tizen 2.4 release accepted/tizen_2.4_mobile tizen_2.4 accepted/tizen/2.4/mobile/20151029.025037 submit/tizen_2.4/20151028.065630 tizen_2.4_mobile_release
authorjk7744.park <jk7744.park@samsung.com>
Sat, 24 Oct 2015 09:06:41 +0000 (18:06 +0900)
committerjk7744.park <jk7744.park@samsung.com>
Sat, 24 Oct 2015 09:06:41 +0000 (18:06 +0900)
700 files changed:
CMakeLists.txt [changed mode: 0644->0755]
LICENSE.APLv2 [moved from LICENSE with 100% similarity]
LICENSE.BSD-2.0 [new file with mode: 0644]
packaging/wrt-plugins-common.spec [changed mode: 0644->0755]
pkgconfigs/wrt-dispatch-event.pc.in [changed mode: 0644->0755]
pkgconfigs/wrt-plugin-loading.pc.in [changed mode: 0644->0755]
pkgconfigs/wrt-plugins-commons-javascript.pc.in [changed mode: 0644->0755]
pkgconfigs/wrt-plugins-commons.pc.in [changed mode: 0644->0755]
pkgconfigs/wrt-plugins-filesystem.pc.in [changed mode: 0644->0755]
pkgconfigs/wrt-plugins-ipc-message.pc.in [changed mode: 0644->0755]
pkgconfigs/wrt-plugins-localstorage.pc.in [new file with mode: 0755]
pkgconfigs/wrt-plugins-plugin-manager.pc.in [changed mode: 0644->0755]
pkgconfigs/wrt-plugins-widget-interface.pc.in [changed mode: 0644->0755]
pkgconfigs/wrt-plugins-widget.pc.in [new file with mode: 0755]
pkgconfigs/wrt-plugins-widgetdb.pc.in [changed mode: 0644->0755]
pkgconfigs/wrt-popup-ace-runner.pc.in [deleted file]
pkgconfigs/wrt-popup-runner.pc.in [changed mode: 0644->0755]
pkgconfigs/wrt-popup-wrt-runner.pc.in [changed mode: 0644->0755]
src/CMakeLists.txt [new file with mode: 0755]
src/Commons/Base64.cpp [moved from src_wearable/Commons/Base64.cpp with 100% similarity]
src/Commons/Base64.h [moved from src_wearable/Commons/Base64.h with 100% similarity]
src/Commons/CMakeLists.txt [moved from src_mobile/Commons/CMakeLists.txt with 51% similarity]
src/Commons/DESCRIPTION [moved from src_wearable/CommonsJavaScript/DESCRIPTION with 100% similarity]
src/Commons/Dimension.h [moved from src_wearable/Commons/Dimension.h with 100% similarity]
src/Commons/Emitters.h [moved from src_mobile/Commons/Emitters.h with 88% similarity]
src/Commons/EventListener.h [moved from src_mobile/Commons/EventListener.h with 81% similarity]
src/Commons/EventReceiver.h [moved from src_mobile/Commons/EventReceiver.h with 81% similarity]
src/Commons/Exception.h [moved from src_mobile/Commons/Exception.h with 70% similarity]
src/Commons/FunctionDeclaration.h [moved from src_wearable/Commons/FunctionDeclaration.h with 84% similarity]
src/Commons/FunctionDefinition.cpp [moved from src_wearable/Commons/FunctionDefinition.cpp with 100% similarity]
src/Commons/FunctionDefinition.h [moved from src_wearable/Commons/FunctionDefinition.h with 100% similarity]
src/Commons/IEvent.h [moved from src_mobile/Commons/IEvent.h with 90% similarity]
src/Commons/IExternEventCanceler.h [moved from src_mobile/Commons/IExternEventCanceler.h with 91% similarity]
src/Commons/JSObject.cpp [moved from src_wearable/Commons/JSObject.cpp with 100% similarity]
src/Commons/JSObject.h [moved from src_mobile/Commons/JSObject.h with 94% similarity]
src/Commons/JSObjectDeclaration.cpp [moved from src_wearable/Commons/JSObjectDeclaration.cpp with 100% similarity]
src/Commons/JSObjectDeclaration.h [moved from src_mobile/Commons/JSObjectDeclaration.h with 95% similarity]
src/Commons/ListenerEvent.h [moved from src_mobile/Commons/ListenerEvent.h with 88% similarity]
src/Commons/ListenerEventEmitter.h [moved from src_wearable/Commons/ListenerEventEmitter.h with 91% similarity]
src/Commons/Range.h [moved from src_wearable/Commons/Range.h with 100% similarity]
src/Commons/Regex.cpp [moved from src_wearable/Commons/Regex.cpp with 100% similarity]
src/Commons/Regex.h [moved from src_wearable/Commons/Regex.h with 100% similarity]
src/Commons/RegexPatterns.h [moved from src_wearable/Commons/RegexPatterns.h with 100% similarity]
src/Commons/RegexUtils.cpp [moved from src_wearable/Commons/RegexUtils.cpp with 100% similarity]
src/Commons/RegexUtils.h [moved from src_wearable/Commons/RegexUtils.h with 100% similarity]
src/Commons/StaticAssert.h [moved from src_wearable/Commons/StaticAssert.h with 100% similarity]
src/Commons/StringBuilder.cpp [moved from src_wearable/Commons/StringBuilder.cpp with 100% similarity]
src/Commons/StringBuilder.h [moved from src_wearable/Commons/StringBuilder.h with 100% similarity]
src/Commons/StringUtils.cpp [moved from src_wearable/Commons/StringUtils.cpp with 100% similarity]
src/Commons/StringUtils.h [moved from src_mobile/Commons/StringUtils.h with 98% similarity]
src/Commons/ThreadPool.cpp [moved from src_mobile/Commons/ThreadPool.cpp with 99% similarity]
src/Commons/ThreadPool.h [moved from src_mobile/Commons/ThreadPool.h with 98% similarity]
src/Commons/TypeTraits.h [moved from src_wearable/Commons/TypeTraits.h with 88% similarity]
src/Commons/TypesDeclaration.h [moved from src_wearable/Commons/TypesDeclaration.h with 100% similarity]
src/Commons/WrtAccess/WrtAccess.cpp [new file with mode: 0644]
src/Commons/WrtAccess/WrtAccess.h [moved from src_wearable/Commons/WrtAccess/WrtAccess.h with 75% similarity]
src/Commons/WrtAccess/config.cmake [moved from src_wearable/Commons/WrtAccess/config.cmake with 100% similarity]
src/Commons/plugin_initializer_def.h [moved from src_wearable/Commons/plugin_initializer_def.h with 97% similarity]
src/CommonsJavaScript/CMakeLists.txt [moved from src_wearable/CommonsJavaScript/CMakeLists.txt with 60% similarity]
src/CommonsJavaScript/Converter.cpp [moved from src_wearable/CommonsJavaScript/Converter.cpp with 95% similarity]
src/CommonsJavaScript/Converter.h [moved from src_mobile/CommonsJavaScript/Converter.h with 89% similarity]
src/CommonsJavaScript/DESCRIPTION [moved from src_wearable/Commons/DESCRIPTION with 100% similarity]
src/CommonsJavaScript/DOMExceptionData.cpp [moved from src_wearable/CommonsJavaScript/DOMExceptionData.cpp with 100% similarity]
src/CommonsJavaScript/DOMExceptionData.h [moved from src_wearable/CommonsJavaScript/DOMExceptionData.h with 93% similarity]
src/CommonsJavaScript/JSCallbackManager.cpp [moved from src_wearable/CommonsJavaScript/JSCallbackManager.cpp with 92% similarity]
src/CommonsJavaScript/JSCallbackManager.h [moved from src_wearable/CommonsJavaScript/JSCallbackManager.h with 96% similarity]
src/CommonsJavaScript/JSDOMException.cpp [moved from src_wearable/CommonsJavaScript/JSDOMException.cpp with 100% similarity]
src/CommonsJavaScript/JSDOMException.h [moved from src_wearable/CommonsJavaScript/JSDOMException.h with 100% similarity]
src/CommonsJavaScript/JSDOMExceptionFactory.cpp [moved from src_wearable/CommonsJavaScript/JSDOMExceptionFactory.cpp with 100% similarity]
src/CommonsJavaScript/JSDOMExceptionFactory.h [moved from src_wearable/CommonsJavaScript/JSDOMExceptionFactory.h with 100% similarity]
src/CommonsJavaScript/JSLifeManager.cpp [new file with mode: 0755]
src/CommonsJavaScript/JSLifeManager.h [new file with mode: 0755]
src/CommonsJavaScript/JSPendingOperation.cpp [moved from src_mobile/CommonsJavaScript/JSPendingOperation.cpp with 96% similarity]
src/CommonsJavaScript/JSPendingOperation.h [moved from src_mobile/CommonsJavaScript/JSPendingOperation.h with 98% similarity]
src/CommonsJavaScript/JSPendingOperationPrivateObject.h [moved from src_mobile/CommonsJavaScript/JSPendingOperationPrivateObject.h with 85% similarity]
src/CommonsJavaScript/JSUtils.cpp [moved from src_wearable/CommonsJavaScript/JSUtils.cpp with 100% similarity]
src/CommonsJavaScript/JSUtils.h [moved from src_wearable/CommonsJavaScript/JSUtils.h with 100% similarity]
src/CommonsJavaScript/PrivateObject.h [moved from src_mobile/CommonsJavaScript/PrivateObject.h with 96% similarity]
src/CommonsJavaScript/ScopedJSStringRef.cpp [moved from src_wearable/CommonsJavaScript/ScopedJSStringRef.cpp with 100% similarity]
src/CommonsJavaScript/ScopedJSStringRef.h [moved from src_wearable/CommonsJavaScript/ScopedJSStringRef.h with 100% similarity]
src/CommonsJavaScript/Security/SecurityFunctionDeclaration.cpp [moved from src_wearable/CommonsJavaScript/Security/SecurityFunctionDeclaration.cpp with 100% similarity]
src/CommonsJavaScript/Security/SecurityFunctionDeclaration.h [moved from src_wearable/CommonsJavaScript/Security/SecurityFunctionDeclaration.h with 100% similarity]
src/CommonsJavaScript/Security/StaticDeclaration.h [moved from src_wearable/CommonsJavaScript/Security/StaticDeclaration.h with 100% similarity]
src/CommonsJavaScript/SecurityExceptions.h [moved from src_wearable/CommonsJavaScript/SecurityExceptions.h with 100% similarity]
src/CommonsJavaScript/SupportPendingOperation.h [moved from src_wearable/CommonsJavaScript/SupportPendingOperation.h with 100% similarity]
src/CommonsJavaScript/Utils.h [moved from src_mobile/CommonsJavaScript/Utils.h with 91% similarity]
src/CommonsJavaScript/Validator.cpp [moved from src_wearable/CommonsJavaScript/Validator.cpp with 100% similarity]
src/CommonsJavaScript/Validator.h [moved from src_mobile/CommonsJavaScript/Validator.h with 97% similarity]
src/DESCRIPTION [moved from src_wearable/DESCRIPTION with 100% similarity]
src/dispatch-event/CMakeLists.txt [moved from src_mobile/dispatch-event/CMakeLists.txt with 89% similarity]
src/dispatch-event/dispatch_event_support.cpp [moved from src_wearable/dispatch-event/dispatch_event_support.cpp with 100% similarity]
src/dispatch-event/dispatch_event_support.h [moved from src_wearable/dispatch-event/dispatch_event_support.h with 97% similarity]
src/js-overlay/CMakeLists.txt [moved from src_mobile/js-overlay/CMakeLists.txt with 90% similarity]
src/js-overlay/deprecated/JSClass/JSSoftKeyboardChangeEvent.cpp [moved from src_wearable/js-overlay/deprecated/JSClass/JSSoftKeyboardChangeEvent.cpp with 100% similarity]
src/js-overlay/deprecated/JSClass/JSSoftKeyboardChangeEvent.h [moved from src_wearable/js-overlay/deprecated/JSClass/JSSoftKeyboardChangeEvent.h with 100% similarity]
src/js-overlay/deprecated/JSClass/JSStorageEvent.cpp [moved from src_wearable/js-overlay/deprecated/JSClass/JSStorageEvent.cpp with 100% similarity]
src/js-overlay/deprecated/JSClass/JSStorageEvent.h [moved from src_wearable/js-overlay/deprecated/JSClass/JSStorageEvent.h with 100% similarity]
src/js-overlay/deprecated/JSClass/JSTizenServiceEvent.cpp [moved from src_wearable/js-overlay/deprecated/JSClass/JSTizenServiceEvent.cpp with 100% similarity]
src/js-overlay/deprecated/JSClass/JSTizenServiceEvent.h [moved from src_wearable/js-overlay/deprecated/JSClass/JSTizenServiceEvent.h with 100% similarity]
src/js-overlay/deprecated/js_iframe_support.cpp [moved from src_wearable/js-overlay/deprecated/js_iframe_support.cpp with 100% similarity]
src/js-overlay/deprecated/js_iframe_support.h [moved from src_wearable/js-overlay/deprecated/js_iframe_support.h with 100% similarity]
src/js-overlay/deprecated/js_overlay_addEventListener.cpp [moved from src_wearable/js-overlay/deprecated/js_overlay_addEventListener.cpp with 95% similarity]
src/js-overlay/deprecated/js_overlay_addEventListener.h [moved from src_wearable/js-overlay/deprecated/js_overlay_addEventListener.h with 100% similarity]
src/js-overlay/deprecated/js_overlay_support.cpp [moved from src_wearable/js-overlay/deprecated/js_overlay_support.cpp with 96% similarity]
src/js-overlay/deprecated/js_overlay_support.h [moved from src_wearable/js-overlay/deprecated/js_overlay_support.h with 100% similarity]
src/js-overlay/js_function_manager.cpp [moved from src_wearable/js-overlay/js_function_manager.cpp with 100% similarity]
src/js-overlay/js_function_manager.h [moved from src_wearable/js-overlay/js_function_manager.h with 100% similarity]
src/js-overlay/js_overlay_functions.cpp [moved from src_wearable/js-overlay/js_overlay_functions.cpp with 91% similarity]
src/js-overlay/js_overlay_functions.h [moved from src_wearable/js-overlay/js_overlay_functions.h with 100% similarity]
src/js-overlay/js_overlay_types.h [moved from src_wearable/js-overlay/js_overlay_types.h with 100% similarity]
src/modules/API/CMakeLists.txt [moved from src_mobile/standards/CMakeLists.txt with 72% similarity]
src/modules/API/DESCRIPTION [moved from src_wearable/modules/API/DESCRIPTION with 100% similarity]
src/modules/API/LocalStorage/ILocalStorage.h [moved from src_wearable/modules/API/LocalStorage/ILocalStorage.h with 96% similarity]
src/modules/API/LocalStorage/LocalStorageMgr.cpp [moved from src_mobile/modules/API/LocalStorage/LocalStorageMgr.cpp with 95% similarity]
src/modules/API/LocalStorage/LocalStorageMgr.h [moved from src_mobile/modules/API/LocalStorage/LocalStorageMgr.h with 91% similarity]
src/modules/API/LocalStorage/config.cmake [moved from src_wearable/modules/API/LocalStorage/config.cmake with 100% similarity]
src/modules/API/PluginManager/IPluginManager.h [moved from src_wearable/modules/API/PluginManager/IPluginManager.h with 95% similarity]
src/modules/API/PluginManager/PluginManagerFactory.cpp [moved from src_mobile/modules/API/PluginManager/PluginManagerFactory.cpp with 97% similarity]
src/modules/API/PluginManager/PluginManagerFactory.h [moved from src_wearable/modules/API/PluginManager/PluginManagerFactory.h with 94% similarity]
src/modules/API/PluginManager/config.cmake [moved from src_wearable/modules/API/PluginManager/config.cmake with 100% similarity]
src/modules/API/SoftKeyboardChangeEvent/ISoftKeyboardChangeEvent.h [moved from src_wearable/modules/API/SoftKeyboardChangeEvent/ISoftKeyboardChangeEvent.h with 100% similarity]
src/modules/API/SoftKeyboardChangeEvent/SoftKeyboardChangeEvent.cpp [moved from src_wearable/modules/API/SoftKeyboardChangeEvent/SoftKeyboardChangeEvent.cpp with 100% similarity]
src/modules/API/SoftKeyboardChangeEvent/SoftKeyboardChangeEvent.h [moved from src_wearable/modules/API/SoftKeyboardChangeEvent/SoftKeyboardChangeEvent.h with 100% similarity]
src/modules/API/SoftKeyboardChangeEvent/config.cmake [moved from src_wearable/modules/API/SoftKeyboardChangeEvent/config.cmake with 100% similarity]
src/modules/API/StorageEvent/IStorageEvent.h [moved from src_wearable/modules/API/StorageEvent/IStorageEvent.h with 94% similarity]
src/modules/API/StorageEvent/StorageEvent.cpp [moved from src_mobile/modules/API/StorageEvent/StorageEvent.cpp with 98% similarity]
src/modules/API/StorageEvent/StorageEvent.h [moved from src_wearable/modules/API/StorageEvent/StorageEvent.h with 100% similarity]
src/modules/API/StorageEvent/StorageEventMgr.cpp [moved from src_wearable/modules/API/StorageEvent/StorageEventMgr.cpp with 100% similarity]
src/modules/API/StorageEvent/StorageEventMgr.h [moved from src_wearable/modules/API/StorageEvent/StorageEventMgr.h with 100% similarity]
src/modules/API/StorageEvent/config.cmake [moved from src_wearable/modules/API/StorageEvent/config.cmake with 100% similarity]
src/modules/API/TizenServiceEvent/ITizenServiceEvent.h [moved from src_mobile/modules/API/TizenServiceEvent/ITizenServiceEvent.h with 93% similarity]
src/modules/API/TizenServiceEvent/TizenServiceEvent.cpp [moved from src_wearable/modules/API/TizenServiceEvent/TizenServiceEvent.cpp with 100% similarity]
src/modules/API/TizenServiceEvent/TizenServiceEvent.h [moved from src_wearable/modules/API/TizenServiceEvent/TizenServiceEvent.h with 100% similarity]
src/modules/API/TizenServiceEvent/config.cmake [moved from src_wearable/modules/API/TizenServiceEvent/config.cmake with 100% similarity]
src/modules/API/Widget/IWidget.h [moved from src_mobile/modules/API/Widget/IWidget.h with 98% similarity]
src/modules/API/Widget/WidgetFactory.cpp [moved from src_wearable/modules/API/Widget/WidgetFactory.cpp with 100% similarity]
src/modules/API/Widget/WidgetFactory.h [moved from src_wearable/modules/API/Widget/WidgetFactory.h with 100% similarity]
src/modules/API/Widget/config.cmake [moved from src_wearable/modules/API/Widget/config.cmake with 100% similarity]
src/modules/API/WidgetDB/IWidgetDB.h [moved from src_mobile/modules/API/WidgetDB/IWidgetDB.h with 93% similarity]
src/modules/API/WidgetDB/IWidgetFeature.h [moved from src_wearable/modules/API/WidgetDB/IWidgetFeature.h with 93% similarity]
src/modules/API/WidgetDB/WidgetDBMgr.cpp [moved from src_mobile/modules/API/WidgetDB/WidgetDBMgr.cpp with 95% similarity]
src/modules/API/WidgetDB/WidgetDBMgr.h [moved from src_mobile/modules/API/WidgetDB/WidgetDBMgr.h with 95% similarity]
src/modules/API/WidgetDB/config.cmake [moved from src_wearable/modules/API/WidgetDB/config.cmake with 100% similarity]
src/modules/API/config.cmake [moved from src_wearable/modules/tizen/config.cmake with 100% similarity]
src/modules/CMakeLists.txt [moved from src_wearable/modules/CMakeLists.txt with 87% similarity]
src/modules/DESCRIPTION [moved from src_wearable/modules/DESCRIPTION with 100% similarity]
src/modules/packages/CMakeLists.txt [new file with mode: 0644]
src/modules/packages/LocalStorage/CMakeLists.txt [moved from src_mobile/modules/packages/WidgetDB/CMakeLists.txt with 57% similarity, mode: 0755]
src/modules/packages/PluginManager/CMakeLists.txt [moved from src_wearable/modules/packages/PluginManager/CMakeLists.txt with 73% similarity]
src/modules/packages/SoftKeyboardChangeEvent/CMakeLists.txt [moved from src_mobile/modules/packages/SoftKeyboardChangeEvent/CMakeLists.txt with 79% similarity]
src/modules/packages/StorageEvent/CMakeLists.txt [moved from src_mobile/modules/packages/StorageEvent/CMakeLists.txt with 75% similarity]
src/modules/packages/TizenServiceEvent/CMakeLists.txt [moved from src_wearable/modules/packages/TizenServiceEvent/CMakeLists.txt with 79% similarity]
src/modules/packages/Widget/CMakeLists.txt [moved from src_wearable/modules/packages/Widget/CMakeLists.txt with 56% similarity, mode: 0755]
src/modules/packages/WidgetDB/CMakeLists.txt [moved from src_wearable/modules/packages/WidgetDB/CMakeLists.txt with 71% similarity]
src/modules/packages/WidgetInterface/CMakeLists.txt [moved from src_mobile/modules/packages/WidgetInterface/CMakeLists.txt with 70% similarity]
src/modules/tizen/CMakeLists.txt [moved from src_mobile/modules/tizen/CMakeLists.txt with 84% similarity]
src/modules/tizen/DESCRIPTION [moved from src_wearable/modules/tizen/DESCRIPTION with 100% similarity]
src/modules/tizen/PluginManager/PluginManager.cpp [moved from src_wearable/modules/tizen/PluginManager/PluginManager.cpp with 94% similarity, mode: 0755]
src/modules/tizen/PluginManager/PluginManager.h [moved from src_wearable/modules/tizen/PluginManager/PluginManager.h with 94% similarity]
src/modules/tizen/PluginManager/config.cmake [moved from src_wearable/modules/tizen/PluginManager/config.cmake with 100% similarity]
src/modules/tizen/Widget/Property.h [moved from src_wearable/modules/tizen/Widget/Property.h with 100% similarity]
src/modules/tizen/Widget/Widget.cpp [moved from src_wearable/modules/tizen/Widget/Widget.cpp with 100% similarity]
src/modules/tizen/Widget/Widget.h [moved from src_mobile/modules/tizen/Widget/Widget.h with 96% similarity]
src/modules/tizen/Widget/config.cmake [moved from src_wearable/modules/tizen/Widget/config.cmake with 100% similarity]
src/modules/tizen/WidgetDB/WidgetDB.cpp [moved from src_wearable/modules/tizen/WidgetDB/WidgetDB.cpp with 97% similarity]
src/modules/tizen/WidgetDB/WidgetDB.h [moved from src_mobile/modules/tizen/WidgetDB/WidgetDB.h with 91% similarity]
src/modules/tizen/WidgetDB/WidgetFeature.cpp [moved from src_wearable/modules/tizen/WidgetDB/WidgetFeature.cpp with 100% similarity]
src/modules/tizen/WidgetDB/WidgetFeature.h [moved from src_wearable/modules/tizen/WidgetDB/WidgetFeature.h with 100% similarity]
src/modules/tizen/WidgetDB/config.cmake [moved from src_wearable/modules/tizen/WidgetDB/config.cmake with 100% similarity]
src/modules/tizen/WidgetInterface/CMakeLists.txt [new file with mode: 0644]
src/modules/tizen/WidgetInterface/WidgetInterface.cpp [moved from src_wearable/modules/tizen/WidgetInterface/WidgetInterface.cpp with 97% similarity]
src/modules/tizen/WidgetInterface/WidgetInterface.h [moved from src_wearable/modules/tizen/WidgetInterface/WidgetInterface.h with 94% similarity]
src/modules/tizen/WidgetInterface/config.cmake [moved from src_wearable/modules/tizen/WidgetInterface/config.cmake with 100% similarity]
src/modules/tizen/config.cmake [moved from src_wearable/modules/API/config.cmake with 100% similarity]
src/plugin-loading/CMakeLists.txt [moved from src_mobile/plugin-loading/CMakeLists.txt with 80% similarity]
src/plugin-loading/explorer.cpp [moved from src_wearable/plugin-loading/explorer.cpp with 97% similarity]
src/plugin-loading/explorer.h [moved from src_mobile/plugin-loading/explorer.h with 97% similarity]
src/plugin-loading/javascript_interface.cpp [moved from src_wearable/plugin-loading/javascript_interface.cpp with 98% similarity]
src/plugin-loading/javascript_interface.h [moved from src_wearable/plugin-loading/javascript_interface.h with 100% similarity]
src/plugin-loading/js_page_session.cpp [moved from src_wearable/plugin-loading/js_page_session.cpp with 96% similarity]
src/plugin-loading/js_page_session.h [moved from src_wearable/plugin-loading/js_page_session.h with 97% similarity]
src/plugin-loading/js_types.h [moved from src_wearable/plugin-loading/js_types.h with 100% similarity]
src/plugin-loading/plugin.cpp [moved from src_wearable/plugin-loading/plugin.cpp with 98% similarity]
src/plugin-loading/plugin.h [moved from src_mobile/plugin-loading/plugin.h with 91% similarity]
src/plugin-loading/plugin_container_support.cpp [moved from src_mobile/plugin-loading/plugin_container_support.cpp with 91% similarity]
src/plugin-loading/plugin_container_support.h [moved from src_wearable/plugin-loading/plugin_container_support.h with 90% similarity]
src/plugin-loading/plugin_iframe_support.cpp [moved from src_wearable/plugin-loading/plugin_iframe_support.cpp with 100% similarity]
src/plugin-loading/plugin_iframe_support.h [moved from src_wearable/plugin-loading/plugin_iframe_support.h with 100% similarity]
src/plugin-loading/plugin_logic.cpp [moved from src_wearable/plugin-loading/plugin_logic.cpp with 95% similarity, mode: 0755]
src/plugin-loading/plugin_logic.h [moved from src_mobile/plugin-loading/plugin_logic.h with 88% similarity]
src/plugin-loading/plugin_model.cpp [moved from src_wearable/plugin-loading/plugin_model.cpp with 100% similarity]
src/plugin-loading/plugin_model.h [moved from src_mobile/plugin-loading/plugin_model.h with 86% similarity]
src/plugin-loading/plugin_property_support.cpp [moved from src_wearable/plugin-loading/plugin_property_support.cpp with 100% similarity]
src/plugin-loading/plugin_property_support.h [moved from src_wearable/plugin-loading/plugin_property_support.h with 100% similarity]
src/plugins-api-support/CMakeLists.txt [moved from src_mobile/plugins-api-support/CMakeLists.txt with 90% similarity]
src/plugins-api-support/CallbackSupport.h [moved from src_wearable/plugins-api-support/CallbackSupport.h with 100% similarity]
src/plugins-api-support/ExportedApi.h [moved from src_wearable/plugins-api-support/ExportedApi.h with 96% similarity]
src/plugins-api-support/IObject.h [moved from src_wearable/plugins-api-support/IObject.h with 100% similarity]
src/plugins-api-support/IObject_cast.h [moved from src_wearable/plugins-api-support/IObject_cast.h with 100% similarity]
src/plugins-api-support/Object.cpp [moved from src_mobile/plugins-api-support/Object.cpp with 99% similarity]
src/plugins-api-support/Object.h [moved from src_wearable/plugins-api-support/Object.h with 100% similarity]
src/plugins-api-support/ObjectFactory.cpp [moved from src_wearable/plugins-api-support/ObjectFactory.cpp with 100% similarity]
src/plugins-api-support/ObjectFactory.h [moved from src_wearable/plugins-api-support/ObjectFactory.h with 100% similarity]
src/plugins-api-support/Plugin.cpp [moved from src_wearable/plugins-api-support/Plugin.cpp with 100% similarity]
src/plugins-api-support/Plugin.h [moved from src_wearable/plugins-api-support/Plugin.h with 100% similarity]
src/plugins-api-support/PluginRegistration.cpp [moved from src_wearable/plugins-api-support/PluginRegistration.cpp with 100% similarity]
src/plugins-api-support/PluginRegistration.h [moved from src_wearable/plugins-api-support/PluginRegistration.h with 100% similarity]
src/plugins-api-support/PluginRegistrationImpl.h [moved from src_wearable/plugins-api-support/PluginRegistrationImpl.h with 100% similarity]
src/plugins-api-support/PluginRegistry.cpp [moved from src_wearable/plugins-api-support/PluginRegistry.cpp with 98% similarity]
src/plugins-api-support/PluginRegistry.h [moved from src_wearable/plugins-api-support/PluginRegistry.h with 100% similarity]
src/plugins-api-support/PluginSignals.h [moved from src_wearable/plugins-api-support/PluginSignals.h with 100% similarity]
src/plugins-api-support/SignalSignature.h [moved from src_wearable/plugins-api-support/SignalSignature.h with 100% similarity]
src/plugins-api-support/SignalsSupport.h [moved from src_wearable/plugins-api-support/SignalsSupport.h with 100% similarity]
src/plugins-api-support/detail/traits.h [moved from src_wearable/plugins-api-support/detail/traits.h with 100% similarity]
src/plugins-api-support/js_types.h [moved from src_wearable/plugins-api-support/js_types.h with 100% similarity]
src/plugins-api-support/traits.h [moved from src_wearable/plugins-api-support/traits.h with 100% similarity]
src/plugins-api-support/tuple.h [moved from src_wearable/plugins-api-support/tuple.h with 100% similarity]
src/plugins-installer/CMakeLists.txt [moved from src_wearable/plugins-installer/CMakeLists.txt with 88% similarity]
src/plugins-installer/DESCRIPTION [moved from src_wearable/plugins-installer/DESCRIPTION with 100% similarity]
src/plugins-installer/plugin_installer.cpp [moved from src_wearable/plugins-installer/plugin_installer.cpp with 93% similarity]
src/plugins-installer/plugin_installer.h [moved from src_wearable/plugins-installer/plugin_installer.h with 94% similarity]
src/plugins-installer/plugin_installer_errors.h [moved from src_wearable/plugins-installer/plugin_installer_errors.h with 100% similarity]
src/plugins-installer/plugin_installer_types.h [moved from src_wearable/plugins-installer/plugin_installer_types.h with 100% similarity]
src/plugins-installer/plugin_metafile_reader.cpp [moved from src_wearable/plugins-installer/plugin_metafile_reader.cpp with 100% similarity]
src/plugins-installer/plugin_metafile_reader.h [moved from src_wearable/plugins-installer/plugin_metafile_reader.h with 100% similarity]
src/plugins-installer/plugin_objects.cpp [moved from src_mobile/plugins-installer/plugin_objects.cpp with 82% similarity]
src/plugins-installer/plugin_objects.h [moved from src_mobile/plugins-installer/plugin_objects.h with 95% similarity]
src/plugins-installer/plugin_utils.cpp [moved from src_wearable/plugins-installer/plugin_utils.cpp with 81% similarity]
src/plugins-installer/plugin_utils.h [moved from src_wearable/plugins-installer/plugin_utils.h with 100% similarity]
src/plugins-installer/wrt_plugins_installer.cpp [moved from src_wearable/plugins-installer/wrt_plugins_installer.cpp with 81% similarity]
src/plugins-ipc-message/CMakeLists.txt [moved from src_mobile/plugins-ipc-message/CMakeLists.txt with 84% similarity, mode: 0755]
src/plugins-ipc-message/ipc_message_support.cpp [moved from src_mobile/plugins-ipc-message/ipc_message_support.cpp with 78% similarity, mode: 0755]
src/plugins-ipc-message/ipc_message_support.h [moved from src_wearable/plugins-ipc-message/ipc_message_support.h with 92% similarity, mode: 0755]
src/standards/CMakeLists.txt [moved from src_wearable/standards/CMakeLists.txt with 96% similarity]
src/standards/W3C/CMakeLists.txt [moved from src_wearable/standards/W3C/CMakeLists.txt with 97% similarity]
src/standards/W3C/DESCRIPTION [moved from src_wearable/standards/W3C/DESCRIPTION with 100% similarity]
src/standards/W3C/Widget/CMakeLists.txt [moved from src_wearable/standards/W3C/Widget/CMakeLists.txt with 75% similarity]
src/standards/W3C/Widget/JSPreferences.cpp [moved from src_wearable/standards/W3C/Widget/JSPreferences.cpp with 99% similarity]
src/standards/W3C/Widget/JSPreferences.h [moved from src_wearable/standards/W3C/Widget/JSPreferences.h with 100% similarity]
src/standards/W3C/Widget/JSWidget.cpp [moved from src_wearable/standards/W3C/Widget/JSWidget.cpp with 97% similarity]
src/standards/W3C/Widget/JSWidget.h [moved from src_wearable/standards/W3C/Widget/JSWidget.h with 100% similarity]
src/standards/W3C/Widget/plugin_config.cpp [moved from src_wearable/standards/W3C/Widget/plugin_config.cpp with 100% similarity]
src/standards/W3C/Widget/plugin_config.h [moved from src_wearable/standards/W3C/Widget/plugin_config.h with 100% similarity]
src/standards/W3C/Widget/plugin_initializer.cpp [moved from src_wearable/standards/W3C/Widget/plugin_initializer.cpp with 93% similarity]
src/wrt-popup/CMakeLists.txt [moved from src_mobile/wrt-popup/CMakeLists.txt with 50% similarity]
src/wrt-popup/wrt/CMakeLists.txt [moved from src_mobile/wrt-popup/wrt/CMakeLists.txt with 68% similarity]
src/wrt-popup/wrt/PopupEnum.h [moved from src_wearable/wrt-popup/wrt/PopupEnum.h with 100% similarity]
src/wrt-popup/wrt/PopupSerializer.cpp [moved from src_wearable/wrt-popup/wrt/PopupSerializer.cpp with 100% similarity]
src/wrt-popup/wrt/PopupSerializer.h [moved from src_wearable/wrt-popup/wrt/PopupSerializer.h with 100% similarity]
src/wrt-popup/wrt/popup-bin/CMakeLists.txt [moved from src_wearable/wrt-popup/wrt/popup-bin/CMakeLists.txt with 87% similarity]
src/wrt-popup/wrt/popup-bin/InfoPopup.cpp [moved from src_wearable/wrt-popup/wrt/popup-bin/InfoPopup.cpp with 100% similarity]
src/wrt-popup/wrt/popup-bin/InfoPopup.h [moved from src_wearable/wrt-popup/wrt/popup-bin/InfoPopup.h with 100% similarity]
src/wrt-popup/wrt/popup-bin/YesNoCheckPopup.cpp [moved from src_mobile/wrt-popup/wrt/popup-bin/YesNoCheckPopup.cpp with 70% similarity]
src/wrt-popup/wrt/popup-bin/YesNoCheckPopup.h [moved from src_wearable/wrt-popup/wrt/popup-bin/YesNoCheckPopup.h with 82% similarity]
src/wrt-popup/wrt/popup-bin/renderer/evas_object.cpp [moved from src_wearable/wrt-popup/wrt/popup-bin/renderer/evas_object.cpp with 100% similarity]
src/wrt-popup/wrt/popup-bin/renderer/evas_object.h [moved from src_wearable/wrt-popup/wrt/popup-bin/renderer/evas_object.h with 99% similarity]
src/wrt-popup/wrt/popup-bin/renderer/popup.h [moved from src_wearable/wrt-popup/wrt/popup-bin/renderer/popup.h with 100% similarity]
src/wrt-popup/wrt/popup-bin/renderer/popup_controller.cpp [moved from src_wearable/wrt-popup/wrt/popup-bin/renderer/popup_controller.cpp with 100% similarity]
src/wrt-popup/wrt/popup-bin/renderer/popup_controller.h [moved from src_wearable/wrt-popup/wrt/popup-bin/renderer/popup_controller.h with 100% similarity]
src/wrt-popup/wrt/popup-bin/renderer/popup_manager.cpp [moved from src_wearable/wrt-popup/wrt/popup-bin/renderer/popup_manager.cpp with 100% similarity]
src/wrt-popup/wrt/popup-bin/renderer/popup_manager.h [moved from src_wearable/wrt-popup/wrt/popup-bin/renderer/popup_manager.h with 100% similarity]
src/wrt-popup/wrt/popup-bin/renderer/popup_object.h [moved from src_wearable/wrt-popup/wrt/popup-bin/renderer/popup_object.h with 100% similarity]
src/wrt-popup/wrt/popup-bin/renderer/popup_renderer.cpp [moved from src_wearable/wrt-popup/wrt/popup-bin/renderer/popup_renderer.cpp with 99% similarity]
src/wrt-popup/wrt/popup-bin/renderer/popup_renderer.h [moved from src_mobile/wrt-popup/wrt/popup-bin/renderer/popup_renderer.h with 93% similarity]
src/wrt-popup/wrt/popup-bin/wrt-popup.cpp [moved from src_wearable/wrt-popup/wrt/popup-bin/wrt-popup.cpp with 95% similarity]
src/wrt-popup/wrt/popup-bin/wrt-popup.h [moved from src_wearable/wrt-popup/wrt/popup-bin/wrt-popup.h with 100% similarity]
src/wrt-popup/wrt/popup-runner/CMakeLists.txt [moved from src_mobile/wrt-popup/wrt/popup-runner/CMakeLists.txt with 86% similarity]
src/wrt-popup/wrt/popup-runner/PopupInvoker.cpp [moved from src_mobile/wrt-popup/wrt/popup-runner/PopupInvoker.cpp with 82% similarity]
src/wrt-popup/wrt/popup-runner/PopupInvoker.h [moved from src_wearable/wrt-popup/wrt/popup-runner/PopupInvoker.h with 92% similarity]
src/xwalk-module/CMakeLists.txt [moved from src_wearable/plugins-ipc-message/CMakeLists.txt with 55% similarity, mode: 0755]
src/xwalk-module/XW_Extension.h [new file with mode: 0644]
src/xwalk-module/XW_Extension_Data.h [new file with mode: 0644]
src/xwalk-module/XW_Extension_EntryPoints.h [new file with mode: 0644]
src/xwalk-module/XW_Extension_Permissions.h [new file with mode: 0644]
src/xwalk-module/XW_Extension_Runtime.h [new file with mode: 0644]
src/xwalk-module/XW_Extension_SyncMessage.h [new file with mode: 0644]
src/xwalk-module/extension.cpp [new file with mode: 0755]
src/xwalk-module/extension.h [new file with mode: 0755]
src/xwalk-module/extension_adapter.cpp [new file with mode: 0755]
src/xwalk-module/extension_adapter.h [new file with mode: 0755]
src/xwalk-module/extension_manager.cpp [new file with mode: 0755]
src/xwalk-module/extension_manager.h [new file with mode: 0755]
src/xwalk-module/js_utils.cpp [new file with mode: 0755]
src/xwalk-module/js_utils.h [new file with mode: 0755]
src/xwalk-module/object_tools_module.cpp [new file with mode: 0644]
src/xwalk-module/object_tools_module.h [new file with mode: 0644]
src/xwalk-module/picojson.h [new file with mode: 0644]
src/xwalk-module/runtime_variable_provider.h [new file with mode: 0755]
src/xwalk-module/xwalk_extension_client.cpp [new file with mode: 0755]
src/xwalk-module/xwalk_extension_client.h [new file with mode: 0755]
src/xwalk-module/xwalk_extension_module.cpp [new file with mode: 0755]
src/xwalk-module/xwalk_extension_module.h [new file with mode: 0755]
src/xwalk-module/xwalk_extension_renderer_controller.cpp [new file with mode: 0755]
src/xwalk-module/xwalk_extension_renderer_controller.h [new file with mode: 0755]
src/xwalk-module/xwalk_module_system.cpp [new file with mode: 0755]
src/xwalk-module/xwalk_module_system.h [new file with mode: 0755]
src/xwalk-module/xwalk_v8tools_module.cpp [new file with mode: 0755]
src/xwalk-module/xwalk_v8tools_module.h [new file with mode: 0755]
src_mobile/CMakeLists.txt [deleted file]
src_mobile/Commons/Base64.cpp [deleted file]
src_mobile/Commons/Base64.h [deleted file]
src_mobile/Commons/DESCRIPTION [deleted file]
src_mobile/Commons/Deprecated.h [deleted file]
src_mobile/Commons/Dimension.h [deleted file]
src_mobile/Commons/FunctionDeclaration.h [deleted file]
src_mobile/Commons/FunctionDefinition.cpp [deleted file]
src_mobile/Commons/FunctionDefinition.h [deleted file]
src_mobile/Commons/JSObject.cpp [deleted file]
src_mobile/Commons/JSObjectDeclaration.cpp [deleted file]
src_mobile/Commons/ListenerEventEmitter.h [deleted file]
src_mobile/Commons/Range.h [deleted file]
src_mobile/Commons/Regex.cpp [deleted file]
src_mobile/Commons/Regex.h [deleted file]
src_mobile/Commons/RegexPatterns.h [deleted file]
src_mobile/Commons/RegexUtils.cpp [deleted file]
src_mobile/Commons/RegexUtils.h [deleted file]
src_mobile/Commons/StaticAssert.h [deleted file]
src_mobile/Commons/StringBuilder.cpp [deleted file]
src_mobile/Commons/StringBuilder.h [deleted file]
src_mobile/Commons/StringUtils.cpp [deleted file]
src_mobile/Commons/TimeUtils.cpp [deleted file]
src_mobile/Commons/TimeUtils.h [deleted file]
src_mobile/Commons/TypeTraits.h [deleted file]
src_mobile/Commons/TypesDeclaration.h [deleted file]
src_mobile/Commons/WrtAccess/WrtAccess.cpp [deleted file]
src_mobile/Commons/WrtAccess/WrtAccess.h [deleted file]
src_mobile/Commons/WrtAccess/config.cmake [deleted file]
src_mobile/Commons/plugin_initializer_def.h [deleted file]
src_mobile/CommonsJavaScript/CMakeLists.txt [deleted file]
src_mobile/CommonsJavaScript/Converter.cpp [deleted file]
src_mobile/CommonsJavaScript/DESCRIPTION [deleted file]
src_mobile/CommonsJavaScript/DOMExceptionData.cpp [deleted file]
src_mobile/CommonsJavaScript/DOMExceptionData.h [deleted file]
src_mobile/CommonsJavaScript/JSCallbackManager.cpp [deleted file]
src_mobile/CommonsJavaScript/JSCallbackManager.h [deleted file]
src_mobile/CommonsJavaScript/JSDOMException.cpp [deleted file]
src_mobile/CommonsJavaScript/JSDOMException.h [deleted file]
src_mobile/CommonsJavaScript/JSDOMExceptionFactory.cpp [deleted file]
src_mobile/CommonsJavaScript/JSDOMExceptionFactory.h [deleted file]
src_mobile/CommonsJavaScript/JSUtils.cpp [deleted file]
src_mobile/CommonsJavaScript/JSUtils.h [deleted file]
src_mobile/CommonsJavaScript/ScopedJSStringRef.cpp [deleted file]
src_mobile/CommonsJavaScript/ScopedJSStringRef.h [deleted file]
src_mobile/CommonsJavaScript/Security/SecurityFunctionDeclaration.cpp [deleted file]
src_mobile/CommonsJavaScript/Security/SecurityFunctionDeclaration.h [deleted file]
src_mobile/CommonsJavaScript/Security/StaticDeclaration.h [deleted file]
src_mobile/CommonsJavaScript/SecurityExceptions.h [deleted file]
src_mobile/CommonsJavaScript/SupportPendingOperation.h [deleted file]
src_mobile/CommonsJavaScript/Validator.cpp [deleted file]
src_mobile/DESCRIPTION [deleted file]
src_mobile/dispatch-event/dispatch_event_support.cpp [deleted file]
src_mobile/dispatch-event/dispatch_event_support.h [deleted file]
src_mobile/js-overlay/deprecated/JSClass/JSSoftKeyboardChangeEvent.cpp [deleted file]
src_mobile/js-overlay/deprecated/JSClass/JSSoftKeyboardChangeEvent.h [deleted file]
src_mobile/js-overlay/deprecated/JSClass/JSStorageEvent.cpp [deleted file]
src_mobile/js-overlay/deprecated/JSClass/JSStorageEvent.h [deleted file]
src_mobile/js-overlay/deprecated/JSClass/JSTizenServiceEvent.cpp [deleted file]
src_mobile/js-overlay/deprecated/JSClass/JSTizenServiceEvent.h [deleted file]
src_mobile/js-overlay/deprecated/js_iframe_support.cpp [deleted file]
src_mobile/js-overlay/deprecated/js_iframe_support.h [deleted file]
src_mobile/js-overlay/deprecated/js_overlay_addEventListener.cpp [deleted file]
src_mobile/js-overlay/deprecated/js_overlay_addEventListener.h [deleted file]
src_mobile/js-overlay/deprecated/js_overlay_support.cpp [deleted file]
src_mobile/js-overlay/deprecated/js_overlay_support.h [deleted file]
src_mobile/js-overlay/js_function_manager.cpp [deleted file]
src_mobile/js-overlay/js_function_manager.h [deleted file]
src_mobile/js-overlay/js_overlay_functions.cpp [deleted file]
src_mobile/js-overlay/js_overlay_functions.h [deleted file]
src_mobile/js-overlay/js_overlay_types.h [deleted file]
src_mobile/modules/API/CMakeLists.txt [deleted file]
src_mobile/modules/API/DESCRIPTION [deleted file]
src_mobile/modules/API/Filesystem/Enums.h [deleted file]
src_mobile/modules/API/Filesystem/EventCopy.cpp [deleted file]
src_mobile/modules/API/Filesystem/EventCopy.h [deleted file]
src_mobile/modules/API/Filesystem/EventFind.cpp [deleted file]
src_mobile/modules/API/Filesystem/EventFind.h [deleted file]
src_mobile/modules/API/Filesystem/EventListNodes.cpp [deleted file]
src_mobile/modules/API/Filesystem/EventListNodes.h [deleted file]
src_mobile/modules/API/Filesystem/EventMove.cpp [deleted file]
src_mobile/modules/API/Filesystem/EventMove.h [deleted file]
src_mobile/modules/API/Filesystem/EventOpen.cpp [deleted file]
src_mobile/modules/API/Filesystem/EventOpen.h [deleted file]
src_mobile/modules/API/Filesystem/EventReadText.cpp [deleted file]
src_mobile/modules/API/Filesystem/EventReadText.h [deleted file]
src_mobile/modules/API/Filesystem/EventRemove.cpp [deleted file]
src_mobile/modules/API/Filesystem/EventRemove.h [deleted file]
src_mobile/modules/API/Filesystem/EventResolve.cpp [deleted file]
src_mobile/modules/API/Filesystem/EventResolve.h [deleted file]
src_mobile/modules/API/Filesystem/IManager.cpp [deleted file]
src_mobile/modules/API/Filesystem/IManager.h [deleted file]
src_mobile/modules/API/Filesystem/INode.cpp [deleted file]
src_mobile/modules/API/Filesystem/INode.h [deleted file]
src_mobile/modules/API/Filesystem/INodeTypes.h [deleted file]
src_mobile/modules/API/Filesystem/IPath.cpp [deleted file]
src_mobile/modules/API/Filesystem/IPath.h [deleted file]
src_mobile/modules/API/Filesystem/IStream.cpp [deleted file]
src_mobile/modules/API/Filesystem/IStream.h [deleted file]
src_mobile/modules/API/Filesystem/NodeFilter.cpp [deleted file]
src_mobile/modules/API/Filesystem/NodeFilter.h [deleted file]
src_mobile/modules/API/Filesystem/PathUtils.cpp [deleted file]
src_mobile/modules/API/Filesystem/PathUtils.h [deleted file]
src_mobile/modules/API/Filesystem/config.cmake [deleted file]
src_mobile/modules/API/LocalStorage/ILocalStorage.h [deleted file]
src_mobile/modules/API/LocalStorage/config.cmake [deleted file]
src_mobile/modules/API/Networking/EventConnected.cpp [deleted file]
src_mobile/modules/API/Networking/EventConnected.h [deleted file]
src_mobile/modules/API/Networking/EventDisconnected.cpp [deleted file]
src_mobile/modules/API/Networking/EventDisconnected.h [deleted file]
src_mobile/modules/API/Networking/IAdapter.cpp [deleted file]
src_mobile/modules/API/Networking/IAdapter.h [deleted file]
src_mobile/modules/API/Networking/IConnection.cpp [deleted file]
src_mobile/modules/API/Networking/IConnection.h [deleted file]
src_mobile/modules/API/Networking/IManager.cpp [deleted file]
src_mobile/modules/API/Networking/IManager.h [deleted file]
src_mobile/modules/API/Networking/config.cmake [deleted file]
src_mobile/modules/API/PluginManager/IPluginManager.h [deleted file]
src_mobile/modules/API/PluginManager/PluginManagerFactory.h [deleted file]
src_mobile/modules/API/PluginManager/config.cmake [deleted file]
src_mobile/modules/API/SoftKeyboardChangeEvent/ISoftKeyboardChangeEvent.h [deleted file]
src_mobile/modules/API/SoftKeyboardChangeEvent/SoftKeyboardChangeEvent.cpp [deleted file]
src_mobile/modules/API/SoftKeyboardChangeEvent/SoftKeyboardChangeEvent.h [deleted file]
src_mobile/modules/API/SoftKeyboardChangeEvent/config.cmake [deleted file]
src_mobile/modules/API/StorageEvent/IStorageEvent.h [deleted file]
src_mobile/modules/API/StorageEvent/StorageEvent.h [deleted file]
src_mobile/modules/API/StorageEvent/StorageEventMgr.cpp [deleted file]
src_mobile/modules/API/StorageEvent/StorageEventMgr.h [deleted file]
src_mobile/modules/API/StorageEvent/config.cmake [deleted file]
src_mobile/modules/API/TizenServiceEvent/TizenServiceEvent.cpp [deleted file]
src_mobile/modules/API/TizenServiceEvent/TizenServiceEvent.h [deleted file]
src_mobile/modules/API/TizenServiceEvent/config.cmake [deleted file]
src_mobile/modules/API/Widget/WidgetFactory.cpp [deleted file]
src_mobile/modules/API/Widget/WidgetFactory.h [deleted file]
src_mobile/modules/API/Widget/config.cmake [deleted file]
src_mobile/modules/API/WidgetDB/IWidgetFeature.h [deleted file]
src_mobile/modules/API/WidgetDB/config.cmake [deleted file]
src_mobile/modules/API/config.cmake [deleted file]
src_mobile/modules/CMakeLists.txt [deleted file]
src_mobile/modules/DESCRIPTION [deleted file]
src_mobile/modules/packages/CMakeLists.txt [deleted file]
src_mobile/modules/packages/Filesystem/CMakeLists.txt [deleted file]
src_mobile/modules/packages/LocalStorage/CMakeLists.txt [deleted file]
src_mobile/modules/packages/Networking/CMakeLists.txt [deleted file]
src_mobile/modules/packages/PluginManager/CMakeLists.txt [deleted file]
src_mobile/modules/packages/TizenServiceEvent/CMakeLists.txt [deleted file]
src_mobile/modules/packages/Widget/CMakeLists.txt [deleted file]
src_mobile/modules/tizen/DESCRIPTION [deleted file]
src_mobile/modules/tizen/Filesystem/Manager.cpp [deleted file]
src_mobile/modules/tizen/Filesystem/Manager.h [deleted file]
src_mobile/modules/tizen/Filesystem/Node.cpp [deleted file]
src_mobile/modules/tizen/Filesystem/Node.h [deleted file]
src_mobile/modules/tizen/Filesystem/NodeFilterMatcher.cpp [deleted file]
src_mobile/modules/tizen/Filesystem/NodeFilterMatcher.h [deleted file]
src_mobile/modules/tizen/Filesystem/Path.cpp [deleted file]
src_mobile/modules/tizen/Filesystem/Path.h [deleted file]
src_mobile/modules/tizen/Filesystem/Stream.cpp [deleted file]
src_mobile/modules/tizen/Filesystem/Stream.h [deleted file]
src_mobile/modules/tizen/Filesystem/Utils.cpp [deleted file]
src_mobile/modules/tizen/Filesystem/Utils.h [deleted file]
src_mobile/modules/tizen/Filesystem/config.cmake [deleted file]
src_mobile/modules/tizen/Networking/Connection.cpp [deleted file]
src_mobile/modules/tizen/Networking/Connection.h [deleted file]
src_mobile/modules/tizen/Networking/EthernetAdapter.cpp [deleted file]
src_mobile/modules/tizen/Networking/EthernetAdapter.h [deleted file]
src_mobile/modules/tizen/Networking/Manager.cpp [deleted file]
src_mobile/modules/tizen/Networking/Manager.h [deleted file]
src_mobile/modules/tizen/Networking/WifiAdapter.cpp [deleted file]
src_mobile/modules/tizen/Networking/WifiAdapter.h [deleted file]
src_mobile/modules/tizen/Networking/config.cmake [deleted file]
src_mobile/modules/tizen/PluginManager/PluginManager.cpp [deleted file]
src_mobile/modules/tizen/PluginManager/PluginManager.h [deleted file]
src_mobile/modules/tizen/PluginManager/config.cmake [deleted file]
src_mobile/modules/tizen/Widget/Property.h [deleted file]
src_mobile/modules/tizen/Widget/Widget.cpp [deleted file]
src_mobile/modules/tizen/Widget/config.cmake [deleted file]
src_mobile/modules/tizen/WidgetDB/WidgetDB.cpp [deleted file]
src_mobile/modules/tizen/WidgetDB/WidgetFeature.cpp [deleted file]
src_mobile/modules/tizen/WidgetDB/WidgetFeature.h [deleted file]
src_mobile/modules/tizen/WidgetDB/config.cmake [deleted file]
src_mobile/modules/tizen/WidgetInterface/CMakeLists.txt [deleted file]
src_mobile/modules/tizen/WidgetInterface/WidgetInterface.cpp [deleted file]
src_mobile/modules/tizen/WidgetInterface/WidgetInterface.h [deleted file]
src_mobile/modules/tizen/WidgetInterface/config.cmake [deleted file]
src_mobile/modules/tizen/config.cmake [deleted file]
src_mobile/plugin-loading/explorer.cpp [deleted file]
src_mobile/plugin-loading/javascript_interface.cpp [deleted file]
src_mobile/plugin-loading/javascript_interface.h [deleted file]
src_mobile/plugin-loading/js_page_session.cpp [deleted file]
src_mobile/plugin-loading/js_page_session.h [deleted file]
src_mobile/plugin-loading/plugin.cpp [deleted file]
src_mobile/plugin-loading/plugin_container_support.h [deleted file]
src_mobile/plugin-loading/plugin_iframe_support.cpp [deleted file]
src_mobile/plugin-loading/plugin_iframe_support.h [deleted file]
src_mobile/plugin-loading/plugin_logic.cpp [deleted file]
src_mobile/plugin-loading/plugin_model.cpp [deleted file]
src_mobile/plugin-loading/plugin_property_support.cpp [deleted file]
src_mobile/plugin-loading/plugin_property_support.h [deleted file]
src_mobile/plugins-api-support/CallbackSupport.h [deleted file]
src_mobile/plugins-api-support/ExportedApi.h [deleted file]
src_mobile/plugins-api-support/IObject.h [deleted file]
src_mobile/plugins-api-support/IObject_cast.h [deleted file]
src_mobile/plugins-api-support/Object.h [deleted file]
src_mobile/plugins-api-support/ObjectFactory.cpp [deleted file]
src_mobile/plugins-api-support/ObjectFactory.h [deleted file]
src_mobile/plugins-api-support/Plugin.cpp [deleted file]
src_mobile/plugins-api-support/Plugin.h [deleted file]
src_mobile/plugins-api-support/PluginRegistration.cpp [deleted file]
src_mobile/plugins-api-support/PluginRegistration.h [deleted file]
src_mobile/plugins-api-support/PluginRegistrationImpl.h [deleted file]
src_mobile/plugins-api-support/PluginRegistry.cpp [deleted file]
src_mobile/plugins-api-support/PluginRegistry.h [deleted file]
src_mobile/plugins-api-support/PluginSignals.h [deleted file]
src_mobile/plugins-api-support/SignalSignature.h [deleted file]
src_mobile/plugins-api-support/SignalsSupport.h [deleted file]
src_mobile/plugins-api-support/SoFeatures.h [deleted file]
src_mobile/plugins-api-support/detail/traits.h [deleted file]
src_mobile/plugins-api-support/js_types.h [deleted file]
src_mobile/plugins-api-support/traits.h [deleted file]
src_mobile/plugins-api-support/tuple.h [deleted file]
src_mobile/plugins-installer/CMakeLists.txt [deleted file]
src_mobile/plugins-installer/DESCRIPTION [deleted file]
src_mobile/plugins-installer/plugin_installer.cpp [deleted file]
src_mobile/plugins-installer/plugin_installer.h [deleted file]
src_mobile/plugins-installer/plugin_installer_errors.h [deleted file]
src_mobile/plugins-installer/plugin_installer_types.h [deleted file]
src_mobile/plugins-installer/plugin_metafile_reader.cpp [deleted file]
src_mobile/plugins-installer/plugin_metafile_reader.h [deleted file]
src_mobile/plugins-installer/plugin_utils.cpp [deleted file]
src_mobile/plugins-installer/plugin_utils.h [deleted file]
src_mobile/plugins-installer/wrt_plugins_installer.cpp [deleted file]
src_mobile/plugins-ipc-message/ipc_message_support.h [deleted file]
src_mobile/standards/W3C/CMakeLists.txt [deleted file]
src_mobile/standards/W3C/DESCRIPTION [deleted file]
src_mobile/standards/W3C/Widget/CMakeLists.txt [deleted file]
src_mobile/standards/W3C/Widget/JSPreferences.cpp [deleted file]
src_mobile/standards/W3C/Widget/JSPreferences.h [deleted file]
src_mobile/standards/W3C/Widget/JSWidget.cpp [deleted file]
src_mobile/standards/W3C/Widget/JSWidget.h [deleted file]
src_mobile/standards/W3C/Widget/plugin_config.cpp [deleted file]
src_mobile/standards/W3C/Widget/plugin_config.h [deleted file]
src_mobile/standards/W3C/Widget/plugin_initializer.cpp [deleted file]
src_mobile/wrt-popup/ace/CMakeLists.txt [deleted file]
src_mobile/wrt-popup/ace/popup-bin/CMakeLists.txt [deleted file]
src_mobile/wrt-popup/ace/popup-bin/Popup.cpp [deleted file]
src_mobile/wrt-popup/ace/popup-bin/Popup.h [deleted file]
src_mobile/wrt-popup/ace/popup-runner/CMakeLists.txt [deleted file]
src_mobile/wrt-popup/ace/popup-runner/popup-runner.cpp [deleted file]
src_mobile/wrt-popup/ace/popup-runner/popup-runner.h [deleted file]
src_mobile/wrt-popup/wrt/PopupEnum.h [deleted file]
src_mobile/wrt-popup/wrt/PopupSerializer.cpp [deleted file]
src_mobile/wrt-popup/wrt/PopupSerializer.h [deleted file]
src_mobile/wrt-popup/wrt/popup-bin/CMakeLists.txt [deleted file]
src_mobile/wrt-popup/wrt/popup-bin/InfoPopup.cpp [deleted file]
src_mobile/wrt-popup/wrt/popup-bin/InfoPopup.h [deleted file]
src_mobile/wrt-popup/wrt/popup-bin/YesNoCheckPopup.h [deleted file]
src_mobile/wrt-popup/wrt/popup-bin/YesNoPopup.cpp [deleted file]
src_mobile/wrt-popup/wrt/popup-bin/YesNoPopup.h [deleted file]
src_mobile/wrt-popup/wrt/popup-bin/renderer/evas_object.cpp [deleted file]
src_mobile/wrt-popup/wrt/popup-bin/renderer/evas_object.h [deleted file]
src_mobile/wrt-popup/wrt/popup-bin/renderer/popup.h [deleted file]
src_mobile/wrt-popup/wrt/popup-bin/renderer/popup_controller.cpp [deleted file]
src_mobile/wrt-popup/wrt/popup-bin/renderer/popup_controller.h [deleted file]
src_mobile/wrt-popup/wrt/popup-bin/renderer/popup_manager.cpp [deleted file]
src_mobile/wrt-popup/wrt/popup-bin/renderer/popup_manager.h [deleted file]
src_mobile/wrt-popup/wrt/popup-bin/renderer/popup_object.h [deleted file]
src_mobile/wrt-popup/wrt/popup-bin/renderer/popup_renderer.cpp [deleted file]
src_mobile/wrt-popup/wrt/popup-bin/wrt-popup.cpp [deleted file]
src_mobile/wrt-popup/wrt/popup-bin/wrt-popup.h [deleted file]
src_mobile/wrt-popup/wrt/popup-runner/PopupInvoker.h [deleted file]
src_wearable/CMakeLists.txt [deleted file]
src_wearable/Commons/CMakeLists.txt [deleted file]
src_wearable/Commons/Deprecated.h [deleted file]
src_wearable/Commons/Emitters.h [deleted file]
src_wearable/Commons/EventListener.h [deleted file]
src_wearable/Commons/EventReceiver.h [deleted file]
src_wearable/Commons/Exception.h [deleted file]
src_wearable/Commons/IEvent.h [deleted file]
src_wearable/Commons/IExternEventCanceler.h [deleted file]
src_wearable/Commons/JSObject.h [deleted file]
src_wearable/Commons/JSObjectDeclaration.h [deleted file]
src_wearable/Commons/ListenerEvent.h [deleted file]
src_wearable/Commons/StringUtils.h [deleted file]
src_wearable/Commons/ThreadPool.cpp [deleted file]
src_wearable/Commons/ThreadPool.h [deleted file]
src_wearable/Commons/TimeUtils.cpp [deleted file]
src_wearable/Commons/TimeUtils.h [deleted file]
src_wearable/Commons/WrtAccess/WrtAccess.cpp [deleted file]
src_wearable/CommonsJavaScript/Converter.h [deleted file]
src_wearable/CommonsJavaScript/JSPendingOperation.cpp [deleted file]
src_wearable/CommonsJavaScript/JSPendingOperation.h [deleted file]
src_wearable/CommonsJavaScript/JSPendingOperationPrivateObject.h [deleted file]
src_wearable/CommonsJavaScript/PrivateObject.h [deleted file]
src_wearable/CommonsJavaScript/Utils.h [deleted file]
src_wearable/CommonsJavaScript/Validator.h [deleted file]
src_wearable/dispatch-event/CMakeLists.txt [deleted file]
src_wearable/js-overlay/CMakeLists.txt [deleted file]
src_wearable/modules/API/CMakeLists.txt [deleted file]
src_wearable/modules/API/Filesystem/Enums.h [deleted file]
src_wearable/modules/API/Filesystem/EventCopy.cpp [deleted file]
src_wearable/modules/API/Filesystem/EventCopy.h [deleted file]
src_wearable/modules/API/Filesystem/EventFind.cpp [deleted file]
src_wearable/modules/API/Filesystem/EventFind.h [deleted file]
src_wearable/modules/API/Filesystem/EventListNodes.cpp [deleted file]
src_wearable/modules/API/Filesystem/EventListNodes.h [deleted file]
src_wearable/modules/API/Filesystem/EventMove.cpp [deleted file]
src_wearable/modules/API/Filesystem/EventMove.h [deleted file]
src_wearable/modules/API/Filesystem/EventOpen.cpp [deleted file]
src_wearable/modules/API/Filesystem/EventOpen.h [deleted file]
src_wearable/modules/API/Filesystem/EventReadText.cpp [deleted file]
src_wearable/modules/API/Filesystem/EventReadText.h [deleted file]
src_wearable/modules/API/Filesystem/EventRemove.cpp [deleted file]
src_wearable/modules/API/Filesystem/EventRemove.h [deleted file]
src_wearable/modules/API/Filesystem/EventResolve.cpp [deleted file]
src_wearable/modules/API/Filesystem/EventResolve.h [deleted file]
src_wearable/modules/API/Filesystem/IManager.cpp [deleted file]
src_wearable/modules/API/Filesystem/IManager.h [deleted file]
src_wearable/modules/API/Filesystem/INode.cpp [deleted file]
src_wearable/modules/API/Filesystem/INode.h [deleted file]
src_wearable/modules/API/Filesystem/INodeTypes.h [deleted file]
src_wearable/modules/API/Filesystem/IPath.cpp [deleted file]
src_wearable/modules/API/Filesystem/IPath.h [deleted file]
src_wearable/modules/API/Filesystem/IStream.cpp [deleted file]
src_wearable/modules/API/Filesystem/IStream.h [deleted file]
src_wearable/modules/API/Filesystem/NodeFilter.cpp [deleted file]
src_wearable/modules/API/Filesystem/NodeFilter.h [deleted file]
src_wearable/modules/API/Filesystem/PathUtils.cpp [deleted file]
src_wearable/modules/API/Filesystem/PathUtils.h [deleted file]
src_wearable/modules/API/Filesystem/config.cmake [deleted file]
src_wearable/modules/API/LocalStorage/LocalStorageMgr.cpp [deleted file]
src_wearable/modules/API/LocalStorage/LocalStorageMgr.h [deleted file]
src_wearable/modules/API/PluginManager/PluginManagerFactory.cpp [deleted file]
src_wearable/modules/API/StorageEvent/StorageEvent.cpp [deleted file]
src_wearable/modules/API/TizenServiceEvent/ITizenServiceEvent.h [deleted file]
src_wearable/modules/API/Widget/IWidget.h [deleted file]
src_wearable/modules/API/WidgetDB/IWidgetDB.h [deleted file]
src_wearable/modules/API/WidgetDB/WidgetDBMgr.cpp [deleted file]
src_wearable/modules/API/WidgetDB/WidgetDBMgr.h [deleted file]
src_wearable/modules/packages/CMakeLists.txt [deleted file]
src_wearable/modules/packages/Filesystem/CMakeLists.txt [deleted file]
src_wearable/modules/packages/LocalStorage/CMakeLists.txt [deleted file]
src_wearable/modules/packages/SoftKeyboardChangeEvent/CMakeLists.txt [deleted file]
src_wearable/modules/packages/StorageEvent/CMakeLists.txt [deleted file]
src_wearable/modules/packages/WidgetInterface/CMakeLists.txt [deleted file]
src_wearable/modules/tizen/CMakeLists.txt [deleted file]
src_wearable/modules/tizen/Filesystem/Manager.cpp [deleted file]
src_wearable/modules/tizen/Filesystem/Manager.h [deleted file]
src_wearable/modules/tizen/Filesystem/Node.cpp [deleted file]
src_wearable/modules/tizen/Filesystem/Node.h [deleted file]
src_wearable/modules/tizen/Filesystem/NodeFilterMatcher.cpp [deleted file]
src_wearable/modules/tizen/Filesystem/NodeFilterMatcher.h [deleted file]
src_wearable/modules/tizen/Filesystem/Path.cpp [deleted file]
src_wearable/modules/tizen/Filesystem/Path.h [deleted file]
src_wearable/modules/tizen/Filesystem/Stream.cpp [deleted file]
src_wearable/modules/tizen/Filesystem/Stream.h [deleted file]
src_wearable/modules/tizen/Filesystem/Utils.cpp [deleted file]
src_wearable/modules/tizen/Filesystem/Utils.h [deleted file]
src_wearable/modules/tizen/Filesystem/config.cmake [deleted file]
src_wearable/modules/tizen/Widget/Widget.h [deleted file]
src_wearable/modules/tizen/WidgetDB/WidgetDB.h [deleted file]
src_wearable/modules/tizen/WidgetInterface/CMakeLists.txt [deleted file]
src_wearable/plugin-loading/CMakeLists.txt [deleted file]
src_wearable/plugin-loading/explorer.h [deleted file]
src_wearable/plugin-loading/plugin.h [deleted file]
src_wearable/plugin-loading/plugin_container_support.cpp [deleted file]
src_wearable/plugin-loading/plugin_logic.h [deleted file]
src_wearable/plugin-loading/plugin_model.h [deleted file]
src_wearable/plugins-api-support/CMakeLists.txt [deleted file]
src_wearable/plugins-api-support/Object.cpp [deleted file]
src_wearable/plugins-installer/plugin_objects.cpp [deleted file]
src_wearable/plugins-installer/plugin_objects.h [deleted file]
src_wearable/plugins-ipc-message/ipc_message_support.cpp [deleted file]
src_wearable/wrt-popup/CMakeLists.txt [deleted file]
src_wearable/wrt-popup/ace/CMakeLists.txt [deleted file]
src_wearable/wrt-popup/ace/popup-bin/CMakeLists.txt [deleted file]
src_wearable/wrt-popup/ace/popup-bin/Popup.cpp [deleted file]
src_wearable/wrt-popup/ace/popup-bin/Popup.h [deleted file]
src_wearable/wrt-popup/ace/popup-runner/CMakeLists.txt [deleted file]
src_wearable/wrt-popup/ace/popup-runner/popup-runner.cpp [deleted file]
src_wearable/wrt-popup/ace/popup-runner/popup-runner.h [deleted file]
src_wearable/wrt-popup/wrt/CMakeLists.txt [deleted file]
src_wearable/wrt-popup/wrt/popup-bin/YesNoCheckPopup.cpp [deleted file]
src_wearable/wrt-popup/wrt/popup-bin/YesNoPopup.cpp [deleted file]
src_wearable/wrt-popup/wrt/popup-bin/YesNoPopup.h [deleted file]
src_wearable/wrt-popup/wrt/popup-bin/renderer/popup_renderer.h [deleted file]
src_wearable/wrt-popup/wrt/popup-runner/CMakeLists.txt [deleted file]
src_wearable/wrt-popup/wrt/popup-runner/PopupInvoker.cpp [deleted file]
tests/CMakeLists.txt
tests/CMakeUtils.txt
tests/Commons/Base64_test.cpp [new file with mode: 0644]
tests/Commons/CMakeLists.txt [new file with mode: 0644]
tests/Commons/TestInit.cpp [moved from src_mobile/plugin-loading/js_types.h with 58% similarity]
tests/dao/CMakeLists.txt
tests/dao/WidgetDBTest.cpp
wrt-plugins-common.manifest [changed mode: 0644->0755]
wrt-popup-ace-runtime.mobile.rule [deleted file]
wrt-popup-ace-runtime.mobile2.rule [deleted file]
wrt-popup-ace-runtime.rule [deleted file]
wrt-popup-wrt-runtime.efl [new file with mode: 0644]
wrt-popup-wrt-runtime.mobile.rule [deleted file]
wrt-popup-wrt-runtime.mobile2.rule [deleted file]
wrt-popup-wrt-runtime.rule [deleted file]

old mode 100644 (file)
new mode 100755 (executable)
index 8978700..f5e8f59
 #    See the License for the specific language governing permissions and
 #    limitations under the License.
 #
-cmake_minimum_required(VERSION 2.6)
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
 
 SET(CMAKE_PROJECT_NAME wrt-plugins-common)
-set(PACKAGE_NAME ${CMAKE_PROJECT_NAME})
-project(${CMAKE_PROJECT_NAME})
+SET(PACKAGE_NAME ${CMAKE_PROJECT_NAME})
+PROJECT(${CMAKE_PROJECT_NAME})
 STRING(REGEX MATCH "([^.]*)" CMAKE_PROJECT_API_VERSION "${CMAKE_PROJECT_VERSION}")
 
 ################################################################################
 # Required platform modules
 
-include(FindPkgConfig)
+INCLUDE(FindPkgConfig)
 
-pkg_search_module(dpl REQUIRED dpl-efl>=0.2.21)
+PKG_SEARCH_MODULE(dpl REQUIRED dpl-efl>=0.2.21)
 
-include_directories(
+INCLUDE_DIRECTORIES(
   ${dpl_INCLUDE_DIRS}
   ${CMAKE_CURRENT_SOURCE_DIR}/src/
   ${CMAKE_CURRENT_SOURCE_DIR}/src/modules/API
@@ -34,7 +34,6 @@ include_directories(
   ${CMAKE_CURRENT_SOURCE_DIR}/src/CommonsJavaScript
   ${CMAKE_CURRENT_SOURCE_DIR}/src/plugin-loading
   ${CMAKE_CURRENT_SOURCE_DIR}/src/js-overlay
-  ${CMAKE_CURRENT_SOURCE_DIR}/src/wrt-popup/ace/popup-runner
   ${CMAKE_CURRENT_SOURCE_DIR}/src/plugins_ipc_message
   ${CMAKE_CURRENT_SOURCE_DIR}/src/dispatch-event)
 
@@ -49,12 +48,13 @@ SET(CMAKE_C_FLAGS_PROFILING    "-O2")
 SET(CMAKE_CXX_FLAGS_PROFILING  "-O2 -std=c++0x")
 SET(CMAKE_C_FLAGS_DEBUG        "-O0 -g")
 SET(CMAKE_CXX_FLAGS_DEBUG      "-O0 -std=c++0x -g")
-SET(CMAKE_C_FLAGS_RELEASE      "-Os")
-SET(CMAKE_CXX_FLAGS_RELEASE    "-Os -std=c++0x -fvisibility-inlines-hidden")
+SET(CMAKE_C_FLAGS_RELEASE      "-O2 -g")
+SET(CMAKE_CXX_FLAGS_RELEASE    "-O2 -std=c++0x -g -fvisibility-inlines-hidden")
 SET(CMAKE_CXX_FLAGS_CCOV       "-O0 -std=c++0x -g --coverage")
 ####
 
 OPTION(DPL_LOG "DPL logs status" ON)
+SET(LOG_TAG "WRT_PLUGINS_COMMON")
 OPTION(WITH_TESTS "Build tests" OFF)
 
 IF(DPL_LOG AND NOT CMAKE_BUILD_TYPE MATCHES "profiling")
@@ -87,103 +87,89 @@ ENDIF(DEVPKG)
 ################################################################################
 # Miscellaneous variables
 
-set(CONFIG_FILE_NAME "config.cmake")
-set(LIBS_COMMONS ${dpl_LDFLAGS} )
+SET(CONFIG_FILE_NAME "config.cmake")
+SET(LIBS_COMMONS ${dpl_LDFLAGS} )
 
-set(DESTINATION_LIB_PREFIX lib)
-set(DESTINATION_HEADER_PREFIX include/${PROJECT_NAME})
+SET(DESTINATION_LIB_PREFIX lib)
+SET(DESTINATION_HEADER_PREFIX include/${PROJECT_NAME})
 
-set(DESTINATION_HEADERS_NON_JS ${DESTINATION_HEADER_PREFIX}/Commons)
-set(DESTINATION_HEADERS_JS ${DESTINATION_HEADER_PREFIX}/CommonsJavaScript)
-set(DESTINATION_HEADERS_JS_OVERLAY ${DESTINATION_HEADER_PREFIX}/js-overlay)
-set(DESTINATION_HEADERS_WRT_POPUP_RUNNER ${DESTINATION_HEADER_PREFIX}/popup-runner)
+SET(DESTINATION_HEADERS_NON_JS ${DESTINATION_HEADER_PREFIX}/Commons)
+SET(DESTINATION_HEADERS_JS ${DESTINATION_HEADER_PREFIX}/CommonsJavaScript)
+SET(DESTINATION_HEADERS_JS_OVERLAY ${DESTINATION_HEADER_PREFIX}/js-overlay)
+SET(DESTINATION_HEADERS_WRT_POPUP_RUNNER ${DESTINATION_HEADER_PREFIX}/popup-runner)
 
 ################################################################################
 # Target platform
 
-if (NOT DEFINED PLATFORM)
-  set(PLATFORM "tizen")
-endif ()
+IF (NOT DEFINED PLATFORM)
+  SET(PLATFORM "tizen")
+ENDIF ()
 
 ################################################################################
 # Schema of plugin's configuration file
 
-set(COMMON_CONFIG_DTD ${CMAKE_CURRENT_SOURCE_DIR}/config.dtd)
-set(COMMON_CONFIG_DTD_DST /usr/etc/wrt-plugins)
+SET(COMMON_CONFIG_DTD ${CMAKE_CURRENT_SOURCE_DIR}/config.dtd)
+SET(COMMON_CONFIG_DTD_DST /usr/etc/wrt-plugins)
 INSTALL(FILES ${COMMON_CONFIG_DTD} DESTINATION ${COMMON_CONFIG_DTD_DST})
 
 ################################################################################
 # Macros used for including plugins from AL.
 
 
-function(add_subdir NAME)
-  message(STATUS "Building: ${CMAKE_CURRENT_SOURCE_DIR}/${NAME}")
-  add_subdirectory(${NAME})
-endfunction()
+FUNCTION(add_subdir NAME)
+  MESSAGE(STATUS "Building: ${CMAKE_CURRENT_SOURCE_DIR}/${NAME}")
+  ADD_SUBDIRECTORY(${NAME})
+ENDFUNCTION()
 
 ################################################################################
 # Subdirectories
 
-add_subdirectory(src)
+ADD_SUBDIRECTORY(src)
 
 IF(WITH_TESTS)
-  add_subdirectory(tests)
+  ADD_SUBDIRECTORY(tests)
 ENDIF(WITH_TESTS)
 
 ################################################################################
 # PKGCONFIG
 
-set(PKGCONFIG_DIR ${PROJECT_SOURCE_DIR}/pkgconfigs)
+SET(PKGCONFIG_DIR ${PROJECT_SOURCE_DIR}/pkgconfigs)
 
-macro(configure_and_install_pkg PKG_FILE)
+MACRO(configure_and_install_pkg PKG_FILE)
     CONFIGURE_FILE(${PKGCONFIG_DIR}/${PKG_FILE}.in
                ${PKGCONFIG_DIR}/${PKG_FILE} @ONLY)
     INSTALL(FILES ${PKGCONFIG_DIR}/${PKG_FILE} DESTINATION lib/pkgconfig)
-endmacro(configure_and_install_pkg)
-
-configure_and_install_pkg(wrt-plugins-commons-javascript.pc)
-configure_and_install_pkg(wrt-plugins-commons.pc)
-configure_and_install_pkg(wrt-plugins-filesystem.pc)
-configure_and_install_pkg(wrt-plugins-widget-interface.pc)
-configure_and_install_pkg(wrt-plugins-widgetdb.pc)
-configure_and_install_pkg(wrt-plugins-plugin-manager.pc)
-configure_and_install_pkg(wrt-plugin-loading.pc)
-configure_and_install_pkg(wrt-plugin-js-overlay.pc)
-configure_and_install_pkg(wrt-popup-runner.pc)
-configure_and_install_pkg(wrt-popup-ace-runner.pc)
-configure_and_install_pkg(wrt-popup-wrt-runner.pc)
-configure_and_install_pkg(wrt-plugins-api-support.pc)
-configure_and_install_pkg(wrt-plugins-ipc-message.pc)
-configure_and_install_pkg(wrt-dispatch-event.pc)
+ENDMACRO(configure_and_install_pkg)
+
+CONFIGURE_AND_INSTALL_PKG(wrt-plugins-commons-javascript.pc)
+CONFIGURE_AND_INSTALL_PKG(wrt-plugins-commons.pc)
+CONFIGURE_AND_INSTALL_PKG(wrt-plugins-widget-interface.pc)
+CONFIGURE_AND_INSTALL_PKG(wrt-plugins-widgetdb.pc)
+CONFIGURE_AND_INSTALL_PKG(wrt-plugins-plugin-manager.pc)
+CONFIGURE_AND_INSTALL_PKG(wrt-plugin-loading.pc)
+CONFIGURE_AND_INSTALL_PKG(wrt-plugin-js-overlay.pc)
+CONFIGURE_AND_INSTALL_PKG(wrt-popup-runner.pc)
+CONFIGURE_AND_INSTALL_PKG(wrt-popup-wrt-runner.pc)
+CONFIGURE_AND_INSTALL_PKG(wrt-plugins-api-support.pc)
+CONFIGURE_AND_INSTALL_PKG(wrt-plugins-ipc-message.pc)
+CONFIGURE_AND_INSTALL_PKG(wrt-dispatch-event.pc)
+
+CONFIGURE_AND_INSTALL_PKG(wrt-plugins-localstorage.pc)
+CONFIGURE_AND_INSTALL_PKG(wrt-plugins-widget.pc)
 
 ################################################################################
 # Cache
 
-set(PLATFORM "${PLATFORM}" CACHE STRING "Target platform" FORCE)
-set(CMAKE_CONFIG_FILE_NAME "${CMAKE_CONFIG_FILE_NAME}" CACHE
+SET(PLATFORM "${PLATFORM}" CACHE STRING "Target platform" FORCE)
+SET(CMAKE_CONFIG_FILE_NAME "${CMAKE_CONFIG_FILE_NAME}" CACHE
     STRING "CMake configuration file name." FORCE)
 
 ################################################################################
 # SMACK rule
 
-IF(DEVICE_PROFILE STREQUAL "wearable")
-# werable
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/wrt-popup-ace-runtime.rule DESTINATION /etc/smack/accesses2.d)
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/wrt-popup-wrt-runtime.rule DESTINATION /etc/smack/accesses2.d)
-#
-ELSE(DEVICE_PROFILE STREQUAL "wearable")
-# mobile
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/wrt-popup-ace-runtime.mobile.rule DESTINATION /etc/smack/accesses2.d)
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/wrt-popup-wrt-runtime.mobile.rule DESTINATION /etc/smack/accesses2.d)
-# temp for smack branch
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/wrt-popup-ace-runtime.mobile2.rule DESTINATION /opt/etc/smack/accesses.d)
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/wrt-popup-wrt-runtime.mobile2.rule DESTINATION /opt/etc/smack/accesses.d)
-#
-ENDIF(DEVICE_PROFILE STREQUAL "wearable")
-
-
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/wrt-popup-wrt-runtime.efl DESTINATION /etc/smack/accesses.d)
 
 ################################################################################
 # Summary
 
-message(STATUS "PLATFORM = ${PLATFORM}")
+MESSAGE(STATUS "PLATFORM = ${PLATFORM}")
similarity index 100%
rename from LICENSE
rename to LICENSE.APLv2
diff --git a/LICENSE.BSD-2.0 b/LICENSE.BSD-2.0
new file mode 100644 (file)
index 0000000..5d7d3f3
--- /dev/null
@@ -0,0 +1,13 @@
+
+Copyright (c) 2015 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: 
+
+1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 
+
+2. 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. 
+
+3. Neither the name of the copyright holder nor the names of its 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 HOLDER 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. 
+
old mode 100644 (file)
new mode 100755 (executable)
index a9f645f..a09e18f
@@ -1,17 +1,16 @@
 #git:framework/web/wrt-plugins-common
 Name:       wrt-plugins-common
 Summary:    wrt-plugins common library
-Version:    0.3.132_w2
+Version:    1.0.15
 Release:    1
-VCS:        framework/web/wrt-plugins-common#submit/master/20130311.134353-36-gd21f1dd1a4093883baf25942eef0562263808726
 Group:      Development/Libraries
-License:    Apache License, Version 2.0
+License:    Apache-2.0 and BSD-2.0
 Source0:    %{name}-%{version}.tar.gz
 
 BuildRequires: cmake
+BuildRequires: pkgconfig(capi-appfw-application)
 BuildRequires: pkgconfig(dpl-efl)
 BuildRequires: pkgconfig(wrt-plugins-types)
-BuildRequires: pkgconfig(security-client)
 BuildRequires: pkgconfig(dpl-event-efl)
 BuildRequires: pkgconfig(ewebkit2)
 BuildRequires: pkgconfig(dpl-wrt-dao-ro)
@@ -43,19 +42,9 @@ wrt-plugins common library development headers
 %endif
 
 %build
-%if 0%{?sec_build_binary_debug_enable}
 export CFLAGS="$CFLAGS -DTIZEN_DEBUG_ENABLE"
 export CXXFLAGS="$CXXFLAGS -DTIZEN_DEBUG_ENABLE"
 export FFLAGS="$FFLAGS -DTIZEN_DEBUG_ENABLE"
-%endif
-
-%if "%{_repository}" == "wearable"
-ln -s src_wearable src
-%define device_profile "wearable"
-%else
-ln -s src_mobile src
-%define device_profile "mobile"
-%endif
 
 export LDFLAGS+="-Wl,--rpath=/usr/lib -Wl,--as-needed -Wl,--hash-style=both"
 
@@ -63,13 +52,13 @@ cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix}  \
         -DDPL_LOG="ON"                     \
         -DCMAKE_PROJECT_VERSION=%{version} \
         -DCMAKE_BUILD_TYPE=%{?build_type:%build_type} \
-        -DDEVICE_PROFILE=%{?device_profile:%device_profile} \
         %{?WITH_TESTS:-DWITH_TESTS=%WITH_TESTS}
 make %{?jobs:-j%jobs}
 
 %install
 mkdir -p %{buildroot}/usr/share/license
-cp LICENSE %{buildroot}/usr/share/license/%{name}
+cp LICENSE.APLv2 %{buildroot}/usr/share/license/%{name}
+cat LICENSE.BSD-2.0 >> %{buildroot}/usr/share/license/%{name}
 %make_install
 
 %clean
@@ -78,7 +67,6 @@ rm -rf %{buildroot}
 %post
 mkdir -p %{_libdir}/wrt-plugins
 mkdir -p /usr/etc/wrt/injected-javascript
-touch /opt/share/widget/plugin-installation-required
 
 %files
 %manifest wrt-plugins-common.manifest
@@ -86,22 +74,13 @@ touch /opt/share/widget/plugin-installation-required
 %{_libdir}/*.so
 %{_libdir}/*.so.*
 %{_libdir}/wrt-plugins/w3c-widget-interface/libwrt-plugins-w3c-widget-interface.so
-%attr(755,root,root) %{_bindir}/wrt-popup-ace-runtime
 %attr(755,root,root) %{_bindir}/wrt-popup-wrt-runtime
-%attr(755,root,root) %{_bindir}/wrt-plugins-installer
 %{_datadir}/license/%{name}
-%if "%{_repository}" == "wearable"
-/etc/smack/accesses2.d/wrt-popup-ace-runtime.rule
-/etc/smack/accesses2.d/wrt-popup-wrt-runtime.rule
-%else
-/etc/smack/accesses2.d/wrt-popup-ace-runtime.mobile.rule
-/etc/smack/accesses2.d/wrt-popup-wrt-runtime.mobile.rule
-/opt/etc/smack/accesses.d/wrt-popup-ace-runtime.mobile2.rule
-/opt/etc/smack/accesses.d/wrt-popup-wrt-runtime.mobile2.rule
-%endif
+/etc/smack/accesses.d/wrt-popup-wrt-runtime.efl
 %if %{with_tests}
     %attr(755,root,root) %{_bindir}/widgetdb_tests_prepare_db.sh
     %attr(755,root,root) %{_bindir}/wrt-plugins-common-tests-widgetdb
+    %attr(755,root,root) %{_bindir}/wrt-plugins-common-tests-Commons
 %endif
 
 %files devel
old mode 100644 (file)
new mode 100755 (executable)
index 937bcaf..03df62e
@@ -7,6 +7,6 @@ includedir=${prefix}/include/wrt-dispatch-event
 Name: wrt dispatch event support
 Description: Support to dispatch DOM event
 Version: @CMAKE_PROJECT_VERSION@
-Requires: dpl-efl ewebkit2
+Requires:
 Libs: -L${libdir} -lwrt-dispatch-event
 Cflags: -I${includedir}
old mode 100644 (file)
new mode 100755 (executable)
index 69b9f8f..9602018
@@ -6,6 +6,6 @@ includedir=${prefix}/include
 Name: wrt-plugin-loading
 Description: wrt-plugin-loading
 Version: @PROJECT_VERSION@
-Requires: dpl-efl dpl-wrt-dao-ro ewebkit2
-Libs: -lwrt-plugin-loading -L${libdir}
+Requires:
+Libs: -lwrt-plugin-loading -lwrt-xwalk-module -L${libdir}
 Cflags: -I${includedir}/wrt-plugin-loading -I${includedir}/wrt-plugins-common
old mode 100644 (file)
new mode 100755 (executable)
index b522b22..35ba534
@@ -7,6 +7,6 @@ includedir=${prefix}/include/${project_name}
 Name: WrtDeviceApis commons with JavaScrpt dependencies
 Description: Commons for DeviceApis with JavaScrpt dependencies
 Version: @CMAKE_PROJECT_VERSION@
-Requires: dpl-efl ewebkit2 wrt-plugins-commons
+Requires:
 Libs: -L${libdir} -lwrt-plugins-commons-javascript
 Cflags: -I${includedir}
old mode 100644 (file)
new mode 100755 (executable)
index e3c8c7a..a28894f
@@ -7,6 +7,6 @@ includedir=${prefix}/include/${project_name}
 Name: WrtDeviceApis commons
 Description: Commons for DeviceApis
 Version: @CMAKE_PROJECT_VERSION@
-Requires: dpl-efl
+Requires:
 Libs: -L${libdir} -lwrt-plugins-commons
 Cflags: -I${includedir}
old mode 100644 (file)
new mode 100755 (executable)
index 49563e1..6fb72f8
@@ -7,6 +7,6 @@ includedir=${prefix}/include/${project_name}
 Name: WebRuntime DeviceApis Filesystem module
 Description: WebRuntime Filesystem module
 Version: @CMAKE_PROJECT_VERSION@
-Requires: dpl-efl wrt-plugins-commons
+Requires:
 Libs: -L${libdir} -lwrt-plugins-filesystem
 Cflags: -I${includedir}/Filesystem
old mode 100644 (file)
new mode 100755 (executable)
index 8088720..ebcfd0c
@@ -7,6 +7,6 @@ includedir=${prefix}/include/${project_name}
 Name: wrt ipc message support
 Description: Support IPC between plugins and UI Process
 Version: @CMAKE_PROJECT_VERSION@
-Requires: dpl-efl ewebkit2
+Requires:
 Libs: -L${libdir} -lwrt-plugins-ipc-message
 Cflags: -I${includedir}
diff --git a/pkgconfigs/wrt-plugins-localstorage.pc.in b/pkgconfigs/wrt-plugins-localstorage.pc.in
new file mode 100755 (executable)
index 0000000..764c23f
--- /dev/null
@@ -0,0 +1,12 @@
+prefix=/usr
+project_name=@CMAKE_PROJECT_NAME@
+exec_prefix=${prefix}
+libdir=${prefix}/lib
+includedir=${prefix}/include/${project_name}
+
+Name: WebRuntime Local Storage module
+Description: WebRuntime Local Storage module
+Version: @CMAKE_PROJECT_VERSION@
+Requires:
+Libs: -L${libdir} -lwrt-plugins-localstorage
+Cflags: -I${includedir}/LocalStorage
old mode 100644 (file)
new mode 100755 (executable)
index c6a3faa..ee879b8
@@ -7,6 +7,6 @@ includedir=${prefix}/include/${project_name}
 Name: WebRuntime DeviceApis Plugin Manager module
 Description: WebRuntime Plugin Manager module
 Version: @CMAKE_PROJECT_VERSION@
-Requires: dpl-efl wrt-plugins-commons wrt-plugins-commons-javascript dpl-wrt-dao-ro ewebkit2
+Requires:
 Libs: -L${libdir} -lwrt-plugins-plugin-manager
 Cflags: -I${includedir}/PluginManager
old mode 100644 (file)
new mode 100755 (executable)
index 8792516..3540056
@@ -7,6 +7,6 @@ includedir=${prefix}/include/${project_name}
 Name: WebRuntime DeviceApis Widget Interface module
 Description: WebRuntime Widget Interface module
 Version: @CMAKE_PROJECT_VERSION@
-Requires: dpl-efl wrt-plugins-commons dpl-wrt-dao-ro wrt-plugins-localstorage wrt-commons-widget-interface-dao
+Requires:
 Libs: -L${libdir} -lwrt-plugins-widget-interface
 Cflags: -I${includedir}/WidgetInterface
diff --git a/pkgconfigs/wrt-plugins-widget.pc.in b/pkgconfigs/wrt-plugins-widget.pc.in
new file mode 100755 (executable)
index 0000000..1321a69
--- /dev/null
@@ -0,0 +1,12 @@
+prefix=/usr
+project_name=@CMAKE_PROJECT_NAME@
+exec_prefix=${prefix}
+libdir=${prefix}/lib
+includedir=${prefix}/include/${project_name}
+
+Name: WebRuntime DeviceApis Widget module
+Description: WebRuntime Widget module
+Version: @CMAKE_PROJECT_VERSION@
+Requires:
+Libs: -L${libdir} -lwrt-plugins-widget
+Cflags: -I${includedir}/Widget
old mode 100644 (file)
new mode 100755 (executable)
index 788423a..b7d152b
@@ -7,6 +7,6 @@ includedir=${prefix}/include/${project_name}
 Name: WebRuntime DeviceApis WidgetDB module
 Description: WebRuntime WidgetDB module
 Version: @CMAKE_PROJECT_VERSION@
-Requires: dpl-efl wrt-plugins-commons
+Requires:
 Libs: -L${libdir} -lwrt-plugins-widgetdb
 Cflags: -I${includedir}/WidgetDB
diff --git a/pkgconfigs/wrt-popup-ace-runner.pc.in b/pkgconfigs/wrt-popup-ace-runner.pc.in
deleted file mode 100644 (file)
index ad9605e..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-prefix=/usr
-project_name=@CMAKE_PROJECT_NAME@
-exec_prefix=${prefix}
-libdir=${prefix}/lib
-includedir=${prefix}/include/${project_name}
-
-Name: wrt-popup-runner
-Description:  Library with function to run wrt runtime popup
-Version: @CMAKE_PROJECT_VERSION@
-Requires: dpl-efl dpl-dbus-efl elementary security-client
-Libs: -L${libdir} -lwrt-popup-ace-runner
-Cflags: -I${includedir}
old mode 100644 (file)
new mode 100755 (executable)
index ad9605e..795dc43
@@ -7,6 +7,6 @@ includedir=${prefix}/include/${project_name}
 Name: wrt-popup-runner
 Description:  Library with function to run wrt runtime popup
 Version: @CMAKE_PROJECT_VERSION@
-Requires: dpl-efl dpl-dbus-efl elementary security-client
-Libs: -L${libdir} -lwrt-popup-ace-runner
+Requires:
+Libs: -L${libdir} -lwrt-popup-runner
 Cflags: -I${includedir}
old mode 100644 (file)
new mode 100755 (executable)
index a7b830f..8e0016c
@@ -7,6 +7,6 @@ includedir=${prefix}/include/${project_name}
 Name: wrt-popup-runner
 Description:  Library with function to run wrt runtime popup
 Version: @CMAKE_PROJECT_VERSION@
-Requires: dpl-efl
+Requires:
 Libs: -L${libdir} -lwrt-popup-wrt-runner
 Cflags: -I${includedir}
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100755 (executable)
index 0000000..6f53a4b
--- /dev/null
@@ -0,0 +1,70 @@
+# 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.
+#
+# Includes CMake configuration file (*.cmake), preserving appropriate paths.
+
+ADD_DEFINITIONS("-DWRT_PLUGINS_COMMON_LOG")
+
+MACRO(include_config_file INCLUDED_CONFIG_FILE_PATH)
+  GET_FILENAME_COMPONENT(CURRENT_CONFIG_FILE_PATH ${CMAKE_CURRENT_LIST_FILE} PATH)
+  INCLUDE(${CURRENT_CONFIG_FILE_PATH}/${INCLUDED_CONFIG_FILE_PATH}/${CONFIG_FILE_NAME} OPTIONAL)
+ENDMACRO()
+
+# Gets actual path for CMake configuration file (*.cmake).
+# By default, if no argument is passed, current path will be set to variable
+# named CURRENT_PATH.
+# @param [Optional] Name of the variable to set with current path.
+MACRO(get_current_path)
+  SET(VARIABLE "CURRENT_PATH")
+  IF(${ARGC} GREATER 0)
+    SET(VARIABLE ${ARGV0})
+  ENDIF()
+  GET_FILENAME_COMPONENT(${VARIABLE} ${CMAKE_CURRENT_LIST_FILE} PATH)
+ENDMACRO()
+
+SET(HOST_ARCH $ENV{DEB_HOST_ARCH})
+IF("${HOST_ARCH}" MATCHES "armel")
+    SET(HOST_ARCH "armel")
+ENDIF()
+
+#target names
+SET(TARGET_PLUGIN_LOADING_LIB "wrt-plugin-loading")
+SET(TARGET_COMMONS "wrt-plugins-commons")
+SET(TARGET_COMMONS_JAVASCRIPT "wrt-plugins-commons-javascript")
+SET(TARGET_JS_OVERLAY "wrt-plugins-js-overlay")
+SET(TARGET_POPUP_WRT "wrt-popup-wrt-runtime")
+SET(TARGET_POPUP_WRT_RUNNER_LIB "wrt-popup-wrt-runner")
+SET(TARGET_PLUGINS_API_SUPPORT "wrt-plugins-api-support")
+SET(TARGET_PLUGINS_IPC_MESSAGE_LIB "wrt-plugins-ipc-message")
+SET(TARGET_XWALK_MODULE_LIB "wrt-xwalk-module")
+
+SET(PLUGIN_LOADING_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/plugin-loading)
+SET(PLUGINS_API_SUPPORT_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/plugins-api-support)
+SET(PLUGINS_IPC_MESSAGE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/plugins-ipc-message)
+
+ADD_SUBDIRECTORY(plugins-api-support)
+ADD_SUBDIRECTORY(plugin-loading)
+ADD_SUBDIRECTORY(js-overlay)
+ADD_SUBDIRECTORY(Commons)
+ADD_SUBDIRECTORY(CommonsJavaScript)
+ADD_SUBDIRECTORY(dispatch-event)
+ADD_SUBDIRECTORY(modules)
+ADD_SUBDIRECTORY(standards)
+ADD_SUBDIRECTORY(wrt-popup)
+
+# wrt-plugins-installer has been integrated into wrt-instaler 
+#ADD_SUBDIRECTORY(plugins-installer)
+
+ADD_SUBDIRECTORY(plugins-ipc-message)
+ADD_SUBDIRECTORY(xwalk-module)
similarity index 51%
rename from src_mobile/Commons/CMakeLists.txt
rename to src/Commons/CMakeLists.txt
index 6b58193..52bc1d1 100644 (file)
 #    See the License for the specific language governing permissions and
 #    limitations under the License.
 #
-macro(install_header_file HEADER_FILE)
+MACRO(install_header_file HEADER_FILE)
     INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${HEADER_FILE}
         DESTINATION ${DESTINATION_HEADERS_NON_JS})
-endmacro()
+ENDMACRO()
 
-macro(install_wrtaccess_header_file HEADER_FILE)
+MACRO(install_wrtaccess_header_file HEADER_FILE)
     INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${HEADER_FILE}
         DESTINATION ${DESTINATION_HEADERS_NON_JS}/WrtAccess)
-endmacro()
+ENDMACRO()
 
-macro(install_widget_interface_header_file HEADER_FILE)
+MACRO(install_widget_interface_header_file HEADER_FILE)
     INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${HEADER_FILE}
         DESTINATION ${DESTINATION_HEADERS_NON_JS}/WidgetInterface)
-endmacro()
+ENDMACRO()
 
-include_config_file(WrtAccess)
+INCLUDE_CONFIG_FILE(WrtAccess)
 
-pkg_search_module(plugin-types REQUIRED wrt-plugins-types)
-pkg_search_module(ace-client REQUIRED security-client)
-pkg_search_module(dpl-event REQUIRED dpl-event-efl)
-pkg_search_module(icu REQUIRED icu-i18n)
+PKG_SEARCH_MODULE(plugin-types REQUIRED wrt-plugins-types)
+PKG_SEARCH_MODULE(dpl-event REQUIRED dpl-event-efl)
+PKG_SEARCH_MODULE(icu REQUIRED icu-i18n)
+PKG_SEARCH_MODULE(pcrecpp REQUIRED libpcrecpp)
 
-set(WRT_COMMONS_DEPENDECIES_INCLUDES
+SET(WRT_COMMONS_DEPENDECIES_INCLUDES
     ${wrt-plugin-api_INCLUDE_DIRS}
     ${ace-client_INCLUDE_DIRS}
     ${plugin-types_INCLUDE_DIRS}
     ${icu_INCLUDE_DIRS}
     )
 
-include_directories(${WRT_COMMONS_DEPENDECIES_INCLUDES})
+INCLUDE_DIRECTORIES(${WRT_COMMONS_DEPENDECIES_INCLUDES})
 
-set(TARGET_NAME ${TARGET_COMMONS})
+SET(TARGET_NAME ${TARGET_COMMONS})
 
-set(SRCS
+SET(SRCS
   ${SRCS_WRT_ACCESS}
   ${CMAKE_CURRENT_SOURCE_DIR}/Base64.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/FunctionDefinition.cpp
@@ -56,51 +56,52 @@ set(SRCS
   ${CMAKE_CURRENT_SOURCE_DIR}/ThreadPool.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/JSObjectDeclaration.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/JSObject.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/TimeUtils.cpp
   #PARENT_SCOPE
 )
 
-add_library(${TARGET_NAME} SHARED ${SRCS})
-target_link_libraries(${TARGET_NAME}
+ADD_LIBRARY(${TARGET_NAME} SHARED ${SRCS})
+TARGET_LINK_LIBRARIES(${TARGET_NAME}
   ${LIBS_COMMONS}
   ${ace-client_LIBRARIES}
   ${dpl-event_LIBRARIES}
   ${icu_LIBRARIES}
+  ${pcrecpp_LIBRARIES}
   ${TARGET_POPUP_ACE_RUNNER_LIB}
 )
 
-set_target_properties(${TARGET_NAME} PROPERTIES
+SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES
+    COMPILE_DEFINITIONS LOG_TAG="${LOG_TAG}")
+
+SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES
  SOVERSION ${CMAKE_PROJECT_API_VERSION}
  VERSION ${CMAKE_PROJECT_VERSION}
 )
 
 INSTALL(TARGETS ${TARGET_NAME} LIBRARY DESTINATION ${DESTINATION_LIB_PREFIX})
 
-install_header_file(FunctionDeclaration.h)
-install_header_file(FunctionDefinition.h)
-install_header_file(Base64.h)
-install_header_file(Deprecated.h)
-install_header_file(Dimension.h)
-install_header_file(Emitters.h)
-install_header_file(EventListener.h)
-install_header_file(EventReceiver.h)
-install_header_file(Exception.h)
-install_header_file(IEvent.h)
-install_header_file(IExternEventCanceler.h)
-install_header_file(ListenerEventEmitter.h)
-install_header_file(ListenerEvent.h)
-install_header_file(Range.h)
-install_header_file(Regex.h)
-install_header_file(RegexPatterns.h)
-install_header_file(RegexUtils.h)
-install_header_file(StaticAssert.h)
-install_header_file(StringBuilder.h)
-install_header_file(StringUtils.h)
-install_header_file(ThreadPool.h)
-install_header_file(TypesDeclaration.h)
-install_header_file(TypeTraits.h)
-install_header_file(plugin_initializer_def.h)
-install_header_file(JSObjectDeclaration.h)
-install_header_file(JSObject.h)
-install_header_file(TimeUtils.h)
-install_wrtaccess_header_file(WrtAccess/WrtAccess.h)
+INSTALL_HEADER_FILE(FunctionDeclaration.h)
+INSTALL_HEADER_FILE(FunctionDefinition.h)
+INSTALL_HEADER_FILE(Base64.h)
+INSTALL_HEADER_FILE(Dimension.h)
+INSTALL_HEADER_FILE(Emitters.h)
+INSTALL_HEADER_FILE(EventListener.h)
+INSTALL_HEADER_FILE(EventReceiver.h)
+INSTALL_HEADER_FILE(Exception.h)
+INSTALL_HEADER_FILE(IEvent.h)
+INSTALL_HEADER_FILE(IExternEventCanceler.h)
+INSTALL_HEADER_FILE(ListenerEventEmitter.h)
+INSTALL_HEADER_FILE(ListenerEvent.h)
+INSTALL_HEADER_FILE(Range.h)
+INSTALL_HEADER_FILE(Regex.h)
+INSTALL_HEADER_FILE(RegexPatterns.h)
+INSTALL_HEADER_FILE(RegexUtils.h)
+INSTALL_HEADER_FILE(StaticAssert.h)
+INSTALL_HEADER_FILE(StringBuilder.h)
+INSTALL_HEADER_FILE(StringUtils.h)
+INSTALL_HEADER_FILE(ThreadPool.h)
+INSTALL_HEADER_FILE(TypesDeclaration.h)
+INSTALL_HEADER_FILE(TypeTraits.h)
+INSTALL_HEADER_FILE(plugin_initializer_def.h)
+INSTALL_HEADER_FILE(JSObjectDeclaration.h)
+INSTALL_HEADER_FILE(JSObject.h)
+INSTALL_WRTACCESS_HEADER_FILE(WrtAccess/WrtAccess.h)
similarity index 88%
rename from src_mobile/Commons/Emitters.h
rename to src/Commons/Emitters.h
index 7b1d8c2..8069e78 100644 (file)
@@ -23,8 +23,7 @@
 #include <cstddef>
 #include <map>
 #include <memory>
-#include <dpl/mutex.h>
-#include <dpl/shared_ptr.h>
+#include <mutex>
 #include <Commons/ListenerEventEmitter.h>
 
 namespace WrtDeviceApis {
@@ -38,16 +37,16 @@ class Emitters
 {
   public:
     typedef EmitterClass EmitterType;
-    typedef DPL::SharedPtr<EmitterType>           EmitterPtrType;
+    typedef std::shared_ptr<EmitterType>           EmitterPtrType;
     typedef typename EmitterType::IdType EmitterIdType;
     typedef typename EmitterType::EventType EventType;
     typedef typename EmitterType::EventPtrType EventPtrType;
-    typedef std::auto_ptr<DPL::Mutex::ScopedLock> LockType;
+    typedef std::shared_ptr<std::lock_guard<std::mutex>> LockType;
 
   public:
     ~Emitters()
     {
-        DPL::Mutex::ScopedLock lock(&m_mtx);
+        std::lock_guard<std::mutex> lock(m_mtx);
         m_emitters.clear();
     }
 
@@ -58,7 +57,7 @@ class Emitters
      */
     void attach(const EmitterPtrType& emitter)
     {
-        DPL::Mutex::ScopedLock lock(&m_mtx);
+        std::lock_guard<std::mutex> lock(m_mtx);
         m_emitters[emitter->getId()] = emitter;
     }
 
@@ -71,7 +70,7 @@ class Emitters
      */
     bool detach(const EmitterIdType id)
     {
-        DPL::Mutex::ScopedLock lock(&m_mtx);
+        std::lock_guard<std::mutex> lock(m_mtx);
         return (m_emitters.erase(id) > 0);
     }
 
@@ -82,7 +81,7 @@ class Emitters
      */
     void emit(const EventPtrType& event)
     {
-        DPL::Mutex::ScopedLock lock(&m_mtx);
+        std::lock_guard<std::mutex> lock(m_mtx);
         for (Iterator it = m_emitters.begin(); it != m_emitters.end(); ++it) {
             it->second->emit(event);
         }
@@ -100,7 +99,7 @@ class Emitters
     void emitIf(const EventPtrType& event,
                 Predicate pred)
     {
-        DPL::Mutex::ScopedLock lock(&m_mtx);
+        std::lock_guard<std::mutex> lock(m_mtx);
         for (Iterator it = m_emitters.begin(); it != m_emitters.end(); ++it) {
             if (bool(pred(it->second))) {
                 it->second->emit(event);
@@ -140,7 +139,7 @@ class Emitters
      */
     LockType getLock()
     {
-        return LockType(new DPL::Mutex::ScopedLock(&m_mtx));
+        return LockType(new std::lock_guard<std::mutex>(m_mtx));
     }
 
   private:
@@ -149,7 +148,7 @@ class Emitters
     typedef typename Map::const_iterator ConstIterator;
 
   private:
-    DPL::Mutex m_mtx; ///< Synchronizes operation on this object.
+    std::mutex m_mtx; ///< Synchronizes operation on this object.
     Map m_emitters; ///< Emitters container.
 };
 }
similarity index 81%
rename from src_mobile/Commons/EventListener.h
rename to src/Commons/EventListener.h
index f059082..eab6e95 100644 (file)
@@ -16,7 +16,8 @@
 #ifndef WRTDEVICEAPIS_COMMONS_EVENT_LISTENER_H_
 #define WRTDEVICEAPIS_COMMONS_EVENT_LISTENER_H_
 
-#include <dpl/shared_ptr.h>
+#include <memory>
+
 #include <Commons/ThreadPool.h>
 #include <Commons/EventReceiver.h>
 
@@ -35,22 +36,22 @@ class EventListener : private EventReceiver<TemplateEvent>
         EventReceiver<TemplateEvent>(threadType)
     {}
 
-    virtual void onAnswerReceived(const DPL::SharedPtr<TemplateEvent>& event) =
-        0;
+    virtual void onAnswerReceived(const std::shared_ptr<TemplateEvent>& event) = 0;
 
-    void postAnswer(const DPL::SharedPtr<TemplateEvent>& event)
+    void postAnswer(const std::shared_ptr<TemplateEvent>& event)
     {
-        DPL::Event::ControllerEventHandler<DPL::SharedPtr<TemplateEvent> >::
+        DPL::Event::ControllerEventHandler<std::shared_ptr<TemplateEvent> >::
             PostEvent(
             event);
     }
 
   protected:
-    void OnEventReceived(const DPL::SharedPtr<TemplateEvent> &event)
+    void OnEventReceived(const std::shared_ptr<TemplateEvent> &event)
     {
         onAnswerReceived(event);
     }
 };
+
 }
 } // WrtDeviceApisCommon
 
similarity index 81%
rename from src_mobile/Commons/EventReceiver.h
rename to src/Commons/EventReceiver.h
index 3d7c67b..7a46e36 100644 (file)
 #ifndef WRTDEVICEAPIS_COMMONS_EVENT_RECEIVER_H_
 #define WRTDEVICEAPIS_COMMONS_EVENT_RECEIVER_H_
 
+#include <memory>
+#include <mutex>
 #include <assert.h>
 #include <dpl/event/thread_event_dispatcher.h>
-#include <dpl/shared_ptr.h>
 #include <dpl/event/controller.h>
 #include <dpl/type_list.h>
 #include <dpl/event/abstract_event_call.h>
+#include <dpl/log/log.h>
 #include <dpl/log/secure_log.h>
 #include <Commons/ThreadPool.h>
 
@@ -35,11 +37,11 @@ namespace Commons {
 template<class TemplateEvent>
 class SignalEventCall : public DPL::Event::AbstractEventCall
 {
-    DPL::SharedPtr<TemplateEvent> m_event;
+    std::shared_ptr<TemplateEvent> m_event;
 
   public:
 
-    SignalEventCall(const DPL::SharedPtr<TemplateEvent> &event) : m_event(event)
+    SignalEventCall(const std::shared_ptr<TemplateEvent> &event) : m_event(event)
     {}
     virtual void Call()
     {
@@ -51,7 +53,7 @@ class SignalEventCall : public DPL::Event::AbstractEventCall
 template<class TemplateEvent>
 class EventReceiver :
     protected DPL::Event::Controller<
-        typename DPL::TypeListDecl<DPL::SharedPtr<TemplateEvent> >::Type>
+        typename DPL::TypeListDecl<std::shared_ptr<TemplateEvent> >::Type>
 {
     DPL::Event::ThreadEventDispatcher m_threadDispatcher;
 
@@ -61,13 +63,13 @@ class EventReceiver :
     {
         DPL::Thread *thread =
             ThreadPool::getInstance().getThreadRef(threadType);
-        DPL::Event::ControllerEventHandler<DPL::SharedPtr<TemplateEvent> >::
+        DPL::Event::ControllerEventHandler<std::shared_ptr<TemplateEvent> >::
             Touch();
-        DPL::Event::ControllerEventHandler<DPL::SharedPtr<TemplateEvent> >::
+        DPL::Event::ControllerEventHandler<std::shared_ptr<TemplateEvent> >::
             SwitchToThread(thread);
     }
 
-    void signalEventByDispatcher(const DPL::SharedPtr<TemplateEvent> &event)
+    void signalEventByDispatcher(const std::shared_ptr<TemplateEvent> &event)
     {
         _D("called");
         Try {
@@ -86,7 +88,7 @@ class EventReceiver :
 
     virtual ~EventReceiver()
     {
-        DPL::Event::ControllerEventHandler<DPL::SharedPtr<TemplateEvent> >::
+        DPL::Event::ControllerEventHandler<std::shared_ptr<TemplateEvent> >::
             SwitchToThread(NULL);
     }
 };
@@ -98,21 +100,21 @@ class EventRequestReceiver : private EventReceiver<TemplateEvent>
     EventRequestReceiver(ThreadEnum::Enumeration threadType) : EventReceiver<
             TemplateEvent>(threadType)
     {}
-    virtual void OnRequestReceived(const DPL::SharedPtr<TemplateEvent> &event)
-        = 0;
+
+    virtual void OnRequestReceived(const std::shared_ptr<TemplateEvent> &) = 0;
 
     /*
      *
      * @argument delaySeconds - event will be received not sooner than after
      * delay (in seconds)
      */
-    void PostRequest(const DPL::SharedPtr<TemplateEvent> &event,
+    void PostRequest(const std::shared_ptr<TemplateEvent> &event,
                      double delaySeconds = 0.0)
     {
         _D("called");
         {
-            DPL::Mutex::ScopedLock lock(&event->m_stateMutex);
-            assert(TemplateEvent::STATE_INITIAL == event->m_state);
+            std::lock_guard<std::mutex> lock(event->m_stateMutex);
+            Assert(TemplateEvent::STATE_INITIAL == event->m_state);
             event->m_state = TemplateEvent::STATE_REQUEST_SEND;
         }
 
@@ -123,18 +125,18 @@ class EventRequestReceiver : private EventReceiver<TemplateEvent>
         }
 
         if (0.0 == delaySeconds) {
-            DPL::Event::ControllerEventHandler<DPL::SharedPtr<TemplateEvent> >
+            DPL::Event::ControllerEventHandler<std::shared_ptr<TemplateEvent> >
                 ::
                 PostEvent(event);
         } else {
-            DPL::Event::ControllerEventHandler<DPL::SharedPtr<TemplateEvent> >
+            DPL::Event::ControllerEventHandler<std::shared_ptr<TemplateEvent> >
                 ::
                 PostTimedEvent(event, delaySeconds);
         }
 
         switch (event->getHandlingType()) {
         case TemplateEvent::HANDLING_NOT_SET:
-            assert(0);
+            Assert(0);
             break;
         case TemplateEvent::HANDLING_SYNCHRONOUS:
             event->waitForAnswer();
@@ -142,11 +144,11 @@ class EventRequestReceiver : private EventReceiver<TemplateEvent>
         }
     }
 
-    void OnEventReceived(const DPL::SharedPtr<TemplateEvent> &event)
+    void OnEventReceived(const std::shared_ptr<TemplateEvent> &event)
     {
         _D("called");
         {
-            DPL::Mutex::ScopedLock lock(&event->m_stateMutex);
+            std::lock_guard<std::mutex> lock(event->m_stateMutex);
             if (event->m_cancelled) {
                 event->handleCancel();
                 event->m_cancelAllowed = true;
@@ -154,7 +156,7 @@ class EventRequestReceiver : private EventReceiver<TemplateEvent>
                 event->signalFinishedFlag();
                 return;
             } else {
-                assert(
+                Assert(
                     TemplateEvent::STATE_REQUEST_SEND == event->m_state &&
                     "Wrong state!");
             }
@@ -166,7 +168,7 @@ class EventRequestReceiver : private EventReceiver<TemplateEvent>
         //After Controller ends processing it should call it to signal that work
         // is done
         {
-            DPL::Mutex::ScopedLock lock(&event->m_stateMutex);
+            std::lock_guard<std::mutex> lock(event->m_stateMutex);
 
             if (event->m_cancelled) {
                 //if cancel was not handled in OnRequestReceived when we should
@@ -189,7 +191,7 @@ class EventRequestReceiver : private EventReceiver<TemplateEvent>
 
         switch (event->m_handlingType) {
         case TemplateEvent::HANDLING_NOT_SET:
-            assert(0);
+            Assert(0);
             break;
         case TemplateEvent::HANDLING_SYNCHRONOUS:
             //event->Signal();
@@ -211,16 +213,16 @@ class EventRequestReceiver : private EventReceiver<TemplateEvent>
         }
     }
 
-    virtual void ManualAnswer(const DPL::SharedPtr<TemplateEvent> &event)
+    virtual void ManualAnswer(const std::shared_ptr<TemplateEvent> &event)
     {
         _D("called");
-        assert(
+        Assert(
             event->m_handlingType ==
             TemplateEvent::HANDLING_ASYNCHRONOUS_MANUAL_ANSWER ||
             event->m_handlingType ==
             TemplateEvent::HANDLING_SYNCHRONOUS_MANUAL_ANSWER);
         {
-            DPL::Mutex::ScopedLock lock(&event->m_stateMutex);
+            std::lock_guard<std::mutex> lock(event->m_stateMutex);
             if (event->m_cancelled) {
                 //if cancel was not handled in OnRequestReceived when we should
                 //process as if it was not cancelled at all.
@@ -259,25 +261,24 @@ class EventAnswerReceiver : private EventReceiver<TemplateEvent>
             TemplateEvent>(threadType)
     {}
 
-    virtual void OnAnswerReceived(const DPL::SharedPtr<TemplateEvent> &event) =
-        0;
+    virtual void OnAnswerReceived(const std::shared_ptr<TemplateEvent> &) = 0;
 
     //it should be hidden outside, but I can't do it! I can't! :|
-    void PostAnswer(const DPL::SharedPtr<TemplateEvent> &event)
+    void PostAnswer(const std::shared_ptr<TemplateEvent> &event)
     {
-        LogDebug(__FUNCTION__);
+        _D("called");
         event->signalCancelStatusFlag();
-        DPL::Event::ControllerEventHandler<DPL::SharedPtr<TemplateEvent> >::
+        DPL::Event::ControllerEventHandler<std::shared_ptr<TemplateEvent> >::
             PostEvent(
             event);
     }
 
-    void OnEventReceived(const DPL::SharedPtr<TemplateEvent> &event)
+    void OnEventReceived(const std::shared_ptr<TemplateEvent> &event)
     {
         _D("EventAnswerReceiver: answer received");
         //check if it can be processed and set the state
         {
-            DPL::Mutex::ScopedLock lock(&event->m_stateMutex);
+            std::lock_guard<std::mutex> lock(event->m_stateMutex);
 
             //in case someone changed it to synchronous call, we don't process
             // it
@@ -288,7 +289,7 @@ class EventAnswerReceiver : private EventReceiver<TemplateEvent>
                 return;
             }
             //we should get cancelled or answer_send state here
-            assert(
+            Assert(
                 TemplateEvent::STATE_ANSWER_SEND == event->m_state &&
                 "Wrong state!");
 
@@ -303,8 +304,8 @@ class EventAnswerReceiver : private EventReceiver<TemplateEvent>
         OnAnswerReceived(event);
 
         {
-            DPL::Mutex::ScopedLock lock(&event->m_stateMutex);
-            assert(TemplateEvent::STATE_ANSWER_RECEIVED == event->m_state);
+            std::lock_guard<std::mutex> lock(event->m_stateMutex);
+            Assert(TemplateEvent::STATE_ANSWER_RECEIVED == event->m_state);
             event->m_state = TemplateEvent::STATE_ENDED;
             delete event->m_cancelStatusFlag;
             event->m_cancelStatusFlag = NULL;
similarity index 70%
rename from src_mobile/Commons/Exception.h
rename to src/Commons/Exception.h
index 0f1db99..78eba65 100644 (file)
 #ifndef WRTDEVICEAPIS_COMMONS_EXCEPTION_H_
 #define WRTDEVICEAPIS_COMMONS_EXCEPTION_H_
 
+#include <string>
 #include <dpl/exception.h>
 
 namespace WrtDeviceApis {
 namespace Commons {
-#define PLUGINS_DECLARE_EXCEPTION_TYPE(BaseClass, Class) \
-    class Class :       \
-        public BaseClass \
-    { \
-        ExceptionCodes::Enumeration m_code; \
-      public: \
-        virtual ExceptionCodes::Enumeration getCode() const { return m_code; } \
-        Class(const char *path, \
-              const char *function, \
-              int line, \
-              const std::string & message = std::string()) :                                                                                               \
-            BaseClass(path, function, line, message) \
-        { \
-            BaseClass::m_className = #Class; \
-            m_code = ExceptionCodes::Class; \
-        } \
- \
-        Class(const char *path, \
-              const char *function, \
-              int line, \
-              const DPL::Exception & reason, \
-              const std::string & message = std::string()) :                                                                                                                             \
-            BaseClass(path, function, line, reason, message) \
-        { \
-            BaseClass::m_className = #Class; \
-            m_code = ExceptionCodes::Class; \
-        } \
+#define PLUGINS_DECLARE_EXCEPTION_TYPE(BaseClass, Class)                       \
+    class Class : public BaseClass                                             \
+    {                                                                          \
+    public:                                                                    \
+        Class() = default;                                                     \
+                                                                               \
+        Class(const char *path,                                                \
+              const char *function,                                            \
+              int line,                                                        \
+              const std::string & message = std::string()) :                   \
+            BaseClass(path, function, line, message)                           \
+        { }                                                                    \
+                                                                               \
+        Class(const char *path,                                                \
+              const char *function,                                            \
+              int line,                                                        \
+              const DPL::Exception & reason,                                   \
+              const std::string & message = std::string()) :                   \
+            BaseClass(path, function, line, reason, message)                   \
+        { }                                                                    \
+                                                                               \
+        virtual ::WrtDeviceApis::Commons::ExceptionCodes::Enumeration getCode() const  \
+        {                                                                      \
+            return ::WrtDeviceApis::Commons::ExceptionCodes::Class;            \
+        }                                                                      \
     };
 
 class ExceptionCodes
similarity index 84%
rename from src_wearable/Commons/FunctionDeclaration.h
rename to src/Commons/FunctionDeclaration.h
index d603c49..f15c386 100644 (file)
@@ -104,13 +104,6 @@ typedef WrtDeviceApis::Commons::AceFunction (&AceFunctionGetter)(const std::
 
 namespace WrtDeviceApis {
 namespace Commons {
-enum class AceSecurityStatus
-{
-    AccessGranted,
-    AccessDenied,
-    PrivacyDenied,
-    InternalError
-};
 
 template <typename ... Args>
 class DefaultArgsVerifier
@@ -132,36 +125,6 @@ class DefaultArgsVerifier<>
     {}
 };
 
-template <typename FunctionGetter,
-          typename ArgumentsVerifier,
-          typename ... Args>
-AceSecurityStatus aceCheckAccess(
-    const FunctionGetter& f,
-    const char* functionName,
-    Args && ... args)
-{
-    using namespace WrtDeviceApis::Commons;
-
-    AceFunction aceFunction = f(functionName);
-
-    ArgumentsVerifier argsVerify;
-    argsVerify(aceFunction, args ...);
-
-    WrtAccess::CheckAccessReturnType ret =
-        WrtAccessSingleton::Instance().checkAccessControl(aceFunction);
-
-    if (ret == WrtAccess::CHECK_ACCESS_PRIVILEGE_DENIED) {
-        return AceSecurityStatus::AccessDenied;
-    }
-    else if (ret == WrtAccess::CHECK_ACCESS_PRIVACY_DENIED) {
-        return AceSecurityStatus::PrivacyDenied;
-    }
-    else if (ret == WrtAccess::CHECK_ACCESS_INTERNAL_ERROR) {
-        return AceSecurityStatus::InternalError;
-    }
-
-    return AceSecurityStatus::AccessGranted;
-}
 }
 } // WrtDeviceApisCommon
 
similarity index 90%
rename from src_mobile/Commons/IEvent.h
rename to src/Commons/IEvent.h
index 207f5bb..939a807 100644 (file)
 #ifndef WRTDEVICEAPIS_COMMONS_IEVENT_H_
 #define WRTDEVICEAPIS_COMMONS_IEVENT_H_
 
+#include <memory>
+#include <mutex>
+
 #include <assert.h>
+#include <dpl/log/log.h>
 #include <dpl/event/controller.h>
-#include <dpl/mutex.h>
-#include <dpl/shared_ptr.h>
 #include <Commons/Exception.h>
 #include <Commons/EventReceiver.h>
 
@@ -40,7 +42,7 @@ class IEventPrivateData
 
 class IEventController
 {
-    DPL::SharedPtr<IEventPrivateData> m_privateData;
+    std::shared_ptr<IEventPrivateData> m_privateData;
 
   public:
     virtual void waitTillProcessed() = 0;
@@ -54,16 +56,16 @@ class IEventController
     {}
 
     void setPrivateData(
-        const DPL::SharedPtr<IEventPrivateData> &privateData)
+        const std::shared_ptr<IEventPrivateData> &privateData)
     {
         m_privateData = privateData;
     }
-    const DPL::SharedPtr<IEventPrivateData>& getPrivateData()
+    const std::shared_ptr<IEventPrivateData>& getPrivateData()
     {
         return m_privateData;
     }
 };
-typedef DPL::SharedPtr<IEventController> IEventControllerPtr;
+typedef std::shared_ptr<IEventController> IEventControllerPtr;
 
 // CRTP pattern
 template<class Super>
@@ -106,7 +108,7 @@ class IEvent : /*private DPL::WaitableEvent, */ public IEventController
     }
 
   protected:
-    DPL::Mutex m_stateMutex;
+    std::mutex m_stateMutex;
     State m_state;
     HandlingType m_handlingType;
     EventAnswerReceiver< Super > *m_remoteController;
@@ -133,10 +135,10 @@ class IEvent : /*private DPL::WaitableEvent, */ public IEventController
 
     virtual void waitForAnswer()
     {
-        assert(HANDLING_SYNCHRONOUS == m_handlingType);
+        Assert(HANDLING_SYNCHRONOUS == m_handlingType);
         DPL::WaitForSingleHandle(m_synchronousEventFlag->GetHandle());
         {
-            DPL::Mutex::ScopedLock lock(&m_stateMutex);
+            std::lock_guard<std::mutex> lock(m_stateMutex);
             m_state = STATE_ENDED;
         }
         signalFinishedFlag();
@@ -163,7 +165,7 @@ class IEvent : /*private DPL::WaitableEvent, */ public IEventController
     void signalCancelStatusFlag()
     {
         LogDebug("signaling cancel");
-        DPL::Mutex::ScopedLock lock(&m_stateMutex);
+        std::lock_guard<std::mutex> lock(m_stateMutex);
         m_cancelSignalAhead = true;
         if (m_cancelStatusFlag) {
             m_cancelStatusFlag->Signal();
@@ -233,7 +235,7 @@ class IEvent : /*private DPL::WaitableEvent, */ public IEventController
 
     virtual bool setForSynchronousCall()
     {
-        DPL::Mutex::ScopedLock lock(&m_stateMutex);
+        std::lock_guard<std::mutex> lock(m_stateMutex);
         if (m_cancelled) {
             return false;
         }
@@ -254,7 +256,7 @@ class IEvent : /*private DPL::WaitableEvent, */ public IEventController
     virtual bool setForAsynchronousCall(
         EventAnswerReceiver< Super > *remoteController)
     {
-        DPL::Mutex::ScopedLock lock(&m_stateMutex);
+        std::lock_guard<std::mutex> lock(m_stateMutex);
         if (m_cancelled) {
             return false;
         }
@@ -280,11 +282,11 @@ class IEvent : /*private DPL::WaitableEvent, */ public IEventController
      */
     virtual bool switchToManualAnswer()
     {
-        assert(
+        Assert(
             m_handlingType == HANDLING_ASYNCHRONOUS || m_handlingType ==
             HANDLING_SYNCHRONOUS);
 
-        DPL::Mutex::ScopedLock lock(&m_stateMutex);
+        std::lock_guard<std::mutex> lock(m_stateMutex);
         if (m_cancelled) {
             return false;
         }
@@ -312,13 +314,13 @@ class IEvent : /*private DPL::WaitableEvent, */ public IEventController
 
     bool checkCancelled()
     {
-        //DPL::Mutex::ScopedLock lock(&m_stateMutex);
+        //std::lock_guard<std::mutex> lock(m_stateMutex);
         return m_cancelled;
     }
 
     void tryCancelled()
     {
-        //DPL::Mutex::ScopedLock lock(&m_stateMutex);
+        //std::lock_guard<std::mutex> lock(m_stateMutex);
         if (m_cancelled) {
             Throw(Commons::EventCancelledException);
         }
@@ -337,17 +339,17 @@ class IEvent : /*private DPL::WaitableEvent, */ public IEventController
     bool cancelRequest()
     {
         LogDebug("trying to cancel");
-        assert(HANDLING_ASYNCHRONOUS == m_handlingType ||
+        Assert(HANDLING_ASYNCHRONOUS == m_handlingType ||
                HANDLING_ASYNCHRONOUS_MANUAL_ANSWER == m_handlingType);
         bool signaled = false;
         {
-            DPL::Mutex::ScopedLock lock(&m_stateMutex);
+            std::lock_guard<std::mutex> lock(m_stateMutex);
             if (m_cancelled) {
                 return false;
             }
             switch (m_state) {
             case STATE_INITIAL:
-                assert(0);
+                Assert(0);
             case STATE_ANSWER_SEND:
                 LogDebug("cancelling");
                 m_cancelled = true;
similarity index 91%
rename from src_mobile/Commons/IExternEventCanceler.h
rename to src/Commons/IExternEventCanceler.h
index 5a7a7e0..a653f19 100644 (file)
@@ -22,7 +22,9 @@
 #ifndef WRTDEVICEAPIS_COMMONS_IEXTERN_EVENT_CANCELER_H_
 #define WRTDEVICEAPIS_COMMONS_IEXTERN_EVENT_CANCELER_H_
 
-#include <dpl/shared_ptr.h>
+#include <memory>
+
+#include <dpl/log/log.h>
 
 namespace WrtDeviceApis {
 namespace Commons {
@@ -37,7 +39,7 @@ template<class TemplateEvent>
 class IExternEventCanceler
 {
   public:
-    virtual void OnCancelEvent(const DPL::SharedPtr<TemplateEvent>& event) = 0;
+    virtual void OnCancelEvent(const std::shared_ptr<TemplateEvent>& event) = 0;
 
     virtual ~IExternEventCanceler()
     {}
similarity index 94%
rename from src_mobile/Commons/JSObject.h
rename to src/Commons/JSObject.h
index d52f5a8..399b6da 100644 (file)
@@ -23,8 +23,9 @@
 #ifndef WRT_SRC_PLUGIN_SERVICE_JS_OBJECT_H_
 #define WRT_SRC_PLUGIN_SERVICE_JS_OBJECT_H_
 
+#include <memory>
+
 #include <dpl/noncopyable.h>
-#include <dpl/shared_ptr.h>
 
 class JSObject : private DPL::Noncopyable
 {
@@ -47,6 +48,6 @@ class JSObject : private DPL::Noncopyable
     RealObject m_object;
 };
 
-typedef DPL::SharedPtr<JSObject> JSObjectPtr;
+typedef std::shared_ptr<JSObject> JSObjectPtr;
 
 #endif
similarity index 95%
rename from src_mobile/Commons/JSObjectDeclaration.h
rename to src/Commons/JSObjectDeclaration.h
index a726029..972b30d 100644 (file)
@@ -26,7 +26,6 @@
 #include <string>
 #include <memory>
 #include <cassert>
-#include <dpl/shared_ptr.h>
 #include <dpl/noncopyable.h>
 #include <dpl/log/log.h>
 #include <wrt_plugin_export.h>
@@ -93,7 +92,7 @@ class JSObjectDeclaration : private DPL::Noncopyable
       private:
         explicit Options(const ClassOptions* options) : m_options(options)
         {
-            assert(options && "Dont create empty options");
+            Assert(options && "Dont create empty options");
         }
 
         friend class JSObjectDeclaration;
@@ -148,6 +147,6 @@ class JSObjectDeclaration : private DPL::Noncopyable
     OptionsPtr m_options;
 };
 
-typedef DPL::SharedPtr<JSObjectDeclaration> JSObjectDeclarationPtr;
+typedef std::shared_ptr<JSObjectDeclaration> JSObjectDeclarationPtr;
 
 #endif
similarity index 88%
rename from src_mobile/Commons/ListenerEvent.h
rename to src/Commons/ListenerEvent.h
index 7956ab7..649f2bf 100644 (file)
@@ -20,8 +20,9 @@
 #ifndef WRTDEVICEAPIS_COMMONS_LISTENER_EVENT_H_
 #define WRTDEVICEAPIS_COMMONS_LISTENER_EVENT_H_
 
-#include <dpl/mutex.h>
-#include <dpl/shared_ptr.h>
+#include <memory>
+#include <mutex>
+
 #include <dpl/noncopyable.h>
 #include <Commons/Exception.h>
 #include <Commons/IEvent.h>
@@ -46,7 +47,7 @@ class ListenerEvent
 
   public:
     typedef IEventPrivateData PrivateDataType;
-    typedef DPL::SharedPtr<PrivateDataType> PrivateDataTypePtr;
+    typedef std::shared_ptr<PrivateDataType> PrivateDataTypePtr;
 
   public:
     virtual ~ListenerEvent()
@@ -60,7 +61,7 @@ class ListenerEvent
      */
     Commons::ExceptionCodes::Enumeration getExceptionCode() const
     {
-        DPL::Mutex::ScopedLock lock(m_mtx);
+        std::lock_guard<std::mutex> lock(*m_mtx);
         return m_code;
     }
 
@@ -71,7 +72,7 @@ class ListenerEvent
      */
     void setExceptionCode(Commons::ExceptionCodes::Enumeration code)
     {
-        DPL::Mutex::ScopedLock lock(m_mtx);
+        std::lock_guard<std::mutex> lock(*m_mtx);
         m_code = code;
     }
 
@@ -81,18 +82,18 @@ class ListenerEvent
      */
     const PrivateDataTypePtr& getPrivateData() const
     {
-        DPL::Mutex::ScopedLock lock(m_mtx);
+        std::lock_guard<std::mutex> lock(*m_mtx);
         return m_privateData;
     }
 
   protected:
     ListenerEvent() :
-        m_mtx(new DPL::Mutex()),
+        m_mtx(new std::mutex()),
         m_code(Commons::ExceptionCodes::None)
     {}
 
     ListenerEvent(const ListenerEvent &ths) :
-        m_mtx(new DPL::Mutex()),
+        m_mtx(new std::mutex()),
         m_code(ths.m_code),
         m_privateData(ths.m_privateData)
     {}
@@ -100,7 +101,7 @@ class ListenerEvent
     ListenerEvent& operator=(const ListenerEvent &other)
     {
         if (this != &other) {
-            m_mtx = new DPL::Mutex();
+            m_mtx = new std::mutex();
             m_code = other.m_code;
             m_privateData = other.m_privateData;
         }
@@ -116,12 +117,12 @@ class ListenerEvent
      */
     void setPrivateData(const PrivateDataTypePtr& data)
     {
-        DPL::Mutex::ScopedLock lock(m_mtx);
+        std::lock_guard<std::mutex> lock(*m_mtx);
         m_privateData = data;
     }
 
   protected:
-    mutable DPL::Mutex *m_mtx;
+    mutable std::mutex *m_mtx;
     Commons::ExceptionCodes::Enumeration m_code; ///< Exception code.
     PrivateDataTypePtr m_privateData; ///< Private data.
 };
similarity index 91%
rename from src_wearable/Commons/ListenerEventEmitter.h
rename to src/Commons/ListenerEventEmitter.h
index 77bada2..8843920 100644 (file)
 #ifndef WRTDEVICEAPIS_COMMONS_LISTENER_EVENT_EMITTER_H_
 #define WRTDEVICEAPIS_COMMONS_LISTENER_EVENT_EMITTER_H_
 
+#include <memory>
+#include <mutex>
+
 #include <stdint.h>
 #include <dpl/noncopyable.h>
-#include <dpl/shared_ptr.h>
-#include <dpl/mutex.h>
 #include <Commons/EventListener.h>
 #include <Commons/ListenerEvent.h>
 
@@ -47,7 +48,7 @@ class ListenerEventEmitter : private DPL::Noncopyable
 {
   public:
     typedef EventClass EventType;
-    typedef DPL::SharedPtr<EventType> EventPtrType;
+    typedef std::shared_ptr<EventType> EventPtrType;
     typedef ListenerEventEmitter<EventType> Type;
     typedef typename ListenerEvent<EventType>::PrivateDataType
     EventPrivateDataType;
@@ -80,7 +81,7 @@ class ListenerEventEmitter : private DPL::Noncopyable
      */
     virtual void setEventPrivateData(const EventPrivateDataTypePtr& data)
     {
-        DPL::Mutex::ScopedLock lock(&m_mtx);
+        std::lock_guard<std::mutex> lock(m_mtx);
         m_privateData = data;
     }
 
@@ -90,7 +91,7 @@ class ListenerEventEmitter : private DPL::Noncopyable
      */
     virtual EventPrivateDataTypePtr getEventPrivateData()
     {
-        DPL::Mutex::ScopedLock lock(&m_mtx);
+        std::lock_guard<std::mutex> lock(m_mtx);
         return m_privateData;
     }
 
@@ -104,7 +105,7 @@ class ListenerEventEmitter : private DPL::Noncopyable
      */
     virtual void setListener(ListenerType* listener)
     {
-        DPL::Mutex::ScopedLock lock(&m_mtx);
+        std::lock_guard<std::mutex> lock(m_mtx);
         m_listener = listener;
     }
 
@@ -114,8 +115,8 @@ class ListenerEventEmitter : private DPL::Noncopyable
      */
     virtual void emit(const EventPtrType& event)
     {
-        DPL::Mutex::ScopedLock lock(&m_mtx);
-        EventPtrType copy(new EventType(*event.Get()));
+        std::lock_guard<std::mutex> lock(m_mtx);
+        EventPtrType copy(new EventType(*event.get()));
         if (m_listener) {
             copy->setPrivateData(m_privateData);
             m_listener->postAnswer(copy);
@@ -133,7 +134,7 @@ class ListenerEventEmitter : private DPL::Noncopyable
     }
 
   protected:
-    DPL::Mutex m_mtx; ///< Mutex for thread-safety.
+    std::mutex m_mtx; ///< Mutex for thread-safety.
     ListenerType* m_listener; ///< Event listener object.
     EventPrivateDataTypePtr m_privateData; ///< Private data.
 };
similarity index 98%
rename from src_mobile/Commons/StringUtils.h
rename to src/Commons/StringUtils.h
index b36071f..2427048 100644 (file)
@@ -26,7 +26,7 @@
 #include <sstream>
 #include <utility>
 #include <Commons/Exception.h>
-#include <Commons/Deprecated.h>
+#include <dpl/availability.h>
 
 namespace WrtDeviceApis {
 namespace Commons {
@@ -116,7 +116,7 @@ std::vector<std::string> split(const std::string& str,
 /**
  * @deprecated Use convertTo<int>().
  */
-int toInt(const std::string& str) WRT_PLUGINS_DEPRECATED;
+int toInt(const std::string& str) DPL_DEPRECATED;
 
 /**
  * Converts string to specified type.
similarity index 99%
rename from src_mobile/Commons/ThreadPool.cpp
rename to src/Commons/ThreadPool.cpp
index fd5cd3a..280d512 100644 (file)
@@ -63,7 +63,7 @@ ThreadPool::~ThreadPool()
 DPL::Thread* ThreadPool::getThreadHandleCreateIfNotExists(
     ThreadEnum::Enumeration type)
 {
-    DPL::Mutex::ScopedLock lock(&m_threadHandlersMutex);
+    std::lock_guard<std::mutex> lock(m_threadHandlersMutex);
     ThreadHandleMap::iterator element = m_threadHandlers.find(type);
 
     //if element does not exists in the map
similarity index 98%
rename from src_mobile/Commons/ThreadPool.h
rename to src/Commons/ThreadPool.h
index ada3233..2d403bf 100644 (file)
@@ -24,6 +24,7 @@
 #define WRTDEVICEAPIS_COMMONS_THREADPOOL_H_
 
 #include <map>
+#include <mutex>
 #include <dpl/thread.h>
 #include <dpl/event/main_event_dispatcher.h>
 #include <dpl/event/thread_event_dispatcher.h>
@@ -84,7 +85,7 @@ class ThreadPool : private DPL::Noncopyable
   private:
     typedef std::map<ThreadEnum::Enumeration, DPL::Thread*> ThreadHandleMap;
     ThreadHandleMap m_threadHandlers;
-    DPL::Mutex m_threadHandlersMutex;
+    std::mutex m_threadHandlersMutex;
 
     DPL::Thread *getThreadHandleCreateIfNotExists(ThreadEnum::Enumeration type);
 
similarity index 88%
rename from src_wearable/Commons/TypeTraits.h
rename to src/Commons/TypeTraits.h
index bcc98f7..a921fb2 100644 (file)
@@ -16,7 +16,7 @@
 #ifndef WRTDEVICEAPIS_COMMONS_TYPE_TRAITS_H_
 #define WRTDEVICEAPIS_COMMONS_TYPE_TRAITS_H_
 
-#include <dpl/shared_ptr.h>
+#include <memory>
 
 namespace WrtDeviceApis {
 namespace Commons {
@@ -39,11 +39,11 @@ struct IsNull<T*>
 };
 
 template<typename Class>
-struct IsNull<DPL::SharedPtr<Class> >
+struct IsNull<std::shared_ptr<Class> >
 {
-    static bool value(const DPL::SharedPtr<Class>& ptr)
+    static bool value(const std::shared_ptr<Class>& ptr)
     {
-        return ptr.Get() == NULL;
+        return ptr.get() == NULL;
     }
 };
 
diff --git a/src/Commons/WrtAccess/WrtAccess.cpp b/src/Commons/WrtAccess/WrtAccess.cpp
new file mode 100644 (file)
index 0000000..0d6959d
--- /dev/null
@@ -0,0 +1,159 @@
+/*
+ * 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.
+ */
+/*
+ * @author      Grzegorz Krawczyk (g.krawczyk@samsung.com)
+ * @version     0.1
+ * @brief
+ */
+
+#include <memory>
+#include <sstream>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/types.h>
+
+#include <dpl/log/log.h>
+#include <dpl/log/secure_log.h>
+#include <dpl/scoped_resource.h>
+#include <dpl/assert.h>
+#include <Commons/Exception.h>
+#include "WrtAccess.h"
+#include <dpl/singleton_safe_impl.h>
+
+IMPLEMENT_SAFE_SINGLETON(WrtDeviceApis::Commons::WrtAccess)
+
+namespace {
+/**
+ * Helper class - single parameter and its value
+ */
+struct AceParam
+{
+    const char *name;
+    const char *value;
+
+    AceParam() :
+        name(NULL), value(NULL)
+    {}
+
+    AceParam(const char *name, const char *value) :
+        name(name), value(value)
+    {}
+};
+
+/**
+ * Helper class - list of params for single dev cap
+ */
+struct AceParamList
+{
+    size_t count;
+    AceParam* param;
+    AceParamList() :
+        count(0),
+        param(NULL)
+    {}
+};
+
+struct DeviceCapParamPolicy
+{
+    typedef AceParamList* Type;
+    static Type NullValue()
+    {
+        return NULL;
+    }
+    static void Destroy(Type ptr)
+    {
+        if (ptr) {
+            delete[] ptr->param;
+        }
+        delete[] ptr;
+    }
+};
+
+/**
+ * Helper class - modified ScopedArray for ace_param_list_t
+ */
+class ScopedDeviceCapArray : public DPL::ScopedResource<DeviceCapParamPolicy>
+{
+  public:
+    explicit ScopedDeviceCapArray(AceParamList *ptr =
+                                      DeviceCapParamPolicy::NullValue()) :
+        DPL::ScopedResource<DeviceCapParamPolicy>(ptr)
+    {}
+
+    AceParamList & operator [](std::ptrdiff_t k) const
+    {
+        AssertMsg(this->m_value != DeviceCapParamPolicy::NullValue(),
+               "Dereference of scoped NULL array!");
+        AssertMsg(k >= 0, "Negative array index");
+
+        return this->m_value[k];
+    }
+};
+} // namespace
+
+namespace WrtDeviceApis {
+namespace Commons {
+WrtAccess::WrtAccess() :
+    m_widgetId(-1),
+    m_sessionId(GenerateSessionId())
+{}
+
+WrtAccess::~WrtAccess()
+{}
+
+WrtAccess::SessionId WrtAccess::GenerateSessionId()
+{
+    const size_t SESSION_ID_LENGTH = 32;
+
+    std::ostringstream pid;
+    pid << static_cast<int>(getpid());
+
+    std::string session_id = pid.str();
+
+    session_id.reserve(session_id.length() + SESSION_ID_LENGTH);
+
+    for (size_t i = 0; i < SESSION_ID_LENGTH; ++i) {
+        int c = random() % 16;
+
+        session_id += (c < 10 ?
+                       static_cast<char>('0' + c) :
+                       static_cast<char>('A' + c - 10));
+    }
+    return session_id;
+}
+
+void WrtAccess::initialize(WidgetHandle widgetId)
+{
+    _D("initialize");
+    if (widgetId < 0) {
+        _E("Invalid widget id");
+        Throw(Exception);
+    }
+
+    m_widgetId = widgetId;
+}
+
+void WrtAccess::deinitialize(WidgetHandle /*widgetId*/)
+{
+    _D("deinitialize");
+}
+
+WidgetHandle WrtAccess::getWidgetId() const
+{
+    return m_widgetId;
+}
+}
+} // WrtDeviceApisCommon
similarity index 75%
rename from src_wearable/Commons/WrtAccess/WrtAccess.h
rename to src/Commons/WrtAccess/WrtAccess.h
index 18893a0..0cd9b39 100644 (file)
 
 #include <dpl/singleton.h>
 #include <Commons/TypesDeclaration.h>
+#include <dpl/wrt-dao-ro/wrt_db_types.h>
 
 namespace WrtDeviceApis {
 namespace Commons {
 class WrtAccess
 {
  public:
-    enum CheckAccessReturnType
-    {
-        CHECK_ACCESS_GRANTED,
-        CHECK_ACCESS_PRIVILEGE_DENIED,
-        CHECK_ACCESS_PRIVACY_DENIED,
-        CHECK_ACCESS_INTERNAL_ERROR
-    };
 
-    void initialize(int widgetId);
-    void deinitialize(int widgetId);
-    int getWidgetId() const;
-    CheckAccessReturnType checkAccessControl(const AceFunction &aceFunction) const;
+    void initialize(WidgetHandle widgetId);
+    void deinitialize(WidgetHandle widgetId);
+    WidgetHandle getWidgetId() const;
 
   private:
 
@@ -53,10 +46,8 @@ class WrtAccess
     WrtAccess();
     virtual ~WrtAccess();
 
-    int m_widgetId;
+    WidgetHandle m_widgetId;
     SessionId m_sessionId;
-    size_t m_pluginOwners;
-
 
     friend class DPL::Singleton<WrtAccess>;
 };
similarity index 97%
rename from src_wearable/Commons/plugin_initializer_def.h
rename to src/Commons/plugin_initializer_def.h
index 73a6185..17c1d93 100644 (file)
@@ -65,7 +65,7 @@ typedef java_script_context_t JavaScriptContext;
  * loaded widget this function will be called)
  *  Example:
  *       plugin_initializer.cpp
- *        void on_widget_start_callback(int widgetId, JSContextRef context,
+ *        void on_widget_start_callback(WidgetHandle widgetId, JSContextRef context,
  * const engine_interface_t *interface)
  *        {
  *          //...
@@ -96,7 +96,7 @@ typedef java_script_context_t JavaScriptContext;
  * providing callback that will be called while unloading each widget (for
  * every unloaded widget this function will be called)
  *  Example:
- *        void on_widget_stop_callback(int widgetId)
+ *        void on_widget_stop_callback(WidgetHandle widgetId)
  *        {
  *          //...
  *        }
similarity index 60%
rename from src_wearable/CommonsJavaScript/CMakeLists.txt
rename to src/CommonsJavaScript/CMakeLists.txt
index ecd0317..4e33416 100755 (executable)
 #    See the License for the specific language governing permissions and
 #    limitations under the License.
 #
-macro(install_header_file HEADER_FILE)
+MACRO(install_header_file HEADER_FILE)
     INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${HEADER_FILE}
         DESTINATION ${DESTINATION_HEADERS_JS})
-endmacro()
+ENDMACRO()
 
 
-pkg_search_module(webkit2 REQUIRED ewebkit2)
+PKG_SEARCH_MODULE(webkit2 REQUIRED ewebkit2)
 
-set(TARGET_NAME ${TARGET_COMMONS_JAVASCRIPT})
+SET(TARGET_NAME ${TARGET_COMMONS_JAVASCRIPT})
 
-include_directories(${DIR_JS_COMMONS}
+INCLUDE_DIRECTORIES(${DIR_JS_COMMONS}
                     ${wrt-plugin-api_INCLUDE_DIRS}
                     ${webkit2_INCLUDE_DIRS}}
                     )
 
 
-set(SRCS
+SET(SRCS
   ${CMAKE_CURRENT_SOURCE_DIR}/Converter.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/ScopedJSStringRef.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/JSCallbackManager.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/JSUtils.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/ScopedJSStringRef.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/Validator.cpp
-  # wrapper for simple version of aceCheckAcces
-  ${CMAKE_CURRENT_SOURCE_DIR}/Security/SecurityFunctionDeclaration.cpp
   #ECMA Script Exception
   ${CMAKE_CURRENT_SOURCE_DIR}/JSDOMException.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/DOMExceptionData.cpp
   ${CMAKE_CURRENT_SOURCE_DIR}/JSDOMExceptionFactory.cpp
   #Pending Operation support
   ${CMAKE_CURRENT_SOURCE_DIR}/JSPendingOperation.cpp
+  #support safe protect
+  ${CMAKE_CURRENT_SOURCE_DIR}/JSLifeManager.cpp
 )
 
 
-add_library(${TARGET_NAME} SHARED ${SRCS})
-target_link_libraries(${TARGET_NAME}
+ADD_LIBRARY(${TARGET_NAME} SHARED ${SRCS})
+TARGET_LINK_LIBRARIES(${TARGET_NAME}
         ${LIBS_COMMONS}
         ${webkit2_LIBRARIES}
         ${TARGET_COMMONS}
 )
-set_target_properties(${TARGET_NAME} PROPERTIES
+
+SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES
+    COMPILE_DEFINITIONS LOG_TAG="${LOG_TAG}")
+
+SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES
  SOVERSION ${CMAKE_PROJECT_API_VERSION}
  VERSION ${CMAKE_PROJECT_VERSION}
 )
@@ -60,25 +64,26 @@ set_target_properties(${TARGET_NAME} PROPERTIES
 INSTALL(TARGETS ${TARGET_NAME} LIBRARY DESTINATION ${DESTINATION_LIB_PREFIX})
 
 #utils
-install_header_file(PrivateObject.h)
+INSTALL_HEADER_FILE(PrivateObject.h)
 #tools
-install_header_file(Converter.h)
-install_header_file(Validator.h)
-install_header_file(JSUtils.h)
-install_header_file(ScopedJSStringRef.h)
+INSTALL_HEADER_FILE(Converter.h)
+INSTALL_HEADER_FILE(Validator.h)
+INSTALL_HEADER_FILE(JSUtils.h)
+INSTALL_HEADER_FILE(ScopedJSStringRef.h)
 #callback manager
-install_header_file(JSCallbackManager.h)
+INSTALL_HEADER_FILE(JSCallbackManager.h)
 #exceptions
-install_header_file(JSDOMException.h)
-install_header_file(JSDOMExceptionFactory.h)
-install_header_file(DOMExceptionData.h)
-install_header_file(SecurityExceptions.h)
+INSTALL_HEADER_FILE(JSDOMException.h)
+INSTALL_HEADER_FILE(JSDOMExceptionFactory.h)
+INSTALL_HEADER_FILE(DOMExceptionData.h)
+INSTALL_HEADER_FILE(SecurityExceptions.h)
 #static declarations
-install_header_file(Security/StaticDeclaration.h)
-install_header_file(Security/SecurityFunctionDeclaration.h)
+INSTALL_HEADER_FILE(Security/StaticDeclaration.h)
 #pending operation
-install_header_file(SupportPendingOperation.h)
-install_header_file(Utils.h)
-install_header_file(JSPendingOperation.h)
-install_header_file(JSPendingOperationPrivateObject.h)
+INSTALL_HEADER_FILE(SupportPendingOperation.h)
+INSTALL_HEADER_FILE(Utils.h)
+INSTALL_HEADER_FILE(JSPendingOperation.h)
+INSTALL_HEADER_FILE(JSPendingOperationPrivateObject.h)
+#Safe Protect
+INSTALL_HEADER_FILE(JSLifeManager.h)
 
similarity index 95%
rename from src_wearable/CommonsJavaScript/Converter.cpp
rename to src/CommonsJavaScript/Converter.cpp
index 0eccb60..0b03a82 100644 (file)
@@ -15,7 +15,6 @@
  */
 #include <sstream>
 #include <limits>
-#include <dpl/scoped_array.h>
 #include <dpl/scoped_free.h>
 #include "ScopedJSStringRef.h"
 #include "Converter.h"
@@ -159,13 +158,13 @@ std::string Converter::toString(const JSStringRef& arg)
     size_t jsSize = JSStringGetMaximumUTF8CStringSize(arg);
     if (jsSize > 0) {
         jsSize = jsSize + 1;
-        DPL::ScopedArray<char> buffer(new char[jsSize]);
-        size_t written = JSStringGetUTF8CString(arg, buffer.Get(), jsSize);
+        std::unique_ptr<char[]> buffer(new char[jsSize]);
+        size_t written = JSStringGetUTF8CString(arg, buffer.get(), jsSize);
         if (written > jsSize) {
             ThrowMsg(ConversionException,
                      "Conversion could not be fully performed.");
         }
-        result = buffer.Get();
+        result = buffer.get();
     }
 
     return result;
@@ -179,20 +178,22 @@ time_t Converter::toDateTimeT(const JSValueRef& arg)
 
 tm Converter::toDateTm(const JSValueRef& arg)
 {
+    using namespace std::placeholders;
+
     std::string stringDate = toDateString(arg);
     struct tm result;
     char* currentLocale = setlocale(LC_TIME, NULL);
     if (currentLocale == NULL) {
         ThrowMsg(ConversionException, "Couldn't get current locale.");
     }
-    DPL::ScopedFree<char> currentLocaleCopy(strdup(currentLocale));
+    std::unique_ptr<char, void(*)(void*)> currentLocaleCopy(strdup(currentLocale), &free);
     if (setlocale(LC_TIME, "C") == NULL) {
         ThrowMsg(ConversionException, "Couldn't set POSIX locale.");
     }
     if (strptime(stringDate.c_str(), "%a %b %d %Y %T", &result) == NULL) {
         ThrowMsg(ConversionException, "Couldn't convert supplied date.");
     }
-    if (setlocale(LC_TIME, currentLocaleCopy.Get()) == NULL) {
+    if (setlocale(LC_TIME, currentLocaleCopy.get()) == NULL) {
         ThrowMsg(ConversionException, "Couldn't set previous locale back.");
     }
     //strptime function doesn't affect tm_isdst flag.
@@ -370,9 +371,9 @@ std::string Converter::toString_(const JSValueRef& arg)
 
     size_t jsSize = JSStringGetMaximumUTF8CStringSize(str);
     if (jsSize > 0) {
-        DPL::ScopedArray<char> buffer(new char[jsSize]);
-        JSStringGetUTF8CString(str, buffer.Get(), jsSize);
-        result = buffer.Get();
+        std::unique_ptr<char[]> buffer(new char[jsSize]);
+        JSStringGetUTF8CString(str, buffer.get(), jsSize);
+        result = buffer.get();
     }
     JSStringRelease(str);
     return result;
similarity index 89%
rename from src_mobile/CommonsJavaScript/Converter.h
rename to src/CommonsJavaScript/Converter.h
index ff196b6..8baa86c 100644 (file)
@@ -21,9 +21,9 @@
 #include <string>
 #include <vector>
 #include <list>
+#include <memory>
 #include <JavaScriptCore/JavaScript.h>
 #include <dpl/noncopyable.h>
-#include <dpl/shared_ptr.h>
 #include <Commons/Exception.h>
 #include <Commons/StaticAssert.h>
 
@@ -366,11 +366,11 @@ class Converter : private DPL::Noncopyable
     /**
      * Template specialization to catch errors caused
      * by wrong usage of general template or
-     * implicit conversions from SharedPtr to
+     * implicit conversions from shared_ptr to
      * specialized type
      * */
     template<class Class>
-    JSValueRef toJSValueRef(const DPL::SharedPtr<Class>& c)
+    JSValueRef toJSValueRef(const std::shared_ptr<Class>& c)
     {
         STATIC_ERROR(ERROR_INVALID_IMPLICIT_CONVERSION, c)
         //above macro causes compilation error
@@ -405,15 +405,23 @@ class Converter : private DPL::Noncopyable
             return std::vector<T>();
         }
 
-        if (!JSIsArrayValue(m_context, arg)) {
+        JSObjectRef objArg = toJSObjectRef(arg);
+        JSStringRef string;
+        JSValueRef exception = NULL;
+        size_t length;
+
+        string = JSStringCreateWithUTF8CString("length");
+        length = toSizeT(JSObjectGetProperty(m_context, objArg, string, &exception));
+        JSStringRelease(string);
+
+        if (exception != NULL) {
             ThrowMsg(Commons::ConversionException,
-                     "Argument is not an JS array.");
+                     "Argument may not be an JS array.");
         }
 
         std::vector<T> result;
-        JSObjectRef objArg = toJSObjectRef(arg);
-        for (std::size_t i = 0; i < JSGetArrayLength(m_context, objArg); ++i) {
-            JSValueRef element = JSGetArrayElement(m_context, objArg, i);
+        for (std::size_t i = 0; i < length; ++i) {
+            JSValueRef element = JSObjectGetPropertyAtIndex(m_context, objArg, i, NULL);
             result.push_back((object->*f)(element));
         }
         return result;
@@ -429,15 +437,23 @@ class Converter : private DPL::Noncopyable
             return std::vector<T>();
         }
 
-        if (!JSIsArrayValue(m_context, arg)) {
+        JSObjectRef objArg = toJSObjectRef(arg);
+        JSStringRef string;
+        JSValueRef exception = NULL;
+        size_t length;
+
+        string = JSStringCreateWithUTF8CString("length");
+        length = toSizeT(JSObjectGetProperty(m_context, objArg, string, &exception));
+        JSStringRelease(string);
+
+        if (exception != NULL) {
             ThrowMsg(Commons::ConversionException,
-                     "Argument is not an JS array.");
+                     "Argument may not be an JS array.");
         }
 
         std::vector<T> result;
-        JSObjectRef objArg = toJSObjectRef(arg);
-        for (std::size_t i = 0; i < JSGetArrayLength(m_context, objArg); ++i) {
-            JSValueRef element = JSGetArrayElement(m_context, objArg, i);
+        for (std::size_t i = 0; i < length; ++i) {
+            JSValueRef element = JSObjectGetPropertyAtIndex(m_context, objArg, i, NULL);
             result.push_back((this->*f)(element));
         }
         return result;
@@ -448,7 +464,7 @@ class Converter : private DPL::Noncopyable
                              JSValueRef (Derived::*f)(const T &),
                              Derived* object)
     {
-        JSObjectRef jsResult = JSCreateArrayObject(m_context, 0, NULL);
+        JSObjectRef jsResult = JSObjectMakeArray(m_context, 0, NULL, NULL);
 
         if (NULL == jsResult) {
             ThrowMsg(WrtDeviceApis::Commons::NullPointerException,
@@ -457,7 +473,9 @@ class Converter : private DPL::Noncopyable
 
         for (std::size_t i = 0; i < arg.size(); ++i) {
             JSValueRef tmpVal = (object->*f)(arg[i]);
-            if (!JSSetArrayElement(m_context, jsResult, i, tmpVal)) {
+            JSValueRef exception = NULL;
+            JSObjectSetPropertyAtIndex(m_context, jsResult, i, tmpVal, &exception);
+            if (exception != NULL) {
                 ThrowMsg(WrtDeviceApis::Commons::UnknownException,
                          "Could not insert value into js array");
             }
@@ -469,7 +487,7 @@ class Converter : private DPL::Noncopyable
     template<class T>
     JSValueRef toJSValueRef_(const std::vector<T>& arg)
     {
-        JSObjectRef jsResult = JSCreateArrayObject(m_context, 0, NULL);
+        JSObjectRef jsResult = JSObjectMakeArray(m_context, 0, NULL, NULL);
 
         if (NULL == jsResult) {
             ThrowMsg(WrtDeviceApis::Commons::NullPointerException,
@@ -478,7 +496,9 @@ class Converter : private DPL::Noncopyable
 
         for (std::size_t i = 0; i < arg.size(); ++i) {
             JSValueRef tmpVal = toJSValueRef(arg[i]);
-            if (!JSSetArrayElement(m_context, jsResult, i, tmpVal)) {
+            JSValueRef exception = NULL;
+            JSObjectSetPropertyAtIndex(m_context, jsResult, i, tmpVal, &exception);
+            if (exception != NULL) {
                 ThrowMsg(WrtDeviceApis::Commons::UnknownException,
                          "Could not insert value into js array");
             }
@@ -490,7 +510,7 @@ class Converter : private DPL::Noncopyable
     template<class T>
     JSValueRef toJSValueRef_(const std::list<T>& arg)
     {
-        JSObjectRef jsResult = JSCreateArrayObject(m_context, 0, NULL);
+        JSObjectRef jsResult = JSObjectMakeArray(m_context, 0, NULL, NULL);
 
         if (NULL == jsResult) {
             ThrowMsg(WrtDeviceApis::Commons::NullPointerException,
@@ -500,7 +520,9 @@ class Converter : private DPL::Noncopyable
         typename std::list<T>::const_iterator it = arg.begin();
         for (std::size_t i = 0; it != arg.end(); ++i, ++it) {
             JSValueRef tmpVal = toJSValueRef(*it);
-            if (!JSSetArrayElement(m_context, jsResult, i, tmpVal)) {
+            JSValueRef exception = NULL;
+            JSObjectSetPropertyAtIndex(m_context, jsResult, i, tmpVal, &exception);
+            if (exception != NULL) {
                 ThrowMsg(WrtDeviceApis::Commons::UnknownException,
                          "Could not insert value into js array");
             }
@@ -514,7 +536,7 @@ class Converter : private DPL::Noncopyable
                              JSValueRef (Derived::*f)(const T &),
                              Derived* object)
     {
-        JSObjectRef jsResult = JSCreateArrayObject(m_context, 0, NULL);
+        JSObjectRef jsResult = JSObjectMakeArray(m_context, 0, NULL, NULL);
 
         if (NULL == jsResult) {
             ThrowMsg(WrtDeviceApis::Commons::NullPointerException,
@@ -524,7 +546,9 @@ class Converter : private DPL::Noncopyable
         typename std::list<T>::const_iterator it = arg.begin();
         for (std::size_t i = 0; it != arg.end(); ++i, ++it) {
             JSValueRef tmpVal = (object->*f)(*it);
-            if (!JSSetArrayElement(m_context, jsResult, i, tmpVal)) {
+            JSValueRef exception = NULL;
+            JSObjectSetPropertyAtIndex(m_context, jsResult, i, tmpVal, &exception);
+            if (exception != NULL) {
                 ThrowMsg(WrtDeviceApis::Commons::UnknownException,
                          "Could not insert value into js array");
             }
@@ -557,7 +581,7 @@ class ConverterFactory : private DPL::Noncopyable
     /**
      * Converter type which deletes itself when gets out of scope.
      */
-    typedef DPL::SharedPtr<C> ConverterType;
+    typedef std::shared_ptr<C> ConverterType;
 
   public:
     /**
similarity index 93%
rename from src_wearable/CommonsJavaScript/DOMExceptionData.h
rename to src/CommonsJavaScript/DOMExceptionData.h
index b6cd760..140d875 100644 (file)
@@ -17,7 +17,7 @@
 #define WRTDEVICEAPIS_COMMONSJAVASCRIPT_DOM_EXCEPTION_DATA_H_
 
 #include <string>
-#include <dpl/shared_ptr.h>
+#include <memory>
 
 namespace WrtDeviceApis {
 namespace CommonsJavaScript {
@@ -35,7 +35,7 @@ class DOMExceptionData
     std::string m_message;
 };
 
-typedef DPL::SharedPtr<DOMExceptionData> DOMExceptionDataPtr;
+typedef std::shared_ptr<DOMExceptionData> DOMExceptionDataPtr;
 } // CommonsJavaScript
 } // WrtDeviceApis
 
@@ -22,6 +22,7 @@
 #include "JSCallbackManager.h"
 #include <WKBundle.h>
 #include <dpl/log/secure_log.h>
+#include <CommonsJavaScript/JSLifeManager.h>
 
 namespace WrtDeviceApis {
 namespace CommonsJavaScript {
@@ -81,22 +82,22 @@ JSCallbackManager::JSCallbackManager(JSContextRef context,
 JSCallbackManager::~JSCallbackManager()
 {
     if (m_onSuccess) {
-        JSValueUnprotect(m_context, m_onSuccess);
+        JSValueSafeUnprotect(m_context, m_onSuccess);
     }
 
     if (m_onError) {
-        JSValueUnprotect(m_context, m_onError);
+        JSValueSafeUnprotect(m_context, m_onError);
     }
 
     if (m_object) {
-        JSValueUnprotect(m_context, m_object);
+        JSValueSafeUnprotect(m_context, m_object);
     }
 }
 
 void JSCallbackManager::setOnSuccess(JSValueRef onSuccess)
 {
     if (m_onSuccess != NULL) {
-        JSValueUnprotect(m_context, m_onSuccess);
+        JSValueSafeUnprotect(m_context, m_onSuccess);
     }
 
     if (onSuccess) {
@@ -106,7 +107,7 @@ void JSCallbackManager::setOnSuccess(JSValueRef onSuccess)
     }
 
     if (m_onSuccess != NULL) {
-        JSValueProtect(m_context, m_onSuccess);
+        JSValueSafeProtect(m_context, m_onSuccess);
     }
 }
 
@@ -118,7 +119,7 @@ JSValueRef JSCallbackManager::getOnSuccess() const
 void JSCallbackManager::setOnError(JSValueRef onError)
 {
     if (m_onError != NULL) {
-        JSValueUnprotect(m_context, m_onError);
+        JSValueSafeUnprotect(m_context, m_onError);
     }
 
     if (onError) {
@@ -128,7 +129,7 @@ void JSCallbackManager::setOnError(JSValueRef onError)
     }
 
     if (m_onError != NULL) {
-        JSValueProtect(m_context, m_onError);
+        JSValueSafeProtect(m_context, m_onError);
     }
 }
 
@@ -140,13 +141,13 @@ JSValueRef JSCallbackManager::getOnError() const
 void JSCallbackManager::setObject(JSObjectRef object)
 {
     if (m_object != NULL) {
-        JSValueUnprotect(m_context, m_object);
+        JSValueSafeUnprotect(m_context, m_object);
     }
 
     m_object = object;
 
     if (m_object != NULL) {
-        JSValueProtect(m_context, m_object);
+        JSValueSafeProtect(m_context, m_object);
     }
 }
 
 #define WRTDEVICEAPIS_COMMONSJAVASCRIPT_JS_CALLBACK_MANAGER_H_
 
 
-#include <dpl/shared_ptr.h>
+#include <memory>
 #include <Commons/IEvent.h>
 #include <JavaScriptCore/JavaScript.h>
 
 namespace WrtDeviceApis {
 namespace CommonsJavaScript {
 class JSCallbackManager;
-typedef DPL::SharedPtr<JSCallbackManager> JSCallbackManagerPtr;
+typedef std::shared_ptr<JSCallbackManager> JSCallbackManagerPtr;
 
 class JSCallbackManager : public WrtDeviceApis::Commons::IEventPrivateData
 {
   private:
-    JSCallbackManager()
+    JSCallbackManager(): m_onSuccess(NULL), m_onError(NULL)
     {}
 
     /**
diff --git a/src/CommonsJavaScript/JSLifeManager.cpp b/src/CommonsJavaScript/JSLifeManager.cpp
new file mode 100755 (executable)
index 0000000..4813afd
--- /dev/null
@@ -0,0 +1,138 @@
+/*
+ * Copyright (c) 2014 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 "JSLifeManager.h"
+
+#include <dlog.h>
+
+#include <map>
+#include <list>
+#include <algorithm>
+
+// import temporarily from JSContextRefPrivate.h
+extern "C" JSGlobalContextRef JSContextGetGlobalContext(JSContextRef ctx);
+
+namespace WrtDeviceApis {
+namespace CommonsJavaScript {
+
+class JSLifeManagerImpl{
+    friend class JSLifeManager;
+    protected:
+        JSLifeManagerImpl();
+        ~JSLifeManagerImpl();
+        void protect(JSContextRef ctx, JSValueRef value);
+        void unprotect(JSContextRef ctx, JSValueRef value);
+        void releaseContext(JSContextRef ctx);
+        void addGlobalContext(JSContextRef ctx);
+        bool isAvailableContext(JSContextRef ctx);
+    private:
+        JSLifeManagerImpl(const JSLifeManager&) = delete;
+        JSLifeManagerImpl& operator=(const JSLifeManager&) = delete;
+        typedef std::map<JSValueRef,int> RefCountT;
+        std::map<JSContextRef,RefCountT> mRefCount;
+        std::list<JSContextRef> validContextList_;
+};
+
+JSLifeManagerImpl::JSLifeManagerImpl(){
+}
+
+JSLifeManagerImpl::~JSLifeManagerImpl(){
+}
+
+void JSLifeManagerImpl::protect( JSContextRef ctx, JSValueRef value ){
+    JSGlobalContextRef global = JSContextGetGlobalContext(ctx);
+    RefCountT &ref = mRefCount[global];
+    RefCountT::iterator itr = ref.find(value);
+    if( itr == ref.end()){
+        LOGE("protect %p", value);
+        JSValueProtect(ctx, value);
+        ref.insert( std::make_pair( value, 1));
+    }else
+        itr->second++;
+}
+
+void JSLifeManagerImpl::unprotect( JSContextRef ctx, JSValueRef value ){
+    JSGlobalContextRef global = JSContextGetGlobalContext(ctx);
+    RefCountT &ref = mRefCount[global];
+    RefCountT::iterator itr = ref.find(value);
+    if( itr == ref.end()){
+        return;
+    }
+    itr->second--;
+    if( itr->second == 0 ){
+        JSValueUnprotect(ctx, value);
+        ref.erase(itr);
+    }
+}
+
+void JSLifeManagerImpl::addGlobalContext(JSContextRef ctx) {
+  JSGlobalContextRef global = JSContextGetGlobalContext(ctx);
+  validContextList_.push_back(global);
+}
+
+bool JSLifeManagerImpl::isAvailableContext(JSContextRef ctx) {
+  auto found = std::find(validContextList_.begin(),
+                         validContextList_.end(),
+                         ctx);
+  return found != validContextList_.end();
+}
+
+void JSLifeManagerImpl::releaseContext( JSContextRef ctx ){
+    JSGlobalContextRef global = JSContextGetGlobalContext(ctx);
+    RefCountT &ref = mRefCount[global];
+    RefCountT::iterator itr = ref.begin();
+    while( itr != ref.end() ){
+        JSValueUnprotect( ctx, itr->first );
+        ++itr;
+    }
+    mRefCount.erase(global);
+    validContextList_.remove(global);
+}
+
+JSLifeManager& JSLifeManager::GetInstance(){
+    static JSLifeManager instance;
+    return instance;
+}
+
+JSLifeManager::JSLifeManager():mImpl(new JSLifeManagerImpl){
+
+}
+
+JSLifeManager::~JSLifeManager(){
+    delete mImpl;
+}
+
+void JSLifeManager::JSValueProtect(JSContextRef ctx, JSValueRef value){
+    mImpl->protect(ctx,value);
+}
+
+void JSLifeManager::JSValueUnprotect(JSContextRef ctx, JSValueRef value){
+    mImpl->unprotect(ctx, value);
+}
+
+void JSLifeManager::ReleaseContext(JSContextRef ctx){
+    mImpl->releaseContext(ctx);
+}
+
+void JSLifeManager::AddGlobalContext(JSContextRef ctx) {
+  mImpl->addGlobalContext(ctx);
+}
+
+bool JSLifeManager::IsAvailableContext(JSContextRef ctx) {
+  return mImpl->isAvailableContext(ctx);
+}\r
+
+} // CommonsJavaScript
+} // WrtDeviceApis
diff --git a/src/CommonsJavaScript/JSLifeManager.h b/src/CommonsJavaScript/JSLifeManager.h
new file mode 100755 (executable)
index 0000000..1646aa6
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2014 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.
+ */
+
+
+#ifndef JS_LIFE_MANAGER_H_
+#define JS_LIFE_MANAGER_H_
+
+#include <JavaScriptCore/JavaScript.h>
+
+namespace WrtDeviceApis {
+namespace CommonsJavaScript {
+
+class JSLifeManagerImpl;
+class JSLifeManager{
+    public:
+        void JSValueProtect(JSContextRef ctx, JSValueRef value);
+        void JSValueUnprotect(JSContextRef ctx, JSValueRef value);
+        void ReleaseContext(JSContextRef ctx);
+        void AddGlobalContext(JSContextRef ctx);
+        bool IsAvailableContext(JSContextRef ctx);
+        static JSLifeManager& GetInstance();
+    private:
+        JSLifeManager();
+        ~JSLifeManager();
+        JSLifeManager(const JSLifeManager&) = delete;
+        JSLifeManager& operator=(const JSLifeManager&) = delete;
+        JSLifeManagerImpl *mImpl;
+};
+} // CommonsJavaScript
+} // WrtDeviceApis
+
+
+#define JSValueSafeProtect(ctx,value) \
+    do {\
+        WrtDeviceApis::CommonsJavaScript::JSLifeManager::GetInstance().JSValueProtect(ctx,value); \
+    }while(0)
+
+
+#define JSValueSafeUnprotect(ctx,value) \
+    do {\
+        WrtDeviceApis::CommonsJavaScript::JSLifeManager::GetInstance().JSValueUnprotect(ctx,value); \
+    }while(0)
+
+
+#endif
@@ -21,7 +21,6 @@
  * @brief       Implementation of the JSPendingOperation class
  */
 
-#include <dpl/shared_ptr.h>
 #include <Commons/IEvent.h>
 #include "JSPendingOperation.h"
 #include "JSPendingOperationPrivateObject.h"
@@ -70,7 +69,7 @@ JSClassRef JSPendingOperation::getClassRef()
 void JSPendingOperation::initialize(JSContextRef /*context*/,
                                     JSObjectRef object)
 {
-    assert(NULL != JSObjectGetPrivate(object));
+    Assert(NULL != JSObjectGetPrivate(object));
 }
 
 void JSPendingOperation::finalize(JSObjectRef object)
@@ -94,7 +93,7 @@ JSValueRef JSPendingOperation::cancel(JSContextRef context,
     IJSPendingOperationPrivateObject *priv =
         static_cast<IJSPendingOperationPrivateObject *>(
             JSObjectGetPrivate(thisObject));
-    assert(NULL != priv);
+    Assert(NULL != priv);
     bool cancelResult = priv->cancel();
     LogDebug("cancel result : " << cancelResult);
     return JSValueMakeBoolean(context, cancelResult);
@@ -25,7 +25,7 @@
 #define WRTDEVICEAPIS_COMMONSJAVASCRIPT_JS_PENDINGOPERATION_H_
 
 #include <JavaScriptCore/JavaScript.h>
-#include <dpl/shared_ptr.h>
+#include <memory>
 #include <Commons/IEvent.h>
 #include <CommonsJavaScript/PrivateObject.h>
 #include <CommonsJavaScript/JSPendingOperationPrivateObject.h>
@@ -24,7 +24,7 @@
 
 #include <cassert>
 #include <dpl/log/log.h>
-#include <dpl/shared_ptr.h>
+#include <memory>
 #include <Commons/EventReceiver.h>
 #include <Commons/IExternEventCanceler.h>
 #include <Commons/IEvent.h>
@@ -35,11 +35,11 @@ class IJSPendingOperationPrivateObject
 {
   public:
     explicit IJSPendingOperationPrivateObject(
-        const DPL::SharedPtr<Commons::IEventController>
+        const std::shared_ptr<Commons::IEventController>
         &event) :
         m_event(event)
     {
-        assert(NULL != m_event);
+        Assert(NULL != m_event.get());
     }
 
     virtual bool cancel()
@@ -52,7 +52,7 @@ class IJSPendingOperationPrivateObject
     {}
 
   protected:
-    DPL::SharedPtr<Commons::IEventController> m_event;
+    std::shared_ptr<Commons::IEventController> m_event;
 };
 
 /*
@@ -76,14 +76,14 @@ class IJSExtCancelPendingOperationPrivateObject :
 {
   public:
     IJSExtCancelPendingOperationPrivateObject(
-        const DPL::SharedPtr< TemplateEvent> &event,
-        const DPL::SharedPtr<
+        const std::shared_ptr< TemplateEvent> &event,
+        const std::shared_ptr<
             Commons::IExternEventCanceler<TemplateEvent> > & cancel) :
         IJSPendingOperationPrivateObject(
-            DPL::StaticPointerCast<Commons::IEventController>(event)),
+            std::static_pointer_cast<Commons::IEventController>(event)),
         m_canceler(cancel)
     {
-        assert(NULL != m_canceler);
+        Assert(NULL != m_canceler);
     }
 
     virtual bool cancel()
@@ -98,7 +98,7 @@ class IJSExtCancelPendingOperationPrivateObject :
         if (m_canceler) {
             LogDebug("Calling extern cancel");
             m_canceler->OnCancelEvent(
-                DPL::StaticPointerCast<TemplateEvent>(m_event));
+                std::static_pointer_cast<TemplateEvent>(m_event));
         }
 
         return result;
@@ -108,7 +108,7 @@ class IJSExtCancelPendingOperationPrivateObject :
     {}
 
   protected:
-    DPL::SharedPtr< Commons::IExternEventCanceler<TemplateEvent> > m_canceler;
+    std::shared_ptr< Commons::IExternEventCanceler<TemplateEvent> > m_canceler;
 };
 }
 }
similarity index 96%
rename from src_mobile/CommonsJavaScript/PrivateObject.h
rename to src/CommonsJavaScript/PrivateObject.h
index 8bd816a..e1bcca3 100644 (file)
@@ -21,6 +21,7 @@
 #include <dpl/assert.h>
 #include <Commons/Exception.h>
 #include <Commons/TypeTraits.h>
+#include <CommonsJavaScript/JSLifeManager.h>
 
 namespace WrtDeviceApis {
 namespace CommonsJavaScript {
@@ -41,7 +42,7 @@ struct AcquireByProtect
     void acquire(T* object)
     {
         Assert(object && "Object passed to protect can't be NULL.");
-        JSValueProtect(object->getContext(), object->getObject());
+        JSValueSafeProtect(object->getContext(), object->getObject());
     }
 
   protected:
@@ -81,7 +82,7 @@ struct ReleaseByUnprotect
     void release(T* object)
     {
         Assert(object && "Object passed to unprotect can't be NULL.");
-        JSValueUnprotect(object->getContext(), object->getObject());
+        JSValueSafeUnprotect(object->getContext(), object->getObject());
     }
 
   protected:
similarity index 91%
rename from src_mobile/CommonsJavaScript/Utils.h
rename to src/CommonsJavaScript/Utils.h
index d8b8f95..4127d00 100644 (file)
@@ -20,7 +20,7 @@
 #ifndef WRTDEVICEAPIS_COMMONSJAVASCRIPT_UTILS_H_
 #define WRTDEVICEAPIS_COMMONSJAVASCRIPT_UTILS_H_
 
-#include <dpl/shared_ptr.h>
+#include <memory>
 #include <Commons/IEvent.h>
 #include <CommonsJavaScript/JSPendingOperation.h>
 #include <CommonsJavaScript/JSPendingOperationPrivateObject.h>
@@ -39,7 +39,7 @@ JSObjectRef makePendingOperation(JSContextRef context,
                                  const DPL::SharedPtr<EventType>& event)
 {
     Commons::IEventControllerPtr eventController =
-        DPL::StaticPointerCast<Commons::IEventController>(event);
+        std::static_pointer_cast<Commons::IEventController>(event);
     IJSPendingOperationPrivateObject* pendingOperation =
         new IJSPendingOperationPrivateObject(eventController);
     return JSObjectMake(context,
@@ -49,8 +49,8 @@ JSObjectRef makePendingOperation(JSContextRef context,
 template<typename EventType>
 JSObjectRef makeExtCancelSupportedPendingOperation(
     JSContextRef context,
-    const DPL::SharedPtr<EventType>& event,
-    const DPL::SharedPtr<Commons::IExternEventCanceler<EventType> >&
+    const std::shared_ptr<EventType>& event,
+    const std::shared_ptr<Commons::IExternEventCanceler<EventType> >&
     cancel)
 {
     IJSPendingOperationPrivateObject* pendingOperation =
similarity index 97%
rename from src_mobile/CommonsJavaScript/Validator.h
rename to src/CommonsJavaScript/Validator.h
index 6a89550..315ffcf 100644 (file)
@@ -21,7 +21,7 @@
 #include <vector>
 #include <JavaScriptCore/JavaScript.h>
 #include <dpl/noncopyable.h>
-#include <dpl/shared_ptr.h>
+#include <memory>
 #include <Commons/Exception.h>
 
 namespace WrtDeviceApis {
@@ -70,7 +70,7 @@ class ValidatorFactory : private DPL::Noncopyable
     /**
      * Validator type which deletes itself when gets out of scope.
      */
-    typedef DPL::SharedPtr<C> ValidatorType;
+    typedef std::shared_ptr<C> ValidatorType;
 
   public:
     /**
similarity index 100%
rename from src_wearable/DESCRIPTION
rename to src/DESCRIPTION
similarity index 89%
rename from src_mobile/dispatch-event/CMakeLists.txt
rename to src/dispatch-event/CMakeLists.txt
index 3ba4072..945f485 100644 (file)
@@ -18,8 +18,8 @@
 # @version  1.0
 #
 
-pkg_search_module(webkit2 REQUIRED ewebkit2)
-pkg_search_module(dpl REQUIRED dpl-efl)
+PKG_SEARCH_MODULE(webkit2 REQUIRED ewebkit2)
+PKG_SEARCH_MODULE(dpl REQUIRED dpl-efl)
 
 SET(TARGET_NAME wrt-dispatch-event)
 
@@ -41,6 +41,9 @@ TARGET_LINK_LIBRARIES(${TARGET_NAME}
 )
 
 SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES
+    COMPILE_DEFINITIONS LOG_TAG="${LOG_TAG}")
+
+SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES
     COMPILE_FLAGS -fPIC
     LINK_FLAGS "-Wl,--as-needed -Wl,--hash-style=both"
 )
@@ -27,7 +27,8 @@
 #include <string>
 #include <dpl/optional_typedefs.h>
 #include <dpl/log/log.h>
-#include <EWebKit2.h>
+#include <EWebKit.h>
+#include <EWebKit_internal.h>
 #include <JavaScriptCore/JavaScript.h>
 
 namespace DispatchEventSupport {
similarity index 90%
rename from src_mobile/js-overlay/CMakeLists.txt
rename to src/js-overlay/CMakeLists.txt
index f42c3f0..52b4427 100644 (file)
@@ -22,8 +22,8 @@ MACRO(INSTALL_HEADER_FILE HEADER_FILE)
         DESTINATION ${DESTINATION_HEADERS_JS_OVERLAY})
 ENDMACRO()
 
-pkg_search_module(webkit2 REQUIRED ewebkit2)
-pkg_search_module(plugin-types REQUIRED wrt-plugins-types)
+PKG_SEARCH_MODULE(webkit2 REQUIRED ewebkit2)
+PKG_SEARCH_MODULE(plugin-types REQUIRED wrt-plugins-types)
 
 SET(TARGET_NAME ${TARGET_JS_OVERLAY})
 
@@ -48,6 +48,9 @@ TARGET_LINK_LIBRARIES(${TARGET_NAME}
 )
 
 SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES
+    COMPILE_DEFINITIONS LOG_TAG="${LOG_TAG}")
+
+SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES
     COMPILE_FLAGS -fPIC
     LINK_FLAGS "-Wl,--as-needed -Wl,--hash-style=both"
 )
@@ -29,6 +29,7 @@
 #include <js_overlay_addEventListener.h>
 #include <js_overlay_types.h>
 #include <JSStorageEvent.h>
+#include <CommonsJavaScript/JSLifeManager.h>
 
 namespace WrtPlugins {
 namespace W3C {
@@ -78,7 +79,7 @@ JSValueRef AddEventListenerSupport::AddEventListener(
         LogError("JS object is not a function");
         return JSValueMakeUndefined(context);
     }
-    JSValueProtect(global_context, arguments[1]);
+    JSValueSafeProtect(global_context, arguments[1]);
     //add object to Listeners
     //set event information according to each event type
     CallbackData data;
@@ -109,7 +110,7 @@ void AddEventListenerSupport::RemoveIFrame(JSObjectPtr iframe)
 
     FOREACH(listener, *it->second)
     {
-        JSValueUnprotect(listener->context, listener->object);
+        JSValueSafeUnprotect(listener->context, listener->object);
     }
     m_listeners.erase(it);
     LogDebug("Iframe removed from add event listener object");
@@ -139,7 +140,7 @@ void AddEventListenerSupport::CallStorageListenersFromDifferentIFrames(
             const size_t argc = 1;
             JSValueRef argv[argc] = { eventObject };
 
-            JSValueProtect(listener->context, eventObject);
+            JSValueSafeProtect(listener->context, eventObject);
 
             if (listener->eventType == StorageCustomEvent)
             {
@@ -152,7 +153,7 @@ void AddEventListenerSupport::CallStorageListenersFromDifferentIFrames(
                     NULL);
             }
 
-            JSValueUnprotect(listener->context, eventObject);
+            JSValueSafeUnprotect(listener->context, eventObject);
         }
     }
 
@@ -25,6 +25,7 @@
 #include <JavaScriptCore/JavaScript.h>
 
 #include <js_overlay_support.h>
+#include <CommonsJavaScript/JSLifeManager.h>
 
 namespace JSOverlaySupport {
 class JSFunctionDispatcher
@@ -75,13 +76,13 @@ JSObjectPtr createWrappedFunction(
 
     JSStringRelease(name_js);
 
-    LogDebug("JSValueProtect invoked for: "
+    LogDebug("JSValueSafeProtect invoked for: "
              << overlayFunction->getObject() << " "
              << originalFunction->getObject() << " Wrapper:"
              << fun);
 
     //the value is unprotected in finalize of the JSFunctionDispatcher object
-    JSValueProtect(ctx,
+    JSValueSafeProtect(ctx,
                    static_cast<JSObjectRef>(
                        overlayFunction->getObject()));
 
@@ -126,7 +127,7 @@ void JSFunctionDispatcher::finalize(JSObjectRef object)
 
     PrivateData* priv = static_cast<PrivateData*>(JSObjectGetPrivate(object));
     if (priv) {
-        JSValueUnprotect(priv->context,
+        JSValueSafeUnprotect(priv->context,
                          static_cast<JSObjectRef>(
                              priv->overlayFunction->getObject()));
         delete priv;
similarity index 91%
rename from src_wearable/js-overlay/js_overlay_functions.cpp
rename to src/js-overlay/js_overlay_functions.cpp
index 8097d20..30c373d 100644 (file)
  * @brief
  */
 
+#include <memory>
+#include <string>
 #include <dpl/log/log.h>
-#include <dpl/scoped_array.h>
 #include <js_overlay_functions.h>
 
 namespace JSCFunctions {
 std::string ConvertJSStringToStdString(JSStringRef value)
 {
     int nSize = JSStringGetLength(value) + 1;
-    DPL::ScopedArray<char> textStr(new char[nSize]);
-    JSStringGetUTF8CString(value, textStr.Get(), nSize);
-    std::string ret = textStr.Get();
+    std::unique_ptr<char[]> textStr(new char[nSize]);
+    JSStringGetUTF8CString(value, textStr.get(), nSize);
+    std::string ret = textStr.get();
     return ret;
 }
 
@@ -49,10 +50,10 @@ JSValueRef JavaScriptPrintProc(JSContextRef context,
     JSStringRef textRef = JSValueToStringCopy(context, arguments[0], exception);
     int nSize = JSStringGetLength(textRef) + 1;
 
-    DPL::ScopedArray<char> textStr(new char[nSize]);
+    std::unique_ptr<char[]> textStr(new char[nSize]);
 
-    JSStringGetUTF8CString(textRef, textStr.Get(), nSize);
-    LogDebug("\033[00;35m[jsPrint] " << textStr.Get());
+    JSStringGetUTF8CString(textRef, textStr.get(), nSize);
+    LogDebug("\033[00;35m[jsPrint] " << textStr.get());
 
     JSStringRelease(textRef);
     return JSValueMakeBoolean(context, true);
similarity index 72%
rename from src_mobile/standards/CMakeLists.txt
rename to src/modules/API/CMakeLists.txt
index 83ff664..f8290dd 100644 (file)
 #    See the License for the specific language governing permissions and
 #    limitations under the License.
 #
-
-add_subdirectory(W3C)
+INCLUDE_CONFIG_FILE(Widget)
+INCLUDE_CONFIG_FILE(LocalStorage)
+INCLUDE_CONFIG_FILE(WidgetDB)
+INCLUDE_CONFIG_FILE(PluginManager)
+INCLUDE_CONFIG_FILE(StorageEvent)
+INCLUDE_CONFIG_FILE(TizenServiceEvent)
+INCLUDE_CONFIG_FILE(SoftKeyboardChangeEvent)
@@ -24,7 +24,7 @@
 #define WRTDEVICEAPIS_LOCALSTORAGE_LOCAL_STORAGE_INTERFACE_H_
 
 #include <string>
-#include <dpl/shared_ptr.h>
+#include <memory>
 #include <dpl/optional_typedefs.h>
 
 namespace WrtDeviceApis {
@@ -85,7 +85,7 @@ class ILocalStorage
     {}
 };
 
-typedef DPL::SharedPtr<ILocalStorage> ILocalStoragePtr;
+typedef std::shared_ptr<ILocalStorage> ILocalStoragePtr;
 } // Api
 } // LocalStorage
 } // WrtDeviceApis
@@ -27,7 +27,7 @@
 namespace WrtDeviceApis {
 namespace LocalStorage {
 namespace Api {
-ILocalStoragePtr getLocalStorage(int widgetId)
+ILocalStoragePtr getLocalStorage(WidgetHandle widgetId)
 {
     return ILocalStoragePtr(new WrtDeviceApis::WidgetInterfaceObject(widgetId));
 }
 #define WRTDEVICEAPIS_LOCALSTORAGE_LOCAL_STORAGE_FACTORY_H
 
 #include <LocalStorage/ILocalStorage.h>
+#include <dpl/wrt-dao-ro/wrt_db_types.h>
 
 namespace WrtDeviceApis {
 namespace LocalStorage {
 namespace Api {
-ILocalStoragePtr getLocalStorage(int widgetId);
+ILocalStoragePtr getLocalStorage(WidgetHandle widgetId);
 } // Api
 } // LocalStorage
 } // WrtDeviceApis
@@ -25,7 +25,7 @@
 
 #include <string>
 #include <vector>
-#include <dpl/shared_ptr.h>
+#include <memory>
 #include <JavaScriptCore/JavaScript.h>
 
 namespace WrtDeviceApis {
@@ -50,7 +50,7 @@ class IPluginManager
         JSPropertyNameAccumulatorRef propertyNames) const = 0;
 };
 
-typedef DPL::SharedPtr<IPluginManager> IPluginManagerPtr;
+typedef std::shared_ptr<IPluginManager> IPluginManagerPtr;
 }
 }
 }
@@ -36,7 +36,7 @@ PluginManagerFactory& PluginManagerFactory::getInstance()
 }
 
 IPluginManagerPtr PluginManagerFactory::getPluginManager(
-    int widgetHandle,
+    WidgetHandle widgetHandle,
     const std::string &objectUri,
     JSObjectRef object,
     JSContextRef context) const
@@ -26,6 +26,7 @@
 #include <string>
 #include <dpl/noncopyable.h>
 #include <PluginManager/IPluginManager.h>
+#include <dpl/wrt-dao-ro/wrt_db_types.h>
 
 namespace WrtDeviceApis {
 namespace PluginManager {
@@ -35,7 +36,7 @@ class PluginManagerFactory : private DPL::Noncopyable
   public:
     static PluginManagerFactory& getInstance();
     IPluginManagerPtr getPluginManager(
-        int widgetHandle,
+        WidgetHandle widgetHandle,
         const std::string &objectUri,
         JSObjectRef object,
         JSContextRef context) const;
@@ -25,7 +25,7 @@
 #define WRTDEVICEAPIS_COMMONS_STORAGE_EVENT_INTERFACE_H
 
 #include <dpl/optional_typedefs.h>
-#include <dpl/shared_ptr.h>
+#include <memory>
 #include <LocalStorage/ILocalStorage.h>
 
 namespace WrtDeviceApis {
@@ -34,6 +34,7 @@ namespace Api {
 class IStorageEvent
 {
   public:
+    virtual ~IStorageEvent() = 0;
 
     virtual std::string getKey() const = 0;
     virtual DPL::OptionalString getOldValue() const = 0;
@@ -49,7 +50,7 @@ class IStorageEvent
         const LocalStorage::Api::ILocalStoragePtr &inStorageArea) = 0;
 };
 
-typedef DPL::SharedPtr<IStorageEvent> IStorageEventPtr;
+typedef std::shared_ptr<IStorageEvent> IStorageEventPtr;
 } // Api
 } // StorageEvent
 } // WrtDeviceApis
@@ -27,7 +27,7 @@ namespace WrtDeviceApis {
 namespace StorageEvent {
 namespace Api {
 StorageEvent::StorageEvent() :
-    m_storageArea(NULL) {}
+    m_storageArea() {}
 
 StorageEvent::StorageEvent(
     const LocalStorage::Api::ILocalStoragePtr &storageArea) :
@@ -25,7 +25,7 @@
 #define _WRT_PLUGIN_TIZEN_SERVICE_EVENT_INTERFACE_H_
 
 #include <string>
-#include <dpl/shared_ptr.h>
+#include <memory>
 
 namespace WrtDeviceApis {
 namespace TizenServiceEvent {
@@ -41,7 +41,7 @@ class ITizenServiceEvent
     virtual ~ITizenServiceEvent() {}
 };
 
-typedef DPL::SharedPtr<ITizenServiceEvent> ITizenServiceEventPtr;
+typedef std::shared_ptr<ITizenServiceEvent> ITizenServiceEventPtr;
 } // Api
 } // TizenServiceEvent
 } // WrtDeviceApis
similarity index 98%
rename from src_mobile/modules/API/Widget/IWidget.h
rename to src/modules/API/Widget/IWidget.h
index 1936ee9..608dc4e 100644 (file)
 
 #include <string>
 
-#include <dpl/shared_ptr.h>
+#include <memory>
 
 namespace WrtDeviceApis {
 namespace Widget {
 namespace Api {
 class IWidget;
-typedef DPL::SharedPtr<IWidget> IWidgetPtr;
+typedef std::shared_ptr<IWidget> IWidgetPtr;
 
 class IWidget
 {
similarity index 93%
rename from src_mobile/modules/API/WidgetDB/IWidgetDB.h
rename to src/modules/API/WidgetDB/IWidgetDB.h
index e0c3f9b..218eb1e 100644 (file)
 
 #include "IWidgetFeature.h"
 #include <vector>
-#include <dpl/shared_ptr.h>
+#include <memory>
+#include <dpl/wrt-dao-ro/wrt_db_types.h>
 
 namespace WrtDeviceApis {
 namespace WidgetDB {
 namespace Api {
 class IWidgetDB;
-typedef DPL::SharedPtr<IWidgetDB> IWidgetDBPtr;
+typedef std::shared_ptr<IWidgetDB> IWidgetDBPtr;
 
 typedef std::vector<IWidgetFeaturePtr> Features;
 
@@ -48,7 +49,6 @@ enum class ConfigAttribute
     NAME,
     SHORT_NAME,
     ICON,
-    ACCESS_NETWORK,
     WIDTH,
     HEIGHT,
     INSTALL_PATH,
@@ -66,7 +66,7 @@ class IWidgetDB
 {
   public:
 
-    virtual int getWidgetId() const = 0;
+    virtual WidgetHandle getWidgetId() const = 0;
 
     virtual std::string getLanguage() const = 0;
 
@@ -24,7 +24,7 @@
 
 #include <list>
 #include <string>
-#include <dpl/shared_ptr.h>
+#include <memory>
 
 namespace WrtDeviceApis {
 namespace WidgetDB {
@@ -41,7 +41,7 @@ class IWidgetFeature
     virtual bool isRequestedByWidget() const = 0;
 };
 
-typedef DPL::SharedPtr<IWidgetFeature> IWidgetFeaturePtr;
+typedef std::shared_ptr<IWidgetFeature> IWidgetFeaturePtr;
 } // Api
 } // WidgetDB
 } // WrtDeviceApis
similarity index 95%
rename from src_mobile/modules/API/WidgetDB/WidgetDBMgr.cpp
rename to src/modules/API/WidgetDB/WidgetDBMgr.cpp
index b275f33..b8940c9 100644 (file)
@@ -27,7 +27,7 @@
 namespace WrtDeviceApis {
 namespace WidgetDB {
 namespace Api {
-IWidgetDBPtr getWidgetDB(int widgetId)
+IWidgetDBPtr getWidgetDB(WidgetHandle widgetId)
 {
     return IWidgetDBPtr(new WrtDeviceApis::WidgetDB::WidgetDB(widgetId));
 }
similarity index 95%
rename from src_mobile/modules/API/WidgetDB/WidgetDBMgr.h
rename to src/modules/API/WidgetDB/WidgetDBMgr.h
index 6de3f99..cdf24bc 100644 (file)
@@ -28,7 +28,7 @@
 namespace WrtDeviceApis {
 namespace WidgetDB {
 namespace Api {
-IWidgetDBPtr getWidgetDB(int widgetId);
+IWidgetDBPtr getWidgetDB(WidgetHandle widgetId);
 } // Api
 } // WidgetDB
 } // WrtDeviceApis
similarity index 87%
rename from src_wearable/modules/CMakeLists.txt
rename to src/modules/CMakeLists.txt
index 85db759..94f05f2 100644 (file)
 #    See the License for the specific language governing permissions and
 #    limitations under the License.
 #
-include_directories(
+INCLUDE_DIRECTORIES(
  ${CMAKE_CURRENT_SOURCE_DIR}
  ${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM}
 )
 
-add_subdirectory(API)
-add_subdirectory(${PLATFORM})
-add_subdirectory(packages)
+ADD_SUBDIRECTORY(API)
+ADD_SUBDIRECTORY(${PLATFORM})
+ADD_SUBDIRECTORY(packages)
diff --git a/src/modules/packages/CMakeLists.txt b/src/modules/packages/CMakeLists.txt
new file mode 100644 (file)
index 0000000..b28b471
--- /dev/null
@@ -0,0 +1,32 @@
+# 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.
+#
+
+SET(TARGET_MODULE_WIDGET "wrt-plugins-widget")
+SET(TARGET_MODULE_LOCALSTORAGE "wrt-plugins-localstorage")
+SET(TARGET_MODULE_WIDGET_INTERFACE "wrt-plugins-widget-interface")
+SET(TARGET_MODULE_STORAGEEVENT "wrt-plugins-storageevent")
+SET(TARGET_MODULE_TIZEN_SERVICE_EVENT "wrt-plugins-tizen-service-event")
+SET(TARGET_MODULE_SOFTKEYBOARD_CHANGE_EVENT "wrt-plugins-softkeyboardchange-event")
+SET(TARGET_MODULE_WIDGETDB "wrt-plugins-widgetdb")
+SET(TARGET_MODULE_PLUGIN_MANAGER "wrt-plugins-plugin-manager")
+
+ADD_SUBDIRECTORY(Widget)
+ADD_SUBDIRECTORY(LocalStorage)
+ADD_SUBDIRECTORY(WidgetInterface)
+ADD_SUBDIRECTORY(WidgetDB)
+ADD_SUBDIRECTORY(PluginManager)
+ADD_SUBDIRECTORY(StorageEvent)
+ADD_SUBDIRECTORY(TizenServiceEvent)
+ADD_SUBDIRECTORY(SoftKeyboardChangeEvent)
old mode 100644 (file)
new mode 100755 (executable)
similarity index 57%
rename from src_mobile/modules/packages/WidgetDB/CMakeLists.txt
rename to src/modules/packages/LocalStorage/CMakeLists.txt
index ec91fdb..0129642
@@ -1,4 +1,3 @@
-#
 # Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
 #
 #    Licensed under the Apache License, Version 2.0 (the "License");
 #    See the License for the specific language governing permissions and
 #    limitations under the License.
 #
-macro(install_header_file HEADER_FILE)
-    INSTALL(FILES ${API_WIDGETDB_PATH}/${HEADER_FILE}
-        DESTINATION ${DESTINATION_HEADER_PREFIX}/WidgetDB)
-endmacro()
 
-set(TARGET_NAME ${TARGET_MODULE_WIDGETDB})
 
-include_directories(
-    ${INCLUDES_PLATFORM_IMPLEMENTATION_WIDGETDB}
-)
+MACRO(install_header_file HEADER_FILE)
+    INSTALL(FILES ${API_LOCALSTORAGE_PATH}/${HEADER_FILE}
+        DESTINATION ${DESTINATION_HEADER_PREFIX}/LocalStorage)
+ENDMACRO()
+
+SET(TARGET_NAME ${TARGET_MODULE_LOCALSTORAGE})
 
-set(SRCS
-  ${SRCS_API_WIDGETDB}
-  ${SRCS_PLATFORM_IMPLEMENTATION_WIDGETDB}
+SET(SRCS
+  ${SRCS_API_LOCALSTORAGE}
 )
 
-add_library(${TARGET_NAME} SHARED ${SRCS})
+ADD_LIBRARY(${TARGET_NAME} SHARED ${SRCS})
 
-target_link_libraries(${TARGET_NAME}
+TARGET_LINK_LIBRARIES(${TARGET_NAME}
    ${LIBS_COMMONS}
    ${TARGET_COMMONS}
-   ${LIBS_PLATFORM_IMPLEMENTATION_WIDGETDB}
+   ${TARGET_MODULE_WIDGET_INTERFACE}
 )
-set_target_properties(${TARGET_NAME} PROPERTIES 
+
+SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES 
  SOVERSION ${CMAKE_PROJECT_API_VERSION}
  VERSION ${CMAKE_PROJECT_VERSION}
+ COMPILE_DEFINITIONS LOG_TAG="${LOG_TAG}"
 )
 
 INSTALL(TARGETS ${TARGET_NAME} LIBRARY DESTINATION
     ${DESTINATION_LIB_PREFIX})
 
-install_header_file(IWidgetDB.h)
-install_header_file(IWidgetFeature.h)
-install_header_file(WidgetDBMgr.h)
-
+INSTALL_HEADER_FILE(ILocalStorage.h)
+INSTALL_HEADER_FILE(LocalStorageMgr.h)
 # @version  1.0
 #
 
-macro(install_header_file HEADER_FILE)
+MACRO(install_header_file HEADER_FILE)
     INSTALL(FILES ${API_PLUGIN_MANAGER_PATH}/${HEADER_FILE}
         DESTINATION ${DESTINATION_HEADER_PREFIX}/PluginManager)
-endmacro()
+ENDMACRO()
 
-set(TARGET_NAME ${TARGET_MODULE_PLUGIN_MANAGER})
+SET(TARGET_NAME ${TARGET_MODULE_PLUGIN_MANAGER})
 
-pkg_search_module(webkit2 REQUIRED ewebkit2)
+PKG_SEARCH_MODULE(webkit2 REQUIRED ewebkit2)
 
-include_directories(
+INCLUDE_DIRECTORIES(
     ${INCLUDES_PLATFORM_IMPLEMENTATION_PLUGIN_MANAGER}
     ${webkit2_INCLUDE_DIRS}}
 )
 
-set(SRCS
+SET(SRCS
   ${SRCS_API_PLUGIN_MANAGER}
   ${SRCS_PLATFORM_IMPLEMENTATION_PLUGIN_MANAGER}
 )
 
-add_library(${TARGET_NAME} SHARED ${SRCS})
-target_link_libraries(${TARGET_NAME}
+ADD_LIBRARY(${TARGET_NAME} SHARED ${SRCS})
+TARGET_LINK_LIBRARIES(${TARGET_NAME}
    ${LIBS_COMMONS}
    ${TARGET_PLUGIN_LOADING_LIB}
    ${TARGET_COMMONS}
@@ -46,7 +46,10 @@ target_link_libraries(${TARGET_NAME}
    ${LIBS_PLATFORM_IMPLEMENTATION_PLUGIN_MANAGER}
 )
 
-set_target_properties(${TARGET_NAME} PROPERTIES
+SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES
+    COMPILE_DEFINITIONS LOG_TAG="${LOG_TAG}")
+
+SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES
  SOVERSION ${CMAKE_PROJECT_API_VERSION}
  VERSION ${CMAKE_PROJECT_VERSION}
 )
@@ -54,5 +57,5 @@ set_target_properties(${TARGET_NAME} PROPERTIES
 INSTALL(TARGETS ${TARGET_NAME} LIBRARY DESTINATION
     ${DESTINATION_LIB_PREFIX})
 
-install_header_file(PluginManagerFactory.h)
-install_header_file(IPluginManager.h)
+INSTALL_HEADER_FILE(PluginManagerFactory.h)
+INSTALL_HEADER_FILE(IPluginManager.h)
 # @author      Yunchan Cho (yunchan.cho@samsung.com)
 # @version     0.1
 
-set(TARGET_NAME ${TARGET_MODULE_SOFTKEYBOARD_CHANGE_EVENT})
+SET(TARGET_NAME ${TARGET_MODULE_SOFTKEYBOARD_CHANGE_EVENT})
 
-set(SRCS
+SET(SRCS
     ${SRCS_API_SOFTKEYBOARD_CHANGE_EVENT}
 )
 
-add_library(${TARGET_NAME} STATIC ${SRCS})
+ADD_LIBRARY(${TARGET_NAME} STATIC ${SRCS})
+
+SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES
+    COMPILE_DEFINITIONS LOG_TAG="${LOG_TAG}")
 #    See the License for the specific language governing permissions and
 #    limitations under the License.
 #
-set(TARGET_NAME ${TARGET_MODULE_STORAGEEVENT})
+SET(TARGET_NAME ${TARGET_MODULE_STORAGEEVENT})
 
-set(SRCS
+SET(SRCS
   ${SRCS_API_STORAGE_EVENT}
 )
 
-add_library(${TARGET_NAME} STATIC ${SRCS})
+ADD_LIBRARY(${TARGET_NAME} STATIC ${SRCS})
 
-target_link_libraries(${TARGET_NAME}
+TARGET_LINK_LIBRARIES(${TARGET_NAME}
    ${TARGET_MODULE_LOCALSTORAGE}
 )
 
+SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES
+    COMPILE_DEFINITIONS LOG_TAG="${LOG_TAG}")
 # @author      Yunchan Cho (yunchan.cho@samsung.com)
 # @version     0.1
 
-set(TARGET_NAME ${TARGET_MODULE_TIZEN_SERVICE_EVENT})
+SET(TARGET_NAME ${TARGET_MODULE_TIZEN_SERVICE_EVENT})
 
-set(SRCS
+SET(SRCS
   ${SRCS_API_TIZEN_SERVICE_EVENT}
 )
 
-add_library(${TARGET_NAME} STATIC ${SRCS})
+ADD_LIBRARY(${TARGET_NAME} STATIC ${SRCS})
+
+SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES
+    COMPILE_DEFINITIONS LOG_TAG="${LOG_TAG}")
old mode 100644 (file)
new mode 100755 (executable)
similarity index 56%
rename from src_wearable/modules/packages/Widget/CMakeLists.txt
rename to src/modules/packages/Widget/CMakeLists.txt
index 74bf1a6..dd77a14
 #    limitations under the License.
 #
 
-set(TARGET_NAME ${TARGET_MODULE_WIDGET})
 
-set(SRCS
+MACRO(install_header_file HEADER_FILE)
+    INSTALL(FILES ${API_WIDGET_PATH}/${HEADER_FILE}
+        DESTINATION ${DESTINATION_HEADER_PREFIX}/Widget)
+ENDMACRO()
+
+SET(TARGET_NAME ${TARGET_MODULE_WIDGET})
+
+SET(SRCS
     ${SRCS_API_WIDGET}
     ${SRCS_IMPLEMENTATION_WIDGET}
 )
 
-add_library(${TARGET_NAME} STATIC ${SRCS})
+ADD_LIBRARY(${TARGET_NAME} SHARED ${SRCS})
 
-target_link_libraries(${TARGET_NAME}
+TARGET_LINK_LIBRARIES(${TARGET_NAME}
    ${LIBS_COMMONS}
    ${TARGET_COMMONS}
    ${TARGET_MODULE_WIDGETDB}
 )
 
+SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES 
+ SOVERSION ${CMAKE_PROJECT_API_VERSION}
+ VERSION ${CMAKE_PROJECT_VERSION}
+ COMPILE_DEFINITIONS LOG_TAG="${LOG_TAG}"
+)
+
+INSTALL(TARGETS ${TARGET_NAME} LIBRARY DESTINATION
+    ${DESTINATION_LIB_PREFIX})
+
+INSTALL_HEADER_FILE(IWidget.h)
+INSTALL_HEADER_FILE(WidgetFactory.h)
 #    See the License for the specific language governing permissions and
 #    limitations under the License.
 #
-macro(install_header_file HEADER_FILE)
+MACRO(install_header_file HEADER_FILE)
     INSTALL(FILES ${API_WIDGETDB_PATH}/${HEADER_FILE}
         DESTINATION ${DESTINATION_HEADER_PREFIX}/WidgetDB)
-endmacro()
+ENDMACRO()
 
-set(TARGET_NAME ${TARGET_MODULE_WIDGETDB})
+SET(TARGET_NAME ${TARGET_MODULE_WIDGETDB})
 
-include_directories(
+INCLUDE_DIRECTORIES(
     ${INCLUDES_PLATFORM_IMPLEMENTATION_WIDGETDB}
 )
 
-set(SRCS
+SET(SRCS
   ${SRCS_API_WIDGETDB}
   ${SRCS_PLATFORM_IMPLEMENTATION_WIDGETDB}
 )
 
-add_library(${TARGET_NAME} SHARED ${SRCS})
+ADD_LIBRARY(${TARGET_NAME} SHARED ${SRCS})
 
-target_link_libraries(${TARGET_NAME}
+TARGET_LINK_LIBRARIES(${TARGET_NAME}
    ${LIBS_COMMONS}
    ${TARGET_COMMONS}
    ${LIBS_PLATFORM_IMPLEMENTATION_WIDGETDB}
 )
-set_target_properties(${TARGET_NAME} PROPERTIES 
+
+SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES
+    COMPILE_DEFINITIONS LOG_TAG="${LOG_TAG}")
+
+SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES
  SOVERSION ${CMAKE_PROJECT_API_VERSION}
  VERSION ${CMAKE_PROJECT_VERSION}
 )
@@ -44,7 +48,7 @@ set_target_properties(${TARGET_NAME} PROPERTIES
 INSTALL(TARGETS ${TARGET_NAME} LIBRARY DESTINATION
     ${DESTINATION_LIB_PREFIX})
 
-install_header_file(IWidgetDB.h)
-install_header_file(IWidgetFeature.h)
-install_header_file(WidgetDBMgr.h)
+INSTALL_HEADER_FILE(IWidgetDB.h)
+INSTALL_HEADER_FILE(IWidgetFeature.h)
+INSTALL_HEADER_FILE(WidgetDBMgr.h)
 
 #    limitations under the License.
 #
 
-macro(install_header_file HEADER_FILE)
+MACRO(install_header_file HEADER_FILE)
     INSTALL(FILES ${API_WIDGET_INTERFACE_PATH}/${HEADER_FILE}
         DESTINATION ${DESTINATION_HEADER_PREFIX}/WidgetInterface)
-endmacro()
+ENDMACRO()
 
-pkg_search_module(dpl-wrt-dao-ro REQUIRED dpl-wrt-dao-ro)
-pkg_search_module(wrt-commons-widget-interface-dao REQUIRED wrt-commons-widget-interface-dao)
+PKG_SEARCH_MODULE(dpl-wrt-dao-ro REQUIRED dpl-wrt-dao-ro)
+PKG_SEARCH_MODULE(wrt-commons-widget-interface-dao REQUIRED wrt-commons-widget-interface-dao)
 
-include_directories(
+INCLUDE_DIRECTORIES(
     ${WIDGET_INTERFACE_INCLUDE_DIRS}
     ${dpl-wrt-dao-ro_INCLUDE_DIRS}
     ${wrt-commons-widget-interface-dao_INCLUDE_DIRS})
 
-set(TARGET_NAME ${TARGET_MODULE_WIDGET_INTERFACE})
+SET(TARGET_NAME ${TARGET_MODULE_WIDGET_INTERFACE})
 
-set(SRCS
+SET(SRCS
     ${SRCS_WIDGET_INTERFACE}
 )
 
-add_library(${TARGET_NAME} SHARED ${SRCS})
+ADD_LIBRARY(${TARGET_NAME} SHARED ${SRCS})
 
-target_link_libraries(${TARGET_NAME}
+TARGET_LINK_LIBRARIES(${TARGET_NAME}
    ${LIBS_COMMONS}
    ${dpl-wrt-dao-ro_LIBRARIES}
    ${wrt-commons-widget-interface-dao_LIBRARIES}
 )
-set_target_properties(${TARGET_NAME} PROPERTIES 
+
+SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES
+    COMPILE_DEFINITIONS LOG_TAG="${LOG_TAG}")
+
+SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES
  SOVERSION ${CMAKE_PROJECT_API_VERSION}
  VERSION ${CMAKE_PROJECT_VERSION}
 )
@@ -47,4 +51,4 @@ set_target_properties(${TARGET_NAME} PROPERTIES
 INSTALL(TARGETS ${TARGET_NAME} LIBRARY DESTINATION
     ${DESTINATION_LIB_PREFIX})
 
-install_header_file(WidgetInterface.h)
+INSTALL_HEADER_FILE(WidgetInterface.h)
similarity index 84%
rename from src_mobile/modules/tizen/CMakeLists.txt
rename to src/modules/tizen/CMakeLists.txt
index 3cfc293..f212fb3 100644 (file)
 # are used in Power config.cmake file.
 ################################################################################
 
-include_config_file(Filesystem)
-include_config_file(Widget)
-include_config_file(LocalStorage)
-include_config_file(WidgetInterface)
-add_subdirectory(WidgetInterface)
-include_config_file(WidgetDB)
-include_config_file(PluginManager)
+INCLUDE_CONFIG_FILE(Widget)
+INCLUDE_CONFIG_FILE(LocalStorage)
+INCLUDE_CONFIG_FILE(WidgetInterface)
+ADD_SUBDIRECTORY(WidgetInterface)
+INCLUDE_CONFIG_FILE(WidgetDB)
+INCLUDE_CONFIG_FILE(PluginManager)
old mode 100644 (file)
new mode 100755 (executable)
similarity index 94%
rename from src_wearable/modules/tizen/PluginManager/PluginManager.cpp
rename to src/modules/tizen/PluginManager/PluginManager.cpp
index 8e528b1..e56d83d
@@ -33,6 +33,7 @@
 #include <dpl/exception.h>
 #include <dpl/log/secure_log.h>
 #include <dpl/foreach.h>
+#include <CommonsJavaScript/JSLifeManager.h>
 
 using namespace std;
 
@@ -43,7 +44,7 @@ const char* SEPARATOR = ".";
 
 namespace WrtDeviceApis {
 namespace PluginManager {
-PluginManager::PluginManager(int widgetHandle,
+PluginManager::PluginManager(WidgetHandle widgetHandle,
                              const string &objectUri,
                              JSObjectRef object,
                              JSContextRef context) :
@@ -61,7 +62,7 @@ PluginManager::~PluginManager()
 {
     ObjectList::iterator it = m_objectList.begin();
     for (; it != m_objectList.end(); ++it) {
-        JSValueUnprotect(m_context, it->second);
+        JSValueSafeUnprotect(m_context, it->second);
     }
     WrtDB::WrtDatabase::detachFromThread();
 }
@@ -138,6 +139,10 @@ JSValueRef PluginManager::getProperty(const string &name) const
         return it->second;
     }
 
+    if( !hasChild(name) )
+        return JSValueMakeUndefined(m_context);
+
+
     if (!loadChild(name)) {
         ThrowMsg(Commons::PlatformException, "Cannot load plugin");
     }
@@ -155,10 +160,14 @@ bool PluginManager::setProperty(const string &name,
                                 JSValueRef value)
 {
     _D("setProperty %s", name.c_str());
+    if( !hasChild(name) ){
+        return false;
+    }
+
     if (m_objectList.count(name) > 0) {
-        JSValueUnprotect(m_context, m_objectList[name]);
+        JSValueSafeUnprotect(m_context, m_objectList[name]);
     }
-    JSValueProtect(m_context, value);
+    JSValueSafeProtect(m_context, value);
     m_objectList[name] = value;
     return true;
 }
@@ -167,7 +176,7 @@ bool PluginManager::deleteProperty(const string &name)
 {
     if (m_objectList.count(name) > 0) {
         _D("deleteProperty %s", name.c_str());
-        JSValueUnprotect(m_context, m_objectList[name]);
+        JSValueSafeUnprotect(m_context, m_objectList[name]);
         m_objectList.erase(name);
         return true;
     }
 #include <string>
 #include <API/PluginManager/IPluginManager.h>
 #include <boost/optional.hpp>
+#include <dpl/wrt-dao-ro/wrt_db_types.h>
 
 namespace WrtDeviceApis {
 namespace PluginManager {
 class PluginManager : public Api::IPluginManager
 {
   public:
-    PluginManager(int widgetHandle,
+    PluginManager(WidgetHandle widgetHandle,
                   const std::string &objectUri,
                   JSObjectRef object,
                   JSContextRef context);
@@ -52,7 +53,7 @@ class PluginManager : public Api::IPluginManager
   private:
     typedef std::map<std::string, JSValueRef> ObjectList;
 
-    int m_widgetHandle;
+    WidgetHandle m_widgetHandle;
     JSObjectRef m_objectInstance;
     std::string m_objectUri;
     std::string m_shortUri;
similarity index 96%
rename from src_mobile/modules/tizen/Widget/Widget.h
rename to src/modules/tizen/Widget/Widget.h
index 1dee043..d46b9c7 100644 (file)
@@ -33,6 +33,8 @@
 #include <WidgetDB/IWidgetDB.h>
 #include "Property.h"
 
+#include <dpl/wrt-dao-ro/wrt_db_types.h>
+
 namespace WrtDeviceApis {
 namespace Widget {
 class Widget : public Api::IWidget
@@ -71,7 +73,7 @@ class Widget : public Api::IWidget
     std::string getProperty(WidgetDB::Api::ConfigAttribute) const;
     void checkWidgetId() const;
 
-    int m_widgetId;
+    WidgetHandle m_widgetId;
 };
 }
 }
similarity index 97%
rename from src_wearable/modules/tizen/WidgetDB/WidgetDB.cpp
rename to src/modules/tizen/WidgetDB/WidgetDB.cpp
index f2813b4..cea399b 100644 (file)
@@ -28,6 +28,7 @@
 #include <Commons/Exception.h>
 #include <WidgetDB/IWidgetDB.h>
 #include <WidgetDB/IWidgetFeature.h>
+#include <dpl/log/log.h>
 #include <dpl/wrt-dao-ro/property_dao_read_only.h>
 #include <dpl/wrt-dao-ro/widget_dao_read_only.h>
 #include <dpl/wrt-dao-ro/global_config.h>
@@ -43,9 +44,9 @@
 
 namespace WrtDeviceApis {
 namespace WidgetDB {
-WidgetDB::WidgetDB(int widgetId) : m_widgetId(widgetId) {}
+WidgetDB::WidgetDB(WidgetHandle widgetId) : m_widgetId(widgetId) {}
 
-int WidgetDB::getWidgetId() const
+WidgetHandle WidgetDB::getWidgetId() const
 {
     return m_widgetId;
 }
@@ -252,8 +253,8 @@ Api::Features WidgetDB::getWidgetFeatures() const
     WrtDB::DbWidgetFeatureSet features;
     Try
     {
-        WrtDB::WidgetDAOReadOnly doa(getWidgetId());
-        features = doa.getFeaturesList();
+        WrtDB::WidgetDAOReadOnly dao(getWidgetId());
+        features = dao.getFeaturesList();
     }
     Catch(DPL::Exception)
     {
similarity index 91%
rename from src_mobile/modules/tizen/WidgetDB/WidgetDB.h
rename to src/modules/tizen/WidgetDB/WidgetDB.h
index b471e1a..f91547e 100644 (file)
@@ -25,6 +25,7 @@
 
 #include <string>
 #include <WidgetDB/IWidgetDB.h>
+#include <dpl/wrt-dao-ro/wrt_db_types.h>
 
 namespace WrtDeviceApis {
 namespace WidgetDB {
@@ -32,9 +33,9 @@ class WidgetDB : public Api::IWidgetDB
 {
   public:
 
-    explicit WidgetDB(int widgetId);
+    explicit WidgetDB(WidgetHandle widgetId);
 
-    virtual int getWidgetId() const;
+    virtual WidgetHandle getWidgetId() const;
 
     virtual std::string getLanguage() const;
 
@@ -59,7 +60,7 @@ class WidgetDB : public Api::IWidgetDB
 
   private:
 
-    int m_widgetId;
+    WidgetHandle m_widgetId;
 };
 } // WidgetDB
 } // WrtDeviceApis
diff --git a/src/modules/tizen/WidgetInterface/CMakeLists.txt b/src/modules/tizen/WidgetInterface/CMakeLists.txt
new file mode 100644 (file)
index 0000000..e6ddea1
--- /dev/null
@@ -0,0 +1,6 @@
+
+GET_CURRENT_PATH()
+
+PKG_SEARCH_MODULE(wrt-commons-widget-interface-dao REQUIRED wrt-commons-widget-interface-dao)
+
+INCLUDE_DIRECTORIES(${CURRENT_PATH})
@@ -30,7 +30,7 @@
 namespace WrtDeviceApis {
 using namespace WidgetInterfaceDB;
 
-WidgetInterfaceObject::WidgetInterfaceObject(int widgetHandle)
+WidgetInterfaceObject::WidgetInterfaceObject(WidgetHandle widgetHandle)
 {
     Try
     {
 #include <dpl/optional_typedefs.h>
 #include <wrt-commons/widget-interface-dao/widget_interface_dao.h>
 #include <LocalStorage/ILocalStorage.h>
+#include <dpl/wrt-dao-ro/wrt_db_types.h>
 
 namespace WrtDeviceApis {
 class WidgetInterfaceObject :
     public LocalStorage::Api::ILocalStorage
 {
   public:
-    WidgetInterfaceObject(int widgetHandle);
+    WidgetInterfaceObject(WidgetHandle widgetHandle);
     virtual ~WidgetInterfaceObject();
 
     void setItem(const std::string& key,
similarity index 80%
rename from src_mobile/plugin-loading/CMakeLists.txt
rename to src/plugin-loading/CMakeLists.txt
index fbcf48a..7341e01 100644 (file)
 # @version  1.0
 #
 
-pkg_search_module(plugin-types REQUIRED wrt-plugins-types)
-pkg_search_module(dpl REQUIRED dpl-efl)
-pkg_search_module(dpl-event REQUIRED dpl-event-efl)
-pkg_search_module(dpl-wrt-dao-ro REQUIRED dpl-wrt-dao-ro)
-pkg_search_module(webkit2 REQUIRED ewebkit2)
+PKG_SEARCH_MODULE(plugin-types REQUIRED wrt-plugins-types)
+PKG_SEARCH_MODULE(dpl REQUIRED dpl-efl)
+PKG_SEARCH_MODULE(dpl-event REQUIRED dpl-event-efl)
+PKG_SEARCH_MODULE(dpl-wrt-dao-ro REQUIRED dpl-wrt-dao-ro)
+PKG_SEARCH_MODULE(webkit2 REQUIRED ewebkit2)
 
-set(PLUGIN_LOADING_SOURCES
+SET(PLUGIN_LOADING_SOURCES
     ${PLUGIN_LOADING_DIRS}/plugin_logic.cpp
     ${PLUGIN_LOADING_DIRS}/plugin.cpp
     ${PLUGIN_LOADING_DIRS}/plugin_model.cpp
@@ -48,6 +48,12 @@ ADD_LIBRARY(${TARGET_PLUGIN_LOADING_LIB} SHARED
 )
 
 SET_TARGET_PROPERTIES(${TARGET_PLUGIN_LOADING_LIB} PROPERTIES
+    COMPILE_DEFINITIONS LOG_TAG="${LOG_TAG}")
+
+SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES
+    COMPILE_DEFINITIONS LOG_TAG="${LOG_TAG}")
+
+SET_TARGET_PROPERTIES(${TARGET_PLUGIN_LOADING_LIB} PROPERTIES
     COMPILE_FLAGS -fPIC
     LINK_FLAGS "-Wl,--as-needed -Wl,--hash-style=both"
 )
@@ -57,7 +63,7 @@ SET_TARGET_PROPERTIES(${TARGET_PLUGIN_LOADING_LIB} PROPERTIES
     VERSION ${CMAKE_PROJECT_VERSION}
 )
 
-target_link_libraries(${TARGET_PLUGIN_LOADING_LIB}
+TARGET_LINK_LIBRARIES(${TARGET_PLUGIN_LOADING_LIB}
     ${dpl_LIBRARIES}
     ${dpl-event_LIBRARIES}
     ${dpl-wrt-dao-ro_LIBRARIES}
similarity index 97%
rename from src_wearable/plugin-loading/explorer.cpp
rename to src/plugin-loading/explorer.cpp
index 1d5d8c3..9990262 100644 (file)
@@ -149,7 +149,7 @@ bool Explorer::registerObject(const JSObjectDeclarationPtr& declaration,
     std::string fullParentName = declaration->getParentName();
 
     if (fullParentName == providedObjectName) {
-        \r_D("Provided object was matched!!");
+        _D("Provided object was matched!!");
         return register_(declaration, providedObject, context);
     }
 
@@ -326,7 +326,7 @@ void Explorer::callEventListeners(CustomEventType /*eventType*/, void* /*data*/)
         // call js callback function for 'appservice' js event on each frame
         FOREACH(it, *frameLists)
         {
-            JSObjectRef frame = static_cast<JSObjectRef>((*it).Get()->getObject());
+            JSObjectRef frame = static_cast<JSObjectRef>((**it).Get()->getObject());
 
             auto eventPriv =
                 new JSTizenServiceEventPrivateObject(m_context, event);
@@ -340,7 +340,7 @@ void Explorer::callEventListeners(CustomEventType /*eventType*/, void* /*data*/)
     } else if (eventType == SoftKeyboardChangeCustomEvent) {
         using namespace WrtDeviceApis::SoftKeyboardChangeEvent::Api;
         if (!data) {
-            LogDebug("no ime size");
+            _D("no ime size");
             return;
         }
 
@@ -360,7 +360,7 @@ void Explorer::callEventListeners(CustomEventType /*eventType*/, void* /*data*/)
         // frame
         FOREACH(it, *frameLists)
         {
-            JSObjectRef frame = static_cast<JSObjectRef>((*it).Get()->getObject());
+            JSObjectRef frame = static_cast<JSObjectRef>((**it).Get()->getObject());
 
             auto eventPriv =
                 new JSSoftKeyboardChangeEventPrivateObject(m_context, event);
@@ -374,7 +374,7 @@ void Explorer::callEventListeners(CustomEventType /*eventType*/, void* /*data*/)
                 frame, eventType, eventObject);
         }
     } else {
-        LogDebug("Not supported custom event type");
+        _D("Not supported custom event type");
         return;
     }
 #endif
similarity index 97%
rename from src_mobile/plugin-loading/explorer.h
rename to src/plugin-loading/explorer.h
index 60d2fb6..b47849c 100644 (file)
@@ -27,7 +27,7 @@
 
 #include <dpl/noncopyable.h>
 #include <dpl/exception.h>
-#include <dpl/shared_ptr.h>
+#include <memory>
 
 #include <Commons/JSObject.h>
 #include <Commons/JSObjectDeclaration.h>
@@ -98,5 +98,5 @@ class Explorer : private DPL::Noncopyable
         JSObjectPtr providedObject);
 };
 
-typedef DPL::SharedPtr<Explorer> ExplorerPtr;
+typedef std::shared_ptr<Explorer> ExplorerPtr;
 #endif
  * @brief       This file is the implementation file of webkit js plugin
  *              accessing routines in EFL
  */
+
+#include <memory>
+#include <vector>
+#include <string>
 #include <javascript_interface.h>
 #include <dpl/log/secure_log.h>
-#include <dpl/scoped_array.h>
-#include <vector>
 #include <dpl/singleton_impl.h>
-#include <string>
 #include <dpl/foreach.h>
 #include <dpl/noncopyable.h>
 #include <JavaScriptCore/JavaScript.h>
@@ -56,13 +57,13 @@ std::string toString(const JSStringRef& arg)
     size_t jsSize = JSStringGetMaximumUTF8CStringSize(arg);
     if (jsSize > 0) {
         ++jsSize;
-        DPL::ScopedArray<char> buffer(new char[jsSize]);
-        size_t written = JSStringGetUTF8CString(arg, buffer.Get(), jsSize);
+        std::unique_ptr<char[]> buffer(new char[jsSize]);
+        size_t written = JSStringGetUTF8CString(arg, buffer.get(), jsSize);
         if (written > jsSize) {
             _E("Conversion could not be fully performed.");
             return std::string();
         }
-        result = buffer.Get();
+        result = buffer.get();
     }
 
     return result;
@@ -165,7 +166,7 @@ JavaScriptInterface::PropertiesList JavaScriptInterface::
             static_cast<JSObjectRef>(object->getObject()));
     std::size_t count = JSPropertyNameArrayGetCount(properties);
     result.reserve(count);
-    _D("propesties count %d", count);
+    _D("properties count %d", count);
     for (std::size_t i = 0; i < count; ++i) {
         JSStringRef property = JSPropertyNameArrayGetNameAtIndex(properties, i);
         result.push_back(toString(property));
similarity index 96%
rename from src_wearable/plugin-loading/js_page_session.cpp
rename to src/plugin-loading/js_page_session.cpp
index 96de957..031ed4c 100644 (file)
 #include "plugin_logic.h"
 
 #include <dpl/assert.h>
-#include <dpl/scoped_array.h>
 #include <dpl/log/secure_log.h>
 #include <dpl/foreach.h>
 #include <dpl/singleton_impl.h>
 #include <dpl/wrt-dao-ro/widget_dao_read_only.h>
 #include <dpl/wrt-dao-ro/common_dao_types.h>
 #include <dpl/wrt-dao-ro/global_config.h>
+#include <dpl/wrt-dao-ro/wrt_db_types.h>
 
 #include <JavaScriptCore/JavaScript.h>
 
@@ -77,7 +77,7 @@ class JSPageSession::Impl
 
   private:
     ///< Widget handle using this session
-    int m_widgetHandle;
+    WidgetHandle m_widgetHandle;
 
     //view for this session
     JSGlobalContextRef m_context;
@@ -117,7 +117,7 @@ class JSPageSession::Impl
     ~Impl();
 
     // Widget session
-    void startSession(int widgetHandle,
+    void startSession(WidgetHandle widgetHandle,
                       JSGlobalContextRef view,
                       double scaleFactor,
                       const char* encodedBundle,
@@ -154,7 +154,7 @@ JSPageSession::Impl::Impl(const PluginContainerSupportPtr& support) :
 JSPageSession::Impl::~Impl()
 {
     if (m_sessionStarted) {
-        LogError("Must stop widget session before exit!");
+        _E("Must stop widget session before exit!");
         stopSession();
     }
 
@@ -272,7 +272,7 @@ bool JSPageSession::Impl::loadPluginOnDemand(
     // accepted
     //    LogDebug("Installing feature : " << widgetFeature.name);
     //    if (widgetFeature.rejected) {
-    //        LogWarning("This api-feature was rejected");
+    //        _W("This api-feature was rejected");
     //        return;
     //    }
     //
@@ -312,7 +312,7 @@ bool JSPageSession::Impl::installPluginOnDemand(PluginModelPtr plugin,
 
     if (!parent->getObject()) {
         _E("NULL pointer value");
-        assert(false);
+        Assert(false);
         return false;
     }
 
@@ -359,7 +359,7 @@ void JSPageSession::Impl::dispatchJavaScriptEvent(CustomEventType eventType,
     m_objectExplorer->callEventListeners(eventType, data);
 }
 
-void JSPageSession::Impl::startSession(int widgetHandle,
+void JSPageSession::Impl::startSession(WidgetHandle widgetHandle,
                                        JSGlobalContextRef context,
                                        double scaleFactor,
                                        const char* encodedBundle,
@@ -439,17 +439,17 @@ void JSPageSession::Impl::unloadPluginsFromSession()
 void JSPageSession::Impl::performLibrariesUnload()
 {
 #if 0
-    LogDebug("Perform library unload");
+    _D("Perform library unload");
 
     size_t unloadedLibraries = 0;
 
     FOREACH(pluginIt, m_loadedPlugins)
     {
-        LogDebug("Preparing library: " << (*pluginIt)->LibraryName.Get());
+        _D("Preparing library: %s", (*pluginIt)->LibraryName.Get().c_str());
 
-        PluginPtr plugin = (*pluginIt)->LibraryInstance.Get();
+        PluginPtr plugin = (*pluginIt)->LibraryInstance.get();
         if (!plugin) {
-            LogWarning("Library not loaded " << (*pluginIt)->LibraryName.Get());
+            _W("Library not loaded %s", (*pluginIt)->LibraryName.Get().c_str());
             continue;
         }
         unloadedLibraries++;
@@ -541,7 +541,7 @@ void JSPageSession::Impl::unloadFrame(JSGlobalContextRef context)
     m_objectExplorer->unloadFrame(context);
 }
 
-void JSPageSession::startSession(int widgetHandle,
+void JSPageSession::startSession(WidgetHandle widgetHandle,
                                  JSGlobalContextRef ctx,
                                  double scaleFactor,
                                  const char* encodedBundle,
similarity index 97%
rename from src_wearable/plugin-loading/js_page_session.h
rename to src/plugin-loading/js_page_session.h
index 3580287..e4bf13e 100644 (file)
@@ -33,7 +33,7 @@ class JSPageSession
 {
   public:
     // Widget session
-    void startSession(int widgetHandle,
+    void startSession(WidgetHandle widgetHandle,
                       JSGlobalContextRef view,
                       double scaleFactor,
                       const char* encodedBundle,
similarity index 98%
rename from src_wearable/plugin-loading/plugin.cpp
rename to src/plugin-loading/plugin.cpp
index f486500..1268dde 100644 (file)
@@ -195,7 +195,7 @@ std::string Plugin::GetFileName() const
     return m_fileName;
 }
 
-void Plugin::OnWidgetStart(int widgetId)
+void Plugin::OnWidgetStart(WidgetHandle widgetId)
 {
     if (NULL != m_apiOnWidgetStart) {
         (*m_apiOnWidgetStart)(widgetId);
@@ -212,7 +212,7 @@ void Plugin::OnWidgetInit(feature_mapping_interface_t* mapping)
     }
 }
 
-void Plugin::OnWidgetStop(int widgetId)
+void Plugin::OnWidgetStop(WidgetHandle widgetId)
 {
     if (NULL != m_apiOnWidgetStop) {
         (*m_apiOnWidgetStop)(widgetId);
similarity index 91%
rename from src_mobile/plugin-loading/plugin.h
rename to src/plugin-loading/plugin.h
index 1eb277f..0eaa1a5 100644 (file)
 #include <map>
 #include <string>
 #include <dpl/atomic.h>
-#include <dpl/shared_ptr.h>
+#include <memory>
 #include <dpl/noncopyable.h>
 #include <wrt_plugin_export.h>
 #include <Commons/JSObjectDeclaration.h>
+#include <dpl/wrt-dao-ro/wrt_db_types.h>
 
 class Plugin;
-typedef DPL::SharedPtr<Plugin> PluginPtr;
+typedef std::shared_ptr<Plugin> PluginPtr;
 
 class Plugin : private DPL::Noncopyable
 {
@@ -40,7 +41,7 @@ class Plugin : private DPL::Noncopyable
     typedef JSObjectDeclaration Class;
     typedef JSObjectDeclarationPtr ClassPtr;
     typedef std::list<ClassPtr> ClassList;
-    typedef DPL::SharedPtr<ClassList> ClassPtrList;
+    typedef std::shared_ptr<ClassList> ClassPtrList;
 
   private:
     ///< Plug-in identifier. Currently plug-in file name is used as the ID
@@ -76,11 +77,11 @@ class Plugin : private DPL::Noncopyable
     std::string GetFileName() const;
 
     // API
-    void OnWidgetStart(int widgetId);
+    void OnWidgetStart(WidgetHandle widgetId);
 
     void OnWidgetInit(feature_mapping_interface_t *interface);
 
-    void OnWidgetStop(int widgetId);
+    void OnWidgetStop(WidgetHandle widgetId);
 
     void OnFrameLoad(java_script_context_t context);
 
@@ -49,7 +49,7 @@ PluginContainerSupport::~PluginContainerSupport()
     m_featureModels.clear();
  }
 
-void PluginContainerSupport::Initialize(int widgetHandle)
+void PluginContainerSupport::Initialize(WidgetHandle widgetHandle)
 {
     if (isInitialized() == true && m_widgetHandle != widgetHandle) {
         // re-initialize required
@@ -69,7 +69,7 @@ void PluginContainerSupport::Initialize(int widgetHandle)
 }
 
 std::list<std::string> PluginContainerSupport::getAllowedFeatures(
-    int widgetHandle) const
+    WidgetHandle widgetHandle) const
 {
     //TODO it has to return LIST NOT SET!!!
     WidgetDAOReadOnly widgetDao(widgetHandle);
@@ -77,9 +77,9 @@ std::list<std::string> PluginContainerSupport::getAllowedFeatures(
 
     std::list<std::string> allowedFeatures;
     FOREACH(it, features) {
-        _D("Loading api-feature: %s", DPL::ToUTF8String(it->name).c_str());
+        _D("Loading api-feature: %ls", it->name.c_str());
         if (it->rejected) {
-            _W("Api-feature was rejected by ace. (Api-feature name: %s)",
+            _W("Api-feature was rejected by ace. (Api-feature name: %ls)",
                it->name.c_str());
             continue;
         }
@@ -89,7 +89,7 @@ std::list<std::string> PluginContainerSupport::getAllowedFeatures(
     return allowedFeatures;
 }
 
-void PluginContainerSupport::readAllowedPlugins(int widgetHandle)
+void PluginContainerSupport::readAllowedPlugins(WidgetHandle widgetHandle)
 {
     std::list<std::string> allowedFeatures;
     auto requested = getAllowedFeatures(widgetHandle);
@@ -111,7 +111,7 @@ void PluginContainerSupport::readAllowedPlugins(int widgetHandle)
     }
 }
 
-void PluginContainerSupport::readRootPlugins(int widgetHandle)
+void PluginContainerSupport::readRootPlugins(WidgetHandle widgetHandle)
 {
     WidgetDAOReadOnly dao(widgetHandle);
     WidgetType appType = dao.getWidgetType();
@@ -167,8 +167,13 @@ void PluginContainerSupport::registerPluginModel(DbPluginHandle handle)
         return;
     }
 
-    model.Reset(new PluginModel(handle));
-
+    Try {
+        model.reset(new PluginModel(handle));
+    } Catch(WrtDB::PluginDAOReadOnly::Exception::PluginNotExist) {
+        // database changed between receiving plugin handle and creating PluginModel
+        _E("Failed to create PluginModel - database may be changed");
+        return;
+    }
     \r_D("Model Created. Handle: %d, name: %s",
        handle,
        model->LibraryName.Get().c_str());
@@ -54,7 +54,7 @@ class PluginContainerSupport
 
     bool m_initialized;
 
-    int m_widgetHandle;
+    WidgetHandle m_widgetHandle;
 
   private:
     // Reading
@@ -78,15 +78,15 @@ class PluginContainerSupport
     {
         return m_initialized;
     }
-    bool isInitialized(int widgetHandle)
+    bool isInitialized(WidgetHandle widgetHandle)
     {
         return (m_initialized && m_widgetHandle == widgetHandle);
     }
-    void Initialize(int widgetHandle);
+    void Initialize(WidgetHandle widgetHandle);
     void registerPluginModel(WrtDB::DbPluginHandle handle);
-    std::list<std::string> getAllowedFeatures(int widgetHandle) const;
-    void readAllowedPlugins(int widgetHandle);
-    void readRootPlugins(int widgetHandle);
+    std::list<std::string> getAllowedFeatures(WidgetHandle widgetHandle) const;
+    void readAllowedPlugins(WidgetHandle widgetHandle);
+    void readRootPlugins(WidgetHandle widgetHandle);
     PluginsList  getRootPlugins() const;
     PluginsList  getPluginsList() const;
 
old mode 100644 (file)
new mode 100755 (executable)
similarity index 95%
rename from src_wearable/plugin-loading/plugin_logic.cpp
rename to src/plugin-loading/plugin_logic.cpp
index 8458501..2ffabc6
@@ -27,7 +27,6 @@
 #include "plugin_logic.h"
 
 #include <dpl/assert.h>
-#include <dpl/scoped_array.h>
 #include <dpl/log/secure_log.h>
 #include <dpl/foreach.h>
 #include <dpl/singleton_impl.h>
@@ -36,6 +35,7 @@
 #include <dpl/wrt-dao-ro/global_config.h>
 
 #include <JavaScriptCore/JavaScript.h>
+#include <CommonsJavaScript/JSLifeManager.h>
 
 #include <string>
 #include <sys/types.h>
@@ -82,8 +82,8 @@ class PluginLogic::Impl
     ~Impl();
 
     // Widget session
-    void initSession(int widgetHandle);
-    void startSession(int widgetHandle,
+    void initSession(WidgetHandle widgetHandle);
+    void startSession(WidgetHandle widgetHandle,
                       JSGlobalContextRef context,
                       double scaleFactor,
                       const char* encodedBundle,
@@ -131,7 +131,6 @@ PluginLogic::Impl::Impl() :
 {
     s_sanityCheck = true;
 
-    DPL::Log::LogSystemSingleton::Instance().SetTag("WRT_PLUGINS");
     _D("Initializing Plugin Logic...");
     m_pluginsSupport = PluginContainerSupportPtr(new PluginContainerSupport());
 
@@ -153,12 +152,12 @@ PluginLogic::Impl::~Impl()
     }
 }
 
-void PluginLogic::initSession(int widgetHandle)
+void PluginLogic::initSession(WidgetHandle widgetHandle)
 {
     m_impl->initSession(widgetHandle);
 }
 
-void PluginLogic::startSession(int widgetHandle,
+void PluginLogic::startSession(WidgetHandle widgetHandle,
                                JSGlobalContextRef ctx,
                                double scaleFactor,
                                const char* encodedBundle,
@@ -220,12 +219,14 @@ void PluginLogic::dispatchJavaScriptEvent(JSGlobalContextRef context,
 
 void PluginLogic::loadFrame(JSGlobalContextRef context)
 {
+    WrtDeviceApis::CommonsJavaScript::JSLifeManager::GetInstance().AddGlobalContext(context);
     m_impl->loadFrame(context);
 }
 
 void PluginLogic::unloadFrame(JSGlobalContextRef context)
 {
     m_impl->unloadFrame(context);
+    WrtDeviceApis::CommonsJavaScript::JSLifeManager::GetInstance().ReleaseContext(context);
 }
 
 unsigned int PluginLogic::windowHandle() const
@@ -244,7 +245,7 @@ PluginLogic::PluginLogic() : m_impl(new PluginLogic::Impl())
 PluginLogic::~PluginLogic()
 {}
 
-void PluginLogic::Impl::initSession(int widgetHandle)
+void PluginLogic::Impl::initSession(WidgetHandle widgetHandle)
 {
     _D(">---------------------[init session START]---------------------<");
 
@@ -278,7 +279,7 @@ void PluginLogic::Impl::initSession(int widgetHandle)
     _D("========== init session END ==========");
 }
 
-void PluginLogic::Impl::startSession(int widgetHandle,
+void PluginLogic::Impl::startSession(WidgetHandle widgetHandle,
                                      JSGlobalContextRef context,
                                      double scaleFactor,
                                      const char* encodedBundle,
similarity index 88%
rename from src_mobile/plugin-loading/plugin_logic.h
rename to src/plugin-loading/plugin_logic.h
index fb965c5..e447cf9 100644 (file)
@@ -34,7 +34,8 @@
 #include <dpl/wrt-dao-ro/plugin_dao_read_only.h>
 #include <js_overlay_types.h>
 #include <js_types.h>
-#include <Commons/Deprecated.h>
+#include <dpl/availability.h>
+#include <dpl/wrt-dao-ro/wrt_db_types.h>
 
 using namespace WrtPlugins::W3C;
 
@@ -42,8 +43,8 @@ class PluginLogic : DPL::Noncopyable
 {
   public:
     // Widget session
-    void initSession(int widgetHandle);
-    void startSession(int widgetHandle,
+    void initSession(WidgetHandle widgetHandle);
+    void startSession(WidgetHandle widgetHandle,
                       JSGlobalContextRef view,
                       double scaleFactor,
                       const char* encodedBundle,
@@ -57,14 +58,13 @@ class PluginLogic : DPL::Noncopyable
                             JavaScriptObject& parentObject,
                             JSGlobalContextRef context);
 
-    WRT_PLUGINS_DEPRECATED void loadPluginsIntoIframes(
-        JSGlobalContextRef context);
+    DPL_DEPRECATED void loadPluginsIntoIframes(JSGlobalContextRef context);
 
     void loadFrame(JSGlobalContextRef context);
     void unloadFrame(JSGlobalContextRef context);
 
     // reset custom window properties. (Tizen requirements)
-    WRT_PLUGINS_DEPRECATED void setCustomProperties(double scaleFactor,
+    DPL_DEPRECATED void setCustomProperties(double scaleFactor,
                                                     const char* encodedBundle,
                                                     const char* theme);
 
@@ -73,8 +73,7 @@ class PluginLogic : DPL::Noncopyable
                              const char* encodedBundle,
                              const char* theme);
 
-    WRT_PLUGINS_DEPRECATED void dispatchJavaScriptEvent(
-        CustomEventType eventType);
+    DPL_DEPRECATED void dispatchJavaScriptEvent(CustomEventType eventType);
 
     void dispatchJavaScriptEvent(JSGlobalContextRef ctx,
                                  CustomEventType eventType,
similarity index 86%
rename from src_mobile/plugin-loading/plugin_model.h
rename to src/plugin-loading/plugin_model.h
index e834cd1..f57c46e 100644 (file)
@@ -26,7 +26,7 @@
 
 #include <string>
 #include <list>
-#include <dpl/shared_ptr.h>
+#include <memory>
 #include <dpl/event/model.h>
 #include <dpl/event/property.h>
 
@@ -51,21 +51,21 @@ class PluginModel : public DPL::Event::Model
      */
     DPL::Event::Property<std::string,
                          DPL::Event::PropertyReadOnly,
-                         DPL::Event::PropertyStorageDynamicCached> LibraryName;
+                         DPL::Event::PropertyStorageDynamicInitCached> LibraryName;
 
     /**
      * *@brief Library Path
      */
     DPL::Event::Property<std::string,
                          DPL::Event::PropertyReadOnly,
-                         DPL::Event::PropertyStorageDynamicCached> LibraryPath;
+                         DPL::Event::PropertyStorageDynamicInitCached> LibraryPath;
 
     /**
      * *@brief Feature set
      */
     DPL::Event::Property<WrtDB::FeatureHandleListPtr,
                          DPL::Event::PropertyReadOnly,
-                         DPL::Event::PropertyStorageDynamicCached>
+                         DPL::Event::PropertyStorageDynamicInitCached>
     FeatureHandles;
 
     /**
@@ -73,7 +73,7 @@ class PluginModel : public DPL::Event::Model
      */
     DPL::Event::Property<WrtDB::PluginHandleSetPtr,
                          DPL::Event::PropertyReadOnly,
-                         DPL::Event::PropertyStorageDynamicCached>
+                         DPL::Event::PropertyStorageDynamicInitCached>
     LibraryDependencies;
 
     /**
@@ -90,6 +90,6 @@ class PluginModel : public DPL::Event::Model
     WrtDB::DbPluginHandle getHandle() const;
 };
 
-typedef DPL::SharedPtr<PluginModel> PluginModelPtr;
+typedef std::shared_ptr<PluginModel> PluginModelPtr;
 
 #endif
similarity index 90%
rename from src_mobile/plugins-api-support/CMakeLists.txt
rename to src/plugins-api-support/CMakeLists.txt
index 7a67b5e..5a8f7c5 100644 (file)
@@ -18,9 +18,9 @@
 # @version  1.0
 #
 
-pkg_search_module(dpl REQUIRED dpl-efl)
+PKG_SEARCH_MODULE(dpl REQUIRED dpl-efl)
 
-set(PLUGINS_API_SUPPORT_SOURCES
+SET(PLUGINS_API_SUPPORT_SOURCES
     ${CMAKE_CURRENT_SOURCE_DIR}/Plugin.cpp
     ${CMAKE_CURRENT_SOURCE_DIR}/Object.cpp
     ${CMAKE_CURRENT_SOURCE_DIR}/ObjectFactory.cpp
@@ -37,6 +37,9 @@ ADD_LIBRARY(${TARGET_PLUGINS_API_SUPPORT} SHARED
     ${PLUGINS_API_SUPPORT_SOURCES}
 )
 
+SET_TARGET_PROPERTIES(${TARGET_PLUGINS_API_SUPPORT} PROPERTIES
+    COMPILE_DEFINITIONS LOG_TAG="${LOG_TAG}")
+
 SET_TARGET_PROPERTIES(${TARGET_PLUGIN_API_SUPPORT} PROPERTIES
     COMPILE_FLAGS -fPIC
     LINK_FLAGS "-Wl,--as-needed -Wl,--hash-style=both"
@@ -47,7 +50,7 @@ SET_TARGET_PROPERTIES(${TARGET_PLUGINS_API_SUPPORT} PROPERTIES
     VERSION ${CMAKE_PROJECT_VERSION}
 )
 
-target_link_libraries(${TARGET_PLUGINS_API_SUPPORT}
+TARGET_LINK_LIBRARIES(${TARGET_PLUGINS_API_SUPPORT}
     ${dpl_LIBRARIES}
 )
 
similarity index 96%
rename from src_wearable/plugins-api-support/ExportedApi.h
rename to src/plugins-api-support/ExportedApi.h
index 28886d0..4a71d95 100644 (file)
@@ -59,6 +59,8 @@
  * #include "JSTest.h"
  * #include "plugin_config.h"
  *
+ * #include <dpl/wrt-dao-ro/wrt_db_types.h>
+ *
  * #define OBJECT_WIDGET "widget"
  * #define OBJECT_TEST "__test"
  *
  *  namespace W3CTest
  *  {
  *
- *  void on_widget_start_callback(int widgetId)
+ *  void on_widget_start_callback(WidgetHandle widgetId)
  *  {
  *
  *  }
  *
- *  void on_widget_stop_callback(int widgetId)
+ *  void on_widget_stop_callback(WidgetHandle widgetId)
  *  {
  *  }
  *
similarity index 99%
rename from src_mobile/plugins-api-support/Object.cpp
rename to src/plugins-api-support/Object.cpp
index 7db93e4..6e2d335 100644 (file)
@@ -118,6 +118,7 @@ Object::Object(const char* name,
                const char* parentName,
                IObjectType type) :
     m_name(name),
+    m_classRef(0),
     m_parentName(parentName),
     m_type(type),
     m_interfaceRef(interfaceRef),
@@ -77,8 +77,6 @@ void PluginRegistry::UnloadAll()
 {
     LogDebug("Unload all plugins");
 
-    typedef void (*UnregisterFunction)(PluginRegistration&, Plugin&);
-
     FOREACH(libraryIt, m_libraries)
     {
         auto pluginIt = m_plugins.find(libraryIt->first);
similarity index 88%
rename from src_wearable/plugins-installer/CMakeLists.txt
rename to src/plugins-installer/CMakeLists.txt
index 6c01a00..1be0de9 100644 (file)
@@ -28,6 +28,7 @@ PKG_CHECK_MODULES(PLUGINS_INSTALLER_DEPS
     libxml-2.0
     cert-svc-vcore
     dpl-efl
+    dpl-utils-efl
     dpl-wrt-dao-rw
     libpcrecpp
     REQUIRED
@@ -55,13 +56,19 @@ ADD_EXECUTABLE(${TARGET_PLUGINS_INSTALLER}
     ${WRT_PLUGINS_INSTALLER_SOURCES}
 )
 
+SET_TARGET_PROPERTIES(${TARGET_PLUGINS_INSTALLER} PROPERTIES
+    COMPILE_DEFINITIONS LOG_TAG="${LOG_TAG}")
+
+ADD_DEFINITIONS("-fPIE")
+
 TARGET_LINK_LIBRARIES(${TARGET_PLUGINS_INSTALLER}
     ${PLUGINS_INSTALLER_DEPS_LIBRARIES}
-    ${TARGET_PLUGINS_API_SUPPORT} "-ldl"
+    ${TARGET_PLUGINS_API_SUPPORT}
+    "-ldl"
 )
 
 SET_TARGET_PROPERTIES(${TARGET_PLUGINS_INSTALLER} PROPERTIES
-    LINK_FLAGS "-Wl,--as-needed -Wl,--hash-style=both"
+    LINK_FLAGS "-Wl,--as-needed -pie -Wl,--hash-style=both"
     BUILD_WITH_INSTALL_RPATH ON
     INSTALL_RPATH_USE_LINK_PATH ON
 )
@@ -43,8 +43,8 @@
 
 #include <dpl/log/log.h>
 #include <dpl/exception.h>
+#include <dpl/utils/path.h>
 #include <dpl/wrt-dao-ro/global_config.h>
-#include <dpl/wrt-dao-rw/plugin_dao.h>
 #include <dpl/wrt-dao-rw/feature_dao.h>
 #include <dpl/foreach.h>
 #include <dpl/wrt-dao-ro/WrtDatabase.h>
@@ -451,6 +451,48 @@ int PluginsInstaller::installAllPlugins()
     return installedPluginsCount;
 }
 
+void PluginsInstaller::uninstallPlugin(WrtDB::DbPluginHandle handle, const PluginDAOReadOnly& dao)
+{
+    LogDebug("Unregister plugin: %s ..." << dao.getLibraryName());
+
+    // mark dependent plugins as waiting when their dependency disappered
+    auto dependentPlugins = *dao.getLibraryDependentPlugins();
+    FOREACH(pl, dependentPlugins) {
+        PluginDAO::setPluginInstallationStatus(*pl, PluginDAO::INSTALLATION_WAITING);
+        PluginDAO::unregisterPluginLibrariesDependencies(*pl);
+    }
+
+    PluginDAO::unregisterPlugin(handle);
+}
+
+int PluginsInstaller::uninstallMissingAndChangedPlugins()
+{
+    int uninstalled = 0;
+    WrtDB::PluginHandleList list = PluginDAO::getPluginHandleList();
+    FOREACH(item, list)
+    {
+        Try {
+            PluginDAOReadOnly dao(*item);
+            DPL::Utils::Path libPath(dao.getLibraryPath());
+            if (!libPath.Exists()) {
+                // plugin deleted
+                uninstallPlugin(*item, dao);
+                ++uninstalled;
+            } else {
+                std::time_t timestamp = libPath.LastWriteTime();
+                if (timestamp != dao.getLibraryTimestamp()) {
+                    // plugin updated
+                    uninstallPlugin(*item, dao);
+                    ++uninstalled;
+                }
+            }
+        } Catch(PluginDAOReadOnly::Exception::PluginNotExist) {
+            // ignore, plugin may be already removed
+        }
+    }
+    return uninstalled;
+}
+
 int PluginsInstaller::installWaitingPlugins()
 {
     PluginHandleSetPtr waitingPlugins;
similarity index 94%
rename from src_wearable/plugins-installer/plugin_installer.h
rename to src/plugins-installer/plugin_installer.h
index be0075c..f669e76 100644 (file)
 #define WRT_PLUGINS_INSTALLER_PLUGIN_INSTALLER_H
 
 #include <string>
+#include <utility>
 #include <boost/optional.hpp>
 #include <plugin_installer_types.h>
 #include <plugin_objects.h>
 #include <IObject.h>
 #include <PluginRegistry.h>
 
+#include <dpl/wrt-dao-rw/plugin_dao.h>
 #include <dpl/singleton.h>
 
 class PluginsInstaller
@@ -64,6 +66,9 @@ class PluginsInstaller
 
     bool isInitialized();
 
+    int uninstallMissingAndChangedPlugins();
+    void uninstallPlugin(WrtDB::DbPluginHandle handle, const WrtDB::PluginDAOReadOnly& dao);
+
   private:
     friend class DPL::Singleton<PluginsInstaller>;
 
similarity index 82%
rename from src_mobile/plugins-installer/plugin_objects.cpp
rename to src/plugins-installer/plugin_objects.cpp
index ae65b0f..364d0fd 100644 (file)
  * @brief
  */
 #include <string>
-#include <dpl/log/log.h>
+#include <dpl/log/secure_log.h>
 #include "plugin_objects.h"
 #include <IObject.h>
 
 namespace {
 const char* SEPARATOR = ".";
-const std::string GLOBAL_OBJECT_NAME = WrtPluginsApi::IObject::WINDOW_OBJECT();
-const std::string OLD_GLOBAL_OBJECT_NAME = "GLOBAL_OBJECT";
+const std::string GLOBAL_OBJECT_NAME = "GLOBAL_OBJECT";
+const std::string OLD_GLOBAL_OBJECT_NAME = WrtPluginsApi::IObject::WINDOW_OBJECT();
 
 std::string normalizeName(const std::string& objectName)
 {
     if (objectName.empty()) {
-        LogError("Normalize name, name size is 0");
+        _E("Normalize name, name size is 0");
         return objectName;
     }
 
@@ -55,7 +55,7 @@ std::string normalizeName(const std::string& objectName,
                           const std::string& parentName)
 {
     if (objectName.empty() || parentName.empty()) {
-        LogError("Normalize name, name size or parent name size is 0");
+        _E("Normalize name, name size or parent name size is 0");
         return std::string();
     }
 
@@ -86,13 +86,11 @@ PluginObjects::ObjectsPtr PluginObjects::getDependentObjects() const
 void PluginObjects::addObjects(const std::string& parentName,
                                const std::string& name)
 {
-    LogDebug("\n Parent: " << parentName
-                           << "\n Name: " << name
-                           << "\n After: Implemented: " <<
-             normalizeName(name, parentName)
-                           << "\n After Dependent: " <<
-             normalizeName(parentName)
-             );
+    _D("\n Parent: %s\n Name: %s\n After: Implemented: %s\n After Dependent: %s",
+        parentName.c_str(),
+        name.c_str(),
+        normalizeName(name, parentName).c_str(),
+        normalizeName(parentName).c_str());
 
     addImplementedObject(normalizeName(name, parentName));
     addDependentObject(normalizeName(parentName));
similarity index 95%
rename from src_mobile/plugins-installer/plugin_objects.h
rename to src/plugins-installer/plugin_objects.h
index eda28a3..0b27a14 100644 (file)
@@ -23,7 +23,7 @@
 #ifndef WRT_SRC_INSTALLER_CORE_PLUGIN_INSTALLER_TASKS_PLUGIN_OBJECTS_H_
 #define WRT_SRC_INSTALLER_CORE_PLUGIN_INSTALLER_TASKS_PLUGIN_OBJECTS_H_
 
-#include <dpl/shared_ptr.h>
+#include <memory>
 #include <string>
 #include <set>
 #include <list>
@@ -53,6 +53,6 @@ class PluginObjects : public WrtDB::PluginObjectsDAO
     void addDependentObject(const std::string& value);
 };
 
-typedef DPL::SharedPtr<PluginObjects> PluginObjectsPtr;
+typedef std::shared_ptr<PluginObjects> PluginObjectsPtr;
 
 #endif
similarity index 81%
rename from src_wearable/plugins-installer/plugin_utils.cpp
rename to src/plugins-installer/plugin_utils.cpp
index 42cc49d..a8126c8 100644 (file)
@@ -23,7 +23,7 @@
 #include "plugin_utils.h"
 #include <dpl/semaphore.h>
 #include <dpl/exception.h>
-#include <dpl/log/log.h>
+#include <dpl/log/secure_log.h>
 #include <dpl/wrt-dao-ro/global_config.h>
 
 using namespace WrtDB;
@@ -56,7 +56,7 @@ bool checkPath(const std::string& path)
     if (0 == stat(path.c_str(), &st) && S_ISDIR(st.st_mode)) {
         return true;
     }
-    LogError("Cannot access directory [ " << path << " ]");
+    _E("Cannot access directory [%s]", path.c_str());
     return false;
 }
 
@@ -66,23 +66,17 @@ bool checkPaths()
     if_ok &= (checkPath(cutOffFileName(
                             GlobalConfig::GetWrtDatabaseFilePath())));
     if (!if_ok) {
-        LogError(
-            "Path <" << GlobalConfig::GetWrtDatabaseFilePath() <<
-            "> does not exist.");
+        _E("Path <%s> does not exist.", GlobalConfig::GetWrtDatabaseFilePath());
     }
 
     if_ok &= (checkPath(GlobalConfig::GetDevicePluginPath()));
     if (!if_ok) {
-        LogError(
-            "Path <" << GlobalConfig::GetDevicePluginPath() <<
-            "> does not exist.");
+        _E("Path <%s> does not exist.", GlobalConfig::GetDevicePluginPath());
     }
 
     if_ok &= (checkPath(GlobalConfig::GetUserInstalledWidgetPath()));
     if (!if_ok) {
-        LogError(
-            "Path <" << GlobalConfig::GetUserInstalledWidgetPath() <<
-            "> does not exist.");
+        _E("Path <%s> does not exist.", GlobalConfig::GetUserInstalledWidgetPath());
     }
     return if_ok;
 }
 #include <string>
 #include <cstdio>
 #include <dpl/exception.h>
+#include <dpl/platform.h>
 
 int main(int /*argc*/, char */*argv*/[])
 {
     UNHANDLED_EXCEPTION_HANDLER_BEGIN
     {
-        DPL::Log::LogSystemSingleton::Instance().SetTag("PLUGINS_INSTALLER");
         LogDebug("Plugins installation started.");
 
         printf("Installing plugins...\n");
         PluginsInstallerSingleton::Instance().initialize();
-        int installed =
-            PluginsInstallerSingleton::Instance().installAllPlugins();
-        PluginsInstallerSingleton::Instance().deinitialize();
+
+#ifdef ENABLE(DOWNLOADABLE_PLUGIN)
+        int uninstalled = PluginsInstallerSingleton::Instance().uninstallMissingAndChangedPlugins();
+        printf("# %d plugins uninstalled.\n", uninstalled);
+#endif
+
+        int installed = PluginsInstallerSingleton::Instance().installAllPlugins();
         printf("Completed: %d plugins installed.\n", installed);
 
+        PluginsInstallerSingleton::Instance().deinitialize();
         LogDebug("All plugins installed successfuly");
         return 0;
     }
old mode 100644 (file)
new mode 100755 (executable)
similarity index 84%
rename from src_mobile/plugins-ipc-message/CMakeLists.txt
rename to src/plugins-ipc-message/CMakeLists.txt
index d3da03e..92ca185
 # @version  1.0
 #
 
-pkg_search_module(dpl REQUIRED dpl-efl)
-pkg_search_module(webkit2 REQUIRED ewebkit2)
+PKG_SEARCH_MODULE(dpl REQUIRED dpl-efl)
+PKG_SEARCH_MODULE(webkit2 REQUIRED ewebkit2)
 
-set(PLUGINS_IPC_MESSAGE_SOURCES
+SET(PLUGINS_IPC_MESSAGE_SOURCES
     ${PLUGINS_IPC_MESSAGE_DIRS}/ipc_message_support.cpp
 )
 
@@ -44,11 +44,14 @@ SET_TARGET_PROPERTIES(${TARGET_PLUGINS_IPC_MESSAGE_LIB} PROPERTIES
     VERSION ${CMAKE_PROJECT_VERSION}
 )
 
-target_link_libraries(${TARGET_PLUGINS_IPC_MESSAGE_LIB}
+TARGET_LINK_LIBRARIES(${TARGET_PLUGINS_IPC_MESSAGE_LIB}
     ${dpl_LIBRARIES}
     ${webkit2_LIBRARIES}
 )
 
+SET_TARGET_PROPERTIES(${TARGET_PLUGINS_IPC_MESSAGE_LIB} PROPERTIES
+    COMPILE_DEFINITIONS LOG_TAG="${LOG_TAG}")
+
 INSTALL(TARGETS ${TARGET_PLUGINS_IPC_MESSAGE_LIB}
     DESTINATION lib
     PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
old mode 100644 (file)
new mode 100755 (executable)
similarity index 78%
rename from src_mobile/plugins-ipc-message/ipc_message_support.cpp
rename to src/plugins-ipc-message/ipc_message_support.cpp
index d848d26..114f5a0
@@ -23,6 +23,8 @@
 
 #include <string>
 #include <sstream>
+#include <memory>
+
 #include <WKBundle.h>
 #include <WKString.h>
 #include <WKType.h>
@@ -36,42 +38,6 @@ namespace {
 const char* const TIZEN_GET_WINDOW_HANDLE = "tizen://getWindowHandle";
 const char* const TIZEN_CLEAR_ALL_COOKIES = "tizen://clearAllCookies";
 
-static std::string toString(WKStringRef str)
-{
-    if (WKStringIsEmpty(str)) {
-        return std::string();
-    }
-    size_t size = WKStringGetMaximumUTF8CStringSize(str);
-    char buffer[size + 1];
-    WKStringGetUTF8CString(str, buffer, size + 1);
-    return buffer;
-}
-
-static std::string sendSyncMessage(const char* name, const char* body)
-{
-    WKStringRef nameWKString = WKStringCreateWithUTF8CString(name);
-    WKStringRef bodyWKString = NULL;
-    if (body) {
-        bodyWKString = WKStringCreateWithUTF8CString(body);
-    }
-    WKTypeRef retWKType = NULL;
-    WKBundlePostSynchronousMessage(s_injectedBundleRef,
-                                   nameWKString,
-                                   bodyWKString,
-                                   &retWKType);
-    WKRelease(nameWKString);
-    if (bodyWKString) {
-        WKRelease(bodyWKString);
-    }
-    if (retWKType) {
-        std::string retString = toString(static_cast<WKStringRef>(retWKType));
-        WKRelease(retWKType);
-        return retString;
-    } else {
-        return std::string();
-    }
-}
-
 static void sendPostMessage(const char* name, const char* body)
 {
     WKStringRef nameWKString = WKStringCreateWithUTF8CString(name);
@@ -79,7 +45,7 @@ static void sendPostMessage(const char* name, const char* body)
     if (body) {
         bodyWKString = WKStringCreateWithUTF8CString(body);
     }
-    WKTypeRef retWKType = NULL;
+
     WKBundlePostMessage(s_injectedBundleRef,
                         nameWKString,
                         bodyWKString);
@@ -173,14 +139,14 @@ void IPCMessageSupport::setXwindowHandle(unsigned int handle)
     s_xWindowHandle = handle;
 }
 
-const char* IPCMessageSupport::sendMessageToUiProcess(
+void IPCMessageSupport::sendMessageToUiProcess(
     const char* name,
     const char* body)
 {
     _D("called");
     if (s_injectedBundleRef == NULL) {
         _E("UI Process information isn't set");
-        return NULL;
+        return;
     }
     _D("name = [%s]", name);
     if (body) {
@@ -188,28 +154,11 @@ const char* IPCMessageSupport::sendMessageToUiProcess(
     }
 
     if (!name) {
-        return NULL;
-    }
-
-    // tizen://getWindowHandle
-    if (!strcmp(name, TIZEN_GET_WINDOW_HANDLE)) {
-        if (s_xWindowHandle == 0) {
-            return NULL;
-        } else {
-            std::stringstream ss;
-            ss << s_xWindowHandle;
-            std::string ret  = ss.str();
-            return strdup(ret.c_str());
-        }
+        return;
     }
 
-    // tizen://clearAllCookies
-    if (!strcmp(name, TIZEN_CLEAR_ALL_COOKIES)) {
-        sendPostMessage(name, body);
-        return NULL;
-    }
+    sendPostMessage(name, body);
 
-    return NULL;
 }
 
 int IPCMessageSupport::sendAsyncMessageToUiProcess(const char* name, const char* body, AsyncReplyCallback replyCallback, void* data)
@@ -233,10 +182,7 @@ int IPCMessageSupport::sendAsyncMessageToUiProcess(const char* name, const char*
         body = "";
     }
 
-    _D("name = [%s]", name);
-    if (!body) {
-        _D("body = [%s]", body);
-    }
+    _D("name = [%s]\nbody = [%s]", name, body);
 
     return sendAsyncMessage(name, body, replyCallback, data);
 }
@@ -274,3 +220,46 @@ void IPCMessageSupport::replyAsyncMessageToWebProcess(Ewk_Context* ewkContext, i
 
     ewk_context_message_post_to_injected_bundle(ewkContext, REPLY_ASYNC, strBody.c_str());
 }
+
+namespace {
+  std::string WKStringToString(WKStringRef str)
+  {
+      if (WKStringIsEmpty(str)) {
+          return std::string();
+      } else {
+          size_t size = WKStringGetMaximumUTF8CStringSize(str);
+          std::unique_ptr<char []> buffer(new char[size + 1]);
+          WKStringGetUTF8CString(str, buffer.get(), size + 1);
+          return std::string(buffer.get());
+      }
+  }
+}  // namespace
+
+std::string IPCMessageSupport::sendSyncMessageToUiProcess(const char* name, const char* body) {
+    _D("called : %s %s", name ? name : "", body ? body : "");
+
+    WKStringRef nameWKString = WKStringCreateWithUTF8CString(name);
+    WKStringRef bodyWKString = NULL;
+    WKTypeRef retval = NULL;
+    if (body) {
+        bodyWKString = WKStringCreateWithUTF8CString(body);
+    }
+
+    WKBundlePostSynchronousMessage(
+            s_injectedBundleRef,
+            nameWKString,
+            bodyWKString,
+            &retval);
+
+    WKRelease(nameWKString);
+    if (bodyWKString) {
+        WKRelease(bodyWKString);
+    }
+    if (retval != NULL) {
+        std::string ret = WKStringToString(static_cast<WKStringRef>(retval));
+        WKRelease(retval);
+        return ret;
+    } else {
+        return std::string();
+    }
+}
old mode 100644 (file)
new mode 100755 (executable)
similarity index 92%
rename from src_wearable/plugins-ipc-message/ipc_message_support.h
rename to src/plugins-ipc-message/ipc_message_support.h
index b5463e9..2d379a8
@@ -26,7 +26,8 @@
 #include <map>
 #include <string>
 #include <WKBundle.h>
-#include <EWebKit2.h>
+#include <EWebKit.h>
+#include <EWebKit_internal.h>
 
 typedef void (*AsyncReplyCallback)(unsigned int, void*, const char*);
 
@@ -73,10 +74,11 @@ class AsyncConnectionManager
 
 void setWKBundleRef(WKBundleRef bundleRef);
 void setXwindowHandle(unsigned int handle);
-const char* sendMessageToUiProcess(const char* name, const char* body);
+void sendMessageToUiProcess(const char* name, const char* body);
 int  sendAsyncMessageToUiProcess(const char* name, const char* body, AsyncReplyCallback replyCallback, void* data);
 void* ignoreAsyncMessageReply(int handle);
 void replyAsyncMessageToWebProcess(Ewk_Context* ewkContext, int handle, const char* body);
+std::string sendSyncMessageToUiProcess(const char* name, const char* body);
 }
 
 #endif // WRT_SRC_IPC_MESSAGE_SUPPORT
similarity index 96%
rename from src_wearable/standards/CMakeLists.txt
rename to src/standards/CMakeLists.txt
index 83ff664..449083d 100644 (file)
@@ -13,4 +13,4 @@
 #    limitations under the License.
 #
 
-add_subdirectory(W3C)
+ADD_SUBDIRECTORY(W3C)
similarity index 97%
rename from src_wearable/standards/W3C/CMakeLists.txt
rename to src/standards/W3C/CMakeLists.txt
index 11828fb..18f64a9 100644 (file)
@@ -12,4 +12,4 @@
 #    See the License for the specific language governing permissions and
 #    limitations under the License.
 #
-add_subdir(Widget)
+ADD_SUBDIR(Widget)
similarity index 75%
rename from src_wearable/standards/W3C/Widget/CMakeLists.txt
rename to src/standards/W3C/Widget/CMakeLists.txt
index 74bb6da..3ac9dfd 100644 (file)
 
 ADD_DEFINITIONS("-DWRT_PLUGINS_WIDGET_LOG")
 
-set(TARGET_NAME "wrt-plugins-w3c-widget-interface")
+SET(TARGET_NAME "wrt-plugins-w3c-widget-interface")
 
-pkg_search_module(webkit2 REQUIRED ewebkit2)
-pkg_search_module(plugin-types REQUIRED wrt-plugins-types)
+PKG_SEARCH_MODULE(webkit2 REQUIRED ewebkit2)
+PKG_SEARCH_MODULE(plugin-types REQUIRED wrt-plugins-types)
 
-set(SRCS
+SET(SRCS
   ${SRCS_COMMONS}
   JSWidget.cpp
   JSPreferences.cpp
@@ -28,15 +28,15 @@ set(SRCS
   plugin_config.cpp
 )
 
-include_directories(
+INCLUDE_DIRECTORIES(
   ${API_WIDGET_PATH}
   ${webkit2_INCLUDE_DIRS}
   ${plugin-types_INCLUDE_DIRS}
   ${PLUGINS_API_SUPPORT_DIRS}
 )
 
-add_library(${TARGET_NAME} SHARED ${SRCS})
-target_link_libraries(${TARGET_NAME}
+ADD_LIBRARY(${TARGET_NAME} SHARED ${SRCS})
+TARGET_LINK_LIBRARIES(${TARGET_NAME}
   ${LIBS_COMMON}
   ${TARGET_COMMONS}
   ${TARGET_COMMONS_JAVASCRIPT}
@@ -48,4 +48,8 @@ target_link_libraries(${TARGET_NAME}
   wrt-dispatch-event
 )
 
+# Override default tag
+SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES
+    COMPILE_DEFINITIONS LOG_TAG="WRT_PLUGINS_WIDGET")
+
 INSTALL(TARGETS ${TARGET_NAME} LIBRARY DESTINATION /usr/lib/wrt-plugins/w3c-widget-interface)
@@ -221,10 +221,10 @@ const JSClassDefinition* JSPreferences::getClassInfo()
 JSClassRef JSPreferences::m_jsClassRef =
     JSClassCreate(JSPreferences::getClassInfo());
 
-void JSPreferences::initialize(JSContextRef context,
+void JSPreferences::initialize(JSContextRef /* context */,
                                JSObjectRef object)
 {
-    _D("entered. Context: %p", context);
+    _D("entered");
 
     LocalStoragePrivateData* priv =
         static_cast<LocalStoragePrivateData*>(JSObjectGetPrivate(object));
similarity index 97%
rename from src_wearable/standards/W3C/Widget/JSWidget.cpp
rename to src/standards/W3C/Widget/JSWidget.cpp
index ec7b7b2..47f3fa4 100644 (file)
@@ -32,6 +32,8 @@
 #include <Widget/IWidget.h>
 #include <LocalStorage/LocalStorageMgr.h>
 #include <Commons/WrtAccess/WrtAccess.h>
+#include <dpl/wrt-dao-ro/wrt_db_types.h>
+#include <CommonsJavaScript/JSLifeManager.h>
 
 // temporary
 extern "C" JSGlobalContextRef JSContextGetGlobalContext(JSContextRef ctx);
@@ -108,8 +110,6 @@ struct WidgetPrivateObject
 {
     Widget::Api::IWidgetPtr iwidget;
     JSObjectRef preferencesObject;
-    //TEMP
-    //int widgetId     // TODO: check is it necessary (g.rynkowski)
     JSObjectRef widgetObject;
 };
 typedef std::shared_ptr<WidgetPrivateObject> WidgetPrivateObjectPtr;
@@ -131,7 +131,7 @@ WrtDeviceApis::Widget::Api::IWidgetPtr getIWidget(JSObjectRef arg)
     return priv->getObject()->iwidget;
 }
 
-LocalStorage::Api::ILocalStoragePtr getLocalStorage(int widgetId)
+LocalStorage::Api::ILocalStoragePtr getLocalStorage(WidgetHandle widgetId)
 {
     LocalStorage::Api::ILocalStoragePtr storage(
         LocalStorage::Api::getLocalStorage(widgetId));
@@ -154,7 +154,7 @@ JSObjectRef getPreferences(JSObjectRef arg)
 
 JSObjectRef createPreferencesObject(JSContextRef context,
                                     JSObjectRef widgetObject,
-                                    int widgetId)
+                                    WidgetHandle widgetId)
 {
     AssertMsg(widgetObject, "Widget Object can'n be null");
     //delete is invoked in JSPreferences::finalize
@@ -172,7 +172,7 @@ JSObjectRef createPreferencesObject(JSContextRef context,
         delete priv;
     }
     //Unprotect is called in JSWidget::finalize
-    JSValueProtect(context, preferences);
+    JSValueSafeProtect(context, preferences);
 
     return preferences;
 }
@@ -243,8 +243,7 @@ void JSWidget::initialize(JSContextRef context,
 
     LogDebug("entered. Context : " << context << "(global:" << g_context << "), Object: " << object);
 
-    if (context != g_context)
-    {
+    if (context != g_context) {
         context = g_context;
     }
 
@@ -259,7 +258,7 @@ void JSWidget::initialize(JSContextRef context,
 
             Widget::Api::IWidgetPtr widget =
                 Api::WidgetFactory::createWidget();
-            int widgetId = WrtAccessSingleton::Instance().getWidgetId();
+            WidgetHandle widgetId = WrtAccessSingleton::Instance().getWidgetId();
             JSObjectRef preferences =
                 createPreferencesObject(context,
                                         object,
@@ -289,12 +288,11 @@ void JSWidget::initialize(JSContextRef context,
 void JSWidget::finalize(JSObjectRef object)
 {
     LogDebug("entered");
-    LogDebug("Object: " << object);
     JSWidgetPrivateObject* priv =
         static_cast<JSWidgetPrivateObject*>(JSObjectGetPrivate(object));
 
     if (priv) {
-        JSValueUnprotect(priv->getContext(),
+        JSValueSafeUnprotect(priv->getContext(),
                          priv->getObject()->preferencesObject);
 
         delete priv;
@@ -491,8 +489,6 @@ JSValueRef JSWidget::getProperty(JSContextRef context,
                                  JSStringRef propertyName,
                                  JSValueRef* exception)
 {
-    LogDebug("Object: " << object);
-
     Try {
         Converter converter(context);
 
@@ -74,7 +74,7 @@ void on_widget_init_callback(feature_mapping_interface_t *mapping)
 }
 //...
 
-void on_widget_start_callback(int widgetId)
+void on_widget_start_callback(WidgetHandle widgetId)
 {
     _D("[W3C\\widget] on_widget_start_callback (%d)", widgetId);
 
@@ -89,7 +89,7 @@ void on_widget_start_callback(int widgetId)
     }
 }
 
-void on_widget_stop_callback(int widgetId)
+void on_widget_stop_callback(WidgetHandle widgetId)
 {
     _D("[W3C\\widget] on_widget_stop_callback (%d)", widgetId);
     Try
@@ -109,9 +109,9 @@ void Register(PluginRegistration& r)
 
     auto widgetObject = ObjectFactory::createObjectWithInterface(
             OBJECT_WIDGET,
-            (js_class_template_getter) WrtPlugins::W3C::JSWidget::getClassRef,
+            (ClassRef)WrtPlugins::W3C::JSWidget::getClassRef,
             INTERFACE_WIDGET_NAME,
-            reinterpret_cast<js_class_constructor_cb_t>(WrtPlugins::W3C::JSWidget::callAsConstructor));
+            (ClassRef)WrtPlugins::W3C::JSWidget::callAsConstructor);
 
     plugin->AddObject(widgetObject);
 
similarity index 50%
rename from src_mobile/wrt-popup/CMakeLists.txt
rename to src/wrt-popup/CMakeLists.txt
index 13a79cc..1d8f266 100755 (executable)
@@ -1,2 +1 @@
-ADD_SUBDIRECTORY(ace)
 ADD_SUBDIRECTORY(wrt)
similarity index 68%
rename from src_mobile/wrt-popup/wrt/CMakeLists.txt
rename to src/wrt-popup/wrt/CMakeLists.txt
index ed0e24b..0d89bfd 100755 (executable)
@@ -1,5 +1,5 @@
 
-set(WRT_POPUP_COMMON_DIR ${PROJECT_SOURCE_DIR}/src/wrt-popup/wrt)
+SET(WRT_POPUP_COMMON_DIR ${PROJECT_SOURCE_DIR}/src/wrt-popup/wrt)
 
 SET(WRT_POPUP_COMMON_SRCS
     ${WRT_POPUP_COMMON_DIR}/PopupSerializer.cpp
@@ -15,6 +15,7 @@
 
 PKG_CHECK_MODULES(WRT_POPUP_DEPS
     ecore-x
+    capi-appfw-application
     dpl-efl
     dpl-event-efl
     REQUIRED
@@ -30,7 +31,6 @@ INCLUDE_DIRECTORIES(
 SET(WRT_POPUP_SRCS
     ${WRT_POPUP_COMMON_SRCS}
     wrt-popup.cpp
-    YesNoPopup.cpp
     YesNoCheckPopup.cpp
     InfoPopup.cpp
     renderer/evas_object.cpp
@@ -43,12 +43,17 @@ ADD_EXECUTABLE(${TARGET_POPUP_WRT}
     ${WRT_POPUP_SRCS}
 )
 
+ADD_DEFINITIONS("-fPIE")
+
 TARGET_LINK_LIBRARIES(${TARGET_POPUP_WRT}
     ${WRT_POPUP_DEPS_LIBRARIES}
 )
 
 SET_TARGET_PROPERTIES(${TARGET_POPUP_WRT} PROPERTIES
-    LINK_FLAGS "-Wl,--as-needed -Wl,--hash-style=both"
+    COMPILE_DEFINITIONS LOG_TAG="${LOG_TAG}")
+
+SET_TARGET_PROPERTIES(${TARGET_POPUP_WRT} PROPERTIES
+    LINK_FLAGS "-Wl,--as-needed -pie -Wl,--hash-style=both"
     BUILD_WITH_INSTALL_RPATH ON
     INSTALL_RPATH_USE_LINK_PATH ON
 )
 
 namespace Wrt {
 namespace Popup {
+
+YesNoCheckPopup::YesNoCheckPopup():
+        m_parent(NULL)
+{}
+
 YesNoCheckPopup::~YesNoCheckPopup()
 {}
 
+void YesNoCheckPopup::show(DPL::BinaryQueueAutoPtr data, WrtPopup* parent)
+{
+    LogDebug("Entered");
+    m_parent = parent;
+    Renderer::CtrlPopupPtr popup = createPopup(data);
+    ListenForAnswer(popup);
+
+    Renderer::ShowPopupEventShort event(popup,
+                                        MakeAnswerCallback(
+                                            this,
+                                            &YesNoCheckPopup::responseCallback));
+
+    CONTROLLER_POST_EVENT(Renderer::PopupController,
+                          event);
+
+    LogDebug("Exited");
+    return;
+}
+
 Renderer::CtrlPopupPtr YesNoCheckPopup::createPopup(
     DPL::BinaryQueueAutoPtr data)
 {
@@ -39,6 +63,7 @@ Renderer::CtrlPopupPtr YesNoCheckPopup::createPopup(
 void YesNoCheckPopup::responseCallback(
     const Renderer::AnswerCallbackData &answer)
 {
+    LogDebug("Entered");
     bool result = (POPUP_YES_VALUE == answer.buttonAnswer);
     DPL::BinaryQueue retValue;
     PopupSerializer::appendArg(true, retValue);
@@ -21,7 +21,6 @@
  * Inplementation
  */
 
-#include "YesNoPopup.h"
 #include "wrt-popup.h"
 
 #ifndef WRT_YES_NO_CHECK_POPUP_H
 
 namespace Wrt {
 namespace Popup {
-class YesNoCheckPopup : public YesNoPopup
+
+const char YES_LABEL[] = "Yes";
+const char NO_LABEL[] = "No";
+const int POPUP_YES_VALUE = 1;
+const int POPUP_NO_VALUE = 2;
+
+class YesNoCheckPopup : public IPopup
 {
   public:
+    virtual void show(DPL::BinaryQueueAutoPtr data, WrtPopup* parent);
+
+    YesNoCheckPopup();
     virtual ~YesNoCheckPopup();
 
   protected:
     virtual Renderer::CtrlPopupPtr createPopup(DPL::BinaryQueueAutoPtr data);
     virtual void responseCallback(const Renderer::AnswerCallbackData &answer);
+    WrtPopup* m_parent;
 };
 } // Popup
 } // Wrt
@@ -50,10 +50,12 @@ class EvasObject
         Evas_Object* GetEvasObject();
         void Disconnect();
 
+      protected:
+        virtual ~IConnection() {}
+
       private:
         IConnection(EvasObjectShared* object);
-        virtual ~IConnection()
-        {}
+
         virtual void Call(void* /*event_info*/) = 0;
 
         static void SmartCallbackWrapper(void* data,
@@ -22,7 +22,6 @@
 
 #include "popup_renderer.h"
 #include <stddef.h>
-#include <dpl/scoped_array.h>
 #include <dpl/assert.h>
 #include <dpl/log/log.h>
 #include <dpl/foreach.h>
@@ -32,6 +31,7 @@
 #include "popup_manager.h"
 #include "popup_manager.h"
 #include "evas_object.h"
+#include <Ecore_X.h>
 
 namespace Wrt {
 namespace {
@@ -46,6 +46,9 @@ class PopupRenderer : public std::enable_shared_from_this<PopupRenderer>
     IPopupPtr CreatePopup();
     virtual void setExternalCanvas(void* externalCanvas);
 
+    PopupRenderer (const PopupRenderer &) = delete;
+    PopupRenderer & operator= (const PopupRenderer &) = delete;
+
   protected:
     class Popup;
     typedef std::shared_ptr<Popup> PopupPtr;
@@ -97,7 +100,8 @@ class PopupRenderer : public std::enable_shared_from_this<PopupRenderer>
         friend class std::shared_ptr<Popup>;
         friend class PopupObjectTheme;
 
-        Popup(std::shared_ptr<PopupRenderer> renderer) : m_renderer(renderer)
+        Popup(std::shared_ptr<PopupRenderer> renderer) :
+                m_data(NULL), m_callback(NULL), m_renderer(renderer)
         {}
 
         void ForwardAnswer(const AnswerCallbackData & answer) const
@@ -24,7 +24,6 @@
 
 #include "PopupEnum.h"
 #include "PopupSerializer.h"
-#include "YesNoPopup.h"
 #include "InfoPopup.h"
 #include "YesNoCheckPopup.h"
 
@@ -98,10 +97,6 @@ void WrtPopup::readInputData()
     int popupType = PopupSerializer::getIntArg(*data);
     LogDebug("popup type " << popupType);
     switch (popupType) {
-    case YES_NO_PROMPT:
-        m_popup.reset(new YesNoPopup());
-        m_popup->show(data, this);
-        break;
     case INFO_PROMPT:
         m_popup.reset(new InfoPopup());
         m_popup->show(data, this);
@@ -185,7 +180,6 @@ int main(int argc, char *argv[])
         // the output may not be flushed).
         setlinebuf(stdout);
 
-        DPL::Log::LogSystemSingleton::Instance().SetTag("WRT-POPUP");
         Wrt::Popup::WrtPopup app(argc, argv);
         int ret = app.Exec();
         LogDebug("App returned: " << ret);
@@ -24,9 +24,9 @@ PKG_CHECK_MODULES(WRT_POPUP_RUNNER_LIB_DEP
     REQUIRED
 )
 
-set(WRT_POPUP_RUNNER_LIB_SRC_DIR ${PROJECT_SOURCE_DIR}/src/wrt-popup/wrt/popup-runner)
+SET(WRT_POPUP_RUNNER_LIB_SRC_DIR ${PROJECT_SOURCE_DIR}/src/wrt-popup/wrt/popup-runner)
 
-set(WRT_POPUP_RUNNER_LIB_SOURCES
+SET(WRT_POPUP_RUNNER_LIB_SOURCES
     ${WRT_POPUP_COMMON_SRCS}
     ${WRT_POPUP_RUNNER_LIB_SRC_DIR}/PopupInvoker.cpp
 )
@@ -44,6 +44,9 @@ ADD_LIBRARY(${TARGET_POPUP_WRT_RUNNER_LIB} SHARED
 )
 
 SET_TARGET_PROPERTIES(${TARGET_POPUP_WRT_RUNNER_LIB} PROPERTIES
+    COMPILE_DEFINITIONS LOG_TAG="${LOG_TAG}")
+
+SET_TARGET_PROPERTIES(${TARGET_POPUP_WRT_RUNNER_LIB} PROPERTIES
     COMPILE_FLAGS -fPIC
 )
 
@@ -52,7 +55,7 @@ SET_TARGET_PROPERTIES(${TARGET_POPUP_WRT_RUNNER_LIB} PROPERTIES
     VERSION ${CMAKE_PROJECT_VERSION}
 )
 
-target_link_libraries(${TARGET_POPUP_WRT_RUNNER_LIB}
+TARGET_LINK_LIBRARIES(${TARGET_POPUP_WRT_RUNNER_LIB}
     ${WRT_POPUP_RUNNER_LIB_DEP_LIBRARIES}
     ${WRT_POPUP_RUNNER_LIB_DEP_LDFLAGS}
 )
 
 #include "PopupInvoker.h"
 #include <sstream>
+#include <limits>
 #include <unistd.h>
 #include <stdio.h>
 #include <dpl/log/log.h>
+#include <dpl/assert.h>
 #include <dpl/waitable_handle.h>
 #include <dpl/binary_queue.h>
 #include <dpl/serialization.h>
@@ -64,57 +66,11 @@ PopupInvoker::~PopupInvoker()
     }
 }
 
-bool PopupInvoker::askYesNo(const std::string& title,
-                            const std::string& message)
-{
-    Try
-    {
-        DPL::BinaryQueue data;
-        PopupSerializer::appendArg(YES_NO_PROMPT, data);
-        PopupSerializer::appendArg(title, data);
-        PopupSerializer::appendArg(message, data);
-        DPL::NamedInputPipe tmp;
-        tmp.Open(m_outputName);
-        m_output.Open(m_outputName);
-        m_input.Open(m_inputName);
-        m_output.Write(data, data.Size());
-
-        executePopup();
-
-        //Result from popup application is available. Read it.
-        DPL::BinaryQueueAutoPtr resultData =
-            m_input.Read(std::numeric_limits<std::size_t>::max());
-        const int success = PopupSerializer::getIntArg(*resultData);
-        bool retVal = false;
-        if (success) {
-            const int result = PopupSerializer::getIntArg(*resultData);
-
-            LogDebug("Popup result is: " << result);
-
-            Assert(resultData->Empty());
-            retVal = (!!result);
-        } else {
-            LogWarning("Failed to show popup.");
-        }
-
-        tmp.Close();
-        m_input.Close();
-        m_output.Close();
-
-        return retVal;
-    }
-    Catch(DPL::Exception)
-    {
-        LogError("error occured");
-    }
-
-    return false;
-}
-
 void PopupInvoker::showInfo(const std::string& title,
                             const std::string& message,
                             const std::string& buttonLabel)
 {
+    LogDebug("Entered");
     Try
     {
         DPL::BinaryQueue data;
@@ -212,6 +168,7 @@ PopupResponse PopupInvoker::askYesNoCheckbox(const std::string& title,
 
 void PopupInvoker::executePopup()
 {
+    LogDebug("entered");
     pid_t pid = fork();
     if (pid == -1) {
         //error occured
@@ -26,7 +26,7 @@
  *
  * Example usage:
  *
- * bool result = PopupInvoker().askYesNo("title", "message");
+ * bool result = PopupInvoker().askYesNoCheckbox("title", "message", "lable for checkbox");
  *
  */
 
@@ -52,7 +52,6 @@ class PopupInvoker
     PopupInvoker();
     ~PopupInvoker();
 
-    bool askYesNo(const std::string &title, const std::string &message);
     void showInfo(const std::string &title,
                   const std::string &message,
                   const std::string &buttonLabel = std::string("OK"));
old mode 100644 (file)
new mode 100755 (executable)
similarity index 55%
rename from src_wearable/plugins-ipc-message/CMakeLists.txt
rename to src/xwalk-module/CMakeLists.txt
index d3da03e..b48f469
 #
 
 # @file     CMakeLists.txt
-# @author   Jihoon Chung (jihoon.chung@samsung.com)
+# @author   Lukasz Marek (l.marek@samsung.com)
 # @version  1.0
 #
 
-pkg_search_module(dpl REQUIRED dpl-efl)
+SET(TARGET_XWALK_MODULE_LIB "wrt-xwalk-module")
+
 pkg_search_module(webkit2 REQUIRED ewebkit2)
 
-set(PLUGINS_IPC_MESSAGE_SOURCES
-    ${PLUGINS_IPC_MESSAGE_DIRS}/ipc_message_support.cpp
+set(XWALK_MODULE_SRC
+    extension_adapter.cpp
+    extension_manager.cpp
+    extension.cpp
+    xwalk_extension_client.cpp
+    xwalk_extension_module.cpp
+    xwalk_extension_renderer_controller.cpp
+    xwalk_module_system.cpp
+    xwalk_v8tools_module.cpp
+    object_tools_module.cpp
+    js_utils.cpp
 )
 
 INCLUDE_DIRECTORIES(
-    ${PLUGINS_IPC_MESSAGE_DIRS}
     ${webkit2_INCLUDE_DIRS}
 )
 
-ADD_LIBRARY(${TARGET_PLUGINS_IPC_MESSAGE_LIB} SHARED
-    ${PLUGINS_IPC_MESSAGE_SOURCES}
+ADD_LIBRARY(${TARGET_XWALK_MODULE_LIB} SHARED
+    ${XWALK_MODULE_SRC}
 )
 
-SET_TARGET_PROPERTIES(${TARGET_PLUGINS_IPC_MESSAGE_LIB} PROPERTIES
+SET_TARGET_PROPERTIES(${TARGET_XWALK_MODULE_LIB} PROPERTIES
+    COMPILE_DEFINITIONS LOG_TAG="WRT_XWALK")
+
+SET_TARGET_PROPERTIES(${TARGET_XWALK_MODULE_LIB} PROPERTIES
     COMPILE_FLAGS -fPIC
     LINK_FLAGS "-Wl,--as-needed -Wl,--hash-style=both"
 )
 
-SET_TARGET_PROPERTIES(${TARGET_PLUGINS_IPC_MESSAGE_LIB} PROPERTIES
-    SOVERSION ${CMAKE_PROJECT_API_VERSION}
-    VERSION ${CMAKE_PROJECT_VERSION}
-)
-
-target_link_libraries(${TARGET_PLUGINS_IPC_MESSAGE_LIB}
-    ${dpl_LIBRARIES}
+target_link_libraries(${TARGET_XWALK_MODULE_LIB}
     ${webkit2_LIBRARIES}
+    ${TARGET_PLUGINS_IPC_MESSAGE_LIB}
 )
 
-INSTALL(TARGETS ${TARGET_PLUGINS_IPC_MESSAGE_LIB}
+INSTALL(TARGETS ${TARGET_XWALK_MODULE_LIB}
     DESTINATION lib
     PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
     GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
 )
 
 INSTALL(FILES
-    ipc_message_support.h
-    DESTINATION include/plugins-ipc-message)
+    xwalk_extension_renderer_controller.h
+    DESTINATION include/wrt-plugin-loading)
+
diff --git a/src/xwalk-module/XW_Extension.h b/src/xwalk-module/XW_Extension.h
new file mode 100644 (file)
index 0000000..386dee2
--- /dev/null
@@ -0,0 +1,186 @@
+// Copyright (c) 2013 Intel Corporation. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef XWALK_EXTENSIONS_PUBLIC_XW_EXTENSION_H_
+#define XWALK_EXTENSIONS_PUBLIC_XW_EXTENSION_H_
+
+// Crosswalk Extensions are modules of code loaded by Crosswalk runtime that
+// allow extending its capabilities. The extension is expected to define a
+// XW_Initialize() function as declared below, get the interfaces it need to
+// use and register to whatever callbacks it needs, then return XW_OK.
+//
+// The Extension is represented by the type XW_Extension. Each extension
+// loaded may be used multiple times for different pages, so to each execution
+// there will be an associated XW_Instance. A reasonable analogy is that the
+// XW_Extension represent a "class", and have concrete instances running.
+//
+// An interface is a struct with a set of functions, provided by Crosswalk,
+// that allow the extension code to interact with the web content. Certain
+// functions in an interface are used to register callbacks, so that Crosswalk
+// can call the extension at specific situations.
+//
+// Crosswalk won't call an extension's XW_Initialize() multiple times in the
+// same process.
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if __GNUC__ >= 4
+#define XW_EXPORT __attribute__ ((visibility("default")))
+#elif defined(_MSC_VER)
+#define XW_EXPORT __declspec(dllexport)
+#endif
+
+#include <stddef.h>
+#include <stdint.h>
+
+
+// XW_Extension is used to identify your extension when calling functions from
+// the API. You should always use the XW_Extension received at XW_Initialize().
+//
+// XW_Instance is used to identify different web contents using your
+// extension. Each time a new web content is created you can be notified
+// registering the XW_CreatedInstanceCallback, that receives the new
+// XW_Instance. When interacting with an Instance (for example to post a
+// message), you should pass the corresponding XW_Instance.
+//
+// In both types the zero value is never used by Crosswalk, so can be used to
+// initialize variables.
+typedef int32_t XW_Extension;
+typedef int32_t XW_Instance;
+
+enum {
+  XW_OK = 0,
+  XW_ERROR = -1
+};
+
+// Returns a struct containing functions to be used by the extension. Those
+// structs can be stored statically and used until the extension is unloaded.
+// Extensions should use definitions like XW_CORE_INTERFACE, instead of using
+// the versioned definition or the literal string. Returns NULL if the
+// interface is not supported.
+typedef const void* (*XW_GetInterface)(const char* interface_name);
+
+
+typedef int32_t (*XW_Initialize_Func)(XW_Extension extension,
+                                      XW_GetInterface get_interface);
+
+// XW_Initialize is called after the extension code is loaded. The 'extension'
+// value should be used in further calls that expect XW_Extension argument.
+//
+// The 'get_interface' function should be used to get access to functions that
+// interact with the web content. It is only valid during the execution of the
+// XW_Initialize() function.
+//
+// This function should return XW_OK when the extension was succesfully
+// loaded, otherwise XW_ERROR.
+XW_EXPORT int32_t XW_Initialize(XW_Extension extension,
+                                XW_GetInterface get_interface);
+
+
+//
+// XW_CORE_INTERFACE: Basic functionality for Crosswalk Extensions. All
+// extensions should use this interface to set at least their name.
+//
+
+#define XW_CORE_INTERFACE_1 "XW_CoreInterface_1"
+#define XW_CORE_INTERFACE XW_CORE_INTERFACE_1
+
+typedef void (*XW_CreatedInstanceCallback)(XW_Instance instance);
+typedef void (*XW_DestroyedInstanceCallback)(XW_Instance instance);
+typedef void (*XW_ShutdownCallback)(XW_Extension extension);
+
+struct XW_CoreInterface_1 {
+  // Set the name of the extension. It is used as the namespace for the
+  // JavaScript code exposed by the extension. So extension named
+  // 'my_extension', will expose its JavaScript functionality inside
+  // the 'my_extension' namespace.
+  //
+  // This function should be called only during XW_Initialize().
+  void (*SetExtensionName)(XW_Extension extension, const char* name);
+
+  // Set the JavaScript code loaded in the web content when the extension is
+  // used. This can be used together with the messaging mechanism to implement
+  // a higher-level API that posts messages to extensions, see
+  // XW_MESSAGING_INTERFACE below.
+  //
+  // The code will be executed inside a JS function context with the following
+  // objects available:
+  //
+  // - exports: this object should be filled with properties and functions
+  //            that will be exposed in the namespace associated with this
+  //            extension.
+  //
+  // - extension.postMessage(): post a string message to the extension native
+  //                            code. See below for details.
+  // - extension.setMessageListener(): allow setting a callback that is called
+  //                                   when the native code sends a message
+  //                                   to JavaScript. Callback takes a string.
+  //
+  // This function should be called only during XW_Initialize().
+  void (*SetJavaScriptAPI)(XW_Extension extension, const char* api);
+
+  // Register callbacks that are called when an instance of this extension
+  // is created or destroyed. Everytime a new web content is loaded, it will
+  // get a new associated instance.
+  //
+  // This function should be called only during XW_Initialize().
+  void (*RegisterInstanceCallbacks)(XW_Extension extension,
+                                    XW_CreatedInstanceCallback created,
+                                    XW_DestroyedInstanceCallback destroyed);
+
+  // Register a callback to be executed when the extension will be unloaded.
+  //
+  // This function should be called only during XW_Initialize().
+  void (*RegisterShutdownCallback)(XW_Extension extension,
+                                   XW_ShutdownCallback shutdown_callback);
+
+  // These two functions are conveniences used to associated arbitrary data
+  // with a given XW_Instance. They can be used only with instances that were
+  // created but not yet completely destroyed. GetInstanceData() can be used
+  // during the destroyed instance callback. If not instance data was set,
+  // getting it returns NULL.
+  void (*SetInstanceData)(XW_Instance instance, void* data);
+  void* (*GetInstanceData)(XW_Instance instance);
+};
+
+typedef struct XW_CoreInterface_1 XW_CoreInterface;
+
+
+//
+// XW_MESSAGING_INTERFACE: Exchange asynchronous messages with JavaScript
+// code provided by extension.
+//
+
+#define XW_MESSAGING_INTERFACE_1 "XW_MessagingInterface_1"
+#define XW_MESSAGING_INTERFACE XW_MESSAGING_INTERFACE_1
+
+typedef void (*XW_HandleMessageCallback)(XW_Instance instance,
+                                         const char* message);
+
+struct XW_MessagingInterface_1 {
+  // Register a callback to be called when the JavaScript code associated
+  // with the extension posts a message. Note that the callback will be called
+  // with the XW_Instance that posted the message as well as the message
+  // contents.
+  void (*Register)(XW_Extension extension,
+                   XW_HandleMessageCallback handle_message);
+
+  // Post a message to the web content associated with the instance. To
+  // receive this message the extension's JavaScript code should set a
+  // listener using extension.setMessageListener() function.
+  //
+  // This function is thread-safe and can be called until the instance is
+  // destroyed.
+  void (*PostMessage)(XW_Instance instance, const char* message);
+};
+
+typedef struct XW_MessagingInterface_1 XW_MessagingInterface;
+
+#ifdef __cplusplus
+}  // extern "C"
+#endif
+
+#endif  // XWALK_EXTENSIONS_PUBLIC_XW_EXTENSION_H_
diff --git a/src/xwalk-module/XW_Extension_Data.h b/src/xwalk-module/XW_Extension_Data.h
new file mode 100644 (file)
index 0000000..c1b55de
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2015 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.
+ */
+
+#ifndef XWALK_EXTENSIONS_PUBLIC_XW_EXTENSION_DATA_H_
+#define XWALK_EXTENSIONS_PUBLIC_XW_EXTENSION_DATA_H_
+
+#ifndef XWALK_EXTENSIONS_PUBLIC_XW_EXTENSION_H_
+#error "You should include XW_Extension.h before this file"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+//
+// XW_INTERNAL_DATA_INTERFACE: allow extensions to exchange binary chunk data
+// between extension and loader.
+//
+
+#define XW_INTERNAL_DATA_INTERFACE_1 \
+  "XW_InternalDataInterface_1"
+#define XW_INTERNAL_DATA_INTERFACE \
+  XW_INTERNAL_DATA_INTERFACE_1
+
+// Synchronous / Asynchronous data exchanging interface
+typedef void (*XW_HandleDataCallback)(XW_Instance instance,
+                                      const char* message,
+                                      uint8_t* buffer, size_t len);
+
+struct XW_Internal_DataInterface_1 {
+  void (*RegisterSync)(XW_Extension extension,
+                       XW_HandleDataCallback handle_data);
+
+  void (*RegisterAsync)(XW_Extension extension,
+                        XW_HandleDataCallback handle_data);
+
+  void (*SetSyncReply)(XW_Instance instance, const char* reply,
+                       uint8_t* buffer, size_t len);
+
+  void (*PostData)(XW_Instance instance, const char* message,
+                   uint8_t* buffer, size_t len);
+};
+
+typedef struct XW_Internal_DataInterface_1
+    XW_Internal_DataInterface;
+
+#ifdef __cplusplus
+}  // extern "C"
+#endif
+
+#endif  // XWALK_EXTENSIONS_PUBLIC_XW_EXTENSION_DATA_H_
diff --git a/src/xwalk-module/XW_Extension_EntryPoints.h b/src/xwalk-module/XW_Extension_EntryPoints.h
new file mode 100644 (file)
index 0000000..54532a9
--- /dev/null
@@ -0,0 +1,49 @@
+// Copyright (c) 2013 Intel Corporation. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef XWALK_EXTENSIONS_PUBLIC_XW_EXTENSION_ENTRYPOINTS_H_
+#define XWALK_EXTENSIONS_PUBLIC_XW_EXTENSION_ENTRYPOINTS_H_
+
+// NOTE: This file and interfaces marked as internal are not considered stable
+// and can be modified in incompatible ways between Crosswalk versions.
+
+#ifndef XWALK_EXTENSIONS_PUBLIC_XW_EXTENSION_H_
+#error "You should include XW_Extension.h before this file"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define XW_INTERNAL_ENTRY_POINTS_INTERFACE_1 \
+  "XW_Internal_EntryPointsInterface_1"
+#define XW_INTERNAL_ENTRY_POINTS_INTERFACE \
+  XW_INTERNAL_ENTRY_POINTS_INTERFACE_1
+
+//
+// XW_INTERNAL_ENTRY_POINTS_INTERFACE: provides a way for extensions to add
+// more information about its implementation. For now, allow extensions to
+// specify more objects that the access should cause the extension to be
+// loaded.
+//
+
+struct XW_Internal_EntryPointsInterface_1 {
+  // Register extra entry points for this extension. An "extra" entry points
+  // are objects outside the implicit namespace for which the extension should
+  // be loaded when they are touched.
+  //
+  // This function should be called only during XW_Initialize().
+  void (*SetExtraJSEntryPoints)(XW_Extension extension,
+                                const char** entry_points);
+};
+
+typedef struct XW_Internal_EntryPointsInterface_1
+    XW_Internal_EntryPointsInterface;
+
+#ifdef __cplusplus
+}  // extern "C"
+#endif
+
+#endif  // XWALK_EXTENSIONS_PUBLIC_XW_EXTENSION_ENTRYPOINTS_H_
+
diff --git a/src/xwalk-module/XW_Extension_Permissions.h b/src/xwalk-module/XW_Extension_Permissions.h
new file mode 100644 (file)
index 0000000..d25484e
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright (c) 2014 Intel Corporation. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef XWALK_EXTENSIONS_PUBLIC_XW_EXTENSION_PERMISSIONS_H_
+#define XWALK_EXTENSIONS_PUBLIC_XW_EXTENSION_PERMISSIONS_H_
+
+// NOTE: This file and interfaces marked as internal are not considered stable
+// and can be modified in incompatible ways between Crosswalk versions.
+
+#ifndef XWALK_EXTENSIONS_PUBLIC_XW_EXTENSION_H_
+#error "You should include XW_Extension.h before this file"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define XW_INTERNAL_PERMISSIONS_INTERFACE_1 \
+    "XW_Internal_PermissionsInterface_1"
+#define XW_INTERNAL_PERMISSIONS_INTERFACE \
+    XW_INTERNAL_PERMISSIONS_INTERFACE_1
+
+//
+// XW_INTERNAL_PERMISSIONS_INTERFACE: provides a way for extensions
+// check if they have the proper permissions for certain APIs.
+//
+
+struct XW_Internal_PermissionsInterface_1 {
+  int (*CheckAPIAccessControl)(XW_Extension extension, const char* api_name);
+  int (*RegisterPermissions)(XW_Extension extension, const char* perm_table);
+};
+
+typedef struct XW_Internal_PermissionsInterface_1
+    XW_Internal_PermissionsInterface;
+
+#ifdef __cplusplus
+}  // extern "C"
+#endif
+
+#endif  // XWALK_EXTENSIONS_PUBLIC_XW_EXTENSION_PERMISSIONS_H_
diff --git a/src/xwalk-module/XW_Extension_Runtime.h b/src/xwalk-module/XW_Extension_Runtime.h
new file mode 100644 (file)
index 0000000..11ad307
--- /dev/null
@@ -0,0 +1,44 @@
+// Copyright (c) 2013 Intel Corporation. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef XWALK_EXTENSIONS_PUBLIC_XW_EXTENSION_RUNTIME_H_
+#define XWALK_EXTENSIONS_PUBLIC_XW_EXTENSION_RUNTIME_H_
+
+// NOTE: This file and interfaces marked as internal are not considered stable
+// and can be modified in incompatible ways between Crosswalk versions.
+
+#ifndef XWALK_EXTENSIONS_PUBLIC_XW_EXTENSION_H_
+#error "You should include XW_Extension.h before this file"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define XW_INTERNAL_RUNTIME_INTERFACE_1 \
+  "XW_Internal_RuntimeInterface_1"
+#define XW_INTERNAL_RUNTIME_INTERFACE \
+  XW_INTERNAL_RUNTIME_INTERFACE_1
+
+//
+// XW_INTERNAL_RUNTIME_INTERFACE: allow extensions to gather information
+// from the runtime.
+//
+
+struct XW_Internal_RuntimeInterface_1 {
+  void (*GetRuntimeVariableString)(XW_Extension extension,
+                                   const char* key,
+                                   char* value,
+                                   unsigned int value_len);
+};
+
+typedef struct XW_Internal_RuntimeInterface_1
+    XW_Internal_RuntimeInterface;
+
+#ifdef __cplusplus
+}  // extern "C"
+#endif
+
+#endif  // XWALK_EXTENSIONS_PUBLIC_XW_EXTENSION_RUNTIME_H_
+
diff --git a/src/xwalk-module/XW_Extension_SyncMessage.h b/src/xwalk-module/XW_Extension_SyncMessage.h
new file mode 100644 (file)
index 0000000..4eddbf9
--- /dev/null
@@ -0,0 +1,48 @@
+// Copyright (c) 2013 Intel Corporation. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef XWALK_EXTENSIONS_PUBLIC_XW_EXTENSION_SYNCMESSAGE_H_
+#define XWALK_EXTENSIONS_PUBLIC_XW_EXTENSION_SYNCMESSAGE_H_
+
+// NOTE: This file and interfaces marked as internal are not considered stable
+// and can be modified in incompatible ways between Crosswalk versions.
+
+#ifndef XWALK_EXTENSIONS_PUBLIC_XW_EXTENSION_H_
+#error "You should include XW_Extension.h before this file"
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+//
+// XW_INTERNAL_SYNC_MESSAGING_INTERFACE: allow JavaScript code to send a
+// synchronous message to extension code and block until response is
+// available. The response is made available by calling the SetSyncReply
+// function, that can be done from outside the context of the SyncMessage
+// handler.
+//
+
+#define XW_INTERNAL_SYNC_MESSAGING_INTERFACE_1 \
+  "XW_InternalSyncMessagingInterface_1"
+#define XW_INTERNAL_SYNC_MESSAGING_INTERFACE \
+  XW_INTERNAL_SYNC_MESSAGING_INTERFACE_1
+
+typedef void (*XW_HandleSyncMessageCallback)(XW_Instance instance,
+                                             const char* message);
+
+struct XW_Internal_SyncMessagingInterface_1 {
+  void (*Register)(XW_Extension extension,
+                   XW_HandleSyncMessageCallback handle_sync_message);
+  void (*SetSyncReply)(XW_Instance instance, const char* reply);
+};
+
+typedef struct XW_Internal_SyncMessagingInterface_1
+    XW_Internal_SyncMessagingInterface;
+
+#ifdef __cplusplus
+}  // extern "C"
+#endif
+
+#endif  // XWALK_EXTENSIONS_PUBLIC_XW_EXTENSION_SYNCMESSAGE_H_
diff --git a/src/xwalk-module/extension.cpp b/src/xwalk-module/extension.cpp
new file mode 100755 (executable)
index 0000000..3015ffa
--- /dev/null
@@ -0,0 +1,195 @@
+// Copyright 2014 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.
+
+#include "extension.h"
+
+#include <dlfcn.h>
+#include <dlog.h>
+#include <dpl/log/secure_log.h>
+
+#include "extension_adapter.h"
+#include "runtime_variable_provider.h"
+
+namespace wrt {
+namespace xwalk {
+
+Extension::Extension(const std::string& path, RuntimeVariableProvider* provider)
+  : initialized_(false),
+    library_path_(path),
+    xw_extension_(0),
+    use_trampoline_(true),
+    created_instance_callback_(NULL),
+    destroyed_instance_callback_(NULL),
+    shutdown_callback_(NULL),
+    handle_msg_callback_(NULL),
+    handle_sync_msg_callback_(NULL),
+    rv_provider_(provider){
+}
+
+Extension::Extension(const std::string& path,
+                     const std::string& name,
+                     const std::vector<std::string>& entry_points,
+                     RuntimeVariableProvider* provider)
+  : initialized_(false),
+    library_path_(path),
+    xw_extension_(0),
+    name_(name),
+    entry_points_(entry_points),
+    use_trampoline_(true),
+    created_instance_callback_(NULL),
+    destroyed_instance_callback_(NULL),
+    shutdown_callback_(NULL),
+    handle_msg_callback_(NULL),
+    handle_sync_msg_callback_(NULL),
+    rv_provider_(provider){
+}
+
+
+Extension::~Extension() {
+  if (!initialized_)
+    return;
+
+  if (shutdown_callback_)
+    shutdown_callback_(xw_extension_);
+  ExtensionAdapter::GetInstance()->UnregisterExtension(this);
+}
+
+bool Extension::Initialize() {
+  if (initialized_)
+    return true;
+
+  LOGD("========== << Initialize >> ENTER ==========");
+  _D("Extension Module library : [%s]", library_path_.c_str());
+
+  void* handle = dlopen(library_path_.c_str(), RTLD_LAZY);
+  if (!handle) {
+    const char* error = (const char*)dlerror();
+    LOGE("Error loading extension '%s'. Reason: %s", library_path_.c_str(), (error != NULL ? error : "unknown"));
+    return false;
+  }
+
+  XW_Initialize_Func initialize = reinterpret_cast<XW_Initialize_Func>(
+      dlsym(handle, "XW_Initialize"));
+  if (!initialize) {
+    LOGE("Error loading extension");
+    _E("[%s] couldn't get XW_Initialize function", library_path_.c_str());
+    dlclose(handle);
+    return false;
+  }
+
+  ExtensionAdapter* adapter = ExtensionAdapter::GetInstance();
+  xw_extension_ = adapter->GetNextXWExtension();
+  adapter->RegisterExtension(this);
+
+  int ret = initialize(xw_extension_, ExtensionAdapter::GetInterface);
+  if (ret != XW_OK) {
+    LOGE("Error loading extension");
+    _E("[%s] XW_Initialize function returned error value.", library_path_.c_str());
+    dlclose(handle);
+    return false;
+  }
+
+  initialized_ = true;
+  LOGD("========== << Initialize >> END ==========");
+  return true;
+}
+
+ExtensionInstance* Extension::CreateInstance() {
+  Initialize();
+  ExtensionAdapter* adapter = ExtensionAdapter::GetInstance();
+  XW_Instance xw_instance = adapter->GetNextXWInstance();
+  return new ExtensionInstance(this, xw_instance);
+}
+
+void Extension::GetRuntimeVariable(const char* key, char* value, size_t value_len) {
+  if( rv_provider_ ){
+      std::string ret = rv_provider_->GetRuntimeVariable(key);
+      strncpy(value, ret.c_str(), value_len);
+  }
+}
+int Extension::CheckAPIAccessControl(const char* /*api_name*/) {
+  // TODO
+  return XW_OK;
+}
+
+int Extension::RegisterPermissions(const char* /*perm_table*/) {
+  // TODO
+  return XW_OK;
+}
+
+ExtensionInstance::ExtensionInstance(Extension* extension, XW_Instance xw_instance)
+  : extension_(extension),
+    xw_instance_(xw_instance),
+    instance_data_(NULL),
+    post_message_listener_(NULL),
+    post_data_listener_(NULL) {
+  ExtensionAdapter::GetInstance()->RegisterInstance(this);
+  XW_CreatedInstanceCallback callback = extension_->created_instance_callback_;
+  if (callback)
+    callback(xw_instance_);
+}
+
+ExtensionInstance::~ExtensionInstance() {
+  XW_DestroyedInstanceCallback callback = extension_->destroyed_instance_callback_;
+  if (callback)
+    callback(xw_instance_);
+  ExtensionAdapter::GetInstance()->UnregisterInstance(this);
+}
+
+void ExtensionInstance::HandleMessage(const std::string& msg) {
+  XW_HandleMessageCallback callback = extension_->handle_msg_callback_;
+  if (callback)
+    callback(xw_instance_, msg.c_str());
+}
+
+void ExtensionInstance::HandleSyncMessage(const std::string& msg) {
+  XW_HandleSyncMessageCallback callback = extension_->handle_sync_msg_callback_;
+  if (callback) {
+    sync_reply_msg_.clear();
+    callback(xw_instance_, msg.c_str());
+  }
+}
+
+void ExtensionInstance::PostMessage(const std::string& msg) {
+  if (post_message_listener_) {
+    post_message_listener_->PostMessageToJS(msg);
+  }
+}
+
+void ExtensionInstance::SyncReply(const std::string& reply) {
+  sync_reply_msg_ = reply;
+}
+
+void ExtensionInstance::HandleData(const std::string& msg, uint8_t* buffer, size_t len) {
+  XW_HandleDataCallback callback = extension_->handle_data_callback_;
+  if (callback)
+    callback(xw_instance_, msg.c_str(), buffer, len);
+}
+
+void ExtensionInstance::HandleSyncData(const std::string& msg, uint8_t* buffer, size_t len) {
+  XW_HandleDataCallback callback = extension_->handle_sync_data_callback_;
+  if (callback) {
+    sync_reply_msg_.clear();
+    sync_reply_buffer_len_ = 0;
+    sync_reply_buffer_ = NULL;
+    // sync_reply_buffer_ will be freed by XWalkExtensionModule
+    callback(xw_instance_, msg.c_str(), buffer, len);
+  }
+}
+
+void ExtensionInstance::PostData(const std::string& msg, uint8_t* buffer, size_t len) {
+  if (post_data_listener_) {
+    post_data_listener_->PostDataToJS(msg, buffer, len);
+  }
+}
+
+void ExtensionInstance::SyncDataReply(const std::string& reply, uint8_t* buffer, size_t len) {
+  sync_reply_msg_ = reply;
+  sync_reply_buffer_ = buffer;
+  sync_reply_buffer_len_ = len;
+}
+
+} // namespace xwalk
+} // namespace wrt
+
diff --git a/src/xwalk-module/extension.h b/src/xwalk-module/extension.h
new file mode 100755 (executable)
index 0000000..72a98ed
--- /dev/null
@@ -0,0 +1,162 @@
+// Copyright 2014 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.
+
+#ifndef WRT_SERVICE_NODE_EXTENSION_H_
+#define WRT_SERVICE_NODE_EXTENSION_H_
+
+#include <string>
+#include <vector>
+
+#include "XW_Extension.h"
+#include "XW_Extension_SyncMessage.h"
+#include "XW_Extension_Data.h"
+
+namespace wrt {
+class RuntimeVariableProvider;
+
+namespace xwalk {
+
+class ExtensionAdapter;
+class ExtensionInstance;
+
+class Extension {
+ public:
+  Extension(const std::string& path, RuntimeVariableProvider* provider);
+  Extension(const std::string& path,
+            const std::string& name,
+            const std::vector<std::string>& entry_points,
+            RuntimeVariableProvider* provider);
+
+  virtual ~Extension();
+
+  bool Initialize();
+  ExtensionInstance* CreateInstance();
+
+  XW_Extension xw_extension() {
+    return xw_extension_;
+  }
+
+  std::string name() {
+    return name_;
+  }
+
+  std::string javascript_api() {
+    Initialize();
+    return javascript_api_;
+  }
+
+  std::vector<std::string>& entry_points() {
+    return entry_points_;
+  }
+
+  bool use_trampoline() {
+    return use_trampoline_;
+  }
+
+  void set_name(const std::string& name) {
+    name_ = name;
+  }
+
+  void set_javascript_api(const std::string& javascript_api) {
+    javascript_api_ = javascript_api;
+  }
+
+  void set_use_trampoline(bool use_trampoline) {
+    use_trampoline_ = use_trampoline;
+  }
+
+ private:
+  friend class ExtensionAdapter;
+  friend class ExtensionInstance;
+
+  void GetRuntimeVariable(const char* key, char* value, size_t value_len);
+  int CheckAPIAccessControl(const char* api_name);
+  int RegisterPermissions(const char* perm_table);
+
+  bool initialized_;
+  std::string library_path_;
+
+  XW_Extension xw_extension_;
+  std::string name_;
+  std::string javascript_api_;
+  std::vector<std::string> entry_points_;
+  bool use_trampoline_;
+
+  XW_CreatedInstanceCallback created_instance_callback_;
+  XW_DestroyedInstanceCallback destroyed_instance_callback_;
+  XW_ShutdownCallback shutdown_callback_;
+  XW_HandleMessageCallback handle_msg_callback_;
+  XW_HandleSyncMessageCallback handle_sync_msg_callback_;
+  XW_HandleDataCallback handle_data_callback_;
+  XW_HandleDataCallback handle_sync_data_callback_;
+  RuntimeVariableProvider* rv_provider_;
+};
+
+class PostMessageListener {
+ public:
+  virtual void PostMessageToJS(const std::string& msg) = 0;
+};
+
+class PostDataListener {
+ public:
+  virtual void PostDataToJS(const std::string& msg, uint8_t* buffer, size_t len) = 0;
+};
+
+class ExtensionInstance {
+ public:
+  ExtensionInstance(Extension* extension, XW_Instance xw_instance);
+  virtual ~ExtensionInstance();
+
+  void HandleMessage(const std::string& msg);
+  void HandleSyncMessage(const std::string& msg);
+
+  void HandleData(const std::string& msg, uint8_t* buffer, size_t len);
+  void HandleSyncData(const std::string& msg, uint8_t* buffer, size_t len);
+
+  XW_Instance xw_instance() {
+    return xw_instance_;
+  }
+
+  std::string sync_replay_msg() {
+    return sync_reply_msg_;
+  }
+
+  std::string sync_data_reply_msg(uint8_t** buffer, size_t *len) {
+    *buffer = sync_reply_buffer_;
+    *len = sync_reply_buffer_len_;
+    return sync_reply_msg_;
+  }
+
+  void set_post_message_listener(PostMessageListener* listener) {
+    post_message_listener_ = listener;
+  }
+
+  void set_post_data_listener(PostDataListener* listener) {
+    post_data_listener_ = listener;
+  }
+
+ private:
+  friend class ExtensionAdapter;
+
+  void PostMessage(const std::string& msg);
+  void SyncReply(const std::string& reply);
+
+  void PostData(const std::string& msg, uint8_t* buffer, size_t len);
+  void SyncDataReply(const std::string& reply, uint8_t* buffer, size_t len);
+
+  Extension* extension_;
+  XW_Instance xw_instance_;
+  void* instance_data_;
+  std::string sync_reply_msg_;
+  uint8_t* sync_reply_buffer_;
+  size_t sync_reply_buffer_len_;
+
+  PostMessageListener* post_message_listener_;
+  PostDataListener* post_data_listener_;
+};
+
+} // namespace xwalk
+} // namespace wrt
+
+#endif // WRT_SERVICE_NODE_EXTENSION_H_
diff --git a/src/xwalk-module/extension_adapter.cpp b/src/xwalk-module/extension_adapter.cpp
new file mode 100755 (executable)
index 0000000..75e2079
--- /dev/null
@@ -0,0 +1,313 @@
+// Copyright (c) 2013 Intel Corporation. All rights reserved.
+// Copyright 2014 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.
+
+#include "extension_adapter.h"
+
+#include <dlog.h>
+
+namespace wrt {
+namespace xwalk {
+
+ExtensionAdapter::ExtensionAdapter()
+  : next_xw_extension_(1),
+    next_xw_instance_(1) {
+}
+
+ExtensionAdapter::~ExtensionAdapter() {
+}
+
+ExtensionAdapter* ExtensionAdapter::GetInstance() {
+  static ExtensionAdapter self;
+  return &self;
+}
+
+XW_Extension ExtensionAdapter::GetNextXWExtension() {
+  return next_xw_extension_++;
+}
+
+XW_Instance ExtensionAdapter::GetNextXWInstance() {
+  return next_xw_instance_++;
+}
+
+void ExtensionAdapter::RegisterExtension(Extension* extension) {
+  XW_Extension xw_extension = extension->xw_extension();
+  if (!(xw_extension > 0 && xw_extension < next_xw_extension_)) {
+    LOGW("xw_extension (%d) is invalid.", xw_extension);
+    return;
+  }
+  if (extension_map_.find(xw_extension) == extension_map_.end())
+    extension_map_[xw_extension] = extension;
+}
+
+void ExtensionAdapter::UnregisterExtension(Extension* extension) {
+  XW_Extension xw_extension = extension->xw_extension();
+  if (!(xw_extension > 0 && xw_extension < next_xw_extension_)) {
+    LOGW("xw_extension (%d) is invalid.", xw_extension);
+    return;
+  }
+  if (extension_map_.find(xw_extension) != extension_map_.end())
+    extension_map_.erase(xw_extension);
+}
+
+void ExtensionAdapter::RegisterInstance(ExtensionInstance* instance) {
+  XW_Instance xw_instance = instance->xw_instance();
+  if (!(xw_instance > 0 && xw_instance < next_xw_instance_)) {
+    LOGW("xw_instance (%d) is invalid.", xw_instance);
+    return;
+  }
+  if (instance_map_.find(xw_instance) == instance_map_.end())
+    instance_map_[xw_instance] = instance;
+}
+
+void ExtensionAdapter::UnregisterInstance(ExtensionInstance* instance) {
+  XW_Instance xw_instance = instance->xw_instance();
+  if (!(xw_instance > 0 && xw_instance < next_xw_instance_)) {
+    LOGW("xw_instance (%d) is invalid.", xw_instance);
+    return;
+  }
+  if (instance_map_.find(xw_instance) != instance_map_.end())
+    instance_map_.erase(xw_instance);
+}
+
+const void* ExtensionAdapter::GetInterface(const char* name) {
+  if (!strcmp(name, XW_CORE_INTERFACE_1)) {
+    static const XW_CoreInterface_1 coreInterface1 = {
+      CoreSetExtensionName,
+      CoreSetJavaScriptAPI,
+      CoreRegisterInstanceCallbacks,
+      CoreRegisterShutdownCallback,
+      CoreSetInstanceData,
+      CoreGetInstanceData
+    };
+    return &coreInterface1;
+  }
+
+  if (!strcmp(name, XW_MESSAGING_INTERFACE_1)) {
+    static const XW_MessagingInterface_1 messagingInterface1 = {
+      MessagingRegister,
+      MessagingPostMessage
+    };
+    return &messagingInterface1;
+  }
+
+  if (!strcmp(name, XW_INTERNAL_SYNC_MESSAGING_INTERFACE_1)) {
+    static const XW_Internal_SyncMessagingInterface_1
+        syncMessagingInterface1 = {
+      SyncMessagingRegister,
+      SyncMessagingSetSyncReply
+    };
+    return &syncMessagingInterface1;
+  }
+
+  if (!strcmp(name, XW_INTERNAL_ENTRY_POINTS_INTERFACE_1)) {
+    static const XW_Internal_EntryPointsInterface_1 entryPointsInterface1 = {
+      EntryPointsSetExtraJSEntryPoints
+    };
+    return &entryPointsInterface1;
+  }
+
+  if (!strcmp(name, XW_INTERNAL_RUNTIME_INTERFACE_1)) {
+    static const XW_Internal_RuntimeInterface_1 runtimeInterface1 = {
+      RuntimeGetStringVariable
+    };
+    return &runtimeInterface1;
+  }
+
+  if (!strcmp(name, XW_INTERNAL_PERMISSIONS_INTERFACE_1)) {
+    static const XW_Internal_PermissionsInterface_1 permissionsInterface1 = {
+      PermissionsCheckAPIAccessControl,
+      PermissionsRegisterPermissions
+    };
+    return &permissionsInterface1;
+  }
+
+  if (!strcmp(name, XW_INTERNAL_DATA_INTERFACE_1)) {
+    static const XW_Internal_DataInterface_1 dataInterface1 = {
+      DataRegisterSync,
+      DataRegisterAsync,
+      DataSetSyncReply,
+      DataPostData
+    };
+    return &dataInterface1;
+  }
+
+  LOGW("Interface '%s' is not supported.", name);
+  return NULL;
+}
+
+Extension* ExtensionAdapter::GetExtension(XW_Extension xw_extension) {
+  ExtensionAdapter* adapter = ExtensionAdapter::GetInstance();
+  ExtensionMap::iterator it = adapter->extension_map_.find(xw_extension);
+  if (it == adapter->extension_map_.end())
+    return NULL;
+  return it->second;
+}
+
+ExtensionInstance* ExtensionAdapter::GetExtensionInstance(XW_Instance xw_instance) {
+  ExtensionAdapter* adapter = ExtensionAdapter::GetInstance();
+  InstanceMap::iterator it = adapter->instance_map_.find(xw_instance);
+  if (it == adapter->instance_map_.end())
+    return NULL;
+  return it->second;
+}
+
+#define CHECK(x, xw) \
+  if (!x) { \
+    LOGW("Ignoring call. Invalid %s = %d", #xw, xw); \
+    return; \
+  }
+
+#define RETURN_IF_INITIALIZED(x) \
+  if (x->initialized_) \
+    return;
+
+void ExtensionAdapter::CoreSetExtensionName(XW_Extension xw_extension,
+    const char* name) {
+  Extension* extension = GetExtension(xw_extension);
+  CHECK(extension, xw_extension);
+  RETURN_IF_INITIALIZED(extension);
+  extension->name_ = name;
+}
+
+void ExtensionAdapter::CoreSetJavaScriptAPI(XW_Extension xw_extension,
+    const char* javascript_api) {
+  Extension* extension = GetExtension(xw_extension);
+  CHECK(extension, xw_extension);
+  RETURN_IF_INITIALIZED(extension);
+  extension->javascript_api_ = javascript_api;
+}
+
+void ExtensionAdapter::CoreRegisterInstanceCallbacks(XW_Extension xw_extension,
+    XW_CreatedInstanceCallback created,
+    XW_DestroyedInstanceCallback destroyed) {
+  Extension* extension = GetExtension(xw_extension);
+  CHECK(extension, xw_extension);
+  RETURN_IF_INITIALIZED(extension);
+  extension->created_instance_callback_ = created;
+  extension->destroyed_instance_callback_ = destroyed;
+}
+
+void ExtensionAdapter::CoreRegisterShutdownCallback(XW_Extension xw_extension,
+    XW_ShutdownCallback shutdown) {
+  Extension* extension = GetExtension(xw_extension);
+  CHECK(extension, xw_extension);
+  RETURN_IF_INITIALIZED(extension);
+  extension->shutdown_callback_ = shutdown;
+}
+
+void ExtensionAdapter::CoreSetInstanceData(XW_Instance xw_instance, void* data) {
+  ExtensionInstance* instance = GetExtensionInstance(xw_instance);
+  CHECK(instance, xw_instance);
+  instance->instance_data_ = data;
+}
+
+void* ExtensionAdapter::CoreGetInstanceData(XW_Instance xw_instance) {
+  ExtensionInstance* instance = GetExtensionInstance(xw_instance);
+  if (instance)
+    return instance->instance_data_;
+  else
+    return NULL;
+}
+
+void ExtensionAdapter::MessagingRegister(XW_Extension xw_extension,
+    XW_HandleMessageCallback handle_message) {
+  Extension* extension = GetExtension(xw_extension);
+  CHECK(extension, xw_extension);
+  RETURN_IF_INITIALIZED(extension);
+  extension->handle_msg_callback_ = handle_message;
+}
+
+void ExtensionAdapter::MessagingPostMessage(XW_Instance xw_instance,
+    const char* message) {
+  ExtensionInstance* instance = GetExtensionInstance(xw_instance);
+  CHECK(instance, xw_instance);
+  instance->PostMessage(message);
+}
+
+void ExtensionAdapter::SyncMessagingRegister(XW_Extension xw_extension,
+    XW_HandleSyncMessageCallback handle_sync_message) {
+  Extension* extension = GetExtension(xw_extension);
+  CHECK(extension, xw_extension);
+  RETURN_IF_INITIALIZED(extension);
+  extension->handle_sync_msg_callback_ = handle_sync_message;
+}
+
+void ExtensionAdapter::SyncMessagingSetSyncReply(XW_Instance xw_instance,
+    const char* reply) {
+  ExtensionInstance* instance = GetExtensionInstance(xw_instance);
+  CHECK(instance, xw_instance);
+  instance->SyncReply(reply);
+}
+
+void ExtensionAdapter::EntryPointsSetExtraJSEntryPoints(XW_Extension xw_extension,
+    const char** entry_points) {
+  Extension* extension = GetExtension(xw_extension);
+  CHECK(extension, xw_extension);
+  RETURN_IF_INITIALIZED(extension);
+
+  for (int i=0; entry_points[i]; ++i) {
+    extension->entry_points_.push_back(std::string(entry_points[i]));
+  }
+}
+
+void ExtensionAdapter::RuntimeGetStringVariable(XW_Extension xw_extension,
+    const char* key,
+    char* value,
+    unsigned int value_len) {
+  Extension* extension = GetExtension(xw_extension);
+  CHECK(extension, xw_extension);
+  extension->GetRuntimeVariable(key, value, value_len);
+}
+
+int ExtensionAdapter::PermissionsCheckAPIAccessControl(XW_Extension xw_extension,
+    const char* api_name) {
+  Extension* extension = GetExtension(xw_extension);
+  if (extension)
+    return extension->CheckAPIAccessControl(api_name);
+  else
+    return XW_ERROR;
+}
+
+int ExtensionAdapter::PermissionsRegisterPermissions(XW_Extension xw_extension,
+    const char* perm_table) {
+  Extension* extension = GetExtension(xw_extension);
+  if (extension)
+    return extension->RegisterPermissions(perm_table);
+  else
+    return XW_ERROR;
+}
+
+void ExtensionAdapter::DataRegisterSync(XW_Extension xw_extension,
+                                    XW_HandleDataCallback handle_sync_data) {
+  Extension* extension = GetExtension(xw_extension);
+  CHECK(extension, xw_extension);
+  RETURN_IF_INITIALIZED(extension);
+  extension->handle_sync_data_callback_ = handle_sync_data;
+}
+
+void ExtensionAdapter::DataRegisterAsync(XW_Extension xw_extension,
+                                         XW_HandleDataCallback handle_data) {
+  Extension* extension = GetExtension(xw_extension);
+  CHECK(extension, xw_extension);
+  RETURN_IF_INITIALIZED(extension);
+  extension->handle_data_callback_ = handle_data;
+}
+
+void ExtensionAdapter::DataSetSyncReply(XW_Instance xw_instance, const char* reply,
+                                        uint8_t* buffer, size_t len) {
+  ExtensionInstance* instance = GetExtensionInstance(xw_instance);
+  CHECK(instance, xw_instance);
+  instance->SyncDataReply(reply, buffer, len);
+}
+
+void ExtensionAdapter::DataPostData(XW_Instance xw_instance, const char* message,
+                                    uint8_t* buffer, size_t len) {
+  ExtensionInstance* instance = GetExtensionInstance(xw_instance);
+  CHECK(instance, xw_instance);
+  instance->PostData(message, buffer, len);
+}
+
+} // namespace xwalk
+} // namespace wrt
diff --git a/src/xwalk-module/extension_adapter.h b/src/xwalk-module/extension_adapter.h
new file mode 100755 (executable)
index 0000000..26fd0be
--- /dev/null
@@ -0,0 +1,91 @@
+// Copyright 2014 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.
+
+#ifndef WRT_SERVICE_NODE_EXTENSION_ADAPTER_H_
+#define WRT_SERVICE_NODE_EXTENSION_ADAPTER_H_
+
+#include <map>
+
+#include "XW_Extension.h"
+#include "XW_Extension_SyncMessage.h"
+#include "XW_Extension_EntryPoints.h"
+#include "XW_Extension_Runtime.h"
+#include "XW_Extension_Permissions.h"
+#include "XW_Extension_Data.h"
+
+#include "extension.h"
+
+namespace wrt {
+namespace xwalk {
+
+class ExtensionAdapter {
+ public:
+  static ExtensionAdapter* GetInstance();
+
+  XW_Extension GetNextXWExtension();
+  XW_Instance GetNextXWInstance();
+
+  void RegisterExtension(Extension* extension);
+  void UnregisterExtension(Extension* extension);
+
+  void RegisterInstance(ExtensionInstance* instance);
+  void UnregisterInstance(ExtensionInstance* instance);
+
+  // Returns the correct struct according to interface asked. This is
+  // passed to external extensions in XW_Initialize() call.
+  static const void* GetInterface(const char* name);
+
+  static Extension* GetExtension(XW_Extension xw_extension);
+  static ExtensionInstance* GetExtensionInstance(XW_Instance xw_instance);
+
+ private:
+  ExtensionAdapter();
+  virtual ~ExtensionAdapter();
+
+
+  static void CoreSetExtensionName(XW_Extension xw_extension, const char* name);
+  static void CoreSetJavaScriptAPI(XW_Extension xw_extension,const char* javascript_api);
+  static void CoreRegisterInstanceCallbacks(XW_Extension xw_extension,
+                                     XW_CreatedInstanceCallback created,
+                                     XW_DestroyedInstanceCallback destroyed);
+  static void CoreRegisterShutdownCallback(XW_Extension xw_extension,
+                                    XW_ShutdownCallback shutdown);
+  static void CoreSetInstanceData(XW_Instance xw_instance, void* data);
+  static void* CoreGetInstanceData(XW_Instance xw_instance);
+  static void MessagingRegister(XW_Extension xw_extension, XW_HandleMessageCallback handle_message);
+  static void MessagingPostMessage(XW_Instance xw_instance, const char* message);
+  static void SyncMessagingRegister(XW_Extension xw_extension,
+                             XW_HandleSyncMessageCallback handle_sync_message);
+  static void SyncMessagingSetSyncReply(XW_Instance xw_instance, const char* reply);
+  static void EntryPointsSetExtraJSEntryPoints(XW_Extension xw_extension,
+                                        const char** entry_points);
+  static void RuntimeGetStringVariable(XW_Extension xw_extension,
+                                const char* key,
+                                char* value,
+                                unsigned int value_len);
+  static int PermissionsCheckAPIAccessControl(XW_Extension xw_extension,
+                                       const char* api_name);
+  static int PermissionsRegisterPermissions(XW_Extension xw_extension,
+                                     const char* perm_table);
+  static void DataRegisterSync(XW_Extension xw_extension, XW_HandleDataCallback handle_sync_data);
+  static void DataRegisterAsync(XW_Extension xw_extension, XW_HandleDataCallback handle_data);
+  static void DataSetSyncReply(XW_Instance instance, const char* reply,
+                               uint8_t* buffer, size_t len);
+  static void DataPostData(XW_Instance instance, const char* message,
+                           uint8_t* buffer, size_t len);
+
+  typedef std::map<XW_Extension, Extension*> ExtensionMap;
+  ExtensionMap extension_map_;
+
+  typedef std::map<XW_Instance, ExtensionInstance*> InstanceMap;
+  InstanceMap instance_map_;
+
+  XW_Extension next_xw_extension_;
+  XW_Instance next_xw_instance_;
+};
+
+} // namespace xwalk
+} // namespace wrt
+
+#endif // WRT_SERVICE_NODE_EXTENSION_ADAPTER_H_
diff --git a/src/xwalk-module/extension_manager.cpp b/src/xwalk-module/extension_manager.cpp
new file mode 100755 (executable)
index 0000000..9425f9c
--- /dev/null
@@ -0,0 +1,159 @@
+// Copyright 2014 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.
+
+#include "extension_manager.h"
+
+#include <glob.h>
+#include <dlog.h>
+#include <dpl/log/secure_log.h>
+#include <memory>
+#include <iostream>
+#include <fstream>
+
+#include "runtime_variable_provider.h"
+#include "picojson.h"
+
+
+namespace wrt {
+namespace xwalk {
+
+namespace {
+const char kExtensionDir[] = "/usr/lib/tizen-extensions-crosswalk";
+const char kExtensionPrefix[] = "lib";
+const char kExtensionSuffix[] = ".so";
+const char kExtensionMetadataSuffix[] = ".json";
+
+}
+
+ExtensionManager::ExtensionManager() {
+}
+
+ExtensionManager::~ExtensionManager() {
+}
+
+ExtensionManager* ExtensionManager::GetInstance() {
+  static ExtensionManager self;
+  return &self;
+}
+
+void ExtensionManager::RegisterExtensionsByMetadata(
+    RuntimeVariableProvider* provider, const std::string& metafile_path) {
+  _D("path : [%s]", metafile_path.c_str());
+  std::ifstream metafile(metafile_path.c_str());
+  if (!metafile.is_open()) {
+    LOGE("Can't open plugin metadata file");
+    return;
+  }
+
+  picojson::value metadata;
+  metafile >> metadata;
+  if (metadata.is<picojson::array>()) {
+    auto& plugins = metadata.get<picojson::array>();
+    for (auto plugin = plugins.begin(); plugin != plugins.end(); ++plugin) {
+      if (!plugin->is<picojson::object>())
+        continue;
+
+      std::string name = plugin->get("name").to_str();
+      std::string lib = plugin->get("lib").to_str();
+      if (lib.at(0) != '/') {
+        lib = std::string(kExtensionDir) + "/" + lib;
+      }
+      std::vector<std::string> entries;
+      auto& entry_points_value = plugin->get("entry_points");
+      if (entry_points_value.is<picojson::array>()) {
+        auto& entry_points = entry_points_value.get<picojson::array>();
+        for (auto entry = entry_points.begin(); entry != entry_points.end();
+             ++entry) {
+          entries.push_back(entry->to_str());
+        }
+      } else {
+        LOGE("there is no entry points");
+      }
+      Extension* extension = new Extension(lib, name, entries, provider);
+      RegisterExtension(extension);
+    }
+  } else {
+    LOGE("Not plugin metadata");
+    _E("%s is not plugin metadata", metafile_path.c_str());
+  }
+  metafile.close();
+}
+
+void ExtensionManager::RegisterExtensionsByMetadata(
+    RuntimeVariableProvider* provider) {
+  std::string extension_path(kExtensionDir);
+  extension_path.append("/");
+  extension_path.append("*");
+  extension_path.append(kExtensionMetadataSuffix);
+
+  LOGD("Register Extension directory");
+  _D("path : [%s]", extension_path.c_str());
+
+  glob_t glob_result;
+  glob(extension_path.c_str(), GLOB_TILDE, NULL, &glob_result);
+  for (unsigned int i = 0; i < glob_result.gl_pathc; ++i) {
+    RegisterExtensionsByMetadata(provider, glob_result.gl_pathv[i]);
+  }
+  if (glob_result.gl_pathc == 0) {
+    RegisterExtensionsInDirectory(provider);
+  }
+}
+
+
+void ExtensionManager::RegisterExtensionsInDirectory(RuntimeVariableProvider* provider) {
+  std::string extension_path(kExtensionDir);
+  extension_path.append("/");
+  extension_path.append(kExtensionPrefix);
+  extension_path.append("*");
+  extension_path.append(kExtensionSuffix);
+
+  LOGD("Register Extension directory");
+  _D("path : [%s]", extension_path.c_str());
+
+  glob_t glob_result;
+  glob(extension_path.c_str(), GLOB_TILDE, NULL, &glob_result);
+  for (unsigned int i = 0; i < glob_result.gl_pathc; ++i) {
+    Extension* extension = new Extension(glob_result.gl_pathv[i], provider);
+    if (extension->Initialize()) {
+      RegisterExtension(extension);
+    }
+  }
+}
+
+bool ExtensionManager::RegisterExtension(Extension* extension) {
+  LOGD("========== << RegisterExtension >> ENTER ==========");
+  if (!extension)
+    return false;
+
+  std::string name = extension->name();
+
+  LOGD("Register Extension name : [%s]", name.c_str());
+  if (extension_symbols_.find(name) != extension_symbols_.end()) {
+    LOGW("Ignoring extension with name already registred. '%s'", name.c_str());
+    return false;
+  }
+
+  std::vector<std::string>& entry_points = extension->entry_points();
+  std::vector<std::string>::iterator iter;
+  for (iter = entry_points.begin(); iter != entry_points.end(); ++iter) {
+    if (extension_symbols_.find(*iter) != extension_symbols_.end()) {
+      LOGW("Ignoring extension with entry_point already registred. '%s'", (*iter).c_str());
+      return false;
+    }
+  }
+
+  for (iter = entry_points.begin(); iter != entry_points.end(); ++iter) {
+    extension_symbols_.insert(*iter);
+  }
+
+  extension_symbols_.insert(name);
+  extensions_[name] = extension;
+
+  LOGD("========== << RegisterExtension >> END ==========");
+  return true;
+}
+
+
+} // namespace xwalk
+} // namespace wrt
diff --git a/src/xwalk-module/extension_manager.h b/src/xwalk-module/extension_manager.h
new file mode 100755 (executable)
index 0000000..5181ab4
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright 2014 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.
+
+#ifndef WRT_SERVICE_NODE_EXTENSION_MANAGER_H_
+#define WRT_SERVICE_NODE_EXTENSION_MANAGER_H_
+
+#include <string>
+#include <set>
+#include <map>
+
+#include "XW_Extension.h"
+#include "XW_Extension_SyncMessage.h"
+#include "extension.h"
+
+namespace wrt {
+class RuntimeVariableProvider;
+namespace xwalk {
+
+typedef std::map<std::string, Extension*> ExtensionMap;
+
+class ExtensionManager {
+ public:
+  static ExtensionManager* GetInstance();
+
+  void RegisterExtensionsInDirectory(RuntimeVariableProvider* provider);
+  void RegisterExtensionsByMetadata(RuntimeVariableProvider* provider);
+  void RegisterExtensionsByMetadata(RuntimeVariableProvider* provider,
+                                    const std::string& metafile_path);
+
+
+  ExtensionMap& extensions() {
+    return extensions_;
+  }
+
+ private:
+  ExtensionManager();
+  virtual ~ExtensionManager();
+
+  bool RegisterExtension(Extension* extension);
+
+  ExtensionMap extensions_;
+
+  std::set<std::string> extension_symbols_;
+};
+
+} // namespace xwalk
+} // namespace wrt
+
+#endif // WRT_SERVICE_NODE_EXTENSION_MANAGER_H_
diff --git a/src/xwalk-module/js_utils.cpp b/src/xwalk-module/js_utils.cpp
new file mode 100755 (executable)
index 0000000..b428f61
--- /dev/null
@@ -0,0 +1,189 @@
+// Copyright 2015 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.
+
+#include "js_utils.h"
+#include <dlog.h>
+#include <vector>
+#include <string>
+#include <memory>
+
+template <typename T, size_t N>
+char (&ArraySizeHelper(T (&array)[N]))[N];
+#define arraysize(array) (sizeof(ArraySizeHelper(array)))
+
+
+
+namespace wrt {
+namespace JsUtils {
+
+namespace {
+
+// Templatized backend for StringPrintF/StringAppendF. This does not finalize
+// the va_list, the caller is expected to do that.
+template <class StringType>
+static void StringAppendVT(StringType* dst,
+                           const typename StringType::value_type* format,
+                           va_list ap) {
+    // First try with a small fixed size buffer.
+    // This buffer size should be kept in sync with StringUtilTest.GrowBoundary
+    // and StringUtilTest.StringPrintfBounds.
+    typename StringType::value_type stack_buf[1024];
+
+    va_list ap_copy;
+    va_copy(ap_copy, ap);
+
+    int result = vsnprintf(stack_buf, arraysize(stack_buf), format, ap_copy);
+    va_end(ap_copy);
+
+    if (result >= 0 && result < static_cast<int>(arraysize(stack_buf))) {
+        // It fit.
+        dst->append(stack_buf, result);
+        return;
+    }
+
+    // Repeatedly increase buffer size until it fits.
+    int mem_length = arraysize(stack_buf);
+    while (true) {
+        if (result < 0) {
+            if (errno != 0 && errno != EOVERFLOW)
+                return;
+            // Try doubling the buffer size.
+            mem_length *= 2;
+        } else {
+            // We need exactly "result + 1" characters.
+            mem_length = result + 1;
+        }
+
+        if (mem_length > 32 * 1024 * 1024) {
+            // That should be plenty, don't try anything larger.  This protects
+            // against huge allocations when using vsnprintfT implementations that
+            // return -1 for reasons other than overflow without setting errno.
+            LOGE("Unable to printf the requested string due to size.");
+            return;
+        }
+
+        std::vector<typename StringType::value_type> mem_buf(mem_length);
+
+        // NOTE: You can only use a va_list once.  Since we're in a while loop, we
+        // need to make a new copy each time so we don't use up the original.
+        va_copy(ap_copy, ap);
+        result = vsnprintf(&mem_buf[0], mem_length, format, ap_copy);
+        va_end(ap_copy);
+
+        if ((result >= 0) && (result < mem_length)) {
+            // It fit.
+            dst->append(&mem_buf[0], result);
+            return;
+        }
+    }
+}
+
+std::string StringPrintf(const char* format, ...) {
+    va_list ap;
+    va_start(ap, format);
+    std::string result;
+    StringAppendVT(&result, format, ap);
+    va_end(ap);
+    return result;
+}
+
+}// unamed namespace
+
+JSValueRef ToJSValueRef(JSContextRef ctx, const std::string& str){
+    JSValueRef result = NULL;
+    JSStringRef jsString = JSStringCreateWithUTF8CString(str.c_str());
+    result = JSValueMakeString(ctx, jsString);
+    JSStringRelease(jsString);
+    return result;
+}
+
+void SetProperty(JSContextRef ctx , JSObjectRef object, const char *name, JSValueRef value, JSPropertyAttributes attributes, JSValueRef *exception){
+    JSStringRef propertyName = JSStringCreateWithUTF8CString(name);
+    JSValueRef localException = NULL;
+    JSObjectSetProperty(ctx, object, propertyName, value,attributes, &localException);
+    JSStringRelease(propertyName);
+    if( localException != NULL ){
+        if( exception != NULL )
+            *exception = localException;
+    }
+}
+
+void DeleteProperty(JSContextRef ctx , JSObjectRef object, const char *name, JSValueRef *exception){
+    JSStringRef propertyName = JSStringCreateWithUTF8CString(name);
+    JSValueRef localException = NULL;
+    JSObjectDeleteProperty(ctx, object, propertyName, &localException);
+    JSStringRelease(propertyName);
+    if( localException != NULL ){
+        if( exception != NULL )
+            *exception = localException;
+    }
+}
+
+JSValueRef GetProperty(JSContextRef ctx , JSObjectRef object, const char *name, JSValueRef *exception){
+    JSValueRef value;
+    JSStringRef propertyName = JSStringCreateWithUTF8CString(name);
+    JSValueRef localException = NULL;
+    value = JSObjectGetProperty(ctx, object, propertyName, &localException);
+    JSStringRelease(propertyName);
+
+    if( localException != NULL && exception != NULL){
+        *exception = localException;
+    }
+    return value;
+}
+
+std::string JSValueToString(JSContextRef ctx, JSValueRef value){
+    JSValueRef exception = NULL;
+    JSStringRef str = JSValueToStringCopy(ctx, value, &exception);
+    if (exception != NULL) {
+        return std::string();
+    }
+    size_t jsSize = JSStringGetMaximumUTF8CStringSize(str);
+    std::unique_ptr<char []> buffer(new char[jsSize + 1]);
+    JSStringGetUTF8CString(str, buffer.get(), jsSize + 1);
+    JSStringRelease(str);
+    return std::string(buffer.get());
+}
+
+
+std::string ExceptionToString(JSContextRef ctx, JSValueRef exception) {
+    JSObjectRef obj = JSValueToObject( ctx, exception, NULL);
+    JSStringRef property_name = JSStringCreateWithUTF8CString("message");
+    JSValueRef message = JSObjectGetProperty( ctx, obj, property_name, NULL);
+    JSStringRelease(property_name);
+
+    JSStringRef msg = JSValueToStringCopy( ctx, message, NULL);
+
+    if (msg == NULL) {
+      return std::string();
+    }
+
+    size_t len = JSStringGetLength(msg);
+    std::unique_ptr<char []> buf(new char [len+1]);
+    JSStringGetUTF8CString(msg, buf.get(), len+1);
+    JSStringRelease(msg);
+    return std::string(buf.get());
+}
+
+JSValueRef RunString(JSContextRef ctx, const std::string& code,
+                                std::string* exception) {
+    LOGD("========== << RunString >> ENTER ==========");
+
+    JSStringRef script = JSStringCreateWithUTF8CString(code.c_str());
+    JSValueRef except_value = NULL;
+    JSValueRef ret = JSEvaluateScript(ctx, script, NULL, NULL, 1, &except_value);
+    JSStringRelease(script);
+    if( except_value != NULL ){
+        if( exception )
+            *exception = ExceptionToString(ctx, except_value);
+        return JSValueMakeUndefined(ctx);
+    }
+
+    LOGD("========== << RunString >> END ==========");
+    return ret;
+}
+
+
+}
+}
diff --git a/src/xwalk-module/js_utils.h b/src/xwalk-module/js_utils.h
new file mode 100755 (executable)
index 0000000..1fbf3c3
--- /dev/null
@@ -0,0 +1,30 @@
+// Copyright 2015 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.
+
+#ifndef WRT_XWALK_JS_UTILS_H_
+#define WRT_XWALK_JS_UTILS_H_
+
+#include <string>
+#include <EWebKit.h>
+#include <EWebKit_internal.h>
+#include <JavaScriptCore/JavaScript.h>
+
+
+namespace wrt {
+namespace JsUtils {
+
+JSValueRef ToJSValueRef(JSContextRef ctx, const std::string& str);
+void SetProperty(JSContextRef ctx , JSObjectRef object, const char *name, JSValueRef value, JSPropertyAttributes attributes, JSValueRef *exception);
+void DeleteProperty(JSContextRef ctx , JSObjectRef object, const char *name, JSValueRef *exception);
+JSValueRef GetProperty(JSContextRef ctx , JSObjectRef object, const char *name, JSValueRef *exception);
+std::string JSValueToString(JSContextRef ctx, JSValueRef value);
+std::string ExceptionToString(JSContextRef ctx, JSValueRef exception);
+JSValueRef RunString(JSContextRef ctx, const std::string& code,std::string* exception);
+
+
+}
+}
+
+
+#endif
diff --git a/src/xwalk-module/object_tools_module.cpp b/src/xwalk-module/object_tools_module.cpp
new file mode 100644 (file)
index 0000000..85f55aa
--- /dev/null
@@ -0,0 +1,77 @@
+// Copyright 2015 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.
+
+#include <dlog.h>
+#include "object_tools_module.h"
+#include "js_utils.h"
+#include "JSLifeManager.h"
+#include "xwalk_module_system.h"
+
+extern "C" JSGlobalContextRef JSContextGetGlobalContext(JSContextRef ctx);
+
+
+namespace wrt {
+
+namespace {
+
+JSObjectRef CreateObjectFunctions(JSContextRef context) {
+  const char *code =
+    "(function(object) {"
+    "  var newobject = Object.create(object);"
+    "  Object.getOwnPropertyNames(object).forEach(function(name) {"
+    "    if (object[name] instanceof Function) {"
+    "      newobject[name] = object[name];"
+    "    }"
+    "  });"
+    "  newobject['origin_prototype'] = {};"
+    "  Object.getOwnPropertyNames(object.prototype).forEach(function(name) {"
+    "    if (object.prototype[name] instanceof Function) {"
+    "      newobject['origin_prototype'][name] = object.prototype[name];"
+    "    }"
+    "  });"
+    "  return function() {"
+    "    return newobject;"
+    "  };"
+    "}(Object));";
+
+  std::string exception;
+  JSValueRef ret_value = JsUtils::RunString(context, code, &exception);
+  JSObjectRef ret_object = JSValueToObject(context, ret_value, NULL);
+  if (!JSValueIsObject(context, ret_value) || !JSObjectIsFunction(context, ret_object)) {
+    LOGE("Couldn't get CreateObjectFunctions : %s", exception.c_str());
+    return NULL;
+  }
+  return ret_object;
+}
+
+}  //  namespace
+
+
+ObjectToolsModule::ObjectToolsModule(JSContextRef context) {
+  js_context_ = context;
+  object_function_ = CreateObjectFunctions(js_context_);
+  JSValueSafeProtect(js_context_, object_function_);
+}
+
+ObjectToolsModule::~ObjectToolsModule() {
+  JSValueSafeUnprotect(js_context_, object_function_);
+  js_context_ = NULL;
+}
+
+
+JSObjectRef ObjectToolsModule::NewInstance(JSContextRef context) {
+  JSObjectRef func = object_function_;
+  JSValueRef except_value = NULL;
+  JSValueRef ret_value = JSObjectCallAsFunction(context, func, NULL, 0, NULL, &except_value);
+  if (except_value != NULL) {
+    std::string error = JsUtils::ExceptionToString(context, except_value);
+    LOGE("Error NewInstance : %s", error.c_str());
+  }
+  JSObjectRef objecttools = JSValueToObject(context, ret_value, NULL);
+  return objecttools;
+}
+
+
+}  // namespace wrt
+
diff --git a/src/xwalk-module/object_tools_module.h b/src/xwalk-module/object_tools_module.h
new file mode 100644 (file)
index 0000000..f0cd134
--- /dev/null
@@ -0,0 +1,31 @@
+// Copyright 2015 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.
+
+#ifndef WRT_OBJECT_TOOLS_MODULE_H_
+#define WRT_OBJECT_TOOLS_MODULE_H_
+
+#include <JavaScriptCore/JavaScript.h>
+
+#include "xwalk_module_system.h"
+
+namespace wrt {
+
+// This module provides extra JS functions that help writing JS API code for
+// extensions, for example: allowing setting a read-only property of an object.
+class ObjectToolsModule : public NativeModule {
+ public:
+  ObjectToolsModule(JSContextRef context);
+  ~ObjectToolsModule();
+
+ private:
+  JSObjectRef NewInstance(JSContextRef context);
+
+  JSObjectRef object_function_;
+  JSContextRef js_context_;
+};
+
+}  // namespace wrt
+
+#endif  // WRT_OBJECT_TOOLS_MODULE_H_
+
diff --git a/src/xwalk-module/picojson.h b/src/xwalk-module/picojson.h
new file mode 100644 (file)
index 0000000..9f98319
--- /dev/null
@@ -0,0 +1,1037 @@
+/*
+ * Copyright 2009-2010 Cybozu Labs, Inc.
+ * Copyright 2011 Kazuho Oku
+ * 
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * 
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ * 2. 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.
+ * 
+ * THIS SOFTWARE IS PROVIDED BY CYBOZU LABS, INC. ``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 CYBOZU LABS, INC. 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.
+ * 
+ * The views and conclusions contained in the software and documentation are
+ * those of the authors and should not be interpreted as representing official
+ * policies, either expressed or implied, of Cybozu Labs, Inc.
+ *
+ */
+#ifndef picojson_h
+#define picojson_h
+
+#include <algorithm>
+#include <cassert>
+#include <cmath>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <iostream>
+#include <iterator>
+#include <map>
+#include <string>
+#include <vector>
+
+#ifdef _MSC_VER
+    #define SNPRINTF _snprintf_s
+    #pragma warning(push)
+    #pragma warning(disable : 4244) // conversion from int to char
+#else
+    #define SNPRINTF snprintf
+#endif
+
+namespace picojson {
+  
+  enum {
+    null_type,
+    boolean_type,
+    number_type,
+    string_type,
+    array_type,
+    object_type
+  };
+  
+  struct null {};
+  
+  class value {
+  public:
+    typedef std::vector<value> array;
+    typedef std::map<std::string, value> object;
+    union _storage {
+      bool boolean_;
+      double number_;
+      std::string* string_;
+      array* array_;
+      object* object_;
+    };
+  protected:
+    int type_;
+    _storage u_;
+  public:
+    value();
+    value(int type, bool);
+    explicit value(bool b);
+    explicit value(double n);
+    explicit value(const std::string& s);
+    explicit value(const array& a);
+    explicit value(const object& o);
+    explicit value(const char* s);
+    value(const char* s, size_t len);
+    ~value();
+    value(const value& x);
+    value& operator=(const value& x);
+    void swap(value& x);
+    template <typename T> bool is() const;
+    template <typename T> const T& get() const;
+    template <typename T> T& get();
+    bool evaluate_as_boolean() const;
+    const value& get(size_t idx) const;
+    const value& get(const std::string& key) const;
+    bool contains(size_t idx) const;
+    bool contains(const std::string& key) const;
+    std::string to_str() const;
+    template <typename Iter> void serialize(Iter os) const;
+    std::string serialize() const;
+  private:
+    template <typename T> value(const T*); // intentionally defined to block implicit conversion of pointer to bool
+  };
+  
+  typedef value::array array;
+  typedef value::object object;
+  
+  inline value::value() : type_(null_type) {}
+  
+  inline value::value(int type, bool) : type_(type) {
+    switch (type) {
+#define INIT(p, v) case p##type: u_.p = v; break
+      INIT(boolean_, false);
+      INIT(number_, 0.0);
+      INIT(string_, new std::string());
+      INIT(array_, new array());
+      INIT(object_, new object());
+#undef INIT
+    default: break;
+    }
+  }
+  
+  inline value::value(bool b) : type_(boolean_type) {
+    u_.boolean_ = b;
+  }
+  
+  inline value::value(double n) : type_(number_type) {
+    u_.number_ = n;
+  }
+  
+  inline value::value(const std::string& s) : type_(string_type) {
+    u_.string_ = new std::string(s);
+  }
+  
+  inline value::value(const array& a) : type_(array_type) {
+    u_.array_ = new array(a);
+  }
+  
+  inline value::value(const object& o) : type_(object_type) {
+    u_.object_ = new object(o);
+  }
+  
+  inline value::value(const char* s) : type_(string_type) {
+    u_.string_ = new std::string(s);
+  }
+  
+  inline value::value(const char* s, size_t len) : type_(string_type) {
+    u_.string_ = new std::string(s, len);
+  }
+  
+  inline value::~value() {
+    switch (type_) {
+#define DEINIT(p) case p##type: delete u_.p; break
+      DEINIT(string_);
+      DEINIT(array_);
+      DEINIT(object_);
+#undef DEINIT
+    default: break;
+    }
+  }
+  
+  inline value::value(const value& x) : type_(x.type_) {
+    switch (type_) {
+#define INIT(p, v) case p##type: u_.p = v; break
+      INIT(string_, new std::string(*x.u_.string_));
+      INIT(array_, new array(*x.u_.array_));
+      INIT(object_, new object(*x.u_.object_));
+#undef INIT
+    default:
+      u_ = x.u_;
+      break;
+    }
+  }
+  
+  inline value& value::operator=(const value& x) {
+    if (this != &x) {
+      this->~value();
+      new (this) value(x);
+    }
+    return *this;
+  }
+  
+  inline void value::swap(value& x) {
+    std::swap(type_, x.type_);
+    std::swap(u_, x.u_);
+  }
+  
+#define IS(ctype, jtype)                            \
+  template <> inline bool value::is<ctype>() const { \
+    return type_ == jtype##_type;                   \
+  }
+  IS(null, null)
+  IS(bool, boolean)
+  IS(int, number)
+  IS(double, number)
+  IS(std::string, string)
+  IS(array, array)
+  IS(object, object)
+#undef IS
+  
+#define GET(ctype, var)                                                \
+  template <> inline const ctype& value::get<ctype>() const {  \
+    assert("type mismatch! call vis<type>() before get<type>()" \
+          && is<ctype>());                                     \
+    return var;                                                        \
+  }                                                            \
+  template <> inline ctype& value::get<ctype>() {              \
+    assert("type mismatch! call is<type>() before get<type>()" \
+          && is<ctype>());                                     \
+    return var;                                                        \
+  }
+  GET(bool, u_.boolean_)
+  GET(double, u_.number_)
+  GET(std::string, *u_.string_)
+  GET(array, *u_.array_)
+  GET(object, *u_.object_)
+#undef GET
+  
+  inline bool value::evaluate_as_boolean() const {
+    switch (type_) {
+    case null_type:
+      return false;
+    case boolean_type:
+      return u_.boolean_;
+    case number_type:
+      return u_.number_ != 0;
+    case string_type:
+      return ! u_.string_->empty();
+    default:
+      return true;
+    }
+  }
+  
+  inline const value& value::get(size_t idx) const {
+    static value s_null;
+    assert(is<array>());
+    return idx < u_.array_->size() ? (*u_.array_)[idx] : s_null;
+  }
+
+  inline const value& value::get(const std::string& key) const {
+    static value s_null;
+    assert(is<object>());
+    object::const_iterator i = u_.object_->find(key);
+    return i != u_.object_->end() ? i->second : s_null;
+  }
+
+  inline bool value::contains(size_t idx) const {
+    assert(is<array>());
+    return idx < u_.array_->size();
+  }
+
+  inline bool value::contains(const std::string& key) const {
+    assert(is<object>());
+    object::const_iterator i = u_.object_->find(key);
+    return i != u_.object_->end();
+  }
+  
+  inline std::string value::to_str() const {
+    switch (type_) {
+    case null_type:      return "null";
+    case boolean_type:   return u_.boolean_ ? "true" : "false";
+    case number_type:    {
+      char buf[256];
+      double tmp;
+      SNPRINTF(buf, sizeof(buf), fabs(u_.number_) < (1ULL << 53) && modf(u_.number_, &tmp) == 0 ? "%.f" : "%.17g", u_.number_);
+      return buf;
+    }
+    case string_type:    return *u_.string_;
+    case array_type:     return "array";
+    case object_type:    return "object";
+    default:             assert(0);
+#ifdef _MSC_VER
+      __assume(0);
+#endif
+    }
+    return std::string();
+  }
+  
+  template <typename Iter> void copy(const std::string& s, Iter oi) {
+    std::copy(s.begin(), s.end(), oi);
+  }
+  
+  template <typename Iter> void serialize_str(const std::string& s, Iter oi) {
+    *oi++ = '"';
+    for (std::string::const_iterator i = s.begin(); i != s.end(); ++i) {
+      switch (*i) {
+#define MAP(val, sym) case val: copy(sym, oi); break
+       MAP('"', "\\\"");
+       MAP('\\', "\\\\");
+       MAP('/', "\\/");
+       MAP('\b', "\\b");
+       MAP('\f', "\\f");
+       MAP('\n', "\\n");
+       MAP('\r', "\\r");
+       MAP('\t', "\\t");
+#undef MAP
+      default:
+       if ((unsigned char)*i < 0x20 || *i == 0x7f) {
+         char buf[7];
+         SNPRINTF(buf, sizeof(buf), "\\u%04x", *i & 0xff);
+         copy(buf, buf + 6, oi);
+         } else {
+         *oi++ = *i;
+       }
+       break;
+      }
+    }
+    *oi++ = '"';
+  }
+  
+  template <typename Iter> void value::serialize(Iter oi) const {
+    switch (type_) {
+    case string_type:
+      serialize_str(*u_.string_, oi);
+      break;
+    case array_type: {
+      *oi++ = '[';
+      for (array::const_iterator i = u_.array_->begin();
+           i != u_.array_->end();
+           ++i) {
+       if (i != u_.array_->begin()) {
+         *oi++ = ',';
+       }
+       i->serialize(oi);
+      }
+      *oi++ = ']';
+      break;
+    }
+    case object_type: {
+      *oi++ = '{';
+      for (object::const_iterator i = u_.object_->begin();
+          i != u_.object_->end();
+          ++i) {
+       if (i != u_.object_->begin()) {
+         *oi++ = ',';
+       }
+       serialize_str(i->first, oi);
+       *oi++ = ':';
+       i->second.serialize(oi);
+      }
+      *oi++ = '}';
+      break;
+    }
+    default:
+      copy(to_str(), oi);
+      break;
+    }
+  }
+  
+  inline std::string value::serialize() const {
+    std::string s;
+    serialize(std::back_inserter(s));
+    return s;
+  }
+  
+  template <typename Iter> class input {
+  protected:
+    Iter cur_, end_;
+    int last_ch_;
+    bool ungot_;
+    int line_;
+  public:
+    input(const Iter& first, const Iter& last) : cur_(first), end_(last), last_ch_(-1), ungot_(false), line_(1) {}
+    int getc() {
+      if (ungot_) {
+       ungot_ = false;
+       return last_ch_;
+      }
+      if (cur_ == end_) {
+       last_ch_ = -1;
+       return -1;
+      }
+      if (last_ch_ == '\n') {
+       line_++;
+      }
+      last_ch_ = *cur_++ & 0xff;
+      return last_ch_;
+    }
+    void ungetc() {
+      if (last_ch_ != -1) {
+       assert(! ungot_);
+       ungot_ = true;
+      }
+    }
+    Iter cur() const { return cur_; }
+    int line() const { return line_; }
+    void skip_ws() {
+      while (1) {
+       int ch = getc();
+       if (! (ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r')) {
+         ungetc();
+         break;
+       }
+      }
+    }
+    bool expect(int expect) {
+      skip_ws();
+      if (getc() != expect) {
+       ungetc();
+       return false;
+      }
+      return true;
+    }
+    bool match(const std::string& pattern) {
+      for (std::string::const_iterator pi(pattern.begin());
+          pi != pattern.end();
+          ++pi) {
+       if (getc() != *pi) {
+         ungetc();
+         return false;
+       }
+      }
+      return true;
+    }
+  };
+  
+  template<typename Iter> inline int _parse_quadhex(input<Iter> &in) {
+    int uni_ch = 0, hex;
+    for (int i = 0; i < 4; i++) {
+      if ((hex = in.getc()) == -1) {
+       return -1;
+      }
+      if ('0' <= hex && hex <= '9') {
+       hex -= '0';
+      } else if ('A' <= hex && hex <= 'F') {
+       hex -= 'A' - 0xa;
+      } else if ('a' <= hex && hex <= 'f') {
+       hex -= 'a' - 0xa;
+      } else {
+       in.ungetc();
+       return -1;
+      }
+      uni_ch = uni_ch * 16 + hex;
+    }
+    return uni_ch;
+  }
+  
+  template<typename String, typename Iter> inline bool _parse_codepoint(String& out, input<Iter>& in) {
+    int uni_ch;
+    if ((uni_ch = _parse_quadhex(in)) == -1) {
+      return false;
+    }
+    if (0xd800 <= uni_ch && uni_ch <= 0xdfff) {
+      if (0xdc00 <= uni_ch) {
+       // a second 16-bit of a surrogate pair appeared
+       return false;
+      }
+      // first 16-bit of surrogate pair, get the next one
+      if (in.getc() != '\\' || in.getc() != 'u') {
+       in.ungetc();
+       return false;
+      }
+      int second = _parse_quadhex(in);
+      if (! (0xdc00 <= second && second <= 0xdfff)) {
+       return false;
+      }
+      uni_ch = ((uni_ch - 0xd800) << 10) | ((second - 0xdc00) & 0x3ff);
+      uni_ch += 0x10000;
+    }
+    if (uni_ch < 0x80) {
+      out.push_back(uni_ch);
+    } else {
+      if (uni_ch < 0x800) {
+       out.push_back(0xc0 | (uni_ch >> 6));
+      } else {
+       if (uni_ch < 0x10000) {
+         out.push_back(0xe0 | (uni_ch >> 12));
+       } else {
+         out.push_back(0xf0 | (uni_ch >> 18));
+         out.push_back(0x80 | ((uni_ch >> 12) & 0x3f));
+       }
+       out.push_back(0x80 | ((uni_ch >> 6) & 0x3f));
+      }
+      out.push_back(0x80 | (uni_ch & 0x3f));
+    }
+    return true;
+  }
+  
+  template<typename String, typename Iter> inline bool _parse_string(String& out, input<Iter>& in) {
+    while (1) {
+      int ch = in.getc();
+      if (ch < ' ') {
+       in.ungetc();
+       return false;
+      } else if (ch == '"') {
+       return true;
+      } else if (ch == '\\') {
+       if ((ch = in.getc()) == -1) {
+         return false;
+       }
+       switch (ch) {
+#define MAP(sym, val) case sym: out.push_back(val); break
+         MAP('"', '\"');
+         MAP('\\', '\\');
+         MAP('/', '/');
+         MAP('b', '\b');
+         MAP('f', '\f');
+         MAP('n', '\n');
+         MAP('r', '\r');
+         MAP('t', '\t');
+#undef MAP
+       case 'u':
+         if (! _parse_codepoint(out, in)) {
+           return false;
+         }
+         break;
+       default:
+         return false;
+       }
+      } else {
+       out.push_back(ch);
+      }
+    }
+    return false;
+  }
+  
+  template <typename Context, typename Iter> inline bool _parse_array(Context& ctx, input<Iter>& in) {
+    if (! ctx.parse_array_start()) {
+      return false;
+    }
+    if (in.expect(']')) {
+      return true;
+    }
+    size_t idx = 0;
+    do {
+      if (! ctx.parse_array_item(in, idx)) {
+       return false;
+      }
+      idx++;
+    } while (in.expect(','));
+    return in.expect(']');
+  }
+  
+  template <typename Context, typename Iter> inline bool _parse_object(Context& ctx, input<Iter>& in) {
+    if (! ctx.parse_object_start()) {
+      return false;
+    }
+    if (in.expect('}')) {
+      return true;
+    }
+    do {
+      std::string key;
+      if (! in.expect('"')
+         || ! _parse_string(key, in)
+         || ! in.expect(':')) {
+       return false;
+      }
+      if (! ctx.parse_object_item(in, key)) {
+       return false;
+      }
+    } while (in.expect(','));
+    return in.expect('}');
+  }
+  
+  template <typename Iter> inline bool _parse_number(double& out, input<Iter>& in) {
+    std::string num_str;
+    while (1) {
+      int ch = in.getc();
+      if (('0' <= ch && ch <= '9') || ch == '+' || ch == '-' || ch == '.'
+         || ch == 'e' || ch == 'E') {
+       num_str.push_back(ch);
+      } else {
+       in.ungetc();
+       break;
+      }
+    }
+    char* endp;
+    out = strtod(num_str.c_str(), &endp);
+    return endp == num_str.c_str() + num_str.size();
+  }
+  
+  template <typename Context, typename Iter> inline bool _parse(Context& ctx, input<Iter>& in) {
+    in.skip_ws();
+    int ch = in.getc();
+    switch (ch) {
+#define IS(ch, text, op) case ch: \
+      if (in.match(text) && op) { \
+       return true; \
+      } else { \
+       return false; \
+      }
+      IS('n', "ull", ctx.set_null());
+      IS('f', "alse", ctx.set_bool(false));
+      IS('t', "rue", ctx.set_bool(true));
+#undef IS
+    case '"':
+      return ctx.parse_string(in);
+    case '[':
+      return _parse_array(ctx, in);
+    case '{':
+      return _parse_object(ctx, in);
+    default:
+      if (('0' <= ch && ch <= '9') || ch == '-') {
+       in.ungetc();
+       double f;
+       if (_parse_number(f, in)) {
+         ctx.set_number(f);
+         return true;
+       } else {
+         return false;
+       }
+      }
+      break;
+    }
+    in.ungetc();
+    return false;
+  }
+  
+  class deny_parse_context {
+  public:
+    bool set_null() { return false; }
+    bool set_bool(bool) { return false; }
+    bool set_number(double) { return false; }
+    template <typename Iter> bool parse_string(input<Iter>&) { return false; }
+    bool parse_array_start() { return false; }
+    template <typename Iter> bool parse_array_item(input<Iter>&, size_t) {
+      return false;
+    }
+    bool parse_object_start() { return false; }
+    template <typename Iter> bool parse_object_item(input<Iter>&, const std::string&) {
+      return false;
+    }
+  };
+  
+  class default_parse_context {
+  protected:
+    value* out_;
+  public:
+    default_parse_context(value* out) : out_(out) {}
+    bool set_null() {
+      *out_ = value();
+      return true;
+    }
+    bool set_bool(bool b) {
+      *out_ = value(b);
+      return true;
+    }
+    bool set_number(double f) {
+      *out_ = value(f);
+      return true;
+    }
+    template<typename Iter> bool parse_string(input<Iter>& in) {
+      *out_ = value(string_type, false);
+      return _parse_string(out_->get<std::string>(), in);
+    }
+    bool parse_array_start() {
+      *out_ = value(array_type, false);
+      return true;
+    }
+    template <typename Iter> bool parse_array_item(input<Iter>& in, size_t) {
+      array& a = out_->get<array>();
+      a.push_back(value());
+      default_parse_context ctx(&a.back());
+      return _parse(ctx, in);
+    }
+    bool parse_object_start() {
+      *out_ = value(object_type, false);
+      return true;
+    }
+    template <typename Iter> bool parse_object_item(input<Iter>& in, const std::string& key) {
+      object& o = out_->get<object>();
+      default_parse_context ctx(&o[key]);
+      return _parse(ctx, in);
+    }
+  private:
+    default_parse_context(const default_parse_context&);
+    default_parse_context& operator=(const default_parse_context&);
+  };
+
+  class null_parse_context {
+  public:
+    struct dummy_str {
+      void push_back(int) {}
+    };
+  public:
+    null_parse_context() {}
+    bool set_null() { return true; }
+    bool set_bool(bool) { return true; }
+    bool set_number(double) { return true; }
+    template <typename Iter> bool parse_string(input<Iter>& in) {
+      dummy_str s;
+      return _parse_string(s, in);
+    }
+    bool parse_array_start() { return true; }
+    template <typename Iter> bool parse_array_item(input<Iter>& in, size_t) {
+      return _parse(*this, in);
+    }
+    bool parse_object_start() { return true; }
+    template <typename Iter> bool parse_object_item(input<Iter>& in, const std::string&) {
+      return _parse(*this, in);
+    }
+  private:
+    null_parse_context(const null_parse_context&);
+    null_parse_context& operator=(const null_parse_context&);
+  };
+  
+  // obsolete, use the version below
+  template <typename Iter> inline std::string parse(value& out, Iter& pos, const Iter& last) {
+    std::string err;
+    pos = parse(out, pos, last, &err);
+    return err;
+  }
+  
+  template <typename Context, typename Iter> inline Iter _parse(Context& ctx, const Iter& first, const Iter& last, std::string* err) {
+    input<Iter> in(first, last);
+    if (! _parse(ctx, in) && err != NULL) {
+      char buf[64];
+      SNPRINTF(buf, sizeof(buf), "syntax error at line %d near: ", in.line());
+      *err = buf;
+      while (1) {
+       int ch = in.getc();
+       if (ch == -1 || ch == '\n') {
+         break;
+       } else if (ch >= ' ') {
+         err->push_back(ch);
+       }
+      }
+    }
+    return in.cur();
+  }
+  
+  template <typename Iter> inline Iter parse(value& out, const Iter& first, const Iter& last, std::string* err) {
+    default_parse_context ctx(&out);
+    return _parse(ctx, first, last, err);
+  }
+  
+  inline std::string parse(value& out, std::istream& is) {
+    std::string err;
+    parse(out, std::istreambuf_iterator<char>(is.rdbuf()),
+         std::istreambuf_iterator<char>(), &err);
+    return err;
+  }
+  
+  template <typename T> struct last_error_t {
+    static std::string s;
+  };
+  template <typename T> std::string last_error_t<T>::s;
+  
+  inline void set_last_error(const std::string& s) {
+    last_error_t<bool>::s = s;
+  }
+  
+  inline const std::string& get_last_error() {
+    return last_error_t<bool>::s;
+  }
+
+  inline bool operator==(const value& x, const value& y) {
+    if (x.is<null>())
+      return y.is<null>();
+#define PICOJSON_CMP(type)                                     \
+    if (x.is<type>())                                          \
+      return y.is<type>() && x.get<type>() == y.get<type>()
+    PICOJSON_CMP(bool);
+    PICOJSON_CMP(double);
+    PICOJSON_CMP(std::string);
+    PICOJSON_CMP(array);
+    PICOJSON_CMP(object);
+#undef PICOJSON_CMP
+    assert(0);
+#ifdef _MSC_VER
+    __assume(0);
+#endif
+    return false;
+  }
+  
+  inline bool operator!=(const value& x, const value& y) {
+    return ! (x == y);
+  }
+}
+
+namespace std {
+  template<> inline void swap(picojson::value& x, picojson::value& y)
+    {
+      x.swap(y);
+    }
+}
+
+inline std::istream& operator>>(std::istream& is, picojson::value& x)
+{
+  picojson::set_last_error(std::string());
+  std::string err = picojson::parse(x, is);
+  if (! err.empty()) {
+    picojson::set_last_error(err);
+    is.setstate(std::ios::failbit);
+  }
+  return is;
+}
+
+inline std::ostream& operator<<(std::ostream& os, const picojson::value& x)
+{
+  x.serialize(std::ostream_iterator<char>(os));
+  return os;
+}
+#ifdef _MSC_VER
+    #pragma warning(pop)
+#endif
+
+#endif
+#ifdef TEST_PICOJSON
+#ifdef _MSC_VER
+    #pragma warning(disable : 4127) // conditional expression is constant
+#endif
+
+using namespace std;
+  
+static void plan(int num)
+{
+  printf("1..%d\n", num);
+}
+
+static bool success = true;
+
+static void ok(bool b, const char* name = "")
+{
+  static int n = 1;
+  if (! b)
+    success = false;
+  printf("%s %d - %s\n", b ? "ok" : "ng", n++, name);
+}
+
+template <typename T> void is(const T& x, const T& y, const char* name = "")
+{
+  if (x == y) {
+    ok(true, name);
+  } else {
+    ok(false, name);
+  }
+}
+
+#include <algorithm>
+#include <sstream>
+#include <float.h>
+#include <limits.h>
+
+int main(void)
+{
+  plan(85);
+
+  // constructors
+#define TEST(expr, expected) \
+    is(picojson::value expr .serialize(), string(expected), "picojson::value" #expr)
+  
+  TEST( (true),  "true");
+  TEST( (false), "false");
+  TEST( (42.0),   "42");
+  TEST( (string("hello")), "\"hello\"");
+  TEST( ("hello"), "\"hello\"");
+  TEST( ("hello", 4), "\"hell\"");
+
+  {
+    double a = 1;
+    for (int i = 0; i < 1024; i++) {
+      picojson::value vi(a);
+      std::stringstream ss;
+      ss << vi;
+      picojson::value vo;
+      ss >> vo;
+      double b = vo.get<double>();
+      if ((i < 53 && a != b) || fabs(a - b) / b > 1e-8) {
+        printf("ng i=%d a=%.18e b=%.18e\n", i, a, b);
+      }
+      a *= 2;
+    }
+  }
+  
+#undef TEST
+  
+#define TEST(in, type, cmp, serialize_test) {                          \
+    picojson::value v;                                                 \
+    const char* s = in;                                                        \
+    string err = picojson::parse(v, s, s + strlen(s));                 \
+    ok(err.empty(), in " no error");                                   \
+    ok(v.is<type>(), in " check type");                                        \
+    is<type>(v.get<type>(), cmp, in " correct output");                        \
+    is(*s, '\0', in " read to eof");                                   \
+    if (serialize_test) {                                              \
+      is(v.serialize(), string(in), in " serialize");                  \
+    }                                                                  \
+  }
+  TEST("false", bool, false, true);
+  TEST("true", bool, true, true);
+  TEST("90.5", double, 90.5, false);
+  TEST("1.7976931348623157e+308", double, DBL_MAX, false);
+  TEST("\"hello\"", string, string("hello"), true);
+  TEST("\"\\\"\\\\\\/\\b\\f\\n\\r\\t\"", string, string("\"\\/\b\f\n\r\t"),
+       true);
+  TEST("\"\\u0061\\u30af\\u30ea\\u30b9\"", string,
+       string("a\xe3\x82\xaf\xe3\x83\xaa\xe3\x82\xb9"), false);
+  TEST("\"\\ud840\\udc0b\"", string, string("\xf0\xa0\x80\x8b"), false);
+#undef TEST
+
+#define TEST(type, expr) {                                            \
+    picojson::value v;                                                \
+    const char *s = expr;                                             \
+    string err = picojson::parse(v, s, s + strlen(s));                \
+    ok(err.empty(), "empty " #type " no error");                      \
+    ok(v.is<picojson::type>(), "empty " #type " check type");         \
+    ok(v.get<picojson::type>().empty(), "check " #type " array size"); \
+  }
+  TEST(array, "[]");
+  TEST(object, "{}");
+#undef TEST
+  
+  {
+    picojson::value v;
+    const char *s = "[1,true,\"hello\"]";
+    string err = picojson::parse(v, s, s + strlen(s));
+    ok(err.empty(), "array no error");
+    ok(v.is<picojson::array>(), "array check type");
+    is(v.get<picojson::array>().size(), size_t(3), "check array size");
+    ok(v.contains(0), "check contains array[0]");
+    ok(v.get(0).is<double>(), "check array[0] type");
+    is(v.get(0).get<double>(), 1.0, "check array[0] value");
+    ok(v.contains(1), "check contains array[1]");
+    ok(v.get(1).is<bool>(), "check array[1] type");
+    ok(v.get(1).get<bool>(), "check array[1] value");
+    ok(v.contains(2), "check contains array[2]");
+    ok(v.get(2).is<string>(), "check array[2] type");
+    is(v.get(2).get<string>(), string("hello"), "check array[2] value");
+    ok(!v.contains(3), "check not contains array[3]");
+  }
+  
+  {
+    picojson::value v;
+    const char *s = "{ \"a\": true }";
+    string err = picojson::parse(v, s, s + strlen(s));
+    ok(err.empty(), "object no error");
+    ok(v.is<picojson::object>(), "object check type");
+    is(v.get<picojson::object>().size(), size_t(1), "check object size");
+    ok(v.contains("a"), "check contains property");
+    ok(v.get("a").is<bool>(), "check bool property exists");
+    is(v.get("a").get<bool>(), true, "check bool property value");
+    is(v.serialize(), string("{\"a\":true}"), "serialize object");
+    ok(!v.contains("z"), "check not contains property");
+  }
+
+#define TEST(json, msg) do {                           \
+    picojson::value v;                                 \
+    const char *s = json;                              \
+    string err = picojson::parse(v, s, s + strlen(s)); \
+    is(err, string("syntax error at line " msg), msg); \
+  } while (0)
+  TEST("falsoa", "1 near: oa");
+  TEST("{]", "1 near: ]");
+  TEST("\n\bbell", "2 near: bell");
+  TEST("\"abc\nd\"", "1 near: ");
+#undef TEST
+  
+  {
+    picojson::value v1, v2;
+    const char *s;
+    string err;
+    s = "{ \"b\": true, \"a\": [1,2,\"three\"], \"d\": 2 }";
+    err = picojson::parse(v1, s, s + strlen(s));
+    s = "{ \"d\": 2.0, \"b\": true, \"a\": [1,2,\"three\"] }";
+    err = picojson::parse(v2, s, s + strlen(s));
+    ok((v1 == v2), "check == operator in deep comparison");
+  }
+
+  {
+    picojson::value v1, v2;
+    const char *s;
+    string err;
+    s = "{ \"b\": true, \"a\": [1,2,\"three\"], \"d\": 2 }";
+    err = picojson::parse(v1, s, s + strlen(s));
+    s = "{ \"d\": 2.0, \"a\": [1,\"three\"], \"b\": true }";
+    err = picojson::parse(v2, s, s + strlen(s));
+    ok((v1 != v2), "check != operator for array in deep comparison");
+  }
+
+  {
+    picojson::value v1, v2;
+    const char *s;
+    string err;
+    s = "{ \"b\": true, \"a\": [1,2,\"three\"], \"d\": 2 }";
+    err = picojson::parse(v1, s, s + strlen(s));
+    s = "{ \"d\": 2.0, \"a\": [1,2,\"three\"], \"b\": false }";
+    err = picojson::parse(v2, s, s + strlen(s));
+    ok((v1 != v2), "check != operator for object in deep comparison");
+  }
+
+  {
+    picojson::value v1, v2;
+    const char *s;
+    string err;
+    s = "{ \"b\": true, \"a\": [1,2,\"three\"], \"d\": 2 }";
+    err = picojson::parse(v1, s, s + strlen(s));
+    picojson::object& o = v1.get<picojson::object>();
+    o.erase("b");
+    picojson::array& a = o["a"].get<picojson::array>();
+    picojson::array::iterator i;
+    i = std::remove(a.begin(), a.end(), picojson::value(std::string("three")));
+    a.erase(i, a.end());
+    s = "{ \"a\": [1,2], \"d\": 2 }";
+    err = picojson::parse(v2, s, s + strlen(s));
+    ok((v1 == v2), "check erase()");
+  }
+
+  ok(picojson::value(3.0).serialize() == "3",
+     "integral number should be serialized as a integer");
+  
+  {
+    const char* s = "{ \"a\": [1,2], \"d\": 2 }";
+    picojson::null_parse_context ctx;
+    string err;
+    picojson::_parse(ctx, s, s + strlen(s), &err);
+    ok(err.empty(), "null_parse_context");
+  }
+  
+  {
+    picojson::value v1, v2;
+    v1 = picojson::value(true);
+    swap(v1, v2);
+    ok(v1.is<picojson::null>(), "swap (null)");
+    ok(v2.get<bool>() == true, "swap (bool)");
+
+    v1 = picojson::value("a");
+    v2 = picojson::value(1.0);
+    swap(v1, v2);
+    ok(v1.get<double>() == 1.0, "swap (dobule)");
+    ok(v2.get<string>() == "a", "swap (string)");
+
+    v1 = picojson::value(picojson::object());
+    v2 = picojson::value(picojson::array());
+    swap(v1, v2);
+    ok(v1.is<picojson::array>(), "swap (array)");
+    ok(v2.is<picojson::object>(), "swap (object)");
+  }
+  
+  return success ? 0 : 1;
+}
+
+#endif
diff --git a/src/xwalk-module/runtime_variable_provider.h b/src/xwalk-module/runtime_variable_provider.h
new file mode 100755 (executable)
index 0000000..ae3051d
--- /dev/null
@@ -0,0 +1,14 @@
+#ifndef WRT_RUNTIME_VARIABLE_PROVIDER_H_
+#define WRT_RUNTIME_VARIABLE_PROVIDER_H_
+
+#include <string>
+
+namespace wrt{
+class RuntimeVariableProvider{
+public:
+    virtual const std::string GetRuntimeVariable(const std::string& key) const = 0;
+    virtual void UpdateRuntimeVariable(const std::string& key, const std::string& value) = 0;
+};
+}
+
+#endif //WRT_RUNTIME_VARIABLE_PROVIDER_H_
diff --git a/src/xwalk-module/xwalk_extension_client.cpp b/src/xwalk-module/xwalk_extension_client.cpp
new file mode 100755 (executable)
index 0000000..a92fc77
--- /dev/null
@@ -0,0 +1,134 @@
+
+#include <dlog.h>
+#include "xwalk_extension_client.h"
+
+#include "extension_adapter.h"
+#include "extension_manager.h"
+
+#define RETURN_IF_NULL(x) \
+  do { \
+    if(!x){ \
+        LOGW("%s is NULL", #x); \
+    } \
+  }while(0)
+
+using namespace wrt::xwalk;
+
+namespace wrt {
+
+
+void XWalkExtensionClient::ListenerAdapter::PostMessageToJS(const std::string& msg){
+  if (handler_)
+    handler_->HandleMessageFromNative(msg);
+}
+
+void XWalkExtensionClient::ListenerAdapter::PostDataToJS(const std::string& msg, uint8_t* buffer, size_t len) {
+  if (handler_)
+    handler_->HandleMessageFromNative(msg, buffer, len);
+}
+
+XWalkExtensionClient::XWalkExtensionClient() {
+}
+
+XWalkExtensionClient::~XWalkExtensionClient() {
+  for (auto itr = extension_apis_.begin(); itr != extension_apis_.end(); ++itr) {
+      delete itr->second;
+  }
+}
+
+XWalkExtensionClient::ExtensionCodePoints::ExtensionCodePoints(
+    Extension* extension) : extension_(extension) {
+  entry_points_ = extension->entry_points();
+}
+
+XWalkExtensionClient::ExtensionCodePoints::~ExtensionCodePoints() {
+}
+
+std::string XWalkExtensionClient::ExtensionCodePoints::api() {
+  return extension_->javascript_api();
+}
+
+int64_t XWalkExtensionClient::CreateInstance(const std::string& extension_name, InstanceHandler* handler) {
+    LOGD("Extension CreateInstance: [%s]", extension_name.c_str());
+
+    ExtensionMap& map = ExtensionManager::GetInstance()->extensions();
+    if (map.find(extension_name) == map.end()) {
+        LOGE("Can't find extension name %s", extension_name.c_str());
+        return 0;
+    }
+
+    Extension* extention = map[extension_name];
+    ExtensionInstance *instance = extention->CreateInstance();
+    std::shared_ptr<ListenerAdapter> listener(new ListenerAdapter(handler));
+    instance->set_post_message_listener(listener.get());
+    instance->set_post_data_listener(listener.get());
+
+    ExtensionAdapter::GetInstance()->RegisterInstance(instance);
+    int64_t instance_id = instance->xw_instance();
+    listeners_[instance_id] = listener;
+    return instance_id;
+}
+
+void XWalkExtensionClient::DestroyInstance(int64_t instance_id) {
+    ExtensionInstance* instance = ExtensionAdapter::GetExtensionInstance(instance_id);
+    RETURN_IF_NULL(instance);
+    listeners_[instance_id].reset();
+    listeners_.erase(instance_id);
+    delete instance;
+}
+
+void XWalkExtensionClient::PostMessageToNative(int64_t instance_id, const std::string& msg) {
+    ExtensionInstance* instance = ExtensionAdapter::GetExtensionInstance(instance_id);
+    RETURN_IF_NULL(instance);
+    instance->HandleMessage(msg);
+}
+
+void XWalkExtensionClient::PostMessageToNative(int64_t instance_id, const std::string& msg, unsigned char* buffer, std::size_t len) {
+    ExtensionInstance* instance = ExtensionAdapter::GetExtensionInstance(instance_id);
+    RETURN_IF_NULL(instance);
+    instance->HandleData(msg, buffer, len);
+}
+
+std::string XWalkExtensionClient::SendSyncMessageToNative(int64_t instance_id, const std::string& msg) {
+    ExtensionInstance* instance = ExtensionAdapter::GetExtensionInstance(instance_id);
+    RETURN_IF_NULL(instance);
+    instance->HandleSyncMessage(msg);
+    return instance->sync_replay_msg();
+}
+
+std::string XWalkExtensionClient::SendSyncMessageToNative(int64_t instance_id,
+                                                          const std::string& msg,
+                                                          unsigned char* buffer,
+                                                          std::size_t len,
+                                                          unsigned char** outbuffer,
+                                                          std::size_t* outlen) {
+    ExtensionInstance* instance = ExtensionAdapter::GetExtensionInstance(instance_id);
+    RETURN_IF_NULL(instance);
+    instance->HandleSyncData(msg, buffer, len);
+    return instance->sync_data_reply_msg(outbuffer, outlen);
+}
+
+
+void XWalkExtensionClient::Initialize() {
+    LOGD("========== << Initialize >> ENTER ==========");
+    extension_apis_.clear();
+    ExtensionManager::GetInstance()->RegisterExtensionsByMetadata(this);
+    ExtensionMap& map = ExtensionManager::GetInstance()->extensions();
+    for (auto itr = map.begin(); itr != map.end(); ++itr) {
+        std::string name = itr->first;
+        Extension* extension = itr->second;
+        ExtensionCodePoints* code = new ExtensionCodePoints(extension);
+        extension_apis_.insert(std::make_pair(name, code));
+    }
+    LOGD("========== << Initialize >> END ==========");
+}
+
+const std::string XWalkExtensionClient::GetRuntimeVariable(const std::string& key) const{
+    return rv_map_[key];
+}
+
+void XWalkExtensionClient::UpdateRuntimeVariable(const std::string& key, const std::string& value){
+    rv_map_[key] = value;
+}
+
+} // WRT
diff --git a/src/xwalk-module/xwalk_extension_client.h b/src/xwalk-module/xwalk_extension_client.h
new file mode 100755 (executable)
index 0000000..3a0e3cd
--- /dev/null
@@ -0,0 +1,89 @@
+#ifndef WRT_XWALK_EXTENSION_CLIENT_H_
+#define WRT_XWALK_EXTENSION_CLIENT_H_
+
+#include <string>
+#include <memory>
+#include <map>
+#include <vector>
+#include "runtime_variable_provider.h"
+#include "extension.h"
+
+namespace wrt {
+
+namespace xwalk {
+    class PostMessageListener;
+    class Extension;
+}
+
+class XWalkExtensionClient : public RuntimeVariableProvider{
+public:
+    struct InstanceHandler {
+        virtual void HandleMessageFromNative(const std::string& msg) = 0;
+        virtual void HandleMessageFromNative(const std::string& msg, unsigned char* buffer, std::size_t len) = 0;
+    protected:
+        ~InstanceHandler() {}
+    };
+
+    XWalkExtensionClient();
+    virtual ~XWalkExtensionClient();
+
+
+    int64_t CreateInstance(const std::string& extension_name,
+                    InstanceHandler* handler);
+    void DestroyInstance(int64_t instance_id);
+
+    void PostMessageToNative(int64_t instance_id, const std::string& msg);
+    void PostMessageToNative(int64_t instance_id, const std::string& msg, unsigned char* buffer, std::size_t len);
+    std::string SendSyncMessageToNative(int64_t instance_id, const std::string& msg);
+    std::string SendSyncMessageToNative(int64_t instance_id,
+                                        const std::string& msg,
+                                        unsigned char* buffer,
+                                        std::size_t len,
+                                        unsigned char** outbuffer,
+                                        std::size_t* outlen);
+
+    void Initialize();
+
+    class ExtensionCodePoints {
+      public:
+        ExtensionCodePoints(xwalk::Extension* extension);
+        ~ExtensionCodePoints();
+        std::string api();
+        const std::vector<std::string>& entry_points() const {
+          return entry_points_;
+        }
+      private:
+        std::string api_;
+        std::vector<std::string> entry_points_;
+        xwalk::Extension* extension_;
+    };
+
+    class ListenerAdapter : public wrt::xwalk::PostMessageListener, public wrt::xwalk::PostDataListener {
+    public:
+        ListenerAdapter(XWalkExtensionClient::InstanceHandler* handler) : handler_(handler) {}
+        ~ListenerAdapter(){};
+        virtual void PostMessageToJS(const std::string& msg);
+        virtual void PostDataToJS(const std::string& msg, uint8_t* buffer, size_t len);
+    private:
+        XWalkExtensionClient::InstanceHandler* handler_;
+    };
+
+
+    typedef std::map<std::string, ExtensionCodePoints*> ExtensionAPIMap;
+    typedef std::map<int64_t, std::shared_ptr<ListenerAdapter>> ListenerMap;
+    const ExtensionAPIMap& extension_apis() const { return extension_apis_; }
+
+    const std::string GetRuntimeVariable(const std::string& key) const;
+    void UpdateRuntimeVariable(const std::string& key, const std::string& value);
+
+ private:
+    typedef std::map<std::string, std::string> RVMap;
+    ExtensionAPIMap extension_apis_;
+    ListenerMap listeners_;
+    RVMap rv_map_;
+};
+
+
+}
+
+#endif //WRT_XWALK_EXTENSION_CLIENT_H_
diff --git a/src/xwalk-module/xwalk_extension_module.cpp b/src/xwalk-module/xwalk_extension_module.cpp
new file mode 100755 (executable)
index 0000000..cc23d50
--- /dev/null
@@ -0,0 +1,697 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright (c) 2013 Intel Corporation. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <dlog.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <plugins-ipc-message/ipc_message_support.h>
+
+#include "xwalk_extension_module.h"
+#include "xwalk_extension_client.h"
+#include "JSLifeManager.h"
+#include "xwalk_module_system.h"
+#include "js_utils.h"
+
+extern "C" JSGlobalContextRef JSContextGetGlobalContext(JSContextRef ctx);
+
+// The arraysize(arr) macro returns the # of elements in an array arr.
+// The expression is a compile-time constant, and therefore can be
+// used in defining new arrays, for example.  If you use arraysize on
+// a pointer by mistake, you will get a compile-time error.
+//
+// One caveat is that arraysize() doesn't accept any array of an
+// anonymous type or a type defined inside a function.  In these rare
+// cases, you have to use the unsafe ARRAYSIZE_UNSAFE() macro below.  This is
+// due to a limitation in C++'s template system.  The limitation might
+// eventually be removed, but it hasn't happened yet.
+
+// This template function declaration is used in defining arraysize.
+// Note that the function doesn't need an implementation, as we only
+// use its type.
+template <typename T, size_t N>
+char (&ArraySizeHelper(T (&array)[N]))[N];
+
+#define arraysize(array) (sizeof(ArraySizeHelper(array)))
+
+namespace wrt {
+
+namespace {
+
+std::string CodeToEnsureNamespace(const std::string& extension_name) {
+    std::string result;
+    size_t pos = 0;
+    while (true) {
+        pos = extension_name.find('.', pos);
+        if (pos == std::string::npos) {
+            result += extension_name + ";";
+            break;
+        }
+        std::string ns = extension_name.substr(0, pos);
+        result += ns + " = " + ns + " || {}; ";
+        pos++;
+    }
+    return result;
+}
+
+// Templatized backend for StringPrintF/StringAppendF. This does not finalize
+// the va_list, the caller is expected to do that.
+template <class StringType>
+static void StringAppendVT(StringType* dst,
+                           const typename StringType::value_type* format,
+                           va_list ap) {
+    // First try with a small fixed size buffer.
+    // This buffer size should be kept in sync with StringUtilTest.GrowBoundary
+    // and StringUtilTest.StringPrintfBounds.
+    typename StringType::value_type stack_buf[1024];
+
+    va_list ap_copy;
+    va_copy(ap_copy, ap);
+
+    int result = vsnprintf(stack_buf, arraysize(stack_buf), format, ap_copy);
+    va_end(ap_copy);
+
+    if (result >= 0 && result < static_cast<int>(arraysize(stack_buf))) {
+        // It fit.
+        dst->append(stack_buf, result);
+        return;
+    }
+
+    // Repeatedly increase buffer size until it fits.
+    int mem_length = arraysize(stack_buf);
+    while (true) {
+        if (result < 0) {
+            if (errno != 0 && errno != EOVERFLOW)
+                return;
+            // Try doubling the buffer size.
+            mem_length *= 2;
+        } else {
+            // We need exactly "result + 1" characters.
+            mem_length = result + 1;
+        }
+
+        if (mem_length > 32 * 1024 * 1024) {
+            // That should be plenty, don't try anything larger.  This protects
+            // against huge allocations when using vsnprintfT implementations that
+            // return -1 for reasons other than overflow without setting errno.
+            LOGE("Unable to printf the requested string due to size.");
+            return;
+        }
+
+        std::vector<typename StringType::value_type> mem_buf(mem_length);
+
+        // NOTE: You can only use a va_list once.  Since we're in a while loop, we
+        // need to make a new copy each time so we don't use up the original.
+        va_copy(ap_copy, ap);
+        result = vsnprintf(&mem_buf[0], mem_length, format, ap_copy);
+        va_end(ap_copy);
+
+        if ((result >= 0) && (result < mem_length)) {
+            // It fit.
+            dst->append(&mem_buf[0], result);
+            return;
+        }
+    }
+}
+
+std::string StringPrintf(const char* format, ...) {
+    va_list ap;
+    va_start(ap, format);
+    std::string result;
+    StringAppendVT(&result, format, ap);
+    va_end(ap);
+    return result;
+}
+
+// Wrap API code into a callable form that takes extension object as parameter.
+std::string WrapAPICode(const std::string& extension_code,
+                        const std::string& extension_name) {
+    // We take care here to make sure that line numbering for api_code after
+    // wrapping doesn't change, so that syntax errors point to the correct line.
+
+    return StringPrintf(
+        "var %s; (function(extension, requireNative) { "
+        "extension.internal = {};"
+        "extension.internal.sendSyncMessage_ = extension.sendSyncMessage;"
+        "extension.internal.sendSyncMessage = function(){ return extension.internal.sendSyncMessage_.apply(extension, arguments); };"
+        "delete extension.sendSyncMessage;"
+        "var Object = requireNative('objecttools');"
+        "var exports = {}; (function() {'use strict'; %s\n})();"
+        "%s = %s || exports; });",
+        CodeToEnsureNamespace(extension_name).c_str(),
+        extension_code.c_str(),
+        extension_name.c_str(),
+        extension_name.c_str());
+}
+
+int GetNextChunkID() {
+    static int id = 0;
+    return ++id;
+}
+
+}  // namespace
+
+
+
+JSClassDefinition XWalkExtensionModule::class_definition_ = {
+    0,
+    kJSClassAttributeNone,
+    "extensionModule",
+    NULL, //ParentClass
+    NULL, //StaticValues
+    XWalkExtensionModule::static_functions_,
+    NULL, //initialize,
+    NULL, //finalize,
+    NULL, //HasProperty,
+    NULL, //GetProperty,
+    NULL, //SetProperty,
+    NULL, //DeleteProperty,
+    NULL, //GetPropertyNames,
+    NULL, //CallAsFunction,
+    NULL, //CallAsConstructor,
+    NULL, //HasInstance,
+    NULL //ConvertToType
+};
+
+
+JSStaticFunction XWalkExtensionModule::static_functions_[] = {
+    { "postMessage", PostMessageCallback, kJSPropertyAttributeNone },
+    { "postData", PostDataCallback, kJSPropertyAttributeNone },
+    { "sendSyncMessage", SendSyncMessageCallback, kJSPropertyAttributeNone },
+    { "sendSyncData", SendSyncDataCallback, kJSPropertyAttributeNone },
+    { "sendRuntimeMessage", SendRuntimeMessageCallback, kJSPropertyAttributeNone },
+    { "sendRuntimeAsyncMessage", SendRuntimeAsyncMessageCallback, kJSPropertyAttributeNone },
+    { "sendRuntimeSyncMessage", SendRuntimeSyncMessageCallback, kJSPropertyAttributeNone },
+    { "setMessageListener", SetMessageListenerCallback, kJSPropertyAttributeNone },
+    { "setDataListener", SetDataListenerCallback, kJSPropertyAttributeNone },
+    { "receiveChunkData", ReceiveChunkDataCallback, kJSPropertyAttributeNone },
+    { 0, 0, 0 }
+};
+
+JSClassRef XWalkExtensionModule::class_ref_ = NULL;
+
+XWalkExtensionModule::ChunkData::ChunkData()
+    : data_(nullptr), length_(0) {
+}
+
+XWalkExtensionModule::ChunkData::~ChunkData() {
+    if (data_) {
+       free(data_);
+    }
+}
+
+XWalkExtensionModule::XWalkExtensionModule(XWalkExtensionClient* client,
+                                           XWalkModuleSystem* module_system,
+                                           const std::string& extension_name,
+                                           std::function<std::string(void)> getter)
+    : js_object_(0),
+      extension_name_(extension_name),
+      client_(client),
+      module_system_(module_system),
+      instance_id_(0),
+      extension_code_getter_(getter) {
+}
+
+XWalkExtensionModule::~XWalkExtensionModule() {
+    JSContextRef ctx = module_system_->GetJSContext();
+
+    if( js_object_ != NULL ){
+        JSObjectSetPrivate(js_object_, NULL);
+        JSValueSafeUnprotect(ctx,js_object_);
+    }
+
+    if(message_listener_ != NULL){
+        JSValueSafeUnprotect(ctx,message_listener_);
+    }
+    if (instance_id_)
+        client_->DestroyInstance(instance_id_);
+}
+
+void XWalkExtensionModule::LoadExtensionCode(JSContextRef context, JSObjectRef native_require) {
+    LOGD("========== << LoadExtensionCode >> ENTER ==========");
+    //CHECK(!instance_id_);
+    instance_id_ = client_->CreateInstance(extension_name_, this);
+
+    LOGD("Extension Module Name : [%s]", extension_name_.c_str());
+
+    std::string exception;
+    std::string extension_code = extension_code_getter_();
+    std::string wrapped_api_code = WrapAPICode(extension_code, extension_name_);
+    JSValueRef result = JsUtils::RunString(context, wrapped_api_code, &exception);
+    JSObjectRef callable_api_code = JSValueToObject(context, result, NULL);
+
+    if (!JSValueIsObject(context, result) || !JSObjectIsFunction(context, callable_api_code)) {
+        LOGE("Couldn't load JS API code for %s: %s", extension_name_.c_str(), exception.c_str());
+        return;
+    }
+
+    const int argc = 2;
+    if( js_object_ == NULL ){
+        if( XWalkExtensionModule::class_ref_ == NULL ){
+            XWalkExtensionModule::class_ref_ = JSClassCreate(&XWalkExtensionModule::class_definition_);
+        }
+        js_object_ = JSObjectMake( context, XWalkExtensionModule::class_ref_, this);
+        JSValueSafeProtect(context,js_object_);
+    }
+    JSValueRef argv[argc] = {
+        js_object_,
+        native_require
+    };
+
+    JSValueRef except_value = NULL;
+    JSObjectCallAsFunction(context, callable_api_code, NULL, argc, argv, &except_value);
+    if( except_value != NULL ){
+        LOGE("Couldn't load JS API code for %s: %s", extension_name_.c_str(), JsUtils::ExceptionToString(context, except_value).c_str());
+    }
+
+}
+
+void XWalkExtensionModule::HandleMessageFromNative(const std::string& msg) {
+    if (message_listener_ == NULL)
+        return;
+
+    JSContextRef context = module_system_->GetJSContext();
+    JSValueRef args[] = { JsUtils::ToJSValueRef(context, msg) };
+
+    JSValueRef except_value = NULL;
+    JSObjectCallAsFunction(context, message_listener_, NULL, 1, args, &except_value);
+    if (except_value != NULL)
+        LOGE("Exception when running message listener: %s", JsUtils::ExceptionToString(context, except_value).c_str());
+}
+
+void XWalkExtensionModule::HandleMessageFromNative(const std::string& msg, unsigned char* buffer, std::size_t len) {
+    if (data_listener_ == NULL)
+        return;
+
+    JSContextRef context = module_system_->GetJSContext();
+    JSValueRef args[] = {
+      JsUtils::ToJSValueRef(context, msg),
+      JSValueMakeNull(context)
+    };
+    if (len > 0) {
+        int chunk_id = GetNextChunkID();
+        ChunkData& chunk_data = data_chunk_storage_[chunk_id];
+        chunk_data.set_data(buffer);
+        chunk_data.set_length(len);
+        args[1] = JSValueMakeNumber(context, chunk_id);
+    }
+
+    JSValueRef except_value = NULL;
+    JSObjectCallAsFunction(context, data_listener_, NULL, 2, args, &except_value);
+    if (except_value != NULL) {
+        LOGE("Exception when running message listener: %s", JsUtils::ExceptionToString(context, except_value).c_str());
+    }
+}
+
+
+// static
+JSValueRef XWalkExtensionModule::PostMessageCallback(JSContextRef context,
+        JSObjectRef object,
+        JSObjectRef thisObject,
+        size_t argumentCount,
+        const JSValueRef arguments[],
+        JSValueRef* exception) {
+    XWalkExtensionModule* module = GetExtensionModule(thisObject);
+    if (!module || argumentCount != 1) {
+        return JSValueMakeBoolean(context, false);
+    }
+
+    //CHECK(module->instance_id_);
+    module->client_->PostMessageToNative(module->instance_id_, JsUtils::JSValueToString(context, arguments[0]));
+    return JSValueMakeBoolean(context, true);
+}
+
+JSValueRef XWalkExtensionModule::PostDataCallback(JSContextRef context,
+        JSObjectRef object,
+        JSObjectRef thisObject,
+        size_t argumentCount,
+        const JSValueRef arguments[],
+        JSValueRef* exception) {
+    XWalkExtensionModule* module = GetExtensionModule(thisObject);
+    if (!module || argumentCount < 1) {
+        return JSValueMakeBoolean(context, false);
+    }
+
+    std::vector<unsigned char> chunk;
+    size_t chunk_size = 0;
+    if (argumentCount > 1) {
+        if (JSValueIsObject(context, arguments[1])) {
+            JSObjectRef arrayobj = JSValueToObject(context, arguments[1], NULL);
+            if (arrayobj) {
+                for (std::size_t i = 0; i < JSGetArrayLength(context, arrayobj); ++i) {
+                    JSValueRef element = JSGetArrayElement(context, arrayobj, i);
+                    unsigned char v = static_cast<unsigned char>(JSValueToNumber(context, element, NULL));
+                    chunk.push_back(v);
+                }
+                chunk_size = chunk.size();
+            }
+        } else if (JSValueIsString(context, arguments[1])) {
+            JSStringRef chunkStr = JSValueToStringCopy(context,
+                                                       arguments[1],
+                                                       exception);
+            size_t len = JSStringGetLength(chunkStr) + 1;
+            chunk.resize(len);
+            JSStringGetUTF8CString(chunkStr,
+                                   reinterpret_cast<char*>(chunk.data()),
+                                   len);
+            JSStringRelease(chunkStr);
+            chunk_size = len - 1;
+        }
+    }
+
+    module->client_->PostMessageToNative(module->instance_id_,
+                                         JsUtils::JSValueToString(context, arguments[0]),
+                                         chunk.data(),
+                                         chunk_size);
+    return JSValueMakeBoolean(context, true);
+}
+
+
+// static
+JSValueRef XWalkExtensionModule::SendSyncMessageCallback(JSContextRef context,
+        JSObjectRef object,
+        JSObjectRef thisObject,
+        size_t argumentCount,
+        const JSValueRef arguments[],
+        JSValueRef* exception) {
+
+    XWalkExtensionModule* module = GetExtensionModule(thisObject);
+    if (!module || argumentCount != 1) {
+        return JSValueMakeBoolean(context, false);
+    }
+
+    //CHECK(module->instance_id_);
+    std::string reply =
+        module->client_->SendSyncMessageToNative(module->instance_id_, JsUtils::JSValueToString(context, arguments[0]));
+
+    // If we tried to send a message to an instance that became invalid,
+    // then reply will be NULL.
+    if (!reply.empty()) {
+        return JsUtils::ToJSValueRef(context, reply);
+    }
+    return JSValueMakeNull(context);
+}
+
+// static
+JSValueRef XWalkExtensionModule::SendSyncDataCallback(JSContextRef context,
+        JSObjectRef object,
+        JSObjectRef thisObject,
+        size_t argumentCount,
+        const JSValueRef arguments[],
+        JSValueRef* exception) {
+
+    XWalkExtensionModule* module = GetExtensionModule(thisObject);
+    if (!module || argumentCount < 1) {
+        return JSValueMakeBoolean(context, false);
+    }
+
+    std::vector<unsigned char> chunk;
+    size_t chunk_size = 0;
+    if (argumentCount > 1) {
+        if (JSValueIsObject(context, arguments[1])) {
+          JSObjectRef arrayobj = JSValueToObject(context, arguments[1], NULL);
+          if (arrayobj) {
+            for (std::size_t i = 0; i < JSGetArrayLength(context, arrayobj); ++i) {
+                JSValueRef element = JSGetArrayElement(context, arrayobj, i);
+                unsigned char v = static_cast<unsigned char>(JSValueToNumber(context, element, NULL));
+                chunk.push_back(v);
+            }
+            chunk_size = chunk.size();
+          }
+        } else if (JSValueIsString(context, arguments[1])) {
+            JSStringRef chunkStr = JSValueToStringCopy(context,
+                                                       arguments[1],
+                                                       exception);
+            size_t len = JSStringGetLength(chunkStr) + 1;
+            chunk.resize(len);
+            JSStringGetUTF8CString(chunkStr,
+                                   reinterpret_cast<char*>(chunk.data()),
+                                   len);
+            JSStringRelease(chunkStr);
+            chunk_size = len - 1;
+        }
+    }
+
+    unsigned char* received_buffer = NULL;
+    std::size_t received_size = 0;
+    //CHECK(module->instance_id_);
+    std::string reply =
+        module->client_->SendSyncMessageToNative(
+            module->instance_id_,
+            JsUtils::JSValueToString(context, arguments[0]),
+            chunk.data(),
+            chunk_size,
+            &received_buffer,
+            &received_size);
+
+    // If we tried to send a message to an instance that became invalid,
+    // then reply will be NULL.
+    if (!reply.empty()) {
+      JSObjectRef return_obj = JSObjectMake(context, NULL, NULL);
+      JsUtils::SetProperty(context,
+                           return_obj,
+                           "reply",
+                           JsUtils::ToJSValueRef(context, reply),
+                           NULL,
+                           NULL);
+      if (received_buffer || received_size > 0) {
+        int chunk_id = GetNextChunkID();
+        ChunkData& chunk_data = module->data_chunk_storage_[chunk_id];
+        chunk_data.set_data(received_buffer);
+        chunk_data.set_length(received_size);
+        JsUtils::SetProperty(context,
+                             return_obj,
+                             "chunk_id",
+                             JSValueMakeNumber(context, chunk_id),
+                             NULL,
+                             NULL);
+      }
+      return return_obj;
+    }
+    return JSValueMakeNull(context);
+}
+
+// static
+JSValueRef XWalkExtensionModule::ReceiveChunkDataCallback(JSContextRef context,
+        JSObjectRef object,
+        JSObjectRef thisObject,
+        size_t argumentCount,
+        const JSValueRef arguments[],
+        JSValueRef* exception) {
+
+    XWalkExtensionModule* module = GetExtensionModule(thisObject);
+    if (!module || argumentCount < 1) {
+        return JSValueMakeBoolean(context, false);
+    }
+
+    int chunk_id = 0;
+    if (JSValueIsNumber(context, arguments[0])) {
+        chunk_id = JSValueToNumber(context, arguments[0], NULL);
+    }
+
+    std::string chunk_type("octet");
+    if (argumentCount > 1 && JSValueIsString(context, arguments[1])) {
+        chunk_type = JsUtils::JSValueToString(context, arguments[1]);
+    }
+
+    JSValueRef jschunk = JSValueMakeNull(context);
+
+    auto it = module->data_chunk_storage_.find(chunk_id);
+    if (it != module->data_chunk_storage_.end()) {
+        ChunkData& chunk_data = it->second;
+        if (chunk_type == "string") {
+            JSStringRef jsstr = JSStringCreateWithUTF8CString(reinterpret_cast<const char*>(chunk_data.data()));
+            jschunk = JSValueMakeString(context, jsstr);
+            JSStringRelease(jsstr);
+        } else {
+            std::unique_ptr<JSValueRef []> valueArray(new JSValueRef[chunk_data.length()]);
+            for (std::size_t i = 0; i < chunk_data.length(); ++i) {
+                valueArray[i] = JSValueMakeNumber(context, chunk_data.data()[i]);
+            }
+            jschunk = JSObjectMakeArray(context,
+                                        chunk_data.length(),
+                                        valueArray.get(),
+                                        NULL);
+        }
+        module->data_chunk_storage_.erase(it);
+    }
+
+    return jschunk;
+}
+
+// static
+JSValueRef XWalkExtensionModule::SendRuntimeMessageCallback(JSContextRef context,
+        JSObjectRef object,
+        JSObjectRef thisObject,
+        size_t argumentCount,
+        const JSValueRef arguments[],
+        JSValueRef* exception) {
+    LOGD("SendRuntimeMessageCallback");
+    XWalkExtensionModule* module = GetExtensionModule(thisObject);
+    if (!module || argumentCount < 1) {
+        return JSValueMakeBoolean(context, false);
+    }
+    std::string message = JsUtils::JSValueToString(context, arguments[0]);
+    std::string body;
+    if (argumentCount > 1) {
+      body = JsUtils::JSValueToString(context, arguments[1]);
+    }
+    IPCMessageSupport::sendMessageToUiProcess(message.c_str(), body.c_str());
+    return JSValueMakeBoolean(context, true);
+}
+
+
+namespace {
+struct AsyncData{
+  JSContextRef context;
+  JSObjectRef callback;
+};
+}  // namespace
+
+// static
+JSValueRef XWalkExtensionModule::SendRuntimeAsyncMessageCallback(JSContextRef context,
+        JSObjectRef object,
+        JSObjectRef thisObject,
+        size_t argumentCount,
+        const JSValueRef arguments[],
+        JSValueRef* exception) {
+    LOGD("SendRuntimeAsyncMessageCallback");
+    XWalkExtensionModule* module = GetExtensionModule(thisObject);
+    if (!module || argumentCount < 1) {
+        return JSValueMakeBoolean(context, false);
+    }
+    std::string message = JsUtils::JSValueToString(context, arguments[0]);
+    std::string body;
+    if (argumentCount > 1) {
+        body = JsUtils::JSValueToString(context, arguments[1]);
+    }
+    JSObjectRef js_callback = NULL;
+    if (argumentCount > 2) {
+        js_callback = JSValueToObject(context, arguments[2], NULL);
+        if (js_callback != NULL) {
+            JSValueSafeProtect(context,js_callback);
+        }
+    }
+    AsyncData* user_data = new AsyncData;
+    user_data->callback = js_callback;
+    user_data->context = JSContextGetGlobalContext(context);
+
+    auto callback = [](unsigned int id, void* user_data, const char* result) -> void {
+        LOGD("SendRuntimeAsyncMessageCallback async result callback - start");
+        AsyncData* data = static_cast<AsyncData*>(user_data);
+        using namespace WrtDeviceApis::CommonsJavaScript;
+        if (data != NULL
+            && data->context != NULL
+            && JSLifeManager::GetInstance().IsAvailableContext(data->context)
+            && data->callback != NULL
+            && JSObjectIsFunction(data->context, data->callback)) {
+          JSValueRef args[1] = { JsUtils::ToJSValueRef(data->context, result) };
+          JSObjectCallAsFunction(data->context, data->callback, NULL, 1, args, NULL);
+          JSValueSafeUnprotect(data->context,data->callback);
+        }
+        if (data != NULL) {
+            delete data;
+        }
+    };
+
+    LOGD("SendRuntimeAsyncMessageCallback send async call");
+    IPCMessageSupport::sendAsyncMessageToUiProcess(
+            message.c_str(),
+            body.c_str(),
+            callback, user_data);
+    return JSValueMakeBoolean(context, true);
+}
+
+// static
+JSValueRef XWalkExtensionModule::SendRuntimeSyncMessageCallback(JSContextRef context,
+        JSObjectRef object,
+        JSObjectRef thisObject,
+        size_t argumentCount,
+        const JSValueRef arguments[],
+        JSValueRef* exception) {
+    LOGD("SendRuntimeSyncMessageCallback");
+    XWalkExtensionModule* module = GetExtensionModule(thisObject);
+    if (!module || argumentCount < 1) {
+        return JSValueMakeUndefined(context);
+    }
+    std::string message = JsUtils::JSValueToString(context, arguments[0]);
+    std::string body;
+    if (argumentCount > 1) {
+        body = JsUtils::JSValueToString(context, arguments[1]);
+    }
+
+    std::string retval = IPCMessageSupport::sendSyncMessageToUiProcess(message.c_str(), body.c_str());
+    return JsUtils::ToJSValueRef(context, retval);
+}
+
+
+
+// static
+JSValueRef XWalkExtensionModule::SetMessageListenerCallback(JSContextRef context,
+        JSObjectRef object,
+        JSObjectRef thisObject,
+        size_t argumentCount,
+        const JSValueRef arguments[],
+        JSValueRef* exception) {
+    XWalkExtensionModule* module = GetExtensionModule(thisObject);
+    if (!module || argumentCount != 1) {
+        return JSValueMakeBoolean(context, false);
+    }
+
+    JSObjectRef obj = JSValueToObject(context, arguments[0], NULL);
+    if ( !(obj != NULL && JSObjectIsFunction(context, obj)) && !JSValueIsUndefined(context, arguments[0])) {
+        LOGE("Trying to set message listener with invalid value.");
+        return JSValueMakeBoolean(context, false);
+    }
+
+    if( module->message_listener_ != NULL ){
+        JSValueSafeUnprotect(context,module->message_listener_);
+    }
+    module->message_listener_ = NULL;
+
+    if (!JSValueIsUndefined(context, arguments[0])){
+        module->message_listener_ = obj;
+        JSValueSafeProtect(context,module->message_listener_);
+    }
+
+    return JSValueMakeBoolean(context, true);
+}
+
+JSValueRef XWalkExtensionModule::SetDataListenerCallback(JSContextRef context,
+        JSObjectRef object,
+        JSObjectRef thisObject,
+        size_t argumentCount,
+        const JSValueRef arguments[],
+        JSValueRef* exception) {
+    XWalkExtensionModule* module = GetExtensionModule(thisObject);
+    if (!module || argumentCount != 1) {
+        return JSValueMakeBoolean(context, false);
+    }
+
+    JSObjectRef obj = JSValueToObject(context, arguments[0], NULL);
+    if ( !(obj != NULL && JSObjectIsFunction(context, obj)) && !JSValueIsUndefined(context, arguments[0])) {
+        LOGE("Trying to set message listener with invalid value.");
+        return JSValueMakeBoolean(context, false);
+    }
+
+    if( module->data_listener_ != NULL ){
+        JSValueSafeUnprotect(context,module->data_listener_);
+    }
+    module->data_listener_ = NULL;
+
+    if (!JSValueIsUndefined(context, arguments[0])){
+        module->data_listener_ = obj;
+        JSValueSafeProtect(context,module->data_listener_);
+    }
+
+    return JSValueMakeBoolean(context, true);
+}
+
+
+// static
+XWalkExtensionModule* XWalkExtensionModule::GetExtensionModule(JSObjectRef thisObject) {
+    return static_cast<XWalkExtensionModule*>(JSObjectGetPrivate(thisObject));
+}
+
+}  // namespace wrt
diff --git a/src/xwalk-module/xwalk_extension_module.h b/src/xwalk-module/xwalk_extension_module.h
new file mode 100755 (executable)
index 0000000..f8b9703
--- /dev/null
@@ -0,0 +1,152 @@
+#ifndef WRT_XWALK_EXTENSION_MODULE_H_
+#define WRT_XWALK_EXTENSION_MODULE_H_
+
+#include <memory>
+
+#include <EWebKit.h>
+#include <EWebKit_internal.h>
+#include <JavaScriptCore/JavaScript.h>
+
+#include <string>
+#include <map>
+#include <functional>
+
+#include "xwalk_extension_client.h"
+
+namespace wrt {
+
+class XWalkExtensionClient;
+class XWalkModuleSystem;
+
+// Responsible for running the JS code of a XWalkExtension. This includes
+// creating and exposing an 'extension' object for the execution context of
+// the extension JS code.
+//
+// We'll create one XWalkExtensionModule per extension/frame pair, so
+// there'll be a set of different modules per v8::Context.
+class XWalkExtensionModule : public XWalkExtensionClient::InstanceHandler {
+  public:
+    XWalkExtensionModule(XWalkExtensionClient* client,
+                       XWalkModuleSystem* module_system,
+                       const std::string& extension_name,
+                       std::function<std::string(void)> getter);
+    virtual ~XWalkExtensionModule();
+
+    // TODO(cmarcelo): Make this return a v8::Handle<v8::Object>, and
+    // let the module system set it to the appropriated object.
+    void LoadExtensionCode(JSContextRef context, JSObjectRef native_require);
+
+    std::string extension_name() const { return extension_name_; }
+
+  private:
+    class ChunkData {
+     public:
+      ChunkData();
+      ~ChunkData();
+
+      ChunkData& operator=(const ChunkData&) = delete;
+      ChunkData(const ChunkData&) = delete;
+
+      uint8_t* data() const { return data_; }
+      size_t length() const { return length_; }
+      void set_data(uint8_t* data) { data_ = data; }
+      void set_length(const size_t length) { length_ = length; }
+     private:
+      uint8_t* data_;
+      size_t length_;
+    };
+
+
+    // XWalkExtensionClient::InstanceHandler implementation.
+    virtual void HandleMessageFromNative(const std::string& msg);
+    virtual void HandleMessageFromNative(const std::string& msg, unsigned char* buffer, std::size_t len);
+
+    // Callbacks for JS functions available in 'extension' object.
+    static JSValueRef PostMessageCallback(JSContextRef context,
+        JSObjectRef object,
+        JSObjectRef thisObject,
+        size_t argumentCount,
+        const JSValueRef arguments[],
+        JSValueRef* exception);
+    static JSValueRef PostDataCallback(JSContextRef context,
+        JSObjectRef object,
+        JSObjectRef thisObject,
+        size_t argumentCount,
+        const JSValueRef arguments[],
+        JSValueRef* exception);
+    static JSValueRef SendSyncMessageCallback(JSContextRef context,
+        JSObjectRef object,
+        JSObjectRef thisObject,
+        size_t argumentCount,
+        const JSValueRef arguments[],
+        JSValueRef* exception);
+    static JSValueRef SendSyncDataCallback(JSContextRef context,
+        JSObjectRef object,
+        JSObjectRef thisObject,
+        size_t argumentCount,
+        const JSValueRef arguments[],
+        JSValueRef* exception);
+    static JSValueRef SendRuntimeMessageCallback(JSContextRef context,
+        JSObjectRef object,
+        JSObjectRef thisObject,
+        size_t argumentCount,
+        const JSValueRef arguments[],
+        JSValueRef* exception);
+    static JSValueRef SendRuntimeAsyncMessageCallback(JSContextRef context,
+        JSObjectRef object,
+        JSObjectRef thisObject,
+        size_t argumentCount,
+        const JSValueRef arguments[],
+        JSValueRef* exception);
+    static JSValueRef SendRuntimeSyncMessageCallback(JSContextRef context,
+        JSObjectRef object,
+        JSObjectRef thisObject,
+        size_t argumentCount,
+        const JSValueRef arguments[],
+        JSValueRef* exception);
+
+    static JSValueRef SetMessageListenerCallback(JSContextRef context,
+        JSObjectRef object,
+        JSObjectRef thisObject,
+        size_t argumentCount,
+        const JSValueRef arguments[],
+        JSValueRef* exception);
+    static JSValueRef SetDataListenerCallback(JSContextRef context,
+        JSObjectRef object,
+        JSObjectRef thisObject,
+        size_t argumentCount,
+        const JSValueRef arguments[],
+        JSValueRef* exception);
+    static JSValueRef ReceiveChunkDataCallback(JSContextRef context,
+        JSObjectRef object,
+        JSObjectRef thisObject,
+        size_t argumentCount,
+        const JSValueRef arguments[],
+        JSValueRef* exception);
+
+    static XWalkExtensionModule* GetExtensionModule(JSObjectRef info);
+
+    static JSClassDefinition class_definition_;
+    static JSStaticFunction static_functions_[];
+    static JSClassRef class_ref_;
+
+    JSObjectRef js_object_;
+
+    // Function to be called when the extension sends a message to its JS code.
+    // This value is registered by using 'extension.setMessageListener()'.
+    JSObjectRef message_listener_;
+    JSObjectRef data_listener_;
+
+    std::string extension_name_;
+
+    std::map<int, ChunkData> data_chunk_storage_;
+
+    XWalkExtensionClient* client_;
+    XWalkModuleSystem* module_system_;
+    int64_t instance_id_;
+    std::function<std::string(void)> extension_code_getter_;
+};
+
+}  // namespace wrt
+
+#endif  // WRT_XWALK_EXTENSION_MODULE_H_
diff --git a/src/xwalk-module/xwalk_extension_renderer_controller.cpp b/src/xwalk-module/xwalk_extension_renderer_controller.cpp
new file mode 100755 (executable)
index 0000000..342bd8b
--- /dev/null
@@ -0,0 +1,105 @@
+// Copyright (c) 2013 Intel Corporation. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <dlog.h>
+#include <utility>
+#include <string>
+
+#include <EWebKit.h>
+#include <EWebKit_internal.h>
+#include <JavaScriptCore/JavaScript.h>
+
+#include "xwalk_extension_renderer_controller.h"
+#include "xwalk_extension_client.h"
+#include "xwalk_extension_module.h"
+#include "xwalk_module_system.h"
+#include "runtime_variable_provider.h"
+#include "xwalk_v8tools_module.h"
+#include "object_tools_module.h"
+
+namespace {
+    const char * kRvRuntimeName = "runtime_name";
+    const char * kRvAppid = "app_id";
+    const char * kRvBundle = "encoded_bundle";
+}
+
+namespace wrt {
+
+XWalkExtensionRendererController& XWalkExtensionRendererController::GetInstance(){
+    static XWalkExtensionRendererController instance;
+    return instance;
+}
+
+XWalkExtensionRendererController::XWalkExtensionRendererController()
+    : extensions_client_(new XWalkExtensionClient) {
+  extensions_client_->UpdateRuntimeVariable(kRvRuntimeName,"wrt");
+}
+
+XWalkExtensionRendererController::~XWalkExtensionRendererController() {
+}
+
+namespace {
+
+void CreateExtensionModules(XWalkExtensionClient* client,
+                            XWalkModuleSystem* module_system) {
+  LOGD("========== << CreateExtensionModules >> ENTER ==========");
+
+  const XWalkExtensionClient::ExtensionAPIMap& extensions =
+      client->extension_apis();
+  XWalkExtensionClient::ExtensionAPIMap::const_iterator it = extensions.begin();
+  for (; it != extensions.end(); ++it) {
+    LOGD("Extension Module name : [%s]", (it->first).c_str());
+    XWalkExtensionClient::ExtensionCodePoints* codepoint = it->second;
+
+    std::unique_ptr<XWalkExtensionModule> module(
+        new XWalkExtensionModule(client,
+                                 module_system,
+                                 it->first,
+                                 [codepoint](){return codepoint->api();})
+    );
+    module_system->RegisterExtensionModule(std::move(module), codepoint->entry_points());
+  }
+  LOGD("========== << CreateExtensionModules >> END ==========");
+}
+
+
+}  // namespace
+
+void XWalkExtensionRendererController::DidCreateScriptContext(
+    JSContextRef context) {
+  LOGD("========== << DidCreateScriptContext >> ENTER ==========");
+
+  XWalkModuleSystem* module_system = new XWalkModuleSystem(context);
+  XWalkModuleSystem::SetModuleSystemInContext(
+      std::unique_ptr<XWalkModuleSystem>(module_system), context);
+
+  module_system->RegisterNativeModule(
+      "v8tools", std::unique_ptr<NativeModule>(new XWalkV8ToolsModule));
+
+  module_system->RegisterNativeModule(
+      "objecttools", std::unique_ptr<NativeModule>(new ObjectToolsModule(context)));
+
+  CreateExtensionModules(extensions_client_.get(), module_system);
+  module_system->Initialize();
+  LOGD("========== << DidCreateScriptContext >> END ==========");
+}
+
+void XWalkExtensionRendererController::WillReleaseScriptContext(
+    JSContextRef context) {
+  XWalkModuleSystem::ResetModuleSystemFromContext(context);
+}
+
+void XWalkExtensionRendererController::SetAppId(const std::string& appid){
+  extensions_client_->UpdateRuntimeVariable(kRvAppid, appid);
+}
+
+void XWalkExtensionRendererController::SetBundle(const std::string& bundle){
+  extensions_client_->UpdateRuntimeVariable(kRvBundle, bundle);
+}
+
+void XWalkExtensionRendererController::InitializeExtensions(){
+  extensions_client_->Initialize();
+}
+
+}  // namespace wrt
diff --git a/src/xwalk-module/xwalk_extension_renderer_controller.h b/src/xwalk-module/xwalk_extension_renderer_controller.h
new file mode 100755 (executable)
index 0000000..a2c55d5
--- /dev/null
@@ -0,0 +1,40 @@
+#ifndef WRT_XWALK_EXTENSION_RENDERER_CONTROLLER_H_
+#define WRT_XWALK_EXTENSION_RENDERER_CONTROLLER_H_
+
+#include <memory>
+
+#include <EWebKit.h>
+#include <EWebKit_internal.h>
+#include <JavaScriptCore/JavaScript.h>
+
+namespace wrt {
+
+class XWalkExtensionClient;
+
+// Renderer controller for XWalk extensions keeps track of the extensions
+// registered into the system. It also watches for new render views to attach
+// the extensions handlers to them.
+class XWalkExtensionRendererController {
+ public:
+    static XWalkExtensionRendererController& GetInstance();
+
+    // To be called in XWalkContentRendererClient so we can create and
+    // destroy extensions contexts appropriatedly.
+    void DidCreateScriptContext(JSContextRef context);
+    void WillReleaseScriptContext(JSContextRef context);
+
+    void SetAppId(const std::string& appid);
+    void SetBundle(const std::string& bundle);
+    void InitializeExtensions();
+
+ private:
+  explicit XWalkExtensionRendererController();
+  virtual ~XWalkExtensionRendererController();
+
+ private:
+  std::unique_ptr<XWalkExtensionClient> extensions_client_;
+};
+
+}  // namespace wrt
+
+#endif  // WRT_XWALK_EXTENSION_RENDERER_CONTROLLER_H_
diff --git a/src/xwalk-module/xwalk_module_system.cpp b/src/xwalk-module/xwalk_module_system.cpp
new file mode 100755 (executable)
index 0000000..316ce7d
--- /dev/null
@@ -0,0 +1,472 @@
+// Copyright (c) 2013 Intel Corporation. All rights reserved.
+// Copyright 2015 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.
+
+#include <algorithm>
+#include <map>
+#include <functional>
+#include <string>
+#include <sstream>
+#include <dlog.h>
+#include "xwalk_module_system.h"
+#include "xwalk_extension_client.h"
+#include "xwalk_extension_module.h"
+#include "js_utils.h"
+
+extern "C" JSGlobalContextRef JSContextGetGlobalContext(JSContextRef ctx);
+
+namespace wrt {
+
+namespace {
+
+static void SplitString(const std::string &s, char delim, std::vector<std::string>* elems) {
+    elems->clear();
+    std::stringstream ss(s);
+    std::string item;
+    while (std::getline(ss, item, delim)) {
+        elems->push_back(item);
+    }
+}
+
+static JSObjectRef EnsureTargetObjectForTrampoline(JSContextRef context,
+        const std::vector<std::string>& path, std::string* error) {
+
+    JSObjectRef object = JSContextGetGlobalObject(context);
+    std::vector<std::string>::const_iterator it = path.begin();
+    for (; it != path.end(); ++it) {
+        JSValueRef value = JsUtils::GetProperty(context, object, it->c_str(), NULL);
+
+        if (JSValueIsUndefined(context, value)) {
+            //make dumy object
+            JSObjectRef next_object = JSObjectMake(context, NULL, NULL);
+            JsUtils::SetProperty(context, object, it->c_str(), next_object, kJSPropertyAttributeNone , NULL);
+            object = next_object;
+            continue;
+        }
+
+        if (!JSValueIsObject(context,value)) {
+            if( error )
+                *error = "the property '" + *it + "' in the path is undefined";
+            return JSValueMakeUndefined(context);
+        }
+        object = JSValueToObject(context, value, NULL);
+    }
+    return object;
+}
+
+static JSValueRef GetObjectForPath(JSContextRef context,
+        const std::vector<std::string>& path, std::string* error) {
+
+    JSObjectRef object = JSContextGetGlobalObject(context);
+    std::vector<std::string>::const_iterator it = path.begin();
+    for (; it != path.end(); ++it) {
+        JSValueRef value = JsUtils::GetProperty(context, object, it->c_str(), NULL);
+        if (!JSValueIsObject(context,value)) {
+            if( error )
+                *error = "the property '" + *it + "' in the path is undefined";
+            return JSValueMakeUndefined(context);
+        }
+        object = JSValueToObject(context, value, NULL);
+    }
+    return object;
+}
+
+}  // unamed namespace
+
+std::map<JSContextRef,XWalkModuleSystem*> XWalkModuleSystem::module_system_table_;
+
+XWalkModuleSystem::XWalkModuleSystem(JSContextRef context) {
+    LOGD("========== << XWalkModuleSystem >> ==========");
+    js_context_ = context;
+    trampoline_function_ = NULL;
+}
+
+XWalkModuleSystem::~XWalkModuleSystem() {
+    DeleteExtensionModules();
+    auto it = native_modules_.begin();
+    for ( ; it != native_modules_.end(); ++it) {
+      delete it->second;
+    }
+    native_modules_.clear();
+
+    js_context_ = NULL;
+}
+
+
+// static
+XWalkModuleSystem* XWalkModuleSystem::GetModuleSystemFromContext(JSContextRef context) {
+    return XWalkModuleSystem::module_system_table_[context];
+}
+
+// static
+void XWalkModuleSystem::SetModuleSystemInContext(
+        std::unique_ptr<XWalkModuleSystem> module_system,
+        JSContextRef context) {
+    XWalkModuleSystem::module_system_table_[context] = module_system.release();
+}
+
+// static
+void XWalkModuleSystem::ResetModuleSystemFromContext(
+        JSContextRef context) {
+    delete XWalkModuleSystem::module_system_table_[context];
+    SetModuleSystemInContext(std::unique_ptr<XWalkModuleSystem>(), context);
+}
+
+void XWalkModuleSystem::RegisterExtensionModule(
+        std::unique_ptr<XWalkExtensionModule> module,
+        const std::vector<std::string>& entry_points) {
+    LOGD("========== << RegisterExtensionModule >> ENTER ==========");
+    const std::string& extension_name = module->extension_name();
+    LOGD("Register Extension Module name : [%s]", extension_name.c_str());
+
+    if (ContainsEntryPoint(extension_name)) {
+        LOGE("Can't register Extension Module named for extension '%s'"
+             "in the Module System because name was already registered.", extension_name.c_str());
+        return;
+    }
+
+    std::vector<std::string>::const_iterator it = entry_points.begin();
+    for (; it != entry_points.end(); ++it) {
+        if (ContainsEntryPoint(*it)) {
+            LOGE("Can't register Extension Module named for extension '%s' "
+                 "in the Module System because another extension has the entry "
+                 "point '%s'.", extension_name.c_str(), (*it).c_str());
+            return;
+        }
+    }
+
+    extension_modules_.push_back(ExtensionModuleEntry(extension_name, module.release(), entry_points));
+    LOGD("========== << RegisterExtensionModule >> END ==========");
+}
+
+void XWalkModuleSystem::RegisterNativeModule(
+    const std::string& name, std::unique_ptr<NativeModule> module) {
+  if (native_modules_.find(name) != native_modules_.end()) {
+    return;
+  }
+  native_modules_[name] = module.release();
+}
+
+JSValueRef XWalkModuleSystem::RequireNativeFunction(JSContextRef context,
+        JSObjectRef object,
+        JSObjectRef thisObject,
+        size_t argumentCount,
+        const JSValueRef arguments[],
+        JSValueRef* exception) {
+  JSContextRef globalctx = JSContextGetGlobalContext(context);
+  XWalkModuleSystem* module_system = XWalkModuleSystem::GetModuleSystemFromContext(globalctx);
+  std::string name = JsUtils::JSValueToString(context, arguments[0]);
+  return module_system->RequireNative(name);
+}
+
+JSObjectRef XWalkModuleSystem::RequireNative(const std::string& name) {
+  NativeModuleMap::iterator it = native_modules_.find(name);
+  if (it == native_modules_.end())
+    return NULL;
+  return it->second->NewInstance(js_context_);
+}
+
+
+bool XWalkModuleSystem::InstallTrampoline(JSContextRef context,
+                                          ExtensionModuleEntry* entry) {
+    LOGD("InstallTrampline %s", entry->name.c_str());
+    if( !SetTrampolineAccessorForEntryPoint(context, entry->name, entry->name) ){
+        LOGE("Error installing trampline for '%s'", entry->name.c_str());
+        return false;
+    }
+    std::vector<std::string>::const_iterator it = entry->entry_points.begin();
+    for (; it != entry->entry_points.end(); ++it) {
+        if ( !SetTrampolineAccessorForEntryPoint(context, entry->name, *it)) {
+            LOGE("Error installing trampoline for '%s'", (*it).c_str());
+            return false;
+        }
+    }
+    return true;
+}
+
+bool XWalkModuleSystem::SetTrampolineAccessorForEntryPoint(JSContextRef context, const std::string& plugin_name, const std::string& entry_point){
+    std::vector<std::string> path;
+    SplitString(entry_point, '.', &path);
+    std::string basename = path.back();  
+    path.pop_back();
+
+    std::string error;
+    JSObjectRef parent = EnsureTargetObjectForTrampoline(context, path, &error);
+    if( JSValueIsUndefined( context, parent )){
+        LOGE("can't get parent object : %s", error.c_str());
+        return false;
+    }
+    SetTrampolineCallback(context, parent, basename, plugin_name, XWalkModuleSystem::DoLoadingCallback);
+    return true;
+}
+
+namespace {
+JSObjectRef GetInstallTrampolineFunction(JSContextRef context){
+    const char *code =
+        "(function (parent, property_name, entry_point, do_load, param){"
+        "  if (parent[property_name]) {"
+        "    console.log('ERROR: module ['+property_name+'] was already loaded');"
+        "    return;"
+        "  }"
+        "Object.defineProperty("
+        "    parent, "
+        "    property_name, {"
+        "        get: function (parent_obj, base_name, entry_point, param) {"
+        "            return function() {"
+        "                try {"
+        "                    delete parent_obj[base_name];"
+        "                    do_load(entry_point, param);"
+        "                    return parent_obj[base_name];"
+        "                } catch (e) {"
+        "                    console.log(e.stack);"
+        "                }"
+        "            };"
+        "        }(parent, property_name, entry_point, param),"
+        "        enumerable : true,"
+        "        configurable : true"
+        "    }"
+        ");"
+        "})";
+
+    std::string exception;
+    JSValueRef ret_value = JsUtils::RunString(context, code, &exception);
+    JSObjectRef ret_object = JSValueToObject(context, ret_value, NULL);
+    if (!JSValueIsObject(context, ret_value) || !JSObjectIsFunction(context, ret_object)) {
+        LOGE("Couldn't get Object.definedProperty funtion : %s", exception.c_str());
+        return NULL;
+    }
+    return ret_object;
+}
+}
+
+void XWalkModuleSystem::Initialize() {
+    LOGD("========== << Initialize >> ENTER ==========");
+    JSContextRef context = GetJSContext();
+    trampoline_function_ = GetInstallTrampolineFunction(context);
+
+    MarkModulesWithTrampoline();
+
+    ExtensionModules::iterator it = extension_modules_.begin();
+    for (; it != extension_modules_.end(); ++it) {
+        if (it->use_trampoline && InstallTrampoline(context, &*it))
+            continue;
+        LOGD("Load Extension without trampoline %s", it->name.c_str());
+        JSObjectRef native_require_callback =
+            JSObjectMakeFunctionWithCallback(context, NULL, XWalkModuleSystem::RequireNativeFunction);
+        it->module->LoadExtensionCode(context, native_require_callback);
+        EnsureExtensionNamespaceIsReadOnly(context, it->name);
+        auto entry_it = it->entry_points.begin();
+        for (; entry_it != it->entry_points.end(); ++entry_it) {
+            EnsureExtensionNamespaceIsReadOnly(context, *entry_it);
+        }
+    }
+    LOGD("========== << Initialize >> END ==========");
+}
+
+JSContextRef XWalkModuleSystem::GetJSContext() {
+    return js_context_;
+}
+
+bool XWalkModuleSystem::ContainsEntryPoint(const std::string& entry) {
+    ExtensionModules::iterator it = extension_modules_.begin();
+    for (; it != extension_modules_.end(); ++it) {
+        if (it->name == entry)
+            return true;
+
+        std::vector<std::string>::iterator entry_it = std::find(
+            it->entry_points.begin(), it->entry_points.end(), entry);
+        if (entry_it != it->entry_points.end()) {
+            return true;
+        }
+    }
+    return false;
+}
+
+void XWalkModuleSystem::DeleteExtensionModules() {
+    for (auto it = extension_modules_.begin(); it != extension_modules_.end(); ++it) {
+        LOGD("Delete Extension Module name : [%s]", it->name.c_str());
+        delete it->module;
+    }
+    extension_modules_.clear();
+}
+
+
+XWalkModuleSystem::ExtensionModuleEntry::ExtensionModuleEntry(
+    const std::string& name,
+    XWalkExtensionModule* module,
+    const std::vector<std::string>& entry_points) :
+        name(name), module(module), use_trampoline(true),
+        entry_points(entry_points) {
+}
+
+XWalkModuleSystem::ExtensionModuleEntry::~ExtensionModuleEntry() {
+}
+
+// Returns whether the name of first is prefix of the second, considering "."
+// character as a separator. So "a" is prefix of "a.b" but not of "ab".
+bool XWalkModuleSystem::ExtensionModuleEntry::IsPrefix(
+        const ExtensionModuleEntry& first,
+        const ExtensionModuleEntry& second) {
+    const std::string& p = first.name;
+    const std::string& s = second.name;
+    return s.size() > p.size() && s[p.size()] == '.'
+        && std::mismatch(p.begin(), p.end(), s.begin()).first == p.end();
+}
+
+// Mark the extension modules that we want to setup "trampolines"
+// instead of loading the code directly. The current algorithm is very
+// simple: we only create trampolines for extensions that are leaves
+// in the namespace tree.
+//
+// For example, if there are two extensions "tizen" and "tizen.time",
+// the first one won't be marked with trampoline, but the second one
+// will. So we'll only load code for "tizen" extension.
+void XWalkModuleSystem::MarkModulesWithTrampoline() {
+    LOGD("========== << MarkModulesWithTrampoline >> ENTER ==========");
+    std::sort(extension_modules_.begin(), extension_modules_.end());
+
+    ExtensionModules::iterator it = extension_modules_.begin();
+    while (it != extension_modules_.end()) {
+        it = std::adjacent_find(it, extension_modules_.end(),
+                            &ExtensionModuleEntry::IsPrefix);
+        if (it == extension_modules_.end())
+            break;
+        it->use_trampoline = false;
+        ++it;
+    }
+    LOGD("========== << MarkModulesWithTrampoline >> END ==========");
+}
+
+void XWalkModuleSystem::EnsureExtensionNamespaceIsReadOnly(
+        JSContextRef context,
+        const std::string& extension_name) {
+    std::vector<std::string> path;
+    SplitString(extension_name, '.', &path);
+    std::string basename = path.back();
+    path.pop_back();
+
+    std::string error;
+    JSValueRef value = GetObjectForPath(context, path, &error);
+    if (JSValueIsUndefined(context, value)) {
+        LOGE("Error retrieving object for %s: %s.", extension_name.c_str(), error.c_str());
+        return;
+    }
+    JSObjectRef parent_object = JSValueToObject(context, value, NULL);
+    JSValueRef module = JsUtils::GetProperty(context, parent_object, basename.c_str(), NULL);
+    JsUtils::DeleteProperty(context, parent_object, basename.c_str(), NULL);
+    JsUtils::SetProperty(context, parent_object, basename.c_str(), module,
+                         kJSPropertyAttributeReadOnly|kJSPropertyAttributeDontDelete, NULL);
+}
+
+
+JSClassDefinition dummy_class_definition = {
+    0,
+    kJSClassAttributeNone,
+    "dummy",
+    NULL, //ParentClass
+    NULL, //StaticValues
+    NULL, //StaticFunctions
+    NULL, //initialize,
+    NULL, //finalize,
+    NULL, //HasProperty,
+    NULL, //GetProperty,
+    NULL, //SetProperty,
+    NULL, //DeleteProperty,
+    NULL, //GetPropertyNames,
+    NULL, //CallAsFunction,
+    NULL, //CallAsConstructor,
+    NULL, //HasInstance,
+    NULL //ConvertToType
+};
+
+
+void XWalkModuleSystem::SetTrampolineCallback(JSContextRef context,
+                                              JSObjectRef obj,
+                                              const std::string& property_name,
+                                              const std::string& plugin_name,
+                                              JSObjectCallAsFunctionCallback do_load){
+    JSObjectRef func = trampoline_function_;
+    JSObjectRef do_load_func = JSObjectMakeFunctionWithCallback(context, NULL, do_load);
+
+    static JSClassRef class_ref = JSClassCreate(&dummy_class_definition);
+    JSObjectRef param = JSObjectMake(context, class_ref, this);
+
+    JSValueRef args[5] = {
+        obj, //parent
+        JsUtils::ToJSValueRef(context, property_name), // propery name
+        JsUtils::ToJSValueRef(context, plugin_name), // plugin_name
+        do_load_func, // loading function
+        param // extra parameter for passing native pointer( this )
+    };
+    JSValueRef except_value = NULL;
+    JSObjectCallAsFunction(context, func, NULL, 5, args, &except_value);
+    if( except_value != NULL){
+        std::string error = JsUtils::ExceptionToString(context, except_value);
+        LOGE("Error SetTrampolineCallback : %s", error.c_str());
+    }
+
+}
+
+void XWalkModuleSystem::RemoveTrampolineCallback(JSContextRef context, const std::string& entry_point){
+    std::vector<std::string> path;
+    SplitString(entry_point, '.', &path);
+    std::string basename = path.back();
+    path.pop_back();
+
+    std::string error;
+    JSObjectRef parent = EnsureTargetObjectForTrampoline(context, path, &error);
+    if( JSValueIsUndefined( context, parent )){
+        LOGE("can't get parent object : %s", error.c_str());
+        return;
+    }
+    JsUtils::DeleteProperty(context, parent, basename.c_str(), NULL);
+}
+
+
+JSValueRef XWalkModuleSystem::DoLoadingCallback(JSContextRef context,
+        JSObjectRef object,
+        JSObjectRef thisObject,
+        size_t argumentCount,
+        const JSValueRef arguments[],
+        JSValueRef* exception) {
+
+    if( argumentCount < 2 ){
+        return JSValueMakeUndefined(context);
+    }
+
+    std::string plugin_name = JsUtils::JSValueToString(context, arguments[0]);
+    JSObjectRef param = JSValueToObject(context, arguments[1], NULL);
+    XWalkModuleSystem *self = static_cast<XWalkModuleSystem*>(JSObjectGetPrivate(param));
+    if( self == NULL){
+        LOGE("Fail to load plugin, extra param was NULL");
+        return JSValueMakeUndefined(context);
+    }
+
+    LOGD("DoLoading : %s", plugin_name.c_str());
+
+    ExtensionModules::iterator it = self->extension_modules_.begin();
+    for (; it != self->extension_modules_.end(); ++it) {
+        if( it->name == plugin_name ){
+            RemoveTrampolineCallback(JSContextGetGlobalContext(context), it->name);
+            std::vector<std::string>::const_iterator entry_it = it->entry_points.begin();
+            for (; entry_it != it->entry_points.end(); ++entry_it) {
+                RemoveTrampolineCallback(JSContextGetGlobalContext(context), *entry_it);
+            }
+
+            JSObjectRef native_require_callback =
+                JSObjectMakeFunctionWithCallback(JSContextGetGlobalContext(context), NULL, XWalkModuleSystem::RequireNativeFunction);
+
+            it->module->LoadExtensionCode(JSContextGetGlobalContext(context), native_require_callback);
+            EnsureExtensionNamespaceIsReadOnly(JSContextGetGlobalContext(context), it->name);
+            entry_it = it->entry_points.begin();
+            for (; entry_it != it->entry_points.end(); ++entry_it) {
+                EnsureExtensionNamespaceIsReadOnly(JSContextGetGlobalContext(context), *entry_it);
+            }
+            break;
+        }
+    }
+    return JSValueMakeUndefined(context);
+}
+
+}  // namespace wrt
diff --git a/src/xwalk-module/xwalk_module_system.h b/src/xwalk-module/xwalk_module_system.h
new file mode 100755 (executable)
index 0000000..22e29c7
--- /dev/null
@@ -0,0 +1,120 @@
+#ifndef WRT_XWALK_MODULE_SYSTEM_H_
+#define WRT_XWALK_MODULE_SYSTEM_H_
+
+#include <vector>
+#include <string>
+#include <map>
+#include <memory>
+#include <EWebKit.h>
+#include <EWebKit_internal.h>
+#include <JavaScriptCore/JavaScript.h>
+
+namespace wrt {
+
+class XWalkExtensionModule;
+
+// Interface used to expose objects via the requireNative() function in JS API
+// code. Native modules should be registered with the module system.
+class NativeModule {
+ public:
+  virtual JSObjectRef NewInstance(JSContextRef context) = 0;
+  virtual ~NativeModule() {}
+};
+
+
+// This object is associated with the v8::Context of each WebFrame. It manages
+// the JS modules we expose to the JavaScript environment.
+//
+// We treat the modules that represent the JS API code of XWalkExtensions
+// specially, since to enable messaging we want to provide a communication
+// gateway between RenderViewHandler and these modules. See XWalkExtensionModule
+// for details.
+class XWalkModuleSystem {
+ public:
+  explicit XWalkModuleSystem(JSContextRef context);
+  ~XWalkModuleSystem();
+
+  // Functions that manage the relationship between v8::Context and
+  // XWalkModuleSystem.
+  static XWalkModuleSystem* GetModuleSystemFromContext(JSContextRef context);
+  static void SetModuleSystemInContext(
+      std::unique_ptr<XWalkModuleSystem> module_system,
+      JSContextRef context);
+  static void ResetModuleSystemFromContext(JSContextRef context);
+
+  void RegisterExtensionModule(std::unique_ptr<XWalkExtensionModule> module,
+                               const std::vector<std::string>& entry_points);
+
+  void RegisterNativeModule(const std::string& name,
+                            std::unique_ptr<NativeModule> module);
+  JSObjectRef RequireNative(const std::string& name);
+
+  void Initialize();
+
+  JSContextRef GetJSContext();
+
+ private:
+  struct ExtensionModuleEntry {
+    ExtensionModuleEntry(const std::string& name, XWalkExtensionModule* module,
+                         const std::vector<std::string>& entry_points);
+    ~ExtensionModuleEntry();
+    std::string name;
+    XWalkExtensionModule* module;
+    bool use_trampoline;
+    std::vector<std::string> entry_points;
+    bool operator<(const ExtensionModuleEntry& other) const {
+      return name < other.name;
+    }
+
+    static bool IsPrefix(const ExtensionModuleEntry& first,
+                         const ExtensionModuleEntry& second);
+  };
+
+  bool InstallTrampoline(JSContextRef context,
+                         ExtensionModuleEntry* entry);
+  bool SetTrampolineAccessorForEntryPoint(JSContextRef context, const std::string& plugin_name, const std::string& entry_point);
+  bool ContainsEntryPoint(const std::string& entry_point);
+  void MarkModulesWithTrampoline();
+  void DeleteExtensionModules();
+
+  static void EnsureExtensionNamespaceIsReadOnly(JSContextRef context,
+                                          const std::string& extension_name);
+
+  void SetTrampolineCallback(JSContextRef context,
+                             JSObjectRef obj,
+                             const std::string& property_name,
+                             const std::string& plugin_name,
+                             JSObjectCallAsFunctionCallback do_load);
+
+  static JSValueRef DoLoadingCallback(JSContextRef context,
+                                      JSObjectRef object,
+                                      JSObjectRef thisObject,
+                                      size_t argumentCount,
+                                      const JSValueRef arguments[],
+                                      JSValueRef* exception);
+  static JSValueRef RequireNativeFunction(JSContextRef context,
+                                          JSObjectRef object,
+                                          JSObjectRef thisObject,
+                                          size_t argumentCount,
+                                          const JSValueRef arguments[],
+                                          JSValueRef* exception);
+
+  static void RemoveTrampolineCallback(JSContextRef context, const std::string& entry_point);
+
+  typedef std::vector<ExtensionModuleEntry> ExtensionModules;
+  ExtensionModules extension_modules_;
+  typedef std::map<std::string, NativeModule*> NativeModuleMap;
+  NativeModuleMap native_modules_;
+
+  // Points back to the current context, used when native wants to callback
+  // JavaScript. When WillReleaseScriptContext() is called, we dispose this
+  // persistent.
+  JSContextRef js_context_;
+  JSObjectRef trampoline_function_;
+  
+  static std::map<JSContextRef,XWalkModuleSystem*> module_system_table_;
+};
+
+}  // namespace wrt
+
+#endif  // WRT_XWALK_MODULE_SYSTEM_H_
diff --git a/src/xwalk-module/xwalk_v8tools_module.cpp b/src/xwalk-module/xwalk_v8tools_module.cpp
new file mode 100755 (executable)
index 0000000..d5f0fb6
--- /dev/null
@@ -0,0 +1,100 @@
+// Copyright 2015 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.
+
+#include "xwalk_v8tools_module.h"
+
+#include <dlog.h>
+
+#include "js_utils.h"
+
+extern "C" JSGlobalContextRef JSContextGetGlobalContext(JSContextRef ctx);
+
+
+namespace wrt {
+
+namespace {
+void LifeCycleInitialize(JSContextRef context, JSObjectRef object) {
+  JSObjectSetPrivate(object, context);
+}
+
+void LifeCycleFinalize(JSObjectRef object)
+{
+    LOGD("enter");
+    JSContextRef context = static_cast<JSContextRef>(JSObjectGetPrivate(object));
+    XWalkModuleSystem* modulesystem = XWalkModuleSystem::GetModuleSystemFromContext(context);
+    if (modulesystem == NULL) {
+      LOGD("xwalk module system was released");
+      return;
+    }
+    JSValueRef destructor =
+        JsUtils::GetProperty(context, object, "destructor", NULL);
+    if (destructor != NULL && JSValueIsObject(context, destructor)) {
+      JSObjectRef obj = JSValueToObject(context, destructor, NULL);
+      if (obj != NULL && JSObjectIsFunction(context, obj)) {
+        JSObjectCallAsFunction(context, obj, NULL, 0, NULL, NULL);
+      }
+    }
+}
+
+JSClassDefinition life_cycle_class_def = {
+    0,
+    kJSClassAttributeNone,
+    "lifecycleTracker",
+    NULL, //ParentClass
+    NULL, //StaticValues
+    NULL, //StaticFunctions
+    LifeCycleInitialize, //initialize,
+    LifeCycleFinalize, //finalize,
+    NULL, //HasProperty,
+    NULL, //GetProperty,
+    NULL, //SetProperty,
+    NULL, //DeleteProperty,
+    NULL, //GetPropertyNames,
+    NULL, //CallAsFunction,
+    NULL, //CallAsConstructor,
+    NULL, //HasInstance,
+    NULL //ConvertToType
+};
+
+JSValueRef CreateLifeCycleTrackerObject(JSContextRef context,
+        JSObjectRef object,
+        JSObjectRef thisObject,
+        size_t argumentCount,
+        const JSValueRef arguments[],
+        JSValueRef* exception) {
+  static JSClassRef class_ref = JSClassCreate(&life_cycle_class_def);
+  JSObjectRef tracker =
+      JSObjectMake(JSContextGetGlobalContext(context), class_ref, NULL);
+  return tracker;
+}
+
+
+
+}  //  namespace
+
+XWalkV8ToolsModule::XWalkV8ToolsModule() {
+}
+
+XWalkV8ToolsModule::~XWalkV8ToolsModule() {
+}
+
+
+JSObjectRef XWalkV8ToolsModule::NewInstance(JSContextRef context) {
+  JSObjectRef v8tools = JSObjectMake(context, NULL, NULL);
+  JSObjectRef get_life_tracker_fun =
+      JSObjectMakeFunctionWithCallback(context,
+                                       NULL,
+                                       CreateLifeCycleTrackerObject);
+  JsUtils::SetProperty(context,
+                       v8tools,
+                       "lifecycleTracker",
+                       get_life_tracker_fun,
+                       kJSPropertyAttributeNone,
+                       NULL);
+  return v8tools;
+}
+
+
+}  // namespace wrt
+
diff --git a/src/xwalk-module/xwalk_v8tools_module.h b/src/xwalk-module/xwalk_v8tools_module.h
new file mode 100755 (executable)
index 0000000..80febe1
--- /dev/null
@@ -0,0 +1,28 @@
+// Copyright 2015 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.
+
+#ifndef WRT_XWALK_V8TOOLS_MODULE_H_
+#define WRT_XWALK_V8TOOLS_MODULE_H_
+
+#include <JavaScriptCore/JavaScript.h>
+
+#include "xwalk_module_system.h"
+
+namespace wrt {
+
+// This module provides extra JS functions that help writing JS API code for
+// extensions, for example: allowing setting a read-only property of an object.
+class XWalkV8ToolsModule : public NativeModule {
+ public:
+  XWalkV8ToolsModule();
+  ~XWalkV8ToolsModule();
+
+ private:
+  JSObjectRef NewInstance(JSContextRef context);
+};
+
+}  // namespace wrt
+
+#endif  // WRT_XWALK_V8TOOLS_MODULE_H_
+
diff --git a/src_mobile/CMakeLists.txt b/src_mobile/CMakeLists.txt
deleted file mode 100644 (file)
index ba7daa0..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-# 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.
-#
-# Includes CMake configuration file (*.cmake), preserving appropriate paths.
-
-ADD_DEFINITIONS("-DWRT_PLUGINS_COMMON_LOG")
-
-macro(include_config_file INCLUDED_CONFIG_FILE_PATH)
-  get_filename_component(CURRENT_CONFIG_FILE_PATH ${CMAKE_CURRENT_LIST_FILE} PATH)
-  include(${CURRENT_CONFIG_FILE_PATH}/${INCLUDED_CONFIG_FILE_PATH}/${CONFIG_FILE_NAME} OPTIONAL)
-endmacro()
-
-# Gets actual path for CMake configuration file (*.cmake).
-# By default, if no argument is passed, current path will be set to variable
-# named CURRENT_PATH.
-# @param [Optional] Name of the variable to set with current path.
-macro(get_current_path)
-  set(VARIABLE "CURRENT_PATH")
-  if (${ARGC} GREATER 0)
-    set(VARIABLE ${ARGV0})
-  endif ()
-  get_filename_component(${VARIABLE} ${CMAKE_CURRENT_LIST_FILE} PATH)
-endmacro()
-
-set(HOST_ARCH $ENV{DEB_HOST_ARCH})
-if("${HOST_ARCH}" MATCHES "armel")
-    set(HOST_ARCH "armel")
-endif()
-
-#target names
-set(TARGET_PLUGIN_LOADING_LIB "wrt-plugin-loading")
-set(TARGET_COMMONS "wrt-plugins-commons")
-set(TARGET_COMMONS_JAVASCRIPT "wrt-plugins-commons-javascript")
-set(TARGET_JS_OVERLAY "wrt-plugins-js-overlay")
-SET(TARGET_POPUP_ACE "wrt-popup-ace-runtime")
-SET(TARGET_POPUP_ACE_RUNNER_LIB "wrt-popup-ace-runner")
-SET(TARGET_POPUP_WRT "wrt-popup-wrt-runtime")
-SET(TARGET_POPUP_WRT_RUNNER_LIB "wrt-popup-wrt-runner")
-set(TARGET_PLUGINS_API_SUPPORT "wrt-plugins-api-support")
-set(TARGET_PLUGINS_IPC_MESSAGE_LIB "wrt-plugins-ipc-message")
-
-set(PLUGIN_LOADING_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/plugin-loading)
-set(PLUGINS_API_SUPPORT_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/plugins-api-support)
-set(PLUGINS_IPC_MESSAGE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/plugins-ipc-message)
-
-add_subdirectory(plugins-api-support)
-add_subdirectory(plugin-loading)
-add_subdirectory(js-overlay)
-add_subdirectory(Commons)
-add_subdirectory(CommonsJavaScript)
-add_subdirectory(dispatch-event)
-add_subdirectory(modules)
-add_subdirectory(standards)
-add_subdirectory(wrt-popup)
-add_subdirectory(plugins-installer)
-add_subdirectory(plugins-ipc-message)
diff --git a/src_mobile/Commons/Base64.cpp b/src_mobile/Commons/Base64.cpp
deleted file mode 100644 (file)
index 94ac901..0000000
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
- * 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.
- */
-/*
- * Copyright (c) 2003-2007, Bicom Systems 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 name of the Bicom Systems Ltd nor the names of its
- *         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.
- *
- * Denis Komadaric,
- * Bicom Systems Ltd.
- */
-#include <ctype.h>
-#include "Exception.h"
-#include "Base64.h"
-
-namespace WrtDeviceApis {
-namespace Commons {
-const std::string Base64::chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
-                                  "abcdefghijklmnopqrstuvwxyz"
-                                  "0123456789+/";
-
-bool Base64::is_base64(unsigned char c)
-{
-    return (isalnum(c) || (c == '+') || (c == '/'));
-}
-
-std::string Base64::encode(unsigned char* data,
-                           std::size_t num)
-{
-    std::string ret;
-    int i = 0;
-    int j = 0;
-    unsigned char char_array_3[3];
-    unsigned char char_array_4[4];
-
-    while (num--) {
-        char_array_3[i++] = *(data++);
-        if (i == 3) {
-            char_array_4[0] = (char_array_3[0] & 0xfc) >> 2;
-            char_array_4[1] =
-                ((char_array_3[0] &
-                  0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4);
-            char_array_4[2] =
-                ((char_array_3[1] &
-                  0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6);
-            char_array_4[3] = char_array_3[2] & 0x3f;
-
-            for (i = 0; i < 4; ++i) {
-                ret += chars[char_array_4[i]];
-            }
-            i = 0;
-        }
-    }
-
-    if (i != 0) {
-        for (j = i; j < 3; ++j) {
-            char_array_3[j] = '\0';
-        }
-
-        char_array_4[0] = (char_array_3[0] & 0xfc) >> 2;
-        char_array_4[1] =
-            ((char_array_3[0] & 0x03) << 4) + ((char_array_3[1] & 0xf0) >> 4);
-        char_array_4[2] =
-            ((char_array_3[1] & 0x0f) << 2) + ((char_array_3[2] & 0xc0) >> 6);
-        char_array_4[3] = char_array_3[2] & 0x3f;
-
-        for (j = 0; (j < i + 1); ++j) {
-            ret += chars[char_array_4[j]];
-        }
-
-        while ((i++ < 3)) {
-            ret += '=';
-        }
-    }
-
-    return ret;
-}
-
-std::string Base64::decode(const std::string& str)
-{
-    if (!is_base64_string(str)) {
-        ThrowMsg(InvalidArgumentException,
-                 "Invalid length of base64 string.");
-    }
-    int in_len = str.size();
-    int i = 0;
-    int j = 0;
-    int in_ = 0;
-    unsigned char char_array_4[4], char_array_3[3];
-    std::string ret;
-
-    while (in_len-- && (str[in_] != '=')) {
-        if (!is_base64(str[in_])) {
-            ThrowMsg(InvalidArgumentException,
-                     "Invalid characters in base64 string.");
-        }
-        char_array_4[i++] = str[in_];
-        in_++;
-        if (i == 4) {
-            for (i = 0; i < 4; ++i) {
-                char_array_4[i] = chars.find(char_array_4[i]);
-            }
-
-            char_array_3[0] =
-                (char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4);
-            char_array_3[1] =
-                ((char_array_4[1] &
-                  0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2);
-            char_array_3[2] = ((char_array_4[2] & 0x3) << 6) + char_array_4[3];
-
-            for (i = 0; i < 3; ++i) {
-                ret += char_array_3[i];
-            }
-            i = 0;
-        }
-    }
-
-    if (i != 0) {
-        for (j = i; j < 4; ++j) {
-            char_array_4[j] = 0;
-        }
-
-        for (j = 0; j < 4; ++j) {
-            char_array_4[j] = chars.find(char_array_4[j]);
-        }
-
-        char_array_3[0] =
-            (char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4);
-        char_array_3[1] =
-            ((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2);
-        char_array_3[2] = ((char_array_4[2] & 0x3) << 6) + char_array_4[3];
-
-        for (j = 0; (j < i - 1); ++j) {
-            ret += char_array_3[j];
-        }
-    }
-
-    return ret;
-}
-
-bool Base64::is_base64_string(const std::string& str)
-{
-    return ((str.size() % 4) == 0);
-}
-}
-} //WrtDeviceApisCommon
diff --git a/src_mobile/Commons/Base64.h b/src_mobile/Commons/Base64.h
deleted file mode 100644 (file)
index 5f42802..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRTDEVICEAPIS_COMMONS_BASE64_H_
-#define WRTDEVICEAPIS_COMMONS_BASE64_H_
-
-#include <string>
-#include <cstddef>
-
-namespace WrtDeviceApis {
-namespace Commons {
-class Base64
-{
-  public:
-    static std::string encode(unsigned char* data,
-                              std::size_t num);
-    static std::string decode(const std::string& str);
-
-  private:
-    static bool is_base64(unsigned char c);
-    static bool is_base64_string(const std::string& str);
-
-  private:
-    static const std::string chars;
-}; // Base64
-}
-} // WrtDeviceApisCommon
-
-#endif /* WRTDEVICEAPIS_COMMONS_BASE64_H_ */
diff --git a/src_mobile/Commons/DESCRIPTION b/src_mobile/Commons/DESCRIPTION
deleted file mode 100644 (file)
index 7f04546..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Common code
diff --git a/src_mobile/Commons/Deprecated.h b/src_mobile/Commons/Deprecated.h
deleted file mode 100644 (file)
index 5db3acf..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRTDEVICEAPIS_COMMONS_DEPRECATED_H_
-#define WRTDEVICEAPIS_COMMONS_DEPRECATED_H_
-
-#define WRT_PLUGINS_DEPRECATED __attribute__((deprecated))
-
-#endif /* WRTDEVICEAPIS_COMMONS_DEPRECATED_H_ */
diff --git a/src_mobile/Commons/Dimension.h b/src_mobile/Commons/Dimension.h
deleted file mode 100644 (file)
index 703e0c0..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * 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.
- */
-/**
- * @author       Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
- */
-
-#ifndef WRTDEVICEAPIS_COMMONS_DIMENSION_H_
-#define WRTDEVICEAPIS_COMMONS_DIMENSION_H_
-
-namespace WrtDeviceApis {
-namespace Commons {
-/**
- * Encapsulates width and height of a component.
- */
-class Dimension
-{
-  public:
-    /**
-     * Type of dimension's values.
-     */
-    typedef unsigned int ValueType;
-
-  public:
-    /**
-     * Creates an instance of Dimension with specified width and height.
-     * @param width Specified width.
-     * @param height Specified height.
-     */
-    Dimension(ValueType width,
-              ValueType height) :
-        m_width(width),
-        m_height(height)
-    {}
-
-    ValueType getWidth() const
-    {
-        return m_width;
-    }
-
-    ValueType getHeight() const
-    {
-        return m_height;
-    }
-
-    void setSize(ValueType width,
-                 ValueType height)
-    {
-        m_width = width;
-        m_height = height;
-    }
-
-  private:
-    ValueType m_width;
-    ValueType m_height;
-};
-}
-} // WrtDeviceApisCommon
-
-#endif // WRTDEVICEAPIS_COMMONS_DIMENSION_H_
diff --git a/src_mobile/Commons/FunctionDeclaration.h b/src_mobile/Commons/FunctionDeclaration.h
deleted file mode 100644 (file)
index d603c49..0000000
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRTDEVICEAPIS_COMMONS_FUNCTION_DECLARATION_
-#define WRTDEVICEAPIS_COMMONS_FUNCTION_DECLARATION_
-
-#include <string>
-#include <algorithm>
-#include <dpl/log/log.h>
-#include <Commons/WrtAccess/WrtAccess.h>
-#include <Commons/Exception.h>
-#include <Commons/TypesDeclaration.h>
-#include <Commons/TypeTraits.h>
-#include <Commons/plugin_initializer_def.h>
-
-#define ACE_DECLARE_FUNCTION(function_definition) \
-    extern WrtDeviceApis::Commons::AceFunction ace_##function_definition
-
-#define ACE_DECLARE_PARAM(param_definition) \
-    extern WrtDeviceApis::Commons::AceDeviceCapParam ace_param_## \
-    param_definition
-
-class DevCapFinder
-{
-  public:
-    explicit DevCapFinder(const std::string& devcap) : m_searchFor(devcap)
-    {}
-    explicit DevCapFinder(const char* devcap) : m_searchFor(devcap)
-    {}
-    bool operator()(const WrtDeviceApis::Commons::AceDeviceCapability& dc)
-    const
-    {
-        return m_searchFor == dc.devCapName;
-    }
-
-  private:
-    std::string m_searchFor;
-};
-
-#define ACE_ADD_DEV_CAP_PARAM(dev_caps_list, dev_cap_name, param)              \
-    do {                                                                       \
-        WrtDeviceApis::Commons::AceDeviceCaps::iterator devcapit =                \
-            std::find_if(dev_caps_list.begin(),                                \
-                         dev_caps_list.end(),                                  \
-                         DevCapFinder(dev_cap_name));                          \
-        if (devcapit == dev_caps_list.end())                                   \
-        {                                                                      \
-            ThrowMsg(                                                          \
-                WrtDeviceApis::Commons::InvalidArgumentException,                 \
-                "Trying to set a param that doesn't exist: " <<                \
-                dev_cap_name);                                                 \
-        }                                                                      \
-        else                                                                   \
-        {                                                                      \
-            LogDebug("Setting dev cap " << dev_cap_name << " param: " <<        \
-                    param.name << " to value " << param.value);                \
-            devcapit->devCapParams.push_back(param);                           \
-        }                                                                      \
-    } while (0)
-
-/*
- * Macro must be run inside plugin function. Plugin function must follow this
- * declaration:
- * plugin_example_function(JScontextRef cotext, JSObjectRef function,
- * JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[],
- * JSValueRef *exception);
- * where context, arguments, argumentsCount, exception are fixed and could not
- * be change.
- * */
-
-#define DECLARE_FUNCTION_GETTER(Plugin_Module)                                 \
-    WrtDeviceApis::Commons::AceFunction get##Plugin_Module##FunctionData(     \
-        const std::string & functionId);
-
-#define DEFINE_FUNCTION_GETTER(Plugin_Module, FunctionMap)                     \
-    WrtDeviceApis::Commons::AceFunction get##Plugin_Module##FunctionData(     \
-        const std::string & functionId)                                        \
-    {                                                                          \
-        WrtDeviceApis::Commons::FunctionMapping::const_iterator it =              \
-            FunctionMap.find(functionId);                                      \
-        if (it == FunctionMap.end())                                           \
-        {                                                                      \
-            std::string errorMsg();                                            \
-            ThrowMsg(WrtDeviceApis::Commons::InvalidArgumentException,            \
-                     "Function with id " << functionId << "not found");        \
-        }                                                                      \
-        return it->second;                                                     \
-    }
-
-typedef WrtDeviceApis::Commons::AceFunction (&AceFunctionGetter)(const std::
-                                                                     string&);
-
-namespace WrtDeviceApis {
-namespace Commons {
-enum class AceSecurityStatus
-{
-    AccessGranted,
-    AccessDenied,
-    PrivacyDenied,
-    InternalError
-};
-
-template <typename ... Args>
-class DefaultArgsVerifier
-{
-  public:
-    void operator()(AceFunction& aceFunction, Args && ... args) const
-    {
-        static_assert(
-            WrtDeviceApis::Commons::AlwaysFalse<Args ...>::value,
-            "Please provide a specialization for these argument types!");
-    }
-};
-
-template <>
-class DefaultArgsVerifier<>
-{
-  public:
-    void operator()(AceFunction& /*aceFunction*/) const
-    {}
-};
-
-template <typename FunctionGetter,
-          typename ArgumentsVerifier,
-          typename ... Args>
-AceSecurityStatus aceCheckAccess(
-    const FunctionGetter& f,
-    const char* functionName,
-    Args && ... args)
-{
-    using namespace WrtDeviceApis::Commons;
-
-    AceFunction aceFunction = f(functionName);
-
-    ArgumentsVerifier argsVerify;
-    argsVerify(aceFunction, args ...);
-
-    WrtAccess::CheckAccessReturnType ret =
-        WrtAccessSingleton::Instance().checkAccessControl(aceFunction);
-
-    if (ret == WrtAccess::CHECK_ACCESS_PRIVILEGE_DENIED) {
-        return AceSecurityStatus::AccessDenied;
-    }
-    else if (ret == WrtAccess::CHECK_ACCESS_PRIVACY_DENIED) {
-        return AceSecurityStatus::PrivacyDenied;
-    }
-    else if (ret == WrtAccess::CHECK_ACCESS_INTERNAL_ERROR) {
-        return AceSecurityStatus::InternalError;
-    }
-
-    return AceSecurityStatus::AccessGranted;
-}
-}
-} // WrtDeviceApisCommon
-
-#endif // WRTDEVICEAPIS_COMMONS_FUNCTION_DECLARARION_
diff --git a/src_mobile/Commons/FunctionDefinition.cpp b/src_mobile/Commons/FunctionDefinition.cpp
deleted file mode 100644 (file)
index 4209994..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * 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 "FunctionDefinition.h"
-
-namespace WrtDeviceApis {
-namespace Commons {
-int aceAddDeviceCap(const AceDeviceCapability& cap,
-                    AceDeviceCaps &instance)
-{
-    instance.push_back(cap);
-    return 0;
-}
-
-int aceAddApiFeature(const AceFeature& apiFeature,
-                     AceFeatures& instance)
-{
-    instance.push_back(apiFeature);
-    return 0;
-}
-}
-} // WrtDeviceApisCommon
diff --git a/src_mobile/Commons/FunctionDefinition.h b/src_mobile/Commons/FunctionDefinition.h
deleted file mode 100644 (file)
index fa8b32c..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRTDEVICEAPIS_COMMONS_FUNCTION_DEFINITION_
-#define WRTDEVICEAPIS_COMMONS_FUNCTION_DEFINITION_
-
-#include <map>
-#include <string>
-#include <Commons/FunctionDeclaration.h>
-
-namespace WrtDeviceApis {
-namespace Commons {
-/**
- * Creates an empty device cap list. Additional device-caps may be added by
- * ACE_CREATE_DEVICE_CAP and ACE_ADD_DEVICE_CAP macros
- */
-#define ACE_CREATE_DEVICE_CAPS_LIST(device) \
-    WrtDeviceApis::Commons::AceDeviceCaps ace_##device
-
-/**
- * Creates an empty api features list. Additional api features may be added by
- * ACE_CREATE_FEATURE and ACE_ADD_API_FEATURE macros
- */
-#define ACE_CREATE_FEATURE_LIST(apifeature) \
-    WrtDeviceApis::Commons::AceFeatures ace_##apifeature
-
-/**
- * Creates a device capability which should be later added to device cap list
- */
-#define ACE_CREATE_DEVICE_CAP(device_cap_id, cap_id)                      \
-    WrtDeviceApis::Commons::AceDeviceCapability ace_##device_cap_id = \
-        AceDeviceCapability(cap_id, WrtDeviceApis::Commons::AceDeviceCapParams());
-
-/**
- * Create an api feature which should be later added to api features list
- */
-#define ACE_CREATE_FEATURE(feature_id, feature_api) \
-    WrtDeviceApis::Commons::AceFeature ace_##feature_id = { feature_api \
-    };
-
-/**
- * Adds an existing device-cap created by ACE_CREATE_DEVICE_CAP macro to
- * device cap list
- */
-#define ACE_ADD_DEVICE_CAP(device, device_cap_id)   \
-    WrtDeviceApis::Commons::aceAddDeviceCap(ace_##device_cap_id, ace_##device)
-
-/**
- * Adds an existing api feature created by ACE_CREATE_FEATURE macro to
- * api feature list
- */
-#define ACE_ADD_API_FEATURE(apifeature, feature_id)     \
-    WrtDeviceApis::Commons::aceAddApiFeature(ace_##feature_id, \
-                                             ace_##apifeature)
-
-/**
- * Creates a function definition with given id that uses provided api feature
- * and device capability lists
- */
-#define ACE_CREATE_FUNCTION(function_id, function_name, feature_id, device) \
-    { function_name, ace_##feature_id, ace_##device }
-
-// Support for param:name begin
-#define ACE_CREATE_PARAM(param_definition, param_name, position)            \
-    static WrtDeviceApis::Commons::AceDeviceCapParam ace_param_## \
-    param_definition = \
-    { std::string(param_name), position };
-
-// Support for param:name end
-
-typedef std::map <std::string, AceFunction> FunctionMapping;
-
-int aceAddDeviceCap(const AceDeviceCapability &cap,
-                    AceDeviceCaps & instance);
-int aceAddApiFeature(const AceFeature &apiFeature,
-                     AceFeatures & instance);
-}
-} // WrtDeviceApisCommon
-
-#endif // WRTDEVICEAPIS_COMMONS_FUNCTION_DEFINITION
diff --git a/src_mobile/Commons/JSObject.cpp b/src_mobile/Commons/JSObject.cpp
deleted file mode 100644 (file)
index 70488f1..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * 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    js_object.cpp
- * @author  Grzegorz Krawczyk (g.krawczyk@samgsung.com)
- * @version
- * @brief
- */
-
-#include "JSObject.h"
-#include <dpl/log/log.h>
-
-JSObject::JSObject(RealObject object) : m_object(object)
-{
-    if (!object) {
-        LogError("Object is NULL");
-    }
-}
-
-JSObject::RealObject JSObject::getObject() const
-{
-    return m_object;
-}
diff --git a/src_mobile/Commons/JSObjectDeclaration.cpp b/src_mobile/Commons/JSObjectDeclaration.cpp
deleted file mode 100755 (executable)
index 81578cc..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * 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    js_object_declaration.cpp
- * @author  Grzegorz Krawczyk (g.krawczyk@samgsung.com)
- * @version
- * @brief
- */
-
-#include <dpl/log/log.h>
-#include <dpl/assert.h>
-#include "JSObjectDeclaration.h"
-
-JSObjectDeclaration::JSObjectDeclaration(js_entity_definition_ptr_t classD) :
-    m_name(classD->object_name),
-    m_parentName(classD->parent_name),
-    m_interfaceName(classD->interface_name),
-    m_classTemplate(NULL),
-    m_constructorCallback(classD->js_class_constructor_cb)
-{
-    if (NULL != classD->js_class_template_getter_fun) {
-        m_classTemplate = classD->js_class_template_getter_fun();
-    }
-    if (classD->class_options) {
-        m_options = OptionsPtr(new Options(classD->class_options));
-    }
-}
-
-JSObjectDeclaration::~JSObjectDeclaration()
-{}
-
-bool JSObjectDeclaration::checkIframesSupported() const
-{
-    if (!m_options ||
-        m_options->getIframeObject() == Options::IFrameObject::None)
-    {
-        return false;
-    }
-
-    return true;
-}
-
-JSObjectDeclaration::Options::ClassType
-JSObjectDeclaration::Options::getType() const
-{
-    Assert(m_options && "Pointer to options is NULL");
-
-    switch (m_options->type) {
-    case JS_CLASS: return ClassType::Class;
-    case JS_FUNCTION: return ClassType::Function;
-    case JS_INTERFACE: return ClassType::Interface;
-    default: Assert(0 && "Wrong value of type");
-    }
-}
-
-JSObjectDeclaration::Options::IFrameObject
-JSObjectDeclaration::Options::getIframeObject() const
-{
-    Assert(m_options && "Options object is NULL");
-
-    switch (m_options->iframe_option) {
-    case NONE: return IFrameObject::None;
-    case REFERENCE: return IFrameObject::Reference; // deprecated
-    case CREATE_INSTANCE: return IFrameObject::CreateInstance;
-    default:
-        Assert(0 && "Wrong value of behaviour type");
-    }
-}
-
-JSObjectDeclaration::Options::IFrameNotice
-JSObjectDeclaration::Options::getIframeNotice() const
-{
-    Assert(m_options && "Pointer to options is null");
-
-    switch (m_options->iframe_notice) {
-    case NONE_NOTICE: return IFrameNotice::None;
-    case ALWAYS_NOTICE: return IFrameNotice::AlwaysNotice;
-    default:
-        Assert(0 && "Wrong value of notice option");
-    }
-}
-
-js_function_impl JSObjectDeclaration::Options::getFunctionImpl() const
-{
-    Assert(m_options && "Pointer to options is null");
-    return m_options->function;
-}
-
-void JSObjectDeclaration::Options::invokeCallback(JsContext ctx,
-                                                  ObjectInstance iframe,
-                                                  ObjectInstance object) const
-{
-    LogDebug("JS Object create, notice.");
-    Assert(m_options && m_options->cb && "Empty callback pointer");
-    m_options->cb(ctx, iframe, object);
-}
-
-JSObjectDeclaration::Options::PrivateData
-JSObjectDeclaration::Options::getPrivateData() const
-{
-    Assert(m_options && m_options->private_data && "empty private data");
-    return m_options->private_data;
-}
diff --git a/src_mobile/Commons/ListenerEventEmitter.h b/src_mobile/Commons/ListenerEventEmitter.h
deleted file mode 100644 (file)
index 77bada2..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * 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.
- */
-/**
- * @author    Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
- */
-
-#ifndef WRTDEVICEAPIS_COMMONS_LISTENER_EVENT_EMITTER_H_
-#define WRTDEVICEAPIS_COMMONS_LISTENER_EVENT_EMITTER_H_
-
-#include <stdint.h>
-#include <dpl/noncopyable.h>
-#include <dpl/shared_ptr.h>
-#include <dpl/mutex.h>
-#include <Commons/EventListener.h>
-#include <Commons/ListenerEvent.h>
-
-namespace WrtDeviceApis {
-namespace Commons {
-template<class EmitterClass>
-class Emitters;
-
-/**
- * Creates listener events in the abstraction layer in response to some
- * asynchronous action.
- * To enable passing events from abstract layer to layer that uses it, first
- * proper event emitter should be registered in abstract layer by the layer
- * that uses it. Then when some action happens in abstract layer event should be
- * created and passed to this emitter's emit() function. Then emitter passes
- * this event to proper listener.
- * Template parameter should be class that derives from @see ListenerEvent.
- */
-template<class EventClass>
-class ListenerEventEmitter : private DPL::Noncopyable
-{
-  public:
-    typedef EventClass EventType;
-    typedef DPL::SharedPtr<EventType> EventPtrType;
-    typedef ListenerEventEmitter<EventType> Type;
-    typedef typename ListenerEvent<EventType>::PrivateDataType
-    EventPrivateDataType;
-    typedef typename ListenerEvent<EventType>::PrivateDataTypePtr
-    EventPrivateDataTypePtr;
-    typedef EventListener<EventType> ListenerType;
-    typedef uintptr_t IdType;
-
-    /**
-     * Empty (NULL) value of emitter's Id.
-     */
-    static const IdType emptyId;
-
-  public:
-    ListenerEventEmitter() : m_listener(NULL)
-    {}
-
-  public:
-    virtual ~ListenerEventEmitter()
-    {}
-
-    /**
-     * Sets event's private data.
-     * Event's private data object has to implement @see IEventPrivateData
-     * interface.
-     * @param data Private data.
-     * @remarks Practically private dat should be only set at object creation
-     * and
-     *          not chaged during this object lifetime.
-     */
-    virtual void setEventPrivateData(const EventPrivateDataTypePtr& data)
-    {
-        DPL::Mutex::ScopedLock lock(&m_mtx);
-        m_privateData = data;
-    }
-
-    /**
-     * Gets event's private data.
-     * @return Private data.
-     */
-    virtual EventPrivateDataTypePtr getEventPrivateData()
-    {
-        DPL::Mutex::ScopedLock lock(&m_mtx);
-        return m_privateData;
-    }
-
-    /**
-     * Sets listener.
-     * Object set as listener has to implement @see EventListener interface.
-     * @param listener Listener object.
-     * @remarks Doesn't take ownership over this object.
-     *          It's suggested to use singletons to have one listener for all
-     *          events (no dynamic allocation overhead).
-     */
-    virtual void setListener(ListenerType* listener)
-    {
-        DPL::Mutex::ScopedLock lock(&m_mtx);
-        m_listener = listener;
-    }
-
-    /**
-     * Emits event.
-     * @param event Event to emit.
-     */
-    virtual void emit(const EventPtrType& event)
-    {
-        DPL::Mutex::ScopedLock lock(&m_mtx);
-        EventPtrType copy(new EventType(*event.Get()));
-        if (m_listener) {
-            copy->setPrivateData(m_privateData);
-            m_listener->postAnswer(copy);
-        }
-    }
-
-    /**
-     * Gets id.
-     * @return Event's id.
-     * @remarks Id is implemented as value of `this` pointer.
-     */
-    virtual IdType getId()
-    {
-        return reinterpret_cast<IdType>(this);
-    }
-
-  protected:
-    DPL::Mutex m_mtx; ///< Mutex for thread-safety.
-    ListenerType* m_listener; ///< Event listener object.
-    EventPrivateDataTypePtr m_privateData; ///< Private data.
-};
-
-template<class EventClass>
-const typename ListenerEventEmitter<EventClass>::IdType ListenerEventEmitter<
-    EventClass>::emptyId = 0;
-}
-} // WrtDeviceApisCommon
-
-#endif // WRTDEVICEAPIS_COMMONS_LISTENER_EVENT_EMITTER_H_
diff --git a/src_mobile/Commons/Range.h b/src_mobile/Commons/Range.h
deleted file mode 100644 (file)
index ab731e1..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * 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.
- */
-/**
- * @author          Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
- */
-
-#ifndef WRTDEVICEAPIS_COMMONS_RANGE_H_
-#define WRTDEVICEAPIS_COMMONS_RANGE_H_
-
-namespace WrtDeviceApis {
-namespace Commons {
-/**
- * Stores data describing a range of values.
- */
-template<typename Type>
-struct Range
-{
-    /**
-     * Type of value.
-     */
-    typedef Type ValueType;
-
-    /**
-     * Value representing minimum.
-     */
-    ValueType min;
-
-    /**
-     * Value representing maximum.
-     */
-    ValueType max;
-};
-}
-} // WrtDeviceApisCommon
-
-#endif // WRTDEVICEAPIS_COMMONS_RANGE_H_
diff --git a/src_mobile/Commons/Regex.cpp b/src_mobile/Commons/Regex.cpp
deleted file mode 100644 (file)
index 9284d3f..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * 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 <pcrecpp.h>
-#include "Regex.h"
-
-namespace WrtDeviceApis {
-namespace Commons {
-bool validate(const std::string &pattern,
-              const std::string &value,
-              unsigned int options)
-{
-    pcrecpp::RE_Options pcreOpt;
-    if (options & VALIDATE_MATCH_CASELESS) {
-        pcreOpt.set_caseless(true);
-    }
-    pcrecpp::RE re(pattern, pcreOpt);
-    if (options & VALIDATE_MATCH_FULL) {
-        return re.FullMatch(value);
-    }
-    return re.PartialMatch(value);
-}
-
-std::string filter(const std::string &pattern,
-                   const std::string &value)
-{
-    pcrecpp::RE re(pattern);
-    std::string ret = static_cast<std::string>(value);
-    re.GlobalReplace("", &ret);
-    return ret;
-}
-
-std::string toUpper(const std::string &value)
-{
-    pcrecpp::RE re(LOWER_P);
-    std::string ret = static_cast<std::string>(value);
-    re.GlobalReplace(UPPER_P, &ret);
-    return ret;
-}
-}
-} // WrtDeviceApisCommon
diff --git a/src_mobile/Commons/Regex.h b/src_mobile/Commons/Regex.h
deleted file mode 100644 (file)
index f6c046b..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRTDEVICEAPIS_COMMONS_REGEX_H_
-#define WRTDEVICEAPIS_COMMONS_REGEX_H_
-
-#include <string>
-
-namespace WrtDeviceApis {
-namespace Commons {
-const unsigned int VALIDATE_MATCH_CASELESS = 0x0001;     //use when you want to
-                                                         // make caseless match
-const unsigned int VALIDATE_MATCH_FULL = 0x0002;         //use when you want
-                                                         // supplied text
-                                                         // matches a supplied
-                                                         // pattern exactly
-const std::string LOWER_P = "p";
-const std::string UPPER_P = "P";
-
-/**
- * Validates value against pattern
- * @param pattern Regexp pattern
- * @param value String to validate
- * @param options Modifiers for a match.
- * @return True when value is matched against pattern
- */
-bool validate(const std::string &pattern,
-              const std::string &value,
-              unsigned int options = 0);
-
-/**
- * Filter value against pattern(Any character except "0-9+#*Pp" will be removed
- * from value)
- * @param pattern Regexp pattern
- * @param value String to be filtered
- * @return filtered value
- */
-std::string filter(const std::string &pattern,
-                   const std::string &value);
-
-/**
- * Replace character "p" in value by "P"
- * @param value String to be replaced
- * @return replaced value
- */
-std::string toUpper(const std::string &value);
-}
-} // WrtDeviceApisCommon
-
-#endif // WRTDEVICEAPIS_COMMONS_REGEX_H_
diff --git a/src_mobile/Commons/RegexPatterns.h b/src_mobile/Commons/RegexPatterns.h
deleted file mode 100644 (file)
index 3c9ceb6..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRTDEVICEAPIS_COMMONS_REGEX_PATTERNS_H_
-#define WRTDEVICEAPIS_COMMONS_REGEX_PATTERNS_H_
-
-#include <string>
-
-namespace WrtDeviceApis {
-namespace Commons {
-const std::string PATTERN_PHONE_NUMBER_FILTER("[^0-9+#*Pp]");
-const std::string PATTERN_PHONE_NUMBER("^[0-9#+*]+$");
-const std::string PATTERN_PHONE_NUMBER_P("^\\+?[0-9#*Pp]*[0-9][0-9#*Pp]*$");
-const std::string PATTERN_PHONE_NUMBER_PW("^[0-9#+*PpWw]+$");
-}
-} // WrtDeviceApisCommon
-
-#endif // WRTDEVICEAPIS_COMMONS_REGEX_PATTERNS_H_
diff --git a/src_mobile/Commons/RegexUtils.cpp b/src_mobile/Commons/RegexUtils.cpp
deleted file mode 100644 (file)
index db749e7..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * 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 "RegexUtils.h"
-#include <pcrecpp.h>
-#include "StringUtils.h"
-
-namespace WrtDeviceApis {
-namespace Commons {
-std::string addStartPositionMark(const std::string &value)
-{
-    if (!String::startsWith(value, "^") && !String::startsWith(value, ".*")) {
-        return "^" + value;
-    }
-    return value;
-}
-
-std::string addEndPositionMark(const std::string &value)
-{
-    if ((!String::endsWith(value, "$") || String::endsWith(value, "\\$")) &&
-        !String::endsWith(value, ".*"))
-    {
-        return value + "$";
-    }
-    return value;
-}
-
-std::string addStartAndEndPositionMark(const std::string &value)
-{
-    return addEndPositionMark(addStartPositionMark(value));
-}
-
-std::string preparePercent(const std::string& str)
-{
-    std::string result = escape(str);
-    pcrecpp::RE("(([^\\\\])\\*|^()\\*)").GlobalReplace("\\2\\\\*", &result);
-    pcrecpp::RE("(([^\\\\])%|^()%)").GlobalReplace("\\2.*", &result);
-    return result;
-}
-
-std::string prepareAsterisk(const std::string& str)
-{
-    std::string result = escape(str);
-    // Replaces single wildcard "*" with version more compliant with Perl
-    // regular exrepssions, i.e. ".*".
-    pcrecpp::RE("(([^\\\\])\\*|^()\\*)").GlobalReplace("\\2.*", &result);
-    return result;
-}
-
-std::string escape(const std::string& str)
-{
-    std::string result = str;
-    // Escape standard regular expressions' metacharacters,
-    // i.e.: \, ., -, +, ?, (, ), [, ], ^, $, |
-    const char* metas = "(\\.|\\-|\\+|\\?|\\(|\\)|\\[|\\]|\\^|\\$|\\|"
-                        "|(\\\\[^\\*\\%]|\\\\$))";        // \*, \% won't get
-                                                          // additional '\'
-    pcrecpp::RE(metas).GlobalReplace("\\\\\\1", &result);
-    return result;
-}
-}
-} // WrtDeviceApisCommon
diff --git a/src_mobile/Commons/RegexUtils.h b/src_mobile/Commons/RegexUtils.h
deleted file mode 100644 (file)
index a06e1cd..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRTDEVICEAPIS_COMMONS_REGEX_UTILS_H_
-#define WRTDEVICEAPIS_COMMONS_REGEX_UTILS_H_
-
-#include <string>
-
-namespace WrtDeviceApis {
-namespace Commons {
-/**
- * Adds ^ character at the beginning in proper way
- * @param value Regexp pattern
- * @return Proper regular expression's pattern.
- */
-std::string addStartPositionMark(const std::string &value);
-
-/**
- * Adds $ character at the end in proper way
- * @param value Regexp pattern
- * @return Proper regular expression's pattern.
- */
-std::string addEndPositionMark(const std::string &value);
-
-/**
- * Adds ^ character at the beginning and $ the end in proper way
- * @param value Regexp pattern
- * @return Proper regular expression's pattern.
- */
-std::string addStartAndEndPositionMark(const std::string &value);
-
-/**
- * Converts typical string with wildcard '%' to proper perl-like regular
- * expression's pattern.
- * @param str String that came from JS.
- * @return Proper regular expression's pattern.
- * @remarks Calling it twice will (probably?) cause double escaping.
- */
-std::string preparePercent(const std::string& str);
-
-/**
- * Converts typical string with wildcard '*' to proper perl-like regular
- * expression's pattern.
- * @param str String that came from JS.
- * @return Proper regular expression's pattern.
- * @remarks Calling it twice will (probably?) cause double escaping.
- */
-std::string prepareAsterisk(const std::string& str);
-
-/**
- * Escapes regex special characters.
- * @param str String to escape.
- * @return String with regex special characters escaped.
- */
-std::string escape(const std::string& str);
-}
-} // WrtDeviceApisCommon
-
-#endif // WRTDEVICEAPIS_COMMONS_REGEX_UTILS_H_
diff --git a/src_mobile/Commons/StaticAssert.h b/src_mobile/Commons/StaticAssert.h
deleted file mode 100644 (file)
index bbd19f2..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * 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        StaticAssert.h
- * @author      Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
- * @author      Grzegorz Krawczyk (g.krawczyk@samsung.com)
- * @version     0.1
- */
-
-#ifndef WRTDEVICEAPIS_COMMONS_STATIC_ASSERT_H
-#define WRTDEVICEAPIS_COMMONS_STATIC_ASSERT_H
-
-namespace WrtDeviceApis {
-namespace Commons {
-template<bool>
-struct CompileTimeChecker
-{
-    CompileTimeChecker(...);
-};
-
-template<>
-struct CompileTimeChecker<false> {};
-
-#define STATIC_CHECK(expr, msg) \
-    { \
-        class ERROR_##msg {}; \
-        CompileTimeChecker<(expr) != 0>((ERROR_##msg())); \
-    }
-
-/**
- * Define used to inform about errors in compilation time
- * useful in templates
- * @param msg - message to be displayed,
- * msg have to be a valid C++ identifier,
- * other way reported errors will be meaningless
- * @param C - instance of object which caused problem
- * error generated by compiler display type of C
- * */
-#define STATIC_ERROR(msg, C) \
-    { \
-        C->_##msg(); \
-    }
-}
-} // WrtDeviceApisCommon
-
-#endif // WRTDEVICEAPIS_COMMONS_STATIC_ASSERT_H
diff --git a/src_mobile/Commons/StringBuilder.cpp b/src_mobile/Commons/StringBuilder.cpp
deleted file mode 100644 (file)
index 7fb1cb9..0000000
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * 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.
- */
-/**
- * @author          Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
- */
-#include <sstream>
-#include "Exception.h"
-#include "StringBuilder.h"
-
-namespace WrtDeviceApis {
-namespace Commons {
-class StringBuilderImpl
-{
-  public:
-    StringBuilderImpl() : m_counter(1)
-    {}
-
-    void append(const std::string& str)
-    {
-        if (!(m_ss << str)) {
-            m_ss.clear();
-            ThrowMsg(PlatformException, "Couldn't append string.");
-        }
-    }
-
-    void append(const StringBuilderImpl* impl)
-    {
-        if (!(m_ss << impl->m_ss)) {
-            m_ss.clear();
-            ThrowMsg(PlatformException,
-                     "Couldn't append string builder.");
-        }
-    }
-
-    void addRef()
-    {
-        ++m_counter;
-    }
-
-    void deref()
-    {
-        if (0 == --m_counter) {
-            delete this;
-        }
-    }
-
-    StringBuilderImpl* clone()
-    {
-        if (1 == m_counter) {
-            return this;
-        }
-
-        --m_counter;
-
-        StringBuilderImpl* result = new StringBuilderImpl();
-        result->m_ss << m_ss;
-        return result;
-    }
-
-    std::string toString() const
-    {
-        return m_ss.str();
-    }
-
-  private:
-    std::stringstream m_ss;
-    unsigned int m_counter;
-};
-
-StringBuilder::StringBuilder() : m_impl(new StringBuilderImpl())
-{}
-
-StringBuilder::~StringBuilder()
-{
-    m_impl->deref();
-}
-
-StringBuilder::StringBuilder(const StringBuilder& other)
-{
-    other.m_impl->addRef();
-    m_impl = other.m_impl;
-}
-
-StringBuilder & StringBuilder::operator=(const StringBuilder& other)
-{
-    if (this == &other) {
-        return *this;
-    }
-
-    other.m_impl->addRef();
-
-    m_impl->deref();
-    m_impl = other.m_impl;
-
-    return *this;
-}
-
-StringBuilder& StringBuilder::append(const std::string& str)
-{
-    m_impl = m_impl->clone();
-    m_impl->append(str);
-    return *this;
-}
-
-StringBuilder& StringBuilder::append(const StringBuilder& builder)
-{
-    m_impl = m_impl->clone();
-    m_impl->append(builder.m_impl);
-    return *this;
-}
-
-std::string StringBuilder::toString() const
-{
-    return m_impl->toString();
-}
-}
-} // WrtDeviceApisCommon
diff --git a/src_mobile/Commons/StringBuilder.h b/src_mobile/Commons/StringBuilder.h
deleted file mode 100644 (file)
index fa12c37..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * 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.
- */
-/**
- * @author          Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
- */
-
-#ifndef WRTDEVICEAPIS_COMMONS_STRINGBUILDER_H_
-#define WRTDEVICEAPIS_COMMONS_STRINGBUILDER_H_
-
-#include <string>
-
-namespace WrtDeviceApis {
-namespace Commons {
-class StringBuilderImpl;
-
-class StringBuilder
-{
-  public:
-    StringBuilder();
-    StringBuilder(const StringBuilder& other);
-    ~StringBuilder();
-
-    StringBuilder& operator=(const StringBuilder& other);
-
-    StringBuilder& append(const std::string& str);
-    StringBuilder& append(const StringBuilder& builder);
-    std::string toString() const;
-
-  private:
-    StringBuilderImpl* m_impl;
-};
-}
-} // WrtDeviceApisCommon
-
-#endif // WRTDEVICEAPIS_COMMONS_STRINGBUILDER_H_
diff --git a/src_mobile/Commons/StringUtils.cpp b/src_mobile/Commons/StringUtils.cpp
deleted file mode 100644 (file)
index 0b432b6..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * 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 <cstring>
-#include <algorithm>
-#include <iterator>
-#include <new>
-#include "StringUtils.h"
-
-namespace WrtDeviceApis {
-namespace Commons {
-namespace String {
-std::string lTrim(const std::string& str)
-{
-    std::string result = str;
-    result.erase(result.begin(),
-                 std::find_if(result.begin(), result.end(),
-                              std::not1(std::ptr_fun<int, int>(std::isspace))));
-    return result;
-}
-
-std::string rTrim(const std::string& str)
-{
-    std::string result = str;
-    result.erase(std::find_if(result.rbegin(), result.rend(),
-                              std::not1(std::ptr_fun<int, int>(
-                                            std::isspace))).base(), result.end());
-    return result;
-}
-
-std::string trim(const std::string& str)
-{
-    return lTrim(rTrim(str));
-}
-
-bool startsWith(const std::string& str,
-                const std::string& startStr)
-{
-    return str.find(startStr) == 0;
-}
-
-bool endsWith(const std::string& str,
-              const std::string& endStr)
-{
-    std::size_t pos = str.rfind(endStr);
-    if (pos == std::string::npos) {
-        return false;
-    }
-    return pos == str.length() - endStr.length();
-}
-
-std::string unique(const std::string& str,
-                   const char needle)
-{
-    std::string result = str;
-
-    std::string::size_type pos = 0;
-    while ((pos = result.find_first_of(needle, pos)) < std::string::npos) {
-        std::string::size_type last = result.find_first_not_of(needle, pos);
-        if (last == std::string::npos) {
-            last = result.size();
-        }
-        if (last - pos > 1) {
-            result.erase(pos + 1, last - pos - 1);
-        }
-        pos = last;
-    }
-
-    return result;
-}
-
-bool inCStringArray(const std::string& needle,
-                    const char* stack[])
-{
-    while (*stack) {
-        if (needle == *stack) {
-            return true;
-        }
-        ++stack;
-    }
-    return false;
-}
-
-char* strdup(const char* str)
-{
-    char* result = ::strdup(str);
-    if (NULL == result) {
-        throw std::bad_alloc();
-    }
-    return result;
-}
-
-std::string merge(const std::vector<std::string>& strs,
-                  std::string::value_type delim)
-{
-    typedef std::vector<std::string> Strings;
-
-    std::ostringstream ss;
-    if (!strs.empty()) {
-        for (Strings::size_type i = 0; i < strs.size() - 1; ++i) {
-            ss << strs[i] << delim;
-        }
-        ss << strs.at(strs.size() - 1);
-    }
-    return ss.str();
-}
-
-std::vector<std::string> split(const std::string& str,
-                               std::string::value_type delim)
-{
-    std::vector<std::string> result;
-    std::string::size_type begin = 0, end = 0;
-    while ((end = str.find_first_of(delim, begin))) {
-        std::string part = (std::string::npos == end ?
-                            str.substr(begin) :
-                            str.substr(begin, end - begin));
-        if (!part.empty()) {
-            result.push_back(part);
-        }
-        if (std::string::npos == end) {
-            break;
-        }
-        begin = end + 1;
-    }
-    return result;
-}
-
-int toInt(const std::string& str)
-{
-    return convertTo<int>(str);
-}
-}
-}
-}
diff --git a/src_mobile/Commons/TimeUtils.cpp b/src_mobile/Commons/TimeUtils.cpp
deleted file mode 100644 (file)
index ce5cce8..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * 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   TimeUtils.h
- * @author Tae-Jeong Lee (taejeong.lee@samsung.com)
- */
-
-#include "TimeUtils.h"
-#include <unicode/ucal.h>
-
-namespace WrtDeviceApis {
-namespace Commons {
-namespace Time {
-struct tm* localtime_r(long long int* timep, struct tm* result)
-{
-    UErrorCode status = U_ZERO_ERROR;
-    UCalendar *cal;
-
-    if (!result || !timep) {
-        return NULL;
-    }
-
-    cal = ucal_open(NULL, 0, NULL, UCAL_DEFAULT, &status);
-
-    if (U_FAILURE(status)) {
-        return NULL;
-    }
-
-    ucal_setMillis(cal, (*timep * (double)1000.0), &status);
-
-    result->tm_sec = ucal_get(cal, UCAL_SECOND, &status);
-    result->tm_min = ucal_get(cal, UCAL_MINUTE, &status);
-    result->tm_hour = ucal_get(cal, UCAL_HOUR, &status);
-    result->tm_mday = ucal_get(cal, UCAL_DAY_OF_MONTH, &status);
-    result->tm_mon = ucal_get(cal, UCAL_MONTH, &status);
-    result->tm_year = ucal_get(cal, UCAL_YEAR, &status);
-    result->tm_wday = ucal_get(cal, UCAL_DAY_OF_WEEK, &status);
-    result->tm_yday = ucal_get(cal, UCAL_DAY_OF_YEAR, &status);
-    result->tm_isdst = ucal_get(cal, UCAL_DST_OFFSET, &status);
-
-    ucal_close(cal);
-
-    if (U_FAILURE(status)) {
-        return NULL;
-    } else {
-        return result;
-    }
-}
-}
-}
-}
diff --git a/src_mobile/Commons/TimeUtils.h b/src_mobile/Commons/TimeUtils.h
deleted file mode 100644 (file)
index de55e4c..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * 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   TimeUtils.h
- * @author Tae-Jeong Lee (taejeong.lee@samsung.com)
- */
-
-#ifndef WRTDEVICEAPIS_COMMONS_TIMEUTILS_H_
-#define WRTDEVICEAPIS_COMMONS_TIMEUTILS_H_
-
-#include <time.h>
-
-namespace WrtDeviceApis {
-namespace Commons {
-namespace Time {
-struct tm* localtime_r(long long int* timep, struct tm* result);
-}
-}
-}
-#endif
diff --git a/src_mobile/Commons/TypeTraits.h b/src_mobile/Commons/TypeTraits.h
deleted file mode 100644 (file)
index bcc98f7..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRTDEVICEAPIS_COMMONS_TYPE_TRAITS_H_
-#define WRTDEVICEAPIS_COMMONS_TYPE_TRAITS_H_
-
-#include <dpl/shared_ptr.h>
-
-namespace WrtDeviceApis {
-namespace Commons {
-template<typename T>
-struct IsNull
-{
-    static bool value(const T&)
-    {
-        return false;
-    }
-};
-
-template<typename T>
-struct IsNull<T*>
-{
-    static bool value(T* ptr)
-    {
-        return ptr == NULL;
-    }
-};
-
-template<typename Class>
-struct IsNull<DPL::SharedPtr<Class> >
-{
-    static bool value(const DPL::SharedPtr<Class>& ptr)
-    {
-        return ptr.Get() == NULL;
-    }
-};
-
-template<typename ... T>
-struct AlwaysFalse
-{
-    static const bool value = false;
-};
-}
-} // WrtDeviceApisCommon
-
-#endif // WRTDEVICEAPIS_COMMONS_TYPE_TRAITS_H_
diff --git a/src_mobile/Commons/TypesDeclaration.h b/src_mobile/Commons/TypesDeclaration.h
deleted file mode 100644 (file)
index 0f2dca2..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRTDEVICEAPIS_COMMONS_TYPES_DECLARATION_
-#define WRTDEVICEAPIS_COMMONS_TYPES_DECLARATION_
-
-#include <string>
-#include <vector>
-
-namespace WrtDeviceApis {
-namespace Commons {
-struct AceFeature
-{
-    AceFeature(const std::string& featName) : name(featName) {}
-    std::string name;
-};
-
-typedef std::vector <AceFeature> AceFeatures;
-
-struct AceDeviceCapParam
-{
-    AceDeviceCapParam(const std::string& parName,
-                      const std::string& parVal) : name(parName),
-        value(parVal)
-    {}
-
-    std::string name;
-    std::string value;
-};
-
-typedef std::vector <AceDeviceCapParam> AceDeviceCapParams;
-
-struct AceDeviceCapability
-{
-    AceDeviceCapability() {}
-    AceDeviceCapability(const std::string& name,
-                        const AceDeviceCapParams& params) :
-        devCapName(name),
-        devCapParams(params)
-    {}
-
-    std::string devCapName;
-    AceDeviceCapParams devCapParams;
-};
-
-typedef std::vector <AceDeviceCapability> AceDeviceCaps;
-
-struct AceFunction
-{
-    std::string name;
-    AceFeatures features;
-    AceDeviceCaps deviceCapabilities;
-};
-} // namespace Commons
-} // namespace WrtDeviceApis
-
-#endif
diff --git a/src_mobile/Commons/WrtAccess/WrtAccess.cpp b/src_mobile/Commons/WrtAccess/WrtAccess.cpp
deleted file mode 100644 (file)
index 766ca44..0000000
+++ /dev/null
@@ -1,280 +0,0 @@
-/*
- * 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.
- */
-/*
- * @author      Grzegorz Krawczyk (g.krawczyk@samsung.com)
- * @version     0.1
- * @brief
- */
-
-#include <memory>
-#include <sstream>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/types.h>
-
-#include <dpl/log/log.h>
-#include <dpl/log/secure_log.h>
-#include <dpl/scoped_array.h>
-#include <dpl/scoped_resource.h>
-#include <dpl/assert.h>
-#include <Commons/Exception.h>
-#include "WrtAccess.h"
-#include <ace_api_client.h>
-#include <dpl/singleton_safe_impl.h>
-
-#include "popup-runner.h"
-IMPLEMENT_SAFE_SINGLETON(WrtDeviceApis::Commons::WrtAccess)
-
-namespace {
-/**
- * Helper class - single parameter and its value
- */
-struct AceParam
-{
-    const char *name;
-    const char *value;
-
-    AceParam() :
-        name(NULL), value(NULL)
-    {}
-
-    AceParam(const char *name, const char *value) :
-        name(name), value(value)
-    {}
-};
-
-/**
- * Helper class - list of params for single dev cap
- */
-struct AceParamList
-{
-    size_t count;
-    AceParam* param;
-    AceParamList() :
-        count(0),
-        param(NULL)
-    {}
-};
-
-struct DeviceCapParamPolicy
-{
-    typedef AceParamList* Type;
-    static Type NullValue()
-    {
-        return NULL;
-    }
-    static void Destroy(Type ptr)
-    {
-        if (ptr) {
-            delete[] ptr->param;
-        }
-        delete[] ptr;
-    }
-};
-
-/**
- * Helper class - modified ScopedArray for ace_param_list_t
- */
-class ScopedDeviceCapArray : public DPL::ScopedResource<DeviceCapParamPolicy>
-{
-  public:
-    explicit ScopedDeviceCapArray(AceParamList *ptr =
-                                      DeviceCapParamPolicy::NullValue()) :
-        DPL::ScopedResource<DeviceCapParamPolicy>(ptr)
-    {}
-
-    AceParamList & operator [](std::ptrdiff_t k) const
-    {
-        Assert(this->m_value != DeviceCapParamPolicy::NullValue() &&
-               "Dereference of scoped NULL array!");
-        Assert(k >= 0 && "Negative array index");
-
-        return this->m_value[k];
-    }
-};
-} // namespace
-
-namespace WrtDeviceApis {
-namespace Commons {
-WrtAccess::WrtAccess() :
-    m_sessionId(GenerateSessionId()),
-    m_pluginOwners(0)
-{}
-
-WrtAccess::~WrtAccess()
-{}
-
-WrtAccess::SessionId WrtAccess::GenerateSessionId()
-{
-    const size_t SESSION_ID_LENGTH = 32;
-
-    std::ostringstream pid;
-    pid << static_cast<int>(getpid());
-
-    std::string session_id = pid.str();
-
-    session_id.reserve(session_id.length() + SESSION_ID_LENGTH);
-
-    for (size_t i = 0; i < SESSION_ID_LENGTH; ++i) {
-        int c = random() % 16;
-
-        session_id += (c < 10 ?
-                       static_cast<char>('0' + c) :
-                       static_cast<char>('A' + c - 10));
-    }
-    return session_id;
-}
-
-void WrtAccess::initialize(int widgetId)
-{
-    _D("initialize");
-    if (widgetId < 0) {
-        _E("Invalid widget id");
-        Throw(Exception);
-    }
-
-    m_widgetId = widgetId;
-
-    if (!m_pluginOwners++) {
-        DPL::Log::LogSystemSingleton::Instance().SetTag("SECURITY_DAEMON");
-        ace_return_t ret = ace_client_initialize(Wrt::Popup::run_popup);
-        DPL::Log::LogSystemSingleton::Instance().SetTag("WRT_PLUGINS");
-        Assert(ACE_OK == ret);
-    }
-}
-
-void WrtAccess::deinitialize(int /*widgetId*/)
-{
-    _D("deinitialize");
-
-    if (!--m_pluginOwners) {
-        DPL::Log::LogSystemSingleton::Instance().SetTag("SECURITY_DAEMON");
-        ace_return_t ret = ace_client_shutdown();
-        DPL::Log::LogSystemSingleton::Instance().SetTag("WRT_PLUGINS");
-        Assert(ACE_OK == ret);
-    }
-}
-
-int WrtAccess::getWidgetId() const
-{
-    return m_widgetId;
-}
-
-WrtAccess::CheckAccessReturnType WrtAccess::checkAccessControl(const AceFunction& aceFunction) const
-{
-    Assert(
-        m_pluginOwners && "WrtAccessSingleton needs to be initialized with"
-                          "WidgetId during on_widget_start_callback in each plugin");
-    size_t deviceCount = aceFunction.deviceCapabilities.size();
-
-    DPL::ScopedArray <const char *> deviceScopedArray;
-    ScopedDeviceCapArray paramsScopedArray;
-
-    if (deviceCount) {
-        deviceScopedArray.Reset(new const char*[deviceCount]);
-        paramsScopedArray.Reset(new AceParamList[deviceCount]);
-
-        for (size_t i = 0; i < deviceCount; ++i) {
-            deviceScopedArray[i] =
-                aceFunction.deviceCapabilities.at(i).devCapName.c_str();
-            paramsScopedArray[i].count =
-                aceFunction.deviceCapabilities.at(i).devCapParams.size();
-
-            paramsScopedArray[i].param =
-                new AceParam[paramsScopedArray[i].count];
-
-            for (size_t j = 0; j < paramsScopedArray[i].count; ++j) {
-                paramsScopedArray[i].param[j].name =
-                    aceFunction.deviceCapabilities.at(i).
-                        devCapParams[j].name.c_str();
-                paramsScopedArray[i].param[j].value =
-                    aceFunction.deviceCapabilities.at(i).
-                        devCapParams[j].value.c_str();
-            }
-        }
-    }
-
-    size_t featuresCount = aceFunction.features.size();
-
-    DPL::ScopedArray <const char*> featureScopedArray;
-    if (featuresCount) {
-        featureScopedArray.Reset(new const char*[featuresCount]);
-
-        for (size_t i = 0; i < featuresCount; ++i) {
-            featureScopedArray[i] =
-                aceFunction.features.at(i).name.c_str();
-        }
-    }
-
-    _D("constructing ACE request");
-
-    ace_request_t aceRequest;
-    aceRequest.session_id =
-        const_cast<const ace_session_id_t>(m_sessionId.c_str());
-    aceRequest.widget_handle = getWidgetId();
-    aceRequest.feature_list.count = featuresCount;
-    aceRequest.feature_list.items =
-        const_cast<ace_string_t*>(featureScopedArray.Get());
-    aceRequest.dev_cap_list.count = deviceCount;
-    aceRequest.dev_cap_list.items = new ace_dev_cap_t[deviceCount];
-
-    const char**  devCapNames = deviceScopedArray.Get();
-    AceParamList* paramList = paramsScopedArray.Get();
-
-    unsigned int i;
-    for (i = 0; i < deviceCount; ++i) {
-        aceRequest.dev_cap_list.items[i].name =
-            const_cast<const ace_string_t>(devCapNames[i]);
-        aceRequest.dev_cap_list.items[i].param_list.count = paramList[i].count;
-        aceRequest.dev_cap_list.items[i].param_list.items =
-            new ace_param_t[paramList[i].count];
-        unsigned int j;
-        for (j = 0; j < paramList[i].count; ++j) {
-            aceRequest.dev_cap_list.items[i].param_list.items[j].name =
-                const_cast<ace_string_t>(paramList[i].param[j].name);
-            aceRequest.dev_cap_list.items[i].param_list.items[j].value =
-                const_cast<ace_string_t>(paramList[i].param[j].value);
-        }
-    }
-
-    ace_check_result_t aceCheckResult = ACE_PRIVILEGE_DENIED;
-    DPL::Log::LogSystemSingleton::Instance().SetTag("SECURITY_DAEMON");
-    ace_return_t ret = ace_check_access_ex(&aceRequest, &aceCheckResult);
-    DPL::Log::LogSystemSingleton::Instance().SetTag("WRT_PLUGINS");
-    for (i = 0; i < deviceCount; ++i) {
-        delete[] aceRequest.dev_cap_list.items[i].param_list.items;
-    }
-    delete[] aceRequest.dev_cap_list.items;
-
-    if (ACE_OK != ret) {
-        _E("Error in ace check: %d", static_cast<int>(ret));
-        return CHECK_ACCESS_INTERNAL_ERROR;
-    }
-
-    if (aceCheckResult == ACE_ACCESS_GRANTED) {
-        return CHECK_ACCESS_GRANTED;
-    }
-    else if (aceCheckResult == ACE_PRIVILEGE_DENIED) {
-        return CHECK_ACCESS_PRIVILEGE_DENIED;
-    }
-    else if (aceCheckResult == ACE_PRIVACY_DENIED) {
-        return CHECK_ACCESS_PRIVACY_DENIED;
-    }
-
-    return CHECK_ACCESS_INTERNAL_ERROR;
-}
-}
-} // WrtDeviceApisCommon
diff --git a/src_mobile/Commons/WrtAccess/WrtAccess.h b/src_mobile/Commons/WrtAccess/WrtAccess.h
deleted file mode 100644 (file)
index 18893a0..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * 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.
- */
-/*
- * @author      Grzegorz Krawczyk (g.krawczyk@samsung.com)
- * @version     0.1
- * @brief
- */
-
-#ifndef WRT_PLUGINS_WRT_ACCESS_H_
-#define WRT_PLUGINS_WRT_ACCESS_H_
-
-#include <string>
-
-#include <dpl/singleton.h>
-#include <Commons/TypesDeclaration.h>
-
-namespace WrtDeviceApis {
-namespace Commons {
-class WrtAccess
-{
- public:
-    enum CheckAccessReturnType
-    {
-        CHECK_ACCESS_GRANTED,
-        CHECK_ACCESS_PRIVILEGE_DENIED,
-        CHECK_ACCESS_PRIVACY_DENIED,
-        CHECK_ACCESS_INTERNAL_ERROR
-    };
-
-    void initialize(int widgetId);
-    void deinitialize(int widgetId);
-    int getWidgetId() const;
-    CheckAccessReturnType checkAccessControl(const AceFunction &aceFunction) const;
-
-  private:
-
-    typedef std::string SessionId;
-    SessionId GenerateSessionId();
-
-    WrtAccess();
-    virtual ~WrtAccess();
-
-    int m_widgetId;
-    SessionId m_sessionId;
-    size_t m_pluginOwners;
-
-
-    friend class DPL::Singleton<WrtAccess>;
-};
-
-typedef DPL::Singleton<WrtAccess> WrtAccessSingleton;
-}
-} // WrtDeviceApisCommon
-
-#endif //WRT_PLUGINS_WRT_ACCESS_H_
diff --git a/src_mobile/Commons/WrtAccess/config.cmake b/src_mobile/Commons/WrtAccess/config.cmake
deleted file mode 100644 (file)
index a31ce63..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-get_current_path()
-
-set(SRCS_WRT_ACCESS
-    ${CURRENT_PATH}/WrtAccess.cpp
-)
diff --git a/src_mobile/Commons/plugin_initializer_def.h b/src_mobile/Commons/plugin_initializer_def.h
deleted file mode 100644 (file)
index 73a6185..0000000
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * 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.
- */
-/*
- * @author      Karol Majewski (k.majewski@samsung.com)
- * @version     0.1
- * @brief       This is a file that you provides interface for wrt-engine while
- * loading and using plugin
- *              If you are a plugin developer you need to plugin_initializer.cpp
- * in your module and provide implementation for macros below
- */
-
-#ifndef WRTDEVICEAPIS_COMMONS_PLUGIN_INITIALIZER_DEF_H_
-#define WRTDEVICEAPIS_COMMONS_PLUGIN_INITIALIZER_DEF_H_
-
-#include <wrt_plugin_export.h>
-
-typedef java_script_context_t JavaScriptContext;
-
-#define EXPORT_SYMBOL __attribute__((__visibility__("default")))
-
-//DEFINES FOR GLOBAL OBJECTS AVAILABLE IN JAVASCRIPT
-/**
- * each object which declare this object as parent
- * will ba available as global object in javascript
- */
-#define WRT_JS_EXTENSION_OBJECT_GLOBAL  "GLOBAL_OBJECT"
-
-/**
- * global object bondi
- * */
-#define WRT_JS_EXTENSION_OBJECT_BONDI "bondi"
-
-/**
- * global object Widget
- * */
-#define WRT_JS_EXTENSION_OBJECT_WIDGET "Widget"
-
-/**
- * global object deviceapis
- * */
-#define WRT_JS_EXTENSION_OBJECT_DEVICEAPIS "deviceapis"
-
-/**
- * global object tizen
- * */
-#define WRT_JS_EXTENSION_OBJECT_TIZEN "tizen"
-
-//HAVE TO BE IMPLEMENTED IN EVERY PLUGIN
-/*
- * You have to(!) call this macro in your plugin_initializer.cpp(!) file
- * providing callback that will be called while loading each widget (for every
- * loaded widget this function will be called)
- *  Example:
- *       plugin_initializer.cpp
- *        void on_widget_start_callback(int widgetId, JSContextRef context,
- * const engine_interface_t *interface)
- *        {
- *          //...
- *        }
- *        PLUGIN_ON_WIDGET_START(on_widget_start_callback)
- */
-#define PLUGIN_ON_WIDGET_START(CALLBACK_NAME) extern "C" const \
-    on_widget_start_proc PLUGIN_WIDGET_START_PROC EXPORT_SYMBOL = CALLBACK_NAME;
-
-/*
- *  You have to(!) call this macro in your plugin_initializer.cpp(!) file
- *  providing callback that will be called while loading each widget
- * (for every loaded widget this function will be called)
- *  Example:
- *       plugin_initializer.cpp
- *        void on_widget_init_callback(feature_mapping_interface_t *mapping)
- *        {
- *          //...
- *        }
- *        PLUGIN_ON_WIDGET_INIT(on_widget_init_callback)
- */
-#define PLUGIN_ON_WIDGET_INIT(CALLBACK_NAME) extern "C" \
-    const on_widget_init_proc PLUGIN_WIDGET_INIT_PROC EXPORT_SYMBOL = \
-        CALLBACK_NAME;
-
-/*
- *  You have to(!) call this macro in your plugin_initializer.cpp(!) file
- * providing callback that will be called while unloading each widget (for
- * every unloaded widget this function will be called)
- *  Example:
- *        void on_widget_stop_callback(int widgetId)
- *        {
- *          //...
- *        }
- *        PLUGIN_ON_WIDGET_STOP(on_widget_stop_callback)
- */
-#define PLUGIN_ON_WIDGET_STOP(CALLBACK_NAME) extern "C" const \
-    on_widget_stop_proc PLUGIN_WIDGET_STOP_PROC EXPORT_SYMBOL = CALLBACK_NAME;
-
-/*
- *  You have to(!) call this macro in your plugin_initializer.cpp(!) file
- * providing callback that will be called while unloading each page (for every
- * loaded page, including nested page, this function will be called)
- *  Example:
- *        void on_frame_load_callback(java_script_context_t context)
- *        {
- *          //...
- *        }
- *        PLUGIN_ON_FRAME_LOAD(on_frame_load_callback)
- */
-#define PLUGIN_ON_FRAME_LOAD(CALLBACK_NAME) extern "C" const on_frame_load_proc \
-    PLUGIN_FRAME_LOAD_PROC EXPORT_SYMBOL = CALLBACK_NAME;
-
-/*
- *  You have to(!) call this macro in your plugin_initializer.cpp(!) file
- * providing callback that will be called while ununloading each page (for
- * every unloaded page, including nested page, this function will be called)
- *  Example:
- *        void on_frame_unload_callback(java_script_context_t context)
- *        {
- *          //...
- *        }
- *        PLUGIN_ON_FRAME_UNLOAD(on_frame_unload_callback)
- */
-#define PLUGIN_ON_FRAME_UNLOAD(CALLBACK_NAME) extern "C" const \
-    on_frame_unload_proc PLUGIN_FRAME_UNLOAD_PROC EXPORT_SYMBOL = CALLBACK_NAME;
-
-/*
- * You have to(!) define an array of structures in your
- * plugin_initializer.cpp(!) file describing a JS class (class_definition) and
- * it's parent class name (parent_name).
- * JS class will be bind to a parent class name (parent_name.jsclass_name).
- * Example:
- *    plugin_initializer.cpp
- *      PLUGIN_CLASS_MAP_BEGIN
- *          PLUGIN_CLASS_MAP_ADD_CLASS(
- *              "bondi",
- *              WrtPluginBondi::JSICameraManager::getClassInfo())
- *          PLUGIN_CLASS_MAP_ADD_CLASS(
- *              "bondi",
- *              WrtPluginBondi::JSICameraAnotherClass::getClassInfo())
- *      PLUGIN_CLASS_MAP_END
- *
- */
-#define PLUGIN_CLASS_MAP_BEGIN extern "C" const js_entity_definition_t \
-    PLUGIN_CLASS_MAP[] EXPORT_SYMBOL = {
-
-#define PLUGIN_CLASS_MAP_ADD_INTERFACE(PARENTNAME, \
-                                       INTERFACENAME, \
-                                       JSPRODUCTCLASSTEMPLATE, \
-                                       PRODUCTCONSTRUCTORCB, \
-                                       PRIVDATA) \
-    { PARENTNAME, INTERFACENAME, "", JSPRODUCTCLASSTEMPLATE, \
-      PRODUCTCONSTRUCTORCB, PRIVDATA },
-
-#define PLUGIN_CLASS_MAP_ADD_INTERFACE_PRODUCT(PARENTNAME, OBJECTNAME, \
-                                               INTERFACENAME, PRIVDATA) \
-    { PARENTNAME, OBJECTNAME, INTERFACENAME, NULL, NULL, PRIVDATA },
-
-#define PLUGIN_CLASS_MAP_ADD_CLASS(PARENTNAME, CLASSNAME, JSCLASSTEMPLATE, \
-                                   PRIVDATA) \
-    { PARENTNAME, CLASSNAME, "", JSCLASSTEMPLATE, NULL, PRIVDATA },
-
-#define PLUGIN_CLASS_MAP_END { NULL, NULL, NULL, NULL, NULL, NULL } };
-
-#define PLUGIN_CLASS_MAP_BEGIN_STATIC static const js_entity_definition_t \
-    PLUGIN_CLASS_MAP[] = {
-
-#define PLUGIN_GET_CLASS_MAP(CALLBACK_NAME) extern "C" const \
-    get_widget_entity_map_proc \
-    PLUGIN_GET_CLASS_PROC_MAP EXPORT_SYMBOL = CALLBACK_NAME;
-
-#endif // WRTDEVICEAPIS_COMMONS_PLUGIN_INITIALIZER_DEF_H_
diff --git a/src_mobile/CommonsJavaScript/CMakeLists.txt b/src_mobile/CommonsJavaScript/CMakeLists.txt
deleted file mode 100755 (executable)
index ecd0317..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-# 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.
-#
-macro(install_header_file HEADER_FILE)
-    INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${HEADER_FILE}
-        DESTINATION ${DESTINATION_HEADERS_JS})
-endmacro()
-
-
-pkg_search_module(webkit2 REQUIRED ewebkit2)
-
-set(TARGET_NAME ${TARGET_COMMONS_JAVASCRIPT})
-
-include_directories(${DIR_JS_COMMONS}
-                    ${wrt-plugin-api_INCLUDE_DIRS}
-                    ${webkit2_INCLUDE_DIRS}}
-                    )
-
-
-set(SRCS
-  ${CMAKE_CURRENT_SOURCE_DIR}/Converter.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/ScopedJSStringRef.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/JSCallbackManager.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/JSUtils.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/ScopedJSStringRef.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/Validator.cpp
-  # wrapper for simple version of aceCheckAcces
-  ${CMAKE_CURRENT_SOURCE_DIR}/Security/SecurityFunctionDeclaration.cpp
-  #ECMA Script Exception
-  ${CMAKE_CURRENT_SOURCE_DIR}/JSDOMException.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/DOMExceptionData.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/JSDOMExceptionFactory.cpp
-  #Pending Operation support
-  ${CMAKE_CURRENT_SOURCE_DIR}/JSPendingOperation.cpp
-)
-
-
-add_library(${TARGET_NAME} SHARED ${SRCS})
-target_link_libraries(${TARGET_NAME}
-        ${LIBS_COMMONS}
-        ${webkit2_LIBRARIES}
-        ${TARGET_COMMONS}
-)
-set_target_properties(${TARGET_NAME} PROPERTIES
- SOVERSION ${CMAKE_PROJECT_API_VERSION}
- VERSION ${CMAKE_PROJECT_VERSION}
-)
-
-INSTALL(TARGETS ${TARGET_NAME} LIBRARY DESTINATION ${DESTINATION_LIB_PREFIX})
-
-#utils
-install_header_file(PrivateObject.h)
-#tools
-install_header_file(Converter.h)
-install_header_file(Validator.h)
-install_header_file(JSUtils.h)
-install_header_file(ScopedJSStringRef.h)
-#callback manager
-install_header_file(JSCallbackManager.h)
-#exceptions
-install_header_file(JSDOMException.h)
-install_header_file(JSDOMExceptionFactory.h)
-install_header_file(DOMExceptionData.h)
-install_header_file(SecurityExceptions.h)
-#static declarations
-install_header_file(Security/StaticDeclaration.h)
-install_header_file(Security/SecurityFunctionDeclaration.h)
-#pending operation
-install_header_file(SupportPendingOperation.h)
-install_header_file(Utils.h)
-install_header_file(JSPendingOperation.h)
-install_header_file(JSPendingOperationPrivateObject.h)
-
diff --git a/src_mobile/CommonsJavaScript/Converter.cpp b/src_mobile/CommonsJavaScript/Converter.cpp
deleted file mode 100644 (file)
index cdaed58..0000000
+++ /dev/null
@@ -1,389 +0,0 @@
-/*
- * 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 <sstream>
-#include <limits>
-#include <dpl/scoped_array.h>
-#include <dpl/scoped_free.h>
-#include "ScopedJSStringRef.h"
-#include "Converter.h"
-#include <dpl/log/log.h>
-
-using namespace WrtDeviceApis::Commons;
-
-namespace WrtDeviceApis {
-namespace CommonsJavaScript {
-Converter::Converter(JSContextRef context) : m_context(context)
-{}
-
-Converter::~Converter()
-{}
-
-JSObjectRef Converter::toJSObjectRef(const JSValueRef& arg)
-{
-    if (!arg) {
-        Throw(NullPointerException);
-    }
-    JSValueRef exception = NULL;
-    JSObjectRef result = JSValueToObject(m_context, arg, &exception);
-    if ((NULL == result) || (NULL != exception)) {
-        ThrowMsg(ConversionException, "Couldn't convert to a JS Object.");
-    }
-    return result;
-}
-
-bool Converter::toBool(const JSValueRef& arg)
-{
-    return JSValueToBoolean(m_context, arg);
-}
-
-unsigned char Converter::toUChar(const JSValueRef& arg)
-{
-    return static_cast<unsigned char>(toChar(arg));
-}
-
-char Converter::toChar(const JSValueRef& arg)
-{
-    double tmp = toNumber_(arg);
-    return (isNan(tmp) ? 0 : static_cast<char>(tmp));
-}
-
-int Converter::toInt(const JSValueRef& arg)
-{
-    double tmp = toNumber_(arg);
-    return (isNan(tmp) ? 0 : static_cast<int>(tmp));
-}
-
-int Converter::toInt(const std::string &arg)
-{
-    return static_cast<int>(toNumber_(arg));
-}
-
-long Converter::toLong(const JSValueRef& arg)
-{
-    double tmp = toNumber_(arg);
-    return (isNan(tmp) ? 0 : static_cast<long>(tmp));
-}
-
-long long Converter::toLongLong(const JSValueRef& arg)
-{
-    double tmp = toNumber_(arg);
-    return (isNan(tmp) ? 0 : static_cast<long long>(tmp));
-}
-
-unsigned long Converter::toULong(const JSValueRef& arg)
-{
-    double tmp = toNumber_(arg);
-    return (isNan(tmp) ? 0 : static_cast<unsigned long>(tmp));
-}
-
-std::size_t Converter::toSizeT(const JSValueRef& arg)
-{
-    double tmp = toNumber_(arg);
-    return (isNan(tmp) ? 0 : static_cast<std::size_t>(tmp));
-}
-
-std::size_t Converter::toSizeT(const JSStringRef& arg)
-{
-    return static_cast<std::size_t>(toNumber_(arg));
-}
-
-double Converter::toDouble(const JSValueRef& arg)
-{
-    return toNumber_(arg);
-}
-
-std::string Converter::toString(int arg)
-{
-    return toString_(arg);
-}
-
-std::string Converter::toString(unsigned long arg)
-{
-    return toString_(arg);
-}
-
-std::string Converter::toString(long arg)
-{
-    return toString_(arg);
-}
-
-std::string Converter::toString(std::size_t arg)
-{
-    return toString_(arg);
-}
-
-std::string Converter::toString(const JSValueRef& arg)
-{
-    return toString_(arg);
-}
-
-std::string Converter::tryString(const JSValueRef& arg)
-{
-    if (!JSValueIsString(m_context, arg) &&
-        !JSValueIsNumber(m_context, arg) &&
-        !JSValueIsBoolean(m_context, arg))
-    {
-        ThrowMsg(ConversionException,
-                 "Argument is not convertable to JS String.");
-    }
-
-    return toString_(arg);
-}
-
-std::string Converter::toDateString(const JSValueRef& arg)
-{
-    if (!JSValueIsObject(m_context, arg)) {
-        ThrowMsg(ConversionException, "Argument is not JS Date.");
-    }
-
-    return toString_(arg);
-}
-
-std::string Converter::toString(const JSStringRef& arg)
-{
-    std::string result;
-    size_t jsSize = JSStringGetMaximumUTF8CStringSize(arg);
-    if (jsSize > 0) {
-        jsSize = jsSize + 1;
-        DPL::ScopedArray<char> buffer(new char[jsSize]);
-        size_t written = JSStringGetUTF8CString(arg, buffer.Get(), jsSize);
-        if (written > jsSize) {
-            ThrowMsg(ConversionException,
-                     "Conversion could not be fully performed.");
-        }
-        result = buffer.Get();
-    }
-
-    return result;
-}
-
-time_t Converter::toDateTimeT(const JSValueRef& arg)
-{
-    struct tm tm = toDateTm(arg);
-    return mktime(&tm);
-}
-
-tm Converter::toDateTm(const JSValueRef& arg)
-{
-    std::string stringDate = toDateString(arg);
-    struct tm result;
-    char* currentLocale = setlocale(LC_TIME, NULL);
-    if (currentLocale == NULL) {
-        ThrowMsg(ConversionException, "Couldn't get current locale.");
-    }
-    DPL::ScopedFree<char> currentLocaleCopy(strdup(currentLocale));
-    if (setlocale(LC_TIME, "C") == NULL) {
-        ThrowMsg(ConversionException, "Couldn't set POSIX locale.");
-    }
-    if (strptime(stringDate.c_str(), "%a %b %d %Y %T", &result) == NULL) {
-        ThrowMsg(ConversionException, "Couldn't convert supplied date.");
-    }
-    if (setlocale(LC_TIME, currentLocaleCopy.Get()) == NULL) {
-        ThrowMsg(ConversionException, "Couldn't set previous locale back.");
-    }
-    //strptime function doesn't affect tm_isdst flag.
-    //It may cause -1hr conversion error. Setting it to -1 informs that
-    //there is no information about daylight saving time.
-    result.tm_isdst = -1;
-    return result;
-}
-
-std::vector<unsigned char> Converter::toVectorOfUChars(const JSValueRef& arg)
-{
-    return toVectorOfT_(arg, &Converter::toUChar);
-}
-
-std::vector<char> Converter::toVectorOfChars(const JSValueRef& arg)
-{
-    return toVectorOfT_(arg, &Converter::toChar);
-}
-
-std::vector<int> Converter::toVectorOfInts(const JSValueRef& arg)
-{
-    return toVectorOfT_(arg, &Converter::toInt);
-}
-
-std::vector<std::string> Converter::toVectorOfStrings(const JSValueRef& arg)
-{
-    return toVectorOfT_(arg, &Converter::toString);
-}
-
-std::vector<time_t> Converter::toVectorOfTimeT(const JSValueRef& arg)
-{
-    return toVectorOfT_(arg, &Converter::toDateTimeT);
-}
-
-JSValueRef Converter::toJSValueRef(bool arg)
-{
-    return JSValueMakeBoolean(m_context, arg);
-}
-
-JSValueRef Converter::toJSValueRef(int arg)
-{
-    return JSValueMakeNumber(m_context, arg);
-}
-
-JSValueRef Converter::toJSValueRef(unsigned int arg)
-{
-    return JSValueMakeNumber(m_context, arg);
-}
-
-JSValueRef Converter::toJSValueRef(unsigned long arg)
-{
-    return JSValueMakeNumber(m_context, arg);
-}
-
-JSValueRef Converter::toJSValueRefLong(const long arg)
-{
-    return JSValueMakeNumber(m_context, arg);
-}
-
-JSValueRef Converter::toJSValueRef(long long int arg)
-{
-    return JSValueMakeNumber(m_context, arg);
-}
-
-JSValueRef Converter::toJSValueRef(double arg)
-{
-    return JSValueMakeNumber(m_context, arg);
-}
-
-JSValueRef Converter::toJSValueRef(const std::string& arg)
-{
-    JSValueRef result = NULL;
-    JSStringRef jsString = JSStringCreateWithUTF8CString(arg.c_str());
-    result = JSValueMakeString(m_context, jsString);
-    JSStringRelease(jsString);
-    return result;
-}
-
-JSValueRef Converter::toJSValueRef(const tm& arg)
-{
-    JSValueRef args[6];
-    args[0] = JSValueMakeNumber(m_context, arg.tm_year + 1900);
-    args[1] = JSValueMakeNumber(m_context, arg.tm_mon);
-    args[2] = JSValueMakeNumber(m_context, arg.tm_mday);
-    args[3] = JSValueMakeNumber(m_context, arg.tm_hour);
-    args[4] = JSValueMakeNumber(m_context, arg.tm_min);
-    args[5] = JSValueMakeNumber(m_context, arg.tm_sec);
-
-    JSValueRef exception = NULL;
-    JSObjectRef result = JSObjectMakeDate(m_context, 6, args, &exception);
-    if (NULL != exception) {
-        ThrowMsg(ConversionException, "Couldn't convert to a JS Date.");
-    }
-
-    return result;
-}
-
-JSValueRef Converter::toJSValueRef(const time_t arg)
-{
-    struct tm tminfo;
-    memset(&tminfo,0,sizeof(tminfo));
-    localtime_r(&arg, &tminfo);
-    return toJSValueRef(tminfo);
-}
-
-JSValueRef Converter::toJSValueRef(const std::vector<std::string>& arg)
-{
-    return toJSValueRef_(arg);
-}
-
-JSValueRef Converter::toJSValueRef(const char* arg)
-{
-    return toJSValueRef(std::string(arg));
-}
-
-JSValueRef Converter::toJSValueRef(const std::vector<int>& arg)
-{
-    return toJSValueRef_(arg);
-}
-
-JSValueRef Converter::toJSValueRef(const std::vector<time_t>& arg)
-{
-    return toJSValueRef_(arg);
-}
-
-JSValueRef Converter::toJSValueRef(JSValueRef arg)
-{
-    return arg;
-}
-
-JSValueRef Converter::toJSValueRef(const std::vector<JSValueRef>& arg)
-{
-    return toJSValueRef_(arg);
-}
-
-JSStringRef Converter::toJSStringRef(const std::string& arg)
-{
-    return JSStringCreateWithUTF8CString(arg.c_str());
-}
-
-double Converter::toNumber_(const JSStringRef& arg)
-{
-    return toNumber_(toString(arg));
-}
-
-double Converter::toNumber_(const std::string& arg)
-{
-    double result;
-    std::stringstream ss(arg);
-    if (!(ss >> result)) {
-        Throw(ConversionException);
-    }
-    return result;
-}
-
-double Converter::toNumber_(const JSValueRef& arg)
-{
-    JSValueRef exception = NULL;
-    double result = JSValueToNumber(m_context, arg, &exception);
-    if (NULL != exception) {
-        ThrowMsg(ConversionException, "Couldn't convert to a number.");
-    }
-    return result;
-}
-
-std::string Converter::toString_(const JSValueRef& arg)
-{
-    std::string result;
-
-    JSValueRef exception = NULL;
-    JSStringRef str = JSValueToStringCopy(m_context, arg, &exception);
-    if (NULL == str) {
-        ThrowMsg(ConversionException, "Couldn't cast to a string.");
-    }
-
-    size_t jsSize = JSStringGetMaximumUTF8CStringSize(str);
-    if (jsSize > 0) {
-        DPL::ScopedArray<char> buffer(new char[jsSize]);
-        JSStringGetUTF8CString(str, buffer.Get(), jsSize);
-        result = buffer.Get();
-    }
-    JSStringRelease(str);
-    return result;
-}
-
-bool Converter::isNan(double value) const
-{
-    // This should work unless -ffast-math (GCC) option is used.
-    STATIC_CHECK(std::numeric_limits<double>::is_iec559,
-                 NOT_IEEE754_REPRESENTATION);
-    return (value != value);
-}
-} // CommonsJavaScript
-} // WrtDeviceApis
-
diff --git a/src_mobile/CommonsJavaScript/DESCRIPTION b/src_mobile/CommonsJavaScript/DESCRIPTION
deleted file mode 100644 (file)
index 7f04546..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Common code
diff --git a/src_mobile/CommonsJavaScript/DOMExceptionData.cpp b/src_mobile/CommonsJavaScript/DOMExceptionData.cpp
deleted file mode 100644 (file)
index 3eb148a..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * 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 "DOMExceptionData.h"
-
-namespace WrtDeviceApis {
-namespace CommonsJavaScript {
-DOMExceptionData::DOMExceptionData(int code,
-                                   const std::string& message) :
-    m_code(code),
-    m_message(message)
-{}
-
-int DOMExceptionData::getCode() const
-{
-    return m_code;
-}
-
-std::string DOMExceptionData::getMessage() const
-{
-    return m_message;
-}
-} // CommonsJavaScript
-} // WrtDeviceApis
diff --git a/src_mobile/CommonsJavaScript/DOMExceptionData.h b/src_mobile/CommonsJavaScript/DOMExceptionData.h
deleted file mode 100644 (file)
index b6cd760..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRTDEVICEAPIS_COMMONSJAVASCRIPT_DOM_EXCEPTION_DATA_H_
-#define WRTDEVICEAPIS_COMMONSJAVASCRIPT_DOM_EXCEPTION_DATA_H_
-
-#include <string>
-#include <dpl/shared_ptr.h>
-
-namespace WrtDeviceApis {
-namespace CommonsJavaScript {
-class DOMExceptionData
-{
-  public:
-    explicit DOMExceptionData(int code,
-                              const std::string& message = std::string());
-
-    int getCode() const;
-    std::string getMessage() const;
-
-  private:
-    int m_code;
-    std::string m_message;
-};
-
-typedef DPL::SharedPtr<DOMExceptionData> DOMExceptionDataPtr;
-} // CommonsJavaScript
-} // WrtDeviceApis
-
-#endif // WRT_DOM_EXCEPTION_DATA_H_
diff --git a/src_mobile/CommonsJavaScript/JSCallbackManager.cpp b/src_mobile/CommonsJavaScript/JSCallbackManager.cpp
deleted file mode 100644 (file)
index 56373e3..0000000
+++ /dev/null
@@ -1,241 +0,0 @@
-/*
- * 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        JSCalendar.cpp
- * @author      Lukasz Marek (l.marek@samsung.com)
- * @version     0.1
- */
-
-#include "JSCallbackManager.h"
-#include <dpl/log/secure_log.h>
-
-namespace WrtDeviceApis {
-namespace CommonsJavaScript {
-JSCallbackManagerPtr JSCallbackManager::createObject(
-    JSContextRef context,
-    JSValueRef onSuccess,
-    JSValueRef onError,
-    bool
-    acceptJSNullAsOnSuccess,
-    bool acceptJSNullAsOnError)
-{
-    JSObjectRef l_onSuccess = NULL;
-    JSObjectRef l_onError = NULL;
-
-    if (NULL != onSuccess &&
-        (!acceptJSNullAsOnSuccess || !JSValueIsNull(context, onSuccess)))
-    {
-        l_onSuccess = JSValueToObject(context, onSuccess, NULL);
-        if (!l_onSuccess ||
-            !JSObjectIsFunction(context, l_onSuccess))
-        {
-            ThrowMsg(Commons::InvalidArgumentException,
-                     "success callback is not a function");
-        }
-    } else {
-        //LogWarning("onSuccessCallback is NULL and is not registred");
-    }
-    if (NULL != onError &&
-        (!acceptJSNullAsOnError || !JSValueIsNull(context, onError)))
-    {
-        l_onError = JSValueToObject(context, onError, NULL);
-        if (!l_onError ||
-            !JSObjectIsFunction(context, l_onError))
-        {
-            ThrowMsg(Commons::InvalidArgumentException,
-                     "error callback is not a function");
-        }
-    } else {
-        //LogWarning("onErrorCallback is NULL and is not registred");
-    }
-    return JSCallbackManagerPtr(new JSCallbackManager(context, l_onSuccess,
-                                                      l_onError));
-}
-
-JSCallbackManager::JSCallbackManager(JSContextRef context,
-                                     JSObjectRef onSuccess,
-                                     JSObjectRef onError) :
-    m_onSuccess(NULL),
-    m_onError(NULL),
-    m_context(context),
-    m_object(NULL)
-{
-    setOnSuccess(onSuccess);
-    setOnError(onError);
-}
-
-JSCallbackManager::~JSCallbackManager()
-{
-    if (m_onSuccess) {
-        JSValueUnprotect(m_context, m_onSuccess);
-    }
-
-    if (m_onError) {
-        JSValueUnprotect(m_context, m_onError);
-    }
-
-    if (m_object) {
-        JSValueUnprotect(m_context, m_object);
-    }
-}
-
-void JSCallbackManager::setOnSuccess(JSValueRef onSuccess)
-{
-    if (m_onSuccess != NULL) {
-        JSValueUnprotect(m_context, m_onSuccess);
-    }
-
-    if (onSuccess) {
-        m_onSuccess = JSValueToObject(m_context, onSuccess, NULL);
-    } else {
-        m_onSuccess = NULL;
-    }
-
-    if (m_onSuccess != NULL) {
-        JSValueProtect(m_context, m_onSuccess);
-    }
-}
-
-JSValueRef JSCallbackManager::getOnSuccess() const
-{
-    return m_onSuccess;
-}
-
-void JSCallbackManager::setOnError(JSValueRef onError)
-{
-    if (m_onError != NULL) {
-        JSValueUnprotect(m_context, m_onError);
-    }
-
-    if (onError) {
-        m_onError = JSValueToObject(m_context, onError, NULL);
-    } else {
-        m_onError = NULL;
-    }
-
-    if (m_onError != NULL) {
-        JSValueProtect(m_context, m_onError);
-    }
-}
-
-JSValueRef JSCallbackManager::getOnError() const
-{
-    return m_onError;
-}
-
-void JSCallbackManager::setObject(JSObjectRef object)
-{
-    if (m_object != NULL) {
-        JSValueUnprotect(m_context, m_object);
-    }
-
-    m_object = object;
-
-    if (m_object != NULL) {
-        JSValueProtect(m_context, m_object);
-    }
-}
-
-JSObjectRef JSCallbackManager::getObject() const
-{
-    return m_object;
-}
-
-void JSCallbackManager::setContext(JSContextRef context)
-{
-    m_context = context;
-}
-
-void JSCallbackManager::callOnSuccess()
-{
-    if (m_onSuccess == NULL) {
-        //LogDebug("Success callback is not set");
-        return;
-    }
-    makeCallback(m_context, NULL, m_onSuccess, NULL, 0);
-}
-
-void JSCallbackManager::callOnSuccess(JSValueRef obj)
-{
-    if (m_onSuccess == NULL) {
-        //LogDebug("Success callback is not set");
-        return;
-    }
-    JSValueRef objParam[1] = { obj };
-    makeCallback(m_context, NULL, m_onSuccess, objParam, 1);
-}
-
-void JSCallbackManager::callOnSuccess(JSValueRef obj[],
-                                      int paramCount)
-{
-    if (m_onSuccess == NULL) {
-        //LogDebug("Success callback is not set");
-        return;
-    }
-    makeCallback(m_context, NULL, m_onSuccess, obj, paramCount);
-}
-
-void JSCallbackManager::callOnError()
-{
-    if (m_onError == NULL) {
-        //LogDebug("Error callback is not set");
-        return;
-    }
-    makeCallback(m_context, NULL, m_onError, NULL, 0);
-}
-
-void JSCallbackManager::callOnError(JSValueRef obj)
-{
-    if (m_onError == NULL) {
-        //LogDebug("Error callback is not set");
-        return;
-    }
-    JSValueRef objParam[1] = { obj };
-    makeCallback(m_context, NULL, m_onError, objParam, 1);
-}
-
-void JSCallbackManager::callOnError(JSValueRef obj[],
-                                    int paramCount)
-{
-    if (m_onError == NULL) {
-        //LogDebug("Error callback is not set");
-        return;
-    }
-    makeCallback(m_context, NULL, m_onError, obj, paramCount);
-}
-
-void JSCallbackManager::makeCallback(JSContextRef context,
-                                     JSObjectRef object,
-                                     JSObjectRef callback,
-                                     JSValueRef argv[],
-                                     unsigned argc)
-{
-    if (callback == NULL) {
-        //LogError("callback is NULL");
-        return;
-    }
-
-    if (JSObjectIsFunction(context, callback)) {
-        if (argc == 0) {
-            JSObjectCallAsFunction(context, callback, object, 0, NULL, NULL);
-        } else {
-            JSObjectCallAsFunction(context, callback, object, argc, argv, NULL);
-        }
-        return;
-    }
-}
-}
-}
diff --git a/src_mobile/CommonsJavaScript/JSCallbackManager.h b/src_mobile/CommonsJavaScript/JSCallbackManager.h
deleted file mode 100644 (file)
index 457fe95..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * 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        JSCallbackManager.h
- * @author      Lukasz Marek (l.marel@samsung.com)
- * @version     0.1
- */
-
-#ifndef WRTDEVICEAPIS_COMMONSJAVASCRIPT_JS_CALLBACK_MANAGER_H_
-#define WRTDEVICEAPIS_COMMONSJAVASCRIPT_JS_CALLBACK_MANAGER_H_
-
-#include <dpl/shared_ptr.h>
-#include <Commons/IEvent.h>
-#include <JavaScriptCore/JavaScript.h>
-
-namespace WrtDeviceApis {
-namespace CommonsJavaScript {
-class JSCallbackManager;
-typedef DPL::SharedPtr<JSCallbackManager> JSCallbackManagerPtr;
-
-class JSCallbackManager : public WrtDeviceApis::Commons::IEventPrivateData
-{
-  private:
-    JSCallbackManager()
-    {}
-
-    /**
-     *  Used to create JSCallbackManagerPtr object by factory method
-     * createObject
-     */
-    JSCallbackManager(JSContextRef context,
-                      JSObjectRef onSuccess,
-                      JSObjectRef onError);
-
-  public:
-
-    //JSCallbackManager( JSContextRef context, JSValueRef onSuccess, JSValueRef
-    // onError );
-
-    /**
-     * Create JSCallbackManagerPtr object witch checking callback parameters
-     * if callbacks are NULL it was programmer intention to not use callback and
-     * no exception will be rised
-     * if callbacks are some object but not a function it will rise exception
-     * @param[in] context - global context
-     * @param[in] onSuccess - success callback (may be NULL if not needed)
-     * @param[in] onError   - error callback (may be NULL if not needed)
-     * @param[in] acceptJSNullAsOnSuccess - converts JSNull on onSuccess to NULL
-     * when true
-     * @param[in] acceptJSNullAsOnError   - converts JSNull on onError to NULL
-     * when true
-     * @throw Commons::InvalidArgumentException - if callback is not null and is
-     * not a js function
-     */
-    static JSCallbackManagerPtr createObject(
-        JSContextRef context,
-        JSValueRef onSuccess = NULL,
-        JSValueRef onError = NULL,
-        bool acceptJSNullAsOnSuccess = false,
-        bool acceptJSNullAsOnError = false);
-
-    virtual ~JSCallbackManager();
-
-    void setContext(JSContextRef context);
-
-    JSContextRef getContext() const
-    {
-        return m_context;
-    }
-
-    void setOnSuccess(JSValueRef onSuccess);
-    JSValueRef getOnSuccess() const;
-    void setOnError(JSValueRef onError);
-    JSValueRef getOnError() const;
-    void setObject(JSObjectRef object);
-    JSObjectRef getObject() const;
-
-    void callOnSuccess();
-    void callOnSuccess(JSValueRef obj);
-    void callOnSuccess(JSValueRef obj[], int paramCount);
-
-    void callOnError();
-    void callOnError(JSValueRef obj);
-    void callOnError(JSValueRef obj[], int paramCount);
-
-  private:
-    void makeCallback(JSContextRef context,
-                      JSObjectRef object,
-                      JSObjectRef callback,
-                      JSValueRef argv[],
-                      unsigned argc);
-
-    JSObjectRef m_onSuccess;
-    JSObjectRef m_onError;
-    JSContextRef m_context;
-    JSObjectRef m_object;
-};
-
-bool isCallback(JSContextRef ctx,
-                JSValueRef value,
-                JSValueRef* exception);
-}
-}
-
-#endif // WRTDEVICEAPIS_COMMONSJAVASCRIPT_JS_CALLBACK_MANAGER_H_
diff --git a/src_mobile/CommonsJavaScript/JSDOMException.cpp b/src_mobile/CommonsJavaScript/JSDOMException.cpp
deleted file mode 100644 (file)
index ffee065..0000000
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * 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 "JSDOMException.h"
-
-#include <dpl/log/log.h>
-
-#include "Converter.h"
-
-namespace {
-const char* PLUGIN_NAME = "DOMException";
-const char* PROPERTY_CODE = "code";
-const char* PROPERTY_MESSAGE = "message";
-
-struct Error
-{
-    const char* name;
-    const unsigned short value;
-};
-// This array CAN'T be left empty!
-const Error PROPERTY_ERROR[] = {
-    { "UNKNOWN_ERR",
-      WrtDeviceApis::CommonsJavaScript::JSDOMException::UNKNOWN_ERR },
-    { "INDEX_SIZE_ERR",
-      WrtDeviceApis::CommonsJavaScript::JSDOMException::INDEX_SIZE_ERR },
-    { "DOMSTRING_SIZE_ERR",
-      WrtDeviceApis::CommonsJavaScript::JSDOMException::DOMSTRING_SIZE_ERR },
-    { "HIERARCHY_REQUEST_ERR",
-      WrtDeviceApis::CommonsJavaScript::JSDOMException::
-          HIERARCHY_REQUEST_ERR },
-    { "WRONG_DOCUMENT_ERR",
-      WrtDeviceApis::CommonsJavaScript::JSDOMException::WRONG_DOCUMENT_ERR },
-    { "INVALID_CHARACTER_ERR",
-      WrtDeviceApis::CommonsJavaScript::JSDOMException::
-          INVALID_CHARACTER_ERR },
-    { "NO_DATA_ALLOWED_ERR",
-      WrtDeviceApis::CommonsJavaScript::JSDOMException::
-          NO_DATA_ALLOWED_ERR },
-    { "NO_MODIFICATION_ALLOWED_ERR",
-      WrtDeviceApis::CommonsJavaScript::JSDOMException::
-          NO_MODIFICATION_ALLOWED_ERR },
-    { "NOT_FOUND_ERR",
-      WrtDeviceApis::CommonsJavaScript::JSDOMException::NOT_FOUND_ERR },
-    { "NOT_SUPPORTED_ERR",
-      WrtDeviceApis::CommonsJavaScript::JSDOMException::NOT_SUPPORTED_ERR },
-    { "INUSE_ATTRIBUTE_ERR",
-      WrtDeviceApis::CommonsJavaScript::JSDOMException::
-          INUSE_ATTRIBUTE_ERR },
-    { "INVALID_STATE_ERR",
-      WrtDeviceApis::CommonsJavaScript::JSDOMException::INVALID_STATE_ERR },
-    { "SYNTAX_ERR",
-      WrtDeviceApis::CommonsJavaScript::JSDOMException::SYNTAX_ERR },
-    { "INVALID_MODIFICATION_ERR",
-      WrtDeviceApis::CommonsJavaScript::JSDOMException::
-          INVALID_MODIFICATION_ERR },
-    { "NAMESPACE_ERR",
-      WrtDeviceApis::CommonsJavaScript::JSDOMException::NAMESPACE_ERR },
-    { "INVALID_ACCESS_ERR",
-      WrtDeviceApis::CommonsJavaScript::JSDOMException::INVALID_ACCESS_ERR },
-    { "VALIDATION_ERR",
-      WrtDeviceApis::CommonsJavaScript::JSDOMException::VALIDATION_ERR },
-    { "TYPE_MISMATCH_ERR",
-      WrtDeviceApis::CommonsJavaScript::JSDOMException::TYPE_MISMATCH_ERR },
-    { "SECURITY_ERR",
-      WrtDeviceApis::CommonsJavaScript::JSDOMException::SECURITY_ERR },
-    { "NETWORK_ERR",
-      WrtDeviceApis::CommonsJavaScript::JSDOMException::NETWORK_ERR },
-    { "ABORT_ERR",
-      WrtDeviceApis::CommonsJavaScript::JSDOMException::ABORT_ERR },
-    { "TIMEOUT_ERR",
-      WrtDeviceApis::CommonsJavaScript::JSDOMException::TIMEOUT_ERR },
-    { "INVALID_VALUES_ERR",
-      WrtDeviceApis::CommonsJavaScript::JSDOMException::INVALID_VALUES_ERR },
-    { "IO_ERR",
-      WrtDeviceApis::CommonsJavaScript::JSDOMException::IO_ERR },
-    { "QUOTA_EXCEEDED_ERR",
-      WrtDeviceApis::CommonsJavaScript::JSDOMException::QUOTA_EXCEEDED_ERR }
-};
-} // namespace
-
-namespace WrtDeviceApis {
-namespace CommonsJavaScript {
-JSClassRef JSDOMException::m_classRef = NULL;
-
-JSClassDefinition JSDOMException::m_classInfo = {
-    0,
-    kJSClassAttributeNone,
-    PLUGIN_NAME,
-    0,
-    m_properties,
-    NULL, //__function,
-    initialize,
-    finalize,
-    hasProperty,
-    getProperty,
-    NULL, //SetProperty,
-    NULL, //DeleteProperty,
-    getPropertyNames,
-    NULL, //CallAsFunction,
-    NULL, //CallAsConstructor,
-    hasInstance,
-    NULL, //ConvertToType,
-};
-
-JSStaticValue JSDOMException::m_properties[] = {
-    { PROPERTY_CODE, getStaticProperty, NULL, kJSPropertyAttributeReadOnly },
-    { PROPERTY_MESSAGE, getStaticProperty, NULL, kJSPropertyAttributeReadOnly },
-    { 0, 0, 0, 0 }
-};
-
-const JSClassDefinition* JSDOMException::getClassInfo()
-{
-    return &m_classInfo;
-}
-
-JSClassRef JSDOMException::getClassRef()
-{
-    if (!m_classRef) {
-        m_classRef = JSClassCreate(&m_classInfo);
-    }
-    return m_classRef;
-}
-
-void JSDOMException::initialize(JSContextRef /*context*/,
-                                JSObjectRef /*object*/)
-{}
-
-void JSDOMException::finalize(JSObjectRef object)
-{
-    PrivateObject* privateObject =
-        static_cast<PrivateObject*>(JSObjectGetPrivate(object));
-    if (privateObject) {
-        JSObjectSetPrivate(object, NULL);
-        delete privateObject;
-    }
-}
-
-bool JSDOMException::hasProperty(JSContextRef /*context*/,
-                                 JSObjectRef /*object*/,
-                                 JSStringRef propertyName)
-{
-    const size_t size = sizeof(PROPERTY_ERROR) / sizeof(PROPERTY_ERROR[0]);
-    for (size_t i = 0; i < size; ++i) {
-        if (JSStringIsEqualToUTF8CString(propertyName,
-                                         PROPERTY_ERROR[i].name))
-        {
-            return true;
-        }
-    }
-    return false;
-}
-
-JSValueRef JSDOMException::getStaticProperty(JSContextRef context,
-                                             JSObjectRef object,
-                                             JSStringRef propertyName,
-                                             JSValueRef* /*exception*/)
-{
-    PrivateObject* privateObject =
-        static_cast<PrivateObject*>(JSObjectGetPrivate(object));
-    if (!privateObject) {
-        LogError("Private object is not set.");
-        return JSValueMakeUndefined(context);
-    }
-
-    Converter converter(context);
-    try {
-        if (JSStringIsEqualToUTF8CString(propertyName, PROPERTY_CODE)) {
-            return converter.toJSValueRef(privateObject->getObject()->getCode());
-        } else if (JSStringIsEqualToUTF8CString(propertyName,
-                                                PROPERTY_MESSAGE))
-        {
-            return converter.toJSValueRef(
-                       privateObject->getObject()->getMessage());
-        }
-    } catch (const Commons::ConversionException& ex) {
-        LogError("Exception: " << ex.GetMessage());
-    }
-
-    return JSValueMakeUndefined(context);
-}
-
-JSValueRef JSDOMException::getProperty(JSContextRef context,
-                                       JSObjectRef /*object*/,
-                                       JSStringRef propertyName,
-                                       JSValueRef* /*exception*/)
-{
-    Converter converter(context);
-    try {
-        std::string prop = converter.toString(propertyName);
-
-        const size_t size = sizeof(PROPERTY_ERROR) / sizeof(PROPERTY_ERROR[0]);
-        for (size_t i = 0; i < size; ++i) {
-            if (prop == PROPERTY_ERROR[i].name) {
-                return converter.toJSValueRef(PROPERTY_ERROR[i].value);
-            }
-        }
-    } catch (const Commons::ConversionException& ex) {
-        LogError("Exception: " << ex.GetMessage());
-    }
-
-    return JSValueMakeUndefined(context);
-}
-
-void JSDOMException::getPropertyNames(
-    JSContextRef /*context*/,
-    JSObjectRef /*object*/,
-    JSPropertyNameAccumulatorRef accumulator)
-{
-    const size_t size = sizeof(PROPERTY_ERROR) / sizeof(PROPERTY_ERROR[0]);
-    for (size_t i = 0; i < size; ++i) {
-        JSPropertyNameAccumulatorAddName(accumulator,
-                                         JSStringCreateWithUTF8CString(
-                                             PROPERTY_ERROR[i].name));
-    }
-}
-
-bool JSDOMException::hasInstance(JSContextRef context,
-                                 JSObjectRef /*constructor*/,
-                                 JSValueRef possibleInstance,
-                                 JSValueRef* /*exception*/)
-{
-    return JSValueIsObjectOfClass(context, possibleInstance, getClassRef());
-}
-} // CommonsJavaScript
-} // WrtDeviceApis
-
diff --git a/src_mobile/CommonsJavaScript/JSDOMException.h b/src_mobile/CommonsJavaScript/JSDOMException.h
deleted file mode 100644 (file)
index dcea1e4..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRTDEVICEAPIS_COMMONSJAVASCRIPT_JS_DOM_EXCEPTION_H_
-#define WRTDEVICEAPIS_COMMONSJAVASCRIPT_JS_DOM_EXCEPTION_H_
-
-#include <JavaScriptCore/JavaScript.h>
-#include <CommonsJavaScript/PrivateObject.h>
-#include <CommonsJavaScript/DOMExceptionData.h>
-
-namespace WrtDeviceApis {
-namespace CommonsJavaScript {
-class JSDOMException
-{
-  public:
-    typedef PrivateObjectT<DOMExceptionDataPtr>::Type PrivateObject;
-
-  public:
-    static const unsigned short UNKNOWN_ERR = 0;
-    static const unsigned short INDEX_SIZE_ERR = 1;
-    static const unsigned short DOMSTRING_SIZE_ERR = 2;
-    static const unsigned short HIERARCHY_REQUEST_ERR = 3;
-    static const unsigned short WRONG_DOCUMENT_ERR = 4;
-    static const unsigned short INVALID_CHARACTER_ERR = 5;
-    static const unsigned short NO_DATA_ALLOWED_ERR = 6;
-    static const unsigned short NO_MODIFICATION_ALLOWED_ERR = 7;
-    static const unsigned short NOT_FOUND_ERR = 8;
-    static const unsigned short NOT_SUPPORTED_ERR = 9;
-    static const unsigned short INUSE_ATTRIBUTE_ERR = 10;
-    static const unsigned short INVALID_STATE_ERR = 11;
-    static const unsigned short SYNTAX_ERR = 12;
-    static const unsigned short INVALID_MODIFICATION_ERR = 13;
-    static const unsigned short NAMESPACE_ERR = 14;
-    static const unsigned short INVALID_ACCESS_ERR = 15;
-    static const unsigned short VALIDATION_ERR = 16;
-    static const unsigned short TYPE_MISMATCH_ERR = 17;
-    static const unsigned short SECURITY_ERR = 18;
-    static const unsigned short NETWORK_ERR = 19;
-    static const unsigned short ABORT_ERR = 20;
-    static const unsigned short TIMEOUT_ERR = 21;
-    static const unsigned short INVALID_VALUES_ERR = 22;
-    static const unsigned short IO_ERR = 100;
-
-    //TODO INVALID_VALUES_ERR has the same error code ??
-    static const unsigned short QUOTA_EXCEEDED_ERR = 22;
-
-  public:
-    static JSClassRef getClassRef();
-    /**
-     * Gets object's class description.
-     */
-    static const JSClassDefinition* getClassInfo();
-
-  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);
-
-    /**
-     * The callback invoked when getting a property's value.
-     */
-    static bool hasProperty(JSContextRef context,
-                            JSObjectRef object,
-                            JSStringRef propertyName);
-
-    /**
-     * The callback invoked when getting a property's value.
-     */
-    static JSValueRef getProperty(JSContextRef context,
-                                  JSObjectRef object,
-                                  JSStringRef propertyName,
-                                  JSValueRef* exception);
-
-    /**
-     * The callback invoked when getting a property's value.
-     */
-    static JSValueRef getStaticProperty(JSContextRef context,
-                                        JSObjectRef object,
-                                        JSStringRef propertyName,
-                                        JSValueRef* exception);
-
-    static void getPropertyNames(JSContextRef context,
-                                 JSObjectRef object,
-                                 JSPropertyNameAccumulatorRef accumulator);
-
-    /**
-     * The callback invoked when an object is used as the target of an
-     * 'instanceof' expression.
-     */
-    static bool hasInstance(JSContextRef context,
-                            JSObjectRef constructor,
-                            JSValueRef possibleInstance,
-                            JSValueRef* exception);
-
-    /**
-     * This structure contains properties and callbacks that define a type of
-     * object.
-     */
-    static JSClassDefinition m_classInfo;
-
-    /**
-     * This structure describes a statically declared value property.
-     */
-    static JSStaticValue m_properties[];
-
-    static JSClassRef m_classRef;
-};
-} // CommonsJavaScript
-} // WrtDeviceApis
-
-#endif //
-
diff --git a/src_mobile/CommonsJavaScript/JSDOMExceptionFactory.cpp b/src_mobile/CommonsJavaScript/JSDOMExceptionFactory.cpp
deleted file mode 100644 (file)
index 94c1797..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * 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 "JSDOMExceptionFactory.h"
-
-#include <dpl/assert.h>
-#include <dpl/log/log.h>
-
-#include "JSUtils.h"
-#include "DOMExceptionData.h"
-#include "JSDOMException.h"
-
-namespace WrtDeviceApis {
-namespace CommonsJavaScript {
-#define DEFINE_JS_EXCEPTION_FACTORY(Class, Code) \
-    JSDOMExceptionFactory JSDOMExceptionFactory::Class(Code)
-
-DEFINE_JS_EXCEPTION_FACTORY(UnknownException, JSDOMException::UNKNOWN_ERR);
-DEFINE_JS_EXCEPTION_FACTORY(IndexSizeException, JSDOMException::INDEX_SIZE_ERR);
-DEFINE_JS_EXCEPTION_FACTORY(DomstringSizeException,
-                            JSDOMException::DOMSTRING_SIZE_ERR);
-DEFINE_JS_EXCEPTION_FACTORY(HierarchyRequestException,
-                            JSDOMException::HIERARCHY_REQUEST_ERR);
-DEFINE_JS_EXCEPTION_FACTORY(WrongDocumentException,
-                            JSDOMException::WRONG_DOCUMENT_ERR);
-DEFINE_JS_EXCEPTION_FACTORY(InvalidCharacterException,
-                            JSDOMException::INVALID_CHARACTER_ERR);
-DEFINE_JS_EXCEPTION_FACTORY(NoDataAllowedException,
-                            JSDOMException::NO_DATA_ALLOWED_ERR);
-DEFINE_JS_EXCEPTION_FACTORY(NoModificationAllowedException,
-                            JSDOMException::NO_MODIFICATION_ALLOWED_ERR);
-DEFINE_JS_EXCEPTION_FACTORY(NotFoundException, JSDOMException::NOT_FOUND_ERR);
-DEFINE_JS_EXCEPTION_FACTORY(NotSupportedException,
-                            JSDOMException::NOT_SUPPORTED_ERR);
-DEFINE_JS_EXCEPTION_FACTORY(InuseAttributeException,
-                            JSDOMException::INUSE_ATTRIBUTE_ERR);
-DEFINE_JS_EXCEPTION_FACTORY(InvalidStateException,
-                            JSDOMException::INVALID_STATE_ERR);
-DEFINE_JS_EXCEPTION_FACTORY(SyntaxException, JSDOMException::SYNTAX_ERR);
-DEFINE_JS_EXCEPTION_FACTORY(InvalidModificationException,
-                            JSDOMException::INVALID_MODIFICATION_ERR);
-DEFINE_JS_EXCEPTION_FACTORY(NamespaceException, JSDOMException::NAMESPACE_ERR);
-DEFINE_JS_EXCEPTION_FACTORY(InvalidAccessException,
-                            JSDOMException::INVALID_ACCESS_ERR);
-DEFINE_JS_EXCEPTION_FACTORY(ValidationException, JSDOMException::VALIDATION_ERR);
-DEFINE_JS_EXCEPTION_FACTORY(TypeMismatchException,
-                            JSDOMException::TYPE_MISMATCH_ERR);
-DEFINE_JS_EXCEPTION_FACTORY(SecurityException, JSDOMException::SECURITY_ERR);
-DEFINE_JS_EXCEPTION_FACTORY(NetworkException, JSDOMException::NETWORK_ERR);
-DEFINE_JS_EXCEPTION_FACTORY(AbortException, JSDOMException::ABORT_ERR);
-DEFINE_JS_EXCEPTION_FACTORY(TimeoutException, JSDOMException::TIMEOUT_ERR);
-DEFINE_JS_EXCEPTION_FACTORY(InvalidValuesException,
-                            JSDOMException::INVALID_VALUES_ERR);
-DEFINE_JS_EXCEPTION_FACTORY(IOException, JSDOMException::IO_ERR);
-DEFINE_JS_EXCEPTION_FACTORY(QuotaExceededException,
-                            JSDOMException::QUOTA_EXCEEDED_ERR);
-
-JSDOMExceptionFactory::JSDOMExceptionFactory(int code) : m_code(code)
-{}
-
-JSValueRef JSDOMExceptionFactory::make(JSContextRef context,
-                                       JSValueRef* exception,
-                                       const std::string& message)
-{
-    Assert(exception && "Exception object can't be NULL.");
-    JSDOMException::PrivateObject::ObjectType data(new DOMExceptionData(m_code,
-                                                                        message));
-    *exception = JSUtils::makeObject(context,
-                                     JSDOMException::getClassRef(),
-                                     data);
-    return JSValueMakeUndefined(context);
-}
-
-JSObjectRef JSDOMExceptionFactory::make(JSContextRef context,
-                                        const std::string& message)
-{
-    JSDOMException::PrivateObject::ObjectType data(new DOMExceptionData(m_code,
-                                                                        message));
-    return JSUtils::makeObject(context,
-                               JSDOMException::getClassRef(), data);
-}
-} // CommonsJavaScript
-} // WrtDeviceApis
diff --git a/src_mobile/CommonsJavaScript/JSDOMExceptionFactory.h b/src_mobile/CommonsJavaScript/JSDOMExceptionFactory.h
deleted file mode 100644 (file)
index 2bf8329..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRT_DOM_EXCEPTION_FACTORY_H_
-#define WRT_DOM_EXCEPTION_FACTORY_H_
-
-#include <string>
-#include <dpl/noncopyable.h>
-#include <JavaScriptCore/JavaScript.h>
-
-namespace WrtDeviceApis {
-namespace CommonsJavaScript {
-#define DECLARE_JS_EXCEPTION_FACTORY(Class) static JSDOMExceptionFactory Class
-
-class JSDOMExceptionFactory : public DPL::Noncopyable
-{
-  public:
-    DECLARE_JS_EXCEPTION_FACTORY(UnknownException);
-    DECLARE_JS_EXCEPTION_FACTORY(IndexSizeException);
-    DECLARE_JS_EXCEPTION_FACTORY(DomstringSizeException);
-    DECLARE_JS_EXCEPTION_FACTORY(HierarchyRequestException);
-    DECLARE_JS_EXCEPTION_FACTORY(WrongDocumentException);
-    DECLARE_JS_EXCEPTION_FACTORY(InvalidCharacterException);
-    DECLARE_JS_EXCEPTION_FACTORY(NoDataAllowedException);
-    DECLARE_JS_EXCEPTION_FACTORY(NoModificationAllowedException);
-    DECLARE_JS_EXCEPTION_FACTORY(NotFoundException);
-    DECLARE_JS_EXCEPTION_FACTORY(NotSupportedException);
-    DECLARE_JS_EXCEPTION_FACTORY(InuseAttributeException);
-    DECLARE_JS_EXCEPTION_FACTORY(InvalidStateException);
-    DECLARE_JS_EXCEPTION_FACTORY(SyntaxException);
-    DECLARE_JS_EXCEPTION_FACTORY(InvalidModificationException);
-    DECLARE_JS_EXCEPTION_FACTORY(NamespaceException);
-    DECLARE_JS_EXCEPTION_FACTORY(InvalidAccessException);
-    DECLARE_JS_EXCEPTION_FACTORY(ValidationException);
-    DECLARE_JS_EXCEPTION_FACTORY(TypeMismatchException);
-    DECLARE_JS_EXCEPTION_FACTORY(SecurityException);
-    DECLARE_JS_EXCEPTION_FACTORY(NetworkException);
-    DECLARE_JS_EXCEPTION_FACTORY(AbortException);
-    DECLARE_JS_EXCEPTION_FACTORY(TimeoutException);
-    DECLARE_JS_EXCEPTION_FACTORY(InvalidValuesException);
-    DECLARE_JS_EXCEPTION_FACTORY(IOException);
-    DECLARE_JS_EXCEPTION_FACTORY(QuotaExceededException);
-
-  public:
-    explicit JSDOMExceptionFactory(int code);
-
-    /**
-     * Creates exception object.
-     * @param context JS context of the exception.
-     * @param[out] exception Result object to which exception will be assigned.
-     * @return JS undefined value.
-     * @code
-     * JSValueRef JSClass::getProperty(JSContextRef context,
-     *                                 JSObjectRef object,
-     *                                 JSStringRef propertyName,
-     *                                 JSValueRef* exception)
-     * {
-     * ...
-     *   return JSExceptionFactory::InvalidArgumentException.make(context,
-     * exception);
-     * ...
-     * }
-     * @endcode
-     */
-    JSValueRef make(JSContextRef context,
-                    JSValueRef* exception,
-                    const std::string& message = std::string());
-
-    /**
-     * Creates exception object.
-     * @param context JS context of the exception.
-     * @return JS exception object.
-     * @code
-     * JSObjectRef jsError =
-     * JSExceptionFactory::InvalidArgumentException.make(context);
-     * @endcode
-     */
-    JSObjectRef make(JSContextRef context,
-                     const std::string& message = std::string());
-
-  private:
-    int m_code;
-};
-} // CommonsJavaScript
-} // WrtDeviceApis
-
-#endif //
diff --git a/src_mobile/CommonsJavaScript/JSUtils.cpp b/src_mobile/CommonsJavaScript/JSUtils.cpp
deleted file mode 100644 (file)
index f4c9c95..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * 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 "Converter.h"
-#include "ScopedJSStringRef.h"
-#include "JSUtils.h"
-
-namespace WrtDeviceApis {
-namespace CommonsJavaScript {
-using namespace WrtDeviceApis::Commons;
-
-bool JSUtils::hasProperty(JSStaticValue* properties,
-                          JSStringRef name)
-{
-    JSStaticValue* property = properties;
-    while (property->name) {
-        if (JSStringIsEqualToUTF8CString(name, property->name)) {
-            return true;
-        }
-        ++property;
-    }
-    return false;
-}
-
-JSValueRef JSUtils::getJSProperty(JSContextRef context,
-                                  JSValueRef jsValue,
-                                  const std::string &name,
-                                  JSValueRef *exception)
-{
-    ScopedJSStringRef jsPropName(JSStringCreateWithUTF8CString(name.c_str()));
-    Converter converter(context);
-    JSObjectRef jsObject = converter.toJSObjectRef(jsValue);
-    if (JSObjectHasProperty(context, jsObject, jsPropName.get())) {
-        return JSObjectGetProperty(context, jsObject,
-                                   jsPropName.get(), exception);
-    }
-    return NULL;
-}
-
-JSValueRef JSUtils::getJSProperty(JSContextRef context,
-                                  JSObjectRef object,
-                                  const std::string& name)
-{
-    Converter converter(context);
-    Try {
-        ScopedJSStringRef propName(converter.toJSStringRef(name));
-        if (JSObjectHasProperty(context, object, propName.get())) {
-            JSValueRef result = JSObjectGetProperty(context,
-                                                    object,
-                                                    propName.get(),
-                                                    NULL);
-            if (!JSValueIsUndefined(context, result)) {
-                return result;
-            }
-        }
-    }
-    Catch(ConversionException) {}
-    return NULL;
-}
-
-JSValueRef JSUtils::getJSPropertyOrUndefined(JSContextRef context,
-                                             JSObjectRef object,
-                                             const std::string& name)
-{
-    Converter converter(context);
-    Try {
-        ScopedJSStringRef propName(converter.toJSStringRef(name));
-        if (JSObjectHasProperty(context, object, propName.get())) {
-            return JSObjectGetProperty(context, object, propName.get(), NULL);
-        }
-    }
-    Catch(ConversionException) {}
-    return JSValueMakeUndefined(context);
-}
-} // CommonsJavaScript
-} // WrtDeviceApis
diff --git a/src_mobile/CommonsJavaScript/JSUtils.h b/src_mobile/CommonsJavaScript/JSUtils.h
deleted file mode 100644 (file)
index 5d835a1..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRTDEVICEAPIS_COMMONSJAVASCRIPT_JS_JSUTILS_H_
-#define WRTDEVICEAPIS_COMMONSJAVASCRIPT_JS_JSUTILS_H_
-
-#include <string>
-#include <dpl/log/log.h>
-#include <JavaScriptCore/JavaScript.h>
-#include <Commons/Exception.h>
-#include <CommonsJavaScript/PrivateObject.h>
-
-namespace WrtDeviceApis {
-namespace CommonsJavaScript {
-class JSUtils
-{
-  public:
-    static bool hasProperty(JSStaticValue* properties,
-                            JSStringRef name);
-
-    /**
-     * Gets a property from JSObject if exists
-     * @return JSValueRef if property exists, NULL if not
-     */
-    static JSValueRef getJSProperty(JSContextRef context,
-                                    JSValueRef jsValue,
-                                    const std::string &name,
-                                    JSValueRef* exception = NULL);
-
-    static JSValueRef getJSProperty(JSContextRef context,
-                                    JSObjectRef object,
-                                    const std::string& name);
-
-    static JSValueRef getJSPropertyOrUndefined(JSContextRef context,
-                                               JSObjectRef object,
-                                               const std::string& name);
-
-    template<class C>
-    static JSObjectRef makeObject(JSContextRef context,
-                                  JSClassRef classRef,
-                                  C data)
-    {
-        typedef typename PrivateObjectT<C>::Type Private;
-
-        Private* priv = new Private(context, data);
-        JSObjectRef object = JSObjectMake(context, classRef, priv);
-        if (!object) {
-            ThrowMsg(Commons::NullPointerException,
-                     "Could not create JS object.");
-        }
-
-        return object;
-    }
-
-    static JSObjectRef makeObject(JSContextRef context,
-                                  JSClassRef classRef)
-    {
-        typedef PrivateObjectT<void>::Type Private;
-
-        Private* priv = new Private(context);
-        JSObjectRef object = JSObjectMake(context, classRef, priv);
-        if (!object) {
-            ThrowMsg(Commons::NullPointerException,
-                     "Could not create JS object.");
-        }
-
-        return object;
-    }
-}; // JSUtils
-} // CommonsJavaScript
-} // WrtDeviceApis
-
-#endif /* WRTPLUGINS_COMMONS_JSUTILS_H_ */
diff --git a/src_mobile/CommonsJavaScript/ScopedJSStringRef.cpp b/src_mobile/CommonsJavaScript/ScopedJSStringRef.cpp
deleted file mode 100644 (file)
index 2f0c17f..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * 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 "ScopedJSStringRef.h"
-
-namespace WrtDeviceApis {
-namespace CommonsJavaScript {
-ScopedJSStringRef::ScopedJSStringRef(JSStringRef ref) : m_ref(ref)
-{}
-
-ScopedJSStringRef::~ScopedJSStringRef()
-{
-    if (m_ref != NULL) {
-        JSStringRelease(m_ref);
-    }
-}
-
-JSStringRef ScopedJSStringRef::get() const
-{
-    return m_ref;
-}
-} // CommonsJavaScript
-} // WrtDeviceApis
diff --git a/src_mobile/CommonsJavaScript/ScopedJSStringRef.h b/src_mobile/CommonsJavaScript/ScopedJSStringRef.h
deleted file mode 100644 (file)
index d18238a..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRTDEVICEAPIS_COMMONSJAVASCRIPT_SCOPEDJSSTRINGREF_H_
-#define WRTDEVICEAPIS_COMMONSJAVASCRIPT_SCOPEDJSSTRINGREF_H_
-
-#include <JavaScriptCore/JavaScript.h>
-#include <dpl/noncopyable.h>
-
-namespace WrtDeviceApis {
-namespace CommonsJavaScript {
-/**
- * Takes ownership over JSStringRef object to call JSSTringRelease on it
- * when this object goes out of scope.
- */
-class ScopedJSStringRef : private DPL::Noncopyable
-{
-  public:
-    /**
-     * Creates this class instance.
-     * @param ref JSStringRef to take ownership.
-     * @remarks Takes ownership.
-     */
-    ScopedJSStringRef(JSStringRef ref);
-
-    /**
-     * Destroys instance.
-     * @remarks Releases stored JSStringRef.
-     */
-    ~ScopedJSStringRef();
-
-    /**
-     * Gets stored JSStringRef.
-     * @return JSStringRef object.
-     * @remarks Doesn't pass ownership to caller.
-     */
-    JSStringRef get() const;
-
-  private:
-    JSStringRef m_ref;
-};
-} // CommonsJavaScript
-} // WrtDeviceApis
-
-#endif /* WRTDEVICEAPIS_COMMONSJAVASCRIPT_SCOPEDJSSTRINGREF_H_ */
diff --git a/src_mobile/CommonsJavaScript/Security/SecurityFunctionDeclaration.cpp b/src_mobile/CommonsJavaScript/Security/SecurityFunctionDeclaration.cpp
deleted file mode 100644 (file)
index 87111fd..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * 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 "SecurityFunctionDeclaration.h"
-#include <JavaScriptCore/JavaScript.h>
-
-namespace WrtDeviceApis {
-namespace CommonsJavaScript {
-AceSecurityStatus aceCheckAccessSimple(
-    WrtDeviceApis::Commons::AceFunction aceFunction)
-{
-    return aceCheckAccess2<DefaultArgsVerifier<> >(aceFunction);
-}
-}
-}
diff --git a/src_mobile/CommonsJavaScript/Security/SecurityFunctionDeclaration.h b/src_mobile/CommonsJavaScript/Security/SecurityFunctionDeclaration.h
deleted file mode 100644 (file)
index 8ad1987..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * 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.
- */
-#ifndef _FUNCTION_DECLARATION_
-#define _FUNCTION_DECLARATION_
-
-#include <string>
-#include <Commons/WrtAccess/WrtAccess.h>
-#include <Commons/Exception.h>
-#include <JavaScriptCore/JavaScript.h>
-#include <Commons/TypesDeclaration.h>
-#include <Commons/TypeTraits.h>
-#include <dpl/log/log.h>
-
-namespace WrtDeviceApis {
-namespace CommonsJavaScript {
-enum class AceSecurityStatus
-{
-    AccessGranted,
-    AccessDenied,
-    PrivacyDenied,
-    InternalError
-};
-
-template <typename ... Args>
-class DefaultArgsVerifier
-{
-  public:
-    void operator()(WrtDeviceApis::Commons::AceFunction& aceFunction,
-                    Args && ... args) const
-    {
-        static_assert(
-            WrtDeviceApis::Commons::AlwaysFalse<Args ...>::value,
-            "Please provide a specialization for these argument types!");
-    }
-};
-
-template <>
-class DefaultArgsVerifier<>
-{
-  public:
-    void operator()(WrtDeviceApis::Commons::AceFunction& /*aceFunction*/) const
-    {}
-};
-
-template <typename ArgumentsVerifier,
-          typename ... Args>
-AceSecurityStatus aceCheckAccess2(
-    WrtDeviceApis::Commons::AceFunction aceFunction,
-    Args && ... args)
-{
-    using namespace WrtDeviceApis::Commons;
-
-    ArgumentsVerifier argsVerify;
-    argsVerify(aceFunction, args ...);
-
-    WrtAccess::CheckAccessReturnType ret =
-        WrtAccessSingleton::Instance().checkAccessControl(aceFunction);
-
-    if (ret == WrtAccess::CHECK_ACCESS_PRIVILEGE_DENIED) {
-        LogError("Function is not allowed to run - AccessDenied");
-        return AceSecurityStatus::AccessDenied;
-    }
-    else if (ret == WrtAccess::CHECK_ACCESS_PRIVACY_DENIED) {
-        LogError("Function is not allowed to run - PrivacyDenied");
-        return AceSecurityStatus::PrivacyDenied;
-    }
-    else if (ret == WrtAccess::CHECK_ACCESS_INTERNAL_ERROR) {
-        LogError("InternalError");
-        return AceSecurityStatus::InternalError;
-    }
-
-    LogDebug("Function accepted!");
-
-    return AceSecurityStatus::AccessGranted;
-}
-
-//The simplest version
-AceSecurityStatus aceCheckAccessSimple(
-    WrtDeviceApis::Commons::AceFunction aceFunction);
-}
-}
-
-#endif // _FUNCTION_DECLARARION_
diff --git a/src_mobile/CommonsJavaScript/Security/StaticDeclaration.h b/src_mobile/CommonsJavaScript/Security/StaticDeclaration.h
deleted file mode 100644 (file)
index c089d50..0000000
+++ /dev/null
@@ -1,315 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef _WRTPLUGINS_COMMONS_SRC_COMMONS_STATICDECLARATIOS_H_
-#define _WRTPLUGINS_COMMONS_SRC_COMMONS_STATICDECLARATIOS_H_
-
-#include <map>
-#include <vector>
-#include <string>
-#include <string.h>
-#include <dpl/noncopyable.h>
-#include <dpl/assert.h>
-#include <dpl/foreach.h>
-#include <Commons/TypesDeclaration.h>
-#include <wrt-commons/wrt_plugin_export.h>
-
-namespace WrtDeviceApis {
-namespace CommonsJavaScript {
-template<typename ParamType,
-         typename DeviceCapType,
-         typename FunctionType>
-class StaticDeclarations : public DPL::Noncopyable
-{
-    struct FunctionTriplet {
-        const char* name;
-        std::vector<DeviceCapType> devCaps;
-        std::vector<const char*> features;
-    };
-
-  public:
-
-    typedef typename std::map<ParamType, const char*>  ParamsMap;
-
-    typedef std::map<DeviceCapType,
-                     std::pair<const char*,
-                               std::vector<ParamType> > >  DeviceCapsMaps;
-
-    typedef std::map<FunctionType, FunctionTriplet >  FunctionsMap;
-
-    typedef std::map<FunctionType, WrtDeviceApis::Commons::AceFunction>
-    AceFunctionsMap;
-
-    typedef std::map<std::string, std::vector<DeviceCapType> > FeaturesMap;
-
-    static const std::string getParamName(const ParamType& paramId)
-    {
-        auto it = m_params.find(paramId);
-
-        Assert(it != m_params.end() && "No such paramId");
-
-        return it->second;
-    }
-
-    /**
-     * Returns set of device capabilities WITHOUT params
-     * for given device capability id
-     * */
-    static WrtDeviceApis::Commons::AceDeviceCapability
-    getDeviceCapabilityWithoutParams(const DeviceCapType& devCapsId)
-    {
-        WrtDeviceApis::Commons::AceDeviceCapability deviceCap;
-        auto it = m_deviceCaps.find(devCapsId);
-
-        Assert(it != m_deviceCaps.end() && "No such device cap");
-
-        deviceCap.devCapName = it->second.first;
-
-        return deviceCap;
-    }
-
-    /**
-     * Returns set of device capabilities with set params
-     * for given device capability id
-     * */
-    static WrtDeviceApis::Commons::AceDeviceCapability
-    getDeviceCapability(const DeviceCapType& devCapsId)
-    {
-        auto it = m_deviceCaps.find(devCapsId);
-
-        Assert(it != m_deviceCaps.end() && "No such dev-cap found");
-
-        WrtDeviceApis::Commons::AceDeviceCapability deviceCap;
-        deviceCap.devCapName = it->second.first;
-
-        FOREACH(paramIt, it->second.second)
-        {
-            WrtDeviceApis::Commons::AceDeviceCapParam param(
-                getParamName(*paramIt),
-                std::string());
-
-            deviceCap.devCapParams.push_back(param);
-        }
-
-        return deviceCap;
-    }
-
-    static void addDeviceCapabilty(
-        const DeviceCapType& devCapsId,
-        WrtDeviceApis::Commons::AceFunction& aceFunction)
-    {
-        aceFunction.deviceCapabilities.push_back(
-            getDeviceCapability(devCapsId));
-    }
-
-    /**
-     * Returns names of device-capabilities base on capability id
-     */
-    static std::string getDevCapNameById(DeviceCapType devCapId)
-    {
-        auto it = m_deviceCaps.find(devCapId);
-        Assert(it != m_deviceCaps.end() && "No such devcapid found!");
-        return it->second.first;
-    }
-
-    /**
-     * Sets parameter value for given paramId
-     */
-    static bool setParamValue(WrtDeviceApis::Commons::AceFunction& function,
-                              ParamType paramId,
-                              DeviceCapType devCapId,
-                              const std::string& value)
-    {
-        //get name of the deviceCaps
-        std::string devCapName = getDevCapNameById(devCapId);
-        std::string paramName = getParamName(paramId);
-
-        //search throw all the device capabilities
-        FOREACH(devCapIt, function.deviceCapabilities) {
-            if (devCapIt->devCapName == devCapName) {
-                //device capability has been found
-                //check params
-                FOREACH(devParamIt, devCapIt->devCapParams) {
-                    if (devParamIt->name == paramName) {
-                        devParamIt->value = value;
-                        return true;
-                    }
-                }
-            }
-        }
-        return false;
-    }
-    /**
-     * Return struct Commons::AceFunction with set function name
-     *
-     * To set device capabilities you may use setDeviceCap function
-     * To set param value function you may use setParamValue Function
-     * */
-    static WrtDeviceApis::Commons::AceFunction getEmptyFunction(
-        const FunctionType& functionId)
-    {
-        WrtDeviceApis::Commons::AceFunction function;
-        auto it = m_functions.find(functionId);
-        Assert(it != m_functions.end() && "No such a function");
-        function.name = it->second.first;
-
-        return function;
-    }
-
-    /**
-     * The most useful Function
-     * Return Commons::AceFunction with filled all required fields:
-     * name, device caps and proper param namespace
-     *
-     * To set param value function you may use setParamValue function
-     * */
-    static WrtDeviceApis::Commons::AceFunction getSecurityFunction(
-        const FunctionType& functionId)
-    {
-        WrtDeviceApis::Commons::AceFunction function;
-        auto it = m_functions.find(functionId);
-        Assert(it != m_functions.end() && "No such function found!");
-
-        function.name = it->second.name;
-
-        FOREACH(featIt, it->second.features)
-        function.features.push_back(std::string(*featIt));
-
-        FOREACH(devCapIt, it->second.devCaps) {
-            function.deviceCapabilities.push_back(
-                getDeviceCapability(*devCapIt));
-        }
-        return function;
-    }
-
-    /**
-     * To create static map
-     * */
-    static void createStaticAceFunctions()
-    {
-        FOREACH(functionIt, m_functions)
-        {
-            m_aceFunctions[functionIt->first] =
-                getSecurityFunction(functionIt->first);
-        }
-    }
-
-    static feature_mapping_t* getFeaturesToDevCapMapping()
-    {
-        feature_mapping_t* mapping = new feature_mapping_t;
-
-        mapping->featuresCount = m_features.size();
-        mapping->features = new feature_devcaps_t[mapping->featuresCount];
-
-        size_t i = 0;
-
-        FOREACH(featureIt, m_features)
-        {
-            mapping->features[i].feature_name =
-                strndup(featureIt->first.c_str(), featureIt->first.size() + 1);
-
-            mapping->features[i].devCaps.devCapsCount =
-                featureIt->second.size();
-
-            mapping->features[i].devCaps.deviceCaps =
-                new char*[mapping->features[i].devCaps.devCapsCount];
-
-            for (size_t j = 0;
-                 j < mapping->features[i].devCaps.devCapsCount;
-                 ++j)
-            {
-                std::string dc = getDevCapNameById(featureIt->second[j]);
-
-                mapping->features[i].devCaps.deviceCaps[j] =
-                    strndup(dc.c_str(), dc.size() + 1);
-            }
-
-            ++i;
-        }
-
-        return mapping;
-    }
-
-    static const devcaps_t* devcapsGetter(pfeature_mapping_t feats,
-                                          const char* featureName)
-    {
-        Assert(featureName && "Trying to extract info about NULL api feature");
-
-        std::string feature(featureName);
-
-        devcaps_t* ret = NULL;
-
-        for (size_t i = 0; i < feats->featuresCount; ++i) {
-            Assert(feats->features &&
-                   feats->features[i].feature_name &&
-                   "NULL api feature in feature mapping");
-
-            std::string feat(feats->features[i].feature_name);
-
-            if (feature == feat) {
-                ret = &(feats->features[i].devCaps);
-                break;
-            }
-        }
-
-        return ret;
-    }
-
-    static void featuresDeinitializer(feature_mapping_t* mapping)
-    {
-        if (mapping) {
-            if (mapping->features) {
-                for (size_t i = 0; i < mapping->featuresCount; ++i) {
-                    free(mapping->features[i].feature_name);
-
-                    devcaps_t& dc = mapping->features[i].devCaps;
-
-                    if (dc.deviceCaps) {
-                        for (size_t j = 0; j < dc.devCapsCount; ++j) {
-                            free(dc.deviceCaps[j]);
-                        }
-
-                        delete[] dc.deviceCaps;
-                    }
-                }
-                delete[] mapping->features;
-            }
-            delete mapping;
-        }
-    }
-
-    static void getMappingInterface(feature_mapping_interface_t *mapping)
-    {
-        if (mapping) {
-            mapping->featGetter =
-                StaticDeclarations::getFeaturesToDevCapMapping;
-            mapping->dcGetter = StaticDeclarations::devcapsGetter;
-            mapping->release = StaticDeclarations::featuresDeinitializer;
-        }
-    }
-
-  private:
-    static ParamsMap m_params;
-    static DeviceCapsMaps m_deviceCaps;
-    static FunctionsMap m_functions;
-    static AceFunctionsMap m_aceFunctions;
-
-    static FeaturesMap m_features;
-};
-}
-}
-
-#endif
diff --git a/src_mobile/CommonsJavaScript/SecurityExceptions.h b/src_mobile/CommonsJavaScript/SecurityExceptions.h
deleted file mode 100644 (file)
index ffc111b..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef WRTDEVICEAPIS_COMMONSJAVASCRIPT_JS_SECURITYEXCEPTIONS_H_
-#define WRTDEVICEAPIS_COMMONSJAVASCRIPT_JS_SECURITYEXCEPTIONS_H_
-
-#include <JavaScriptCore/JavaScript.h>
-#include "JSDOMExceptionFactory.h"
-
-namespace WrtDeviceApis {
-namespace CommonsJavaScript {
-/**
- * synchronously checks access status and throws JS Security exception if
- * necessary
- */
-#define SYNC_ACCESS_STATUS_HANDLER(status, context, exception)                 \
-    do {                                                                       \
-        switch (status)                                                        \
-        {                                                                      \
-        case AceSecurityStatus::InternalError:                                 \
-            return JSDOMExceptionFactory::UnknownException.make(                  \
-                       context, exception);                                    \
-            break;                                                             \
-                                                                               \
-        case AceSecurityStatus::AccessDenied:                                  \
-            return JSDOMExceptionFactory::SecurityException.make(                 \
-                       context, exception);                                    \
-            break;                                                             \
-                                                                               \
-        default:                                                               \
-            break;                                                             \
-        } \
-    } while (0)
-
-/**
- * checks access status and returns an error through JSCallbackManager if
- * necessary
- */
-#define ASYNC_CBM_ACCESS_STATUS_HANDLER(status, context, cbm)                  \
-    do {                                                                       \
-        switch (status)                                                        \
-        {                                                                      \
-        case AceSecurityStatus::InternalError:                                 \
-            cbm->callOnError(JSDOMExceptionFactory::UnknownException.make(        \
-                                 context));                                    \
-            return JSValueMakeNull(context);                                   \
-                                                                               \
-        case AceSecurityStatus::AccessDenied:                                  \
-            cbm->callOnError(JSDOMExceptionFactory::SecurityException.make(       \
-                                 context));                                    \
-            return JSValueMakeNull(context);                                   \
-                                                                               \
-        default:                                                               \
-            break;                                                             \
-        }                                                                      \
-    } while (0)
-}
-}
-#endif /*WRTDEVICEAPIS_COMMONSJAVASCRIPT_JS_SECURITYEXCEPTIONS_H_ */
-
diff --git a/src_mobile/CommonsJavaScript/SupportPendingOperation.h b/src_mobile/CommonsJavaScript/SupportPendingOperation.h
deleted file mode 100644 (file)
index 05567e6..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * 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.
- */
-/*
- * @author      Grzegorz Krawczyk (g.krawczyk@samsung.com)
- * @version     0.1
- * @brief
- */
-
-#ifndef WRTDEVICEAPIS_COMMONSJAVASCRIPT_SUPPORT_PENDING_OPERATION_H_
-#define WRTDEVICEAPIS_COMMONSJAVASCRIPT_SUPPORT_PENDING_OPERATION_H_
-
-#include <dpl/optional.h>
-
-namespace WrtDeviceApis {
-namespace CommonsJavaScript {
-template<typename T>
-class SupportPendingOperation
-{
-  public:
-    virtual T getPendingOperation() const
-    {
-        return *m_operation;
-    }
-
-    virtual void setPendingOperation(const T& operation)
-    {
-        m_operation = operation;
-    }
-
-    bool checkPendingOperation() const
-    {
-        return !m_operation.IsNull();
-    }
-
-    virtual ~SupportPendingOperation(){}
-
-  protected:
-    DPL::Optional<T> m_operation;
-};
-}
-}
-
-#endif
diff --git a/src_mobile/CommonsJavaScript/Validator.cpp b/src_mobile/CommonsJavaScript/Validator.cpp
deleted file mode 100644 (file)
index e73d361..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * 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 "Validator.h"
-#include <list>
-#include <dpl/assert.h>
-#include "ScopedJSStringRef.h"
-#include "Converter.h"
-
-namespace WrtDeviceApis {
-namespace CommonsJavaScript {
-Validator::Validator(JSContextRef context,
-                     JSValueRef* exception) :
-    m_context(context),
-    m_exception(exception)
-{
-    Assert(NULL != m_context && "Context cannot be NULL.");
-}
-
-Validator::~Validator()
-{}
-
-bool Validator::isDate(const JSValueRef& arg)
-{
-    if (JSValueIsNull(m_context,
-                      arg) ||
-        JSValueIsUndefined(m_context,
-                           arg) || !JSValueIsObject(m_context, arg))
-    {
-        return false;
-    }
-    Converter converter(m_context);
-    Try
-    {
-        converter.toDateTm(arg);
-    }
-    Catch(Commons::ConversionException)
-    {
-        return false;
-    }
-    return true;
-}
-
-bool
-Validator::isCallback(const JSValueRef& arg)
-{
-    Converter converter(m_context);
-    return !JSValueIsNull(m_context, arg) &&
-           !JSValueIsUndefined(m_context, arg) &&
-           JSObjectIsFunction(m_context, converter.toJSObjectRef(arg));
-}
-
-bool
-Validator::checkArrayKeys(const std::vector<std::string> &allowed,
-                          JSValueRef argument)
-{
-    if (argument == NULL) {
-        return true;
-    }
-    if (!JSValueIsObject(m_context, argument)) {
-        return false;
-    }
-    JSObjectRef jsOptions = JSValueToObject(m_context, argument, NULL);
-    if (jsOptions == NULL) {
-        return false;
-    }
-    JSPropertyNameArrayRef jsProps = JSObjectCopyPropertyNames(m_context,
-                                                               jsOptions);
-    if (jsProps == NULL) {
-        // No properties found; and empty array.
-        return true;
-    }
-    size_t nCount = JSPropertyNameArrayGetCount(jsProps);
-    bool found;
-
-    std::list<JSStringRef> allowedJS;
-    for (size_t j = 0; j < allowed.size(); j++) {
-        allowedJS.push_back(JSStringCreateWithUTF8CString(allowed[j].c_str()));
-    }
-
-    for (size_t i = 0; i < nCount; i++) {
-        found = false;
-        for (std::list<JSStringRef>::const_iterator it = allowedJS.begin();
-             it != allowedJS.end();
-             ++it)
-        {
-            if (JSStringIsEqual(*it,
-                                JSPropertyNameArrayGetNameAtIndex(jsProps,
-                                                                  i)))
-            {
-                found = true;
-                break;
-            }
-        }
-        if (!found) {
-            for (size_t j = 0; j < allowed.size(); j++) {
-                JSStringRelease(allowedJS.front());
-                allowedJS.pop_front();
-            }
-            JSPropertyNameArrayRelease(jsProps);
-            return false;
-        }
-    }
-
-    for (size_t j = 0; j < allowed.size(); j++) {
-        JSStringRelease(allowedJS.front());
-        allowedJS.pop_front();
-    }
-    JSPropertyNameArrayRelease(jsProps);
-    return true;
-}
-
-bool Validator::isNullOrUndefined(const JSValueRef& arg)
-{
-    return (JSValueIsNull(m_context, arg) ||
-            JSValueIsUndefined(m_context, arg));
-}
-} // CommonsJavaScript
-} // WrtDeviceApis
diff --git a/src_mobile/DESCRIPTION b/src_mobile/DESCRIPTION
deleted file mode 100644 (file)
index bc2b1d7..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Main source folder
diff --git a/src_mobile/dispatch-event/dispatch_event_support.cpp b/src_mobile/dispatch-event/dispatch_event_support.cpp
deleted file mode 100755 (executable)
index 7d001a2..0000000
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * 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       dispatch_event_support.cpp
- * @author     Tae-Jeong Lee (taejeong.lee@samsung.com)
- * @version    0.1
- * @brief
- */
-
-#ifndef _DISPATCH_EVENT_SUPPORT_CPP_
-#define _DISPATCH_EVENT_SUPPORT_CPP_
-
-#include "dispatch_event_support.h"
-
-namespace DispatchEventSupport {
-
-static std::string getExceptionString(JSContextRef context, JSValueRef exception)
-{
-    if (exception)
-    {
-        JSStringRef jsString = JSValueToStringCopy(context, exception, NULL);
-        size_t bufSize = JSStringGetMaximumUTF8CStringSize(jsString);
-
-        char* buf = new char[bufSize];
-        JSStringGetUTF8CString(jsString, buf, bufSize);
-        JSStringRelease(jsString);
-
-        std::string ret = buf;
-        delete[] buf;
-
-        return ret;
-    }
-    else
-    {
-        return "NULL";
-    }
-}
-
-void dispatchAppServiceEvent(JSContextRef context, const float scale, const std::string bundle)
-{
-    LogDebug("DispatchTizenServiceEvent(" << context << ", " << scale << ", " << bundle << ")");
-
-    if (context != NULL)
-    {
-        std::stringstream script;
-
-        script << "var __event = document.createEvent(\"CustomEvent\");\n"
-               << "__event.initCustomEvent(\"appservice\", true, true);\n"
-               << "__event.scale = " << scale << ";\n"
-               << "__event.__bundle = \"" << bundle << "\";\n"
-               << "document.dispatchEvent(__event);\n"
-               << "\n"
-               << "for (var i=0; i < window.frames.length; i++)\n"
-               << "{ window.frames[i].document.dispatchEvent(__event); }";
-
-        // just for debugging
-        // LogDebug("script :\n" << script.str());
-
-        JSValueRef exception = NULL, ret = NULL;
-        JSStringRef jsScript = JSStringCreateWithUTF8CString(script.str().c_str());
-
-        ret = JSEvaluateScript(context, jsScript, NULL, NULL, 1, &exception);
-
-        JSStringRelease(jsScript);
-
-        LogDebug("JSEvaluateScript() - ret:" << ret << ", exception:" << exception << " (" << getExceptionString(context, exception) << ")");
-    }
-}
-
-void dispatchSoftKeyboardChangeEvent(JSContextRef context, const std::string state, const int width, const int height)
-{
-    LogDebug("dispatchSoftKeyboardChangeEvent(" << context << ", " << state << ", " << width << ", " << height << ")");
-
-    if (context != NULL)
-    {
-        std::stringstream script;
-
-        script << "var __event = document.createEvent(\"CustomEvent\");\n"
-               << "__event.initCustomEvent(\"softkeyboardchange\", true, true);\n"
-               << "__event.state = \"" << state << "\";\n"
-               << "__event.width = " << width << ";\n"
-               << "__event.height = " << height << ";\n"
-               << "document.dispatchEvent(__event);\n"
-               << "\n"
-               << "for (var i=0; i < window.frames.length; i++)\n"
-               << "{ window.frames[i].document.dispatchEvent(__event); }";
-
-        // just for debugging
-        // LogDebug("script :\n" << script.str());
-
-        JSValueRef exception = NULL, ret = NULL;
-        JSStringRef jsScript = JSStringCreateWithUTF8CString(script.str().c_str());
-
-        ret = JSEvaluateScript(context, jsScript, NULL, NULL, 1, &exception);
-
-        JSStringRelease(jsScript);
-
-        LogDebug("JSEvaluateScript() - ret:" << ret << ", exception:" << exception << " (" << getExceptionString(context, exception) << ")");
-    }
-}
-
-void dispatchStorageEvent(JSContextRef context,
-                          const DPL::Optional<std::string>& key,
-                          const DPL::Optional<std::string>& oldValue,
-                          const DPL::Optional<std::string>& newValue,
-                          const std::string& url)
-{
-    LogDebug("dispatchStorageEvent(" <<
-             context << ", " <<
-             (key.IsNull() ? "null" : *key) << ", " <<
-             (oldValue.IsNull() ? "null" : *oldValue) << ", " <<
-             (newValue.IsNull() ? "null" : *newValue) << ", " <<
-             url << ")");
-
-    if (context != NULL)
-    {
-        std::stringstream script;
-
-        auto toJSValue =
-            [](const DPL::Optional<std::string>& value) -> std::string
-            {
-                return (value.IsNull() ? "null" : "\"" + *value + "\"");
-            };
-
-        script << "var __event = document.createEvent(\"CustomEvent\");"
-               << "__event.initCustomEvent(\"storage\", true, true);"
-               << "__event.key = " << toJSValue(key) << ";"
-               << "__event.oldValue = " << toJSValue(oldValue) << ";"
-               << "__event.newValue = " << toJSValue(newValue) << ";"
-               << "__event.url = \"" << url << "\";"
-               << "__event.storageArea = widget.preferences;"
-               << "document.dispatchEvent(__event);"
-               << "for (var i=0; i < window.frames.length; i++)"
-               << "{ window.frames[i].document.dispatchEvent(__event); }";
-
-
-        // just for debugging
-        // LogDebug("script :\n" << script.str());
-
-        JSValueRef exception = NULL, ret = NULL;
-        JSStringRef jsScript = JSStringCreateWithUTF8CString(script.str().c_str());
-
-        ret = JSEvaluateScript(context, jsScript, NULL, NULL, 1, &exception);
-
-        JSStringRelease(jsScript);
-
-        LogDebug("JSEvaluateScript() - ret:" << ret << ", exception:" << exception << " (" << getExceptionString(context, exception) << ")");
-    }
-}
-
-void dispatchHwKeyEvent(Evas_Object* ewkView, const std::string key)
-{
-    LogDebug("dispatchHwKeyEvent(" << ewkView << ", " << key << ")");
-
-    if (ewkView != NULL && !key.empty())
-    {
-        std::stringstream script;
-
-        script << "var __event = document.createEvent(\"CustomEvent\");\n"
-               << "__event.initCustomEvent(\"tizenhwkey\", true, true);\n"
-               << "__event.keyName = \"" << key << "\";\n"
-               << "document.dispatchEvent(__event);\n"
-               << "\n"
-               << "for (var i=0; i < window.frames.length; i++)\n"
-               << "{ window.frames[i].document.dispatchEvent(__event); }";
-
-        // just for debugging
-        // LogDebug("script :\n" << script.str());
-
-        if (ewk_view_script_execute(ewkView, script.str().c_str(), NULL, NULL) != EINA_TRUE)
-        {
-            LogWarning("ewk_view_script_execute returned FALSE!");
-        }
-    }
-}
-
-}
-#endif //_DISPATCH_EVENT_SUPPORT_CPP_
diff --git a/src_mobile/dispatch-event/dispatch_event_support.h b/src_mobile/dispatch-event/dispatch_event_support.h
deleted file mode 100644 (file)
index 8a42e20..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * 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       dispatch_event_support.h
- * @author     Tae-Jeong Lee (taejeong.lee@samsung.com)
- * @version    0.1
- * @brief
- */
-
-#ifndef _DISPATCH_EVENT_SUPPORT_H_
-#define _DISPATCH_EVENT_SUPPORT_H_
-
-#include <string>
-#include <dpl/optional.h>
-#include <dpl/log/log.h>
-#include <EWebKit2.h>
-#include <JavaScriptCore/JavaScript.h>
-
-namespace DispatchEventSupport {
-
-void dispatchAppServiceEvent(JSContextRef context, const float scale, const std::string bundle);
-void dispatchSoftKeyboardChangeEvent(JSContextRef context, const std::string state, const int width, const int height);
-void dispatchStorageEvent(JSContextRef context,
-                          const DPL::Optional<std::string>& key,
-                          const DPL::Optional<std::string>& oldValue,
-                          const DPL::Optional<std::string>& newValue,
-                          const std::string& url);
-void dispatchHwKeyEvent(Evas_Object* ewkView, const std::string key);
-}
-#endif //_DISPATCH_EVENT_SUPPORT_H_
diff --git a/src_mobile/js-overlay/deprecated/JSClass/JSSoftKeyboardChangeEvent.cpp b/src_mobile/js-overlay/deprecated/JSClass/JSSoftKeyboardChangeEvent.cpp
deleted file mode 100644 (file)
index 7bd26e2..0000000
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- * Copyright (c) 2012 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        JSSoftKeyboardChangeEvent.cpp
- * @author      Yunchan Cho (yunchan.cho@samsung.com)
- * @version     0.1
- */
-
-#include "JSSoftKeyboardChangeEvent.h"
-#include <dpl/log/log.h>
-#include <dpl/assert.h>
-#include <SoftKeyboardChangeEvent/ISoftKeyboardChangeEvent.h>
-#include <CommonsJavaScript/Converter.h>
-#include <CommonsJavaScript/JSDOMExceptionFactory.h>
-
-using namespace WrtDeviceApis;
-using namespace WrtDeviceApis::Commons;
-using namespace WrtDeviceApis::CommonsJavaScript;
-using namespace WrtDeviceApis::SoftKeyboardChangeEvent::Api;
-
-#define WIDGET_PLUGIN_NAME              "SoftKeyboardChangeEvent"
-#define SOFTKEYBOARD_CHANGE_EVENT_PROPERTY_STATE   "state"
-#define SOFTKEYBOARD_CHANGE_EVENT_PROPERTY_WIDTH   "width"
-#define SOFTKEYBOARD_CHANGE_EVENT_PROPERTY_HEIGHT  "height"
-
-#define CATCH_EXCEPTION_CONVERSION \
-    Catch(Commons::ConversionException) { \
-        LogError("Error on conversion"); \
-        return JSDOMExceptionFactory:: \
-                   UnknownException.make(context, exception); \
-    }
-
-#define CATCH_EXCEPTION_NULL_PTR \
-    Catch(Commons::NullPointerException) { \
-        LogError("Error on pointer, null value"); \
-        return JSDOMExceptionFactory:: \
-                   UnknownException.make(context, exception); \
-    }
-
-#define CATCH_EXCEPTION_PLATFORM_ERROR \
-    Catch(Commons::PlatformException){ \
-        LogError("PlatformException occured"); \
-        return JSDOMExceptionFactory:: \
-                   UnknownException.make(context, exception); \
-    }
-
-namespace WrtPlugins {
-namespace Tizen {
-JSClassDefinition JSSoftKeyboardChangeEvent::m_classInfo = {
-    0,
-    kJSClassAttributeNone,
-    WIDGET_PLUGIN_NAME,
-    0,
-    m_property,
-    NULL,
-    initialize,
-    finalize,
-    NULL, //HasProperty,
-    NULL, //GetProperty,
-    NULL, //SetProperty,
-    NULL, //DeleteProperty,
-    NULL, //GetPropertyNames,
-    NULL, //CallAsFunction,
-    NULL, //CallAsConstructor,
-    NULL, //HasInstance,
-    NULL, //ConvertToType,
-};
-
-JSStaticValue JSSoftKeyboardChangeEvent::m_property[] = {
-    { SOFTKEYBOARD_CHANGE_EVENT_PROPERTY_STATE,
-      JSSoftKeyboardChangeEvent::getState,
-      0, kJSPropertyAttributeReadOnly },
-    { SOFTKEYBOARD_CHANGE_EVENT_PROPERTY_WIDTH,
-      JSSoftKeyboardChangeEvent::getWidth,
-      0, kJSPropertyAttributeReadOnly },
-    { SOFTKEYBOARD_CHANGE_EVENT_PROPERTY_HEIGHT,
-      JSSoftKeyboardChangeEvent::getHeight,
-      0, kJSPropertyAttributeReadOnly },
-    { 0, 0, 0, 0 }
-};
-
-JSClassRef JSSoftKeyboardChangeEvent::getClassRef()
-{
-    if (!m_jsClassRef) {
-        m_jsClassRef = JSClassCreate(&m_classInfo);
-    }
-    return m_jsClassRef;
-}
-
-const JSClassDefinition* JSSoftKeyboardChangeEvent::getClassInfo()
-{
-    return &m_classInfo;
-}
-
-JSClassRef JSSoftKeyboardChangeEvent::m_jsClassRef = JSClassCreate(
-        JSSoftKeyboardChangeEvent::getClassInfo());
-
-void JSSoftKeyboardChangeEvent::initialize(JSContextRef /*context*/,
-                                           JSObjectRef object)
-{
-    LogDebug("entered");
-
-    JSSoftKeyboardChangeEventPrivateObject* priv =
-        static_cast<JSSoftKeyboardChangeEventPrivateObject*>(JSObjectGetPrivate(
-                                                                 object));
-
-    Assert(priv && "Missing private object");
-}
-
-void JSSoftKeyboardChangeEvent::finalize(JSObjectRef object)
-{
-    LogDebug("entered");
-    JSSoftKeyboardChangeEventPrivateObject* priv =
-        static_cast<JSSoftKeyboardChangeEventPrivateObject*>(JSObjectGetPrivate(
-                                                                 object));
-
-    delete priv;
-    LogDebug("private object is realised");
-}
-
-JSValueRef JSSoftKeyboardChangeEvent::getState(
-    JSContextRef context,
-    JSObjectRef object,
-    JSStringRef /*propertyName*/,
-    JSValueRef* exception)
-{
-    LogDebug("entered!");
-
-    Try
-    {
-        Converter converter(context);
-        return converter.toJSValueRef(getPrivateObject(object)->getState());
-    }
-    CATCH_EXCEPTION_CONVERSION
-    CATCH_EXCEPTION_NULL_PTR
-        CATCH_EXCEPTION_PLATFORM_ERROR
-}
-
-JSValueRef JSSoftKeyboardChangeEvent::getWidth(
-    JSContextRef context,
-    JSObjectRef object,
-    JSStringRef /*propertyName*/,
-    JSValueRef* exception)
-{
-    LogDebug("entered!");
-
-    Try
-    {
-        Converter converter(context);
-        return converter.toJSValueRef(getPrivateObject(object)->getWidth());
-    }
-    CATCH_EXCEPTION_CONVERSION
-    CATCH_EXCEPTION_NULL_PTR
-        CATCH_EXCEPTION_PLATFORM_ERROR
-}
-
-JSValueRef JSSoftKeyboardChangeEvent::getHeight(
-    JSContextRef context,
-    JSObjectRef object,
-    JSStringRef /*propertyName*/,
-    JSValueRef* exception)
-{
-    LogDebug("entered");
-
-    Try
-    {
-        Converter converter(context);
-        return converter.toJSValueRef(getPrivateObject(object)->getHeight());
-    }
-    CATCH_EXCEPTION_CONVERSION
-    CATCH_EXCEPTION_NULL_PTR
-        CATCH_EXCEPTION_PLATFORM_ERROR
-}
-
-ISoftKeyboardChangeEventPtr JSSoftKeyboardChangeEvent::getPrivateObject(
-    JSObjectRef arg)
-{
-    JSSoftKeyboardChangeEventPrivateObject* priv =
-        static_cast<JSSoftKeyboardChangeEventPrivateObject*>(JSObjectGetPrivate(
-                                                                 arg));
-
-    if (!priv) {
-        LogError("Private object not initialized");
-        ThrowMsg(Commons::NullPointerException,
-                 "Private object not initialized");
-    }
-
-    return priv->getObject();
-}
-
-#undef CATCH_EXCEPTION_CONVERSION
-#undef CATCH_EXCEPTION_NULL_PTR
-#undef CATCH_EXCEPTION_PLATFORM_ERROR
-}
-}
diff --git a/src_mobile/js-overlay/deprecated/JSClass/JSSoftKeyboardChangeEvent.h b/src_mobile/js-overlay/deprecated/JSClass/JSSoftKeyboardChangeEvent.h
deleted file mode 100644 (file)
index 49da22f..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * 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       JSSoftKeyboardChangeEvent.h
- * @author     Yunchan Cho (yunchan.cho@samsung.com)
- * @version    0.1
- * @brief
- */
-
-#ifndef WRT_PLUGIN_JS_SOFTKEYBOARD_CHANGE_EVENT_H
-#define WRT_PLUGIN_JS_SOFTKEYBOARD_CHANGE_EVENT_H
-
-#include <JavaScriptCore/JavaScript.h>
-#include <CommonsJavaScript/PrivateObject.h>
-#include <SoftKeyboardChangeEvent/ISoftKeyboardChangeEvent.h>
-
-namespace WrtPlugins {
-namespace Tizen {
-typedef WrtDeviceApis::CommonsJavaScript::PrivateObjectT<
-    WrtDeviceApis::SoftKeyboardChangeEvent::Api::ISoftKeyboardChangeEventPtr>::
-    Type
-JSSoftKeyboardChangeEventPrivateObject;
-
-class JSSoftKeyboardChangeEvent
-{
-  public:
-    /**
-     * This method initializes this in the JS Engine.
-     */
-    static JSClassRef getClassRef();
-
-    /**
-     * Gets object's class description.
-     */
-    static const JSClassDefinition* getClassInfo();
-
-  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 value property.
-     */
-    static JSStaticValue m_property[];
-
-    /**
-     * This structure contains properties and callbacks that define a type of
-     * object.
-     */
-    static JSClassDefinition m_classInfo;
-
-    static JSClassRef m_jsClassRef;
-
-    // getters for properties
-    static JSValueRef getState(
-        JSContextRef context,
-        JSObjectRef object,
-        JSStringRef propertyName,
-        JSValueRef* exception);
-
-    static JSValueRef getWidth(
-        JSContextRef context,
-        JSObjectRef object,
-        JSStringRef propertyName,
-        JSValueRef* exception);
-
-    static JSValueRef getHeight(
-        JSContextRef context,
-        JSObjectRef object,
-        JSStringRef propertyName,
-        JSValueRef* exception);
-
-    static WrtDeviceApis::SoftKeyboardChangeEvent::Api::
-        ISoftKeyboardChangeEventPtr
-    getPrivateObject(JSObjectRef arg);
-};
-} // Tizen
-} // WrtPlugins
-
-#endif // WRT_PLUGIN_JS_SOFTKEYBOARD_CHANGE_EVENT_H
diff --git a/src_mobile/js-overlay/deprecated/JSClass/JSStorageEvent.cpp b/src_mobile/js-overlay/deprecated/JSClass/JSStorageEvent.cpp
deleted file mode 100644 (file)
index 489656e..0000000
+++ /dev/null
@@ -1,272 +0,0 @@
-/*
- * 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        JSStorageEvent.cpp
- * @author      Andrzej Surdej (a.surdej@samsung.com)
- * @version     0.1
- */
-
-#include "JSStorageEvent.h"
-#include <dpl/log/log.h>
-#include <dpl/assert.h>
-#include <StorageEvent/IStorageEvent.h>
-#include <CommonsJavaScript/Converter.h>
-#include <CommonsJavaScript/JSDOMExceptionFactory.h>
-
-using namespace WrtDeviceApis;
-using namespace WrtDeviceApis::Commons;
-using namespace WrtDeviceApis::CommonsJavaScript;
-using namespace WrtDeviceApis::StorageEvent::Api;
-
-#define WIDGET_PLUGIN_NAME "StorageEvent"
-
-#define WRT_STORAGE_EVENT_PROPERTY_KEY          "key"
-#define WRT_STORAGE_EVENT_PROPERTY_OLD_VALUE    "oldValue"
-#define WRT_STORAGE_EVENT_PROPERTY_NEW_VALUE    "newValue"
-#define WRT_STORAGE_EVENT_PROPERTY_URL          "url"
-#define WRT_STORAGE_EVENT_PROPERTY_STORAGE_AREA "storageArea"
-
-#define CATCH_EXCEPTION_CONVERSION \
-    Catch(Commons::ConversionException) { \
-        LogError("Error on conversion"); \
-        return JSDOMExceptionFactory:: \
-                   UnknownException.make(context, exception); \
-    }
-
-#define CATCH_EXCEPTION_NULL_PTR \
-    Catch(Commons::NullPointerException) { \
-        LogError("Error on pointer, null value"); \
-        return JSDOMExceptionFactory:: \
-                   UnknownException.make(context, exception); \
-    }
-
-#define CATCH_EXCEPTION_PLATFORM_ERROR \
-    Catch(Commons::PlatformException){ \
-        LogError("PlatformException occured"); \
-        return JSDOMExceptionFactory:: \
-                   UnknownException.make(context, exception); \
-    }
-
-#define CATCH_EXCEPTION_SECURITY \
-    Catch(Commons::SecurityException){ \
-        LogError("Security exception occured"); \
-        return JSDOMExceptionFactory:: \
-                   SecurityException.make(context, exception); \
-    }
-
-namespace WrtPlugins {
-namespace W3C {
-JSClassDefinition JSStorageEvent::m_classInfo = {
-    0,
-    kJSClassAttributeNone,
-    WIDGET_PLUGIN_NAME,
-    0,
-    m_property,
-    NULL,
-    initialize,
-    finalize,
-    NULL, //HasProperty,
-    NULL, //GetProperty,
-    NULL, //SetProperty,
-    NULL, //DeleteProperty,
-    NULL, //GetPropertyNames,
-    NULL, //CallAsFunction,
-    NULL, //CallAsConstructor,
-    NULL, //HasInstance,
-    NULL, //ConvertToType,
-};
-
-JSStaticValue JSStorageEvent::m_property[] = {
-    { WRT_STORAGE_EVENT_PROPERTY_KEY, JSStorageEvent::getKey,
-      0, kJSPropertyAttributeReadOnly },
-    { WRT_STORAGE_EVENT_PROPERTY_OLD_VALUE, JSStorageEvent::getOldValue,
-      0, kJSPropertyAttributeReadOnly },
-    { WRT_STORAGE_EVENT_PROPERTY_NEW_VALUE, JSStorageEvent::getNewValue,
-      0, kJSPropertyAttributeReadOnly },
-    { WRT_STORAGE_EVENT_PROPERTY_URL, JSStorageEvent::getUrl,
-      0, kJSPropertyAttributeReadOnly },
-    { WRT_STORAGE_EVENT_PROPERTY_STORAGE_AREA, JSStorageEvent::getStorageArea,
-      0, kJSPropertyAttributeReadOnly },
-    { 0, 0, 0, 0 }
-};
-
-JSClassRef JSStorageEvent::getClassRef()
-{
-    if (!m_jsClassRef) {
-        m_jsClassRef = JSClassCreate(&m_classInfo);
-    }
-    return m_jsClassRef;
-}
-
-const JSClassDefinition* JSStorageEvent::getClassInfo()
-{
-    return &m_classInfo;
-}
-
-JSClassRef JSStorageEvent::m_jsClassRef = JSClassCreate(
-        JSStorageEvent::getClassInfo());
-
-void JSStorageEvent::initialize(JSContextRef /*context*/,
-                                JSObjectRef object)
-{
-    LogDebug("entered");
-
-    JSStorageEventPrivateObject* priv =
-        static_cast<JSStorageEventPrivateObject*>(JSObjectGetPrivate(object));
-
-    Assert(priv && "Missing private object");
-}
-
-void JSStorageEvent::finalize(JSObjectRef object)
-{
-    LogDebug("entered");
-    JSStorageEventPrivateObject* priv =
-        static_cast<JSStorageEventPrivateObject*>(JSObjectGetPrivate(object));
-
-    delete priv;
-    LogDebug("private object is realised");
-}
-
-JSValueRef JSStorageEvent::getKey(
-    JSContextRef context,
-    JSObjectRef object,
-    JSStringRef /*propertyName*/,
-    JSValueRef* exception)
-{
-    LogDebug("entered");
-
-    Try
-    {
-        Converter converter(context);
-
-        return converter.toJSValueRef(getPrivateObject(object)->getKey());
-    }
-    CATCH_EXCEPTION_CONVERSION
-    CATCH_EXCEPTION_NULL_PTR
-    CATCH_EXCEPTION_PLATFORM_ERROR
-        CATCH_EXCEPTION_SECURITY
-}
-
-JSValueRef JSStorageEvent::getOldValue(
-    JSContextRef context,
-    JSObjectRef object,
-    JSStringRef /*propertyName*/,
-    JSValueRef* exception)
-{
-    LogDebug("entered");
-
-    Try
-    {
-        Converter converter(context);
-
-        DPL::OptionalString oldValue = getPrivateObject(object)->getOldValue();
-
-        if (!oldValue) {
-            return JSValueMakeNull(context);
-        } else {
-            return converter.toJSValueRef(DPL::ToUTF8String(*oldValue));
-        }
-    }
-    CATCH_EXCEPTION_CONVERSION
-    CATCH_EXCEPTION_NULL_PTR
-    CATCH_EXCEPTION_PLATFORM_ERROR
-        CATCH_EXCEPTION_SECURITY
-}
-
-JSValueRef JSStorageEvent::getNewValue(
-    JSContextRef context,
-    JSObjectRef object,
-    JSStringRef /*propertyName*/,
-    JSValueRef* exception)
-{
-    LogDebug("entered");
-
-    Try
-    {
-        Converter converter(context);
-
-        DPL::OptionalString newValue = getPrivateObject(object)->getNewValue();
-
-        if (!newValue) {
-            return JSValueMakeNull(context);
-        } else {
-            return converter.toJSValueRef(DPL::ToUTF8String(*newValue));
-        }
-    }
-    CATCH_EXCEPTION_CONVERSION
-    CATCH_EXCEPTION_NULL_PTR
-    CATCH_EXCEPTION_PLATFORM_ERROR
-        CATCH_EXCEPTION_SECURITY
-}
-
-JSValueRef JSStorageEvent::getUrl(
-    JSContextRef context,
-    JSObjectRef object,
-    JSStringRef /*propertyName*/,
-    JSValueRef* exception)
-{
-    LogDebug("entered");
-
-    Try
-    {
-        Converter converter(context);
-
-        return converter.toJSValueRef(getPrivateObject(object)->getUrl());
-    }
-    CATCH_EXCEPTION_CONVERSION
-        CATCH_EXCEPTION_NULL_PTR
-}
-
-JSValueRef JSStorageEvent::getStorageArea(
-    JSContextRef context,
-    JSObjectRef /*object*/,
-    JSStringRef /*propertyName*/,
-    JSValueRef* exception)
-{
-    LogDebug("entered");
-
-    Try
-    {
-        LogError("Not implemented");
-        return JSValueMakeUndefined(context);
-    }
-    CATCH_EXCEPTION_CONVERSION
-    CATCH_EXCEPTION_NULL_PTR
-    CATCH_EXCEPTION_PLATFORM_ERROR
-        CATCH_EXCEPTION_SECURITY
-}
-
-IStorageEventPtr JSStorageEvent::getPrivateObject(JSObjectRef arg)
-{
-    JSStorageEventPrivateObject* priv =
-        static_cast<JSStorageEventPrivateObject*>(JSObjectGetPrivate(arg));
-
-    if (!priv) {
-        LogError("Private object not initialized");
-        ThrowMsg(Commons::NullPointerException,
-                 "Private object not initialized");
-    }
-
-    return priv->getObject();
-}
-
-#undef CATCH_EXCEPTION_CONVERSION
-#undef CATCH_EXCEPTION_NULL_PTR
-#undef CATCH_EXCEPTION_PLATFORM_ERROR
-#undef CATCH_EXCEPTION_SECURITY
-}
-}
diff --git a/src_mobile/js-overlay/deprecated/JSClass/JSStorageEvent.h b/src_mobile/js-overlay/deprecated/JSClass/JSStorageEvent.h
deleted file mode 100644 (file)
index 0460f39..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * 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       JSStorageEvent.h
- * @author     Andrzej Surdej (a.surdej@samsung.com)
- * @version    0.1
- * @brief
- */
-
-#ifndef _WRT_PLUGIN_JS_STORAGE_EVENT_H_
-#define _WRT_PLUGIN_JS_STORAGE_EVENT_H_
-
-#include <JavaScriptCore/JavaScript.h>
-#include <CommonsJavaScript/PrivateObject.h>
-#include <StorageEvent/IStorageEvent.h>
-
-namespace WrtPlugins {
-namespace W3C {
-typedef WrtDeviceApis::CommonsJavaScript::PrivateObjectT<
-    WrtDeviceApis::StorageEvent::Api::IStorageEventPtr>::Type
-JSStorageEventPrivateObject;
-
-class JSStorageEvent
-{
-  public:
-    /**
-     * This method initializes this in the JS Engine.
-     */
-    static JSClassRef getClassRef();
-
-    /**
-     * Gets object's class description.
-     */
-    static const JSClassDefinition* getClassInfo();
-
-  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 value property.
-     */
-    static JSStaticValue m_property[];
-
-    /**
-     * This structure contains properties and callbacks that define a type of
-     * object.
-     */
-    static JSClassDefinition m_classInfo;
-
-    static JSClassRef m_jsClassRef;
-
-    // getters for properties
-    static JSValueRef getKey(
-        JSContextRef context,
-        JSObjectRef object,
-        JSStringRef propertyName,
-        JSValueRef* exception);
-    static JSValueRef getOldValue(
-        JSContextRef context,
-        JSObjectRef object,
-        JSStringRef propertyName,
-        JSValueRef* exception);
-    static JSValueRef getNewValue(
-        JSContextRef context,
-        JSObjectRef object,
-        JSStringRef propertyName,
-        JSValueRef* exception);
-    static JSValueRef getUrl(
-        JSContextRef context,
-        JSObjectRef object,
-        JSStringRef propertyName,
-        JSValueRef* exception);
-    static JSValueRef getStorageArea(
-        JSContextRef context,
-        JSObjectRef object,
-        JSStringRef propertyName,
-        JSValueRef* exception);
-
-    static WrtDeviceApis::StorageEvent::Api::IStorageEventPtr
-    getPrivateObject(JSObjectRef arg);
-};
-} // W3C
-} // WrtPlugins
-
-#endif // _WRT_PLUGIN_JS_STORAGE_EVENT_H_
diff --git a/src_mobile/js-overlay/deprecated/JSClass/JSTizenServiceEvent.cpp b/src_mobile/js-overlay/deprecated/JSClass/JSTizenServiceEvent.cpp
deleted file mode 100644 (file)
index 516d189..0000000
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- * 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        JSTizenServiceEvent.cpp
- * @author      Yunchan Cho (yunchan.cho@samsung.com)
- * @version     0.1
- */
-
-#include "JSTizenServiceEvent.h"
-#include <dpl/log/log.h>
-#include <dpl/assert.h>
-#include <TizenServiceEvent/ITizenServiceEvent.h>
-#include <CommonsJavaScript/Converter.h>
-#include <CommonsJavaScript/JSDOMExceptionFactory.h>
-
-using namespace WrtDeviceApis;
-using namespace WrtDeviceApis::Commons;
-using namespace WrtDeviceApis::CommonsJavaScript;
-using namespace WrtDeviceApis::TizenServiceEvent::Api;
-
-#define WIDGET_PLUGIN_NAME "TizenServiceEvent"
-
-#define TIZEN_SERVICE_EVENT_PROPERTY_SCALE      "scale"
-#define TIZEN_SERVICE_EVENT_PROPERTY_BUNDLE     "__bundle"
-
-#define CATCH_EXCEPTION_CONVERSION \
-    Catch(Commons::ConversionException) { \
-        LogError("Error on conversion"); \
-        return JSDOMExceptionFactory:: \
-                   UnknownException.make(context, exception); \
-    }
-
-#define CATCH_EXCEPTION_NULL_PTR \
-    Catch(Commons::NullPointerException) { \
-        LogError("Error on pointer, null value"); \
-        return JSDOMExceptionFactory:: \
-                   UnknownException.make(context, exception); \
-    }
-
-#define CATCH_EXCEPTION_PLATFORM_ERROR \
-    Catch(Commons::PlatformException){ \
-        LogError("PlatformException occured"); \
-        return JSDOMExceptionFactory:: \
-                   UnknownException.make(context, exception); \
-    }
-
-#define CATCH_EXCEPTION_SECURITY \
-    Catch(Commons::SecurityException){ \
-        LogError("Security exception occured"); \
-        return JSDOMExceptionFactory:: \
-                   SecurityException.make(context, exception); \
-    }
-
-namespace WrtPlugins {
-namespace Tizen {
-JSClassDefinition JSTizenServiceEvent::m_classInfo = {
-    0,
-    kJSClassAttributeNone,
-    WIDGET_PLUGIN_NAME,
-    0,
-    m_property,
-    NULL,
-    initialize,
-    finalize,
-    NULL, //HasProperty,
-    NULL, //GetProperty,
-    NULL, //SetProperty,
-    NULL, //DeleteProperty,
-    NULL, //GetPropertyNames,
-    NULL, //CallAsFunction,
-    NULL, //CallAsConstructor,
-    NULL, //HasInstance,
-    NULL, //ConvertToType,
-};
-
-JSStaticValue JSTizenServiceEvent::m_property[] = {
-    { TIZEN_SERVICE_EVENT_PROPERTY_SCALE, JSTizenServiceEvent::getScale,
-      0, kJSPropertyAttributeReadOnly },
-    { TIZEN_SERVICE_EVENT_PROPERTY_BUNDLE, JSTizenServiceEvent::getBundle,
-      0, kJSPropertyAttributeReadOnly },
-    { 0, 0, 0, 0 }
-};
-
-JSClassRef JSTizenServiceEvent::getClassRef()
-{
-    if (!m_jsClassRef) {
-        m_jsClassRef = JSClassCreate(&m_classInfo);
-    }
-    return m_jsClassRef;
-}
-
-const JSClassDefinition* JSTizenServiceEvent::getClassInfo()
-{
-    return &m_classInfo;
-}
-
-JSClassRef JSTizenServiceEvent::m_jsClassRef = JSClassCreate(
-        JSTizenServiceEvent::getClassInfo());
-
-void JSTizenServiceEvent::initialize(JSContextRef /*context*/,
-                                     JSObjectRef object)
-{
-    LogDebug("entered");
-
-    JSTizenServiceEventPrivateObject* priv =
-        static_cast<JSTizenServiceEventPrivateObject*>(JSObjectGetPrivate(
-                                                           object));
-
-    Assert(priv && "Missing private object");
-}
-
-void JSTizenServiceEvent::finalize(JSObjectRef object)
-{
-    LogDebug("entered");
-    JSTizenServiceEventPrivateObject* priv =
-        static_cast<JSTizenServiceEventPrivateObject*>(JSObjectGetPrivate(
-                                                           object));
-
-    delete priv;
-    LogDebug("private object is realised");
-}
-
-JSValueRef JSTizenServiceEvent::getScale(
-    JSContextRef context,
-    JSObjectRef object,
-    JSStringRef /*propertyName*/,
-    JSValueRef* exception)
-{
-    LogDebug("entered");
-
-    Try
-    {
-        Converter converter(context);
-        return converter.toJSValueRef(getPrivateObject(object)->getScale());
-    }
-    CATCH_EXCEPTION_CONVERSION
-    CATCH_EXCEPTION_NULL_PTR
-    CATCH_EXCEPTION_PLATFORM_ERROR
-        CATCH_EXCEPTION_SECURITY
-}
-
-JSValueRef JSTizenServiceEvent::getBundle(
-    JSContextRef context,
-    JSObjectRef object,
-    JSStringRef /*propertyName*/,
-    JSValueRef* exception)
-{
-    LogDebug("entered");
-
-    Try
-    {
-        Converter converter(context);
-        return converter.toJSValueRef(getPrivateObject(object)->getBundle());
-    }
-    CATCH_EXCEPTION_CONVERSION
-    CATCH_EXCEPTION_NULL_PTR
-    CATCH_EXCEPTION_PLATFORM_ERROR
-        CATCH_EXCEPTION_SECURITY
-}
-
-ITizenServiceEventPtr JSTizenServiceEvent::getPrivateObject(JSObjectRef arg)
-{
-    JSTizenServiceEventPrivateObject* priv =
-        static_cast<JSTizenServiceEventPrivateObject*>(JSObjectGetPrivate(arg));
-
-    if (!priv) {
-        LogError("Private object not initialized");
-        ThrowMsg(Commons::NullPointerException,
-                 "Private object not initialized");
-    }
-
-    return priv->getObject();
-}
-
-#undef CATCH_EXCEPTION_CONVERSION
-#undef CATCH_EXCEPTION_NULL_PTR
-#undef CATCH_EXCEPTION_PLATFORM_ERROR
-#undef CATCH_EXCEPTION_SECURITY
-}
-}
diff --git a/src_mobile/js-overlay/deprecated/JSClass/JSTizenServiceEvent.h b/src_mobile/js-overlay/deprecated/JSClass/JSTizenServiceEvent.h
deleted file mode 100644 (file)
index a079dc5..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * 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       JSTizenServiceEvent.h
- * @author     Yunchan Cho (yunchan.cho@samsung.com)
- * @version    0.1
- * @brief
- */
-
-#ifndef _WRT_PLUGIN_JS_TIZEN_SERVICE_EVENT_H_
-#define _WRT_PLUGIN_JS_TIZEN_SERVICE_EVENT_H_
-
-#include <JavaScriptCore/JavaScript.h>
-#include <CommonsJavaScript/PrivateObject.h>
-#include <TizenServiceEvent/ITizenServiceEvent.h>
-
-namespace WrtPlugins {
-namespace Tizen {
-typedef WrtDeviceApis::CommonsJavaScript::PrivateObjectT<
-    WrtDeviceApis::TizenServiceEvent::Api::ITizenServiceEventPtr>::Type
-JSTizenServiceEventPrivateObject;
-
-class JSTizenServiceEvent
-{
-  public:
-    /**
-     * This method initializes this in the JS Engine.
-     */
-    static JSClassRef getClassRef();
-
-    /**
-     * Gets object's class description.
-     */
-    static const JSClassDefinition* getClassInfo();
-
-  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 value property.
-     */
-    static JSStaticValue m_property[];
-
-    /**
-     * This structure contains properties and callbacks that define a type of
-     * object.
-     */
-    static JSClassDefinition m_classInfo;
-
-    static JSClassRef m_jsClassRef;
-
-    // getters for properties
-    static JSValueRef getScale(
-        JSContextRef context,
-        JSObjectRef object,
-        JSStringRef propertyName,
-        JSValueRef* exception);
-
-    static JSValueRef getBundle(
-        JSContextRef context,
-        JSObjectRef object,
-        JSStringRef propertyName,
-        JSValueRef* exception);
-
-    static WrtDeviceApis::TizenServiceEvent::Api::ITizenServiceEventPtr
-    getPrivateObject(JSObjectRef arg);
-};
-} // Tizen
-} // WrtPlugins
-
-#endif // _WRT_PLUGIN_JS_TIZEN_SERVICE_EVENT_H_
diff --git a/src_mobile/js-overlay/deprecated/js_iframe_support.cpp b/src_mobile/js-overlay/deprecated/js_iframe_support.cpp
deleted file mode 100755 (executable)
index 904d4e1..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * 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       IFrameSupport.cpp
- * @author     Grzegorz Krawczyk (g.krawczyk@samsung.com)
- * @version    0.1
- * @brief
- */
-
-#include <dpl/foreach.h>
-#include <dpl/assert.h>
-#include <dpl/log/log.h>
-#include <js_iframe_support.h>
-
-namespace WrtPlugins {
-namespace W3C {
-IFrameSupport::IFramesContainer IFrameSupport::m_iframesObject =
-    IFrameSupport::IFramesContainer();
-
-void IFrameSupport::RegisterWidget(java_script_context_t /*global_context*/,
-                                   js_object_instance_t iframe,
-                                   js_object_instance_t object)
-{
-    LogDebug("New widget instance registered");
-    LogDebug("iframe: " << iframe);
-    LogDebug("object: " << object);
-    getIFrameData(static_cast<JSObjectRef>(iframe))->widget =
-        static_cast<JSObjectRef>(object);
-}
-
-void IFrameSupport::RegisterAddEventListener(
-    java_script_context_t /*global_context*/,
-    js_object_instance_t iframe,
-    js_object_instance_t object)
-{
-    LogDebug("New addEventListener instance registered");
-    LogDebug("iframe: " << iframe);
-    LogDebug("object: " << object);
-    getIFrameData(static_cast<JSObjectRef>(iframe))->addEventListener
-        = static_cast<JSObjectRef>(object);
-}
-
-JSObjectRef IFrameSupport::getIFrameObjectForWidget(JSObjectRef widgetObject)
-{
-    FOREACH(it, m_iframesObject)
-    {
-        if (it->second->widget == widgetObject) {
-            LogDebug("iframe found");
-            return it->first;
-        }
-    }
-    LogDebug("Iframe not found");
-    return NULL;
-}
-
-IFrameDataPtr IFrameSupport::getIFrameData(JSObjectRef iframe)
-{
-    auto it = m_iframesObject.find(iframe);
-    if (it != m_iframesObject.end()) {
-        return it->second;
-    }
-
-    return m_iframesObject[iframe] = IFrameDataPtr(new IFrameData());
-}
-}
-}
diff --git a/src_mobile/js-overlay/deprecated/js_iframe_support.h b/src_mobile/js-overlay/deprecated/js_iframe_support.h
deleted file mode 100755 (executable)
index de07932..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * 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       IFrameSupport.h
- * @author     Grzegorz Krawczyk (g.krawczyk@samsung.com)
- * @version    0.1
- * @brief
- */
-
-#ifndef _WRT_PLUGINS_SRC_W3C_WIDGET_IFRAME_SUPPORT_H_
-#define _WRT_PLUGINS_SRC_W3C_WIDGET_IFRAME_SUPPORT_H_
-
-#include <map>
-#include <memory>
-#include <JavaScriptCore/JavaScript.h>
-#include <wrt_plugin_export.h>
-
-namespace WrtPlugins {
-namespace W3C {
-struct IFrameData
-{
-    IFrameData() : widget(0), addEventListener(0){}
-
-    JSObjectRef widget;
-    JSObjectRef addEventListener;
-};
-typedef std::shared_ptr<IFrameData> IFrameDataPtr;
-
-class IFrameSupport
-{
-  public:
-    static void RegisterWidget(java_script_context_t global_context,
-                               js_object_instance_t iframe,
-                               js_object_instance_t object);
-
-    static void RegisterAddEventListener(java_script_context_t global_context,
-                                         js_object_instance_t iframe,
-                                         js_object_instance_t object);
-
-    static JSObjectRef getIFrameObjectForWidget(JSObjectRef widgetObject);
-
-  private:
-    //map iframe:objects
-    typedef std::map<JSObjectRef, IFrameDataPtr> IFramesContainer;
-
-    static IFramesContainer m_iframesObject;
-
-  private:
-    static IFrameDataPtr getIFrameData(JSObjectRef iframe);
-};
-}
-}
-
-#endif
diff --git a/src_mobile/js-overlay/deprecated/js_overlay_addEventListener.cpp b/src_mobile/js-overlay/deprecated/js_overlay_addEventListener.cpp
deleted file mode 100755 (executable)
index 8cb6801..0000000
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * 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       AddEventListenerSupport.cpp
- * @author     Grzegorz Krawczyk (g.krawczyk@samsung.com)
- * @author     Yunchan Cho (yunchan.cho@samsung.com)
- * @version    0.1
- * @brief
- */
-
-#include <string>
-#include <dpl/log/log.h>
-#include <dpl/foreach.h>
-#include <CommonsJavaScript/Converter.h>
-#include <js_overlay_addEventListener.h>
-#include <js_overlay_types.h>
-#include <JSStorageEvent.h>
-
-namespace WrtPlugins {
-namespace W3C {
-
-const std::string storageEventName = "storage";
-const std::string appServiceEventName = "appservice";
-const std::string softKeyboardChangeEventName = "softkeyboardchange";
-
-AddEventListenerSupport::IFramesListeners
-AddEventListenerSupport::m_listeners =
-    AddEventListenerSupport::IFramesListeners();
-
-JSValueRef AddEventListenerSupport::AddEventListener(
-        JSContextRef context,
-        JSObjectRef object,
-        JSObjectRef thisObject,
-        size_t argumentCount,
-        const JSValueRef arguments[],
-        JSValueRef* /*exception*/)
-{
-    LogDebug("Add event listener invoked");
-    LogDebug("This(iframe?):" << thisObject);
-    LogDebug("object:" << object);
-
-    JSContextRef global_context = JSContextGetGlobalContext(context);
-    LogDebug("context:" << context << "(global:" << global_context << ")");
-
-    if (argumentCount < 2 || !JSValueIsString(context, arguments[0])) {
-        LogError("Wrong arguments");
-        return JSValueMakeUndefined(context);
-    }
-
-    std::string eventName = WrtDeviceApis::CommonsJavaScript::
-            Converter(context).toString(arguments[0]);
-    LogDebug("Event name: " << eventName);
-
-    if (eventName != storageEventName &&
-        eventName != appServiceEventName &&
-        eventName != softKeyboardChangeEventName)
-    {
-        LogDebug("Event type not supported");
-        return JSValueMakeUndefined(context);
-    }
-
-    JSObjectRef objectCb = JSValueToObject(context, arguments[1], NULL);
-    if (!JSObjectIsFunction(context, objectCb)) {
-        LogError("JS object is not a function");
-        return JSValueMakeUndefined(context);
-    }
-    JSValueProtect(global_context, arguments[1]);
-    //add object to Listeners
-    //set event information according to each event type
-    CallbackData data;
-    data.object = objectCb;
-    data.thisObject = thisObject;
-    data.context = global_context;
-
-    if (eventName == storageEventName) {
-        data.eventType = StorageCustomEvent;
-    } else if (eventName == appServiceEventName) {
-        data.eventType = ServiceCustomEvent;
-    } else if (eventName == softKeyboardChangeEventName) {
-        data.eventType = SoftKeyboardChangeCustomEvent;
-    }
-
-    getIFrameListeners(thisObject)->push_back(data);
-
-    return JSValueMakeUndefined(context);
-}
-
-void AddEventListenerSupport::RemoveIFrame(JSObjectPtr iframe)
-{
-    auto it = m_listeners.find(iframe->getObject());
-    if (it == m_listeners.end()) {
-        LogWarning("Iframe not registered");
-        return;
-    }
-
-    FOREACH(listener, *it->second)
-    {
-        JSValueUnprotect(listener->context, listener->object);
-    }
-    m_listeners.erase(it);
-    LogDebug("Iframe removed from add event listener object");
-}
-
-void AddEventListenerSupport::CallStorageListenersFromDifferentIFrames(
-        JSObjectRef iframe,
-        const WrtDeviceApis::StorageEvent::Api::IStorageEventPtr& event)
-{
-    LogDebug("Invoked callbacks");
-
-    FOREACH(it, m_listeners)
-    {
-        if (it->first == iframe) {
-            continue;
-        }
-
-        FOREACH(listener, *it->second)
-        {
-            LogDebug("Call");
-
-            auto eventPriv =
-                new JSStorageEventPrivateObject(listener->context, event);
-
-            JSObjectRef eventObject =
-                JSObjectMake(listener->context, JSStorageEvent::getClassRef(), eventPriv);
-            const size_t argc = 1;
-            JSValueRef argv[argc] = { eventObject };
-
-            JSValueProtect(listener->context, eventObject);
-
-            if (listener->eventType == StorageCustomEvent)
-            {
-                JSObjectCallAsFunction(
-                    listener->context,
-                    listener->object,
-                    NULL,
-                    argc,
-                    argv,
-                    NULL);
-            }
-
-            JSValueUnprotect(listener->context, eventObject);
-        }
-    }
-
-    LogDebug("Done");
-}
-
-void AddEventListenerSupport::CallCustomEventListenersFromIFrame(
-        JSObjectRef iframe,
-        CustomEventType eventType,
-        JSObjectRef eventObject)
-{
-    LogDebug("Invoked callbacks");
-
-    IFramesListeners::iterator it = m_listeners.find(iframe);
-    if (it == m_listeners.end()) {
-        LogDebug("This frame object not existed");
-        return;
-    }
-
-    const size_t argc = 1;
-    JSValueRef argv[argc] = { eventObject };
-
-    FOREACH(listener, *it->second)
-    {
-        if (listener->eventType == eventType) {
-            LogDebug("Call");
-            JSObjectCallAsFunction(
-                listener->context,
-                listener->object,
-                iframe,
-                argc,
-                argv,
-                NULL);
-        }
-    }
-    LogDebug("Done");
-}
-
-AddEventListenerSupport::ListenersPtr
-AddEventListenerSupport::getIFrameListeners(JSObjectRef iframe)
-{
-    auto it = m_listeners.find(iframe);
-    if (it != m_listeners.end()) {
-        return it->second;
-    }
-
-    return m_listeners[iframe] = ListenersPtr(new Listeners());
-}
-}
-}
diff --git a/src_mobile/js-overlay/deprecated/js_overlay_addEventListener.h b/src_mobile/js-overlay/deprecated/js_overlay_addEventListener.h
deleted file mode 100755 (executable)
index 0a9717e..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * 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       js_overlay_addEventListener.h
- * @author     Grzegorz Krawczyk (g.krawczyk@samsung.com)
- * @author     Yunchan Cho (yunchan.cho@samsung.com)
- * @version    0.1
- * @brief
- */
-
-#ifndef _WRT_PLUGINS_SRC_W3C_WIDGET_ADDEVENTLISTENERSUPPORT_H_
-#define _WRT_PLUGINS_SRC_W3C_WIDGET_ADDEVENTLISTENERSUPPORT_H_
-
-#include <map>
-#include <list>
-#include <memory>
-#include <JavaScriptCore/JavaScript.h>
-#include <JavaScriptCore/JSContextRef.h>
-#include <StorageEvent/IStorageEvent.h>
-#include <TizenServiceEvent/ITizenServiceEvent.h>
-#include <js_overlay_types.h>
-#include <JSObject.h>
-
-// import temporarily from JSContextRefPrivate.h
-extern "C" JSGlobalContextRef JSContextGetGlobalContext(JSContextRef ctx);
-
-namespace WrtPlugins {
-namespace W3C {
-class AddEventListenerSupport
-{
-  public:
-    static JSValueRef AddEventListener(JSContextRef context,
-                                       JSObjectRef object,
-                                       JSObjectRef thisObject,
-                                       size_t argumentCount,
-                                       const JSValueRef arguments[],
-                                       JSValueRef* exception);
-
-    static void RemoveIFrame(JSObjectPtr iframe);
-
-    static void CallStorageListenersFromDifferentIFrames(
-        JSObjectRef iframe,
-        const WrtDeviceApis::StorageEvent::Api::IStorageEventPtr& event);
-
-    static void CallCustomEventListenersFromIFrame(
-        JSObjectRef iframe,
-        CustomEventType eventType,
-        JSObjectRef eventObject);
-
-  private:
-
-    struct CallbackData {
-        CustomEventType eventType;
-        JSObjectRef object;
-        JSObjectRef thisObject;
-        JSContextRef context;
-    };
-
-    typedef std::list<CallbackData> Listeners;
-    typedef std::shared_ptr<Listeners> ListenersPtr;
-
-    //first-iframe, 2nd - listeners list
-    typedef std::map<JSObjectRef, ListenersPtr> IFramesListeners;
-
-    static IFramesListeners m_listeners;
-
-  private:
-    static ListenersPtr getIFrameListeners(JSObjectRef iframe);
-};
-}
-}
-
-#endif
diff --git a/src_mobile/js-overlay/deprecated/js_overlay_support.cpp b/src_mobile/js-overlay/deprecated/js_overlay_support.cpp
deleted file mode 100644 (file)
index cad75a5..0000000
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * 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        js_overlay_support.cpp
- * @author
- * @version     1.0
- * @brief
- */
-#include <memory>
-#include <dpl/log/log.h>
-#include <dpl/foreach.h>
-#include <JavaScriptCore/JavaScript.h>
-
-#include <js_overlay_support.h>
-
-namespace JSOverlaySupport {
-class JSFunctionDispatcher
-{
-  public:
-    struct PrivateData
-    {
-        //required to unprotect object in destructor;
-        JSContextRef context;
-        JSObjectPtr originalFunction;
-        JSObjectPtr overlayFunction;
-    };
-
-    static JSClassRef getClassRef();
-
-  private:
-    static JSClassDefinition m_classInfo;
-
-  private:
-    static void initialize(JSContextRef context, JSObjectRef object);
-
-    static void finalize(JSObjectRef object);
-
-    static JSValueRef callAsFunction(JSContextRef ctx,
-                                     JSObjectRef function,
-                                     JSObjectRef thisObject,
-                                     size_t argumentCount,
-                                     const JSValueRef arguments[],
-                                     JSValueRef* exception);
-};
-
-JSObjectPtr createWrappedFunction(
-    JSGlobalContextRef ctx,
-    const JSObjectPtr& originalFunction,
-    const JSObjectPtr& overlayFunction,
-    const std::string& name)
-{
-    LogDebug("Creation overlay for function: " << name);
-    JSStringRef name_js = JSStringCreateWithUTF8CString(name.c_str());
-
-    JSFunctionDispatcher::PrivateData* priv =
-        new JSFunctionDispatcher::PrivateData;
-    priv->context = ctx;
-    priv->overlayFunction = overlayFunction;
-    priv->originalFunction = originalFunction;
-
-    auto fun = JSObjectMake(ctx, JSFunctionDispatcher::getClassRef(), priv);
-
-    JSStringRelease(name_js);
-
-    LogDebug("JSValueProtect invoked for: "
-             << overlayFunction->getObject() << " "
-             << originalFunction->getObject() << " Wrapper:"
-             << fun);
-
-    //the value is unprotected in finalize of the JSFunctionDispatcher object
-    JSValueProtect(ctx,
-                   static_cast<JSObjectRef>(
-                       overlayFunction->getObject()));
-
-    return JSObjectPtr(new JSObject(fun));
-}
-
-JSClassDefinition JSFunctionDispatcher::m_classInfo = {
-    0,
-    kJSClassAttributeNone,
-    "IGNORED",
-    0,
-    0,
-    0,
-    initialize,
-    finalize,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    NULL,
-    callAsFunction,
-    NULL,
-    NULL,
-    NULL
-};
-
-JSClassRef JSFunctionDispatcher::getClassRef()
-{
-    static auto classRef = JSClassCreate(&m_classInfo);
-    return classRef;
-}
-
-void JSFunctionDispatcher::initialize(JSContextRef /*context*/,
-                                      JSObjectRef /*object*/)
-{
-    LogDebug("Initialize");
-}
-
-void JSFunctionDispatcher::finalize(JSObjectRef object)
-{
-    LogDebug("finalize");
-
-    PrivateData* priv = static_cast<PrivateData*>(JSObjectGetPrivate(object));
-    if (priv) {
-        JSValueUnprotect(priv->context,
-                         static_cast<JSObjectRef>(
-                             priv->overlayFunction->getObject()));
-        delete priv;
-    }
-}
-
-JSValueRef JSFunctionDispatcher::callAsFunction(
-    JSContextRef context,
-    JSObjectRef object,
-    JSObjectRef thisObject,
-    size_t argumentCount,
-    const JSValueRef arguments[],
-    JSValueRef* exception)
-{
-    LogDebug("Dispatcher invoked");
-
-    JSValueRef result = JSValueMakeUndefined(context);
-
-    JSFunctionDispatcher::PrivateData* priv =
-        static_cast<JSFunctionDispatcher::PrivateData*>
-        (JSObjectGetPrivate(object));
-
-    if (!priv) {
-        LogError("Private object is NULL");
-        return result;
-    }
-
-    //call overlayed function
-    if (priv->overlayFunction->getObject()) {
-        LogDebug("Overlayed function will be invoked...");
-        result = JSObjectCallAsFunction(
-                priv->context,
-                static_cast<JSObjectRef>(
-                    priv->overlayFunction->getObject()),
-                thisObject,
-                argumentCount,
-                arguments,
-                exception);
-    }
-
-    //call original function
-    if (priv->originalFunction->getObject()) {
-        LogDebug("Original function will be invoked..");
-        result = JSObjectCallAsFunction(
-                context,
-                static_cast<JSObjectRef>(
-                    priv->originalFunction->getObject()),
-                thisObject,
-                argumentCount,
-                arguments,
-                exception);
-    }
-
-    LogDebug("Done");
-    return result;
-}
-}
diff --git a/src_mobile/js-overlay/deprecated/js_overlay_support.h b/src_mobile/js-overlay/deprecated/js_overlay_support.h
deleted file mode 100644 (file)
index 0cfb19b..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * 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        js_function_wrapper.h
- * @author
- * @version     1.0
- * @brief
- */
-
-#ifndef _JAVASCRIPT_OVERLAY_SUPPORT_H
-#define _JAVASCRIPT_OVERLAY_SUPPORT_H
-
-#include <string>
-#include <dpl/noncopyable.h>
-#include <JavaScriptCore/JavaScript.h>
-#include <JavaScriptCore/JSObjectRef.h>
-#include <Commons/JSObject.h>
-
-namespace JSOverlaySupport {
-JSObjectPtr createWrappedFunction(
-    JSGlobalContextRef ctx,
-    const JSObjectPtr& originalFunction,
-    const JSObjectPtr& overlayFunction,
-    const std::string& name);
-}
-
-#endif
diff --git a/src_mobile/js-overlay/js_function_manager.cpp b/src_mobile/js-overlay/js_function_manager.cpp
deleted file mode 100644 (file)
index dab34b9..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * 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    js_function_manager.cpp
- * @author  Grzegorz Krawczyk (g.krawczyk@samgsung.com)
- * @author  Yunchan Cho (yunchan.cho@samgsung.com)
- * @version
- * @brief
- */
-
-#include <dpl/singleton_safe_impl.h>
-#include <js_function_manager.h>
-#include <js_overlay_functions.h>
-#include <wrt_plugin_export.h>
-#include <dpl/log/secure_log.h>
-
-IMPLEMENT_SAFE_SINGLETON(JsFunctionManager)
-
-namespace {
-const char* JSPRINT_NAME = "jsPrint";
-const char* JSGLOBAL_OBJECT = "GLOBAL_OBJECT";
-const char* JSHOOK_NAME = "jsHook";
-}
-
-namespace JavaScriptFunctions {
-//options
-class_definition_options_t jsHookfunctionsOptions = {
-    JS_FUNCTION,
-    CREATE_INSTANCE,
-    NONE_NOTICE,
-    USE_OVERLAYED,     //ignored
-    NULL,
-    NULL,
-    reinterpret_cast<js_function_impl>(JSCFunctions::JavaScriptHookProc)
-};
-
-class_definition_options_t jsPrintfunctionsOptions = {
-    JS_FUNCTION,
-    CREATE_INSTANCE,
-    NONE_NOTICE,
-    USE_OVERLAYED,     //ignored
-    NULL,
-    NULL,
-    reinterpret_cast<js_function_impl>(JSCFunctions::JavaScriptPrintProc)
-};
-
-js_entity_definition_t jsPrint = {
-    JSGLOBAL_OBJECT,
-    JSPRINT_NAME,
-    "",
-    NULL,
-    NULL,
-    &jsPrintfunctionsOptions
-};
-
-js_entity_definition_t jsHook = {
-    JSGLOBAL_OBJECT,
-    JSHOOK_NAME,
-    "",
-    NULL,
-    NULL,
-    &jsHookfunctionsOptions
-};
-
-const js_entity_definition_ptr_t jsPrintPtr = &jsPrint;
-const js_entity_definition_ptr_t jsHookPtr = &jsHook;
-}
-
-bool JsFunctionManager::initialize()
-{
-    _D("JSObjectDeclaration for js functions are intialized");
-    JSObjectDeclarationPtr jsPrintObj(
-        new JSObjectDeclaration(JavaScriptFunctions::jsPrintPtr));
-
-    JSObjectDeclarationPtr jsHookObj(
-        new JSObjectDeclaration(JavaScriptFunctions::jsHookPtr));
-
-    m_functions.push_back(jsPrintObj);
-    m_functions.push_back(jsHookObj);
-
-    return true;
-}
-
-JsFunctionManager::Functions JsFunctionManager::getFunctions()
-{
-    _D("get standard js fucntions");
-    static bool initialized = initialize();
-    (void) initialized;
-    return m_functions;
-}
diff --git a/src_mobile/js-overlay/js_function_manager.h b/src_mobile/js-overlay/js_function_manager.h
deleted file mode 100644 (file)
index d6bd80e..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * 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    js_function_manager.h
- * @author  Grzegorz Krawczyk (g.krawczyk@samgsung.com)
- * @version
- * @brief
- */
-
-#ifndef WRT_SRC_PLUGIN_SERVICE_JS_FUNCTION_MANGER_H_
-#define WRT_SRC_PLUGIN_SERVICE_JS_FUNCTION_MANGER_H_
-
-#include <list>
-#include <dpl/noncopyable.h>
-#include <dpl/singleton.h>
-
-#include <Commons/JSObjectDeclaration.h>
-
-class JsFunctionManager : private DPL::Noncopyable
-{
-  public:
-    typedef std::list<JSObjectDeclarationPtr> Functions;
-
-  public:
-    Functions getFunctions();
-
-  private:
-    JsFunctionManager()
-    {}
-
-    bool initialize();
-
-  private:
-    Functions m_functions;
-
-    friend class DPL::Singleton<JsFunctionManager>;
-};
-
-typedef DPL::Singleton<JsFunctionManager> JsFunctionManagerSingleton;
-
-#endif
-
diff --git a/src_mobile/js-overlay/js_overlay_functions.cpp b/src_mobile/js-overlay/js_overlay_functions.cpp
deleted file mode 100644 (file)
index 8097d20..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * 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    javascript_functions.cpp
- * @author  Grzegorz Krawczyk (g.krawczyk@samgsung.com)
- * @version
- * @brief
- */
-
-#include <dpl/log/log.h>
-#include <dpl/scoped_array.h>
-#include <js_overlay_functions.h>
-
-namespace JSCFunctions {
-std::string ConvertJSStringToStdString(JSStringRef value)
-{
-    int nSize = JSStringGetLength(value) + 1;
-    DPL::ScopedArray<char> textStr(new char[nSize]);
-    JSStringGetUTF8CString(value, textStr.Get(), nSize);
-    std::string ret = textStr.Get();
-    return ret;
-}
-
-JSValueRef JavaScriptPrintProc(JSContextRef context,
-                               JSObjectRef /*object*/,
-                               JSObjectRef /*thisObject*/,
-                               size_t argumentCount,
-                               const JSValueRef arguments[],
-                               JSValueRef* exception)
-{
-    if (argumentCount == 0 || !JSValueIsString(context, arguments[0])) {
-        LogError("Argument is not string");
-        return JSValueMakeUndefined(context);
-    }
-
-    JSStringRef textRef = JSValueToStringCopy(context, arguments[0], exception);
-    int nSize = JSStringGetLength(textRef) + 1;
-
-    DPL::ScopedArray<char> textStr(new char[nSize]);
-
-    JSStringGetUTF8CString(textRef, textStr.Get(), nSize);
-    LogDebug("\033[00;35m[jsPrint] " << textStr.Get());
-
-    JSStringRelease(textRef);
-    return JSValueMakeBoolean(context, true);
-}
-
-JSValueRef JavaScriptHookProc(
-    JSContextRef context,
-    JSObjectRef /*object*/,
-    JSObjectRef /*thisObject*/,
-    size_t argumentCount,
-    const JSValueRef arguments[],
-    JSValueRef* exception)
-{
-    bool inError = false;
-    if (argumentCount < 2 ||
-        argumentCount > 3 ||
-        !JSValueIsString(context, arguments[0]) ||
-        !JSValueIsString(context, arguments[1]))
-    {
-        inError = true;
-    }
-
-    if (inError) {
-        LogError("*********************************************");
-        LogError("*********************************************");
-        LogError("Cannot print test Result");
-        LogError("*********************************************");
-        LogError("*********************************************");
-        return JSValueMakeUndefined(context);
-    }
-
-    std::string id, result, message;
-    JSStringRef idRef = JSValueToStringCopy(context, arguments[0], exception);
-    id = ConvertJSStringToStdString(idRef);
-    JSStringRelease(idRef);
-    JSStringRef idResult = JSValueToStringCopy(context,
-                                               arguments[1],
-                                               exception);
-    result = ConvertJSStringToStdString(idResult);
-    JSStringRelease(idResult);
-
-    if (argumentCount == 3 && !JSValueIsString(context, arguments[2])) {
-        JSStringRef idMessage = JSValueToStringCopy(context,
-                                                    arguments[0],
-                                                    exception);
-        message = ConvertJSStringToStdString(idMessage);
-        JSStringRelease(idMessage);
-    }
-
-    LogDebug("\033[00;35m***********************************************");
-    LogDebug("\033[00;35m***********************************************");
-    LogDebug("\033[00;35m TEST ID: " << id);
-    LogDebug("\033[00;35m RESULT: " << result);
-    LogDebug("\033[00;35m MESSAGE: " << message);
-    LogDebug("\033[00;35m***********************************************");
-    LogDebug("\033[00;35m***********************************************");
-
-    return JSValueMakeBoolean(context, true);
-}
-}
diff --git a/src_mobile/js-overlay/js_overlay_functions.h b/src_mobile/js-overlay/js_overlay_functions.h
deleted file mode 100644 (file)
index 3c7f86a..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * 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    javascript_functions.h
- * @author  Grzegorz Krawczyk (g.krawczyk@samgsung.com)
- * @version
- * @brief
- */
-
-#ifndef WRT_SRC_PLUGIN_SERVICE_EFL_JAVASCRIPT_FUNCTIONS_H_
-#define WRT_SRC_PLUGIN_SERVICE_EFL_JAVASCRIPT_FUNCTIONS_H_
-
-#include <JavaScriptCore/JavaScript.h>
-
-namespace JSCFunctions {
-JSValueRef JavaScriptPrintProc(
-    JSContextRef context,
-    JSObjectRef /*object*/,
-    JSObjectRef /*thisObject*/,
-    size_t argumentCount,
-    const JSValueRef arguments[],
-    JSValueRef * exception);
-JSValueRef JavaScriptHookProc(
-    JSContextRef context,
-    JSObjectRef /*object*/,
-    JSObjectRef /*thisObject*/,
-    size_t argumentCount,
-    const JSValueRef arguments[],
-    JSValueRef * exception);
-}
-
-#endif
-
diff --git a/src_mobile/js-overlay/js_overlay_types.h b/src_mobile/js-overlay/js_overlay_types.h
deleted file mode 100644 (file)
index e47634f..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * 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       js_overlay_types.h
- * @author     Yunchan Cho (yunchan.cho@samsung.com)
- * @version    0.1
- * @brief
- */
-
-#ifndef _WRT_PLUGINS_JS_OVERLAY_TYPES_H_
-#define _WRT_PLUGINS_JS_OVERLAY_TYPES_H_
-
-#include <string>
-
-namespace WrtPlugins {
-namespace W3C {
-// If needed, enum for new custom event should be defined here
-enum CustomEventType {
-    StorageCustomEvent,
-    ServiceCustomEvent,
-    SoftKeyboardChangeCustomEvent,
-};
-
-// Argument structure of SoftKeyboardChangeCustomEvent
-typedef struct SoftKeyboardChangeArgs {
-    std::string state; // value is 'on' or 'off'
-    int width;
-    int height;
-    SoftKeyboardChangeArgs() :
-        width(0),
-        height(0)
-    {}
-} SoftKeyboardChangeArgs;
-
-// If needed, argument structure of other custom events should be defined here
-} // W3C
-} // WrtPlugins
-#endif // _WRT_PLUGINS_JS_OVERLAY_TYPES_H_
diff --git a/src_mobile/modules/API/CMakeLists.txt b/src_mobile/modules/API/CMakeLists.txt
deleted file mode 100644 (file)
index 1a64e70..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-# 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_config_file(Filesystem)
-include_config_file(Widget)
-include_config_file(LocalStorage)
-include_config_file(WidgetDB)
-include_config_file(PluginManager)
-include_config_file(StorageEvent)
-include_config_file(TizenServiceEvent)
-include_config_file(SoftKeyboardChangeEvent)
diff --git a/src_mobile/modules/API/DESCRIPTION b/src_mobile/modules/API/DESCRIPTION
deleted file mode 100644 (file)
index 76eb35c..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-!!!options!!! stop
-Platform independent platform API
diff --git a/src_mobile/modules/API/Filesystem/Enums.h b/src_mobile/modules/API/Filesystem/Enums.h
deleted file mode 100644 (file)
index 81e7d0d..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRTDEVICEAPIS_FILESYSTEM_ENUMS_H_
-#define WRTDEVICEAPIS_FILESYSTEM_ENUMS_H_
-
-#include <string>
-#include <map>
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-enum LocationType
-{
-    LT_APPS,
-    LT_DOCUMENTS,
-    LT_DOWNLOADS,
-    LT_GAMES,
-    LT_IMAGES,
-    LT_OTHERS,
-    LT_ROOT,
-    LT_SDCARD,
-    LT_SOUNDS,
-    LT_TEMP,
-    LT_VIDEOS
-};
-
-enum NodeType
-{
-    NT_DIRECTORY,
-    NT_FILE
-};
-
-enum AccessMode
-{
-    AM_READ = 0x0001,
-    AM_WRITE = 0x0002,
-    AM_APPEND = 0x0004
-};
-
-/**
- * Used in @see IManager::access().
- */
-enum AccessType
-{
-    AT_READ = 0x0001,     //!< AT_READ   - checks for read access
-    AT_WRITE = 0x0002,    //!< AT_WRITE  - checks for write access
-    AT_EXEC = 0x0004,     //!< AT_EXEC   - checks for execution access
-    AT_EXISTS = 0x0008    //!< AT_EXISTS - checks for existence
-};
-
-enum Permissions
-{
-    PERM_NONE = 0x0000,
-    PERM_READ = 0x0001,
-    PERM_WRITE = 0x0002
-};
-
-enum PlatformMode
-{
-    PM_USER_READ = 0x0100,
-    PM_USER_WRITE = 0x0080,
-    PM_USER_EXEC = 0x0040,
-    PM_GROUP_READ = 0x0020,
-    PM_GROUP_WRITE = 0x0010,
-    PM_GROUP_EXEC = 0x0008,
-    PM_OTHER_READ = 0x0004,
-    PM_OTHER_WRITE = 0x0002,
-    PM_OTHER_EXEC = 0x0001,
-    PM_NONE = 0x0000
-};
-
-enum Options
-{
-    OPT_NONE = 0x0000,
-    OPT_OVERWRITE = 0x0001,
-    OPT_RECURSIVE = 0x0002
-};
-
-enum FindFilter
-{
-    FF_NAME,
-    FF_CREATED,
-    FF_MODIFIED,
-    FF_SIZE
-};
-typedef std::map<FindFilter, std::string> FiltersMap;
-} // API
-} // Filesystem
-} // WrtDeviceApis
-
-#endif /* WRTDEVICEAPIS_FILESYSTEM_ENUMS_H_ */
diff --git a/src_mobile/modules/API/Filesystem/EventCopy.cpp b/src_mobile/modules/API/Filesystem/EventCopy.cpp
deleted file mode 100644 (file)
index cd4efa1..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * 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 "EventCopy.h"
-#include <dpl/assert.h>
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-EventCopy::EventCopy(const IPathPtr& src,
-                     const IPathPtr& dest) :
-    m_src(src),
-    m_dest(dest),
-    m_options(OPT_NONE)
-{
-    Assert(src && "Source path not set.");
-    Assert(dest && "Destination path not set.");
-}
-
-IPathPtr EventCopy::getDestination() const
-{
-    return m_dest;
-}
-
-IPathPtr EventCopy::getSource() const
-{
-    return m_src;
-}
-
-INodePtr EventCopy::getResult() const
-{
-    return m_result;
-}
-
-void EventCopy::setResult(const INodePtr& node)
-{
-    m_result = node;
-}
-
-int EventCopy::getOptions() const
-{
-    return m_options;
-}
-
-void EventCopy::setOptions(int options)
-{
-    m_options = options;
-}
-} // API
-} // Filesystem
-} // WrtDeviceApis
diff --git a/src_mobile/modules/API/Filesystem/EventCopy.h b/src_mobile/modules/API/Filesystem/EventCopy.h
deleted file mode 100644 (file)
index 62bef44..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRTDEVICEAPIS_FILESYSTEM_EVENTCOPY_H_
-#define WRTDEVICEAPIS_FILESYSTEM_EVENTCOPY_H_
-
-#include <dpl/shared_ptr.h>
-#include <Commons/IEvent.h>
-#include "IPath.h"
-#include "INode.h"
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-class EventCopy : public Commons::IEvent<EventCopy>
-{
-  public:
-    /**
-     * Creates new event object.
-     * @param src Path to source node.
-     * @param dest Path to destination node.
-     * @return New object.
-     */
-    EventCopy(const IPathPtr& src,
-              const IPathPtr& dest);
-
-    /**
-     * Gets destination path.
-     * @return Destination path.
-     */
-    IPathPtr getDestination() const;
-
-    /**
-     * Gets source path.
-     * @return Source path.
-     */
-    IPathPtr getSource() const;
-
-    /**
-     * Gets result node.
-     * @return Result node.
-     */
-    INodePtr getResult() const;
-
-    /**
-     * Sets result node.
-     * @param node Result node.
-     */
-    void setResult(const INodePtr& node);
-
-    /**
-     * Gets options.
-     * @return Options.
-     */
-    int getOptions() const;
-
-    /**
-     * Sets options.
-     * @param options Options.
-     */
-    void setOptions(int options);
-
-  private:
-    IPathPtr m_src;   ///< Source path.
-    IPathPtr m_dest;  ///< Destination path.
-    INodePtr m_result; ///< Result node.
-    int m_options;    ///< Options for copy action @see
-                      // WrtDeviceApis::Api::Filesystem::Options.
-};
-
-typedef DPL::SharedPtr<EventCopy> EventCopyPtr;
-} // API
-} // Filesystem
-} // WrtDeviceApis
-
-#endif // WRTDEVICEAPIS_FILESYSTEM_EVENTCOPY_H_
diff --git a/src_mobile/modules/API/Filesystem/EventFind.cpp b/src_mobile/modules/API/Filesystem/EventFind.cpp
deleted file mode 100644 (file)
index c8c01a9..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * 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 "EventFind.h"
-
-#include <Filesystem/Path.h>
-#include "INode.h"
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-EventFind::EventFind(const IPathPtr& path) : m_path(path)
-{}
-
-IPathPtr EventFind::getPath() const
-{
-    return m_path;
-}
-
-NodeList EventFind::getResult() const
-{
-    return m_nodes;
-}
-
-void EventFind::addResult(const INodePtr& node)
-{
-    m_nodes.push_back(node);
-}
-
-void EventFind::setResult(const NodeList& nodes)
-{
-    m_nodes = nodes;
-}
-
-void EventFind::addFilter(FindFilter name,
-                          const std::string& value)
-{
-    m_filters.insert(std::pair<FindFilter, std::string>(name, value));
-}
-
-FiltersMap EventFind::getFilters() const
-{
-    return m_filters;
-}
-} // API
-} // Filesystem
-} // WrtDeviceApis
diff --git a/src_mobile/modules/API/Filesystem/EventFind.h b/src_mobile/modules/API/Filesystem/EventFind.h
deleted file mode 100644 (file)
index 47d6e50..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRTDEVICEAPIS_IEVENTFILESYSTEMFIND_H_
-#define WRTDEVICEAPIS_IEVENTFILESYSTEMFIND_H_
-
-#include <list>
-#include <dpl/shared_ptr.h>
-#include <Commons/IEvent.h>
-#include "IPath.h"
-#include "INodeTypes.h"
-#include "Enums.h"
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-class EventFind : public Commons::IEvent<EventFind>
-{
-  public:
-    /**
-     * Creates new event object.
-     * @param path Start path.
-     * @return New object.
-     */
-    explicit EventFind(const IPathPtr& path);
-
-    /**
-     * Gets start path.
-     * @return Path to start searching from.
-     */
-    IPathPtr getPath() const;
-
-    /**
-     * Gets found nodes.
-     * @return Nodes.
-     */
-    NodeList getResult() const;
-
-    /**
-     * Adds found node.
-     * @param node Found node.
-     */
-    void addResult(const INodePtr& node);
-
-    /**
-     * Sets found nodes.
-     * @param nodes Nodes.
-     */
-    void setResult(const NodeList& nodes);
-
-    /**
-     * Adds find filter.
-     * @param name Filter name.
-     * @param value Filter value.
-     */
-    void addFilter(FindFilter name,
-                   const std::string& value);
-
-    /**
-     * Gets all filters.
-     * @return Filters.
-     */
-    FiltersMap getFilters() const;
-
-  private:
-    IPathPtr m_path;    ///< Start path.
-    NodeList m_nodes;   ///< Resolved nodes.
-    FiltersMap m_filters; ///< Search filters.
-};
-
-typedef DPL::SharedPtr<EventFind> EventFindPtr;
-} // API
-} // Filesystem
-} // WrtDeviceApis
-
-#endif // WRTDEVICEAPIS_IEVENTFILESYSTEMFIND_H_
diff --git a/src_mobile/modules/API/Filesystem/EventListNodes.cpp b/src_mobile/modules/API/Filesystem/EventListNodes.cpp
deleted file mode 100644 (file)
index 3fed54f..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * 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 "EventListNodes.h"
-#include <dpl/assert.h>
-#include "INode.h"
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-EventListNodes::EventListNodes(const INodePtr& node) : m_node(node)
-{
-    Assert(m_node && "Node can't be NULL.");
-}
-
-INodePtr EventListNodes::getNode() const
-{
-    return m_node;
-}
-
-NodeFilterPtr EventListNodes::getFilter() const
-{
-    return m_filter;
-}
-
-void EventListNodes::setFilter(const NodeFilterPtr& filter)
-{
-    m_filter = filter;
-}
-
-NodeList EventListNodes::getResult() const
-{
-    return m_list;
-}
-
-void EventListNodes::setResult(const NodeList& list)
-{
-    m_list = list;
-}
-} // API
-} // Filesystem
-} // WrtDeviceApis
diff --git a/src_mobile/modules/API/Filesystem/EventListNodes.h b/src_mobile/modules/API/Filesystem/EventListNodes.h
deleted file mode 100644 (file)
index a856546..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRTDEVICEAPIS_FILESYSTEM_EVENTLISTNODES_H_
-#define WRTDEVICEAPIS_FILESYSTEM_EVENTLISTNODES_H_
-
-#include <dpl/shared_ptr.h>
-#include <Commons/IEvent.h>
-#include "INodeTypes.h"
-#include "NodeFilter.h"
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-class EventListNodes : public Commons::IEvent<EventListNodes>
-{
-  public:
-    /**
-     * Creates new event object.
-     * @param path Node to list children for.
-     * @return New object.
-     */
-    explicit EventListNodes(const INodePtr& node);
-
-    /**
-     * Gets parent node.
-     * @return Parent node.
-     */
-    INodePtr getNode() const;
-
-    /**
-     * Gets filter.
-     * @return Filter.
-     */
-    NodeFilterPtr getFilter() const;
-
-    /**
-     * Sets filter.
-     * @param filter Filter to list only specific nodes.
-     */
-    void setFilter(const NodeFilterPtr& filter);
-
-    /**
-     * Gets nodes.
-     * @return Nodes list.
-     */
-    NodeList getResult() const;
-
-    /**
-     * Sets nodes list.
-     * @param list Nodes list.
-     */
-    void setResult(const NodeList& list);
-
-  private:
-    NodeList m_list;      ///< List of child nodes.
-    INodePtr m_node;      ///< Node to list children for.
-    NodeFilterPtr m_filter; ///< Filter.
-};
-
-typedef DPL::SharedPtr<EventListNodes> EventListNodesPtr;
-} // API
-} // Filesystem
-} // WrtDeviceApis
-
-#endif // WRTDEVICEAPIS_FILESYSTEM_EVENTLISTNODES_H_
diff --git a/src_mobile/modules/API/Filesystem/EventMove.cpp b/src_mobile/modules/API/Filesystem/EventMove.cpp
deleted file mode 100644 (file)
index 0164856..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * 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 "EventMove.h"
-#include <dpl/assert.h>
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-EventMove::EventMove(const IPathPtr& src,
-                     const IPathPtr& dest) :
-    m_src(src),
-    m_dest(dest),
-    m_options(OPT_NONE)
-{
-    Assert(src && "Source path not set.");
-    Assert(dest && "Destination path not set.");
-}
-
-IPathPtr EventMove::getDestination() const
-{
-    return m_dest;
-}
-
-IPathPtr EventMove::getSource() const
-{
-    return m_src;
-}
-
-INodePtr EventMove::getResult() const
-{
-    return m_result;
-}
-
-void EventMove::setResult(const INodePtr& node)
-{
-    m_result = node;
-}
-
-int EventMove::getOptions() const
-{
-    return m_options;
-}
-
-void EventMove::setOptions(int options)
-{
-    m_options = options;
-}
-} // API
-} // Filesystem
-} // WrtDeviceApis
diff --git a/src_mobile/modules/API/Filesystem/EventMove.h b/src_mobile/modules/API/Filesystem/EventMove.h
deleted file mode 100644 (file)
index d9716f0..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRTDEVICEAPIS_FILESYSTEM_EVENTMOVE_H_
-#define WRTDEVICEAPIS_FILESYSTEM_EVENTMOVE_H_
-
-#include <dpl/shared_ptr.h>
-#include <Commons/IEvent.h>
-#include "IPath.h"
-#include "INode.h"
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-class EventMove : public Commons::IEvent<EventMove>
-{
-  public:
-    /**
-     * Creates new event object.
-     * @param src Source path.
-     * @param dest Destination path.
-     * @return New object.
-     */
-    EventMove(const IPathPtr& src,
-              const IPathPtr& dest);
-
-    /**
-     * Gets destination path.
-     * @return Destination path.
-     */
-    IPathPtr getDestination() const;
-
-    /**
-     * Gets source path.
-     * @return Source path.
-     */
-    IPathPtr getSource() const;
-
-    /**
-     * Gets result node.
-     * @return Result node.
-     */
-    INodePtr getResult() const;
-
-    /**
-     * Sets result node.
-     * @param node Result node.
-     */
-    void setResult(const INodePtr& node);
-
-    /**
-     * Gets options.
-     * @return Options.
-     */
-    int getOptions() const;
-
-    /**
-     * Sets options.
-     * @param options Options.
-     */
-    void setOptions(int options);
-
-  private:
-    IPathPtr m_src;   ///< Source path.
-    IPathPtr m_dest;  ///< Destination path.
-    INodePtr m_result; ///< Result node.
-    int m_options;    ///< Options for copy action @see
-                      // WrtDeviceApis::Api::Filesystem::Options.
-};
-
-typedef DPL::SharedPtr<EventMove> EventMovePtr;
-} // API
-} // Filesystem
-} // WrtDeviceApis
-
-#endif // WRTDEVICEAPIS_FILESYSTEM_EVENTMOVE_H_
diff --git a/src_mobile/modules/API/Filesystem/EventOpen.cpp b/src_mobile/modules/API/Filesystem/EventOpen.cpp
deleted file mode 100644 (file)
index 274e963..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * 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 "EventOpen.h"
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-EventOpen::EventOpen(int mode) : m_mode(mode)
-{}
-
-int EventOpen::getMode() const
-{
-    return m_mode;
-}
-
-IStreamPtr EventOpen::getResult() const
-{
-    return m_stream;
-}
-
-void EventOpen::setResult(const IStreamPtr& stream)
-{
-    m_stream = stream;
-}
-} // API
-} // Filesystem
-} // WrtDeviceApis
diff --git a/src_mobile/modules/API/Filesystem/EventOpen.h b/src_mobile/modules/API/Filesystem/EventOpen.h
deleted file mode 100644 (file)
index 5ab5662..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRTDEVICEAPIS_FILESYSTEM_EVENTOPEN_H_
-#define WRTDEVICEAPIS_FILESYSTEM_EVENTOPEN_H_
-
-#include <dpl/shared_ptr.h>
-#include <Commons/IEvent.h>
-#include "IStream.h"
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-class EventOpen : public Commons::IEvent<EventOpen>
-{
-  public:
-    /**
-     * Creates new event object.
-     * @param mode Mode to open the node in.
-     * @return New object.
-     */
-    explicit EventOpen(int mode);
-
-    /**
-     * Gets mode.
-     * @return Mode.
-     */
-    int getMode() const;
-
-    /**
-     * Gets result stream.
-     * @return Result stream.
-     */
-    IStreamPtr getResult() const;
-
-    /**
-     * Sets result stream.
-     * @param stream Result stream.
-     */
-    void setResult(const IStreamPtr& stream);
-
-  private:
-    int m_mode;         ///< Mode.
-    IStreamPtr m_stream; ///< Opened stream.
-};
-
-typedef DPL::SharedPtr<EventOpen> EventOpenPtr;
-} // API
-} // Filesystem
-} // WrtDeviceApis
-
-#endif // WRTDEVICEAPIS_FILESYSTEM_EVENTOPEN_H_
diff --git a/src_mobile/modules/API/Filesystem/EventReadText.cpp b/src_mobile/modules/API/Filesystem/EventReadText.cpp
deleted file mode 100644 (file)
index 560687e..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * 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 "EventReadText.h"
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-std::string EventReadText::getResult() const
-{
-    return m_result;
-}
-
-void EventReadText::setResult(const std::string& result)
-{
-    m_result = result;
-}
-} // API
-} // Filesystem
-} // WrtDeviceApis
diff --git a/src_mobile/modules/API/Filesystem/EventReadText.h b/src_mobile/modules/API/Filesystem/EventReadText.h
deleted file mode 100644 (file)
index 986b565..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRTDEVICEAPIS_FILESYSTEM_EVENTREADTEXT_H_
-#define WRTDEVICEAPIS_FILESYSTEM_EVENTREADTEXT_H_
-
-#include <string>
-#include <dpl/shared_ptr.h>
-#include <Commons/IEvent.h>
-#include "IPath.h"
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-class EventReadText : public Commons::IEvent<EventReadText>
-{
-  public:
-    /**
-     * Gets read text.
-     * @return Text.
-     */
-    std::string getResult() const;
-
-    /**
-     * Sets read text.
-     * @param result Text.
-     */
-    void setResult(const std::string& result);
-
-  private:
-    std::string m_result; ///< Read text.
-};
-
-typedef DPL::SharedPtr<EventReadText> EventReadTextPtr;
-} // API
-} // Filesystem
-} // WrtDeviceApis
-
-#endif // WRTDEVICEAPIS_FILESYSTEM_EVENTREADTEXT_H_
diff --git a/src_mobile/modules/API/Filesystem/EventRemove.cpp b/src_mobile/modules/API/Filesystem/EventRemove.cpp
deleted file mode 100644 (file)
index 6be8f41..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * 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 "EventRemove.h"
-#include <dpl/assert.h>
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-EventRemove::EventRemove(const IPathPtr& path) :
-    m_path(path),
-    m_options(OPT_NONE)
-{
-    Assert(m_path && "Path is not set.");
-}
-
-IPathPtr EventRemove::getPath() const
-{
-    return m_path;
-}
-
-int EventRemove::getOptions() const
-{
-    return m_options;
-}
-
-void EventRemove::setOptions(int options)
-{
-    m_options = options;
-}
-} // API
-} // Filesystem
-} // WrtDeviceApis
diff --git a/src_mobile/modules/API/Filesystem/EventRemove.h b/src_mobile/modules/API/Filesystem/EventRemove.h
deleted file mode 100644 (file)
index be3aecd..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRTDEVICEAPIS_FILESYSTEM_EVENTREMOVE_H_
-#define WRTDEVICEAPIS_FILESYSTEM_EVENTREMOVE_H_
-
-#include <dpl/shared_ptr.h>
-#include <Commons/IEvent.h>
-#include "INode.h"
-#include "Enums.h"
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-class EventRemove : public Commons::IEvent<EventRemove>
-{
-  public:
-    /**
-     * Creates new event object.
-     * @param path Path to the node to remove.
-     * @return New object.
-     */
-    explicit EventRemove(const IPathPtr& path);
-
-    /**
-     * Gets path to the node to remove.
-     * @return Path.
-     */
-    IPathPtr getPath() const;
-
-    /**
-     * Gets options.
-     * @return Options.
-     */
-    int getOptions() const;
-
-    /**
-     * Sets options.
-     * @param options Options.
-     */
-    void setOptions(int options);
-
-  private:
-    IPathPtr m_path; ///< Source path.
-    int m_options;  ///< Options for remove action @see
-                    // WrtDeviceApis::Api::Filesystem::Options.
-};
-
-typedef DPL::SharedPtr<EventRemove> EventRemovePtr;
-} // API
-} // Filesystem
-} // WrtDeviceApis
-
-#endif // WRTDEVICEAPIS_FILESYSTEM_EVENTREMOVE_H_
diff --git a/src_mobile/modules/API/Filesystem/EventResolve.cpp b/src_mobile/modules/API/Filesystem/EventResolve.cpp
deleted file mode 100644 (file)
index 2473795..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * 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 "EventResolve.h"
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-EventResolve::EventResolve(const IPathPtr& path) : m_path(path)
-{}
-
-IPathPtr EventResolve::getPath() const
-{
-    return m_path;
-}
-
-INodePtr EventResolve::getResult() const
-{
-    return m_node;
-}
-
-void EventResolve::setResult(const INodePtr& node)
-{
-    m_node = node;
-}
-} // API
-} // Filesystem
-} // WrtDeviceApis
diff --git a/src_mobile/modules/API/Filesystem/EventResolve.h b/src_mobile/modules/API/Filesystem/EventResolve.h
deleted file mode 100644 (file)
index 1d50258..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRTDEVICEAPIS_FILESYSTEM_EVENTRESOLVE_H_
-#define WRTDEVICEAPIS_FILESYSTEM_EVENTRESOLVE_H_
-
-#include <dpl/shared_ptr.h>
-#include <Commons/IEvent.h>
-#include "IPath.h"
-#include "INode.h"
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-class EventResolve : public Commons::IEvent<EventResolve>
-{
-  public:
-    /**
-     * Creates new event object.
-     * @param path Path to the node to resolve.
-     * @return New object.
-     */
-    explicit EventResolve(const IPathPtr& path);
-
-    /**
-     * Gets path of the node to resolve.
-     * @return Path to resolve.
-     */
-    IPathPtr getPath() const;
-
-    /**
-     * Gets resolved node.
-     * NULL if none found. Check exception code.
-     * @return Resolved node or NULL.
-     */
-    INodePtr getResult() const;
-
-    /**
-     * Sets resolved node.
-     * @param node Resolved node.
-     */
-    void setResult(const INodePtr& node);
-
-  private:
-    IPathPtr m_path; ///< Path to the requested node.
-    INodePtr m_node; ///< Resolved node.
-};
-
-typedef DPL::SharedPtr<EventResolve> EventResolvePtr;
-} // API
-} // Filesystem
-} // WrtDeviceApis
-
-#endif // WRTDEVICEAPIS_FILESYSTEM_EVENTRESOLVE_H_
diff --git a/src_mobile/modules/API/Filesystem/IManager.cpp b/src_mobile/modules/API/Filesystem/IManager.cpp
deleted file mode 100644 (file)
index 92219f5..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * 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 <Filesystem/Manager.h>
-#include <Commons/ThreadPool.h>
-#include "IManager.h"
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-IManager& IManager::getInstance()
-{
-    static Manager instance;
-    return instance;
-}
-
-bool IManager::fileExists(const std::string &file)
-{
-    return WrtDeviceApis::Filesystem::Manager::fileExists(file);
-}
-
-IManager::IManager() :
-    Commons::EventRequestReceiver<EventResolve>(
-        Commons::ThreadEnum::FILESYSTEM_THREAD),
-    Commons::EventRequestReceiver<EventCopy>(
-        Commons::ThreadEnum::FILESYSTEM_THREAD),
-    Commons::EventRequestReceiver<EventMove>(
-        Commons::ThreadEnum::FILESYSTEM_THREAD),
-    Commons::EventRequestReceiver<EventRemove>(
-        Commons::ThreadEnum::FILESYSTEM_THREAD),
-    Commons::EventRequestReceiver<EventFind>(
-        Commons::ThreadEnum::FILESYSTEM_THREAD)
-{}
-
-IManager::~IManager()
-{}
-} // API
-} // Filesystem
-} // WrtDeviceApis
diff --git a/src_mobile/modules/API/Filesystem/IManager.h b/src_mobile/modules/API/Filesystem/IManager.h
deleted file mode 100644 (file)
index bc3cf0d..0000000
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRTDEVICEAPIS_FILESYSTEM_IMANAGER_H_
-#define WRTDEVICEAPIS_FILESYSTEM_IMANAGER_H_
-
-#include <vector>
-#include <string>
-#include <cstddef>
-#include <dpl/noncopyable.h>
-#include <Commons/EventReceiver.h>
-#include <Filesystem/EventResolve.h>
-#include <Filesystem/EventCopy.h>
-#include <Filesystem/EventMove.h>
-#include <Filesystem/EventRemove.h>
-#include <Filesystem/EventFind.h>
-#include <Filesystem/Enums.h>
-#include <Filesystem/INode.h>
-#include <Filesystem/IPath.h>
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-typedef std::vector<IPathPtr> LocationPaths;
-typedef std::vector<LocationType> LocationTypes;
-
-class IManager :
-    public Commons::EventRequestReceiver<EventResolve>,
-    public Commons::EventRequestReceiver<EventCopy>,
-    public Commons::EventRequestReceiver<EventMove>,
-    public Commons::EventRequestReceiver<EventRemove>,
-    public Commons::EventRequestReceiver<EventFind>
-{
-  public:
-    static IManager& getInstance();
-    static bool fileExists(const std::string &file);
-
-    virtual ~IManager() = 0;
-
-    /**
-     * Gets base path.
-     * @return Valid path or empty shared pointer.
-     */
-    virtual IPathPtr getBasePath() const = 0;
-
-    /**
-     * Gets path for specified location type.
-     * @param type Location type @see
-     * WrtDeviceApis::Api::Filesystem::LocationType.
-     * @return Valid path or empty shared pointer.
-     */
-    virtual IPathPtr getLocationPath(LocationType type) const = 0;
-
-    /**
-     * Gets paths to default locations.
-     * @return Paths to predefined virtual locations.
-     */
-    virtual LocationPaths getLocationPaths() const = 0;
-
-    /**
-     * Gets locations supported by platform.
-     * @return Supported locations.
-     */
-    virtual LocationTypes getLocations() const = 0;
-
-    /**
-     * Gets filesystem node.
-     * @param event Get node event @see Api::Filesystem::EventGetNode.
-     * @remarks Asynchronous.
-     */
-    virtual void getNode(const EventResolvePtr& event) = 0;
-
-    /**
-     * Gets maximum length of filesystem path.
-     * @return Maximum path length.
-     */
-    virtual std::size_t getMaxPathLength() const = 0;
-
-    /**
-     * Copies node to specified destination.
-     * @param event Copy node event @see Api::Filesystem::EventCopy.
-     * @remarks Asynchronous.
-     */
-    virtual void copy(const EventCopyPtr& event) = 0;
-
-    /**
-     * Moves node to specified destination.
-     * @param event Move node event @see Api::Filesystem::EventMove.
-     * @remarks Asynchronous.
-     */
-    virtual void move(const EventMovePtr& event) = 0;
-
-    /**
-     * Removes node.
-     * @param event Remove node event @see Api::Filesystem::EventRemove.
-     * @remarks Asynchronous.
-     */
-    virtual void remove(const EventRemovePtr& event) = 0;
-
-    /**
-     * Finds nodes.
-     * @param event Find nodes event @see Api::Filesystem::EventFind.
-     * @remarks Asynchronous.
-     */
-    virtual void find(const EventFindPtr& event) = 0;
-
-    /**
-     * Checks if node at specified path has supplied access rights.
-     * @param path Path to the node.
-     * @param accessType Access right(s) to check @see AccessType. Multiple
-     * values
-     *                   can be passed using OR operator.
-     * @return True if specified node has supplied access rights, false
-     * otherwise.
-     */
-    virtual bool access(const IPathPtr& path,
-                        int accessType) const = 0;
-
-    virtual void addOpenedNode(const INodePtr& node) = 0;
-    virtual void removeOpenedNode(const INodePtr& node) = 0;
-    virtual bool checkIfOpened(const IPathPtr& path) const = 0;
-
-  protected:
-    IManager();
-
-    virtual void OnRequestReceived(const EventResolvePtr& event) = 0;
-    virtual void OnRequestReceived(const EventCopyPtr& event) = 0;
-    virtual void OnRequestReceived(const EventMovePtr& event) = 0;
-    virtual void OnRequestReceived(const EventRemovePtr& event) = 0;
-    virtual void OnRequestReceived(const EventFindPtr& event) = 0;
-}; // IManager
-} // API
-} // Filesystem
-} // WrtDeviceApis
-
-#endif // WRTDEVICEAPIS_FILESYSTEM_IMANAGER_H_
diff --git a/src_mobile/modules/API/Filesystem/INode.cpp b/src_mobile/modules/API/Filesystem/INode.cpp
deleted file mode 100644 (file)
index cd30a04..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * 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 "INode.h"
-#include <Commons/ThreadPool.h>
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-INode::INode() :
-    Commons::EventRequestReceiver<EventListNodes>(
-        Commons::ThreadEnum::FILESYSTEM_THREAD),
-    Commons::EventRequestReceiver<EventOpen>(
-        Commons::ThreadEnum::FILESYSTEM_THREAD),
-    Commons::EventRequestReceiver<EventReadText>(
-        Commons::ThreadEnum::FILESYSTEM_THREAD)
-{}
-
-INode::~INode()
-{}
-} // API
-} // Filesystem
-} // WrtDeviceApis
diff --git a/src_mobile/modules/API/Filesystem/INode.h b/src_mobile/modules/API/Filesystem/INode.h
deleted file mode 100644 (file)
index c227aa9..0000000
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRTDEVICEAPIS_FILESYSTEM_INODE_H_
-#define WRTDEVICEAPIS_FILESYSTEM_INODE_H_
-
-#include <string>
-#include <vector>
-#include <ctime>
-#include <dpl/noncopyable.h>
-#include <dpl/shared_ptr.h>
-#include <Commons/EventReceiver.h>
-#include "EventListNodes.h"
-#include "EventOpen.h"
-#include "EventReadText.h"
-#include "Enums.h"
-#include "IPath.h"
-#include "IStream.h"
-#include "INodeTypes.h"
-#include "NodeFilter.h"
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-class INode :
-    public Commons::EventRequestReceiver<EventListNodes>,
-    public Commons::EventRequestReceiver<EventOpen>,
-    public Commons::EventRequestReceiver<EventReadText>
-{
-  public:
-    typedef std::vector<std::string> NameList;
-    typedef NameList::iterator NodeListIterator;
-
-  public:
-    virtual ~INode() = 0;
-
-    /**
-     * Gets direct child of this node.
-     * @param path Path to the child node.
-     * @return Ptr to the child node.
-     * @remarks Ownership passed to the caller.
-     */
-    virtual INodePtr getChild(const IPathPtr& path) = 0;
-
-    /**
-     * Gets path of current node.
-     * @return Node's path.
-     */
-    virtual IPathPtr getPath() const = 0;
-
-    /**
-     * Gets type of current node.
-     * @return Node's type.
-     */
-    virtual NodeType getType() const = 0;
-
-    /**
-     * Gets permissions of the virtual node (not real filesystem node).
-     * @return Node's permissions.
-     */
-    virtual int getPermissions() const = 0;
-
-    /**
-     * Sets permissions on the virtual node (not real filesystem node).
-     * @param perms Node's permissions @see Api::Filesystem::Permissions.
-     */
-    virtual void setPermissions(int perms) = 0;
-
-    /**
-     * Gets list of names of direct child nodes.
-     * @return Names of child nodes.
-     */
-    virtual NameList getChildNames() const = 0;
-
-    /**
-     * Gets list of direct child nodes.
-     * @return Child nodes.
-     * @remarks Ownership passed to the caller.
-     * @deprecated
-     */
-    virtual NodeList getChildNodes(const NodeFilterPtr& filter =
-                                       NodeFilterPtr()) const /*DEPREC*/ = 0;
-
-    /**
-     * Gets list of direct descendant nodes.
-     * @param event Get child nodes event.
-     */
-    virtual void getChildNodes(const EventListNodesPtr& event) = 0;
-
-    /**
-     * Gets stream for this node.
-     * @param mode @see Api::Filesystem::AccessMode.
-     * @return Stream connected with current node.
-     * @deprecated Use async version of thi method instead.
-     */
-    virtual IStreamPtr open(int mode) = 0;
-
-    /**
-     * Gets stream for this node.
-     * @param mode @see Api::Filesystem::AccessMode.
-     * @return Stream connected with current node.
-     */
-    virtual void open(const EventOpenPtr& event) = 0;
-
-    /**
-     * Removes underlying filesystem node.
-     * @param options Removal options (by default removal is recursive).
-     * @remarks Synchronous.
-     * Valid options:
-     * - OPT_RECURSIVE - remove node recursively.
-     */
-    virtual void remove(int options = OPT_RECURSIVE) = 0;
-
-    /**
-     * Creates child of current node.
-     * @param path Path to the node to create.
-     * @param type Type of the node @see Api::Filesystem::NodeType.
-     * @param options Additional options see remarks (no options by default).
-     * @return Ptr to newly created node.
-     * @remarks
-     * Valid options:
-     * - OPT_RECURSIVE - attempt to create all necessary sub-directories
-     */
-    virtual INodePtr createChild(const IPathPtr& path,
-                                 NodeType type,
-                                 int options = OPT_NONE) = 0;
-
-    /**
-     * Gets size of this node.
-     * @return Size.
-     */
-    virtual std::size_t getSize() const = 0;
-
-    /**
-     * Gets creation date of this node.
-     * @return Date.
-     */
-    virtual std::time_t getCreated() const = 0;
-
-    /**
-     * Gets last modification date of this node.
-     * @return Date.
-     */
-    virtual std::time_t getModified() const = 0;
-
-    /**
-     * Gets parent of this node.
-     * @return Parent node or NULL if no parent (e.g. in case of a root node).
-     */
-    virtual INodePtr getParent() const = 0;
-
-    /**
-     * Gets platform permissions.
-     * @return Platform permissions (set of flags from @see Permissions enum).
-     */
-    virtual int getMode() const = 0;
-
-    /**
-     * Reads whole file as text.
-     * @param event Read file event.
-     */
-    virtual void read(const EventReadTextPtr& event) = 0;
-
-    virtual std::string toUri(int widgetId) const = 0;
-
-  protected:
-    INode();
-};
-} // API
-} // Filesystem
-} // WrtDeviceApis
-
-#endif /* WRTDEVICEAPIS_FILESYSTEM_INODE_H_ */
diff --git a/src_mobile/modules/API/Filesystem/INodeTypes.h b/src_mobile/modules/API/Filesystem/INodeTypes.h
deleted file mode 100644 (file)
index c1c49f7..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * 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.
- */
-/**
- * @author          Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
- */
-
-#ifndef WRTDEVICEAPIS_FILESYSTEM_INODETYPES_H_
-#define WRTDEVICEAPIS_FILESYSTEM_INODETYPES_H_
-
-#include <vector>
-#include <dpl/shared_ptr.h>
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-class INode;
-
-typedef DPL::SharedPtr<INode> INodePtr;
-
-typedef std::vector<INodePtr> NodeList;
-typedef NodeList::iterator NodeListIterator;
-} // API
-} // Filesystem
-} // WrtDeviceApis
-
-#endif // WRTDEVICEAPIS_FILESYSTEM_INODETYPES_H_
diff --git a/src_mobile/modules/API/Filesystem/IPath.cpp b/src_mobile/modules/API/Filesystem/IPath.cpp
deleted file mode 100644 (file)
index de9b32d..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * 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 <Filesystem/Path.h>
-#include "IPath.h"
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-IPathPtr IPath::create(const std::string& str)
-{
-    return Path::create(str);
-}
-
-IPath::SeparatorType IPath::getSeparator()
-{
-    return Path::getSeparator();
-}
-
-IPath::~IPath()
-{}
-} // API
-} // Filesystem
-} // WrtDeviceApis
diff --git a/src_mobile/modules/API/Filesystem/IPath.h b/src_mobile/modules/API/Filesystem/IPath.h
deleted file mode 100644 (file)
index 3c32abd..0000000
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRTDEVICEAPIS_FILESYSTEM_IPATH_H_
-#define WRTDEVICEAPIS_FILESYSTEM_IPATH_H_
-
-#include <string>
-#include <dpl/shared_ptr.h>
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-class IPath;
-typedef DPL::SharedPtr<IPath> IPathPtr;
-
-class IPath
-{
-  public:
-    typedef char SeparatorType;
-
-  public:
-    /**
-     * Creates path object from specified string.
-     * @param str Path string.
-     * @return Path.
-     * @throw InvalidArgumentException If supplied string is not a valid path.
-     * @throw PlatformException If error in platform occurs.
-     * @remarks Ownership passed to the caller.
-     */
-    static IPathPtr create(const std::string& str);
-
-    /**
-     * Gets separator used by current platform.
-     * @return Path separator.
-     */
-    static SeparatorType getSeparator();
-
-  public:
-    virtual ~IPath() = 0;
-
-    /**
-     * Gets full path.
-     * @return Full path.
-     */
-    virtual std::string getFullPath() const = 0;
-
-    /**
-     * Gets base path (full path w/o name).
-     * @return Base path
-     */
-    virtual std::string getPath() const = 0;
-
-    /**
-     * Gets the last part of path.
-     * @return Path's name.
-     * @return Last part is typically name of a directory or file.
-     */
-    virtual std::string getName() const = 0;
-
-    /**
-     * Appends path specified as string to current path.
-     * @param path Path to append.
-     * @return Current path object.
-     */
-    virtual IPathPtr append(const std::string& path) = 0;
-
-    /**
-     * Appends path specified as path object to current path.
-     * @param path Path to append.
-     * @return Current path object.
-     */
-    virtual IPathPtr append(const IPathPtr& path) = 0;
-
-    /**
-     * Checks if path is abolute.
-     * @return True if absolute, false if relative.
-     */
-    virtual bool isAbsolute() const = 0;
-
-    /**
-     * Clones this object.
-     * @return Independent copy.
-     */
-    virtual IPathPtr clone() const = 0;
-};
-
-inline const IPathPtr operator+(const IPath& lhs,
-                                const IPath& rhs)
-{
-    return IPath::create(lhs.getFullPath())->append(rhs.getFullPath());
-}
-
-inline const IPathPtr operator+(const IPath& lhs,
-                                const std::string& rhs)
-{
-    return IPath::create(lhs.getFullPath())->append(rhs);
-}
-
-inline const IPathPtr operator+(const std::string& lhs,
-                                const IPath& rhs)
-{
-    return IPath::create(lhs)->append(rhs.getFullPath());
-}
-
-inline bool operator==(const IPath& lhs, const IPath& rhs)
-{
-    return (lhs.getFullPath() == rhs.getFullPath());
-}
-
-inline bool operator==(const IPath& lhs, const std::string& rhs)
-{
-    return (lhs.getFullPath() == rhs);
-}
-
-inline bool operator==(const std::string& lhs, const IPath& rhs)
-{
-    return (lhs == rhs.getFullPath());
-}
-
-inline bool operator!=(const IPath& lhs, const IPath& rhs)
-{
-    return (lhs.getFullPath() != rhs.getFullPath());
-}
-
-inline bool operator!=(const IPath& lhs, const std::string& rhs)
-{
-    return (lhs.getFullPath() != rhs);
-}
-
-inline bool operator!=(const std::string& lhs, const IPath& rhs)
-{
-    return (lhs != rhs.getFullPath());
-}
-} // API
-} // Filesystem
-} // WrtDeviceApis
-
-#endif // WRTDEVICEAPIS_FILESYSTEM_IPATH_H_
diff --git a/src_mobile/modules/API/Filesystem/IStream.cpp b/src_mobile/modules/API/Filesystem/IStream.cpp
deleted file mode 100644 (file)
index b18f188..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * 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 "IStream.h"
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-IStream::~IStream()
-{}
-} // API
-} // Filesystem
-} // WrtDeviceApis
diff --git a/src_mobile/modules/API/Filesystem/IStream.h b/src_mobile/modules/API/Filesystem/IStream.h
deleted file mode 100644 (file)
index d39ddb0..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRTDEVICEAPIS_FILESYSTEM_ISTREAM_H_
-#define WRTDEVICEAPIS_FILESYSTEM_ISTREAM_H_
-
-#include <cstddef>
-#include <string>
-#include <dpl/noncopyable.h>
-#include <dpl/shared_ptr.h>
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-class IStream;
-typedef DPL::SharedPtr<IStream> IStreamPtr;
-
-class IStream : private DPL::Noncopyable
-{
-  public:
-    virtual ~IStream() = 0;
-
-    virtual IStreamPtr write(bool arg) = 0;
-    virtual IStreamPtr write(unsigned char arg) = 0;
-    virtual IStreamPtr write(char arg) = 0;
-    virtual IStreamPtr write(int arg) = 0;
-    virtual IStreamPtr write(double arg) = 0;
-    virtual IStreamPtr write(const std::string& arg) = 0;
-
-    virtual IStreamPtr read(bool& arg) = 0;
-    virtual IStreamPtr read(unsigned char& arg) = 0;
-    virtual IStreamPtr read(char& arg) = 0;
-    virtual IStreamPtr read(int& arg) = 0;
-    virtual IStreamPtr read(double& arg) = 0;
-    virtual IStreamPtr read(std::string& arg) = 0;
-
-    /**
-     * Gets characters from stream.
-     * @param num Number of characters to read.
-     * @return Pointer to read buffer.
-     * @throw PlatformException if stream is closed, EOF is set or write-only.
-     * @remarks Passes ownership to the caller.
-     */
-    virtual char* getChars(std::size_t num) = 0;
-
-    /**
-     * Gets bytes from stream.
-     * @param num Number of bytes to read.
-     * @return Pointer to read buffer.
-     * @remarks Passes ownership to the caller.
-     * @throw PlatformException if stream is closed, EOF is set or write-only.
-     */
-    virtual unsigned char* getBytes(std::size_t num) = 0;
-
-    /**
-     * Gets number of bytes read by last getBytes() or getChars() operation.
-     * @return Number of read bytes.
-     * @throw PlatformException if stream is closed or write-only.
-     */
-    virtual std::size_t getCount() const = 0;
-
-    /**
-     * Reads line of characters from stream (till '\n' character).
-     * @return Read line.
-     */
-    virtual std::string getLine() = 0;
-
-    /**
-     * Checks whether stream is open.
-     * @return True if stream is open, false otherwsie.
-     */
-    virtual bool isOpen() const = 0;
-
-    /**
-     * Checks whether End-Of-Line character occured.
-     * @return True if EOF flag was set, false otherwise.
-     */
-    virtual bool isEof() const = 0;
-
-    /**
-     * Closes stream.
-     */
-    virtual void close() = 0;
-
-    /**
-     * Gets current position in stream.
-     * @return Position or -1 if fails.
-     */
-    virtual long getPosition() const = 0;
-
-    /**
-     * Sets current position in stream.
-     * @param position Position to set.
-     */
-    virtual void setPosition(long position) = 0;
-
-    /**
-     * Gets mode stream was opened in.
-     * @return Mode @see Api::Filesystem::AccessMode.
-     */
-    virtual int getMode() const = 0;
-
-    /**
-     * Gets stream's size.
-     * @return Size or -1 if unavailable (e.g. stream is write-only).
-     */
-    virtual long getSize() const = 0;
-};
-} // API
-} // Filesystem
-} // WrtDeviceApis
-
-#endif /* WRTDEVICEAPIS_FILESYSTEM_ISTREAM_H_ */
diff --git a/src_mobile/modules/API/Filesystem/NodeFilter.cpp b/src_mobile/modules/API/Filesystem/NodeFilter.cpp
deleted file mode 100644 (file)
index b26e275..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * 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.
- */
-/**
- * @author          Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
- */
-
-#include "NodeFilter.h"
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-OptionalString NodeFilter::getName() const
-{
-    return m_name;
-}
-
-void NodeFilter::setName(const OptionalString& name)
-{
-    m_name = name;
-}
-
-OptionalDate NodeFilter::getMinCreated() const
-{
-    return m_created.min;
-}
-
-void NodeFilter::setMinCreated(const OptionalDate& date)
-{
-    m_created.min = date;
-}
-
-OptionalDate NodeFilter::getMaxCreated() const
-{
-    return m_created.max;
-}
-
-void NodeFilter::setMaxCreated(const OptionalDate& date)
-{
-    m_created.max = date;
-}
-
-void NodeFilter::setCreated(const OptionalDate& date)
-{
-    m_created.min = m_created.max = date;
-}
-
-OptionalDate NodeFilter::getMinModified() const
-{
-    return m_modified.min;
-}
-
-void NodeFilter::setMinModified(const OptionalDate& date)
-{
-    m_modified.min = date;
-}
-
-OptionalDate NodeFilter::getMaxModified() const
-{
-    return m_modified.max;
-}
-
-void NodeFilter::setMaxModified(const OptionalDate& date)
-{
-    m_modified.max = date;
-}
-
-void NodeFilter::setModified(const OptionalDate& date)
-{
-    m_modified.min = m_modified.max = date;
-}
-
-OptionalSize NodeFilter::getMinSize() const
-{
-    return m_size.min;
-}
-
-void NodeFilter::setMinSize(const OptionalSize& size)
-{
-    m_size.min = size;
-}
-
-OptionalSize NodeFilter::getMaxSize() const
-{
-    return m_size.max;
-}
-
-void NodeFilter::setMaxSize(const OptionalSize& size)
-{
-    m_size.max = size;
-}
-
-void NodeFilter::setSize(const OptionalSize& size)
-{
-    m_size.min = m_size.max = size;
-}
-} // API
-} // Filesystem
-} // WrtDeviceApis
diff --git a/src_mobile/modules/API/Filesystem/NodeFilter.h b/src_mobile/modules/API/Filesystem/NodeFilter.h
deleted file mode 100644 (file)
index 3c47549..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * 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.
- */
-/**
- * @author          Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
- */
-
-#ifndef WRTDEVICEAPIS_FILESYSTEM_NODEFILTER_H_
-#define WRTDEVICEAPIS_FILESYSTEM_NODEFILTER_H_
-
-#include <ctime>
-#include <cstddef>
-#include <string>
-#include <dpl/optional.h>
-#include <dpl/shared_ptr.h>
-#include <Commons/Range.h>
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-typedef DPL::Optional<std::string> OptionalString;
-typedef DPL::Optional<std::time_t> OptionalDate;
-typedef DPL::Optional<std::size_t> OptionalSize;
-
-class NodeFilter
-{
-  public:
-    OptionalString getName() const;
-    void setName(const OptionalString& name);
-
-    OptionalDate getMinCreated() const;
-    void setMinCreated(const OptionalDate& date);
-
-    OptionalDate getMaxCreated() const;
-    void setMaxCreated(const OptionalDate& date);
-
-    void setCreated(const OptionalDate& date);
-
-    OptionalDate getMinModified() const;
-    void setMinModified(const OptionalDate& date);
-
-    OptionalDate getMaxModified() const;
-    void setMaxModified(const OptionalDate& date);
-
-    void setModified(const OptionalDate& date);
-
-    OptionalSize getMinSize() const;
-    void setMinSize(const OptionalSize& size);
-
-    OptionalSize getMaxSize() const;
-    void setMaxSize(const OptionalSize& size);
-
-    void setSize(const OptionalSize& size);
-
-  private:
-    OptionalString m_name;
-    Commons::Range<OptionalDate> m_created;
-    Commons::Range<OptionalDate> m_modified;
-    Commons::Range<OptionalSize> m_size;
-};
-
-typedef DPL::SharedPtr<NodeFilter> NodeFilterPtr;
-} // API
-} // Filesystem
-} // WrtDeviceApis
-
-#endif // WRTDEVICEAPIS_FILESYSTEM_NODEFILTER_H_
diff --git a/src_mobile/modules/API/Filesystem/PathUtils.cpp b/src_mobile/modules/API/Filesystem/PathUtils.cpp
deleted file mode 100644 (file)
index e2ac7de..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * 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.
- */
-/**
- * @author          Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
- */
-
-#include "PathUtils.h"
-#include <dpl/log/log.h>
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-namespace PathUtils {
-PathList getParts(const IPathPtr& path)
-{
-    PathList result;
-    IPath::SeparatorType separator = path->getSeparator();
-    std::string fullPath = path->getFullPath();
-    std::string::size_type pos = 0;
-    while ((pos = fullPath.find(separator, pos + 1)) != std::string::npos) {
-        result.push_back(IPath::create(fullPath.substr(0, pos)));
-    }
-    return result;
-}
-} // PathUtils
-} // API
-} // Filesystem
-} // WrtDeviceApis
diff --git a/src_mobile/modules/API/Filesystem/PathUtils.h b/src_mobile/modules/API/Filesystem/PathUtils.h
deleted file mode 100644 (file)
index 40642f3..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * 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.
- */
-/**
- * @author          Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
- */
-
-#ifndef WRTDEVICEAPIS_FILESYSTEM_PATHUTILS_H_
-#define WRTDEVICEAPIS_FILESYSTEM_PATHUTILS_H_
-
-#include <vector>
-#include "IPath.h"
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-namespace PathUtils {
-typedef std::vector<IPathPtr> PathList;
-typedef PathList::iterator PathListIterator;
-
-/**
- * Gets sub-paths of supplied path.
- * The supplied path is not included.
- * @param path
- * @return List of paths.
- */
-PathList getParts(const IPathPtr& path);
-} // PathUtils
-} // API
-} // Filesystem
-} // WrtDeviceApis
-
-#endif // WRTDEVICEAPIS_FILESYSTEM_PATHUTILS_H_
diff --git a/src_mobile/modules/API/Filesystem/config.cmake b/src_mobile/modules/API/Filesystem/config.cmake
deleted file mode 100644 (file)
index a9a514b..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-get_current_path()
-
-set(API_FILESYSTEM_PATH
-    ${CURRENT_PATH}
-    PARENT_SCOPE
-)
-
-set(SRCS_API_FILESYSTEM
-  ${CURRENT_PATH}/IManager.cpp
-  ${CURRENT_PATH}/IPath.cpp
-  ${CURRENT_PATH}/IStream.cpp
-  ${CURRENT_PATH}/EventResolve.cpp
-  ${CURRENT_PATH}/EventCopy.cpp
-  ${CURRENT_PATH}/EventMove.cpp
-  ${CURRENT_PATH}/EventRemove.cpp
-  ${CURRENT_PATH}/EventFind.cpp
-  ${CURRENT_PATH}/EventListNodes.cpp
-  ${CURRENT_PATH}/EventOpen.cpp
-  ${CURRENT_PATH}/EventReadText.cpp
-  ${CURRENT_PATH}/INode.cpp
-  ${CURRENT_PATH}/NodeFilter.cpp
-  ${CURRENT_PATH}/PathUtils.cpp
-  PARENT_SCOPE
-)
-
diff --git a/src_mobile/modules/API/LocalStorage/ILocalStorage.h b/src_mobile/modules/API/LocalStorage/ILocalStorage.h
deleted file mode 100644 (file)
index 6ee677e..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * 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.
- */
-/*
- * @author      Grzegorz Krawczyk (g.krawczyk@samsung.com)
- * @author      Andrzej Surdej (a.surdej@samsung.com)
- * @version     0.1
- * @brief       Local storage interface file
- */
-
-#ifndef WRTDEVICEAPIS_LOCALSTORAGE_LOCAL_STORAGE_INTERFACE_H_
-#define WRTDEVICEAPIS_LOCALSTORAGE_LOCAL_STORAGE_INTERFACE_H_
-
-#include <string>
-#include <dpl/shared_ptr.h>
-#include <dpl/optional.h>
-
-namespace WrtDeviceApis {
-namespace LocalStorage {
-namespace Api {
-class ILocalStorage
-{
-  public:
-
-    /**
-     * Save pair key/value in local storage
-     * @param key
-     * @param value
-     * @param readOnly - if true, the value will be read only
-     *                  otherwise the value will be modificable
-     */
-    virtual void setItem(const std::string& key,
-                         const std::string& value,
-                         bool readOnly) = 0;
-
-    /**
-     * Remove pair key/value from local storage
-     */
-    virtual void removeItem(const std::string& key) = 0;
-
-    /**
-     * Get value for key
-     *
-     */
-    virtual DPL::Optional<std::string> getValue(
-        const std::string& key) const = 0;
-
-    /**
-     * Clears the local storage
-     * @param removeReadOnly - true -remove all elements
-     *                          false - ommit items which have read only flag
-     * set
-     */
-    virtual void clear(bool removeReadOnly) = 0;
-
-    /**
-     * Get number of elements in local storage
-     * @param removeReadOnly - true -remove all elements
-     *                          false - ommit items which have read only flag
-     * set
-     */
-    virtual size_t getStorageSize() const = 0;
-
-    /**
-     * Get key name for index
-     */
-    virtual std::string getKeyByIndex(size_t index) const = 0;
-
-    /**
-     * virtual destructor
-     */
-    virtual ~ILocalStorage()
-    {}
-};
-
-typedef DPL::SharedPtr<ILocalStorage> ILocalStoragePtr;
-} // Api
-} // LocalStorage
-} // WrtDeviceApis
-
-#endif // WRTDEVICEAPIS_LOCALSTORAGE_LOACA_STORAGE_INTERFACE_H_
diff --git a/src_mobile/modules/API/LocalStorage/config.cmake b/src_mobile/modules/API/LocalStorage/config.cmake
deleted file mode 100644 (file)
index f421686..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-get_current_path()
-
-set(API_LOCALSTORAGE_PATH
-    ${CURRENT_PATH}
-    PARENT_SCOPE
-    )
-
-set(SRCS_API_LOCALSTORAGE
-  ${CURRENT_PATH}/LocalStorageMgr.cpp
-  PARENT_SCOPE
-)
diff --git a/src_mobile/modules/API/Networking/EventConnected.cpp b/src_mobile/modules/API/Networking/EventConnected.cpp
deleted file mode 100644 (file)
index 51a5799..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * 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 "EventConnected.h"
-
-namespace WrtDeviceApis {
-namespace Networking {
-namespace Api {} // Api
-} // Networking
-} // WrtDeviceApis
diff --git a/src_mobile/modules/API/Networking/EventConnected.h b/src_mobile/modules/API/Networking/EventConnected.h
deleted file mode 100644 (file)
index 26f5618..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * 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.
- */
-/**
- * @author       Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
- */
-
-#ifndef WRTDEVICEAPIS_NETWORKING_EVENTCONNECTED_H_
-#define WRTDEVICEAPIS_NETWORKING_EVENTCONNECTED_H_
-
-#include <dpl/shared_ptr.h>
-#include <Commons/ListenerEvent.h>
-#include <Commons/ListenerEventEmitter.h>
-#include "IConnection.h"
-
-namespace WrtDeviceApis {
-namespace Networking {
-namespace Api {
-/* TODO */
-class EventConnected : public Commons::ListenerEvent<EventConnected>
-{
-  private:
-    IConnectionPtr m_connection;
-};
-
-typedef DPL::SharedPtr<EventConnected> EventConnectedPtr;
-typedef Commons::ListenerEventEmitter<EventConnected> EventConnectedEmitter;
-typedef DPL::SharedPtr<EventConnectedEmitter> EventConnectedEmitterPtr;
-} // Api
-} // Networking
-} // WrtDeviceApis
-
-#endif // WRTDEVICEAPIS_NETWORKING_EVENTCONNECTED_H_
diff --git a/src_mobile/modules/API/Networking/EventDisconnected.cpp b/src_mobile/modules/API/Networking/EventDisconnected.cpp
deleted file mode 100644 (file)
index 7be367a..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * 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 "EventDisconnected.h"
-
-namespace WrtDeviceApis {
-namespace Networking {
-namespace Api {} // Api
-} // Networking
-} // WrtDeviceApis
diff --git a/src_mobile/modules/API/Networking/EventDisconnected.h b/src_mobile/modules/API/Networking/EventDisconnected.h
deleted file mode 100644 (file)
index e683e9f..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * 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.
- */
-/**
- * @author       Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
- */
-
-#ifndef WRTDEVICEAPIS_NETWORKING_EVENTDISCONNECTED_H_
-#define WRTDEVICEAPIS_NETWORKING_EVENTDISCONNECTED_H_
-
-#include <dpl/shared_ptr.h>
-#include <Commons/ListenerEvent.h>
-#include <Commons/ListenerEventEmitter.h>
-#include "IConnection.h"
-
-namespace WrtDeviceApis {
-namespace Networking {
-namespace Api {
-/* TODO */
-class EventDisconnected : public Commons::ListenerEvent<EventDisconnected>
-{
-  private:
-    IConnectionPtr m_connection;
-};
-
-typedef DPL::SharedPtr<EventDisconnected> EventDisconnectedPtr;
-typedef Commons::ListenerEventEmitter<EventDisconnected>
-EventDisconnectedEmitter;
-typedef DPL::SharedPtr<EventDisconnectedEmitter> EventDisconnectedEmitterPtr;
-} // Api
-} // Networking
-} // WrtDeviceApis
-
-#endif // WRTDEVICEAPIS_NETWORKING_EVENTDISCONNECTED_H_
diff --git a/src_mobile/modules/API/Networking/IAdapter.cpp b/src_mobile/modules/API/Networking/IAdapter.cpp
deleted file mode 100644 (file)
index 5b94609..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * 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 "IAdapter.h"
-
-namespace WrtDeviceApis {
-namespace Networking {
-namespace Api {
-IAdapter::~IAdapter()
-{}
-} // Api
-} // Networking
-} // WrtDeviceApis
diff --git a/src_mobile/modules/API/Networking/IAdapter.h b/src_mobile/modules/API/Networking/IAdapter.h
deleted file mode 100644 (file)
index 9159022..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * 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.
- */
-/**
- * @author       Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
- */
-
-#ifndef WRTDEVICEAPIS_NETWORKING_IADAPTER_H_
-#define WRTDEVICEAPIS_NETWORKING_IADAPTER_H_
-
-#include <list>
-#include <dpl/noncopyable.h>
-#include "IConnection.h"
-#include "EventConnected.h"
-#include "EventDisconnected.h"
-
-namespace WrtDeviceApis {
-namespace Networking {
-namespace Api {
-class IAdapter : public DPL::Noncopyable
-{
-  public:
-    /**
-     * Adapter type.
-     */
-    enum Type
-    {
-        T_ETHERNET, //!< T_ETHERNET
-        T_WIFI //!< T_WIFI
-    };
-
-  public:
-    virtual ~IAdapter() = 0;
-
-    /**
-     * Checks whether network adapter has active connection.
-     * @return True when connected, false otherwsie.
-     */
-    virtual bool isConnected() const = 0;
-
-    /**
-     * Gets active connection.
-     * @return Active connection or NULL if not connected.
-     */
-    virtual IConnectionPtr getConnection() const = 0;
-
-    /**
-     * Sets on connected event emitter.
-     * @param event Event emitter.
-     */
-    virtual void addOnConnected(const EventConnectedEmitterPtr& emitter) = 0;
-
-    /**
-     * Removes on connected event emitter.
-     * @param id Emitters id.
-     */
-    virtual void removeOnConnected(EventConnectedEmitter::IdType id) = 0;
-
-    /**
-     * Sets on disconnected event emitter.
-     * @param emitter Event emitter.
-     */
-    virtual void addOnDisconnected(const EventDisconnectedEmitterPtr& emitter)
-        = 0;
-
-    /**
-     * Removes on disconnected event emitter.
-     * @param id Emitters id.
-     */
-    virtual void removeOnDisconnected(EventDisconnectedEmitter::IdType id) = 0;
-
-    /**
-     * Gets type of an adapter
-     * @return type Type of an adapter
-     */
-    virtual Type getAdapterType() const = 0;
-};
-
-typedef std::list<IAdapter*> AdaptersSet;
-typedef std::list<IAdapter*>::iterator AdaptersSetIterator;
-} // Api
-} // Networking
-} // WrtDeviceApis
-
-#endif // WRTDEVICEAPIS_NETWORKING_IADAPTER_H_
diff --git a/src_mobile/modules/API/Networking/IConnection.cpp b/src_mobile/modules/API/Networking/IConnection.cpp
deleted file mode 100644 (file)
index d8bc537..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * 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 "IConnection.h"
-
-namespace WrtDeviceApis {
-namespace Networking {
-namespace Api {
-IConnection::~IConnection()
-{}
-} // Api
-} // Networking
-} // WrtDeviceApis
diff --git a/src_mobile/modules/API/Networking/IConnection.h b/src_mobile/modules/API/Networking/IConnection.h
deleted file mode 100644 (file)
index eb0202d..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * 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.
- */
-/**
- * @author       Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
- */
-
-#ifndef WRTDEVICEAPIS_NETWORKING_ICONNECTION_H_
-#define WRTDEVICEAPIS_NETWORKING_ICONNECTION_H_
-
-#include <string>
-#include <dpl/shared_ptr.h>
-#include <dpl/noncopyable.h>
-
-namespace WrtDeviceApis {
-namespace Networking {
-namespace Api {
-class IConnection : public DPL::Noncopyable
-{
-  public:
-    virtual ~IConnection() = 0;
-
-    /**
-     * Gets connection name.
-     * @return Connection's name.
-     */
-    virtual std::string getName() const = 0;
-};
-
-typedef DPL::SharedPtr<IConnection> IConnectionPtr;
-} // Api
-} // Networking
-} // WrtDeviceApis
-
-#endif // WRTDEVICEAPIS_NETWORKING_ICONNECTION_H_
diff --git a/src_mobile/modules/API/Networking/IManager.cpp b/src_mobile/modules/API/Networking/IManager.cpp
deleted file mode 100644 (file)
index fd3f216..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * 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 <Networking/Manager.h>
-#include "IManager.h"
-
-namespace WrtDeviceApis {
-namespace Networking {
-namespace Api {
-IManager& IManager::getInstance()
-{
-    return Manager::getInstance();
-}
-
-IManager::~IManager()
-{}
-} // Api
-} // Networking
-} // WrtDeviceApis
diff --git a/src_mobile/modules/API/Networking/IManager.h b/src_mobile/modules/API/Networking/IManager.h
deleted file mode 100644 (file)
index 841316a..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * 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.
- */
-/**
- * @author       Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
- */
-
-#ifndef WRTDEVICEAPIS_NETWORKING_IMANAGER_H_
-#define WRTDEVICEAPIS_NETWORKING_IMANAGER_H_
-
-#include <dpl/noncopyable.h>
-#include "IAdapter.h"
-
-namespace WrtDeviceApis {
-namespace Networking {
-namespace Api {
-class IManager : private DPL::Noncopyable
-{
-  public:
-    static IManager& getInstance();
-
-  public:
-    virtual ~IManager() = 0;
-
-    /**
-     * Gets specfied adapter.
-     * @param type Adapter type @see IAdapter::Type.
-     * @return Interface to network adapter, NULL if current platform does not
-     *         support such network adapter.
-     * @throw PlatformException If platform error occured.
-     */
-    virtual IAdapter* getAdapter(IAdapter::Type type) const = 0;
-
-    /**
-     * Adds to given set all available on platform adapters
-     * @param [out] list of interfaces to network adapters
-     */
-    virtual void getAvailableAdapters(AdaptersSet *retSet) const = 0;
-};
-} // Api
-} // Networking
-} // WrtDeviceApis
-
-#endif // WRTDEVICEAPIS_NETWORKING_IMANAGER_H_
diff --git a/src_mobile/modules/API/Networking/config.cmake b/src_mobile/modules/API/Networking/config.cmake
deleted file mode 100644 (file)
index 66ab813..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-get_current_path()
-
-set(API_NETWORKING_PATH
-    ${CURRENT_PATH}
-    PARENT_SCOPE
-)
-
-set(SRCS_API_NETWORKING
-  ${CURRENT_PATH}/IManager.cpp
-  ${CURRENT_PATH}/IAdapter.cpp
-  ${CURRENT_PATH}/IConnection.cpp
-  ${CURRENT_PATH}/EventConnected.cpp
-  ${CURRENT_PATH}/EventDisconnected.cpp
-  PARENT_SCOPE
-)
diff --git a/src_mobile/modules/API/PluginManager/IPluginManager.h b/src_mobile/modules/API/PluginManager/IPluginManager.h
deleted file mode 100644 (file)
index d96652c..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * 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        IPluginManager.h
- * @author      Lukasz Marek (l.marek@samsung.com)
- * @version     0.1
- * @brief
- */
-
-#ifndef WRTDEVICEAPIS_PLUGINMANAGER_IPLUGINMANAGER_H_
-#define WRTDEVICEAPIS_PLUGINMANAGER_IPLUGINMANAGER_H_
-
-#include <string>
-#include <vector>
-#include <dpl/shared_ptr.h>
-#include <JavaScriptCore/JavaScript.h>
-
-namespace WrtDeviceApis {
-namespace PluginManager {
-namespace Api {
-class IPluginManager
-{
-  public:
-    typedef std::vector<std::string> PropertyList;
-
-    virtual ~IPluginManager() {}
-    virtual bool hasChild(const std::string &name) const = 0;
-    virtual bool loadChild(const std::string &name) const = 0;
-
-    virtual JSValueRef getProperty(const std::string &name) const = 0;
-    virtual bool setProperty(const std::string &name,
-                             JSValueRef value) = 0;
-    virtual bool deleteProperty(const std::string &name) = 0;
-
-    virtual PropertyList getProperties() const = 0;
-    virtual void addPropertiesToList(
-        JSPropertyNameAccumulatorRef propertyNames) const = 0;
-};
-
-typedef DPL::SharedPtr<IPluginManager> IPluginManagerPtr;
-}
-}
-}
-
-#endif // WRTDEVICEAPIS_PLUGINMANAGER_IPLUGINMANAGER_H_
diff --git a/src_mobile/modules/API/PluginManager/PluginManagerFactory.h b/src_mobile/modules/API/PluginManager/PluginManagerFactory.h
deleted file mode 100644 (file)
index b13a36a..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * 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        PluginManagerFactory.h
- * @author      Lukasz Marek (l.marek@samsung.com)
- * @version     0.1
- */
-
-#ifndef WRTDEVICEAPIS_PLUGIN_MANAGER_FACTORY_H_
-#define WRTDEVICEAPIS_PLUGIN_MANAGER_FACTORY_H_
-
-#include <string>
-#include <dpl/noncopyable.h>
-#include <PluginManager/IPluginManager.h>
-
-namespace WrtDeviceApis {
-namespace PluginManager {
-namespace Api {
-class PluginManagerFactory : private DPL::Noncopyable
-{
-  public:
-    static PluginManagerFactory& getInstance();
-    IPluginManagerPtr getPluginManager(
-        int widgetHandle,
-        const std::string &objectUri,
-        JSObjectRef object,
-        JSContextRef context) const;
-
-  private:
-    PluginManagerFactory();
-};
-}
-}
-}
-
-#endif // WRTDEVICEAPIS_PLUGIN_MANAGER_FACTORY_H_
diff --git a/src_mobile/modules/API/PluginManager/config.cmake b/src_mobile/modules/API/PluginManager/config.cmake
deleted file mode 100644 (file)
index f513d08..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-get_current_path()
-
-set(API_PLUGIN_MANAGER_PATH
-    ${CURRENT_PATH}
-    PARENT_SCOPE
-)
-
-set(SRCS_API_PLUGIN_MANAGER
-    ${CURRENT_PATH}/PluginManagerFactory.cpp
-    PARENT_SCOPE
-)
diff --git a/src_mobile/modules/API/SoftKeyboardChangeEvent/ISoftKeyboardChangeEvent.h b/src_mobile/modules/API/SoftKeyboardChangeEvent/ISoftKeyboardChangeEvent.h
deleted file mode 100644 (file)
index a001b71..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 2012 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        ISoftKeyboardChangeEvent.h
- * @author      Yunchan Cho (yunchan.cho@samsung.com)
- * @version     0.1
- * @brief       softkeyboardchange event interfece
- */
-
-#ifndef WRT_PLUGIN_SOFTKEYBOARD_CHANGE_EVENT_INTERFACE_H
-#define WRT_PLUGIN_SOFTKEYBOARD_CHANGE_EVENT_INTERFACE_H
-
-#include <memory>
-
-namespace WrtDeviceApis {
-namespace SoftKeyboardChangeEvent {
-namespace Api {
-class ISoftKeyboardChangeEvent
-{
-  public:
-    virtual std::string getState() const = 0;
-    virtual int getWidth() const = 0;
-    virtual int getHeight() const = 0;
-
-    virtual ~ISoftKeyboardChangeEvent() {}
-};
-
-typedef std::shared_ptr<ISoftKeyboardChangeEvent> ISoftKeyboardChangeEventPtr;
-} // Api
-} // SoftKeyboardChangeEvent
-} // WrtDeviceApis
-
-#endif // WRT_PLUGIN_SOFTKEYBOARD_CHANGE_EVENT_INTERFACE_H
diff --git a/src_mobile/modules/API/SoftKeyboardChangeEvent/SoftKeyboardChangeEvent.cpp b/src_mobile/modules/API/SoftKeyboardChangeEvent/SoftKeyboardChangeEvent.cpp
deleted file mode 100644 (file)
index 7cd04ba..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2012 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        SoftKeyboardChangeEvent.cpp
- * @author      Yunchan Cho (yunchan.cho@samsung.com)
- * @version     0.1
- * @brief       softkeyboardchange event class implementation
- */
-
-#include "SoftKeyboardChangeEvent.h"
-
-namespace WrtDeviceApis {
-namespace SoftKeyboardChangeEvent {
-namespace Api {
-SoftKeyboardChangeEvent::SoftKeyboardChangeEvent(
-    std::string state, int width, int height) :
-    m_state(state), m_width(width), m_height(height)
-{}
-
-SoftKeyboardChangeEvent::~SoftKeyboardChangeEvent()
-{}
-
-std::string SoftKeyboardChangeEvent::getState() const
-{
-    return m_state;
-}
-
-int SoftKeyboardChangeEvent::getWidth() const
-{
-    return m_width;
-}
-
-int SoftKeyboardChangeEvent::getHeight() const
-{
-    return m_height;
-}
-} // Api
-} // SoftKeyboardChangeEvent
-} // WrtDeviceApis
diff --git a/src_mobile/modules/API/SoftKeyboardChangeEvent/SoftKeyboardChangeEvent.h b/src_mobile/modules/API/SoftKeyboardChangeEvent/SoftKeyboardChangeEvent.h
deleted file mode 100644 (file)
index df8f721..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2012 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        SoftKeyboardChangeEvent.h
- * @author      Yunchan Cho (yunchan.cho@samsung.com)
- * @version     0.1
- * @brief       softkeyboardchange event class
- */
-
-#ifndef WRT_PLUGIN_SOFTKEYBOARD_CHANGE_EVENT_CLASS_H
-#define WRT_PLUGIN_SOFTKEYBOARD_CHANGE_EVENT_CLASS_H
-
-#include <string>
-#include "ISoftKeyboardChangeEvent.h"
-
-namespace WrtDeviceApis {
-namespace SoftKeyboardChangeEvent {
-namespace Api {
-class SoftKeyboardChangeEvent : public ISoftKeyboardChangeEvent
-{
-  public:
-    explicit SoftKeyboardChangeEvent(
-        std::string state,
-        int width,
-        int height);
-    ~SoftKeyboardChangeEvent();
-
-    std::string getState() const;
-    int getWidth() const;
-    int getHeight() const;
-
-  private:
-    std::string m_state;
-    int m_width;
-    int m_height;
-};
-} // Api
-} // SoftKeyboardChangeEvent
-} // WrtDeviceApis
-
-#endif // WRT_PLUGIN_SOFTKEYBOARD_CHANGE_EVENT_CLASS_H
diff --git a/src_mobile/modules/API/SoftKeyboardChangeEvent/config.cmake b/src_mobile/modules/API/SoftKeyboardChangeEvent/config.cmake
deleted file mode 100644 (file)
index 398a39b..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-get_current_path()
-
-set(API_SOFTKEYBOARD_CHANGE_EVENT_PATH
-    ${CURRENT_PATH}
-    PARENT_SCOPE
-    )
-
-set(SRCS_API_SOFTKEYBOARD_CHANGE_EVENT
-    ${CURRENT_PATH}/SoftKeyboardChangeEvent.cpp
-  PARENT_SCOPE
-)
diff --git a/src_mobile/modules/API/StorageEvent/IStorageEvent.h b/src_mobile/modules/API/StorageEvent/IStorageEvent.h
deleted file mode 100644 (file)
index 5c34514..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * 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        IStorageEvent.h
- * @author      Andrzej Surdej (a.surdej@samsung.com)
- * @version     0.1
- * @brief       Storage event interfece
- */
-
-#ifndef WRTDEVICEAPIS_COMMONS_STORAGE_EVENT_INTERFACE_H
-#define WRTDEVICEAPIS_COMMONS_STORAGE_EVENT_INTERFACE_H
-
-#include <dpl/optional_typedefs.h>
-#include <dpl/shared_ptr.h>
-#include <LocalStorage/ILocalStorage.h>
-
-namespace WrtDeviceApis {
-namespace StorageEvent {
-namespace Api {
-class IStorageEvent
-{
-  public:
-
-    virtual std::string getKey() const = 0;
-    virtual DPL::OptionalString getOldValue() const = 0;
-    virtual DPL::OptionalString getNewValue() const = 0;
-    virtual std::string getUrl() const = 0;
-    virtual LocalStorage::Api::ILocalStoragePtr getStorageArea() const = 0;
-
-    virtual void setKey(const std::string &inKey) = 0;
-    virtual void setOldValue(const std::string &inValue) = 0;
-    virtual void setNewValue(const std::string &inValue) = 0;
-    virtual void setUrl(const std::string &inUrl) = 0;
-    virtual void setStorageArea(
-        const LocalStorage::Api::ILocalStoragePtr &inStorageArea) = 0;
-};
-
-typedef DPL::SharedPtr<IStorageEvent> IStorageEventPtr;
-} // Api
-} // StorageEvent
-} // WrtDeviceApis
-
-#endif // WRTDEVICEAPIS_COMMONS_STORAGE_EVENT_INTERFACE_H
diff --git a/src_mobile/modules/API/StorageEvent/StorageEvent.h b/src_mobile/modules/API/StorageEvent/StorageEvent.h
deleted file mode 100644 (file)
index 37df421..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * 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        StorageEvent.h
- * @author      Andrzej Surdej (a.surdej@samsung.com)
- * @version     0.1
- * @brief       Storage event class
- */
-
-#ifndef WRTDEVICEAPIS_STORAGEEVENT_STORAGE_EVENT_H
-#define WRTDEVICEAPIS_STORAGEEVENT_STORAGE_EVENT_H
-
-#include <dpl/optional_typedefs.h>
-#include "IStorageEvent.h"
-
-namespace WrtDeviceApis {
-namespace StorageEvent {
-namespace Api {
-class StorageEvent : public IStorageEvent
-{
-  public:
-
-    StorageEvent();
-    explicit StorageEvent(
-        const LocalStorage::Api::ILocalStoragePtr &storageArea);
-
-    std::string getKey() const;
-    DPL::OptionalString getOldValue() const;
-    DPL::OptionalString getNewValue() const;
-    std::string getUrl() const;
-    LocalStorage::Api::ILocalStoragePtr getStorageArea() const;
-
-    void setKey(const std::string &inKey);
-    void setOldValue(const std::string &inValue);
-    void setNewValue(const std::string &inValue);
-    void setUrl(const std::string &inUrl);
-    void setStorageArea(
-        const LocalStorage::Api::ILocalStoragePtr &inStorageArea);
-
-  private:
-    std::string m_key;
-    DPL::OptionalString m_oldValue;
-    DPL::OptionalString m_newValue;
-    std::string m_url;
-    LocalStorage::Api::ILocalStoragePtr m_storageArea;
-};
-} // Api
-} // StorageEvent
-} // WrtDeviceApis
-
-#endif // WRTDEVICEAPIS_STORAGEEVENT_STORAGE_EVENT_H
diff --git a/src_mobile/modules/API/StorageEvent/StorageEventMgr.cpp b/src_mobile/modules/API/StorageEvent/StorageEventMgr.cpp
deleted file mode 100644 (file)
index 92b8772..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * 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        StorageEventMgr.cpp
- * @author      Andrzej Surdej (a.surdej@samsung.com)
- * @version     0.1
- * @brief       Storage event getter
- */
-
-#include "StorageEventMgr.h"
-#include "StorageEvent.h"
-
-namespace WrtDeviceApis {
-namespace StorageEvent {
-namespace Api {
-IStorageEventPtr getStorageEvent()
-{
-    return IStorageEventPtr(new StorageEvent());
-}
-} // Api
-} // StorageEvent
-} // WrtDeviceApis
diff --git a/src_mobile/modules/API/StorageEvent/StorageEventMgr.h b/src_mobile/modules/API/StorageEvent/StorageEventMgr.h
deleted file mode 100644 (file)
index b519abd..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * 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        StorageEventMgr.h
- * @author      Andrzej Surdej (a.surdej@samsung.com)
- * @version     0.1
- * @brief       Storage event interfece
- */
-
-#ifndef WRTDEVICEAPIS_COMMONS_STORAGE_EVENT_MGR_H
-#define WRTDEVICEAPIS_COMMONS_STORAGE_EVENT_MGR_H
-
-#include "IStorageEvent.h"
-
-namespace WrtDeviceApis {
-namespace StorageEvent {
-namespace Api {
-IStorageEventPtr getStorageEvent();
-} // Api
-} // StorageEvent
-} // WrtDeviceApis
-
-#endif // WRTDEVICEAPIS_COMMONS_STORAGE_EVENT_MGR_H
-
diff --git a/src_mobile/modules/API/StorageEvent/config.cmake b/src_mobile/modules/API/StorageEvent/config.cmake
deleted file mode 100644 (file)
index a0029fc..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-get_current_path()
-
-set(API_STORAGE_EVENT_PATH
-    ${CURRENT_PATH}
-    PARENT_SCOPE
-    )
-
-set(SRCS_API_STORAGE_EVENT
-  ${CURRENT_PATH}/StorageEventMgr.cpp
-  ${CURRENT_PATH}/StorageEvent.cpp
-  PARENT_SCOPE
-)
diff --git a/src_mobile/modules/API/TizenServiceEvent/TizenServiceEvent.cpp b/src_mobile/modules/API/TizenServiceEvent/TizenServiceEvent.cpp
deleted file mode 100644 (file)
index b6233c6..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * 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        TizenServiceEvent.cpp
- * @author      Yunchan Cho (yunchan.cho@samsung.com)
- * @version     0.1
- * @brief       Tizen appservice event class implementation
- */
-
-#include "TizenServiceEvent.h"
-
-namespace WrtDeviceApis {
-namespace TizenServiceEvent {
-namespace Api {
-TizenServiceEvent::TizenServiceEvent() :
-        m_scale(0)
-{}
-
-TizenServiceEvent::~TizenServiceEvent()
-{}
-
-float TizenServiceEvent::getScale() const
-{
-    return m_scale;
-}
-
-std::string TizenServiceEvent::getBundle() const
-{
-    return m_bundle;
-}
-
-void TizenServiceEvent::setScale(const float scale)
-{
-    m_scale = scale;
-}
-
-void TizenServiceEvent::setBundle(const std::string& bundle)
-{
-    m_bundle = bundle;
-}
-} // Api
-} // TizenServiceEvent
-} // WrtDeviceApis
diff --git a/src_mobile/modules/API/TizenServiceEvent/TizenServiceEvent.h b/src_mobile/modules/API/TizenServiceEvent/TizenServiceEvent.h
deleted file mode 100644 (file)
index 3b577f0..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * 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        TizenServiceEvent.h
- * @author      Yunchan Cho (yunchan.cho@samsung.com)
- * @version     0.1
- * @brief       Tizen Service event class
- */
-
-#ifndef _WRT_PLUGIN_TIZEN_SERVICE_EVENT_CLASS_H_
-#define _WRT_PLUGIN_TIZEN_SERVICE_EVENT_CLASS_H_
-
-#include <string>
-#include "ITizenServiceEvent.h"
-
-namespace WrtDeviceApis {
-namespace TizenServiceEvent {
-namespace Api {
-class TizenServiceEvent : public ITizenServiceEvent
-{
-  public:
-
-    TizenServiceEvent();
-    ~TizenServiceEvent();
-
-    float getScale() const;
-    std::string getBundle() const;
-
-    void setScale(const float scale);
-    void setBundle(const std::string &bundle);
-
-  private:
-    float m_scale;
-    std::string m_bundle;
-};
-} // Api
-} // TizenServiceEvent
-} // WrtDeviceApis
-
-#endif // _WRT_PLUGIN_TIZEN_SERVICE_EVENT_CLASS_H_
diff --git a/src_mobile/modules/API/TizenServiceEvent/config.cmake b/src_mobile/modules/API/TizenServiceEvent/config.cmake
deleted file mode 100644 (file)
index 5a64dcd..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-get_current_path()
-
-set(API_TIZEN_SERVICE_EVENT_PATH
-    ${CURRENT_PATH}
-    PARENT_SCOPE
-    )
-
-set(SRCS_API_TIZEN_SERVICE_EVENT
-  ${CURRENT_PATH}/TizenServiceEvent.cpp
-  PARENT_SCOPE
-)
diff --git a/src_mobile/modules/API/Widget/WidgetFactory.cpp b/src_mobile/modules/API/Widget/WidgetFactory.cpp
deleted file mode 100644 (file)
index 2197a75..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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       WidgetFactory.cpp
- * @author     Grzegorz Krawczyk (g.krawczyk@samsung.com)
- * @version    0.1
- * @brief
- */
-#include "WidgetFactory.h"
-
-#include <Widget/Widget.h>
-
-namespace WrtDeviceApis {
-namespace Widget {
-namespace Api {
-IWidgetPtr WidgetFactory::createWidget()
-{
-    return IWidgetPtr(new WrtDeviceApis::Widget::Widget());
-}
-}
-}
-}
diff --git a/src_mobile/modules/API/Widget/WidgetFactory.h b/src_mobile/modules/API/Widget/WidgetFactory.h
deleted file mode 100644 (file)
index b068dc2..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * 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       WidgetFactory.h
- * @author     Grzegorz Krawczyk (g.krawczyk@samsung.com)
- * @version    0.1
- * @brief
- */
-#ifndef _WIDGET_FACTORY_H
-#define _WIDGET_FACTORY_H
-
-#include <string>
-#include <dpl/noncopyable.h>
-#include <Widget/IWidget.h>
-
-namespace WrtDeviceApis {
-namespace Widget {
-namespace Api {
-class WidgetFactory : private DPL::Noncopyable
-{
-  public:
-
-    /**
-     * Create widget
-     * @param[in] id of the widget
-     */
-    static IWidgetPtr createWidget();
-
-  private:
-    WidgetFactory()
-    {}
-};
-}
-}
-}
-
-#endif
diff --git a/src_mobile/modules/API/Widget/config.cmake b/src_mobile/modules/API/Widget/config.cmake
deleted file mode 100644 (file)
index 11ffcc8..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-get_current_path()
-
-set(API_WIDGET_PATH
-    ${CURRENT_PATH}
-    PARENT_SCOPE
-)
-
-set(SRCS_API_WIDGET
-    ${CURRENT_PATH}/WidgetFactory.cpp
-    PARENT_SCOPE
-)
diff --git a/src_mobile/modules/API/WidgetDB/IWidgetFeature.h b/src_mobile/modules/API/WidgetDB/IWidgetFeature.h
deleted file mode 100644 (file)
index 2371c1e..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * 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.
- */
-/*
- * @author      Grzegorz Krawczyk (g.krawczyk@samsung.com)
- * @version     0.1
- * @brief
- */
-
-#ifndef WRT_PLUGINS_WRT_ENGINE_WIDGET_FEATURE_INTERFACE_H_
-#define WRT_PLUGINS_WRT_ENGINE_WIDGET_FEATURE_INTERFACE_H_
-
-#include <list>
-#include <string>
-#include <dpl/shared_ptr.h>
-
-namespace WrtDeviceApis {
-namespace WidgetDB {
-namespace Api {
-class IWidgetFeature
-{
-  public:
-
-    virtual ~IWidgetFeature()
-    {}
-
-    virtual std::string getName() const = 0;
-
-    virtual bool isRequestedByWidget() const = 0;
-};
-
-typedef DPL::SharedPtr<IWidgetFeature> IWidgetFeaturePtr;
-} // Api
-} // WidgetDB
-} // WrtDeviceApis
-
-#endif
diff --git a/src_mobile/modules/API/WidgetDB/config.cmake b/src_mobile/modules/API/WidgetDB/config.cmake
deleted file mode 100644 (file)
index 14a6acc..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-get_current_path()
-
-set(API_WIDGETDB_PATH
-    ${CURRENT_PATH}
-    PARENT_SCOPE
-)
-
-set(SRCS_API_WIDGETDB
-  ${CURRENT_PATH}/WidgetDBMgr.cpp
-  PARENT_SCOPE
-)
-
diff --git a/src_mobile/modules/API/config.cmake b/src_mobile/modules/API/config.cmake
deleted file mode 100644 (file)
index 82b25da..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-include_config_file(Widget)\r
-include_config_file(StorageEvent)\r
-include_config_file(LocalStorage)
\ No newline at end of file
diff --git a/src_mobile/modules/CMakeLists.txt b/src_mobile/modules/CMakeLists.txt
deleted file mode 100644 (file)
index 85db759..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-# 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_directories(
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM}
-)
-
-add_subdirectory(API)
-add_subdirectory(${PLATFORM})
-add_subdirectory(packages)
diff --git a/src_mobile/modules/DESCRIPTION b/src_mobile/modules/DESCRIPTION
deleted file mode 100644 (file)
index a5d1510..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Platform abstraction
diff --git a/src_mobile/modules/packages/CMakeLists.txt b/src_mobile/modules/packages/CMakeLists.txt
deleted file mode 100644 (file)
index ed3e799..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-# 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.
-#
-
-set(TARGET_MODULE_FILESYSTEM "wrt-plugins-filesystem")
-set(TARGET_MODULE_WIDGET "wrt-plugins-widget")
-set(TARGET_MODULE_LOCALSTORAGE "wrt-plugins-localstorage")
-set(TARGET_MODULE_WIDGET_INTERFACE "wrt-plugins-widget-interface")
-set(TARGET_MODULE_STORAGEEVENT "wrt-plugins-storageevent")
-set(TARGET_MODULE_TIZEN_SERVICE_EVENT "wrt-plugins-tizen-service-event")
-set(TARGET_MODULE_SOFTKEYBOARD_CHANGE_EVENT "wrt-plugins-softkeyboardchange-event")
-set(TARGET_MODULE_WIDGETDB "wrt-plugins-widgetdb")
-set(TARGET_MODULE_PLUGIN_MANAGER "wrt-plugins-plugin-manager")
-
-add_subdirectory(Filesystem)
-add_subdirectory(Widget)
-add_subdirectory(LocalStorage)
-add_subdirectory(WidgetInterface)
-add_subdirectory(WidgetDB)
-add_subdirectory(PluginManager)
-add_subdirectory(StorageEvent)
-add_subdirectory(TizenServiceEvent)
-add_subdirectory(SoftKeyboardChangeEvent)
diff --git a/src_mobile/modules/packages/Filesystem/CMakeLists.txt b/src_mobile/modules/packages/Filesystem/CMakeLists.txt
deleted file mode 100644 (file)
index e5079dc..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-# 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.
-#
-macro(install_header_file HEADER_FILE)
-    INSTALL(FILES ${API_FILESYSTEM_PATH}/${HEADER_FILE}
-        DESTINATION ${DESTINATION_HEADER_PREFIX}/Filesystem)
-endmacro()
-
-set(TARGET_NAME ${TARGET_MODULE_FILESYSTEM})
-
-set(SRCS
-  ${SRCS_API_FILESYSTEM}
-  ${SRCS_PLATFORM_IMPLEMENTATION_FILESYSTEM}
-)
-
-add_library(${TARGET_NAME} SHARED ${SRCS})
-target_link_libraries(${TARGET_NAME}
-   ${LIBS_COMMONS}
-   ${TARGET_COMMONS}
-)
-set_target_properties(${TARGET_NAME} PROPERTIES 
- SOVERSION ${CMAKE_PROJECT_API_VERSION}
- VERSION ${CMAKE_PROJECT_VERSION}
-)
-
-INSTALL(TARGETS ${TARGET_NAME} LIBRARY DESTINATION
-    ${DESTINATION_LIB_PREFIX})
-
-install_header_file(IManager.h)
-install_header_file(INode.h)
-install_header_file(INodeTypes.h)
-install_header_file(IPath.h)
-install_header_file(IStream.h)
-install_header_file(EventResolve.h)
-install_header_file(EventCopy.h)
-install_header_file(EventMove.h)
-install_header_file(EventRemove.h)
-install_header_file(EventFind.h)
-install_header_file(EventListNodes.h)
-install_header_file(EventOpen.h)
-install_header_file(EventReadText.h)
-install_header_file(Enums.h)
-install_header_file(NodeFilter.h)
diff --git a/src_mobile/modules/packages/LocalStorage/CMakeLists.txt b/src_mobile/modules/packages/LocalStorage/CMakeLists.txt
deleted file mode 100644 (file)
index 90d648a..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-# 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.
-#
-set(TARGET_NAME ${TARGET_MODULE_LOCALSTORAGE})
-
-set(SRCS
-  ${SRCS_API_LOCALSTORAGE}
-)
-
-add_library(${TARGET_NAME} STATIC ${SRCS})
-
-target_link_libraries(${TARGET_NAME}
-   ${LIBS_COMMONS}
-   ${TARGET_COMMONS}
-   ${TARGET_MODULE_WIDGET_INTERFACE}
-)
-
diff --git a/src_mobile/modules/packages/Networking/CMakeLists.txt b/src_mobile/modules/packages/Networking/CMakeLists.txt
deleted file mode 100644 (file)
index 9de7e04..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-# 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.
-#
-macro(install_header_file HEADER_FILE)
-    INSTALL(FILES ${API_NETWORKING_PATH}/${HEADER_FILE}
-        DESTINATION ${DESTINATION_HEADER_PREFIX}/Networking)
-endmacro()
-
-set(TARGET_NAME ${TARGET_MODULE_NETWORKING})
-
-include_directories(
-    ${INCLUDES_PLATFORM_IMPLEMENTATION_NETWORKING}
-)
-
-set(SRCS
-  ${SRCS_API_NETWORKING}
-  ${SRCS_IMPLEMENTATION_NETWORKING}
-)
-
-add_library(${TARGET_NAME} SHARED ${SRCS})
-
-target_link_libraries(${TARGET_NAME}
-   ${LIBS_COMMONS}
-   ${TARGET_COMMONS}
-   ${LIBS_PLATFORM_IMPLEMENTATION_NETWORKING}
-)
-set_target_properties(${TARGET_NAME} PROPERTIES 
- SOVERSION ${CMAKE_PROJECT_API_VERSION}
- VERSION ${CMAKE_PROJECT_VERSION}
-)
-
-INSTALL(TARGETS ${TARGET_NAME} LIBRARY DESTINATION
-    ${DESTINATION_LIB_PREFIX})
-
-install_header_file(EventConnected.h)
-install_header_file(EventDisconnected.h)
-install_header_file(IAdapter.h)
-install_header_file(IConnection.h)
-install_header_file(IManager.h)
diff --git a/src_mobile/modules/packages/PluginManager/CMakeLists.txt b/src_mobile/modules/packages/PluginManager/CMakeLists.txt
deleted file mode 100644 (file)
index a66bbfd..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-# 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     CMakeLists.txt
-# @author   Lukasz Marek (l.marek@samsung.com)
-# @version  1.0
-#
-
-macro(install_header_file HEADER_FILE)
-    INSTALL(FILES ${API_PLUGIN_MANAGER_PATH}/${HEADER_FILE}
-        DESTINATION ${DESTINATION_HEADER_PREFIX}/PluginManager)
-endmacro()
-
-set(TARGET_NAME ${TARGET_MODULE_PLUGIN_MANAGER})
-
-pkg_search_module(webkit2 REQUIRED ewebkit2)
-
-include_directories(
-    ${INCLUDES_PLATFORM_IMPLEMENTATION_PLUGIN_MANAGER}
-    ${webkit2_INCLUDE_DIRS}}
-)
-
-set(SRCS
-  ${SRCS_API_PLUGIN_MANAGER}
-  ${SRCS_PLATFORM_IMPLEMENTATION_PLUGIN_MANAGER}
-)
-
-add_library(${TARGET_NAME} SHARED ${SRCS})
-target_link_libraries(${TARGET_NAME}
-   ${LIBS_COMMONS}
-   ${TARGET_PLUGIN_LOADING_LIB}
-   ${TARGET_COMMONS}
-   ${TARGET_COMMONS_JAVASCRIPT}
-   ${LIBS_PLATFORM_IMPLEMENTATION_PLUGIN_MANAGER}
-)
-
-set_target_properties(${TARGET_NAME} PROPERTIES
- SOVERSION ${CMAKE_PROJECT_API_VERSION}
- VERSION ${CMAKE_PROJECT_VERSION}
-)
-
-INSTALL(TARGETS ${TARGET_NAME} LIBRARY DESTINATION
-    ${DESTINATION_LIB_PREFIX})
-
-install_header_file(PluginManagerFactory.h)
-install_header_file(IPluginManager.h)
diff --git a/src_mobile/modules/packages/TizenServiceEvent/CMakeLists.txt b/src_mobile/modules/packages/TizenServiceEvent/CMakeLists.txt
deleted file mode 100644 (file)
index e8efc16..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-# 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        CMakeLists.txt 
-# @author      Yunchan Cho (yunchan.cho@samsung.com)
-# @version     0.1
-
-set(TARGET_NAME ${TARGET_MODULE_TIZEN_SERVICE_EVENT})
-
-set(SRCS
-  ${SRCS_API_TIZEN_SERVICE_EVENT}
-)
-
-add_library(${TARGET_NAME} STATIC ${SRCS})
diff --git a/src_mobile/modules/packages/Widget/CMakeLists.txt b/src_mobile/modules/packages/Widget/CMakeLists.txt
deleted file mode 100644 (file)
index 74bf1a6..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-# 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.
-#
-
-set(TARGET_NAME ${TARGET_MODULE_WIDGET})
-
-set(SRCS
-    ${SRCS_API_WIDGET}
-    ${SRCS_IMPLEMENTATION_WIDGET}
-)
-
-add_library(${TARGET_NAME} STATIC ${SRCS})
-
-target_link_libraries(${TARGET_NAME}
-   ${LIBS_COMMONS}
-   ${TARGET_COMMONS}
-   ${TARGET_MODULE_WIDGETDB}
-)
-
diff --git a/src_mobile/modules/tizen/DESCRIPTION b/src_mobile/modules/tizen/DESCRIPTION
deleted file mode 100644 (file)
index 45900ba..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-!!!options!!! stop
-API implementation for tizen platform
diff --git a/src_mobile/modules/tizen/Filesystem/Manager.cpp b/src_mobile/modules/tizen/Filesystem/Manager.cpp
deleted file mode 100644 (file)
index 5ecfe2f..0000000
+++ /dev/null
@@ -1,623 +0,0 @@
-/*
- * 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 "Manager.h"
-
-#include <unistd.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <pcrecpp.h>
-#include <ctime>
-#include <cstdio>
-#include <sstream>
-#include <fts.h>
-#include <ecore-1/Ecore_File.h>
-#include <eina-1/eina/eina_list.h>
-#include <dpl/log/log.h>
-#include <dpl/scoped_ptr.h>
-#include <dpl/errno_string.h>
-#include <Commons/Exception.h>
-#include <Commons/Regex.h>
-#include <Filesystem/PathUtils.h>
-#include "Node.h"
-#include "Utils.h"
-
-namespace {
-const char* PATH_ROOT = "/opt/media";
-const char* PATH_DOWNLOADS = "/opt/media/Downloads";
-const char* PATH_DOCUMENTS = "/opt/media/Documents";
-const char* PATH_SOUNDS = "/opt/media/Music";
-const char* PATH_IMAGES = "/opt/media/Images";
-const char* PATH_VIDEOS = "/opt/media/Videos";
-const char* PATH_SDCARD = "/opt/storage/sdcard";
-}
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-using namespace Api;
-
-Manager::Locations Manager::m_locations;
-const std::size_t Manager::m_maxPathLength = 256;
-NodeList Manager::m_openedNodes;
-
-bool Manager::fileExists(const std::string &file)
-{
-    errno = 0;
-    struct stat info;
-    memset(&info, 0, sizeof(struct stat));
-    int status = lstat(file.c_str(), &info);
-    if (status == 0) {
-        return true;
-    } else if (errno == ENOENT) {
-        return false;
-    }
-    ThrowMsg(Commons::PlatformException, "Cannot stat file.");
-}
-
-void Manager::addOpenedNode(const INodePtr& node)
-{
-    NodeListIterator it = m_openedNodes.begin();
-    for (; it != m_openedNodes.end(); ++it) {
-        if (node.Get() == (*it).Get()) {
-            //node is added already
-            return;
-        }
-    }
-    m_openedNodes.push_back(node);
-}
-
-void Manager::removeOpenedNode(const INodePtr& node)
-{
-    NodeListIterator it = m_openedNodes.begin();
-    for (; it != m_openedNodes.end(); ++it) {
-        if ((*it).Get() == node.Get()) {
-            m_openedNodes.erase(it);
-            break;
-        }
-    }
-}
-
-bool Manager::checkIfOpened(const IPathPtr& path) const
-{
-    Assert(path);
-    NodeListIterator it = m_openedNodes.begin();
-    for (; it != m_openedNodes.end(); ++it) {
-        Assert(*it);
-        if (*path == *(*it)->getPath()) {
-            return true;
-        }
-    }
-    return false;
-}
-
-Manager::Manager()
-{
-    static bool initialized = init();
-    (void) initialized;
-}
-
-Manager::~Manager()
-{}
-
-IPathPtr Manager::getBasePath() const
-{
-    Locations::const_iterator it = m_locations.find(LT_ROOT);
-    if (it == m_locations.end()) {
-        ThrowMsg(Commons::PlatformException, "Base path not available.");
-    }
-    return it->second;
-}
-
-IPathPtr Manager::getLocationPath(LocationType type) const
-{
-    Locations::const_iterator it = m_locations.find(type);
-    if (it != m_locations.end()) {
-        return it->second->clone();
-    }
-    return IPathPtr();
-}
-
-LocationPaths Manager::getLocationPaths() const
-{
-    LocationPaths result;
-    Locations::const_iterator it = m_locations.begin();
-    for (; it != m_locations.end(); ++it) {
-        result.push_back(it->second->clone());
-    }
-    return result;
-}
-
-LocationTypes Manager::getLocations() const
-{
-    LocationTypes result;
-    Locations::const_iterator it = m_locations.begin();
-    for (; it != m_locations.end(); ++it) {
-        result.push_back(it->first);
-    }
-    return result;
-}
-
-void Manager::getNode(const EventResolvePtr& event)
-{
-    EventRequestReceiver<EventResolve>::PostRequest(event);
-}
-
-std::size_t Manager::getMaxPathLength() const
-{
-    return m_maxPathLength;
-}
-
-void Manager::copy(const EventCopyPtr& event)
-{
-    EventRequestReceiver<EventCopy>::PostRequest(event);
-}
-
-void Manager::move(const EventMovePtr& event)
-{
-    EventRequestReceiver<EventMove>::PostRequest(event);
-}
-
-void Manager::remove(const EventRemovePtr& event)
-{
-    EventRequestReceiver<EventRemove>::PostRequest(event);
-}
-
-void Manager::find(const EventFindPtr& event)
-{
-    EventRequestReceiver<EventFind>::PostRequest(event);
-}
-
-void Manager::find(const IPathPtr& path,
-                   const FiltersMap& filters,
-                   NodeList& result,
-                   const EventFindPtr& event)
-{
-    Try {
-        Assert(path && "path is NULL");
-        FTS *fts;
-        FTSENT *ftsent;
-        std::string pth = path->getFullPath();
-        char * const paths[] = { const_cast<char * const>(pth.c_str()), NULL };
-
-        if ((fts =
-                 fts_open(paths, FTS_PHYSICAL | FTS_NOCHDIR, NULL)) == NULL)
-        {
-            //ERROR
-            int error = errno;
-            LogError(__PRETTY_FUNCTION__ << ": fts_open on "
-                                         << pth
-                                         << " failed with error: "
-                                         << strerror(error));
-            return;
-        }
-
-        while ((ftsent = fts_read(fts)) != NULL) {
-            if (event && event->checkCancelled()) {
-                break;
-            }
-            switch (ftsent->fts_info) {
-            case FTS_DP:
-                //directory in postorder - do nothing
-                break;
-            case FTS_D:
-            case FTS_DC:
-            case FTS_F:
-            case FTS_SL:
-            case FTS_SLNONE:
-            case FTS_DEFAULT:
-                //regular files, symbolic links, directories in preorder
-                //and other file entries that can be processed further
-                if (matchFilters(ftsent->fts_name, *ftsent->fts_statp,
-                                 filters))
-                {
-                    IPathPtr childPath = IPath::create(ftsent->fts_path);
-                    result.push_back(Node::resolve(childPath));
-                }
-                break;
-            case FTS_NS:
-            case FTS_NSOK:
-            case FTS_DOT:
-            case FTS_DNR:
-            case FTS_ERR:
-            default:
-                LogWarning(__PRETTY_FUNCTION__
-                           << ": traversal failed with error: "
-                           << strerror(ftsent->fts_errno));
-                ThrowMsg(Commons::PlatformException,
-                         "Error reading directory");
-            }
-        }
-
-        if (fts_close(fts) == -1) {
-            int error = errno;
-            LogWarning(__PRETTY_FUNCTION__ << ": fts_close failed with error: "
-                                           << strerror(error));
-            ThrowMsg(Commons::PlatformException,
-                     "Could not close platform node.");
-        }
-    }
-    Catch(Commons::Exception) {}
-}
-
-void Manager::copyElement(
-    const std::string &src, const std::string &dest, bool recursive) const
-{
-    LogDebug("Copying src: " << src << " to: " << dest);
-
-    //element is a file:
-    if (EINA_TRUE != ecore_file_is_dir(src.c_str())) {
-        if (EINA_TRUE != ecore_file_cp(src.c_str(), dest.c_str())) {
-            ThrowMsg(Commons::PlatformException, "Failed to copy file");
-        }
-        return;
-    }
-    //element is a directory -> create it:
-    if (EINA_TRUE != ecore_file_mkdir(dest.c_str())) {
-        LogDebug("Failed to create destination directory");
-        ThrowMsg(Commons::PlatformException, "Failed to copy directory");
-    }
-    //copy all elements of directory:
-    if (recursive) {
-        Eina_List* list = ecore_file_ls(src.c_str());
-        void* data;
-        EINA_LIST_FREE(list, data)
-        {
-            Try
-            {
-                copyElement((src + '/' + static_cast<char*>(data)).c_str(),
-                            (dest + '/' + static_cast<char*>(data)).c_str());
-            }
-            Catch(Commons::PlatformException)
-            {
-                //remove rest of the list
-                EINA_LIST_FREE(list, data)
-                {
-                    free(data);
-                }
-                ReThrowMsg(Commons::PlatformException, "Failed to copy element");
-            }
-            free(data);
-        }
-    }
-}
-
-bool Manager::access(const IPathPtr& path,
-                     int accessType) const
-{
-    int amode = 0;
-    if (accessType & AT_EXISTS) {
-        amode |= F_OK;
-    }
-    if (accessType & AT_READ) {
-        amode |= R_OK;
-    }
-    if (accessType & AT_WRITE) {
-        amode |= W_OK;
-    }
-    if (accessType & AT_EXEC) {
-        amode |= X_OK;
-    }
-    return (::access(path->getFullPath().c_str(), amode) == 0);
-}
-
-bool Manager::matchFilters(const std::string& name,
-                           const struct stat& info,
-                           const FiltersMap& filters)
-{
-    FiltersMap::const_iterator it = filters.begin();
-    for (; it != filters.end(); ++it) {
-        if (it->first == FF_NAME) {
-            if (!pcrecpp::RE(it->second).PartialMatch(name)) {
-                return false;
-            }
-        } else if (it->first == FF_SIZE) {
-            std::size_t size;
-            std::stringstream ss(it->second);
-            ss >> size;
-            if (!ss ||
-                (size != static_cast<size_t>(info.st_size)))
-            {
-                return false;
-            }
-        } else if (it->first == FF_CREATED) {
-            std::time_t created;
-            std::stringstream ss(it->second);
-            ss >> created;
-            if (!ss || (created != info.st_ctime)) {
-                return false;
-            }
-        } else if (it->first == FF_MODIFIED) {
-            std::time_t modified;
-            std::stringstream ss(it->second);
-            ss >> modified;
-            if (!ss || (modified != info.st_mtime)) {
-                return false;
-            }
-        }
-    }
-    return true;
-}
-
-void Manager::OnRequestReceived(const EventResolvePtr& event)
-{
-    try {
-        event->setResult(Node::resolve(event->getPath()));
-    } catch (const Commons::PlatformException& ex) {
-        LogError("Exception: " << ex.GetMessage());
-        event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
-    }
-    event->setCancelAllowed(true);
-}
-
-void Manager::checkPaths(
-    Api::IPathPtr &src,
-    Api::IPathPtr &dest)
-{
-    Assert(dest);
-    Assert(src);
-    if (!dest->isAbsolute()) {
-        dest = src->getPath() + *dest;
-    }
-
-    if (src == dest) {
-        ThrowMsg(Commons::PlatformException,
-                 "Destination is same as source: " << src->getFullPath());
-    }
-
-    INodePtr parent;
-    Try {
-        parent = Node::resolve(IPath::create(dest->getPath()));
-    }
-    Catch(Commons::PlatformException) {
-        ReThrowMsg(Commons::PlatformException,
-                   "Could not get destination's parent node.");
-    }
-
-    if (parent->getType() != NT_DIRECTORY) {
-        ThrowMsg(Commons::PlatformException,
-                 "Destination's parent node is not directory.");
-    }
-
-    if (!access(parent->getPath(), AT_WRITE)) {
-        ThrowMsg(Commons::SecurityException,
-                 "Not enough permissions to write to destination.");
-    }
-}
-
-bool Manager::pathExists(const std::string &path)
-{
-    errno = 0;
-    struct stat info;
-    memset(&info, 0, sizeof(struct stat));
-    int status = lstat(path.c_str(), &info);
-    if ((status != 0) && (errno != ENOENT)) {
-        ThrowMsg(Commons::PlatformException,
-                 "No access to platform destination node.");
-    }
-    return 0 == status;
-}
-
-void Manager::OnRequestReceived(const EventCopyPtr& event)
-{
-    Try {
-        INodePtr srcNode = Node::resolve(event->getSource());
-        int requiredAccess;
-        switch (srcNode->getType()) {
-        case NT_DIRECTORY:
-            requiredAccess = AT_EXEC;
-            break;
-        case NT_FILE:
-            requiredAccess = AT_READ;
-            break;
-        }
-        if (!access(srcNode->getPath(), requiredAccess)) {
-            ThrowMsg(Commons::SecurityException,
-                     "Not enough permissions to copy source node.");
-        }
-
-        IPathPtr src = event->getSource();
-        IPathPtr dest = event->getDestination();
-
-        checkPaths(src, dest);
-
-        std::string realSrc = src->getFullPath();
-        std::string realDest = dest->getFullPath();
-
-        if (pathExists(realDest)) {
-            //no owerwrite flag setted -> exception
-            if ((event->getOptions() & OPT_OVERWRITE) == 0) {
-                ThrowMsg(Commons::PlatformException, "Overwrite is not set.");
-            }
-
-            if (event->checkCancelled()) {
-                //file is not copied yet, so we can cancel it now.
-                event->setCancelAllowed(true);
-                return;
-            }
-
-            //destination exist. Need to be removed
-            Try {
-                INodePtr node = Node::resolve(event->getDestination());
-                node->remove(event->getOptions());
-            }
-            Catch(Commons::PlatformException) {
-                LogError("Exception: " << _rethrown_exception.GetMessage());
-                event->setExceptionCode(
-                    Commons::ExceptionCodes::PlatformException);
-            }
-            Catch(Commons::SecurityException) {
-                event->setExceptionCode(
-                    Commons::ExceptionCodes::SecurityException);
-            }
-        }
-        //Destination is not exist. Start copy now.
-        copyElement(realSrc, realDest);
-
-        event->setResult(Node::resolve(dest));
-    } catch (const Commons::PlatformException& ex) {
-        LogError("Exception: " << ex.GetMessage());
-        event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
-    } catch (const Commons::SecurityException& ex) {
-        LogError("Exception: " << ex.GetMessage());
-        event->setExceptionCode(Commons::ExceptionCodes::SecurityException);
-    }
-    //file is copied already so we don't allow cancelling anymore.
-    event->setCancelAllowed(false);
-}
-
-void Manager::OnRequestReceived(const EventMovePtr& event)
-{
-    try {
-        IPathPtr src = event->getSource();
-        IPathPtr dest = event->getDestination();
-
-        INodePtr srcNode = Node::resolve(src);
-        if (!access(srcNode->getParent()->getPath(), AT_WRITE)) {
-            ThrowMsg(Commons::SecurityException,
-                     "Not enough permissions to move source node.");
-        }
-
-        checkPaths(src, dest);
-
-        bool destExists = pathExists(dest->getFullPath());
-
-        if (destExists && (0 == (event->getOptions() & OPT_OVERWRITE))) {
-            ThrowMsg(Commons::PlatformException, "Overwrite is not set.");
-        }
-
-        if (event->checkCancelled()) {
-            //file is not moved yet, so we can cancel it now.
-            event->setCancelAllowed(true);
-            return;
-        }
-
-        errno = 0;
-        if (0 != ::rename(src->getFullPath().c_str(),
-                          dest->getFullPath().c_str()))
-        {
-            int error = errno;
-            switch (error) {
-            case EXDEV:
-            {
-                if (destExists) {
-                    //destination exist. Need to be removed
-                    Try {
-                        INodePtr node = Node::resolve(
-                                event->getDestination());
-                        node->remove(event->getOptions());
-                    }
-                    Catch(Commons::PlatformException) {
-                        LogError("Exception while removing dest directory");
-                        event->setExceptionCode(
-                            Commons::ExceptionCodes::PlatformException);
-                    }
-                    Catch(Commons::SecurityException) {
-                        event->setExceptionCode(
-                            Commons::ExceptionCodes::SecurityException);
-                    }
-                }
-
-                copyElement(src->getFullPath(),
-                            dest->getFullPath());
-                //remove source files
-                Try {
-                    INodePtr node = Node::resolve(event->getSource());
-                    node->remove(event->getOptions());
-                }
-                Catch(Commons::Exception) {
-                    LogError("Exception: "
-                             << _rethrown_exception.GetMessage());
-                }
-                break;
-            }
-            default:
-                ThrowMsg(Commons::PlatformException,
-                         "Error on rename: " << DPL::GetErrnoString(error));
-                break;
-            }
-        }
-
-        event->setResult(Node::resolve(dest));
-    } catch (const Commons::PlatformException& ex) {
-        LogError("Exception: " << ex.GetMessage());
-        event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
-    } catch (const Commons::SecurityException& ex) {
-        LogError("Exception: " << ex.GetMessage());
-        event->setExceptionCode(Commons::ExceptionCodes::SecurityException);
-    }
-    event->setCancelAllowed(false);
-}
-
-void Manager::OnRequestReceived(const EventRemovePtr& event)
-{
-    if (!event->checkCancelled()) {
-        Try {
-            INodePtr node = Node::resolve(event->getPath());
-            node->remove(event->getOptions());
-        }
-        Catch(Commons::PlatformException) {
-            LogError("Exception: " << _rethrown_exception.GetMessage());
-            event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
-        }
-        Catch(Commons::SecurityException) {
-            event->setExceptionCode(Commons::ExceptionCodes::SecurityException);
-        }
-        event->setCancelAllowed(false);
-    } else {
-        event->setCancelAllowed(true);
-    }
-}
-
-void Manager::OnRequestReceived(const EventFindPtr& event)
-{
-    try {
-        NodeList result;
-        find(event->getPath(), event->getFilters(), result, event);
-        event->setResult(result);
-    } catch (const Commons::Exception& ex) {
-        LogError("Exception: " << ex.GetMessage());
-        event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
-    }
-    event->setCancelAllowed(true);
-}
-
-bool Manager::init()
-{
-    m_locations[LT_ROOT] = IPath::create(PATH_ROOT);
-    m_locations[LT_SDCARD] = IPath::create(PATH_SDCARD);
-    setupLocation(LT_DOWNLOADS, PATH_DOWNLOADS);
-    setupLocation(LT_DOCUMENTS, PATH_DOCUMENTS);
-    setupLocation(LT_SOUNDS, PATH_SOUNDS);
-    setupLocation(LT_IMAGES, PATH_IMAGES);
-    setupLocation(LT_VIDEOS, PATH_VIDEOS);
-
-    return true;
-}
-
-void Manager::setupLocation(LocationType location,
-                            const char* path)
-{
-    if (!nodeExists(path)) {
-        try {
-            makePath(path, 0755);
-        } catch (const Commons::PlatformException& ex) {
-            LogError("Exception: " << ex.DumpToString());
-            return;
-        }
-    }
-    m_locations[location] = IPath::create(path);
-}
-} // Filesystem
-} // WrtDeviceApis
diff --git a/src_mobile/modules/tizen/Filesystem/Manager.h b/src_mobile/modules/tizen/Filesystem/Manager.h
deleted file mode 100644 (file)
index fa59e3d..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRTDEVICEAPIS_FILESYSTEM_MANAGER_H_
-#define WRTDEVICEAPIS_FILESYSTEM_MANAGER_H_
-
-#include <map>
-#include <vector>
-#include <cstddef>
-#include <dpl/shared_ptr.h>
-#include <Filesystem/IManager.h>
-#include <Filesystem/IPath.h>
-#include "Node.h"
-#include "Path.h"
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-class Manager : public Api::IManager
-{
-  public:
-    /**
-     * Checks if file exists.
-     * @param real file path.
-     * @return true when file exists, false otherwise.
-     * @throw PlatformException If unable to validate if file exists.
-     */
-    static bool fileExists(const std::string &file);
-
-  public:
-    Manager();
-    ~Manager();
-
-    Api::IPathPtr getBasePath() const;
-
-    Api::IPathPtr getLocationPath(Api::LocationType type) const;
-
-    Api::LocationPaths getLocationPaths() const;
-
-    Api::LocationTypes getLocations() const;
-
-    void getNode(const Api::EventResolvePtr& event);
-
-    std::size_t getMaxPathLength() const;
-
-    void copy(const Api::EventCopyPtr& event);
-
-    void move(const Api::EventMovePtr& event);
-
-    void remove(const Api::EventRemovePtr& event);
-
-    void find(const Api::EventFindPtr& event);
-
-    /**
-     * Finds files in the filesystem whish match specified filters.
-     * @param path Starting path.
-     * @param filter Filters @see FindFilters.
-     * @param result List with found files.
-     * @param event DPL event, if set then search process can be cancelled
-     * @remarks For filter FF_NAME value is treated as perl like regex pattern.
-     *          Use @Regex::escpae() if you want to treat it as normal string.
-     */
-    void find(const Api::IPathPtr& path,
-              const Api::FiltersMap& filter,
-              Api::NodeList& result,
-              const Api::EventFindPtr& event = Api::EventFindPtr(NULL));
-
-    /**
-     * @warning Operates on specified as it is - it DOES NOT take its real path.
-     *          This is because all filesystem operation will probably change
-     *          their approach to real path and will allow to refer to nodes
-     *          only by virtual roots.
-     */
-    bool access(const Api::IPathPtr& path,
-                int accessType) const;
-
-    void addOpenedNode(const Api::INodePtr& node);
-    void removeOpenedNode(const Api::INodePtr& node);
-    bool checkIfOpened(const Api::IPathPtr& path) const;
-
-  protected:
-    bool matchFilters(const std::string& name,
-                      const struct stat& info,
-                      const Api::FiltersMap& filter);
-
-    void OnRequestReceived(const Api::EventResolvePtr& event);
-    void OnRequestReceived(const Api::EventCopyPtr& event);
-    void OnRequestReceived(const Api::EventMovePtr& event);
-    void OnRequestReceived(const Api::EventRemovePtr& event);
-    void OnRequestReceived(const Api::EventFindPtr& event);
-
-  private:
-    typedef std::map<Api::LocationType, Api::IPathPtr> Locations;
-
-  private:
-    /**
-     * Initializes statics of Manager class.
-     * Used only internally.
-     * @return True on success, false otherwsie.
-     */
-    static bool init();
-
-    static void setupLocation(Api::LocationType location,
-                              const char* path);
-
-    void copyElement(const std::string &src,
-                     const std::string &dest,
-                     bool recursive = true) const;
-
-    /**
-     * Check two paths to copy/move. Checks if they are not the same and
-     * required permissions.
-     * @param src
-     * @param dest
-     */
-    void checkPaths(Api::IPathPtr &src, Api::IPathPtr &dest);
-    bool pathExists(const std::string &path);
-
-  private:
-    static Locations m_locations; ///< Paths to default locations.
-    static const std::size_t m_maxPathLength; ///< Maximum path length.
-    static Api::NodeList m_openedNodes; ///< List of nodes that has opened
-                                        // streams.
-};
-} // Filesystem
-} // WrtDeviceApis
-
-#endif // WRTDEVICEAPIS_FILESYSTEM_MANAGER_H_
diff --git a/src_mobile/modules/tizen/Filesystem/Node.cpp b/src_mobile/modules/tizen/Filesystem/Node.cpp
deleted file mode 100644 (file)
index 221285c..0000000
+++ /dev/null
@@ -1,608 +0,0 @@
-/*
- * 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 "Node.h"
-#include <algorithm>
-#include <memory>
-#include <typeinfo>
-#include <sys/types.h>
-#include <cstdio>
-#include <unistd.h>
-#include <fts.h>
-#include <dirent.h>
-#include <errno.h>
-#include <pcrecpp.h>
-#include <sstream>
-#include <Commons/Exception.h>
-#include <Filesystem/PathUtils.h>
-#include <Filesystem/Enums.h>
-#include "Manager.h"
-#include "NodeFilterMatcher.h"
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-using namespace Api;
-
-INodePtr Node::resolve(const IPathPtr& path)
-{
-    struct stat info;
-    if (lstat(path->getFullPath().c_str(), &info) != 0) {
-        LogError("File: " << path->getFullPath().c_str());
-        ThrowMsg(Commons::PlatformException,
-                 "Node does not exist or access denied.");
-    }
-
-    if (!S_ISDIR(info.st_mode) && !S_ISREG(info.st_mode)) {
-        ThrowMsg(Commons::PlatformException,
-                 "Platform node is of unsupported type.");
-    }
-
-    NodeType type = S_ISDIR(info.st_mode) ? NT_DIRECTORY : NT_FILE;
-    NodePtr result(new Node(path, type));
-    return DPL::StaticPointerCast<INode>(result);
-}
-
-IPathPtr Node::getPath() const
-{
-    return IPath::create(m_path->getFullPath());
-}
-
-INodePtr Node::getChild(const IPathPtr& path)
-{
-    if (m_type != NT_DIRECTORY) {
-        ThrowMsg(Commons::PlatformException, "Not a directory.");
-    }
-    return Node::resolve(*m_path + *path);
-}
-
-NodeType Node::getType() const
-{
-    return m_type;
-}
-
-int Node::getPermissions() const
-{
-    return m_perms;
-}
-
-void Node::setPermissions(int perms)
-{
-    m_perms = perms;
-}
-
-Node::NameList Node::getChildNames() const
-{
-    if (m_type != NT_DIRECTORY) {
-        ThrowMsg(Commons::PlatformException, "Node is not directory.");
-    }
-
-    if ((m_perms & PERM_READ) == 0) {
-        ThrowMsg(Commons::SecurityException, "No permission.");
-    }
-
-    DIR* dir = opendir(m_path->getFullPath().c_str());
-    if (!dir) {
-        ThrowMsg(Commons::PlatformException,
-                 "Node has been deleted from platform.");
-    }
-
-    NameList result;
-    errno = 0;
-    int return_code;
-    struct dirent entry;
-    struct dirent *entry_result;
-    for (return_code = readdir_r(dir, &entry, &entry_result);
-            entry_result != NULL && return_code == 0;
-            return_code = readdir_r(dir, &entry, &entry_result)) {
-        if (!strncmp(entry.d_name, ".", 1) ||
-            !strncmp(entry.d_name, "..", 2))
-        {
-            continue;
-        }
-        result.push_back(entry.d_name);
-    }
-    if (return_code != 0 || errno != 0) {
-        ThrowMsg(Commons::PlatformException, "Error while reading directory.");
-    }
-
-    if (closedir(dir) != 0) {
-        ThrowMsg(Commons::PlatformException, "Could not close platform node.");
-    }
-
-    return result;
-}
-
-NodeList Node::getChildNodes(const NodeFilterPtr& filter) const
-{
-    if (m_type != NT_DIRECTORY) {
-        ThrowMsg(Commons::PlatformException, "Node is not directory.");
-    }
-
-    if ((m_perms & PERM_READ) == 0) {
-        ThrowMsg(Commons::SecurityException, "No permission.");
-    }
-
-    DIR* dir = opendir(m_path->getFullPath().c_str());
-    if (!dir) {
-        ThrowMsg(Commons::PlatformException,
-                 "Node has been deleted from platform.");
-    }
-
-    errno = 0;
-    NodeList result;
-    int return_code;
-    struct dirent entry;
-    struct dirent *entry_result;
-    for (return_code = readdir_r(dir, &entry, &entry_result);
-            entry_result != NULL && return_code == 0;
-            return_code = readdir_r(dir, &entry, &entry_result)) {
-        if (!strncmp(entry.d_name, ".", 1) ||
-            !strncmp(entry.d_name, "..", 2))
-        {
-            continue;
-        }
-        Try {
-            Assert(m_path);
-            INodePtr node = Node::resolve(*m_path + entry.d_name);
-            node->setPermissions(getPermissions()); // inherit access rights
-            if (NodeFilterMatcher::match(node, filter)) {
-                result.push_back(node);
-            }
-        }
-        Catch(Commons::PlatformException) {}
-    }
-
-    if (return_code != 0 || errno != 0) {
-        ThrowMsg(Commons::PlatformException, "Error while reading directory.");
-    }
-
-    if (closedir(dir) != 0) {
-        ThrowMsg(Commons::PlatformException, "Could not close platform node.");
-    }
-
-    return result;
-}
-
-void Node::getChildNodes(const EventListNodesPtr& event)
-{
-    LogDebug("ENTER");
-    EventRequestReceiver<EventListNodes>::PostRequest(event);
-}
-
-INodePtr Node::createChild(
-    const IPathPtr& path,
-    NodeType type,
-    int options)
-{
-    if (m_type != NT_DIRECTORY) {
-        ThrowMsg(Commons::PlatformException, "Parent node is not a directory.");
-    }
-
-    if ((m_perms & PERM_WRITE) == 0) {
-        ThrowMsg(Commons::SecurityException, "Not enough permissions.");
-    }
-
-    Assert(m_path);
-    Assert(path);
-    IPathPtr childPath = *m_path + *path;
-    if (exists(childPath)) {
-        ThrowMsg(Commons::PlatformException, "Node already exists.");
-    }
-
-    NodePtr result;
-    switch (type) {
-    case NT_FILE:
-        result.Reset(createAsFile(childPath, options));
-        break;
-    case NT_DIRECTORY:
-        result.Reset(createAsDirectory(childPath, options));
-        break;
-    default:
-        ThrowMsg(Commons::PlatformException, "Unsupported node type.");
-    }
-    if (!!result) {
-        result->m_perms = m_perms;
-    } else {
-        ThrowMsg(Commons::PlatformException, "Node creation error");
-    }
-
-    return DPL::StaticPointerCast<INode>(result);
-}
-
-IStreamPtr Node::open(int mode)
-{
-    if (m_type == NT_DIRECTORY) {
-        ThrowMsg(Commons::PlatformException,
-                 "Cannot attach stream to directory.");
-    }
-
-    if (((mode & AM_READ) && ((m_perms & PERM_READ) == 0)) ||
-        (((mode & AM_WRITE) ||
-          (mode & AM_APPEND)) && ((m_perms & PERM_WRITE) == 0)))
-    {
-        ThrowMsg(Commons::SecurityException, "Not enough permissions.");
-    }
-
-    DPL::Mutex::ScopedLock lock(&m_openStreamsMutex);
-    StreamPtr stream(new Stream(SharedFromThis(), mode));
-    m_openStreams.insert(stream);
-    IManager::getInstance().addOpenedNode(DPL::StaticPointerCast<INode>(
-                                              SharedFromThis()));
-    return DPL::StaticPointerCast<IStream>(stream);
-}
-
-void Node::open(const EventOpenPtr& event)
-{
-    LogDebug("ENTER");
-    EventRequestReceiver<EventOpen>::PostRequest(event);
-}
-
-void Node::remove(int options)
-{
-    switch (m_type) {
-    case NT_FILE:
-        removeAsFile(m_path);
-        break;
-    case NT_DIRECTORY:
-        removeAsDirectory(m_path, (options & OPT_RECURSIVE));
-        break;
-    }
-}
-
-std::size_t Node::getSize() const
-{
-    if (m_type == NT_DIRECTORY) {
-        ThrowMsg(Commons::PlatformException,
-                 "Getting size for directories is not supported.");
-    }
-
-    struct stat info = stat(m_path);
-    if (!S_ISREG(info.st_mode)) {
-        ThrowMsg(Commons::PlatformException,
-                 "Specified node is not a regular file.");
-    }
-
-    return info.st_size;
-}
-
-std::time_t Node::getCreated() const
-{
-    return stat(m_path).st_ctime;
-}
-
-std::time_t Node::getModified() const
-{
-    return stat(m_path).st_mtime;
-}
-
-// TODO Optimize it, maybe store a flag indicating that node is a root.
-INodePtr Node::getParent() const
-{
-    LocationPaths roots = IManager::getInstance().getLocationPaths();
-    for (LocationPaths::iterator it = roots.begin(); it != roots.end(); ++it) {
-        Assert(*it);
-        Assert(m_path);
-        if (*(*it) == *m_path) {
-            return INodePtr();
-        }
-    }
-    return Node::resolve(IPath::create(m_path->getPath()));
-}
-
-int Node::getMode() const
-{
-    int result = 0;
-    struct stat info = stat(m_path);
-    if (info.st_mode & S_IRUSR) {
-        result |= PM_USER_READ;
-    }
-    if (info.st_mode & S_IWUSR) {
-        result |= PM_USER_WRITE;
-    }
-    if (info.st_mode & S_IXUSR) {
-        result |= PM_USER_EXEC;
-    }
-    if (info.st_mode & S_IRGRP) {
-        result |= PM_GROUP_READ;
-    }
-    if (info.st_mode & S_IWGRP) {
-        result |= PM_GROUP_WRITE;
-    }
-    if (info.st_mode & S_IXGRP) {
-        result |= PM_GROUP_EXEC;
-    }
-    if (info.st_mode & S_IROTH) {
-        result |= PM_OTHER_READ;
-    }
-    if (info.st_mode & S_IWOTH) {
-        result |= PM_OTHER_WRITE;
-    }
-    if (info.st_mode & S_IXOTH) {
-        result |= PM_OTHER_EXEC;
-    }
-    return result;
-}
-
-void Node::read(const EventReadTextPtr& event)
-{
-    LogDebug("ENTER");
-    EventRequestReceiver<EventReadText>::PostRequest(event);
-}
-
-void Node::onStreamClose(const StreamPtr& stream)
-{
-    {
-        DPL::Mutex::ScopedLock lock(&m_openStreamsMutex);
-        m_openStreams.erase(stream);
-    }
-    if (m_openStreams.empty()) {
-        IManager::getInstance().removeOpenedNode(DPL::StaticPointerCast<INode>(
-                                                     SharedFromThis()));
-    }
-}
-
-bool Node::exists(const IPathPtr& path)
-{
-    struct stat info;
-    memset(&info, 0, sizeof(struct stat));
-    int status = lstat(path->getFullPath().c_str(), &info);
-    if ((status == 0) || ((status != 0) && (errno != ENOENT))) {
-        return true;
-    }
-    return false;
-}
-
-struct stat Node::stat(const IPathPtr& path)
-{
-    struct stat result;
-    memset(&result, 0, sizeof(struct stat));
-    if (::stat(path->getFullPath().c_str(),
-               &result) != 0)
-    {
-        LogError("File: " << path->getFullPath().c_str());
-        ThrowMsg(Commons::PlatformException, "Node does not exist or no access");
-    }
-    return result;
-}
-
-Node::Node(const IPathPtr& path,
-           NodeType type) :
-    m_path(path),
-    m_type(type),
-    m_perms(PERM_NONE)
-{}
-
-Node* Node::createAsFile(const IPathPtr& path,
-                         int /* options */)
-{
-    LogDebug("ENTER");
-    createAsFileInternal(path);
-    return new Node(path, NT_FILE);
-}
-
-void Node::createAsFileInternal(const IPathPtr& path)
-{
-    LogDebug("ENTER");
-    FILE* file = std::fopen(path->getFullPath().c_str(), "wb");
-    if (!file) {
-        ThrowMsg(Commons::PlatformException,
-                 "Platform node could not be created.");
-    }
-    std::fclose(file);
-}
-
-Node* Node::createAsDirectory(const IPathPtr& path,
-                              int options)
-{
-    if (options & OPT_RECURSIVE) {
-        PathUtils::PathList parts = PathUtils::getParts(path);
-        PathUtils::PathListIterator it = parts.begin();
-        for (; it != parts.end(); ++it) {
-            if (!exists(*it)) {
-                createAsDirectoryInternal(*it);
-            }
-        }
-    }
-    createAsDirectoryInternal(path);
-    return new Node(path, NT_DIRECTORY);
-}
-
-void Node::createAsDirectoryInternal(const IPathPtr& path)
-{
-    if (mkdir(path->getFullPath().c_str(), S_IRWXU | S_IRWXG | S_IROTH |
-              S_IXOTH) != 0)
-    {
-        ThrowMsg(Commons::PlatformException,
-                 "Platform node could not be created.");
-    }
-}
-
-void Node::removeAsFile(const IPathPtr& path)
-{
-    DPL::Mutex::ScopedLock lock(&m_openStreamsMutex);
-    if (!m_openStreams.empty()) {
-        ThrowMsg(Commons::PlatformException, "Node is locked for I/O.");
-    }
-    if (IManager::getInstance().checkIfOpened(path)) {
-        ThrowMsg(Commons::PlatformException, "Node is locked for I/O.");
-    }
-
-    if (unlink(path->getFullPath().c_str()) != 0) {
-        ThrowMsg(Commons::PlatformException,
-                 "Error while removing platform node.");
-    }
-}
-
-void Node::removeAsDirectory(const IPathPtr& path,
-                             bool recursive)
-{
-    Assert(path);
-    if (recursive) {
-        FTS *fts;
-        FTSENT *ftsent;
-        int error = 0;
-        std::string pth = path->getFullPath();
-        char * const paths[] = { const_cast<char * const>(pth.c_str()), NULL };
-
-        if ((fts =
-                 fts_open(paths, FTS_PHYSICAL | FTS_NOCHDIR, NULL)) == NULL)
-        {
-            //ERROR
-            error = errno;
-            LogError(__PRETTY_FUNCTION__ << ": fts_open on "
-                                         << pth
-                                         << " failed with error: "
-                                         << strerror(error));
-            ThrowMsg(Commons::PlatformException, "Failed to traverse Node");
-        }
-
-        while ((ftsent = fts_read(fts)) != NULL) {
-            switch (ftsent->fts_info) {
-            case FTS_D:
-                //directory in preorder - do nothing
-                break;
-            case FTS_DP:
-                //directory in postorder - remove
-                errno = 0;
-                if (rmdir(ftsent->fts_accpath) != 0) {
-                    if (errno == EEXIST) {
-                        ThrowMsg(Commons::PlatformException,
-                                 "Node has child nodes.");
-                    }
-                    ThrowMsg(Commons::PlatformException,
-                             "Error while removing platform node.");
-                }
-                break;
-            case FTS_DC:
-            case FTS_F:
-            case FTS_NSOK:
-            case FTS_SL:
-            case FTS_SLNONE:
-            case FTS_DEFAULT:
-            {
-                //regular files and other objects that can safely be removed
-                IPathPtr file_path = IPath::create(ftsent->fts_path);
-                removeAsFile(file_path);
-                break;
-            }
-            case FTS_NS:
-            case FTS_DOT:
-            case FTS_DNR:
-            case FTS_ERR:
-            default:
-                LogWarning(__PRETTY_FUNCTION__
-                           << ": traversal failed with error: "
-                           << strerror(ftsent->fts_errno));
-                break;
-            }
-        }
-
-        if (fts_close(fts) == -1) {
-            error = errno;
-            LogWarning(__PRETTY_FUNCTION__ << ": fts_close failed with error: "
-                                           << strerror(error));
-        }
-    } else {
-        if (rmdir(path->getFullPath().c_str()) != 0) {
-            if (errno == EEXIST) {
-                ThrowMsg(Commons::PlatformException, "Node has child nodes.");
-            }
-            ThrowMsg(Commons::PlatformException,
-                     "Error while removing platform node.");
-        }
-    }
-}
-
-void Node::OnRequestReceived(const EventListNodesPtr& event)
-{
-    try {
-        NodeList list = event->getNode()->getChildNodes(event->getFilter());
-        event->setResult(list);
-    } catch (const Commons::PlatformException& ex) {
-        LogError("Exception: " << ex.GetMessage());
-        event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
-    } catch (const Commons::SecurityException& ex) {
-        LogError("Exception: " << ex.GetMessage());
-        event->setExceptionCode(Commons::ExceptionCodes::SecurityException);
-    }
-}
-
-void Node::OnRequestReceived(const EventOpenPtr& event)
-{
-    if (!event->checkCancelled()) {
-        try {
-            IStreamPtr result = open(event->getMode());
-            event->setResult(result);
-        } catch (const Commons::PlatformException& ex) {
-            LogError("Exception: " << ex.GetMessage());
-            event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
-        } catch (const Commons::SecurityException& ex) {
-            LogError("Exception: " << ex.GetMessage());
-            event->setExceptionCode(Commons::ExceptionCodes::SecurityException);
-        }
-        //event can be cancelled before executing this code.
-        //when it comes here we doesn't allow it anymore
-        event->setCancelAllowed(false);
-    } else {
-        event->setCancelAllowed(true);
-    }
-}
-
-void Node::OnRequestReceived(const EventReadTextPtr& event)
-{
-    Try {
-        event->setResult(readText());
-        LogDebug("LEAVIN GRACEFULLY");
-    }
-    Catch(Commons::PlatformException) {
-        event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
-    }
-    Catch(Commons::SecurityException) {
-        event->setExceptionCode(Commons::ExceptionCodes::SecurityException);
-    }
-    //this function doesn't change state of the platform,
-    //so we can allow to cancel it and discard results.
-    event->setCancelAllowed(true);
-}
-
-std::string Node::readText()
-{
-    if (m_type != NT_FILE) {
-        ThrowMsg(Commons::PlatformException, "Node is not a file.");
-    }
-
-    if ((m_perms & PERM_READ) == 0) {
-        ThrowMsg(Commons::SecurityException, "No permission.");
-    }
-
-    std::stringstream result;
-    DPL::SharedPtr<Stream> stream(new Stream(SharedFromThis(), AM_READ));
-    while (!stream->isEof()) {
-        result << stream->getLine();
-        if (!stream->isEof()) {
-            result << '\n';
-        }
-    }
-    stream->close();
-    return result.str();
-}
-
-std::string Node::toUri(int /*widgetId*/) const
-{
-    // TODO I believe moving this feature to WrtWrapper would make more sense.
-    return "file://" + m_path->getFullPath();
-}
-} // Filesystem
-} // WrtDeviceApis
diff --git a/src_mobile/modules/tizen/Filesystem/Node.h b/src_mobile/modules/tizen/Filesystem/Node.h
deleted file mode 100644 (file)
index de95317..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRTDEVICEAPIS_FILESYSTEM_NODE_H_
-#define WRTDEVICEAPIS_FILESYSTEM_NODE_H_
-
-#include <ctime>
-#include <cstddef>
-#include <sys/stat.h>
-#include <set>
-#include <dpl/shared_ptr.h>
-#include <dpl/enable_shared_from_this.h>
-#include <dpl/mutex.h>
-
-#include <Filesystem/Enums.h>
-#include <Filesystem/INode.h>
-#include "Path.h"
-#include "Stream.h"
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-class Node :
-    public Api::INode,
-    public DPL::EnableSharedFromThis<Node>
-{
-  public:
-    static Api::INodePtr resolve(const Api::IPathPtr& path);
-
-  public:
-    Api::IPathPtr getPath() const;
-    Api::NodeType getType() const;
-    int getPermissions() const;
-    void setPermissions(int perms);
-    std::size_t getSize() const;
-    std::time_t getCreated() const;
-    std::time_t getModified() const;
-    Api::INodePtr getParent() const;
-    int getMode() const;
-
-    Api::INodePtr getChild(const Api::IPathPtr& path);
-    NameList getChildNames() const;
-    Api::NodeList getChildNodes(
-        const Api::NodeFilterPtr& filter = Api::NodeFilterPtr()) const;
-    void getChildNodes(const Api::EventListNodesPtr& event);
-    Api::INodePtr createChild(const Api::IPathPtr & path,
-                              Api::NodeType,
-                              int options);
-    Api::IStreamPtr open(int mode);
-    void open(const Api::EventOpenPtr& event);
-    void remove(int options);
-    void read(const Api::EventReadTextPtr& event);
-
-    void onStreamClose(const StreamPtr& stream);
-
-  private:
-    typedef std::set<StreamPtr> StreamList;
-
-  private:
-    static bool exists(const Api::IPathPtr& path);
-    static struct stat stat(const Api::IPathPtr& path);
-
-  private:
-    Node(const Api::IPathPtr& path, Api::NodeType type);
-
-    Node* createAsFile(const Api::IPathPtr& path,
-                       int options);
-    void createAsFileInternal(const Api::IPathPtr& path);
-
-    Node* createAsDirectory(const Api::IPathPtr& path,
-                            int options);
-    void createAsDirectoryInternal(const Api::IPathPtr& path);
-
-    void removeAsFile(const Api::IPathPtr& path);
-    void removeAsDirectory(const Api::IPathPtr& path,
-                           bool recursive);
-
-    void OnRequestReceived(const Api::EventListNodesPtr& event);
-    void OnRequestReceived(const Api::EventOpenPtr& event);
-
-    void OnRequestReceived(const Api::EventReadTextPtr& event);
-    std::string readText();
-
-    std::string toUri(int widgetId) const;
-
-  private:
-    Api::IPathPtr m_path;
-    Api::NodeType m_type;
-    int m_perms;
-    StreamList m_openStreams;
-    mutable DPL::Mutex m_openStreamsMutex;
-};
-
-typedef DPL::SharedPtr<Node> NodePtr;
-} // Filesystem
-} // WrtDeviceApis
-
-#endif /* WRTDEVICEAPIS_FILESYSTEM_NODE_H_ */
diff --git a/src_mobile/modules/tizen/Filesystem/NodeFilterMatcher.cpp b/src_mobile/modules/tizen/Filesystem/NodeFilterMatcher.cpp
deleted file mode 100644 (file)
index d85f4f0..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * 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.
- */
-/**
- * @author          Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
- */
-
-#include "NodeFilterMatcher.h"
-
-#include <pcrecpp.h>
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-using namespace Api;
-
-bool NodeFilterMatcher::match(const INodePtr& value,
-                              const NodeFilterPtr& filter)
-{
-    if (filter) {
-        if (!matchString(value->getPath()->getName(), filter->getName())) {
-            return false;
-        }
-
-        if (!matchRange(value->getCreated(),
-                        filter->getMinCreated(),
-                        filter->getMaxCreated()))
-        {
-            return false;
-        }
-
-        if (!matchRange(value->getModified(),
-                        filter->getMinModified(),
-                        filter->getMaxModified()))
-        {
-            return false;
-        }
-
-        if (!matchRange(value->getSize(),
-                        filter->getMinSize(),
-                        filter->getMaxSize()))
-        {
-            return false;
-        }
-    }
-    return true;
-}
-
-bool NodeFilterMatcher::matchString(const std::string& value,
-                                    const OptionalString& filter)
-{
-    if (!filter.IsNull()) {
-        return pcrecpp::RE(*filter).PartialMatch(value);
-    }
-    return true;
-}
-
-template<typename Type>
-bool NodeFilterMatcher::matchRange(const Type& value,
-                                   const DPL::Optional<Type>& min,
-                                   const DPL::Optional<Type>& max)
-{
-    if ((!min.IsNull() && (value < *min)) ||
-        (!max.IsNull() && (value > *max)))
-    {
-        return false;
-    }
-    return true;
-}
-} // Filesystem
-} // WrtDeviceApis
diff --git a/src_mobile/modules/tizen/Filesystem/NodeFilterMatcher.h b/src_mobile/modules/tizen/Filesystem/NodeFilterMatcher.h
deleted file mode 100644 (file)
index e300058..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * 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.
- */
-/**
- * @author          Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
- */
-
-#ifndef WRTDEVICEAPIS_FILESYSTEM_NODEFILTERMATCHER_H_
-#define WRTDEVICEAPIS_FILESYSTEM_NODEFILTERMATCHER_H_
-
-#include <string>
-#include <dpl/optional.h>
-#include <Filesystem/INode.h>
-#include <Filesystem/NodeFilter.h>
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-class NodeFilterMatcher
-{
-  public:
-    static bool match(const Api::INodePtr& value,
-                      const Api::NodeFilterPtr& filter);
-
-  private:
-    static bool matchString(const std::string& value,
-                            const Api::OptionalString& filter);
-
-    template<typename Type>
-    static bool matchRange(const Type& value,
-                           const DPL::Optional<Type>& min,
-                           const DPL::Optional<Type>& max);
-
-  private:
-    NodeFilterMatcher();
-};
-} // Filesystem
-} // WrtDeviceApis
-
-#endif // WRTDEVICEAPIS_FILESYSTEM_NODEFILTERMATCHER_H_
diff --git a/src_mobile/modules/tizen/Filesystem/Path.cpp b/src_mobile/modules/tizen/Filesystem/Path.cpp
deleted file mode 100644 (file)
index 9aa1197..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * 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 <memory>
-#include <algorithm>
-#include <iterator>
-#include <stdlib.h>
-#include <limits.h>
-#include <dpl/log/log.h>
-#include <dpl/assert.h>
-#include <Commons/Exception.h>
-#include <Commons/StringUtils.h>
-#include "Path.h"
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-using namespace Api;
-
-const Path::SeparatorType Path::m_pathSeparator = '/';
-
-IPathPtr Path::create(const std::string& path)
-{
-    DPL::SharedPtr<Path> result(new Path());
-    result->reset(path);
-    return DPL::StaticPointerCast<IPath>(result);
-}
-
-std::string Path::getFullPath() const
-{
-    return m_fullPath;
-}
-
-std::string Path::getPath() const
-{
-    return m_path;
-}
-
-std::string Path::getName() const
-{
-    return m_name;
-}
-
-IPathPtr Path::append(const std::string& path)
-{
-    reset(m_fullPath + m_pathSeparator + path);
-    return DPL::StaticPointerCast<IPath>(SharedFromThis());
-}
-
-IPathPtr Path::append(const IPathPtr& path)
-{
-    reset(m_fullPath + m_pathSeparator + path->getFullPath());
-    return DPL::StaticPointerCast<IPath>(SharedFromThis());
-}
-
-bool Path::isAbsolute() const
-{
-    return (!m_fullPath.empty() && (m_fullPath[0] == m_pathSeparator));
-}
-
-IPath::SeparatorType Path::getSeparator()
-{
-    return m_pathSeparator;
-}
-
-bool Path::isValid(const std::string& str)
-{
-    return !str.empty();
-}
-
-IPathPtr Path::clone() const
-{
-    return Path::create(m_fullPath);
-}
-
-Path::Path()
-{}
-
-void Path::reset(const std::string& str)
-{
-    if (!isValid(str)) {
-        ThrowMsg(Commons::InvalidArgumentException,
-                 "Not a valid path: " + str + ".");
-    }
-
-    std::string tmp = Commons::String::unique(Commons::String::trim(
-                                                  str), m_pathSeparator);
-    std::string::size_type pos = tmp.find_last_of(m_pathSeparator);
-    if (pos == std::string::npos) {
-        m_fullPath = m_name = tmp;
-        m_path.clear();
-    } else {
-        if (0 == pos) {
-            m_fullPath = m_path = m_pathSeparator;
-        } else {
-            m_fullPath = m_path = tmp.substr(0, pos);
-            m_fullPath += m_pathSeparator;
-        }
-        m_name = tmp.substr(pos + 1);
-        m_fullPath += m_name;
-    }
-}
-} // Filesystem
-} // WrtDeviceApis
diff --git a/src_mobile/modules/tizen/Filesystem/Path.h b/src_mobile/modules/tizen/Filesystem/Path.h
deleted file mode 100644 (file)
index 6c7b314..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRTDEVICEAPIS_FILESYSTEM_PATH_H_
-#define WRTDEVICEAPIS_FILESYSTEM_PATH_H_
-
-#include <string>
-#include <vector>
-#include <dpl/enable_shared_from_this.h>
-#include <Filesystem/IPath.h>
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-class Path : public Api::IPath,
-    public DPL::EnableSharedFromThis<Path>
-{
-  public:
-    static Api::IPathPtr create(const std::string& path);
-    static Api::IPath::SeparatorType getSeparator();
-
-  public:
-    std::string getFullPath() const;
-    std::string getPath() const;
-    std::string getName() const;
-    Api::IPathPtr append(const std::string& path);
-    Api::IPathPtr append(const Api::IPathPtr& path);
-    bool isAbsolute() const;
-    Api::IPathPtr clone() const;
-
-  private:
-    /**
-     * Checks whether specified string is a valid path.
-     * @param path String to verify.
-     * @return True when string is a valid path, false otherwise.
-     */
-    static bool isValid(const std::string& str);
-
-  private:
-    Path();
-    void reset(const std::string& str);
-
-  private:
-    static const SeparatorType m_pathSeparator; ///< Path separator.
-
-  private:
-    std::string m_fullPath; ///< Full path.
-    std::string m_path;   ///< Base path.
-    std::string m_name;   ///< Last part of the path.
-};
-} // Filesystem
-} // WrtDeviceApis
-
-#endif /* WRTDEVICEAPIS_FILESYSTEM_PATH_H_ */
diff --git a/src_mobile/modules/tizen/Filesystem/Stream.cpp b/src_mobile/modules/tizen/Filesystem/Stream.cpp
deleted file mode 100644 (file)
index f63d7c4..0000000
+++ /dev/null
@@ -1,302 +0,0 @@
-/*
- * 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 "Stream.h"
-#include <stdio.h>
-#include <new>
-#include <dpl/assert.h>
-#include <dpl/scoped_array.h>
-#include <Commons/Exception.h>
-#include "Manager.h"
-#include "Node.h"
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-using namespace Api;
-
-Stream::Stream(const NodePtr& parent,
-               int mode) :
-    m_parent(parent),
-    m_mode(mode)
-{
-    Assert(m_parent && "Stream needs to have parent.");
-
-    std::ios_base::openmode mode_ = std::ios_base::binary;
-    if (mode & AM_READ) {
-        mode_ |= std::ios_base::in;
-    }
-    if (mode & AM_WRITE) {
-        mode_ |= std::ios_base::out;
-    } else if (mode &
-               AM_APPEND)
-    {
-        mode_ |= (std::ios_base::app | std::ios_base::out);
-    }
-
-    m_stream.open(m_parent->getPath()->getFullPath().c_str(), mode_);
-    if (!m_stream) {
-        ThrowMsg(Commons::PlatformException, "Could not open stream.");
-    }
-}
-
-Stream::~Stream()
-{
-    close();
-}
-
-IStreamPtr Stream::write(bool arg)
-{
-    return write_(arg);
-}
-
-IStreamPtr Stream::write(unsigned char arg)
-{
-    return write_(arg);
-}
-
-IStreamPtr Stream::write(char arg)
-{
-    return write_(arg);
-}
-
-IStreamPtr Stream::write(int arg)
-{
-    return write_(arg);
-}
-
-IStreamPtr Stream::write(double arg)
-{
-    return write_(arg);
-}
-
-IStreamPtr Stream::write(const std::string& arg)
-{
-    return write_(arg);
-}
-
-IStreamPtr Stream::read(bool& arg)
-{
-    return read_(arg);
-}
-
-IStreamPtr Stream::read(unsigned char& arg)
-{
-    return read_(arg);
-}
-
-IStreamPtr Stream::read(char& arg)
-{
-    return read_(arg);
-}
-
-IStreamPtr Stream::read(int& arg)
-{
-    return read_(arg);
-}
-
-IStreamPtr Stream::read(double& arg)
-{
-    return read_(arg);
-}
-
-IStreamPtr Stream::read(std::string& arg)
-{
-    return read_(arg);
-}
-
-char* Stream::getChars(std::size_t num)
-{
-    checkForReading();
-
-    std::size_t maxChars = num + 1;
-    DPL::ScopedArray<char> result;
-    Try {
-        result.Reset(new char[maxChars]);
-    }
-    Catch(std::bad_alloc) {
-        ThrowMsg(Commons::PlatformException, "Couldn't allocate output buffer.");
-    }
-    if (m_stream.get(result.Get(), maxChars).bad()) {
-        ThrowMsg(Commons::PlatformException,
-                 "Error while reading from the stream.");
-    }
-
-    return result.Release();
-}
-
-unsigned char* Stream::getBytes(std::size_t num)
-{
-    checkForReading();
-
-    DPL::ScopedArray<char> buffer;
-    Try {
-        buffer.Reset(new char[num]);
-    }
-    Catch(std::bad_alloc) {
-        ThrowMsg(Commons::PlatformException, "Couldn't allocate output buffer.");
-    }
-    if (m_stream.read(buffer.Get(), num).bad()) {
-        ThrowMsg(Commons::PlatformException,
-                 "Error while reading from the stream.");
-    }
-
-    return static_cast<unsigned char*>(static_cast<void*>(buffer.Release()));
-}
-
-std::size_t Stream::getCount() const
-{
-    if (!isOpen()) {
-        ThrowMsg(Commons::PlatformException, "Stream is closed.");
-    }
-
-    if (!isReadable()) {
-        ThrowMsg(Commons::PlatformException, "Stream is not readable.");
-    }
-
-    return m_stream.gcount();
-}
-
-std::string Stream::getLine()
-{
-    checkForReading();
-
-    std::string result;
-    std::getline(m_stream, result);
-
-    return result;
-}
-
-bool Stream::isOpen() const
-{
-    return m_stream.is_open();
-}
-
-bool Stream::isEof() const
-{
-    return m_stream.eof();
-}
-
-void Stream::close()
-{
-    if (isOpen()) {
-        m_stream.close();
-        m_parent->onStreamClose(SharedFromThis());
-    }
-}
-
-int Stream::getMode() const
-{
-    return m_mode;
-}
-
-long Stream::getPosition() const
-{
-    return static_cast<long>(m_stream.tellg());
-}
-
-void Stream::setPosition(long position)
-{
-    if (m_stream.rdstate() & std::ios_base::eofbit) {
-        m_stream.clear();
-    }
-    if (!(m_stream.seekg(position)) || !(m_stream.seekp(position))) {
-        ThrowMsg(Commons::PlatformException, "Could not set position.");
-    }
-}
-
-long Stream::getSize() const
-{
-    std::fstream::streampos pos = m_stream.tellg();
-    if (pos == -1) {
-        return -1;
-    }
-
-    if (!m_stream.seekg(0, std::_S_end)) {
-        return -1;
-    }
-
-    long result = m_stream.tellg();
-    m_stream.seekg(pos, std::_S_beg);
-
-    return (result == -1 ? result : result + 1);
-}
-
-template<typename T>
-IStreamPtr Stream::write_(T arg)
-{
-    checkForWriting();
-
-    if (!(m_stream << arg)) {
-        LogError("Error while writing to the stream.");
-        ThrowMsg(Commons::PlatformException,
-                 "Error while writing to the stream.");
-    }
-    m_stream.flush();
-
-    return DPL::StaticPointerCast<IStream>(SharedFromThis());
-}
-
-template<typename T>
-IStreamPtr Stream::read_(T& arg)
-{
-    checkForReading();
-
-    if (!(m_stream >> arg)) {
-        ThrowMsg(Commons::PlatformException,
-                 "Error while reading from the stream.");
-    }
-
-    return DPL::StaticPointerCast<IStream>(SharedFromThis());
-}
-
-bool Stream::isReadable() const
-{
-    return (m_mode & AM_READ);
-}
-
-bool Stream::isWriteable() const
-{
-    return ((m_mode & AM_WRITE) || (m_mode & AM_APPEND));
-}
-
-void Stream::checkForReading() const
-{
-    if (!isOpen()) {
-        ThrowMsg(Commons::PlatformException, "Stream is closed.");
-    }
-
-    if (isEof()) {
-        ThrowMsg(Commons::PlatformException, "Stream is marked as EOF.");
-    }
-
-    if (!isReadable()) {
-        ThrowMsg(Commons::PlatformException, "Stream is not readable.");
-    }
-}
-
-void Stream::checkForWriting() const
-{
-    if (!isOpen()) {
-        LogError("Stream is closed.");
-        ThrowMsg(Commons::PlatformException, "Stream is closed.");
-    }
-
-    if (!isWriteable()) {
-        LogError("Stream is not writeable.");
-        ThrowMsg(Commons::PlatformException, "Stream is not writeable.");
-    }
-}
-} // Filesystem
-} // WrtDeviceApis
diff --git a/src_mobile/modules/tizen/Filesystem/Stream.h b/src_mobile/modules/tizen/Filesystem/Stream.h
deleted file mode 100644 (file)
index 777168f..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRTDEVICEAPIS_FILESYSTEM_STREAM_H_
-#define WRTDEVICEAPIS_FILESYSTEM_STREAM_H_
-
-#include <cstddef>
-#include <fstream>
-#include <dpl/shared_ptr.h>
-#include <dpl/enable_shared_from_this.h>
-#include <Filesystem/IStream.h>
-#include <Filesystem/Enums.h>
-#include <Filesystem/INode.h>
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-class Node;
-typedef DPL::SharedPtr<Node> NodePtr;
-
-class Stream :
-    public Api::IStream,
-    public DPL::EnableSharedFromThis<Stream>
-{
-    friend class Node;
-
-  public:
-    ~Stream();
-
-    Api::IStreamPtr write(bool arg);
-    Api::IStreamPtr write(unsigned char arg);
-    Api::IStreamPtr write(char arg);
-    Api::IStreamPtr write(int arg);
-    Api::IStreamPtr write(double arg);
-    Api::IStreamPtr write(const std::string& arg);
-
-    Api::IStreamPtr read(bool& arg);
-    Api::IStreamPtr read(unsigned char& arg);
-    Api::IStreamPtr read(char& arg);
-    Api::IStreamPtr read(int& arg);
-    Api::IStreamPtr read(double& arg);
-    Api::IStreamPtr read(std::string& arg);
-
-    /**
-     * @throw PlatformException If unable to read from the stream.
-     */
-    unsigned char* getBytes(std::size_t num);
-
-    std::size_t getCount() const;
-
-    /**
-     * @throw PlatformException If unable to read from the stream.
-     */
-    char* getChars(std::size_t num);
-
-    std::string getLine();
-
-    bool isOpen() const;
-    bool isEof() const;
-
-    void close();
-
-    long getPosition() const;
-    void setPosition(long position);
-
-    int getMode() const;
-
-    long getSize() const;
-
-  private:
-    template<typename T>
-    Api::IStreamPtr read_(T& arg);
-    template<typename T>
-    Api::IStreamPtr write_(T arg);
-
-    inline bool isReadable() const;
-    inline bool isWriteable() const;
-    void checkForReading() const;
-    void checkForWriting() const;
-
-  private:
-    Stream(const NodePtr& parent,
-           int mode);
-
-  private:
-    NodePtr m_parent;
-    int m_mode;
-    mutable std::fstream m_stream;
-};
-
-typedef DPL::SharedPtr<Stream> StreamPtr;
-} // Filesystem
-} // WrtDeviceApis
-
-#endif /* WRTDEVICEAPIS_FILESYSTEM_STREAM_H_ */
diff --git a/src_mobile/modules/tizen/Filesystem/Utils.cpp b/src_mobile/modules/tizen/Filesystem/Utils.cpp
deleted file mode 100644 (file)
index fc9cde0..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * 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    Utils.cpp
- * @author  Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
- * @version 1.0
- */
-
-#include <sys/stat.h>
-#include <cerrno>
-#include <cstring>
-#include <cstdlib>
-#include <unistd.h>
-#include <Commons/Exception.h>
-#include "Utils.h"
-
-namespace {
-int try_mkdir(const char* path,
-              mode_t mode)
-{
-    struct stat st;
-    int err = 0;
-
-    if (::stat(path, &st) != 0) {
-        if (::mkdir(path, mode) != 0) {
-            err = -1;
-        }
-    } else if (!S_ISDIR(st.st_mode)) {
-        errno = ENOTDIR;
-        err = -1;
-    }
-
-    return err;
-}
-
-int mkpath(const char* path,
-           mode_t mode)
-{
-    char* copy = ::strdup(path);
-    if (NULL == copy) {
-        return -1;
-    }
-
-    int err = 0;
-    char* ptr = copy;
-    char* slash = NULL;
-
-    while ((0 == err) && (NULL != (slash = ::strchr(ptr, '/')))) {
-        if (slash != ptr) {
-            *slash = '\0';
-            err = try_mkdir(copy, mode);
-            *slash = '/';
-        }
-        ptr = slash + 1;
-    }
-
-    if (0 == err) {
-        err = try_mkdir(path, mode);
-    }
-
-    ::free(copy);
-    return err;
-}
-}
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-bool nodeExists(const std::string& path)
-{
-    struct stat info;
-    if (stat(path.c_str(), &info) == 0) {
-        if (S_ISDIR(info.st_mode)) {
-            return true;
-        }
-    }
-    return false;
-}
-
-void makePath(const std::string& path,
-              mode_t mode)
-{
-    if (mkpath(path.c_str(), mode) == -1) {
-        ThrowMsg(Commons::PlatformException, "Couldn't create path: " << path);
-    }
-}
-}
-}
diff --git a/src_mobile/modules/tizen/Filesystem/Utils.h b/src_mobile/modules/tizen/Filesystem/Utils.h
deleted file mode 100644 (file)
index 2b1eeb3..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * 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    Utils.h
- * @author  Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
- * @version 1.0
- */
-
-#ifndef WRTDEVICEAPIS_FILESYSTEM_UTILS_H_
-#define WRTDEVICEAPIS_FILESYSTEM_UTILS_H_
-
-#include <sys/types.h>
-#include <string>
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-bool nodeExists(const std::string& path);
-
-void makePath(const std::string& path, mode_t mode);
-}
-}
-
-#endif
diff --git a/src_mobile/modules/tizen/Filesystem/config.cmake b/src_mobile/modules/tizen/Filesystem/config.cmake
deleted file mode 100644 (file)
index ed22f05..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-get_current_path()
-
-pkg_search_module(pcrecpp REQUIRED libpcrecpp
-                  ecore REQUIRED ecore-1)
-
-set(INCLUDES_PLATFORM_IMPLEMENTATION_FILESYSTEM
-  ${pcrecpp_INCLUDE_DIRS}
-  ${ecore_INCLUDE_DIRS}
-  PARENT_SCOPE
-)
-
-set(LIBS_PLATFORM_IMPLEMENTATION_FILESYSTEM
-  ${pcrecpp_LIBRARIES}
-  ${ecore_LIBRARIES}
-  PARENT_SCOPE
-)
-
-set(SRCS_PLATFORM_IMPLEMENTATION_FILESYSTEM
-  ${CURRENT_PATH}/Manager.cpp
-  ${CURRENT_PATH}/Node.cpp
-  ${CURRENT_PATH}/Path.cpp
-  ${CURRENT_PATH}/Stream.cpp
-  ${CURRENT_PATH}/NodeFilterMatcher.cpp
-  ${CURRENT_PATH}/Utils.cpp
-  PARENT_SCOPE
-)
diff --git a/src_mobile/modules/tizen/Networking/Connection.cpp b/src_mobile/modules/tizen/Networking/Connection.cpp
deleted file mode 100644 (file)
index 3e544c0..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * 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 "Connection.h"
-
-namespace WrtDeviceApis {
-namespace Networking {
-std::string Connection::getName() const
-{
-    return m_name;
-}
-} // Networking
-} // WrtDeviceApis
diff --git a/src_mobile/modules/tizen/Networking/Connection.h b/src_mobile/modules/tizen/Networking/Connection.h
deleted file mode 100644 (file)
index 04bb4a5..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * 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.
- */
-/**
- * @author       Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
- */
-
-#ifndef WRTDEVICEAPIS_NETWORKING_CONNECTION_H_
-#define WRTDEVICEAPIS_NETWORKING_CONNECTION_H_
-
-#include <string>
-#include <Networking/IConnection.h>
-
-namespace WrtDeviceApis {
-namespace Networking {
-/* TODO */
-class Connection : public Api::IConnection
-{
-  public:
-    std::string getName() const;
-
-  private:
-    std::string m_name;
-};
-} // Networking
-} // WrtDeviceApis
-
-#endif // WRTDEVICEAPIS_NETWORKING_CONNECTION_H_
diff --git a/src_mobile/modules/tizen/Networking/EthernetAdapter.cpp b/src_mobile/modules/tizen/Networking/EthernetAdapter.cpp
deleted file mode 100644 (file)
index e2cf447..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * 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 "EthernetAdapter.h"
-
-namespace WrtDeviceApis {
-namespace Networking {
-EthernetAdapter::EthernetAdapter()
-{}
-
-void EthernetAdapter::addOnConnected(
-    const Api::EventConnectedEmitterPtr& emitter)
-{
-    m_onConnected.attach(emitter);
-}
-
-void EthernetAdapter::removeOnConnected(
-    Api::EventConnectedEmitter::IdType id)
-{
-    m_onConnected.detach(id);
-}
-
-void EthernetAdapter::addOnDisconnected(
-    const Api::EventDisconnectedEmitterPtr& emitter)
-{
-    m_onDisconnected.attach(emitter);
-}
-
-void EthernetAdapter::removeOnDisconnected(
-    Api::EventDisconnectedEmitter::IdType id)
-{
-    m_onDisconnected.detach(id);
-}
-
-Api::IAdapter::Type EthernetAdapter::getAdapterType() const
-{
-    return Api::IAdapter::T_ETHERNET;
-}
-} // Networking
-} // WrtDeviceApis
-
diff --git a/src_mobile/modules/tizen/Networking/EthernetAdapter.h b/src_mobile/modules/tizen/Networking/EthernetAdapter.h
deleted file mode 100644 (file)
index 6193531..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * 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.
- */
-/**
- * @author       Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
- */
-
-#ifndef WRTDEVICEAPIS_NETWORKING_ETHERNETADAPTER_H_
-#define WRTDEVICEAPIS_NETWORKING_ETHERNETADAPTER_H_
-
-#include <Networking/IAdapter.h>
-#include <Networking/EventConnected.h>
-#include <Networking/EventDisconnected.h>
-#include <Commons/Emitters.h>
-
-namespace WrtDeviceApis {
-namespace Networking {
-class Manager;
-
-class EthernetAdapter : public Api::IAdapter
-{
-    friend class Manager;
-
-  public:
-    bool isConnected() const /* TODO */
-    {
-        return false;
-    }
-
-    // Api::Networking::IConnectionPtr getConnection() const { /* TODO */ }
-
-    void addOnConnected(
-        const Api::EventConnectedEmitterPtr& emitter);
-
-    void removeOnConnected(Api::EventConnectedEmitter::IdType id);
-
-    void addOnDisconnected(
-        const Api::EventDisconnectedEmitterPtr& emitter);
-
-    void removeOnDisconnected(
-        Api::EventDisconnectedEmitter::IdType id);
-
-    Api::IAdapter::Type getAdapterType() const;
-
-  private:
-    EthernetAdapter();
-
-  private:
-    Commons::Emitters<Api::EventConnectedEmitter> m_onConnected;
-    Commons::Emitters<Api::EventDisconnectedEmitter>
-    m_onDisconnected;
-};
-} // Networking
-} // WrtDeviceApis
-
-#endif // WRTDEVICEAPIS_NETWORKING_ETHERNETADAPTER_H_
diff --git a/src_mobile/modules/tizen/Networking/Manager.cpp b/src_mobile/modules/tizen/Networking/Manager.cpp
deleted file mode 100644 (file)
index 8416b2c..0000000
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * 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 "Manager.h"
-
-//#include <cstddef>
-//#include <NetCMIntf.h>
-//#include <NetPMIntf.h>
-//#include <wlan-engine-client-intf.h>
-//#include <dpl/log/log.h>
-#include "EthernetAdapter.h"
-#include "WifiAdapter.h"
-
-/* TODO - commented source code will be removed */
-//namespace {
-//const std::size_t SSID_MAX_LENGTH = 32;
-//} // anonymous
-
-namespace WrtDeviceApis {
-namespace Networking {
-//net_event_callbacks Manager::m_netEventCallbacks =
-// Manager::getNetEventCallbacks();
-
-Manager& Manager::getInstance()
-{
-    static Manager instance;
-    return instance;
-}
-
-Api::IAdapter* Manager::getAdapter(Api::IAdapter::Type /*type*/) const
-{
-    //TODO: to be implemented
-    return NULL;
-    //  Adapters::const_iterator it = m_adapters.find(type);
-    //  if (it == m_adapters.end()) {
-    //    return NULL;
-    //  }
-    //  return it->second;
-}
-
-void Manager::getAvailableAdapters(Api::AdaptersSet *retSet) const
-{
-    if (retSet) {
-        retSet->insert(retSet->end(), m_adapters.begin(), m_adapters.end());
-    }
-}
-
-//Api::Connections Manager::getConnections() const {
-//  return m_connections;
-//}
-//
-//void Manager::wlanCallback(const wlan_event_type_t* event,
-//                           void* userData,
-//                           void* data)
-//{
-//  LogDebug("--| ENTER");
-//  LogDebug("Event: " << *event);
-//}
-//
-//void Manager::onNetConnectionOpen(const NetErr_t error,
-//                                  const NetDevInfo_t* device,
-//                                  int transportErrorCode,
-//                                  void *userData)
-//{
-//  LogDebug("--| ENTER");
-//
-//}
-//
-//void Manager::onNetConnectionClose(const NetErr_t error,
-//                                   int transportErrorCode,
-//                                   void *userData)
-//{ LogDebug("--| ENTER"); }
-//
-//void Manager::onNetConnectionKill(const NetErr_t error,
-//                                  int transportErrorCode,
-//                                  void *userData)
-//{ LogDebug("--| ENTER"); }
-//
-//void Manager::onNetStatusChange(NetStatusInfo_t* status, void *userData) {
-//  LogDebug("--| ENTER");
-//  LogDebug("Type: " << status->transportType << ", status: " <<
-// status->WiFiStatus);
-//}
-
-Manager::Manager()
-{
-    setupAdapters();
-}
-
-Manager::~Manager()
-{
-    removeAdapters();
-}
-
-void Manager::setupAdapters()
-{
-    //TODO: to be implemented
-    //  Api::IAdapter* adapter = NULL;
-    //
-    //  adapter = new EthernetAdapter();
-    //  m_adapters.insert(Adapters::value_type(Api::IAdapter::T_ETHERNET,
-    // adapter));
-    //
-    //  adapter = new WifiAdapter();
-    //  m_adapters.insert(Adapters::value_type(Api::IAdapter::T_WIFI, adapter));
-}
-
-void Manager::removeAdapters()
-{
-    //TODO: to be implemented
-    //  Adapters::iterator it = m_adapters.begin();
-    //  for (; it != m_adapters.end(); ++it) {
-    //    delete it->second;
-    //  }
-    //  m_adapters.clear();
-}
-
-//void Manager::attachListeners() {
-//  int error = 0;
-//
-//  if ((error = net_register_client(&m_netEventCallbacks, this)) !=
-// NET_ERR_NONE) {
-//    LogError("Could not register to datanetworking module (" << error <<
-// ").");
-//  }
-//
-//  if ((error = wlan_client_register(wlanCallback, this)) != WLAN_ERR_NONE) {
-//    LogError("Could not register to wifi module (" << error << ").");
-//  }
-//}
-//
-//void Manager::detachListeners() {
-//  int error = 0;
-//
-//  if ((error = net_deregister_client()) != NET_ERR_NONE) {
-//    LogError("Could not deregister from datanetworking module (" << error <<
-// ").");
-//  }
-//
-//  if ((error = wlan_client_deregister()) != WLAN_ERR_NONE) {
-//    LogError("Could not deregister from wifi module (" << error << ").");
-//  }
-//}
-
-//void Manager::initConnections() {
-//  int error;
-//  int profile = 0;
-//  char ssid[SSID_MAX_LENGTH + 1] = {0};
-//  if ((error = wlan_client_get_connected_ap_info(&profile, ssid)) ==
-// WLAN_ERR_NONE) {
-//    Adapter* connection = new Adapter();
-//    connection->setType(Api::IAdapter::T_WIFI);
-//    connection->setName(ssid);
-//    m_connections.push_back(connection);
-//  }
-//  else {
-//    LogError("Could not get wlan connection info (" << error << ").");
-//  }
-//}
-//
-//void Manager::clearConnections() {
-//  Api::Connections::iterator it = m_connections.begin();
-//  for (; it != m_connections.end(); ++it) {
-//    delete *it;
-//  }
-//}
-//
-//net_event_callbacks Manager::getNetEventCallbacks() {
-//  net_event_callbacks result = {0};
-//  result.on_open_rsp = Manager::onNetConnectionOpen;
-//  result.on_close_rsp = Manager::onNetConnectionClose;
-//  result.on_kill_rsp = Manager::onNetConnectionKill;
-//  result.on_net_status = Manager::onNetStatusChange;
-//  return result;
-//}
-} // Networking
-} // WrtDeviceApis
diff --git a/src_mobile/modules/tizen/Networking/Manager.h b/src_mobile/modules/tizen/Networking/Manager.h
deleted file mode 100644 (file)
index 0df9a1a..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * 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.
- */
-/**
- * @author       Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
- */
-
-#ifndef WRTDEVICEAPIS_NETWORKING_MANAGER_H_
-#define WRTDEVICEAPIS_NETWORKING_MANAGER_H_
-
-#include <map>
-//extern "C" {
-//  #include <wlan-interface.h>
-//}
-//#include <dpl/mutex.h>
-#include <Networking/IManager.h>
-
-namespace WrtDeviceApis {
-namespace Networking {
-/* TODO - commented source code will be removed */
-class Manager : public Api::IManager
-{
-  public:
-    static Manager& getInstance();
-
-  public:
-    /**
-     * @see Api::IManager::getAdapter()
-     */
-    Api::IAdapter* getAdapter(Api::IAdapter::Type type)
-    const;
-
-    /**
-     * @see Api::IManager::getAvailableAdapters
-     */
-    virtual void getAvailableAdapters(Api::AdaptersSet *retSet)
-    const;
-
-  protected:
-    Manager();
-    virtual ~Manager();
-
-    /**
-     * Initialize adapters available on wac.
-     */
-    void setupAdapters();
-
-    /**
-     * Cleans up adapters.
-     */
-    void removeAdapters();
-
-  private:
-    //  typedef std::map<Api::IAdapter::Type,
-    //                   Api::IAdapter*> Adapters;
-    //private:
-    //  static void wlanCallback(const wlan_event_type_t* event,
-    //                           void* userData,
-    //                           void* data);
-    //
-    //  static void onNetConnectionOpen(const NetErr_t error,
-    //                                  const NetDevInfo_t* device,
-    //                                  int transportErrorCode,
-    //                                  void *userData);
-    //
-    //  static void onNetConnectionClose(const NetErr_t error,
-    //                                   int transportErrorCode,
-    //                                   void *userData);
-    //
-    //  static void onNetConnectionKill(const NetErr_t error,
-    //                                  int transportErrorCode,
-    //                                  void *userData);
-    //
-    //  static void onNetStatusChange(NetStatusInfo_t* status, void *userData);
-    //
-    //  static net_event_callbacks getNetEventCallbacks();
-    //
-    //private:
-    //  static net_event_callbacks m_netEventCallbacks;
-
-  private:
-    //  DPL::Mutex m_mtx; ///< Synchronizes access to this object.
-    //  Adapters m_adapters; ///< Adapters container.
-    Api::AdaptersSet m_adapters;
-};
-} // Networking
-} // WrtDeviceApis
-
-#endif // WRTDEVICEAPIS_NETWORKING_MANAGER_H_
diff --git a/src_mobile/modules/tizen/Networking/WifiAdapter.cpp b/src_mobile/modules/tizen/Networking/WifiAdapter.cpp
deleted file mode 100644 (file)
index 6ad6077..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * 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 "WifiAdapter.h"
-
-namespace WrtDeviceApis {
-namespace Networking {
-WifiAdapter::WifiAdapter()
-{}
-
-void WifiAdapter::addOnConnected(
-    const Api::EventConnectedEmitterPtr& emitter)
-{
-    m_onConnected.attach(emitter);
-}
-
-void WifiAdapter::removeOnConnected(
-    Api::EventConnectedEmitter::IdType id)
-{
-    m_onConnected.detach(id);
-}
-
-void WifiAdapter::addOnDisconnected(
-    const Api::EventDisconnectedEmitterPtr& emitter)
-{
-    m_onDisconnected.attach(emitter);
-}
-
-void WifiAdapter::removeOnDisconnected(
-    Api::EventDisconnectedEmitter::IdType id)
-{
-    m_onDisconnected.detach(id);
-}
-
-Api::IAdapter::Type WifiAdapter::getAdapterType() const
-{
-    return Api::IAdapter::T_WIFI;
-}
-} // Networking
-} // WrtDeviceApis
-
diff --git a/src_mobile/modules/tizen/Networking/WifiAdapter.h b/src_mobile/modules/tizen/Networking/WifiAdapter.h
deleted file mode 100644 (file)
index ebb4245..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * 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.
- */
-/**
- * @author       Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
- */
-
-#ifndef WRTDEVICEAPIS_NETWORKING_WIFIADAPTER_H_
-#define WRTDEVICEAPIS_NETWORKING_WIFIADAPTER_H_
-
-#include <Networking/IAdapter.h>
-#include <Networking/EventConnected.h>
-#include <Networking/EventDisconnected.h>
-#include <Commons/Emitters.h>
-
-namespace WrtDeviceApis {
-namespace Networking {
-class Manager;
-
-class WifiAdapter : public Api::IAdapter
-{
-    friend class Manager;
-
-  public:
-    bool isConnected() const /* TODO */
-    {
-        return false;
-    }
-
-    //Api::Networking::IConnectionPtr getConnection() const { /* TODO */ }
-
-    void addOnConnected(
-        const Api::EventConnectedEmitterPtr& emitter);
-
-    void removeOnConnected(Api::EventConnectedEmitter::IdType id);
-
-    void addOnDisconnected(
-        const Api::EventDisconnectedEmitterPtr& emitter);
-
-    void removeOnDisconnected(
-        Api::EventDisconnectedEmitter::IdType id);
-
-    Api::IAdapter::Type getAdapterType() const;
-
-  private:
-    WifiAdapter();
-
-  private:
-    Commons::Emitters<Api::EventConnectedEmitter> m_onConnected;
-    Commons::Emitters<Api::EventDisconnectedEmitter>
-    m_onDisconnected;
-};
-} // Networking
-} // WrtDeviceApis
-
-#endif // WRTDEVICEAPIS_NETWORKING_WIFIADAPTER_H_
diff --git a/src_mobile/modules/tizen/Networking/config.cmake b/src_mobile/modules/tizen/Networking/config.cmake
deleted file mode 100644 (file)
index cfae99d..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-get_current_path()
-
-pkg_search_module(dnet REQUIRED dnet)
-
-set(INCLUDES_PLATFORM_IMPLEMENTATION_NETWORKING
-  ${dnet_INCLUDE_DIRS}
-  PARENT_SCOPE
-)
-
-set(LIBS_PLATFORM_IMPLEMENTATION_NETWORKING
-  ${dnet_LIBRARIES}
-  PARENT_SCOPE
-)
-
-set(SRCS_IMPLEMENTATION_NETWORKING
-  ${CURRENT_PATH}/Manager.cpp
-  ${CURRENT_PATH}/EthernetAdapter.cpp
-  ${CURRENT_PATH}/WifiAdapter.cpp
-  PARENT_SCOPE
-)
diff --git a/src_mobile/modules/tizen/PluginManager/PluginManager.cpp b/src_mobile/modules/tizen/PluginManager/PluginManager.cpp
deleted file mode 100644 (file)
index 6e2c97c..0000000
+++ /dev/null
@@ -1,265 +0,0 @@
-/*
- * 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        PluginManager.cpp
- * @author      Lukasz Marek (l.marek@samsung.com)
- * @version     0.1
- * @brief
- */
-
-#include "PluginManager.h"
-#include <algorithm>
-#include <dpl/wrt-dao-ro/widget_dao_read_only.h>
-#include <dpl/wrt-dao-ro/plugin_dao_read_only.h>
-#include <dpl/wrt-dao-ro/WrtDatabase.h>
-#include <plugin_logic.h>
-#include <js_types.h>
-#include <dpl/wrt-dao-ro/common_dao_types.h>
-#include <Commons/Exception.h>
-#include <CommonsJavaScript/Converter.h>
-#include <dpl/exception.h>
-#include <dpl/log/secure_log.h>
-#include <dpl/foreach.h>
-
-using namespace std;
-
-namespace {
-const string GLOBAL_OBJECT_NAME = "GLOBAL_OBJECT";
-const char* SEPARATOR = ".";
-}
-
-namespace WrtDeviceApis {
-namespace PluginManager {
-PluginManager::PluginManager(int widgetHandle,
-                             const string &objectUri,
-                             JSObjectRef object,
-                             JSContextRef context) :
-    m_widgetHandle(widgetHandle),
-    m_objectInstance(object),
-    m_objectUri(GLOBAL_OBJECT_NAME),
-    m_shortUri(objectUri),
-    m_context(context)
-{
-    m_objectUri.append(SEPARATOR).append(objectUri);
-    WrtDB::WrtDatabase::attachToThreadRO();
-}
-
-PluginManager::~PluginManager()
-{
-    ObjectList::iterator it = m_objectList.begin();
-    for (; it != m_objectList.end(); ++it) {
-        JSValueUnprotect(m_context, it->second);
-    }
-    WrtDB::WrtDatabase::detachFromThread();
-}
-
-bool PluginManager::hasChild(const string &name) const
-{
-    const PropertyList &prop = getProperties();
-    return prop.end() != find(prop.begin(), prop.end(), name);
-}
-
-bool PluginManager::loadChild(const string &name) const
-{
-    _D("loading %s", name.c_str());
-    string localUri = m_objectUri;
-    localUri.append(SEPARATOR).append(name);
-
-    WrtDB::DbPluginHandle handle =
-        WrtDB::PluginDAOReadOnly::getPluginHandleForImplementedObject(localUri);
-    if (handle == WrtDB::INVALID_PLUGIN_HANDLE) {
-        _E("Plugin not found");
-        return false;
-    }
-
-    WrtDB::DbWidgetFeatureSet features;
-    WrtDB::WidgetType widgetType;
-    Try
-    {
-        WrtDB::WidgetDAOReadOnly dao(m_widgetHandle);
-        features = dao.getFeaturesList();
-        widgetType = dao.getWidgetType();
-    }
-    Catch(WrtDB::WidgetDAOReadOnly::Exception::Base)
-    {
-        // Error while reading database - widget handle may
-        // be invalid or some data may be missing in database
-        _E("Cannot get feature list");
-        return false;
-    }
-
-    if (widgetType == WrtDB::APP_TYPE_TIZENWEBAPP) {
-        JavaScriptObject jsObject = { m_objectInstance,
-                                      m_shortUri };
-        return PluginLogicSingleton::Instance().loadPluginOnDemand(
-                   handle, jsObject, const_cast<JSGlobalContextRef>(m_context));
-    }
-
-    //check does plugin with feature was requested
-    FOREACH(it, features)
-    {
-        if (it->pluginId == handle) {
-            if (it->rejected) {
-                _E("Feature rejected by ACE");
-                continue;
-            }
-
-            JavaScriptObject jsObject = { m_objectInstance,
-                                          m_shortUri };
-
-            return PluginLogicSingleton::Instance().loadPluginOnDemand(
-                       handle, jsObject,
-                       const_cast<JSGlobalContextRef>(m_context));
-        }
-    }
-    _E("Plugin not loaded");
-    return false;
-}
-
-JSValueRef PluginManager::getProperty(const string &name) const
-{
-    _D("getProperty %s", name.c_str());
-    ObjectList::const_iterator it = m_objectList.find(name);
-    if (it != m_objectList.end()) {
-        //return already set value
-        return it->second;
-    }
-
-    if (!loadChild(name)) {
-        ThrowMsg(Commons::PlatformException, "Cannot load plugin");
-    }
-
-    it = m_objectList.find(name);
-    if (it != m_objectList.end()) {
-        //return set value
-        return it->second;
-    }
-
-    ThrowMsg(Commons::PlatformException, "Cannot obtain property");
-}
-
-bool PluginManager::setProperty(const string &name,
-                                JSValueRef value)
-{
-    _D("setProperty %s", name.c_str());
-    if (m_objectList.count(name) > 0) {
-        JSValueUnprotect(m_context, m_objectList[name]);
-    }
-    JSValueProtect(m_context, value);
-    m_objectList[name] = value;
-    return true;
-}
-
-bool PluginManager::deleteProperty(const string &name)
-{
-    if (m_objectList.count(name) > 0) {
-        _D("deleteProperty %s", name.c_str());
-        JSValueUnprotect(m_context, m_objectList[name]);
-        m_objectList.erase(name);
-        return true;
-    }
-    return false;
-}
-
-Api::IPluginManager::PropertyList PluginManager::getProperties() const
-{
-    using namespace WrtDB;
-
-    if (!m_propertyCache.IsNull()) {
-        return *m_propertyCache;
-    }
-
-    m_propertyCache = PropertyList();
-
-    WidgetDAOReadOnly dao(m_widgetHandle);
-    string localUri = m_objectUri + SEPARATOR;
-
-    if (dao.getWidgetType() == APP_TYPE_TIZENWEBAPP)
-    {
-        static ImplementedObjectsList implObjectList =
-            PluginDAOReadOnly::getImplementedObjects();
-
-        FOREACH(it_implObject, implObjectList)
-        {
-            //check if implemented object stats with localUri
-            if (it_implObject->find(localUri) == 0) {
-                string property = *it_implObject;
-                //remove local uri that predicts property name.
-                property.erase(0, localUri.size());
-                //check if property has its own properties.
-                size_t pos = property.find(SEPARATOR);
-                if (pos != string::npos) {
-                    //if so then remove them.
-                    property.erase(pos);
-                }
-
-                m_propertyCache->push_back(property);
-            }
-        }
-    }
-    else
-    {
-        DbWidgetFeatureSet features;
-
-        Try
-        {
-            features = dao.getFeaturesList();
-        }
-        Catch(WidgetDAOReadOnly::Exception::Base)
-        {
-            _E("Cannot get feature list");
-            ReThrow(Commons::PlatformException);
-        }
-
-        DbWidgetFeatureSet::const_iterator feature = features.begin();
-        for (; feature != features.end(); ++feature) {
-            ImplementedObjectsList implObjs =
-                PluginDAOReadOnly::getImplementedObjectsForPluginHandle(
-                    feature->pluginId);
-            FOREACH(it, implObjs) {
-                //check if implemented object stats with localUri
-                if (it->find(localUri) == 0) {
-                    string property = *it;
-                    //remove local uri that predicts property name.
-                    property.erase(0, localUri.size());
-                    //check if property has its own properties.
-                    size_t pos = property.find(SEPARATOR);
-                    if (pos != string::npos) {
-                        //if so then remove them.
-                        property.erase(pos);
-                    }
-                    m_propertyCache->push_back(property);
-                }
-            }
-        }
-    }
-
-    return *m_propertyCache;
-}
-
-void PluginManager::addPropertiesToList(
-    JSPropertyNameAccumulatorRef propertyNames) const
-{
-    PropertyList properties = getProperties();
-    CommonsJavaScript::Converter converter(m_context);
-    FOREACH(it, properties) {
-        JSStringRef name = converter.toJSStringRef(*it);
-        JSPropertyNameAccumulatorAddName(propertyNames, name);
-        JSStringRelease(name);
-    }
-}
-}
-}
diff --git a/src_mobile/modules/tizen/PluginManager/PluginManager.h b/src_mobile/modules/tizen/PluginManager/PluginManager.h
deleted file mode 100644 (file)
index 30b72a3..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * 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        PluginManager.h
- * @author      Lukasz Marek (l.marek@samsung.com)
- * @version     0.1
- * @brief
- */
-
-#ifndef WRTDEVICEAPIS_PLUGINMANAGER_PLUGINMANAGER_H_
-#define WRTDEVICEAPIS_PLUGINMANAGER_PLUGINMANAGER_H_
-
-#include <map>
-#include <string>
-#include <API/PluginManager/IPluginManager.h>
-#include <dpl/optional.h>
-
-namespace WrtDeviceApis {
-namespace PluginManager {
-class PluginManager : public Api::IPluginManager
-{
-  public:
-    PluginManager(int widgetHandle,
-                  const std::string &objectUri,
-                  JSObjectRef object,
-                  JSContextRef context);
-    ~PluginManager();
-    bool hasChild(const std::string &name) const;
-    bool loadChild(const std::string &name) const;
-
-    JSValueRef getProperty(const std::string &name) const;
-    bool setProperty(const std::string &name,
-                     JSValueRef value);
-    bool deleteProperty(const std::string &name);
-
-    PropertyList getProperties() const;
-    void addPropertiesToList(JSPropertyNameAccumulatorRef propertyNames) const;
-
-  private:
-    typedef std::map<std::string, JSValueRef> ObjectList;
-
-    int m_widgetHandle;
-    JSObjectRef m_objectInstance;
-    std::string m_objectUri;
-    std::string m_shortUri;
-    mutable DPL::Optional<PropertyList> m_propertyCache;
-    ObjectList m_objectList;
-    JSContextRef m_context;
-};
-}
-}
-
-#endif
diff --git a/src_mobile/modules/tizen/PluginManager/config.cmake b/src_mobile/modules/tizen/PluginManager/config.cmake
deleted file mode 100644 (file)
index ccf3c80..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-get_current_path()
-
-pkg_search_module(dpl-wrt-dao-ro REQUIRED dpl-wrt-dao-ro)
-#pkg_search_module(wrt-plugin-loading REQUIRED wrt-plugin-loading)
-
-set(INCLUDES_PLATFORM_IMPLEMENTATION_PLUGIN_MANAGER
-  ${dpl-wrt-dao-ro_INCLUDE_DIRS}
-  ${wrt-plugin-loading_INCLUDE_DIRS}
-  ${PLUGIN_LOADING_DIRS}
-  PARENT_SCOPE
-)
-
-set(LIBS_PLATFORM_IMPLEMENTATION_PLUGIN_MANAGER
-  ${dpl-wrt-dao-ro_LIBRARIES}
-  ${wrt-plugin-loading_LIBRARIES}
-  ${TARGET_PLUGIN_LOADING_LIB}
-  PARENT_SCOPE
-)
-
-set(SRCS_PLATFORM_IMPLEMENTATION_PLUGIN_MANAGER
-  ${CURRENT_PATH}/PluginManager.cpp
-  PARENT_SCOPE
-)
diff --git a/src_mobile/modules/tizen/Widget/Property.h b/src_mobile/modules/tizen/Widget/Property.h
deleted file mode 100644 (file)
index d1a19d1..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * 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       Property.h
- * @author     Grzegorz Krawczyk (g.krawczyk@samsung.com)
- * @version    0.1
- * @brief
- */
-
-#ifndef WIDGET_PROPERTY_H_
-#define WIDGET_PROPERTY_H_
-
-#include <string>
-#include <Commons/Exception.h>
-
-namespace WrtDeviceApis {
-namespace Widget {
-template<typename T>
-class Property
-{
-  public:
-    explicit Property() :
-        m_value(),
-        m_valid(false)
-    {}
-
-    void setValue(const T& value)
-    {
-        m_value = value;
-        m_valid = true;
-    }
-
-    T getValue() const
-    {
-        if (!m_valid) {
-            Throw(Commons::PlatformException);
-        }
-        return m_value;
-    }
-
-    bool isValid() const
-    {
-        return m_valid;
-    }
-
-    virtual ~Property()
-    {}
-
-  private:
-    T m_value;
-    bool m_valid;
-};
-
-typedef Property<std::string> StringProperty;
-typedef Property<unsigned int> UIntProperty;
-}
-}
-#endif
diff --git a/src_mobile/modules/tizen/Widget/Widget.cpp b/src_mobile/modules/tizen/Widget/Widget.cpp
deleted file mode 100644 (file)
index d250452..0000000
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * 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       Widget.h
- * @author     Grzegorz Krawczyk (g.krawczyk@samsung.com)
- * @version    0.1
- * @brief
- */
-
-#include <dpl/log/log.h>
-#include <Commons/StringUtils.h>
-#include <Commons/WrtAccess/WrtAccess.h>
-#include "Widget.h"
-#include <WidgetDB/IWidgetDB.h>
-#include <WidgetDB/WidgetDBMgr.h>
-
-namespace WrtDeviceApis {
-namespace Widget {
-using namespace std;
-using namespace WidgetDB::Api;
-
-Widget::Widget()
-{
-    using namespace WrtDeviceApis::Commons;
-    m_widgetId = WrtAccessSingleton::Instance().getWidgetId();
-}
-
-Widget::~Widget()
-{}
-
-string Widget::getProperty(ConfigAttribute attr) const
-{
-    checkWidgetId();
-
-    string value;
-    Try {
-        IWidgetDBPtr widgetDB = getWidgetDB(m_widgetId);
-        value = widgetDB->getConfigValue(attr);
-    }
-    Catch(Commons::InvalidArgumentException){
-        LogError("Invalid argument exception");
-        Throw(Commons::PlatformException);
-    }
-
-    return value;
-}
-
-string Widget::getAuthor() const
-{
-    checkWidgetId();
-
-    if (!m_author.isValid()) {
-        m_author.setValue(getProperty(ConfigAttribute::AUTHOR_NAME));
-    }
-    return m_author.getValue();
-}
-
-string Widget::getAuthorEmail() const
-{
-    checkWidgetId();
-
-    if (!m_authorEmail.isValid()) {
-        m_authorEmail.setValue(getProperty(ConfigAttribute::AUTHOR_EMAIL));
-    }
-    return m_authorEmail.getValue();
-}
-
-string Widget::getAuthorHref() const
-{
-    checkWidgetId();
-
-    if (!m_authorHref.isValid()) {
-        m_authorHref.setValue(getProperty(ConfigAttribute::AUTHOR_HREF));
-    }
-    return m_authorHref.getValue();
-}
-
-string Widget::getDescription() const
-{
-    checkWidgetId();
-
-    if (!m_description.isValid()) {
-        m_description.setValue(getProperty(ConfigAttribute::DESCRIPTION));
-    }
-    return m_description.getValue();
-}
-
-string Widget::getId() const
-{
-    checkWidgetId();
-
-    LogDebug("entered");
-    if (!m_id.isValid()) {
-        m_id.setValue(getProperty(ConfigAttribute::ID));
-    }
-    return m_id.getValue();
-}
-
-string Widget::getName() const
-{
-    checkWidgetId();
-
-    if (!m_name.isValid()) {
-        m_name.setValue(getProperty(ConfigAttribute::NAME));
-    }
-    return m_name.getValue();
-}
-
-string Widget::getShortName() const
-{
-    checkWidgetId();
-
-    if (!m_shortName.isValid()) {
-        m_shortName.setValue(getProperty(ConfigAttribute::SHORT_NAME));
-    }
-    return m_shortName.getValue();
-}
-
-string Widget::getVersion() const
-{
-    checkWidgetId();
-
-    if (!m_version.isValid()) {
-        m_version.setValue(getProperty(ConfigAttribute::VERSION));
-    }
-    return m_version.getValue();
-}
-
-unsigned int Widget::getHeight() const
-{
-    checkWidgetId();
-
-    if (!m_height.isValid()) {
-        m_height.setValue(Commons::String::convertTo<int>(
-                              getProperty(ConfigAttribute::HEIGHT)));
-    }
-    return m_height.getValue();
-}
-
-unsigned int Widget::getWidth() const
-{
-    checkWidgetId();
-
-    if (!m_width.isValid()) {
-        m_width.setValue(Commons::String::convertTo<int>(
-                             getProperty(ConfigAttribute::WIDTH)));
-    }
-    return m_width.getValue();
-}
-
-void Widget::checkWidgetId() const
-{
-    if (m_widgetId < 0) {
-        LogError("Invalid widget id");
-        Throw(Commons::InvalidArgumentException);
-    }
-    return;
-}
-}
-}
diff --git a/src_mobile/modules/tizen/Widget/config.cmake b/src_mobile/modules/tizen/Widget/config.cmake
deleted file mode 100644 (file)
index c4a3adf..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-get_current_path()
-
-set(SRCS_IMPLEMENTATION_WIDGET
-  ${CURRENT_PATH}/Widget.cpp
-  PARENT_SCOPE
-)
diff --git a/src_mobile/modules/tizen/WidgetDB/WidgetDB.cpp b/src_mobile/modules/tizen/WidgetDB/WidgetDB.cpp
deleted file mode 100644 (file)
index 08c3f42..0000000
+++ /dev/null
@@ -1,389 +0,0 @@
-/*
- * 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        WidgetDB.cpp
- * @author      Andrzej Surdej (a.surdej@samsung.com)
- * @version     0.1
- * @brief
- */
-
-#include "WidgetDB.h"
-
-#include <string>
-#include <set>
-
-#include <Commons/Exception.h>
-#include <WidgetDB/IWidgetDB.h>
-#include <WidgetDB/IWidgetFeature.h>
-#include <dpl/wrt-dao-ro/property_dao_read_only.h>
-#include <dpl/wrt-dao-ro/widget_dao_read_only.h>
-#include <dpl/wrt-dao-ro/global_config.h>
-#include <dpl/wrt-dao-ro/widget_config.h>
-#include <dpl/wrt-dao-ro/feature_dao_read_only.h>
-#include <dpl/wrt-dao-ro/widget_dao_read_only.h>
-#include <dpl/wrt-dao-ro/feature_model.h>
-#include <dpl/wrt-dao-ro/common_dao_types.h>
-
-#include <dpl/localization/w3c_file_localization.h>
-
-#include "WidgetFeature.h"
-
-namespace WrtDeviceApis {
-namespace WidgetDB {
-WidgetDB::WidgetDB(int widgetId) : m_widgetId(widgetId) {}
-
-int WidgetDB::getWidgetId() const
-{
-    return m_widgetId;
-}
-
-std::string WidgetDB::getLanguage() const
-{
-    LogDebug("getting language");
-
-    WrtDB::LanguageTagList languageTags;
-    std::string outLanguage;
-    Try
-    {
-        WrtDB::WidgetDAOReadOnly dao(getWidgetId());
-        languageTags = dao.getLanguageTags();
-    }
-    Catch(DPL::Exception)
-    {
-        ReThrow(Commons::SecurityException);
-    }
-
-    // get 'en' language or first from the list if 'en' does not exist
-    if (languageTags.size() > 1) {
-        FOREACH(lang, languageTags)
-        {
-            if ("en" == DPL::ToUTF8String(*lang)) {
-                return "en";
-            }
-        }
-    }
-
-    if (!languageTags.empty()) {
-        // get first language tag
-        outLanguage = DPL::ToUTF8String(*(languageTags.begin()));
-    }
-    return outLanguage;
-}
-
-/*License,LicenseHref,Description,Name can be \
- *  returned with incorect language*/
-std::string WidgetDB::getConfigValue(Api::ConfigAttribute attribute) const
-{
-    LogDebug("entered");
-    std::string value;
-    Try
-    {
-        WrtDB::WidgetDAOReadOnly dao(getWidgetId());
-        WrtDB::WidgetLocalizedInfo widgetInfo =
-            W3CFileLocalization::getLocalizedInfo(getWidgetId());
-
-        std::ostringstream out;
-
-        switch (attribute) {
-        case Api::ConfigAttribute::ID: {
-            DPL::OptionalString val = dao.getGUID();
-            value = !val ? "" : DPL::ToUTF8String(*val);
-            break;
-        }
-
-        case Api::ConfigAttribute::VERSION: {
-            DPL::OptionalString val = dao.getVersion();
-            value = !val ? "" : DPL::ToUTF8String(*val);
-            break;
-        }
-
-        case Api::ConfigAttribute::DESCRIPTION: {
-            DPL::OptionalString val = widgetInfo.description;
-            value = !val ? "" : DPL::ToUTF8String(*val);
-            break;
-        }
-
-        case Api::ConfigAttribute::LICENSE: {
-            DPL::OptionalString val = widgetInfo.license;
-            value = !val ? "" : DPL::ToUTF8String(*val);
-            break;
-        }
-
-        case Api::ConfigAttribute::LICENSE_HREF: {
-            DPL::OptionalString val = widgetInfo.licenseHref;
-            value = !val ? "" : DPL::ToUTF8String(*val);
-            break;
-        }
-
-        case Api::ConfigAttribute::AUTHOR_NAME: {
-            DPL::OptionalString val = dao.getAuthorName();
-            value = !val ? "" : DPL::ToUTF8String(*val);
-            break;
-        }
-
-        case Api::ConfigAttribute::AUTHOR_EMAIL: {
-            DPL::OptionalString val = dao.getAuthorEmail();
-            value = !val ? "" : DPL::ToUTF8String(*val);
-            break;
-        }
-
-        case Api::ConfigAttribute::AUTHOR_HREF: {
-            DPL::OptionalString val = dao.getAuthorHref();
-            value = !val ? "" : DPL::ToUTF8String(*val);
-            break;
-        }
-
-        case Api::ConfigAttribute::NAME: {
-            DPL::OptionalString val = widgetInfo.name;
-            value = !val ? "" : DPL::ToUTF8String(*val);
-            break;
-        }
-
-        case Api::ConfigAttribute::SHORT_NAME: {
-            DPL::OptionalString val = widgetInfo.shortName;
-            value = !val ? "" : DPL::ToUTF8String(*val);
-            break;
-        }
-
-        case Api::ConfigAttribute::ACCESS_NETWORK:
-            value = dao.getAccessNetworkMode() ? "yes" : "no";
-            break;
-
-        case Api::ConfigAttribute::WIDTH: {
-            DPL::OptionalInt width = dao.getPreferredSize().width;
-            !width ? out << "0" : out << *width;
-            value = out.str();
-            break;
-        }
-
-        case Api::ConfigAttribute::HEIGHT: {
-            DPL::OptionalInt height = dao.getPreferredSize().height;
-            !height ? out << "0" : out << *height;
-            value = out.str();
-            break;
-        }
-
-        case Api::ConfigAttribute::INSTALL_PATH:
-            value = DPL::ToUTF8String(dao.getPath());
-            break;
-
-        case Api::ConfigAttribute::PUBLIC_STORAGE_PATH:
-            value = WrtDB::GlobalConfig::GetPublicVirtualRootPath();
-            break;
-
-        default:
-            LogWarning("Unknown attribute requested");
-            Throw(Commons::InvalidArgumentException);
-        }
-    }
-    Catch(Commons::InvalidArgumentException)
-    {
-        ReThrow(Commons::InvalidArgumentException);
-    }
-    Catch(DPL::Exception)
-    {
-        ReThrow(Commons::SecurityException);
-    }
-
-    LogDebug("exit");
-
-    return value;
-}
-
-std::string WidgetDB::getUserAgent() const
-{
-    LogDebug("Widget User_Agent data get");
-
-    std::string outUA("not implemented");
-    return outUA;
-}
-
-Api::InstallationStatus WidgetDB::checkInstallationStatus(
-    const std::string& gid,
-    const std::string& name,
-    const std::string& version) const
-{
-    LogDebug("Checking widget ( gid(" << gid << "), name(" << name <<
-             "), version(" << version << ")) installation status");
-
-    Api::InstallationStatus outStatus;
-    Try
-    {
-        const WrtDB::WidgetGUID w_guid =
-            WrtDB::WidgetGUID(DPL::FromUTF8String(gid));
-
-        try {
-            WrtDB::DbWidgetHandle widgetHandle =
-                WrtDB::WidgetDAOReadOnly::getHandle(w_guid);
-
-            WrtDB::WidgetDAOReadOnly dao(widgetHandle);
-            DPL::OptionalString ver = dao.getVersion();
-            if (!ver || version > DPL::ToUTF8String(*ver)) {
-                // if there is no version in DB
-                // or DB version is lover or equal than provided
-                outStatus = Api::InstallationStatus::STATUS_INSTALLED;
-            } else {
-                outStatus = Api::InstallationStatus::STATUS_LATEST;
-            }
-        } catch (WrtDB::WidgetDAOReadOnly::Exception::WidgetNotExist) {
-            outStatus = Api::InstallationStatus::STATUS_UNINSTALLED;
-        }
-    }
-    Catch(DPL::Exception)
-    {
-        ReThrow(Commons::SecurityException);
-    }
-
-    return outStatus;
-}
-
-Api::Features WidgetDB::getWidgetFeatures() const
-{
-    LogDebug("entered");
-    WrtDB::DbWidgetFeatureSet features;
-    Try
-    {
-        WrtDB::WidgetDAOReadOnly doa(getWidgetId());
-        features = doa.getFeaturesList();
-    }
-    Catch(DPL::Exception)
-    {
-        // exception handle
-        ReThrow(Commons::SecurityException);
-    }
-
-    Api::Features outFeatures;
-
-    LogDebug("There is no exception");
-
-    FOREACH(it, features)
-    {
-        Api::IWidgetFeaturePtr feature(
-            new WidgetFeature(DPL::ToUTF8String((*it).name),
-                              true));      // requested (WidgetFeature param)
-        outFeatures.push_back(feature);
-    }
-
-    return outFeatures;
-}
-
-Api::Features WidgetDB::getRegisteredFeatures() const
-{
-    Api::Features outRegisteredFeatures;
-    Try
-    {
-        // initialize with our widget features (they are required)
-        outRegisteredFeatures = getWidgetFeatures();
-
-        // searching for another features
-
-        WrtDB::FeatureHandleList features =
-            WrtDB::FeatureDAOReadOnly::GetHandleList();
-
-        bool featureFound = false;
-
-        // throught all features
-        FOREACH(registeredFeature, features)
-        {
-            WrtDB::FeatureHandle handle = *registeredFeature;
-            WrtDB::FeatureDAOReadOnly dao(handle);
-
-            // check if this feature is aleready on outRegisteredFeatures list
-            // and if not, add it
-
-            FOREACH(it, outRegisteredFeatures)
-            {
-                if (dao.GetName() == (*it)->getName()) {    // *it = shared ptr
-                    // this name is found on list, do not add
-                    featureFound = true;
-                    break;
-                }
-            }
-
-            if (!featureFound) {
-                // feature is not on outRegisteredFeature so add it with
-                // 'required' property false
-                Api::IWidgetFeaturePtr newFeature(new WidgetFeature(
-                                                      dao.GetName(),
-                                                      false));
-
-                // TODO what about feature params? aren't they needed
-                outRegisteredFeatures.push_back(newFeature);
-            }
-            // reset the flag and check another feature
-            featureFound = false;
-        }
-    }
-    Catch(DPL::Exception)
-    {
-        ReThrow(Commons::SecurityException);
-    }
-
-    return outRegisteredFeatures;
-}
-
-std::string WidgetDB::getWidgetInstallationPath() const
-{
-    Try
-    {
-        WrtDB::WidgetDAOReadOnly dao(getWidgetId());
-        std::string result(DPL::ToUTF8String(dao.getFullPath()));
-        result.erase(0, strlen("file://"));
-        std::string::size_type pos = result.size();
-        std::string separator("/");
-        pos = result.rfind(separator, pos);
-        if ((result.size() - pos) > 0 && (result.size() - pos) < 2) {
-            result.erase(pos, result.size());
-        }
-        return result;
-    }
-    Catch(DPL::Exception)
-    {
-        ReThrow(Commons::PlatformException);
-    }
-}
-
-std::string WidgetDB::getWidgetPersistentStoragePath() const
-{
-    Try
-    {
-        WrtDB::WidgetDAOReadOnly dao(getWidgetId());
-        return
-            WrtDB::WidgetConfig::GetWidgetPersistentStoragePath(
-                dao.getTizenPkgId());
-    }
-    Catch(DPL::Exception)
-    {
-        ReThrow(Commons::PlatformException);
-    }
-}
-
-std::string WidgetDB::getWidgetTemporaryStoragePath() const
-{
-    Try
-    {
-        WrtDB::WidgetDAOReadOnly dao(getWidgetId());
-        return
-            WrtDB::WidgetConfig::GetWidgetTemporaryStoragePath(
-                dao.getTizenPkgId());
-    }
-    Catch(DPL::Exception)
-    {
-        ReThrow(Commons::PlatformException);
-    }
-}
-} // WidgetDB
-} // WrtDeviceApis
diff --git a/src_mobile/modules/tizen/WidgetDB/WidgetFeature.cpp b/src_mobile/modules/tizen/WidgetDB/WidgetFeature.cpp
deleted file mode 100644 (file)
index aee4902..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * 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.
- */
-/*
- * @author      Grzegorz Krawczyk (g.krawczyk@samsung.com)
- * @version     0.1
- * @brief
- */
-
-#include <dpl/log/log.h>
-#include "WidgetFeature.h"
-
-namespace WrtDeviceApis {
-namespace WidgetDB {
-WidgetFeature::WidgetFeature(const std::string& name,
-                             bool requested) :
-    m_name(name),
-    m_requested(requested)
-{
-    //LogDebug("entered");
-}
-
-std::string WidgetFeature::getName() const
-{
-    //LogDebug("entered");
-    return m_name;
-}
-
-WidgetFeature::~WidgetFeature()
-{
-    //LogDebug("entered");
-}
-
-bool WidgetFeature::isRequestedByWidget() const
-{
-    return m_requested;
-}
-} // WidgetDB
-} // WrtDeviceApis
diff --git a/src_mobile/modules/tizen/WidgetDB/WidgetFeature.h b/src_mobile/modules/tizen/WidgetDB/WidgetFeature.h
deleted file mode 100644 (file)
index d14dc69..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * 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.
- */
-/*
- * @author      Grzegorz Krawczyk (g.krawczyk@samsung.com)
- * @version     0.1
- * @brief
- */
-
-#ifndef WRT_PLUGINS_WRT_ENGINE_WIDGET_FEATURE_H_
-#define WRT_PLUGINS_WRT_ENGINE_WIDGET_FEATURE_H_
-
-#include <string>
-#include <WidgetDB/IWidgetFeature.h>
-
-namespace WrtDeviceApis {
-namespace WidgetDB {
-class WidgetFeature : public Api::IWidgetFeature
-{
-  public:
-    WidgetFeature(const std::string& name,
-                  bool requested);
-
-    std::string getName() const;
-
-    virtual ~WidgetFeature();
-
-    virtual bool isRequestedByWidget() const;
-
-  private:
-    std::string m_name;
-    bool m_requested;
-};
-} // WidgetDB
-} // WrtDeviceApis
-
-#endif
diff --git a/src_mobile/modules/tizen/WidgetDB/config.cmake b/src_mobile/modules/tizen/WidgetDB/config.cmake
deleted file mode 100644 (file)
index 6362668..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-get_current_path()
-
-pkg_search_module(dpl-wrt-dao-ro REQUIRED dpl-wrt-dao-ro)
-pkg_search_module(dpl-utils-efl REQUIRED dpl-utils-efl)
-
-set(INCLUDES_PLATFORM_IMPLEMENTATION_WIDGETDB
-  ${dpl-wrt-dao-ro_INCLUDE_DIRS}
-  ${dpl-utils-efl_INCLUDE_DIRS}
-  PARENT_SCOPE
-)
-
-set(LIBS_PLATFORM_IMPLEMENTATION_WIDGETDB
-  ${dpl-wrt-dao-ro_LDFLAGS}
-  ${dpl-utils-efl_LDFLAGS}
-  PARENT_SCOPE
-)
-
-set(SRCS_PLATFORM_IMPLEMENTATION_WIDGETDB
-  ${CURRENT_PATH}/WidgetDB.cpp
-  ${CURRENT_PATH}/WidgetFeature.cpp
-  PARENT_SCOPE
-)
diff --git a/src_mobile/modules/tizen/WidgetInterface/CMakeLists.txt b/src_mobile/modules/tizen/WidgetInterface/CMakeLists.txt
deleted file mode 100644 (file)
index 883f3d1..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-
-get_current_path()
-
-pkg_search_module(wrt-commons-widget-interface-dao REQUIRED wrt-commons-widget-interface-dao)
-
-include_directories(${CURRENT_PATH})
diff --git a/src_mobile/modules/tizen/WidgetInterface/WidgetInterface.cpp b/src_mobile/modules/tizen/WidgetInterface/WidgetInterface.cpp
deleted file mode 100644 (file)
index cfd9c8c..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * 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.
- */
-/*
- * @author      Lukasz Marek (l.marek@samsung.com)
- * @version     0.1
- * @brief
- */
-
-#include "WidgetInterface.h"
-#include <string>
-#include <dpl/exception.h>
-#include <dpl/log/log.h>
-#include <dpl/optional.h>
-#include <dpl/string.h>
-#include <wrt-commons/widget-interface-dao/widget_interface_dao.h>
-#include <Commons/Exception.h>
-
-namespace WrtDeviceApis {
-using namespace WidgetInterfaceDB;
-
-WidgetInterfaceObject::WidgetInterfaceObject(int widgetHandle)
-{
-    Try
-    {
-        m_dao.reset(new WidgetInterfaceDAO(widgetHandle));
-    }
-    Catch(WidgetInterfaceDAO::Exception::DatabaseError)
-    {
-        ReThrow(Commons::PlatformException);
-    }
-}
-
-WidgetInterfaceObject::~WidgetInterfaceObject()
-{
-    m_dao.reset();
-}
-
-void WidgetInterfaceObject::setItem(const std::string& key,
-                                    const std::string& value,
-                                    bool readOnly)
-{
-    Try
-    {
-        m_dao->setItem(key, value, readOnly);
-    }
-    Catch(WidgetInterfaceDAO::Exception::DatabaseError)
-    {
-        ReThrow(Commons::PlatformException);
-    }
-    Catch(WidgetInterfaceDAO::Exception::LocalStorageValueNoModifableException)
-    {
-        LogError("Cannot delete item. Item is readonly");
-        ReThrow(Commons::LocalStorageValueNoModifableException);
-    }
-}
-
-void WidgetInterfaceObject::removeItem(const std::string& key)
-{
-    Try
-    {
-        m_dao->removeItem(key);
-    }
-    Catch(WidgetInterfaceDAO::Exception::DatabaseError)
-    {
-        ReThrow(Commons::PlatformException);
-    }
-    Catch(WidgetInterfaceDAO::Exception::LocalStorageValueNoModifableException)
-    {
-        LogError("Cannot delete item. Item is readonly");
-        ReThrow(Commons::LocalStorageValueNoModifableException);
-    }
-}
-
-DPL::Optional<std::string> WidgetInterfaceObject::getValue(
-    const std::string& key) const
-{
-    Try
-    {
-        return m_dao->getValue(key);
-    }
-    Catch(WidgetInterfaceDAO::Exception::DatabaseError)
-    {
-        ReThrow(Commons::PlatformException);
-    }
-}
-
-void WidgetInterfaceObject::clear(bool removeReadOnly)
-{
-    Try
-    {
-        m_dao->clear(removeReadOnly);
-    }
-    Catch(WidgetInterfaceDAO::Exception::DatabaseError)
-    {
-        ReThrow(Commons::PlatformException);
-    }
-}
-
-size_t WidgetInterfaceObject::getStorageSize() const
-{
-    Try
-    {
-        return m_dao->getStorageSize();
-    }
-    Catch(WidgetInterfaceDAO::Exception::DatabaseError)
-    {
-        ReThrow(Commons::PlatformException);
-    }
-}
-
-std::string WidgetInterfaceObject::getKeyByIndex(size_t index) const
-{
-    Try
-    {
-        return m_dao->getKeyByIndex(index);
-    }
-    Catch(WidgetInterfaceDAO::Exception::DatabaseError)
-    {
-        ReThrow(Commons::PlatformException);
-    }
-    Catch(WidgetInterfaceDAO::Exception::InvalidArgumentException)
-    {
-        ReThrow(Commons::InvalidArgumentException);
-    }
-}
-}
diff --git a/src_mobile/modules/tizen/WidgetInterface/WidgetInterface.h b/src_mobile/modules/tizen/WidgetInterface/WidgetInterface.h
deleted file mode 100644 (file)
index 1dacf49..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * 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.
- */
-/*
- * @author      Lukasz Marek (l.marek@samsung.com)
- * @version     0.1
- * @brief
- */
-
-#ifndef WRTDEVICEAPIS_COMMONS_WIDGET_INTERFACE_H_
-#define WRTDEVICEAPIS_COMMONS_WIDGET_INTERFACE_H_
-
-#include <string>
-#include <dpl/optional.h>
-#include <wrt-commons/widget-interface-dao/widget_interface_dao.h>
-#include <LocalStorage/ILocalStorage.h>
-
-namespace WrtDeviceApis {
-class WidgetInterfaceObject :
-    public LocalStorage::Api::ILocalStorage
-{
-  public:
-    WidgetInterfaceObject(int widgetHandle);
-    virtual ~WidgetInterfaceObject();
-
-    void setItem(const std::string& key,
-                 const std::string& value,
-                 bool readOnly);
-    void removeItem(const std::string& key);
-    DPL::Optional<std::string> getValue(const std::string& key) const;
-    void clear(bool removeReadOnly);
-    size_t getStorageSize() const;
-    std::string getKeyByIndex(size_t index) const;
-
-  private:
-    WidgetInterfaceDB::WidgetInterfaceDAOPtr m_dao;
-};
-}
-
-#endif //WRTDEVICEAPIS_COMMONS_WIDGET_INTERFACE_H_
diff --git a/src_mobile/modules/tizen/WidgetInterface/config.cmake b/src_mobile/modules/tizen/WidgetInterface/config.cmake
deleted file mode 100644 (file)
index a69d23e..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-
-get_current_path()
-
-set(WIDGET_INTERFACE_INCLUDE_DIRS
-    ${CURRENT_PATH}
-    PARENT_SCOPE
-)
-
-SET(API_WIDGET_INTERFACE_PATH
-    ${CURRENT_PATH}
-    PARENT_SCOPE
-)
-
-set(SRCS_WIDGET_INTERFACE
-    ${CURRENT_PATH}/WidgetInterface.cpp
-    PARENT_SCOPE
-)
diff --git a/src_mobile/modules/tizen/config.cmake b/src_mobile/modules/tizen/config.cmake
deleted file mode 100644 (file)
index 82b25da..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-include_config_file(Widget)\r
-include_config_file(StorageEvent)\r
-include_config_file(LocalStorage)
\ No newline at end of file
diff --git a/src_mobile/plugin-loading/explorer.cpp b/src_mobile/plugin-loading/explorer.cpp
deleted file mode 100644 (file)
index a36aecc..0000000
+++ /dev/null
@@ -1,386 +0,0 @@
-/*
- * 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    explorer.cpp
- * @author  Grzegorz Krawczyk (g.krawczyk@samgsung.com)
- * @author  Yunchan Cho (yunchan.cho@samgsung.com)
- * @version
- * @brief
- */
-
-#include <algorithm>
-#include <dpl/foreach.h>
-#include <dpl/log/secure_log.h>
-#include "explorer.h"
-#include "plugin_property_support.h"
-
-// JS overlay
-#include <js_overlay_types.h>
-
-namespace {
-//const char* SEPARATOR = ".";
-const std::string GLOBAL_OBJECT_NAME = "GLOBAL_OBJECT";
-}
-
-using namespace std;
-using namespace PluginModule;
-using namespace WrtPlugins::W3C;
-
-Explorer::Explorer(JSGlobalContextRef context) :
-    m_context(context)
-{
-    if (!context) {
-        _W("Context is NULL");
-        return;
-    }
-
-    m_globalObject =
-        JavaScriptInterfaceSingleton::Instance().getGlobalObject(context);
-
-    //register main frame;
-    m_iframeSupport.registerIframe(m_globalObject);
-
-    m_propertySupport.reset(new WindowPropertySupport(m_context));
-}
-
-Explorer::~Explorer()
-{
-}
-
-JSObjectPtr Explorer::getJSObjectProperty(const std::string& propertyName,
-                                          JSObjectPtr object)
-{
-    return JavaScriptInterfaceSingleton::Instance().getJSObjectProperty(
-               m_context, object, propertyName);
-}
-
-JSObjectPtr Explorer::getProperty(
-    const string& requestedProperty,
-    JSObjectPtr providedObject)
-{
-    _D("Requested Property: %s", requestedProperty.c_str());
-
-    if (!providedObject) {
-        _W("Provided object is empty");
-        return JSObjectPtr();
-    }
-
-    std::string currentObjectName;
-    std::string currentPropertyRequested = requestedProperty;
-    JSObjectPtr currentObject = providedObject;
-
-    while (true) {
-        auto pos = currentPropertyRequested.find(".");
-        if (pos == string::npos) {
-            return getJSObjectProperty(currentPropertyRequested, currentObject);
-        }
-
-        //check if requested object has child
-        currentObjectName = currentPropertyRequested.substr(0, pos);
-
-        if (currentPropertyRequested.size() <= pos + 1) {
-            _W("Wrong name of requested property");
-            return JSObjectPtr();
-        }
-        currentPropertyRequested = currentPropertyRequested.substr(pos + 1);
-
-        currentObject = getJSObjectProperty(currentObjectName, currentObject);
-        if (!currentObject) {
-            _W("Failed to get property: %s", currentObjectName.c_str());
-            return JSObjectPtr();
-        }
-    }
-}
-
-bool Explorer::registerObject(const JSObjectDeclarationPtr& declaration,
-                              JSGlobalContextRef context)
-{
-    bool retValue;
-
-    if (declaration->getParentName() == GLOBAL_OBJECT_NAME) {
-        retValue = register_(declaration, m_globalObject, context);
-    } else { //PIM support
-        //it should be master object name
-        string masterName = declaration->getParentName();
-        auto pos = masterName.find(".");
-        if (string::npos != pos) {
-            _W("ParentName not allowed");
-            return false;
-        }
-        auto masterObject = getJSObjectProperty(masterName, m_globalObject);
-        if (masterObject->getObject() == 0) {
-            return false;
-        }
-        retValue = registerObject(declaration,
-                                  masterName,
-                                  masterObject,
-                                  context);
-    }
-
-    if (declaration->checkIframesSupported()) {
-        m_iframeSupport.registerDeclaration(declaration);
-        //        m_iframeSupport.invokeCallbackForMainFrame(m_context,
-        //                                                   declaration,
-        //                                                   newObject);
-    }
-
-    return retValue;
-}
-
-bool Explorer::registerObject(const JSObjectDeclarationPtr& declaration,
-                              const std::string& providedObjectName,
-                              JSObjectPtr providedObject,
-                              JSGlobalContextRef context)
-{
-    _D("%s <- %s", providedObjectName.c_str(), declaration->getName().c_str());
-    std::string fullParentName = declaration->getParentName();
-
-    if (fullParentName == providedObjectName) {
-        \r_D("Provided object was matched!!");
-        return register_(declaration, providedObject, context);
-    }
-
-    //check if object exists in fullParentName
-    auto pos = fullParentName.find(providedObjectName);
-    if (pos == string::npos) {
-        _W("Object: %s should be child of: %s but you provided object: %s",
-           declaration->getName().c_str(),
-           declaration->getParentName().c_str(),
-           providedObjectName.c_str());
-        return false;
-    }
-
-    if (fullParentName.size() <= pos + providedObjectName.size() + 1) {
-        _W("Invalid object name");
-        return false;
-    }
-
-    auto currentRequesteProperty =
-        fullParentName.substr(pos + providedObjectName.size() + 1);
-
-    JSObjectPtr jsObject = getProperty(
-            currentRequesteProperty, providedObject);
-
-    if (!jsObject->getObject()) {
-        _W("Object: %s should be child of: %s. you provided object: %s but object is null",
-           declaration->getName().c_str(),
-           declaration->getParentName().c_str(),
-           providedObjectName.c_str());
-        return false;
-    }
-
-    return register_(declaration, jsObject, context);
-}
-
-bool Explorer::register_(const JSObjectDeclarationPtr& declaration,
-                         JSObjectPtr parent,
-                         JSGlobalContextRef context)
-{
-    _D("Registration object: %s <- %s",
-       declaration->getParentName().c_str(),
-       declaration->getName().c_str());
-    Assert(parent && "parent object is NULL");
-
-    typedef JSObjectDeclaration::Options JO;
-
-    JSGlobalContextRef gContext = (context == NULL) ? m_context : context;
-    JSObjectPtr objectInstance = JavaScriptInterfaceSingleton::Instance().
-            createObject(gContext, declaration);
-
-    JavaScriptInterfaceSingleton::Instance().setObjectProperty(
-        gContext,
-        parent,
-        declaration->getName(),
-        objectInstance);
-
-    //notice
-    if (declaration->getOptions() &&
-        (declaration->getOptions()->getIframeNotice() ==
-         JO::IFrameNotice::AlwaysNotice))
-    {
-        declaration->getOptions()->invokeCallback(gContext,
-                                                  parent->getObject(),
-                                                  objectInstance->getObject());
-    }
-
-    return true;
-}
-
-void Explorer::registerObjectIntoIframe(
-    const JSObjectDeclarationPtr& declaration,
-    JSObjectPtr frameObject,
-    JSGlobalContextRef context)
-{
-    if (declaration->getParentName() == GLOBAL_OBJECT_NAME) {
-        _D("Connect to Global object of IFRAME");
-        register_(declaration, frameObject, context);
-        return;
-    }
-
-    //PIM SUPPORT
-    {
-        _D("Connect to NOT global object of IFRAME");
-        //it should be master object name
-        string masterName = declaration->getParentName();
-        auto pos = masterName.find(".");
-        if (string::npos != pos) {
-            _W("ParentName not allowed");
-            return;
-        }
-        auto masterObject = getJSObjectProperty(masterName, frameObject);
-        if (!masterObject->getObject()) {
-            _W("Object not exist in frame");
-            return;
-        }
-        register_(declaration, masterObject, context);
-    }
-}
-
-void Explorer::loadFrame(JSGlobalContextRef context)
-{
-    JSObjectPtr frameObject =
-        JavaScriptInterfaceSingleton::Instance().getGlobalObject(context);
-
-    if (frameObject->getObject() == m_globalObject->getObject()) {
-        // Main page was already loaded from constructor
-        _W("Main page loaded");
-        return;
-    }
-
-    m_iframeSupport.registerIframe(frameObject);
-
-    auto iframeObjects = m_iframeSupport.getIframeObjects();
-
-    FOREACH(object, iframeObjects)
-    {
-        _D("Register object: %s", (*object)->getName().c_str());
-        registerObjectIntoIframe(*object, frameObject, context);
-    }
-}
-
-void Explorer::unloadFrame(JSGlobalContextRef context)
-{
-    JSObjectPtr frameObject =
-        JavaScriptInterfaceSingleton::Instance().getGlobalObject(context);
-    m_iframeSupport.unregisterIframe(frameObject);
-}
-
-void Explorer::removePluginsFromIframes()
-{
-    if (m_iframeSupport.hasIframes()) {
-        JavaScriptInterfaceSingleton::Instance().removeIframes(m_context);
-    }
-}
-
-void Explorer::deregisterObject(const JSObjectDeclarationPtr& declaration)
-{
-    if (GLOBAL_OBJECT_NAME != declaration->getParentName()) {
-        _W("Ignored remove property %s", declaration->getName().c_str());
-        return;
-    }
-
-    JavaScriptInterfaceSingleton::Instance().
-        removeObjectProperty(m_context,
-                             m_globalObject,
-                             declaration->getName());
-}
-
-void Explorer::cleanIframesData()
-{
-    m_iframeSupport.clean();
-}
-
-void Explorer::callEventListeners(CustomEventType /*eventType*/, void* /*data*/)
-{
-#if 0 // deprecated
-    using namespace WrtPlugins::Tizen;
-    // get iframe objects from javascript global context
-    JavaScriptInterface::ObjectsListPtr frameLists =
-        JavaScriptInterfaceSingleton::Instance().getIframesList(m_context);
-
-    // get main frame object from javascript global context
-    JSObjectRef mainFrame = JSContextGetGlobalObject(m_context);
-    frameLists->push_back(JSObjectPtr(new JSObject(mainFrame)));
-
-    if (eventType == ServiceCustomEvent) {
-        using namespace WrtDeviceApis::TizenServiceEvent::Api;
-        // set user data of js callback function for 'appservice' js event
-        ITizenServiceEventPtr event = ITizenServiceEventPtr(
-                new TizenServiceEvent());
-        event->setScale(m_propertySupport->getScale());
-        event->setBundle(m_propertySupport->getBundle());
-
-        // call js callback function for 'appservice' js event on each frame
-        FOREACH(it, *frameLists)
-        {
-            JSObjectRef frame = static_cast<JSObjectRef>((*it).Get()->getObject());
-
-            auto eventPriv =
-                new JSTizenServiceEventPrivateObject(m_context, event);
-            JSObjectRef eventObject =
-                JSObjectMake(m_context,
-                             JSTizenServiceEvent::getClassRef(), eventPriv);
-
-            AddEventListenerSupport::CallCustomEventListenersFromIFrame(
-                frame, eventType, eventObject);
-        }
-    } else if (eventType == SoftKeyboardChangeCustomEvent) {
-        using namespace WrtDeviceApis::SoftKeyboardChangeEvent::Api;
-        if (!data) {
-            LogDebug("no ime size");
-            return;
-        }
-
-        // set user data of js callback function for 'softkeyboardchange' js
-        // event
-        SoftKeyboardChangeArgs* args =
-            static_cast<SoftKeyboardChangeArgs *>(data);
-        ISoftKeyboardChangeEventPtr event =
-            ISoftKeyboardChangeEventPtr(
-                new SoftKeyboardChangeEvent(
-                    args->state,
-                    args->width,
-                    args->height));
-        LogDebug("softkeyboard event's state: " << args->state);
-
-        // call js callback function for 'softkeyboardchange' js event on each
-        // frame
-        FOREACH(it, *frameLists)
-        {
-            JSObjectRef frame = static_cast<JSObjectRef>((*it).Get()->getObject());
-
-            auto eventPriv =
-                new JSSoftKeyboardChangeEventPrivateObject(m_context, event);
-            JSObjectRef eventObject =
-                JSObjectMake(
-                    m_context,
-                    JSSoftKeyboardChangeEvent::getClassRef(),
-                    eventPriv);
-
-            AddEventListenerSupport::CallCustomEventListenersFromIFrame(
-                frame, eventType, eventObject);
-        }
-    } else {
-        LogDebug("Not supported custom event type");
-        return;
-    }
-#endif
-}
-
-WindowPropertySupport* Explorer::getWindowPropertySupport()
-{
-    return m_propertySupport.get();
-}
diff --git a/src_mobile/plugin-loading/javascript_interface.cpp b/src_mobile/plugin-loading/javascript_interface.cpp
deleted file mode 100644 (file)
index 5dc8f9f..0000000
+++ /dev/null
@@ -1,431 +0,0 @@
-/*
- * 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        plugin_webkit.h
- * @author      Przemyslaw Dobrowolski (p.dobrowolsk@samsung.com)
- * @version     1.0
- * @brief       This file is the implementation file of webkit js plugin
- *              accessing routines in EFL
- */
-#include <javascript_interface.h>
-#include <dpl/log/secure_log.h>
-#include <dpl/scoped_array.h>
-#include <vector>
-#include <dpl/singleton_impl.h>
-#include <string>
-#include <dpl/foreach.h>
-#include <dpl/noncopyable.h>
-#include <JavaScriptCore/JavaScript.h>
-#include <JavaScriptCore/JSObjectRef.h>
-
-IMPLEMENT_SINGLETON(JavaScriptInterface)
-
-#define CHECK_JSVALUE_IS_UNDEFINED_RETURN(context, object, ret) \
-    if (JSValueIsUndefined(context, object)) { \
-        _E("Object %s is undefined", #object); \
-        return ret; \
-    }
-
-#define CHECK_JSOBJECT_IS_NULL_RETURN(object, ret) \
-    if (!object) { \
-        _E("Object %s is NULL", #object); \
-        return ret; \
-    }
-
-namespace {
-/**
- * Converts JSStringRef to std::string
- * */
-std::string toString(const JSStringRef& arg)
-{
-    Assert(arg);
-    std::string result;
-    size_t jsSize = JSStringGetMaximumUTF8CStringSize(arg);
-    if (jsSize > 0) {
-        ++jsSize;
-        DPL::ScopedArray<char> buffer(new char[jsSize]);
-        size_t written = JSStringGetUTF8CString(arg, buffer.Get(), jsSize);
-        if (written > jsSize) {
-            _E("Conversion could not be fully performed.");
-            return std::string();
-        }
-        result = buffer.Get();
-    }
-
-    return result;
-}
-
-/**
- * Converts JSValueRef to std::string
- * */
-std::string toString(JSContextRef ctx, JSValueRef value)
-{
-    Assert(ctx && value);
-    std::string result;
-    JSStringRef str = JSValueToStringCopy(ctx, value, NULL);
-    result = toString(str);
-    JSStringRelease(str);
-    return result;
-}
-
-JSValueRef getProperty(JSContextRef ctx, JSValueRef value, const char* name)
-{
-    Assert(ctx && value && name);
-    JSValueRef result = NULL;
-    JSObjectRef obj = JSValueToObject(ctx, value, NULL);
-    if (obj) {
-        JSStringRef str = JSStringCreateWithUTF8CString(name);
-        result = JSObjectGetProperty(ctx, obj, str, NULL);
-        JSStringRelease(str);
-    }
-    return result;
-}
-
-JSValueRef getPropertyObj(JSContextRef ctx, JSObjectRef obj, const char* name)
-{
-    Assert(ctx && obj && name);
-    JSStringRef str = JSStringCreateWithUTF8CString(name);
-    JSValueRef result = JSObjectGetProperty(ctx, obj, str, NULL);
-    JSStringRelease(str);
-    return result;
-}
-
-JSObjectRef getJSGlobalObject(JSGlobalContextRef context)
-{
-    return JSContextGetGlobalObject(context);
-}
-}
-
-typedef JSValueRef (*JSCFunction)(
-    JSContextRef context,
-    JSObjectRef object,
-    JSObjectRef thisObject,
-    size_t argumentCount,
-    const JSValueRef arguments[],
-    JSValueRef* exception);
-
-void JavaScriptInterface::setObjectProperty(JSGlobalContextRef context,
-                                            const JSObjectPtr& parentObject,
-                                            const std::string &propertyName,
-                                            const JSObjectPtr& propertyObject)
-{
-    _D("JSObjectSetProperty(%p, \"%s\")", context, propertyName.c_str());
-
-    //create name
-    JSStringRef name = JSStringCreateWithUTF8CString(propertyName.c_str());
-    //set property
-    JSObjectSetProperty(
-        static_cast<JSGlobalContextRef>(context),
-        static_cast<JSObjectRef>(parentObject->getObject()), name,
-        static_cast<JSObjectRef>(propertyObject->getObject()),
-        kJSPropertyAttributeReadOnly, 0);
-
-    JSStringRelease(name);
-}
-
-void JavaScriptInterface::removeObjectProperty(JSGlobalContextRef context,
-                                               const JSObjectPtr& parentObject,
-                                               const std::string &propertyName)
-{
-    if (!context) {
-        //nothing to do -> no context
-        return;
-    }
-    _D("JSObjectDeleteProperty(%p, \"%s\")", context, propertyName.c_str());
-
-    JSStringRef name = JSStringCreateWithUTF8CString(propertyName.c_str());
-    JSObjectDeleteProperty(
-        static_cast<JSGlobalContextRef>(context),
-        static_cast<JSObjectRef>(parentObject->getObject()), name, 0);
-
-    JSStringRelease(name);
-}
-
-JavaScriptInterface::PropertiesList JavaScriptInterface::
-    getObjectPropertiesList(
-    JSGlobalContextRef context,
-    const JSObjectPtr& object) const
-{
-    PropertiesList result;
-    JSPropertyNameArrayRef properties = JSObjectCopyPropertyNames(
-            static_cast<JSGlobalContextRef>(context),
-            static_cast<JSObjectRef>(object->getObject()));
-    std::size_t count = JSPropertyNameArrayGetCount(properties);
-    result.reserve(count);
-    _D("propesties count %d", count);
-    for (std::size_t i = 0; i < count; ++i) {
-        JSStringRef property = JSPropertyNameArrayGetNameAtIndex(properties, i);
-        result.push_back(toString(property));
-    }
-    JSPropertyNameArrayRelease(properties);
-    return result;
-}
-
-JSObjectPtr JavaScriptInterface::makeJSFunctionObject(
-    JSGlobalContextRef context,
-    const std::string &name,
-    js_function_impl functionImplementation) const
-{
-    _D("JSObjectMakeFunctionWithCallback(%p, \"%s\")", context, name.c_str());
-    JSStringRef jsFunName = JSStringCreateWithUTF8CString(name.c_str());
-
-    JSObjectRef object = JSObjectMakeFunctionWithCallback(
-            context,
-            jsFunName,
-            reinterpret_cast<JSObjectCallAsFunctionCallback>(
-                functionImplementation));
-
-    JSStringRelease(jsFunName);
-    return JSObjectPtr(new JSObject(static_cast<void*>(object)));
-}
-
-JSObjectPtr JavaScriptInterface::makeJSClassObject(
-    JSGlobalContextRef context,
-    JSObjectDeclaration::ConstClassTemplate classTemplate) const
-{
-    _D("JSObjectMake(%p)", context);
-    JSObjectRef object = JSObjectMake(
-            context,
-            static_cast<JSClassRef>(
-                const_cast<JSObjectDeclaration::ClassTemplate>(classTemplate)),
-            NULL);
-    return JSObjectPtr(new JSObject(object));
-}
-
-JSObjectPtr JavaScriptInterface::makeJSObjectBasedOnInterface(
-    JSGlobalContextRef context,
-    const std::string &interfaceName) const
-{
-    _D("makeJSObjectBasedOnInterface(%p, \"%s\")", context, interfaceName.c_str());
-    JSObjectPtr jsInterfaceObj = getJSObjectProperty(context,
-                                                     getGlobalObject(
-                                                         context),
-                                                     interfaceName);
-    JSObjectRef object = JSObjectCallAsConstructor(context,
-                                                   static_cast<JSObjectRef>(
-                                                       jsInterfaceObj->
-                                                           getObject()), 0,
-                                                   NULL,
-                                                   NULL);
-    return JSObjectPtr(new JSObject(static_cast<void*>(object)));
-}
-
-JSObjectPtr JavaScriptInterface::makeJSInterface(
-    JSGlobalContextRef context,
-    JSObjectDeclaration::ConstClassTemplate classTemplate,
-    JSObjectDeclaration::ConstructorCallback constructorCallback) const
-{
-    _D("makeJSInterface(%p)", context);
-    JSObjectRef object = JSObjectMakeConstructor(context,
-                                                 static_cast<JSClassRef>(
-                                                     const_cast<
-                                                         JSObjectDeclaration::
-                                                             ClassTemplate>(
-                                                         classTemplate)),
-                                                 reinterpret_cast<
-                                                     JSObjectCallAsConstructorCallback>(
-                                                     constructorCallback)
-                                                 );
-    return JSObjectPtr(new JSObject(static_cast<void*>(object)));
-}
-
-JSObjectPtr JavaScriptInterface::createObject(
-    JSGlobalContextRef context,
-    const JSObjectDeclarationPtr&
-    declaration)
-{
-    typedef JSObjectDeclaration::Options JO;
-
-    if (declaration->getOptions()) {
-        switch (declaration->getOptions()->getType()) {
-        case JO::ClassType::Function:
-            return makeJSFunctionObject(
-                       context,
-                       declaration->getName(),
-                       declaration->getOptions()->getFunctionImpl());
-
-        case JO::ClassType::Class:
-            if (declaration->getInterfaceName().empty()) {
-                return makeJSClassObject(
-                           context,
-                           declaration->getClassTemplate());
-            } else {
-                return makeJSObjectBasedOnInterface(
-                           context,
-                           declaration->getInterfaceName());
-            }
-
-        case JO::ClassType::Interface:
-            return makeJSInterface(
-                       context,
-                       /* product class template */
-                       declaration->getClassTemplate(),
-                       declaration->getConstructorCallback());
-
-        default:
-            _E("Invalid class type. Making empty JS object.");
-            return JSObjectPtr(new JSObject(
-                                   JSObjectMake(context, NULL, NULL)));
-        }
-    } else {
-        _D("No declaration options");
-        return JSObjectPtr(new JSObject(
-                               JSObjectMake(
-                                   context,
-                                   static_cast<JSClassRef>(
-                                       const_cast<JSObjectDeclaration::
-                                                      ClassTemplate>(
-                                           declaration->getClassTemplate())),
-                                   NULL)));
-    }
-}
-
-JSObjectPtr JavaScriptInterface::getGlobalObject(JSGlobalContextRef context)
-const
-{
-    return JSObjectPtr(new JSObject(static_cast<JSObject::RealObject>(
-                                        JSContextGetGlobalObject(static_cast<
-                                                                     JSGlobalContextRef>(
-                                                                     context)))));
-}
-
-JSObjectPtr JavaScriptInterface::copyObjectToIframe(
-    JSGlobalContextRef context,
-    const JSObjectPtr& iframe,
-    const std::string& name)
-{
-    _D("copyObjectToIframe(%s)", name.c_str());
-
-    JSGlobalContextRef jsGlobalContext =
-        static_cast<JSGlobalContextRef>(context);
-
-    JSObjectRef globalObject = JSContextGetGlobalObject(jsGlobalContext);
-
-    JSValueRef requestedObject = getPropertyObj(jsGlobalContext,
-                                                globalObject,
-                                                name.c_str());
-    CHECK_JSVALUE_IS_UNDEFINED_RETURN(jsGlobalContext,
-                                      requestedObject,
-                                      JSObjectPtr());
-
-    JSStringRef requestedObjectStr =
-        JSStringCreateWithUTF8CString(name.c_str());
-
-    JSObjectSetProperty(jsGlobalContext,
-                        static_cast<JSObjectRef>(iframe->getObject()),
-                        requestedObjectStr,
-                        requestedObject,
-                        kJSPropertyAttributeReadOnly,
-                        NULL);
-
-    JSStringRelease(requestedObjectStr);
-
-    return JSObjectPtr(
-               new JSObject(const_cast<OpaqueJSValue*>(requestedObject)));
-}
-
-JavaScriptInterface::ObjectsListPtr
-JavaScriptInterface::getIframesList(JSGlobalContextRef ctx) const
-{
-    JSGlobalContextRef context = static_cast<JSGlobalContextRef>(ctx);
-    JSObjectRef globalObject = JSContextGetGlobalObject(context);
-    ObjectsListPtr retList = getIframesList(context, globalObject);
-
-    return retList;
-}
-
-JavaScriptInterface::ObjectsListPtr
-JavaScriptInterface::getIframesList(JSContextRef context,
-                                    JSObjectRef globalObject) const
-{
-    JSValueRef frames = getPropertyObj(context, globalObject, "frames");
-    CHECK_JSVALUE_IS_UNDEFINED_RETURN(context, frames, ObjectsListPtr());
-
-    JSObjectRef frames_o = JSValueToObject(context, frames, NULL);
-    CHECK_JSOBJECT_IS_NULL_RETURN(frames_o, ObjectsListPtr());
-
-    JSValueRef len = getPropertyObj(context, frames_o, "length");
-    CHECK_JSVALUE_IS_UNDEFINED_RETURN(context, len, ObjectsListPtr());
-
-    size_t count = JSValueToNumber(context, len, NULL);
-    _D("frames_o.length = %%d", count);
-
-    ObjectsListPtr retList = ObjectsListPtr(new ObjectsList());
-
-    for (size_t i = 0; i < count; ++i) {
-        std::stringstream ss;
-        ss << i;
-        JSValueRef frame = getPropertyObj(context,
-                                          frames_o,
-                                          ss.str().c_str());
-        if (JSValueIsUndefined(context, frame)) {
-            _E("Selected frame is null: frame[%d]", i);
-            continue;
-        }
-        JSObjectRef frame_obj = JSValueToObject(context, frame, NULL);
-        if (!frame_obj) {
-            _E("frame_obj is NULL.");
-            continue;
-        }
-        retList->push_back(JSObjectPtr(new JSObject(frame_obj)));
-        ObjectsListPtr childList = getIframesList(context, frame_obj);
-
-        retList->merge(*childList);
-        _D("Frame Value Pointer: %p", frame);
-        _D("Frame Object Pointer: %p", frame_obj);
-    }
-
-    return retList;
-}
-
-JSObjectPtr JavaScriptInterface::getJSObjectProperty(JSGlobalContextRef ctx,
-                                                     const JSObjectPtr& frame,
-                                                     const std::string& name)
-const
-{
-    _D("makeJSObjectBasedOnInterface(%p, \"%s\")", ctx, name.c_str());
-    JSObjectRef frame_js = static_cast<JSObjectRef>(frame->getObject());
-    JSValueRef property = getPropertyObj(ctx, frame_js, name.c_str());
-    JSObjectRef objProp = JSValueToObject(ctx, property, NULL);
-
-    return JSObjectPtr(new JSObject(objProp));
-}
-
-void JavaScriptInterface::removeIframes(JSGlobalContextRef context)
-{
-    const char* deleteIframesScript =
-        "frame_set = document.getElementsByTagName('iframe');"
-        "len = frame_set.length;"
-        "for(i=0; i< len; i++)"
-        "   frame_set[0].parentNode.removeChild(frame_set[0]); ";
-
-    JSGlobalContextRef ctx = static_cast<JSGlobalContextRef>(context);
-
-    JSStringRef script_src = JSStringCreateWithUTF8CString(deleteIframesScript);
-
-    JSEvaluateScript(ctx, script_src, 0, 0, 0, 0);
-
-    JSStringRelease(script_src);
-}
-
-void JavaScriptInterface::invokeGarbageCollector(JSGlobalContextRef context)
-{
-    LogDebug("Garbage collection");
-    JSGarbageCollect(context);
-    JSGarbageCollect(context);
-    JSGarbageCollect(context);
-    JSGarbageCollect(context);
-}
diff --git a/src_mobile/plugin-loading/javascript_interface.h b/src_mobile/plugin-loading/javascript_interface.h
deleted file mode 100644 (file)
index c3aa171..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * 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       JavaScriptInterface.h
- * @author     Przemyslaw Dobrowolski (p.dobrowolsk@samsung.com)
- * @author     Piotr Fatyga (p.fatyga@samsung.com)
- * @version    0.1
- * @brief
- */
-#ifndef WRT_SRC_PLUGIN_SERVICE_WEBKIT_INTERFACE_H_
-#define WRT_SRC_PLUGIN_SERVICE_WEBKIT_INTERFACE_H_
-
-#include <string>
-#include <vector>
-#include <memory>
-#include <list>
-#include <dpl/noncopyable.h>
-#include <dpl/singleton.h>
-#include <Commons/JSObjectDeclaration.h>
-#include <Commons/JSObject.h>
-
-//forward declaration of JSConectexRef
-extern "C" {
-typedef const struct OpaqueJSContext* JSContextRef;
-typedef struct OpaqueJSContext* JSGlobalContextRef;
-typedef struct OpaqueJSValue* JSObjectRef;
-}
-
-class JavaScriptInterface : DPL::Noncopyable
-{
-  public:
-
-    typedef std::vector<std::string> PropertiesList;
-
-    typedef std::list<JSObjectPtr> ObjectsList;
-    typedef std::shared_ptr<ObjectsList> ObjectsListPtr;
-
-  public:
-    JSObjectPtr getGlobalObject(JSGlobalContextRef context) const;
-
-    // object creation
-    JSObjectPtr createObject(JSGlobalContextRef context,
-                             const JSObjectDeclarationPtr& declaration);
-
-    //properties
-    void setObjectProperty(JSGlobalContextRef context,
-                           const JSObjectPtr& parentObject,
-                           const std::string &propertyName,
-                           const JSObjectPtr& propertyObject);
-
-    void removeObjectProperty(JSGlobalContextRef context,
-                              const JSObjectPtr& parentObject,
-                              const std::string &propertyName);
-
-    PropertiesList getObjectPropertiesList(JSGlobalContextRef context,
-                                           const JSObjectPtr& object) const;
-
-    JSObjectPtr copyObjectToIframe(JSGlobalContextRef context,
-                                   const JSObjectPtr& iframe,
-                                   const std::string& name);
-
-    ObjectsListPtr getIframesList(JSGlobalContextRef context) const;
-
-    void removeIframes(JSGlobalContextRef context);
-
-    void invokeGarbageCollector(JSGlobalContextRef context);
-
-    JSObjectPtr getJSObjectProperty(JSGlobalContextRef ctx,
-                                    const JSObjectPtr& frame,
-                                    const std::string& name) const;
-
-  private:
-    JavaScriptInterface()
-    {}
-
-    JSObjectPtr makeJSFunctionObject(
-        JSGlobalContextRef context,
-        const std::string &name,
-        js_function_impl functionImplementation) const;
-    JSObjectPtr makeJSClassObject(
-        JSGlobalContextRef context,
-        JSObjectDeclaration::ConstClassTemplate classTemplate) const;
-    JSObjectPtr makeJSObjectBasedOnInterface(
-        JSGlobalContextRef context,
-        const std::string &interfaceName) const;
-    JSObjectPtr makeJSInterface(
-        JSGlobalContextRef context,
-        JSObjectDeclaration::ConstClassTemplate classTemplate,
-        JSObjectDeclaration::ConstructorCallback constructorCallback) const;
-
-    ObjectsListPtr getIframesList(JSContextRef context,
-                                  JSObjectRef object) const;
-
-    friend class DPL::Singleton<JavaScriptInterface>;
-};
-
-typedef DPL::Singleton<JavaScriptInterface> JavaScriptInterfaceSingleton;
-
-#endif
diff --git a/src_mobile/plugin-loading/js_page_session.cpp b/src_mobile/plugin-loading/js_page_session.cpp
deleted file mode 100644 (file)
index cec6266..0000000
+++ /dev/null
@@ -1,601 +0,0 @@
-/*
- * 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        plugin_logic.cpp
- * @author      Piotr Fatyga (p.fatyga@samsung.com)
- * @author      Grzegorz Krawczyk (g.krawczyk@samsung.com)
- * @author      Przemyslaw Dobrowolski (p.dobrowolsk@samsung.com)
- * @version     1.0
- * @brief       This file is the implementation file of plugin and
- *              feature loading routines
- * @brief       This code is intended to work behind view controller
- */
-
-#include "plugin_logic.h"
-
-#include <dpl/assert.h>
-#include <dpl/scoped_array.h>
-#include <dpl/log/secure_log.h>
-#include <dpl/foreach.h>
-#include <dpl/singleton_impl.h>
-#include <dpl/wrt-dao-ro/widget_dao_read_only.h>
-#include <dpl/wrt-dao-ro/common_dao_types.h>
-#include <dpl/wrt-dao-ro/global_config.h>
-
-#include <JavaScriptCore/JavaScript.h>
-
-#include <string>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <dirent.h>
-#include <errno.h>
-#include <fstream>
-#include <map>
-#include <list>
-#include <vector>
-#include <algorithm>
-#include <cstring>
-
-#include <wrt_plugin_export.h>
-#include <js_overlay_types.h>
-
-#include "explorer.h"
-#include "plugin.h"
-#include "plugin_model.h"
-#include "javascript_interface.h"
-#include "js_function_manager.h"
-#include "plugin_container_support.h"
-
-#include "js_page_session.h"
-
-using namespace std;
-using namespace WrtDB;
-using namespace WrtPlugins::W3C;
-
-namespace {
-const char *LIBRARY_PATH_SEPARATOR = "/";
-}
-
-class JSPageSession::Impl
-{
-  private:
-    typedef std::set<PluginPtr> LoadedPlugins;
-    typedef std::set<JSGlobalContextRef> LoadedContexts;
-
-  private:
-    ///< Widget handle using this session
-    int m_widgetHandle;
-
-    //view for this session
-    JSGlobalContextRef m_context;
-
-    bool m_sessionStarted;
-
-    ///< JS object explorer for this session
-    Explorer* m_objectExplorer;
-
-    PluginContainerSupportPtr m_pluginsSupport;
-
-    ///< All loaded plugins. Each one must be unloaded. Plugins means
-    //set of features connected with such plugin (library)
-    LoadedPlugins m_loadedPlugins;
-
-    // Set of currently loaded web pages' contexts. These contexts are
-    // exactly matching with each frames' global context.
-    LoadedContexts m_loadedContexts;
-
-  private:
-    PluginPtr loadLibrary(PluginModelPtr& pluginModel);
-
-    void installStandardFunctions();
-    void installRootPlugins();
-    void installRequestedFeatures();
-
-    //returns true if success or false if failed
-    bool installPlugin(PluginModelPtr plugin);
-    bool installPluginOnDemand(PluginModelPtr plugin,
-                               JavaScriptObject& parentObject,
-                               JSGlobalContextRef context);
-
-    void unloadPluginsFromSession();
-
-  public:
-    Impl(const PluginContainerSupportPtr& containerSupport);
-    ~Impl();
-
-    // Widget session
-    void startSession(int widgetHandle,
-                      JSGlobalContextRef view,
-                      double scaleFactor,
-                      const char* encodedBundle,
-                      const char* theme);
-
-    void stopSession();
-
-    void performLibrariesUnload();
-
-    bool loadPluginOnDemand(const WrtDB::DbPluginHandle &pluginHandle,
-                            JavaScriptObject& parentObject,
-                            JSGlobalContextRef context);
-
-    void loadFrame(JSGlobalContextRef context);
-    void unloadFrame(JSGlobalContextRef context);
-
-    void setCustomProperties(double scaleFactor,
-                             const char* encodedBundle,
-                             const char* theme);
-
-    void dispatchJavaScriptEvent(CustomEventType eventType, void* data);
-};
-
-JSPageSession::Impl::Impl(const PluginContainerSupportPtr& support) :
-        m_widgetHandle(0),
-        m_context(NULL),
-        m_sessionStarted(false),
-        m_objectExplorer(NULL)
-{
-    _D("Initializing Page Session");
-    m_pluginsSupport = support;
-}
-
-JSPageSession::Impl::~Impl()
-{
-    if (m_sessionStarted) {
-        LogError("Must stop widget session before exit!");
-        stopSession();
-    }
-
-    _D("Deinitializing Page Session");
-}
-
- void JSPageSession::Impl::installStandardFunctions()
- {
-    _D("========== install standard Functions START ==========");
-
-    //add standard functions
-    FOREACH(it, JsFunctionManagerSingleton::Instance().getFunctions()) {
-        m_objectExplorer->registerObject(*it, NULL);
-    }
-
-    _D("========== install standard Functions END ==========");
- }
-
-void JSPageSession::Impl::installRootPlugins()
-{
-    _D("========== install root Functions START ==========");
-
-    PluginContainerSupport::PluginsList rootPlugins =
-                    m_pluginsSupport->getRootPlugins();
-    FOREACH(it, rootPlugins)
-    {
-        installPlugin(*it);
-    }
-
-    _D("========== install root Functions END ==========");
-}
-
-bool JSPageSession::Impl::installPlugin(PluginModelPtr plugin)
-{
-    Assert(plugin && "Plugin Model is NULL");
-    PluginPtr library = loadLibrary(plugin);
-
-    if (!library) {
-        _E("Loading library failed");
-        return false;
-    }
-
-    _D("Install Plugin : %s", library->GetFileName().c_str());
-
-    // Register new class
-    FOREACH(it, *(library->GetClassList()))
-    {
-        if (!m_objectExplorer->registerObject(*it, NULL)) {
-            _E("Object Registration failed : %s", (*it)->getName().c_str());
-        }
-    }
-    return true;
-}
-
-void JSPageSession::Impl::installRequestedFeatures()
-{
-    _D("========== install requested Features START ==========");
-
-    std::list<std::string> allowedFeatures =
-        m_pluginsSupport->getAllowedFeatures(m_widgetHandle);
-
-    PluginContainerSupport::PluginsList allowedPlugins;
-
-    FOREACH(feature, allowedFeatures)
-    {
-        _D("Processing feature: %s", (*feature).c_str());
-
-        PluginModelPtr plugin = m_pluginsSupport->getPluginForFeature(*feature);
-
-        if (!plugin) {
-            _W("It didn't have plugins! : %s", (*feature).c_str());
-            continue;
-        }
-
-        ImplementedObjectsList implObjs =
-            PluginDAOReadOnly::
-                getImplementedObjectsForPluginHandle(plugin->Handle.Get());
-
-        FOREACH(obj, implObjs)
-        {
-            _D("Processing object: %s", (*obj).c_str());
-            /* This can be optimalized, but would need extra data in database.
-             * There should be a list of features that are allowed to be
-             * installed at widget start */
-            if (obj->find(".") == obj->rfind(".")) {
-                allowedPlugins.push_back(plugin);
-                _D("Plugin will be added: %s", plugin->LibraryName.Get().c_str());
-                break;
-            }
-        }
-    }
-
-    FOREACH(plugin, allowedPlugins)
-    {
-        _D("Installation plugin: %s", (*plugin)->LibraryName.Get().c_str());
-        installPlugin(*plugin);
-    }
-
-    _D("========== install requested Features END ==========");
-}
-
-bool JSPageSession::Impl::loadPluginOnDemand(
-    const WrtDB::DbPluginHandle &pluginHandle,
-    JavaScriptObject& parentObject,
-    JSGlobalContextRef context)
-{
-    Assert(parentObject.instance &&
-           !parentObject.name.empty()
-           && "Wrong arguments");
-
-    if (!m_sessionStarted) {
-        _W("Session not started");
-        return false;
-    }
-    //    //TODO here may be a bug. if plugin contains feature rejected and
-    // accepted
-    //    LogDebug("Installing feature : " << widgetFeature.name);
-    //    if (widgetFeature.rejected) {
-    //        LogWarning("This api-feature was rejected");
-    //        return;
-    //    }
-    //
-    //    auto plugin = m_pluginsSupport->getPluginModelById(pluginHandle);
-    //    if (!plugin) {
-    //        LogError("Failed to load plugin. plugin handle: " <<
-    // pluginHandle);
-    //        return false;
-    //    }
-    m_pluginsSupport->registerPluginModel(pluginHandle);
-    return installPluginOnDemand(
-               m_pluginsSupport->getPluginModelById(pluginHandle),
-               parentObject,
-               context);
-}
-
-bool JSPageSession::Impl::installPluginOnDemand(PluginModelPtr plugin,
-                                                JavaScriptObject& parentObject,
-                                                JSGlobalContextRef context)
-{
-    Assert(plugin && "Plugin Model is NULL");
-    PluginPtr library = loadLibrary(plugin);
-
-    if (!library) {
-        _E("Loading library failed");
-        return false;
-    }
-
-    _D("Install Plugin %s", library->GetFileName().c_str());
-
-    if (!(parentObject.instance)) {
-        _E("NULL pointer value");
-        return false;
-    }
-
-    JSObjectPtr parent(new JSObject(parentObject.instance));
-
-    if (!parent->getObject()) {
-        _E("NULL pointer value");
-        assert(false);
-        return false;
-    }
-
-    FOREACH(it, *(library->GetClassList()))
-    {
-        bool installationStatus =
-            m_objectExplorer->registerObject(*it,
-                                             parentObject.name,
-                                             parent,
-                                             context);
-
-        if (!installationStatus) {
-            _E("Object Registration failed : %s; Parent object name: %s",
-               (*it)->getName().c_str(),
-               parentObject.name.c_str());
-            return false;
-        }
-    }
-
-    _D("Plugin on demand registration completed");
-    return true;
-}
-
-void JSPageSession::Impl::setCustomProperties(double scaleFactor,
-                                              const char* encodedBundle,
-                                              const char* theme)
-{
-    m_objectExplorer->getWindowPropertySupport()
-        ->setScaleToNavigatorProperty(scaleFactor);
-    m_objectExplorer->getWindowPropertySupport()
-        ->setBundleToWindowProperty(encodedBundle);
-    m_objectExplorer->getWindowPropertySupport()
-        ->setThemeToNavigatorProperty(theme);
-}
-
-void JSPageSession::Impl::dispatchJavaScriptEvent(CustomEventType eventType,
-                                                  void* data)
-{
-    // Check if session is already started
-    if (!m_sessionStarted) {
-        _W("Session not started!");
-        return;
-    }
-    m_objectExplorer->callEventListeners(eventType, data);
-}
-
-void JSPageSession::Impl::startSession(int widgetHandle,
-                                       JSGlobalContextRef context,
-                                       double scaleFactor,
-                                       const char* encodedBundle,
-                                       const char* theme)
-{
-
-    // Check if corresponding session if not already created
-    if (m_sessionStarted) {
-        _W("Session already started!");
-        return;
-    }
-
-    // Create js object explorer object
-    m_objectExplorer = new Explorer(context);
-
-    m_sessionStarted = true;
-    m_widgetHandle = widgetHandle;
-    m_loadedPlugins.clear();
-    m_context = context;
-
-    // Register standard features
-    installStandardFunctions();
-
-    WidgetDAOReadOnly dao(m_widgetHandle);
-    WidgetType appType = dao.getWidgetType();
-    if (appType == WrtDB::APP_TYPE_TIZENWEBAPP) {
-        installRootPlugins();
-    }
-    // Register special features
-    installRequestedFeatures();
-
-    // set scale, bundle as window's property
-    setCustomProperties(scaleFactor, encodedBundle, theme);
-}
-
-void JSPageSession::Impl::stopSession()
-{
-    if (!m_sessionStarted) {
-        _W("Session not started!");
-        return;
-    }
-
-    unloadPluginsFromSession();
-    m_sessionStarted = false;
-}
-
-void JSPageSession::Impl::unloadPluginsFromSession()
-{
-    m_objectExplorer->removePluginsFromIframes();
-    m_objectExplorer->cleanIframesData();
-
-    // delete js object for overlayed js functions
-    FOREACH(it, JsFunctionManagerSingleton::Instance().getFunctions())
-    {
-        m_objectExplorer->deregisterObject(*it);
-    }
-
-    // delete js object for plugins
-    FOREACH(pluginIt, m_loadedPlugins)
-    {
-        _D("Unregistering plugin %s", (*pluginIt)->GetFileName().c_str());
-        (*pluginIt)->OnWidgetStop(m_widgetHandle);
-
-        FOREACH(it, *((*pluginIt)->GetClassList())) {
-            m_objectExplorer->deregisterObject(*it);
-        }
-    }
-
-    JavaScriptInterfaceSingleton::Instance().invokeGarbageCollector(m_context);
-
-    m_loadedPlugins.clear();
-
-    delete m_objectExplorer;
-    m_objectExplorer = NULL;
-}
-
-void JSPageSession::Impl::performLibrariesUnload()
-{
-#if 0
-    LogDebug("Perform library unload");
-
-    size_t unloadedLibraries = 0;
-
-    FOREACH(pluginIt, m_loadedPlugins)
-    {
-        LogDebug("Preparing library: " << (*pluginIt)->LibraryName.Get());
-
-        PluginPtr plugin = (*pluginIt)->LibraryInstance.Get();
-        if (!plugin) {
-            LogWarning("Library not loaded " << (*pluginIt)->LibraryName.Get());
-            continue;
-        }
-        unloadedLibraries++;
-        (*pluginIt)->LibraryInstance.Set(PluginPtr());
-    }
-
-    LogDebug("unloaded " << unloadedLibraries << " unreferenced libraries!");
-#endif
-}
-
-PluginPtr JSPageSession::Impl::loadLibrary(PluginModelPtr& pluginModel)
-{
-    PluginPtr pluginLib = pluginModel->LibraryInstance.Get();
-    if (!pluginLib) {
-        std::string path = pluginModel->LibraryPath.Get() +
-            std::string(LIBRARY_PATH_SEPARATOR) +
-            pluginModel->LibraryName.Get();
-
-        pluginLib = Plugin::LoadFromFile(path);
-
-        if (!pluginLib) {
-            _E("Loading library failed");
-        } else {
-            pluginModel->LibraryInstance.Set(pluginLib);
-
-            _D("On widget start");
-            // This is first time for this plugin, start widget Session
-            pluginLib->OnWidgetStart(
-                m_widgetHandle);
-            m_loadedPlugins.insert(pluginLib);
-
-            FOREACH(context, m_loadedContexts)
-            {
-                pluginLib->OnFrameLoad(*context);
-            }
-        }
-    } else {
-        _D("Get from LibraryInstance");
-        _D("On widget start");
-        // This is first time for this plugin, start widget Session
-        pluginLib->OnWidgetStart(
-            m_widgetHandle);
-        m_loadedPlugins.insert(pluginLib);
-
-        FOREACH(context, m_loadedContexts)
-        {
-            pluginLib->OnFrameLoad(*context);
-        }
-    }
-
-    return pluginLib;
-}
-
-void JSPageSession::Impl::loadFrame(JSGlobalContextRef context)
-{
-    if (!m_sessionStarted) {
-        _W("Session NOT started!");
-        return;
-    }
-
-    m_loadedContexts.insert(context);
-
-    FOREACH(pluginIt, m_loadedPlugins)
-    {
-        _D("Try to call 'OnFrameLoad' callback : %s",
-           (*pluginIt)->GetFileName().c_str());
-        (*pluginIt)->OnFrameLoad(context);
-    }
-
-    m_objectExplorer->loadFrame(context);
-}
-
-void JSPageSession::Impl::unloadFrame(JSGlobalContextRef context)
-{
-    if (!m_sessionStarted) {
-        _W("Session NOT started!");
-        return;
-    }
-
-    m_loadedContexts.erase(context);
-
-    FOREACH(pluginIt, m_loadedPlugins)
-    {
-        _D("Try to call 'OnFrameUnload' callback : %s",
-           (*pluginIt)->GetFileName().c_str());
-        (*pluginIt)->OnFrameUnload(context);
-    }
-
-    m_objectExplorer->unloadFrame(context);
-}
-
-void JSPageSession::startSession(int widgetHandle,
-                                 JSGlobalContextRef ctx,
-                                 double scaleFactor,
-                                 const char* encodedBundle,
-                                 const char* theme)
-{
-    m_impl->startSession(widgetHandle, ctx, scaleFactor, encodedBundle, theme);
-}
-
-void JSPageSession::stopSession()
-{
-    m_impl->stopSession();
-}
-
-void JSPageSession::performLibrariesUnload()
-{
-    m_impl->performLibrariesUnload();
-}
-
-bool JSPageSession::loadPluginOnDemand(
-    const WrtDB::DbPluginHandle &pluginHandle,
-    JavaScriptObject& parentObject,
-    JSGlobalContextRef context)
-{
-    return m_impl->loadPluginOnDemand(pluginHandle, parentObject, context);
-}
-
-void JSPageSession::setCustomProperties(double scaleFactor,
-                                        const char* encodedBundle,
-                                        const char* theme)
-{
-    m_impl->setCustomProperties(scaleFactor, encodedBundle, theme);
-}
-
-void JSPageSession::dispatchJavaScriptEvent(CustomEventType eventType,
-                                            void* data)
-{
-    m_impl->dispatchJavaScriptEvent(eventType, data);
-}
-
-void JSPageSession::loadFrame(JSGlobalContextRef context)
-{
-    m_impl->loadFrame(context);
-}
-
-void JSPageSession::unloadFrame(JSGlobalContextRef context)
-{
-    m_impl->unloadFrame(context);
-}
-
-JSPageSession::JSPageSession(const PluginContainerSupportPtr& containerSupport)
-    :
-    m_impl(new JSPageSession::Impl(containerSupport))
-{}
-
-JSPageSession::~JSPageSession()
-{}
diff --git a/src_mobile/plugin-loading/js_page_session.h b/src_mobile/plugin-loading/js_page_session.h
deleted file mode 100644 (file)
index 3580287..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * 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        js_page_session.h
- * @author      Grzegorz Krawczyk (g.krawczyk@samsung.com)
- * @version     1.0
- */
-#ifndef WRT_PLUGIN_JS_PAGE_SESSION_H_
-#define WRT_PLUGIN_JS_PAGE_SESSION_H_
-
-#include <memory>
-#include <vector>
-#include <dpl/wrt-dao-ro/plugin_dao_read_only.h>
-#include <js_overlay_types.h>
-#include "js_types.h"
-
-using namespace WrtPlugins::W3C;
-
-class JSPageSession
-{
-  public:
-    // Widget session
-    void startSession(int widgetHandle,
-                      JSGlobalContextRef view,
-                      double scaleFactor,
-                      const char* encodedBundle,
-                      const char* theme);
-
-    void stopSession();
-
-    //TODO im not sure if it is needed. I think it should be hidden
-    void performLibrariesUnload();
-    bool loadPluginOnDemand(const WrtDB::DbPluginHandle &pluginHandle,
-                            JavaScriptObject& parentObject,
-                            JSGlobalContextRef context);
-
-    void loadFrame(JSGlobalContextRef context);
-    void unloadFrame(JSGlobalContextRef context);
-
-    // reset custom window properties. (Tizen requirements)
-    void setCustomProperties(double scaleFactor,
-                             const char* encodedBundle,
-                             const char* theme);
-
-    void dispatchJavaScriptEvent(CustomEventType eventType, void* data);
-
-    JSPageSession(const PluginContainerSupportPtr& containerSupport);
-
-    virtual ~JSPageSession();
-
-  private:
-    class Impl;
-    std::unique_ptr<Impl> m_impl;
-};
-
-typedef std::shared_ptr<JSPageSession> JSPageSessionPtr;
-
-#endif // PLUGIN_LOGIC_H
diff --git a/src_mobile/plugin-loading/plugin.cpp b/src_mobile/plugin-loading/plugin.cpp
deleted file mode 100644 (file)
index 246a548..0000000
+++ /dev/null
@@ -1,242 +0,0 @@
-/*
- * 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        plugin.cpp
- * @author      Przemyslaw Dobrowolski (p.dobrowolsk@samsung.com)
- * @version     1.0
- * @brief       This file is the implementation file of plugin
- */
-#include "plugin.h"
-#include <dpl/log/secure_log.h>
-#include <dpl/assert.h>
-#include <dlfcn.h>
-
-Plugin::Plugin(const std::string &fileName,
-               void *libHandle,
-               on_widget_start_proc *apiOnWidgetStart,
-               on_widget_init_proc *apiOnWidgetInit,
-               on_widget_stop_proc *apiOnWidgetStop,
-               on_frame_load_proc* apiOnFrameLoad,
-               on_frame_unload_proc* apiOnFrameUnload,
-               const ClassPtrList &apiClassList) :
-    m_fileName(fileName),
-    m_libHandle(libHandle),
-    m_apiOnWidgetStart(apiOnWidgetStart),
-    m_apiOnWidgetInit(apiOnWidgetInit),
-    m_apiOnWidgetStop(apiOnWidgetStop),
-    m_apiOnFrameLoad(apiOnFrameLoad),
-    m_apiOnFrameUnload(apiOnFrameUnload),
-    m_apiClassList(apiClassList)
-{}
-
-Plugin::~Plugin()
-{
-    _D("Unloading plugin library: %s", m_fileName.c_str());
-
-    // Unload library
-    if (dlclose(m_libHandle) != 0) {
-        _E("Cannot close plugin handle");
-    } else {
-        _D("Library is unloaded");
-    }
-}
-
-PluginPtr Plugin::LoadFromFile(const std::string& fileName)
-{
-    static bool logEnable = (getenv("WRT_LOAD_PLUGINS_LOG_ENABLE") != NULL);
-
-    _D("LoadFromFile %s", fileName.c_str());
-
-    void *dllHandle;
-    dllHandle = dlopen(fileName.c_str(), RTLD_LAZY);
-
-    _D("dlopen() done!");
-
-    if (dllHandle == NULL) {
-        const char* error = (const char*)dlerror();
-        _E("Failed to load plugin: %s. Reason: %s",
-           fileName.c_str(),
-           (error != NULL ? error : "unknown"));
-        PluginPtr empty;
-        return empty;
-    }
-
-    // Load new plugin API
-    on_widget_start_proc *onWidgetStartProcPtr = NULL;
-    on_widget_stop_proc *onWidgetStopProcPtr = NULL;
-    on_widget_init_proc *onWidgetInitProcPtr = NULL;
-    on_frame_load_proc *onFrameLoadProcPtr = NULL;
-    on_frame_unload_proc *onFrameUnloadProcPtr = NULL;
-
-    const js_entity_definition_t *rawClassList = NULL;
-    get_widget_entity_map_proc *getWidgetEntityMapProcPtr = NULL;
-
-    onWidgetStartProcPtr =
-        reinterpret_cast<on_widget_start_proc *>(
-            dlsym(dllHandle, PLUGIN_WIDGET_START_PROC_NAME));
-    onWidgetInitProcPtr =
-        reinterpret_cast<on_widget_init_proc *>(
-            dlsym(dllHandle, PLUGIN_WIDGET_INIT_PROC_NAME));
-    onWidgetStopProcPtr =
-        reinterpret_cast<on_widget_stop_proc *>(
-            dlsym(dllHandle, PLUGIN_WIDGET_STOP_PROC_NAME));
-    onFrameLoadProcPtr =
-        reinterpret_cast<on_frame_load_proc *>(
-            dlsym(dllHandle, PLUGIN_FRAME_LOAD_PROC_NAME));
-    onFrameUnloadProcPtr =
-        reinterpret_cast<on_frame_unload_proc *>(
-            dlsym(dllHandle, PLUGIN_FRAME_UNLOAD_PROC_NAME));
-    getWidgetEntityMapProcPtr =
-        reinterpret_cast<get_widget_entity_map_proc *>(
-            dlsym(dllHandle, PLUGIN_GET_CLASS_MAP_PROC_NAME));
-
-    if (getWidgetEntityMapProcPtr) {
-        rawClassList = (*getWidgetEntityMapProcPtr)();
-
-        if (logEnable) {
-            _D("rawClassList : %p by getWidgetClassMapProcPtr()",
-               rawClassList);
-        }
-    } else {
-        rawClassList =
-            static_cast<const js_entity_definition_t *>(dlsym(dllHandle,
-                                                              PLUGIN_CLASS_MAP_NAME));
-        if (logEnable) { _D("rawClassList : %p", rawClassList); }
-    }
-
-    if (NULL == onWidgetStartProcPtr || NULL == onWidgetStopProcPtr ||
-        /*NULL == onWidgetInitProcPtr ||*/ NULL == rawClassList)
-    {
-        if (logEnable) {
-            _W("#####");
-            _W("##### Warning: The following plugin does not support new plugin API.");
-            _W("##### Old plugin API is deprecated. Please update it to new API");
-            _W("#####");
-            _W("##### Plugin: %s has got deprecated or invalid API", fileName.c_str());
-            _W("#####");
-        }
-
-        // Will not load plugin
-        dlclose(dllHandle);
-
-        PluginPtr empty;
-        return empty;
-    }
-
-    if (logEnable) {
-        _D("#####");
-        _D("##### Plugin: %s supports new plugin API", fileName.c_str());
-        _D("#####");
-        _D("##### $onWidgetStartProc: %p", onWidgetStartProcPtr);
-        _D("##### $onWidgetInitProc: %p", onWidgetInitProcPtr);
-        _D("##### $onWidgetStopProc %p", onWidgetStopProcPtr);
-        _D("##### $onFrameLoadProc %p", onFrameLoadProcPtr);
-        _D("##### $onFrameUnloadProc %p", onFrameUnloadProcPtr);
-        _D("##### $classMap: %p", reinterpret_cast<const void *>(rawClassList));
-        _D("##### ");
-        _D("##### Class map:");
-    }
-
-    const js_entity_definition_t *rawEntityListIterator = rawClassList;
-    ClassPtrList classList(new Plugin::ClassList());
-
-    // Parse all class definitions
-    while (rawEntityListIterator->parent_name != NULL &&
-           rawEntityListIterator->object_name != NULL)
-    {
-        if (logEnable)
-        {
-            // Logging
-            _D("#####");
-            _D("##### [%s]", rawEntityListIterator->object_name);
-            _D("##### Interface: %s", rawEntityListIterator->interface_name);
-            _D("##### Parent: %s", rawEntityListIterator->parent_name);
-        }
-
-        // Register class
-        classList->push_back(ClassPtr(new Class(rawEntityListIterator)));
-
-        // Go to next class
-        ++rawEntityListIterator;
-    }
-
-    // Load export table
-    _D("Plugin successfuly loaded");
-
-    // Insert to loaded modules list
-
-    PluginPtr instance(new Plugin(fileName,
-                                  dllHandle,
-                                  onWidgetStartProcPtr,
-                                  onWidgetInitProcPtr,
-                                  onWidgetStopProcPtr,
-                                  onFrameLoadProcPtr,
-                                  onFrameUnloadProcPtr,
-                                  classList));
-
-    return instance;
-}
-
-std::string Plugin::GetFileName() const
-{
-    return m_fileName;
-}
-
-void Plugin::OnWidgetStart(int widgetId)
-{
-    if (NULL != m_apiOnWidgetStart) {
-        (*m_apiOnWidgetStart)(widgetId);
-        _D("Called!");
-    }
-}
-
-void Plugin::OnWidgetInit(feature_mapping_interface_t* mapping)
-{
-    Assert(NULL != mapping && "NULL mapping interface provided");
-    if (NULL != m_apiOnWidgetInit) {
-        (*m_apiOnWidgetInit)(mapping);
-        _D("Called!");
-    }
-}
-
-void Plugin::OnWidgetStop(int widgetId)
-{
-    if (NULL != m_apiOnWidgetStop) {
-        (*m_apiOnWidgetStop)(widgetId);
-        _D("Called!");
-    }
-}
-
-void Plugin::OnFrameLoad(java_script_context_t context)
-{
-    if (NULL != m_apiOnFrameLoad) {
-        (*m_apiOnFrameLoad)(context);
-        _D("Called!");
-    }
-}
-
-void Plugin::OnFrameUnload(java_script_context_t context)
-{
-    if (NULL != m_apiOnFrameUnload) {
-        (*m_apiOnFrameUnload)(context);
-        _D("Called!");
-    }
-}
-
-const Plugin::ClassPtrList Plugin::GetClassList() const
-{
-    return m_apiClassList;
-}
diff --git a/src_mobile/plugin-loading/plugin_container_support.h b/src_mobile/plugin-loading/plugin_container_support.h
deleted file mode 100644 (file)
index dbdf6c5..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * 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        plugin_container_support.h
- * @author      Grzegorz Krawczyk (g.krawczyk@samsung.com)
- * @version     1.0
- */
-#ifndef PLUGIN_CONTAINER_SUPPORT_H
-#define PLUGIN_CONTAINER_SUPPORT_H
-
-#include <memory>
-#include <set>
-#include <string>
-
-#include <dpl/wrt-dao-ro/feature_dao_read_only.h>
-#include <dpl/wrt-dao-ro/feature_model.h>
-
-#include "plugin_model.h"
-
-class PluginContainerSupport
-{
-  public:
-    typedef std::list<WrtDB::FeatureModelPtr> FeaturesList;
-    typedef std::list<PluginModelPtr> PluginsList;
-
-  private:
-    // Standard features
-    typedef std::list<std::string> StandardFeatureList;
-
-    // Main feature list. Always equal to DB feature list
-    typedef std::set<WrtDB::FeatureModelPtr> FeatureModelContainer;
-
-    // Main plugin list. Always equal to DB plugin list
-    typedef std::set<PluginModelPtr> PluginModelsContainer;
-
-    WrtDB::PluginHandleList m_rootPluginsList;
-
-    PluginModelsContainer m_pluginModels;
-
-    FeatureModelContainer m_featureModels;
-
-    bool m_initialized;
-
-    int m_widgetHandle;
-
-  private:
-    // Reading
-     void readRootPluginsList();
-
-    // Plugin models
-    typedef std::multimap<WrtDB::FeatureHandle, std::string> DeviceCapList;
-    void registerFeatureModel(WrtDB::FeatureHandle handle,
-                              WrtDB::FeatureData* data,
-                              DeviceCapList deviceCapabilities);
-
-    WrtDB::FeatureModelPtr getFeatureModel(const std::string &name) const;
-    WrtDB::FeatureModelPtr getFeatureModel(WrtDB::FeatureHandle handle) const;
-
-    PluginModelPtr getPluginModel(const WrtDB::FeatureModelPtr &feature) const;
-
-  public:
-    PluginContainerSupport();
-
-    bool isInitialized()
-    {
-        return m_initialized;
-    }
-    bool isInitialized(int widgetHandle)
-    {
-        return (m_initialized && m_widgetHandle == widgetHandle);
-    }
-    void Initialize(int widgetHandle);
-    void registerPluginModel(WrtDB::DbPluginHandle handle);
-    std::list<std::string> getAllowedFeatures(int widgetHandle) const;
-    void readAllowedPlugins(int widgetHandle);
-    void readRootPlugins(int widgetHandle);
-    PluginsList  getRootPlugins() const;
-    PluginsList  getPluginsList() const;
-
-    PluginModelPtr getPluginForFeature(const std::string& featureName);
-
-    PluginModelPtr getPluginModelById(WrtDB::DbPluginHandle handle) const;
-
-    ~PluginContainerSupport();
-};
-
-typedef std::shared_ptr<PluginContainerSupport> PluginContainerSupportPtr;
-
-#endif // PLUGIN_CONTAINER_SUPPORT_H
diff --git a/src_mobile/plugin-loading/plugin_iframe_support.cpp b/src_mobile/plugin-loading/plugin_iframe_support.cpp
deleted file mode 100644 (file)
index 4e428dd..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * 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    plugin_iframe_support.cpp
- * @version 1.0
- * @brief
- */
-
-#include "plugin_iframe_support.h"
-
-#include <algorithm>
-#include <dpl/foreach.h>
-#include <dpl/log/secure_log.h>
-
-void IframesSupport::registerDeclaration(
-    const JSObjectDeclarationPtr& declaration)
-{
-    _D("Registration iframes-supported plugins %s", declaration->getName().c_str());
-
-    if (declaration->getParentName().find('.') != std::string::npos) {
-        _E("The object will not be loaded to iframes");
-        return;
-    }
-    m_iframesObjects.push_back(declaration);
-}
-
-void IframesSupport::registerIframe(const JSObjectPtr& iframe)
-{
-    _D("LoadedIframes size: %d", m_loadedIframes.size() );
-
-    m_loadedIframes.insert(iframe);
-}
-
-void IframesSupport::unregisterIframe(const JSObjectPtr& iframe)
-{
-    _D("LoadedIframes size: %d", m_loadedIframes.size() );
-
-    auto it_loaded = std::find_if(m_loadedIframes.begin(),
-                                  m_loadedIframes.end(),
-                                  std::bind2nd(EqualToJSObjectPtr(), iframe));
-    //object not found, so thats the new iframe
-    if (it_loaded == m_loadedIframes.end()) {
-        _D("Nothing to unregister");
-        return;
-    }
-
-    m_loadedIframes.erase(it_loaded);
-}
-
-bool IframesSupport::hasIframes() const
-{
-    return !m_loadedIframes.empty();
-}
-
-IframesSupport::DeclarationsList IframesSupport::getIframeObjects() const
-{
-    return m_iframesObjects;
-}
-
-void IframesSupport::clean()
-{
-    m_iframesObjects.clear();
-    m_loadedIframes.clear();
-}
diff --git a/src_mobile/plugin-loading/plugin_iframe_support.h b/src_mobile/plugin-loading/plugin_iframe_support.h
deleted file mode 100644 (file)
index 0c98768..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * 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    plugin_iframe_support.h
- * @version 1.0
- * @brief
- */
-
-#ifndef _WRTENGINE_SRC_PLUGINSERVICE_IFRAME_SUPPORT_H_
-#define _WRTENGINE_SRC_PLUGINSERVICE_IFRAME_SUPPORT_H_
-
-#include <list>
-#include <set>
-#include <Commons/JSObjectDeclaration.h>
-#include <Commons/JSObject.h>
-#include "javascript_interface.h"
-
-class IframesSupport
-{
-  public:
-    typedef std::list<JSObjectDeclarationPtr> DeclarationsList;
-
-  public:
-    void registerDeclaration(const JSObjectDeclarationPtr& declaration);
-
-    void registerIframe(const JSObjectPtr& iframe);
-
-    void unregisterIframe(const JSObjectPtr& iframe);
-
-    DeclarationsList getIframeObjects() const;
-
-    bool hasIframes() const;
-
-    void clean();
-
-  private:
-    std::list<JSObjectDeclarationPtr> m_iframesObjects;
-    std::set<JSObjectPtr> m_loadedIframes;
-
-    // used to find matching object from m_loadedIframes
-    struct EqualToJSObjectPtr
-    {
-        typedef JSObjectPtr first_argument_type;
-        typedef JSObjectPtr second_argument_type;
-        typedef bool result_type;
-
-        result_type operator()(const first_argument_type &s1,
-                               const second_argument_type &s2) const
-        {
-            return (s1->getObject() == s2->getObject());
-        }
-    };
-};
-
-#endif
diff --git a/src_mobile/plugin-loading/plugin_logic.cpp b/src_mobile/plugin-loading/plugin_logic.cpp
deleted file mode 100644 (file)
index 8458501..0000000
+++ /dev/null
@@ -1,420 +0,0 @@
-/*
- * 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        plugin_logic.cpp
- * @author      Piotr Fatyga (p.fatyga@samsung.com)
- * @author      Grzegorz Krawczyk (g.krawczyk@samsung.com)
- * @author      Przemyslaw Dobrowolski (p.dobrowolsk@samsung.com)
- * @version     1.0
- * @brief       This file is the implementation file of plugin and
- *              feature loading routines
- * @brief       This code is intended to work behind view controller
- */
-
-#include "plugin_logic.h"
-
-#include <dpl/assert.h>
-#include <dpl/scoped_array.h>
-#include <dpl/log/secure_log.h>
-#include <dpl/foreach.h>
-#include <dpl/singleton_impl.h>
-#include <dpl/wrt-dao-ro/widget_dao_read_only.h>
-#include <dpl/wrt-dao-ro/common_dao_types.h>
-#include <dpl/wrt-dao-ro/global_config.h>
-
-#include <JavaScriptCore/JavaScript.h>
-
-#include <string>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <dirent.h>
-#include <errno.h>
-#include <fstream>
-#include <map>
-#include <list>
-#include <vector>
-#include <algorithm>
-#include <cstring>
-
-#include <wrt_plugin_export.h>
-#include <js_overlay_types.h>
-
-#include "explorer.h"
-#include "plugin.h"
-#include "plugin_model.h"
-#include "javascript_interface.h"
-#include "js_function_manager.h"
-#include "plugin_container_support.h"
-
-#include "js_page_session.h"
-
-using namespace std;
-using namespace WrtDB;
-using namespace WrtPlugins::W3C;
-
-namespace {
-const char *LIBRARY_PATH_SEPARATOR = "/";
-}
-
-class PluginLogic::Impl
-{
-    PluginContainerSupportPtr m_pluginsSupport;
-
-    typedef std::map<JSContextRef, JSPageSessionPtr> PagesSessionsSet;
-    PagesSessionsSet m_sessions;
-    unsigned int m_windowHandle;
-
-  public:
-    Impl();
-    ~Impl();
-
-    // Widget session
-    void initSession(int widgetHandle);
-    void startSession(int widgetHandle,
-                      JSGlobalContextRef context,
-                      double scaleFactor,
-                      const char* encodedBundle,
-                      const char* theme);
-
-    void stopSession(JSGlobalContextRef context);
-
-    void performLibrariesUnload();
-
-    bool loadPluginOnDemand(const WrtDB::DbPluginHandle &pluginHandle,
-                            JavaScriptObject& parentObject,
-                            JSGlobalContextRef context);
-
-    void loadFrame(JSGlobalContextRef context);
-    void unloadFrame(JSGlobalContextRef context);
-
-    void setCustomProperties(JSGlobalContextRef ctx,
-                             double scaleFactor,
-                             const char* encodedBundle,
-                             const char* theme);
-
-    void dispatchJavaScriptEvent(JSGlobalContextRef ctx,
-                                 CustomEventType eventType,
-                                 void* data);
-
-    unsigned int windowHandle() const;
-    void setWindowHandle(unsigned int handle);
-
-    static bool s_sanityCheck;
-};
-
-IMPLEMENT_SINGLETON(PluginLogic);
-
-bool PluginLogic::Impl::s_sanityCheck = false;
-
-#define PLUGIN_LOGIC_SANITY_CHECK \
-    if (!s_sanityCheck) \
-    { \
-        _E("Object is not available. Wrong flow occured"); \
-        return; \
-    }
-
-PluginLogic::Impl::Impl() :
-    m_windowHandle(0)
-{
-    s_sanityCheck = true;
-
-    DPL::Log::LogSystemSingleton::Instance().SetTag("WRT_PLUGINS");
-    _D("Initializing Plugin Logic...");
-    m_pluginsSupport = PluginContainerSupportPtr(new PluginContainerSupport());
-
-    // explicit call to keep singleton's lifetime until calling destructor.
-    JsFunctionManagerSingleton::Instance();
-    JavaScriptInterfaceSingleton::Instance();
-}
-
-PluginLogic::Impl::~Impl()
-{
-    _D("called");
-
-    s_sanityCheck = false;
-
-    FOREACH(it, m_sessions)
-    {
-        _W("Must stop widget session before exit!");
-        it->second->stopSession();
-    }
-}
-
-void PluginLogic::initSession(int widgetHandle)
-{
-    m_impl->initSession(widgetHandle);
-}
-
-void PluginLogic::startSession(int widgetHandle,
-                               JSGlobalContextRef ctx,
-                               double scaleFactor,
-                               const char* encodedBundle,
-                               const char* theme)
-{
-    m_impl->startSession(widgetHandle, ctx, scaleFactor, encodedBundle, theme);
-}
-
-void PluginLogic::stopSession(JSGlobalContextRef context)
-{
-    m_impl->stopSession(context);
-}
-
-void PluginLogic::performLibrariesUnload()
-{
-    _W("This function is DEPRECATED");
-    //    m_impl->performLibrariesUnload();
-}
-
-bool PluginLogic::loadPluginOnDemand(
-    const WrtDB::DbPluginHandle &pluginHandle,
-    JavaScriptObject& parentObject,
-    JSGlobalContextRef context)
-{
-    return m_impl->loadPluginOnDemand(pluginHandle, parentObject, context);
-}
-
-void PluginLogic::loadPluginsIntoIframes(JSGlobalContextRef /*context*/)
-{
-    _W("This function is DEPRECATED");
-}
-
-void PluginLogic::setCustomProperties(double /*scaleFactor*/,
-                                      const char* /*encodedBundle*/,
-                                      const char* /*theme*/)
-{
-    _W("This function is DEPRECATED");
-}
-
-void PluginLogic::setCustomProperties(JSGlobalContextRef context,
-                                      double scaleFactor,
-                                      const char* encodedBundle,
-                                      const char* theme)
-{
-    m_impl->setCustomProperties(context, scaleFactor, encodedBundle, theme);
-}
-
-void PluginLogic::dispatchJavaScriptEvent(CustomEventType /*eventType*/)
-{
-    _W("This function is DEPRECATED");
-}
-
-void PluginLogic::dispatchJavaScriptEvent(JSGlobalContextRef context,
-                                          CustomEventType eventType,
-                                          void *data)
-{
-    m_impl->dispatchJavaScriptEvent(context, eventType, data);
-}
-
-void PluginLogic::loadFrame(JSGlobalContextRef context)
-{
-    m_impl->loadFrame(context);
-}
-
-void PluginLogic::unloadFrame(JSGlobalContextRef context)
-{
-    m_impl->unloadFrame(context);
-}
-
-unsigned int PluginLogic::windowHandle() const
-{
-    return m_impl->windowHandle();
-}
-
-void PluginLogic::setWindowHandle(unsigned int handle)
-{
-    m_impl->setWindowHandle(handle);
-}
-
-PluginLogic::PluginLogic() : m_impl(new PluginLogic::Impl())
-{}
-
-PluginLogic::~PluginLogic()
-{}
-
-void PluginLogic::Impl::initSession(int widgetHandle)
-{
-    _D(">---------------------[init session START]---------------------<");
-
-    m_pluginsSupport->Initialize(widgetHandle);
-    PluginContainerSupport::PluginsList rootPluginList =
-        m_pluginsSupport->getRootPlugins();
-
-    FOREACH(it, rootPluginList)
-    {
-        PluginModelPtr& pluginModel = *it;
-        PluginPtr pluginLib = pluginModel->LibraryInstance.Get();
-
-        if (!pluginLib) {
-            std::string path = pluginModel->LibraryPath.Get() +
-                std::string(LIBRARY_PATH_SEPARATOR) +
-                pluginModel->LibraryName.Get();
-
-            pluginLib = Plugin::LoadFromFile(path);
-
-            if (!pluginLib) {
-                _W("Loading library failed");
-            } else {
-                pluginModel->LibraryInstance.Set(pluginLib);
-                _D("pluginModel->LibraryInstance.Set() : %s",
-                   pluginLib->GetFileName().c_str());
-            }
-        } else {
-            _D("Already loaded");
-        }
-    }
-    _D("========== init session END ==========");
-}
-
-void PluginLogic::Impl::startSession(int widgetHandle,
-                                     JSGlobalContextRef context,
-                                     double scaleFactor,
-                                     const char* encodedBundle,
-                                     const char* theme)
-{
-    _D("========== start session START ==========");
-
-    if (!m_pluginsSupport->isInitialized(widgetHandle)) {
-        m_pluginsSupport->Initialize(widgetHandle);
-    }
-    auto sessionIt = m_sessions.find(context);
-
-    // Check if corresponding session if not already created
-    if (sessionIt != m_sessions.end()) {
-        _W("Session already started!");
-    } else {
-        auto newSession = JSPageSessionPtr(new JSPageSession(m_pluginsSupport));
-        newSession->startSession(widgetHandle,
-                                 context,
-                                 scaleFactor,
-                                 encodedBundle,
-                                 theme);
-
-        m_sessions[context] = newSession;
-    }
-    _D("========== start session END ==========");
-}
-
-void PluginLogic::Impl::stopSession(JSGlobalContextRef context)
-{
-    _D("========== stop session START ==========");
-
-    auto sessionIt = m_sessions.find(context);
-    if (sessionIt == m_sessions.end()) {
-        _W("Session not exist!");
-    } else {
-        sessionIt->second->stopSession();
-        m_sessions.erase(sessionIt);
-    }
-    _D("========== stop session END ==========");
-}
-
-bool PluginLogic::Impl::loadPluginOnDemand(
-    const WrtDB::DbPluginHandle &pluginHandle,
-    JavaScriptObject& parentObject,
-    JSGlobalContextRef context
-    )
-{
-    _D("========== load ondemand plugin ==========");
-
-    auto sessionIt = m_sessions.find(context);
-    if (sessionIt == m_sessions.end()) {
-        _W("Session not exist!");
-        return false;
-    }
-
-    return sessionIt->second->loadPluginOnDemand(pluginHandle,
-                                                 parentObject,
-                                                 context);
-}
-
-void PluginLogic::Impl::loadFrame(JSGlobalContextRef context)
-{
-    _D("========== load frame START ==========");
-    PLUGIN_LOGIC_SANITY_CHECK
-
-    auto sessionIt = m_sessions.find(context);
-    if (sessionIt == m_sessions.end()) {
-        _W("Session not exist!");
-    } else {
-        sessionIt->second->loadFrame(context);
-    }
-    _D("========== load frame END ==========");
-}
-
-void PluginLogic::Impl::unloadFrame(JSGlobalContextRef context)
-{
-    _D("========== unload frame START ==========");
-    PLUGIN_LOGIC_SANITY_CHECK
-
-    auto sessionIt = m_sessions.find(context);
-    if (sessionIt == m_sessions.end()) {
-        LogWarning("Session not exist!");
-    } else {
-        sessionIt->second->unloadFrame(context);
-
-        // I don't know why this session should be removed here.
-        // session list is removed also from stopSession().
-        //m_sessions.erase(sessionIt);
-        }
-    _D("========== unload frame END ==========");
-}
-
-void PluginLogic::Impl::setCustomProperties(JSGlobalContextRef context,
-                                            double scaleFactor,
-                                            const char* encodedBundle,
-                                            const char* theme)
-{
-    PLUGIN_LOGIC_SANITY_CHECK
-
-    auto sessionIt = m_sessions.find(context);
-    if (sessionIt == m_sessions.end()) {
-        _W("Session not exist!");
-        return;
-    }
-
-    sessionIt->second->setCustomProperties(scaleFactor,
-                                           encodedBundle,
-                                           theme);
-}
-
-void PluginLogic::Impl::dispatchJavaScriptEvent(JSGlobalContextRef context,
-                                                CustomEventType eventType,
-                                                void* data)
-{
-    PLUGIN_LOGIC_SANITY_CHECK
-
-    auto sessionIt = m_sessions.find(context);
-    if (sessionIt == m_sessions.end()) {
-        _W("Session not exist!");
-        return;
-    }
-
-    sessionIt->second->dispatchJavaScriptEvent(eventType, data);
-}
-
-unsigned int PluginLogic::Impl::windowHandle() const
-{
-    if (!s_sanityCheck) {
-        LogError("Object is not available. Wrong flow occured");
-    }
-    return m_windowHandle;
-}
-
-void PluginLogic::Impl::setWindowHandle(unsigned int handle)
-{
-    PLUGIN_LOGIC_SANITY_CHECK
-    m_windowHandle = handle;
-}
diff --git a/src_mobile/plugin-loading/plugin_model.cpp b/src_mobile/plugin-loading/plugin_model.cpp
deleted file mode 100644 (file)
index ee6dd6f..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * 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    plugin_model.cpp
- * @author  Pawel Sikorski (p.sikorski@samgsung.com)
- * @author  Przemyslaw Dobrowolski (p.dobrowolsk@samgsung.com)
- * @author  Grzegorz Krawczyk (g.krawczyk@samgsung.com)
- * @version
- * @brief   This file contains PluginModel, PluginHandle definitions.
- */
-
-#include "plugin_model.h"
-#include <dpl/event/model_bind_to_dao.h>
-#include <dpl/wrt-dao-ro/feature_dao_read_only.h>
-
-using namespace WrtDB;
-
-template <typename RetType, RetType(PluginDAOReadOnly::*extFun) () const >
-struct BindToPluginDAO :
-    DPL::Event::BindToDAO<PluginModel,
-                          RetType,
-                          WrtDB::DbPluginHandle,
-                          PluginDAOReadOnly,
-                          &PluginModel::getHandle,
-                          extFun>
-{};
-
-template <typename RetType, RetType(*extFun) (WrtDB::DbPluginHandle)>
-struct BindToFeatureDAOStatic :
-    DPL::Event::BindToDAO_Static<PluginModel,
-                                 RetType,
-                                 WrtDB::DbPluginHandle,
-                                 &PluginModel::getHandle,
-                                 extFun>
-{};
-
-PluginModel::PluginModel(const WrtDB::DbPluginHandle& handle) :
-    Handle(this, handle),
-    LibraryName(this,
-                BindToPluginDAO<std::string,
-                                &PluginDAOReadOnly::getLibraryName>::Get),
-    LibraryPath(this,
-                BindToPluginDAO<std::string,
-                                &PluginDAOReadOnly::getLibraryPath>::Get),
-    FeatureHandles(this,
-                   BindToFeatureDAOStatic<FeatureHandleListPtr,
-                                          FeatureDAOReadOnly::
-                                              GetFeatureHandleListForPlugin>::
-                       Get),
-    LibraryDependencies(this,
-                        BindToPluginDAO<PluginHandleSetPtr,
-                                        &PluginDAOReadOnly::
-                                            getLibraryDependencies>::Get),
-    LibraryInstance(this, PluginPtr())
-{}
-
-WrtDB::DbPluginHandle PluginModel::getHandle() const
-{
-    return Handle.Get();
-}
diff --git a/src_mobile/plugin-loading/plugin_property_support.cpp b/src_mobile/plugin-loading/plugin_property_support.cpp
deleted file mode 100644 (file)
index 7569de2..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * 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    plugin_property_support.cpp
- * @author  Yunchan Cho (yunchan.cho@samsung.com)
- * @version 1.0
- * @brief
- */
-
-#include "plugin_property_support.h"
-#include <dpl/log/secure_log.h>
-
-using namespace PluginModule;
-
-const char *NAVIGATOR_PROPERTY_NAME = "navigator";
-const char *SCALE_PROPERTY_NAME = "scale";
-const char *BUNDLE_PROPERTY_NAME = "__bundle";
-const char *THEME_PROPERTY_NAME = "theme";
-
-WindowPropertySupport::WindowPropertySupport(
-    JSGlobalContextRef context) :
-    m_scale(0),
-    m_bundle(""),
-    m_theme(""),
-    m_context(context)
-{}
-
-WindowPropertySupport::~WindowPropertySupport()
-{}
-
-float WindowPropertySupport::getScale() const
-{
-    return m_scale;
-}
-
-std::string WindowPropertySupport::getBundle() const
-{
-    return m_bundle;
-}
-
-std::string WindowPropertySupport::getTheme() const
-{
-    return m_theme;
-}
-
-JSGlobalContextRef WindowPropertySupport::getJSContext() const
-{
-    return m_context;
-}
-
-void WindowPropertySupport::setScaleToNavigatorProperty(const double scale)
-{
-    _D("set window.navigator.scale: %ld", scale);
-    m_scale = scale;
-    setPropertyToNavigator(SCALE_PROPERTY_NAME,
-                           JSValueMakeNumber(m_context, scale));
-}
-
-void WindowPropertySupport::setBundleToWindowProperty(const char* bundle)
-{
-    _D("set window.__bundle: %s", bundle);
-    if (bundle) {
-        m_bundle = bundle;
-        JSStringRef bundleString = JSStringCreateWithUTF8CString(bundle);
-        setPropertyToWindow(BUNDLE_PROPERTY_NAME,
-                            JSValueMakeString(m_context, bundleString));
-        JSStringRelease(bundleString);
-    }
-}
-
-void WindowPropertySupport::setThemeToNavigatorProperty(const char* theme)
-{
-    _D("set window.navigator.__theme: %s", theme);
-    if (theme) {
-        m_theme = theme;
-        JSStringRef themeString = JSStringCreateWithUTF8CString(theme);
-        setPropertyToNavigator(THEME_PROPERTY_NAME,
-                               JSValueMakeString(m_context, themeString));
-        JSStringRelease(themeString);
-    }
-}
-
-void WindowPropertySupport::setPropertyToWindow(const char* propertyName,
-                                                JSValueRef jsValue)
-{
-    _D("et property to window : %s", propertyName);
-    if (propertyName) {
-        JSObjectRef globalObject = JSContextGetGlobalObject(m_context);
-        JSStringRef propertyNameString =
-            JSStringCreateWithUTF8CString(propertyName);
-        JSObjectSetProperty(m_context,
-                            globalObject,
-                            propertyNameString,
-                            jsValue,
-                            kJSPropertyAttributeReadOnly,
-                            NULL);
-        JSStringRelease(propertyNameString);
-    }
-}
-
-void WindowPropertySupport::setPropertyToNavigator(const char* propertyName,
-                                                   JSValueRef jsValue)
-{
-    _D("set property to navigator : %s", propertyName);
-    if (propertyName) {
-        JSObjectRef globalObject = JSContextGetGlobalObject(m_context);
-
-        JSStringRef navigatorString =
-            JSStringCreateWithUTF8CString(NAVIGATOR_PROPERTY_NAME);
-        JSValueRef navigatorValue = JSObjectGetProperty(m_context,
-                                                        globalObject,
-                                                        navigatorString,
-                                                        NULL);
-
-        JSStringRef propertyNameString =
-            JSStringCreateWithUTF8CString(propertyName);
-        JSObjectSetProperty(m_context,
-                            JSValueToObject(m_context, navigatorValue, NULL),
-                            propertyNameString,
-                            jsValue,
-                            kJSPropertyAttributeReadOnly,
-                            NULL);
-
-        JSStringRelease(propertyNameString);
-        JSStringRelease(navigatorString);
-    }
-}
-
diff --git a/src_mobile/plugin-loading/plugin_property_support.h b/src_mobile/plugin-loading/plugin_property_support.h
deleted file mode 100644 (file)
index fc946c4..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * 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    plugin_property_support.h
- * @author  Yunchan Cho (yunchan.cho@samsung.com)
- * @version 1.0
- * @brief
- */
-
-#ifndef _PLUGIN_LOGIC_PROPERTY_SUPPORT_H_
-#define _PLUGIN_LOGIC_PROPERTY_SUPPORT_H_
-
-#include <string>
-#include <JavaScriptCore/JavaScript.h>
-
-namespace PluginModule {
-class WindowPropertySupport
-{
-  public:
-    float getScale() const;
-    std::string getBundle() const;
-    std::string getTheme() const;
-    JSGlobalContextRef getJSContext() const;
-
-    void setScaleToNavigatorProperty(const double scale);
-    void setBundleToWindowProperty(const char* bundle);
-    void setThemeToNavigatorProperty(const char* theme);
-
-    explicit WindowPropertySupport(JSGlobalContextRef m_context);
-    ~WindowPropertySupport();
-
-  private:
-    float m_scale;
-    std::string m_bundle;   // string of base64 encoded bundle
-    std::string m_theme;
-    JSGlobalContextRef m_context;
-
-    void setPropertyToWindow(const char* propertyName, JSValueRef jsValue);
-    void setPropertyToNavigator(const char* propertyName, JSValueRef jsValue);
-};
-} // namespace PluginModule
-
-#endif // _PLUGIN_LOGIC_PROPERTY_SUPPORT_H_
diff --git a/src_mobile/plugins-api-support/CallbackSupport.h b/src_mobile/plugins-api-support/CallbackSupport.h
deleted file mode 100644 (file)
index bcaa849..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (c) 2012 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   CallbackSupport.h
- * @author Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
- */
-
-#ifndef _WRT_PLUGINS_COMMON_PLUGIN_API_SUPPORT_CALLBACK_SUPPORT_H_
-#define _WRT_PLUGINS_COMMON_PLUGIN_API_SUPPORT_CALLBACK_SUPPORT_H_
-
-#include <map>
-#include <vector>
-#include <string>
-#include <dpl/foreach.h>
-
-namespace WrtPluginsApi {
-template<typename Sig>
-class CallbackSupport
-{
-  public:
-    typedef typename Sig::Signature SlotSignature;
-    typedef typename Sig::Type SlotType;
-    typedef std::string GroupType;
-    typedef std::vector<SlotType> SlotList;
-
-    void Connect(const GroupType& group, const SlotType& slot)
-    {
-        auto groupIt = m_slots.find(group);
-        if (m_slots.end() == groupIt) {
-            groupIt = m_slots.insert(std::make_pair(group, SlotList())).first;
-        }
-        groupIt->second.push_back(slot);
-    }
-
-    void Disconnect(const GroupType& group)
-    {
-        m_slots.erase(group);
-    }
-
-    template<typename ... Args>
-    void Invoke(const Args& ... args)
-    {
-        FOREACH(groupIt, m_slots)
-        {
-            FOREACH(slotIt, groupIt->second)
-            {
-                (*slotIt)(args ...);
-            }
-        }
-    }
-
-    template<typename ... Args>
-    void InvokeGroup(const GroupType& group, const Args& ... args)
-    {
-        auto groupIt = m_slots.find(group);
-
-        if (m_slots.end() != groupIt) {
-            FOREACH(slotIt, groupIt->second)
-            {
-                (*slotIt)(args ...);
-            }
-        }
-    }
-
-  private:
-    std::map<GroupType, SlotList> m_slots;
-};
-}
-#endif
diff --git a/src_mobile/plugins-api-support/ExportedApi.h b/src_mobile/plugins-api-support/ExportedApi.h
deleted file mode 100644 (file)
index 28886d0..0000000
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Copyright (c) 2012 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       ExportedApi.h
- * @author     Grzegorz Krawczyk (g.krawczyk@samsung.com)
- * @version    0.1
- * @brief
- */
-#ifndef _WRT_PLUGINS_COMMON_PLUGIN_API_SUPPORT_EXPORTED_API_H_
-#define _WRT_PLUGINS_COMMON_PLUGIN_API_SUPPORT_EXPORTED_API_H_
-
-#include <PluginRegistration.h>
-
-/**
- * This file provides definition of entry point to the plugin's shared library
- * used by wrt.
- *
- * Each plugin have to provide 1 symbol which is get by dlsym.
- * The name of required symbol is specified by 'GetExportedSymbolName' function
- * The type of this symbol is pointer to ExportedApi struct
- *
- * To allow access to your plugin, you have to:
- *
- * 1)define 3 functions:
- *  - Register,
- *  - Unregister,
- *  - GetProvidedFeatures
- *  (names are not important)
- *
- * 2)define global struct named "dll_api" and initialize it with above functions
- *   *Example:
- *    ExportedApi dll_api = {Register, Unregister, GetProvidedFeatures};
- *
- *
- * Detailed Example how the file with api may looks like file:
- *
- * #include <Commons/Exception.h>
- * #include <Commons/WrtAccess/WrtAccess.h>
- *
- * #include <Plugin.h>
- * #include <ObjectFactory.h>
- * #include <PluginRegistration.h>
- * #include <ExportedApi.h>
- *
- * #include "JSTest.h"
- * #include "plugin_config.h"
- *
- * #define OBJECT_WIDGET "widget"
- * #define OBJECT_TEST "__test"
- *
- *  using namespace WrtPlugins::W3C;
- *  using namespace WrtDeviceApis;
- *  using namespace WrtDeviceApis::Commons;
- *  using namespace WrtPluginsApi;
- *
- *  namespace W3CTest
- *  {
- *
- *  void on_widget_start_callback(int widgetId)
- *  {
- *
- *  }
- *
- *  void on_widget_stop_callback(int widgetId)
- *  {
- *  }
- *
- *  }
- *
- *  void Register(PluginRegistration& r)
- *  {
- *      Plugin* plugin = new Plugin();
- *
- *      auto test = ObjectFactory::createMainObject(
- *                          OBJECT_TEST,
- *                          WrtPlugins::W3C::JSTest::getClassRef,
- *                          OBJECT_WIDGET);
- *
- *      plugin->AddObject(test);
- *
- *      r.Connect<OnWidgetStart>(W3CTest::on_widget_start_callback);
- *
- *      r.Connect<OnWidgetStop>(W3CTest::on_widget_stop_callback);
- *
- *      r.AddPlugin(*plugin);
- *  }
- *
- *  void Unregister(PluginRegistration& r, Plugin* plugin)
- *  {
- *      r.DisconnectAll();
- *      delete plugin;
- *  }
- *
- *  void GetProvidedFeatures(feature_mapping_interface_t *mapping)
- *  {
- *      WrtPlugins::W3C::WidgetTestDeclarations::getMappingInterface(mapping);
- *  }
- *
- *  ExportedApi dll_api={Register, Unregister, GetProvidedFeatures};
- *
- * #undef OBJECT_WIDGET
- * #undef OBJECT_TEST
- *
- *
- * */
-
-//forward declaration
-struct feature_mapping_interface_s;
-typedef struct feature_mapping_interface_s feature_mapping_interface_t;
-
-extern "C" struct ExportedApi
-{
-    /*
-     * This function is invoked when library is loaded
-     * */
-    void (*Register)(WrtPluginsApi::PluginRegistration&);
-
-    /*
-     * This function is invoked when library is unloaded
-     * */
-    void (*Unregister)(WrtPluginsApi::PluginRegistration&,
-                       WrtPluginsApi::Plugin* plugin);
-
-    /*
-     * This function is invoked by wrt-plugins-installer to obtain
-     * info about features,functions,objects provided by plugin
-     * */
-    void (*GetProvidedFeatures)(feature_mapping_interface_t*);
-};
-
-constexpr const char* GetExportedSymbolName()
-{
-    return "dll_api";
-}
-
-#endif
diff --git a/src_mobile/plugins-api-support/IObject.h b/src_mobile/plugins-api-support/IObject.h
deleted file mode 100644 (file)
index 4148d91..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2012 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    IObject.h
- * @author  Grzegorz Krawczyk (g.krawczyk@samgsung.com)
- * @version
- * @brief
- */
-#ifndef _WRT_PLUGINS_COMMON_PLUGIN_API_SUPPORT_IOBJECT_H_
-#define _WRT_PLUGINS_COMMON_PLUGIN_API_SUPPORT_IOBJECT_H_
-
-#include <memory>
-#include <list>
-
-extern "C" {
-typedef struct OpaqueJSClass* (*ClassRef)();
-}
-
-namespace WrtPluginsApi {
-enum class IObjectType
-{
-    Object,
-    Function,
-    Interface,
-    InterfaceInstance
-};
-
-enum class IObjectOption
-{
-    Overlayed
-};
-
-class IObject;
-typedef std::shared_ptr<IObject> IObjectPtr;
-
-class IObject
-{
-  public:
-    constexpr static const char* WINDOW_OBJECT()
-    {
-        return "window";
-    }
-
-    virtual void AddChild(const IObjectPtr&) = 0;
-
-    /*
-     * Optional
-     * */
-    virtual void setBoolOption(IObjectOption option, bool value) = 0;
-
-    virtual ~IObject(){}
-};
-
-typedef std::list<IObjectPtr> IObjectsList;
-typedef std::shared_ptr<IObjectsList> IObjectsListPtr;
-}
-#endif
diff --git a/src_mobile/plugins-api-support/IObject_cast.h b/src_mobile/plugins-api-support/IObject_cast.h
deleted file mode 100644 (file)
index 105a31d..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (c) 2012 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    IObject_cast.h
- * @author
- * @version
- * @brief
- */
-#ifndef _WRT_PLUGINS_COMMON_PLUGINS_API_SUPPORT_CAST_H_
-#define _WRT_PLUGINS_COMMON_PLUGINS_API_SUPPORT_CAST_H_
-
-#include <memory>
-#include <IObject.h>
-#include <Object.h>
-
-namespace WrtPluginsApi {
-inline ObjectPtr CAST(const IObjectPtr& object)
-{
-    return std::dynamic_pointer_cast<Object>(object);
-}
-}
-#endif
diff --git a/src_mobile/plugins-api-support/Object.h b/src_mobile/plugins-api-support/Object.h
deleted file mode 100644 (file)
index 5417453..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright (c) 2012 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    IObject.h
- * @author  Grzegorz Krawczyk (g.krawczyk@samgsung.com)
- * @version
- * @brief
- */
-
-#ifndef _WRT_PLUGINS_COMMON_PLUGIN_API_SUPPORT_OBJECT_H_
-#define _WRT_PLUGINS_COMMON_PLUGIN_API_SUPPORT_OBJECT_H_
-
-#include <memory>
-#include <list>
-
-#include <IObject.h>
-#include <dpl/optional.h>
-
-namespace WrtPluginsApi {
-class Object;
-typedef std::shared_ptr<Object> ObjectPtr;
-
-struct ObjectOption
-{
-    DPL::Optional<bool> overlayedMode;
-};
-typedef std::shared_ptr<ObjectOption> ObjectOptionPtr;
-
-class Object : public IObject
-{
-  public:
-    Object(const char* name,
-           ClassRef ref,
-           IObjectType type = IObjectType::Object);
-
-    Object(const char* name,
-           ClassRef ref,
-           const char* parentName = IObject::WINDOW_OBJECT(),
-           IObjectType type = IObjectType::Object);
-
-    Object(const char* name,
-           ClassRef interfaceRef,
-           const char* interfaceName,
-           ClassRef constructorRef,
-           const char* parentName = IObject::WINDOW_OBJECT(),
-           IObjectType type = IObjectType::Object);
-
-    ~Object();
-
-    void AddChild(const IObjectPtr&);
-
-    void setBoolOption(IObjectOption option, bool value);
-
-    IObjectsListPtr GetChildren() const;
-
-    ClassRef GetClass() const;
-
-    /*
-     * Available only for object with type InterfaceInstance
-     * */
-    ClassRef GetClassConstructor() const;
-
-    const char* GetInterfaceName() const;
-
-    const char* GetName() const;
-
-    IObjectType GetType() const;
-
-    const char* GetParentName() const;
-
-    ObjectOptionPtr GetOptions() const;
-
-  private:
-    const char* m_name;
-    ClassRef m_classRef;
-
-    const char* m_parentName;
-
-    IObjectType m_type;
-
-    ClassRef m_interfaceRef;
-    const char* m_interfaceName;
-    ClassRef m_constructorRef;
-
-    ObjectOptionPtr m_options;
-
-    IObjectsListPtr m_children;
-};
-}
-
-#endif
diff --git a/src_mobile/plugins-api-support/ObjectFactory.cpp b/src_mobile/plugins-api-support/ObjectFactory.cpp
deleted file mode 100644 (file)
index b897399..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 2012 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    ObjectFactory.cpp
- * @author  Grzegorz Krawczyk (g.krawczyk@samgsung.com)
- * @version
- * @brief
- */
-
-#include "ObjectFactory.h"
-#include "Object.h"
-
-namespace WrtPluginsApi {
-namespace ObjectFactory {
-IObjectPtr createObject(
-    const char* name,
-    ClassRef ref,
-    IObjectType type)
-{
-    return IObjectPtr(new Object(name, ref, type));
-}
-
-IObjectPtr createMainObject(
-    const char* name,
-    ClassRef ref,
-    const char* parentName,
-    IObjectType type)
-{
-    return IObjectPtr(new Object(name, ref, parentName, type));
-}
-
-IObjectPtr createObjectWithInterface(
-    const char* name,
-    ClassRef interfaceRef,
-    const char* interfaceName,
-    ClassRef constructorRef,
-    const char* parentName,
-    IObjectType type)
-{
-    return IObjectPtr(new Object(name,
-                                 interfaceRef,
-                                 interfaceName,
-                                 constructorRef,
-                                 parentName,
-                                 type));
-}
-}
-}
diff --git a/src_mobile/plugins-api-support/ObjectFactory.h b/src_mobile/plugins-api-support/ObjectFactory.h
deleted file mode 100644 (file)
index 59bff1d..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2012 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    ObjectFactory.h
- * @author  Grzegorz Krawczyk (g.krawczyk@samgsung.com)
- * @version
- * @brief
- */
-#ifndef _WRT_PLUGINS_COMMON_PLUGIN_API_SUPPORT_OBJECT_FACTORY_H_
-#define _WRT_PLUGINS_COMMON_PLUGIN_API_SUPPORT_OBJECT_FACTORY_H_
-
-#include <memory>
-#include <IObject.h>
-
-namespace WrtPluginsApi {
-namespace ObjectFactory {
-IObjectPtr createObject(
-    const char* name,
-    ClassRef ref,
-    IObjectType type = IObjectType::Object);
-
-IObjectPtr createMainObject(
-    const char* name,
-    ClassRef ref,
-    const char* parentName = IObject::WINDOW_OBJECT(),
-    IObjectType type = IObjectType::Object);
-
-IObjectPtr createObjectWithInterface(
-    const char* name,
-    ClassRef interfaceRef,
-    const char* interfaceName,
-    ClassRef constructorRef,
-    const char* parentName = IObject::WINDOW_OBJECT(),
-    IObjectType type = IObjectType::Object);
-}
-}
-#endif
diff --git a/src_mobile/plugins-api-support/Plugin.cpp b/src_mobile/plugins-api-support/Plugin.cpp
deleted file mode 100644 (file)
index 6303c32..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2012 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    Plugin.cpp
- * @author  Grzegorz Krawczyk (g.krawczyk@samgsung.com)
- * @version
- * @brief
- */
-#include "Plugin.h"
-
-namespace WrtPluginsApi {
-void Plugin::AddObject(const IObjectPtr& object)
-{
-    m_objects->push_back(object);
-}
-
-IObjectsListPtr Plugin::GetObjects() const
-{
-    return m_objects;
-}
-
-Plugin::~Plugin()
-{}
-
-Plugin::Plugin() : m_objects(new IObjectsList())
-{}
-}
diff --git a/src_mobile/plugins-api-support/Plugin.h b/src_mobile/plugins-api-support/Plugin.h
deleted file mode 100644 (file)
index 5458714..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2012 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    Plugin.h
- * @author  Grzegorz Krawczyk (g.krawczyk@samgsung.com)
- * @version
- * @brief
- */
-#ifndef _WRT_PLUGINS_COMMON_PLUGIN_API_SUPPORT_PLUGIN_H_
-#define _WRT_PLUGINS_COMMON_PLUGIN_API_SUPPORT_PLUGIN_H_
-
-#include <list>
-#include <IObject.h>
-
-namespace WrtPluginsApi {
-class Plugin
-{
-  public:
-    void AddObject(const IObjectPtr& object);
-
-    IObjectsListPtr GetObjects() const;
-
-    Plugin();
-
-    virtual ~Plugin();
-
-  private:
-    IObjectsListPtr m_objects;
-};
-}
-
-#endif
diff --git a/src_mobile/plugins-api-support/PluginRegistration.cpp b/src_mobile/plugins-api-support/PluginRegistration.cpp
deleted file mode 100644 (file)
index 089fdec..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2012 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   PluginRegistration.cpp
- * @author Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
- */
-
-#include "PluginRegistration.h"
-
-#include "PluginRegistrationImpl.h"
-#include "Plugin.h"
-#include <dpl/assert.h>
-
-namespace WrtPluginsApi {
-PluginRegistration::PluginRegistration(Impl* impl) : m_impl(impl)
-{
-    Assert(impl != 0 && "impl is NULL");
-}
-
-template<typename SignalSignature>
-void PluginRegistration::Connect(const typename SignalSignature::Type& slot)
-{
-    m_impl->Connect<SignalSignature>(slot);
-}
-
-void PluginRegistration::DisconnectAll()
-{
-    m_impl->DisconnectAll();
-}
-
-void PluginRegistration::AddPlugin(Plugin& plugin)
-{
-    m_impl->AddPlugin(plugin);
-}
-
-#define EXPLICIT_INSTATIATE_PLUGIN_REGISTRATION(SignalSignature)               \
-    template void PluginRegistration::Connect<SignalSignature>(            \
-        const typename SignalSignature::Type &)
-
-EXPLICIT_INSTATIATE_PLUGIN_REGISTRATION(OnWidgetStart);
-EXPLICIT_INSTATIATE_PLUGIN_REGISTRATION(OnWidgetStop);
-EXPLICIT_INSTATIATE_PLUGIN_REGISTRATION(OnFrameLoad);
-EXPLICIT_INSTATIATE_PLUGIN_REGISTRATION(OnFrameUnload);
-}
diff --git a/src_mobile/plugins-api-support/PluginRegistration.h b/src_mobile/plugins-api-support/PluginRegistration.h
deleted file mode 100644 (file)
index e871a76..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2012 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   PluginRegistration.h
- * @author Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
- */
-
-#ifndef _WRT_PLUGINS_COMMON_PLUGIN_API_SUPPORT_PLUGIN_REGISTRATION_H_
-#define _WRT_PLUGINS_COMMON_PLUGIN_API_SUPPORT_PLUGIN_REGISTRATION_H_
-
-#include <memory>
-#include "Plugin.h"
-#include "PluginSignals.h"
-
-namespace WrtPluginsApi {
-class PluginRegistration
-{
-  public:
-    class Impl;
-
-    explicit PluginRegistration(PluginRegistration::Impl* impl);
-
-    template<typename SignalSignature>
-    void Connect(const typename SignalSignature::Type& slot);
-
-    void DisconnectAll();
-
-    void AddPlugin(Plugin& plugin);
-
-  private:
-    std::unique_ptr<Impl> m_impl;
-};
-}
-
-#endif
diff --git a/src_mobile/plugins-api-support/PluginRegistrationImpl.h b/src_mobile/plugins-api-support/PluginRegistrationImpl.h
deleted file mode 100644 (file)
index 1c17859..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2012 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   PluginRegistrationImpl.h
- * @author Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
- */
-
-#ifndef _WRT_PLUGINS_COMMON_PLUGIN_API_SUPPORT_PLUGIN_REGISTRATION_IMPL_H_
-#define _WRT_PLUGINS_COMMON_PLUGIN_API_SUPPORT_PLUGIN_REGISTRATION_IMPL_H_
-
-#include <string>
-#include "SignalsSupport.h"
-#include "Plugin.h"
-#include <dpl/log/log.h>
-
-namespace WrtPluginsApi {
-class PluginRegistration::Impl
-{
-  public:
-    Impl(SignalsSupport& registry, const std::string& libraryName) :
-        m_registry(registry),
-        m_libraryName(libraryName)
-    {}
-
-    void AddPlugin(Plugin& plugin)
-    {
-        m_registry.AddPlugin(m_libraryName, plugin);
-    }
-
-    template<typename T>
-    void Connect(const typename T::Type& slot)
-    {
-        m_registry.Connect<T>(m_libraryName, slot);
-    }
-
-    void DisconnectAll()
-    {
-        m_registry.Disconnect(m_libraryName);
-    }
-
-  private:
-    SignalsSupport& m_registry;
-    std::string m_libraryName;
-};
-}
-
-#endif
diff --git a/src_mobile/plugins-api-support/PluginRegistry.cpp b/src_mobile/plugins-api-support/PluginRegistry.cpp
deleted file mode 100644 (file)
index c4bc496..0000000
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * Copyright (c) 2012 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    PluginRegistry.h
- * @author  Grzegorz Krawczyk (g.krawczyk@samgsung.com)
- * @version
- * @brief
- */
-#include "PluginRegistry.h"
-#include "PluginRegistration.h"
-#include "PluginRegistrationImpl.h"
-#include "ExportedApi.h"
-
-#include <dlfcn.h>
-#include <cstdio>
-#include <cstdlib>
-#include <string>
-#include <algorithm>
-
-#include <dpl/log/log.h>
-#include <dpl/log/secure_log.h>
-#include <dpl/foreach.h>
-#include <dpl/scope_guard.h>
-
-namespace WrtPluginsApi {
-void PluginRegistry::AddPlugin(const std::string& libraryName,
-                               Plugin& plugin)
-{
-    LogDebug("Adding plugin for library: " << libraryName);
-
-    auto libraryIt = m_plugins.find(libraryName);
-    if (m_plugins.end() == libraryIt) {
-        m_plugins[libraryName] = &plugin;
-    }
-}
-
-Plugin* PluginRegistry::GetPlugin(const std::string& libraryName)
-{
-    auto it = m_plugins.find(libraryName);
-    if (it == m_plugins.end()) {
-        if (!LoadFromFile(libraryName)) {
-            LogError("Failed to load lib" << libraryName);
-            ThrowMsg(PluginNotFound, "Failed to load plugin");
-        }
-
-        return m_plugins[libraryName];
-    }
-
-    return it->second;
-}
-
-void PluginRegistry::RemovePlugin(const std::string& libraryName,
-                                  Plugin& plugin)
-{
-    auto it = m_plugins.find(libraryName);
-    if (it != m_plugins.end()) {
-        if (&plugin == it->second) {
-            m_plugins.erase(it);
-        }
-    }
-}
-
-void PluginRegistry::UnloadAll()
-{
-    LogDebug("Unload all plugins");
-
-    typedef void (*UnregisterFunction)(PluginRegistration&, Plugin&);
-
-    FOREACH(libraryIt, m_libraries)
-    {
-        auto pluginIt = m_plugins.find(libraryIt->first);
-        if (m_plugins.end() != pluginIt) {
-            void* handle = dlopen(libraryIt->first.c_str(), RTLD_NOW);
-            if (!handle) {
-                const char* error = (const char*)dlerror();
-                LogError("Error: " << (error != NULL ? error : "unknown"));
-                continue;
-            }
-            DPL_SCOPE_EXIT(handle) {
-                if (dlclose(handle) != 0) {
-                    const char* error = dlerror();
-                    if (error != NULL)
-                    {
-                        std::string errstr{error};
-                        _E("%s", errstr.c_str());
-                    }
-                    else
-                    {
-                        _E("unknown error while closing plug-in library");
-                    }
-                }
-            };
-
-            ExportedApi* entryPoint =
-                static_cast<ExportedApi*>
-                (dlsym(handle, GetExportedSymbolName()));
-            if (NULL == entryPoint) {
-                const char* error = (const char*)dlerror();
-                LogError("Error: " << (error != NULL ? error : "unknown"));
-                continue;
-            }
-            if (entryPoint->Unregister == NULL) {
-                LogError("Error Unregister function not set");
-                continue;
-            }
-
-            PluginRegistration registration(
-                new PluginRegistration::Impl(*this, libraryIt->first));
-
-            entryPoint->Unregister(registration, (pluginIt->second));
-
-            m_plugins.erase(pluginIt);
-        }
-        dlclose(libraryIt->second);
-    }
-}
-
-bool PluginRegistry::LoadFromFile(const std::string& libraryName)
-{
-    void* handle = dlopen(libraryName.c_str(), RTLD_NOW);
-    if (!handle) {
-        const char* error = (const char*)dlerror();
-        LogError("Error: " << (error != NULL ? error : "unknown"));
-        return false;
-    }
-    m_libraries[libraryName] = handle;
-
-    ExportedApi* entryPoint =
-        static_cast<ExportedApi*>(dlsym(handle, GetExportedSymbolName()));
-    if (NULL == entryPoint) {
-        const char* error = (const char*)dlerror();
-        LogError("Error: " << (error != NULL ? error : "unknown"));
-        return false;
-    }
-
-    if (entryPoint->Register == NULL) {
-        LogError("Error Register function not set");
-        return false;
-    }
-    if (entryPoint->Unregister == NULL) {
-        LogError("Error Unregister function not set");
-        return false;
-    }
-
-    PluginRegistration registration(
-        new PluginRegistration::Impl(*this, libraryName));
-    entryPoint->Register(registration);
-
-    return true;
-}
-
-PluginRegistry::~PluginRegistry()
-{
-    //TODO discuss ... when the unload should be called
-    //    UnloadAll();
-}
-}
diff --git a/src_mobile/plugins-api-support/PluginRegistry.h b/src_mobile/plugins-api-support/PluginRegistry.h
deleted file mode 100644 (file)
index 5db1ea4..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (c) 2012 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    PluginRegistry.h
- * @author  Grzegorz Krawczyk (g.krawczyk@samgsung.com)
- * @version
- * @brief
- */
-#ifndef _WRT_PLUGINS_COMMON_PLUGIN_LOADING_PLUGIN_REGISTRY_H_
-#define _WRT_PLUGINS_COMMON_PLUGIN_LOADING_PLUGIN_REGISTRY_H_
-
-#include <map>
-#include <string>
-#include "SignalsSupport.h"
-#include "Plugin.h"
-#include <dpl/exception.h>
-
-namespace WrtPluginsApi {
-typedef std::list<Plugin*> PluginsList;
-typedef std::shared_ptr<PluginsList> PluginsListPtr;
-typedef std::map< std::string, PluginsListPtr> PluginsSet;
-
-class PluginRegistry : public SignalsSupport
-{
-  public:
-    DECLARE_EXCEPTION_TYPE(DPL::Exception, Base)
-    DECLARE_EXCEPTION_TYPE(Base, PluginNotFound)
-
-    template <typename T, typename ... Args>
-    void Call(Args ... args)
-    {
-        Invoke<T>(args ...);
-    }
-
-    template <typename T, typename ... Args>
-    void CallGroup(const typename CallbackSupport<T>::GroupType& type,
-                   Args ... args)
-    {
-        InvokeGroup<T>(type, args ...);
-    }
-
-    void AddPlugin(const std::string& libraryName, Plugin& plugin);
-
-    /*
-     * @throw PluginNotFound
-     * */
-    Plugin* GetPlugin(const std::string& libraryName);
-
-    void RemovePlugin(const std::string& libraryName, Plugin& plugin);
-
-    void UnloadAll();
-
-    ~PluginRegistry();
-
-  private:
-    bool LoadFromFile(const std::string& libraryName);
-
-    typedef void* Symbol;
-
-    std::map<std::string, Plugin*> m_plugins;
-    std::map<std::string, void*> m_libraries;
-};
-
-typedef std::shared_ptr<PluginRegistry> PluginRegistryPtr;
-}
-
-#endif
diff --git a/src_mobile/plugins-api-support/PluginSignals.h b/src_mobile/plugins-api-support/PluginSignals.h
deleted file mode 100644 (file)
index 556d620..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (c) 2012 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   PluginSignals.h
- * @author Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
- */
-
-#ifndef _WRT_PLUGINS_COMMON_PLUGIN_API_SUPPORT_PLUGIN_SIGNALS_H_
-#define _WRT_PLUGINS_COMMON_PLUGIN_API_SUPPORT_PLUGIN_SIGNALS_H_
-
-#include "SignalSignature.h"
-
-namespace WrtPluginsApi {
-struct OnWidgetStart : SignalSignature<void (int)> {};
-
-struct OnWidgetStop : SignalSignature<void (int)> {};
-
-struct OnFrameLoad : SignalSignature<void (void*)> {};
-
-struct OnFrameUnload : SignalSignature<void (void*)> {};
-}
-
-#endif
diff --git a/src_mobile/plugins-api-support/SignalSignature.h b/src_mobile/plugins-api-support/SignalSignature.h
deleted file mode 100644 (file)
index b43747e..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 2012 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   SignalSignature.h
- * @author Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
- */
-
-#ifndef _WRT_PLUGINS_COMMON_PLUGIN_API_SUPPORT_SIGNAL_SIGNATURE_H_
-#define _WRT_PLUGINS_COMMON_PLUGIN_API_SUPPORT_SIGNAL_SIGNATURE_H_
-
-#include <functional>
-
-namespace WrtPluginsApi {
-template<typename> struct SignalSignature;
-
-template<typename R, typename ... Args>
-struct SignalSignature<R(Args ...)>
-{
-    typedef R (*Signature)(Args ...);
-    typedef std::function<R(Args ...)> Type;
-};
-}
-
-#endif
diff --git a/src_mobile/plugins-api-support/SignalsSupport.h b/src_mobile/plugins-api-support/SignalsSupport.h
deleted file mode 100644 (file)
index 9c47af2..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright (c) 2012 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    IPluginRegistry.h
- * @author  Grzegorz Krawczyk (g.krawczyk@samgsung.com)
- * @version
- * @brief
- */
-
-#ifndef _WRT_PLUGINS_COMMON_PLUGIN_API_SUPPORT_SIGNALS_SUPPORT_H_
-#define _WRT_PLUGINS_COMMON_PLUGIN_API_SUPPORT_SIGNALS_SUPPORT_H_
-
-#include <tuple>
-#include <string>
-#include "CallbackSupport.h"
-#include "tuple.h"
-#include "PluginSignals.h"
-#include "Plugin.h"
-
-namespace WrtPluginsApi {
-class SignalsSupport
-{
-  public:
-    virtual ~SignalsSupport() {}
-
-    template<typename T>
-    void Connect(const std::string& libraryName, const typename T::Type& slot)
-    {
-        Tuple::get_by_type<CallbackSupport<T> >(m_slots).Connect(libraryName,
-                                                                 slot);
-    }
-
-    void Disconnect(const std::string& libraryName)
-    {
-        DisconnectGroup(m_slots, libraryName);
-    }
-
-    virtual void AddPlugin(const std::string& libraryName, Plugin& plugin) = 0;
-
-  protected:
-    template<typename T, typename ... Args>
-    void Invoke(const Args& ... args)
-    {
-        Tuple::get_by_type<CallbackSupport<T> >(m_slots).Invoke(args ...);
-    }
-
-    template<typename T, typename ... Args>
-    void InvokeGroup(const std::string& libraryName, const Args& ... args)
-    {
-        Tuple::get_by_type<CallbackSupport<T> >(m_slots).InvokeGroup(
-            libraryName,
-            args ...);
-    }
-
-  private:
-    template<int N, typename ... Args>
-    void DisconnectSlot(std::tuple<Args ...>& slots,
-                        const std::string& libraryName,
-                        typename std::enable_if<(N >= 0)>::type* = NULL)
-    {
-        std::get<N>(slots).Disconnect(libraryName);
-        DisconnectSlot<N - 1>(slots, libraryName);
-    }
-
-    template<int N, typename ... Args>
-    void DisconnectSlot(std::tuple<Args ...>& /*slots*/,
-                        const std::string& /*libraryName*/,
-                        typename std::enable_if<(N == -1)>::type* = NULL)
-    {}
-
-    template<typename ... Args>
-    void DisconnectGroup(std::tuple<Args ...>& slots,
-                         const std::string& libraryName)
-    {
-        DisconnectSlot<sizeof ... (Args)-1>(slots, libraryName);
-    }
-
-    std::tuple<CallbackSupport<OnWidgetStart>,
-               CallbackSupport<OnWidgetStop>,
-               CallbackSupport<OnFrameLoad>,
-               CallbackSupport<OnFrameUnload> > m_slots;
-};
-}
-
-#endif
diff --git a/src_mobile/plugins-api-support/SoFeatures.h b/src_mobile/plugins-api-support/SoFeatures.h
deleted file mode 100644 (file)
index a42963e..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (c) 2012 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
- * @author
- * @version
- * @brief    TODO This header must be removed because it does not fit to current
- * solution, its just a temporary approach.
- */
-#ifndef _WRT_PLUGINS_COMMON_FEATURE_API_SO_FEATURES_H_
-#define _WRT_PLUGINS_COMMON_FEATURE_API_SO_FEATURES_H_
-
-#define PLUGIN_WIDGET_INIT_PROC_NAME         "on_widget_init"
-//#define PLUGIN_WIDGET_INIT_PROC_NAME \
-//    "_Z23on_widget_init_callbackP27feature_mapping_interface_s"
-
-//TODO remove
-/*
- * list of device caps
- */
-typedef struct devcaps_s
-{
-    char** deviceCaps;
-    size_t devCapsCount;
-} devcaps_t;
-
-/*
- * mapping from a feature to corresponding list of device capabilities
- */
-typedef struct feature_devcaps_s
-{
-    char* feature_name;
-    devcaps_t devCaps;
-} feature_devcaps_t;
-
-/*
- * list of feature_devcaps_t structs
- */
-typedef struct feature_mapping_s
-{
-    feature_devcaps_t* features;
-    size_t featuresCount;
-} feature_mapping_t;
-
-typedef feature_mapping_t* pfeature_mapping_t;
-
-typedef pfeature_mapping_t (*features_getter)(void);
-
-typedef const devcaps_t* (*devcaps_getter)(pfeature_mapping_t /*features*/,
-                                           const char* /*featureName*/);
-typedef void (*deinitializer)(pfeature_mapping_t /*features*/);
-
-typedef struct feature_mapping_interface_s
-{
-    features_getter featGetter;  /* returns a list of api features */
-    devcaps_getter dcGetter;     /*
-                                  * for a given api feature returns a list of
-                                  * corresponding device capabilities
-                                  */
-
-    deinitializer release;       /* as memory ownership of features is
-                                  * transfered to callee you have to call
-                                  * the release function ptr on features
-                                  */
-} feature_mapping_interface_t;
-
-typedef void (*on_widget_init_proc)(feature_mapping_interface_t *interface);
-
-#endif
diff --git a/src_mobile/plugins-api-support/detail/traits.h b/src_mobile/plugins-api-support/detail/traits.h
deleted file mode 100644 (file)
index 7ab56db..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 2012 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   traits.h
- * @author Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
- */
-
-#ifndef _WRT_PLUGINS_COMMON_PLUGIN_API_SUPPORT_DETAIL_TRAITS_H_
-#define _WRT_PLUGINS_COMMON_PLUGIN_API_SUPPORT_DETAIL_TRAITS_H_
-
-namespace WrtPluginsApi {
-namespace Traits {
-namespace Detail {
-template<size_t, typename RequiredType, typename ... TupleArgTypes>
-struct index_of_;
-
-/*
- * CurrentArgType is not equal to RequiredType, check next tuple's argument
- */
-template<size_t n,
-         typename RequiredType,
-         typename CurrentArgType,
-         typename ... TupleArgTypes>
-struct index_of_<n, RequiredType, CurrentArgType, TupleArgTypes ...>
-{
-    static const size_t value = index_of_<n + 1,
-                                          RequiredType,
-                                          TupleArgTypes ...>::value;
-};
-
-/*
- * RequiredType found on tuple's args list
- * return position on tuple's list
- */
-template<size_t n, typename RequiredType, typename ... TupleArgTypes>
-struct index_of_<n, RequiredType, RequiredType, TupleArgTypes ...>
-{
-    static const size_t value = n;
-};
-
-/*
- * RequiredType found on last position of tuple's args list
- * return position on tuple's list
- */
-template<size_t n, typename RequiredType>
-struct index_of_<n, RequiredType, RequiredType>
-{
-    static const size_t value = n;
-};
-
-/*
- * RequiredType was not found on tuple args list
- */
-template<size_t n, typename RequiredType, typename LastArgType>
-struct index_of_<n, RequiredType, LastArgType>
-{
-    static const size_t value = -1;
-};
-}
-}
-}
-
-#endif
diff --git a/src_mobile/plugins-api-support/js_types.h b/src_mobile/plugins-api-support/js_types.h
deleted file mode 100644 (file)
index 387c5bc..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2012 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        js_types.h
- * @author      Grzegorz Krawczyk (g.krawczyk@samsung.com)
- * @version     1.0
- */
-
-#ifndef WRT_PLUGIN_COMMON_API_SUPPORT_JS_TYPES_H_
-#define WRT_PLUGIN_COMMON_API_SUPPORT_JS_TYPES_H_
-
-#include <string>
-
-//forward declaration
-extern "C" {
-typedef struct OpaqueJSContext* JSGlobalContextRef;
-typedef struct OpaqueJSValue* JSObjectRef;
-}
-
-namespace WrtPluginsApi {
-struct JavaScriptObject
-{
-    JSObjectRef instance;
-    std::string name;
-};
-}
-
-#endif
diff --git a/src_mobile/plugins-api-support/traits.h b/src_mobile/plugins-api-support/traits.h
deleted file mode 100644 (file)
index 286c510..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2012 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   traits.h
- * @author Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
- */
-
-#ifndef _WRT_PLUGINS_COMMON_PLUGIN_API_SUPPORT_TRAITS_H_
-#define _WRT_PLUGINS_COMMON_PLUGIN_API_SUPPORT_TRAITS_H_
-
-#include "detail/traits.h"
-
-namespace WrtPluginsApi {
-namespace Traits {
-/**
- * Gets index of specified type in the type list.
- */
-template<typename RequiredType, typename ... TupleArgTypes>
-struct index_of
-{
-    static const size_t value = Detail::index_of_<0,
-                                                  RequiredType,
-                                                  TupleArgTypes ...>::value;
-};
-}
-}
-
-#endif
diff --git a/src_mobile/plugins-api-support/tuple.h b/src_mobile/plugins-api-support/tuple.h
deleted file mode 100644 (file)
index ec7c3b3..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 2012 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   tuple.h
- * @author Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
- */
-
-#ifndef _WRT_PLUGINS_COMMON_PLUGIN_API_SUPPORT_TUPLE_H_
-#define _WRT_PLUGINS_COMMON_PLUGIN_API_SUPPORT_TUPLE_H_
-
-#include <tuple>
-#include "traits.h"
-
-namespace WrtPluginsApi {
-namespace Tuple {
-template<typename T, typename ... Args>
-T& get_by_type(std::tuple<Args ...>& tuple)
-{
-    return std::get<Traits::index_of<T, Args ...>::value>(tuple);
-}
-}
-}
-
-#endif
diff --git a/src_mobile/plugins-installer/CMakeLists.txt b/src_mobile/plugins-installer/CMakeLists.txt
deleted file mode 100644 (file)
index 6c01a00..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-# 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     CMakeLists.txt
-# @author   Andrzej Surdej (a.surdej@samsung.com)
-# @version  1.0
-#
-
-SET(TARGET_PLUGINS_INSTALLER "wrt-plugins-installer")
-
-SET(WRT_PLUGINS_INSTALLER_SRC_DIR
-    ${CMAKE_CURRENT_SOURCE_DIR}
-)
-
-PKG_CHECK_MODULES(PLUGINS_INSTALLER_DEPS
-    libxml-2.0
-    cert-svc-vcore
-    dpl-efl
-    dpl-wrt-dao-rw
-    libpcrecpp
-    REQUIRED
-)
-
-INCLUDE_DIRECTORIES(
-    ${WRT_PLUGINS_INSTALLER_SRC_DIR}
-    ${PLUGINS_INSTALLER_INCLUDES}
-    ${PLUGINS_INSTALLER_DEPS_INCLUDE_DIRS}
-    ${PLUGINS_API_SUPPORT_DIRS}
-)
-
-SET(WRT_PLUGINS_INSTALLER_SOURCES
-    ${WRT_PLUGINS_INSTALLER_SRC_DIR}/wrt_plugins_installer.cpp
-    ${WRT_PLUGINS_INSTALLER_SRC_DIR}/plugin_installer.cpp
-    ${WRT_PLUGINS_INSTALLER_SRC_DIR}/plugin_utils.cpp
-    ${WRT_PLUGINS_INSTALLER_SRC_DIR}/plugin_objects.cpp
-    ${WRT_PLUGINS_INSTALLER_SRC_DIR}/plugin_metafile_reader.cpp
-)
-
-ADD_DEFINITIONS(${PLUGINS_INSTALLER_DEPS_CFLAGS})
-ADD_DEFINITIONS(${PLUGINS_INSTALLER_DEPS_CFLAGS_OTHERS})
-
-ADD_EXECUTABLE(${TARGET_PLUGINS_INSTALLER}
-    ${WRT_PLUGINS_INSTALLER_SOURCES}
-)
-
-TARGET_LINK_LIBRARIES(${TARGET_PLUGINS_INSTALLER}
-    ${PLUGINS_INSTALLER_DEPS_LIBRARIES}
-    ${TARGET_PLUGINS_API_SUPPORT} "-ldl"
-)
-
-SET_TARGET_PROPERTIES(${TARGET_PLUGINS_INSTALLER} PROPERTIES
-    LINK_FLAGS "-Wl,--as-needed -Wl,--hash-style=both"
-    BUILD_WITH_INSTALL_RPATH ON
-    INSTALL_RPATH_USE_LINK_PATH ON
-)
-
-INSTALL(TARGETS ${TARGET_PLUGINS_INSTALLER} DESTINATION bin)
diff --git a/src_mobile/plugins-installer/DESCRIPTION b/src_mobile/plugins-installer/DESCRIPTION
deleted file mode 100644 (file)
index 0e8c571..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-!!!options!!! stop
-Widget (un)installer, plugin (un)installer
diff --git a/src_mobile/plugins-installer/plugin_installer.cpp b/src_mobile/plugins-installer/plugin_installer.cpp
deleted file mode 100644 (file)
index 645bc72..0000000
+++ /dev/null
@@ -1,711 +0,0 @@
-/*
- * Copyright (c) 2012 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    plugin_installer.cpp
- * @author  Andrzej Surdej(a.surdej@samgsung.com)
- * @version
- * @brief
- */
-
-#include "plugin_installer.h"
-
-#include <sys/stat.h>
-#include <cstdio>
-#include <dlfcn.h>
-#include <string>
-
-#include <vcore/VCore.h>
-#include <libxml/parser.h>
-
-#include "plugin_objects.h"
-#include "plugin_metafile_reader.h"
-#include "plugin_installer_errors.h"
-
-#include <Plugin.h>
-#include <IObject_cast.h>
-//#include <SoFeatures.h>
-#include <plugin_utils.h>
-#include <ExportedApi.h>
-
-#include <wrt-commons/wrt_plugin_export.h>
-
-#include <dpl/log/log.h>
-#include <dpl/exception.h>
-#include <dpl/wrt-dao-ro/global_config.h>
-#include <dpl/wrt-dao-rw/plugin_dao.h>
-#include <dpl/wrt-dao-rw/feature_dao.h>
-#include <dpl/foreach.h>
-#include <dpl/wrt-dao-ro/WrtDatabase.h>
-
-#include <dpl/singleton_impl.h>
-
-using namespace WrtDB;
-using namespace WrtPluginsApi;
-
-IMPLEMENT_SINGLETON(PluginsInstaller)
-
-namespace {
-const std::string DIRECTORY_SEPARATOR = std::string("/");
-}
-
-const int PluginsInstaller::INSTALLATION_ERROR = -1;
-
-PluginsInstaller::PluginsInstaller() :
-    m_initialized(false)
-{
-    LogDebug("PluginsInstaller created.");
-}
-PluginsInstaller::~PluginsInstaller()
-{
-    LogDebug("PluginsInstaller destroyed.");
-}
-
-void PluginsInstaller::checkDatabaseTablesExistance()
-{
-    if (!WrtDB::WrtDatabase::CheckTableExist("FeaturesList") ||
-        !WrtDB::WrtDatabase::CheckTableExist("PluginProperties") ||
-        !WrtDB::WrtDatabase::CheckTableExist("PluginDependencies") ||
-        !WrtDB::WrtDatabase::CheckTableExist("PluginImplementedObjects") ||
-        !WrtDB::WrtDatabase::CheckTableExist("PluginRequiredObjects") ||
-        !WrtDB::WrtDatabase::CheckTableExist("DeviceCapabilities") ||
-        !WrtDB::WrtDatabase::CheckTableExist("FeatureDeviceCapProxy"))
-    {
-        LogError("Wrong database. Required tables not exist.");
-        deinitialize();
-        Assert(false && "Wrong database. Required tables not exist.");
-    }
-}
-
-bool PluginsInstaller::initialize()
-{
-    LogDebug("Initializing required systems.");
-
-    // Check paths
-    if (!PluginUtils::checkPaths()) {
-        return false;
-    }
-    // Initialize ValidationCore - this must be done before AttachDatabases
-    ValidationCore::VCoreInit(
-        std::string(GlobalConfig::GetFingerprintListFile()),
-        std::string(GlobalConfig::GetFingerprintListSchema()),
-        std::string(GlobalConfig::GetVCoreDatabaseFilePath()));
-
-    xmlInitParser();
-    WrtDB::WrtDatabase::attachToThreadRW();
-    ValidationCore::AttachToThreadRW();
-    checkDatabaseTablesExistance();
-    LogDebug("Initialized.");
-    m_initialized = true;
-    return true;
-}
-
-void PluginsInstaller::deinitialize()
-{
-    LogDebug("Shuting systems down.");
-    m_initialized = false;
-    ValidationCore::DetachFromThread();
-    WrtDB::WrtDatabase::detachFromThread();
-    ValidationCore::VCoreDeinit();
-    xmlCleanupParser();
-    LogDebug("Done");
-}
-
-PluginsInstaller::ReturnStatus PluginsInstaller::installPlugin(
-    const std::string& libPath)
-{
-    if (!m_initialized) {
-        LogError("Plugins installer not initialized.");
-        return ReturnStatus::NotInitialized;
-    }
-    LogDebug("Plugin installation started. Checking path: " << libPath);
-
-    if (!PluginUtils::checkPath(libPath)) {
-        return ReturnStatus::WrongPluginPath;
-    }
-
-    LogDebug("Plugin path ok. Searching for config file...");
-
-    std::string metaFileName = libPath + DIRECTORY_SEPARATOR +
-        std::string(WrtDB::GlobalConfig::GetPluginMetafileName());
-    if (PluginUtils::checkFileExistance(metaFileName)) {
-        return installPluginFromMetafile(libPath, metaFileName);
-    }
-
-    PluginMetafileData pluginInfo;
-    pluginInfo.m_libraryName = getLibraryName(libPath);
-
-    LogDebug(
-        "Config file done. Lib name: " << pluginInfo.m_libraryName
-                                       <<
-        ". Searching for installed plugin...");
-
-    if (WrtDB::PluginDAO::isPluginInstalled(pluginInfo.m_libraryName)) {
-        LogDebug("Plugin already installed.");
-        return ReturnStatus::AlreadyInstalled;
-    }
-    LogDebug("Plugin not installed. Loading library file...");
-
-    PluginObjectsPtr libraryObjects;
-    PluginHandle pluginHandle;
-
-    std::string filename = libPath + DIRECTORY_SEPARATOR +
-        pluginInfo.m_libraryName;
-
-    LogDebug("Loading plugin: " << filename);
-
-    Plugin* plugin;
-    Try
-    {
-        plugin = m_registry.GetPlugin(filename);
-    }
-    Catch(DPL::Exception) {
-        LogError("Loading library failed " << filename);
-        return ReturnStatus::LoadingLibraryError;
-    }
-    libraryObjects = PluginObjectsPtr(new PluginObjects());
-
-    LogDebug("#####");
-    LogDebug("##### Plugin: " << filename << " supports new plugin API");
-    LogDebug("#####");
-
-    FOREACH(o, *plugin->GetObjects()) {
-        libraryObjects->addObjects(CAST(*o)->GetParentName(),
-                                   CAST(*o)->GetName());
-
-        LogDebug("[Parent << Object] " << CAST(*o)->GetParentName()
-                                       << " << "
-                                       << CAST(*o)->GetName());
-
-        registerObjects(libraryObjects, plugin->GetObjects());
-    }
-
-    if (!fillMappingInterfaces(pluginInfo, filename)) {
-        m_registry.RemovePlugin(filename, *plugin);
-        return ReturnStatus::LoadingLibraryError;
-    }
-
-    LogDebug("Library loaded. Registering plugin...");
-
-    Try
-    {
-        pluginHandle =
-            PluginDAO::registerPlugin(pluginInfo, libPath);
-
-        LogDebug("Plugin registered. Registering features...");
-
-        FOREACH(it, pluginInfo.m_featureContainer)
-        {
-            LogError("PluginHandle: " << pluginHandle);
-            FeatureDAO::RegisterFeature(*it, pluginHandle);
-        }
-
-        LogDebug("Features registered. Registering objects...");
-
-        registerPluginObjects(pluginHandle, libraryObjects);
-
-        LogDebug("Registration done. Resolving dependencies...");
-
-        //TODO: can it be replaced with resolvePluginDependencies(handle)
-        if (!registerAndUpdateInstallation(pluginHandle, libraryObjects)) {
-            return ReturnStatus::InstallationWaiting;
-        }
-    } Catch(DPL::Exception) {
-        LogError("Failed to make database entry.");
-        return ReturnStatus::DatabaseError;
-    }
-
-    LogDebug("Plugin installed successfully.");
-    return ReturnStatus::Success;
-}
-
-PluginObjectsPtr PluginsInstaller::loadLibraryFromMetafile(
-    const std::string& libName) const
-{
-    LogDebug("Loading library: " << libName);
-
-    void *dlHandle = dlopen(libName.c_str(), RTLD_NOW);
-    if (dlHandle == NULL) {
-        const char* error = (const char*)dlerror();
-        LogError(
-            "Failed to load plugin: " << libName <<
-            ". Reason: " << (error != NULL ? error : "unknown"));
-        ThrowMsg(PluginInstall::Exceptions::LibraryException, "Library error");
-    }
-
-    const js_entity_definition_t *rawEntityList = NULL;
-    get_widget_entity_map_proc *getWidgetEntityMapProcPtr = NULL;
-
-    getWidgetEntityMapProcPtr =
-        reinterpret_cast<get_widget_entity_map_proc *>(dlsym(dlHandle,
-                                                             PLUGIN_GET_CLASS_MAP_PROC_NAME));
-
-    if (getWidgetEntityMapProcPtr) {
-        rawEntityList = (*getWidgetEntityMapProcPtr)();
-    } else {
-        rawEntityList =
-            static_cast<const js_entity_definition_t *>(dlsym(dlHandle,
-                                                              PLUGIN_CLASS_MAP_NAME));
-    }
-
-    if (rawEntityList == NULL) {
-        dlclose(dlHandle);
-        LogError("Failed to read class name" << libName);
-        ThrowMsg(PluginInstall::Exceptions::LibraryException, "Library error");
-    }
-
-    PluginObjectsPtr libraryObjects = PluginObjectsPtr(new PluginObjects());
-    const js_entity_definition_t *rawEntityListIterator = rawEntityList;
-
-    LogDebug("#####");
-    LogDebug("##### Plugin: " << libName << " is using deprecated API");
-    LogDebug("#####");
-
-    while (rawEntityListIterator->parent_name != NULL &&
-           rawEntityListIterator->object_name != NULL)
-    {
-        LogDebug("#####     [" << rawEntityListIterator->object_name << "]: ");
-        LogDebug("#####     Parent: " << rawEntityListIterator->parent_name);
-        LogDebug("#####");
-
-        libraryObjects->addObjects(rawEntityListIterator->parent_name,
-                                   rawEntityListIterator->object_name);
-
-        ++rawEntityListIterator;
-    }
-
-    // Unload library
-    if (dlclose(dlHandle) != 0) {
-        LogError("Cannot close plugin handle");
-    } else {
-        LogDebug("Library is unloaded");
-    }
-
-    // Load export table
-    LogDebug("Library successfuly loaded and parsed");
-
-    return libraryObjects;
-}
-
-PluginsInstaller::ReturnStatus PluginsInstaller::installPluginFromMetafile(
-    const std::string& path, const std::string& metaFilePath)
-{
-    if (!m_initialized) {
-        LogError("Plugins installer not initialized.");
-        return ReturnStatus::NotInitialized;
-    }
-    OptionalPluginMetafileData pluginData;
-    Try
-    {
-        pluginData = parseMetafile(metaFilePath);
-    }
-    Catch(PluginInstall::Exceptions::XMLFileParsingException)
-    {
-        LogError("Parsing metafile failed.");
-        return ReturnStatus::MetafileError;
-    }
-    if (pluginData.IsNull()) {
-        return ReturnStatus::MetafileError;
-    }
-
-    if (WrtDB::PluginDAO::isPluginInstalled(pluginData->m_libraryName)) {
-        LogDebug("Plugin already installed.");
-        return ReturnStatus::AlreadyInstalled;
-    }
-    Try {
-        LogError(
-            "path is: " << path << ", libraryName: " <<
-            pluginData->m_libraryName);
-        PluginObjectsPtr objects = loadLibraryFromMetafile(
-                path + DIRECTORY_SEPARATOR + pluginData->m_libraryName);
-
-        PluginHandle pluginHandle =
-            PluginDAO::registerPlugin(*pluginData, path);
-
-        LogDebug("Plugin registered. Registering features...");
-
-        FOREACH(it, pluginData->m_featureContainer)
-        {
-            LogError("PluginHandle: " << pluginHandle);
-            FeatureDAO::RegisterFeature(*it, pluginHandle);
-        }
-
-        LogDebug("Features registered. Registering objects...");
-
-        registerPluginObjects(pluginHandle, objects);
-
-        LogDebug("Objects registered. Finishing...");
-
-        if (!registerAndUpdateInstallation(pluginHandle, objects)) {
-            return ReturnStatus::InstallationWaiting;
-        }
-    } Catch(DPL::Exception) {
-        LogError("Failed to make database entry.");
-        return ReturnStatus::DatabaseError;
-    }
-
-    LogDebug("Plugin installed successfully.");
-    return ReturnStatus::Success;
-}
-
-int PluginsInstaller::installAllPlugins()
-{
-    if (!m_initialized) {
-        LogError("Plugins installer not initialized.");
-        return INSTALLATION_ERROR;
-    }
-    LogDebug("Installing plugins ...");
-
-    std::string PLUGIN_PATH = std::string(GlobalConfig::GetDevicePluginPath());
-
-    DIR *dir;
-    dir = opendir(PLUGIN_PATH.c_str());
-
-    if (!dir) {
-        return INSTALLATION_ERROR;
-    }
-
-    LogDebug("Plugin DIRECTORY IS" << PLUGIN_PATH);
-    int return_code;
-    struct dirent libdir;
-    struct dirent* result;
-
-    errno = 0;
-
-    std::list<std::string> pluginsPaths;
-
-    for (return_code = readdir_r(dir, &libdir, &result);
-            result != NULL && return_code == 0;
-            return_code = readdir_r(dir, &libdir, &result)) {
-        if (strcmp(libdir.d_name, ".") == 0 ||
-            strcmp(libdir.d_name, "..") == 0)
-        {
-            continue;
-        }
-
-        std::string path = PLUGIN_PATH;
-        path += "/";
-        path += libdir.d_name;
-
-        struct stat tmp;
-
-        if (stat(path.c_str(), &tmp) == -1) {
-            LogError("Failed to open file" << path);
-            continue;
-        }
-
-        if (!S_ISDIR(tmp.st_mode)) {
-            LogError("Not a directory" << path);
-            continue;
-        }
-
-        LogDebug("Found plugin at " << path);
-        pluginsPaths.push_back(path);
-    }
-
-    if (0 != return_code)
-        LogError("Error while reading directory.");
-
-    if (-1 == closedir(dir)) {
-        LogError("Failed to close dir: " << PLUGIN_PATH);
-    }
-
-    LogDebug("Plugins to install: " << pluginsPaths.size());
-
-    for (size_t k = 0; k <= pluginsPaths.size(); ++k) {
-        printf(" ");
-    }
-    printf("]\r[");
-    int installedPluginsCount = 0;
-    ReturnStatus ret = ReturnStatus::Unknown;
-    FOREACH(it, pluginsPaths) {
-        LogDebug("Preparing to plugin installation: " << *it);
-        ret = installPlugin(*it);
-        if (ReturnStatus::Success == ret) {
-            ++installedPluginsCount;
-            LogDebug("Plugin " << *it << " installed.");
-        } else if (ReturnStatus::InstallationWaiting == ret) {
-            LogWarning("Plugin not installed. Waiting for dependency");
-        } else {
-            LogError("Plugin installation failed");
-        }
-        printf("#");
-        fflush(stdout);
-    }
-    printf("\n");
-    installedPluginsCount += installWaitingPlugins();
-    m_registry.UnloadAll();
-    LogDebug("Installed " << installedPluginsCount
-                         << " plugins of total: " << pluginsPaths.size());
-    return installedPluginsCount;
-}
-
-int PluginsInstaller::installWaitingPlugins()
-{
-    PluginHandleSetPtr waitingPlugins;
-
-    waitingPlugins =
-        PluginDAO::getPluginHandleByStatus(PluginDAO::INSTALLATION_WAITING);
-
-    int pluginsInstalled = 0;
-    FOREACH(it, *waitingPlugins)
-    {
-        if (resolvePluginDependencies(*it)) {
-            ++pluginsInstalled;
-        }
-    }
-    return pluginsInstalled;
-}
-
-bool PluginsInstaller::resolvePluginDependencies(PluginHandle handle)
-{
-    PluginHandleSetPtr dependencies(new PluginHandleSet);
-
-    PluginObjects::ObjectsPtr requiredObjects =
-        PluginDAO::getRequiredObjectsForPluginHandle(handle);
-
-    PluginHandle depHandle = INVALID_PLUGIN_HANDLE;
-
-    FOREACH(requiredObject, *requiredObjects)
-    {
-        depHandle =
-            PluginDAO::getPluginHandleForImplementedObject(*requiredObject);
-
-        if (INVALID_PLUGIN_HANDLE == depHandle) {
-            LogError("Library implementing: " <<
-                     *requiredObject << " NOT FOUND");
-            return false;
-        }
-        dependencies->insert(depHandle);
-    }
-
-    PluginDAO::registerPluginLibrariesDependencies(handle, dependencies);
-    PluginDAO::setPluginInstallationStatus(handle,
-                                           PluginDAO::INSTALLATION_COMPLETED);
-
-    return true;
-}
-
-void PluginsInstaller::registerObjects(const PluginObjectsPtr& libObj,
-                                       const IObjectsListPtr& objects) const
-{
-    LogDebug("registerObjects invoked");
-
-    FOREACH(o, *objects)
-    {
-        auto children = CAST(*o)->GetChildren();
-
-        if (children) {
-            FOREACH(c, *children)
-            {
-                libObj->addObjects(CAST(*o)->GetName(), CAST(*c)->GetName());
-
-                LogDebug("[Parent << Object] " << CAST(*c)->GetName()
-                                               << " << "
-                                               << CAST(*o)->GetName());
-            }
-
-            registerObjects(libObj, children);
-        }
-    }
-}
-
-PluginsInstaller::OptionalPluginMetafileData PluginsInstaller::parseMetafile(
-    const std::string& path) const
-{
-    LogDebug("Plugin Config file::" << path);
-    Try
-    {
-        PluginMetafileData pluginInfo;
-        PluginMetafileReader reader;
-        reader.initialize(path);
-        reader.read(pluginInfo);
-
-        FOREACH(it, pluginInfo.m_featureContainer) {
-            LogDebug("Parsed feature : " << it->m_name);
-
-            FOREACH(devCap, it->m_deviceCapabilities) {
-                LogDebug("  |  DevCap : " << *devCap);
-            }
-        }
-        return OptionalPluginMetafileData(pluginInfo);
-    }
-    Catch(ValidationCore::ParserSchemaException::Base) {
-        LogError("Error during file processing " << path);
-        ThrowMsg(PluginInstall::Exceptions::XMLFileParsingException,
-                 "Parsing metafile failed");
-    }
-}
-
-std::string PluginsInstaller::getLibraryName(const std::string& dirPath) const
-{
-    std::string pluginPath = dirPath;
-    size_t indexpos = pluginPath.find_last_of('/');
-
-    if (std::string::npos == indexpos) {
-        indexpos = 0;
-    } else {
-        indexpos += 1;  // move after '/'
-    }
-
-    std::string libName = pluginPath.substr(indexpos);
-    libName = WrtDB::GlobalConfig::GetPluginPrefix() + libName
-        + WrtDB::GlobalConfig::GetPluginSuffix();
-    LogDebug("Plugin .so: " << libName);
-    return libName;
-}
-
-bool PluginsInstaller::registerAndUpdateInstallation(
-    const WrtDB::DbPluginHandle& pluginHandle,
-    const PluginObjectsPtr& libraries)
-{
-    PluginHandleSetPtr handles = PluginHandleSetPtr(new PluginHandleSet);
-
-    DbPluginHandle handle = INVALID_PLUGIN_HANDLE;
-
-    //register requiredObjects
-    FOREACH(it, *(libraries->getDependentObjects()))
-    {
-        if (libraries->hasObject(*it)) {
-            LogDebug("Dependency from the same library. ignored");
-            continue;
-        }
-
-        handle = PluginDAO::getPluginHandleForImplementedObject(*it);
-        if (handle == INVALID_PLUGIN_HANDLE) {
-            LogError("Library implementing: " << *it << " NOT FOUND");
-            PluginDAO::setPluginInstallationStatus(
-                pluginHandle,
-                PluginDAO::INSTALLATION_WAITING);
-            return false;
-        }
-
-        handles->insert(handle);
-    }
-
-    PluginDAO::registerPluginLibrariesDependencies(pluginHandle, handles);
-
-    PluginDAO::setPluginInstallationStatus(pluginHandle,
-                                           PluginDAO::INSTALLATION_COMPLETED);
-    return true;
-}
-
-bool PluginsInstaller::fillMappingInterfaces(PluginMetafileData& pluginData,
-                                             const std::string& filename)
-{
-    void *dlHandle = dlopen(filename.c_str(), RTLD_NOW);
-    if (dlHandle == NULL) {
-        const char* error = (const char*)dlerror();
-        LogError(
-            "Failed to load plugin: " << filename << ". Reason: " << (error != NULL ? error : "unknown"));
-        return false;
-    }
-    Try
-    {
-        ExportedApi* entryPoint =
-            static_cast<ExportedApi*>(dlsym(dlHandle, GetExportedSymbolName()));
-        if (NULL == entryPoint) {
-            const char* error = (const char*)dlerror();
-            LogError("Error: " << (error != NULL ? error : "unknown"));
-            ThrowMsg(PluginInstall::Exceptions::LibraryException,
-                     "Library error");
-        }
-
-        // obtain feature -> dev-cap mapping
-        feature_mapping_interface_t mappingInterface = { NULL, NULL, NULL };
-        entryPoint->GetProvidedFeatures(&mappingInterface);
-
-        if (!mappingInterface.featGetter || !mappingInterface.release ||
-            !mappingInterface.dcGetter)
-        {
-            LogError("Failed to obtain mapping interface from .so");
-            ThrowMsg(PluginInstall::Exceptions::LibraryException,
-                     "Library error");
-        }
-
-        feature_mapping_t* devcapMapping = mappingInterface.featGetter();
-
-        LogDebug("Getting mapping from features to device capabilities");
-
-        for (size_t i = 0; i < devcapMapping->featuresCount; ++i) {
-            PluginMetafileData::Feature feature;
-            feature.m_name = devcapMapping->features[i].feature_name;
-
-            LogDebug("Feature: " << feature.m_name);
-
-            const devcaps_t* dc =
-                mappingInterface.dcGetter(
-                    devcapMapping,
-                    devcapMapping->features[i].
-                        feature_name);
-
-            LogDebug("device=cap: " << dc);
-
-            if (dc) {
-                LogDebug("devcaps count: " << dc->devCapsCount);
-
-                for (size_t j = 0; j < dc->devCapsCount; ++j) {
-                    LogDebug("devcap: " << dc->deviceCaps[j]);
-                    feature.m_deviceCapabilities.insert(dc->deviceCaps[j]);
-                }
-            }
-
-            pluginData.m_featureContainer.insert(feature);
-        }
-
-        mappingInterface.release(devcapMapping);
-    } Catch(PluginInstall::Exceptions::PluginsInstallerException)
-    {
-        LogError("Exception while feature mapping");
-        dlclose(dlHandle);
-        return false;
-    }
-
-    // Unload library
-    if (dlclose(dlHandle) != 0) {
-        LogError("Cannot close plugin handle");
-    } else {
-        LogDebug("Library is unloaded");
-    }
-    return true;
-}
-
-void PluginsInstaller::registerPluginObjects(
-    const WrtDB::DbPluginHandle& handle,
-    const PluginObjectsPtr libObjects)
-const
-{
-    //register implemented objects
-    PluginObjects::ObjectsPtr objects =
-        libObjects->getImplementedObject();
-
-    FOREACH(it, *objects)
-    {
-        WrtDB::PluginDAO::registerPluginImplementedObject(*it, handle);
-    }
-
-    //register requiredObjects
-    objects = libObjects->getDependentObjects();
-
-    FOREACH(it, *objects)
-    {
-        if (libObjects->hasObject(*it)) {
-            LogDebug("Dependency from the same library. ignored");
-            continue;
-        }
-        WrtDB::PluginDAO::registerPluginRequiredObject(*it, handle);
-    }
-}
-
diff --git a/src_mobile/plugins-installer/plugin_installer.h b/src_mobile/plugins-installer/plugin_installer.h
deleted file mode 100644 (file)
index 2ad33b0..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Copyright (c) 2012 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    plugin_installer.h
- * @author  Andrzej Surdej(a.surdej@samgsung.com)
- * @version
- * @brief
- */
-
-#ifndef WRT_PLUGINS_INSTALLER_PLUGIN_INSTALLER_H
-#define WRT_PLUGINS_INSTALLER_PLUGIN_INSTALLER_H
-
-#include <string>
-#include <plugin_installer_types.h>
-#include <plugin_objects.h>
-#include <IObject.h>
-#include <PluginRegistry.h>
-
-#include <dpl/singleton.h>
-
-class PluginsInstaller
-{
-  public:
-    static const int INSTALLATION_ERROR;
-    enum class ReturnStatus
-    {
-        Success,                    ///< Success
-
-        NotInitialized,             ///< Singleton not initialized
-        WrongPluginPath,            ///< ?
-        MetafileError,              ///< ?
-        AlreadyInstalled,           ///< ?
-        LoadingLibraryError,        ///< Loading library by dlopen failed.
-                                    /// It may be caused by missing symbols
-        InstallationWaiting,        /// Installation failed due to dependencies
-        DatabaseError,              /// Unable to update database
-        Unknown                     ///< Temporary error. Try to not use this.
-    };
-
-    bool initialize();
-    int installAllPlugins();
-    void deinitialize();
-
-    ReturnStatus installPlugin(const std::string& libPath);
-    ReturnStatus installPluginFromMetafile(const std::string& libPath,
-                                           const std::string& metaFilePath);
-
-    int installWaitingPlugins();
-    bool resolvePluginDependencies(PluginHandle handle);
-
-    bool isInitialized();
-
-  private:
-    friend class DPL::Singleton<PluginsInstaller>;
-
-    PluginsInstaller();
-    virtual ~PluginsInstaller();
-
-    void registerObjects(const PluginObjectsPtr& libObj,
-                         const WrtPluginsApi::IObjectsListPtr& objects) const;
-
-    typedef DPL::Optional<WrtDB::PluginMetafileData> OptionalPluginMetafileData;
-    OptionalPluginMetafileData parseMetafile(const std::string& path) const;
-
-    std::string getLibraryName(const std::string& dirPath) const;
-    bool registerAndUpdateInstallation(const PluginHandle& pluginHandle,
-                                       const PluginObjectsPtr& libraries);
-    bool fillMappingInterfaces(WrtDB::PluginMetafileData& pluginData,
-                               const std::string& filename);
-    void registerPluginObjects(const PluginHandle& handle,
-                               const PluginObjectsPtr libObjects) const;
-    void checkDatabaseTablesExistance();
-    PluginObjectsPtr loadLibraryFromMetafile(const std::string& libName) const;
-
-    WrtPluginsApi::PluginRegistry m_registry;
-    bool m_initialized;
-    bool m_reinstall;
-};
-
-typedef DPL::Singleton<PluginsInstaller> PluginsInstallerSingleton;
-
-#endif  /* WRT_PLUGINS_INSTALLER_PLUGIN_INSTALLER_H */
-
diff --git a/src_mobile/plugins-installer/plugin_installer_errors.h b/src_mobile/plugins-installer/plugin_installer_errors.h
deleted file mode 100644 (file)
index 9a94a79..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * 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    plugin_installer_errors.h
- * @author  Pawel Sikorski (p.sikorski@samgsung.com)
- * @author  Grzegorz Krawczyk (g.krawczyk@samgsung.com)
- * @version
- * @brief
- */
-
-#ifndef WRT_PLUGINS_INSTALLER_PLUGIN_INSTALLER_ERRORS_H
-#define WRT_PLUGINS_INSTALLER_PLUGIN_INSTALLER_ERRORS_H
-
-#include <dpl/exception.h>
-
-namespace PluginInstall {
-namespace Exceptions {
-DECLARE_EXCEPTION_TYPE(DPL::Exception, PluginsInstallerException)
-DECLARE_EXCEPTION_TYPE(PluginsInstallerException, LibraryException)
-DECLARE_EXCEPTION_TYPE(PluginsInstallerException, XMLFileParsingException)
-} //namespace
-} //namespace
-
-#endif /* WRT_PLUGINS_INSTALLER_PLUGIN_INSTALLER_ERRORS_H */
-
diff --git a/src_mobile/plugins-installer/plugin_installer_types.h b/src_mobile/plugins-installer/plugin_installer_types.h
deleted file mode 100644 (file)
index ae3a5db..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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    plugin_installer_types.h
- * @author  Andrzej Surdej (a.surdej@samgsung.com)
- * @version
- * @brief
- */
-
-#ifndef WRT_PLUGINS_INSTALLER_PLUGIN_INSTALLER_TYPES_H
-#define WRT_PLUGINS_INSTALLER_PLUGIN_INSTALLER_TYPES_H
-
-#include <dpl/wrt-dao-ro/common_dao_types.h>
-
-/* Define db type */
-typedef WrtDB::DbWidgetHandle WidgetHandle;
-typedef WrtDB::DbWidgetHandleList WidgetHandleList;
-
-typedef WrtDB::DbWidgetFeature WidgetFeature;
-typedef WrtDB::DbWidgetFeatureSet WidgetFeatureSet;
-
-typedef WrtDB::DbPluginHandle PluginHandle;
-
-#endif /* WRT_PLUGINS_INSTALLER_PLUGIN_INSTALLER_TYPES_H */
diff --git a/src_mobile/plugins-installer/plugin_metafile_reader.cpp b/src_mobile/plugins-installer/plugin_metafile_reader.cpp
deleted file mode 100644 (file)
index b65c2e3..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * 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        plugin_metafile_reader.cpp
- * @author      Grzegorz Krawczyk(g.krawczyk@samsung.com)
- * @version     1.0
- * @brief
- */
-
-#include "plugin_metafile_reader.h"
-
-using namespace WrtDB;
-
-namespace {
-const std::string XML_NAMESPACE = "";
-
-const std::string TOKEN_LIBRARY_NAME = "library-name";
-const std::string TOKEN_API_FEATURE = "api-feature";
-const std::string TOKEN_NAME = "name";
-const std::string TOKEN_DEVICECAPABILITY = "device-capability";
-}
-
-PluginMetafileReader::PluginMetafileReader() : m_parserSchema(this)
-{
-    m_parserSchema.addEndTagCallback(
-        TOKEN_LIBRARY_NAME,
-        XML_NAMESPACE,
-        &PluginMetafileReader::tokenEndLibraryName);
-
-    m_parserSchema.addEndTagCallback(
-        TOKEN_API_FEATURE,
-        XML_NAMESPACE,
-        &PluginMetafileReader::tokenEndApiFeature);
-
-    m_parserSchema.addEndTagCallback(
-        TOKEN_NAME,
-        XML_NAMESPACE,
-        &PluginMetafileReader::tokenEndName);
-
-    m_parserSchema.addEndTagCallback(
-        TOKEN_DEVICECAPABILITY,
-        XML_NAMESPACE,
-        &PluginMetafileReader::tokenEndDeviceCapability);
-}
-
-void PluginMetafileReader::blankFunction(PluginMetafileData & /* data */)
-{}
-
-void PluginMetafileReader::tokenEndLibraryName(PluginMetafileData &data)
-{
-    data.m_libraryName = m_parserSchema.getText();
-}
-
-void PluginMetafileReader::tokenEndApiFeature(PluginMetafileData &data)
-{
-    data.m_featureContainer.insert(m_feature);
-    m_feature.m_deviceCapabilities.clear();
-}
-
-void PluginMetafileReader::tokenEndName(PluginMetafileData & /* data */)
-{
-    m_feature.m_name = m_parserSchema.getText();
-}
-
-void PluginMetafileReader::tokenEndDeviceCapability(PluginMetafileData& /*data*/)
-{
-    m_feature.m_deviceCapabilities.insert(m_parserSchema.getText());
-}
-
diff --git a/src_mobile/plugins-installer/plugin_metafile_reader.h b/src_mobile/plugins-installer/plugin_metafile_reader.h
deleted file mode 100644 (file)
index b0c88f0..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * 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        plugin_metafile_reader.h
- * @author      Grzegorz Krawczyk(g.krawczyk@samsung.com)
- * @version     1.0
- * @brief
- */
-
-#ifndef WRT_SRC_INSTALLER_CORE_PLUGIN_INSTALLER_TASKS_PLUGIN_METAFILE_READER_H_
-#define WRT_SRC_INSTALLER_CORE_PLUGIN_INSTALLER_TASKS_PLUGIN_METAFILE_READER_H_
-
-#include <dpl/wrt-dao-ro/common_dao_types.h>
-#include <vcore/ParserSchema.h>
-
-class PluginMetafileReader
-{
-  public:
-    PluginMetafileReader();
-
-    void initialize(const std::string &filename)
-    {
-        m_parserSchema.initialize(filename,
-                                  true,
-                                  ValidationCore::SaxReader::VALIDATION_DTD,
-                                  std::string());
-    }
-
-    void read(WrtDB::PluginMetafileData &data)
-    {
-        m_parserSchema.read(data);
-    }
-
-  private:
-    void blankFunction(WrtDB::PluginMetafileData &data);
-
-    void tokenEndLibraryName(WrtDB::PluginMetafileData &data);
-    void tokenEndApiFeature(WrtDB::PluginMetafileData &data);
-    void tokenEndName(WrtDB::PluginMetafileData &data);
-    void tokenEndDeviceCapability(WrtDB::PluginMetafileData &data);
-
-    WrtDB::PluginMetafileData::Feature m_feature;
-
-    ValidationCore::ParserSchema<PluginMetafileReader,
-                                 WrtDB::PluginMetafileData> m_parserSchema;
-};
-
-#endif
diff --git a/src_mobile/plugins-installer/plugin_utils.cpp b/src_mobile/plugins-installer/plugin_utils.cpp
deleted file mode 100644 (file)
index 42cc49d..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * 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    plugin-utils.cpp
- * @author
- * @version 1.0
- * @brief   Header file for plugin util
- */
-
-#include "plugin_utils.h"
-#include <dpl/semaphore.h>
-#include <dpl/exception.h>
-#include <dpl/log/log.h>
-#include <dpl/wrt-dao-ro/global_config.h>
-
-using namespace WrtDB;
-
-namespace PluginUtils {
-//checks if file exists and is regular file
-bool checkFileExistance(const std::string& filename)
-{
-    struct stat tmp;
-
-    if (0 == stat(filename.c_str(), &tmp) && S_ISREG(tmp.st_mode)) {
-        return true;
-    }
-    return false;
-}
-
-std::string cutOffFileName(const std::string& path)
-{
-    size_t found = path.find_last_of("/");
-    if (found == std::string::npos) {
-        return path;
-    } else {
-        return path.substr(0, found);
-    }
-}
-
-bool checkPath(const std::string& path)
-{
-    struct stat st;
-    if (0 == stat(path.c_str(), &st) && S_ISDIR(st.st_mode)) {
-        return true;
-    }
-    LogError("Cannot access directory [ " << path << " ]");
-    return false;
-}
-
-bool checkPaths()
-{
-    bool if_ok = true;
-    if_ok &= (checkPath(cutOffFileName(
-                            GlobalConfig::GetWrtDatabaseFilePath())));
-    if (!if_ok) {
-        LogError(
-            "Path <" << GlobalConfig::GetWrtDatabaseFilePath() <<
-            "> does not exist.");
-    }
-
-    if_ok &= (checkPath(GlobalConfig::GetDevicePluginPath()));
-    if (!if_ok) {
-        LogError(
-            "Path <" << GlobalConfig::GetDevicePluginPath() <<
-            "> does not exist.");
-    }
-
-    if_ok &= (checkPath(GlobalConfig::GetUserInstalledWidgetPath()));
-    if (!if_ok) {
-        LogError(
-            "Path <" << GlobalConfig::GetUserInstalledWidgetPath() <<
-            "> does not exist.");
-    }
-    return if_ok;
-}
-} //namespace PluginUtils
diff --git a/src_mobile/plugins-installer/plugin_utils.h b/src_mobile/plugins-installer/plugin_utils.h
deleted file mode 100644 (file)
index a542e28..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * 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    plugin-utils.h
- * @author
- * @version 1.0
- * @brief   Header file for plugin util
- */
-#ifndef PLUGIN_UTILS_H
-#define PLUGIN_UTILS_H
-
-#include <string>
-#include <sys/stat.h>
-
-namespace PluginUtils {
-bool checkFileExistance(const std::string& filename);
-
-std::string cutOffFileName(const std::string& path);
-bool checkPath(const std::string& path);
-bool checkPaths();
-}
-#endif // PLUGIN_UTILS_H
diff --git a/src_mobile/plugins-installer/wrt_plugins_installer.cpp b/src_mobile/plugins-installer/wrt_plugins_installer.cpp
deleted file mode 100644 (file)
index c664350..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2012 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    wrt_plugins_installer.cpp
- * @author  Andrzej Surdej(a.surdej@gmail.com)
- * @version 1.0
- * @brief   Main file for plugins installer
- */
-
-#include <plugin_installer.h>
-#include <dpl/log/log.h>
-#include <string>
-#include <cstdio>
-#include <dpl/exception.h>
-
-int main(int /*argc*/, char */*argv*/[])
-{
-    UNHANDLED_EXCEPTION_HANDLER_BEGIN
-    {
-        DPL::Log::LogSystemSingleton::Instance().SetTag("PLUGINS_INSTALLER");
-        LogDebug("Plugins installation started.");
-
-        printf("Installing plugins...\n");
-        PluginsInstallerSingleton::Instance().initialize();
-        int installed =
-            PluginsInstallerSingleton::Instance().installAllPlugins();
-        PluginsInstallerSingleton::Instance().deinitialize();
-        printf("Completed: %d plugins installed.\n", installed);
-
-        LogDebug("All plugins installed successfuly");
-        return 0;
-    }
-    UNHANDLED_EXCEPTION_HANDLER_END
-}
diff --git a/src_mobile/plugins-ipc-message/ipc_message_support.h b/src_mobile/plugins-ipc-message/ipc_message_support.h
deleted file mode 100644 (file)
index b5463e9..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * 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        ipc_message_support.h
- * @author      Jihoon Chung (jihoon.chung@samsung.com)
- * @version     1.0
- * @brief       Implementation of IPC between plugins and UI Process
- */
-#ifndef WRT_SRC_IPC_MESSAGE_SUPPORT
-#define WRT_SRC_IPC_MESSAGE_SUPPORT
-
-#include <memory>
-#include <map>
-#include <string>
-#include <WKBundle.h>
-#include <EWebKit2.h>
-
-typedef void (*AsyncReplyCallback)(unsigned int, void*, const char*);
-
-namespace IPCMessageSupport {
-
-static const char * const REPLY_ASYNC = "ToInjectedBundle::REPLY_ASYNC";
-static const char * const TIZEN_CHANGE_USERAGENT = "tizen://changeUA";
-static const char * const TIZEN_DELETE_ALL_COOKIES = "tizen://deleteAllCookies";
-static const char * const TIZEN_EXIT = "tizen://exit";
-static const char * const TIZEN_HIDE = "tizen://hide";
-
-class AsyncConnection
-{
-  public:
-    AsyncReplyCallback replyCallback;
-    void* data;
-
-    AsyncConnection(AsyncReplyCallback r, void* d) :
-        replyCallback(r),
-        data(d)
-    {
-    }
-};
-
-typedef std::shared_ptr<AsyncConnection> AsyncConnectionPtr;
-typedef std::map<unsigned int, AsyncConnectionPtr> AsyncConnectionMap;
-
-class AsyncConnectionManager
-{
-  private:
-    AsyncConnectionMap m_connectionMap;
-
-  public:
-    ~AsyncConnectionManager();
-
-    // Singleton
-    static AsyncConnectionManager &instance();
-
-    int addConnection(AsyncConnectionPtr connection);
-    bool removeConnection(int handle);
-    AsyncConnectionPtr getConnection(int handle);
-
-};
-
-void setWKBundleRef(WKBundleRef bundleRef);
-void setXwindowHandle(unsigned int handle);
-const char* sendMessageToUiProcess(const char* name, const char* body);
-int  sendAsyncMessageToUiProcess(const char* name, const char* body, AsyncReplyCallback replyCallback, void* data);
-void* ignoreAsyncMessageReply(int handle);
-void replyAsyncMessageToWebProcess(Ewk_Context* ewkContext, int handle, const char* body);
-}
-
-#endif // WRT_SRC_IPC_MESSAGE_SUPPORT
diff --git a/src_mobile/standards/W3C/CMakeLists.txt b/src_mobile/standards/W3C/CMakeLists.txt
deleted file mode 100644 (file)
index 11828fb..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-# 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.
-#
-add_subdir(Widget)
diff --git a/src_mobile/standards/W3C/DESCRIPTION b/src_mobile/standards/W3C/DESCRIPTION
deleted file mode 100644 (file)
index 8e32c7b..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-!!!options!!! stop
-W3C plugin - Widget Interface
diff --git a/src_mobile/standards/W3C/Widget/CMakeLists.txt b/src_mobile/standards/W3C/Widget/CMakeLists.txt
deleted file mode 100644 (file)
index a76454d..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-# 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.
-#
-
-ADD_DEFINITIONS("-DWRT_PLUGINS_WIDGET_LOG")
-
-set(TARGET_NAME "wrt-plugins-w3c-widget-interface")
-
-pkg_search_module(webkit2 REQUIRED ewebkit2)
-pkg_search_module(plugin-types REQUIRED wrt-plugins-types)
-
-set(SRCS
-  ${SRCS_COMMONS}
-  JSWidget.cpp
-  JSPreferences.cpp
-  plugin_initializer.cpp
-  plugin_config.cpp
-)
-
-include_directories(
-  ${API_WIDGET_PATH}
-  ${webkit2_INCLUDE_DIRS}
-  ${plugin-types_INCLUDE_DIRS}
-)
-
-add_library(${TARGET_NAME} SHARED ${SRCS})
-target_link_libraries(${TARGET_NAME}
-  ${LIBS_COMMON}
-  ${TARGET_COMMONS}
-  ${TARGET_COMMONS_JAVASCRIPT}
-  ${TARGET_JS_OVERLAY}
-  wrt-plugins-widget
-  wrt-plugins-localstorage
-  wrt-plugins-storageevent
-  wrt-dispatch-event
-)
-
-INSTALL(TARGETS ${TARGET_NAME} LIBRARY DESTINATION /usr/lib/wrt-plugins/w3c-widget-interface)
diff --git a/src_mobile/standards/W3C/Widget/JSPreferences.cpp b/src_mobile/standards/W3C/Widget/JSPreferences.cpp
deleted file mode 100644 (file)
index 1b3785b..0000000
+++ /dev/null
@@ -1,528 +0,0 @@
-/*
- * 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        JSPreferences.cpp
- * @author      Grzegorz Krawczyk (g.krawczyk@samsung.com)
- * @version     0.1
- */
-
-#include "JSPreferences.h"
-
-#include <string>
-#include <dpl/assert.h>
-#include <dpl/log/secure_log.h>
-#include <dpl/optional.h>
-#include <CommonsJavaScript/Converter.h>
-#include <CommonsJavaScript/JSDOMExceptionFactory.h>
-#include <StorageEvent/StorageEventMgr.h>
-#include <StorageEvent/IStorageEvent.h>
-#include <dispatch-event/dispatch_event_support.h>
-
-// import temporarily from JSContextRefPrivate.h
-extern "C" JSGlobalContextRef JSContextGetGlobalContext(JSContextRef ctx);
-
-using namespace std;
-using namespace WrtDeviceApis;
-using namespace WrtDeviceApis::Commons;
-using namespace WrtDeviceApis::CommonsJavaScript;
-using namespace WrtDeviceApis::LocalStorage::Api;
-using namespace WrtDeviceApis::StorageEvent::Api;
-
-#define PREFERENCES_PLUGIN_NAME       "preferences"
-#define LOCAL_STORAGE_PROPERTY_LENGTH "length"
-
-#define CATCH_EXCEPTION_NO_MODIFABLE \
-    Catch(Commons::LocalStorageValueNoModifableException) { \
-        _E("The item is read only"); \
-        return JSDOMExceptionFactory:: \
-                   NoModificationAllowedException.make(context, exception); \
-    }
-
-#define CATCH_EXCEPTION_CONVERSION \
-    Catch(Commons::ConversionException) { \
-        _E("Error on conversion"); \
-        return JSDOMExceptionFactory:: \
-                   UnknownException.make(context, exception); \
-    }
-
-#define CATCH_EXCEPTION_NULL_PTR \
-    Catch(Commons::NullPointerException) { \
-        _E("Error on pointer, null value"); \
-        return JSDOMExceptionFactory:: \
-                   UnknownException.make(context, exception); \
-    }
-
-#define CATCH_EXCEPTION_PLATFORM_ERROR \
-    Catch(Commons::PlatformException){ \
-        _E("PlatformException occured"); \
-        return JSDOMExceptionFactory:: \
-                   UnknownException.make(context, exception); \
-    }
-
-#define CATCH_EXCEPTION_SECURITY \
-    Catch(Commons::SecurityException){ \
-        _E("Security exception occured"); \
-        return JSDOMExceptionFactory:: \
-                   SecurityException.make(context, exception); \
-    }
-
-#define CATCH_EXCEPTION_OUT_OF_RANGE \
-    Catch(Commons::OutOfRangeException) { \
-        _E("OutOfRangeException"); \
-        return JSDOMExceptionFactory:: \
-                   QuotaExceededException.make(context, exception); \
-    }
-
-#define CATCH_EXCEPTION_INVALID_ARG \
-    Catch(Commons::InvalidArgumentException) { \
-        _E("Pair for given key doesnt exist"); \
-        return JSValueMakeNull(context); \
-    }
-
-namespace WrtPlugins {
-namespace W3C {
-ILocalStoragePtr getIStorage(JSObjectRef arg)
-{
-    _D("get localstorage object");
-    LocalStoragePrivateData* priv =
-        static_cast<LocalStoragePrivateData*>(JSObjectGetPrivate(arg));
-
-    if (!priv) {
-        _E("Private object not initialized");
-        ThrowMsg(Commons::NullPointerException,
-                 "Private object not initialized");
-    }
-
-    return priv->istorage;
-}
-
-JSObjectRef getWidgetObject(JSObjectRef arg)
-{
-    _D("get widget object");
-    LocalStoragePrivateData* priv =
-        static_cast<LocalStoragePrivateData*>(JSObjectGetPrivate(arg));
-
-    if (!priv) {
-        _E("Private object not initialized");
-        ThrowMsg(Commons::NullPointerException,
-                 "Private object not initialized");
-    }
-
-    return priv->widgetObject;
-}
-
-enum class ModificationType
-{
-    RemoveItem,
-    SetItem
-};
-
-//this function may throw exceptions
-IStorageEventPtr modifyItemAndCreateEvent(ModificationType type,
-                                          JSObjectRef thisObject,
-                                          const string& key,
-                                          const string& value = std::string())
-{
-    DPL::Optional<std::string> oldValue =
-        getIStorage(thisObject)->getValue(key);
-
-    if (ModificationType::SetItem == type) {
-        getIStorage(thisObject)->setItem(key, value, false);
-    } else if (ModificationType::RemoveItem == type) {
-        getIStorage(thisObject)->removeItem(key);
-    } else {
-        Assert(0 && "Wrong Modification type");
-    }
-
-    DPL::Optional<std::string> newValue =
-        getIStorage(thisObject)->getValue(key);
-
-    //create event object
-    IStorageEventPtr storageEvent = getStorageEvent();
-
-    //key
-    storageEvent->setKey(key);
-    //oldvalue
-    if (!!oldValue) {
-        storageEvent->setOldValue(*oldValue);
-    }
-    //newValue
-    if (!!newValue) {
-        storageEvent->setNewValue(*newValue);
-    }
-
-    return storageEvent;
-}
-
-JSClassDefinition JSPreferences::m_classInfo = {
-    0,
-    kJSClassAttributeNone,
-    PREFERENCES_PLUGIN_NAME,
-    0,
-    m_property,
-    m_function,
-    initialize,
-    finalize,
-    hasProperty,
-    getProperty,
-    setProperty,
-    NULL, //DeleteProperty,
-    NULL, //GetPropertyNames,
-    NULL, //CallAsFunction,
-    NULL, //CallAsConstructor,
-    NULL, //HasInstance,
-    NULL, //ConvertToType,
-};
-
-JSStaticFunction JSPreferences::m_function[] = {
-    { "setItem", JSPreferences::setItem, kJSPropertyAttributeNone },
-    { "removeItem", JSPreferences::removeItem, kJSPropertyAttributeNone },
-    { "getItem", JSPreferences::getItem, kJSPropertyAttributeNone },
-    { "clear", JSPreferences::clear, kJSPropertyAttributeNone },
-    { "key", JSPreferences::key, kJSPropertyAttributeNone },
-    { 0, 0, 0 }
-};
-
-JSStaticValue JSPreferences::m_property[] = {
-    { LOCAL_STORAGE_PROPERTY_LENGTH,
-      JSPreferences::getLength,
-      NULL,
-      kJSPropertyAttributeReadOnly },
-    { 0, 0, 0, 0 }
-};
-
-JSClassRef JSPreferences::getClassRef()
-{
-    if (!m_jsClassRef) {
-        m_jsClassRef = JSClassCreate(&m_classInfo);
-    }
-    return m_jsClassRef;
-}
-
-const JSClassDefinition* JSPreferences::getClassInfo()
-{
-    return &m_classInfo;
-}
-
-JSClassRef JSPreferences::m_jsClassRef =
-    JSClassCreate(JSPreferences::getClassInfo());
-
-void JSPreferences::initialize(JSContextRef context,
-                               JSObjectRef object)
-{
-    _D("entered. Context: %p", context);
-
-    LocalStoragePrivateData* priv =
-        static_cast<LocalStoragePrivateData*>(JSObjectGetPrivate(object));
-
-    Assert(priv && "private object of preferences is NULL");
-}
-
-void JSPreferences::finalize(JSObjectRef object)
-{
-    _D("entered");
-    LocalStoragePrivateData* priv =
-        static_cast<LocalStoragePrivateData*>(JSObjectGetPrivate(object));
-
-    delete priv;
-}
-
-JSValueRef JSPreferences::removeItem(JSContextRef context,
-                                     JSObjectRef /*object*/,
-                                     JSObjectRef thisObject,
-                                     size_t /*argumentCount*/,
-                                     const JSValueRef arguments[],
-                                     JSValueRef* exception)
-{
-    _D("entered");
-
-    Try {
-        Converter converter(context);
-
-        std::string key = converter.toString(arguments[0]);
-
-        DPL::Optional<std::string> oldValue = getIStorage(thisObject)->getValue(key);
-        getIStorage(thisObject)->removeItem(key);
-        DPL::Optional<std::string> newValue = getIStorage(thisObject)->getValue(key);
-
-        JSContextRef g_context  = JSContextGetGlobalContext(context);
-
-        DispatchEventSupport::dispatchStorageEvent(g_context, key, oldValue, newValue, "");
-
-        return JSValueMakeNull(context);
-    }
-    CATCH_EXCEPTION_NO_MODIFABLE
-    CATCH_EXCEPTION_CONVERSION
-    CATCH_EXCEPTION_NULL_PTR
-    CATCH_EXCEPTION_PLATFORM_ERROR
-        CATCH_EXCEPTION_SECURITY
-}
-
-JSValueRef JSPreferences::setItem(JSContextRef context,
-                                  JSObjectRef /*object*/,
-                                  JSObjectRef thisObject,
-                                  size_t /*argumentCount*/,
-                                  const JSValueRef arguments[],
-                                  JSValueRef* exception)
-{
-    _D("entered");
-
-    Try {
-        Converter converter(context);
-
-        std::string key = converter.toString(arguments[0]);
-        std::string value = converter.tryString(arguments[1]);
-
-        DPL::Optional<std::string> oldValue = getIStorage(thisObject)->getValue(key);
-        getIStorage(thisObject)->setItem(key, value, false);
-        DPL::Optional<std::string> newValue = getIStorage(thisObject)->getValue(key);
-
-        JSContextRef g_context  = JSContextGetGlobalContext(context);
-
-        DispatchEventSupport::dispatchStorageEvent(g_context, key, oldValue, newValue, "");
-
-        return JSValueMakeUndefined(context);
-    }
-    CATCH_EXCEPTION_NO_MODIFABLE
-    CATCH_EXCEPTION_CONVERSION
-    CATCH_EXCEPTION_NULL_PTR
-    CATCH_EXCEPTION_PLATFORM_ERROR
-    CATCH_EXCEPTION_SECURITY
-        CATCH_EXCEPTION_OUT_OF_RANGE
-}
-
-JSValueRef JSPreferences::clear(JSContextRef context,
-                                JSObjectRef /*object*/,
-                                JSObjectRef thisObject,
-                                size_t /*argumentCount*/,
-                                const JSValueRef /*arguments*/[],
-                                JSValueRef* exception)
-{
-    _D("entered");
-
-    Try {
-        getIStorage(thisObject)->clear(false);
-
-        JSContextRef g_context  = JSContextGetGlobalContext(context);
-
-        const auto& null = DPL::Optional<std::string>::Null;
-
-        DispatchEventSupport::dispatchStorageEvent(g_context, null, null, null, "");
-
-        return JSValueMakeNull(context);
-    }
-    CATCH_EXCEPTION_NULL_PTR
-    CATCH_EXCEPTION_PLATFORM_ERROR
-        CATCH_EXCEPTION_SECURITY
-}
-
-JSValueRef JSPreferences::getItem(JSContextRef context,
-                                  JSObjectRef /*object*/,
-                                  JSObjectRef thisObject,
-                                  size_t /*argumentCount*/,
-                                  const JSValueRef arguments[],
-                                  JSValueRef* exception)
-{
-    _D("entered");
-
-    Try {
-        Converter converter(context);
-
-        std::string key = converter.tryString(arguments[0]);
-
-        _D("Getting item for key %s", key.c_str());
-
-        DPL::Optional<std::string> value =
-            getIStorage(thisObject)->getValue(key);
-
-        if (!value) {
-            return JSValueMakeNull(context);
-        } else {
-            return converter.toJSValueRef(*value);
-        }
-    }
-    CATCH_EXCEPTION_INVALID_ARG
-    CATCH_EXCEPTION_CONVERSION
-    CATCH_EXCEPTION_NULL_PTR
-    CATCH_EXCEPTION_PLATFORM_ERROR
-        CATCH_EXCEPTION_SECURITY
-}
-
-JSValueRef JSPreferences::key(JSContextRef context,
-                              JSObjectRef /*object*/,
-                              JSObjectRef thisObject,
-                              size_t argumentCount,
-                              const JSValueRef arguments[],
-                              JSValueRef* exception)
-{
-    _D("entered");
-
-    Try {
-        if (argumentCount < 1) {
-            _E("No argument found");
-            Throw(Commons::InvalidArgumentException);
-        }
-
-        Converter converter(context);
-
-        size_t n = converter.toSizeT(arguments[0]);
-
-        std::string value = getIStorage(thisObject)->getKeyByIndex(n);
-
-        return converter.toJSValueRef(value);
-    }
-    CATCH_EXCEPTION_CONVERSION
-    CATCH_EXCEPTION_NULL_PTR
-    CATCH_EXCEPTION_PLATFORM_ERROR
-    CATCH_EXCEPTION_SECURITY
-        CATCH_EXCEPTION_INVALID_ARG
-}
-
-JSValueRef JSPreferences::getLength(JSContextRef context,
-                                    JSObjectRef object,
-                                    JSStringRef /*propertyName*/,
-                                    JSValueRef* exception)
-{
-    _D("enter");
-
-    Try
-    {
-        Converter converter(context);
-
-        size_t value = getIStorage(object)->getStorageSize();
-        return converter.toJSValueRef(value);
-    }
-    CATCH_EXCEPTION_CONVERSION
-    CATCH_EXCEPTION_NULL_PTR
-    CATCH_EXCEPTION_PLATFORM_ERROR
-    CATCH_EXCEPTION_SECURITY
-        CATCH_EXCEPTION_INVALID_ARG
-}
-
-bool JSPreferences::hasProperty(JSContextRef context,
-                                JSObjectRef object,
-                                JSStringRef propertyName)
-{
-    _D("enter");
-
-    Try {
-        Converter converter(context);
-
-        std::string key = converter.toString(propertyName);
-
-        if (!getIStorage(object)->getValue(key)) {
-            return false;
-        } else {
-            return true;
-        }
-    }
-
-    Catch(Commons::InvalidArgumentException) {
-        _E("Pair for given key doesnt exist");
-    }
-
-    Catch(Commons::ConversionException) {
-        _E("Error on conversion");
-    }
-
-    Catch(Commons::NullPointerException) {
-        _E("Error on pointer, null value");
-    }
-
-    Catch(Commons::PlatformException){
-        _E("PlatformException occured");
-    }
-    return false;
-}
-
-JSValueRef JSPreferences::getProperty(JSContextRef context,
-                                      JSObjectRef object,
-                                      JSStringRef propertyName,
-                                      JSValueRef* exception)
-{
-    _D("enter");
-
-    Try {
-        Converter converter(context);
-
-        std::string key = converter.toString(propertyName);
-
-        DPL::Optional<std::string> value =
-            getIStorage(object)->getValue(key);
-
-        if (!value) {
-            return JSValueMakeNull(context);
-        } else {
-            return converter.toJSValueRef(*value);
-        }
-    }
-
-    CATCH_EXCEPTION_CONVERSION
-    CATCH_EXCEPTION_NULL_PTR
-    CATCH_EXCEPTION_PLATFORM_ERROR
-        CATCH_EXCEPTION_INVALID_ARG
-}
-
-bool JSPreferences::setProperty(JSContextRef context,
-                                JSObjectRef object,
-                                JSStringRef propertyName,
-                                JSValueRef jvalue,
-                                JSValueRef* exception)
-{
-    _D("enter");
-
-    Try {
-        Converter converter(context);
-
-        std::string key = converter.toString(propertyName);
-        std::string value = converter.toString(jvalue);
-
-        DPL::Optional<std::string> oldValue = getIStorage(object)->getValue(key);
-        getIStorage(object)->setItem(key, value, false);
-        DPL::Optional<std::string> newValue = getIStorage(object)->getValue(key);
-
-        JSContextRef g_context  = JSContextGetGlobalContext(context);
-        std::string oldValueStr = "";
-        std::string newValueStr = "";
-
-        if (!!oldValue) { oldValueStr = *oldValue; }
-        if (!!newValue) { newValueStr = *newValue; }
-
-        DispatchEventSupport::dispatchStorageEvent(g_context, key, oldValueStr, newValueStr, "");
-
-        return true;
-    }
-    CATCH_EXCEPTION_NO_MODIFABLE
-    CATCH_EXCEPTION_OUT_OF_RANGE
-    CATCH_EXCEPTION_INVALID_ARG
-    CATCH_EXCEPTION_CONVERSION
-    CATCH_EXCEPTION_NULL_PTR
-    CATCH_EXCEPTION_PLATFORM_ERROR
-        CATCH_EXCEPTION_SECURITY
-
-    return false;
-}
-
-#undef CATCH_EXCEPTION_NO_MODIFABLE
-#undef CATCH_EXCEPTION_CONVERSION
-#undef CATCH_EXCEPTION_NULL_PTR
-#undef CATCH_EXCEPTION_PLATFORM_ERROR
-#undef CATCH_EXCEPTION_SECURITY
-#undef CATCH_EXCEPTION_OUT_OF_RANGE
-#undef CATCH_EXCEPTION_INVALID_ARG
-}
-}
diff --git a/src_mobile/standards/W3C/Widget/JSPreferences.h b/src_mobile/standards/W3C/Widget/JSPreferences.h
deleted file mode 100644 (file)
index b86bae8..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * 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       JSPreferences.h
- * @author     Grzegorz Krawczyk (g.krawczyk@samsung.com)
- * @version    0.1
- * @brief
- */
-
-#ifndef _WRT_PLUGIN_JS_WIDGET_PREFERENCES_H_
-#define _WRT_PLUGIN_JS_WIDGET_PREFERENCES_H_
-
-#include <JavaScriptCore/JavaScript.h>
-#include <CommonsJavaScript/PrivateObject.h>
-#include <LocalStorage/ILocalStorage.h>
-
-namespace WrtPlugins {
-namespace W3C {
-struct LocalStoragePrivateData {
-    WrtDeviceApis::LocalStorage::Api::ILocalStoragePtr istorage;
-    //parent
-    JSObjectRef widgetObject;
-};
-
-class JSPreferences
-{
-  public:
-    /**
-     * This method initializes this in the JS Engine.
-     */
-    static JSClassRef getClassRef();
-
-    /**
-     * Gets object's class description.
-     */
-    static const JSClassDefinition* getClassInfo();
-
-  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 contains properties and callbacks
-     * that define a type of object.
-     */
-    static JSClassDefinition m_classInfo;
-
-    /**
-     * This structure describes a statically declared function.
-     */
-    static JSStaticFunction m_function[];
-
-    static JSStaticValue m_property[];
-
-    static JSClassRef m_jsClassRef;
-
-    //Modified functions for Preference object
-    static JSValueRef removeItem(JSContextRef context, JSObjectRef object,
-                                 JSObjectRef thisObject, size_t argumentCount,
-                                 const JSValueRef arguments[],
-                                 JSValueRef* exception);
-
-    static JSValueRef setItem(JSContextRef context, JSObjectRef object,
-                              JSObjectRef thisObject, size_t argumentCount,
-                              const JSValueRef arguments[],
-                              JSValueRef* exception);
-
-    static JSValueRef getItem(JSContextRef context, JSObjectRef object,
-                              JSObjectRef thisObject, size_t argumentCount,
-                              const JSValueRef arguments[],
-                              JSValueRef* exception);
-
-    static JSValueRef clear(JSContextRef context, JSObjectRef object,
-                            JSObjectRef thisObject, size_t argumentCount,
-                            const JSValueRef arguments[],
-                            JSValueRef* exception);
-
-    static JSValueRef key(JSContextRef context, JSObjectRef object,
-                          JSObjectRef thisObject, size_t argumentCount,
-                          const JSValueRef arguments[],
-                          JSValueRef* exception);
-
-    static JSValueRef getLength(JSContextRef context,
-                                JSObjectRef object,
-                                JSStringRef propertyName,
-                                JSValueRef* exception);
-
-    static bool hasProperty(JSContextRef context,
-                            JSObjectRef object,
-                            JSStringRef propertyName);
-
-    static JSValueRef getProperty(JSContextRef context,
-                                  JSObjectRef object,
-                                  JSStringRef propertyName,
-                                  JSValueRef* exception);
-
-    static bool setProperty(JSContextRef context,
-                            JSObjectRef object,
-                            JSStringRef propertyName,
-                            JSValueRef value,
-                            JSValueRef* exception);
-};
-}
-}
-
-#endif
diff --git a/src_mobile/standards/W3C/Widget/JSWidget.cpp b/src_mobile/standards/W3C/Widget/JSWidget.cpp
deleted file mode 100644 (file)
index f4b9684..0000000
+++ /dev/null
@@ -1,560 +0,0 @@
-/*
- * 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        JSWidget.cpp
- * @author      Grzegorz Krawczyk (g.krawczyk@samsung.com)
- * @version     0.1
- */
-
-#include "JSWidget.h"
-#include <memory>
-#include <CommonsJavaScript/Converter.h>
-#include <dpl/log/log.h>
-#include <dpl/assert.h>
-#include <Widget/WidgetFactory.h>
-#include <CommonsJavaScript/JSDOMExceptionFactory.h>
-#include "JSPreferences.h"
-#include <Widget/IWidget.h>
-#include <LocalStorage/LocalStorageMgr.h>
-#include <Commons/WrtAccess/WrtAccess.h>
-
-// temporary
-extern "C" JSGlobalContextRef JSContextGetGlobalContext(JSContextRef ctx);
-
-#define CATCH_EXCEPTION_NO_MODIFABLE \
-    Catch(Commons::LocalStorageValueNoModifableException) { \
-        LogError("The item is read only"); \
-        return JSDOMExceptionFactory:: \
-                   NoModificationAllowedException.make(context, exception); \
-    }
-
-#define CATCH_EXCEPTION_CONVERSION \
-    Catch(Commons::ConversionException) { \
-        LogError("Error on conversion"); \
-        return JSDOMExceptionFactory:: \
-                   UnknownException.make(context, exception); \
-    }
-
-#define CATCH_EXCEPTION_NULL_PTR \
-    Catch(Commons::NullPointerException) { \
-        LogError("Error on pointer, null value"); \
-        return JSDOMExceptionFactory:: \
-                   UnknownException.make(context, exception); \
-    }
-
-#define CATCH_EXCEPTION_PLATFORM_ERROR \
-    Catch(Commons::PlatformException){ \
-        LogError("PlatformException occured"); \
-        return JSDOMExceptionFactory:: \
-                   UnknownException.make(context, exception); \
-    }
-
-#define CATCH_EXCEPTION_SECURITY \
-    Catch(Commons::SecurityException){ \
-        LogError("Security exception occured"); \
-        return JSDOMExceptionFactory:: \
-                   SecurityException.make(context, exception); \
-    }
-
-#define CATCH_EXCEPTION_OUT_OF_RANGE \
-    Catch(Commons::OutOfRangeException) { \
-        LogError("OutOfRangeException"); \
-        return JSDOMExceptionFactory:: \
-                   QuotaExceededException.make(context, exception); \
-    }
-
-#define CATCH_EXCEPTION_INVALID_ARG \
-    Catch(Commons::InvalidArgumentException) { \
-        LogError("Pair for given key doesnt exist"); \
-        return JSValueMakeNull(context); \
-    }
-
-#define WIDGET_PLUGIN_NAME "Widget"
-
-#define WRT_WIDGET_PROPERTY_AUTHOR       "author"
-#define WRT_WIDGET_PROPERTY_AUTHOR_EMAIL "authorEmail"
-#define WRT_WIDGET_PROPERTY_AUTHOR_HREF  "authorHref"
-#define WRT_WIDGET_PROPERTY_DESCRIPTION  "description"
-#define WRT_WIDGET_PROPERTY_ID           "id"
-#define WRT_WIDGET_PROPERTY_NAME         "name"
-#define WRT_WIDGET_PROPERTY_SHORT_NAME   "shortName"
-#define WRT_WIDGET_PROPERTY_VERSION      "version"
-#define WRT_WIDGET_PROPERTY_HEIGHT       "height"
-#define WRT_WIDGET_PROPERTY_WIDTH        "width"
-
-namespace WrtPlugins {
-namespace W3C {
-using namespace WrtDeviceApis;
-using namespace WrtDeviceApis::Commons;
-using namespace WrtDeviceApis::CommonsJavaScript;
-using namespace WrtDeviceApis::Widget;
-
-struct WidgetPrivateObject
-{
-    Widget::Api::IWidgetPtr iwidget;
-    JSObjectRef preferencesObject;
-    //TEMP
-    //int widgetId     // TODO: check is it necessary (g.rynkowski)
-    JSObjectRef widgetObject;
-};
-typedef std::shared_ptr<WidgetPrivateObject> WidgetPrivateObjectPtr;
-
-typedef WrtDeviceApis::CommonsJavaScript::PrivateObjectT
-<WidgetPrivateObjectPtr>::Type JSWidgetPrivateObject;
-
-WrtDeviceApis::Widget::Api::IWidgetPtr getIWidget(JSObjectRef arg)
-{
-    JSWidgetPrivateObject* priv =
-        static_cast<JSWidgetPrivateObject*>(JSObjectGetPrivate(arg));
-
-    if (!priv) {
-        LogError("Private object not initialized");
-        ThrowMsg(Commons::NullPointerException,
-                 "Private object not initialized");
-    }
-
-    return priv->getObject()->iwidget;
-}
-
-LocalStorage::Api::ILocalStoragePtr getLocalStorage(int widgetId)
-{
-    LocalStorage::Api::ILocalStoragePtr storage(
-        LocalStorage::Api::getLocalStorage(widgetId));
-
-    return storage;
-}
-
-JSObjectRef getPreferences(JSObjectRef arg)
-{
-    JSWidgetPrivateObject* priv =
-        static_cast<JSWidgetPrivateObject*>(JSObjectGetPrivate(arg));
-
-    if (!priv) {
-        LogError("Private object not initialized");
-        return NULL;
-    }
-
-    return priv->getObject()->preferencesObject;
-}
-
-JSObjectRef createPreferencesObject(JSContextRef context,
-                                    JSObjectRef widgetObject,
-                                    int widgetId)
-{
-    Assert(widgetObject && "Widget Object can'n be null");
-    //delete is invoked in JSPreferences::finalize
-    LocalStoragePrivateData* priv = new LocalStoragePrivateData;
-    Assert(priv && "Private data is null");
-    priv->istorage = getLocalStorage(widgetId);
-    priv->widgetObject = widgetObject;
-
-    JSObjectRef preferences = JSObjectMake(context,
-                                           JSPreferences::getClassRef(),
-                                           priv);
-
-    if (!preferences) {
-        LogError("Preferences object is null");
-        delete priv;
-    }
-    //Unprotect is called in JSWidget::finalize
-    JSValueProtect(context, preferences);
-
-    return preferences;
-}
-
-JSClassDefinition JSWidget::m_classInfo = {
-    0,
-    kJSClassAttributeNone,
-    WIDGET_PLUGIN_NAME,
-    0,
-    m_property,
-    NULL,
-    initialize,
-    finalize,
-    hasProperty,
-    getProperty,
-    setProperty,
-    NULL, //DeleteProperty,
-    NULL, //GetPropertyNames,
-    NULL, //CallAsFunction,
-    callAsConstructor,
-    NULL, //HasInstance,
-    NULL, //ConvertToType,
-};
-
-JSStaticValue JSWidget::m_property[] = {
-    { WRT_WIDGET_PROPERTY_AUTHOR, JSWidget::getAuthor,
-      0, kJSPropertyAttributeReadOnly },
-    { WRT_WIDGET_PROPERTY_AUTHOR_EMAIL, JSWidget::getAuthorEmail,
-      0, kJSPropertyAttributeReadOnly },
-    { WRT_WIDGET_PROPERTY_AUTHOR_HREF, JSWidget::getAuthorHref,
-      0, kJSPropertyAttributeReadOnly },
-    { WRT_WIDGET_PROPERTY_DESCRIPTION, JSWidget::getDescription,
-      0, kJSPropertyAttributeReadOnly },
-    { WRT_WIDGET_PROPERTY_ID, JSWidget::getId,
-      0, kJSPropertyAttributeReadOnly },
-    { WRT_WIDGET_PROPERTY_NAME, JSWidget::getName,
-      0, kJSPropertyAttributeReadOnly },
-    { WRT_WIDGET_PROPERTY_SHORT_NAME, JSWidget::getShortName,
-      0, kJSPropertyAttributeReadOnly },
-    { WRT_WIDGET_PROPERTY_VERSION, JSWidget::getVersion,
-      0, kJSPropertyAttributeReadOnly },
-    { WRT_WIDGET_PROPERTY_HEIGHT, JSWidget::getHeight,
-      0, kJSPropertyAttributeReadOnly },
-    { WRT_WIDGET_PROPERTY_WIDTH, JSWidget::getWidth,
-      0, kJSPropertyAttributeReadOnly },
-    { 0, 0, 0, 0 }
-};
-
-JSClassRef JSWidget::getClassRef()
-{
-    if (!m_jsClassRef) {
-        m_jsClassRef = JSClassCreate(&m_classInfo);
-    }
-    return m_jsClassRef;
-}
-
-const JSClassDefinition* JSWidget::getClassInfo()
-{
-    return &m_classInfo;
-}
-
-JSClassRef JSWidget::m_jsClassRef = JSClassCreate(JSWidget::getClassInfo());
-
-void JSWidget::initialize(JSContextRef context,
-                          JSObjectRef object)
-{
-    JSGlobalContextRef g_context = JSContextGetGlobalContext(context);
-
-    LogDebug("entered. Context : " << context << "(global:" << g_context << "), Object: " << object);
-
-    if (context != g_context)
-    {
-        context = g_context;
-    }
-
-    JSWidgetPrivateObject* priv =
-        static_cast<JSWidgetPrivateObject*>(JSObjectGetPrivate(object));
-
-    if (!priv) {
-        LogDebug("creation private object");
-
-        Try {
-            using namespace WrtDeviceApis::Commons;
-
-            Widget::Api::IWidgetPtr widget =
-                Api::WidgetFactory::createWidget();
-            int widgetId = WrtAccessSingleton::Instance().getWidgetId();
-            JSObjectRef preferences =
-                createPreferencesObject(context,
-                                        object,
-                                        widgetId);
-            if (!preferences) {
-                LogError("Failed to create preferences object");
-            }
-
-            WidgetPrivateObjectPtr widgetPriv(new WidgetPrivateObject);
-            widgetPriv->iwidget = widget;
-            widgetPriv->preferencesObject = preferences;
-
-            priv = new JSWidgetPrivateObject(context, widgetPriv);
-            JSObjectSetPrivate(object, priv);
-        }
-        Catch(Commons::InvalidArgumentException){
-            LogError("You should register widget id in ON_WIDGET_START");
-            return;
-        }
-        Catch(DPL::Exception) {
-            LogError("Failed to create private object for JSWidget");
-            return;
-        }
-    }
-}
-
-void JSWidget::finalize(JSObjectRef object)
-{
-    LogDebug("entered");
-    LogDebug("Object: " << object);
-    JSWidgetPrivateObject* priv =
-        static_cast<JSWidgetPrivateObject*>(JSObjectGetPrivate(object));
-
-    if (priv) {
-        JSValueUnprotect(priv->getContext(),
-                         priv->getObject()->preferencesObject);
-
-        delete priv;
-        LogDebug("private object is released");
-    } else {
-        LogDebug("private object wasn't created");
-    }
-}
-
-JSValueRef JSWidget::getAuthor(JSContextRef context,
-                               JSObjectRef object,
-                               JSStringRef /*propertyName*/,
-                               JSValueRef* exception)
-{
-    LogDebug("entered");
-
-    Try {
-        Converter converter(context);
-        return converter.toJSValueRef(getIWidget(object)->getAuthor());
-    }
-    CATCH_EXCEPTION_CONVERSION
-    CATCH_EXCEPTION_NULL_PTR
-        CATCH_EXCEPTION_PLATFORM_ERROR
-}
-
-JSValueRef JSWidget::getAuthorEmail(JSContextRef context,
-                                    JSObjectRef object,
-                                    JSStringRef /*propertyName*/,
-                                    JSValueRef* exception)
-{
-    Try {
-        Converter converter(context);
-        return converter.toJSValueRef(getIWidget(object)->getAuthorEmail());
-    }
-    CATCH_EXCEPTION_CONVERSION
-    CATCH_EXCEPTION_NULL_PTR
-        CATCH_EXCEPTION_PLATFORM_ERROR
-}
-
-JSValueRef JSWidget::getAuthorHref(JSContextRef context,
-                                   JSObjectRef object,
-                                   JSStringRef /*propertyName*/,
-                                   JSValueRef* exception)
-{
-    Try {
-        Converter converter(context);
-        return converter.toJSValueRef(getIWidget(object)->getAuthorHref());
-    }
-    CATCH_EXCEPTION_CONVERSION
-    CATCH_EXCEPTION_NULL_PTR
-        CATCH_EXCEPTION_PLATFORM_ERROR
-}
-
-JSValueRef JSWidget::getDescription(JSContextRef context,
-                                    JSObjectRef object,
-                                    JSStringRef /*propertyName*/,
-                                    JSValueRef* exception)
-{
-    Try {
-        Converter converter(context);
-        return converter.toJSValueRef(getIWidget(object)->getDescription());
-    }
-    CATCH_EXCEPTION_CONVERSION
-    CATCH_EXCEPTION_NULL_PTR
-        CATCH_EXCEPTION_PLATFORM_ERROR
-}
-
-JSValueRef JSWidget::getId(JSContextRef context,
-                           JSObjectRef object,
-                           JSStringRef /*propertyName*/,
-                           JSValueRef* exception)
-{
-    Try {
-        Converter converter(context);
-        return converter.toJSValueRef(getIWidget(object)->getId());
-    }
-    CATCH_EXCEPTION_CONVERSION
-    CATCH_EXCEPTION_NULL_PTR
-        CATCH_EXCEPTION_PLATFORM_ERROR
-}
-
-JSValueRef JSWidget::getName(JSContextRef context,
-                             JSObjectRef object,
-                             JSStringRef /*propertyName*/,
-                             JSValueRef* exception)
-{
-    Try {
-        Converter converter(context);
-        return converter.toJSValueRef(getIWidget(object)->getName());
-    }
-    CATCH_EXCEPTION_CONVERSION
-    CATCH_EXCEPTION_NULL_PTR
-        CATCH_EXCEPTION_PLATFORM_ERROR
-}
-
-JSValueRef JSWidget::getShortName(JSContextRef context,
-                                  JSObjectRef object,
-                                  JSStringRef /*propertyName*/,
-                                  JSValueRef* exception)
-{
-    Try {
-        Converter converter(context);
-        return converter.toJSValueRef(getIWidget(object)->getShortName());
-    }
-    CATCH_EXCEPTION_CONVERSION
-    CATCH_EXCEPTION_NULL_PTR
-        CATCH_EXCEPTION_PLATFORM_ERROR
-}
-
-JSValueRef JSWidget::getVersion(JSContextRef context,
-                                JSObjectRef object,
-                                JSStringRef /*propertyName*/,
-                                JSValueRef* exception)
-{
-    Try {
-        Converter converter(context);
-        return converter.toJSValueRef(getIWidget(object)->getVersion());
-    }
-    CATCH_EXCEPTION_CONVERSION
-    CATCH_EXCEPTION_NULL_PTR
-        CATCH_EXCEPTION_PLATFORM_ERROR
-}
-
-JSValueRef JSWidget::getHeight(JSContextRef context,
-                               JSObjectRef object,
-                               JSStringRef /*propertyName*/,
-                               JSValueRef* exception)
-{
-    Try {
-        Converter converter(context);
-        unsigned int height = getIWidget(object)->getHeight();
-        if (0 == height) {
-            height = 1;
-        }
-        return converter.toJSValueRef(height);
-    }
-    CATCH_EXCEPTION_CONVERSION
-    CATCH_EXCEPTION_NULL_PTR
-        CATCH_EXCEPTION_PLATFORM_ERROR
-}
-
-JSValueRef JSWidget::getWidth(JSContextRef context,
-                              JSObjectRef object,
-                              JSStringRef /*propertyName*/,
-                              JSValueRef* exception)
-{
-    Try {
-        Converter converter(context);
-        unsigned int width = getIWidget(object)->getWidth();
-        if (0 == width) {
-            width = 1;
-        }
-        return converter.toJSValueRef(width);
-    }
-    CATCH_EXCEPTION_CONVERSION
-    CATCH_EXCEPTION_NULL_PTR
-        CATCH_EXCEPTION_PLATFORM_ERROR
-}
-
-bool JSWidget::hasProperty(JSContextRef context,
-                           JSObjectRef /*object*/,
-                           JSStringRef propertyName)
-{
-    LogDebug("enter");
-
-    Try {
-        Converter converter(context);
-
-        std::string key = converter.toString(propertyName);
-        if (key == "preferences") {
-            return true;
-        }
-    }
-    Catch(Commons::InvalidArgumentException) {
-        LogDebug("Pair for given key doesnt exist");
-    }
-
-    Catch(Commons::ConversionException) {
-        LogError("Error on conversion");
-    }
-
-    Catch(Commons::NullPointerException) {
-        LogError("Error on pointer, null value");
-    }
-
-    Catch(Commons::PlatformException){
-        LogError("PlatformException occured");
-    }
-    return false;
-}
-
-JSValueRef JSWidget::getProperty(JSContextRef context,
-                                 JSObjectRef object,
-                                 JSStringRef propertyName,
-                                 JSValueRef* exception)
-{
-    LogDebug("Object: " << object);
-
-    Try {
-        Converter converter(context);
-
-        std::string key = converter.toString(propertyName);
-
-        if (key == "preferences") {
-            Converter converter(context);
-            JSObjectRef pref = getPreferences(object);
-            if (!pref) {
-                LogError("Preferences object is NULL");
-                return JSValueMakeUndefined(context);
-            }
-            return pref;
-        }
-        LogError("Property NOT supported: " << propertyName);
-        return JSValueMakeUndefined(context);
-    }
-
-    CATCH_EXCEPTION_CONVERSION
-    CATCH_EXCEPTION_NULL_PTR
-        CATCH_EXCEPTION_INVALID_ARG
-}
-
-bool JSWidget::setProperty(JSContextRef context,
-                           JSObjectRef /*object*/,
-                           JSStringRef propertyName,
-                           JSValueRef /*jvalue*/,
-                           JSValueRef* exception)
-{
-    LogDebug("enter");
-
-    Try {
-        Converter converter(context);
-
-        std::string key = converter.toString(propertyName);
-        if (key == "preferences") {
-            LogError("Object is read only");
-            return true;
-        }
-    }
-    CATCH_EXCEPTION_INVALID_ARG
-    CATCH_EXCEPTION_CONVERSION
-        CATCH_EXCEPTION_NULL_PTR
-
-    return false;
-}
-
-JSObjectRef JSWidget::callAsConstructor(JSContextRef context,
-                                        JSObjectRef /*constructor*/,
-                                        size_t /*argumentCount*/,
-                                        const JSValueRef /*arguments*/[],
-                                        JSValueRef* /*exception*/)
-{
-    LogDebug("widget constructor");
-    return JSObjectMake(context, JSWidget::getClassRef(), NULL);
-}
-
-#undef CATCH_EXCEPTION_NO_MODIFABLE
-#undef CATCH_EXCEPTION_CONVERSION
-#undef CATCH_EXCEPTION_NULL_PTR
-#undef CATCH_EXCEPTION_PLATFORM_ERROR
-#undef CATCH_EXCEPTION_SECURITY
-#undef CATCH_EXCEPTION_OUT_OF_RANGE
-#undef CATCH_EXCEPTION_INVALID_ARG
-}
-}
diff --git a/src_mobile/standards/W3C/Widget/JSWidget.h b/src_mobile/standards/W3C/Widget/JSWidget.h
deleted file mode 100644 (file)
index f1f979c..0000000
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * 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       JSWidget.h
- * @author     Grzegorz Krawczyk (g.krawczyk@samsung.com)
- * @version    0.1
- * @brief
- */
-
-#ifndef _WRT_PLUGIN_JS_WIDGET_H_
-#define _WRT_PLUGIN_JS_WIDGET_H_
-
-#include <JavaScriptCore/JavaScript.h>
-#include <CommonsJavaScript/PrivateObject.h>
-#include <wrt_plugin_export.h>
-
-namespace WrtPlugins {
-namespace W3C {
-class JSWidget
-{
-  public:
-    /**
-     * This method initializes this in the JS Engine.
-     */
-    static JSClassRef getClassRef();
-
-    /**
-     * Gets object's class description.
-     */
-    static const JSClassDefinition* getClassInfo();
-
-    static JSObjectRef callAsConstructor(JSContextRef context,
-                                         JSObjectRef constructor,
-                                         size_t argumentCount,
-                                         const JSValueRef arguments[],
-                                         JSValueRef* exception);
-
-  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 value property.
-     */
-    static JSStaticValue m_property[];
-
-    /**
-     * This structure contains properties and callbacks that define a type of
-     * object.
-     */
-    static JSClassDefinition m_classInfo;
-
-    static JSClassRef m_jsClassRef;
-
-    // getters for properties
-    static JSValueRef getAuthor(JSContextRef context,
-                                JSObjectRef object,
-                                JSStringRef propertyName,
-                                JSValueRef* exception);
-    static JSValueRef getAuthorEmail(JSContextRef context,
-                                     JSObjectRef object,
-                                     JSStringRef propertyName,
-                                     JSValueRef* exception);
-    static JSValueRef getAuthorHref(JSContextRef context,
-                                    JSObjectRef object,
-                                    JSStringRef propertyName,
-                                    JSValueRef* exception);
-    static JSValueRef getDescription(JSContextRef context,
-                                     JSObjectRef object,
-                                     JSStringRef propertyName,
-                                     JSValueRef* exception);
-    static JSValueRef getId(JSContextRef context,
-                            JSObjectRef object,
-                            JSStringRef propertyName,
-                            JSValueRef* exception);
-    static JSValueRef getName(JSContextRef context,
-                              JSObjectRef object,
-                              JSStringRef propertyName,
-                              JSValueRef* exception);
-    static JSValueRef getShortName(JSContextRef context,
-                                   JSObjectRef object,
-                                   JSStringRef propertyName,
-                                   JSValueRef* exception);
-    static JSValueRef getVersion(JSContextRef context,
-                                 JSObjectRef object,
-                                 JSStringRef propertyName,
-                                 JSValueRef* exception);
-    static JSValueRef getHeight(JSContextRef context,
-                                JSObjectRef object,
-                                JSStringRef propertyName,
-                                JSValueRef* exception);
-    static JSValueRef getWidth(JSContextRef context,
-                               JSObjectRef object,
-                               JSStringRef propertyName,
-                               JSValueRef* exception);
-
-    static bool hasProperty(JSContextRef context,
-                            JSObjectRef object,
-                            JSStringRef propertyName);
-
-    static JSValueRef getProperty(JSContextRef context,
-                                  JSObjectRef object,
-                                  JSStringRef propertyName,
-                                  JSValueRef* exception);
-
-    static bool setProperty(JSContextRef context,
-                            JSObjectRef object,
-                            JSStringRef propertyName,
-                            JSValueRef value,
-                            JSValueRef* exception);
-};
-}
-}
-
-#endif /* _WRT_PLUGIN_JS_WIDGET_INTERFACE_H_ */
diff --git a/src_mobile/standards/W3C/Widget/plugin_config.cpp b/src_mobile/standards/W3C/Widget/plugin_config.cpp
deleted file mode 100644 (file)
index 8588aca..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * 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 "plugin_config.h"
-
-namespace WrtPlugins {
-namespace W3C {
-template <>
-WidgetDeclarations::ParamsMap WidgetDeclarations::m_params =
-    WrtPlugins::W3C::WidgetDeclarations::ParamsMap();
-
-template <>
-WidgetDeclarations::DeviceCapsMaps WidgetDeclarations::m_deviceCaps =
-    WrtPlugins::W3C::WidgetDeclarations::DeviceCapsMaps();
-
-template <>
-WidgetDeclarations::FeaturesMap WidgetDeclarations::m_features = {
-    {
-        "http://w3cWidgetInterface.com/w3c-widget-interface",
-        {}
-    }
-};
-
-template <>
-WidgetDeclarations::FunctionsMap WidgetDeclarations::m_functions =
-    WrtPlugins::W3C::WidgetDeclarations::FunctionsMap();
-} // namespace Wac2_0
-} // namespace WrtPlugins
diff --git a/src_mobile/standards/W3C/Widget/plugin_config.h b/src_mobile/standards/W3C/Widget/plugin_config.h
deleted file mode 100644 (file)
index 13de247..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * 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.
- */
-#ifndef _WIDGET_PLUGIN_CONFIG_H_
-#define _WIDGET_PLUGIN_CONFIG_H_
-
-#include <Security/StaticDeclaration.h>
-
-namespace WrtPlugins {
-namespace W3C {
-enum class WidgetParamId
-{};
-
-enum class WidgetDeviceCapId
-{};
-
-enum class WidgetFunctionId
-{};
-
-typedef WrtDeviceApis::CommonsJavaScript::StaticDeclarations <
-    WidgetParamId,
-    WidgetDeviceCapId,
-    WidgetFunctionId> WidgetDeclarations;
-}
-}
-
-#endif //  _WIDGET_PLUGIN_CONFIG_H_
diff --git a/src_mobile/standards/W3C/Widget/plugin_initializer.cpp b/src_mobile/standards/W3C/Widget/plugin_initializer.cpp
deleted file mode 100644 (file)
index 1768069..0000000
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * 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       plugin_initializer.cpp
- * @author     Grzegorz Krawczyk (g.krawczyk@samsung.com)
- * @version    0.1
- * @brief
- */
-
-#include <dpl/log/secure_log.h>
-
-#include <Commons/plugin_initializer_def.h>
-#include <Commons/WrtAccess/WrtAccess.h>
-
-#include "JSWidget.h"
-#include "JSPreferences.h"
-
-#include "plugin_config.h"
-
-#define OBJECT_WIDGET "widget"
-#define INTERFACE_WIDGET_NAME "Widget"
-#define OBJECT_PREFERENCES "preferences"
-
-using namespace WrtPlugins::W3C;
-using namespace WrtDeviceApis;
-using namespace WrtDeviceApis::Commons;
-
-namespace Options {
-class_definition_options_t WidgetOptions = {
-    JS_CLASS,
-    CREATE_INSTANCE,
-    NONE_NOTICE,
-    IGNORED,
-    NULL,
-    NULL,
-    NULL
-};
-
-class_definition_options_t WidgetInterfaceOptions = {
-    JS_INTERFACE,
-    CREATE_INSTANCE,
-    NONE_NOTICE,
-    IGNORED, //ignored
-    NULL,
-    NULL,
-    NULL
-};
-};
-
-void on_widget_init_callback(feature_mapping_interface_t *mapping)
-{
-    _D("[W3C\\widget] on_widget_init_callback");
-
-    WrtPlugins::W3C::WidgetDeclarations::getMappingInterface(mapping);
-}
-
-void on_widget_start_callback(int widgetId)
-{
-    _D("[W3C\\widget] on_widget_start_callback (%d)", widgetId);
-
-    Try
-    {
-        WrtAccessSingleton::Instance().initialize(widgetId);
-    }
-    Catch(Commons::Exception)
-    {
-        _E("Wrt wrapper registration failed");
-        return;
-    }
-}
-
-void on_widget_stop_callback(int widgetId)
-{
-    _D("[W3C\\widget] on_widget_stop_callback (%d)", widgetId);
-    Try
-    {
-        WrtAccessSingleton::Instance().deinitialize(widgetId);
-    }
-    Catch(Commons::Exception)
-    {
-        _E("Wrt wrapper registration failed");
-        return;
-    }
-}
-
-PLUGIN_ON_WIDGET_START(on_widget_start_callback)
-PLUGIN_ON_WIDGET_STOP(on_widget_stop_callback)
-PLUGIN_ON_WIDGET_INIT(on_widget_init_callback)
-
-PLUGIN_CLASS_MAP_BEGIN
-PLUGIN_CLASS_MAP_ADD_INTERFACE(
-    WRT_JS_EXTENSION_OBJECT_GLOBAL,
-    INTERFACE_WIDGET_NAME,
-    (js_class_template_getter) WrtPlugins::W3C::JSWidget::getClassRef,
-    reinterpret_cast<js_class_constructor_cb_t>(WrtPlugins::W3C::JSWidget::
-                                                    callAsConstructor),
-    &Options::WidgetInterfaceOptions)
-PLUGIN_CLASS_MAP_ADD_INTERFACE_PRODUCT(
-    WRT_JS_EXTENSION_OBJECT_GLOBAL,
-    OBJECT_WIDGET,
-    INTERFACE_WIDGET_NAME,
-    &Options::WidgetOptions)
-
-PLUGIN_CLASS_MAP_END
-
-#undef OBJECT_WIDGET
-#undef OBJECT_PREFERENCES
diff --git a/src_mobile/wrt-popup/ace/CMakeLists.txt b/src_mobile/wrt-popup/ace/CMakeLists.txt
deleted file mode 100755 (executable)
index 2ecd23d..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-ADD_SUBDIRECTORY(popup-bin)
-ADD_SUBDIRECTORY(popup-runner)
diff --git a/src_mobile/wrt-popup/ace/popup-bin/CMakeLists.txt b/src_mobile/wrt-popup/ace/popup-bin/CMakeLists.txt
deleted file mode 100644 (file)
index f87483d..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-# 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     CMakeLists.txt
-# @author   Janusz Kozerski (j.kozerski@samsung.com)
-#
-# @version  1.0
-#
-
-PKG_CHECK_MODULES(WRT_POPUP_DEP
-    dpl-efl
-    elementary
-    security-client
-    security-popup-validation
-   REQUIRED)
-
-set(WRT_POPUP_SRC_DIR ${PROJECT_SOURCE_DIR}/src/wrt-popup/ace/popup-bin)
-
-set(WRT_POPUP_SOURCES
-    ${WRT_POPUP_SRC_DIR}/Popup.cpp
-)
-
-ADD_DEFINITIONS(${WRT_POPUP_DEP_CFLAGS})
-
-INCLUDE_DIRECTORIES(
-    ${WRT_POPUP_SRC_DIR}
-    ${WRT_POPUP_DEP_INCLUDE_DIRS}
-)
-
-ADD_EXECUTABLE(${TARGET_POPUP_ACE}
-    ${WRT_POPUP_SOURCES}
-)
-
-SET_TARGET_PROPERTIES(${TARGET_POPUP_ACE} PROPERTIES
-    COMPILE_FLAGS -fPIC
-)
-
-SET_TARGET_PROPERTIES(${TARGET_POPUP_ACE} PROPERTIES
-    #LINK_FLAGS "-Wl,--as-needed -Wl"
-    SOVERSION ${PROJECT_API_VERSION}
-    VERSION ${PROJECT_VERSION}
-)
-
-target_link_libraries(${TARGET_POPUP_ACE}
-    ${WRT_POPUP_DEP_LIBRARIES}
-    ${TARGET_POPUP_ACE_RUNNER_LIB}
-    ${WRT_POPUP_DEP_LDFLAGS}
-)
-
-INSTALL(TARGETS ${TARGET_POPUP_ACE}
-    DESTINATION bin
-)
diff --git a/src_mobile/wrt-popup/ace/popup-bin/Popup.cpp b/src_mobile/wrt-popup/ace/popup-bin/Popup.cpp
deleted file mode 100644 (file)
index 6d51ace..0000000
+++ /dev/null
@@ -1,463 +0,0 @@
-/*
- * 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        Popup.c
- * @author      Janusz Kozerski (j.kozerski@samsung.com)
- * @version     1.0
- */
-
-/*
- * This is just a example pop-up that shows how to use a new C-API in
- * wrt-security.
- * This pop-up should be re-implemented by members of NGWAP.
- */
-
-#include <stdio.h>
-#include <unistd.h>
-#include <string.h>
-#include <errno.h>
-#include <vector>
-#include <ctime>
-
-#include <Elementary.h>
-
-#include <dpl/log/log.h>
-#include <dpl/serialization.h>
-#include <ace_api_common.h>
-#include <ace_api_popup_validation.h>
-
-#include "popup-runner.h"
-#include "Popup.h"
-
-namespace { // anonymous
-static void set_validity_from_checkbox(struct ace_popup_data *pdp)
-{
-    if (NULL == pdp) {
-        LogError("pdp is NULL; return");
-        return;
-    }
-
-    if (pdp->always) {
-        LogDebug("Remember ALWAYS");
-        pdp->remember_choice = ACE_ALWAYS;
-        return;
-    }
-    if (pdp->per_session) {
-        LogDebug("Remember PER_SESSION");
-        pdp->remember_choice = ACE_PER_SESSION;
-        return;
-    }
-    LogDebug("Remember ONCE");
-    pdp->remember_choice = ACE_ONCE;
-    return;
-}
-
-static void on_done(void)
-{
-    // Quit the efl-mainloop
-    LogDebug("elm_exit()");
-    elm_exit();
-}
-
-static void grant_answer(void *data,
-                         Evas_Object * /* obj */,
-                         void * /* event_info */)
-{
-    LogDebug("grant_answer");
-    if (NULL == data) {
-        LogError("data is NULL; return");
-        return;
-    }
-    struct ace_popup_data *pdp = static_cast <struct ace_popup_data *>(data);
-
-    set_validity_from_checkbox(pdp);
-
-    ace_popup_validation_initialize();
-    pdp->validation_return = ace_validate_answer(
-            ACE_TRUE,
-            pdp->remember_choice,
-            pdp->resource_name,
-            pdp->session_id,
-            &(pdp->param_list),
-            pdp->handle,
-            &(pdp->validation_result));
-    ace_popup_validation_shutdown();
-
-    on_done();
-}
-
-static void deny_answer(void *data,
-                        Evas_Object * /* obj */,
-                        void * /* event_info */)
-{
-    LogDebug("deny_answer");
-    if (NULL == data) {
-        LogError("data is NULL; return");
-        return;
-    }
-    struct ace_popup_data *pdp = static_cast <struct ace_popup_data *>(data);
-
-    set_validity_from_checkbox(pdp);
-
-    ace_popup_validation_initialize();
-    pdp->validation_return = ace_validate_answer(
-            ACE_FALSE,
-            pdp->remember_choice,
-            pdp->resource_name,
-            pdp->session_id,
-            &(pdp->param_list),
-            pdp->handle,
-            &(pdp->validation_result));
-    ace_popup_validation_shutdown();
-
-    on_done();
-}
-
-static int _ace_params_deserializer(ace_param_list_t* ace_param_list,
-                                    Wrt::Popup::BinaryStream *stream)
-{
-    LogDebug("_ace_params_deserializer");
-
-    if (NULL == ace_param_list || NULL == stream) {
-        LogError("ace_param_list or stream is NULL; return -1");
-        return -1;
-    }
-
-    // deserialize ace_param_list->count;
-    size_t count = 0;
-    DPL::Deserialization::Deserialize(*stream, count);
-    ace_param_list->count = count;
-    LogDebug("count : " << count);
-
-    std::string name;
-    std::string value;
-    if (count == 0) {
-        ace_param_list->items = NULL;
-        return 0;
-    }
-    ace_param_list->items =
-        static_cast <ace_param_t *>(malloc(count * sizeof(ace_param_t)));
-    memset(ace_param_list->items, 0, count * sizeof(ace_param_t));
-
-    for (size_t i = 0; i < count; ++i) {
-        DPL::Deserialization::Deserialize(*stream, name);
-        ace_param_list->items[i].name =
-            strdup(const_cast <char *>(name.c_str()));
-
-        DPL::Deserialization::Deserialize(*stream, value);
-        ace_param_list->items[i].value =
-            strdup(const_cast <char *>(value.c_str()));
-    }
-    return 0;
-}
-
-static void _ace_params_finalize(ace_param_list_t* ace_param_list)
-{
-    if (!ace_param_list || !ace_param_list->items) {
-        LogDebug("List is null, nothing to do");
-        return;
-    }
-    for (size_t i = 0; i < ace_param_list->count; ++i) {
-        free(ace_param_list->items[i].name);
-        free(ace_param_list->items[i].value);
-    }
-    free(ace_param_list->items);
-    ace_param_list->items = NULL;
-    ace_param_list->count = 0;
-}
-
-static void show_popup(struct ace_popup_data *pdp)
-{
-    LogDebug("show_popup()");
-
-    if (NULL == pdp) {
-        LogError("pdp is NULL; return");
-        return;
-    }
-
-    const char *resource_type = static_cast <char *>(pdp->resource_name);
-
-    Evas_Object *win = NULL;
-    Evas_Object *box = NULL;
-    Evas_Object *label = NULL;
-    Evas_Object *grant_button = NULL;
-    Evas_Object *deny_button = NULL;
-    pdp->per_session = EINA_FALSE;
-    pdp->always = EINA_FALSE;
-
-    win = elm_win_add(NULL, "The wrt-client popup", ELM_WIN_NOTIFICATION);
-    elm_win_autodel_set(win, EINA_TRUE);
-    elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
-    evas_object_show(win);
-    elm_win_indicator_opacity_set(win, ELM_WIN_INDICATOR_TRANSLUCENT);
-
-    pdp->popup = elm_popup_add(win);
-
-    box = elm_box_add(pdp->popup);
-    evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, 0);
-    evas_object_size_hint_align_set(box, EVAS_HINT_FILL, 0.0);
-
-    label = elm_label_add(pdp->popup);
-    elm_object_style_set(label, "popup_description/default");
-    elm_label_line_wrap_set(label, ELM_WRAP_MIXED);
-    char *buff = NULL;
-    if (-1 ==
-        asprintf(&buff, "Application need an access to %s.<br>Grant or deny?",
-                 resource_type))
-    {
-        LogError("asprintf failed - returned -1");
-        evas_object_del(label);
-        evas_object_del(pdp->popup);
-        evas_object_del(win);
-        return;
-    }
-    elm_object_text_set(label, buff);
-    free(buff);
-    evas_object_size_hint_weight_set(label, EVAS_HINT_EXPAND, 0.0);
-    evas_object_size_hint_align_set(label, EVAS_HINT_FILL, EVAS_HINT_FILL);
-    evas_object_show(label);
-    elm_box_pack_end(box, label);
-
-    LogDebug("popup_type == " << pdp->popup_type);
-    if (pdp->popup_type == ACE_SESSION || pdp->popup_type == ACE_BLANKET) {
-        LogDebug("popup_type == ACE_SESSION || ACE_BLANKET");
-        Evas_Object *cb_session = elm_check_add(pdp->popup);
-        elm_object_text_set(cb_session, "Remember choice for this session");
-        elm_check_state_pointer_set(cb_session, &(pdp->per_session));
-        evas_object_smart_callback_add(cb_session, "changed", NULL, NULL);
-        evas_object_size_hint_align_set(cb_session,
-                                        EVAS_HINT_FILL,
-                                        EVAS_HINT_FILL);
-        evas_object_size_hint_weight_set(cb_session,
-                                         EVAS_HINT_EXPAND,
-                                         EVAS_HINT_EXPAND);
-        evas_object_show(cb_session);
-        elm_box_pack_end(box, cb_session);
-
-        if (pdp->popup_type == ACE_BLANKET) {
-            LogDebug("popup_type == ACE_BLANKET");
-            Evas_Object *cb_always = elm_check_add(pdp->popup);
-            elm_object_text_set(cb_always, "Remember choice forever");
-            elm_check_state_pointer_set(cb_always, &(pdp->always));
-            evas_object_smart_callback_add(cb_always, "changed", NULL, NULL);
-            evas_object_size_hint_align_set(cb_always,
-                                            EVAS_HINT_FILL,
-                                            EVAS_HINT_FILL);
-            evas_object_size_hint_weight_set(cb_always,
-                                             EVAS_HINT_EXPAND,
-                                             EVAS_HINT_EXPAND);
-            evas_object_show(cb_always);
-            elm_box_pack_end(box, cb_always);
-        }
-    }
-
-    elm_object_part_content_set(pdp->popup, "default", box);
-
-    grant_button = elm_button_add(pdp->popup);
-    elm_object_text_set(grant_button, "Grant");
-    elm_object_part_content_set(pdp->popup, "button1", grant_button);
-    evas_object_smart_callback_add(grant_button, "clicked", grant_answer, pdp);
-
-    deny_button = elm_button_add(pdp->popup);
-    elm_object_text_set(deny_button, "Deny");
-    elm_object_part_content_set(pdp->popup, "button2", deny_button);
-    evas_object_smart_callback_add(deny_button, "clicked", deny_answer, pdp);
-
-    evas_object_show(pdp->popup);
-
-    // Showing the popup window
-    evas_object_show(win);
-
-    // Run the efl mainloop
-    elm_run();
-}
-} // anonymous
-
-EAPI_MAIN int
-elm_main(int argc, char ** argv)
-{
-    UNHANDLED_EXCEPTION_HANDLER_BEGIN
-    {
-        // int pipe_in and int pipe_out should be passed to Popup via args.
-
-        //  These parameters should be passed to Popup via pipe:
-        //  ace_popup_t             popup_type
-        //  const ace_resource_t    resource_name
-        //  const ace_session_id_t  session_id
-        //  ace_widget_handle_t     handle
-        //  const ace_param_list_t  param_list
-
-        try {
-            DPL::Log::LogSystemSingleton::Instance().SetTag("WRT-POPUP-BIN");
-        } Catch(DPL::Exception) {
-            //cannot run logger
-            return ACE_INTERNAL_ERROR;
-        }
-        LogDebug(
-            "############################ popup binary ################################");
-
-        if (argc < 3) {
-            LogError(
-                "To few args passed in exec to popup-bin - should be at least 3:");
-            LogError("(binary-name, pipe_in, pipe_out)");
-            LogError("return ACE_INTERNAL_ERROR");
-            return ACE_INTERNAL_ERROR;
-        }
-        LogDebug("Passed args: " << argv[0] << ", " << argv[1] << ", " <<
-                 argv[2]);
-
-        int pipe_in;
-        int pipe_out;
-        std::stringstream parsing_stream;
-
-        // Parsing args (pipe_in, pipe_out)
-        parsing_stream.str(argv[1]);
-        parsing_stream >> pipe_in;
-        if ( parsing_stream.fail() ) {
-            LogError("Error while parsing pipe_in; return ACE_INTERNAL_ERROR");
-            return ACE_INTERNAL_ERROR;
-        }
-        parsing_stream.clear();
-        parsing_stream.str(argv[2]);
-        parsing_stream >> pipe_out;
-        if ( parsing_stream.fail() ) {
-            LogError("Error while parsing pipe_out; return ACE_INTERNAL_ERROR");
-            return ACE_INTERNAL_ERROR;
-        }
-        parsing_stream.clear();
-        LogDebug("Parsed pipes: IN: " << pipe_in << ", OUT: " << pipe_out);
-
-        int buff_size = 1024;
-        char line[buff_size];
-
-        struct ace_popup_data pd;
-        struct ace_popup_data *pdp = &pd;
-
-        pdp->popup = NULL;
-
-        ssize_t count = 0;
-        time_t time_start;
-        time(&time_start); // now
-        double timeout = 10.0;
-        // try to read parameters from pipe_in
-        // timeout is set for 10 seconds
-        do {
-            count = TEMP_FAILURE_RETRY(read(pipe_in, line, buff_size));
-            if (timeout < difftime(time(NULL), time_start) ) {
-                LogError("Timeout reached! Exit popup - ACE_INTERNAL_ERROR");
-                close(pipe_in);
-                close(pipe_out);
-                return ACE_INTERNAL_ERROR;
-            }
-        } while (0 == count);
-        if (count < 0) {
-            close(pipe_in);
-            close(pipe_out);
-            LogError("read returned a negative value (" << count << ")");
-            LogError("errno: " << strerror(errno) );
-            LogError("Exit popup - ACE_INTERNAL_ERROR");
-            return ACE_INTERNAL_ERROR;
-        }
-        LogDebug("Read bytes : " << count << " (in " <<
-                 difftime(time_start, time(NULL)) << " seconds)");
-        close(pipe_in); // cleanup
-
-        Wrt::Popup::BinaryStream stream;
-        stream.Write(count, static_cast <void *>(line));
-        int popup_type = ACE_ONESHOT;
-        std::string resource_name_str;
-        std::string session_id_str;
-        int handle = 0;
-
-        LogDebug("------- Deserialization -------");
-        // Deserialization order:
-        // popup_type, resource_name, session_id, handle, param_list
-
-        DPL::Deserialization::Deserialize(stream, popup_type);
-        LogDebug("popup_type_int : " << popup_type);
-        pdp->popup_type = static_cast <ace_popup_t>(popup_type);
-
-        DPL::Deserialization::Deserialize(stream, resource_name_str);
-        LogDebug("resource_name_char : " << resource_name_str.c_str());
-        pdp->resource_name =
-            strdup(const_cast <ace_resource_t>(resource_name_str.c_str()));
-
-        DPL::Deserialization::Deserialize(stream, session_id_str);
-        LogDebug("session_id_char : " << session_id_str.c_str());
-        pdp->session_id =
-            strdup(const_cast <ace_session_id_t>(session_id_str.c_str()));
-
-        DPL::Deserialization::Deserialize(stream, handle);
-        LogDebug("handle_int : " << handle);
-        pdp->handle = static_cast <ace_widget_handle_t>(handle);
-
-        if (_ace_params_deserializer(&(pdp->param_list), &stream)) {
-            return ACE_INTERNAL_ERROR;
-        }
-
-        pdp->per_session = EINA_FALSE;
-        pdp->always = EINA_FALSE;
-        pdp->validation_return = ACE_ACE_UNKNOWN_ERROR;
-
-        show_popup(pdp); // Showing popup
-
-        // sending validation_result to popup-runner
-        Wrt::Popup::BinaryStream stream_out;
-
-        LogDebug("pdp->validation_result : " << pdp->validation_result);
-        int validation_result_int = (int) pdp->validation_result;
-        LogDebug("validation_result_int : " << validation_result_int);
-        DPL::Serialization::Serialize(stream_out, validation_result_int);
-        if (-1 ==
-            TEMP_FAILURE_RETRY(write(pipe_out, stream_out.char_pointer(),
-                                     stream_out.size())))
-        {
-            LogError("Write to pipe failed!");
-            close(pipe_out);
-            return ACE_INTERNAL_ERROR;
-        }
-        close(pipe_out);
-
-        if (pdp->validation_return == ACE_OK) {
-            LogDebug("ACE_OK");
-        } else if (pdp->validation_return == ACE_INVALID_ARGUMENTS) {
-            LogError("ACE_INVALID_ARGUMENTS");
-        } else if (pdp->validation_return == ACE_INTERNAL_ERROR) {
-            LogError("ACE_INTERNAL_ERROR");
-        } else if (pdp->validation_return == ACE_ACE_UNKNOWN_ERROR) {
-            LogError("ACE_ACE_UNKNOWN_ERROR");
-        } else {
-            LogError("Really unknown error!!!");
-        }
-
-        LogDebug(
-            "############################ /popup binary ################################");
-
-        // Shutdown elementary
-        //LogDebug("elm_shutdown()");
-        //elm_shutdown();
-        // This is commented because, it causes that popup exits with 139 code
-        // (Segmentatation violation).
-        // Not calling elm_shutdown() should not have any negative consequences
-        // because this binary ends
-        // in next line, and system should clear the memory.
-
-        _ace_params_finalize(&(pdp->param_list));
-        return pdp->validation_return;
-    }
-    UNHANDLED_EXCEPTION_HANDLER_END
-}
-ELM_MAIN()
diff --git a/src_mobile/wrt-popup/ace/popup-bin/Popup.h b/src_mobile/wrt-popup/ace/popup-bin/Popup.h
deleted file mode 100644 (file)
index 388c921..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * 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        Popup.h
- * @author      Janusz Kozerski (j.kozerski@samsung.com)
- * @version     1.0
- */
-
-#include <Elementary.h>
-#include <ace_api_common.h>
-
-struct ace_popup_data {
-    ace_popup_t popup_type;
-    ace_resource_t resource_name;
-    ace_session_id_t session_id;
-    ace_param_list_t param_list;
-    ace_widget_handle_t handle;
-    ace_bool_t validation_result;
-    ace_return_t validation_return;
-
-    Evas_Object          *popup;
-    Eina_Bool per_session;
-    Eina_Bool always;
-
-    ace_validity_t remember_choice;
-};
diff --git a/src_mobile/wrt-popup/ace/popup-runner/CMakeLists.txt b/src_mobile/wrt-popup/ace/popup-runner/CMakeLists.txt
deleted file mode 100644 (file)
index 4e5053c..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-# 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     CMakeLists.txt
-# @author   Janusz Kozerski (j.kozerski@samsung.com)
-#
-# @version  1.0
-#
-
-PKG_CHECK_MODULES(WRT_POPUP_RUNNER_LIB_DEP
-    dpl-efl
-    elementary
-    security-client
-   REQUIRED)
-
-set(WRT_POPUP_RUNNER_LIB_SRC_DIR ${PROJECT_SOURCE_DIR}/src/wrt-popup/ace/popup-runner)
-
-set(WRT_POPUP_RUNNER_LIB_SOURCES
-    ${WRT_POPUP_RUNNER_LIB_SRC_DIR}/popup-runner.cpp
-)
-
-ADD_DEFINITIONS(${WRT_POPUP_RUNNER_LIB_DEP_CFLAGS})
-
-INCLUDE_DIRECTORIES(
-    ${WRT_POPUP_RUNNER_LIB_SRC_DIR}
-    ${WRT_POPUP_RUNNER_LIB_DEP_INCLUDE_DIRS}
-)
-
-ADD_LIBRARY(${TARGET_POPUP_ACE_RUNNER_LIB} SHARED
-    ${WRT_POPUP_RUNNER_LIB_SOURCES}
-)
-
-SET_TARGET_PROPERTIES(${TARGET_POPUP_ACE_RUNNER_LIB} PROPERTIES
-    COMPILE_FLAGS -fPIC
-)
-
-SET_TARGET_PROPERTIES(${TARGET_POPUP_ACE_RUNNER_LIB} PROPERTIES
-    SOVERSION ${CMAKE_PROJECT_API_VERSION}
-    VERSION ${CMAKE_PROJECT_VERSION}
-)
-
-target_link_libraries(${TARGET_POPUP_ACE_RUNNER_LIB}
-    ${WRT_POPUP_RUNNER_LIB_DEP_LIBRARIES}
-    ${WRT_POPUP_RUNNER_LIB_DEP_LDFLAGS}
-)
-
-INSTALL(TARGETS ${TARGET_POPUP_ACE_RUNNER_LIB}
-    DESTINATION lib
-)
-
-INSTALL(FILES ${WRT_POPUP_RUNNER_LIB_SRC_DIR}/popup-runner.h
-    DESTINATION ${DESTINATION_HEADERS_WRT_POPUP_RUNNER}
-)
diff --git a/src_mobile/wrt-popup/ace/popup-runner/popup-runner.cpp b/src_mobile/wrt-popup/ace/popup-runner/popup-runner.cpp
deleted file mode 100644 (file)
index e46fc16..0000000
+++ /dev/null
@@ -1,290 +0,0 @@
-/*
- * 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        popup-runner.cpp
- * @author      Janusz Kozerski (j.kozerski@samsung.com)
- * @version     1.0
- */
-
-/*
- * This is just a example pop-up that shows how to use a new C-API in
- * wrt-security.
- * This pop-up should be re-implemented by members of NGWAP.
- */
-
-#include <stdio.h>
-#include <unistd.h>
-#include <string.h>
-#include <iostream>
-#include <sstream>
-#include <sys/types.h>
-#include <sys/wait.h>
-
-#include <dpl/log/log.h>
-
-#include "popup-runner.h"
-
-namespace { // anonymous
-const char *POPUP_EXEC = "/usr/bin/wrt-popup-ace-runtime";
-
-void _ace_params_serializer (const ace_param_list_t* ace_param_list,
-                             Wrt::Popup::BinaryStream *stream)
-{
-    LogDebug("_ace_params_serializer");
-
-    if (NULL == ace_param_list || NULL == stream) {
-        LogError("*ace_param_list or *stream is NULL; return");
-        return;
-    }
-    LogDebug("Param count : " << ace_param_list->count);
-
-    // serialize ace_param_list->count;
-    size_t count = static_cast <size_t>(ace_param_list->count);
-    DPL::Serialization::Serialize(*stream, count);
-
-    for (size_t i = 0; i < count; ++i) {
-        std::string name(ace_param_list->items[i].name);
-        DPL::Serialization::Serialize(*stream, name);
-
-        std::string value(ace_param_list->items[i].value);
-        DPL::Serialization::Serialize(*stream, value);
-    }
-}
-} // anonymous namespace
-
-namespace Wrt {
-namespace Popup {
-// BinaryStream class implementation
-void BinaryStream::Read(size_t num, void * bytes)
-{
-    size_t max_size = m_data.size();
-    for (size_t i = 0; i < num; ++i) {
-        if (i + m_readPosition >= max_size) {
-            return;
-        }
-        static_cast <unsigned char*>(bytes)[i] = m_data[i + m_readPosition];
-    }
-    m_readPosition += num;
-}
-
-void BinaryStream::Write(size_t num, const void * bytes)
-{
-    for (size_t i = 0; i < num; ++i) {
-        m_data.push_back(static_cast <const unsigned char*>(bytes)[i]);
-    }
-}
-
-BinaryStream::BinaryStream()
-{
-    m_readPosition = 0;
-}
-
-BinaryStream::~BinaryStream() {}
-
-const unsigned char* BinaryStream::char_pointer() const
-{
-    return &m_data[0];
-}
-
-size_t BinaryStream::size() const
-{
-    return m_data.size();
-}
-// BinaryStream
-
-ace_return_t run_popup(
-    ace_popup_t popup_type,
-    const ace_resource_t resource_name,
-    const ace_session_id_t session_id,
-    const ace_param_list_t* ace_param_list,
-    ace_widget_handle_t handle,
-    ace_bool_t* validation_result)
-{
-    if (NULL == resource_name ||
-        NULL == session_id ||
-        NULL == ace_param_list ||
-        NULL == validation_result)
-    {
-        LogError("run_popup : ACE_INVALID_ARGUMENTS");
-        return ACE_INVALID_ARGUMENTS;
-    }
-    LogDebug("popup_type    : " << popup_type);
-    LogDebug("resource_name : " << resource_name);
-    LogDebug("session_id    : " << session_id);
-    LogDebug("widget handle : " << handle);
-
-    int popup_type_int = static_cast <int>(popup_type);
-    char *resource_name_char = static_cast <char *>(resource_name);
-    char *session_id_char = static_cast <char *>(session_id);
-    int handle_int = static_cast <int>(handle);
-
-    // serialization
-    Wrt::Popup::BinaryStream stream;
-    DPL::Serialization::Serialize(stream, popup_type_int);
-
-    std::string resource_name_str(resource_name_char);
-    DPL::Serialization::Serialize(stream, resource_name_str);
-
-    std::string session_id_str(session_id_char);
-    DPL::Serialization::Serialize(stream, session_id_str);
-
-    DPL::Serialization::Serialize(stream, handle_int);
-
-    _ace_params_serializer(ace_param_list, &stream);
-
-    int fd_send_to_child[2];
-    int fd_send_to_parent[2];
-    pid_t childpid;
-
-    if (0 != pipe(fd_send_to_child)) {
-        LogError("Cannot create pipes!");
-        return ACE_INTERNAL_ERROR;
-    }
-    if (0 != pipe(fd_send_to_parent)) {
-        LogError("Cannot create pipes!");
-        return ACE_INTERNAL_ERROR;
-    }
-
-    if ((childpid = fork()) == -1) {
-        LogError("Fork() ERROR");
-        return ACE_ACE_UNKNOWN_ERROR;
-    }
-
-    if (childpid == 0) { // Child process
-        LogDebug("Child");
-
-        // read data from parent
-        close(fd_send_to_child[1]);
-
-        // send data to parent
-        close(fd_send_to_parent[0]);
-
-        std::stringstream pipe_in_buff;
-        std::stringstream pipe_out_buff;
-        pipe_in_buff << fd_send_to_parent[1];
-        pipe_out_buff << fd_send_to_child[0];
-        std::string pipe_in = pipe_in_buff.str();
-        std::string pipe_out = pipe_out_buff.str();
-
-        LogDebug(
-            "Passed file descriptors: " << fd_send_to_child[0] << ", " <<
-            fd_send_to_parent[1]);
-
-        if (execl(POPUP_EXEC, POPUP_EXEC, pipe_out.c_str(), pipe_in.c_str(),
-                  NULL) < 0)
-        {
-            LogError("execlp FAILED");
-        }
-
-        LogError("This should not happened!!!");
-    } // end of child process - from now you can use DEBUG LOGS
-    else { // Parent process
-        LogDebug("Parent");
-
-        int buff_size = 1024;
-        char result[buff_size];
-        // send data to child
-        close(fd_send_to_child[0]);
-
-        //writing to child
-        LogDebug("Sending message to popup-bin process");
-        if (-1 ==
-            TEMP_FAILURE_RETRY(write(fd_send_to_child[1], stream.char_pointer(),
-                                     stream.size())))
-        {
-            LogError("Write to pipe failed!");
-            return ACE_INTERNAL_ERROR;
-        }
-        close(fd_send_to_child[1]); // cleanup
-        LogDebug("Message has been sent");
-
-        // read data from child
-        close(fd_send_to_parent[1]);
-
-        int status;
-        wait(&status);
-        LogDebug("STATUS EXIT ON POPUP (CHILD): " << status);
-        switch (status) {
-        case ACE_OK:
-            LogDebug("ACE_OK");
-            break;
-
-        case ACE_INVALID_ARGUMENTS:
-            LogDebug("ACE_INVALID_ARGUMENTS");
-            close(fd_send_to_parent[0]);
-            return static_cast <ace_return_t>(status);
-            break;
-
-        case ACE_INTERNAL_ERROR:
-            LogDebug("ACE_INTERNAL_ERROR");
-            close(fd_send_to_parent[0]);
-            return static_cast <ace_return_t>(status);
-            break;
-
-        case ACE_ACE_UNKNOWN_ERROR:
-            LogDebug("ACE_ACE_UNKNOWN_ERROR");
-            close(fd_send_to_parent[0]);
-            return static_cast <ace_return_t>(status);
-            break;
-
-        default:
-            LogDebug("UNKNOWN_ERROR");
-            close(fd_send_to_parent[0]);
-            status = (int) ACE_ACE_UNKNOWN_ERROR;
-            return static_cast <ace_return_t>(status);
-            break;
-        }
-
-        int count;
-        count = TEMP_FAILURE_RETRY(read(fd_send_to_parent[0], result, buff_size));
-        close(fd_send_to_parent[0]); // cleanup
-
-
-        if (0 < count) {
-            BinaryStream stream_in;
-            int validation_result_int;
-            stream_in.Write(count, result);
-            LogDebug("RESULT FROM POPUP (CHILD) : [ " << count << " ]");
-            DPL::Deserialization::Deserialize(stream_in, validation_result_int);
-            *validation_result = static_cast <ace_bool_t>(validation_result_int);
-
-            LogDebug("validation_result :");
-            switch (*validation_result) {
-            case ACE_FALSE:
-                LogDebug("ACE_FALSE");
-                break;
-            case ACE_TRUE:
-                LogDebug("ACE_TRUE");
-                break;
-            default:
-                LogDebug("UNKNOWN - DEFAULT");
-                break;
-            }
-        } else {
-            LogDebug("count = " << count);
-            LogDebug("UNKNOWN_ERROR");
-            return ACE_ACE_UNKNOWN_ERROR;
-        }
-
-        LogDebug("popup-runner: EXIT");
-        return (ace_return_t) status;
-    }
-
-    LogError("This should not happend!!!");
-    return ACE_ACE_UNKNOWN_ERROR;
-}
-} // Popup
-} // Wrt
diff --git a/src_mobile/wrt-popup/ace/popup-runner/popup-runner.h b/src_mobile/wrt-popup/ace/popup-runner/popup-runner.h
deleted file mode 100644 (file)
index d136fb1..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * 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        popup-runner.h
- * @author      Janusz Kozerski (j.kozerski@samsung.com)
- * @version     1.0
- */
-
-#include <ace_api_client.h>
-#include <vector>
-
-#include <dpl/serialization.h>
-
-namespace Wrt {
-namespace Popup {
-class BinaryStream : public DPL::IStream
-{
-  public:
-    void Read (size_t num, void * bytes);
-    void Write(size_t num, const void * bytes);
-
-    BinaryStream();
-    ~BinaryStream();
-
-    const unsigned char* char_pointer() const;
-    size_t size() const;
-
-  private:
-    std::vector<unsigned char> m_data;
-    size_t m_readPosition;
-};
-
-ace_return_t run_popup(
-    ace_popup_t popup_type,
-    const ace_resource_t resource_name,
-    const ace_session_id_t session_id,
-    const ace_param_list_t* ace_param_list,
-    ace_widget_handle_t handle,
-    ace_bool_t* validation_result
-    );
-} // Popup
-} // Wrt
diff --git a/src_mobile/wrt-popup/wrt/PopupEnum.h b/src_mobile/wrt-popup/wrt/PopupEnum.h
deleted file mode 100644 (file)
index 3200ef4..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef WRT_POPUP_ENUM_H
-#define WRT_POPUP_ENUM_H
-
-namespace Wrt {
-enum PopupType {
-    INFO_PROMPT = 1,
-    YES_NO_PROMPT,
-    YES_NO_CHECK_PROMPT
-};
-}
-
-#endif
-
diff --git a/src_mobile/wrt-popup/wrt/PopupSerializer.cpp b/src_mobile/wrt-popup/wrt/PopupSerializer.cpp
deleted file mode 100644 (file)
index e9dd99f..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * 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 "PopupSerializer.h"
-
-#include <memory>
-
-namespace Wrt {
-namespace PopupSerializer {
-void appendArg(int arg, DPL::BinaryQueue &buffer)
-{
-    size_t argSize = sizeof(arg);
-    buffer.AppendCopy(&argSize, sizeof(argSize));
-    buffer.AppendCopy(&arg, sizeof(arg));
-}
-
-void appendArg(const std::string &arg, DPL::BinaryQueue &buffer)
-{
-    size_t argSize = arg.size();
-    buffer.AppendCopy(&argSize, sizeof(argSize));
-    buffer.AppendCopy(arg.c_str(), argSize);
-}
-
-int getIntArg(DPL::BinaryQueue &buffer)
-{
-    int result;
-    size_t argSize;
-    buffer.FlattenConsume(&argSize, sizeof(argSize));
-    buffer.FlattenConsume(&result, argSize);
-    //TODO: what if argSize != sizeof(int)
-    //This should not be problem if this is run on the same machine.
-    return result;
-}
-
-std::string getStringArg(DPL::BinaryQueue &buffer)
-{
-    std::string::size_type size;
-    buffer.FlattenConsume(&size, sizeof(size));
-    std::unique_ptr<char[]> str(new char[size]);
-    buffer.FlattenConsume(str.get(), size);
-    return std::string(str.get(), str.get() + size);
-}
-}
-} // Wrt
diff --git a/src_mobile/wrt-popup/wrt/PopupSerializer.h b/src_mobile/wrt-popup/wrt/PopupSerializer.h
deleted file mode 100644 (file)
index 70407ec..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef WRT_POPUP_SERIALIZER_H
-#define WRT_POPUP_SERIALIZER_H
-
-#include <string>
-#include <dpl/binary_queue.h>
-
-namespace Wrt {
-namespace PopupSerializer {
-void appendArg(int arg, DPL::BinaryQueue &buffer);
-void appendArg(const std::string &arg, DPL::BinaryQueue &buffer);
-
-int getIntArg(DPL::BinaryQueue &buffer);
-std::string getStringArg(DPL::BinaryQueue &buffer);
-}
-} // Wrt
-
-#endif
\ No newline at end of file
diff --git a/src_mobile/wrt-popup/wrt/popup-bin/CMakeLists.txt b/src_mobile/wrt-popup/wrt/popup-bin/CMakeLists.txt
deleted file mode 100644 (file)
index 52f73ff..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-# 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.
-#
-
-PKG_CHECK_MODULES(WRT_POPUP_DEPS
-    ecore-x
-    dpl-efl
-    dpl-event-efl
-    REQUIRED
-)
-
-INCLUDE_DIRECTORIES(
-    ${CMAKE_CURRENT_SOURCE_DIR}
-    ${CMAKE_CURRENT_SOURCE_DIR}/renderer
-    ${WRT_POPUP_DEPS_INCLUDE_DIRS}
-    ${WRT_POPUP_COMMON_DIR}
-)
-
-SET(WRT_POPUP_SRCS
-    ${WRT_POPUP_COMMON_SRCS}
-    wrt-popup.cpp
-    YesNoPopup.cpp
-    YesNoCheckPopup.cpp
-    InfoPopup.cpp
-    renderer/evas_object.cpp
-    renderer/popup_controller.cpp
-    renderer/popup_manager.cpp
-    renderer/popup_renderer.cpp
-)
-
-ADD_EXECUTABLE(${TARGET_POPUP_WRT}
-    ${WRT_POPUP_SRCS}
-)
-
-TARGET_LINK_LIBRARIES(${TARGET_POPUP_WRT}
-    ${WRT_POPUP_DEPS_LIBRARIES}
-)
-
-SET_TARGET_PROPERTIES(${TARGET_POPUP_WRT} PROPERTIES
-    LINK_FLAGS "-Wl,--as-needed -Wl,--hash-style=both"
-    BUILD_WITH_INSTALL_RPATH ON
-    INSTALL_RPATH_USE_LINK_PATH ON
-)
-
-INSTALL(TARGETS ${TARGET_POPUP_WRT} DESTINATION bin)
diff --git a/src_mobile/wrt-popup/wrt/popup-bin/InfoPopup.cpp b/src_mobile/wrt-popup/wrt/popup-bin/InfoPopup.cpp
deleted file mode 100644 (file)
index 4536350..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * 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        InfoPopup.cpp
- * @author      Lukasz Marek(l.marek@samsung.com)
- * @version     1.0
- * @brief       Popup that displays information. Inplementation
- */
-
-#include "InfoPopup.h"
-#include <memory>
-#include <string.h>
-#include "popup_manager.h"
-#include "popup.h"
-#include "PopupSerializer.h"
-
-namespace Wrt {
-namespace Popup {
-InfoPopup::InfoPopup() :
-        m_parent(NULL)
-{}
-
-void InfoPopup::show(DPL::BinaryQueueAutoPtr data, WrtPopup* parent)
-{
-    LogDebug("Entered");
-    std::string title = PopupSerializer::getStringArg(*data);
-    std::string message = PopupSerializer::getStringArg(*data);
-    std::string button = PopupSerializer::getStringArg(*data);
-    Assert(data->Empty());
-    LogDebug("title: " << title << " message: " << message);
-
-    m_parent = parent;
-
-    Renderer::CtrlPopupPtr popup =
-        Renderer::PopupControllerSingleton::Instance().CreatePopup();
-
-    popup->SetTitle(title);
-    popup->Append(new Renderer::PopupObject::Label(message));
-
-    popup->Append(new Renderer::PopupObject::Button(button, 0));
-
-    ListenForAnswer(popup);
-
-    Renderer::ShowPopupEventShort event(popup,
-                                        MakeAnswerCallback(
-                                            this,
-                                            &InfoPopup::responseCallback));
-
-    CONTROLLER_POST_EVENT(Renderer::PopupController,
-                          event);
-
-    LogDebug("Exited");
-    return;
-}
-
-void InfoPopup::responseCallback(const Renderer::AnswerCallbackData &answer)
-{
-    DPL::BinaryQueue retValue;
-    PopupSerializer::appendArg(true, retValue);
-    PopupSerializer::appendArg(answer.buttonAnswer, retValue);
-    m_parent->response(retValue);
-}
-} // Popup
-} // Wrt
diff --git a/src_mobile/wrt-popup/wrt/popup-bin/InfoPopup.h b/src_mobile/wrt-popup/wrt/popup-bin/InfoPopup.h
deleted file mode 100644 (file)
index 3a29fc0..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * 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        InfoPopup.h
- * @author      Andrzej Surdej (a.surdej@samsung.com)
- * @version     1.0
- * @brief       Popup that contains 'Yes' and 'No' buttons
- */
-
-#ifndef WRT_INFO_POPUP_H
-#define WRT_INFO_POPUP_H
-
-#include "wrt-popup.h"
-
-namespace Wrt {
-namespace Popup {
-class InfoPopup : public IPopup
-{
-  public:
-    InfoPopup();
-    virtual void show(DPL::BinaryQueueAutoPtr data, WrtPopup* parent);
-
-  private:
-
-    void responseCallback(const Renderer::AnswerCallbackData &answer);
-    WrtPopup* m_parent;
-};
-} // Popup
-} // Wrt
-
-#endif /* WRT_INFO_POPUP_H */
-
diff --git a/src_mobile/wrt-popup/wrt/popup-bin/YesNoCheckPopup.h b/src_mobile/wrt-popup/wrt/popup-bin/YesNoCheckPopup.h
deleted file mode 100644 (file)
index 9012df5..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * 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        YesNoCheckPopup.cpp
- * @author      Przmeyslaw Ciezkowsko (p.ciezkowski@samsung.com)
- * @version     1.0
- * @brief       Popup that contains 'Yes' and 'No' buttons and checkbox.
- * Inplementation
- */
-
-#include "YesNoPopup.h"
-#include "wrt-popup.h"
-
-#ifndef WRT_YES_NO_CHECK_POPUP_H
-#define WRT_YES_NO_CHECK_POPUP_H
-
-namespace Wrt {
-namespace Popup {
-class YesNoCheckPopup : public YesNoPopup
-{
-  public:
-    virtual ~YesNoCheckPopup();
-
-  protected:
-    virtual Renderer::CtrlPopupPtr createPopup(DPL::BinaryQueueAutoPtr data);
-    virtual void responseCallback(const Renderer::AnswerCallbackData &answer);
-};
-} // Popup
-} // Wrt
-
-#endif /* WRT_YES_NO_CHECK_POPUP_H */
-
diff --git a/src_mobile/wrt-popup/wrt/popup-bin/YesNoPopup.cpp b/src_mobile/wrt-popup/wrt/popup-bin/YesNoPopup.cpp
deleted file mode 100644 (file)
index a47d205..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * 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        YesNoPopup.cpp
- * @author      Andrzej Surdej (a.surdej@samsung.com)
- * @version     1.0
- * @brief       Popup that contains 'Yes' and 'No' buttons. Inplementation
- */
-
-#include "YesNoPopup.h"
-#include <memory>
-#include <string.h>
-#include "popup_manager.h"
-#include "PopupSerializer.h"
-
-namespace Wrt {
-namespace Popup {
-void YesNoPopup::show(DPL::BinaryQueueAutoPtr data, WrtPopup* parent)
-{
-    LogDebug("Entered");
-    m_parent = parent;
-    Renderer::CtrlPopupPtr popup = createPopup(data);
-    ListenForAnswer(popup);
-
-    Renderer::ShowPopupEventShort event(popup,
-                                        MakeAnswerCallback(
-                                            this,
-                                            &YesNoPopup::responseCallback));
-
-    CONTROLLER_POST_EVENT(Renderer::PopupController,
-                          event);
-
-    LogDebug("Exited");
-    return;
-}
-
-void YesNoPopup::responseCallback(const Renderer::AnswerCallbackData &answer)
-{
-    bool result = (POPUP_YES_VALUE == answer.buttonAnswer);
-    DPL::BinaryQueue retValue;
-    PopupSerializer::appendArg(true, retValue);
-    PopupSerializer::appendArg(result, retValue);
-    m_parent->response(retValue);
-}
-
-YesNoPopup::~YesNoPopup()
-{}
-
-Renderer::CtrlPopupPtr YesNoPopup::createPopup(DPL::BinaryQueueAutoPtr data)
-{
-    std::string title = PopupSerializer::getStringArg(*data);
-    std::string message = PopupSerializer::getStringArg(*data);
-    Assert(data->Empty());
-    LogDebug("title: " << title << " message: " << message);
-    Renderer::CtrlPopupPtr popup =
-        Renderer::PopupControllerSingleton::Instance().CreatePopup();
-
-    popup->SetTitle(title);
-    popup->Append(new Renderer::PopupObject::Label(message));
-
-    popup->Append(new Renderer::PopupObject::Button(YES_LABEL, POPUP_YES_VALUE));
-    popup->Append(new Renderer::PopupObject::Button(NO_LABEL, POPUP_NO_VALUE));
-    return popup;
-}
-} // Popup
-} // Wrt
diff --git a/src_mobile/wrt-popup/wrt/popup-bin/YesNoPopup.h b/src_mobile/wrt-popup/wrt/popup-bin/YesNoPopup.h
deleted file mode 100644 (file)
index 5dbe2f8..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * 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        YesNoPopup.h
- * @author      Andrzej Surdej (a.surdej@samsung.com)
- * @version     1.0
- * @brief       Popup that contains 'Yes' and 'No' buttons
- */
-
-#ifndef WRT_YES_NO_POPUP_H
-#define WRT_YES_NO_POPUP_H
-
-#include "wrt-popup.h"
-
-namespace Wrt {
-namespace Popup {
-const char YES_LABEL[] = "Yes";
-const char NO_LABEL[] = "No";
-const int POPUP_YES_VALUE = 1;
-const int POPUP_NO_VALUE = 2;
-
-class YesNoPopup : public IPopup
-{
-  public:
-    virtual void show(DPL::BinaryQueueAutoPtr data, WrtPopup* parent);
-    virtual ~YesNoPopup();
-
-  protected:
-    virtual Renderer::CtrlPopupPtr createPopup(DPL::BinaryQueueAutoPtr data);
-    virtual void responseCallback(const Renderer::AnswerCallbackData &answer);
-    WrtPopup* m_parent;
-};
-} // Popup
-} // Wrt
-
-#endif /* WRT_YES_NO_POPUP_H */
-
diff --git a/src_mobile/wrt-popup/wrt/popup-bin/renderer/evas_object.cpp b/src_mobile/wrt-popup/wrt/popup-bin/renderer/evas_object.cpp
deleted file mode 100644 (file)
index 13b38c1..0000000
+++ /dev/null
@@ -1,234 +0,0 @@
-/*
- * 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        evas_object.cpp
- * @author      Lukasz Wrzosek (l.wrzosel@samsung.com)
- * @version     1.0
- * @brief       This file is the implementation for Evas_Object wrapper from
- * Efl.
- */
-
-#include "evas_object.h"
-#include <stddef.h>
-#include <dpl/foreach.h>
-
-namespace Wrt {
-namespace Popup {
-namespace Renderer {
-Evas_Object* EvasObject::IConnection::GetEvasObject()
-{
-    return m_object->GetObject();
-}
-
-void EvasObject::IConnection::Disconnect()
-{
-    m_object->DisconnectCallback(this);
-}
-
-EvasObject::IConnection::IConnection(EvasObject::EvasObjectShared* object) :
-    m_object(object)
-{}
-
-void EvasObject::IConnection::SmartCallbackWrapper(void* data,
-                                                   Evas_Object* /*object*/,
-                                                   void* event_info)
-{
-    Assert(data);
-    IConnection* Calle = static_cast<IConnection*>(data);
-    Calle->Call(event_info);
-}
-
-void EvasObject::IConnection::EvasCallbackWrapper(void* data,
-                                                  Evas* /*evas*/,
-                                                  Evas_Object* /*object*/,
-                                                  void* event_info)
-{
-    Assert(data);
-    IConnection* Calle = static_cast<IConnection*>(data);
-    Calle->Call(event_info);
-}
-
-Evas_Object* EvasObject::EvasObjectShared::GetObject()
-{
-    return m_object;
-}
-
-EvasObject::EvasObjectShared::SmartConnectionBase::SmartConnectionBase(
-    const std::string& name,
-    EvasObject::EvasObjectShared* object) :
-    IConnection(object),
-    m_callbackName(name)
-{}
-
-void EvasObject::EvasObjectShared::SmartConnectionBase::ConnectPrv()
-{
-    evas_object_smart_callback_add(GetEvasObject(),
-                                   m_callbackName.c_str(),
-                                   &IConnection::SmartCallbackWrapper, this);
-}
-
-void EvasObject::EvasObjectShared::SmartConnectionBase::DisconnectPrv()
-{
-    evas_object_smart_callback_del(GetEvasObject(),
-                                   m_callbackName.c_str(),
-                                   &IConnection::SmartCallbackWrapper);
-}
-
-EvasObject::EvasObjectShared::EvasConnectionBase::EvasConnectionBase(
-    Evas_Callback_Type type,
-    EvasObject::EvasObjectShared* object) :
-    IConnection(object),
-    m_callbackType(type)
-{}
-
-void EvasObject::EvasObjectShared::EvasConnectionBase::ConnectPrv()
-{
-    evas_object_event_callback_add(
-        GetEvasObject(), m_callbackType, &IConnection::EvasCallbackWrapper,
-        this);
-}
-
-void EvasObject::EvasObjectShared::EvasConnectionBase::DisconnectPrv()
-{
-    evas_object_event_callback_del_full(
-        GetEvasObject(), m_callbackType, &IConnection::EvasCallbackWrapper,
-        this);
-}
-
-EvasObject::EvasObjectShared::EvasObjectShared() :
-    m_object(NULL)
-{}
-
-EvasObject::EvasObjectShared::EvasObjectShared(Evas_Object* object) :
-    m_object(object)
-{
-    Assert(m_object);
-    evas_object_event_callback_add(m_object,
-                                   EVAS_CALLBACK_DEL,
-                                   &StaticOnDelEvent,
-                                   this);
-}
-
-void EvasObject::EvasObjectShared::SetObject(Evas_Object* object)
-{
-    Assert(m_object == NULL);
-    Assert(object != NULL);
-    m_object = object;
-    evas_object_event_callback_add(m_object,
-                                   EVAS_CALLBACK_DEL,
-                                   &StaticOnDelEvent,
-                                   this);
-}
-
-EvasObject::EvasObjectShared::~EvasObjectShared()
-{
-    if (m_object) {
-        DisconnectAll();
-        evas_object_event_callback_del(m_object,
-                                       EVAS_CALLBACK_DEL,
-                                       &StaticOnDelEvent);
-        m_object = NULL;
-    }
-}
-
-bool EvasObject::EvasObjectShared::DisconnectCallback(IConnection* connection)
-{
-    IConnectionsSet::iterator it = m_connections.find(connection);
-    if (it != m_connections.end()) {
-        (*it)->DisconnectPrv();
-        delete connection;
-        m_connections.erase(it);
-        return true;
-    }
-    return false;
-}
-
-void EvasObject::EvasObjectShared::DisconnectAll()
-{
-    FOREACH(it, m_connections)
-    {
-        (*it)->DisconnectPrv();
-        delete *it;
-    }
-    m_connections.clear();
-}
-
-void EvasObject::EvasObjectShared::StaticOnDelEvent(void* data,
-                                                    Evas* /*e*/,
-                                                    Evas_Object* /*o*/,
-                                                    void* /*ev*/)
-{
-    Assert(data);
-    EvasObjectShared* This = static_cast<EvasObjectShared*>(data);
-    if (This->m_object) {
-        evas_object_event_callback_del(This->m_object,
-                                       EVAS_CALLBACK_DEL,
-                                       &StaticOnDelEvent);
-        This->DisconnectAll();
-        This->m_object = NULL;
-    }
-}
-
-EvasObject::EvasObject() :
-    m_object(new EvasObjectShared())
-{}
-
-EvasObject::EvasObject(Evas_Object* object) :
-    m_object(new EvasObjectShared(object))
-{}
-
-EvasObject::EvasObject(const EvasObject& other) :
-    m_object(other.m_object)
-{}
-
-//this destructor must be here to let pimpl with shared_ptr work without warning
-EvasObject::~EvasObject()
-{}
-
-EvasObject& EvasObject::operator=(const EvasObject& other)
-{
-    Assert(m_object);
-    m_object = other.m_object;
-    return *this;
-}
-
-EvasObject* EvasObject::operator=(Evas_Object* object)
-{
-    Assert(m_object);
-    m_object->SetObject(object);
-    return this;
-}
-
-bool EvasObject::DisconnectCallback(IConnection* connection)
-{
-    Assert(m_object);
-    return m_object->DisconnectCallback(connection);
-}
-
-void EvasObject::DisconnectAll()
-{
-    Assert(m_object);
-    m_object->DisconnectAll();
-}
-
-EvasObject::operator Evas_Object *()
-{
-    Assert(m_object);
-    return m_object->GetObject();
-}
-}
-} // namespace DPL
-} // namespace Popup
diff --git a/src_mobile/wrt-popup/wrt/popup-bin/renderer/evas_object.h b/src_mobile/wrt-popup/wrt/popup-bin/renderer/evas_object.h
deleted file mode 100644 (file)
index 2758fa1..0000000
+++ /dev/null
@@ -1,654 +0,0 @@
-/*
- * 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        evas_object.h
- * @author      Lukasz Wrzosek (l.wrzosel@samsung.com)
- * @version     1.0
- * @brief       This file is the header for Evas_Object wrapper from Efl.
- */
-
-#ifndef WRT_SRC_DOMAIN_EFL_EVAS_OBJECT_H
-#define WRT_SRC_DOMAIN_EFL_EVAS_OBJECT_H
-
-#include <Evas.h>
-#include <dpl/noncopyable.h>
-#include <dpl/framework_efl.h>
-#include <dpl/assert.h>
-#include <dpl/foreach.h>
-#include <dpl/apply.h>
-#include <set>
-#include <string>
-#include <tuple>
-#include <utility>
-#include <memory>
-
-namespace Wrt {
-namespace Popup {
-namespace Renderer {
-class EvasObject
-{
-    class EvasObjectShared;
-    typedef std::shared_ptr<EvasObjectShared> EvasObjectSharedPtr;
-
-  public:
-    class IConnection
-    {
-      public:
-        Evas_Object* GetEvasObject();
-        void Disconnect();
-
-      private:
-        IConnection(EvasObjectShared* object);
-        virtual ~IConnection()
-        {}
-        virtual void Call(void* /*event_info*/) = 0;
-
-        static void SmartCallbackWrapper(void* data,
-                                         Evas_Object* /*object*/,
-                                         void* event_info);
-        static void EvasCallbackWrapper(void* data,
-                                        Evas* /*evas*/,
-                                        Evas_Object* /*object*/,
-                                        void* event_info);
-
-        virtual void ConnectPrv() = 0;
-        virtual void DisconnectPrv() = 0;
-
-        friend class EvasObjectShared;
-
-        EvasObjectShared* m_object;
-    };
-
-  private:
-    class EvasObjectShared : DPL::Noncopyable
-    {
-      public:
-        friend class IConnection;
-        Evas_Object* GetObject();
-
-        typedef std::set<IConnection*> IConnectionsSet;
-
-        class SmartConnectionBase : public IConnection
-        {
-          public:
-            SmartConnectionBase(const std::string& name,
-                                EvasObjectShared* object);
-
-            virtual void ConnectPrv();
-            virtual void DisconnectPrv();
-            std::string m_callbackName;
-        };
-
-        template<typename ... Args>
-        class SmartConnection : public SmartConnectionBase
-        {
-          public:
-            typedef void (*CbType)(IConnection* connection,
-                                   void* event_info,
-                                   Args ... args);
-
-            SmartConnection(const std::string& name,
-                            CbType callback,
-                            EvasObjectShared* object,
-                            Args ... args) :
-                SmartConnectionBase(name, object),
-                m_callback(callback),
-                m_args(args ...)
-            {}
-
-            virtual ~SmartConnection()
-            {}
-
-            virtual void Call(void* event_info)
-            {
-                DPL::Apply<void,
-                           DPL::ExtraArgsInsertPolicy::Prepend>(m_callback,
-                                                                m_args,
-                                                                this,
-                                                                event_info);
-            }
-
-          private:
-            CbType m_callback;
-            std::tuple<Args ...> m_args;
-        };
-
-        template <class ThisType, class ArgType1>
-        class SmartMemberConnection1 : public SmartConnectionBase
-        {
-          public:
-            typedef void (ThisType::*CbType)(IConnection* connection,
-                                             void* event_info, ArgType1 *arg1);
-
-            SmartMemberConnection1(const std::string& name,
-                                   CbType callback,
-                                   ThisType* callee,
-                                   ArgType1* arg1,
-                                   EvasObjectShared* object) :
-                SmartConnectionBase(name, object),
-                m_callback(callback),
-                m_callee(callee),
-                m_arg1(arg1)
-            {}
-
-            virtual ~SmartMemberConnection1()
-            {}
-
-            virtual void Call(void* event_info)
-            {
-                (m_callee->*m_callback)(this, event_info, m_arg1);
-            }
-
-          private:
-            CbType m_callback;
-            ThisType* m_callee;
-            ArgType1* m_arg1;
-        };
-
-        template <class ThisType, class ArgType1, class ArgType2>
-        class SmartMemberConnection2 : public SmartConnectionBase
-        {
-          public:
-            typedef void (ThisType::*CbType)(IConnection* connection,
-                                             void* event_info, ArgType1 *arg1,
-                                             ArgType2* arg2);
-
-            SmartMemberConnection2(const std::string& name,
-                                   CbType callback,
-                                   ThisType* callee,
-                                   ArgType1* arg1,
-                                   ArgType2* arg2,
-                                   EvasObjectShared* object) :
-                SmartConnectionBase(name, object),
-                m_callback(callback),
-                m_callee(callee),
-                m_arg1(arg1),
-                m_arg2(arg2)
-            {}
-
-            virtual ~SmartMemberConnection2()
-            {}
-
-            virtual void Call(void* event_info)
-            {
-                (m_callee->*m_callback)(this, event_info, m_arg1, m_arg2);
-            }
-
-          private:
-            CbType m_callback;
-            ThisType* m_callee;
-            ArgType1* m_arg1;
-            ArgType2* m_arg2;
-        };
-
-        class EvasConnectionBase : public IConnection
-        {
-          public:
-            EvasConnectionBase(Evas_Callback_Type type,
-                               EvasObjectShared* object);
-
-            virtual void ConnectPrv();
-            virtual void DisconnectPrv();
-
-            Evas_Callback_Type m_callbackType;
-        };
-
-        template <class ArgType1>
-        class EvasConnection1 : public EvasConnectionBase
-        {
-          public:
-            typedef void (*CbType)(IConnection* connection, void* event_info,
-                                   ArgType1 *arg1);
-
-            EvasConnection1(Evas_Callback_Type type,
-                            CbType callback,
-                            ArgType1* arg1,
-                            EvasObjectShared* object) :
-                EvasConnectionBase(type, object),
-                m_callback(callback),
-                m_arg1(arg1)
-            {}
-
-            virtual ~EvasConnection1()
-            {}
-
-            virtual void Call(void* event_info)
-            {
-                m_callback(this, event_info, m_arg1);
-            }
-
-          private:
-            CbType m_callback;
-            ArgType1* m_arg1;
-        };
-
-        template <class ArgType1, class ArgType2>
-        class EvasConnection2 : public EvasConnectionBase
-        {
-          public:
-            typedef void (*CbType)(IConnection* connection, void* event_info,
-                                   ArgType1 *arg1, ArgType2 *arg2);
-
-            EvasConnection2(Evas_Callback_Type type,
-                            CbType callback,
-                            ArgType1* arg1,
-                            ArgType2* arg2,
-                            EvasObjectShared* object) :
-                EvasConnectionBase(type, object),
-                m_callback(callback),
-                m_arg1(arg1),
-                m_arg2(arg2)
-            {}
-
-            virtual ~EvasConnection2()
-            {}
-
-            virtual void Call(void* event_info)
-            {
-                m_callback(this, event_info, m_arg1, m_arg2);
-            }
-
-          private:
-            CbType m_callback;
-            ArgType1* m_arg1;
-            ArgType2* m_arg2;
-        };
-
-        template <class ThisType, class ArgType1>
-        class EvasMemberConnection1 : public EvasConnectionBase
-        {
-          public:
-            typedef void (ThisType::*CbType)(IConnection* connection,
-                                             void* event_info, ArgType1 *arg1);
-
-            EvasMemberConnection1(Evas_Callback_Type type,
-                                  CbType callback,
-                                  ThisType* callee,
-                                  ArgType1* arg1,
-                                  EvasObjectShared* object) :
-                EvasConnectionBase(type, object),
-                m_callback(callback),
-                m_callee(callee),
-                m_arg1(arg1)
-            {}
-
-            virtual ~EvasMemberConnection1()
-            {}
-
-            virtual void Call(void* event_info)
-            {
-                (m_callee->*m_callback)(this, event_info, m_arg1);
-            }
-
-          private:
-            CbType m_callback;
-            ThisType* m_callee;
-            ArgType1* m_arg1;
-        };
-
-        template <class ThisType, class ArgType1, class ArgType2>
-        class EvasMemberConnection2 : public EvasConnectionBase
-        {
-          public:
-            typedef void (ThisType::*CbType)(IConnection* connection,
-                                             void* event_info, ArgType1* arg1,
-                                             ArgType2* arg2);
-
-            EvasMemberConnection2(Evas_Callback_Type type,
-                                  CbType callback,
-                                  ThisType* callee,
-                                  ArgType1* arg1,
-                                  ArgType2* arg2,
-                                  EvasObjectShared* object) :
-                EvasConnectionBase(type, object),
-                m_callback(callback),
-                m_callee(callee),
-                m_arg1(arg1),
-                m_arg2(arg2)
-            {}
-
-            virtual ~EvasMemberConnection2()
-            {}
-
-            virtual void Call(void* event_info)
-            {
-                (m_callee->*m_callback)(this, event_info, m_arg1, m_arg2);
-            }
-
-          private:
-            CbType m_callback;
-            ThisType* m_callee;
-            ArgType1* m_arg1;
-            ArgType2* m_arg2;
-        };
-
-        EvasObjectShared();
-        explicit EvasObjectShared(Evas_Object* object);
-        void SetObject(Evas_Object* object);
-        ~EvasObjectShared();
-
-        template<typename ... Args>
-        IConnection* ConnectSmartCallback(
-            const char* callbackName,
-            typename SmartConnection<Args ...>::
-                CbType callback,
-            Args ... args)
-        {
-            Assert(m_object);
-            Assert(callbackName);
-            Assert(callback);
-            IConnection* connection = new SmartConnection<Args ...>(
-                    callbackName,
-                    callback,
-                    this,
-                    args ...);
-            m_connections.insert(connection);
-            connection->ConnectPrv();
-            return connection;
-        }
-
-        template <class ThisType, class ArgType1, class ArgType2>
-        IConnection* ConnectMemberSmartCallback(
-            const char* callbackName,
-            typename SmartMemberConnection2<ThisType, ArgType1,
-                                            ArgType2>::CbType callback,
-            ThisType* callee,
-            ArgType1* arg1,
-            ArgType2* arg2)
-        {
-            Assert(m_object);
-            Assert(callee);
-            Assert(callbackName);
-            Assert(callback);
-            IConnection* connection =
-                new SmartMemberConnection2<ThisType, ArgType1, ArgType2>(
-                    callbackName,
-                    callback,
-                    callee,
-                    arg1,
-                    arg2,
-                    this);
-            m_connections.insert(connection);
-            connection->ConnectPrv();
-            return connection;
-        }
-
-        template <class ThisType, class ArgType1>
-        IConnection* ConnectMemberSmartCallback(
-            const char* callbackName,
-            typename SmartMemberConnection1<ThisType,
-                                            ArgType1>::CbType callback,
-            ThisType* callee,
-            ArgType1* arg1)
-        {
-            Assert(m_object);
-            Assert(callee);
-            Assert(callbackName);
-            Assert(callback);
-            IConnection* connection =
-                new SmartMemberConnection1<ThisType, ArgType1>(callbackName,
-                                                               callback,
-                                                               callee,
-                                                               arg1,
-                                                               this);
-            m_connections.insert(connection);
-            connection->ConnectPrv();
-            return connection;
-        }
-
-        template <class ArgType1, class ArgType2>
-        IConnection* ConnectEvasCallback(Evas_Callback_Type callbackType,
-                                         typename EvasConnection2<ArgType1,
-                                                                  ArgType2>::
-                                             CbType callback,
-                                         ArgType1* arg1,
-                                         ArgType2* arg2)
-        {
-            Assert(m_object);
-            Assert(callbackType);
-            Assert(callback);
-            IConnection* connection = new EvasConnection2<ArgType1, ArgType2>(
-                    callbackType,
-                    callback,
-                    arg1,
-                    arg2,
-                    this);
-            m_connections.insert(connection);
-            connection->ConnectPrv();
-            return connection;
-        }
-
-        template <class ArgType1>
-        IConnection* ConnectEvasCallback(
-            Evas_Callback_Type callbackType,
-            typename EvasConnection1<ArgType1>::
-                CbType callback,
-            ArgType1* arg1)
-        {
-            Assert(m_object);
-            Assert(callbackType);
-            Assert(callback);
-            IConnection* connection = new EvasConnection1<ArgType1>(
-                    callbackType,
-                    callback,
-                    arg1,
-                    this);
-            m_connections.insert(connection);
-            connection->ConnectPrv();
-            return connection;
-        }
-
-        template <class ThisType, class ArgType1, class ArgType2>
-        IConnection* ConnectMemberEvasCallback(
-            Evas_Callback_Type callbackType,
-            typename EvasMemberConnection2<ThisType, ArgType1,
-                                           ArgType2>::CbType callback,
-            ThisType* callee,
-            ArgType1* arg1,
-            ArgType2* arg2)
-        {
-            Assert(m_object);
-            Assert(callee);
-            Assert(callbackType);
-            Assert(callback);
-            IConnection* connection =
-                new EvasMemberConnection2<ThisType, ArgType1, ArgType2>(
-                    callbackType,
-                    callback,
-                    callee,
-                    arg1,
-                    arg2,
-                    this);
-            m_connections.insert(connection);
-            connection->ConnectPrv();
-            return connection;
-        }
-
-        template <class ThisType, class ArgType1>
-        IConnection* ConnectMemberEvasCallback(
-            Evas_Callback_Type callbackType,
-            typename EvasMemberConnection1<ThisType,
-                                           ArgType1>::CbType callback,
-            ThisType* callee,
-            ArgType1* arg1)
-        {
-            Assert(m_object);
-            Assert(callee);
-            Assert(callbackType);
-            Assert(callback);
-            IConnection* connection =
-                new EvasMemberConnection1<ThisType, ArgType1>(callbackType,
-                                                              callback,
-                                                              callee,
-                                                              arg1,
-                                                              this);
-            m_connections.insert(connection);
-            connection->ConnectPrv();
-            return connection;
-        }
-
-        bool DisconnectCallback(IConnection* connection);
-        void DisconnectAll();
-
-        static void StaticOnDelEvent(void* data,
-                                     Evas* /*e*/,
-                                     Evas_Object* /*o*/,
-                                     void* /*ev*/);
-
-        IConnectionsSet m_connections;
-        Evas_Object* m_object;
-    };
-
-  public:
-    EvasObject();
-    explicit EvasObject(Evas_Object* object);
-    EvasObject(const EvasObject& other);
-    ~EvasObject();
-
-    EvasObject& operator=(const EvasObject& other);
-    EvasObject* operator=(Evas_Object* object);
-
-    operator Evas_Object *();
-
-    bool IsValid() const
-    {
-        Assert(m_object);
-        return m_object->GetObject() != NULL;
-    }
-
-    bool DisconnectCallback(IConnection* connection);
-    void DisconnectAll();
-
-    template <class ... Args>
-    IConnection* ConnectSmartCallback(
-        const char* callbackName,
-        typename EvasObjectShared::SmartConnection<Args ...>::CbType
-        callback,
-        Args ... args)
-    {
-        Assert(m_object);
-        return m_object->ConnectSmartCallback(callbackName, callback, args ...);
-    }
-
-    template <class ThisType, class ArgType1, class ArgType2>
-    IConnection* ConnectMemberSmartCallback(
-        const char* callbackName,
-        typename EvasObjectShared::SmartMemberConnection2<ThisType,
-                                                          ArgType1,
-                                                          ArgType2>::CbType
-        callback,
-        ThisType* callee,
-        ArgType1* arg1,
-        ArgType2* arg2)
-    {
-        Assert(m_object);
-        Assert(callee);
-        Assert(callback);
-        return m_object->ConnectMemberSmartCallback(callbackName,
-                                                    callback,
-                                                    callee,
-                                                    arg1,
-                                                    arg2);
-    }
-
-    template <class ThisType, class ArgType1>
-    IConnection* ConnectMemberSmartCallback(
-        const char* callbackName,
-        typename EvasObjectShared::SmartMemberConnection1<ThisType,
-                                                          ArgType1>::CbType
-        callback,
-        ThisType* callee,
-        ArgType1* arg1)
-    {
-        Assert(m_object);
-        Assert(callee);
-        Assert(callback);
-        return m_object->ConnectMemberSmartCallback(callbackName,
-                                                    callback,
-                                                    callee,
-                                                    arg1);
-    }
-
-    template <class ArgType1, class ArgType2>
-    IConnection* ConnectEvasCallback(
-        Evas_Callback_Type callbackType,
-        typename EvasObjectShared::EvasConnection1<ArgType1>::CbType
-        callback,
-        ArgType1* arg1,
-        ArgType2* arg2)
-    {
-        Assert(m_object);
-        return m_object->ConnectEvasCallback(callbackType, callback, arg1, arg2);
-    }
-
-    template <class ArgType1>
-    IConnection* ConnectEvasCallback(
-        Evas_Callback_Type callbackType,
-        typename EvasObjectShared::EvasConnection1<ArgType1>::CbType
-        callback,
-        ArgType1* arg1)
-    {
-        Assert(m_object);
-        return m_object->ConnectEvasCallback(callbackType, callback, arg1);
-    }
-
-    template <class ThisType, class ArgType1>
-    IConnection* ConnectMemberEvasCallback(
-        Evas_Callback_Type callbackType,
-        typename EvasObjectShared::EvasMemberConnection1<ThisType,
-                                                         ArgType1>::CbType
-        callback,
-        ThisType* callee,
-        ArgType1* arg1)
-    {
-        Assert(m_object);
-        Assert(callee);
-        Assert(callback);
-        return m_object->ConnectMemberEvasCallback(callbackType,
-                                                   callback,
-                                                   callee,
-                                                   arg1);
-    }
-
-    template <class ThisType, class ArgType1, class ArgType2>
-    IConnection* ConnectMemberEvasCallback(
-        Evas_Callback_Type callbackType,
-        typename EvasObjectShared::EvasMemberConnection2<ThisType, ArgType1,
-                                                         ArgType2>::CbType
-        callback,
-        ThisType* callee,
-        ArgType1* arg1,
-        ArgType2* arg2)
-    {
-        Assert(m_object);
-        Assert(callee);
-        Assert(callback);
-        return m_object->ConnectMemberEvasCallback(callbackType,
-                                                   callback,
-                                                   callee,
-                                                   arg1,
-                                                   arg2);
-    }
-
-  private:
-    EvasObjectSharedPtr m_object;
-};
-}
-} //namespace
-} //namespace
-
-#endif //WRT_SRC_DOMAIN_EFL_EVAS_OBJECT_H
-
diff --git a/src_mobile/wrt-popup/wrt/popup-bin/renderer/popup.h b/src_mobile/wrt-popup/wrt/popup-bin/renderer/popup.h
deleted file mode 100644 (file)
index 149b7eb..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * 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        popup.h
- * @author      Lukasz Wrzosek (l.wrzosek@samsung.com)
- * @version     1.0
- * @brief       This is popup inteface declaration
- */
-
-#ifndef WRT_SRC_POPUP_POPUP_H_
-#define WRT_SRC_POPUP_POPUP_H_
-
-#include <memory>
-#include <dpl/assert.h>
-#include <dpl/log/log.h>
-#include <string>
-#include <dpl/optional.h>
-#include "popup_object.h"
-
-namespace Wrt {
-namespace Popup {
-namespace Renderer {
-struct AnswerCallbackData
-{
-    int buttonAnswer;
-    DPL::Optional<std::string> password;
-    bool chackState;
-};
-
-class PopupManager;
-class IPopup;
-typedef std::shared_ptr<IPopup> IPopupPtr;
-
-class IPopup : public std::enable_shared_from_this<IPopup>
-{
-  public:
-    virtual void SetTitle(const std::string &title) = 0;
-    /*The object is deleted automatically after rendered */
-    virtual void Append(PopupObject::IPopupObject *object) = 0;
-
-  protected:
-    typedef void (*PopupCallbackType)(const AnswerCallbackData& answer,
-                                      void *data);
-    virtual void Show(PopupCallbackType callback,
-                      void* data) = 0;
-    virtual ~IPopup()
-    {}
-
-  private:
-    friend class PopupManager;
-    friend class std::shared_ptr<IPopup>;
-};
-}
-} // namespace Popup
-} // namespace Wrt
-
-#endif //WRT_SRC_POPUP_POPUP_H_
diff --git a/src_mobile/wrt-popup/wrt/popup-bin/renderer/popup_controller.cpp b/src_mobile/wrt-popup/wrt/popup-bin/renderer/popup_controller.cpp
deleted file mode 100644 (file)
index b9bb5b3..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * 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    popup_controller.cpp
- * @author  Lukasz Wrzosek (l.wrzosek@samsung.com)
- * @version 1.0
- * @bref    Implementation file for popup controller
- */
-
-#include "popup_controller.h"
-#include <stddef.h>
-#include <dpl/assert.h>
-#include <dpl/log/log.h>
-#include <dpl/singleton_impl.h>
-
-IMPLEMENT_SINGLETON(Wrt::Popup::Renderer::PopupController)
-
-namespace Wrt {
-namespace Popup {
-namespace Renderer {
-void CtrlPopup::SetTitle(const std::string &title)
-{
-    Assert(m_popup);
-    m_popup->SetTitle(title);
-}
-
-void CtrlPopup::Append(PopupObject::IPopupObject *object)
-{
-    Assert(m_popup);
-    m_popup->Append(object);
-}
-
-CtrlPopup::CtrlPopup(IPopupPtr popup) :
-    m_popup(popup),
-    m_callback()
-{
-    Assert(m_popup);
-}
-
-CtrlPopup::~CtrlPopup()
-{}
-
-void CtrlPopup::EmitAnswer(const AnswerCallbackData & answer)
-{
-    AnswerCallbackData l_answer = answer;
-    PopupAnswerEvent event(shared_from_this(), m_callback, l_answer);
-    DPL::Event::EventSupport<PopupAnswerEvent>::EmitEvent(event);
-}
-
-PopupController::PopupController() : m_canvas(NULL)
-{}
-
-CtrlPopupPtr PopupController::CreatePopup() const
-{
-    return CtrlPopupPtr(
-               new CtrlPopup(PopupManagerSingleton::Instance().CreatePopup()));
-}
-
-void PopupController::OnEventReceived(const ShowPopupEventShort& event)
-{
-    CtrlPopupPtr popup = event.GetArg0();
-    popup->m_callback = event.GetArg1();
-
-    //pass canvas from controller to manager
-    //canvas is not passed earlier because value wasn't set properly
-    PopupManagerSingleton::Instance().setExternalCanvas(getExternalCanvas());
-
-    PopupManagerSingleton::Instance().RunAsyncWithArgType(
-        popup->m_popup,
-        &PopupController::StaticOnAnswerReceived,
-        new CtrlPopupPtr(popup));
-}
-
-void PopupController::StaticOnAnswerReceived(const AnswerCallbackData & answer,
-                                             CtrlPopupPtr* popup)
-{
-    Assert(popup != NULL);
-    (*popup)->EmitAnswer(answer);
-    delete popup; // Just SharedPtr is destroyed, not the popup itself
-}
-
-void PopupControllerUser::OnEventReceived(const PopupAnswerEvent& event)
-{
-    //Here we are in a proper context to call the callback
-    PopupAnswerCallback answerCall = event.GetArg1();
-    AnswerCallbackData answer = event.GetArg2();
-    answerCall.Call(answer);
-    event.GetArg0()->DPL::Event::EventSupport<PopupAnswerEvent>::RemoveListener(
-        this);
-}
-
-void PopupControllerUser::ListenForAnswer(CtrlPopupPtr popup)
-{
-    popup->DPL::Event::EventSupport<PopupAnswerEvent>::AddListener(this);
-}
-}
-} //namespace Popup
-} //namespace Wrt
diff --git a/src_mobile/wrt-popup/wrt/popup-bin/renderer/popup_controller.h b/src_mobile/wrt-popup/wrt/popup-bin/renderer/popup_controller.h
deleted file mode 100644 (file)
index 066fd2d..0000000
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- * 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    popup_controller.h
- * @author  Lukasz Wrzosek (l.wrzosek@samsung.com)
- * @version 1.0
- * @bref    Header file for popup controller
- */
-
-/**
- * To display a popup from a given class:
- *
- * class ABC
- * {
- *    void AskUser()
- *    {
- *    }
- *
- *    void DoSomeLogicWithAnswer()
- *    {
- *    }
- * };
- *
- * ... update the class to something simmilar:
- *
- * class ABC : Popup::PopupControllerUser
- * {
- *    void AskUser() {
- *        using namespace Popup;
- *        CtrlPopupPtr popup =
- *                PopupControllerSingletion::Instance().CreatePopup();
- *        popup->SetTitle("Title");
- *        popup->SetContent("Content");
- *        popup->AddButton("name1", 1);
- *        popup->AddButton("name2", 2);
- *        ListenForAnswer(popup);
- *        ShowPopupEvent event(popup,
- *                             MakeAnswerCallback(this,
- *                                                &ABC::DoSomeLogicWithAnswer));
- *        CONTROLLER_POST_EVENT(PopupController, event);
- *    }
- *
- *    void DoSomeLogicWithAnswer(Popup::LabelId answer) {
- *        if (answer == 1)
- *            ;//name1 pressed
- *        else if (answer == 2)
- *            ;//name2 pressed
- *    }
- * };
- **/
-
-#ifndef WRT_SRC_POPUP_CONTROLLER_POPUP_CONTROLLER_H_
-#define WRT_SRC_POPUP_CONTROLLER_POPUP_CONTROLLER_H_
-
-#include <memory>
-#include <dpl/singleton.h>
-#include <dpl/event/controller.h>
-#include <dpl/event/event_listener.h>
-#include <dpl/generic_event.h>
-#include <dpl/mutex.h>
-#include <dpl/exception.h>
-#include <dpl/noncopyable.h>
-#include <dpl/log/log.h>
-#include "popup_manager.h"
-
-namespace Wrt {
-namespace Popup {
-namespace Renderer {
-typedef int LabelId;
-
-struct PopupAnswerCallback
-{
-    typedef void (PopupAnswerCallback::*MemberPtr)();
-
-    void* callee;
-    MemberPtr member;
-    void (*callTranslator)(PopupAnswerCallback* callData,
-                           const AnswerCallbackData& answer);
-
-    void Call(const AnswerCallbackData& answer)
-    {
-        callTranslator(this, answer);
-    }
-};
-
-class PopupController;
-class CtrlPopup;
-
-typedef std::shared_ptr<CtrlPopup> CtrlPopupPtr;
-
-DECLARE_GENERIC_EVENT_3(PopupAnswerEvent,
-                        CtrlPopupPtr,
-                        PopupAnswerCallback,
-                        AnswerCallbackData)
-
-DECLARE_GENERIC_EVENT_2(ShowPopupEventShort,
-                        CtrlPopupPtr,
-                        PopupAnswerCallback)
-
-class CtrlPopup : public DPL::Event::EventSupport<PopupAnswerEvent>,
-    public std::enable_shared_from_this<CtrlPopup>
-{
-  public:
-    void SetTitle(const std::string &title);
-    void Append(PopupObject::IPopupObject *object);
-
-    ~CtrlPopup();
-
-  private:
-    friend class PopupController;
-    friend class std::shared_ptr<CtrlPopup>;
-
-    explicit CtrlPopup(IPopupPtr popup);
-    void EmitAnswer(const AnswerCallbackData& answer);
-
-    IPopupPtr m_popup;
-    PopupAnswerCallback m_callback;
-};
-
-class PopupController :
-    public DPL::Event::Controller<DPL::TypeListDecl<ShowPopupEventShort>::Type>
-{
-  public:
-    CtrlPopupPtr CreatePopup() const;
-
-    void setExternalCanvas(void* canvas)
-    {
-        m_canvas = canvas;
-    }
-    void* getExternalCanvas() const
-    {
-        return m_canvas;
-    }
-    void* m_canvas;
-
-  protected:
-    virtual void OnEventReceived(const ShowPopupEventShort& event);
-    PopupController();
-
-  private:
-    static void StaticOnAnswerReceived(const AnswerCallbackData& answer,
-                                       CtrlPopupPtr* popup);
-};
-
-class PopupControllerUser : DPL::Event::EventListener<PopupAnswerEvent>
-{
-    template <class Type>
-    struct PopupAnswerCallbackCreator
-    {
-        typedef void (Type::*MemberPtr)(const AnswerCallbackData& answer);
-        union Caster
-        {
-            MemberPtr specific;
-            PopupAnswerCallback::MemberPtr generic;
-        };
-
-        static PopupAnswerCallback Create(Type* callee,
-                                          MemberPtr callback)
-        {
-            PopupAnswerCallback callData;
-
-            callData.callee = callee;
-
-            Caster caster;
-            caster.specific = callback;
-            callData.member = caster.generic;
-
-            callData.callTranslator =
-                &PopupAnswerCallbackCreator::MemberCallbackTranslator;
-
-            return callData;
-        }
-
-        static void MemberCallbackTranslator(PopupAnswerCallback* callData,
-                                             const AnswerCallbackData& answer)
-        {
-            Type* typedThis = static_cast<Type*>(callData->callee);
-            Caster caster;
-            caster.generic = callData->member;
-            MemberPtr typedCallback = caster.specific;
-            (typedThis->*typedCallback)(answer);
-        }
-    };
-
-  protected:
-    virtual void OnEventReceived(const PopupAnswerEvent& event);
-    void ListenForAnswer(CtrlPopupPtr popup);
-
-    template <class Type>
-    PopupAnswerCallback MakeAnswerCallback(Type* This,
-                                           void (Type::*callback)
-                                           (const AnswerCallbackData &))
-    {
-        return PopupAnswerCallbackCreator<Type>::Create(This, callback);
-    }
-};
-
-typedef DPL::Singleton<PopupController> PopupControllerSingleton;
-}
-} //namespace Popup
-} //namespace Wrt
-
-#endif //WRT_SRC_POPUP_CONTROLLER_POPUP_CONTROLLER_H_
diff --git a/src_mobile/wrt-popup/wrt/popup-bin/renderer/popup_manager.cpp b/src_mobile/wrt-popup/wrt/popup-bin/renderer/popup_manager.cpp
deleted file mode 100644 (file)
index 040f445..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * 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        popup_manager.cpp
- * @author      Lukasz Wrzosek (l.wrzosek@samsung.com)
- * @version     1.0
- * @brief       This is popup_manager implementation file
- */
-
-#include "popup_manager.h"
-#include <stddef.h>
-#include <dpl/log/log.h>
-#include <dpl/assert.h>
-#include <dpl/singleton_impl.h>
-#include "popup.h"
-
-IMPLEMENT_SINGLETON(Wrt::Popup::Renderer::PopupManager)
-
-namespace Wrt {
-namespace Popup {
-namespace Renderer {
-void PopupManager::Initialize(PopupRendererPtr renderer)
-{
-    Assert(!m_initialized);
-    m_popupRenderer = renderer;
-    m_popupRenderer->Initialize();
-    m_initialized = true;
-}
-
-void PopupManager::Deinitialize()
-{
-    m_popupRenderer->Deinitialize();
-    Assert(m_initialized);
-    m_popupRenderer.reset();
-    m_initialized = false;
-}
-
-IPopupPtr PopupManager::CreatePopup()
-{
-    Assert(m_initialized);
-    return m_popupRenderer->CreatePopup();
-}
-}
-} // namespace Popup
-} // namespace Wrt
diff --git a/src_mobile/wrt-popup/wrt/popup-bin/renderer/popup_manager.h b/src_mobile/wrt-popup/wrt/popup-bin/renderer/popup_manager.h
deleted file mode 100644 (file)
index 125ac22..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * 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        popup_manager.h
- * @author      Lukasz Wrzosek (l.wrzosek@samsung.com)
- * @version     1.0
- * @brief       This is popup_manager declaration file
- */
-
-#ifndef WRT_SRC_POPUP_POPUP_MANAGER_H_
-#define WRT_SRC_POPUP_POPUP_MANAGER_H_
-
-#include <memory>
-#include <dpl/assert.h>
-#include <dpl/noncopyable.h>
-#include <dpl/singleton.h>
-#include <dpl/optional.h>
-#include <dpl/log/log.h>
-#include "popup.h"
-#include "popup_renderer.h"
-
-namespace Wrt {
-namespace Popup {
-namespace Renderer {
-class PopupManager : DPL::Noncopyable
-{
-    template <class ArgType>
-    struct TemplatedPopupCallback
-    {
-        typedef void (*Type)(const AnswerCallbackData& answer, ArgType* data);
-    };
-
-  public:
-    PopupManager() : m_initialized(false) {}
-    ~PopupManager()
-    {
-        if (m_initialized) {
-            LogError("Destroyed without Deinitialize");
-        }
-    }
-    void Initialize (PopupRendererPtr creator);
-    void Deinitialize();
-    void SetPopupRenderer (PopupRendererPtr creator);
-    IPopupPtr CreatePopup();
-
-    template <class ArgType>
-    void RunAsyncWithArgType(
-        IPopupPtr popup,
-        typename TemplatedPopupCallback<ArgType>::Type
-        callback,
-        ArgType* argument)
-    {
-        Assert(callback);
-        WrapCbAndArg<ArgType>* wrapped =
-            new WrapCbAndArg<ArgType>(callback, argument);
-        popup->Show(&CallbackArgTypeTranslator<ArgType>, wrapped);
-    }
-
-    void Show(IPopupPtr popup,
-              IPopup::PopupCallbackType callback,
-              void* userdata)
-    {
-        popup->Show(callback, userdata);
-    }
-
-    void setExternalCanvas(void* externalCanvas)
-    {
-        Assert(m_initialized && "Manger should be initialized");
-        m_popupRenderer->setExternalCanvas(externalCanvas);
-    }
-
-  private:
-    template <class ArgType>
-    struct WrapCbAndArg
-    {
-        WrapCbAndArg(typename TemplatedPopupCallback<ArgType>::Type cb,
-                     ArgType* arg) :
-            callback(cb),
-            argument(arg)
-        {}
-
-        typename TemplatedPopupCallback<ArgType>::Type callback;
-        ArgType* argument;
-    };
-
-    template <class ArgType>
-    static void CallbackArgTypeTranslator(const AnswerCallbackData & answer,
-                                          void* data)
-    {
-        WrapCbAndArg<ArgType>* wrapped =
-            static_cast< WrapCbAndArg<ArgType>* >(data);
-        wrapped->callback(answer, wrapped->argument);
-        delete wrapped;
-    }
-
-    bool m_initialized;
-    PopupRendererPtr m_popupRenderer;
-};
-
-typedef DPL::Singleton<PopupManager> PopupManagerSingleton;
-}
-} // namespace Popup
-} // namespace Wrt
-
-#endif //WRT_SRC_POPUP_POPUP_MANAGER_H_
diff --git a/src_mobile/wrt-popup/wrt/popup-bin/renderer/popup_object.h b/src_mobile/wrt-popup/wrt/popup-bin/renderer/popup_object.h
deleted file mode 100644 (file)
index 86f7484..0000000
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * 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        popup_object.h
- * @author      Justyna Mejzner (j.mejzner@samsung.com)
- * @version     1.0
- * @brief       This is declaration file of PopupObject
- */
-
-#ifndef WRT_SRC_POPUP_POPUPOBJECT_H_
-#define WRT_SRC_POPUP_POPUPOBJECT_H_
-
-#include <dpl/foreach.h>
-
-#include <list>
-#include <string>
-
-namespace Wrt {
-namespace Popup {
-namespace Renderer {
-namespace PopupObject {
-class IPopupObject;
-class PopupObjectBase;
-class Button;
-class Label;
-class Check;
-
-typedef std::list<IPopupObject*> PopupObjects;
-
-enum PopupType
-{
-    BUTTON,
-    LABEL,
-    CHECK
-};
-
-class IPopupObject
-{
-  public:
-    virtual Button* asButton() = 0;
-    virtual Label* asLabel() = 0;
-    virtual Check* asCheck() = 0;
-    virtual PopupType getType() const = 0;
-    virtual ~IPopupObject()
-    {}
-};
-
-class PopupObjectBase : public IPopupObject
-{
-  public:
-    virtual Button* asButton()
-    {
-        Assert("wrong type");
-        return NULL;
-    }
-    virtual Label* asLabel()
-    {
-        Assert("wrong type");
-        return NULL;
-    }
-    virtual Check* asCheck()
-    {
-        Assert("wrong type");
-        return NULL;
-    }
-
-    PopupType getType() const
-    {
-        return m_type;
-    }
-
-  protected:
-    PopupObjectBase(PopupType type) : m_type(type)
-    {}
-
-    PopupType m_type;
-};
-
-class Button : public PopupObjectBase
-{
-  public:
-    Button(const std::string& label,
-           int labelId) :
-        PopupObjectBase(BUTTON),
-        m_label(label),
-        m_labelId(labelId)
-    {}
-
-    Button* asButton()
-    {
-        return this;
-    }
-
-    const std::string& getLabel() const
-    {
-        return m_label;
-    }
-
-    int getLabelId() const
-    {
-        return m_labelId;
-    }
-
-  private:
-    std::string m_label;
-    int m_labelId;
-};
-
-class Label : public PopupObjectBase
-{
-  public:
-    Label(const std::string &label) :
-        PopupObjectBase(LABEL),
-        m_label(label)
-    {}
-
-    Label* asLabel()
-    {
-        return this;
-    }
-
-    const std::string& getLabel() const
-    {
-        return m_label;
-    }
-
-  private:
-    std::string m_label;
-};
-
-class Check : public PopupObjectBase
-{
-  public:
-    Check(const std::string &label) :
-        PopupObjectBase(CHECK),
-        m_checkLabel(label)
-    {}
-
-    Check* asCheck()
-    {
-        return this;
-    }
-
-    const std::string& getCheckLabel() const
-    {
-        return m_checkLabel;
-    }
-
-  private:
-    std::string m_checkLabel;
-};
-} /*PopupObject*/
-}
-} //namespace Popup
-} //namespace Wrt
-
-#endif //WRT_SRC_POPUP_POPUPOBJECT_H_
diff --git a/src_mobile/wrt-popup/wrt/popup-bin/renderer/popup_renderer.cpp b/src_mobile/wrt-popup/wrt/popup-bin/renderer/popup_renderer.cpp
deleted file mode 100644 (file)
index 0703bda..0000000
+++ /dev/null
@@ -1,421 +0,0 @@
-/*
- * 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        popup_renderer.cpp
- * @author      Lukasz Wrzosek (l.wrzosek@samsung.com)
- * @version     1.0
- * @brief       This is efl specific implementation for PopupRenderer
- */
-
-#include "popup_renderer.h"
-#include <stddef.h>
-#include <dpl/scoped_array.h>
-#include <dpl/assert.h>
-#include <dpl/log/log.h>
-#include <dpl/foreach.h>
-#include <dpl/framework_efl.h>
-#include <dpl/lexical_cast.h>
-#include <queue>
-#include "popup_manager.h"
-#include "popup_manager.h"
-#include "evas_object.h"
-
-namespace Wrt {
-namespace {
-using namespace Popup;
-const char* EDJ_NAME = "/usr/share/edje/ace/generic_popup.edj";
-const char* POPUP_LAYOUT1 = "popup_layout1";
-const char* POPUP_LAYOUT2 = "popup_layout2";
-const char* POPUP_PART_TITLE = "title,text";
-const char* POPUP_PART_BUTTON1 = "button1";
-const char* POPUP_PART_BUTTON2 = "button2";
-const char* POPUP_PART_BUTTON3 = "button3";
-const char* BUTTON_CLICKED_CALLBACK_NAME = "clicked";
-const char* CHANGED_CALLBACK_NAME = "changed";
-const unsigned int MAX_NUMBER_OF_VERTICAL = 2;
-
-Evas_Object* create_layout_main(Evas_Object* parent, int totalV)
-{
-    Evas_Object *layout = elm_layout_add(parent);
-
-    if (totalV == 1) {
-        elm_layout_file_set(layout, EDJ_NAME, POPUP_LAYOUT1);
-    } else if (totalV == 2) {
-        elm_layout_file_set(layout, EDJ_NAME, POPUP_LAYOUT2);
-    } else {
-        Assert("popup needs define new group in the edc");
-    }
-
-    evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND,
-                                     EVAS_HINT_EXPAND);
-    return layout;
-}
-} //namespace
-
-namespace Popup {
-namespace Renderer {
-class PopupRenderer::Impl
-{
-  public:
-    Impl() :
-        m_popupsToRender(),
-        m_current(),
-        m_initialized(false),
-        m_checkState(false),
-        m_themeIndexV(0),
-        m_externalCanvas(NULL)
-    {}
-
-    ~Impl()
-    {
-        if (m_initialized) {
-            LogError("Destroyed without Deinitialize");
-        }
-    }
-
-    void Initialize()
-    {
-        Assert(!m_initialized);
-        m_initialized = true;
-    }
-
-    void Deinitialize()
-    {
-        Assert(m_initialized);
-        m_current.reset();
-        while (!m_popupsToRender.empty()) {
-            m_popupsToRender.pop();
-        }
-        m_initialized = false;
-    }
-
-    void ButtonCallback(EvasObject::IConnection* /*connection*/,
-                        void* /*event_info*/,
-                        void* data)
-    {
-        LogDebug("ButtonCallback");
-        Assert(m_initialized);
-        AnswerCallbackData answerData;
-
-        answerData.buttonAnswer = reinterpret_cast<int>(data);
-        answerData.chackState = m_checkState;
-        answerData.password = m_password;
-        m_current->ForwardAnswer(answerData);
-        m_current.reset();
-
-        FOREACH(it, m_createdObjects)
-        {
-            if (it->IsValid()) {
-                evas_object_del(*it);
-            }
-        }
-        m_createdObjects.clear();
-        m_checkState = false;
-        DoRender();
-    }
-
-    void CheckCallback(EvasObject::IConnection* connection,
-                       void* /*event_info*/,
-                       void* /* unused */)
-    {
-        m_checkState =
-            elm_check_state_get(connection->GetEvasObject());
-    }
-
-    void Render (PopupPtr popup)
-    {
-        Assert(m_initialized);
-        m_popupsToRender.push(popup);
-        DoRender();
-    }
-
-    void DoRender(const PopupObject::Label& object,
-                  EvasObject& parent,
-                  EvasObject& layout,
-                  int themeIndex)
-    {
-        EvasObject label(elm_label_add(parent));
-
-        elm_object_style_set(label, "popup_description/default");
-        elm_label_line_wrap_set(label, ELM_WRAP_WORD);
-        elm_object_text_set(label, object.getLabel().c_str());
-        evas_object_size_hint_weight_set(label, EVAS_HINT_EXPAND, 0.0);
-        evas_object_size_hint_align_set(label, EVAS_HINT_FILL, EVAS_HINT_FILL);
-        evas_object_show(label);
-
-        elm_object_part_content_set(
-            layout,
-            DPL::lexical_cast<std::string>(themeIndex).c_str(),
-            label);
-        m_createdObjects.push_back(label);
-    }
-
-    void DoRender(const PopupObject::Check& object,
-                  EvasObject& parent,
-                  EvasObject& layout,
-                  int themeIndex)
-    {
-        EvasObject check(elm_check_add(parent));
-
-        evas_object_size_hint_align_set(check, EVAS_HINT_FILL, EVAS_HINT_FILL);
-        evas_object_size_hint_weight_set(check, EVAS_HINT_EXPAND, 0.0);
-        elm_object_text_set(check,
-                            object.getCheckLabel().c_str());
-        elm_object_part_content_set(
-            layout,
-            DPL::lexical_cast<std::string>(themeIndex).c_str(),
-            check);
-
-        check.ConnectMemberSmartCallback(CHANGED_CALLBACK_NAME,
-                                         &Impl::CheckCallback,
-                                         this,
-                                         static_cast<void*>(NULL));
-        evas_object_show(check);
-        m_createdObjects.push_back(check);
-    }
-
-    void DoRender(const PopupObject::Button& object,
-                  EvasObject &parent)
-    {
-        EvasObject btn(elm_button_add(parent));
-
-        elm_object_text_set(btn, object.getLabel().c_str());
-        elm_object_part_content_set(parent, POPUP_PART_BUTTON1, btn);
-        btn.ConnectMemberSmartCallback(BUTTON_CLICKED_CALLBACK_NAME,
-                                       &Impl::ButtonCallback,
-                                       this,
-                                       reinterpret_cast<void*>(object.
-                                                                   getLabelId()));
-        m_createdObjects.push_back(btn);
-    }
-
-    void DoRender(const PopupObject::Button& object1,
-                  const PopupObject::Button& object2,
-                  EvasObject &parent)
-    {
-        DoRender(object1, parent);
-
-        EvasObject btn2(elm_button_add(parent));
-
-        elm_object_text_set(btn2, object2.getLabel().c_str());
-        elm_object_part_content_set(parent, POPUP_PART_BUTTON2, btn2);
-        btn2.ConnectMemberSmartCallback(BUTTON_CLICKED_CALLBACK_NAME,
-                                        &Impl::ButtonCallback,
-                                        this,
-                                        reinterpret_cast<void*>(object2.
-                                                                    getLabelId()));
-        m_createdObjects.push_back(btn2);
-    }
-
-    void DoRender(const PopupObject::Button& object1,
-                  const PopupObject::Button& object2,
-                  const PopupObject::Button& object3,
-                  EvasObject &parent)
-    {
-        DoRender(object1, object2, parent);
-
-        EvasObject btn3(elm_button_add(parent));
-
-        elm_object_text_set(btn3, object3.getLabel().c_str());
-        elm_object_part_content_set(parent, POPUP_PART_BUTTON3, btn3);
-        btn3.ConnectMemberSmartCallback(BUTTON_CLICKED_CALLBACK_NAME,
-                                        &Impl::ButtonCallback,
-                                        this,
-                                        reinterpret_cast<void*>(object3.
-                                                                    getLabelId()));
-        m_createdObjects.push_back(btn3);
-    }
-
-    EvasObject getBaseObject()
-    {
-        if (getExternalCanvas() == NULL) {
-            LogDebug("Create old style popup");
-            EvasObject win(elm_win_add(NULL, "Popup", ELM_WIN_DIALOG_BASIC));
-            elm_win_borderless_set(win, EINA_TRUE);
-            elm_win_alpha_set(win, EINA_TRUE);
-            elm_win_raise(win);
-            {
-                int w, h, x, y;
-                ecore_x_window_geometry_get(ecore_x_window_root_first_get(),
-                                            &x,
-                                            &y,
-                                            &w,
-                                            &h);
-                evas_object_resize(win, w, h);
-                evas_object_move(win, x, y);
-            }
-            m_createdObjects.push_back(win);
-            evas_object_show(win);
-            return win;
-        } else {
-            LogDebug("Create new style popup");
-            EvasObject win(getExternalCanvas());
-            evas_object_show(win);
-            return win;
-        }
-    }
-
-    void DoRender()
-    {
-        if (!m_current && !m_popupsToRender.empty()) {
-            m_current = m_popupsToRender.front();
-            m_popupsToRender.pop();
-
-            m_themeIndexV = 0;
-
-            // preprocessing
-            std::vector<int> countPopupObjects = { 0 /* PopupObject::BUTTON */,
-                                                   0 /* PopupObject::LABEL */,
-                                                   0 /* PopupObject::CHECK */ };
-            FOREACH(it, m_current->GetPopupObjects()) {
-                Assert((*it)->getType() < countPopupObjects.size() &&
-                       "Wrong PopupObject assigned");
-                countPopupObjects[(*it)->getType()]++;
-            }
-            int needsIndexV = countPopupObjects[PopupObject::LABEL] +
-                countPopupObjects[PopupObject::CHECK];
-
-            EvasObject win = getBaseObject();
-            EvasObject main(elm_popup_add(win));
-
-            evas_object_size_hint_weight_set(main,
-                                             EVAS_HINT_EXPAND,
-                                             EVAS_HINT_EXPAND);
-            elm_object_part_text_set(main,
-                                     POPUP_PART_TITLE,
-                                     m_current->GetTitle().c_str());
-
-            m_createdObjects.push_back(main);
-            std::vector<PopupObject::Button> buttonObjectList;
-            EvasObject layout(create_layout_main(main, needsIndexV));
-            m_createdObjects.push_back(layout);
-
-            FOREACH(it, m_current->GetPopupObjects()) {
-                switch ((*it)->getType()) {
-                case PopupObject::BUTTON:
-                    buttonObjectList.push_back(*(*it)->asButton());
-                    break;
-                case PopupObject::LABEL:
-                    DoRender(*(*it)->asLabel(),
-                             main,
-                             layout,
-                             m_themeIndexV++);
-                    break;
-                case PopupObject::CHECK:
-                    DoRender(*(*it)->asCheck(),
-                             main,
-                             layout,
-                             m_themeIndexV++);
-                    break;
-                default:
-                    Assert("incorrect type");
-                }
-                Assert(m_themeIndexV <= MAX_NUMBER_OF_VERTICAL);
-            }
-            elm_object_content_set(main,
-                                   layout);
-
-            // show buution
-            switch (buttonObjectList.size()) {
-            case 0:
-                LogDebug("no button");
-                break;
-            case 1:
-                DoRender(buttonObjectList.at(0),
-                         main);
-                break;
-            case 2:
-                DoRender(buttonObjectList.at(0),
-                         buttonObjectList.at(1),
-                         main);
-                break;
-            case 3:
-                DoRender(buttonObjectList.at(0),
-                         buttonObjectList.at(1),
-                         buttonObjectList.at(2),
-                         main);
-                break;
-            default:
-                Assert("incorrect button number");
-                break;
-            }
-
-            evas_object_show(main);
-        }
-    }
-
-    void setExternalCanvas(void* externalCanvas)
-    {
-        m_externalCanvas = static_cast<Evas_Object*>(externalCanvas);
-    }
-
-    Evas_Object* getExternalCanvas() const
-    {
-        return m_externalCanvas;
-    }
-
-    std::queue<PopupPtr> m_popupsToRender;
-    std::list<EvasObject> m_createdObjects;
-    PopupPtr m_current;
-    bool m_initialized;
-    bool m_checkState;
-    DPL::Optional<std::string> m_password;
-    unsigned int m_themeIndexV;
-
-  private:
-    Evas_Object* m_externalCanvas;
-};
-
-PopupRenderer::PopupRenderer()
-{
-    m_impl = new PopupRenderer::Impl();
-}
-
-PopupRenderer::~PopupRenderer()
-{
-    delete m_impl;
-}
-
-void PopupRenderer::Initialize()
-{
-    Assert(m_impl);
-    m_impl->Initialize();
-}
-
-void PopupRenderer::Deinitialize()
-{
-    Assert(m_impl);
-    m_impl->Deinitialize();
-}
-
-IPopupPtr PopupRenderer::CreatePopup()
-{
-    return std::static_pointer_cast<IPopup>(IPopupPtr
-                                                (new Popup(shared_from_this())));
-}
-
-void PopupRenderer::Render(PopupPtr popup)
-{
-    m_impl->Render(popup);
-}
-
-void PopupRenderer::setExternalCanvas(void* externalCanvas)
-{
-    m_impl->setExternalCanvas(externalCanvas);
-}
-}
-} // namespace Popup
-} // namespace Wrt
diff --git a/src_mobile/wrt-popup/wrt/popup-bin/wrt-popup.cpp b/src_mobile/wrt-popup/wrt/popup-bin/wrt-popup.cpp
deleted file mode 100644 (file)
index 41d683d..0000000
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- * 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 "wrt-popup.h"
-#include <limits>
-#include <memory>
-
-#include <aul.h>
-#include <dpl/log/log.h>
-#include <dpl/exception.h>
-#include <dpl/assert.h>
-
-#include "PopupEnum.h"
-#include "PopupSerializer.h"
-#include "YesNoPopup.h"
-#include "InfoPopup.h"
-#include "YesNoCheckPopup.h"
-
-namespace Wrt {
-namespace Popup {
-bool WrtPopup::openPipes()
-{
-    Try
-    {
-        if (m_argc != 3) {
-            LogError("Wrong arguments!");
-            return false;
-        }
-        m_input.Open(m_argv[1]);
-        //open output pipe
-        m_output.Open(m_argv[2]);
-
-        DPL::WaitableHandleWatchSupport::InheritedContext()->
-            AddWaitableHandleWatch(this,
-                                   m_input.WaitableReadHandle(),
-                                   DPL::WaitMode::Read);
-        m_pipesOpened = true;
-        return true;
-    }
-    Catch(DPL::Exception)
-    {
-        LogError("cannot open pipes");
-    }
-    return false;
-}
-
-void WrtPopup::closePipes()
-{
-    Try
-    {
-        if (m_pipesOpened) {
-            DPL::WaitableHandleWatchSupport::InheritedContext()->
-                RemoveWaitableHandleWatch(this,
-                                          m_input.WaitableReadHandle(),
-                                          DPL::WaitMode::Read);
-            m_input.Close();
-            m_output.Close();
-            m_pipesOpened = false;
-        }
-    }
-    Catch(DPL::Exception)
-    {
-        LogError("cannot close pipes");
-    }
-}
-
-void WrtPopup::OnEventReceived(const QuitEvent & /* event */)
-{
-    LogDebug("Quiting");
-    closePipes();
-    Quit();
-}
-
-void WrtPopup::OnWaitableHandleEvent(DPL::WaitableHandle waitableHandle,
-                                     DPL::WaitMode::Type /*mode*/)
-{
-    if (waitableHandle == m_input.WaitableReadHandle()) {
-        readInputData();
-    }
-}
-
-void WrtPopup::readInputData()
-{
-    DPL::BinaryQueueAutoPtr data =
-        m_input.Read(std::numeric_limits<std::size_t>::max());
-    int popupType = PopupSerializer::getIntArg(*data);
-    LogDebug("popup type " << popupType);
-    switch (popupType) {
-    case YES_NO_PROMPT:
-        m_popup.reset(new YesNoPopup());
-        m_popup->show(data, this);
-        break;
-    case INFO_PROMPT:
-        m_popup.reset(new InfoPopup());
-        m_popup->show(data, this);
-        break;
-    case YES_NO_CHECK_PROMPT:
-        m_popup.reset(new YesNoCheckPopup());
-        m_popup->show(data, this);
-        break;
-    default:
-        Assert(false);
-    }
-}
-
-void WrtPopup::response(DPL::BinaryQueue result)
-{
-    m_output.Write(result, result.Size());
-    PostEvent(QuitEvent());
-}
-
-void WrtPopup::OnStop()
-{
-    LogDebug("On Stop");
-}
-
-void WrtPopup::OnCreate()
-{
-    if (!openPipes()) {
-        PostEvent(QuitEvent());
-    }
-    LogDebug("On Create");
-}
-
-void WrtPopup::OnResume()
-{
-    LogDebug("OnResume");
-}
-
-void WrtPopup::OnPause()
-{
-    LogDebug("OnPause");
-}
-
-void WrtPopup::OnReset(bundle */*b*/)
-{
-    LogDebug("OnReset");
-}
-
-void WrtPopup::OnTerminate()
-{
-    LogDebug("Wrt Shutdown now");
-}
-
-WrtPopup::WrtPopup(int argc, char **argv) :
-    Application(argc, argv, "wrt-popup", false),
-    m_pipesOpened(false)
-{
-    Touch();
-    Renderer::PopupControllerSingleton::Instance().Touch();
-    Renderer::PopupManagerSingleton::Instance().Initialize(
-        Renderer::PopupRendererPtr(new Renderer::PopupRenderer));
-    LogDebug("App Created");
-}
-
-WrtPopup::~WrtPopup()
-{
-    Renderer::PopupManagerSingleton::Instance().Deinitialize();
-    LogDebug("App Finished");
-}
-}
-}
-
-int main(int argc, char *argv[])
-{
-    UNHANDLED_EXCEPTION_HANDLER_BEGIN
-    {
-        // Output on stdout will be flushed after every newline character,
-        // even if it is redirected to a pipe. This is useful for running
-        // from a script and parsing output.
-        // (Standard behavior of stdlib is to use full buffering when
-        // redirected to a pipe, which means even after an end of line
-        // the output may not be flushed).
-        setlinebuf(stdout);
-
-        DPL::Log::LogSystemSingleton::Instance().SetTag("WRT-POPUP");
-        Wrt::Popup::WrtPopup app(argc, argv);
-        int ret = app.Exec();
-        LogDebug("App returned: " << ret);
-        return ret;
-    }
-    UNHANDLED_EXCEPTION_HANDLER_END
-}
diff --git a/src_mobile/wrt-popup/wrt/popup-bin/wrt-popup.h b/src_mobile/wrt-popup/wrt/popup-bin/wrt-popup.h
deleted file mode 100644 (file)
index ab9c519..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef WRT_POPUP_H
-#define WRT_POPUP_H
-
-#include <memory>
-#include <dpl/application.h>
-#include <dpl/generic_event.h>
-#include <dpl/event/controller.h>
-#include <dpl/type_list.h>
-#include <dpl/named_input_pipe.h>
-#include <dpl/named_output_pipe.h>
-#include <dpl/waitable_handle_watch_support.h>
-#include <dpl/binary_queue.h>
-#include "popup_controller.h"
-
-namespace Wrt {
-namespace Popup {
-DECLARE_GENERIC_EVENT_0(QuitEvent)
-class WrtPopup;
-
-class IPopup : public Renderer::PopupControllerUser
-{
-  public:
-    virtual void show(DPL::BinaryQueueAutoPtr data, WrtPopup* parent) = 0;
-    virtual ~IPopup() {}
-};
-
-typedef std::unique_ptr<IPopup> IPopupPtr;
-
-class WrtPopup :
-    public DPL::WaitableHandleWatchSupport::WaitableHandleListener,
-    public DPL::Application,
-    private DPL::Event::Controller<DPL::TypeListDecl<QuitEvent>::Type>
-{
-  public:
-    WrtPopup(int argc, char **argv);
-    virtual ~WrtPopup();
-
-    void response(DPL::BinaryQueue result);
-
-  protected:
-    //DPL::Application functions
-    virtual void OnStop();
-    virtual void OnCreate();
-    virtual void OnResume();
-    virtual void OnPause();
-    virtual void OnReset(bundle *b);
-    virtual void OnTerminate();
-    virtual void OnEventReceived(const QuitEvent &event);
-    virtual void OnWaitableHandleEvent(DPL::WaitableHandle waitableHandle,
-                                       DPL::WaitMode::Type mode);
-
-  private:
-
-    void showAcePrompt(DPL::BinaryQueueAutoPtr data);
-    void communicationBoxResponse(int buttonAnswer,
-                                  bool checkState,
-                                  void* userdata);
-    bool m_pipesOpened;
-    IPopupPtr m_popup;
-
-    bool openPipes();
-    void closePipes();
-    void readInputData();
-
-    DPL::NamedInputPipe m_input;
-    DPL::NamedOutputPipe m_output;
-};
-}
-}
-
-#endif // WRT_POPUP_H
diff --git a/src_mobile/wrt-popup/wrt/popup-runner/PopupInvoker.h b/src_mobile/wrt-popup/wrt/popup-runner/PopupInvoker.h
deleted file mode 100644 (file)
index 278db6d..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef WRT_POPUP_INVOKER_H
-#define WRT_POPUP_INVOKER_H
-
-#include <string>
-
-#include <dpl/named_input_pipe.h>
-#include <dpl/named_output_pipe.h>
-
-/*
- *
- * Example usage:
- *
- * bool result = PopupInvoker().askYesNo("title", "message");
- *
- */
-
-namespace Wrt {
-namespace Popup {
-enum PopupResponse {
-    NO_DO_REMEMBER,
-    NO_DONT_REMEMBER,
-    YES_DONT_REMEMBER,
-    YES_DO_REMEMBER
-};
-
-class PopupInvoker
-{
-  public:
-    class Exception
-    {
-      public:
-        DECLARE_EXCEPTION_TYPE(DPL::Exception, Base)
-        DECLARE_EXCEPTION_TYPE(Base, PopupInvokerException)
-    };
-
-    PopupInvoker();
-    ~PopupInvoker();
-
-    bool askYesNo(const std::string &title, const std::string &message);
-    void showInfo(const std::string &title,
-                  const std::string &message,
-                  const std::string &buttonLabel = std::string("OK"));
-    PopupResponse askYesNoCheckbox(const std::string& title,
-                                   const std::string& message,
-                                   const std::string& checkboxLabel);
-
-  private:
-
-    void executePopup();
-
-    DPL::NamedInputPipe m_input;
-    DPL::NamedOutputPipe m_output;
-    std::string m_inputName;
-    std::string m_outputName;
-};
-} // Popup
-} // Wrt
-
-#endif
diff --git a/src_wearable/CMakeLists.txt b/src_wearable/CMakeLists.txt
deleted file mode 100644 (file)
index ba7daa0..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-# 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.
-#
-# Includes CMake configuration file (*.cmake), preserving appropriate paths.
-
-ADD_DEFINITIONS("-DWRT_PLUGINS_COMMON_LOG")
-
-macro(include_config_file INCLUDED_CONFIG_FILE_PATH)
-  get_filename_component(CURRENT_CONFIG_FILE_PATH ${CMAKE_CURRENT_LIST_FILE} PATH)
-  include(${CURRENT_CONFIG_FILE_PATH}/${INCLUDED_CONFIG_FILE_PATH}/${CONFIG_FILE_NAME} OPTIONAL)
-endmacro()
-
-# Gets actual path for CMake configuration file (*.cmake).
-# By default, if no argument is passed, current path will be set to variable
-# named CURRENT_PATH.
-# @param [Optional] Name of the variable to set with current path.
-macro(get_current_path)
-  set(VARIABLE "CURRENT_PATH")
-  if (${ARGC} GREATER 0)
-    set(VARIABLE ${ARGV0})
-  endif ()
-  get_filename_component(${VARIABLE} ${CMAKE_CURRENT_LIST_FILE} PATH)
-endmacro()
-
-set(HOST_ARCH $ENV{DEB_HOST_ARCH})
-if("${HOST_ARCH}" MATCHES "armel")
-    set(HOST_ARCH "armel")
-endif()
-
-#target names
-set(TARGET_PLUGIN_LOADING_LIB "wrt-plugin-loading")
-set(TARGET_COMMONS "wrt-plugins-commons")
-set(TARGET_COMMONS_JAVASCRIPT "wrt-plugins-commons-javascript")
-set(TARGET_JS_OVERLAY "wrt-plugins-js-overlay")
-SET(TARGET_POPUP_ACE "wrt-popup-ace-runtime")
-SET(TARGET_POPUP_ACE_RUNNER_LIB "wrt-popup-ace-runner")
-SET(TARGET_POPUP_WRT "wrt-popup-wrt-runtime")
-SET(TARGET_POPUP_WRT_RUNNER_LIB "wrt-popup-wrt-runner")
-set(TARGET_PLUGINS_API_SUPPORT "wrt-plugins-api-support")
-set(TARGET_PLUGINS_IPC_MESSAGE_LIB "wrt-plugins-ipc-message")
-
-set(PLUGIN_LOADING_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/plugin-loading)
-set(PLUGINS_API_SUPPORT_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/plugins-api-support)
-set(PLUGINS_IPC_MESSAGE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/plugins-ipc-message)
-
-add_subdirectory(plugins-api-support)
-add_subdirectory(plugin-loading)
-add_subdirectory(js-overlay)
-add_subdirectory(Commons)
-add_subdirectory(CommonsJavaScript)
-add_subdirectory(dispatch-event)
-add_subdirectory(modules)
-add_subdirectory(standards)
-add_subdirectory(wrt-popup)
-add_subdirectory(plugins-installer)
-add_subdirectory(plugins-ipc-message)
diff --git a/src_wearable/Commons/CMakeLists.txt b/src_wearable/Commons/CMakeLists.txt
deleted file mode 100644 (file)
index 6b58193..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-# 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.
-#
-macro(install_header_file HEADER_FILE)
-    INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${HEADER_FILE}
-        DESTINATION ${DESTINATION_HEADERS_NON_JS})
-endmacro()
-
-macro(install_wrtaccess_header_file HEADER_FILE)
-    INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${HEADER_FILE}
-        DESTINATION ${DESTINATION_HEADERS_NON_JS}/WrtAccess)
-endmacro()
-
-macro(install_widget_interface_header_file HEADER_FILE)
-    INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${HEADER_FILE}
-        DESTINATION ${DESTINATION_HEADERS_NON_JS}/WidgetInterface)
-endmacro()
-
-include_config_file(WrtAccess)
-
-pkg_search_module(plugin-types REQUIRED wrt-plugins-types)
-pkg_search_module(ace-client REQUIRED security-client)
-pkg_search_module(dpl-event REQUIRED dpl-event-efl)
-pkg_search_module(icu REQUIRED icu-i18n)
-
-set(WRT_COMMONS_DEPENDECIES_INCLUDES
-    ${wrt-plugin-api_INCLUDE_DIRS}
-    ${ace-client_INCLUDE_DIRS}
-    ${plugin-types_INCLUDE_DIRS}
-    ${icu_INCLUDE_DIRS}
-    )
-
-include_directories(${WRT_COMMONS_DEPENDECIES_INCLUDES})
-
-set(TARGET_NAME ${TARGET_COMMONS})
-
-set(SRCS
-  ${SRCS_WRT_ACCESS}
-  ${CMAKE_CURRENT_SOURCE_DIR}/Base64.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/FunctionDefinition.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/Regex.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/RegexUtils.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/StringBuilder.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/StringUtils.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/ThreadPool.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/JSObjectDeclaration.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/JSObject.cpp
-  ${CMAKE_CURRENT_SOURCE_DIR}/TimeUtils.cpp
-  #PARENT_SCOPE
-)
-
-add_library(${TARGET_NAME} SHARED ${SRCS})
-target_link_libraries(${TARGET_NAME}
-  ${LIBS_COMMONS}
-  ${ace-client_LIBRARIES}
-  ${dpl-event_LIBRARIES}
-  ${icu_LIBRARIES}
-  ${TARGET_POPUP_ACE_RUNNER_LIB}
-)
-
-set_target_properties(${TARGET_NAME} PROPERTIES
- SOVERSION ${CMAKE_PROJECT_API_VERSION}
- VERSION ${CMAKE_PROJECT_VERSION}
-)
-
-INSTALL(TARGETS ${TARGET_NAME} LIBRARY DESTINATION ${DESTINATION_LIB_PREFIX})
-
-install_header_file(FunctionDeclaration.h)
-install_header_file(FunctionDefinition.h)
-install_header_file(Base64.h)
-install_header_file(Deprecated.h)
-install_header_file(Dimension.h)
-install_header_file(Emitters.h)
-install_header_file(EventListener.h)
-install_header_file(EventReceiver.h)
-install_header_file(Exception.h)
-install_header_file(IEvent.h)
-install_header_file(IExternEventCanceler.h)
-install_header_file(ListenerEventEmitter.h)
-install_header_file(ListenerEvent.h)
-install_header_file(Range.h)
-install_header_file(Regex.h)
-install_header_file(RegexPatterns.h)
-install_header_file(RegexUtils.h)
-install_header_file(StaticAssert.h)
-install_header_file(StringBuilder.h)
-install_header_file(StringUtils.h)
-install_header_file(ThreadPool.h)
-install_header_file(TypesDeclaration.h)
-install_header_file(TypeTraits.h)
-install_header_file(plugin_initializer_def.h)
-install_header_file(JSObjectDeclaration.h)
-install_header_file(JSObject.h)
-install_header_file(TimeUtils.h)
-install_wrtaccess_header_file(WrtAccess/WrtAccess.h)
diff --git a/src_wearable/Commons/Deprecated.h b/src_wearable/Commons/Deprecated.h
deleted file mode 100644 (file)
index 5db3acf..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRTDEVICEAPIS_COMMONS_DEPRECATED_H_
-#define WRTDEVICEAPIS_COMMONS_DEPRECATED_H_
-
-#define WRT_PLUGINS_DEPRECATED __attribute__((deprecated))
-
-#endif /* WRTDEVICEAPIS_COMMONS_DEPRECATED_H_ */
diff --git a/src_wearable/Commons/Emitters.h b/src_wearable/Commons/Emitters.h
deleted file mode 100644 (file)
index 7b1d8c2..0000000
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * 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.
- */
-/**
- * @author       Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
- */
-
-#ifndef WRTDEVICEAPIS_COMMONS_EMITTERS_H_
-#define WRTDEVICEAPIS_COMMONS_EMITTERS_H_
-
-#include <cstddef>
-#include <map>
-#include <memory>
-#include <dpl/mutex.h>
-#include <dpl/shared_ptr.h>
-#include <Commons/ListenerEventEmitter.h>
-
-namespace WrtDeviceApis {
-namespace Commons {
-/**
- * Manages listener events emitters.
- * Template parameter should be class that derives from @see ListenerEvent.
- */
-template<class EmitterClass>
-class Emitters
-{
-  public:
-    typedef EmitterClass EmitterType;
-    typedef DPL::SharedPtr<EmitterType>           EmitterPtrType;
-    typedef typename EmitterType::IdType EmitterIdType;
-    typedef typename EmitterType::EventType EventType;
-    typedef typename EmitterType::EventPtrType EventPtrType;
-    typedef std::auto_ptr<DPL::Mutex::ScopedLock> LockType;
-
-  public:
-    ~Emitters()
-    {
-        DPL::Mutex::ScopedLock lock(&m_mtx);
-        m_emitters.clear();
-    }
-
-    /**
-     * Attaches emitter.
-     * @param emitter Emitter.
-     * @remarks Thread-safe. Do not use it in the scope of getLock() result.
-     */
-    void attach(const EmitterPtrType& emitter)
-    {
-        DPL::Mutex::ScopedLock lock(&m_mtx);
-        m_emitters[emitter->getId()] = emitter;
-    }
-
-    /**
-     * Detaches emitter.
-     * @param id Id of an emitter.
-     * @return True when emitter was found and successfully detached,
-     *         false otherwise.
-     * @remarks Thread-safe. Do not use it in the scope of getLock() result.
-     */
-    bool detach(const EmitterIdType id)
-    {
-        DPL::Mutex::ScopedLock lock(&m_mtx);
-        return (m_emitters.erase(id) > 0);
-    }
-
-    /**
-     * Emits event through all emitters.
-     * @param event Event to emit.
-     * @remarks Thread-safe. Do not use it in the scope of getLock() result.
-     */
-    void emit(const EventPtrType& event)
-    {
-        DPL::Mutex::ScopedLock lock(&m_mtx);
-        for (Iterator it = m_emitters.begin(); it != m_emitters.end(); ++it) {
-            it->second->emit(event);
-        }
-    }
-
-    /**
-     * Emits event through those emitters that when passed to predicate result
-     * in
-     * returning true by it.
-     * @param event Event to emit.
-     * @param pred Predicate - a callable object (function, functor) that takes
-     *             an argument of type EmitterPtrType and returns boolean value.
-     */
-    template<typename Predicate>
-    void emitIf(const EventPtrType& event,
-                Predicate pred)
-    {
-        DPL::Mutex::ScopedLock lock(&m_mtx);
-        for (Iterator it = m_emitters.begin(); it != m_emitters.end(); ++it) {
-            if (bool(pred(it->second))) {
-                it->second->emit(event);
-            }
-        }
-    }
-
-    /**
-     * Checks whether emitter of supplied id is attached.
-     * @param emitter Emitter.
-     * @return True when emitter has been found, false otherwise.
-     * @remarks Can be used within scope of getLock() call.
-     */
-    bool isAttached(const EmitterIdType id) const
-    {
-        return (m_emitters.count(id) > 0);
-    }
-
-    /**
-     * Returns number of attached emitters.
-     * @return Number of emitters.
-     * @remarks Can be used within scope of getLock() call.
-     */
-    std::size_t size() const
-    {
-        return m_emitters.size();
-    }
-
-    /**
-     * Lock this object.
-     * This lock will be automatically released when out of scope (unless
-     * someone
-     * copies it). Do not use in the same scope as other API of this class.
-     * @return Lock object.
-     * @remarks Provided to allow locking emitters in scope of some client
-     *          code.
-     */
-    LockType getLock()
-    {
-        return LockType(new DPL::Mutex::ScopedLock(&m_mtx));
-    }
-
-  private:
-    typedef std::map<EmitterIdType, EmitterPtrType> Map;
-    typedef typename Map::iterator Iterator;
-    typedef typename Map::const_iterator ConstIterator;
-
-  private:
-    DPL::Mutex m_mtx; ///< Synchronizes operation on this object.
-    Map m_emitters; ///< Emitters container.
-};
-}
-} // WrtDeviceApisCommon
-
-#endif // WRTDEVICEAPIS_COMMONS_EMITTERS_H_
diff --git a/src_wearable/Commons/EventListener.h b/src_wearable/Commons/EventListener.h
deleted file mode 100644 (file)
index abed4a9..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRTDEVICEAPIS_COMMONS_EVENT_LISTENER_H_
-#define WRTDEVICEAPIS_COMMONS_EVENT_LISTENER_H_
-
-#include <memory>
-
-#include <dpl/shared_ptr.h> //TODO: temporary code: DPL::SharedPtr -> std::shared_ptr
-#include <Commons/ThreadPool.h>
-#include <Commons/EventReceiver.h>
-
-namespace WrtDeviceApis {
-namespace Commons {
-/**
- * Base class for listeners.
- * Object that is to act as listener should dervie from this class and implement
- * OnAnswerReceived() function.
- */
-template<class TemplateEvent>
-class EventListener : private EventReceiver<TemplateEvent>
-{
-  public:
-    EventListener(ThreadEnum::Enumeration threadType) :
-        EventReceiver<TemplateEvent>(threadType)
-    {}
-
-    virtual void onAnswerReceived(const DPL::SharedPtr<TemplateEvent>& event)
-    { LogError("Pure virtual function call"); } //TODO: temporary code: DPL::SharedPtr -> std::shared_ptr
-
-    virtual void onAnswerReceived(const std::shared_ptr<TemplateEvent>& event)
-    { LogError("Pure virtual function call"); } //TODO: temporary code: DPL::SharedPtr -> std::shared_ptr
-
-    void postAnswer(const DPL::SharedPtr<TemplateEvent>& event)
-    {
-        DPL::Event::ControllerEventHandler<DPL::SharedPtr<TemplateEvent> >::
-            PostEvent(
-            event);
-    }
-
-  protected:
-    void OnEventReceived(const DPL::SharedPtr<TemplateEvent> &event)
-    {
-        onAnswerReceived(event);
-    }
-};
-
-}
-} // WrtDeviceApisCommon
-
-#endif /* WRTDEVICEAPIS_COMMONS_EVENT_LISTENER_H_ */
diff --git a/src_wearable/Commons/EventReceiver.h b/src_wearable/Commons/EventReceiver.h
deleted file mode 100644 (file)
index 88b78d6..0000000
+++ /dev/null
@@ -1,328 +0,0 @@
-/*
- * 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.
- */
-/*
- * @author      Karol Majewski (k.majewski@samsung.com)
- * @version     0.1
- * @brief
- */
-#ifndef WRTDEVICEAPIS_COMMONS_EVENT_RECEIVER_H_
-#define WRTDEVICEAPIS_COMMONS_EVENT_RECEIVER_H_
-
-#include <memory>
-#include <assert.h>
-#include <dpl/event/thread_event_dispatcher.h>
-#include <dpl/shared_ptr.h>
-#include <dpl/event/controller.h>
-#include <dpl/type_list.h>
-#include <dpl/event/abstract_event_call.h>
-#include <dpl/log/secure_log.h>
-#include <dpl/mutex.h>
-#include <dpl/shared_ptr.h>
-#include <Commons/ThreadPool.h>
-
-namespace WrtDeviceApis {
-namespace Commons {
-template<class TemplateEvent>
-class SignalEventCall : public DPL::Event::AbstractEventCall
-{
-    DPL::SharedPtr<TemplateEvent> m_event;
-
-  public:
-
-    SignalEventCall(const DPL::SharedPtr<TemplateEvent> &event) : m_event(event)
-    {}
-    virtual void Call()
-    {
-        _D("signaling in SignalEventCall");
-        m_event->signalSynchronousEventFlag();
-    }
-};
-
-template<class TemplateEvent>
-class EventReceiver :
-    protected DPL::Event::Controller<
-        typename DPL::TypeListDecl<DPL::SharedPtr<TemplateEvent> >::Type>
-{
-    DPL::Event::ThreadEventDispatcher m_threadDispatcher;
-
-  protected:
-
-    EventReceiver(ThreadEnum::Enumeration threadType)
-    {
-        DPL::Thread *thread =
-            ThreadPool::getInstance().getThreadRef(threadType);
-        DPL::Event::ControllerEventHandler<DPL::SharedPtr<TemplateEvent> >::
-            Touch();
-        DPL::Event::ControllerEventHandler<DPL::SharedPtr<TemplateEvent> >::
-            SwitchToThread(thread);
-    }
-
-    void signalEventByDispatcher(const DPL::SharedPtr<TemplateEvent> &event)
-    {
-        _D("called");
-        Try {
-            DPL::Event::AbstractEventDispatcher *dispatcher =
-                ThreadPool::getInstance().getDispatcher(m_threadDispatcher);
-            dispatcher->AddEventCall(new SignalEventCall<TemplateEvent>(event));
-        }
-        Catch(DPL::Thread::Exception::UnmanagedThread) {
-            // if called on unmanaged thread,
-            // call signalSynchronousEventFlag() directly
-            _E("signalSynchronousEventFlag() is called"
-                     "by unmanaged thread");
-            event->signalSynchronousEventFlag();
-        }
-    }
-
-    virtual ~EventReceiver()
-    {
-        DPL::Event::ControllerEventHandler<DPL::SharedPtr<TemplateEvent> >::
-            SwitchToThread(NULL);
-    }
-};
-
-template<class TemplateEvent>
-class EventRequestReceiver : private EventReceiver<TemplateEvent>
-{
-  public:
-    EventRequestReceiver(ThreadEnum::Enumeration threadType) : EventReceiver<
-            TemplateEvent>(threadType)
-    {}
-    virtual void OnRequestReceived(const DPL::SharedPtr<TemplateEvent> &)
-    { LogError("Pure virtual function call"); } //TODO: temporary code: DPL::SharedPtr -> std::shared_ptr
-
-    virtual void OnRequestReceived(const std::shared_ptr<TemplateEvent> &)
-    { LogError("Pure virtual function call"); }
-
-    /*
-     *
-     * @argument delaySeconds - event will be received not sooner than after
-     * delay (in seconds)
-     */
-    void PostRequest(const DPL::SharedPtr<TemplateEvent> &event,
-                     double delaySeconds = 0.0)
-    {
-        _D("called");
-        {
-            DPL::Mutex::ScopedLock lock(&event->m_stateMutex);
-            assert(TemplateEvent::STATE_INITIAL == event->m_state);
-            event->m_state = TemplateEvent::STATE_REQUEST_SEND;
-        }
-
-        if (TemplateEvent::HANDLING_SYNCHRONOUS == event->getHandlingType() &&
-            !event->m_synchronousEventFlag)
-        {
-            event->m_synchronousEventFlag = new DPL::WaitableEvent();
-        }
-
-        if (0.0 == delaySeconds) {
-            DPL::Event::ControllerEventHandler<DPL::SharedPtr<TemplateEvent> >
-                ::
-                PostEvent(event);
-        } else {
-            DPL::Event::ControllerEventHandler<DPL::SharedPtr<TemplateEvent> >
-                ::
-                PostTimedEvent(event, delaySeconds);
-        }
-
-        switch (event->getHandlingType()) {
-        case TemplateEvent::HANDLING_NOT_SET:
-            assert(0);
-            break;
-        case TemplateEvent::HANDLING_SYNCHRONOUS:
-            event->waitForAnswer();
-            break;
-        }
-    }
-
-    void OnEventReceived(const DPL::SharedPtr<TemplateEvent> &event)
-    {
-        _D("called");
-        {
-            DPL::Mutex::ScopedLock lock(&event->m_stateMutex);
-            if (event->m_cancelled) {
-                event->handleCancel();
-                event->m_cancelAllowed = true;
-                event->signalCancelStatusFlag();
-                event->signalFinishedFlag();
-                return;
-            } else {
-                assert(
-                    TemplateEvent::STATE_REQUEST_SEND == event->m_state &&
-                    "Wrong state!");
-            }
-            event->m_state = TemplateEvent::STATE_REQUEST_RECEIVED;
-        }
-
-        OnRequestReceived(event);
-        event->signalCancelStatusFlag();
-        //After Controller ends processing it should call it to signal that work
-        // is done
-        {
-            DPL::Mutex::ScopedLock lock(&event->m_stateMutex);
-
-            if (event->m_cancelled) {
-                //if cancel was not handled in OnRequestReceived when we should
-                //process as if it was not cancelled at all.
-                if (event->m_cancelAllowed) {
-                    event->handleCancel();
-                    event->signalFinishedFlag();
-                    return;
-                }
-            }
-            //when event is not in manual answer mode we will answer now
-            if (TemplateEvent::HANDLING_ASYNCHRONOUS_MANUAL_ANSWER !=
-                event->m_handlingType &&
-                TemplateEvent::HANDLING_SYNCHRONOUS_MANUAL_ANSWER !=
-                event->m_handlingType)
-            {
-                event->m_state = TemplateEvent::STATE_ANSWER_SEND;
-            }
-        }
-
-        switch (event->m_handlingType) {
-        case TemplateEvent::HANDLING_NOT_SET:
-            assert(0);
-            break;
-        case TemplateEvent::HANDLING_SYNCHRONOUS:
-            //event->Signal();
-            this->signalEventByDispatcher(event);
-            break;
-        case TemplateEvent::HANDLING_ASYNCHRONOUS:
-            ///TODO check - shouldn't it be in signalEventByDispatcher?
-            if (NULL != event->m_remoteController) {
-                event->m_remoteController->PostAnswer(event);
-            }
-            //event->Signal();
-            this->signalEventByDispatcher(event);
-            break;
-        //when event is in manual answer mode we do nothing - the answer will be
-        // send explicit from the code
-        case TemplateEvent::HANDLING_SYNCHRONOUS_MANUAL_ANSWER:
-        case TemplateEvent::HANDLING_ASYNCHRONOUS_MANUAL_ANSWER:
-            break;
-        }
-    }
-
-    virtual void ManualAnswer(const DPL::SharedPtr<TemplateEvent> &event)
-    {
-        _D("called");
-        assert(
-            event->m_handlingType ==
-            TemplateEvent::HANDLING_ASYNCHRONOUS_MANUAL_ANSWER ||
-            event->m_handlingType ==
-            TemplateEvent::HANDLING_SYNCHRONOUS_MANUAL_ANSWER);
-        {
-            DPL::Mutex::ScopedLock lock(&event->m_stateMutex);
-            if (event->m_cancelled) {
-                //if cancel was not handled in OnRequestReceived when we should
-                //process as if it was not cancelled at all.
-                if (event->m_cancelAllowed) {
-                    event->handleCancel();
-                    event->signalCancelStatusFlag();
-                    event->signalFinishedFlag();
-                    return;
-                }
-            }
-            event->m_state = TemplateEvent::STATE_ANSWER_SEND;
-        }
-        switch (event->m_handlingType) {
-        case TemplateEvent::HANDLING_SYNCHRONOUS_MANUAL_ANSWER:
-            //event->Signal();
-            this->signalEventByDispatcher(event);
-            break;
-        case TemplateEvent::HANDLING_ASYNCHRONOUS_MANUAL_ANSWER:
-            //event->Signal();
-            if (NULL != event->m_remoteController) {
-                event->m_remoteController->PostAnswer(event);
-            }
-            this->signalEventByDispatcher(event);
-            break;
-        default:
-            break;
-        }
-    }
-};
-
-template<class TemplateEvent>
-class EventAnswerReceiver : private EventReceiver<TemplateEvent>
-{
-  public:
-    EventAnswerReceiver(ThreadEnum::Enumeration threadType) : EventReceiver<
-            TemplateEvent>(threadType)
-    {}
-
-    virtual void OnAnswerReceived(const DPL::SharedPtr<TemplateEvent> &)
-    { LogError("Pure virtual function call"); } //TODO: temporary code: DPL::SharedPtr -> std::shared_ptr
-
-    virtual void OnAnswerReceived(const std::shared_ptr<TemplateEvent> &)
-    { LogError("Pure virtual function call"); }
-
-    //it should be hidden outside, but I can't do it! I can't! :|
-    void PostAnswer(const DPL::SharedPtr<TemplateEvent> &event)
-    {
-        LogDebug(__FUNCTION__);
-        event->signalCancelStatusFlag();
-        DPL::Event::ControllerEventHandler<DPL::SharedPtr<TemplateEvent> >::
-            PostEvent(
-            event);
-    }
-
-    void OnEventReceived(const DPL::SharedPtr<TemplateEvent> &event)
-    {
-        _D("EventAnswerReceiver: answer received");
-        //check if it can be processed and set the state
-        {
-            DPL::Mutex::ScopedLock lock(&event->m_stateMutex);
-
-            //in case someone changed it to synchronous call, we don't process
-            // it
-            if (TemplateEvent::STATE_CHANGED_TO_SYNCHRONOUS ==
-                event->m_state || TemplateEvent::STATE_ENDED ==
-                event->m_state)
-            {
-                return;
-            }
-            //we should get cancelled or answer_send state here
-            assert(
-                TemplateEvent::STATE_ANSWER_SEND == event->m_state &&
-                "Wrong state!");
-
-            if (event->m_cancelled && event->m_cancelAllowed) {
-                event->handleCancel();
-                event->signalFinishedFlag();
-                return;
-            }
-            event->m_state = TemplateEvent::STATE_ANSWER_RECEIVED;
-        }
-
-        OnAnswerReceived(event);
-
-        {
-            DPL::Mutex::ScopedLock lock(&event->m_stateMutex);
-            assert(TemplateEvent::STATE_ANSWER_RECEIVED == event->m_state);
-            event->m_state = TemplateEvent::STATE_ENDED;
-            delete event->m_cancelStatusFlag;
-            event->m_cancelStatusFlag = NULL;
-            //if someone is waiting
-            event->signalFinishedFlag();
-        }
-    }
-};
-}
-} // WrtDeviceApisCommon
-
-#endif /* WRTDEVICEAPIS_COMMONS_EVENT_RECEIVER_H_ */
diff --git a/src_wearable/Commons/Exception.h b/src_wearable/Commons/Exception.h
deleted file mode 100644 (file)
index 0f1db99..0000000
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRTDEVICEAPIS_COMMONS_EXCEPTION_H_
-#define WRTDEVICEAPIS_COMMONS_EXCEPTION_H_
-
-#include <dpl/exception.h>
-
-namespace WrtDeviceApis {
-namespace Commons {
-#define PLUGINS_DECLARE_EXCEPTION_TYPE(BaseClass, Class) \
-    class Class :       \
-        public BaseClass \
-    { \
-        ExceptionCodes::Enumeration m_code; \
-      public: \
-        virtual ExceptionCodes::Enumeration getCode() const { return m_code; } \
-        Class(const char *path, \
-              const char *function, \
-              int line, \
-              const std::string & message = std::string()) :                                                                                               \
-            BaseClass(path, function, line, message) \
-        { \
-            BaseClass::m_className = #Class; \
-            m_code = ExceptionCodes::Class; \
-        } \
- \
-        Class(const char *path, \
-              const char *function, \
-              int line, \
-              const DPL::Exception & reason, \
-              const std::string & message = std::string()) :                                                                                                                             \
-            BaseClass(path, function, line, reason, message) \
-        { \
-            BaseClass::m_className = #Class; \
-            m_code = ExceptionCodes::Class; \
-        } \
-    };
-
-class ExceptionCodes
-{
-  public:
-    enum Enumeration
-    {
-        None,
-        Exception,
-        InvalidArgumentException,
-        ConversionException,
-        NullPointerException,
-        UnknownException,
-        PlatformException,
-        OutOfRangeException,
-        EventCancelledException,
-        EventWrongStateException,
-        SecurityException,
-        UnsupportedException,
-        PlatformWrongStateException,
-        PendingOperationException,
-        AlreadyInUseException,
-        CameraCaptureException,
-        CameraLiveVideoException,
-        LocalStorageValueNoModifableException,
-        NotFoundException
-    };
-};
-
-/**
- * General exception.
- */
-PLUGINS_DECLARE_EXCEPTION_TYPE(DPL::Exception, Exception)
-
-/**
- * Thrown when passed argument is not of expected type.
- */
-PLUGINS_DECLARE_EXCEPTION_TYPE(Exception, InvalidArgumentException)
-
-/**
- * Thrown when type conversion is not possible.
- */
-PLUGINS_DECLARE_EXCEPTION_TYPE(Exception, ConversionException)
-
-/**
- * Thrown when trying to operate on an object which is set to NULL.
- */
-PLUGINS_DECLARE_EXCEPTION_TYPE(Exception, NullPointerException)
-
-/**
- * Thrown when unknown error occured.
- */
-PLUGINS_DECLARE_EXCEPTION_TYPE(Exception, UnknownException)
-
-/**
- * Thrown when platform function returned error code or threw an exception.
- */
-PLUGINS_DECLARE_EXCEPTION_TYPE(Exception, PlatformException)
-
-/**
- * Thrown when trying to access out of range element from array
- */
-PLUGINS_DECLARE_EXCEPTION_TYPE(Exception, OutOfRangeException)
-
-/**
- * Thrown when trying to operate on cancelled event
- */
-PLUGINS_DECLARE_EXCEPTION_TYPE(Exception, EventCancelledException)
-
-/**
- * Thrown when trying to operate on event in wrong state
- */
-PLUGINS_DECLARE_EXCEPTION_TYPE(Exception, EventWrongStateException)
-
-/**
- * Thrown when trying to perform some action w/o proper permissions.
- */
-PLUGINS_DECLARE_EXCEPTION_TYPE(Exception, SecurityException)
-
-/**
- * Thrown when trying to perform action that is not supported by current
- * platform.
- */
-PLUGINS_DECLARE_EXCEPTION_TYPE(Exception, UnsupportedException)
-
-/**
- * Thrown when trying to perform action on platform in wrong state.
- */
-PLUGINS_DECLARE_EXCEPTION_TYPE(Exception, PlatformWrongStateException)
-
-/**
- * Thrown when trying to perform asynchronous action on JS object
- * that already executes other asynchronous operation.
- */
-PLUGINS_DECLARE_EXCEPTION_TYPE(Exception, PendingOperationException)
-
-/**
- * Thrown when used camera is already in use.
- */
-PLUGINS_DECLARE_EXCEPTION_TYPE(Exception, AlreadyInUseException)
-
-/**
- * Thrown when unpredicted error occurs while a picture or video is being
- * captured
- * or if endRecording is called while no video is currently captured.
- */
-PLUGINS_DECLARE_EXCEPTION_TYPE(Exception, CameraCaptureException)
-
-/**
- * camera live video cannot be provided.
- */
-PLUGINS_DECLARE_EXCEPTION_TYPE(Exception, CameraLiveVideoException)
-
-/**
- * Error trying to modify read only value
- */
-PLUGINS_DECLARE_EXCEPTION_TYPE(Exception, LocalStorageValueNoModifableException)
-
-/**
- * Thrown when object is not found.
- */
-PLUGINS_DECLARE_EXCEPTION_TYPE(Exception, NotFoundException)
-}
-} // WrtDeviceApisCommon
-
-#endif /* WRTDEVICEAPIS_COMMONS_EXCEPTION_H_ */
diff --git a/src_wearable/Commons/IEvent.h b/src_wearable/Commons/IEvent.h
deleted file mode 100644 (file)
index 207f5bb..0000000
+++ /dev/null
@@ -1,383 +0,0 @@
-/*
- * 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.
- */
-/*
- * @author      Karol Majewski (k.majewski@samsung.com)
- * @version     0.1
- * @brief
- */
-
-#ifndef WRTDEVICEAPIS_COMMONS_IEVENT_H_
-#define WRTDEVICEAPIS_COMMONS_IEVENT_H_
-
-#include <assert.h>
-#include <dpl/event/controller.h>
-#include <dpl/mutex.h>
-#include <dpl/shared_ptr.h>
-#include <Commons/Exception.h>
-#include <Commons/EventReceiver.h>
-
-namespace WrtDeviceApis {
-namespace Commons {
-class IEventPrivateData
-{
-  public:
-    virtual ~IEventPrivateData()
-    {}
-};
-
-class IEventController
-{
-    DPL::SharedPtr<IEventPrivateData> m_privateData;
-
-  public:
-    virtual void waitTillProcessed() = 0;
-    virtual void waitForAnswer() = 0;
-    virtual bool cancelRequest()
-    {
-        return false;
-    }
-    virtual bool changeCallToSynchronous() = 0;
-    virtual ~IEventController()
-    {}
-
-    void setPrivateData(
-        const DPL::SharedPtr<IEventPrivateData> &privateData)
-    {
-        m_privateData = privateData;
-    }
-    const DPL::SharedPtr<IEventPrivateData>& getPrivateData()
-    {
-        return m_privateData;
-    }
-};
-typedef DPL::SharedPtr<IEventController> IEventControllerPtr;
-
-// CRTP pattern
-template<class Super>
-class IEvent : /*private DPL::WaitableEvent, */ public IEventController
-{
-  public:
-    friend class EventRequestReceiver<Super>;
-    friend class EventAnswerReceiver<Super>;
-    friend class SignalEventCall<Super>;
-    friend class EventReceiver<Super>;
-
-    enum HandlingType
-    {
-        HANDLING_NOT_SET = -1,
-        HANDLING_SYNCHRONOUS = 0,
-        HANDLING_ASYNCHRONOUS = 1,
-        HANDLING_SYNCHRONOUS_MANUAL_ANSWER = 2,
-        HANDLING_ASYNCHRONOUS_MANUAL_ANSWER = 3
-    };
-
-    enum State
-    {
-        STATE_INITIAL,
-        STATE_REQUEST_SEND,
-        STATE_REQUEST_RECEIVED,
-        STATE_ANSWER_SEND,
-        STATE_ANSWER_RECEIVED,
-        STATE_ENDED,
-        STATE_CHANGED_TO_SYNCHRONOUS
-    };
-
-  private:
-    void handleCancel()
-    {
-        clearOnCancel();
-        m_state = STATE_ENDED;
-        m_exceptionCode = Commons::ExceptionCodes::EventCancelledException;
-        //if someone is waiting
-        signalSynchronousEventFlag();
-    }
-
-  protected:
-    DPL::Mutex m_stateMutex;
-    State m_state;
-    HandlingType m_handlingType;
-    EventAnswerReceiver< Super > *m_remoteController;
-    Commons::ExceptionCodes::Enumeration m_exceptionCode;
-    DPL::WaitableEvent *m_synchronousEventFlag;
-    DPL::WaitableEvent *m_finishedFlag;
-    DPL::WaitableEvent *m_cancelStatusFlag;
-    bool m_cancelSignalAhead;
-    bool m_cancelled;
-    bool m_cancelAllowed;
-
-    IEvent() :
-        m_state(STATE_INITIAL),
-        m_handlingType(HANDLING_NOT_SET),
-        m_remoteController(NULL),
-        m_exceptionCode(Commons::ExceptionCodes::None),
-        m_synchronousEventFlag(NULL),
-        m_finishedFlag(NULL),
-        m_cancelStatusFlag(NULL),
-        m_cancelSignalAhead(false),
-        m_cancelled(false),
-        m_cancelAllowed(false)
-    {}
-
-    virtual void waitForAnswer()
-    {
-        assert(HANDLING_SYNCHRONOUS == m_handlingType);
-        DPL::WaitForSingleHandle(m_synchronousEventFlag->GetHandle());
-        {
-            DPL::Mutex::ScopedLock lock(&m_stateMutex);
-            m_state = STATE_ENDED;
-        }
-        signalFinishedFlag();
-        LogDebug("deleting m_processEvent");
-        delete m_synchronousEventFlag;
-        m_synchronousEventFlag = NULL;
-    }
-
-    void signalFinishedFlag()
-    {
-        if (m_finishedFlag) {
-            m_finishedFlag->Signal();
-        }
-    }
-
-    DPL::WaitableEvent &getFinishedFlag()
-    {
-        if (!m_finishedFlag) {
-            m_finishedFlag = new DPL::WaitableEvent();
-        }
-        return *m_finishedFlag;
-    }
-
-    void signalCancelStatusFlag()
-    {
-        LogDebug("signaling cancel");
-        DPL::Mutex::ScopedLock lock(&m_stateMutex);
-        m_cancelSignalAhead = true;
-        if (m_cancelStatusFlag) {
-            m_cancelStatusFlag->Signal();
-        }
-    }
-
-    DPL::WaitableEvent &getCancelStatusFlag()
-    {
-        if (!m_cancelStatusFlag) {
-            m_cancelStatusFlag = new DPL::WaitableEvent();
-        }
-        return *m_cancelStatusFlag;
-    }
-
-    void signalSynchronousEventFlag()
-    {
-        if (m_synchronousEventFlag) {
-            m_synchronousEventFlag->Signal();
-        }
-    }
-
-  public:
-
-    /*
-     * Gets the answer receiver pointer.
-     */
-    EventAnswerReceiver< Super > * getAnswerReceiverRef() const
-    {
-        return m_remoteController;
-    }
-
-    virtual ~IEvent()
-    {
-        delete m_cancelStatusFlag;
-        delete m_finishedFlag;
-        delete m_synchronousEventFlag;
-    }
-
-    virtual bool changeCallToSynchronous()
-    {
-        return setForSynchronousCall();
-    }
-
-    virtual void waitTillProcessed()
-    {
-        DPL::WaitForSingleHandle(getFinishedFlag().GetHandle());
-        delete m_finishedFlag;
-        m_finishedFlag = NULL;
-    }
-
-    virtual void clearOnCancel()
-    {}
-
-    Commons::ExceptionCodes::Enumeration getExceptionCode() const
-    {
-        return m_exceptionCode;
-    }
-    void setExceptionCode(Commons::ExceptionCodes::Enumeration exceptionCode)
-    {
-        m_exceptionCode = exceptionCode;
-    }
-
-    short getHandlingType() const
-    {
-        return m_handlingType;
-    }
-
-    virtual bool setForSynchronousCall()
-    {
-        DPL::Mutex::ScopedLock lock(&m_stateMutex);
-        if (m_cancelled) {
-            return false;
-        }
-        switch (m_state) {
-        case STATE_ANSWER_SEND:
-            m_state = STATE_CHANGED_TO_SYNCHRONOUS;
-            break;
-        case STATE_ANSWER_RECEIVED:
-        case STATE_ENDED:
-            return false;
-        default:
-            break;
-        }
-        m_handlingType = HANDLING_SYNCHRONOUS;
-        return true;
-    }
-
-    virtual bool setForAsynchronousCall(
-        EventAnswerReceiver< Super > *remoteController)
-    {
-        DPL::Mutex::ScopedLock lock(&m_stateMutex);
-        if (m_cancelled) {
-            return false;
-        }
-        switch (m_state) {
-        case STATE_ANSWER_SEND:
-        case STATE_ANSWER_RECEIVED:
-        case STATE_ENDED:
-            return false;
-        default:
-            break;
-        }
-        m_handlingType = HANDLING_ASYNCHRONOUS;
-        m_remoteController = remoteController;
-        return true;
-    }
-
-    /*
-     * Normally, after invoking OnRequestReceived in RequestReceiver, the answer
-     * is being send automatically (after flow leaves OnRequestReceived).
-     * After calling this function, the answer is not being send automatically,
-     * you need to call ManualAnswer to send event back.
-     * It works both in asynchronous and synchronous handling type.
-     */
-    virtual bool switchToManualAnswer()
-    {
-        assert(
-            m_handlingType == HANDLING_ASYNCHRONOUS || m_handlingType ==
-            HANDLING_SYNCHRONOUS);
-
-        DPL::Mutex::ScopedLock lock(&m_stateMutex);
-        if (m_cancelled) {
-            return false;
-        }
-        switch (m_state) {
-        case STATE_ANSWER_SEND:
-        case STATE_ANSWER_RECEIVED:
-        case STATE_ENDED:
-            return false;
-        default:
-            break;
-        }
-
-        switch (m_handlingType) {
-        case HANDLING_ASYNCHRONOUS:
-            m_handlingType = HANDLING_ASYNCHRONOUS_MANUAL_ANSWER;
-            break;
-        case HANDLING_SYNCHRONOUS:
-            m_handlingType = HANDLING_SYNCHRONOUS_MANUAL_ANSWER;
-            break;
-        default:
-            break;
-        }
-        return true;
-    }
-
-    bool checkCancelled()
-    {
-        //DPL::Mutex::ScopedLock lock(&m_stateMutex);
-        return m_cancelled;
-    }
-
-    void tryCancelled()
-    {
-        //DPL::Mutex::ScopedLock lock(&m_stateMutex);
-        if (m_cancelled) {
-            Throw(Commons::EventCancelledException);
-        }
-    }
-
-    bool getCancelAllowed() const
-    {
-        return m_cancelAllowed;
-    }
-
-    void setCancelAllowed(bool cancelAllowed)
-    {
-        m_cancelAllowed = cancelAllowed;
-    }
-
-    bool cancelRequest()
-    {
-        LogDebug("trying to cancel");
-        assert(HANDLING_ASYNCHRONOUS == m_handlingType ||
-               HANDLING_ASYNCHRONOUS_MANUAL_ANSWER == m_handlingType);
-        bool signaled = false;
-        {
-            DPL::Mutex::ScopedLock lock(&m_stateMutex);
-            if (m_cancelled) {
-                return false;
-            }
-            switch (m_state) {
-            case STATE_INITIAL:
-                assert(0);
-            case STATE_ANSWER_SEND:
-                LogDebug("cancelling");
-                m_cancelled = true;
-                delete m_cancelStatusFlag;
-                m_cancelStatusFlag = NULL;
-                return m_cancelAllowed;
-            case STATE_ANSWER_RECEIVED:
-            case STATE_ENDED:
-                return false;
-            default:
-                break;
-            }
-            LogDebug("cancelling");
-            m_cancelled = true;
-            signaled = m_cancelSignalAhead;
-            if (!signaled) {
-                //create waitable handle
-                getCancelStatusFlag();
-            }
-        }
-        LogDebug("waiting for cancel flag");
-        if (!signaled) {
-            DPL::WaitForSingleHandle(getCancelStatusFlag().GetHandle());
-        }
-        delete m_cancelStatusFlag;
-        m_cancelStatusFlag = NULL;
-        return m_cancelAllowed;
-    }
-};
-}
-} // WrtDeviceApisCommon
-
-#endif /* WRTDEVICEAPIS_COMMONS_IEVENT_H_ */
diff --git a/src_wearable/Commons/IExternEventCanceler.h b/src_wearable/Commons/IExternEventCanceler.h
deleted file mode 100644 (file)
index 958fdd6..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * 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.
- */
-/*
- * @author      Grzegorz Krawczyk (g.krawczyk@samsung.com)
- * @version     0.1
- * @brief
- */
-
-#ifndef WRTDEVICEAPIS_COMMONS_IEXTERN_EVENT_CANCELER_H_
-#define WRTDEVICEAPIS_COMMONS_IEXTERN_EVENT_CANCELER_H_
-
-#include <memory>
-
-#include <dpl/shared_ptr.h>
-#include <dpl/log/log.h>
-
-namespace WrtDeviceApis {
-namespace Commons {
-/**
- * This class is related to JSPendingOperation object.
- *
- * It is interface for controllers which want to perform
- * an additional accation when the PendingOberation object
- * is canceled.
- * */
-template<class TemplateEvent>
-class IExternEventCanceler
-{
-  public:
-    virtual void OnCancelEvent(const std::shared_ptr<TemplateEvent>& event)
-    { LogError("Pure virtual function call"); }
-
-    virtual void OnCancelEvent(const DPL::SharedPtr<TemplateEvent>& event)
-    { LogError("Pure virtual function call"); }
-
-    virtual ~IExternEventCanceler()
-    {}
-};
-}
-} // WrtDeviceApisCommon
-
-#endif // WRTDEVICEAPIS_COMMONS_IEXTERN_EVENT_CANCELER_H_
diff --git a/src_wearable/Commons/JSObject.h b/src_wearable/Commons/JSObject.h
deleted file mode 100644 (file)
index d52f5a8..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * 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    js_object.h
- * @author  Grzegorz Krawczyk (g.krawczyk@samgsung.com)
- * @version
- * @brief
- */
-
-#ifndef WRT_SRC_PLUGIN_SERVICE_JS_OBJECT_H_
-#define WRT_SRC_PLUGIN_SERVICE_JS_OBJECT_H_
-
-#include <dpl/noncopyable.h>
-#include <dpl/shared_ptr.h>
-
-class JSObject : private DPL::Noncopyable
-{
-  public:
-    typedef void* RealObject;
-
-  public:
-    explicit JSObject(RealObject object);
-
-    /**
-     * returns javascript engine object
-     * @throw NullPtrException
-     * */
-    virtual RealObject getObject() const;
-
-    virtual ~JSObject()
-    {}
-
-  private:
-    RealObject m_object;
-};
-
-typedef DPL::SharedPtr<JSObject> JSObjectPtr;
-
-#endif
diff --git a/src_wearable/Commons/JSObjectDeclaration.h b/src_wearable/Commons/JSObjectDeclaration.h
deleted file mode 100644 (file)
index a726029..0000000
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * 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    js_object_declaration.h
- * @author  Grzegorz Krawczyk (g.krawczyk@samgsung.com)
- * @version
- * @brief
- */
-
-#ifndef WRT_SRC_PLUGIN_SERVICE_JS_OBJECT_DECLARATION_H_
-#define WRT_SRC_PLUGIN_SERVICE_JS_OBJECT_DECLARATION_H_
-
-#include <string>
-#include <memory>
-#include <cassert>
-#include <dpl/shared_ptr.h>
-#include <dpl/noncopyable.h>
-#include <dpl/log/log.h>
-#include <wrt_plugin_export.h>
-
-class JSObjectDeclaration : private DPL::Noncopyable
-{
-  public:
-    typedef const void* ConstClassTemplate;
-    typedef void* ClassTemplate;
-    typedef js_class_constructor_cb_t ConstructorCallback;
-    typedef class_definition_options_t ClassOptions;
-
-    class Options : DPL::Noncopyable
-    {
-      public:
-        enum class ClassType
-        {
-            Class,
-            Function,
-            Interface
-        };
-
-        enum class IFrameObject
-        {
-            None,
-            Reference,
-            CreateInstance
-        };
-
-        enum class IFrameNotice
-        {
-            None,
-            AlwaysNotice
-        };
-
-        //only for function
-        enum class IFrameOverlay
-        {
-            Ignored,
-            UseOverlayed,           //deprecated
-            OverlayedBeforeOriginal //deprecated
-        };
-
-        typedef js_object_instance_t ObjectInstance;
-        typedef java_script_context_t JsContext;
-        typedef void* PrivateData;
-
-      public:
-        ClassType getType() const;
-
-        IFrameObject getIframeObject() const;
-        IFrameNotice getIframeNotice() const;
-        js_function_impl getFunctionImpl() const;
-
-        void invokeCallback(JsContext ctx,
-                            ObjectInstance iframe,
-                            ObjectInstance object) const;
-
-        PrivateData getPrivateData() const;
-
-      private:
-        const ClassOptions* m_options;
-
-      private:
-        explicit Options(const ClassOptions* options) : m_options(options)
-        {
-            assert(options && "Dont create empty options");
-        }
-
-        friend class JSObjectDeclaration;
-    };
-
-    typedef std::shared_ptr<Options> OptionsPtr;
-
-  public:
-
-    explicit JSObjectDeclaration(js_entity_definition_ptr_t declaration);
-
-    virtual const std::string& getName() const
-    {
-        return m_name;
-    }
-
-    virtual const std::string& getParentName() const
-    {
-        return m_parentName;
-    }
-
-    virtual ConstClassTemplate getClassTemplate() const
-    {
-        return m_classTemplate;
-    }
-
-    virtual const std::string& getInterfaceName() const
-    {
-        return m_interfaceName;
-    }
-
-    virtual ConstructorCallback getConstructorCallback() const
-    {
-        return m_constructorCallback;
-    }
-
-    const OptionsPtr getOptions() const
-    {
-        return m_options;
-    }
-
-    bool checkIframesSupported() const;
-
-    virtual ~JSObjectDeclaration();
-
-  private:
-    std::string m_name;
-    std::string m_parentName;
-    std::string m_interfaceName;
-    ConstClassTemplate m_classTemplate;
-    ConstructorCallback m_constructorCallback;
-    OptionsPtr m_options;
-};
-
-typedef DPL::SharedPtr<JSObjectDeclaration> JSObjectDeclarationPtr;
-
-#endif
diff --git a/src_wearable/Commons/ListenerEvent.h b/src_wearable/Commons/ListenerEvent.h
deleted file mode 100644 (file)
index 7956ab7..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * 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.
- */
-/**
- * @author    Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
- */
-
-#ifndef WRTDEVICEAPIS_COMMONS_LISTENER_EVENT_H_
-#define WRTDEVICEAPIS_COMMONS_LISTENER_EVENT_H_
-
-#include <dpl/mutex.h>
-#include <dpl/shared_ptr.h>
-#include <dpl/noncopyable.h>
-#include <Commons/Exception.h>
-#include <Commons/IEvent.h>
-
-namespace WrtDeviceApis {
-namespace Commons {
-template<class EventClass>
-class ListenerEventEmitter;
-
-/**
- * This is base class for events that should act as signals between abstract
- * layer and layer that uses it (e.g. JS layer in WRT plugins).
- * Such event is created by specific event emitter from abstract layer
- * and passed asynchronously to object that acts as event listener.
- * Template parameter should be class of an event which derives from
- * this class (co called CRTP pattern).
- */
-template<class Derived>
-class ListenerEvent
-{
-    friend class ListenerEventEmitter<Derived>;
-
-  public:
-    typedef IEventPrivateData PrivateDataType;
-    typedef DPL::SharedPtr<PrivateDataType> PrivateDataTypePtr;
-
-  public:
-    virtual ~ListenerEvent()
-    {
-        delete m_mtx;
-    }
-
-    /**
-     * Gets exception code.
-     * @return Exception code.
-     */
-    Commons::ExceptionCodes::Enumeration getExceptionCode() const
-    {
-        DPL::Mutex::ScopedLock lock(m_mtx);
-        return m_code;
-    }
-
-    /**
-     * Sets exception code.
-     * @param code Exception code.
-     * @throw EventWrongStateExeption When event has already been emitted.
-     */
-    void setExceptionCode(Commons::ExceptionCodes::Enumeration code)
-    {
-        DPL::Mutex::ScopedLock lock(m_mtx);
-        m_code = code;
-    }
-
-    /**
-     * Gets event's private data.
-     * @return Private data (use DPL cast to proper object).
-     */
-    const PrivateDataTypePtr& getPrivateData() const
-    {
-        DPL::Mutex::ScopedLock lock(m_mtx);
-        return m_privateData;
-    }
-
-  protected:
-    ListenerEvent() :
-        m_mtx(new DPL::Mutex()),
-        m_code(Commons::ExceptionCodes::None)
-    {}
-
-    ListenerEvent(const ListenerEvent &ths) :
-        m_mtx(new DPL::Mutex()),
-        m_code(ths.m_code),
-        m_privateData(ths.m_privateData)
-    {}
-
-    ListenerEvent& operator=(const ListenerEvent &other)
-    {
-        if (this != &other) {
-            m_mtx = new DPL::Mutex();
-            m_code = other.m_code;
-            m_privateData = other.m_privateData;
-        }
-        return *this;
-    }
-
-    /**
-     * Sets event's private data.
-     * Event's private data object has to implement @see IEventPrivateData
-     * interface.
-     * @param data Private data.
-     * @throw EventWrongStateExeption When event has already been emitted.
-     */
-    void setPrivateData(const PrivateDataTypePtr& data)
-    {
-        DPL::Mutex::ScopedLock lock(m_mtx);
-        m_privateData = data;
-    }
-
-  protected:
-    mutable DPL::Mutex *m_mtx;
-    Commons::ExceptionCodes::Enumeration m_code; ///< Exception code.
-    PrivateDataTypePtr m_privateData; ///< Private data.
-};
-}
-} // WrtDeviceApisCommon
-
-#endif // WRTDEVICEAPIS_COMMONS_LISTENER_EVENT_H_
diff --git a/src_wearable/Commons/StringUtils.h b/src_wearable/Commons/StringUtils.h
deleted file mode 100644 (file)
index b36071f..0000000
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * 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   StringUtils.h
- * @author Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
- */
-
-#ifndef WRTDEVICEAPIS_COMMONS_STRINGUTILS_H_
-#define WRTDEVICEAPIS_COMMONS_STRINGUTILS_H_
-
-#include <string>
-#include <vector>
-#include <sstream>
-#include <utility>
-#include <Commons/Exception.h>
-#include <Commons/Deprecated.h>
-
-namespace WrtDeviceApis {
-namespace Commons {
-namespace String {
-/**
- * Removes spaces from begining of the string.
- * @param str String to remove spaces from.
- * @return String with spaces removed.
- */
-std::string lTrim(const std::string& str);
-
-/**
- * Removes spaces from end of the string.
- * @param str String to remove spaces from.
- * @return String with spaces removed.
- */
-std::string rTrim(const std::string& str);
-
-/**
- * Removes spaces from begining and end of the string.
- * @param str String to remove spaces from.
- * @return String with spaces removed.
- */
-std::string trim(const std::string& str);
-
-/**
- * Checks if str starts with startStr
- * @param str String to be searched.
- * @param startStr String to be found at the beginning of str.
- * @return true when str starts with startStr, false otherwise.
- */
-bool startsWith(const std::string& str, const std::string& startStr);
-
-/**
- * Checks if str ends with startStr
- * @param str String to be searched.
- * @param endStr String to be found at the end of str.
- * @return true when str starts with startStr, false otherwise.
- */
-bool endsWith(const std::string& str, const std::string& endStr);
-
-/**
- * Merges consecutive groups of duplicate characters into one.
- * @param str String to remove characters from.
- * @param needle Character for which groups of duplicates to merge.
- * @return String with group of duplicate characters merged.
- * @code
- * ...
- * std::string str = "Aala maa kota";
- * std::string uniq = unique(str, 'a');
- * uniq == "Ala ma kota";
- * ...
- * @endcode
- */
-std::string unique(const std::string& str, const char needle);
-
-/**
- * Checks if supplied string exists in specified array of c-strings.
- * @param needle String to verify.
- * @param stack Array of c-strings which last element should be NULL.
- * @return True if string exists in array, false otherwise.
- * @remarks Last element of array should be NULL, otherwise there is no
- *          way to calculate its number of elements.
- */
-bool inCStringArray(const std::string& needle, const char* stack[]);
-
-/**
- * Duplicates a string.
- * @param str String to duplicate.
- * @return String copy.
- * @throw std::bad_alloc If allocation fails.
- * @remarks Ownership passed to the caller. String has to be deallocated using
- *          free() function.
- */
-char* strdup(const char* str);
-inline char* strdup(const std::string& str)
-{
-    return strdup(str.c_str());
-}
-
-std::string merge(const std::vector<std::string>& strs,
-                  std::string::value_type delim);
-
-std::vector<std::string> split(const std::string& str,
-                               std::string::value_type delim);
-
-/**
- * @deprecated Use convertTo<int>().
- */
-int toInt(const std::string& str) WRT_PLUGINS_DEPRECATED;
-
-/**
- * Converts string to specified type.
- *
- * @tparam T Type to convert to.
- * @param str String to convert.
- * @return Converted value.
- * @throw ConversionException If conversion fails.
- *
- * @remarks T must implement default constructor and an implementation
- *          of input string operator for T must exist.
- */
-template<typename T>
-T convertTo(const std::string& str)
-{
-    T result;
-    std::istringstream iss(str);
-    if (!(iss >> result)) {
-        Throw(ConversionException);
-    }
-    return std::move(result);
-}
-
-/**
- * Converts a given value to string.
- *
- * @tparam T Type of the value to convert. It is deduced by the compiler.
- * @param data Value to convert.
- * @return Value converted to string.
- * @throw ConversionException If operation fails.
- *
- * @remarks Output stream operator for type T must exist.
- */
-template<typename T>
-std::string parse(const T& data)
-{
-    std::ostringstream oss;
-    if (!(oss << data)) {
-        Throw(ConversionException);
-    }
-    return oss.str();
-}
-}
-}
-}
-
-#endif
diff --git a/src_wearable/Commons/ThreadPool.cpp b/src_wearable/Commons/ThreadPool.cpp
deleted file mode 100644 (file)
index fd5cd3a..0000000
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- * 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.
- */
-/*
- * ControllersFactory.cpp
- *
- *  Created on: 2010-06-28
- *      Author: kmajewski
- */
-
-#include <assert.h>
-
-#include <dpl/log/log.h>
-#include <dpl/thread.h>
-
-#include "ThreadPool.h"
-#include "Exception.h"
-
-namespace WrtDeviceApis {
-namespace Commons {
-ThreadPool &ThreadPool::getInstance()
-{
-    static ThreadPool theInstance;
-    return theInstance;
-}
-
-DPL::Event::AbstractEventDispatcher *ThreadPool::getDispatcher(
-    DPL::Event::ThreadEventDispatcher &callingThreadDispatcher)
-{
-    DPL::Thread *currentThread = DPL::Thread::GetCurrentThread();
-    //if we are in main thread
-    if (NULL == currentThread) {
-        return &DPL::Event::GetMainEventDispatcherInstance();
-    }
-    callingThreadDispatcher.SetThread(currentThread);
-    return &callingThreadDispatcher;
-}
-
-ThreadPool::ThreadPool()
-{}
-
-ThreadPool::~ThreadPool()
-{
-    for (ThreadHandleMap::const_iterator it = m_threadHandlers.begin(); it
-         != m_threadHandlers.end(); ++it)
-    {
-        delete (*it).second;
-    }
-}
-
-DPL::Thread* ThreadPool::getThreadHandleCreateIfNotExists(
-    ThreadEnum::Enumeration type)
-{
-    DPL::Mutex::ScopedLock lock(&m_threadHandlersMutex);
-    ThreadHandleMap::iterator element = m_threadHandlers.find(type);
-
-    //if element does not exists in the map
-    if (m_threadHandlers.end() == element) {
-        DPL::Thread* newThread = new DPL::Thread();
-        m_threadHandlers.insert(
-            m_threadHandlers.begin(),
-            std::pair<ThreadEnum::Enumeration, DPL::Thread*>(type, newThread));
-        newThread->Run();
-        return newThread;
-    }
-    return (*element).second;
-}
-
-DPL::Thread *ThreadPool::getThreadRef(ThreadEnum::Enumeration type)
-{
-    DPL::Thread *thandle = NULL;
-    if (type < 0 || type >= ThreadEnum::size) {
-        Throw(InvalidArgumentException);
-    }
-    /* we could stay with
-     * getThreadHandleCreateIfNotExists(type);
-     * but by switch we can attach actually one thread to more than one
-     * ThreadEnums
-     */
-    switch (type) {
-    case ThreadEnum::NULL_THREAD:
-        thandle = NULL;
-        break;
-    case ThreadEnum::CAMERA_THREAD:
-        thandle = getThreadHandleCreateIfNotExists(ThreadEnum::CAMERA_THREAD);
-        break;
-    case ThreadEnum::CALENDAR_THREAD:
-        thandle = getThreadHandleCreateIfNotExists(ThreadEnum::CALENDAR_THREAD);
-        break;
-    case ThreadEnum::TELEPHONY_THREAD:
-        thandle = getThreadHandleCreateIfNotExists(ThreadEnum::TELEPHONY_THREAD);
-        break;
-    case ThreadEnum::APPLAUNCHER_THREAD:
-        thandle = getThreadHandleCreateIfNotExists(
-                ThreadEnum::APPLAUNCHER_THREAD);
-        break;
-    case ThreadEnum::APPCONFIG_THREAD:
-        thandle = getThreadHandleCreateIfNotExists(ThreadEnum::APPCONFIG_THREAD);
-        break;
-    case ThreadEnum::MESSAGING_THREAD:
-        thandle = getThreadHandleCreateIfNotExists(type);
-        break;
-    case ThreadEnum::FILESYSTEM_THREAD:
-        thandle = getThreadHandleCreateIfNotExists(
-                ThreadEnum::FILESYSTEM_THREAD);
-        break;
-    case ThreadEnum::GALLERY_THREAD:
-        thandle = getThreadHandleCreateIfNotExists(ThreadEnum::GALLERY_THREAD);
-        break;
-    case ThreadEnum::CONTACT_THREAD:
-        thandle = getThreadHandleCreateIfNotExists(ThreadEnum::CONTACT_THREAD);
-        break;
-    case ThreadEnum::BONDI_THREAD:
-        thandle = getThreadHandleCreateIfNotExists(ThreadEnum::BONDI_THREAD);
-        break;
-    case ThreadEnum::GEOLOCATION_THREAD:
-        thandle = getThreadHandleCreateIfNotExists(
-                ThreadEnum::GEOLOCATION_THREAD);
-        break;
-    case ThreadEnum::DEVICESTATUS_THREAD:
-        thandle = getThreadHandleCreateIfNotExists(
-                ThreadEnum::DEVICESTATUS_THREAD);
-        break;
-    case ThreadEnum::PROFILE_THREAD:
-        thandle = getThreadHandleCreateIfNotExists(type);
-        break;
-    case ThreadEnum::HAPTICS_THREAD:
-        thandle = getThreadHandleCreateIfNotExists(type);
-        break;
-    case ThreadEnum::ACCELEROMETER_THREAD:
-        thandle = getThreadHandleCreateIfNotExists(
-                ThreadEnum::ACCELEROMETER_THREAD);
-        break;
-    case ThreadEnum::ORIENTATION_THREAD:
-        thandle = getThreadHandleCreateIfNotExists(
-                ThreadEnum::ORIENTATION_THREAD);
-        break;
-    case ThreadEnum::TASK_THREAD:
-        thandle = getThreadHandleCreateIfNotExists(ThreadEnum::TASK_THREAD);
-        break;
-    case ThreadEnum::POWER_THREAD:
-        thandle = getThreadHandleCreateIfNotExists(ThreadEnum::POWER_THREAD);
-        break;
-    case ThreadEnum::PLUGIN_TEMPLETE_THREAD:
-        thandle = getThreadHandleCreateIfNotExists(
-                ThreadEnum::PLUGIN_TEMPLETE_THREAD);
-        break;
-    case ThreadEnum::BLUETOOTH_THREAD:
-        thandle = getThreadHandleCreateIfNotExists(ThreadEnum::BLUETOOTH_THREAD);
-        break;
-    case ThreadEnum::APPLICATION_THREAD:
-        thandle = getThreadHandleCreateIfNotExists(
-                ThreadEnum::APPLICATION_THREAD);
-        break;
-    case ThreadEnum::GYROSCOPE_THREAD:
-        thandle = getThreadHandleCreateIfNotExists(ThreadEnum::GYROSCOPE_THREAD);
-        break;
-    case ThreadEnum::CLOCK_THREAD:
-        thandle = getThreadHandleCreateIfNotExists(ThreadEnum::CLOCK_THREAD);
-        break;
-    case ThreadEnum::SYSTEMINFO_THREAD:
-        thandle = getThreadHandleCreateIfNotExists(
-                ThreadEnum::SYSTEMINFO_THREAD);
-        break;
-    case ThreadEnum::CALLHISTORY_THREAD:
-        thandle = getThreadHandleCreateIfNotExists(
-                ThreadEnum::CALLHISTORY_THREAD);
-        break;
-    case ThreadEnum::ACCOUNT_THREAD:
-        thandle = getThreadHandleCreateIfNotExists(
-                ThreadEnum::CALLHISTORY_THREAD);
-        break;
-    case ThreadEnum::NFC_THREAD:
-        thandle = getThreadHandleCreateIfNotExists(ThreadEnum::NFC_THREAD);
-        break;
-    case ThreadEnum::MEDIACONTENT_THREAD:
-        thandle = getThreadHandleCreateIfNotExists(
-                ThreadEnum::MEDIACONTENT_THREAD);
-        break;
-    case ThreadEnum::SE_THREAD:
-        thandle = getThreadHandleCreateIfNotExists(ThreadEnum::SE_THREAD);
-        break;
-    case ThreadEnum::DOWNLOAD_THREAD:
-        thandle = getThreadHandleCreateIfNotExists(ThreadEnum::DOWNLOAD_THREAD);
-        break;
-    case ThreadEnum::PUSH_THREAD:
-        thandle = getThreadHandleCreateIfNotExists(ThreadEnum::PUSH_THREAD);
-        break;
-    case ThreadEnum::SYNC_THREAD:
-        thandle = getThreadHandleCreateIfNotExists(ThreadEnum::SYNC_THREAD);
-        break;
-    // .....
-    default:
-        LogError("no case statement for ThreadEnum");
-        Throw(InvalidArgumentException);
-    }
-    return thandle;
-}
-}
-} // WrtDeviceApisCommon
diff --git a/src_wearable/Commons/ThreadPool.h b/src_wearable/Commons/ThreadPool.h
deleted file mode 100644 (file)
index 9d0bb57..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * 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.
- */
-/*
- * ControllersFactory.h
- *
- *  Created on: 2010-06-28
- *      Author: kmajewski
- */
-
-#ifndef WRTDEVICEAPIS_COMMONS_THREADPOOL_H_
-#define WRTDEVICEAPIS_COMMONS_THREADPOOL_H_
-
-#include <map>
-#include <dpl/thread.h>
-#include <dpl/event/main_event_dispatcher.h>
-#include <dpl/event/thread_event_dispatcher.h>
-#include <dpl/event/event_support.h>
-#include <dpl/mutex.h>
-
-namespace WrtDeviceApis {
-namespace Commons {
-class ThreadEnum
-{
-  private:
-    ThreadEnum()
-    {}
-
-  public:
-    enum Enumeration
-    {
-        NULL_THREAD = 0,
-        CAMERA_THREAD,
-        CALENDAR_THREAD,
-        TELEPHONY_THREAD,
-        APPLAUNCHER_THREAD,
-        MESSAGING_THREAD,
-        FILESYSTEM_THREAD,
-        UI_THREAD,
-        APPCONFIG_THREAD,
-        GALLERY_THREAD,
-        CONTACT_THREAD,
-        BONDI_THREAD,
-        GEOLOCATION_THREAD,
-        DEVICESTATUS_THREAD,
-        PROFILE_THREAD,
-        HAPTICS_THREAD,
-        ACCELEROMETER_THREAD,
-        ORIENTATION_THREAD,
-        TASK_THREAD,
-        POWER_THREAD,
-        PLUGIN_TEMPLETE_THREAD,
-        BLUETOOTH_THREAD,
-        APPLICATION_THREAD,
-        GYROSCOPE_THREAD,
-        CLOCK_THREAD,
-        SYSTEMINFO_THREAD,
-        CALLHISTORY_THREAD,
-        ACCOUNT_THREAD,
-        NFC_THREAD,
-        MEDIACONTENT_THREAD,
-        SE_THREAD,
-        DOWNLOAD_THREAD,
-        PUSH_THREAD,
-        SYNC_THREAD,
-        //....
-        size
-    };
-};
-
-class ThreadPool : private DPL::Noncopyable
-{
-  private:
-    typedef std::map<ThreadEnum::Enumeration, DPL::Thread*> ThreadHandleMap;
-    ThreadHandleMap m_threadHandlers;
-    DPL::Mutex m_threadHandlersMutex;
-
-    DPL::Thread *getThreadHandleCreateIfNotExists(ThreadEnum::Enumeration type);
-
-    //DPL::MainEventDispatcher m_mainEventDispatcher;
-
-    ThreadPool();
-
-  public:
-    ~ThreadPool();
-
-    /*
-     * @throws:  WrtDeviceApis::Commons::InvalidArgumentException
-     */
-    DPL::Thread * getThreadRef(ThreadEnum::Enumeration type);
-
-    /*
-     * Get proper dispatcher for current calling thread
-     */
-    DPL::Event::AbstractEventDispatcher *getDispatcher(
-        DPL::Event::ThreadEventDispatcher &callingThreadDispatcher);
-
-    static ThreadPool& getInstance();
-};
-}
-} // WrtDeviceApisCommon
-
-#endif // WRTDEVICEAPIS_COMMONS_THREADPOOL_H_
diff --git a/src_wearable/Commons/TimeUtils.cpp b/src_wearable/Commons/TimeUtils.cpp
deleted file mode 100644 (file)
index ce5cce8..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * 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   TimeUtils.h
- * @author Tae-Jeong Lee (taejeong.lee@samsung.com)
- */
-
-#include "TimeUtils.h"
-#include <unicode/ucal.h>
-
-namespace WrtDeviceApis {
-namespace Commons {
-namespace Time {
-struct tm* localtime_r(long long int* timep, struct tm* result)
-{
-    UErrorCode status = U_ZERO_ERROR;
-    UCalendar *cal;
-
-    if (!result || !timep) {
-        return NULL;
-    }
-
-    cal = ucal_open(NULL, 0, NULL, UCAL_DEFAULT, &status);
-
-    if (U_FAILURE(status)) {
-        return NULL;
-    }
-
-    ucal_setMillis(cal, (*timep * (double)1000.0), &status);
-
-    result->tm_sec = ucal_get(cal, UCAL_SECOND, &status);
-    result->tm_min = ucal_get(cal, UCAL_MINUTE, &status);
-    result->tm_hour = ucal_get(cal, UCAL_HOUR, &status);
-    result->tm_mday = ucal_get(cal, UCAL_DAY_OF_MONTH, &status);
-    result->tm_mon = ucal_get(cal, UCAL_MONTH, &status);
-    result->tm_year = ucal_get(cal, UCAL_YEAR, &status);
-    result->tm_wday = ucal_get(cal, UCAL_DAY_OF_WEEK, &status);
-    result->tm_yday = ucal_get(cal, UCAL_DAY_OF_YEAR, &status);
-    result->tm_isdst = ucal_get(cal, UCAL_DST_OFFSET, &status);
-
-    ucal_close(cal);
-
-    if (U_FAILURE(status)) {
-        return NULL;
-    } else {
-        return result;
-    }
-}
-}
-}
-}
diff --git a/src_wearable/Commons/TimeUtils.h b/src_wearable/Commons/TimeUtils.h
deleted file mode 100644 (file)
index de55e4c..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * 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   TimeUtils.h
- * @author Tae-Jeong Lee (taejeong.lee@samsung.com)
- */
-
-#ifndef WRTDEVICEAPIS_COMMONS_TIMEUTILS_H_
-#define WRTDEVICEAPIS_COMMONS_TIMEUTILS_H_
-
-#include <time.h>
-
-namespace WrtDeviceApis {
-namespace Commons {
-namespace Time {
-struct tm* localtime_r(long long int* timep, struct tm* result);
-}
-}
-}
-#endif
diff --git a/src_wearable/Commons/WrtAccess/WrtAccess.cpp b/src_wearable/Commons/WrtAccess/WrtAccess.cpp
deleted file mode 100644 (file)
index 782d701..0000000
+++ /dev/null
@@ -1,280 +0,0 @@
-/*
- * 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.
- */
-/*
- * @author      Grzegorz Krawczyk (g.krawczyk@samsung.com)
- * @version     0.1
- * @brief
- */
-
-#include <memory>
-#include <sstream>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/types.h>
-
-#include <dpl/log/log.h>
-#include <dpl/log/secure_log.h>
-#include <dpl/scoped_array.h>
-#include <dpl/scoped_resource.h>
-#include <dpl/assert.h>
-#include <Commons/Exception.h>
-#include "WrtAccess.h"
-#include <ace_api_client.h>
-#include <dpl/singleton_safe_impl.h>
-
-#include "popup-runner.h"
-IMPLEMENT_SAFE_SINGLETON(WrtDeviceApis::Commons::WrtAccess)
-
-namespace {
-/**
- * Helper class - single parameter and its value
- */
-struct AceParam
-{
-    const char *name;
-    const char *value;
-
-    AceParam() :
-        name(NULL), value(NULL)
-    {}
-
-    AceParam(const char *name, const char *value) :
-        name(name), value(value)
-    {}
-};
-
-/**
- * Helper class - list of params for single dev cap
- */
-struct AceParamList
-{
-    size_t count;
-    AceParam* param;
-    AceParamList() :
-        count(0),
-        param(NULL)
-    {}
-};
-
-struct DeviceCapParamPolicy
-{
-    typedef AceParamList* Type;
-    static Type NullValue()
-    {
-        return NULL;
-    }
-    static void Destroy(Type ptr)
-    {
-        if (ptr) {
-            delete[] ptr->param;
-        }
-        delete[] ptr;
-    }
-};
-
-/**
- * Helper class - modified ScopedArray for ace_param_list_t
- */
-class ScopedDeviceCapArray : public DPL::ScopedResource<DeviceCapParamPolicy>
-{
-  public:
-    explicit ScopedDeviceCapArray(AceParamList *ptr =
-                                      DeviceCapParamPolicy::NullValue()) :
-        DPL::ScopedResource<DeviceCapParamPolicy>(ptr)
-    {}
-
-    AceParamList & operator [](std::ptrdiff_t k) const
-    {
-        AssertMsg(this->m_value != DeviceCapParamPolicy::NullValue(),
-               "Dereference of scoped NULL array!");
-        AssertMsg(k >= 0, "Negative array index");
-
-        return this->m_value[k];
-    }
-};
-} // namespace
-
-namespace WrtDeviceApis {
-namespace Commons {
-WrtAccess::WrtAccess() :
-    m_sessionId(GenerateSessionId()),
-    m_pluginOwners(0)
-{}
-
-WrtAccess::~WrtAccess()
-{}
-
-WrtAccess::SessionId WrtAccess::GenerateSessionId()
-{
-    const size_t SESSION_ID_LENGTH = 32;
-
-    std::ostringstream pid;
-    pid << static_cast<int>(getpid());
-
-    std::string session_id = pid.str();
-
-    session_id.reserve(session_id.length() + SESSION_ID_LENGTH);
-
-    for (size_t i = 0; i < SESSION_ID_LENGTH; ++i) {
-        int c = random() % 16;
-
-        session_id += (c < 10 ?
-                       static_cast<char>('0' + c) :
-                       static_cast<char>('A' + c - 10));
-    }
-    return session_id;
-}
-
-void WrtAccess::initialize(int widgetId)
-{
-    _D("initialize");
-    if (widgetId < 0) {
-        _E("Invalid widget id");
-        Throw(Exception);
-    }
-
-    m_widgetId = widgetId;
-
-    if (!m_pluginOwners++) {
-        DPL::Log::LogSystemSingleton::Instance().SetTag("SECURITY_DAEMON");
-        ace_return_t ret = ace_client_initialize(Wrt::Popup::run_popup);
-        DPL::Log::LogSystemSingleton::Instance().SetTag("WRT_PLUGINS");
-        Assert(ACE_OK == ret);
-    }
-}
-
-void WrtAccess::deinitialize(int /*widgetId*/)
-{
-    _D("deinitialize");
-
-    if (!--m_pluginOwners) {
-        DPL::Log::LogSystemSingleton::Instance().SetTag("SECURITY_DAEMON");
-        ace_return_t ret = ace_client_shutdown();
-        DPL::Log::LogSystemSingleton::Instance().SetTag("WRT_PLUGINS");
-        Assert(ACE_OK == ret);
-    }
-}
-
-int WrtAccess::getWidgetId() const
-{
-    return m_widgetId;
-}
-
-WrtAccess::CheckAccessReturnType WrtAccess::checkAccessControl(const AceFunction& aceFunction) const
-{
-    AssertMsg(
-        m_pluginOwners, "WrtAccessSingleton needs to be initialized with"
-                        "WidgetId during on_widget_start_callback in each plugin");
-    size_t deviceCount = aceFunction.deviceCapabilities.size();
-
-    DPL::ScopedArray <const char *> deviceScopedArray;
-    ScopedDeviceCapArray paramsScopedArray;
-
-    if (deviceCount) {
-        deviceScopedArray.Reset(new const char*[deviceCount]);
-        paramsScopedArray.Reset(new AceParamList[deviceCount]);
-
-        for (size_t i = 0; i < deviceCount; ++i) {
-            deviceScopedArray[i] =
-                aceFunction.deviceCapabilities.at(i).devCapName.c_str();
-            paramsScopedArray[i].count =
-                aceFunction.deviceCapabilities.at(i).devCapParams.size();
-
-            paramsScopedArray[i].param =
-                new AceParam[paramsScopedArray[i].count];
-
-            for (size_t j = 0; j < paramsScopedArray[i].count; ++j) {
-                paramsScopedArray[i].param[j].name =
-                    aceFunction.deviceCapabilities.at(i).
-                        devCapParams[j].name.c_str();
-                paramsScopedArray[i].param[j].value =
-                    aceFunction.deviceCapabilities.at(i).
-                        devCapParams[j].value.c_str();
-            }
-        }
-    }
-
-    size_t featuresCount = aceFunction.features.size();
-
-    DPL::ScopedArray <const char*> featureScopedArray;
-    if (featuresCount) {
-        featureScopedArray.Reset(new const char*[featuresCount]);
-
-        for (size_t i = 0; i < featuresCount; ++i) {
-            featureScopedArray[i] =
-                aceFunction.features.at(i).name.c_str();
-        }
-    }
-
-    _D("constructing ACE request");
-
-    ace_request_t aceRequest;
-    aceRequest.session_id =
-        const_cast<const ace_session_id_t>(m_sessionId.c_str());
-    aceRequest.widget_handle = getWidgetId();
-    aceRequest.feature_list.count = featuresCount;
-    aceRequest.feature_list.items =
-        const_cast<ace_string_t*>(featureScopedArray.Get());
-    aceRequest.dev_cap_list.count = deviceCount;
-    aceRequest.dev_cap_list.items = new ace_dev_cap_t[deviceCount];
-
-    const char**  devCapNames = deviceScopedArray.Get();
-    AceParamList* paramList = paramsScopedArray.Get();
-
-    unsigned int i;
-    for (i = 0; i < deviceCount; ++i) {
-        aceRequest.dev_cap_list.items[i].name =
-            const_cast<const ace_string_t>(devCapNames[i]);
-        aceRequest.dev_cap_list.items[i].param_list.count = paramList[i].count;
-        aceRequest.dev_cap_list.items[i].param_list.items =
-            new ace_param_t[paramList[i].count];
-        unsigned int j;
-        for (j = 0; j < paramList[i].count; ++j) {
-            aceRequest.dev_cap_list.items[i].param_list.items[j].name =
-                const_cast<ace_string_t>(paramList[i].param[j].name);
-            aceRequest.dev_cap_list.items[i].param_list.items[j].value =
-                const_cast<ace_string_t>(paramList[i].param[j].value);
-        }
-    }
-
-    ace_check_result_t aceCheckResult = ACE_PRIVILEGE_DENIED;
-    DPL::Log::LogSystemSingleton::Instance().SetTag("SECURITY_DAEMON");
-    ace_return_t ret = ace_check_access_ex(&aceRequest, &aceCheckResult);
-    DPL::Log::LogSystemSingleton::Instance().SetTag("WRT_PLUGINS");
-    for (i = 0; i < deviceCount; ++i) {
-        delete[] aceRequest.dev_cap_list.items[i].param_list.items;
-    }
-    delete[] aceRequest.dev_cap_list.items;
-
-    if (ACE_OK != ret) {
-        _E("Error in ace check: %d", static_cast<int>(ret));
-        return CHECK_ACCESS_INTERNAL_ERROR;
-    }
-
-    if (aceCheckResult == ACE_ACCESS_GRANTED) {
-        return CHECK_ACCESS_GRANTED;
-    }
-    else if (aceCheckResult == ACE_PRIVILEGE_DENIED) {
-        return CHECK_ACCESS_PRIVILEGE_DENIED;
-    }
-    else if (aceCheckResult == ACE_PRIVACY_DENIED) {
-        return CHECK_ACCESS_PRIVACY_DENIED;
-    }
-
-    return CHECK_ACCESS_INTERNAL_ERROR;
-}
-}
-} // WrtDeviceApisCommon
diff --git a/src_wearable/CommonsJavaScript/Converter.h b/src_wearable/CommonsJavaScript/Converter.h
deleted file mode 100644 (file)
index ff196b6..0000000
+++ /dev/null
@@ -1,585 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRTDEVICEAPIS_COMMONSJAVASCRIPT_CONVERTER_H_
-#define WRTDEVICEAPIS_COMMONSJAVASCRIPT_CONVERTER_H_
-
-#include <ctime>
-#include <cstddef>
-#include <string>
-#include <vector>
-#include <list>
-#include <JavaScriptCore/JavaScript.h>
-#include <dpl/noncopyable.h>
-#include <dpl/shared_ptr.h>
-#include <Commons/Exception.h>
-#include <Commons/StaticAssert.h>
-
-namespace WrtDeviceApis {
-namespace CommonsJavaScript {
-class Converter : private DPL::Noncopyable
-{
-  public:
-    explicit Converter(JSContextRef context);
-    virtual ~Converter();
-
-    /**
-     * Converts JSValueRef to JSObjectRef.
-     * @param arg JSValueRef object to convert.
-     * @return JSObjectRef object.
-     * @throw ConversionException Thrown when conversion fails.
-     */
-    JSObjectRef toJSObjectRef(const JSValueRef& arg);
-
-    /**
-     * Converts JSValueRef object to boolean value.
-     * @param arg JSValueRef object to convert.
-     * @return Boolean value.
-     * @throw ConversionException Thrown when conversion fails.
-     */
-    bool toBool(const JSValueRef& arg);
-
-    /**
-     * Converts JSValueRef object to unsigned char value.
-     * @param arg JSValueRef object to convert.
-     * @return Unsigned char value.
-     * @throw ConversionException Thrown when conversion fails.
-     */
-    unsigned char toUChar(const JSValueRef& arg);
-
-    /**
-     * Converts JSValueRef object to char value.
-     * @param arg JSValueRef object to convert.
-     * @return Char value.
-     * @throw ConversionException Thrown when conversion fails.
-     */
-    char toChar(const JSValueRef& arg);
-
-    /**
-     * Converts JSValueRef to integer value.
-     * @param arg JSValueRef object to convert.
-     * @return Integer value.
-     * @throw ConversionException Thrown when conversion fails.
-     */
-    int toInt(const JSValueRef& arg);
-
-    /**
-     * Converts string to integer value.
-     * @param arg string to convert.
-     * @return Integer value.
-     * @throw ConversionException Thrown when conversion fails.
-     */
-    int toInt(const std::string& arg);
-
-    /**
-     * Converts JSvalueRef to long integer value.
-     * @param arg JSValueRef object to convert.
-     * @return Long integer value.
-     * @throw ConversionException Thrown when conversion fails.
-     */
-    long toLong(const JSValueRef& arg);
-
-    /**
-     * Converts JSvalueRef to long long integer value.
-     * @param arg JSValueRef object to convert.
-     * @return Long long integer value.
-     * @throw ConversionException Thrown when conversion fails.
-     */
-    long long toLongLong(const JSValueRef& arg);
-    /**
-     * Converts JSValueRef to unsigned long value.
-     * @param arg JSValueRef object to convert.
-     * @return Unsigned long value.
-     * @throw ConversionException Thrown when conversion fails.
-     */
-    unsigned long toULong(const JSValueRef& arg);
-
-    /**
-     * Converts JSValueRef to double value.
-     * @param arg JSValueRef object to convert.
-     * @return Double value.
-     * @throw ConversionException Thrown when conversion fails.
-     */
-    double toDouble(const JSValueRef& arg);
-
-    /**
-     * Converts JSValueRef to size_t value.
-     * @param arg JSValueRef object to convert.
-     * @return Size_t value.
-     * @throw ConversionException Thrown when conversion fails.
-     */
-    std::size_t toSizeT(const JSValueRef& arg);
-
-    /**
-     * Converts JSStringRef to size_t value.
-     * @param arg JSStringRef object to convert.
-     * @return Size_t value.
-     * @throw ConversionException Thrown when conversion fails.
-     */
-    std::size_t toSizeT(const JSStringRef& arg);
-
-    /**
-     * Converts int to STL string.
-     * @param arg int to convert.
-     * @return STL string.
-     * @throw ConversionException Thrown when conversion fails.
-     */
-    std::string toString(int arg);
-
-    std::string toString(unsigned long arg);
-
-    std::string toString(long arg);
-
-    std::string toString(std::size_t arg);
-
-    /**
-     * Converts JSValueRef to STL string.
-     * @param arg JSValueRef to convert.
-     * @return STL string.
-     * @throw ConversionException Thrown when conversion fails.
-     * @remarks If one wants to convert JS Date object to a string then
-     *          toDateString() should be used.
-     */
-    std::string toString(const JSValueRef& arg);
-
-    /**
-     * Converts JSStringRef to STL string.
-     * @param arg JSStringRef to convert.
-     * @return STL string.
-     * @throw ConversionException Thrown when conversion fails.
-     */
-    std::string toString(const JSStringRef& arg);
-
-    /**
-     * Converts JSSValueRef to STL string if
-     * arg is one of: String, Number, Bool
-     * @param arg JSValueReg to convert.
-     * @return STL string.
-     * @throw ConversionException Thrown when conversion fails.
-     */
-    std::string tryString(const JSValueRef& arg);
-
-    /**
-     * Converts JS Date object to STL string.
-     * @param arg JS Date object to convert.
-     * @return STL string.
-     * @throw ConversionException Thrown when conversion fails.
-     */
-    std::string toDateString(const JSValueRef& arg);
-
-    /**
-     * Converts JSValueRef to time_t value.
-     * @param arg JSValueRef to convert.
-     * @return time_t value.
-     * @throw ConversionException Thrown when conversion fails.
-     */
-    time_t toDateTimeT(const JSValueRef& arg);
-
-    /**
-     * Converts JSValueRef to tm struct.
-     * @param arg JSValueRef to convert.
-     * @return tm struct.
-     * @throw ConversionException Thrown when conversion fails.
-     */
-    tm toDateTm(const JSValueRef& arg);
-
-    /**
-     * Converts JSValueRef to vector<unsigned char>.
-     * @param arg JSValueRef to convert.
-     * @return vector<unsigned char>.
-     * @throw ConversionException Thrown when conversion fails.
-     */
-    std::vector<unsigned char> toVectorOfUChars(const JSValueRef& arg);
-
-    /**
-     * Converts JSValueRef to vector<char>.
-     * @param arg JSValueRef to convert.
-     * @return vector<char>.
-     * @throw ConversionException Thrown when conversion fails.
-     */
-    std::vector<char> toVectorOfChars(const JSValueRef& arg);
-
-    /**
-     * Converts JSValueRef to vector<int>.
-     * @param arg JSValueRef to convert.
-     * @return vector<int>.
-     * @throw ConversionException Thrown when conversion fails.
-     */
-    std::vector<int> toVectorOfInts(const JSValueRef& arg);
-
-    /**
-     * Converts JSValueRef to vector of string.
-     * @param arg JSValueRef to convert.
-     * @return std::vector<std::string>
-     * @throw ConversionException Thrown when conversion fails.
-     */
-    std::vector<std::string> toVectorOfStrings(const JSValueRef& arg);
-
-    /**
-     * Converts JSValueRef to vector of time_t.
-     * @param arg JSValueRef to convert.
-     * @return std::vector<std::time_t>
-     * @throw ConversionException Thrown when conversion fails.
-     */
-    std::vector<std::time_t> toVectorOfTimeT(const JSValueRef& arg);
-
-    /**
-     * Converts boolean value to JSValueRef.
-     * @param arg Boolean value to convert.
-     * @return JSValueRef object.
-     * @throw ConversionException Thrown when conversion fails.
-     */
-    JSValueRef toJSValueRef(bool arg);
-
-    /**
-     * Converts integer value to JSValueRef.
-     * @param arg Integer value to convert.
-     * @return JSValueRef object.
-     * @throw ConversionException Thrown when conversion fails.
-     */
-    JSValueRef toJSValueRef(int arg);
-
-    /**
-     * Converts unsigned integer value to JSValueRef.
-     * @param arg Unsigned integer value to convert.
-     * @return JSValueRef object.
-     * @throw ConversionException Thrown when conversion fails.
-     */
-    JSValueRef toJSValueRef(unsigned int arg);
-
-    /**
-     * Converts double value to JSValueRef.
-     * @param arg Double value to convert.
-     * @return JSValueRef object.
-     * @throw ConversionException Thrown when conversion fails.
-     */
-    JSValueRef toJSValueRef(double arg);
-
-    /**
-     * Converts unsigned long value to JSValueRef.
-     * @param arg unsigned long value to convert.
-     * @return JSValueRef object.
-     * @throw ConversionException Thrown when conversion fails.
-     */
-    JSValueRef toJSValueRef(unsigned long arg);
-
-    /**
-     * Converts long value to JSValueRef.
-     * @param arg long value to convert.
-     * @return JSValueRef object.
-     * @throw ConversionException Thrown when conversion fails.
-     */
-    JSValueRef toJSValueRefLong(const long arg);
-
-    /**
-     * Converts unsigned long value to JSValueRef.
-     * @param arg long long int value to convert.
-     * @return JSValueRef object.
-     * @throw ConversionException Thrown when conversion fails.
-     */
-    JSValueRef toJSValueRef(long long int arg);
-
-    /**
-     * Converts STL string to JSValueRef.
-     * @param arg STL string to convert.
-     * @return JSValueRef object.
-     * @throw ConversionException Thrown when conversion fails.
-     */
-    JSValueRef toJSValueRef(const std::string& arg);
-
-    /**
-     * Converts char sequence to JSValueRef.
-     * @param arg char sequence to convert.
-     * @return JSValueRef object.
-     * @throw ConversionException Thrown when conversion fails.
-     */
-    JSValueRef toJSValueRef(const char* arg);
-
-    /**
-     * Converts time_t value to JSValueRef.
-     * @param arg time_t value to convert.
-     * @return JSValueRef object.
-     * @throw ConversionException Thrown when conversion fails.
-     */
-    JSValueRef toJSValueRef(const time_t arg);
-
-    /**
-     * Converts tm struct to JSValueRef.
-     * @param arg tm struct to convert.
-     * @return JSValueRef object.
-     * @throw ConversionException Thrown when conversion fails.
-     */
-    JSValueRef toJSValueRef(const tm& arg);
-
-    /**
-     * Converts STL vector of integer to JSValueRef.
-     * @param arg STL vector of integer to convert.
-     * @return JSValueRef object.
-     * @throw ConversionException Thrown when conversion fails.
-     */
-    JSValueRef toJSValueRef(const std::vector<int>& arg);
-
-    /**
-     * Converts STL vector of time_t to JSValueRef.
-     * @param arg STL vector of time_t to convert.
-     * @return JSValueRef object.
-     * @throw ConversionException Thrown when conversion fails.
-     */
-    JSValueRef toJSValueRef(const std::vector<time_t>& arg);
-
-    /**
-     * Converts STL vector of string to JSStringRef.
-     * @param arg STL string to convert.
-     * @return JSValueRef object.
-     * @throw ConversionException Thrown when conversion fails.
-     */
-    JSValueRef toJSValueRef(const std::vector<std::string>& arg);
-
-    /**
-     * Converts JSValueRef to JSValueRef
-     * @param JSValueRef js value which is returned
-     * @return JSValueRef - parameter
-     * @throw ConversionException Thrown when conversion fails.
-     */
-    JSValueRef toJSValueRef(JSValueRef arg);
-
-    /**
-     * Converts std::vector to JSValueRef
-     * @param arg vecotr of JSValueRefs
-     * @return JSValueRef - js array
-     * @throw ConversionException Thrown when conversion fails.
-     */
-    JSValueRef toJSValueRef(const std::vector<JSValueRef>& arg);
-
-    /**
-     * Template specialization to catch errors caused
-     * by wrong usage of general template or
-     * implicit conversions from SharedPtr to
-     * specialized type
-     * */
-    template<class Class>
-    JSValueRef toJSValueRef(const DPL::SharedPtr<Class>& c)
-    {
-        STATIC_ERROR(ERROR_INVALID_IMPLICIT_CONVERSION, c)
-        //above macro causes compilation error
-        return static_cast<JSValueRef>(NULL);
-    }
-
-    /**
-     * Converts STL string to JSStringRef.
-     * @param arg STL string to convert.
-     * @return JSStringRef object.
-     * @throw ConversionException Thrown when conversion fails.
-     */
-    JSStringRef toJSStringRef(const std::string& arg);
-
-  protected:
-    bool isNan(double value) const;
-
-    double toNumber_(const JSValueRef& arg);
-
-    double toNumber_(const JSStringRef& arg);
-
-    double toNumber_(const std::string& arg);
-
-    template<typename T, class Derived>
-    std::vector<T> toVectorOfT_(const JSValueRef& arg,
-                                T (Derived::*f)(const JSValueRef &),
-                                Derived* object)
-    {
-        if (JSValueIsNull(m_context,
-                          arg) || JSValueIsUndefined(m_context, arg))
-        {
-            return std::vector<T>();
-        }
-
-        if (!JSIsArrayValue(m_context, arg)) {
-            ThrowMsg(Commons::ConversionException,
-                     "Argument is not an JS array.");
-        }
-
-        std::vector<T> result;
-        JSObjectRef objArg = toJSObjectRef(arg);
-        for (std::size_t i = 0; i < JSGetArrayLength(m_context, objArg); ++i) {
-            JSValueRef element = JSGetArrayElement(m_context, objArg, i);
-            result.push_back((object->*f)(element));
-        }
-        return result;
-    }
-
-    template<typename T>
-    std::vector<T> toVectorOfT_(const JSValueRef& arg,
-                                T (Converter::*f)(const JSValueRef &))
-    {
-        if (JSValueIsNull(m_context,
-                          arg) || JSValueIsUndefined(m_context, arg))
-        {
-            return std::vector<T>();
-        }
-
-        if (!JSIsArrayValue(m_context, arg)) {
-            ThrowMsg(Commons::ConversionException,
-                     "Argument is not an JS array.");
-        }
-
-        std::vector<T> result;
-        JSObjectRef objArg = toJSObjectRef(arg);
-        for (std::size_t i = 0; i < JSGetArrayLength(m_context, objArg); ++i) {
-            JSValueRef element = JSGetArrayElement(m_context, objArg, i);
-            result.push_back((this->*f)(element));
-        }
-        return result;
-    }
-
-    template<class T, class Derived>
-    JSValueRef toJSValueRef_(const std::vector<T>& arg,
-                             JSValueRef (Derived::*f)(const T &),
-                             Derived* object)
-    {
-        JSObjectRef jsResult = JSCreateArrayObject(m_context, 0, NULL);
-
-        if (NULL == jsResult) {
-            ThrowMsg(WrtDeviceApis::Commons::NullPointerException,
-                     "Could not create js array object");
-        }
-
-        for (std::size_t i = 0; i < arg.size(); ++i) {
-            JSValueRef tmpVal = (object->*f)(arg[i]);
-            if (!JSSetArrayElement(m_context, jsResult, i, tmpVal)) {
-                ThrowMsg(WrtDeviceApis::Commons::UnknownException,
-                         "Could not insert value into js array");
-            }
-        }
-
-        return jsResult;
-    }
-
-    template<class T>
-    JSValueRef toJSValueRef_(const std::vector<T>& arg)
-    {
-        JSObjectRef jsResult = JSCreateArrayObject(m_context, 0, NULL);
-
-        if (NULL == jsResult) {
-            ThrowMsg(WrtDeviceApis::Commons::NullPointerException,
-                     "Could not create js array object");
-        }
-
-        for (std::size_t i = 0; i < arg.size(); ++i) {
-            JSValueRef tmpVal = toJSValueRef(arg[i]);
-            if (!JSSetArrayElement(m_context, jsResult, i, tmpVal)) {
-                ThrowMsg(WrtDeviceApis::Commons::UnknownException,
-                         "Could not insert value into js array");
-            }
-        }
-
-        return jsResult;
-    }
-
-    template<class T>
-    JSValueRef toJSValueRef_(const std::list<T>& arg)
-    {
-        JSObjectRef jsResult = JSCreateArrayObject(m_context, 0, NULL);
-
-        if (NULL == jsResult) {
-            ThrowMsg(WrtDeviceApis::Commons::NullPointerException,
-                     "Could not create js array object");
-        }
-
-        typename std::list<T>::const_iterator it = arg.begin();
-        for (std::size_t i = 0; it != arg.end(); ++i, ++it) {
-            JSValueRef tmpVal = toJSValueRef(*it);
-            if (!JSSetArrayElement(m_context, jsResult, i, tmpVal)) {
-                ThrowMsg(WrtDeviceApis::Commons::UnknownException,
-                         "Could not insert value into js array");
-            }
-        }
-
-        return jsResult;
-    }
-
-    template<class T, class Derived>
-    JSValueRef toJSValueRef_(const std::list<T>& arg,
-                             JSValueRef (Derived::*f)(const T &),
-                             Derived* object)
-    {
-        JSObjectRef jsResult = JSCreateArrayObject(m_context, 0, NULL);
-
-        if (NULL == jsResult) {
-            ThrowMsg(WrtDeviceApis::Commons::NullPointerException,
-                     "Could not create js array object");
-        }
-
-        typename std::list<T>::const_iterator it = arg.begin();
-        for (std::size_t i = 0; it != arg.end(); ++i, ++it) {
-            JSValueRef tmpVal = (object->*f)(*it);
-            if (!JSSetArrayElement(m_context, jsResult, i, tmpVal)) {
-                ThrowMsg(WrtDeviceApis::Commons::UnknownException,
-                         "Could not insert value into js array");
-            }
-        }
-
-        return jsResult;
-    }
-
-    std::string toString_(const JSValueRef& arg);
-
-    template<typename T>
-    std::string toString_(const T& arg)
-    {
-        std::stringstream ss;
-        if (!(ss << arg)) {
-            ThrowMsg(WrtDeviceApis::Commons::ConversionException,
-                     "Could not convert to string.");
-        }
-        return ss.str();
-    }
-
-  protected:
-    JSContextRef m_context;
-};
-
-template<class C>
-class ConverterFactory : private DPL::Noncopyable
-{
-  public:
-    /**
-     * Converter type which deletes itself when gets out of scope.
-     */
-    typedef DPL::SharedPtr<C> ConverterType;
-
-  public:
-    /**
-     * Gets converter object.
-     * @param context JavaScript context the conversion will be performed in.
-     * @param[out] exception JavaScript value for storing exception.
-     * @return Converter object.
-     */
-    static ConverterType getConverter(JSContextRef context)
-    {
-        C* convert = new C(context);
-        return ConverterType(convert);
-    }
-
-  private:
-    ConverterFactory();
-};
-
-typedef ConverterFactory<Converter> BasicConverterFactory;
-
-typedef BasicConverterFactory::ConverterType BasicConverter;
-} // CommonsJavaScript
-} // WrtDeviceApis
-
-#endif /* WRTDEVICEAPIS_COMMONSJAVASCRIPT_CONVERTER_H_ */
diff --git a/src_wearable/CommonsJavaScript/JSPendingOperation.cpp b/src_wearable/CommonsJavaScript/JSPendingOperation.cpp
deleted file mode 100644 (file)
index 1891361..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * 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        JSPendingOperation.cpp
- * @author      Pete Cole (peter.cole@partner.samsung.com)
- * @version     0.1
- *              0.2 k.majewski@samsung.com
- * @brief       Implementation of the JSPendingOperation class
- */
-
-#include <dpl/shared_ptr.h>
-#include <Commons/IEvent.h>
-#include "JSPendingOperation.h"
-#include "JSPendingOperationPrivateObject.h"
-
-namespace WrtDeviceApis {
-namespace CommonsJavaScript {
-namespace {
-const char* PLUGIN_NAME = "PendingOperation";
-}
-
-JSClassRef JSPendingOperation::m_classRef = NULL;
-
-JSClassDefinition JSPendingOperation::m_classInfo = {
-    0,
-    kJSClassAttributeNone,
-    PLUGIN_NAME,
-    0,
-    NULL,
-    m_functions,
-    initialize,
-    finalize,
-    NULL, //hasProperty,
-    NULL, //GetProperty,
-    NULL, //SetProperty,
-    NULL, //DeleteProperty,
-    NULL, //getPropertyNames,
-    NULL,
-    NULL,
-    NULL,
-    NULL, //ConvertToType,
-};
-
-JSStaticFunction JSPendingOperation::m_functions[] = {
-    { "cancel", cancel, kJSPropertyAttributeNone },
-    { 0, 0, 0 }
-};
-
-JSClassRef JSPendingOperation::getClassRef()
-{
-    if (!m_classRef) {
-        m_classRef = JSClassCreate(&m_classInfo);
-    }
-    return m_classRef;
-}
-
-void JSPendingOperation::initialize(JSContextRef /*context*/,
-                                    JSObjectRef object)
-{
-    assert(NULL != JSObjectGetPrivate(object));
-}
-
-void JSPendingOperation::finalize(JSObjectRef object)
-{
-    delete static_cast<IJSPendingOperationPrivateObject *>(
-        JSObjectGetPrivate(object));
-}
-
-JSValueRef JSPendingOperation::cancel(JSContextRef context,
-                                      JSObjectRef object,
-                                      JSObjectRef thisObject,
-                                      size_t argumentCount,
-                                      const JSValueRef arguments[],
-                                      JSValueRef* exception)
-{
-    (void) object;
-    (void) argumentCount;
-    (void) arguments;
-    (void) exception;
-    LogDebug(__FUNCTION__);
-    IJSPendingOperationPrivateObject *priv =
-        static_cast<IJSPendingOperationPrivateObject *>(
-            JSObjectGetPrivate(thisObject));
-    assert(NULL != priv);
-    bool cancelResult = priv->cancel();
-    LogDebug("cancel result : " << cancelResult);
-    return JSValueMakeBoolean(context, cancelResult);
-}
-} // CommonsJavaScript
-} // WrtDeviceApis
-
diff --git a/src_wearable/CommonsJavaScript/JSPendingOperation.h b/src_wearable/CommonsJavaScript/JSPendingOperation.h
deleted file mode 100644 (file)
index 1a67d89..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * 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        JSPendingOperation.h
- * @author      Pete Cole (peter.cole@partner.samsung.com)
- * @version     0.1
- *              0.2 k.majewski@samsung.com
- * @brief       Declaration of the JSPendingOperation class
- */
-
-#ifndef WRTDEVICEAPIS_COMMONSJAVASCRIPT_JS_PENDINGOPERATION_H_
-#define WRTDEVICEAPIS_COMMONSJAVASCRIPT_JS_PENDINGOPERATION_H_
-
-#include <JavaScriptCore/JavaScript.h>
-#include <dpl/shared_ptr.h>
-#include <Commons/IEvent.h>
-#include <CommonsJavaScript/PrivateObject.h>
-#include <CommonsJavaScript/JSPendingOperationPrivateObject.h>
-
-namespace WrtDeviceApis {
-namespace CommonsJavaScript {
-//typedef Commons::PrivateObjectT<IJSPendingOperationPrivateObject*>::Type
-// PendingOperationPrivateObject;
-
-class JSPendingOperation
-{
-  public:
-    /*
-     * This initializes this JS class in the JS Engine.
-     */
-    static 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 contains properties and callbacks that define a type of
-     * object.
-     */
-    static JSClassDefinition m_classInfo;
-
-    /**
-     * This structure describes a statically declared function property.
-     */
-    static JSStaticFunction m_functions[];
-
-    static JSClassRef m_classRef;
-
-    /**
-     * Cancel the pending operation, if it has yet not completed.
-     */
-    static JSValueRef cancel(JSContextRef context,
-                             JSObjectRef object,
-                             JSObjectRef thisObject,
-                             size_t argumentCount,
-                             const JSValueRef arguments[],
-                             JSValueRef* exception);
-};
-} // CommonsJavaScript
-} // WrtDeviceApis
-
-#endif // _JS_WAC_PENDINGOPERATION_H_
-
diff --git a/src_wearable/CommonsJavaScript/JSPendingOperationPrivateObject.h b/src_wearable/CommonsJavaScript/JSPendingOperationPrivateObject.h
deleted file mode 100644 (file)
index 3c9b43d..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * 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.
- */
-/*
- * @author      Karol Majewski (k.majewski@samsung.com)
- * @version     0.1
- * @brief
- */
-
-#ifndef WRTDEVICEAPIS_COMMONSJAVASCRIPT_JS_PENDING_OPERATION_PRIVATE_OBJECT_H_
-#define WRTDEVICEAPIS_COMMONSJAVASCRIPT_JS_PENDING_OPERATION_PRIVATE_OBJECT_H_
-
-#include <cassert>
-#include <dpl/log/log.h>
-#include <dpl/shared_ptr.h>
-#include <Commons/EventReceiver.h>
-#include <Commons/IExternEventCanceler.h>
-#include <Commons/IEvent.h>
-
-namespace WrtDeviceApis {
-namespace CommonsJavaScript {
-class IJSPendingOperationPrivateObject
-{
-  public:
-    explicit IJSPendingOperationPrivateObject(
-        const DPL::SharedPtr<Commons::IEventController>
-        &event) :
-        m_event(event)
-    {
-        assert(NULL != m_event.Get());
-    }
-
-    virtual bool cancel()
-    {
-        LogDebug("PendingOperation tries to cancel the request");
-        return m_event->cancelRequest();
-    }
-
-    virtual ~IJSPendingOperationPrivateObject()
-    {}
-
-  protected:
-    DPL::SharedPtr<Commons::IEventController> m_event;
-};
-
-/*
- * This class implements private object for JavaScript PendingOperation
- * with support to external cancel function.
- *
- * When the cancel() method is invoked on PendingOperation,
- * the OnCancelEvent(<EventType>) method is invoked on user object
- * with apropriate * arguments.
- * It allows user to perform an additional action when PendingOperation
- * is destroyed.
- *
- * The Object which want to handle OnCancelEvent have to inherit from
- * Platform::IExternEventCanceler<EventType>.
- *
- * The cancel's handler have to be passed as second argument
- * */
-template<class TemplateEvent>
-class IJSExtCancelPendingOperationPrivateObject :
-    public IJSPendingOperationPrivateObject
-{
-  public:
-    IJSExtCancelPendingOperationPrivateObject(
-        const DPL::SharedPtr< TemplateEvent> &event,
-        const DPL::SharedPtr<
-            Commons::IExternEventCanceler<TemplateEvent> > & cancel) :
-        IJSPendingOperationPrivateObject(
-            DPL::StaticPointerCast<Commons::IEventController>(event)),
-        m_canceler(cancel)
-    {
-        assert(NULL != m_canceler);
-    }
-
-    virtual bool cancel()
-    {
-        bool result = IJSPendingOperationPrivateObject::cancel();
-        if (!result) {
-            LogDebug("Controller can not cancel event, trying platform cancel");
-        } else {
-            return result;
-        }
-
-        if (m_canceler) {
-            LogDebug("Calling extern cancel");
-            m_canceler->OnCancelEvent(
-                DPL::StaticPointerCast<TemplateEvent>(m_event));
-        }
-
-        return result;
-    }
-
-    virtual ~IJSExtCancelPendingOperationPrivateObject()
-    {}
-
-  protected:
-    DPL::SharedPtr< Commons::IExternEventCanceler<TemplateEvent> > m_canceler;
-};
-}
-}
-#endif /* _JS_WAC_PENDING_OPERATION_PRIVATE_OBJECT_H_ */
diff --git a/src_wearable/CommonsJavaScript/PrivateObject.h b/src_wearable/CommonsJavaScript/PrivateObject.h
deleted file mode 100644 (file)
index 8bd816a..0000000
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRTDEVICEAPIS_COMMONSJAVASCRIPT_PRIVATEOBJECT_H_
-#define WRTDEVICEAPIS_COMMONSJAVASCRIPT_PRIVATEOBJECT_H_
-
-#include <JavaScriptCore/JavaScript.h>
-#include <dpl/noncopyable.h>
-#include <dpl/assert.h>
-#include <Commons/Exception.h>
-#include <Commons/TypeTraits.h>
-
-namespace WrtDeviceApis {
-namespace CommonsJavaScript {
-template<class T>
-struct NoAcquire
-{
-    void acquire(T*)
-    {}
-
-  protected:
-    ~NoAcquire()
-    {}
-};
-
-template<class T>
-struct AcquireByProtect
-{
-    void acquire(T* object)
-    {
-        Assert(object && "Object passed to protect can't be NULL.");
-        JSValueProtect(object->getContext(), object->getObject());
-    }
-
-  protected:
-    ~AcquireByProtect()
-    {}
-};
-
-template<class T>
-struct NoRelease
-{
-    void release(T* object)
-    {
-        (void)object;
-    }
-
-  protected:
-    ~NoRelease()
-    {}
-};
-
-template<class T>
-struct ReleaseByDelete
-{
-    void release(T* object)
-    {
-        delete object->getObject();
-    }
-
-  protected:
-    ~ReleaseByDelete()
-    {}
-};
-
-template<class T>
-struct ReleaseByUnprotect
-{
-    void release(T* object)
-    {
-        Assert(object && "Object passed to unprotect can't be NULL.");
-        JSValueUnprotect(object->getContext(), object->getObject());
-    }
-
-  protected:
-    ~ReleaseByUnprotect()
-    {}
-};
-
-template<class T>
-struct NoOwnership : protected NoAcquire<T>,
-    protected NoRelease<T>
-{
-  protected:
-    ~NoOwnership()
-    {}
-};
-
-template<class T>
-struct OwnershipByAcquisition : protected NoAcquire<T>,
-    protected ReleaseByDelete<T>
-{
-  protected:
-    ~OwnershipByAcquisition()
-    {}
-};
-
-template<class T>
-struct OwnershipByProtection : protected AcquireByProtect<T>,
-    protected ReleaseByUnprotect<T>
-{
-  protected:
-    ~OwnershipByProtection()
-    {}
-};
-
-template<class PrivateClass,
-         template <class> class OwnershipPolicy = OwnershipByAcquisition>
-class PrivateObject : public DPL::Noncopyable,
-    protected OwnershipPolicy<PrivateObject<PrivateClass, OwnershipPolicy> >
-{
-  public:
-    typedef PrivateClass ObjectType;
-
-  public:
-    /**
-     * Creates storage object for JS private data.
-     * @param context JS (root/global) context.
-     * @param object Object to store.
-     * @throw NullPointerException When object is pointer and is set to NULL.
-     */
-    PrivateObject(JSContextRef context,
-                  const PrivateClass& object) :
-        m_context(context),
-        m_object(object)
-    {
-        Assert(NULL != m_context && "Context is NULL.");
-        Assert(!Commons::IsNull<PrivateClass>::value(
-                   object) && "Object is NULL.");
-        this->acquire(this);
-    }
-
-    /**
-     * Destroys instance of the object.
-     */
-    virtual ~PrivateObject()
-    {
-        this->release(this);
-    }
-
-    /**
-     * Gets stored JS context.
-     * @return JavaScript context.
-     */
-    virtual JSContextRef getContext() const
-    {
-        return m_context;
-    }
-
-    /**
-     * Gets stored object.
-     * @return Stored object.
-     */
-    virtual PrivateClass getObject() const
-    {
-        return m_object;
-    }
-
-  protected:
-    JSContextRef m_context; ///< JS context.
-    PrivateClass m_object; ///< Stored object.
-};
-
-/**
- * Specialization for type void.
- */
-template<>
-class PrivateObject<void, NoOwnership> : private DPL::Noncopyable
-{
-  public:
-    /**
-     * Creates storage object for JS private data.
-     * @param context JS (root/global) context.
-     * @remarks Takes ownership over stored object.
-     */
-    explicit PrivateObject(JSContextRef context) : m_context(context)
-    {
-        Assert(NULL != m_context && "Context is NULL.");
-    }
-
-    /**
-     * Destroys instance of the object.
-     */
-    virtual ~PrivateObject()
-    {}
-
-    /**
-     * Gets stored JS context.
-     * @return JavaScript context.
-     */
-    virtual JSContextRef getContext() const
-    {
-        return m_context;
-    }
-
-  protected:
-    JSContextRef m_context;
-};
-
-template<class C>
-struct PrivateObjectT
-{
-    typedef PrivateObject<C, NoOwnership> Type;
-};
-
-template<class C>
-struct PrivateObjectT<C*>
-{
-    typedef PrivateObject<C*, OwnershipByAcquisition> Type;
-};
-
-template<>
-struct PrivateObjectT<JSObjectRef>
-{
-    typedef PrivateObject<JSObjectRef, NoOwnership> Type;
-};
-
-template<>
-struct PrivateObjectT<void>
-{
-    typedef PrivateObject<void, NoOwnership> Type;
-};
-} // CommonsJavaScript
-} // WrtDeviceApis
-
-#endif /* PRIVATEOBJECT_H_ */
diff --git a/src_wearable/CommonsJavaScript/Utils.h b/src_wearable/CommonsJavaScript/Utils.h
deleted file mode 100644 (file)
index d8b8f95..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * 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.
- */
-/**
- * @author          Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
- */
-
-#ifndef WRTDEVICEAPIS_COMMONSJAVASCRIPT_UTILS_H_
-#define WRTDEVICEAPIS_COMMONSJAVASCRIPT_UTILS_H_
-
-#include <dpl/shared_ptr.h>
-#include <Commons/IEvent.h>
-#include <CommonsJavaScript/JSPendingOperation.h>
-#include <CommonsJavaScript/JSPendingOperationPrivateObject.h>
-
-namespace WrtDeviceApis {
-namespace CommonsJavaScript {
-/**
- * Creates pending operation object.
- * @param context Global context.
- * @param event Event or other object enclosed in shared ptr and convertible
- *              to @see WrtDeviceApis::Commons::IEventController.
- * @return Pending operation object.
- */
-template<typename EventType>
-JSObjectRef makePendingOperation(JSContextRef context,
-                                 const DPL::SharedPtr<EventType>& event)
-{
-    Commons::IEventControllerPtr eventController =
-        DPL::StaticPointerCast<Commons::IEventController>(event);
-    IJSPendingOperationPrivateObject* pendingOperation =
-        new IJSPendingOperationPrivateObject(eventController);
-    return JSObjectMake(context,
-                        JSPendingOperation::getClassRef(), pendingOperation);
-}
-
-template<typename EventType>
-JSObjectRef makeExtCancelSupportedPendingOperation(
-    JSContextRef context,
-    const DPL::SharedPtr<EventType>& event,
-    const DPL::SharedPtr<Commons::IExternEventCanceler<EventType> >&
-    cancel)
-{
-    IJSPendingOperationPrivateObject* pendingOperation =
-        new IJSExtCancelPendingOperationPrivateObject<EventType>(event, cancel);
-
-    return JSObjectMake(context,
-                        JSPendingOperation::getClassRef(),
-                        pendingOperation);
-}
-} // CommonsJavaScript
-} // WrtDeviceApis
-
-#endif // WRTDEVICEAPIS_COMMONSJAVASCRIPT_UTILS_H_
diff --git a/src_wearable/CommonsJavaScript/Validator.h b/src_wearable/CommonsJavaScript/Validator.h
deleted file mode 100644 (file)
index 6a89550..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRTDEVICEAPIS_COMMONSJAVASCRIPT_VALIDATOR_H_
-#define WRTDEVICEAPIS_COMMONSJAVASCRIPT_VALIDATOR_H_
-
-#include <ctime>
-#include <string>
-#include <vector>
-#include <JavaScriptCore/JavaScript.h>
-#include <dpl/noncopyable.h>
-#include <dpl/shared_ptr.h>
-#include <Commons/Exception.h>
-
-namespace WrtDeviceApis {
-namespace CommonsJavaScript {
-class Validator : private DPL::Noncopyable
-{
-  public:
-    explicit Validator(JSContextRef context,
-                       JSValueRef* exception = NULL);
-    virtual ~Validator();
-
-    /**
-     * Checks if arg is a Date.
-     * @param arg JSValueRef to check.
-     * @return true when object is a date, false otherwise
-     */
-    bool isDate(const JSValueRef& arg);
-
-    /**
-     * Checks if arg is a callback function.
-     * @param arg JSValueRef to check.
-     * @return true when object is a callback function, false otherwise
-     */
-    bool isCallback(const JSValueRef& arg);
-
-    /**
-     * Checks if arg have allowed properties.
-     * @param allowed allowed property names.
-     * @param arg JSValueRef to check.
-     * @return true when object's properties are subset of allowed
-     */
-    bool checkArrayKeys(const std::vector<std::string> &allowed,
-                        JSValueRef argument);
-
-    bool isNullOrUndefined(const JSValueRef& arg);
-
-  protected:
-    JSContextRef m_context;
-    JSValueRef* m_exception;
-};
-
-template<class C>
-class ValidatorFactory : private DPL::Noncopyable
-{
-  public:
-    /**
-     * Validator type which deletes itself when gets out of scope.
-     */
-    typedef DPL::SharedPtr<C> ValidatorType;
-
-  public:
-    /**
-     * Gets converter object.
-     * @param context JavaScript context the conversion will be performed in.
-     * @param[out] exception JavaScript value for storing exception.
-     * @return Converter object.
-     */
-    static ValidatorType getValidator(JSContextRef context,
-                                      JSValueRef* exception = NULL)
-    {
-        C* convert = new C(context, exception);
-        return ValidatorType(convert);
-    }
-
-  private:
-    ValidatorFactory();
-};
-
-typedef ValidatorFactory<Validator> BasicValidatorFactory;
-typedef BasicValidatorFactory::ValidatorType BasicValidator;
-} // CommonsJavaScript
-} // WrtDeviceApis
-
-#endif /* _VALIDATOR_H_ */
diff --git a/src_wearable/dispatch-event/CMakeLists.txt b/src_wearable/dispatch-event/CMakeLists.txt
deleted file mode 100644 (file)
index 3ba4072..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-# 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     CMakeLists.txt
-# @author   Tae-Jeong Lee (taejeong.lee@samsung.com)
-# @version  1.0
-#
-
-pkg_search_module(webkit2 REQUIRED ewebkit2)
-pkg_search_module(dpl REQUIRED dpl-efl)
-
-SET(TARGET_NAME wrt-dispatch-event)
-
-SET(SRCS
-    ${CMAKE_CURRENT_SOURCE_DIR}/dispatch_event_support.cpp
-)
-
-INCLUDE_DIRECTORIES(
-    ${CMAKE_CURRENT_SOURCE_DIR}
-    ${webkit2_INCLUDE_DIRS}
-    ${dpl_INCLUDE_DIRS}
-)
-
-ADD_LIBRARY(${TARGET_NAME} SHARED ${SRCS})
-
-TARGET_LINK_LIBRARIES(${TARGET_NAME}
-    ${webkit2_LIBRARIES}
-    ${dpl_LIBRARIES}
-)
-
-SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES
-    COMPILE_FLAGS -fPIC
-    LINK_FLAGS "-Wl,--as-needed -Wl,--hash-style=both"
-)
-
-SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES
-    SOVERSION ${CMAKE_PROJECT_API_VERSION}
-    VERSION ${CMAKE_PROJECT_VERSION}
-)
-
-INSTALL(TARGETS ${TARGET_NAME}
-    DESTINATION ${DESTINATION_LIB_PREFIX}
-    PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
-    GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
-)
-
-INSTALL(FILES dispatch_event_support.h DESTINATION include/wrt-dispatch-event)
\ No newline at end of file
diff --git a/src_wearable/js-overlay/CMakeLists.txt b/src_wearable/js-overlay/CMakeLists.txt
deleted file mode 100644 (file)
index f42c3f0..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-# 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     CMakeLists.txt
-# @author   Yunchan Cho (yunchan.cho@samsung.com)
-# @version  1.0
-#
-MACRO(INSTALL_HEADER_FILE HEADER_FILE)
-    INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${HEADER_FILE}
-        DESTINATION ${DESTINATION_HEADERS_JS_OVERLAY})
-ENDMACRO()
-
-pkg_search_module(webkit2 REQUIRED ewebkit2)
-pkg_search_module(plugin-types REQUIRED wrt-plugins-types)
-
-SET(TARGET_NAME ${TARGET_JS_OVERLAY})
-
-SET(SRCS
-    ${CMAKE_CURRENT_SOURCE_DIR}/js_function_manager.cpp
-    ${CMAKE_CURRENT_SOURCE_DIR}/js_overlay_functions.cpp
-)
-
-INCLUDE_DIRECTORIES(
-    ${CMAKE_CURRENT_SOURCE_DIR}
-    ${CMAKE_CURRENT_SOURCE_DIR}/JSClass
-    ${webkit2_INCLUDE_DIRS}
-    ${plugin-types_INCLUDE_DIRS}
-)
-
-ADD_LIBRARY(${TARGET_NAME} SHARED ${SRCS})
-
-TARGET_LINK_LIBRARIES(${TARGET_NAME}
-    ${webkit2_LIBRARIES}
-    ${TARGET_COMMONS}
-    ${TARGET_COMMONS_JAVASCRIPT}
-)
-
-SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES
-    COMPILE_FLAGS -fPIC
-    LINK_FLAGS "-Wl,--as-needed -Wl,--hash-style=both"
-)
-
-SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES
-    SOVERSION ${CMAKE_PROJECT_API_VERSION}
-    VERSION ${CMAKE_PROJECT_VERSION}
-)
-
-INSTALL(TARGETS ${TARGET_NAME}
-    DESTINATION ${DESTINATION_LIB_PREFIX}
-    PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
-    GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
-)
-
-INSTALL_HEADER_FILE(js_overlay_types.h)
-
diff --git a/src_wearable/modules/API/CMakeLists.txt b/src_wearable/modules/API/CMakeLists.txt
deleted file mode 100644 (file)
index 1a64e70..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-# 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_config_file(Filesystem)
-include_config_file(Widget)
-include_config_file(LocalStorage)
-include_config_file(WidgetDB)
-include_config_file(PluginManager)
-include_config_file(StorageEvent)
-include_config_file(TizenServiceEvent)
-include_config_file(SoftKeyboardChangeEvent)
diff --git a/src_wearable/modules/API/Filesystem/Enums.h b/src_wearable/modules/API/Filesystem/Enums.h
deleted file mode 100644 (file)
index 81e7d0d..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRTDEVICEAPIS_FILESYSTEM_ENUMS_H_
-#define WRTDEVICEAPIS_FILESYSTEM_ENUMS_H_
-
-#include <string>
-#include <map>
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-enum LocationType
-{
-    LT_APPS,
-    LT_DOCUMENTS,
-    LT_DOWNLOADS,
-    LT_GAMES,
-    LT_IMAGES,
-    LT_OTHERS,
-    LT_ROOT,
-    LT_SDCARD,
-    LT_SOUNDS,
-    LT_TEMP,
-    LT_VIDEOS
-};
-
-enum NodeType
-{
-    NT_DIRECTORY,
-    NT_FILE
-};
-
-enum AccessMode
-{
-    AM_READ = 0x0001,
-    AM_WRITE = 0x0002,
-    AM_APPEND = 0x0004
-};
-
-/**
- * Used in @see IManager::access().
- */
-enum AccessType
-{
-    AT_READ = 0x0001,     //!< AT_READ   - checks for read access
-    AT_WRITE = 0x0002,    //!< AT_WRITE  - checks for write access
-    AT_EXEC = 0x0004,     //!< AT_EXEC   - checks for execution access
-    AT_EXISTS = 0x0008    //!< AT_EXISTS - checks for existence
-};
-
-enum Permissions
-{
-    PERM_NONE = 0x0000,
-    PERM_READ = 0x0001,
-    PERM_WRITE = 0x0002
-};
-
-enum PlatformMode
-{
-    PM_USER_READ = 0x0100,
-    PM_USER_WRITE = 0x0080,
-    PM_USER_EXEC = 0x0040,
-    PM_GROUP_READ = 0x0020,
-    PM_GROUP_WRITE = 0x0010,
-    PM_GROUP_EXEC = 0x0008,
-    PM_OTHER_READ = 0x0004,
-    PM_OTHER_WRITE = 0x0002,
-    PM_OTHER_EXEC = 0x0001,
-    PM_NONE = 0x0000
-};
-
-enum Options
-{
-    OPT_NONE = 0x0000,
-    OPT_OVERWRITE = 0x0001,
-    OPT_RECURSIVE = 0x0002
-};
-
-enum FindFilter
-{
-    FF_NAME,
-    FF_CREATED,
-    FF_MODIFIED,
-    FF_SIZE
-};
-typedef std::map<FindFilter, std::string> FiltersMap;
-} // API
-} // Filesystem
-} // WrtDeviceApis
-
-#endif /* WRTDEVICEAPIS_FILESYSTEM_ENUMS_H_ */
diff --git a/src_wearable/modules/API/Filesystem/EventCopy.cpp b/src_wearable/modules/API/Filesystem/EventCopy.cpp
deleted file mode 100644 (file)
index f6b6e56..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * 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 "EventCopy.h"
-#include <dpl/assert.h>
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-EventCopy::EventCopy(const IPathPtr& src,
-                     const IPathPtr& dest) :
-    m_src(src),
-    m_dest(dest),
-    m_options(OPT_NONE)
-{
-    AssertMsg(src, "Source path not set.");
-    AssertMsg(dest, "Destination path not set.");
-}
-
-IPathPtr EventCopy::getDestination() const
-{
-    return m_dest;
-}
-
-IPathPtr EventCopy::getSource() const
-{
-    return m_src;
-}
-
-INodePtr EventCopy::getResult() const
-{
-    return m_result;
-}
-
-void EventCopy::setResult(const INodePtr& node)
-{
-    m_result = node;
-}
-
-int EventCopy::getOptions() const
-{
-    return m_options;
-}
-
-void EventCopy::setOptions(int options)
-{
-    m_options = options;
-}
-} // API
-} // Filesystem
-} // WrtDeviceApis
diff --git a/src_wearable/modules/API/Filesystem/EventCopy.h b/src_wearable/modules/API/Filesystem/EventCopy.h
deleted file mode 100644 (file)
index 62bef44..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRTDEVICEAPIS_FILESYSTEM_EVENTCOPY_H_
-#define WRTDEVICEAPIS_FILESYSTEM_EVENTCOPY_H_
-
-#include <dpl/shared_ptr.h>
-#include <Commons/IEvent.h>
-#include "IPath.h"
-#include "INode.h"
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-class EventCopy : public Commons::IEvent<EventCopy>
-{
-  public:
-    /**
-     * Creates new event object.
-     * @param src Path to source node.
-     * @param dest Path to destination node.
-     * @return New object.
-     */
-    EventCopy(const IPathPtr& src,
-              const IPathPtr& dest);
-
-    /**
-     * Gets destination path.
-     * @return Destination path.
-     */
-    IPathPtr getDestination() const;
-
-    /**
-     * Gets source path.
-     * @return Source path.
-     */
-    IPathPtr getSource() const;
-
-    /**
-     * Gets result node.
-     * @return Result node.
-     */
-    INodePtr getResult() const;
-
-    /**
-     * Sets result node.
-     * @param node Result node.
-     */
-    void setResult(const INodePtr& node);
-
-    /**
-     * Gets options.
-     * @return Options.
-     */
-    int getOptions() const;
-
-    /**
-     * Sets options.
-     * @param options Options.
-     */
-    void setOptions(int options);
-
-  private:
-    IPathPtr m_src;   ///< Source path.
-    IPathPtr m_dest;  ///< Destination path.
-    INodePtr m_result; ///< Result node.
-    int m_options;    ///< Options for copy action @see
-                      // WrtDeviceApis::Api::Filesystem::Options.
-};
-
-typedef DPL::SharedPtr<EventCopy> EventCopyPtr;
-} // API
-} // Filesystem
-} // WrtDeviceApis
-
-#endif // WRTDEVICEAPIS_FILESYSTEM_EVENTCOPY_H_
diff --git a/src_wearable/modules/API/Filesystem/EventFind.cpp b/src_wearable/modules/API/Filesystem/EventFind.cpp
deleted file mode 100644 (file)
index c8c01a9..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * 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 "EventFind.h"
-
-#include <Filesystem/Path.h>
-#include "INode.h"
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-EventFind::EventFind(const IPathPtr& path) : m_path(path)
-{}
-
-IPathPtr EventFind::getPath() const
-{
-    return m_path;
-}
-
-NodeList EventFind::getResult() const
-{
-    return m_nodes;
-}
-
-void EventFind::addResult(const INodePtr& node)
-{
-    m_nodes.push_back(node);
-}
-
-void EventFind::setResult(const NodeList& nodes)
-{
-    m_nodes = nodes;
-}
-
-void EventFind::addFilter(FindFilter name,
-                          const std::string& value)
-{
-    m_filters.insert(std::pair<FindFilter, std::string>(name, value));
-}
-
-FiltersMap EventFind::getFilters() const
-{
-    return m_filters;
-}
-} // API
-} // Filesystem
-} // WrtDeviceApis
diff --git a/src_wearable/modules/API/Filesystem/EventFind.h b/src_wearable/modules/API/Filesystem/EventFind.h
deleted file mode 100644 (file)
index 47d6e50..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRTDEVICEAPIS_IEVENTFILESYSTEMFIND_H_
-#define WRTDEVICEAPIS_IEVENTFILESYSTEMFIND_H_
-
-#include <list>
-#include <dpl/shared_ptr.h>
-#include <Commons/IEvent.h>
-#include "IPath.h"
-#include "INodeTypes.h"
-#include "Enums.h"
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-class EventFind : public Commons::IEvent<EventFind>
-{
-  public:
-    /**
-     * Creates new event object.
-     * @param path Start path.
-     * @return New object.
-     */
-    explicit EventFind(const IPathPtr& path);
-
-    /**
-     * Gets start path.
-     * @return Path to start searching from.
-     */
-    IPathPtr getPath() const;
-
-    /**
-     * Gets found nodes.
-     * @return Nodes.
-     */
-    NodeList getResult() const;
-
-    /**
-     * Adds found node.
-     * @param node Found node.
-     */
-    void addResult(const INodePtr& node);
-
-    /**
-     * Sets found nodes.
-     * @param nodes Nodes.
-     */
-    void setResult(const NodeList& nodes);
-
-    /**
-     * Adds find filter.
-     * @param name Filter name.
-     * @param value Filter value.
-     */
-    void addFilter(FindFilter name,
-                   const std::string& value);
-
-    /**
-     * Gets all filters.
-     * @return Filters.
-     */
-    FiltersMap getFilters() const;
-
-  private:
-    IPathPtr m_path;    ///< Start path.
-    NodeList m_nodes;   ///< Resolved nodes.
-    FiltersMap m_filters; ///< Search filters.
-};
-
-typedef DPL::SharedPtr<EventFind> EventFindPtr;
-} // API
-} // Filesystem
-} // WrtDeviceApis
-
-#endif // WRTDEVICEAPIS_IEVENTFILESYSTEMFIND_H_
diff --git a/src_wearable/modules/API/Filesystem/EventListNodes.cpp b/src_wearable/modules/API/Filesystem/EventListNodes.cpp
deleted file mode 100644 (file)
index 80c2dd2..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * 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 "EventListNodes.h"
-#include <dpl/assert.h>
-#include "INode.h"
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-EventListNodes::EventListNodes(const INodePtr& node) : m_node(node)
-{
-    AssertMsg(m_node, "Node can't be NULL.");
-}
-
-INodePtr EventListNodes::getNode() const
-{
-    return m_node;
-}
-
-NodeFilterPtr EventListNodes::getFilter() const
-{
-    return m_filter;
-}
-
-void EventListNodes::setFilter(const NodeFilterPtr& filter)
-{
-    m_filter = filter;
-}
-
-NodeList EventListNodes::getResult() const
-{
-    return m_list;
-}
-
-void EventListNodes::setResult(const NodeList& list)
-{
-    m_list = list;
-}
-} // API
-} // Filesystem
-} // WrtDeviceApis
diff --git a/src_wearable/modules/API/Filesystem/EventListNodes.h b/src_wearable/modules/API/Filesystem/EventListNodes.h
deleted file mode 100644 (file)
index a856546..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRTDEVICEAPIS_FILESYSTEM_EVENTLISTNODES_H_
-#define WRTDEVICEAPIS_FILESYSTEM_EVENTLISTNODES_H_
-
-#include <dpl/shared_ptr.h>
-#include <Commons/IEvent.h>
-#include "INodeTypes.h"
-#include "NodeFilter.h"
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-class EventListNodes : public Commons::IEvent<EventListNodes>
-{
-  public:
-    /**
-     * Creates new event object.
-     * @param path Node to list children for.
-     * @return New object.
-     */
-    explicit EventListNodes(const INodePtr& node);
-
-    /**
-     * Gets parent node.
-     * @return Parent node.
-     */
-    INodePtr getNode() const;
-
-    /**
-     * Gets filter.
-     * @return Filter.
-     */
-    NodeFilterPtr getFilter() const;
-
-    /**
-     * Sets filter.
-     * @param filter Filter to list only specific nodes.
-     */
-    void setFilter(const NodeFilterPtr& filter);
-
-    /**
-     * Gets nodes.
-     * @return Nodes list.
-     */
-    NodeList getResult() const;
-
-    /**
-     * Sets nodes list.
-     * @param list Nodes list.
-     */
-    void setResult(const NodeList& list);
-
-  private:
-    NodeList m_list;      ///< List of child nodes.
-    INodePtr m_node;      ///< Node to list children for.
-    NodeFilterPtr m_filter; ///< Filter.
-};
-
-typedef DPL::SharedPtr<EventListNodes> EventListNodesPtr;
-} // API
-} // Filesystem
-} // WrtDeviceApis
-
-#endif // WRTDEVICEAPIS_FILESYSTEM_EVENTLISTNODES_H_
diff --git a/src_wearable/modules/API/Filesystem/EventMove.cpp b/src_wearable/modules/API/Filesystem/EventMove.cpp
deleted file mode 100644 (file)
index 481dac7..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * 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 "EventMove.h"
-#include <dpl/assert.h>
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-EventMove::EventMove(const IPathPtr& src,
-                     const IPathPtr& dest) :
-    m_src(src),
-    m_dest(dest),
-    m_options(OPT_NONE)
-{
-    AssertMsg(src, "Source path not set.");
-    AssertMsg(dest, "Destination path not set.");
-}
-
-IPathPtr EventMove::getDestination() const
-{
-    return m_dest;
-}
-
-IPathPtr EventMove::getSource() const
-{
-    return m_src;
-}
-
-INodePtr EventMove::getResult() const
-{
-    return m_result;
-}
-
-void EventMove::setResult(const INodePtr& node)
-{
-    m_result = node;
-}
-
-int EventMove::getOptions() const
-{
-    return m_options;
-}
-
-void EventMove::setOptions(int options)
-{
-    m_options = options;
-}
-} // API
-} // Filesystem
-} // WrtDeviceApis
diff --git a/src_wearable/modules/API/Filesystem/EventMove.h b/src_wearable/modules/API/Filesystem/EventMove.h
deleted file mode 100644 (file)
index d9716f0..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRTDEVICEAPIS_FILESYSTEM_EVENTMOVE_H_
-#define WRTDEVICEAPIS_FILESYSTEM_EVENTMOVE_H_
-
-#include <dpl/shared_ptr.h>
-#include <Commons/IEvent.h>
-#include "IPath.h"
-#include "INode.h"
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-class EventMove : public Commons::IEvent<EventMove>
-{
-  public:
-    /**
-     * Creates new event object.
-     * @param src Source path.
-     * @param dest Destination path.
-     * @return New object.
-     */
-    EventMove(const IPathPtr& src,
-              const IPathPtr& dest);
-
-    /**
-     * Gets destination path.
-     * @return Destination path.
-     */
-    IPathPtr getDestination() const;
-
-    /**
-     * Gets source path.
-     * @return Source path.
-     */
-    IPathPtr getSource() const;
-
-    /**
-     * Gets result node.
-     * @return Result node.
-     */
-    INodePtr getResult() const;
-
-    /**
-     * Sets result node.
-     * @param node Result node.
-     */
-    void setResult(const INodePtr& node);
-
-    /**
-     * Gets options.
-     * @return Options.
-     */
-    int getOptions() const;
-
-    /**
-     * Sets options.
-     * @param options Options.
-     */
-    void setOptions(int options);
-
-  private:
-    IPathPtr m_src;   ///< Source path.
-    IPathPtr m_dest;  ///< Destination path.
-    INodePtr m_result; ///< Result node.
-    int m_options;    ///< Options for copy action @see
-                      // WrtDeviceApis::Api::Filesystem::Options.
-};
-
-typedef DPL::SharedPtr<EventMove> EventMovePtr;
-} // API
-} // Filesystem
-} // WrtDeviceApis
-
-#endif // WRTDEVICEAPIS_FILESYSTEM_EVENTMOVE_H_
diff --git a/src_wearable/modules/API/Filesystem/EventOpen.cpp b/src_wearable/modules/API/Filesystem/EventOpen.cpp
deleted file mode 100644 (file)
index 274e963..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * 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 "EventOpen.h"
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-EventOpen::EventOpen(int mode) : m_mode(mode)
-{}
-
-int EventOpen::getMode() const
-{
-    return m_mode;
-}
-
-IStreamPtr EventOpen::getResult() const
-{
-    return m_stream;
-}
-
-void EventOpen::setResult(const IStreamPtr& stream)
-{
-    m_stream = stream;
-}
-} // API
-} // Filesystem
-} // WrtDeviceApis
diff --git a/src_wearable/modules/API/Filesystem/EventOpen.h b/src_wearable/modules/API/Filesystem/EventOpen.h
deleted file mode 100644 (file)
index 5ab5662..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRTDEVICEAPIS_FILESYSTEM_EVENTOPEN_H_
-#define WRTDEVICEAPIS_FILESYSTEM_EVENTOPEN_H_
-
-#include <dpl/shared_ptr.h>
-#include <Commons/IEvent.h>
-#include "IStream.h"
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-class EventOpen : public Commons::IEvent<EventOpen>
-{
-  public:
-    /**
-     * Creates new event object.
-     * @param mode Mode to open the node in.
-     * @return New object.
-     */
-    explicit EventOpen(int mode);
-
-    /**
-     * Gets mode.
-     * @return Mode.
-     */
-    int getMode() const;
-
-    /**
-     * Gets result stream.
-     * @return Result stream.
-     */
-    IStreamPtr getResult() const;
-
-    /**
-     * Sets result stream.
-     * @param stream Result stream.
-     */
-    void setResult(const IStreamPtr& stream);
-
-  private:
-    int m_mode;         ///< Mode.
-    IStreamPtr m_stream; ///< Opened stream.
-};
-
-typedef DPL::SharedPtr<EventOpen> EventOpenPtr;
-} // API
-} // Filesystem
-} // WrtDeviceApis
-
-#endif // WRTDEVICEAPIS_FILESYSTEM_EVENTOPEN_H_
diff --git a/src_wearable/modules/API/Filesystem/EventReadText.cpp b/src_wearable/modules/API/Filesystem/EventReadText.cpp
deleted file mode 100644 (file)
index 560687e..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * 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 "EventReadText.h"
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-std::string EventReadText::getResult() const
-{
-    return m_result;
-}
-
-void EventReadText::setResult(const std::string& result)
-{
-    m_result = result;
-}
-} // API
-} // Filesystem
-} // WrtDeviceApis
diff --git a/src_wearable/modules/API/Filesystem/EventReadText.h b/src_wearable/modules/API/Filesystem/EventReadText.h
deleted file mode 100644 (file)
index 986b565..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRTDEVICEAPIS_FILESYSTEM_EVENTREADTEXT_H_
-#define WRTDEVICEAPIS_FILESYSTEM_EVENTREADTEXT_H_
-
-#include <string>
-#include <dpl/shared_ptr.h>
-#include <Commons/IEvent.h>
-#include "IPath.h"
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-class EventReadText : public Commons::IEvent<EventReadText>
-{
-  public:
-    /**
-     * Gets read text.
-     * @return Text.
-     */
-    std::string getResult() const;
-
-    /**
-     * Sets read text.
-     * @param result Text.
-     */
-    void setResult(const std::string& result);
-
-  private:
-    std::string m_result; ///< Read text.
-};
-
-typedef DPL::SharedPtr<EventReadText> EventReadTextPtr;
-} // API
-} // Filesystem
-} // WrtDeviceApis
-
-#endif // WRTDEVICEAPIS_FILESYSTEM_EVENTREADTEXT_H_
diff --git a/src_wearable/modules/API/Filesystem/EventRemove.cpp b/src_wearable/modules/API/Filesystem/EventRemove.cpp
deleted file mode 100644 (file)
index 308a66b..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * 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 "EventRemove.h"
-#include <dpl/assert.h>
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-EventRemove::EventRemove(const IPathPtr& path) :
-    m_path(path),
-    m_options(OPT_NONE)
-{
-    AssertMsg(m_path, "Path is not set.");
-}
-
-IPathPtr EventRemove::getPath() const
-{
-    return m_path;
-}
-
-int EventRemove::getOptions() const
-{
-    return m_options;
-}
-
-void EventRemove::setOptions(int options)
-{
-    m_options = options;
-}
-} // API
-} // Filesystem
-} // WrtDeviceApis
diff --git a/src_wearable/modules/API/Filesystem/EventRemove.h b/src_wearable/modules/API/Filesystem/EventRemove.h
deleted file mode 100644 (file)
index be3aecd..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRTDEVICEAPIS_FILESYSTEM_EVENTREMOVE_H_
-#define WRTDEVICEAPIS_FILESYSTEM_EVENTREMOVE_H_
-
-#include <dpl/shared_ptr.h>
-#include <Commons/IEvent.h>
-#include "INode.h"
-#include "Enums.h"
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-class EventRemove : public Commons::IEvent<EventRemove>
-{
-  public:
-    /**
-     * Creates new event object.
-     * @param path Path to the node to remove.
-     * @return New object.
-     */
-    explicit EventRemove(const IPathPtr& path);
-
-    /**
-     * Gets path to the node to remove.
-     * @return Path.
-     */
-    IPathPtr getPath() const;
-
-    /**
-     * Gets options.
-     * @return Options.
-     */
-    int getOptions() const;
-
-    /**
-     * Sets options.
-     * @param options Options.
-     */
-    void setOptions(int options);
-
-  private:
-    IPathPtr m_path; ///< Source path.
-    int m_options;  ///< Options for remove action @see
-                    // WrtDeviceApis::Api::Filesystem::Options.
-};
-
-typedef DPL::SharedPtr<EventRemove> EventRemovePtr;
-} // API
-} // Filesystem
-} // WrtDeviceApis
-
-#endif // WRTDEVICEAPIS_FILESYSTEM_EVENTREMOVE_H_
diff --git a/src_wearable/modules/API/Filesystem/EventResolve.cpp b/src_wearable/modules/API/Filesystem/EventResolve.cpp
deleted file mode 100644 (file)
index 2473795..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * 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 "EventResolve.h"
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-EventResolve::EventResolve(const IPathPtr& path) : m_path(path)
-{}
-
-IPathPtr EventResolve::getPath() const
-{
-    return m_path;
-}
-
-INodePtr EventResolve::getResult() const
-{
-    return m_node;
-}
-
-void EventResolve::setResult(const INodePtr& node)
-{
-    m_node = node;
-}
-} // API
-} // Filesystem
-} // WrtDeviceApis
diff --git a/src_wearable/modules/API/Filesystem/EventResolve.h b/src_wearable/modules/API/Filesystem/EventResolve.h
deleted file mode 100644 (file)
index 1d50258..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRTDEVICEAPIS_FILESYSTEM_EVENTRESOLVE_H_
-#define WRTDEVICEAPIS_FILESYSTEM_EVENTRESOLVE_H_
-
-#include <dpl/shared_ptr.h>
-#include <Commons/IEvent.h>
-#include "IPath.h"
-#include "INode.h"
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-class EventResolve : public Commons::IEvent<EventResolve>
-{
-  public:
-    /**
-     * Creates new event object.
-     * @param path Path to the node to resolve.
-     * @return New object.
-     */
-    explicit EventResolve(const IPathPtr& path);
-
-    /**
-     * Gets path of the node to resolve.
-     * @return Path to resolve.
-     */
-    IPathPtr getPath() const;
-
-    /**
-     * Gets resolved node.
-     * NULL if none found. Check exception code.
-     * @return Resolved node or NULL.
-     */
-    INodePtr getResult() const;
-
-    /**
-     * Sets resolved node.
-     * @param node Resolved node.
-     */
-    void setResult(const INodePtr& node);
-
-  private:
-    IPathPtr m_path; ///< Path to the requested node.
-    INodePtr m_node; ///< Resolved node.
-};
-
-typedef DPL::SharedPtr<EventResolve> EventResolvePtr;
-} // API
-} // Filesystem
-} // WrtDeviceApis
-
-#endif // WRTDEVICEAPIS_FILESYSTEM_EVENTRESOLVE_H_
diff --git a/src_wearable/modules/API/Filesystem/IManager.cpp b/src_wearable/modules/API/Filesystem/IManager.cpp
deleted file mode 100644 (file)
index 92219f5..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * 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 <Filesystem/Manager.h>
-#include <Commons/ThreadPool.h>
-#include "IManager.h"
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-IManager& IManager::getInstance()
-{
-    static Manager instance;
-    return instance;
-}
-
-bool IManager::fileExists(const std::string &file)
-{
-    return WrtDeviceApis::Filesystem::Manager::fileExists(file);
-}
-
-IManager::IManager() :
-    Commons::EventRequestReceiver<EventResolve>(
-        Commons::ThreadEnum::FILESYSTEM_THREAD),
-    Commons::EventRequestReceiver<EventCopy>(
-        Commons::ThreadEnum::FILESYSTEM_THREAD),
-    Commons::EventRequestReceiver<EventMove>(
-        Commons::ThreadEnum::FILESYSTEM_THREAD),
-    Commons::EventRequestReceiver<EventRemove>(
-        Commons::ThreadEnum::FILESYSTEM_THREAD),
-    Commons::EventRequestReceiver<EventFind>(
-        Commons::ThreadEnum::FILESYSTEM_THREAD)
-{}
-
-IManager::~IManager()
-{}
-} // API
-} // Filesystem
-} // WrtDeviceApis
diff --git a/src_wearable/modules/API/Filesystem/IManager.h b/src_wearable/modules/API/Filesystem/IManager.h
deleted file mode 100644 (file)
index bc3cf0d..0000000
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRTDEVICEAPIS_FILESYSTEM_IMANAGER_H_
-#define WRTDEVICEAPIS_FILESYSTEM_IMANAGER_H_
-
-#include <vector>
-#include <string>
-#include <cstddef>
-#include <dpl/noncopyable.h>
-#include <Commons/EventReceiver.h>
-#include <Filesystem/EventResolve.h>
-#include <Filesystem/EventCopy.h>
-#include <Filesystem/EventMove.h>
-#include <Filesystem/EventRemove.h>
-#include <Filesystem/EventFind.h>
-#include <Filesystem/Enums.h>
-#include <Filesystem/INode.h>
-#include <Filesystem/IPath.h>
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-typedef std::vector<IPathPtr> LocationPaths;
-typedef std::vector<LocationType> LocationTypes;
-
-class IManager :
-    public Commons::EventRequestReceiver<EventResolve>,
-    public Commons::EventRequestReceiver<EventCopy>,
-    public Commons::EventRequestReceiver<EventMove>,
-    public Commons::EventRequestReceiver<EventRemove>,
-    public Commons::EventRequestReceiver<EventFind>
-{
-  public:
-    static IManager& getInstance();
-    static bool fileExists(const std::string &file);
-
-    virtual ~IManager() = 0;
-
-    /**
-     * Gets base path.
-     * @return Valid path or empty shared pointer.
-     */
-    virtual IPathPtr getBasePath() const = 0;
-
-    /**
-     * Gets path for specified location type.
-     * @param type Location type @see
-     * WrtDeviceApis::Api::Filesystem::LocationType.
-     * @return Valid path or empty shared pointer.
-     */
-    virtual IPathPtr getLocationPath(LocationType type) const = 0;
-
-    /**
-     * Gets paths to default locations.
-     * @return Paths to predefined virtual locations.
-     */
-    virtual LocationPaths getLocationPaths() const = 0;
-
-    /**
-     * Gets locations supported by platform.
-     * @return Supported locations.
-     */
-    virtual LocationTypes getLocations() const = 0;
-
-    /**
-     * Gets filesystem node.
-     * @param event Get node event @see Api::Filesystem::EventGetNode.
-     * @remarks Asynchronous.
-     */
-    virtual void getNode(const EventResolvePtr& event) = 0;
-
-    /**
-     * Gets maximum length of filesystem path.
-     * @return Maximum path length.
-     */
-    virtual std::size_t getMaxPathLength() const = 0;
-
-    /**
-     * Copies node to specified destination.
-     * @param event Copy node event @see Api::Filesystem::EventCopy.
-     * @remarks Asynchronous.
-     */
-    virtual void copy(const EventCopyPtr& event) = 0;
-
-    /**
-     * Moves node to specified destination.
-     * @param event Move node event @see Api::Filesystem::EventMove.
-     * @remarks Asynchronous.
-     */
-    virtual void move(const EventMovePtr& event) = 0;
-
-    /**
-     * Removes node.
-     * @param event Remove node event @see Api::Filesystem::EventRemove.
-     * @remarks Asynchronous.
-     */
-    virtual void remove(const EventRemovePtr& event) = 0;
-
-    /**
-     * Finds nodes.
-     * @param event Find nodes event @see Api::Filesystem::EventFind.
-     * @remarks Asynchronous.
-     */
-    virtual void find(const EventFindPtr& event) = 0;
-
-    /**
-     * Checks if node at specified path has supplied access rights.
-     * @param path Path to the node.
-     * @param accessType Access right(s) to check @see AccessType. Multiple
-     * values
-     *                   can be passed using OR operator.
-     * @return True if specified node has supplied access rights, false
-     * otherwise.
-     */
-    virtual bool access(const IPathPtr& path,
-                        int accessType) const = 0;
-
-    virtual void addOpenedNode(const INodePtr& node) = 0;
-    virtual void removeOpenedNode(const INodePtr& node) = 0;
-    virtual bool checkIfOpened(const IPathPtr& path) const = 0;
-
-  protected:
-    IManager();
-
-    virtual void OnRequestReceived(const EventResolvePtr& event) = 0;
-    virtual void OnRequestReceived(const EventCopyPtr& event) = 0;
-    virtual void OnRequestReceived(const EventMovePtr& event) = 0;
-    virtual void OnRequestReceived(const EventRemovePtr& event) = 0;
-    virtual void OnRequestReceived(const EventFindPtr& event) = 0;
-}; // IManager
-} // API
-} // Filesystem
-} // WrtDeviceApis
-
-#endif // WRTDEVICEAPIS_FILESYSTEM_IMANAGER_H_
diff --git a/src_wearable/modules/API/Filesystem/INode.cpp b/src_wearable/modules/API/Filesystem/INode.cpp
deleted file mode 100644 (file)
index cd30a04..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * 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 "INode.h"
-#include <Commons/ThreadPool.h>
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-INode::INode() :
-    Commons::EventRequestReceiver<EventListNodes>(
-        Commons::ThreadEnum::FILESYSTEM_THREAD),
-    Commons::EventRequestReceiver<EventOpen>(
-        Commons::ThreadEnum::FILESYSTEM_THREAD),
-    Commons::EventRequestReceiver<EventReadText>(
-        Commons::ThreadEnum::FILESYSTEM_THREAD)
-{}
-
-INode::~INode()
-{}
-} // API
-} // Filesystem
-} // WrtDeviceApis
diff --git a/src_wearable/modules/API/Filesystem/INode.h b/src_wearable/modules/API/Filesystem/INode.h
deleted file mode 100644 (file)
index c227aa9..0000000
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRTDEVICEAPIS_FILESYSTEM_INODE_H_
-#define WRTDEVICEAPIS_FILESYSTEM_INODE_H_
-
-#include <string>
-#include <vector>
-#include <ctime>
-#include <dpl/noncopyable.h>
-#include <dpl/shared_ptr.h>
-#include <Commons/EventReceiver.h>
-#include "EventListNodes.h"
-#include "EventOpen.h"
-#include "EventReadText.h"
-#include "Enums.h"
-#include "IPath.h"
-#include "IStream.h"
-#include "INodeTypes.h"
-#include "NodeFilter.h"
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-class INode :
-    public Commons::EventRequestReceiver<EventListNodes>,
-    public Commons::EventRequestReceiver<EventOpen>,
-    public Commons::EventRequestReceiver<EventReadText>
-{
-  public:
-    typedef std::vector<std::string> NameList;
-    typedef NameList::iterator NodeListIterator;
-
-  public:
-    virtual ~INode() = 0;
-
-    /**
-     * Gets direct child of this node.
-     * @param path Path to the child node.
-     * @return Ptr to the child node.
-     * @remarks Ownership passed to the caller.
-     */
-    virtual INodePtr getChild(const IPathPtr& path) = 0;
-
-    /**
-     * Gets path of current node.
-     * @return Node's path.
-     */
-    virtual IPathPtr getPath() const = 0;
-
-    /**
-     * Gets type of current node.
-     * @return Node's type.
-     */
-    virtual NodeType getType() const = 0;
-
-    /**
-     * Gets permissions of the virtual node (not real filesystem node).
-     * @return Node's permissions.
-     */
-    virtual int getPermissions() const = 0;
-
-    /**
-     * Sets permissions on the virtual node (not real filesystem node).
-     * @param perms Node's permissions @see Api::Filesystem::Permissions.
-     */
-    virtual void setPermissions(int perms) = 0;
-
-    /**
-     * Gets list of names of direct child nodes.
-     * @return Names of child nodes.
-     */
-    virtual NameList getChildNames() const = 0;
-
-    /**
-     * Gets list of direct child nodes.
-     * @return Child nodes.
-     * @remarks Ownership passed to the caller.
-     * @deprecated
-     */
-    virtual NodeList getChildNodes(const NodeFilterPtr& filter =
-                                       NodeFilterPtr()) const /*DEPREC*/ = 0;
-
-    /**
-     * Gets list of direct descendant nodes.
-     * @param event Get child nodes event.
-     */
-    virtual void getChildNodes(const EventListNodesPtr& event) = 0;
-
-    /**
-     * Gets stream for this node.
-     * @param mode @see Api::Filesystem::AccessMode.
-     * @return Stream connected with current node.
-     * @deprecated Use async version of thi method instead.
-     */
-    virtual IStreamPtr open(int mode) = 0;
-
-    /**
-     * Gets stream for this node.
-     * @param mode @see Api::Filesystem::AccessMode.
-     * @return Stream connected with current node.
-     */
-    virtual void open(const EventOpenPtr& event) = 0;
-
-    /**
-     * Removes underlying filesystem node.
-     * @param options Removal options (by default removal is recursive).
-     * @remarks Synchronous.
-     * Valid options:
-     * - OPT_RECURSIVE - remove node recursively.
-     */
-    virtual void remove(int options = OPT_RECURSIVE) = 0;
-
-    /**
-     * Creates child of current node.
-     * @param path Path to the node to create.
-     * @param type Type of the node @see Api::Filesystem::NodeType.
-     * @param options Additional options see remarks (no options by default).
-     * @return Ptr to newly created node.
-     * @remarks
-     * Valid options:
-     * - OPT_RECURSIVE - attempt to create all necessary sub-directories
-     */
-    virtual INodePtr createChild(const IPathPtr& path,
-                                 NodeType type,
-                                 int options = OPT_NONE) = 0;
-
-    /**
-     * Gets size of this node.
-     * @return Size.
-     */
-    virtual std::size_t getSize() const = 0;
-
-    /**
-     * Gets creation date of this node.
-     * @return Date.
-     */
-    virtual std::time_t getCreated() const = 0;
-
-    /**
-     * Gets last modification date of this node.
-     * @return Date.
-     */
-    virtual std::time_t getModified() const = 0;
-
-    /**
-     * Gets parent of this node.
-     * @return Parent node or NULL if no parent (e.g. in case of a root node).
-     */
-    virtual INodePtr getParent() const = 0;
-
-    /**
-     * Gets platform permissions.
-     * @return Platform permissions (set of flags from @see Permissions enum).
-     */
-    virtual int getMode() const = 0;
-
-    /**
-     * Reads whole file as text.
-     * @param event Read file event.
-     */
-    virtual void read(const EventReadTextPtr& event) = 0;
-
-    virtual std::string toUri(int widgetId) const = 0;
-
-  protected:
-    INode();
-};
-} // API
-} // Filesystem
-} // WrtDeviceApis
-
-#endif /* WRTDEVICEAPIS_FILESYSTEM_INODE_H_ */
diff --git a/src_wearable/modules/API/Filesystem/INodeTypes.h b/src_wearable/modules/API/Filesystem/INodeTypes.h
deleted file mode 100644 (file)
index c1c49f7..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * 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.
- */
-/**
- * @author          Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
- */
-
-#ifndef WRTDEVICEAPIS_FILESYSTEM_INODETYPES_H_
-#define WRTDEVICEAPIS_FILESYSTEM_INODETYPES_H_
-
-#include <vector>
-#include <dpl/shared_ptr.h>
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-class INode;
-
-typedef DPL::SharedPtr<INode> INodePtr;
-
-typedef std::vector<INodePtr> NodeList;
-typedef NodeList::iterator NodeListIterator;
-} // API
-} // Filesystem
-} // WrtDeviceApis
-
-#endif // WRTDEVICEAPIS_FILESYSTEM_INODETYPES_H_
diff --git a/src_wearable/modules/API/Filesystem/IPath.cpp b/src_wearable/modules/API/Filesystem/IPath.cpp
deleted file mode 100644 (file)
index de9b32d..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * 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 <Filesystem/Path.h>
-#include "IPath.h"
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-IPathPtr IPath::create(const std::string& str)
-{
-    return Path::create(str);
-}
-
-IPath::SeparatorType IPath::getSeparator()
-{
-    return Path::getSeparator();
-}
-
-IPath::~IPath()
-{}
-} // API
-} // Filesystem
-} // WrtDeviceApis
diff --git a/src_wearable/modules/API/Filesystem/IPath.h b/src_wearable/modules/API/Filesystem/IPath.h
deleted file mode 100644 (file)
index 3c32abd..0000000
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRTDEVICEAPIS_FILESYSTEM_IPATH_H_
-#define WRTDEVICEAPIS_FILESYSTEM_IPATH_H_
-
-#include <string>
-#include <dpl/shared_ptr.h>
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-class IPath;
-typedef DPL::SharedPtr<IPath> IPathPtr;
-
-class IPath
-{
-  public:
-    typedef char SeparatorType;
-
-  public:
-    /**
-     * Creates path object from specified string.
-     * @param str Path string.
-     * @return Path.
-     * @throw InvalidArgumentException If supplied string is not a valid path.
-     * @throw PlatformException If error in platform occurs.
-     * @remarks Ownership passed to the caller.
-     */
-    static IPathPtr create(const std::string& str);
-
-    /**
-     * Gets separator used by current platform.
-     * @return Path separator.
-     */
-    static SeparatorType getSeparator();
-
-  public:
-    virtual ~IPath() = 0;
-
-    /**
-     * Gets full path.
-     * @return Full path.
-     */
-    virtual std::string getFullPath() const = 0;
-
-    /**
-     * Gets base path (full path w/o name).
-     * @return Base path
-     */
-    virtual std::string getPath() const = 0;
-
-    /**
-     * Gets the last part of path.
-     * @return Path's name.
-     * @return Last part is typically name of a directory or file.
-     */
-    virtual std::string getName() const = 0;
-
-    /**
-     * Appends path specified as string to current path.
-     * @param path Path to append.
-     * @return Current path object.
-     */
-    virtual IPathPtr append(const std::string& path) = 0;
-
-    /**
-     * Appends path specified as path object to current path.
-     * @param path Path to append.
-     * @return Current path object.
-     */
-    virtual IPathPtr append(const IPathPtr& path) = 0;
-
-    /**
-     * Checks if path is abolute.
-     * @return True if absolute, false if relative.
-     */
-    virtual bool isAbsolute() const = 0;
-
-    /**
-     * Clones this object.
-     * @return Independent copy.
-     */
-    virtual IPathPtr clone() const = 0;
-};
-
-inline const IPathPtr operator+(const IPath& lhs,
-                                const IPath& rhs)
-{
-    return IPath::create(lhs.getFullPath())->append(rhs.getFullPath());
-}
-
-inline const IPathPtr operator+(const IPath& lhs,
-                                const std::string& rhs)
-{
-    return IPath::create(lhs.getFullPath())->append(rhs);
-}
-
-inline const IPathPtr operator+(const std::string& lhs,
-                                const IPath& rhs)
-{
-    return IPath::create(lhs)->append(rhs.getFullPath());
-}
-
-inline bool operator==(const IPath& lhs, const IPath& rhs)
-{
-    return (lhs.getFullPath() == rhs.getFullPath());
-}
-
-inline bool operator==(const IPath& lhs, const std::string& rhs)
-{
-    return (lhs.getFullPath() == rhs);
-}
-
-inline bool operator==(const std::string& lhs, const IPath& rhs)
-{
-    return (lhs == rhs.getFullPath());
-}
-
-inline bool operator!=(const IPath& lhs, const IPath& rhs)
-{
-    return (lhs.getFullPath() != rhs.getFullPath());
-}
-
-inline bool operator!=(const IPath& lhs, const std::string& rhs)
-{
-    return (lhs.getFullPath() != rhs);
-}
-
-inline bool operator!=(const std::string& lhs, const IPath& rhs)
-{
-    return (lhs != rhs.getFullPath());
-}
-} // API
-} // Filesystem
-} // WrtDeviceApis
-
-#endif // WRTDEVICEAPIS_FILESYSTEM_IPATH_H_
diff --git a/src_wearable/modules/API/Filesystem/IStream.cpp b/src_wearable/modules/API/Filesystem/IStream.cpp
deleted file mode 100644 (file)
index b18f188..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * 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 "IStream.h"
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-IStream::~IStream()
-{}
-} // API
-} // Filesystem
-} // WrtDeviceApis
diff --git a/src_wearable/modules/API/Filesystem/IStream.h b/src_wearable/modules/API/Filesystem/IStream.h
deleted file mode 100644 (file)
index d39ddb0..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRTDEVICEAPIS_FILESYSTEM_ISTREAM_H_
-#define WRTDEVICEAPIS_FILESYSTEM_ISTREAM_H_
-
-#include <cstddef>
-#include <string>
-#include <dpl/noncopyable.h>
-#include <dpl/shared_ptr.h>
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-class IStream;
-typedef DPL::SharedPtr<IStream> IStreamPtr;
-
-class IStream : private DPL::Noncopyable
-{
-  public:
-    virtual ~IStream() = 0;
-
-    virtual IStreamPtr write(bool arg) = 0;
-    virtual IStreamPtr write(unsigned char arg) = 0;
-    virtual IStreamPtr write(char arg) = 0;
-    virtual IStreamPtr write(int arg) = 0;
-    virtual IStreamPtr write(double arg) = 0;
-    virtual IStreamPtr write(const std::string& arg) = 0;
-
-    virtual IStreamPtr read(bool& arg) = 0;
-    virtual IStreamPtr read(unsigned char& arg) = 0;
-    virtual IStreamPtr read(char& arg) = 0;
-    virtual IStreamPtr read(int& arg) = 0;
-    virtual IStreamPtr read(double& arg) = 0;
-    virtual IStreamPtr read(std::string& arg) = 0;
-
-    /**
-     * Gets characters from stream.
-     * @param num Number of characters to read.
-     * @return Pointer to read buffer.
-     * @throw PlatformException if stream is closed, EOF is set or write-only.
-     * @remarks Passes ownership to the caller.
-     */
-    virtual char* getChars(std::size_t num) = 0;
-
-    /**
-     * Gets bytes from stream.
-     * @param num Number of bytes to read.
-     * @return Pointer to read buffer.
-     * @remarks Passes ownership to the caller.
-     * @throw PlatformException if stream is closed, EOF is set or write-only.
-     */
-    virtual unsigned char* getBytes(std::size_t num) = 0;
-
-    /**
-     * Gets number of bytes read by last getBytes() or getChars() operation.
-     * @return Number of read bytes.
-     * @throw PlatformException if stream is closed or write-only.
-     */
-    virtual std::size_t getCount() const = 0;
-
-    /**
-     * Reads line of characters from stream (till '\n' character).
-     * @return Read line.
-     */
-    virtual std::string getLine() = 0;
-
-    /**
-     * Checks whether stream is open.
-     * @return True if stream is open, false otherwsie.
-     */
-    virtual bool isOpen() const = 0;
-
-    /**
-     * Checks whether End-Of-Line character occured.
-     * @return True if EOF flag was set, false otherwise.
-     */
-    virtual bool isEof() const = 0;
-
-    /**
-     * Closes stream.
-     */
-    virtual void close() = 0;
-
-    /**
-     * Gets current position in stream.
-     * @return Position or -1 if fails.
-     */
-    virtual long getPosition() const = 0;
-
-    /**
-     * Sets current position in stream.
-     * @param position Position to set.
-     */
-    virtual void setPosition(long position) = 0;
-
-    /**
-     * Gets mode stream was opened in.
-     * @return Mode @see Api::Filesystem::AccessMode.
-     */
-    virtual int getMode() const = 0;
-
-    /**
-     * Gets stream's size.
-     * @return Size or -1 if unavailable (e.g. stream is write-only).
-     */
-    virtual long getSize() const = 0;
-};
-} // API
-} // Filesystem
-} // WrtDeviceApis
-
-#endif /* WRTDEVICEAPIS_FILESYSTEM_ISTREAM_H_ */
diff --git a/src_wearable/modules/API/Filesystem/NodeFilter.cpp b/src_wearable/modules/API/Filesystem/NodeFilter.cpp
deleted file mode 100644 (file)
index b26e275..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * 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.
- */
-/**
- * @author          Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
- */
-
-#include "NodeFilter.h"
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-OptionalString NodeFilter::getName() const
-{
-    return m_name;
-}
-
-void NodeFilter::setName(const OptionalString& name)
-{
-    m_name = name;
-}
-
-OptionalDate NodeFilter::getMinCreated() const
-{
-    return m_created.min;
-}
-
-void NodeFilter::setMinCreated(const OptionalDate& date)
-{
-    m_created.min = date;
-}
-
-OptionalDate NodeFilter::getMaxCreated() const
-{
-    return m_created.max;
-}
-
-void NodeFilter::setMaxCreated(const OptionalDate& date)
-{
-    m_created.max = date;
-}
-
-void NodeFilter::setCreated(const OptionalDate& date)
-{
-    m_created.min = m_created.max = date;
-}
-
-OptionalDate NodeFilter::getMinModified() const
-{
-    return m_modified.min;
-}
-
-void NodeFilter::setMinModified(const OptionalDate& date)
-{
-    m_modified.min = date;
-}
-
-OptionalDate NodeFilter::getMaxModified() const
-{
-    return m_modified.max;
-}
-
-void NodeFilter::setMaxModified(const OptionalDate& date)
-{
-    m_modified.max = date;
-}
-
-void NodeFilter::setModified(const OptionalDate& date)
-{
-    m_modified.min = m_modified.max = date;
-}
-
-OptionalSize NodeFilter::getMinSize() const
-{
-    return m_size.min;
-}
-
-void NodeFilter::setMinSize(const OptionalSize& size)
-{
-    m_size.min = size;
-}
-
-OptionalSize NodeFilter::getMaxSize() const
-{
-    return m_size.max;
-}
-
-void NodeFilter::setMaxSize(const OptionalSize& size)
-{
-    m_size.max = size;
-}
-
-void NodeFilter::setSize(const OptionalSize& size)
-{
-    m_size.min = m_size.max = size;
-}
-} // API
-} // Filesystem
-} // WrtDeviceApis
diff --git a/src_wearable/modules/API/Filesystem/NodeFilter.h b/src_wearable/modules/API/Filesystem/NodeFilter.h
deleted file mode 100644 (file)
index 3b77ff3..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * 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.
- */
-/**
- * @author          Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
- */
-
-#ifndef WRTDEVICEAPIS_FILESYSTEM_NODEFILTER_H_
-#define WRTDEVICEAPIS_FILESYSTEM_NODEFILTER_H_
-
-#include <ctime>
-#include <cstddef>
-#include <string>
-#include <boost/optional.hpp>
-#include <dpl/shared_ptr.h>
-#include <Commons/Range.h>
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-typedef boost::optional<std::string> OptionalString;
-typedef boost::optional<std::time_t> OptionalDate;
-typedef boost::optional<std::size_t> OptionalSize;
-
-class NodeFilter
-{
-  public:
-    OptionalString getName() const;
-    void setName(const OptionalString& name);
-
-    OptionalDate getMinCreated() const;
-    void setMinCreated(const OptionalDate& date);
-
-    OptionalDate getMaxCreated() const;
-    void setMaxCreated(const OptionalDate& date);
-
-    void setCreated(const OptionalDate& date);
-
-    OptionalDate getMinModified() const;
-    void setMinModified(const OptionalDate& date);
-
-    OptionalDate getMaxModified() const;
-    void setMaxModified(const OptionalDate& date);
-
-    void setModified(const OptionalDate& date);
-
-    OptionalSize getMinSize() const;
-    void setMinSize(const OptionalSize& size);
-
-    OptionalSize getMaxSize() const;
-    void setMaxSize(const OptionalSize& size);
-
-    void setSize(const OptionalSize& size);
-
-  private:
-    OptionalString m_name;
-    Commons::Range<OptionalDate> m_created;
-    Commons::Range<OptionalDate> m_modified;
-    Commons::Range<OptionalSize> m_size;
-};
-
-typedef DPL::SharedPtr<NodeFilter> NodeFilterPtr;
-} // API
-} // Filesystem
-} // WrtDeviceApis
-
-#endif // WRTDEVICEAPIS_FILESYSTEM_NODEFILTER_H_
diff --git a/src_wearable/modules/API/Filesystem/PathUtils.cpp b/src_wearable/modules/API/Filesystem/PathUtils.cpp
deleted file mode 100644 (file)
index e2ac7de..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * 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.
- */
-/**
- * @author          Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
- */
-
-#include "PathUtils.h"
-#include <dpl/log/log.h>
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-namespace PathUtils {
-PathList getParts(const IPathPtr& path)
-{
-    PathList result;
-    IPath::SeparatorType separator = path->getSeparator();
-    std::string fullPath = path->getFullPath();
-    std::string::size_type pos = 0;
-    while ((pos = fullPath.find(separator, pos + 1)) != std::string::npos) {
-        result.push_back(IPath::create(fullPath.substr(0, pos)));
-    }
-    return result;
-}
-} // PathUtils
-} // API
-} // Filesystem
-} // WrtDeviceApis
diff --git a/src_wearable/modules/API/Filesystem/PathUtils.h b/src_wearable/modules/API/Filesystem/PathUtils.h
deleted file mode 100644 (file)
index 40642f3..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * 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.
- */
-/**
- * @author          Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
- */
-
-#ifndef WRTDEVICEAPIS_FILESYSTEM_PATHUTILS_H_
-#define WRTDEVICEAPIS_FILESYSTEM_PATHUTILS_H_
-
-#include <vector>
-#include "IPath.h"
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-namespace Api {
-namespace PathUtils {
-typedef std::vector<IPathPtr> PathList;
-typedef PathList::iterator PathListIterator;
-
-/**
- * Gets sub-paths of supplied path.
- * The supplied path is not included.
- * @param path
- * @return List of paths.
- */
-PathList getParts(const IPathPtr& path);
-} // PathUtils
-} // API
-} // Filesystem
-} // WrtDeviceApis
-
-#endif // WRTDEVICEAPIS_FILESYSTEM_PATHUTILS_H_
diff --git a/src_wearable/modules/API/Filesystem/config.cmake b/src_wearable/modules/API/Filesystem/config.cmake
deleted file mode 100644 (file)
index a9a514b..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-get_current_path()
-
-set(API_FILESYSTEM_PATH
-    ${CURRENT_PATH}
-    PARENT_SCOPE
-)
-
-set(SRCS_API_FILESYSTEM
-  ${CURRENT_PATH}/IManager.cpp
-  ${CURRENT_PATH}/IPath.cpp
-  ${CURRENT_PATH}/IStream.cpp
-  ${CURRENT_PATH}/EventResolve.cpp
-  ${CURRENT_PATH}/EventCopy.cpp
-  ${CURRENT_PATH}/EventMove.cpp
-  ${CURRENT_PATH}/EventRemove.cpp
-  ${CURRENT_PATH}/EventFind.cpp
-  ${CURRENT_PATH}/EventListNodes.cpp
-  ${CURRENT_PATH}/EventOpen.cpp
-  ${CURRENT_PATH}/EventReadText.cpp
-  ${CURRENT_PATH}/INode.cpp
-  ${CURRENT_PATH}/NodeFilter.cpp
-  ${CURRENT_PATH}/PathUtils.cpp
-  PARENT_SCOPE
-)
-
diff --git a/src_wearable/modules/API/LocalStorage/LocalStorageMgr.cpp b/src_wearable/modules/API/LocalStorage/LocalStorageMgr.cpp
deleted file mode 100644 (file)
index 04e9cc8..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * 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       LocalStorageMgr.cpp
- * @author     Andrzej Surdej (a.surdej@samsung.com)
- * @version    0.1
- * @brief
- */
-#include "LocalStorageMgr.h"
-#include <WidgetInterface/WidgetInterface.h>
-
-namespace WrtDeviceApis {
-namespace LocalStorage {
-namespace Api {
-ILocalStoragePtr getLocalStorage(int widgetId)
-{
-    return ILocalStoragePtr(new WrtDeviceApis::WidgetInterfaceObject(widgetId));
-}
-} // Api
-} // LocalStorage
-} // WrtDeviceApis
diff --git a/src_wearable/modules/API/LocalStorage/LocalStorageMgr.h b/src_wearable/modules/API/LocalStorage/LocalStorageMgr.h
deleted file mode 100644 (file)
index c892376..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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        LocalStorageMgr.h
- * @author      Andrzej Surdej (a.surdej@samsung.com)
- * @version     0.1
- * @brief
- */
-
-#ifndef WRTDEVICEAPIS_LOCALSTORAGE_LOCAL_STORAGE_FACTORY_H
-#define WRTDEVICEAPIS_LOCALSTORAGE_LOCAL_STORAGE_FACTORY_H
-
-#include <LocalStorage/ILocalStorage.h>
-
-namespace WrtDeviceApis {
-namespace LocalStorage {
-namespace Api {
-ILocalStoragePtr getLocalStorage(int widgetId);
-} // Api
-} // LocalStorage
-} // WrtDeviceApis
-
-#endif // WRTDEVICEAPIS_LOCALSTORAGE_LOCAL_STORAGE_FACTORY_H
-
diff --git a/src_wearable/modules/API/PluginManager/PluginManagerFactory.cpp b/src_wearable/modules/API/PluginManager/PluginManagerFactory.cpp
deleted file mode 100644 (file)
index 3866028..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * 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        PluginManagerFactory.cpp
- * @author      Lukasz Marek (l.marek@samsung.com)
- * @version     0.1
- */
-
-#include "PluginManagerFactory.h"
-#include <PluginManager/PluginManager.h>
-
-namespace WrtDeviceApis {
-namespace PluginManager {
-namespace Api {
-PluginManagerFactory::PluginManagerFactory()
-{}
-
-PluginManagerFactory& PluginManagerFactory::getInstance()
-{
-    static PluginManagerFactory instance;
-    return instance;
-}
-
-IPluginManagerPtr PluginManagerFactory::getPluginManager(
-    int widgetHandle,
-    const std::string &objectUri,
-    JSObjectRef object,
-    JSContextRef context) const
-{
-    return IPluginManagerPtr(
-               new PluginManager(widgetHandle, objectUri, object, context));
-}
-}
-}
-}
diff --git a/src_wearable/modules/API/StorageEvent/StorageEvent.cpp b/src_wearable/modules/API/StorageEvent/StorageEvent.cpp
deleted file mode 100644 (file)
index 11068b7..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * 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        StorageEvent.cpp
- * @author      Andrzej Surdej (a.surdej@samsung.com)
- * @version     0.1
- * @brief       Storage event class implementation
- */
-
-#include "StorageEvent.h"
-
-namespace WrtDeviceApis {
-namespace StorageEvent {
-namespace Api {
-StorageEvent::StorageEvent() :
-    m_storageArea(NULL) {}
-
-StorageEvent::StorageEvent(
-    const LocalStorage::Api::ILocalStoragePtr &storageArea) :
-    m_storageArea(storageArea) {}
-
-std::string StorageEvent::getKey() const
-{
-    return m_key;
-}
-
-DPL::OptionalString StorageEvent::getOldValue() const
-{
-    return m_oldValue;
-}
-
-DPL::OptionalString StorageEvent::getNewValue() const
-{
-    return m_newValue;
-}
-std::string StorageEvent::getUrl() const
-{
-    return m_url;
-}
-
-LocalStorage::Api::ILocalStoragePtr StorageEvent::getStorageArea() const
-{
-    return m_storageArea;
-}
-
-void StorageEvent::setKey(const std::string &inKey)
-{
-    m_key = inKey;
-}
-
-void StorageEvent::setOldValue(const std::string &inValue)
-{
-    m_oldValue = DPL::FromUTF8String(inValue);
-}
-
-void StorageEvent::setNewValue(const std::string &inValue)
-{
-    m_newValue = DPL::FromUTF8String(inValue);
-}
-
-void StorageEvent::setUrl(const std::string &inUrl)
-{
-    m_url = inUrl;
-}
-
-void StorageEvent::setStorageArea(
-    const LocalStorage::Api::ILocalStoragePtr &inStorageArea)
-{
-    m_storageArea = inStorageArea;
-}
-} // Api
-} // StorageEvent
-} // WrtDeviceApis
diff --git a/src_wearable/modules/API/TizenServiceEvent/ITizenServiceEvent.h b/src_wearable/modules/API/TizenServiceEvent/ITizenServiceEvent.h
deleted file mode 100644 (file)
index 8882b69..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * 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        ITizenServiceEvent.h
- * @author      Yunchan Cho (yunchan.cho@samsung.com)
- * @version     0.1
- * @brief       Tizen Service event interfece
- */
-
-#ifndef _WRT_PLUGIN_TIZEN_SERVICE_EVENT_INTERFACE_H_
-#define _WRT_PLUGIN_TIZEN_SERVICE_EVENT_INTERFACE_H_
-
-#include <string>
-#include <dpl/shared_ptr.h>
-
-namespace WrtDeviceApis {
-namespace TizenServiceEvent {
-namespace Api {
-class ITizenServiceEvent
-{
-  public:
-    virtual float getScale() const = 0;
-    virtual std::string getBundle() const = 0;
-
-    virtual void setScale(const float scale) = 0;
-    virtual void setBundle(const std::string &bundle) = 0;
-    virtual ~ITizenServiceEvent() {}
-};
-
-typedef DPL::SharedPtr<ITizenServiceEvent> ITizenServiceEventPtr;
-} // Api
-} // TizenServiceEvent
-} // WrtDeviceApis
-
-#endif // _WRT_PLUGIN_TIZEN_SERVICE_EVENT_INTERFACE_H_
diff --git a/src_wearable/modules/API/Widget/IWidget.h b/src_wearable/modules/API/Widget/IWidget.h
deleted file mode 100644 (file)
index 1936ee9..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * 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       IWidget.h
- * @author     Grzegorz Krawczyk (g.krawczyk@samsung.com)
- * @version    0.1
- * @brief
- */
-#ifndef INTERFACE_WIDGET_CONFIG_INFO_H
-#define INTERFACE_WIDGET_CONFIG_INFO_H
-
-#include <string>
-
-#include <dpl/shared_ptr.h>
-
-namespace WrtDeviceApis {
-namespace Widget {
-namespace Api {
-class IWidget;
-typedef DPL::SharedPtr<IWidget> IWidgetPtr;
-
-class IWidget
-{
-  public: // methods
-
-    /**
-     * getter for property from widget config xml
-     * @throw Commons::PlatformException if problem with platform occured
-     * @throw Commons::NullPointerException if problem with platform occured
-     * @throw Commons::SecurityException if wrt forbiden using this function
-     * */
-    virtual std::string getAuthor() const = 0;
-
-    /**
-     * getter for property from widget config xml
-     * @throw Commons::PlatformException if problem with platform occured
-     * @throw Commons::NullPointerException if problem with platform occured
-     * @throw Commons::SecurityException if wrt forbiden using this function
-     * */
-    virtual std::string getAuthorEmail() const = 0;
-
-    /**
-     * getter for property from widget config xml
-     * @throw Commons::PlatformException if problem with platform occured
-     * @throw Commons::NullPointerException if problem with platform occured
-     * @throw Commons::SecurityException if wrt forbiden using this function
-     * */
-    virtual std::string getAuthorHref() const = 0;
-
-    /**
-     * getter for property from widget config xml
-     * @throw Commons::PlatformException if problem with platform occured
-     * @throw Commons::NullPointerException if problem with platform occured
-     * @throw Commons::SecurityException if wrt forbiden using this function
-     * */
-    virtual std::string getDescription() const = 0;
-
-    /**
-     * getter for property from widget config xml
-     * @throw Commons::PlatformException if problem with platform occured
-     * @throw Commons::NullPointerException if problem with platform occured
-     * @throw Commons::SecurityException if wrt forbiden using this function
-     * */
-    virtual std::string getId() const = 0;
-
-    /**
-     * getter for property from widget config xml
-     * @throw Commons::PlatformException if problem with platform occured
-     * @throw Commons::NullPointerException if problem with platform occured
-     * @throw Commons::SecurityException if wrt forbiden using this function
-     * */
-    virtual std::string getName() const = 0;
-
-    /**
-     * getter for property from widget config xml
-     * @throw Commons::PlatformException if problem with platform occured
-     * @throw Commons::NullPointerException if problem with platform occured
-     * @throw Commons::SecurityException if wrt forbiden using this function
-     * */
-    virtual std::string getShortName() const = 0;
-
-    /**
-     * getter for property from widget config xml
-     * @throw Commons::PlatformException if problem with platform occured
-     * @throw Commons::NullPointerException if problem with platform occured
-     * @throw Commons::SecurityException if wrt forbiden using this function
-     * */
-    virtual std::string getVersion() const = 0;
-
-    /**
-     * getter for property from widget config xml
-     * @throw Commons::PlatformException if problem with platform occured
-     * @throw Commons::NullPointerException if problem with platform occured
-     * @throw Commons::SecurityException if wrt forbiden using this function
-     * */
-    virtual unsigned int getHeight() const = 0;
-
-    /**
-     * getter for property from widget config xml
-     * @throw Commons::PlatformException if problem with platform occured
-     * @throw Commons::NullPointerException if problem with platform occured
-     * @throw Commons::SecurityException if wrt forbiden using this function
-     * */
-    virtual unsigned int getWidth() const = 0;
-
-    virtual ~IWidget()
-    {}
-};
-}
-}
-}
-
-#endif
diff --git a/src_wearable/modules/API/WidgetDB/IWidgetDB.h b/src_wearable/modules/API/WidgetDB/IWidgetDB.h
deleted file mode 100644 (file)
index 76ff03f..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * 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        IWidgetDB.h
- * @author      Andrzej Surdej (a.surdej@samsung.com)
- * @version     0.1
- * @brief       Widget interface to access WRT DB
- */
-
-#ifndef WRTDEVICEAPIS_WIDGETDB_IWIDGETDB_H_
-#define WRTDEVICEAPIS_WIDGETDB_IWIDGETDB_H_
-
-#include "IWidgetFeature.h"
-#include <vector>
-#include <dpl/shared_ptr.h>
-
-namespace WrtDeviceApis {
-namespace WidgetDB {
-namespace Api {
-class IWidgetDB;
-typedef DPL::SharedPtr<IWidgetDB> IWidgetDBPtr;
-
-typedef std::vector<IWidgetFeaturePtr> Features;
-
-enum class ConfigAttribute
-{
-    ID,
-    VERSION,
-    DESCRIPTION,
-    LICENSE,
-    LICENSE_HREF,
-    AUTHOR_NAME,
-    AUTHOR_HREF,
-    AUTHOR_EMAIL,
-    NAME,
-    SHORT_NAME,
-    ICON,
-    WIDTH,
-    HEIGHT,
-    INSTALL_PATH,
-    PUBLIC_STORAGE_PATH
-};
-
-enum class InstallationStatus
-{
-    STATUS_INSTALLED,
-    STATUS_LATEST,
-    STATUS_UNINSTALLED
-};
-
-class IWidgetDB
-{
-  public:
-
-    virtual int getWidgetId() const = 0;
-
-    virtual std::string getLanguage() const = 0;
-
-    virtual std::string getConfigValue(ConfigAttribute attribute) const = 0;
-
-    virtual std::string getUserAgent() const = 0;
-
-    virtual InstallationStatus checkInstallationStatus(
-        const std::string& gid,
-        const std::string& name,
-        const std::string& version) const = 0;
-
-    virtual Features getWidgetFeatures() const = 0;
-
-    virtual Features getRegisteredFeatures() const = 0;
-
-    virtual std::string getWidgetInstallationPath() const = 0;
-
-    virtual std::string getWidgetPersistentStoragePath() const = 0;
-
-    virtual std::string getWidgetTemporaryStoragePath() const = 0;
-
-    virtual ~IWidgetDB()
-    {}
-};
-} // Api
-} // WidgetDB
-} // WrtDeviceApis
-
-#endif
-
diff --git a/src_wearable/modules/API/WidgetDB/WidgetDBMgr.cpp b/src_wearable/modules/API/WidgetDB/WidgetDBMgr.cpp
deleted file mode 100644 (file)
index b275f33..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * 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        IWidgetDBMgr.cpp
- * @author      Andrzej Surdej (a.surdej@samsung.com)
- * @version     0.1
- * @brief
- */
-
-#include <WidgetDB/WidgetDB.h>
-#include "IWidgetDB.h"
-#include "WidgetDBMgr.h"
-
-namespace WrtDeviceApis {
-namespace WidgetDB {
-namespace Api {
-IWidgetDBPtr getWidgetDB(int widgetId)
-{
-    return IWidgetDBPtr(new WrtDeviceApis::WidgetDB::WidgetDB(widgetId));
-}
-} // Api
-} // WidgetDB
-} // WrtDeviceApis
diff --git a/src_wearable/modules/API/WidgetDB/WidgetDBMgr.h b/src_wearable/modules/API/WidgetDB/WidgetDBMgr.h
deleted file mode 100644 (file)
index 6de3f99..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * 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        IWidgetDB.h
- * @author      Andrzej Surdej (a.surdej@samsung.com)
- * @version     0.1
- * @brief       Widget interface to access WRT DB
- */
-
-#ifndef WRTDEVICEAPIS_WIDGETDB_WIDGETDB_MGR_H
-#define WRTDEVICEAPIS_WIDGETDB_WIDGETDB_MGR_H
-
-#include "IWidgetDB.h"
-
-namespace WrtDeviceApis {
-namespace WidgetDB {
-namespace Api {
-IWidgetDBPtr getWidgetDB(int widgetId);
-} // Api
-} // WidgetDB
-} // WrtDeviceApis
-
-#endif // WRTDEVICEAPIS_WIDGETDB_WIDGETDB_MGR_H
-
diff --git a/src_wearable/modules/packages/CMakeLists.txt b/src_wearable/modules/packages/CMakeLists.txt
deleted file mode 100644 (file)
index ed3e799..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-# 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.
-#
-
-set(TARGET_MODULE_FILESYSTEM "wrt-plugins-filesystem")
-set(TARGET_MODULE_WIDGET "wrt-plugins-widget")
-set(TARGET_MODULE_LOCALSTORAGE "wrt-plugins-localstorage")
-set(TARGET_MODULE_WIDGET_INTERFACE "wrt-plugins-widget-interface")
-set(TARGET_MODULE_STORAGEEVENT "wrt-plugins-storageevent")
-set(TARGET_MODULE_TIZEN_SERVICE_EVENT "wrt-plugins-tizen-service-event")
-set(TARGET_MODULE_SOFTKEYBOARD_CHANGE_EVENT "wrt-plugins-softkeyboardchange-event")
-set(TARGET_MODULE_WIDGETDB "wrt-plugins-widgetdb")
-set(TARGET_MODULE_PLUGIN_MANAGER "wrt-plugins-plugin-manager")
-
-add_subdirectory(Filesystem)
-add_subdirectory(Widget)
-add_subdirectory(LocalStorage)
-add_subdirectory(WidgetInterface)
-add_subdirectory(WidgetDB)
-add_subdirectory(PluginManager)
-add_subdirectory(StorageEvent)
-add_subdirectory(TizenServiceEvent)
-add_subdirectory(SoftKeyboardChangeEvent)
diff --git a/src_wearable/modules/packages/Filesystem/CMakeLists.txt b/src_wearable/modules/packages/Filesystem/CMakeLists.txt
deleted file mode 100644 (file)
index e5079dc..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-# 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.
-#
-macro(install_header_file HEADER_FILE)
-    INSTALL(FILES ${API_FILESYSTEM_PATH}/${HEADER_FILE}
-        DESTINATION ${DESTINATION_HEADER_PREFIX}/Filesystem)
-endmacro()
-
-set(TARGET_NAME ${TARGET_MODULE_FILESYSTEM})
-
-set(SRCS
-  ${SRCS_API_FILESYSTEM}
-  ${SRCS_PLATFORM_IMPLEMENTATION_FILESYSTEM}
-)
-
-add_library(${TARGET_NAME} SHARED ${SRCS})
-target_link_libraries(${TARGET_NAME}
-   ${LIBS_COMMONS}
-   ${TARGET_COMMONS}
-)
-set_target_properties(${TARGET_NAME} PROPERTIES 
- SOVERSION ${CMAKE_PROJECT_API_VERSION}
- VERSION ${CMAKE_PROJECT_VERSION}
-)
-
-INSTALL(TARGETS ${TARGET_NAME} LIBRARY DESTINATION
-    ${DESTINATION_LIB_PREFIX})
-
-install_header_file(IManager.h)
-install_header_file(INode.h)
-install_header_file(INodeTypes.h)
-install_header_file(IPath.h)
-install_header_file(IStream.h)
-install_header_file(EventResolve.h)
-install_header_file(EventCopy.h)
-install_header_file(EventMove.h)
-install_header_file(EventRemove.h)
-install_header_file(EventFind.h)
-install_header_file(EventListNodes.h)
-install_header_file(EventOpen.h)
-install_header_file(EventReadText.h)
-install_header_file(Enums.h)
-install_header_file(NodeFilter.h)
diff --git a/src_wearable/modules/packages/LocalStorage/CMakeLists.txt b/src_wearable/modules/packages/LocalStorage/CMakeLists.txt
deleted file mode 100644 (file)
index 90d648a..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-# 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.
-#
-set(TARGET_NAME ${TARGET_MODULE_LOCALSTORAGE})
-
-set(SRCS
-  ${SRCS_API_LOCALSTORAGE}
-)
-
-add_library(${TARGET_NAME} STATIC ${SRCS})
-
-target_link_libraries(${TARGET_NAME}
-   ${LIBS_COMMONS}
-   ${TARGET_COMMONS}
-   ${TARGET_MODULE_WIDGET_INTERFACE}
-)
-
diff --git a/src_wearable/modules/packages/SoftKeyboardChangeEvent/CMakeLists.txt b/src_wearable/modules/packages/SoftKeyboardChangeEvent/CMakeLists.txt
deleted file mode 100644 (file)
index 84b9944..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright (c) 2012 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        CMakeLists.txt
-# @author      Yunchan Cho (yunchan.cho@samsung.com)
-# @version     0.1
-
-set(TARGET_NAME ${TARGET_MODULE_SOFTKEYBOARD_CHANGE_EVENT})
-
-set(SRCS
-    ${SRCS_API_SOFTKEYBOARD_CHANGE_EVENT}
-)
-
-add_library(${TARGET_NAME} STATIC ${SRCS})
diff --git a/src_wearable/modules/packages/StorageEvent/CMakeLists.txt b/src_wearable/modules/packages/StorageEvent/CMakeLists.txt
deleted file mode 100644 (file)
index dc9ff0d..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-# 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.
-#
-set(TARGET_NAME ${TARGET_MODULE_STORAGEEVENT})
-
-set(SRCS
-  ${SRCS_API_STORAGE_EVENT}
-)
-
-add_library(${TARGET_NAME} STATIC ${SRCS})
-
-target_link_libraries(${TARGET_NAME}
-   ${TARGET_MODULE_LOCALSTORAGE}
-)
-
diff --git a/src_wearable/modules/packages/WidgetInterface/CMakeLists.txt b/src_wearable/modules/packages/WidgetInterface/CMakeLists.txt
deleted file mode 100644 (file)
index 0ebb5e2..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-# 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.
-#
-
-macro(install_header_file HEADER_FILE)
-    INSTALL(FILES ${API_WIDGET_INTERFACE_PATH}/${HEADER_FILE}
-        DESTINATION ${DESTINATION_HEADER_PREFIX}/WidgetInterface)
-endmacro()
-
-pkg_search_module(dpl-wrt-dao-ro REQUIRED dpl-wrt-dao-ro)
-pkg_search_module(wrt-commons-widget-interface-dao REQUIRED wrt-commons-widget-interface-dao)
-
-include_directories(
-    ${WIDGET_INTERFACE_INCLUDE_DIRS}
-    ${dpl-wrt-dao-ro_INCLUDE_DIRS}
-    ${wrt-commons-widget-interface-dao_INCLUDE_DIRS})
-
-set(TARGET_NAME ${TARGET_MODULE_WIDGET_INTERFACE})
-
-set(SRCS
-    ${SRCS_WIDGET_INTERFACE}
-)
-
-add_library(${TARGET_NAME} SHARED ${SRCS})
-
-target_link_libraries(${TARGET_NAME}
-   ${LIBS_COMMONS}
-   ${dpl-wrt-dao-ro_LIBRARIES}
-   ${wrt-commons-widget-interface-dao_LIBRARIES}
-)
-set_target_properties(${TARGET_NAME} PROPERTIES 
- SOVERSION ${CMAKE_PROJECT_API_VERSION}
- VERSION ${CMAKE_PROJECT_VERSION}
-)
-
-INSTALL(TARGETS ${TARGET_NAME} LIBRARY DESTINATION
-    ${DESTINATION_LIB_PREFIX})
-
-install_header_file(WidgetInterface.h)
diff --git a/src_wearable/modules/tizen/CMakeLists.txt b/src_wearable/modules/tizen/CMakeLists.txt
deleted file mode 100644 (file)
index 3cfc293..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-# 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.
-#
-###############################################################################
-# In this section please add modules that shouldn't be visible directly
-# beyond wac/ subdirectory, i.e. platform wrappers specific for wac -
-# - used only as helpers in AL for wac platform implementation. VConf
-# is a good example, its used i.e. in Power/Battery. Unfortunately order in
-# in which this modules and AL modules are included is significant, i.e. VConf
-# needs to be included before Power as there are some CMake variables set that
-# are used in Power config.cmake file.
-################################################################################
-
-include_config_file(Filesystem)
-include_config_file(Widget)
-include_config_file(LocalStorage)
-include_config_file(WidgetInterface)
-add_subdirectory(WidgetInterface)
-include_config_file(WidgetDB)
-include_config_file(PluginManager)
diff --git a/src_wearable/modules/tizen/Filesystem/Manager.cpp b/src_wearable/modules/tizen/Filesystem/Manager.cpp
deleted file mode 100644 (file)
index 750a214..0000000
+++ /dev/null
@@ -1,623 +0,0 @@
-/*
- * 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 "Manager.h"
-
-#include <unistd.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <pcrecpp.h>
-#include <ctime>
-#include <cstdio>
-#include <sstream>
-#include <fts.h>
-#include <ecore-1/Ecore_File.h>
-#include <eina-1/eina/eina_list.h>
-#include <dpl/log/log.h>
-#include <dpl/scoped_ptr.h>
-#include <dpl/errno_string.h>
-#include <Commons/Exception.h>
-#include <Commons/Regex.h>
-#include <Filesystem/PathUtils.h>
-#include "Node.h"
-#include "Utils.h"
-
-namespace {
-const char* PATH_ROOT = "/opt/media";
-const char* PATH_DOWNLOADS = "/opt/media/Downloads";
-const char* PATH_DOCUMENTS = "/opt/media/Documents";
-const char* PATH_SOUNDS = "/opt/media/Music";
-const char* PATH_IMAGES = "/opt/media/Images";
-const char* PATH_VIDEOS = "/opt/media/Videos";
-const char* PATH_SDCARD = "/opt/storage/sdcard";
-}
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-using namespace Api;
-
-Manager::Locations Manager::m_locations;
-const std::size_t Manager::m_maxPathLength = 256;
-NodeList Manager::m_openedNodes;
-
-bool Manager::fileExists(const std::string &file)
-{
-    errno = 0;
-    struct stat info;
-    memset(&info, 0, sizeof(struct stat));
-    int status = lstat(file.c_str(), &info);
-    if (status == 0) {
-        return true;
-    } else if (errno == ENOENT) {
-        return false;
-    }
-    ThrowMsg(Commons::PlatformException, "Cannot stat file.");
-}
-
-void Manager::addOpenedNode(const INodePtr& node)
-{
-    NodeListIterator it = m_openedNodes.begin();
-    for (; it != m_openedNodes.end(); ++it) {
-        if (node.Get() == (*it).Get()) {
-            //node is added already
-            return;
-        }
-    }
-    m_openedNodes.push_back(node);
-}
-
-void Manager::removeOpenedNode(const INodePtr& node)
-{
-    NodeListIterator it = m_openedNodes.begin();
-    for (; it != m_openedNodes.end(); ++it) {
-        if ((*it).Get() == node.Get()) {
-            m_openedNodes.erase(it);
-            break;
-        }
-    }
-}
-
-bool Manager::checkIfOpened(const IPathPtr& path) const
-{
-    Assert(path);
-    NodeListIterator it = m_openedNodes.begin();
-    for (; it != m_openedNodes.end(); ++it) {
-        Assert(*it);
-        if (*path == *(*it)->getPath()) {
-            return true;
-        }
-    }
-    return false;
-}
-
-Manager::Manager()
-{
-    static bool initialized = init();
-    (void) initialized;
-}
-
-Manager::~Manager()
-{}
-
-IPathPtr Manager::getBasePath() const
-{
-    Locations::const_iterator it = m_locations.find(LT_ROOT);
-    if (it == m_locations.end()) {
-        ThrowMsg(Commons::PlatformException, "Base path not available.");
-    }
-    return it->second;
-}
-
-IPathPtr Manager::getLocationPath(LocationType type) const
-{
-    Locations::const_iterator it = m_locations.find(type);
-    if (it != m_locations.end()) {
-        return it->second->clone();
-    }
-    return IPathPtr();
-}
-
-LocationPaths Manager::getLocationPaths() const
-{
-    LocationPaths result;
-    Locations::const_iterator it = m_locations.begin();
-    for (; it != m_locations.end(); ++it) {
-        result.push_back(it->second->clone());
-    }
-    return result;
-}
-
-LocationTypes Manager::getLocations() const
-{
-    LocationTypes result;
-    Locations::const_iterator it = m_locations.begin();
-    for (; it != m_locations.end(); ++it) {
-        result.push_back(it->first);
-    }
-    return result;
-}
-
-void Manager::getNode(const EventResolvePtr& event)
-{
-    EventRequestReceiver<EventResolve>::PostRequest(event);
-}
-
-std::size_t Manager::getMaxPathLength() const
-{
-    return m_maxPathLength;
-}
-
-void Manager::copy(const EventCopyPtr& event)
-{
-    EventRequestReceiver<EventCopy>::PostRequest(event);
-}
-
-void Manager::move(const EventMovePtr& event)
-{
-    EventRequestReceiver<EventMove>::PostRequest(event);
-}
-
-void Manager::remove(const EventRemovePtr& event)
-{
-    EventRequestReceiver<EventRemove>::PostRequest(event);
-}
-
-void Manager::find(const EventFindPtr& event)
-{
-    EventRequestReceiver<EventFind>::PostRequest(event);
-}
-
-void Manager::find(const IPathPtr& path,
-                   const FiltersMap& filters,
-                   NodeList& result,
-                   const EventFindPtr& event)
-{
-    Try {
-        AssertMsg(path, "path is NULL");
-        FTS *fts;
-        FTSENT *ftsent;
-        std::string pth = path->getFullPath();
-        char * const paths[] = { const_cast<char * const>(pth.c_str()), NULL };
-
-        if ((fts =
-                 fts_open(paths, FTS_PHYSICAL | FTS_NOCHDIR, NULL)) == NULL)
-        {
-            //ERROR
-            int error = errno;
-            LogError(__PRETTY_FUNCTION__ << ": fts_open on "
-                                         << pth
-                                         << " failed with error: "
-                                         << strerror(error));
-            return;
-        }
-
-        while ((ftsent = fts_read(fts)) != NULL) {
-            if (event && event->checkCancelled()) {
-                break;
-            }
-            switch (ftsent->fts_info) {
-            case FTS_DP:
-                //directory in postorder - do nothing
-                break;
-            case FTS_D:
-            case FTS_DC:
-            case FTS_F:
-            case FTS_SL:
-            case FTS_SLNONE:
-            case FTS_DEFAULT:
-                //regular files, symbolic links, directories in preorder
-                //and other file entries that can be processed further
-                if (matchFilters(ftsent->fts_name, *ftsent->fts_statp,
-                                 filters))
-                {
-                    IPathPtr childPath = IPath::create(ftsent->fts_path);
-                    result.push_back(Node::resolve(childPath));
-                }
-                break;
-            case FTS_NS:
-            case FTS_NSOK:
-            case FTS_DOT:
-            case FTS_DNR:
-            case FTS_ERR:
-            default:
-                LogWarning(__PRETTY_FUNCTION__
-                           << ": traversal failed with error: "
-                           << strerror(ftsent->fts_errno));
-                ThrowMsg(Commons::PlatformException,
-                         "Error reading directory");
-            }
-        }
-
-        if (fts_close(fts) == -1) {
-            int error = errno;
-            LogWarning(__PRETTY_FUNCTION__ << ": fts_close failed with error: "
-                                           << strerror(error));
-            ThrowMsg(Commons::PlatformException,
-                     "Could not close platform node.");
-        }
-    }
-    Catch(Commons::Exception) {}
-}
-
-void Manager::copyElement(
-    const std::string &src, const std::string &dest, bool recursive) const
-{
-    LogDebug("Copying src: " << src << " to: " << dest);
-
-    //element is a file:
-    if (EINA_TRUE != ecore_file_is_dir(src.c_str())) {
-        if (EINA_TRUE != ecore_file_cp(src.c_str(), dest.c_str())) {
-            ThrowMsg(Commons::PlatformException, "Failed to copy file");
-        }
-        return;
-    }
-    //element is a directory -> create it:
-    if (EINA_TRUE != ecore_file_mkdir(dest.c_str())) {
-        LogDebug("Failed to create destination directory");
-        ThrowMsg(Commons::PlatformException, "Failed to copy directory");
-    }
-    //copy all elements of directory:
-    if (recursive) {
-        Eina_List* list = ecore_file_ls(src.c_str());
-        void* data;
-        EINA_LIST_FREE(list, data)
-        {
-            Try
-            {
-                copyElement((src + '/' + static_cast<char*>(data)).c_str(),
-                            (dest + '/' + static_cast<char*>(data)).c_str());
-            }
-            Catch(Commons::PlatformException)
-            {
-                //remove rest of the list
-                EINA_LIST_FREE(list, data)
-                {
-                    free(data);
-                }
-                ReThrowMsg(Commons::PlatformException, "Failed to copy element");
-            }
-            free(data);
-        }
-    }
-}
-
-bool Manager::access(const IPathPtr& path,
-                     int accessType) const
-{
-    int amode = 0;
-    if (accessType & AT_EXISTS) {
-        amode |= F_OK;
-    }
-    if (accessType & AT_READ) {
-        amode |= R_OK;
-    }
-    if (accessType & AT_WRITE) {
-        amode |= W_OK;
-    }
-    if (accessType & AT_EXEC) {
-        amode |= X_OK;
-    }
-    return (::access(path->getFullPath().c_str(), amode) == 0);
-}
-
-bool Manager::matchFilters(const std::string& name,
-                           const struct stat& info,
-                           const FiltersMap& filters)
-{
-    FiltersMap::const_iterator it = filters.begin();
-    for (; it != filters.end(); ++it) {
-        if (it->first == FF_NAME) {
-            if (!pcrecpp::RE(it->second).PartialMatch(name)) {
-                return false;
-            }
-        } else if (it->first == FF_SIZE) {
-            std::size_t size;
-            std::stringstream ss(it->second);
-            ss >> size;
-            if (!ss ||
-                (size != static_cast<size_t>(info.st_size)))
-            {
-                return false;
-            }
-        } else if (it->first == FF_CREATED) {
-            std::time_t created;
-            std::stringstream ss(it->second);
-            ss >> created;
-            if (!ss || (created != info.st_ctime)) {
-                return false;
-            }
-        } else if (it->first == FF_MODIFIED) {
-            std::time_t modified;
-            std::stringstream ss(it->second);
-            ss >> modified;
-            if (!ss || (modified != info.st_mtime)) {
-                return false;
-            }
-        }
-    }
-    return true;
-}
-
-void Manager::OnRequestReceived(const EventResolvePtr& event)
-{
-    try {
-        event->setResult(Node::resolve(event->getPath()));
-    } catch (const Commons::PlatformException& ex) {
-        LogError("Exception: " << ex.GetMessage());
-        event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
-    }
-    event->setCancelAllowed(true);
-}
-
-void Manager::checkPaths(
-    Api::IPathPtr &src,
-    Api::IPathPtr &dest)
-{
-    Assert(dest);
-    Assert(src);
-    if (!dest->isAbsolute()) {
-        dest = src->getPath() + *dest;
-    }
-
-    if (src == dest) {
-        ThrowMsg(Commons::PlatformException,
-                 "Destination is same as source: " << src->getFullPath());
-    }
-
-    INodePtr parent;
-    Try {
-        parent = Node::resolve(IPath::create(dest->getPath()));
-    }
-    Catch(Commons::PlatformException) {
-        ReThrowMsg(Commons::PlatformException,
-                   "Could not get destination's parent node.");
-    }
-
-    if (parent->getType() != NT_DIRECTORY) {
-        ThrowMsg(Commons::PlatformException,
-                 "Destination's parent node is not directory.");
-    }
-
-    if (!access(parent->getPath(), AT_WRITE)) {
-        ThrowMsg(Commons::SecurityException,
-                 "Not enough permissions to write to destination.");
-    }
-}
-
-bool Manager::pathExists(const std::string &path)
-{
-    errno = 0;
-    struct stat info;
-    memset(&info, 0, sizeof(struct stat));
-    int status = lstat(path.c_str(), &info);
-    if ((status != 0) && (errno != ENOENT)) {
-        ThrowMsg(Commons::PlatformException,
-                 "No access to platform destination node.");
-    }
-    return 0 == status;
-}
-
-void Manager::OnRequestReceived(const EventCopyPtr& event)
-{
-    Try {
-        INodePtr srcNode = Node::resolve(event->getSource());
-        int requiredAccess;
-        switch (srcNode->getType()) {
-        case NT_DIRECTORY:
-            requiredAccess = AT_EXEC;
-            break;
-        case NT_FILE:
-            requiredAccess = AT_READ;
-            break;
-        }
-        if (!access(srcNode->getPath(), requiredAccess)) {
-            ThrowMsg(Commons::SecurityException,
-                     "Not enough permissions to copy source node.");
-        }
-
-        IPathPtr src = event->getSource();
-        IPathPtr dest = event->getDestination();
-
-        checkPaths(src, dest);
-
-        std::string realSrc = src->getFullPath();
-        std::string realDest = dest->getFullPath();
-
-        if (pathExists(realDest)) {
-            //no owerwrite flag setted -> exception
-            if ((event->getOptions() & OPT_OVERWRITE) == 0) {
-                ThrowMsg(Commons::PlatformException, "Overwrite is not set.");
-            }
-
-            if (event->checkCancelled()) {
-                //file is not copied yet, so we can cancel it now.
-                event->setCancelAllowed(true);
-                return;
-            }
-
-            //destination exist. Need to be removed
-            Try {
-                INodePtr node = Node::resolve(event->getDestination());
-                node->remove(event->getOptions());
-            }
-            Catch(Commons::PlatformException) {
-                LogError("Exception: " << _rethrown_exception.GetMessage());
-                event->setExceptionCode(
-                    Commons::ExceptionCodes::PlatformException);
-            }
-            Catch(Commons::SecurityException) {
-                event->setExceptionCode(
-                    Commons::ExceptionCodes::SecurityException);
-            }
-        }
-        //Destination is not exist. Start copy now.
-        copyElement(realSrc, realDest);
-
-        event->setResult(Node::resolve(dest));
-    } catch (const Commons::PlatformException& ex) {
-        LogError("Exception: " << ex.GetMessage());
-        event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
-    } catch (const Commons::SecurityException& ex) {
-        LogError("Exception: " << ex.GetMessage());
-        event->setExceptionCode(Commons::ExceptionCodes::SecurityException);
-    }
-    //file is copied already so we don't allow cancelling anymore.
-    event->setCancelAllowed(false);
-}
-
-void Manager::OnRequestReceived(const EventMovePtr& event)
-{
-    try {
-        IPathPtr src = event->getSource();
-        IPathPtr dest = event->getDestination();
-
-        INodePtr srcNode = Node::resolve(src);
-        if (!access(srcNode->getParent()->getPath(), AT_WRITE)) {
-            ThrowMsg(Commons::SecurityException,
-                     "Not enough permissions to move source node.");
-        }
-
-        checkPaths(src, dest);
-
-        bool destExists = pathExists(dest->getFullPath());
-
-        if (destExists && (0 == (event->getOptions() & OPT_OVERWRITE))) {
-            ThrowMsg(Commons::PlatformException, "Overwrite is not set.");
-        }
-
-        if (event->checkCancelled()) {
-            //file is not moved yet, so we can cancel it now.
-            event->setCancelAllowed(true);
-            return;
-        }
-
-        errno = 0;
-        if (0 != ::rename(src->getFullPath().c_str(),
-                          dest->getFullPath().c_str()))
-        {
-            int error = errno;
-            switch (error) {
-            case EXDEV:
-            {
-                if (destExists) {
-                    //destination exist. Need to be removed
-                    Try {
-                        INodePtr node = Node::resolve(
-                                event->getDestination());
-                        node->remove(event->getOptions());
-                    }
-                    Catch(Commons::PlatformException) {
-                        LogError("Exception while removing dest directory");
-                        event->setExceptionCode(
-                            Commons::ExceptionCodes::PlatformException);
-                    }
-                    Catch(Commons::SecurityException) {
-                        event->setExceptionCode(
-                            Commons::ExceptionCodes::SecurityException);
-                    }
-                }
-
-                copyElement(src->getFullPath(),
-                            dest->getFullPath());
-                //remove source files
-                Try {
-                    INodePtr node = Node::resolve(event->getSource());
-                    node->remove(event->getOptions());
-                }
-                Catch(Commons::Exception) {
-                    LogError("Exception: "
-                             << _rethrown_exception.GetMessage());
-                }
-                break;
-            }
-            default:
-                ThrowMsg(Commons::PlatformException,
-                         "Error on rename: " << DPL::GetErrnoString(error));
-                break;
-            }
-        }
-
-        event->setResult(Node::resolve(dest));
-    } catch (const Commons::PlatformException& ex) {
-        LogError("Exception: " << ex.GetMessage());
-        event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
-    } catch (const Commons::SecurityException& ex) {
-        LogError("Exception: " << ex.GetMessage());
-        event->setExceptionCode(Commons::ExceptionCodes::SecurityException);
-    }
-    event->setCancelAllowed(false);
-}
-
-void Manager::OnRequestReceived(const EventRemovePtr& event)
-{
-    if (!event->checkCancelled()) {
-        Try {
-            INodePtr node = Node::resolve(event->getPath());
-            node->remove(event->getOptions());
-        }
-        Catch(Commons::PlatformException) {
-            LogError("Exception: " << _rethrown_exception.GetMessage());
-            event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
-        }
-        Catch(Commons::SecurityException) {
-            event->setExceptionCode(Commons::ExceptionCodes::SecurityException);
-        }
-        event->setCancelAllowed(false);
-    } else {
-        event->setCancelAllowed(true);
-    }
-}
-
-void Manager::OnRequestReceived(const EventFindPtr& event)
-{
-    try {
-        NodeList result;
-        find(event->getPath(), event->getFilters(), result, event);
-        event->setResult(result);
-    } catch (const Commons::Exception& ex) {
-        LogError("Exception: " << ex.GetMessage());
-        event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
-    }
-    event->setCancelAllowed(true);
-}
-
-bool Manager::init()
-{
-    m_locations[LT_ROOT] = IPath::create(PATH_ROOT);
-    m_locations[LT_SDCARD] = IPath::create(PATH_SDCARD);
-    setupLocation(LT_DOWNLOADS, PATH_DOWNLOADS);
-    setupLocation(LT_DOCUMENTS, PATH_DOCUMENTS);
-    setupLocation(LT_SOUNDS, PATH_SOUNDS);
-    setupLocation(LT_IMAGES, PATH_IMAGES);
-    setupLocation(LT_VIDEOS, PATH_VIDEOS);
-
-    return true;
-}
-
-void Manager::setupLocation(LocationType location,
-                            const char* path)
-{
-    if (!nodeExists(path)) {
-        try {
-            makePath(path, 0755);
-        } catch (const Commons::PlatformException& ex) {
-            LogError("Exception: " << ex.DumpToString());
-            return;
-        }
-    }
-    m_locations[location] = IPath::create(path);
-}
-} // Filesystem
-} // WrtDeviceApis
diff --git a/src_wearable/modules/tizen/Filesystem/Manager.h b/src_wearable/modules/tizen/Filesystem/Manager.h
deleted file mode 100644 (file)
index fa59e3d..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRTDEVICEAPIS_FILESYSTEM_MANAGER_H_
-#define WRTDEVICEAPIS_FILESYSTEM_MANAGER_H_
-
-#include <map>
-#include <vector>
-#include <cstddef>
-#include <dpl/shared_ptr.h>
-#include <Filesystem/IManager.h>
-#include <Filesystem/IPath.h>
-#include "Node.h"
-#include "Path.h"
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-class Manager : public Api::IManager
-{
-  public:
-    /**
-     * Checks if file exists.
-     * @param real file path.
-     * @return true when file exists, false otherwise.
-     * @throw PlatformException If unable to validate if file exists.
-     */
-    static bool fileExists(const std::string &file);
-
-  public:
-    Manager();
-    ~Manager();
-
-    Api::IPathPtr getBasePath() const;
-
-    Api::IPathPtr getLocationPath(Api::LocationType type) const;
-
-    Api::LocationPaths getLocationPaths() const;
-
-    Api::LocationTypes getLocations() const;
-
-    void getNode(const Api::EventResolvePtr& event);
-
-    std::size_t getMaxPathLength() const;
-
-    void copy(const Api::EventCopyPtr& event);
-
-    void move(const Api::EventMovePtr& event);
-
-    void remove(const Api::EventRemovePtr& event);
-
-    void find(const Api::EventFindPtr& event);
-
-    /**
-     * Finds files in the filesystem whish match specified filters.
-     * @param path Starting path.
-     * @param filter Filters @see FindFilters.
-     * @param result List with found files.
-     * @param event DPL event, if set then search process can be cancelled
-     * @remarks For filter FF_NAME value is treated as perl like regex pattern.
-     *          Use @Regex::escpae() if you want to treat it as normal string.
-     */
-    void find(const Api::IPathPtr& path,
-              const Api::FiltersMap& filter,
-              Api::NodeList& result,
-              const Api::EventFindPtr& event = Api::EventFindPtr(NULL));
-
-    /**
-     * @warning Operates on specified as it is - it DOES NOT take its real path.
-     *          This is because all filesystem operation will probably change
-     *          their approach to real path and will allow to refer to nodes
-     *          only by virtual roots.
-     */
-    bool access(const Api::IPathPtr& path,
-                int accessType) const;
-
-    void addOpenedNode(const Api::INodePtr& node);
-    void removeOpenedNode(const Api::INodePtr& node);
-    bool checkIfOpened(const Api::IPathPtr& path) const;
-
-  protected:
-    bool matchFilters(const std::string& name,
-                      const struct stat& info,
-                      const Api::FiltersMap& filter);
-
-    void OnRequestReceived(const Api::EventResolvePtr& event);
-    void OnRequestReceived(const Api::EventCopyPtr& event);
-    void OnRequestReceived(const Api::EventMovePtr& event);
-    void OnRequestReceived(const Api::EventRemovePtr& event);
-    void OnRequestReceived(const Api::EventFindPtr& event);
-
-  private:
-    typedef std::map<Api::LocationType, Api::IPathPtr> Locations;
-
-  private:
-    /**
-     * Initializes statics of Manager class.
-     * Used only internally.
-     * @return True on success, false otherwsie.
-     */
-    static bool init();
-
-    static void setupLocation(Api::LocationType location,
-                              const char* path);
-
-    void copyElement(const std::string &src,
-                     const std::string &dest,
-                     bool recursive = true) const;
-
-    /**
-     * Check two paths to copy/move. Checks if they are not the same and
-     * required permissions.
-     * @param src
-     * @param dest
-     */
-    void checkPaths(Api::IPathPtr &src, Api::IPathPtr &dest);
-    bool pathExists(const std::string &path);
-
-  private:
-    static Locations m_locations; ///< Paths to default locations.
-    static const std::size_t m_maxPathLength; ///< Maximum path length.
-    static Api::NodeList m_openedNodes; ///< List of nodes that has opened
-                                        // streams.
-};
-} // Filesystem
-} // WrtDeviceApis
-
-#endif // WRTDEVICEAPIS_FILESYSTEM_MANAGER_H_
diff --git a/src_wearable/modules/tizen/Filesystem/Node.cpp b/src_wearable/modules/tizen/Filesystem/Node.cpp
deleted file mode 100644 (file)
index 221285c..0000000
+++ /dev/null
@@ -1,608 +0,0 @@
-/*
- * 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 "Node.h"
-#include <algorithm>
-#include <memory>
-#include <typeinfo>
-#include <sys/types.h>
-#include <cstdio>
-#include <unistd.h>
-#include <fts.h>
-#include <dirent.h>
-#include <errno.h>
-#include <pcrecpp.h>
-#include <sstream>
-#include <Commons/Exception.h>
-#include <Filesystem/PathUtils.h>
-#include <Filesystem/Enums.h>
-#include "Manager.h"
-#include "NodeFilterMatcher.h"
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-using namespace Api;
-
-INodePtr Node::resolve(const IPathPtr& path)
-{
-    struct stat info;
-    if (lstat(path->getFullPath().c_str(), &info) != 0) {
-        LogError("File: " << path->getFullPath().c_str());
-        ThrowMsg(Commons::PlatformException,
-                 "Node does not exist or access denied.");
-    }
-
-    if (!S_ISDIR(info.st_mode) && !S_ISREG(info.st_mode)) {
-        ThrowMsg(Commons::PlatformException,
-                 "Platform node is of unsupported type.");
-    }
-
-    NodeType type = S_ISDIR(info.st_mode) ? NT_DIRECTORY : NT_FILE;
-    NodePtr result(new Node(path, type));
-    return DPL::StaticPointerCast<INode>(result);
-}
-
-IPathPtr Node::getPath() const
-{
-    return IPath::create(m_path->getFullPath());
-}
-
-INodePtr Node::getChild(const IPathPtr& path)
-{
-    if (m_type != NT_DIRECTORY) {
-        ThrowMsg(Commons::PlatformException, "Not a directory.");
-    }
-    return Node::resolve(*m_path + *path);
-}
-
-NodeType Node::getType() const
-{
-    return m_type;
-}
-
-int Node::getPermissions() const
-{
-    return m_perms;
-}
-
-void Node::setPermissions(int perms)
-{
-    m_perms = perms;
-}
-
-Node::NameList Node::getChildNames() const
-{
-    if (m_type != NT_DIRECTORY) {
-        ThrowMsg(Commons::PlatformException, "Node is not directory.");
-    }
-
-    if ((m_perms & PERM_READ) == 0) {
-        ThrowMsg(Commons::SecurityException, "No permission.");
-    }
-
-    DIR* dir = opendir(m_path->getFullPath().c_str());
-    if (!dir) {
-        ThrowMsg(Commons::PlatformException,
-                 "Node has been deleted from platform.");
-    }
-
-    NameList result;
-    errno = 0;
-    int return_code;
-    struct dirent entry;
-    struct dirent *entry_result;
-    for (return_code = readdir_r(dir, &entry, &entry_result);
-            entry_result != NULL && return_code == 0;
-            return_code = readdir_r(dir, &entry, &entry_result)) {
-        if (!strncmp(entry.d_name, ".", 1) ||
-            !strncmp(entry.d_name, "..", 2))
-        {
-            continue;
-        }
-        result.push_back(entry.d_name);
-    }
-    if (return_code != 0 || errno != 0) {
-        ThrowMsg(Commons::PlatformException, "Error while reading directory.");
-    }
-
-    if (closedir(dir) != 0) {
-        ThrowMsg(Commons::PlatformException, "Could not close platform node.");
-    }
-
-    return result;
-}
-
-NodeList Node::getChildNodes(const NodeFilterPtr& filter) const
-{
-    if (m_type != NT_DIRECTORY) {
-        ThrowMsg(Commons::PlatformException, "Node is not directory.");
-    }
-
-    if ((m_perms & PERM_READ) == 0) {
-        ThrowMsg(Commons::SecurityException, "No permission.");
-    }
-
-    DIR* dir = opendir(m_path->getFullPath().c_str());
-    if (!dir) {
-        ThrowMsg(Commons::PlatformException,
-                 "Node has been deleted from platform.");
-    }
-
-    errno = 0;
-    NodeList result;
-    int return_code;
-    struct dirent entry;
-    struct dirent *entry_result;
-    for (return_code = readdir_r(dir, &entry, &entry_result);
-            entry_result != NULL && return_code == 0;
-            return_code = readdir_r(dir, &entry, &entry_result)) {
-        if (!strncmp(entry.d_name, ".", 1) ||
-            !strncmp(entry.d_name, "..", 2))
-        {
-            continue;
-        }
-        Try {
-            Assert(m_path);
-            INodePtr node = Node::resolve(*m_path + entry.d_name);
-            node->setPermissions(getPermissions()); // inherit access rights
-            if (NodeFilterMatcher::match(node, filter)) {
-                result.push_back(node);
-            }
-        }
-        Catch(Commons::PlatformException) {}
-    }
-
-    if (return_code != 0 || errno != 0) {
-        ThrowMsg(Commons::PlatformException, "Error while reading directory.");
-    }
-
-    if (closedir(dir) != 0) {
-        ThrowMsg(Commons::PlatformException, "Could not close platform node.");
-    }
-
-    return result;
-}
-
-void Node::getChildNodes(const EventListNodesPtr& event)
-{
-    LogDebug("ENTER");
-    EventRequestReceiver<EventListNodes>::PostRequest(event);
-}
-
-INodePtr Node::createChild(
-    const IPathPtr& path,
-    NodeType type,
-    int options)
-{
-    if (m_type != NT_DIRECTORY) {
-        ThrowMsg(Commons::PlatformException, "Parent node is not a directory.");
-    }
-
-    if ((m_perms & PERM_WRITE) == 0) {
-        ThrowMsg(Commons::SecurityException, "Not enough permissions.");
-    }
-
-    Assert(m_path);
-    Assert(path);
-    IPathPtr childPath = *m_path + *path;
-    if (exists(childPath)) {
-        ThrowMsg(Commons::PlatformException, "Node already exists.");
-    }
-
-    NodePtr result;
-    switch (type) {
-    case NT_FILE:
-        result.Reset(createAsFile(childPath, options));
-        break;
-    case NT_DIRECTORY:
-        result.Reset(createAsDirectory(childPath, options));
-        break;
-    default:
-        ThrowMsg(Commons::PlatformException, "Unsupported node type.");
-    }
-    if (!!result) {
-        result->m_perms = m_perms;
-    } else {
-        ThrowMsg(Commons::PlatformException, "Node creation error");
-    }
-
-    return DPL::StaticPointerCast<INode>(result);
-}
-
-IStreamPtr Node::open(int mode)
-{
-    if (m_type == NT_DIRECTORY) {
-        ThrowMsg(Commons::PlatformException,
-                 "Cannot attach stream to directory.");
-    }
-
-    if (((mode & AM_READ) && ((m_perms & PERM_READ) == 0)) ||
-        (((mode & AM_WRITE) ||
-          (mode & AM_APPEND)) && ((m_perms & PERM_WRITE) == 0)))
-    {
-        ThrowMsg(Commons::SecurityException, "Not enough permissions.");
-    }
-
-    DPL::Mutex::ScopedLock lock(&m_openStreamsMutex);
-    StreamPtr stream(new Stream(SharedFromThis(), mode));
-    m_openStreams.insert(stream);
-    IManager::getInstance().addOpenedNode(DPL::StaticPointerCast<INode>(
-                                              SharedFromThis()));
-    return DPL::StaticPointerCast<IStream>(stream);
-}
-
-void Node::open(const EventOpenPtr& event)
-{
-    LogDebug("ENTER");
-    EventRequestReceiver<EventOpen>::PostRequest(event);
-}
-
-void Node::remove(int options)
-{
-    switch (m_type) {
-    case NT_FILE:
-        removeAsFile(m_path);
-        break;
-    case NT_DIRECTORY:
-        removeAsDirectory(m_path, (options & OPT_RECURSIVE));
-        break;
-    }
-}
-
-std::size_t Node::getSize() const
-{
-    if (m_type == NT_DIRECTORY) {
-        ThrowMsg(Commons::PlatformException,
-                 "Getting size for directories is not supported.");
-    }
-
-    struct stat info = stat(m_path);
-    if (!S_ISREG(info.st_mode)) {
-        ThrowMsg(Commons::PlatformException,
-                 "Specified node is not a regular file.");
-    }
-
-    return info.st_size;
-}
-
-std::time_t Node::getCreated() const
-{
-    return stat(m_path).st_ctime;
-}
-
-std::time_t Node::getModified() const
-{
-    return stat(m_path).st_mtime;
-}
-
-// TODO Optimize it, maybe store a flag indicating that node is a root.
-INodePtr Node::getParent() const
-{
-    LocationPaths roots = IManager::getInstance().getLocationPaths();
-    for (LocationPaths::iterator it = roots.begin(); it != roots.end(); ++it) {
-        Assert(*it);
-        Assert(m_path);
-        if (*(*it) == *m_path) {
-            return INodePtr();
-        }
-    }
-    return Node::resolve(IPath::create(m_path->getPath()));
-}
-
-int Node::getMode() const
-{
-    int result = 0;
-    struct stat info = stat(m_path);
-    if (info.st_mode & S_IRUSR) {
-        result |= PM_USER_READ;
-    }
-    if (info.st_mode & S_IWUSR) {
-        result |= PM_USER_WRITE;
-    }
-    if (info.st_mode & S_IXUSR) {
-        result |= PM_USER_EXEC;
-    }
-    if (info.st_mode & S_IRGRP) {
-        result |= PM_GROUP_READ;
-    }
-    if (info.st_mode & S_IWGRP) {
-        result |= PM_GROUP_WRITE;
-    }
-    if (info.st_mode & S_IXGRP) {
-        result |= PM_GROUP_EXEC;
-    }
-    if (info.st_mode & S_IROTH) {
-        result |= PM_OTHER_READ;
-    }
-    if (info.st_mode & S_IWOTH) {
-        result |= PM_OTHER_WRITE;
-    }
-    if (info.st_mode & S_IXOTH) {
-        result |= PM_OTHER_EXEC;
-    }
-    return result;
-}
-
-void Node::read(const EventReadTextPtr& event)
-{
-    LogDebug("ENTER");
-    EventRequestReceiver<EventReadText>::PostRequest(event);
-}
-
-void Node::onStreamClose(const StreamPtr& stream)
-{
-    {
-        DPL::Mutex::ScopedLock lock(&m_openStreamsMutex);
-        m_openStreams.erase(stream);
-    }
-    if (m_openStreams.empty()) {
-        IManager::getInstance().removeOpenedNode(DPL::StaticPointerCast<INode>(
-                                                     SharedFromThis()));
-    }
-}
-
-bool Node::exists(const IPathPtr& path)
-{
-    struct stat info;
-    memset(&info, 0, sizeof(struct stat));
-    int status = lstat(path->getFullPath().c_str(), &info);
-    if ((status == 0) || ((status != 0) && (errno != ENOENT))) {
-        return true;
-    }
-    return false;
-}
-
-struct stat Node::stat(const IPathPtr& path)
-{
-    struct stat result;
-    memset(&result, 0, sizeof(struct stat));
-    if (::stat(path->getFullPath().c_str(),
-               &result) != 0)
-    {
-        LogError("File: " << path->getFullPath().c_str());
-        ThrowMsg(Commons::PlatformException, "Node does not exist or no access");
-    }
-    return result;
-}
-
-Node::Node(const IPathPtr& path,
-           NodeType type) :
-    m_path(path),
-    m_type(type),
-    m_perms(PERM_NONE)
-{}
-
-Node* Node::createAsFile(const IPathPtr& path,
-                         int /* options */)
-{
-    LogDebug("ENTER");
-    createAsFileInternal(path);
-    return new Node(path, NT_FILE);
-}
-
-void Node::createAsFileInternal(const IPathPtr& path)
-{
-    LogDebug("ENTER");
-    FILE* file = std::fopen(path->getFullPath().c_str(), "wb");
-    if (!file) {
-        ThrowMsg(Commons::PlatformException,
-                 "Platform node could not be created.");
-    }
-    std::fclose(file);
-}
-
-Node* Node::createAsDirectory(const IPathPtr& path,
-                              int options)
-{
-    if (options & OPT_RECURSIVE) {
-        PathUtils::PathList parts = PathUtils::getParts(path);
-        PathUtils::PathListIterator it = parts.begin();
-        for (; it != parts.end(); ++it) {
-            if (!exists(*it)) {
-                createAsDirectoryInternal(*it);
-            }
-        }
-    }
-    createAsDirectoryInternal(path);
-    return new Node(path, NT_DIRECTORY);
-}
-
-void Node::createAsDirectoryInternal(const IPathPtr& path)
-{
-    if (mkdir(path->getFullPath().c_str(), S_IRWXU | S_IRWXG | S_IROTH |
-              S_IXOTH) != 0)
-    {
-        ThrowMsg(Commons::PlatformException,
-                 "Platform node could not be created.");
-    }
-}
-
-void Node::removeAsFile(const IPathPtr& path)
-{
-    DPL::Mutex::ScopedLock lock(&m_openStreamsMutex);
-    if (!m_openStreams.empty()) {
-        ThrowMsg(Commons::PlatformException, "Node is locked for I/O.");
-    }
-    if (IManager::getInstance().checkIfOpened(path)) {
-        ThrowMsg(Commons::PlatformException, "Node is locked for I/O.");
-    }
-
-    if (unlink(path->getFullPath().c_str()) != 0) {
-        ThrowMsg(Commons::PlatformException,
-                 "Error while removing platform node.");
-    }
-}
-
-void Node::removeAsDirectory(const IPathPtr& path,
-                             bool recursive)
-{
-    Assert(path);
-    if (recursive) {
-        FTS *fts;
-        FTSENT *ftsent;
-        int error = 0;
-        std::string pth = path->getFullPath();
-        char * const paths[] = { const_cast<char * const>(pth.c_str()), NULL };
-
-        if ((fts =
-                 fts_open(paths, FTS_PHYSICAL | FTS_NOCHDIR, NULL)) == NULL)
-        {
-            //ERROR
-            error = errno;
-            LogError(__PRETTY_FUNCTION__ << ": fts_open on "
-                                         << pth
-                                         << " failed with error: "
-                                         << strerror(error));
-            ThrowMsg(Commons::PlatformException, "Failed to traverse Node");
-        }
-
-        while ((ftsent = fts_read(fts)) != NULL) {
-            switch (ftsent->fts_info) {
-            case FTS_D:
-                //directory in preorder - do nothing
-                break;
-            case FTS_DP:
-                //directory in postorder - remove
-                errno = 0;
-                if (rmdir(ftsent->fts_accpath) != 0) {
-                    if (errno == EEXIST) {
-                        ThrowMsg(Commons::PlatformException,
-                                 "Node has child nodes.");
-                    }
-                    ThrowMsg(Commons::PlatformException,
-                             "Error while removing platform node.");
-                }
-                break;
-            case FTS_DC:
-            case FTS_F:
-            case FTS_NSOK:
-            case FTS_SL:
-            case FTS_SLNONE:
-            case FTS_DEFAULT:
-            {
-                //regular files and other objects that can safely be removed
-                IPathPtr file_path = IPath::create(ftsent->fts_path);
-                removeAsFile(file_path);
-                break;
-            }
-            case FTS_NS:
-            case FTS_DOT:
-            case FTS_DNR:
-            case FTS_ERR:
-            default:
-                LogWarning(__PRETTY_FUNCTION__
-                           << ": traversal failed with error: "
-                           << strerror(ftsent->fts_errno));
-                break;
-            }
-        }
-
-        if (fts_close(fts) == -1) {
-            error = errno;
-            LogWarning(__PRETTY_FUNCTION__ << ": fts_close failed with error: "
-                                           << strerror(error));
-        }
-    } else {
-        if (rmdir(path->getFullPath().c_str()) != 0) {
-            if (errno == EEXIST) {
-                ThrowMsg(Commons::PlatformException, "Node has child nodes.");
-            }
-            ThrowMsg(Commons::PlatformException,
-                     "Error while removing platform node.");
-        }
-    }
-}
-
-void Node::OnRequestReceived(const EventListNodesPtr& event)
-{
-    try {
-        NodeList list = event->getNode()->getChildNodes(event->getFilter());
-        event->setResult(list);
-    } catch (const Commons::PlatformException& ex) {
-        LogError("Exception: " << ex.GetMessage());
-        event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
-    } catch (const Commons::SecurityException& ex) {
-        LogError("Exception: " << ex.GetMessage());
-        event->setExceptionCode(Commons::ExceptionCodes::SecurityException);
-    }
-}
-
-void Node::OnRequestReceived(const EventOpenPtr& event)
-{
-    if (!event->checkCancelled()) {
-        try {
-            IStreamPtr result = open(event->getMode());
-            event->setResult(result);
-        } catch (const Commons::PlatformException& ex) {
-            LogError("Exception: " << ex.GetMessage());
-            event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
-        } catch (const Commons::SecurityException& ex) {
-            LogError("Exception: " << ex.GetMessage());
-            event->setExceptionCode(Commons::ExceptionCodes::SecurityException);
-        }
-        //event can be cancelled before executing this code.
-        //when it comes here we doesn't allow it anymore
-        event->setCancelAllowed(false);
-    } else {
-        event->setCancelAllowed(true);
-    }
-}
-
-void Node::OnRequestReceived(const EventReadTextPtr& event)
-{
-    Try {
-        event->setResult(readText());
-        LogDebug("LEAVIN GRACEFULLY");
-    }
-    Catch(Commons::PlatformException) {
-        event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
-    }
-    Catch(Commons::SecurityException) {
-        event->setExceptionCode(Commons::ExceptionCodes::SecurityException);
-    }
-    //this function doesn't change state of the platform,
-    //so we can allow to cancel it and discard results.
-    event->setCancelAllowed(true);
-}
-
-std::string Node::readText()
-{
-    if (m_type != NT_FILE) {
-        ThrowMsg(Commons::PlatformException, "Node is not a file.");
-    }
-
-    if ((m_perms & PERM_READ) == 0) {
-        ThrowMsg(Commons::SecurityException, "No permission.");
-    }
-
-    std::stringstream result;
-    DPL::SharedPtr<Stream> stream(new Stream(SharedFromThis(), AM_READ));
-    while (!stream->isEof()) {
-        result << stream->getLine();
-        if (!stream->isEof()) {
-            result << '\n';
-        }
-    }
-    stream->close();
-    return result.str();
-}
-
-std::string Node::toUri(int /*widgetId*/) const
-{
-    // TODO I believe moving this feature to WrtWrapper would make more sense.
-    return "file://" + m_path->getFullPath();
-}
-} // Filesystem
-} // WrtDeviceApis
diff --git a/src_wearable/modules/tizen/Filesystem/Node.h b/src_wearable/modules/tizen/Filesystem/Node.h
deleted file mode 100644 (file)
index de95317..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRTDEVICEAPIS_FILESYSTEM_NODE_H_
-#define WRTDEVICEAPIS_FILESYSTEM_NODE_H_
-
-#include <ctime>
-#include <cstddef>
-#include <sys/stat.h>
-#include <set>
-#include <dpl/shared_ptr.h>
-#include <dpl/enable_shared_from_this.h>
-#include <dpl/mutex.h>
-
-#include <Filesystem/Enums.h>
-#include <Filesystem/INode.h>
-#include "Path.h"
-#include "Stream.h"
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-class Node :
-    public Api::INode,
-    public DPL::EnableSharedFromThis<Node>
-{
-  public:
-    static Api::INodePtr resolve(const Api::IPathPtr& path);
-
-  public:
-    Api::IPathPtr getPath() const;
-    Api::NodeType getType() const;
-    int getPermissions() const;
-    void setPermissions(int perms);
-    std::size_t getSize() const;
-    std::time_t getCreated() const;
-    std::time_t getModified() const;
-    Api::INodePtr getParent() const;
-    int getMode() const;
-
-    Api::INodePtr getChild(const Api::IPathPtr& path);
-    NameList getChildNames() const;
-    Api::NodeList getChildNodes(
-        const Api::NodeFilterPtr& filter = Api::NodeFilterPtr()) const;
-    void getChildNodes(const Api::EventListNodesPtr& event);
-    Api::INodePtr createChild(const Api::IPathPtr & path,
-                              Api::NodeType,
-                              int options);
-    Api::IStreamPtr open(int mode);
-    void open(const Api::EventOpenPtr& event);
-    void remove(int options);
-    void read(const Api::EventReadTextPtr& event);
-
-    void onStreamClose(const StreamPtr& stream);
-
-  private:
-    typedef std::set<StreamPtr> StreamList;
-
-  private:
-    static bool exists(const Api::IPathPtr& path);
-    static struct stat stat(const Api::IPathPtr& path);
-
-  private:
-    Node(const Api::IPathPtr& path, Api::NodeType type);
-
-    Node* createAsFile(const Api::IPathPtr& path,
-                       int options);
-    void createAsFileInternal(const Api::IPathPtr& path);
-
-    Node* createAsDirectory(const Api::IPathPtr& path,
-                            int options);
-    void createAsDirectoryInternal(const Api::IPathPtr& path);
-
-    void removeAsFile(const Api::IPathPtr& path);
-    void removeAsDirectory(const Api::IPathPtr& path,
-                           bool recursive);
-
-    void OnRequestReceived(const Api::EventListNodesPtr& event);
-    void OnRequestReceived(const Api::EventOpenPtr& event);
-
-    void OnRequestReceived(const Api::EventReadTextPtr& event);
-    std::string readText();
-
-    std::string toUri(int widgetId) const;
-
-  private:
-    Api::IPathPtr m_path;
-    Api::NodeType m_type;
-    int m_perms;
-    StreamList m_openStreams;
-    mutable DPL::Mutex m_openStreamsMutex;
-};
-
-typedef DPL::SharedPtr<Node> NodePtr;
-} // Filesystem
-} // WrtDeviceApis
-
-#endif /* WRTDEVICEAPIS_FILESYSTEM_NODE_H_ */
diff --git a/src_wearable/modules/tizen/Filesystem/NodeFilterMatcher.cpp b/src_wearable/modules/tizen/Filesystem/NodeFilterMatcher.cpp
deleted file mode 100644 (file)
index a464a69..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * 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.
- */
-/**
- * @author          Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
- */
-
-#include "NodeFilterMatcher.h"
-
-#include <pcrecpp.h>
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-using namespace Api;
-
-bool NodeFilterMatcher::match(const INodePtr& value,
-                              const NodeFilterPtr& filter)
-{
-    if (filter) {
-        if (!matchString(value->getPath()->getName(), filter->getName())) {
-            return false;
-        }
-
-        if (!matchRange(value->getCreated(),
-                        filter->getMinCreated(),
-                        filter->getMaxCreated()))
-        {
-            return false;
-        }
-
-        if (!matchRange(value->getModified(),
-                        filter->getMinModified(),
-                        filter->getMaxModified()))
-        {
-            return false;
-        }
-
-        if (!matchRange(value->getSize(),
-                        filter->getMinSize(),
-                        filter->getMaxSize()))
-        {
-            return false;
-        }
-    }
-    return true;
-}
-
-bool NodeFilterMatcher::matchString(const std::string& value,
-                                    const OptionalString& filter)
-{
-    if (!!filter) {
-        return pcrecpp::RE(*filter).PartialMatch(value);
-    }
-    return true;
-}
-
-template<typename Type>
-bool NodeFilterMatcher::matchRange(const Type& value,
-                                   const boost::optional<Type>& min,
-                                   const boost::optional<Type>& max)
-{
-    if ((!!min && (value < *min)) ||
-        (!!max && (value > *max)))
-    {
-        return false;
-    }
-    return true;
-}
-} // Filesystem
-} // WrtDeviceApis
diff --git a/src_wearable/modules/tizen/Filesystem/NodeFilterMatcher.h b/src_wearable/modules/tizen/Filesystem/NodeFilterMatcher.h
deleted file mode 100644 (file)
index c69b330..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * 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.
- */
-/**
- * @author          Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
- */
-
-#ifndef WRTDEVICEAPIS_FILESYSTEM_NODEFILTERMATCHER_H_
-#define WRTDEVICEAPIS_FILESYSTEM_NODEFILTERMATCHER_H_
-
-#include <string>
-#include <boost/optional.hpp>
-#include <Filesystem/INode.h>
-#include <Filesystem/NodeFilter.h>
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-class NodeFilterMatcher
-{
-  public:
-    static bool match(const Api::INodePtr& value,
-                      const Api::NodeFilterPtr& filter);
-
-  private:
-    static bool matchString(const std::string& value,
-                            const Api::OptionalString& filter);
-
-    template<typename Type>
-    static bool matchRange(const Type& value,
-                           const boost::optional<Type>& min,
-                           const boost::optional<Type>& max);
-
-  private:
-    NodeFilterMatcher();
-};
-} // Filesystem
-} // WrtDeviceApis
-
-#endif // WRTDEVICEAPIS_FILESYSTEM_NODEFILTERMATCHER_H_
diff --git a/src_wearable/modules/tizen/Filesystem/Path.cpp b/src_wearable/modules/tizen/Filesystem/Path.cpp
deleted file mode 100644 (file)
index 9aa1197..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * 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 <memory>
-#include <algorithm>
-#include <iterator>
-#include <stdlib.h>
-#include <limits.h>
-#include <dpl/log/log.h>
-#include <dpl/assert.h>
-#include <Commons/Exception.h>
-#include <Commons/StringUtils.h>
-#include "Path.h"
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-using namespace Api;
-
-const Path::SeparatorType Path::m_pathSeparator = '/';
-
-IPathPtr Path::create(const std::string& path)
-{
-    DPL::SharedPtr<Path> result(new Path());
-    result->reset(path);
-    return DPL::StaticPointerCast<IPath>(result);
-}
-
-std::string Path::getFullPath() const
-{
-    return m_fullPath;
-}
-
-std::string Path::getPath() const
-{
-    return m_path;
-}
-
-std::string Path::getName() const
-{
-    return m_name;
-}
-
-IPathPtr Path::append(const std::string& path)
-{
-    reset(m_fullPath + m_pathSeparator + path);
-    return DPL::StaticPointerCast<IPath>(SharedFromThis());
-}
-
-IPathPtr Path::append(const IPathPtr& path)
-{
-    reset(m_fullPath + m_pathSeparator + path->getFullPath());
-    return DPL::StaticPointerCast<IPath>(SharedFromThis());
-}
-
-bool Path::isAbsolute() const
-{
-    return (!m_fullPath.empty() && (m_fullPath[0] == m_pathSeparator));
-}
-
-IPath::SeparatorType Path::getSeparator()
-{
-    return m_pathSeparator;
-}
-
-bool Path::isValid(const std::string& str)
-{
-    return !str.empty();
-}
-
-IPathPtr Path::clone() const
-{
-    return Path::create(m_fullPath);
-}
-
-Path::Path()
-{}
-
-void Path::reset(const std::string& str)
-{
-    if (!isValid(str)) {
-        ThrowMsg(Commons::InvalidArgumentException,
-                 "Not a valid path: " + str + ".");
-    }
-
-    std::string tmp = Commons::String::unique(Commons::String::trim(
-                                                  str), m_pathSeparator);
-    std::string::size_type pos = tmp.find_last_of(m_pathSeparator);
-    if (pos == std::string::npos) {
-        m_fullPath = m_name = tmp;
-        m_path.clear();
-    } else {
-        if (0 == pos) {
-            m_fullPath = m_path = m_pathSeparator;
-        } else {
-            m_fullPath = m_path = tmp.substr(0, pos);
-            m_fullPath += m_pathSeparator;
-        }
-        m_name = tmp.substr(pos + 1);
-        m_fullPath += m_name;
-    }
-}
-} // Filesystem
-} // WrtDeviceApis
diff --git a/src_wearable/modules/tizen/Filesystem/Path.h b/src_wearable/modules/tizen/Filesystem/Path.h
deleted file mode 100644 (file)
index 6c7b314..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRTDEVICEAPIS_FILESYSTEM_PATH_H_
-#define WRTDEVICEAPIS_FILESYSTEM_PATH_H_
-
-#include <string>
-#include <vector>
-#include <dpl/enable_shared_from_this.h>
-#include <Filesystem/IPath.h>
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-class Path : public Api::IPath,
-    public DPL::EnableSharedFromThis<Path>
-{
-  public:
-    static Api::IPathPtr create(const std::string& path);
-    static Api::IPath::SeparatorType getSeparator();
-
-  public:
-    std::string getFullPath() const;
-    std::string getPath() const;
-    std::string getName() const;
-    Api::IPathPtr append(const std::string& path);
-    Api::IPathPtr append(const Api::IPathPtr& path);
-    bool isAbsolute() const;
-    Api::IPathPtr clone() const;
-
-  private:
-    /**
-     * Checks whether specified string is a valid path.
-     * @param path String to verify.
-     * @return True when string is a valid path, false otherwise.
-     */
-    static bool isValid(const std::string& str);
-
-  private:
-    Path();
-    void reset(const std::string& str);
-
-  private:
-    static const SeparatorType m_pathSeparator; ///< Path separator.
-
-  private:
-    std::string m_fullPath; ///< Full path.
-    std::string m_path;   ///< Base path.
-    std::string m_name;   ///< Last part of the path.
-};
-} // Filesystem
-} // WrtDeviceApis
-
-#endif /* WRTDEVICEAPIS_FILESYSTEM_PATH_H_ */
diff --git a/src_wearable/modules/tizen/Filesystem/Stream.cpp b/src_wearable/modules/tizen/Filesystem/Stream.cpp
deleted file mode 100644 (file)
index dabc8a0..0000000
+++ /dev/null
@@ -1,302 +0,0 @@
-/*
- * 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 "Stream.h"
-#include <stdio.h>
-#include <new>
-#include <dpl/assert.h>
-#include <dpl/scoped_array.h>
-#include <Commons/Exception.h>
-#include "Manager.h"
-#include "Node.h"
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-using namespace Api;
-
-Stream::Stream(const NodePtr& parent,
-               int mode) :
-    m_parent(parent),
-    m_mode(mode)
-{
-    AssertMsg(m_parent, "Stream needs to have parent.");
-
-    std::ios_base::openmode mode_ = std::ios_base::binary;
-    if (mode & AM_READ) {
-        mode_ |= std::ios_base::in;
-    }
-    if (mode & AM_WRITE) {
-        mode_ |= std::ios_base::out;
-    } else if (mode &
-               AM_APPEND)
-    {
-        mode_ |= (std::ios_base::app | std::ios_base::out);
-    }
-
-    m_stream.open(m_parent->getPath()->getFullPath().c_str(), mode_);
-    if (!m_stream) {
-        ThrowMsg(Commons::PlatformException, "Could not open stream.");
-    }
-}
-
-Stream::~Stream()
-{
-    close();
-}
-
-IStreamPtr Stream::write(bool arg)
-{
-    return write_(arg);
-}
-
-IStreamPtr Stream::write(unsigned char arg)
-{
-    return write_(arg);
-}
-
-IStreamPtr Stream::write(char arg)
-{
-    return write_(arg);
-}
-
-IStreamPtr Stream::write(int arg)
-{
-    return write_(arg);
-}
-
-IStreamPtr Stream::write(double arg)
-{
-    return write_(arg);
-}
-
-IStreamPtr Stream::write(const std::string& arg)
-{
-    return write_(arg);
-}
-
-IStreamPtr Stream::read(bool& arg)
-{
-    return read_(arg);
-}
-
-IStreamPtr Stream::read(unsigned char& arg)
-{
-    return read_(arg);
-}
-
-IStreamPtr Stream::read(char& arg)
-{
-    return read_(arg);
-}
-
-IStreamPtr Stream::read(int& arg)
-{
-    return read_(arg);
-}
-
-IStreamPtr Stream::read(double& arg)
-{
-    return read_(arg);
-}
-
-IStreamPtr Stream::read(std::string& arg)
-{
-    return read_(arg);
-}
-
-char* Stream::getChars(std::size_t num)
-{
-    checkForReading();
-
-    std::size_t maxChars = num + 1;
-    DPL::ScopedArray<char> result;
-    Try {
-        result.Reset(new char[maxChars]);
-    }
-    Catch(std::bad_alloc) {
-        ThrowMsg(Commons::PlatformException, "Couldn't allocate output buffer.");
-    }
-    if (m_stream.get(result.Get(), maxChars).bad()) {
-        ThrowMsg(Commons::PlatformException,
-                 "Error while reading from the stream.");
-    }
-
-    return result.Release();
-}
-
-unsigned char* Stream::getBytes(std::size_t num)
-{
-    checkForReading();
-
-    DPL::ScopedArray<char> buffer;
-    Try {
-        buffer.Reset(new char[num]);
-    }
-    Catch(std::bad_alloc) {
-        ThrowMsg(Commons::PlatformException, "Couldn't allocate output buffer.");
-    }
-    if (m_stream.read(buffer.Get(), num).bad()) {
-        ThrowMsg(Commons::PlatformException,
-                 "Error while reading from the stream.");
-    }
-
-    return static_cast<unsigned char*>(static_cast<void*>(buffer.Release()));
-}
-
-std::size_t Stream::getCount() const
-{
-    if (!isOpen()) {
-        ThrowMsg(Commons::PlatformException, "Stream is closed.");
-    }
-
-    if (!isReadable()) {
-        ThrowMsg(Commons::PlatformException, "Stream is not readable.");
-    }
-
-    return m_stream.gcount();
-}
-
-std::string Stream::getLine()
-{
-    checkForReading();
-
-    std::string result;
-    std::getline(m_stream, result);
-
-    return result;
-}
-
-bool Stream::isOpen() const
-{
-    return m_stream.is_open();
-}
-
-bool Stream::isEof() const
-{
-    return m_stream.eof();
-}
-
-void Stream::close()
-{
-    if (isOpen()) {
-        m_stream.close();
-        m_parent->onStreamClose(SharedFromThis());
-    }
-}
-
-int Stream::getMode() const
-{
-    return m_mode;
-}
-
-long Stream::getPosition() const
-{
-    return static_cast<long>(m_stream.tellg());
-}
-
-void Stream::setPosition(long position)
-{
-    if (m_stream.rdstate() & std::ios_base::eofbit) {
-        m_stream.clear();
-    }
-    if (!(m_stream.seekg(position)) || !(m_stream.seekp(position))) {
-        ThrowMsg(Commons::PlatformException, "Could not set position.");
-    }
-}
-
-long Stream::getSize() const
-{
-    std::fstream::streampos pos = m_stream.tellg();
-    if (pos == -1) {
-        return -1;
-    }
-
-    if (!m_stream.seekg(0, std::_S_end)) {
-        return -1;
-    }
-
-    long result = m_stream.tellg();
-    m_stream.seekg(pos, std::_S_beg);
-
-    return (result == -1 ? result : result + 1);
-}
-
-template<typename T>
-IStreamPtr Stream::write_(T arg)
-{
-    checkForWriting();
-
-    if (!(m_stream << arg)) {
-        LogError("Error while writing to the stream.");
-        ThrowMsg(Commons::PlatformException,
-                 "Error while writing to the stream.");
-    }
-    m_stream.flush();
-
-    return DPL::StaticPointerCast<IStream>(SharedFromThis());
-}
-
-template<typename T>
-IStreamPtr Stream::read_(T& arg)
-{
-    checkForReading();
-
-    if (!(m_stream >> arg)) {
-        ThrowMsg(Commons::PlatformException,
-                 "Error while reading from the stream.");
-    }
-
-    return DPL::StaticPointerCast<IStream>(SharedFromThis());
-}
-
-bool Stream::isReadable() const
-{
-    return (m_mode & AM_READ);
-}
-
-bool Stream::isWriteable() const
-{
-    return ((m_mode & AM_WRITE) || (m_mode & AM_APPEND));
-}
-
-void Stream::checkForReading() const
-{
-    if (!isOpen()) {
-        ThrowMsg(Commons::PlatformException, "Stream is closed.");
-    }
-
-    if (isEof()) {
-        ThrowMsg(Commons::PlatformException, "Stream is marked as EOF.");
-    }
-
-    if (!isReadable()) {
-        ThrowMsg(Commons::PlatformException, "Stream is not readable.");
-    }
-}
-
-void Stream::checkForWriting() const
-{
-    if (!isOpen()) {
-        LogError("Stream is closed.");
-        ThrowMsg(Commons::PlatformException, "Stream is closed.");
-    }
-
-    if (!isWriteable()) {
-        LogError("Stream is not writeable.");
-        ThrowMsg(Commons::PlatformException, "Stream is not writeable.");
-    }
-}
-} // Filesystem
-} // WrtDeviceApis
diff --git a/src_wearable/modules/tizen/Filesystem/Stream.h b/src_wearable/modules/tizen/Filesystem/Stream.h
deleted file mode 100644 (file)
index 777168f..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * 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.
- */
-#ifndef WRTDEVICEAPIS_FILESYSTEM_STREAM_H_
-#define WRTDEVICEAPIS_FILESYSTEM_STREAM_H_
-
-#include <cstddef>
-#include <fstream>
-#include <dpl/shared_ptr.h>
-#include <dpl/enable_shared_from_this.h>
-#include <Filesystem/IStream.h>
-#include <Filesystem/Enums.h>
-#include <Filesystem/INode.h>
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-class Node;
-typedef DPL::SharedPtr<Node> NodePtr;
-
-class Stream :
-    public Api::IStream,
-    public DPL::EnableSharedFromThis<Stream>
-{
-    friend class Node;
-
-  public:
-    ~Stream();
-
-    Api::IStreamPtr write(bool arg);
-    Api::IStreamPtr write(unsigned char arg);
-    Api::IStreamPtr write(char arg);
-    Api::IStreamPtr write(int arg);
-    Api::IStreamPtr write(double arg);
-    Api::IStreamPtr write(const std::string& arg);
-
-    Api::IStreamPtr read(bool& arg);
-    Api::IStreamPtr read(unsigned char& arg);
-    Api::IStreamPtr read(char& arg);
-    Api::IStreamPtr read(int& arg);
-    Api::IStreamPtr read(double& arg);
-    Api::IStreamPtr read(std::string& arg);
-
-    /**
-     * @throw PlatformException If unable to read from the stream.
-     */
-    unsigned char* getBytes(std::size_t num);
-
-    std::size_t getCount() const;
-
-    /**
-     * @throw PlatformException If unable to read from the stream.
-     */
-    char* getChars(std::size_t num);
-
-    std::string getLine();
-
-    bool isOpen() const;
-    bool isEof() const;
-
-    void close();
-
-    long getPosition() const;
-    void setPosition(long position);
-
-    int getMode() const;
-
-    long getSize() const;
-
-  private:
-    template<typename T>
-    Api::IStreamPtr read_(T& arg);
-    template<typename T>
-    Api::IStreamPtr write_(T arg);
-
-    inline bool isReadable() const;
-    inline bool isWriteable() const;
-    void checkForReading() const;
-    void checkForWriting() const;
-
-  private:
-    Stream(const NodePtr& parent,
-           int mode);
-
-  private:
-    NodePtr m_parent;
-    int m_mode;
-    mutable std::fstream m_stream;
-};
-
-typedef DPL::SharedPtr<Stream> StreamPtr;
-} // Filesystem
-} // WrtDeviceApis
-
-#endif /* WRTDEVICEAPIS_FILESYSTEM_STREAM_H_ */
diff --git a/src_wearable/modules/tizen/Filesystem/Utils.cpp b/src_wearable/modules/tizen/Filesystem/Utils.cpp
deleted file mode 100644 (file)
index fc9cde0..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * 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    Utils.cpp
- * @author  Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
- * @version 1.0
- */
-
-#include <sys/stat.h>
-#include <cerrno>
-#include <cstring>
-#include <cstdlib>
-#include <unistd.h>
-#include <Commons/Exception.h>
-#include "Utils.h"
-
-namespace {
-int try_mkdir(const char* path,
-              mode_t mode)
-{
-    struct stat st;
-    int err = 0;
-
-    if (::stat(path, &st) != 0) {
-        if (::mkdir(path, mode) != 0) {
-            err = -1;
-        }
-    } else if (!S_ISDIR(st.st_mode)) {
-        errno = ENOTDIR;
-        err = -1;
-    }
-
-    return err;
-}
-
-int mkpath(const char* path,
-           mode_t mode)
-{
-    char* copy = ::strdup(path);
-    if (NULL == copy) {
-        return -1;
-    }
-
-    int err = 0;
-    char* ptr = copy;
-    char* slash = NULL;
-
-    while ((0 == err) && (NULL != (slash = ::strchr(ptr, '/')))) {
-        if (slash != ptr) {
-            *slash = '\0';
-            err = try_mkdir(copy, mode);
-            *slash = '/';
-        }
-        ptr = slash + 1;
-    }
-
-    if (0 == err) {
-        err = try_mkdir(path, mode);
-    }
-
-    ::free(copy);
-    return err;
-}
-}
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-bool nodeExists(const std::string& path)
-{
-    struct stat info;
-    if (stat(path.c_str(), &info) == 0) {
-        if (S_ISDIR(info.st_mode)) {
-            return true;
-        }
-    }
-    return false;
-}
-
-void makePath(const std::string& path,
-              mode_t mode)
-{
-    if (mkpath(path.c_str(), mode) == -1) {
-        ThrowMsg(Commons::PlatformException, "Couldn't create path: " << path);
-    }
-}
-}
-}
diff --git a/src_wearable/modules/tizen/Filesystem/Utils.h b/src_wearable/modules/tizen/Filesystem/Utils.h
deleted file mode 100644 (file)
index 2b1eeb3..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * 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    Utils.h
- * @author  Zbigniew Kostrzewa (z.kostrzewa@samsung.com)
- * @version 1.0
- */
-
-#ifndef WRTDEVICEAPIS_FILESYSTEM_UTILS_H_
-#define WRTDEVICEAPIS_FILESYSTEM_UTILS_H_
-
-#include <sys/types.h>
-#include <string>
-
-namespace WrtDeviceApis {
-namespace Filesystem {
-bool nodeExists(const std::string& path);
-
-void makePath(const std::string& path, mode_t mode);
-}
-}
-
-#endif
diff --git a/src_wearable/modules/tizen/Filesystem/config.cmake b/src_wearable/modules/tizen/Filesystem/config.cmake
deleted file mode 100644 (file)
index ed22f05..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-get_current_path()
-
-pkg_search_module(pcrecpp REQUIRED libpcrecpp
-                  ecore REQUIRED ecore-1)
-
-set(INCLUDES_PLATFORM_IMPLEMENTATION_FILESYSTEM
-  ${pcrecpp_INCLUDE_DIRS}
-  ${ecore_INCLUDE_DIRS}
-  PARENT_SCOPE
-)
-
-set(LIBS_PLATFORM_IMPLEMENTATION_FILESYSTEM
-  ${pcrecpp_LIBRARIES}
-  ${ecore_LIBRARIES}
-  PARENT_SCOPE
-)
-
-set(SRCS_PLATFORM_IMPLEMENTATION_FILESYSTEM
-  ${CURRENT_PATH}/Manager.cpp
-  ${CURRENT_PATH}/Node.cpp
-  ${CURRENT_PATH}/Path.cpp
-  ${CURRENT_PATH}/Stream.cpp
-  ${CURRENT_PATH}/NodeFilterMatcher.cpp
-  ${CURRENT_PATH}/Utils.cpp
-  PARENT_SCOPE
-)
diff --git a/src_wearable/modules/tizen/Widget/Widget.h b/src_wearable/modules/tizen/Widget/Widget.h
deleted file mode 100644 (file)
index 1dee043..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * 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       Widget.h
- * @author     Grzegorz Krawczyk (g.krawczyk@samsung.com)
- * @version    0.1
- * @brief
- */
-
-#ifndef PLATFORM_WIDGET_CONFIGURATION_H_
-#define PLATFORM_WIDGET_CONFIGURATION_H_
-
-#include <string>
-
-#include <Commons/WrtAccess/WrtAccess.h>
-
-#include <Widget/IWidget.h>
-#include <WidgetDB/IWidgetDB.h>
-#include "Property.h"
-
-namespace WrtDeviceApis {
-namespace Widget {
-class Widget : public Api::IWidget
-{
-  public:
-
-    explicit Widget();
-    ~Widget();
-
-    virtual std::string getAuthor() const;
-    virtual std::string getAuthorEmail() const;
-    virtual std::string getAuthorHref() const;
-    virtual std::string getDescription() const;
-    virtual std::string getId() const;
-    virtual std::string getName() const;
-    virtual std::string getShortName() const;
-    virtual std::string getVersion() const;
-    virtual unsigned int getHeight() const;
-    virtual unsigned int getWidth() const;
-
-  protected:
-
-    mutable StringProperty m_author;
-    mutable StringProperty m_authorEmail;
-    mutable StringProperty m_authorHref;
-    mutable StringProperty m_description;
-    mutable StringProperty m_id;
-    mutable StringProperty m_name;
-    mutable StringProperty m_shortName;
-    mutable StringProperty m_version;
-    mutable UIntProperty m_height;
-    mutable UIntProperty m_width;
-
-  private:
-
-    std::string getProperty(WidgetDB::Api::ConfigAttribute) const;
-    void checkWidgetId() const;
-
-    int m_widgetId;
-};
-}
-}
-
-#endif
diff --git a/src_wearable/modules/tizen/WidgetDB/WidgetDB.h b/src_wearable/modules/tizen/WidgetDB/WidgetDB.h
deleted file mode 100644 (file)
index b471e1a..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * 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        WidgetDB.h
- * @author      Andrzej Surdej (a.surdej@samsung.com)
- * @version     0.1
- * @brief
- */
-
-#ifndef WRTDEVICEAPIS_WIDGETDB_WIDGETDB_H_
-#define WRTDEVICEAPIS_WIDGETDB_WIDGETDB_H_
-
-#include <string>
-#include <WidgetDB/IWidgetDB.h>
-
-namespace WrtDeviceApis {
-namespace WidgetDB {
-class WidgetDB : public Api::IWidgetDB
-{
-  public:
-
-    explicit WidgetDB(int widgetId);
-
-    virtual int getWidgetId() const;
-
-    virtual std::string getLanguage() const;
-
-    virtual std::string getConfigValue(Api::ConfigAttribute attribute) const;
-
-    virtual std::string getUserAgent() const;
-
-    virtual Api::InstallationStatus checkInstallationStatus(
-        const std::string& gid,
-        const std::string& name,
-        const std::string& version) const;
-
-    virtual Api::Features getWidgetFeatures() const;
-
-    virtual Api::Features getRegisteredFeatures() const;
-
-    virtual std::string getWidgetInstallationPath() const;
-
-    virtual std::string getWidgetPersistentStoragePath() const;
-
-    virtual std::string getWidgetTemporaryStoragePath() const;
-
-  private:
-
-    int m_widgetId;
-};
-} // WidgetDB
-} // WrtDeviceApis
-
-#endif // WRTDEVICEAPIS_WIDGETDB_WIDGETDB_H
-
diff --git a/src_wearable/modules/tizen/WidgetInterface/CMakeLists.txt b/src_wearable/modules/tizen/WidgetInterface/CMakeLists.txt
deleted file mode 100644 (file)
index 883f3d1..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-
-get_current_path()
-
-pkg_search_module(wrt-commons-widget-interface-dao REQUIRED wrt-commons-widget-interface-dao)
-
-include_directories(${CURRENT_PATH})
diff --git a/src_wearable/plugin-loading/CMakeLists.txt b/src_wearable/plugin-loading/CMakeLists.txt
deleted file mode 100644 (file)
index fbcf48a..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-# 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     CMakeLists.txt
-# @author   Lukasz Marek (l.marek@samsung.com)
-# @version  1.0
-#
-
-pkg_search_module(plugin-types REQUIRED wrt-plugins-types)
-pkg_search_module(dpl REQUIRED dpl-efl)
-pkg_search_module(dpl-event REQUIRED dpl-event-efl)
-pkg_search_module(dpl-wrt-dao-ro REQUIRED dpl-wrt-dao-ro)
-pkg_search_module(webkit2 REQUIRED ewebkit2)
-
-set(PLUGIN_LOADING_SOURCES
-    ${PLUGIN_LOADING_DIRS}/plugin_logic.cpp
-    ${PLUGIN_LOADING_DIRS}/plugin.cpp
-    ${PLUGIN_LOADING_DIRS}/plugin_model.cpp
-    ${PLUGIN_LOADING_DIRS}/explorer.cpp
-    ${PLUGIN_LOADING_DIRS}/plugin_iframe_support.cpp
-    ${PLUGIN_LOADING_DIRS}/plugin_container_support.cpp
-    ${PLUGIN_LOADING_DIRS}/plugin_property_support.cpp
-    ${PLUGIN_LOADING_DIRS}/javascript_interface.cpp
-    ${PLUGIN_LOADING_DIRS}/js_page_session.cpp
-)
-
-INCLUDE_DIRECTORIES(
-    ${PLUGIN_MODULE_SRC_DIR}
-    ${PLUGIN_LOADING_DIRS}
-    ${webkit2_INCLUDE_DIRS}
-    ${plugin-types_INCLUDE_DIRS}
-)
-
-ADD_LIBRARY(${TARGET_PLUGIN_LOADING_LIB} SHARED
-    ${PLUGIN_LOADING_SOURCES}
-)
-
-SET_TARGET_PROPERTIES(${TARGET_PLUGIN_LOADING_LIB} PROPERTIES
-    COMPILE_FLAGS -fPIC
-    LINK_FLAGS "-Wl,--as-needed -Wl,--hash-style=both"
-)
-
-SET_TARGET_PROPERTIES(${TARGET_PLUGIN_LOADING_LIB} PROPERTIES
-    SOVERSION ${CMAKE_PROJECT_API_VERSION}
-    VERSION ${CMAKE_PROJECT_VERSION}
-)
-
-target_link_libraries(${TARGET_PLUGIN_LOADING_LIB}
-    ${dpl_LIBRARIES}
-    ${dpl-event_LIBRARIES}
-    ${dpl-wrt-dao-ro_LIBRARIES}
-    ${TARGET_COMMONS}
-    ${TARGET_JS_OVERLAY}
-    wrt-plugins-tizen-service-event # static lib
-    wrt-plugins-softkeyboardchange-event       # static lib
-)
-
-INSTALL(TARGETS ${TARGET_PLUGIN_LOADING_LIB}
-    DESTINATION lib
-    PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
-    GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
-)
-
-# For wrt-plugins
-INSTALL(FILES
-    ${PLUGIN_LOADING_DIRS}/plugin_logic.h
-    ${PLUGIN_LOADING_DIRS}/js_types.h
-    DESTINATION include/wrt-plugin-loading)
diff --git a/src_wearable/plugin-loading/explorer.h b/src_wearable/plugin-loading/explorer.h
deleted file mode 100644 (file)
index 60d2fb6..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * 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    explorer.h
- * @author  Grzegorz Krawczyk (g.krawczyk@samgsung.com)
- * @version
- * @brief
- */
-
-#ifndef WRT_SRC_PLUGIN_SERVICE_EXPLORER_H_
-#define WRT_SRC_PLUGIN_SERVICE_EXPLORER_H_
-
-#include <string>
-
-#include <dpl/noncopyable.h>
-#include <dpl/exception.h>
-#include <dpl/shared_ptr.h>
-
-#include <Commons/JSObject.h>
-#include <Commons/JSObjectDeclaration.h>
-//JSGlobalContextRef
-#include "javascript_interface.h"
-#include "plugin_iframe_support.h"
-#include "plugin_property_support.h"
-
-//JS overlay
-#include <js_overlay_types.h>
-
-using namespace PluginModule;
-using namespace WrtPlugins::W3C;
-
-class Explorer : private DPL::Noncopyable
-{
-  public:
-    explicit Explorer(JSGlobalContextRef context);
-    ~Explorer();
-
-    //register to global frame
-    bool registerObject(const JSObjectDeclarationPtr& declaration,
-                        JSGlobalContextRef context);
-
-    bool registerObject (const JSObjectDeclarationPtr& declaration,
-                         const std::string& parentObjectName,
-                         JSObjectPtr parentObject,
-                         JSGlobalContextRef context);
-
-    void deregisterObject(const JSObjectDeclarationPtr& declaration);
-
-    // new load/unload frame API
-    void loadFrame(JSGlobalContextRef context);
-    void unloadFrame(JSGlobalContextRef context);
-
-    void removePluginsFromIframes();
-    void cleanIframesData();
-    void callEventListeners(CustomEventType eventType, void* data);
-
-    WindowPropertySupport* getWindowPropertySupport();
-
-  private:
-
-    IframesSupport m_iframeSupport;
-
-    //globalContext
-    JSGlobalContextRef m_context;
-
-    //global object of main frame
-    JSObjectPtr m_globalObject;
-
-    std::unique_ptr<WindowPropertySupport> m_propertySupport;
-
-  private:
-    void registerObjectIntoIframe(const JSObjectDeclarationPtr& declaration,
-                                  JSObjectPtr parentObject,
-                                  JSGlobalContextRef context);
-
-    bool register_(const JSObjectDeclarationPtr& declaration,
-                   JSObjectPtr parent,
-                   JSGlobalContextRef context);
-
-    JSObjectPtr getJSObjectProperty(const std::string& propertyName,
-                                    JSObjectPtr object);
-
-    JSObjectPtr getProperty(
-        const std::string& requestedProperty,
-        JSObjectPtr providedObject);
-};
-
-typedef DPL::SharedPtr<Explorer> ExplorerPtr;
-#endif
diff --git a/src_wearable/plugin-loading/plugin.h b/src_wearable/plugin-loading/plugin.h
deleted file mode 100644 (file)
index 1eb277f..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * 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        plugin.h
- * @author      Przemyslaw Dobrowolski (p.dobrowolsk@samsung.com)
- * @version     1.0
- * @brief       This file is the implementation file of plugin
- */
-#ifndef WRT_SRC_PLUGIN_SERVICE_PLUGIN_H_
-#define WRT_SRC_PLUGIN_SERVICE_PLUGIN_H_
-
-#include <list>
-#include <map>
-#include <string>
-#include <dpl/atomic.h>
-#include <dpl/shared_ptr.h>
-#include <dpl/noncopyable.h>
-#include <wrt_plugin_export.h>
-#include <Commons/JSObjectDeclaration.h>
-
-class Plugin;
-typedef DPL::SharedPtr<Plugin> PluginPtr;
-
-class Plugin : private DPL::Noncopyable
-{
-  public:
-    typedef JSObjectDeclaration Class;
-    typedef JSObjectDeclarationPtr ClassPtr;
-    typedef std::list<ClassPtr> ClassList;
-    typedef DPL::SharedPtr<ClassList> ClassPtrList;
-
-  private:
-    ///< Plug-in identifier. Currently plug-in file name is used as the ID
-    std::string m_fileName;
-
-    ///< Handle for the plug-in library. A plug-in is a dynamic loadable library
-    void* m_libHandle;
-
-    // Plugin API
-    on_widget_start_proc* m_apiOnWidgetStart;
-    on_widget_init_proc* m_apiOnWidgetInit;
-    on_widget_stop_proc* m_apiOnWidgetStop;
-    on_frame_load_proc* m_apiOnFrameLoad;
-    on_frame_unload_proc* m_apiOnFrameUnload;
-    const ClassPtrList m_apiClassList;
-
-    Plugin(const std::string &fileName,
-           void *libHandle,
-           on_widget_start_proc* apiOnWidgetStart,
-           on_widget_init_proc* apiOnWidgetInit,
-           on_widget_stop_proc* apiOnWidgetStop,
-           on_frame_load_proc* apiOnFrameLoad,
-           on_frame_unload_proc* apiOnFrameUnload,
-           const ClassPtrList &apiClassList);
-
-  public:
-    virtual ~Plugin();
-
-    // Loading
-    static PluginPtr LoadFromFile(const std::string &fileName);
-
-    // Filename
-    std::string GetFileName() const;
-
-    // API
-    void OnWidgetStart(int widgetId);
-
-    void OnWidgetInit(feature_mapping_interface_t *interface);
-
-    void OnWidgetStop(int widgetId);
-
-    void OnFrameLoad(java_script_context_t context);
-
-    void OnFrameUnload(java_script_context_t context);
-
-    const ClassPtrList GetClassList() const;
-};
-
-#endif // PLUGIN_H
diff --git a/src_wearable/plugin-loading/plugin_container_support.cpp b/src_wearable/plugin-loading/plugin_container_support.cpp
deleted file mode 100644 (file)
index 064e8a4..0000000
+++ /dev/null
@@ -1,270 +0,0 @@
-/*
- * 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        plugin_container_support.h
- * @author      Grzegorz Krawczyk (g.krawczyk@samsung.com)
- * @version     1.0
- */
-
-#include "plugin_container_support.h"
-
-#include <fstream>
-
-#include <dpl/log/secure_log.h>
-#include <dpl/foreach.h>
-#include <dpl/wrt-dao-ro/feature_dao_read_only.h>
-#include <dpl/wrt-dao-ro/global_config.h>
-
- using namespace WrtDB;
-
-#include <dpl/wrt-dao-ro/widget_dao_read_only.h>
-
-PluginContainerSupport::PluginContainerSupport() :
-    m_initialized(false),
-    m_widgetHandle(0)
-{
-     // Reading root plugins list from so files
-    readRootPluginsList();
-}
-
-PluginContainerSupport::~PluginContainerSupport()
-{
-    // Remove all plugin models
-    m_pluginModels.clear();
-
-    // Remove all feature models
-    m_featureModels.clear();
- }
-
-void PluginContainerSupport::Initialize(int widgetHandle)
-{
-    if (isInitialized() == true && m_widgetHandle != widgetHandle) {
-        // re-initialize required
-        m_initialized = false;
-
-        m_pluginModels.clear();
-        m_featureModels.clear();
-    }
-
-    if (isInitialized() == false) {
-        m_initialized = true;
-        m_widgetHandle = widgetHandle;
-
-        readAllowedPlugins(widgetHandle);
-        readRootPlugins(widgetHandle);
-    }
-}
-
-std::list<std::string> PluginContainerSupport::getAllowedFeatures(
-    int widgetHandle) const
-{
-    //TODO it has to return LIST NOT SET!!!
-    WidgetDAOReadOnly widgetDao(widgetHandle);
-    DbWidgetFeatureSet features = widgetDao.getFeaturesList();
-
-    std::list<std::string> allowedFeatures;
-    FOREACH(it, features) {
-        _D("Loading api-feature: %s", DPL::ToUTF8String(it->name).c_str());
-        if (it->rejected) {
-            _W("Api-feature was rejected by ace. (Api-feature name: %s)",
-               it->name.c_str());
-            continue;
-        }
-
-        allowedFeatures.push_back(DPL::ToUTF8String(it->name));
-    }
-    return allowedFeatures;
-}
-
-void PluginContainerSupport::readAllowedPlugins(int widgetHandle)
-{
-    std::list<std::string> allowedFeatures;
-    auto requested = getAllowedFeatures(widgetHandle);
-    FOREACH(f, requested)
-    {
-        allowedFeatures.push_back(*f);
-    }
-
-    FeatureData* dt = NULL;
-    std::map<FeatureHandle,
-             FeatureData> featureDataList = FeatureDAOReadOnly::GetFeatures(
-            allowedFeatures);
-    DeviceCapList deviceCapabilities =
-        FeatureDAOReadOnly::GetDevCapWithFeatureHandle();
-    FOREACH(data, featureDataList) {
-        dt = &(data->second);
-        registerPluginModel(dt->pluginHandle);
-        registerFeatureModel(data->first, dt, deviceCapabilities);
-    }
-}
-
-void PluginContainerSupport::readRootPlugins(int widgetHandle)
-{
-    WidgetDAOReadOnly dao(widgetHandle);
-    WidgetType appType = dao.getWidgetType();
-    if (appType == WrtDB::APP_TYPE_TIZENWEBAPP) {
-         FOREACH(it_rootPluginHandle, m_rootPluginsList)
-        {
-            _D("*it_rootPluginHandle: %d", *it_rootPluginHandle);
-            registerPluginModel(*it_rootPluginHandle);
-        }
-    } else {
-        _D("Not defined app type");
-    }
-}
-
-void PluginContainerSupport::registerFeatureModel(
-    FeatureHandle handle,
-    FeatureData* data,
-    DeviceCapList
-    deviceCapabilities)
-{
-    FeatureModelPtr model = getFeatureModel(handle);
-    if (model) {
-        _D("Model for feature: %d already created", handle);
-        return;
-    }
-
-    _D("Creating Model for feature: %d", handle);
-
-    model.reset(new FeatureModel(handle));
-
-    std::set<std::string> devCapList;
-    auto ret = deviceCapabilities.equal_range(handle);
-    for (auto devCapIt = ret.first; devCapIt != ret.second; devCapIt++) {
-        devCapList.insert((*devCapIt).second);
-    }
-    model->SetData(data->featureName, devCapList, data->pluginHandle);
-    m_featureModels.insert(model);
-}
-
-void PluginContainerSupport::registerPluginModel(DbPluginHandle handle)
-{
-    PluginModelPtr model = getPluginModelById(handle);
-
-    if (model) {
-        _D("Model for plugin: %d already registered", handle);
-        return;
-    }
-
-    if (PluginDAOReadOnly::INSTALLATION_COMPLETED !=
-        PluginDAOReadOnly::getInstallationStateForHandle(handle))
-    {
-        _W("Failed To CreateModel for handle %d", handle);
-        return;
-    }
-
-    model.Reset(new PluginModel(handle));
-
-    \r_D("Model Created. Handle: %d, name: %s",
-       handle,
-       model->LibraryName.Get().c_str());
-
-    m_pluginModels.insert(model);
-}
-
-void PluginContainerSupport::readRootPluginsList()
-{
-    _D("Reading root plugins list from so files...");
-    m_rootPluginsList = PluginDAOReadOnly::getRootPluginHandleList();
-}
-
-FeatureModelPtr
-PluginContainerSupport::getFeatureModel(const std::string &name) const
-{
-    FOREACH(iter, m_featureModels)
-    {
-        if ((*iter)->Name.Get() == name) {
-            return *iter;
-        }
-    }
-
-    return FeatureModelPtr();
-}
-
-FeatureModelPtr
-PluginContainerSupport::getFeatureModel(const FeatureHandle handle) const
-{
-    FOREACH(iter, m_featureModels)
-    {
-        if ((*iter)->FHandle.Get() == handle) {
-            return *iter;
-        }
-    }
-
-    return FeatureModelPtr();
-}
-
-PluginModelPtr
-PluginContainerSupport::getPluginModelById(DbPluginHandle handle) const
-{
-    FOREACH(pluginModel, m_pluginModels)
-    {
-        if ((*pluginModel)->Handle.Get() == handle) {
-            return *pluginModel;
-        }
-    }
-
-    return PluginModelPtr();
-}
-
-PluginModelPtr
-PluginContainerSupport::getPluginModel(const FeatureModelPtr &feature) const
-{
-    if (!feature) {
-        _D("Null Ptr for feature model");
-        return PluginModelPtr();
-    } else {
-        _D("Feature located in plugin: %d", feature->PHandle.Get());
-        return getPluginModelById(feature->PHandle.Get());
-    }
-}
-
- PluginContainerSupport::PluginsList
-PluginContainerSupport::getRootPlugins() const
-{
-    PluginsList plugins;
-
-    FOREACH(it, m_rootPluginsList) {
-        PluginModelPtr plugin = getPluginModelById(*it);
-        if (!plugin) {
-            _W("PluginModel not found");
-            continue;
-        }
-
-        plugins.push_back(plugin);
-    }
-
-    return plugins;
-}
-
-PluginContainerSupport::PluginsList
-PluginContainerSupport::getPluginsList() const
-{
-    PluginsList plugins;
-
-    FOREACH(it, m_pluginModels) {
-        plugins.push_back(*it);
-    }
-
-    return plugins;
-}
-
-PluginModelPtr
-PluginContainerSupport::getPluginForFeature(const std::string& featureName)
-{
-    return getPluginModel(getFeatureModel(featureName));
-}
diff --git a/src_wearable/plugin-loading/plugin_logic.h b/src_wearable/plugin-loading/plugin_logic.h
deleted file mode 100644 (file)
index fb965c5..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * 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        plugin_logic.h
- * @author      Piotr Fatyga (p.fatyga@samsung.com)
- * @author      Grzegorz Krawczyk (g.krawczyk@samsung.com)
- * @author      Przemyslaw Dobrowolski (p.dobrowolsk@samsung.com)
- * @version     1.0
- * @brief       This file is the implementation file of plugin and feature
- *              loading routines
- * @brief       This code is intended to work behind view controller
- */
-#ifndef PLUGIN_LOGIC_H
-#define PLUGIN_LOGIC_H
-
-#include <memory>
-#include <vector>
-#include <set>
-#include <dpl/singleton.h>
-#include <dpl/noncopyable.h>
-#include <dpl/wrt-dao-ro/plugin_dao_read_only.h>
-#include <js_overlay_types.h>
-#include <js_types.h>
-#include <Commons/Deprecated.h>
-
-using namespace WrtPlugins::W3C;
-
-class PluginLogic : DPL::Noncopyable
-{
-  public:
-    // Widget session
-    void initSession(int widgetHandle);
-    void startSession(int widgetHandle,
-                      JSGlobalContextRef view,
-                      double scaleFactor,
-                      const char* encodedBundle,
-                      const char* theme);
-
-    void stopSession(JSGlobalContextRef context);
-
-    //TODO im not sure if it is needed. I think it should be hidden
-    void performLibrariesUnload();
-    bool loadPluginOnDemand(const WrtDB::DbPluginHandle &pluginHandle,
-                            JavaScriptObject& parentObject,
-                            JSGlobalContextRef context);
-
-    WRT_PLUGINS_DEPRECATED void loadPluginsIntoIframes(
-        JSGlobalContextRef context);
-
-    void loadFrame(JSGlobalContextRef context);
-    void unloadFrame(JSGlobalContextRef context);
-
-    // reset custom window properties. (Tizen requirements)
-    WRT_PLUGINS_DEPRECATED void setCustomProperties(double scaleFactor,
-                                                    const char* encodedBundle,
-                                                    const char* theme);
-
-    void setCustomProperties(JSGlobalContextRef ctx,
-                             double scaleFactor,
-                             const char* encodedBundle,
-                             const char* theme);
-
-    WRT_PLUGINS_DEPRECATED void dispatchJavaScriptEvent(
-        CustomEventType eventType);
-
-    void dispatchJavaScriptEvent(JSGlobalContextRef ctx,
-                                 CustomEventType eventType,
-                                 void* data);
-
-    unsigned int windowHandle() const;
-    void setWindowHandle(unsigned int handle);
-
-  private:
-    PluginLogic();
-    ~PluginLogic();
-
-    class Impl;
-    std::unique_ptr<Impl> m_impl;
-
-    friend class DPL::Singleton<PluginLogic>;
-};
-
-typedef DPL::Singleton<PluginLogic> PluginLogicSingleton;
-
-#endif // PLUGIN_LOGIC_H
diff --git a/src_wearable/plugin-loading/plugin_model.h b/src_wearable/plugin-loading/plugin_model.h
deleted file mode 100644 (file)
index e834cd1..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * 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    plugin_model.h
- * @author  Pawel Sikorski (p.sikorski@samgsung.com)
- * @author  Grzegorz Krawczyk (g.krawczyk@samgsung.com)
- * @version
- * @brief   This file contains PluginModel, PluginHandle definitions.
- */
-
-#ifndef WRT_SRC_PLUGIN_SERVICE_PLUGIN_MODEL_H_
-#define WRT_SRC_PLUGIN_SERVICE_PLUGIN_MODEL_H_
-
-#include <string>
-#include <list>
-#include <dpl/shared_ptr.h>
-#include <dpl/event/model.h>
-#include <dpl/event/property.h>
-
-#include <dpl/wrt-dao-ro/feature_model.h>
-#include <dpl/wrt-dao-ro/plugin_dao_read_only.h>
-#include <plugin.h>
-
-class PluginModel;
-
-class PluginModel : public DPL::Event::Model
-{
-  public:
-
-    /**
-     * *@brief Plugin handle
-     */
-    DPL::Event::Property<WrtDB::DbPluginHandle,
-                         DPL::Event::PropertyReadOnly> Handle;
-
-    /**
-     * *@brief LibraryName
-     */
-    DPL::Event::Property<std::string,
-                         DPL::Event::PropertyReadOnly,
-                         DPL::Event::PropertyStorageDynamicCached> LibraryName;
-
-    /**
-     * *@brief Library Path
-     */
-    DPL::Event::Property<std::string,
-                         DPL::Event::PropertyReadOnly,
-                         DPL::Event::PropertyStorageDynamicCached> LibraryPath;
-
-    /**
-     * *@brief Feature set
-     */
-    DPL::Event::Property<WrtDB::FeatureHandleListPtr,
-                         DPL::Event::PropertyReadOnly,
-                         DPL::Event::PropertyStorageDynamicCached>
-    FeatureHandles;
-
-    /**
-     * *@brief Librarydepencies
-     */
-    DPL::Event::Property<WrtDB::PluginHandleSetPtr,
-                         DPL::Event::PropertyReadOnly,
-                         DPL::Event::PropertyStorageDynamicCached>
-    LibraryDependencies;
-
-    /**
-     * *@brief Library instance Low Level
-     * */
-    DPL::Event::Property<PluginPtr,
-                         DPL::Event::PropertyReadWrite,
-                         DPL::Event::PropertyStorageCached> LibraryInstance;
-
-  public:
-    PluginModel(const WrtDB::DbPluginHandle& handle);
-
-  private:
-    WrtDB::DbPluginHandle getHandle() const;
-};
-
-typedef DPL::SharedPtr<PluginModel> PluginModelPtr;
-
-#endif
diff --git a/src_wearable/plugins-api-support/CMakeLists.txt b/src_wearable/plugins-api-support/CMakeLists.txt
deleted file mode 100644 (file)
index 7a67b5e..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-# 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     CMakeLists.txt
-# @author   Grzegorz Krawczyk (g.krawczyk@samsung.com)
-# @version  1.0
-#
-
-pkg_search_module(dpl REQUIRED dpl-efl)
-
-set(PLUGINS_API_SUPPORT_SOURCES
-    ${CMAKE_CURRENT_SOURCE_DIR}/Plugin.cpp
-    ${CMAKE_CURRENT_SOURCE_DIR}/Object.cpp
-    ${CMAKE_CURRENT_SOURCE_DIR}/ObjectFactory.cpp
-    ${CMAKE_CURRENT_SOURCE_DIR}/PluginRegistration.cpp
-    ${CMAKE_CURRENT_SOURCE_DIR}/PluginRegistry.cpp
-)
-
-INCLUDE_DIRECTORIES(
-    ${CMAKE_CURRENT_SOURCE_DIR}
-    ${dpl_INCLUDE_DIRS}
-)
-
-ADD_LIBRARY(${TARGET_PLUGINS_API_SUPPORT} SHARED
-    ${PLUGINS_API_SUPPORT_SOURCES}
-)
-
-SET_TARGET_PROPERTIES(${TARGET_PLUGIN_API_SUPPORT} PROPERTIES
-    COMPILE_FLAGS -fPIC
-    LINK_FLAGS "-Wl,--as-needed -Wl,--hash-style=both"
-)
-
-SET_TARGET_PROPERTIES(${TARGET_PLUGINS_API_SUPPORT} PROPERTIES
-    SOVERSION ${CMAKE_PROJECT_API_VERSION}
-    VERSION ${CMAKE_PROJECT_VERSION}
-)
-
-target_link_libraries(${TARGET_PLUGINS_API_SUPPORT}
-    ${dpl_LIBRARIES}
-)
-
-INSTALL(TARGETS ${TARGET_PLUGINS_API_SUPPORT}
-    DESTINATION lib
-    PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
-    GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
-)
-
-INSTALL(FILES
-    ${CMAKE_CURRENT_SOURCE_DIR}/ExportedApi.h
-    ${CMAKE_CURRENT_SOURCE_DIR}/Plugin.h
-    ${CMAKE_CURRENT_SOURCE_DIR}/IObject.h
-    ${CMAKE_CURRENT_SOURCE_DIR}/ObjectFactory.h
-    ${CMAKE_CURRENT_SOURCE_DIR}/CallbackSupport.h
-    ${CMAKE_CURRENT_SOURCE_DIR}/tuple.h
-    ${CMAKE_CURRENT_SOURCE_DIR}/PluginSignals.h
-    ${CMAKE_CURRENT_SOURCE_DIR}/SignalSignature.h
-    ${CMAKE_CURRENT_SOURCE_DIR}/PluginRegistration.h
-    DESTINATION include/wrt-plugins-api-support)
diff --git a/src_wearable/plugins-api-support/Object.cpp b/src_wearable/plugins-api-support/Object.cpp
deleted file mode 100644 (file)
index 7db93e4..0000000
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Copyright (c) 2012 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    Object.cpp
- * @author  Grzegorz Krawczyk (g.krawczyk@samgsung.com)
- * @version
- * @brief
- */
-
-#include "Object.h"
-
-namespace WrtPluginsApi {
-void Object::AddChild(const IObjectPtr& child)
-{
-    if (!m_children) {
-        m_children = IObjectsListPtr(new IObjectsList);
-    }
-    m_children->push_back(child);
-}
-
-void Object::setBoolOption(IObjectOption option, bool value)
-{
-    if (!m_options) {
-        m_options = ObjectOptionPtr(new ObjectOption);
-    }
-
-    switch (option) {
-    case IObjectOption::Overlayed:
-        m_options->overlayedMode = value;
-        break;
-    default:
-        break;
-    }
-}
-
-IObjectsListPtr Object::GetChildren() const
-{
-    return m_children;
-}
-
-ClassRef Object::GetClass() const
-{
-    return m_classRef;
-}
-
-ClassRef Object::GetClassConstructor() const
-{
-    return m_constructorRef;
-}
-
-const char* Object::GetInterfaceName() const
-{
-    return m_interfaceName;
-}
-
-const char* Object::GetName() const
-{
-    return m_name;
-}
-
-IObjectType Object::GetType() const
-{
-    return m_type;
-}
-
-const char* Object::GetParentName() const
-{
-    return m_parentName;
-}
-
-ObjectOptionPtr Object::GetOptions() const
-{
-    return m_options;
-}
-
-Object::Object(const char* name,
-               ClassRef ref,
-               IObjectType type) :
-    m_name(name),
-    m_classRef(ref),
-    m_parentName(0),
-    m_type(type),
-    m_interfaceRef(0),
-    m_interfaceName(0),
-    m_constructorRef(0)
-{}
-
-Object::Object(const char* name,
-               ClassRef ref,
-               const char* parentName,
-               IObjectType type) :
-    m_name(name),
-    m_classRef(ref),
-    m_parentName(parentName),
-    m_type(type),
-    m_interfaceRef(0),
-    m_interfaceName(0),
-    m_constructorRef(0)
-{}
-
-Object::Object(const char* name,
-               ClassRef interfaceRef,
-               const char* interfaceName,
-               ClassRef constructorRef,
-               const char* parentName,
-               IObjectType type) :
-    m_name(name),
-    m_parentName(parentName),
-    m_type(type),
-    m_interfaceRef(interfaceRef),
-    m_interfaceName(interfaceName),
-    m_constructorRef(constructorRef)
-{}
-
-Object::~Object()
-{}
-}
diff --git a/src_wearable/plugins-installer/plugin_objects.cpp b/src_wearable/plugins-installer/plugin_objects.cpp
deleted file mode 100644 (file)
index ae65b0f..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * 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    plugin_objects.h
- * @author  Grzegorz Krawczyk (g.krawczyk@samgsung.com)
- * @version
- * @brief
- */
-#include <string>
-#include <dpl/log/log.h>
-#include "plugin_objects.h"
-#include <IObject.h>
-
-namespace {
-const char* SEPARATOR = ".";
-const std::string GLOBAL_OBJECT_NAME = WrtPluginsApi::IObject::WINDOW_OBJECT();
-const std::string OLD_GLOBAL_OBJECT_NAME = "GLOBAL_OBJECT";
-
-std::string normalizeName(const std::string& objectName)
-{
-    if (objectName.empty()) {
-        LogError("Normalize name, name size is 0");
-        return objectName;
-    }
-
-    if (!objectName.compare(0, GLOBAL_OBJECT_NAME.size(),
-                            GLOBAL_OBJECT_NAME))
-    {
-        return objectName;
-    }
-    if (!objectName.compare(0, OLD_GLOBAL_OBJECT_NAME.size(),
-                            OLD_GLOBAL_OBJECT_NAME))
-    {
-        return GLOBAL_OBJECT_NAME;
-    }
-
-    //each object in storage has name started from $GLOBAL_OBJECT_NAME$
-    return GLOBAL_OBJECT_NAME + std::string(SEPARATOR) + objectName;
-}
-
-std::string normalizeName(const std::string& objectName,
-                          const std::string& parentName)
-{
-    if (objectName.empty() || parentName.empty()) {
-        LogError("Normalize name, name size or parent name size is 0");
-        return std::string();
-    }
-
-    std::string normalizedName;
-    normalizedName = normalizeName(parentName) +
-        std::string(SEPARATOR) + objectName;
-
-    return normalizedName;
-}
-}
-
-PluginObjects::PluginObjects()
-{
-    m_implemented = ObjectsPtr(new Objects());
-    m_dependent = ObjectsPtr(new Objects());
-}
-
-PluginObjects::ObjectsPtr PluginObjects::getImplementedObject() const
-{
-    return m_implemented;
-}
-
-PluginObjects::ObjectsPtr PluginObjects::getDependentObjects() const
-{
-    return m_dependent;
-}
-
-void PluginObjects::addObjects(const std::string& parentName,
-                               const std::string& name)
-{
-    LogDebug("\n Parent: " << parentName
-                           << "\n Name: " << name
-                           << "\n After: Implemented: " <<
-             normalizeName(name, parentName)
-                           << "\n After Dependent: " <<
-             normalizeName(parentName)
-             );
-
-    addImplementedObject(normalizeName(name, parentName));
-    addDependentObject(normalizeName(parentName));
-}
-
-void PluginObjects::addDependentObject(const std::string& value)
-{
-    if (!value.compare(GLOBAL_OBJECT_NAME)) {
-        //dont add dependency to GLOBAL_OBJECT
-        return;
-    }
-    m_dependent->insert(value);
-}
-
-bool PluginObjects::hasObject(const std::string& name) const
-{
-    return m_implemented->find(name) != m_implemented->end();
-}
-
-void PluginObjects::addImplementedObject(const std::string& value)
-{
-    m_implemented->insert(value);
-}
diff --git a/src_wearable/plugins-installer/plugin_objects.h b/src_wearable/plugins-installer/plugin_objects.h
deleted file mode 100644 (file)
index eda28a3..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * 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        plugin_objects.h
- * @author      Grzegorz Krawczyk(g.krawczyk@samsung.com)
- * @version     1.0
- * @brief
- */
-
-#ifndef WRT_SRC_INSTALLER_CORE_PLUGIN_INSTALLER_TASKS_PLUGIN_OBJECTS_H_
-#define WRT_SRC_INSTALLER_CORE_PLUGIN_INSTALLER_TASKS_PLUGIN_OBJECTS_H_
-
-#include <dpl/shared_ptr.h>
-#include <string>
-#include <set>
-#include <list>
-
-#include <dpl/wrt-dao-ro/common_dao_types.h>
-//TODO TO BE MOVED SOMEWHERE ELSE
-// AS OTHER MODULES (LIKE DAO) USE IT
-
-class PluginObjects : public WrtDB::PluginObjectsDAO
-{
-  public:
-    explicit PluginObjects();
-
-    //getters for objects from library
-    ObjectsPtr getImplementedObject() const;
-    ObjectsPtr getDependentObjects() const;
-
-    //add object declaration
-    void addObjects(const std::string& parentName,
-                    const std::string& name);
-
-    //check if library implemements object given as name
-    bool hasObject(const std::string& name) const;
-
-  private:
-    void addImplementedObject(const std::string& value);
-    void addDependentObject(const std::string& value);
-};
-
-typedef DPL::SharedPtr<PluginObjects> PluginObjectsPtr;
-
-#endif
diff --git a/src_wearable/plugins-ipc-message/ipc_message_support.cpp b/src_wearable/plugins-ipc-message/ipc_message_support.cpp
deleted file mode 100644 (file)
index b892289..0000000
+++ /dev/null
@@ -1,240 +0,0 @@
-/*
- * 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        ipc_message_support.cpp
- * @author      Jihoon Chung (jihoon.chung@samsung.com)
- * @version     1.0
- * @brief       Implementation of IPC between plugins and UI Process
- */
-#include "ipc_message_support.h"
-
-#include <string>
-#include <sstream>
-#include <WKBundle.h>
-#include <WKString.h>
-#include <WKType.h>
-#include <dpl/log/secure_log.h>
-#include <dpl/assert.h>
-
-static WKBundleRef s_injectedBundleRef = NULL;
-static unsigned  int s_xWindowHandle = 0;
-
-namespace {
-const char* const TIZEN_GET_WINDOW_HANDLE = "tizen://getWindowHandle";
-const char* const TIZEN_CLEAR_ALL_COOKIES = "tizen://clearAllCookies";
-
-static void sendPostMessage(const char* name, const char* body)
-{
-    WKStringRef nameWKString = WKStringCreateWithUTF8CString(name);
-    WKStringRef bodyWKString = NULL;
-    if (body) {
-        bodyWKString = WKStringCreateWithUTF8CString(body);
-    }
-
-    WKBundlePostMessage(s_injectedBundleRef,
-                        nameWKString,
-                        bodyWKString);
-    WKRelease(nameWKString);
-    if (bodyWKString) {
-        WKRelease(bodyWKString);
-    }
-}
-
-static int sendAsyncMessage(const char* name, const char* body, AsyncReplyCallback replyCallback, void* data)
-{
-    using namespace IPCMessageSupport;
-
-    int handle = AsyncConnectionManager::instance().addConnection(AsyncConnectionPtr(new AsyncConnection(replyCallback, data)));
-
-    std::string strBody = body;
-    std::stringstream ss;
-
-    ss << handle;
-    strBody = ss.str() + "_" + strBody;
-
-    sendPostMessage(name, strBody.c_str());
-
-    return handle;
-}
-
-} // namespace
-
-
-namespace IPCMessageSupport {
-
-AsyncConnectionManager::~AsyncConnectionManager()
-{
-    m_connectionMap.clear();
-}
-
-AsyncConnectionManager &AsyncConnectionManager::instance()
-{
-    static AsyncConnectionManager instance;
-
-    return instance;
-}
-
-int AsyncConnectionManager::addConnection(AsyncConnectionPtr connection)
-{
-    static int latestHandle = -1;
-    int newHandle;
-
-    latestHandle++;
-    if (latestHandle < 0) latestHandle = 0;
-
-    newHandle = latestHandle;
-
-    m_connectionMap.insert(AsyncConnectionMap::value_type(newHandle, connection));
-
-    return newHandle;
-}
-
-bool AsyncConnectionManager::removeConnection(int handle)
-{
-    bool ret = (m_connectionMap.erase(handle) == 1);
-
-    return ret;
-}
-
-AsyncConnectionPtr AsyncConnectionManager::getConnection(int handle)
-{
-    AsyncConnectionMap::iterator iter = m_connectionMap.find(handle);
-
-    if (iter != m_connectionMap.end())
-    {
-        return iter->second;
-    }
-
-    return AsyncConnectionPtr();
-}
-
-
-} // namespace IPCMessageSupport
-
-
-void IPCMessageSupport::setWKBundleRef(WKBundleRef bundleRef)
-{
-    _D("called");
-    s_injectedBundleRef = bundleRef;
-}
-
-void IPCMessageSupport::setXwindowHandle(unsigned int handle)
-{
-    _D("called");
-    s_xWindowHandle = handle;
-}
-
-const char* IPCMessageSupport::sendMessageToUiProcess(
-    const char* name,
-    const char* body)
-{
-    _D("called");
-    if (s_injectedBundleRef == NULL) {
-        _E("UI Process information isn't set");
-        return NULL;
-    }
-    _D("name = [%s]", name);
-    if (body) {
-        _D("body = [%s]", body);
-    }
-
-    if (!name) {
-        return NULL;
-    }
-
-    // tizen://getWindowHandle
-    if (!strcmp(name, TIZEN_GET_WINDOW_HANDLE)) {
-        if (s_xWindowHandle == 0) {
-            return NULL;
-        } else {
-            std::stringstream ss;
-            ss << s_xWindowHandle;
-            std::string ret  = ss.str();
-            return strdup(ret.c_str());
-        }
-    }
-
-    // tizen://clearAllCookies
-    if (!strcmp(name, TIZEN_CLEAR_ALL_COOKIES)) {
-        sendPostMessage(name, body);
-        return NULL;
-    }
-
-    return NULL;
-}
-
-int IPCMessageSupport::sendAsyncMessageToUiProcess(const char* name, const char* body, AsyncReplyCallback replyCallback, void* data)
-{
-    _D("called");
-
-    if (s_injectedBundleRef == NULL)
-    {
-        _E("UI Process information isn't set");
-        return -1;
-    }
-
-    if (name == NULL)
-    {
-        _E("msg name is null!");
-        return -1;
-    }
-
-    if (body == NULL)
-    {
-        body = "";
-    }
-
-    _D("name = [%s]", name);
-    if (!body) {
-        _D("body = [%s]", body);
-    }
-
-    return sendAsyncMessage(name, body, replyCallback, data);
-}
-
-void* IPCMessageSupport::ignoreAsyncMessageReply(int handle)
-{
-    _D("called");
-
-    AsyncConnectionPtr connection = AsyncConnectionManager::instance().getConnection(handle);
-
-    if (!connection)
-    {
-        return NULL;
-    }
-
-    AsyncConnectionManager::instance().removeConnection(handle);
-
-    return connection->data;
-}
-
-void IPCMessageSupport::replyAsyncMessageToWebProcess(Ewk_Context* ewkContext, int handle, const char* body)
-{
-    _D("called");
-
-    if (ewkContext == NULL)
-    {
-        return;
-    }
-
-    std::string strBody = (body) ? (body) : "";
-    std::stringstream ss;
-    ss << handle;
-
-    strBody = ss.str() + "_" + strBody;
-
-    ewk_context_message_post_to_injected_bundle(ewkContext, REPLY_ASYNC, strBody.c_str());
-}
diff --git a/src_wearable/wrt-popup/CMakeLists.txt b/src_wearable/wrt-popup/CMakeLists.txt
deleted file mode 100755 (executable)
index 13a79cc..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-ADD_SUBDIRECTORY(ace)
-ADD_SUBDIRECTORY(wrt)
diff --git a/src_wearable/wrt-popup/ace/CMakeLists.txt b/src_wearable/wrt-popup/ace/CMakeLists.txt
deleted file mode 100755 (executable)
index 2ecd23d..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-ADD_SUBDIRECTORY(popup-bin)
-ADD_SUBDIRECTORY(popup-runner)
diff --git a/src_wearable/wrt-popup/ace/popup-bin/CMakeLists.txt b/src_wearable/wrt-popup/ace/popup-bin/CMakeLists.txt
deleted file mode 100644 (file)
index f87483d..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-# 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     CMakeLists.txt
-# @author   Janusz Kozerski (j.kozerski@samsung.com)
-#
-# @version  1.0
-#
-
-PKG_CHECK_MODULES(WRT_POPUP_DEP
-    dpl-efl
-    elementary
-    security-client
-    security-popup-validation
-   REQUIRED)
-
-set(WRT_POPUP_SRC_DIR ${PROJECT_SOURCE_DIR}/src/wrt-popup/ace/popup-bin)
-
-set(WRT_POPUP_SOURCES
-    ${WRT_POPUP_SRC_DIR}/Popup.cpp
-)
-
-ADD_DEFINITIONS(${WRT_POPUP_DEP_CFLAGS})
-
-INCLUDE_DIRECTORIES(
-    ${WRT_POPUP_SRC_DIR}
-    ${WRT_POPUP_DEP_INCLUDE_DIRS}
-)
-
-ADD_EXECUTABLE(${TARGET_POPUP_ACE}
-    ${WRT_POPUP_SOURCES}
-)
-
-SET_TARGET_PROPERTIES(${TARGET_POPUP_ACE} PROPERTIES
-    COMPILE_FLAGS -fPIC
-)
-
-SET_TARGET_PROPERTIES(${TARGET_POPUP_ACE} PROPERTIES
-    #LINK_FLAGS "-Wl,--as-needed -Wl"
-    SOVERSION ${PROJECT_API_VERSION}
-    VERSION ${PROJECT_VERSION}
-)
-
-target_link_libraries(${TARGET_POPUP_ACE}
-    ${WRT_POPUP_DEP_LIBRARIES}
-    ${TARGET_POPUP_ACE_RUNNER_LIB}
-    ${WRT_POPUP_DEP_LDFLAGS}
-)
-
-INSTALL(TARGETS ${TARGET_POPUP_ACE}
-    DESTINATION bin
-)
diff --git a/src_wearable/wrt-popup/ace/popup-bin/Popup.cpp b/src_wearable/wrt-popup/ace/popup-bin/Popup.cpp
deleted file mode 100644 (file)
index 56a7ebb..0000000
+++ /dev/null
@@ -1,465 +0,0 @@
-/*
- * 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        Popup.c
- * @author      Janusz Kozerski (j.kozerski@samsung.com)
- * @version     1.0
- */
-
-/*
- * This is just a example pop-up that shows how to use a new C-API in
- * wrt-security.
- * This pop-up should be re-implemented by members of NGWAP.
- */
-
-#include <stdio.h>
-#include <unistd.h>
-#include <string.h>
-#include <errno.h>
-#include <vector>
-#include <ctime>
-
-#include <Elementary.h>
-
-#include <dpl/log/log.h>
-#include <dpl/serialization.h>
-#include <ace_api_common.h>
-#include <ace_api_popup_validation.h>
-
-#include "popup-runner.h"
-#include "Popup.h"
-
-namespace { // anonymous
-static void set_validity_from_checkbox(struct ace_popup_data *pdp)
-{
-    if (NULL == pdp) {
-        LogError("pdp is NULL; return");
-        return;
-    }
-
-    if (pdp->always) {
-        LogDebug("Remember ALWAYS");
-        pdp->remember_choice = ACE_ALWAYS;
-        return;
-    }
-    if (pdp->per_session) {
-        LogDebug("Remember PER_SESSION");
-        pdp->remember_choice = ACE_PER_SESSION;
-        return;
-    }
-    LogDebug("Remember ONCE");
-    pdp->remember_choice = ACE_ONCE;
-    return;
-}
-
-static void on_done(void)
-{
-    // Quit the efl-mainloop
-    LogDebug("elm_exit()");
-    elm_exit();
-}
-
-static void grant_answer(void *data,
-                         Evas_Object * /* obj */,
-                         void * /* event_info */)
-{
-    LogDebug("grant_answer");
-    if (NULL == data) {
-        LogError("data is NULL; return");
-        return;
-    }
-    struct ace_popup_data *pdp = static_cast <struct ace_popup_data *>(data);
-
-    set_validity_from_checkbox(pdp);
-
-    ace_popup_validation_initialize();
-    pdp->validation_return = ace_validate_answer(
-            ACE_TRUE,
-            pdp->remember_choice,
-            pdp->resource_name,
-            pdp->session_id,
-            &(pdp->param_list),
-            pdp->handle,
-            &(pdp->validation_result));
-    ace_popup_validation_shutdown();
-
-    on_done();
-}
-
-static void deny_answer(void *data,
-                        Evas_Object * /* obj */,
-                        void * /* event_info */)
-{
-    LogDebug("deny_answer");
-    if (NULL == data) {
-        LogError("data is NULL; return");
-        return;
-    }
-    struct ace_popup_data *pdp = static_cast <struct ace_popup_data *>(data);
-
-    set_validity_from_checkbox(pdp);
-
-    ace_popup_validation_initialize();
-    pdp->validation_return = ace_validate_answer(
-            ACE_FALSE,
-            pdp->remember_choice,
-            pdp->resource_name,
-            pdp->session_id,
-            &(pdp->param_list),
-            pdp->handle,
-            &(pdp->validation_result));
-    ace_popup_validation_shutdown();
-
-    on_done();
-}
-
-static int _ace_params_deserializer(ace_param_list_t* ace_param_list,
-                                    Wrt::Popup::BinaryStream *stream)
-{
-    LogDebug("_ace_params_deserializer");
-
-    if (NULL == ace_param_list || NULL == stream) {
-        LogError("ace_param_list or stream is NULL; return -1");
-        return -1;
-    }
-
-    // deserialize ace_param_list->count;
-    size_t count = 0;
-    DPL::Deserialization::Deserialize(*stream, count);
-    ace_param_list->count = count;
-    LogDebug("count : " << count);
-
-    std::string name;
-    std::string value;
-    if (count == 0) {
-        ace_param_list->items = NULL;
-        return 0;
-    }
-    ace_param_list->items =
-        static_cast <ace_param_t *>(malloc(count * sizeof(ace_param_t)));
-    memset(ace_param_list->items, 0, count * sizeof(ace_param_t));
-
-    for (size_t i = 0; i < count; ++i) {
-        DPL::Deserialization::Deserialize(*stream, name);
-        ace_param_list->items[i].name =
-            strdup(const_cast <char *>(name.c_str()));
-
-        DPL::Deserialization::Deserialize(*stream, value);
-        ace_param_list->items[i].value =
-            strdup(const_cast <char *>(value.c_str()));
-    }
-    return 0;
-}
-
-static void _ace_params_finalize(ace_param_list_t* ace_param_list)
-{
-    if (!ace_param_list || !ace_param_list->items) {
-        LogDebug("List is null, nothing to do");
-        return;
-    }
-    for (size_t i = 0; i < ace_param_list->count; ++i) {
-        free(ace_param_list->items[i].name);
-        free(ace_param_list->items[i].value);
-    }
-    free(ace_param_list->items);
-    ace_param_list->items = NULL;
-    ace_param_list->count = 0;
-}
-
-static void show_popup(struct ace_popup_data *pdp)
-{
-    LogDebug("show_popup()");
-
-    if (NULL == pdp) {
-        LogError("pdp is NULL; return");
-        return;
-    }
-
-    const char *resource_type = static_cast <char *>(pdp->resource_name);
-
-    Evas_Object *win = NULL;
-    Evas_Object *box = NULL;
-    Evas_Object *label = NULL;
-    Evas_Object *grant_button = NULL;
-    Evas_Object *deny_button = NULL;
-    pdp->per_session = EINA_FALSE;
-    pdp->always = EINA_FALSE;
-
-    win = elm_win_add(NULL, "The wrt-client popup", ELM_WIN_NOTIFICATION);
-    elm_win_autodel_set(win, EINA_TRUE);
-    elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
-    evas_object_show(win);
-    elm_win_indicator_opacity_set(win, ELM_WIN_INDICATOR_TRANSLUCENT);
-
-    pdp->popup = elm_popup_add(win);
-
-    box = elm_box_add(pdp->popup);
-    evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, 0);
-    evas_object_size_hint_align_set(box, EVAS_HINT_FILL, 0.0);
-
-    label = elm_label_add(pdp->popup);
-    elm_object_style_set(label, "popup_description/default");
-    elm_label_line_wrap_set(label, ELM_WRAP_MIXED);
-    char *buff = NULL;
-    if (-1 ==
-        asprintf(&buff, "Application need an access to %s.<br>Grant or deny?",
-                 resource_type))
-    {
-        LogError("asprintf failed - returned -1");
-        evas_object_del(label);
-        evas_object_del(pdp->popup);
-        evas_object_del(win);
-        return;
-    }
-    elm_object_text_set(label, buff);
-    free(buff);
-    evas_object_size_hint_weight_set(label, EVAS_HINT_EXPAND, 0.0);
-    evas_object_size_hint_align_set(label, EVAS_HINT_FILL, EVAS_HINT_FILL);
-    evas_object_show(label);
-    elm_box_pack_end(box, label);
-
-    LogDebug("popup_type == " << pdp->popup_type);
-    if (pdp->popup_type == ACE_SESSION || pdp->popup_type == ACE_BLANKET) {
-        LogDebug("popup_type == ACE_SESSION || ACE_BLANKET");
-        Evas_Object *cb_session = elm_check_add(pdp->popup);
-        elm_object_text_set(cb_session, "Remember choice for this session");
-        elm_check_state_pointer_set(cb_session, &(pdp->per_session));
-        evas_object_smart_callback_add(cb_session, "changed", NULL, NULL);
-        evas_object_size_hint_align_set(cb_session,
-                                        EVAS_HINT_FILL,
-                                        EVAS_HINT_FILL);
-        evas_object_size_hint_weight_set(cb_session,
-                                         EVAS_HINT_EXPAND,
-                                         EVAS_HINT_EXPAND);
-        evas_object_show(cb_session);
-        elm_box_pack_end(box, cb_session);
-
-        if (pdp->popup_type == ACE_BLANKET) {
-            LogDebug("popup_type == ACE_BLANKET");
-            Evas_Object *cb_always = elm_check_add(pdp->popup);
-            elm_object_text_set(cb_always, "Remember choice forever");
-            elm_check_state_pointer_set(cb_always, &(pdp->always));
-            evas_object_smart_callback_add(cb_always, "changed", NULL, NULL);
-            evas_object_size_hint_align_set(cb_always,
-                                            EVAS_HINT_FILL,
-                                            EVAS_HINT_FILL);
-            evas_object_size_hint_weight_set(cb_always,
-                                             EVAS_HINT_EXPAND,
-                                             EVAS_HINT_EXPAND);
-            evas_object_show(cb_always);
-            elm_box_pack_end(box, cb_always);
-        }
-    }
-
-    elm_object_part_content_set(pdp->popup, "default", box);
-
-    grant_button = elm_button_add(pdp->popup);
-    elm_object_style_set(grant_button, "popup");
-    elm_object_text_set(grant_button, "Grant");
-    elm_object_part_content_set(pdp->popup, "button1", grant_button);
-    evas_object_smart_callback_add(grant_button, "clicked", grant_answer, pdp);
-
-    deny_button = elm_button_add(pdp->popup);
-    elm_object_style_set(deny_button, "popup");
-    elm_object_text_set(deny_button, "Deny");
-    elm_object_part_content_set(pdp->popup, "button2", deny_button);
-    evas_object_smart_callback_add(deny_button, "clicked", deny_answer, pdp);
-
-    evas_object_show(pdp->popup);
-
-    // Showing the popup window
-    evas_object_show(win);
-
-    // Run the efl mainloop
-    elm_run();
-}
-} // anonymous
-
-EAPI_MAIN int
-elm_main(int argc, char ** argv)
-{
-    UNHANDLED_EXCEPTION_HANDLER_BEGIN
-    {
-        // int pipe_in and int pipe_out should be passed to Popup via args.
-
-        //  These parameters should be passed to Popup via pipe:
-        //  ace_popup_t             popup_type
-        //  const ace_resource_t    resource_name
-        //  const ace_session_id_t  session_id
-        //  ace_widget_handle_t     handle
-        //  const ace_param_list_t  param_list
-
-        try {
-            DPL::Log::LogSystemSingleton::Instance().SetTag("WRT-POPUP-BIN");
-        } Catch(DPL::Exception) {
-            //cannot run logger
-            return ACE_INTERNAL_ERROR;
-        }
-        LogDebug(
-            "############################ popup binary ################################");
-
-        if (argc < 3) {
-            LogError(
-                "To few args passed in exec to popup-bin - should be at least 3:");
-            LogError("(binary-name, pipe_in, pipe_out)");
-            LogError("return ACE_INTERNAL_ERROR");
-            return ACE_INTERNAL_ERROR;
-        }
-        LogDebug("Passed args: " << argv[0] << ", " << argv[1] << ", " <<
-                 argv[2]);
-
-        int pipe_in;
-        int pipe_out;
-        std::stringstream parsing_stream;
-
-        // Parsing args (pipe_in, pipe_out)
-        parsing_stream.str(argv[1]);
-        parsing_stream >> pipe_in;
-        if ( parsing_stream.fail() ) {
-            LogError("Error while parsing pipe_in; return ACE_INTERNAL_ERROR");
-            return ACE_INTERNAL_ERROR;
-        }
-        parsing_stream.clear();
-        parsing_stream.str(argv[2]);
-        parsing_stream >> pipe_out;
-        if ( parsing_stream.fail() ) {
-            LogError("Error while parsing pipe_out; return ACE_INTERNAL_ERROR");
-            return ACE_INTERNAL_ERROR;
-        }
-        parsing_stream.clear();
-        LogDebug("Parsed pipes: IN: " << pipe_in << ", OUT: " << pipe_out);
-
-        int buff_size = 1024;
-        char line[buff_size];
-
-        struct ace_popup_data pd;
-        struct ace_popup_data *pdp = &pd;
-
-        pdp->popup = NULL;
-
-        ssize_t count = 0;
-        time_t time_start;
-        time(&time_start); // now
-        double timeout = 10.0;
-        // try to read parameters from pipe_in
-        // timeout is set for 10 seconds
-        do {
-            count = TEMP_FAILURE_RETRY(read(pipe_in, line, buff_size));
-            if (timeout < difftime(time(NULL), time_start) ) {
-                LogError("Timeout reached! Exit popup - ACE_INTERNAL_ERROR");
-                close(pipe_in);
-                close(pipe_out);
-                return ACE_INTERNAL_ERROR;
-            }
-        } while (0 == count);
-        if (count < 0) {
-            close(pipe_in);
-            close(pipe_out);
-            LogError("read returned a negative value (" << count << ")");
-            LogError("errno: " << strerror(errno) );
-            LogError("Exit popup - ACE_INTERNAL_ERROR");
-            return ACE_INTERNAL_ERROR;
-        }
-        LogDebug("Read bytes : " << count << " (in " <<
-                 difftime(time_start, time(NULL)) << " seconds)");
-        close(pipe_in); // cleanup
-
-        Wrt::Popup::BinaryStream stream;
-        stream.Write(count, static_cast <void *>(line));
-        int popup_type = ACE_ONESHOT;
-        std::string resource_name_str;
-        std::string session_id_str;
-        int handle = 0;
-
-        LogDebug("------- Deserialization -------");
-        // Deserialization order:
-        // popup_type, resource_name, session_id, handle, param_list
-
-        DPL::Deserialization::Deserialize(stream, popup_type);
-        LogDebug("popup_type_int : " << popup_type);
-        pdp->popup_type = static_cast <ace_popup_t>(popup_type);
-
-        DPL::Deserialization::Deserialize(stream, resource_name_str);
-        LogDebug("resource_name_char : " << resource_name_str.c_str());
-        pdp->resource_name =
-            strdup(const_cast <ace_resource_t>(resource_name_str.c_str()));
-
-        DPL::Deserialization::Deserialize(stream, session_id_str);
-        LogDebug("session_id_char : " << session_id_str.c_str());
-        pdp->session_id =
-            strdup(const_cast <ace_session_id_t>(session_id_str.c_str()));
-
-        DPL::Deserialization::Deserialize(stream, handle);
-        LogDebug("handle_int : " << handle);
-        pdp->handle = static_cast <ace_widget_handle_t>(handle);
-
-        if (_ace_params_deserializer(&(pdp->param_list), &stream)) {
-            return ACE_INTERNAL_ERROR;
-        }
-
-        pdp->per_session = EINA_FALSE;
-        pdp->always = EINA_FALSE;
-        pdp->validation_return = ACE_ACE_UNKNOWN_ERROR;
-
-        show_popup(pdp); // Showing popup
-
-        // sending validation_result to popup-runner
-        Wrt::Popup::BinaryStream stream_out;
-
-        LogDebug("pdp->validation_result : " << pdp->validation_result);
-        int validation_result_int = (int) pdp->validation_result;
-        LogDebug("validation_result_int : " << validation_result_int);
-        DPL::Serialization::Serialize(stream_out, validation_result_int);
-        if (-1 ==
-            TEMP_FAILURE_RETRY(write(pipe_out, stream_out.char_pointer(),
-                                     stream_out.size())))
-        {
-            LogError("Write to pipe failed!");
-            close(pipe_out);
-            return ACE_INTERNAL_ERROR;
-        }
-        close(pipe_out);
-
-        if (pdp->validation_return == ACE_OK) {
-            LogDebug("ACE_OK");
-        } else if (pdp->validation_return == ACE_INVALID_ARGUMENTS) {
-            LogError("ACE_INVALID_ARGUMENTS");
-        } else if (pdp->validation_return == ACE_INTERNAL_ERROR) {
-            LogError("ACE_INTERNAL_ERROR");
-        } else if (pdp->validation_return == ACE_ACE_UNKNOWN_ERROR) {
-            LogError("ACE_ACE_UNKNOWN_ERROR");
-        } else {
-            LogError("Really unknown error!!!");
-        }
-
-        LogDebug(
-            "############################ /popup binary ################################");
-
-        // Shutdown elementary
-        //LogDebug("elm_shutdown()");
-        //elm_shutdown();
-        // This is commented because, it causes that popup exits with 139 code
-        // (Segmentatation violation).
-        // Not calling elm_shutdown() should not have any negative consequences
-        // because this binary ends
-        // in next line, and system should clear the memory.
-
-        _ace_params_finalize(&(pdp->param_list));
-        return pdp->validation_return;
-    }
-    UNHANDLED_EXCEPTION_HANDLER_END
-}
-ELM_MAIN()
diff --git a/src_wearable/wrt-popup/ace/popup-bin/Popup.h b/src_wearable/wrt-popup/ace/popup-bin/Popup.h
deleted file mode 100644 (file)
index 388c921..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * 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        Popup.h
- * @author      Janusz Kozerski (j.kozerski@samsung.com)
- * @version     1.0
- */
-
-#include <Elementary.h>
-#include <ace_api_common.h>
-
-struct ace_popup_data {
-    ace_popup_t popup_type;
-    ace_resource_t resource_name;
-    ace_session_id_t session_id;
-    ace_param_list_t param_list;
-    ace_widget_handle_t handle;
-    ace_bool_t validation_result;
-    ace_return_t validation_return;
-
-    Evas_Object          *popup;
-    Eina_Bool per_session;
-    Eina_Bool always;
-
-    ace_validity_t remember_choice;
-};
diff --git a/src_wearable/wrt-popup/ace/popup-runner/CMakeLists.txt b/src_wearable/wrt-popup/ace/popup-runner/CMakeLists.txt
deleted file mode 100644 (file)
index 4e5053c..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-# 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     CMakeLists.txt
-# @author   Janusz Kozerski (j.kozerski@samsung.com)
-#
-# @version  1.0
-#
-
-PKG_CHECK_MODULES(WRT_POPUP_RUNNER_LIB_DEP
-    dpl-efl
-    elementary
-    security-client
-   REQUIRED)
-
-set(WRT_POPUP_RUNNER_LIB_SRC_DIR ${PROJECT_SOURCE_DIR}/src/wrt-popup/ace/popup-runner)
-
-set(WRT_POPUP_RUNNER_LIB_SOURCES
-    ${WRT_POPUP_RUNNER_LIB_SRC_DIR}/popup-runner.cpp
-)
-
-ADD_DEFINITIONS(${WRT_POPUP_RUNNER_LIB_DEP_CFLAGS})
-
-INCLUDE_DIRECTORIES(
-    ${WRT_POPUP_RUNNER_LIB_SRC_DIR}
-    ${WRT_POPUP_RUNNER_LIB_DEP_INCLUDE_DIRS}
-)
-
-ADD_LIBRARY(${TARGET_POPUP_ACE_RUNNER_LIB} SHARED
-    ${WRT_POPUP_RUNNER_LIB_SOURCES}
-)
-
-SET_TARGET_PROPERTIES(${TARGET_POPUP_ACE_RUNNER_LIB} PROPERTIES
-    COMPILE_FLAGS -fPIC
-)
-
-SET_TARGET_PROPERTIES(${TARGET_POPUP_ACE_RUNNER_LIB} PROPERTIES
-    SOVERSION ${CMAKE_PROJECT_API_VERSION}
-    VERSION ${CMAKE_PROJECT_VERSION}
-)
-
-target_link_libraries(${TARGET_POPUP_ACE_RUNNER_LIB}
-    ${WRT_POPUP_RUNNER_LIB_DEP_LIBRARIES}
-    ${WRT_POPUP_RUNNER_LIB_DEP_LDFLAGS}
-)
-
-INSTALL(TARGETS ${TARGET_POPUP_ACE_RUNNER_LIB}
-    DESTINATION lib
-)
-
-INSTALL(FILES ${WRT_POPUP_RUNNER_LIB_SRC_DIR}/popup-runner.h
-    DESTINATION ${DESTINATION_HEADERS_WRT_POPUP_RUNNER}
-)
diff --git a/src_wearable/wrt-popup/ace/popup-runner/popup-runner.cpp b/src_wearable/wrt-popup/ace/popup-runner/popup-runner.cpp
deleted file mode 100644 (file)
index e46fc16..0000000
+++ /dev/null
@@ -1,290 +0,0 @@
-/*
- * 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        popup-runner.cpp
- * @author      Janusz Kozerski (j.kozerski@samsung.com)
- * @version     1.0
- */
-
-/*
- * This is just a example pop-up that shows how to use a new C-API in
- * wrt-security.
- * This pop-up should be re-implemented by members of NGWAP.
- */
-
-#include <stdio.h>
-#include <unistd.h>
-#include <string.h>
-#include <iostream>
-#include <sstream>
-#include <sys/types.h>
-#include <sys/wait.h>
-
-#include <dpl/log/log.h>
-
-#include "popup-runner.h"
-
-namespace { // anonymous
-const char *POPUP_EXEC = "/usr/bin/wrt-popup-ace-runtime";
-
-void _ace_params_serializer (const ace_param_list_t* ace_param_list,
-                             Wrt::Popup::BinaryStream *stream)
-{
-    LogDebug("_ace_params_serializer");
-
-    if (NULL == ace_param_list || NULL == stream) {
-        LogError("*ace_param_list or *stream is NULL; return");
-        return;
-    }
-    LogDebug("Param count : " << ace_param_list->count);
-
-    // serialize ace_param_list->count;
-    size_t count = static_cast <size_t>(ace_param_list->count);
-    DPL::Serialization::Serialize(*stream, count);
-
-    for (size_t i = 0; i < count; ++i) {
-        std::string name(ace_param_list->items[i].name);
-        DPL::Serialization::Serialize(*stream, name);
-
-        std::string value(ace_param_list->items[i].value);
-        DPL::Serialization::Serialize(*stream, value);
-    }
-}
-} // anonymous namespace
-
-namespace Wrt {
-namespace Popup {
-// BinaryStream class implementation
-void BinaryStream::Read(size_t num, void * bytes)
-{
-    size_t max_size = m_data.size();
-    for (size_t i = 0; i < num; ++i) {
-        if (i + m_readPosition >= max_size) {
-            return;
-        }
-        static_cast <unsigned char*>(bytes)[i] = m_data[i + m_readPosition];
-    }
-    m_readPosition += num;
-}
-
-void BinaryStream::Write(size_t num, const void * bytes)
-{
-    for (size_t i = 0; i < num; ++i) {
-        m_data.push_back(static_cast <const unsigned char*>(bytes)[i]);
-    }
-}
-
-BinaryStream::BinaryStream()
-{
-    m_readPosition = 0;
-}
-
-BinaryStream::~BinaryStream() {}
-
-const unsigned char* BinaryStream::char_pointer() const
-{
-    return &m_data[0];
-}
-
-size_t BinaryStream::size() const
-{
-    return m_data.size();
-}
-// BinaryStream
-
-ace_return_t run_popup(
-    ace_popup_t popup_type,
-    const ace_resource_t resource_name,
-    const ace_session_id_t session_id,
-    const ace_param_list_t* ace_param_list,
-    ace_widget_handle_t handle,
-    ace_bool_t* validation_result)
-{
-    if (NULL == resource_name ||
-        NULL == session_id ||
-        NULL == ace_param_list ||
-        NULL == validation_result)
-    {
-        LogError("run_popup : ACE_INVALID_ARGUMENTS");
-        return ACE_INVALID_ARGUMENTS;
-    }
-    LogDebug("popup_type    : " << popup_type);
-    LogDebug("resource_name : " << resource_name);
-    LogDebug("session_id    : " << session_id);
-    LogDebug("widget handle : " << handle);
-
-    int popup_type_int = static_cast <int>(popup_type);
-    char *resource_name_char = static_cast <char *>(resource_name);
-    char *session_id_char = static_cast <char *>(session_id);
-    int handle_int = static_cast <int>(handle);
-
-    // serialization
-    Wrt::Popup::BinaryStream stream;
-    DPL::Serialization::Serialize(stream, popup_type_int);
-
-    std::string resource_name_str(resource_name_char);
-    DPL::Serialization::Serialize(stream, resource_name_str);
-
-    std::string session_id_str(session_id_char);
-    DPL::Serialization::Serialize(stream, session_id_str);
-
-    DPL::Serialization::Serialize(stream, handle_int);
-
-    _ace_params_serializer(ace_param_list, &stream);
-
-    int fd_send_to_child[2];
-    int fd_send_to_parent[2];
-    pid_t childpid;
-
-    if (0 != pipe(fd_send_to_child)) {
-        LogError("Cannot create pipes!");
-        return ACE_INTERNAL_ERROR;
-    }
-    if (0 != pipe(fd_send_to_parent)) {
-        LogError("Cannot create pipes!");
-        return ACE_INTERNAL_ERROR;
-    }
-
-    if ((childpid = fork()) == -1) {
-        LogError("Fork() ERROR");
-        return ACE_ACE_UNKNOWN_ERROR;
-    }
-
-    if (childpid == 0) { // Child process
-        LogDebug("Child");
-
-        // read data from parent
-        close(fd_send_to_child[1]);
-
-        // send data to parent
-        close(fd_send_to_parent[0]);
-
-        std::stringstream pipe_in_buff;
-        std::stringstream pipe_out_buff;
-        pipe_in_buff << fd_send_to_parent[1];
-        pipe_out_buff << fd_send_to_child[0];
-        std::string pipe_in = pipe_in_buff.str();
-        std::string pipe_out = pipe_out_buff.str();
-
-        LogDebug(
-            "Passed file descriptors: " << fd_send_to_child[0] << ", " <<
-            fd_send_to_parent[1]);
-
-        if (execl(POPUP_EXEC, POPUP_EXEC, pipe_out.c_str(), pipe_in.c_str(),
-                  NULL) < 0)
-        {
-            LogError("execlp FAILED");
-        }
-
-        LogError("This should not happened!!!");
-    } // end of child process - from now you can use DEBUG LOGS
-    else { // Parent process
-        LogDebug("Parent");
-
-        int buff_size = 1024;
-        char result[buff_size];
-        // send data to child
-        close(fd_send_to_child[0]);
-
-        //writing to child
-        LogDebug("Sending message to popup-bin process");
-        if (-1 ==
-            TEMP_FAILURE_RETRY(write(fd_send_to_child[1], stream.char_pointer(),
-                                     stream.size())))
-        {
-            LogError("Write to pipe failed!");
-            return ACE_INTERNAL_ERROR;
-        }
-        close(fd_send_to_child[1]); // cleanup
-        LogDebug("Message has been sent");
-
-        // read data from child
-        close(fd_send_to_parent[1]);
-
-        int status;
-        wait(&status);
-        LogDebug("STATUS EXIT ON POPUP (CHILD): " << status);
-        switch (status) {
-        case ACE_OK:
-            LogDebug("ACE_OK");
-            break;
-
-        case ACE_INVALID_ARGUMENTS:
-            LogDebug("ACE_INVALID_ARGUMENTS");
-            close(fd_send_to_parent[0]);
-            return static_cast <ace_return_t>(status);
-            break;
-
-        case ACE_INTERNAL_ERROR:
-            LogDebug("ACE_INTERNAL_ERROR");
-            close(fd_send_to_parent[0]);
-            return static_cast <ace_return_t>(status);
-            break;
-
-        case ACE_ACE_UNKNOWN_ERROR:
-            LogDebug("ACE_ACE_UNKNOWN_ERROR");
-            close(fd_send_to_parent[0]);
-            return static_cast <ace_return_t>(status);
-            break;
-
-        default:
-            LogDebug("UNKNOWN_ERROR");
-            close(fd_send_to_parent[0]);
-            status = (int) ACE_ACE_UNKNOWN_ERROR;
-            return static_cast <ace_return_t>(status);
-            break;
-        }
-
-        int count;
-        count = TEMP_FAILURE_RETRY(read(fd_send_to_parent[0], result, buff_size));
-        close(fd_send_to_parent[0]); // cleanup
-
-
-        if (0 < count) {
-            BinaryStream stream_in;
-            int validation_result_int;
-            stream_in.Write(count, result);
-            LogDebug("RESULT FROM POPUP (CHILD) : [ " << count << " ]");
-            DPL::Deserialization::Deserialize(stream_in, validation_result_int);
-            *validation_result = static_cast <ace_bool_t>(validation_result_int);
-
-            LogDebug("validation_result :");
-            switch (*validation_result) {
-            case ACE_FALSE:
-                LogDebug("ACE_FALSE");
-                break;
-            case ACE_TRUE:
-                LogDebug("ACE_TRUE");
-                break;
-            default:
-                LogDebug("UNKNOWN - DEFAULT");
-                break;
-            }
-        } else {
-            LogDebug("count = " << count);
-            LogDebug("UNKNOWN_ERROR");
-            return ACE_ACE_UNKNOWN_ERROR;
-        }
-
-        LogDebug("popup-runner: EXIT");
-        return (ace_return_t) status;
-    }
-
-    LogError("This should not happend!!!");
-    return ACE_ACE_UNKNOWN_ERROR;
-}
-} // Popup
-} // Wrt
diff --git a/src_wearable/wrt-popup/ace/popup-runner/popup-runner.h b/src_wearable/wrt-popup/ace/popup-runner/popup-runner.h
deleted file mode 100644 (file)
index d136fb1..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * 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        popup-runner.h
- * @author      Janusz Kozerski (j.kozerski@samsung.com)
- * @version     1.0
- */
-
-#include <ace_api_client.h>
-#include <vector>
-
-#include <dpl/serialization.h>
-
-namespace Wrt {
-namespace Popup {
-class BinaryStream : public DPL::IStream
-{
-  public:
-    void Read (size_t num, void * bytes);
-    void Write(size_t num, const void * bytes);
-
-    BinaryStream();
-    ~BinaryStream();
-
-    const unsigned char* char_pointer() const;
-    size_t size() const;
-
-  private:
-    std::vector<unsigned char> m_data;
-    size_t m_readPosition;
-};
-
-ace_return_t run_popup(
-    ace_popup_t popup_type,
-    const ace_resource_t resource_name,
-    const ace_session_id_t session_id,
-    const ace_param_list_t* ace_param_list,
-    ace_widget_handle_t handle,
-    ace_bool_t* validation_result
-    );
-} // Popup
-} // Wrt
diff --git a/src_wearable/wrt-popup/wrt/CMakeLists.txt b/src_wearable/wrt-popup/wrt/CMakeLists.txt
deleted file mode 100755 (executable)
index ed0e24b..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-
-set(WRT_POPUP_COMMON_DIR ${PROJECT_SOURCE_DIR}/src/wrt-popup/wrt)
-
-SET(WRT_POPUP_COMMON_SRCS
-    ${WRT_POPUP_COMMON_DIR}/PopupSerializer.cpp
-)
-
-ADD_SUBDIRECTORY(popup-bin)
-ADD_SUBDIRECTORY(popup-runner)
diff --git a/src_wearable/wrt-popup/wrt/popup-bin/YesNoCheckPopup.cpp b/src_wearable/wrt-popup/wrt/popup-bin/YesNoCheckPopup.cpp
deleted file mode 100644 (file)
index 7cdbf73..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * File:   YesNoCheckPopup.cpp
- * Author: pciezkowski
- *
- * Created on December 12, 2012, 9:23 AM
- */
-
-#include "YesNoCheckPopup.h"
-#include <memory>
-#include <string.h>
-#include "popup_manager.h"
-#include "PopupSerializer.h"
-
-namespace Wrt {
-namespace Popup {
-YesNoCheckPopup::~YesNoCheckPopup()
-{}
-
-Renderer::CtrlPopupPtr YesNoCheckPopup::createPopup(
-    DPL::BinaryQueueAutoPtr data)
-{
-    std::string title = PopupSerializer::getStringArg(*data);
-    std::string message = PopupSerializer::getStringArg(*data);
-    std::string checkboxLabel = PopupSerializer::getStringArg(*data);
-    Assert(data->Empty());
-    LogDebug("title: " << title << " message: " << message << " checkbox: " <<
-             checkboxLabel);
-    Renderer::CtrlPopupPtr popup =
-        Renderer::PopupControllerSingleton::Instance().CreatePopup();
-
-    popup->SetTitle(title);
-    popup->Append(new Renderer::PopupObject::Label(message));
-    popup->Append(new Renderer::PopupObject::Check(checkboxLabel));
-    popup->Append(new Renderer::PopupObject::Button(YES_LABEL, POPUP_YES_VALUE));
-    popup->Append(new Renderer::PopupObject::Button(NO_LABEL, POPUP_NO_VALUE));
-    return popup;
-}
-
-void YesNoCheckPopup::responseCallback(
-    const Renderer::AnswerCallbackData &answer)
-{
-    bool result = (POPUP_YES_VALUE == answer.buttonAnswer);
-    DPL::BinaryQueue retValue;
-    PopupSerializer::appendArg(true, retValue);
-    PopupSerializer::appendArg(result, retValue);
-    LogDebug("Check state: " << answer.chackState);
-    PopupSerializer::appendArg(answer.chackState, retValue);
-    m_parent->response(retValue);
-}
-} // Popup
-} // Wrt
diff --git a/src_wearable/wrt-popup/wrt/popup-bin/YesNoPopup.cpp b/src_wearable/wrt-popup/wrt/popup-bin/YesNoPopup.cpp
deleted file mode 100644 (file)
index a47d205..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * 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        YesNoPopup.cpp
- * @author      Andrzej Surdej (a.surdej@samsung.com)
- * @version     1.0
- * @brief       Popup that contains 'Yes' and 'No' buttons. Inplementation
- */
-
-#include "YesNoPopup.h"
-#include <memory>
-#include <string.h>
-#include "popup_manager.h"
-#include "PopupSerializer.h"
-
-namespace Wrt {
-namespace Popup {
-void YesNoPopup::show(DPL::BinaryQueueAutoPtr data, WrtPopup* parent)
-{
-    LogDebug("Entered");
-    m_parent = parent;
-    Renderer::CtrlPopupPtr popup = createPopup(data);
-    ListenForAnswer(popup);
-
-    Renderer::ShowPopupEventShort event(popup,
-                                        MakeAnswerCallback(
-                                            this,
-                                            &YesNoPopup::responseCallback));
-
-    CONTROLLER_POST_EVENT(Renderer::PopupController,
-                          event);
-
-    LogDebug("Exited");
-    return;
-}
-
-void YesNoPopup::responseCallback(const Renderer::AnswerCallbackData &answer)
-{
-    bool result = (POPUP_YES_VALUE == answer.buttonAnswer);
-    DPL::BinaryQueue retValue;
-    PopupSerializer::appendArg(true, retValue);
-    PopupSerializer::appendArg(result, retValue);
-    m_parent->response(retValue);
-}
-
-YesNoPopup::~YesNoPopup()
-{}
-
-Renderer::CtrlPopupPtr YesNoPopup::createPopup(DPL::BinaryQueueAutoPtr data)
-{
-    std::string title = PopupSerializer::getStringArg(*data);
-    std::string message = PopupSerializer::getStringArg(*data);
-    Assert(data->Empty());
-    LogDebug("title: " << title << " message: " << message);
-    Renderer::CtrlPopupPtr popup =
-        Renderer::PopupControllerSingleton::Instance().CreatePopup();
-
-    popup->SetTitle(title);
-    popup->Append(new Renderer::PopupObject::Label(message));
-
-    popup->Append(new Renderer::PopupObject::Button(YES_LABEL, POPUP_YES_VALUE));
-    popup->Append(new Renderer::PopupObject::Button(NO_LABEL, POPUP_NO_VALUE));
-    return popup;
-}
-} // Popup
-} // Wrt
diff --git a/src_wearable/wrt-popup/wrt/popup-bin/YesNoPopup.h b/src_wearable/wrt-popup/wrt/popup-bin/YesNoPopup.h
deleted file mode 100644 (file)
index 5dbe2f8..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * 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        YesNoPopup.h
- * @author      Andrzej Surdej (a.surdej@samsung.com)
- * @version     1.0
- * @brief       Popup that contains 'Yes' and 'No' buttons
- */
-
-#ifndef WRT_YES_NO_POPUP_H
-#define WRT_YES_NO_POPUP_H
-
-#include "wrt-popup.h"
-
-namespace Wrt {
-namespace Popup {
-const char YES_LABEL[] = "Yes";
-const char NO_LABEL[] = "No";
-const int POPUP_YES_VALUE = 1;
-const int POPUP_NO_VALUE = 2;
-
-class YesNoPopup : public IPopup
-{
-  public:
-    virtual void show(DPL::BinaryQueueAutoPtr data, WrtPopup* parent);
-    virtual ~YesNoPopup();
-
-  protected:
-    virtual Renderer::CtrlPopupPtr createPopup(DPL::BinaryQueueAutoPtr data);
-    virtual void responseCallback(const Renderer::AnswerCallbackData &answer);
-    WrtPopup* m_parent;
-};
-} // Popup
-} // Wrt
-
-#endif /* WRT_YES_NO_POPUP_H */
-
diff --git a/src_wearable/wrt-popup/wrt/popup-bin/renderer/popup_renderer.h b/src_wearable/wrt-popup/wrt/popup-bin/renderer/popup_renderer.h
deleted file mode 100644 (file)
index 3538bbb..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * 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        popup_renderer.h
- * @author      Lukasz Wrzosek (l.wrzosek@samsung.com)
- * @version     1.0
- * @brief       This is declaration file of PopupRenderer
- */
-
-#ifndef WRT_SRC_POPUP_POPUP_RENDERER_H_
-#define WRT_SRC_POPUP_POPUP_RENDERER_H_
-
-#include <map>
-#include <string>
-#include <memory>
-
-#include <dpl/noncopyable.h>
-#include <dpl/log/log.h>
-#include <dpl/assert.h>
-#include <dpl/foreach.h>
-#include "popup.h"
-
-namespace Wrt {
-namespace Popup {
-namespace Renderer {
-class PopupRenderer : public std::enable_shared_from_this<PopupRenderer>
-{
-  public:
-    PopupRenderer();
-    ~PopupRenderer();
-    void Initialize();
-    void Deinitialize();
-    IPopupPtr CreatePopup();
-    virtual void setExternalCanvas(void* externalCanvas);
-
-  protected:
-    class Popup;
-    typedef std::shared_ptr<Popup> PopupPtr;
-
-    class Popup : public IPopup
-    {
-      public:
-        typedef std::map<int, std::string> ButtonMap;
-        virtual void SetTitle(const std::string &title)
-        {
-            LogDebug(title);
-            Assert(m_title.empty());
-            m_title = title;
-        }
-
-        virtual void Append(PopupObject::IPopupObject *object)
-        {
-            m_popupObjectList.push_back(object);
-        }
-
-        virtual void Show(IPopup::PopupCallbackType callback,
-                          void* data)
-        {
-            Assert(callback);
-            m_data = data;
-            m_callback = callback;
-            m_renderer->Render(std::static_pointer_cast<Popup>(shared_from_this()));
-        }
-
-        const std::string& GetTitle() const
-        {
-            return m_title;
-        }
-
-        PopupObject::PopupObjects& GetPopupObjects()
-        {
-            return m_popupObjectList;
-        }
-
-        virtual ~Popup()
-        {
-            FOREACH(it, m_popupObjectList) {
-                delete *it;
-            }
-        }
-
-      private:
-        friend class PopupRenderer;
-        friend class std::shared_ptr<Popup>;
-        friend class PopupObjectTheme;
-
-        Popup(std::shared_ptr<PopupRenderer> renderer) : m_renderer(renderer)
-        {}
-
-        void ForwardAnswer(const AnswerCallbackData & answer) const
-        {
-            m_callback(answer, m_data);
-        }
-
-        std::string m_title;
-        void* m_data;
-        IPopup::PopupCallbackType m_callback;
-        PopupObject::PopupObjects m_popupObjectList;
-        std::shared_ptr<PopupRenderer> m_renderer;
-    };
-
-  private:
-    void Render (PopupPtr popup);
-
-    class Impl;
-    Impl* m_impl;
-};
-
-typedef std::shared_ptr<PopupRenderer> PopupRendererPtr;
-}
-} // namespace Popup
-} // namespace Wrt
-
-#endif //WRT_SRC_POPUP_POPUP_RENDERER_H_
diff --git a/src_wearable/wrt-popup/wrt/popup-runner/CMakeLists.txt b/src_wearable/wrt-popup/wrt/popup-runner/CMakeLists.txt
deleted file mode 100644 (file)
index 0a8f45e..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-# 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     CMakeLists.txt
-# @author   Lukasz Marek (l.marek@samsung.com)
-#
-# @version  1.0
-#
-
-PKG_CHECK_MODULES(WRT_POPUP_RUNNER_LIB_DEP
-    dpl-efl
-    REQUIRED
-)
-
-set(WRT_POPUP_RUNNER_LIB_SRC_DIR ${PROJECT_SOURCE_DIR}/src/wrt-popup/wrt/popup-runner)
-
-set(WRT_POPUP_RUNNER_LIB_SOURCES
-    ${WRT_POPUP_COMMON_SRCS}
-    ${WRT_POPUP_RUNNER_LIB_SRC_DIR}/PopupInvoker.cpp
-)
-
-ADD_DEFINITIONS(${WRT_POPUP_RUNNER_LIB_DEP_CFLAGS})
-
-INCLUDE_DIRECTORIES(
-    ${WRT_POPUP_RUNNER_LIB_SRC_DIR}
-    ${WRT_POPUP_RUNNER_LIB_DEP_INCLUDE_DIRS}
-    ${WRT_POPUP_COMMON_DIR}
-)
-
-ADD_LIBRARY(${TARGET_POPUP_WRT_RUNNER_LIB} SHARED
-    ${WRT_POPUP_RUNNER_LIB_SOURCES}
-)
-
-SET_TARGET_PROPERTIES(${TARGET_POPUP_WRT_RUNNER_LIB} PROPERTIES
-    COMPILE_FLAGS -fPIC
-)
-
-SET_TARGET_PROPERTIES(${TARGET_POPUP_WRT_RUNNER_LIB} PROPERTIES
-    SOVERSION ${CMAKE_PROJECT_API_VERSION}
-    VERSION ${CMAKE_PROJECT_VERSION}
-)
-
-target_link_libraries(${TARGET_POPUP_WRT_RUNNER_LIB}
-    ${WRT_POPUP_RUNNER_LIB_DEP_LIBRARIES}
-    ${WRT_POPUP_RUNNER_LIB_DEP_LDFLAGS}
-)
-
-INSTALL(TARGETS ${TARGET_POPUP_WRT_RUNNER_LIB}
-    DESTINATION lib
-)
-
-INSTALL(FILES ${WRT_POPUP_RUNNER_LIB_SRC_DIR}/PopupInvoker.h
-    DESTINATION ${DESTINATION_HEADERS_WRT_POPUP_RUNNER}
-)
diff --git a/src_wearable/wrt-popup/wrt/popup-runner/PopupInvoker.cpp b/src_wearable/wrt-popup/wrt/popup-runner/PopupInvoker.cpp
deleted file mode 100644 (file)
index 16cbace..0000000
+++ /dev/null
@@ -1,247 +0,0 @@
-/*
- * 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 "PopupInvoker.h"
-#include <sstream>
-#include <unistd.h>
-#include <stdio.h>
-#include <dpl/log/log.h>
-#include <dpl/waitable_handle.h>
-#include <dpl/binary_queue.h>
-#include <dpl/serialization.h>
-#include <dpl/exception.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include "PopupEnum.h"
-#include "PopupSerializer.h"
-
-namespace {
-const char *POPUP_EXEC = "/usr/bin/wrt-popup-wrt-runtime";
-}
-
-namespace Wrt {
-namespace Popup {
-PopupInvoker::PopupInvoker()
-{
-    char tmp[L_tmpnam + 1];
-    if (NULL == tmpnam(tmp))
-        ThrowMsg(DPL::Exception, "Failed to get pipe name");
-    m_inputName = tmp;
-
-    if (NULL == tmpnam(tmp))
-        ThrowMsg(DPL::Exception, "Failed to get pipe name");
-    m_outputName = tmp;
-
-    m_input.Create(m_inputName);
-    m_output.Create(m_outputName);
-    LogDebug("Pipes created");
-}
-
-PopupInvoker::~PopupInvoker()
-{
-    Try
-    {
-        m_input.Destroy(m_inputName);
-        m_output.Destroy(m_outputName);
-        LogDebug("Pipes destroyed");
-    }
-    Catch(DPL::Exception)
-    {
-        LogError("Cannot destroy pipes");
-    }
-}
-
-bool PopupInvoker::askYesNo(const std::string& title,
-                            const std::string& message)
-{
-    Try
-    {
-        DPL::BinaryQueue data;
-        PopupSerializer::appendArg(YES_NO_PROMPT, data);
-        PopupSerializer::appendArg(title, data);
-        PopupSerializer::appendArg(message, data);
-        DPL::NamedInputPipe tmp;
-        tmp.Open(m_outputName);
-        m_output.Open(m_outputName);
-        m_input.Open(m_inputName);
-        m_output.Write(data, data.Size());
-
-        executePopup();
-
-        //Result from popup application is available. Read it.
-        DPL::BinaryQueueAutoPtr resultData =
-            m_input.Read(std::numeric_limits<std::size_t>::max());
-        const int success = PopupSerializer::getIntArg(*resultData);
-        bool retVal = false;
-        if (success) {
-            const int result = PopupSerializer::getIntArg(*resultData);
-
-            LogDebug("Popup result is: " << result);
-
-            Assert(resultData->Empty());
-            retVal = (!!result);
-        } else {
-            LogWarning("Failed to show popup.");
-        }
-
-        tmp.Close();
-        m_input.Close();
-        m_output.Close();
-
-        return retVal;
-    }
-    Catch(DPL::Exception)
-    {
-        LogError("error occured");
-    }
-
-    return false;
-}
-
-void PopupInvoker::showInfo(const std::string& title,
-                            const std::string& message,
-                            const std::string& buttonLabel)
-{
-    Try
-    {
-        DPL::BinaryQueue data;
-        PopupSerializer::appendArg(INFO_PROMPT, data);
-        PopupSerializer::appendArg(title, data);
-        PopupSerializer::appendArg(message, data);
-        PopupSerializer::appendArg(buttonLabel, data);
-        DPL::NamedInputPipe tmp;
-        tmp.Open(m_outputName);
-        m_output.Open(m_outputName);
-        m_input.Open(m_inputName);
-        m_output.Write(data, data.Size());
-
-        executePopup();
-        DPL::BinaryQueueAutoPtr resultData =
-            m_input.Read(std::numeric_limits<std::size_t>::max());
-        const int success = PopupSerializer::getIntArg(*resultData);
-        if (!success) {
-            LogWarning("Failed to show popup.");
-        }
-        //ignore result
-
-        tmp.Close();
-        m_input.Close();
-        m_output.Close();
-    }
-    Catch(DPL::Exception)
-    {
-        LogError("error occured");
-    }
-}
-
-PopupResponse PopupInvoker::askYesNoCheckbox(const std::string& title,
-                                             const std::string& message,
-                                             const std::string& checkboxLabel)
-{
-    Try
-    {
-        DPL::BinaryQueue data;
-        PopupSerializer::appendArg(YES_NO_CHECK_PROMPT, data);
-        PopupSerializer::appendArg(title, data);
-        PopupSerializer::appendArg(message, data);
-        PopupSerializer::appendArg(checkboxLabel, data);
-        DPL::NamedInputPipe tmp;
-        tmp.Open(m_outputName);
-        m_output.Open(m_outputName);
-        m_input.Open(m_inputName);
-        m_output.Write(data, data.Size());
-
-        executePopup();
-
-        //Result from popup application is available. Read it.
-        DPL::BinaryQueueAutoPtr resultData =
-            m_input.Read(std::numeric_limits<std::size_t>::max());
-        const int success = PopupSerializer::getIntArg(*resultData);
-        if (success) {
-            const int result = PopupSerializer::getIntArg(*resultData);
-            const int rememberResult = PopupSerializer::getIntArg(*resultData);
-
-            LogDebug(
-                "Popup result is: " << result << " remeber: " << rememberResult);
-
-            Assert(resultData->Empty());
-            tmp.Close();
-            m_input.Close();
-            m_output.Close();
-
-            if (1 == result) {
-                if (rememberResult == 1) {
-                    return YES_DO_REMEMBER;
-                } else {
-                    return YES_DONT_REMEMBER;
-                }
-            } else {
-                if (rememberResult == 1) {
-                    return NO_DO_REMEMBER;
-                } else {
-                    return NO_DONT_REMEMBER;
-                }
-            }
-        } else {
-            LogWarning("Popup failed to execute.");
-            tmp.Close();
-            m_input.Close();
-            m_output.Close();
-            return NO_DONT_REMEMBER;
-        }
-    }
-    Catch(DPL::Exception)
-    {
-        LogError("error occured");
-    }
-    return NO_DONT_REMEMBER;
-}
-
-void PopupInvoker::executePopup()
-{
-    pid_t pid = fork();
-    if (pid == -1) {
-        //error occured
-        LogError("Failed to create popup process.");
-        Assert(false);
-    }
-    if (pid == 0) {
-        //child process
-        int ret = execl(POPUP_EXEC,
-                        POPUP_EXEC,
-                        m_outputName.c_str(),
-                        m_inputName.c_str(),
-                        NULL);
-        if (ret == -1) {
-            //execl returns -1 on error
-            LogError("Failed to set popup binary");
-            //write something to pipe to unblock caller process
-            DPL::NamedOutputPipe errOut;
-            errOut.Open(m_inputName);
-            DPL::BinaryQueue data;
-            PopupSerializer::appendArg(false, data);
-            errOut.Write(data, data.Size());
-            errOut.Close();
-
-            Assert(false);
-        }
-    }
-
-    DPL::WaitableHandle handle = m_input.WaitableReadHandle();
-    DPL::WaitForSingleHandle(handle);
-}
-} // Popup
-} // Wrt
index 406edbd..fb83283 100644 (file)
@@ -19,3 +19,4 @@
 INCLUDE(CMakeUtils.txt)
 
 ADD_SUBDIRECTORY(dao)
+ADD_SUBDIRECTORY(Commons)
\ No newline at end of file
index cb27239..028c4bc 100644 (file)
@@ -49,6 +49,8 @@ FUNCTION(WRT_TEST_BUILD TARGET_NAME)
         ${TEST_LIBRARY}
         ${LINK_LIBRARIES}
     )
+    SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES
+        COMPILE_DEFINITIONS LOG_TAG="${LOG_TAG}")
 ENDFUNCTION(WRT_TEST_BUILD)
 
 FUNCTION(WRT_TEST_INSTALL)
diff --git a/tests/Commons/Base64_test.cpp b/tests/Commons/Base64_test.cpp
new file mode 100644 (file)
index 0000000..2870b63
--- /dev/null
@@ -0,0 +1,249 @@
+/*
+ * Copyright (c) 2014 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    Base64_test.cpp
+ * @author  Grzegorz Rynkowski (g.rynkowski@samsung.com)
+ * @brief   This file contains tests for Base64
+ */
+
+#include <Commons/Base64.h>
+#include <Commons/Exception.h>
+#include <dpl/log/secure_log.h>
+#include <dpl/test/test_runner.h>
+#include <cstring>
+#include <memory>
+#include <random>
+#include <set>
+#include <string>
+#include <type_traits>
+
+using namespace WrtDeviceApis::Commons;
+
+namespace {
+struct TextPair {
+    TextPair(std::string&& decoded_, std::string&& encoded_)
+    {
+        std::swap(decoded_, decoded);
+        std::swap(encoded_, encoded);
+    }
+    std::string decoded, encoded;
+
+    static const std::vector<TextPair>& examples()
+    {
+        static std::vector<TextPair> vec = {
+                TextPair(
+                "Man is distinguished, not only by his reason, but by this sing"
+                "ular passion from other animals, which is a lust of the mind, "
+                "that by a perseverance of delight in the continued and indefat"
+                "igable generation of knowledge, exceeds the short vehemence of"
+                " any carnal pleasure.",
+                "TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIG"
+                "J1dCBieSB0aGlzIHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlciBhbmltYWxz"
+                "LCB3aGljaCBpcyBhIGx1c3Qgb2YgdGhlIG1pbmQsIHRoYXQgYnkgYSBwZXJzZX"
+                "ZlcmFuY2Ugb2YgZGVsaWdodCBpbiB0aGUgY29udGludWVkIGFuZCBpbmRlZmF0"
+                "aWdhYmxlIGdlbmVyYXRpb24gb2Yga25vd2xlZGdlLCBleGNlZWRzIHRoZSBzaG"
+                "9ydCB2ZWhlbWVuY2Ugb2YgYW55IGNhcm5hbCBwbGVhc3VyZS4="),
+                TextPair("f", "Zg=="),
+                TextPair("fo" , "Zm8="),
+                TextPair("foo" , "Zm9v"),
+                TextPair("foob" , "Zm9vYg=="),
+                TextPair("fooba" , "Zm9vYmE=")
+        };
+        return vec;
+    }
+};
+
+template<typename T>
+std::unique_ptr<T[]> convertStringToPtr(const std::string& str)
+{
+    static_assert(std::is_same<unsigned char, T>::value
+                || std::is_same<char, T>::value,
+            "std::string is able convert into char[] or unsigned char[]");
+    std::unique_ptr<T[]> textCopy(new T[str.length() + 1]);
+    std::memcpy(textCopy.get(), str.c_str(), str.length() + 1);
+    return std::move(textCopy);
+}
+
+#define CheckEncodeMsg(original_, encoded_, msg) {                             \
+    std::string original(original_), encoded(encoded_);                        \
+    std::string methodResult = Base64::encode(                                 \
+                    convertStringToPtr<unsigned char>(original).get(),         \
+                    original.length());                                        \
+    if (!(methodResult == encoded)) {                                          \
+        _D("Encoded text     = \"%s\"", encoded.c_str());                 \
+        _D("Base64::encode() = \"%s\"", methodResult.c_str());            \
+        RUNNER_ASSERT(false);                                                  \
+    }                                                                          \
+}
+#define CheckEncode(original, encoded) CheckEncodeMsg(original, encoded, "")
+
+#define CheckDecodeMsg(encoded_, decoded_, msg) {                              \
+    std::string encoded(encoded_), decoded(decoded_);                          \
+    std::string methodResult = Base64::decode(encoded);                        \
+    if (!(methodResult == decoded)) {                                          \
+        _D("Decoded text     = \"%s\"", decoded.c_str());                 \
+        _D("Base64::decode() = \"%s\"", methodResult.c_str());            \
+        RUNNER_ASSERT(methodResult == decoded);                                \
+    }                                                                          \
+}
+#define CheckDecode(original, decoded) CheckDecodeMsg(original, decoded, "")
+
+const std::set<char> base64chars = {
+        'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
+        'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
+        'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
+        'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
+        '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/'};
+
+} // unnamed namespace
+
+
+RUNNER_TEST_GROUP_INIT(Base64)
+
+/*
+Name: base64_test_encode
+Description: Tests encoding of examples
+Expected: Base64::encode should encode examples correctly.
+*/
+RUNNER_TEST(base64_test_encode)
+{
+    for (auto& i : TextPair::examples())
+        CheckEncode(i.decoded, i.encoded);
+}
+
+/*
+Name: base64_test_encode_empty
+Description: Tests encoding of empty string
+Expected: Base64::encode should return empty string too
+*/
+RUNNER_TEST(base64_test_encode_empty)
+{
+    CheckEncodeMsg("", "", "Encoded of empty string should be empty too.");
+}
+
+/*
+Name: base64_test_decode
+Description: Tests decoding of examples
+Expected: Base64::encode should decode examples correctly.
+*/
+RUNNER_TEST(base64_test_decode)
+{
+    for (auto& i : TextPair::examples())
+        CheckDecode(i.encoded, i.decoded);
+}
+
+/*
+Name: base64_test_decode_empty
+Description: Tests decoding of empty string
+Expected: Base64::decode should return empty string too
+*/
+RUNNER_TEST(base64_test_decode_empty)
+{
+    CheckDecodeMsg("", "", "Decoded of empty string should be empty too.");
+}
+
+/*
+Name: base64_test_decode_only_pads
+Description: Tests decoding of string with only pads
+Expected: Base64::decode should return empty string
+*/
+RUNNER_TEST(base64_test_decode_only_pads)
+{
+    CheckDecodeMsg("====", "",
+            "Decoded string with only pads should produce empty string");
+}
+
+/*
+Name: base64_test_decode_invalid_length
+Description: Tests decoding of string with invalid length
+Expected: Base64::decode should throw exception
+*/
+RUNNER_TEST(base64_test_decode_invalid_length)
+{
+    for (auto& example : TextPair::examples()) {
+        for (int i = 1; i <= 3; ++i) {
+            std::string encodedWithInvalideLength =
+                    example.encoded.substr(0, example.encoded.size() - i);
+            Try {
+                Base64::decode(encodedWithInvalideLength);
+                RUNNER_ASSERT_MSG(false,
+                        "For invalid length method should throw exception.");
+            } Catch (InvalidArgumentException) {
+                // Test pass - nothing to do
+            } Catch (DPL::Exception) {
+                RUNNER_ASSERT_MSG(false, "Unknown exception.");
+            }
+        }
+    }
+}
+
+/*
+Name: base64_test_decode_invalid_valid_char
+Description: Tests decoding of string with all ASCII characters
+Expected: Base64::decode should throw exception for characters that aren't
+    in alphabet of Base64.
+*/
+RUNNER_TEST(base64_test_decode_invalid_valid_char)
+{
+    std::random_device rd;
+    std::mt19937 gen(rd());
+
+    for (const TextPair& ex : TextPair::examples())
+    {
+        for (char character = 1; character != 0; ++character)
+        {
+            if('=' == character)
+                continue;
+
+            std::string encodedWithNewChar(
+                    [&]()->std::string // return string with invalide character
+                    {
+                        std::size_t lastPosition = ex.encoded.find('=');
+                        lastPosition = (std::string::npos == lastPosition)
+                                ? ex.encoded.length()-1 : lastPosition - 1;
+                        std::uniform_int_distribution<> dis(0, lastPosition);
+
+                        int randomPosition = dis(gen);
+                        std::unique_ptr<char[]> tmp =
+                                convertStringToPtr<char>(ex.encoded);
+                        tmp.get()[randomPosition] = character;
+                        return std::string(tmp.get());
+                    }());
+
+            bool found = (base64chars.find(character) != base64chars.end());
+            Try {
+                Base64::decode(encodedWithNewChar);
+                if (!found) {
+                    _D("Before = \"%s\"", ex.encoded.c_str());
+                    _D("After  = \"%s\"", encodedWithNewChar.c_str());
+                }
+                RUNNER_ASSERT_MSG(found, "For invalid character("
+                        << static_cast<int>(character) << "|'" << character
+                        << "') method should throw exception.");
+            } Catch (InvalidArgumentException) {
+                if (found) {
+                    _D("Before = \"%s\"", ex.encoded.c_str());
+                    _D("After  = \"%s\"", encodedWithNewChar.c_str());
+                }
+                RUNNER_ASSERT_MSG(!found, "For valid character("
+                        << static_cast<int>(character) << "|'" << character
+                        << "') the exception shouldn't be threw.");
+            } Catch (DPL::Exception) {
+                RUNNER_ASSERT_MSG(false, "Unknown exception.");
+            }
+        }
+    }
+}
diff --git a/tests/Commons/CMakeLists.txt b/tests/Commons/CMakeLists.txt
new file mode 100644 (file)
index 0000000..c5ba7fc
--- /dev/null
@@ -0,0 +1,42 @@
+# Copyright (c) 2014 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        CMakeLists.txt
+# @author      Grzegorz Rynkowski (g.rynkowski@sasmung.com)
+# @brief
+#
+
+# names of tested targets
+SET(TARGET_COMMONS "wrt-plugins-commons")                    # name of tested target
+SET(TARGET_COMMONS_TEST "wrt-plugins-common-tests-Commons")  # name of target
+
+
+PKG_SEARCH_MODULE(dpl REQUIRED dpl-efl)
+PKG_SEARCH_MODULE(dpl-test REQUIRED dpl-test-efl)
+
+INCLUDE_DIRECTORIES(${dpl_INCLUDE_DIRS}
+                    ${dpl-test_INCLUDE_DIRS})
+
+# Set tests sources
+SET(SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/TestInit.cpp"
+            "${CMAKE_CURRENT_SOURCE_DIR}/Base64_test.cpp")
+
+WRT_TEST_BUILD(${TARGET_COMMONS_TEST} ${SOURCES})
+WRT_TEST_INSTALL(${TARGET_COMMONS_TEST})
+
+TARGET_LINK_LIBRARIES(${TARGET_COMMONS_TEST}
+  ${TARGET_COMMONS}
+  ${dpl_LIBRARIES}
+  ${dpl-test_LIBRARIES}
+)
\ No newline at end of file
similarity index 58%
rename from src_mobile/plugin-loading/js_types.h
rename to tests/Commons/TestInit.cpp
index 076582e..2e88359 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2014 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.
  *    limitations under the License.
  */
 /**
- * @file        js_types.h
- * @author      Grzegorz Krawczyk (g.krawczyk@samsung.com)
+ * @file        main.cpp
+ * @author      Grzegorz Rynkowski (g.rynkowski@samsung.com)
  * @version     1.0
+ * @brief       This file is the implementation file of main.
  */
 
-#ifndef WRT_PLUGIN_JS_TYPES_H_
-#define WRT_PLUGIN_JS_TYPES_H_
+#include <dpl/test/test_runner.h>
+#include <dpl/log/secure_log.h>
 
-//forward declaration of JSConectexRef
-extern "C" {
-typedef struct OpaqueJSContext* JSGlobalContextRef;
-typedef struct OpaqueJSValue* JSObjectRef;
-}
-
-struct JavaScriptObject
+int main(int argc, char *argv[])
 {
-    JSObjectRef instance;
-    std::string name;
-};
-
-#endif
+    _D("Starting tests");
+    return DPL::Test::TestRunnerSingleton::Instance().ExecTestRunner(argc, argv);
+}
index e970f44..7f4e50a 100644 (file)
 
 SET(TARGET_WIDGETDB_TEST "wrt-plugins-common-tests-widgetdb")
 
-pkg_search_module(dpl REQUIRED dpl-efl)
-pkg_search_module(dpl-test REQUIRED dpl-test-efl)
+PKG_SEARCH_MODULE(dpl REQUIRED dpl-efl)
+PKG_SEARCH_MODULE(dpl-test REQUIRED dpl-test-efl)
 
-include_directories(
+INCLUDE_DIRECTORIES(
   ${dpl_INCLUDE_DIRS}
   ${dpl-test_INCLUDE_DIRS}
 )
@@ -35,7 +35,7 @@ SET(WIDGETDB_TESTS_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/TestInit.cpp"
 WRT_TEST_BUILD(${TARGET_WIDGETDB_TEST} ${WIDGETDB_TESTS_SOURCES})
 WRT_TEST_INSTALL(${TARGET_WIDGETDB_TEST})
 
-target_link_libraries(${TARGET_WIDGETDB_TEST}
+TARGET_LINK_LIBRARIES(${TARGET_WIDGETDB_TEST}
   "wrt-plugins-widgetdb"
   ${dpl_LIBRARIES}
   ${dpl-test_LIBRARIES}
index d8a5d50..f6ec48d 100644 (file)
@@ -30,8 +30,7 @@
 using namespace WrtDeviceApis::WidgetDB::Api;
 
 #define RUNNER_ASSERT_WHAT_EQUALS(in, test)                                    \
-    do                                                                         \
-    {                                                                          \
+    do {                                                                       \
         std::string temp(in);                                                  \
         RUNNER_ASSERT_MSG(temp == (test), "Equals: [" << temp << "]");         \
     }                                                                          \
old mode 100644 (file)
new mode 100755 (executable)
index 4ae6e9b..d8f805c
@@ -3,9 +3,7 @@
     <domain name="wrt-plugins-common"/>
   </define>
   <assign>
-    <filesystem path="/usr/bin/wrt-popup-ace-runtime" label="wrt-popup-ace-runtime" exec_label="wrt-popup-ace-runtime"/>
     <filesystem path="/usr/bin/wrt-popup-wrt-runtime" label="wrt-popup-wrt-runtime" exec_label="wrt-popup-wrt-runtime"/>
-    <filesystem path="/usr/bin/wrt-plugins-installer" label="_" exec_label="none"/>
   </assign>
   <request>
     <domain name="_"/>
diff --git a/wrt-popup-ace-runtime.mobile.rule b/wrt-popup-ace-runtime.mobile.rule
deleted file mode 100644 (file)
index af50ad6..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-wrt-popup-ace-runtime system::homedir rwx
-wrt-popup-ace-runtime device::app_logging w
-wrt-popup-ace-runtime ail::db rw
-wrt-popup-ace-runtime xorg rwx
-wrt-popup-ace-runtime isf rx
-wrt-popup-ace-runtime system::vconf rwx
-wrt-popup-ace-runtime sound_server rw
-wrt-popup-ace-runtime e17 rw
-e17 wrt-popup-ace-runtime rw
-wrt-popup-ace-runtime system::share rwx
-wrt-popup-ace-runtime pulseaudio rwx
-wrt-popup-ace-runtime mobileprint x
-wrt-popup-ace-runtime dbus r
-
diff --git a/wrt-popup-ace-runtime.mobile2.rule b/wrt-popup-ace-runtime.mobile2.rule
deleted file mode 100644 (file)
index 105b2d3..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-wrt-popup-ace-runtime system::homedir rwx--
-wrt-popup-ace-runtime device::app_logging -w---
-wrt-popup-ace-runtime ail::db rw---
-wrt-popup-ace-runtime xorg rwx--
-wrt-popup-ace-runtime isf r-x--
-wrt-popup-ace-runtime system::vconf rwx--
-wrt-popup-ace-runtime sound_server rw---
-wrt-popup-ace-runtime e17 rw---
-e17 wrt-popup-ace-runtime rw---
-wrt-popup-ace-runtime system::share rwx--
-wrt-popup-ace-runtime pulseaudio rwx--
-wrt-popup-ace-runtime mobileprint --x--
-wrt-popup-ace-runtime dbus r----
diff --git a/wrt-popup-ace-runtime.rule b/wrt-popup-ace-runtime.rule
deleted file mode 100644 (file)
index f01a5bc..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-wrt-popup-ace-runtime system::homedir rwx
-wrt-popup-ace-runtime device::app_logging w
-wrt-popup-ace-runtime ail::db rw
-wrt-popup-ace-runtime xorg rwx
-wrt-popup-ace-runtime isf rx
-wrt-popup-ace-runtime system::vconf rwx
-wrt-popup-ace-runtime sound_server rw
-wrt-popup-ace-runtime e17 rw
-e17 wrt-popup-ace-runtime rw
-wrt-popup-ace-runtime system::share rwx
-wrt-popup-ace-runtime pulseaudio rwx
-wrt-popup-ace-runtime dbus r
-
diff --git a/wrt-popup-wrt-runtime.efl b/wrt-popup-wrt-runtime.efl
new file mode 100644 (file)
index 0000000..51c3509
--- /dev/null
@@ -0,0 +1,13 @@
+wrt-popup-wrt-runtime system::homedir rwx--- ------
+wrt-popup-wrt-runtime device::app_logging -w---- ------
+wrt-popup-wrt-runtime ail::db rw---- ------
+wrt-popup-wrt-runtime xorg rwx--- ------
+wrt-popup-wrt-runtime isf r-x--- ------
+wrt-popup-wrt-runtime sound_server rw---- ------
+wrt-popup-wrt-runtime e17 rw---- ------
+e17 wrt-popup-wrt-runtime rw---- ------
+wrt-popup-wrt-runtime system::share rwxat- ------
+wrt-popup-wrt-runtime pulseaudio rwx--- ------
+wrt-popup-wrt-runtime dbus r----- ------
+wrt-popup-wrt-runtime sys-assert::core rwxat
+
diff --git a/wrt-popup-wrt-runtime.mobile.rule b/wrt-popup-wrt-runtime.mobile.rule
deleted file mode 100644 (file)
index 1ad6fbc..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-wrt-popup-wrt-runtime system::homedir rwx
-wrt-popup-wrt-runtime device::app_logging w
-wrt-popup-wrt-runtime ail::db rw
-wrt-popup-wrt-runtime xorg rwx
-wrt-popup-wrt-runtime isf rx
-wrt-popup-wrt-runtime system::vconf rwx
-wrt-popup-wrt-runtime sound_server rw
-wrt-popup-wrt-runtime e17 rw
-e17 wrt-popup-wrt-runtime rw
-wrt-popup-wrt-runtime system::share rwx
-wrt-popup-wrt-runtime pulseaudio rwx
-wrt-popup-wrt-runtime mobileprint x
-wrt-popup-wrt-runtime dbus r
-
diff --git a/wrt-popup-wrt-runtime.mobile2.rule b/wrt-popup-wrt-runtime.mobile2.rule
deleted file mode 100644 (file)
index 09a1e0a..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-wrt-popup-wrt-runtime system::homedir rwx--
-wrt-popup-wrt-runtime device::app_logging -w---
-wrt-popup-wrt-runtime ail::db rw---
-wrt-popup-wrt-runtime xorg rwx--
-wrt-popup-wrt-runtime isf r-x--
-wrt-popup-wrt-runtime system::vconf rwx--
-wrt-popup-wrt-runtime sound_server rw---
-wrt-popup-wrt-runtime e17 rw---
-e17 wrt-popup-wrt-runtime rw---
-wrt-popup-wrt-runtime system::share rwx--
-wrt-popup-wrt-runtime pulseaudio rwx--
-wrt-popup-wrt-runtime mobileprint --x--
-wrt-popup-wrt-runtime dbus r----
diff --git a/wrt-popup-wrt-runtime.rule b/wrt-popup-wrt-runtime.rule
deleted file mode 100644 (file)
index 53211ca..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-wrt-popup-wrt-runtime system::homedir rwx
-wrt-popup-wrt-runtime device::app_logging w
-wrt-popup-wrt-runtime ail::db rw
-wrt-popup-wrt-runtime xorg rwx
-wrt-popup-wrt-runtime isf rx
-wrt-popup-wrt-runtime system::vconf rwx
-wrt-popup-wrt-runtime sound_server rw
-wrt-popup-wrt-runtime e17 rw
-e17 wrt-popup-wrt-runtime rw
-wrt-popup-wrt-runtime system::share rwx
-wrt-popup-wrt-runtime pulseaudio rwx
-wrt-popup-wrt-runtime dbus r
-