Name: wrt-plugins-tizen
Summary: JavaScript plugins for WebRuntime
-Version: 0.4.39
-Release: 1
+Version: 0.4.40
+Release: 0
Group: Development/Libraries
License: Apache License, Version 2.0
Source0: %{name}-%{version}.tar.gz
Callhistory
Systeminfo
NFC
- Log
Filesystem
Alarm
Power
+++ /dev/null
-SET(TARGET_NAME ${log_target})
-SET(DESTINATION_NAME ${log_dest})
-
-set(SRCS_DEVICEINTERACTION
- JSTizenLog.cpp
- plugin_initializer.cpp
-
-)
-
-set(SRCS
- ${SRCS_DEVICEINTERACTION}
-)
-
-include_directories(
- ${INCLUDE_COMMON}
- ${INCLUDES_PLATFORM_IMPLEMENTATION_HAPTICS}
- ${INCLUDES_PLATFORM_IMPLEMENTATION_POWER}
-)
-
-add_library(${TARGET_NAME} SHARED ${SRCS})
-
-target_link_libraries(${TARGET_NAME}
- ${LIBS_COMMON}
-)
-
-INSTALL(TARGETS ${TARGET_NAME} LIBRARY DESTINATION ${DESTINATION_LIB_PREFIX}/${DESTINATION_NAME})
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/config.xml DESTINATION ${DESTINATION_LIB_PREFIX}/${DESTINATION_NAME})
-INSTALL(
- DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ DESTINATION ${DESTINATION_HEADER_PREFIX}/log
- FILES_MATCHING PATTERN "*.h" PATTERN "CMakeFiles" EXCLUDE
-)
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-/**
- * @file JSTizenLog
- * @author Sang-tai Kim(sangtai.kim@samsung.com)
- * @version 0.1
- */
-
-#include <CommonsJavaScript/Converter.h>
-#include <CommonsJavaScript/Validator.h>
-#include <CommonsJavaScript/JSCallbackManager.h>
-#include <CommonsJavaScript/JSUtils.h>
-#include <CommonsJavaScript/JSDOMExceptionFactory.h>
-#include <CommonsJavaScript/Utils.h>
-
-#include "JSTizenLog.h"
-
-#include <dlog.h>
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-
-#define LOG_TAG "TIZEN"
-
-#define EXCEPTION_COLOR "\033[1;31;40m" //bold and red
-#define ASSERT_COLOR "\033[1;31;40m" //bold and red
-
-#define GREEN_COLOR "\033[0;32;40m" //normal and green
-#define NORMAL_COLOR "\033[0m" //system default
-#define RED_COLOR "\033[0;31;40m" //normal and red
-#define YELLOW_COLOR "\033[0;33m" //normal and yellow
-#define BLUE_COLOR "\033[0;34m" //normal and blue
-#define MAGENTA_COLOR "\033[0;35;40m" //normal and magenta
-#define CYAN_COLOR "\033[0;36;40m" //normal and cyan
-
-#define TIZEN_DEBUG(FM,ARG...) {LOGD("%s[%s]%s" FM, GREEN_COLOR, __FUNCTION__, NORMAL_COLOR, ##ARG);}
-#define TIZEN_INFO(FM,ARG...) {LOGI("%s[%s]%s" FM, CYAN_COLOR, __FUNCTION__, NORMAL_COLOR, ##ARG);}
-#define TIZEN_WANING(FM,ARG...) {LOGW("%s[%s]%s" FM, YELLOW_COLOR, __FUNCTION__, NORMAL_COLOR, ##ARG);}
-#define TIZEN_ERROR(FM,ARG...) {LOGE("%s[%s]%s" FM, RED_COLOR, __FUNCTION__, NORMAL_COLOR, ##ARG);}
-
-namespace DeviceAPI {
-namespace Log {
-
-using namespace WrtDeviceApis::Commons;
-using namespace WrtDeviceApis;
-
-JSClassDefinition JSTizenLog::m_classInfo =
-{
- 0,
- kJSClassAttributeNone,
- "log",
- 0,
- NULL,
- m_function,
- initialize,
- finalize,
- NULL, //hasProperty,
- NULL, //getProperty,
- NULL, //setProperty,
- NULL, //DeleteProperty,
- NULL, //GetPropertyNames,
- NULL, //CallAsFunction,
- NULL, //CallAsConstructor,
- NULL, //HasInstance,
- NULL, //ConvertToType
-};
-
-const JSClassRef JSTizenLog::getClassRef() {
- if (!m_jsClassRef) {
- m_jsClassRef = JSClassCreate(&m_classInfo);
- }
- return m_jsClassRef;
-}
-
-const JSClassDefinition* JSTizenLog::getClassInfo() {
- return &m_classInfo;
-}
-
-JSStaticFunction JSTizenLog::m_function[] = {
- { "debug", JSTizenLog::logDebug, kJSPropertyAttributeNone},
- { "info", JSTizenLog::logInfo, kJSPropertyAttributeNone},
- { "warning", JSTizenLog::logWarning, kJSPropertyAttributeNone},
- { "error", JSTizenLog::logError, kJSPropertyAttributeNone},
- { 0, 0, 0 }
-};
-
-JSClassRef JSTizenLog::m_jsClassRef =
- JSClassCreate(JSTizenLog::getClassInfo());
-
-
-void JSTizenLog::initialize(JSContextRef context, JSObjectRef object) {
-// TIZEN_DEBUG("<<<");
-}
-
-void JSTizenLog::finalize(JSObjectRef object) {
-// TIZEN_DEBUG("<<<");
-}
-
-JSValueRef JSTizenLog::logDebug(JSContextRef context, JSObjectRef object,
- JSObjectRef thisObject, size_t argc, const JSValueRef argv[],
- JSValueRef* exception) {
-
- CommonsJavaScript::Converter converter(context);
- std::string pattern = converter.toString(argv[0]);
-
- TIZEN_DEBUG("[%s]", pattern.c_str());
-
- return JSValueMakeUndefined(context);
-}
-
-JSValueRef JSTizenLog::logInfo(JSContextRef context, JSObjectRef object,
- JSObjectRef thisObject, size_t argc, const JSValueRef argv[],
- JSValueRef* exception) {
-
- CommonsJavaScript::Converter converter(context);
- std::string pattern = converter.toString(argv[0]);
-
- TIZEN_INFO("[%s]", pattern.c_str());
-
- return JSValueMakeUndefined(context);
-}
-
-JSValueRef JSTizenLog::logWarning(JSContextRef context, JSObjectRef object,
- JSObjectRef thisObject, size_t argc, const JSValueRef argv[],
- JSValueRef* exception) {
-
- CommonsJavaScript::Converter converter(context);
- std::string pattern = converter.toString(argv[0]);
-
- TIZEN_WANING("[%s]", pattern.c_str());
-
- return JSValueMakeUndefined(context);
-}
-
-JSValueRef JSTizenLog::logError(JSContextRef context, JSObjectRef object,
- JSObjectRef thisObject, size_t argc, const JSValueRef argv[],
- JSValueRef* exception) {
-
- CommonsJavaScript::Converter converter(context);
- std::string pattern = converter.toString(argv[0]);
-
- TIZEN_ERROR("[%s]", pattern.c_str());
-
- return JSValueMakeUndefined(context);
-}
-
-} // Log
-} // DeviceAPI
+++ /dev/null
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-/**
- * @file JSTizenLog.h
- * @author Sang-tai Kim(sangtai.kim@samsung.com)
- * @version 0.1
- */
-
-
-#ifndef _JS_TIZEN_LOG_H_
-#define _JS_TIZEN_LOG_H_
-
-#include <JavaScriptCore/JavaScript.h>
-
-namespace DeviceAPI {
-namespace Log {
-
-class DeviceController;
-
-/**
- * @class JSTizenLog
- * @brief This class is javascript extenstion
- *
- */
-class JSTizenLog
-{
-public:
- static const JSClassDefinition* getClassInfo();
-
- /**
- * Gets class definition reference.
- * @remarks New instance of JSClassRef is created (only once) if none was
- * @remarks set before.
- * @return Class reference.
- */
- static const JSClassRef getClassRef();
-
-private:
- /**
- * The callback invoked when an object is first created.
- */
- static void initialize(JSContextRef context, JSObjectRef object);
-
- /**
- * The callback invoked when an object is finalized.
- */
- static void finalize(JSObjectRef object);
-
- /**
- * This structure describes a statically declared function.
- */
- static JSStaticFunction m_function[];
-
- /**
- * This structure contains properties and callbacks that define a type of object.
- */
- static JSClassDefinition m_classInfo;
-
- /**
- * Class definition reference.
- */
-
- static JSClassRef m_jsClassRef;
-
- static JSValueRef logDebug(JSContextRef context,
- JSObjectRef object,
- JSObjectRef thisObject,
- size_t argc,
- const JSValueRef argv[],
- JSValueRef* exception);
-
- static JSValueRef logInfo(JSContextRef context,
- JSObjectRef object,
- JSObjectRef thisObject,
- size_t argc,
- const JSValueRef argv[],
- JSValueRef* exception);
-
- static JSValueRef logWarning(JSContextRef context,
- JSObjectRef object,
- JSObjectRef thisObject,
- size_t argc,
- const JSValueRef argv[],
- JSValueRef* exception);
-
- static JSValueRef logError(JSContextRef context,
- JSObjectRef object,
- JSObjectRef thisObject,
- size_t argc,
- const JSValueRef argv[],
- JSValueRef* exception);
-
-};
-
-}
-
-}
-
-#endif // _JS_TIZEN_LOG_H_
+++ /dev/null
-<?xml version="1.0" ?>
-<!DOCTYPE plugin-properties SYSTEM "/usr/etc/tizen-apis/config.dtd">
-<plugin-properties>
- <library-name>libwrt-plugins-tizen-log.so</library-name>
- <feature-install-uri>device.install.uri</feature-install-uri>
- <feature-key-cn>SAMSUNG plugin group</feature-key-cn>
- <feature-root-cn>SAMSUNG certificate authority</feature-root-cn>
- <feature-root-fingerprint>AAAABBBBCCCCDDDEEEE0000</feature-root-fingerprint>
-
- <feature-set name="http://tizen.org/privilege/log">
- <api-feature-ref name="http://tizen.org/privilege/log"/>
- </feature-set>
-
- <api-feature>
- <name>http://tizen.org/privilege/log</name>
- <Object name="log">
- <Function name="debug"/>
- <Function name="info"/>
- <Function name="warning"/>
- <Function name="error"/>
- </Object>
- </api-feature>
-</plugin-properties>
+++ /dev/null
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <Commons/plugin_initializer_def.h>
-#include "JSTizenLog.h"
-#include <Logger.h>
-
-#define WRT_JS_EXTENSION_OBJECT_TIZEN "tizen"
-
-namespace DeviceAPI {
-namespace Log {
-
-void on_widget_start_callback(int widgetId)
-{
- LoggerD("[TizenLog] on_widget_start_callback ("<<widgetId<<")");
-}
-
-void on_widget_stop_callback(int widgetId)
-{
- LoggerD("[TizenLog] on_widget_stop_callback ("<<widgetId<<")");
-}
-
-PLUGIN_ON_WIDGET_START(on_widget_start_callback)
-PLUGIN_ON_WIDGET_STOP(on_widget_stop_callback)
-
-PLUGIN_CLASS_MAP_BEGIN
- PLUGIN_CLASS_MAP_ADD_CLASS(WRT_JS_EXTENSION_OBJECT_TIZEN, "log",
- (js_class_template_getter)DeviceAPI::Log::JSTizenLog::getClassRef, NULL)
-PLUGIN_CLASS_MAP_END
-
-} // Log
-} // DeviceAPI
const char* DEVICE_CAPABILITIES_VISION_FACE_RECOGNITION = "visionFaceRecognition";
const char* DEVICE_CAPABILITIES_SECURE_ELEMENT = "secureElement";
const char* DEVICE_CAPABILITIES_NATIVE_OSP_COMPATIBLE = "nativeOspCompatible";
+const char* DEVICE_CAPABILITIES_INPUT_KEY_BACK = "inputKeyBack";
+const char* DEVICE_CAPABILITIES_INPUT_KEY_OPTION = "inputKeyMenu";
}
JSClassRef JSDeviceCapabilitiesInfo::m_classRef = NULL;
{ DEVICE_CAPABILITIES_VISION_FACE_RECOGNITION, getProperty, NULL, kJSPropertyAttributeReadOnly },
{ DEVICE_CAPABILITIES_SECURE_ELEMENT, getProperty, NULL, kJSPropertyAttributeReadOnly },
{ DEVICE_CAPABILITIES_NATIVE_OSP_COMPATIBLE, getProperty, NULL, kJSPropertyAttributeReadOnly },
+ { DEVICE_CAPABILITIES_INPUT_KEY_BACK, getProperty, NULL, kJSPropertyAttributeReadOnly },
+ { DEVICE_CAPABILITIES_INPUT_KEY_OPTION, getProperty, NULL, kJSPropertyAttributeReadOnly },
{ 0, 0, 0, 0 }
};
}
return convert.toJSValueRef(deviceCapabilitiesInfo->sipVoip);
} else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_DUID)) {
- char* duid = NULL;
- if (system_info_get_value_string(SYSTEM_INFO_KEY_DEVICE_UUID, &duid) == SYSTEM_INFO_ERROR_NONE) {
- if (duid) {
- LoggerD("duid : " << duid);
- deviceCapabilitiesInfo->duid = duid;
- free(duid);
- }
- }
return convert.toJSValueRef(deviceCapabilitiesInfo->duid);
} else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_SPEECH_ROCOGNITION)) {
bool speechRecognition = false;
deviceCapabilitiesInfo->nativeOspCompatible = getRegistry("platform.native.osp_compatible");
LoggerD("nativeOspCompatible : " << deviceCapabilitiesInfo->nativeOspCompatible);
return convert.toJSValueRef(deviceCapabilitiesInfo->nativeOspCompatible);
+ } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_INPUT_KEY_BACK)) {
+ bool inputKeyBack = false;
+ if(system_info_get_platform_bool("tizen.org/feature/input.keys.back", &inputKeyBack) == SYSTEM_INFO_ERROR_NONE) {
+ deviceCapabilitiesInfo->inputKeyBack = inputKeyBack;
+ }
+ return convert.toJSValueRef(deviceCapabilitiesInfo->inputKeyBack);
+ } else if (JSStringIsEqualToUTF8CString(propertyName, DEVICE_CAPABILITIES_INPUT_KEY_OPTION)) {
+ bool inputKeyMenu = false;
+ if(system_info_get_platform_bool("tizen.org/feature/input.keys.menu", &inputKeyMenu) == SYSTEM_INFO_ERROR_NONE) {
+ deviceCapabilitiesInfo->inputKeyMenu = inputKeyMenu;
+ }
+ return convert.toJSValueRef(deviceCapabilitiesInfo->inputKeyMenu);
}
}
Catch(Exception)
static JSValueRef getProperty(JSContextRef context, JSObjectRef object, JSStringRef propertyName, JSValueRef* exception);
static bool isExist(const char* path);
static bool getRegistry(std::string key);
-
static JSStaticValue m_properties[];
static JSClassRef m_classRef;
bool visionFaceRecognition;
bool secureElement;
bool nativeOspCompatible;
+ bool inputKeyBack;
+ bool inputKeyMenu;
DeviceCapabilitiesProperties() :
bluetooth(false),
visionQrcodeRecognition(false),
visionFaceRecognition(false),
secureElement(false),
- nativeOspCompatible(false)
+ nativeOspCompatible(false),
+ inputKeyBack(true),
+ inputKeyMenu(true)
{
}
};