Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce tizen_interop package #1

Merged
merged 10 commits into from Aug 9, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
88 changes: 73 additions & 15 deletions .gitignore
@@ -1,21 +1,79 @@
# See https://www.dartlang.org/guides/libraries/private-files
# Miscellaneous
*.class
*.lock
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/

# Files and directories created by pub
# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
**/doc/api/
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
build/
# If you're building an application, you may want to check-in your pubspec.lock
pubspec.lock

# Directory created by dartdoc
# If you don't generate documentation locally you can remove this line.
doc/api/
# Android related
**/android/**/gradle-wrapper.jar
**/android/.gradle
**/android/captures/
**/android/gradlew
**/android/gradlew.bat
**/android/local.properties
**/android/**/GeneratedPluginRegistrant.java

# iOS/XCode related
**/ios/**/*.mode1v3
**/ios/**/*.mode2v3
**/ios/**/*.moved-aside
**/ios/**/*.pbxuser
**/ios/**/*.perspectivev3
**/ios/**/*sync/
**/ios/**/.sconsign.dblite
**/ios/**/.tags*
**/ios/**/.vagrant/
**/ios/**/DerivedData/
**/ios/**/Icon?
**/ios/**/Pods/
**/ios/**/.symlinks/
**/ios/**/profile
**/ios/**/xcuserdata
**/ios/.generated/
**/ios/Flutter/App.framework
**/ios/Flutter/Flutter.framework
**/ios/Flutter/Flutter.podspec
**/ios/Flutter/Generated.xcconfig
**/ios/Flutter/ephemeral
**/ios/Flutter/app.flx
**/ios/Flutter/app.zip
**/ios/Flutter/flutter_assets/
**/ios/Flutter/flutter_export_environment.sh
**/ios/ServiceDefinitions.json
**/ios/Runner/GeneratedPluginRegistrant.*

# Exceptions to above rules.
!**/ios/**/default.mode1v3
!**/ios/**/default.mode2v3
!**/ios/**/default.pbxuser
!**/ios/**/default.perspectivev3

# Avoid committing generated Javascript files:
*.dart.js
*.info.json # Produced by the --dump-info flag.
*.js # When generated by dart2js. Don't specify *.js if your
# project includes source files written in JavaScript.
*.js_
*.js.deps
*.js.map
# Tizen Rootstraps
rootstraps/
25 changes: 25 additions & 0 deletions LICENSE
@@ -0,0 +1,25 @@
Copyright (c) 2021 Samsung Electronics Co., Ltd. All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the names of the copyright holders nor the names of the
WonyoungChoi marked this conversation as resolved.
Show resolved Hide resolved
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22 changes: 22 additions & 0 deletions README.md
@@ -0,0 +1,22 @@
# tizen_interop

This package provides Dart bindings and utility functions for using Tizen native APIs.

## Example

```dart
import 'dart:ffi';
import 'package:ffi/ffi.dart';
import 'package:tizen_interop/4.0/wearable/tizen.dart';

String? getApplicationName() {
String? appName;
using((Arena arena) {
WonyoungChoi marked this conversation as resolved.
Show resolved Hide resolved
Pointer<Pointer<Int8>> namePtr = arena.allocate(sizeOf<Pointer>());
tizen.app_get_name(namePtr);
appName = namePtr.value.toDartString();
malloc.free(namePtr.value);
});
return appName;
}
```
27 changes: 27 additions & 0 deletions build.sh
@@ -0,0 +1,27 @@
#!/usr/bin/env bash
# Copyright 2021 Samsung Electronics Co., Ltd. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

set -e

SCRIPT_DIR=$(dirname $(readlink -f $0))

if [[ -z $TIZEN_STUDIO ]]; then
if [[ -d $HOME/tizen-studio ]]; then
TIZEN_STUDIO=$HOME/tizen-studio
else
echo "Not found the Tizen Studio. Please set the TIZEN_STUDIO environment variable."
exit 1
fi
fi

# Copy rootstraps from Tizen Studio.
OUTDIR=$SCRIPT_DIR/rootstraps
mkdir -p $OUTDIR

cp -fr $TIZEN_STUDIO/platforms/tizen-4.0/wearable/rootstraps/wearable-4.0-device.core $OUTDIR

# Generate binding code.
dart run symgen --config configs/4.0/wearable/symgen.yaml
dart run ffigen --config configs/4.0/wearable/ffigen.yaml
157 changes: 157 additions & 0 deletions configs/4.0/wearable/entrypoints.h
@@ -0,0 +1,157 @@
#define __GLIBC_USE

// Account
#include <account.h>
#include <fido.h>
#include <fido_uaf_authenticator.h>
#include <fido_uaf_client.h>
#include <oauth2.h>
#include <sync_manager.h>
#include <sync_adapter.h>

// Application Framework
#include <app.h>
#include <app_alarm.h>
#include <app_control.h>
#include <app_event.h>
#include <job_scheduler.h>
#include <app_preference.h>
#include <app_resource_manager.h>
#include <app_manager.h>
#include <badge.h>
#include <bundle.h>
#include <data_control.h>
#include <message_port.h>
#include <notification.h>
#include <package_manager.h>
#include <package_archive_info.h>
#include <service_app.h>
#include <watch_app.h>
#include <watch_app_efl.h>
#include <widget_service.h>
#include <widget_errno.h>
#include <widget_viewer_evas.h>

// Content
#include <mime_type.h>
#include <media_content.h>

// Context
#include <activity_recognition.h>
#include <wearable/context_history.h>
#include <gesture_recognition.h>

// Location
#include <locations.h>
#include <maps_service.h>

// Messaging
#include <email.h>
#include <messages.h>
#include <push-service.h>

// Multimedia
#include <audio_io.h>
#include <camera.h>
#include <image_util.h>
#include <media_codec.h>
#include <media_controller_server.h>
#include <media_controller_client.h>
#include <mediademuxer.h>
#include <mediamuxer.h>
#include <media_streamer.h>
#include <media_packet.h>
#include <media_format.h>
#include <mv_barcode.h>
#include <mv_common.h>
#include <mv_face.h>
#include <mv_image.h>
#include <mv_surveillance.h>
#include <metadata_editor.h>
#include <metadata_extractor.h>
#include <player.h>
#include <radio.h>
#include <recorder.h>
#include <sound_manager.h>
#include <sound_pool.h>
#include <streamrecorder.h>
#include <thumbnail_util.h>
#include <tone_player.h>
#include <wav_player.h>

// Network
#include <asp.h>
#include <bluetooth.h>
#include <net_connection.h>
#include <dns-sd.h>
#include <http.h>
#include <iotcon.h>
#include <nfc.h>
#include <ssdp.h>
#include <stc.h>
#include <smartcard.h>
#include <wifi-manager.h>

// Security
#include <csr-engine-manager.h>
#include <csr-content-screening.h>
#include <csr-content-screening-types.h>
#include <csr-error.h>
#include <csr-web-protection.h>
#include <csr-web-protection-types.h>
#include <dpm/password.h>
#include <dpm/device-policy-manager.h>
#include <dpm/restriction.h>
#include <dpm/security.h>
#include <dpm/zone.h>
#include <ckmc/ckmc-manager.h>
#include <ckmc/ckmc-type.h>
#include <privacy_privilege_manager.h>
#include <privilege_information.h>
#include <yaca/yaca_crypto.h>
#include <yaca/yaca_encrypt.h>
#include <yaca/yaca_seal.h>
#include <yaca/yaca_types.h>
#include <yaca/yaca_error.h>
#include <yaca/yaca_sign.h>
#include <yaca/yaca_digest.h>
#include <yaca/yaca_key.h>
#include <yaca/yaca_rsa.h>
#include <yaca/yaca_simple.h>

// Social
#include <calendar.h>
#include <contacts.h>
#include <phone_number.h>

// System
#include <device/battery.h>
#include <device/callback.h>
#include <device/display.h>
#include <device/haptic.h>
#include <device/led.h>
#include <device/power.h>
#include <device/ir.h>
#include <dlog.h>
#include <feedback.h>
#include <media_key.h>
#include <runtime_info.h>
#include <sensor.h>
#include <storage.h>
#include <system_info.h>
#include <system_settings.h>
#include <trace.h>

// Telephony
#include <telephony.h>

// UIX
#include <inputmethod.h>
#include <inputmethod_manager.h>
#include <stt.h>
#include <stte.h>
#include <tts.h>
#include <ttse.h>
#include <voice_control.h>