merge with master submit/tizen_2.1/20130316.110657
authorJinkun Jang <jinkun.jang@samsung.com>
Fri, 15 Mar 2013 16:21:54 +0000 (01:21 +0900)
committerJinkun Jang <jinkun.jang@samsung.com>
Fri, 15 Mar 2013 16:21:54 +0000 (01:21 +0900)
336 files changed:
debian/changelog
packaging/wrt-plugins-common.spec
src/Commons/Base64.cpp
src/Commons/Base64.h
src/Commons/Dimension.h
src/Commons/Emitters.h
src/Commons/EventListener.h
src/Commons/EventReceiver.h
src/Commons/Exception.h
src/Commons/FunctionDeclaration.h
src/Commons/FunctionDefinition.cpp
src/Commons/FunctionDefinition.h
src/Commons/IEvent.h
src/Commons/IExternEventCanceler.h
src/Commons/JSObject.h
src/Commons/JSObjectDeclaration.cpp
src/Commons/JSObjectDeclaration.h
src/Commons/ListenerEvent.h
src/Commons/ListenerEventEmitter.h
src/Commons/Range.h
src/Commons/Regex.cpp
src/Commons/Regex.h
src/Commons/RegexPatterns.h
src/Commons/RegexUtils.cpp
src/Commons/RegexUtils.h
src/Commons/StaticAssert.h
src/Commons/StringBuilder.cpp
src/Commons/StringBuilder.h
src/Commons/StringUtils.cpp
src/Commons/StringUtils.h
src/Commons/ThreadPool.cpp [changed mode: 0755->0644]
src/Commons/ThreadPool.h [changed mode: 0755->0644]
src/Commons/TimeUtils.cpp
src/Commons/TimeUtils.h
src/Commons/TypeTraits.h
src/Commons/TypesDeclaration.h
src/Commons/WrtAccess/WrtAccess.cpp
src/Commons/WrtAccess/WrtAccess.h
src/Commons/plugin_initializer_def.h [changed mode: 0755->0644]
src/CommonsJavaScript/Converter.cpp
src/CommonsJavaScript/Converter.h
src/CommonsJavaScript/DOMExceptionData.cpp
src/CommonsJavaScript/DOMExceptionData.h
src/CommonsJavaScript/JSCallbackManager.cpp
src/CommonsJavaScript/JSCallbackManager.h
src/CommonsJavaScript/JSDOMException.cpp
src/CommonsJavaScript/JSDOMException.h
src/CommonsJavaScript/JSDOMExceptionFactory.cpp
src/CommonsJavaScript/JSDOMExceptionFactory.h
src/CommonsJavaScript/JSPendingOperation.cpp
src/CommonsJavaScript/JSPendingOperation.h
src/CommonsJavaScript/JSPendingOperationPrivateObject.h
src/CommonsJavaScript/JSUtils.cpp
src/CommonsJavaScript/JSUtils.h
src/CommonsJavaScript/PrivateObject.h
src/CommonsJavaScript/ScopedJSStringRef.cpp
src/CommonsJavaScript/Security/SecurityFunctionDeclaration.cpp
src/CommonsJavaScript/Security/SecurityFunctionDeclaration.h
src/CommonsJavaScript/Security/StaticDeclaration.h
src/CommonsJavaScript/SecurityExceptions.h [changed mode: 0755->0644]
src/CommonsJavaScript/SupportPendingOperation.h
src/CommonsJavaScript/Utils.h
src/CommonsJavaScript/Validator.cpp
src/CommonsJavaScript/Validator.h
src/js-overlay/JSClass/JSSoftKeyboardChangeEvent.cpp
src/js-overlay/JSClass/JSSoftKeyboardChangeEvent.h
src/js-overlay/JSClass/JSStorageEvent.cpp
src/js-overlay/JSClass/JSStorageEvent.h
src/js-overlay/JSClass/JSTizenServiceEvent.cpp
src/js-overlay/JSClass/JSTizenServiceEvent.h
src/js-overlay/js_function_manager.cpp
src/js-overlay/js_iframe_support.cpp
src/js-overlay/js_iframe_support.h
src/js-overlay/js_overlay_addEventListener.cpp
src/js-overlay/js_overlay_addEventListener.h
src/js-overlay/js_overlay_functions.cpp
src/js-overlay/js_overlay_functions.h
src/js-overlay/js_overlay_support.cpp
src/js-overlay/js_overlay_support.h
src/js-overlay/js_overlay_types.h
src/modules/API/DEPRACATED/AppLauncher/AppLauncherFactory.h
src/modules/API/DEPRACATED/AppLauncher/EventGetDefaultApplication.h
src/modules/API/DEPRACATED/AppLauncher/EventGetInstalledApplications.h
src/modules/API/DEPRACATED/AppLauncher/EventLaunchApplication.h
src/modules/API/DEPRACATED/AppLauncher/IAppLauncherManager.cpp
src/modules/API/DEPRACATED/AppLauncher/IAppLauncherManager.h
src/modules/API/DEPRACATED/Device/EventClamshellStateChange.cpp
src/modules/API/DEPRACATED/Device/IClamshell.cpp
src/modules/API/DEPRACATED/Device/IClamshell.h
src/modules/API/DEPRACATED/Device/IKeypad.cpp
src/modules/API/DEPRACATED/Device/IManager.cpp
src/modules/API/DEPRACATED/Display/EventChangeOrientation.cpp
src/modules/API/DEPRACATED/Display/EventChangeState.cpp
src/modules/API/DEPRACATED/Display/IManager.cpp
src/modules/API/DEPRACATED/Display/IManager.h
src/modules/API/DEPRACATED/Display/IScreen.cpp
src/modules/API/DEPRACATED/Display/IScreen.h
src/modules/API/DEPRACATED/FeatureLoader/EventLoadFeature.h
src/modules/API/DEPRACATED/FeatureLoader/FeatureManagerFactory.h
src/modules/API/DEPRACATED/FeatureLoader/IFeatureManager.cpp
src/modules/API/DEPRACATED/FeatureLoader/IFeatureManager.h
src/modules/API/DEPRACATED/Gallery/IEventClose.h
src/modules/API/DEPRACATED/Gallery/IEventGetGalleries.h
src/modules/API/DEPRACATED/Gallery/IEventGetMediaItemById.h
src/modules/API/DEPRACATED/Gallery/IEventGetMediaItems.h
src/modules/API/DEPRACATED/Gallery/IEventOpen.h
src/modules/API/DEPRACATED/Gallery/IEventRefresh.h
src/modules/API/DEPRACATED/Gallery/IGallery.cpp
src/modules/API/DEPRACATED/Gallery/IGalleryRequestManager.cpp
src/modules/API/DEPRACATED/Gallery/IGalleryRequestManager.h
src/modules/API/DEPRACATED/Gallery/IMediaItem.h
src/modules/API/DEPRACATED/Gallery/IViewProperties.cpp
src/modules/API/DEPRACATED/Geolocation/EventGetCurrentPosition.h
src/modules/API/DEPRACATED/Geolocation/EventPositionChanged.h
src/modules/API/DEPRACATED/Geolocation/GeolocationFactory.cpp
src/modules/API/DEPRACATED/Geolocation/IGeolocation.cpp
src/modules/API/DEPRACATED/Geolocation/IGeolocation.h
src/modules/API/DEPRACATED/Geolocation/PositionProperties.h
src/modules/API/DEPRACATED/Memory/IManager.cpp
src/modules/API/DEPRACATED/System/IDate.cpp
src/modules/API/DEPRACATED/System/IEnvironment.cpp
src/modules/API/DEPRACATED/Telephony/IEventClearLogs.h
src/modules/API/DEPRACATED/Telephony/IEventDeleteLogEntry.h
src/modules/API/DEPRACATED/Telephony/IEventFindLogEntries.h
src/modules/API/DEPRACATED/Telephony/IEventGetNumberOfLogs.h
src/modules/API/DEPRACATED/Telephony/ILogManager.cpp
src/modules/API/DEPRACATED/Telephony/ILogManager.h
src/modules/API/DEPRACATED/Telephony/LogEntry.cpp
src/modules/API/DEPRACATED/Telephony/LogEntry.h
src/modules/API/DEPRACATED/Telephony/LogFilter.cpp
src/modules/API/DEPRACATED/Telephony/TelephonyFactory.h
src/modules/API/DEPRACATED/UI/IPreferences.h
src/modules/API/DEPRACATED/UI/IPreferencesEvents.h
src/modules/API/DEPRACATED/UI/UIFactory.h
src/modules/API/Filesystem/Enums.h
src/modules/API/Filesystem/EventCopy.cpp
src/modules/API/Filesystem/EventCopy.h
src/modules/API/Filesystem/EventFind.cpp
src/modules/API/Filesystem/EventFind.h
src/modules/API/Filesystem/EventListNodes.cpp
src/modules/API/Filesystem/EventListNodes.h
src/modules/API/Filesystem/EventMove.cpp
src/modules/API/Filesystem/EventMove.h
src/modules/API/Filesystem/EventOpen.cpp
src/modules/API/Filesystem/EventOpen.h
src/modules/API/Filesystem/EventReadText.cpp
src/modules/API/Filesystem/EventReadText.h
src/modules/API/Filesystem/EventRemove.cpp
src/modules/API/Filesystem/EventRemove.h
src/modules/API/Filesystem/EventResolve.cpp
src/modules/API/Filesystem/EventResolve.h
src/modules/API/Filesystem/IManager.cpp
src/modules/API/Filesystem/IManager.h
src/modules/API/Filesystem/INode.cpp
src/modules/API/Filesystem/INode.h
src/modules/API/Filesystem/INodeTypes.h
src/modules/API/Filesystem/IPath.cpp
src/modules/API/Filesystem/IPath.h
src/modules/API/Filesystem/IStream.cpp
src/modules/API/Filesystem/IStream.h
src/modules/API/Filesystem/NodeFilter.cpp
src/modules/API/Filesystem/NodeFilter.h
src/modules/API/Filesystem/PathUtils.cpp
src/modules/API/Filesystem/PathUtils.h
src/modules/API/LocalStorage/ILocalStorage.h
src/modules/API/LocalStorage/LocalStorageMgr.cpp
src/modules/API/LocalStorage/LocalStorageMgr.h
src/modules/API/Networking/EventConnected.cpp
src/modules/API/Networking/EventDisconnected.cpp
src/modules/API/Networking/IAdapter.cpp
src/modules/API/Networking/IConnection.cpp
src/modules/API/Networking/IManager.cpp
src/modules/API/PluginManager/IPluginManager.h
src/modules/API/PluginManager/PluginManagerFactory.cpp
src/modules/API/PluginManager/PluginManagerFactory.h
src/modules/API/SoftKeyboardChangeEvent/ISoftKeyboardChangeEvent.h
src/modules/API/SoftKeyboardChangeEvent/SoftKeyboardChangeEvent.cpp
src/modules/API/SoftKeyboardChangeEvent/SoftKeyboardChangeEvent.h
src/modules/API/StorageEvent/IStorageEvent.h
src/modules/API/StorageEvent/StorageEvent.cpp
src/modules/API/StorageEvent/StorageEvent.h
src/modules/API/StorageEvent/StorageEventMgr.cpp
src/modules/API/StorageEvent/StorageEventMgr.h
src/modules/API/TizenServiceEvent/ITizenServiceEvent.h
src/modules/API/TizenServiceEvent/TizenServiceEvent.cpp
src/modules/API/TizenServiceEvent/TizenServiceEvent.h
src/modules/API/Widget/IWidget.h
src/modules/API/Widget/WidgetFactory.cpp
src/modules/API/Widget/WidgetFactory.h
src/modules/API/WidgetDB/IWidgetDB.h
src/modules/API/WidgetDB/IWidgetFeature.h
src/modules/API/WidgetDB/WidgetDBMgr.cpp
src/modules/API/WidgetDB/WidgetDBMgr.h
src/modules/tizen/DEPRACATED/AppLauncher/AppLauncherManager.cpp
src/modules/tizen/DEPRACATED/AppLauncher/AppLauncherManager.h
src/modules/tizen/DEPRACATED/Camera-Webkit/Camera.cpp
src/modules/tizen/DEPRACATED/Camera-Webkit/Camera.h
src/modules/tizen/DEPRACATED/Camera-Webkit/CameraManager.cpp
src/modules/tizen/DEPRACATED/Camera-Webkit/CameraManager.h
src/modules/tizen/DEPRACATED/Device/Manager.cpp
src/modules/tizen/DEPRACATED/Display/Manager.cpp
src/modules/tizen/DEPRACATED/Display/Screen.cpp
src/modules/tizen/DEPRACATED/Display/Screen.h
src/modules/tizen/DEPRACATED/FeatureLoader/FeatureManager.cpp
src/modules/tizen/DEPRACATED/FeatureLoader/FeatureManager.h
src/modules/tizen/DEPRACATED/Gallery/Gallery.cpp
src/modules/tizen/DEPRACATED/Gallery/Gallery.h
src/modules/tizen/DEPRACATED/Gallery/GalleryRequestManager.cpp
src/modules/tizen/DEPRACATED/Gallery/GalleryRequestManager.h
src/modules/tizen/DEPRACATED/Geolocation/Geolocation.cpp
src/modules/tizen/DEPRACATED/Geolocation/Geolocation.h
src/modules/tizen/DEPRACATED/Memory/Manager.cpp
src/modules/tizen/DEPRACATED/Memory/Manager.h
src/modules/tizen/DEPRACATED/System/Environment.cpp
src/modules/tizen/DEPRACATED/Telephony/LogEntryWrapper.cpp
src/modules/tizen/DEPRACATED/Telephony/LogEntryWrapper.h
src/modules/tizen/DEPRACATED/Telephony/LogManager.cpp
src/modules/tizen/DEPRACATED/Telephony/LogManager.h
src/modules/tizen/Filesystem/Manager.cpp [changed mode: 0755->0644]
src/modules/tizen/Filesystem/Manager.h
src/modules/tizen/Filesystem/Node.cpp [changed mode: 0755->0644]
src/modules/tizen/Filesystem/Node.h
src/modules/tizen/Filesystem/NodeFilterMatcher.cpp
src/modules/tizen/Filesystem/NodeFilterMatcher.h
src/modules/tizen/Filesystem/Path.cpp
src/modules/tizen/Filesystem/Path.h
src/modules/tizen/Filesystem/Stream.cpp [changed mode: 0755->0644]
src/modules/tizen/Filesystem/Stream.h
src/modules/tizen/Filesystem/Utils.cpp
src/modules/tizen/Filesystem/Utils.h
src/modules/tizen/Networking/EthernetAdapter.cpp
src/modules/tizen/Networking/EthernetAdapter.h
src/modules/tizen/Networking/Manager.cpp
src/modules/tizen/Networking/WifiAdapter.cpp
src/modules/tizen/Networking/WifiAdapter.h
src/modules/tizen/PluginManager/PluginManager.cpp
src/modules/tizen/PluginManager/PluginManager.h
src/modules/tizen/Widget/Property.h
src/modules/tizen/Widget/Widget.cpp
src/modules/tizen/Widget/Widget.h
src/modules/tizen/WidgetDB/WidgetDB.cpp
src/modules/tizen/WidgetDB/WidgetDB.h
src/modules/tizen/WidgetDB/WidgetFeature.cpp
src/modules/tizen/WidgetDB/WidgetFeature.h
src/modules/tizen/WidgetInterfaceDAO/WidgetInterfaceDAO.cpp
src/modules/tizen/WidgetInterfaceDAO/WidgetInterfaceDAO.h
src/modules/tizen/WidgetInterfaceDAO/widget_interface_db_sql_generator.h
src/plugin-loading/explorer.cpp
src/plugin-loading/explorer.h
src/plugin-loading/javascript_interface.cpp
src/plugin-loading/javascript_interface.h
src/plugin-loading/js_page_session.cpp
src/plugin-loading/js_types.h
src/plugin-loading/plugin.cpp
src/plugin-loading/plugin.h
src/plugin-loading/plugin_container_support.cpp
src/plugin-loading/plugin_container_support.h
src/plugin-loading/plugin_iframe_support.cpp
src/plugin-loading/plugin_iframe_support.h
src/plugin-loading/plugin_logic.cpp
src/plugin-loading/plugin_logic.h
src/plugin-loading/plugin_model.cpp
src/plugin-loading/plugin_model.h
src/plugin-loading/plugin_property_support.cpp
src/plugin-loading/plugin_property_support.h
src/plugins-api-support/CallbackSupport.h
src/plugins-api-support/ExportedApi.h
src/plugins-api-support/IObject.h
src/plugins-api-support/IObject_cast.h
src/plugins-api-support/Object.cpp
src/plugins-api-support/Object.h
src/plugins-api-support/ObjectFactory.cpp
src/plugins-api-support/ObjectFactory.h
src/plugins-api-support/Plugin.cpp
src/plugins-api-support/Plugin.h
src/plugins-api-support/PluginRegistration.cpp
src/plugins-api-support/PluginRegistration.h
src/plugins-api-support/PluginRegistrationImpl.h
src/plugins-api-support/PluginRegistry.cpp
src/plugins-api-support/PluginRegistry.h
src/plugins-api-support/PluginSignals.h
src/plugins-api-support/SignalSignature.h
src/plugins-api-support/SignalsSupport.h
src/plugins-api-support/SoFeatures.h
src/plugins-api-support/detail/traits.h
src/plugins-api-support/js_types.h
src/plugins-api-support/traits.h
src/plugins-api-support/tuple.h
src/plugins-installer/plugin_installer.cpp
src/plugins-installer/plugin_installer.h
src/plugins-installer/plugin_installer_errors.h
src/plugins-installer/plugin_metafile_reader.cpp
src/plugins-installer/plugin_objects.cpp
src/plugins-installer/plugin_objects.h
src/plugins-installer/plugin_utils.cpp
src/plugins-installer/plugin_utils.h [changed mode: 0755->0644]
src/plugins-installer/wrt_plugins_installer.cpp
src/standards/W3C/Widget/JSPreferences.cpp
src/standards/W3C/Widget/JSPreferences.h
src/standards/W3C/Widget/JSWidget.cpp
src/standards/W3C/Widget/JSWidget.h
src/standards/W3C/Widget/plugin_config.cpp
src/standards/W3C/Widget/plugin_config.h
src/standards/W3C/Widget/plugin_initializer.cpp
src/wrt-popup/ace/popup-bin/Popup.cpp
src/wrt-popup/ace/popup-bin/Popup.h
src/wrt-popup/ace/popup-runner/popup-runner.cpp
src/wrt-popup/ace/popup-runner/popup-runner.h
src/wrt-popup/wrt/PopupSerializer.cpp
src/wrt-popup/wrt/PopupSerializer.h
src/wrt-popup/wrt/popup-bin/InfoPopup.cpp
src/wrt-popup/wrt/popup-bin/InfoPopup.h
src/wrt-popup/wrt/popup-bin/YesNoCheckPopup.cpp
src/wrt-popup/wrt/popup-bin/YesNoCheckPopup.h
src/wrt-popup/wrt/popup-bin/YesNoPopup.cpp
src/wrt-popup/wrt/popup-bin/YesNoPopup.h
src/wrt-popup/wrt/popup-bin/renderer/evas_object.cpp
src/wrt-popup/wrt/popup-bin/renderer/evas_object.h
src/wrt-popup/wrt/popup-bin/renderer/popup.h
src/wrt-popup/wrt/popup-bin/renderer/popup_controller.cpp
src/wrt-popup/wrt/popup-bin/renderer/popup_controller.h
src/wrt-popup/wrt/popup-bin/renderer/popup_manager.cpp
src/wrt-popup/wrt/popup-bin/renderer/popup_manager.h
src/wrt-popup/wrt/popup-bin/renderer/popup_object.h
src/wrt-popup/wrt/popup-bin/renderer/popup_renderer.cpp
src/wrt-popup/wrt/popup-bin/renderer/popup_renderer.h
src/wrt-popup/wrt/popup-bin/wrt-popup.cpp
src/wrt-popup/wrt/popup-bin/wrt-popup.h
src/wrt-popup/wrt/popup-runner/PopupInvoker.cpp
src/wrt-popup/wrt/popup-runner/PopupInvoker.h
tests/dao/CMakeLists.txt
tests/dao/TestInit.cpp
tests/dao/WidgetDBTest.cpp
tests/dao/widgetdb_tests_prepare_db.sh
uncrustify.cfg [new file with mode: 0644]
uncrustify.sh [new file with mode: 0755]

index 8845919..14c7738 100644 (file)
@@ -1,3 +1,34 @@
+wrt-plugins-common (0.3.74) unstable; urgency=low
+
+  * Bug Fix for crash while webapi notification TC is running.
+
+ -- Tae-Jeong Lee <taejeong.lee@samsung.com>  Mon, 11 Mar 2013 22:36:32 +0900
+
+wrt-plugins-common (0.3.73) unstable; urgency=low
+
+  * Fix injection of javascript
+  * 'on_frame_unload' plugin's callback is not invoked when webapp is terminated.
+  * Fix issues shown by cppcheck for wrt-plugins-common
+  * Fix warnings in compilation of wrt-plugins-common
+
+ -- Tae-Jeong Lee <taejeong.lee@samsung.com>  Fri, 08 Mar 2013 17:21:00 +0900
+
+wrt-plugins-common (0.3.72) unstable; urgency=low
+
+  * Source code formating unification
+  * Prevent issues fixes
+
+ -- Tae-Jeong Lee <taejeong.lee@samsung.com>  Wed, 13 Feb 2013 13:58:48 +0900
+
+wrt-plugins-common (0.3.71) unstable; urgency=low
+
+  * Fix script that populates DB for plugins-tests-widgetdb tests.
+  * Fix WrtAccess singleton deinitialize issue
+  * Preloading plugin so file was changed to work only for root object.
+  * Fixed wrong widget private path
+
+ -- Soyoung Kim <sy037.kim@samsung.com>  Fri, 01 Feb 2013 17:00:54 +0900
+
 wrt-plugins-common (0.3.70) unstable; urgency=low
 
   * Add tests - widgetdb
index 338961f..d0232af 100644 (file)
@@ -1,7 +1,7 @@
-#git:framework/web/wrt-plugins-common wrt-plugins-common_0.3.70
+#git:framework/web/wrt-plugins-common wrt-plugins-common_0.3.74
 Name:       wrt-plugins-common
 Summary:    wrt-plugins common library
-Version:    0.3.70
+Version:    0.3.74
 Release:    1
 Group:      Development/Libraries
 License:    Apache License, Version 2.0
@@ -79,7 +79,7 @@ touch /opt/share/widget/plugin-installation-required
 
 %if %{with_tests}
     %attr(755,root,root) %{_bindir}/widgetdb_tests_prepare_db.sh
-    %attr(755,root,root) %{_bindir}/plugins-tests-widgetdb
+    %attr(755,root,root) %{_bindir}/wrt-plugins-common-tests-widgetdb
 %endif
 
 %files devel
index ec8f937..94ac901 100644 (file)
 
 namespace WrtDeviceApis {
 namespace Commons {
-
 const std::string Base64::chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
-    "abcdefghijklmnopqrstuvwxyz"
-    "0123456789+/";
+                                  "abcdefghijklmnopqrstuvwxyz"
+                                  "0123456789+/";
 
 bool Base64::is_base64(unsigned char c)
 {
@@ -62,7 +61,7 @@ bool Base64::is_base64(unsigned char c)
 }
 
 std::string Base64::encode(unsigned char* data,
-        std::size_t num)
+                           std::size_t num)
 {
     std::string ret;
     int i = 0;
@@ -179,6 +178,5 @@ bool Base64::is_base64_string(const std::string& str)
 {
     return ((str.size() % 4) == 0);
 }
-
 }
 } //WrtDeviceApisCommon
index 3a9e54f..5f42802 100644 (file)
 
 namespace WrtDeviceApis {
 namespace Commons {
-
 class Base64
 {
   public:
     static std::string encode(unsigned char* data,
-            std::size_t num);
+                              std::size_t num);
     static std::string decode(const std::string& str);
 
   private:
@@ -36,7 +35,6 @@ class Base64
   private:
     static const std::string chars;
 }; // Base64
-
 }
 } // WrtDeviceApisCommon
 
index 5c0a362..703e0c0 100644 (file)
@@ -22,7 +22,6 @@
 
 namespace WrtDeviceApis {
 namespace Commons {
-
 /**
  * Encapsulates width and height of a component.
  */
@@ -41,11 +40,10 @@ class Dimension
      * @param height Specified height.
      */
     Dimension(ValueType width,
-            ValueType height) :
+              ValueType height) :
         m_width(width),
         m_height(height)
-    {
-    }
+    {}
 
     ValueType getWidth() const
     {
@@ -58,7 +56,7 @@ class Dimension
     }
 
     void setSize(ValueType width,
-            ValueType height)
+                 ValueType height)
     {
         m_width = width;
         m_height = height;
@@ -68,7 +66,6 @@ class Dimension
     ValueType m_width;
     ValueType m_height;
 };
-
 }
 } // WrtDeviceApisCommon
 
index b645126..7b1d8c2 100644 (file)
@@ -29,7 +29,6 @@
 
 namespace WrtDeviceApis {
 namespace Commons {
-
 /**
  * Manages listener events emitters.
  * Template parameter should be class that derives from @see ListenerEvent.
@@ -90,7 +89,8 @@ class Emitters
     }
 
     /**
-     * Emits event through those emitters that when passed to predicate result in
+     * 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
@@ -98,7 +98,7 @@ class Emitters
      */
     template<typename Predicate>
     void emitIf(const EventPtrType& event,
-            Predicate pred)
+                Predicate pred)
     {
         DPL::Mutex::ScopedLock lock(&m_mtx);
         for (Iterator it = m_emitters.begin(); it != m_emitters.end(); ++it) {
@@ -131,7 +131,8 @@ class Emitters
 
     /**
      * Lock this object.
-     * This lock will be automatically released when out of scope (unless someone
+     * 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
@@ -151,7 +152,6 @@ class Emitters
     DPL::Mutex m_mtx; ///< Synchronizes operation on this object.
     Map m_emitters; ///< Emitters container.
 };
-
 }
 } // WrtDeviceApisCommon
 
index 1340396..f059082 100644 (file)
@@ -22,7 +22,6 @@
 
 namespace WrtDeviceApis {
 namespace Commons {
-
 /**
  * Base class for listeners.
  * Object that is to act as listener should dervie from this class and implement
@@ -34,15 +33,15 @@ class EventListener : private EventReceiver<TemplateEvent>
   public:
     EventListener(ThreadEnum::Enumeration threadType) :
         EventReceiver<TemplateEvent>(threadType)
-    {
-    }
+    {}
 
     virtual void onAnswerReceived(const DPL::SharedPtr<TemplateEvent>& event) =
         0;
 
     void postAnswer(const DPL::SharedPtr<TemplateEvent>& event)
     {
-        DPL::Event::ControllerEventHandler<DPL::SharedPtr<TemplateEvent> >::PostEvent(
+        DPL::Event::ControllerEventHandler<DPL::SharedPtr<TemplateEvent> >::
+            PostEvent(
             event);
     }
 
@@ -52,7 +51,6 @@ class EventListener : private EventReceiver<TemplateEvent>
         onAnswerReceived(event);
     }
 };
-
 }
 } // WrtDeviceApisCommon
 
index 0768e05..e3873e2 100644 (file)
 
 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()
     {
         LogDebug("signaling in SignalEventCall");
@@ -49,13 +48,13 @@ class SignalEventCall : public DPL::Event::AbstractEventCall
     }
 };
 
-
 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)
@@ -92,24 +91,23 @@ class EventReceiver :
     }
 };
 
-
 template<class TemplateEvent>
 class EventRequestReceiver : private EventReceiver<TemplateEvent>
 {
   public:
     EventRequestReceiver(ThreadEnum::Enumeration threadType) : EventReceiver<
             TemplateEvent>(threadType)
-    {
-    }
+    {}
     virtual void OnRequestReceived(const DPL::SharedPtr<TemplateEvent> &event)
         = 0;
 
     /*
      *
-     * @argument delaySeconds - event will be received not sooner than after delay (in seconds)
+     * @argument delaySeconds - event will be received not sooner than after
+     * delay (in seconds)
      */
     void PostRequest(const DPL::SharedPtr<TemplateEvent> &event,
-            double delaySeconds = 0.0)
+                     double delaySeconds = 0.0)
     {
         LogDebug(__FUNCTION__);
         {
@@ -120,15 +118,18 @@ class EventRequestReceiver : private EventReceiver<TemplateEvent>
         LogDebug("state changed to STATE_REQUEST_SEND. Now posting");
 
         if (TemplateEvent::HANDLING_SYNCHRONOUS == event->getHandlingType() &&
-            !event->m_synchronousEventFlag) {
+            !event->m_synchronousEventFlag)
+        {
             event->m_synchronousEventFlag = new DPL::WaitableEvent();
         }
 
         if (0.0 == delaySeconds) {
-            DPL::Event::ControllerEventHandler<DPL::SharedPtr<TemplateEvent> >::
+            DPL::Event::ControllerEventHandler<DPL::SharedPtr<TemplateEvent> >
+                ::
                 PostEvent(event);
         } else {
-            DPL::Event::ControllerEventHandler<DPL::SharedPtr<TemplateEvent> >::
+            DPL::Event::ControllerEventHandler<DPL::SharedPtr<TemplateEvent> >
+                ::
                 PostTimedEvent(event, delaySeconds);
         }
         LogDebug("Event posted.");
@@ -165,7 +166,8 @@ class EventRequestReceiver : private EventReceiver<TemplateEvent>
         LogDebug("calling OnRequestReceived");
         OnRequestReceived(event);
         event->signalCancelStatusFlag();
-        //After Controller ends processing it should call it to signal that work is done
+        //After Controller ends processing it should call it to signal that work
+        // is done
         {
             DPL::Mutex::ScopedLock lock(&event->m_stateMutex);
 
@@ -182,7 +184,8 @@ class EventRequestReceiver : private EventReceiver<TemplateEvent>
             if (TemplateEvent::HANDLING_ASYNCHRONOUS_MANUAL_ANSWER !=
                 event->m_handlingType &&
                 TemplateEvent::HANDLING_SYNCHRONOUS_MANUAL_ANSWER !=
-                event->m_handlingType) {
+                event->m_handlingType)
+            {
                 event->m_state = TemplateEvent::STATE_ANSWER_SEND;
             }
         }
@@ -203,7 +206,8 @@ class EventRequestReceiver : private EventReceiver<TemplateEvent>
             //event->Signal();
             signalEventByDispatcher(event);
             break;
-        //when event is in manual answer mode we do nothing - the answer will be send explicit from the code
+        //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:
             LogDebug("Manual answer is set so do nothing.");
@@ -251,15 +255,13 @@ class EventRequestReceiver : private EventReceiver<TemplateEvent>
     }
 };
 
-
 template<class TemplateEvent>
 class EventAnswerReceiver : private EventReceiver<TemplateEvent>
 {
   public:
     EventAnswerReceiver(ThreadEnum::Enumeration threadType) : EventReceiver<
             TemplateEvent>(threadType)
-    {
-    }
+    {}
 
     virtual void OnAnswerReceived(const DPL::SharedPtr<TemplateEvent> &event) =
         0;
@@ -269,7 +271,8 @@ class EventAnswerReceiver : private EventReceiver<TemplateEvent>
     {
         LogDebug(__FUNCTION__);
         event->signalCancelStatusFlag();
-        DPL::Event::ControllerEventHandler<DPL::SharedPtr<TemplateEvent> >::PostEvent(
+        DPL::Event::ControllerEventHandler<DPL::SharedPtr<TemplateEvent> >::
+            PostEvent(
             event);
     }
 
@@ -281,10 +284,12 @@ class EventAnswerReceiver : private EventReceiver<TemplateEvent>
             LogDebug("checking the state");
             DPL::Mutex::ScopedLock lock(&event->m_stateMutex);
 
-            //in case someone changed it to synchronous call, we don't process it
+            //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) {
+                event->m_state)
+            {
                 LogDebug(
                     "Handling probably changed to synchronous meanwhile. Will not process it..");
                 return;
@@ -317,7 +322,6 @@ class EventAnswerReceiver : private EventReceiver<TemplateEvent>
         LogDebug("leaving");
     }
 };
-
 }
 } // WrtDeviceApisCommon
 
index aa1f3b6..0f1db99 100644 (file)
@@ -20,7 +20,6 @@
 
 namespace WrtDeviceApis {
 namespace Commons {
-
 #define PLUGINS_DECLARE_EXCEPTION_TYPE(BaseClass, Class) \
     class Class :       \
         public BaseClass \
@@ -32,23 +31,23 @@ namespace Commons {
               const char *function, \
               int line, \
               const std::string & message = std::string()) :                                                                                               \
-                      BaseClass(path, function, line, message) \
-              { \
-                  BaseClass::m_className = # Class; \
-                  m_code = ExceptionCodes::Class; \
-              } \
+            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(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
 {
@@ -128,7 +127,8 @@ PLUGINS_DECLARE_EXCEPTION_TYPE(Exception, EventWrongStateException)
 PLUGINS_DECLARE_EXCEPTION_TYPE(Exception, SecurityException)
 
 /**
- * Thrown when trying to perform action that is not supported by current platform.
+ * Thrown when trying to perform action that is not supported by current
+ * platform.
  */
 PLUGINS_DECLARE_EXCEPTION_TYPE(Exception, UnsupportedException)
 
@@ -149,7 +149,8 @@ PLUGINS_DECLARE_EXCEPTION_TYPE(Exception, PendingOperationException)
 PLUGINS_DECLARE_EXCEPTION_TYPE(Exception, AlreadyInUseException)
 
 /**
- * Thrown when unpredicted error occurs while a picture or video is being captured
+ * 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)
@@ -168,7 +169,6 @@ PLUGINS_DECLARE_EXCEPTION_TYPE(Exception, LocalStorageValueNoModifableException)
  * Thrown when object is not found.
  */
 PLUGINS_DECLARE_EXCEPTION_TYPE(Exception, NotFoundException)
-
 }
 } // WrtDeviceApisCommon
 
index 23d3322..ee0588e 100644 (file)
 #include <Commons/plugin_initializer_def.h>
 
 #define ACE_DECLARE_FUNCTION(function_definition) \
-    extern WrtDeviceApis::Commons::AceFunction ace_ ## function_definition
+    extern WrtDeviceApis::Commons::AceFunction ace_##function_definition
 
 #define ACE_DECLARE_PARAM(param_definition) \
-    extern WrtDeviceApis::Commons::AceDeviceCapParam ace_param_ ## \
+    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
+    {}
+    bool operator()(const WrtDeviceApis::Commons::AceDeviceCapability& dc)
+    const
     {
         return m_searchFor == dc.devCapName;
     }
@@ -72,17 +71,21 @@ class DevCapFinder
     } 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.
+ * 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(     \
+    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(     \
+    WrtDeviceApis::Commons::AceFunction get##Plugin_Module##FunctionData(     \
         const std::string & functionId)                                        \
     {                                                                          \
         WrtDeviceApis::Commons::FunctionMapping::const_iterator it =              \
@@ -96,11 +99,11 @@ class DevCapFinder
         return it->second;                                                     \
     }
 
-typedef WrtDeviceApis::Commons::AceFunction (&AceFunctionGetter)(const std::string&);
+typedef WrtDeviceApis::Commons::AceFunction (&AceFunctionGetter)(const std::
+                                                                     string&);
 
 namespace WrtDeviceApis {
 namespace Commons {
-
 enum class AceSecurityStatus
 {
     AccessGranted,
@@ -125,17 +128,16 @@ 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)
+    const FunctionGetter& f,
+    const char* functionName,
+    Args && ... args)
 {
     using namespace WrtDeviceApis::Commons;
 
@@ -152,7 +154,6 @@ AceSecurityStatus aceCheckAccess(
 
     return AceSecurityStatus::AccessGranted;
 }
-
 }
 } // WrtDeviceApisCommon
 
index 76c0c51..4209994 100644 (file)
@@ -17,7 +17,6 @@
 
 namespace WrtDeviceApis {
 namespace Commons {
-
 int aceAddDeviceCap(const AceDeviceCapability& cap,
                     AceDeviceCaps &instance)
 {
@@ -31,6 +30,5 @@ int aceAddApiFeature(const AceFeature& apiFeature,
     instance.push_back(apiFeature);
     return 0;
 }
-
 }
 } // WrtDeviceApisCommon
index ba9b264..fa8b32c 100644 (file)
 
 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
+    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
+    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 = \
+    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 };
+    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)
+    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)
+    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 }
+    { 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_ ## \
+    static WrtDeviceApis::Commons::AceDeviceCapParam ace_param_## \
     param_definition = \
     { std::string(param_name), position };
 
@@ -82,11 +82,10 @@ namespace Commons {
 
 typedef std::map <std::string, AceFunction> FunctionMapping;
 
-int aceAddDeviceCap(const AceDeviceCapability& cap,
-        AceDeviceCaps& instance);
-int aceAddApiFeature(const AceFeature& apiFeature,
-        AceFeatures& instance);
-
+int aceAddDeviceCap(const AceDeviceCapability &cap,
+                    AceDeviceCaps & instance);
+int aceAddApiFeature(const AceFeature &apiFeature,
+                     AceFeatures & instance);
 }
 } // WrtDeviceApisCommon
 
index 6ff743f..af3741a 100644 (file)
 
 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;
@@ -53,11 +51,10 @@ class IEventController
     }
     virtual bool changeCallToSynchronous() = 0;
     virtual ~IEventController()
-    {
-    }
+    {}
 
     void setPrivateData(
-            const DPL::SharedPtr<IEventPrivateData> &privateData)
+        const DPL::SharedPtr<IEventPrivateData> &privateData)
     {
         m_privateData = privateData;
     }
@@ -68,7 +65,6 @@ class IEventController
 };
 typedef DPL::SharedPtr<IEventController> IEventControllerPtr;
 
-
 // CRTP pattern
 template<class Super>
 class IEvent : /*private DPL::WaitableEvent, */ public IEventController
@@ -108,6 +104,7 @@ class IEvent : /*private DPL::WaitableEvent, */ public IEventController
         //if someone is waiting
         signalSynchronousEventFlag();
     }
+
   protected:
     DPL::Mutex m_stateMutex;
     State m_state;
@@ -130,8 +127,7 @@ class IEvent : /*private DPL::WaitableEvent, */ public IEventController
         m_cancelStatusFlag(NULL),
         m_cancelled(false),
         m_cancelAllowed(false)
-    {
-    }
+    {}
 
     virtual void waitForAnswer()
     {
@@ -213,8 +209,7 @@ class IEvent : /*private DPL::WaitableEvent, */ public IEventController
     }
 
     virtual void clearOnCancel()
-    {
-    }
+    {}
 
     Commons::ExceptionCodes::Enumeration getExceptionCode() const
     {
@@ -251,7 +246,7 @@ class IEvent : /*private DPL::WaitableEvent, */ public IEventController
     }
 
     virtual bool setForAsynchronousCall(
-            EventAnswerReceiver< Super > *remoteController)
+        EventAnswerReceiver< Super > *remoteController)
     {
         DPL::Mutex::ScopedLock lock(&m_stateMutex);
         if (m_cancelled) {
@@ -271,8 +266,10 @@ class IEvent : /*private DPL::WaitableEvent, */ public IEventController
     }
 
     /*
-     * 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.
+     * 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()
@@ -367,7 +364,6 @@ class IEvent : /*private DPL::WaitableEvent, */ public IEventController
         return m_cancelAllowed;
     }
 };
-
 }
 } // WrtDeviceApisCommon
 
index 913dad4..5a7a7e0 100644 (file)
@@ -26,7 +26,6 @@
 
 namespace WrtDeviceApis {
 namespace Commons {
-
 /**
  * This class is related to JSPendingOperation object.
  *
@@ -41,10 +40,8 @@ class IExternEventCanceler
     virtual void OnCancelEvent(const DPL::SharedPtr<TemplateEvent>& event) = 0;
 
     virtual ~IExternEventCanceler()
-    {
-    }
+    {}
 };
-
 }
 } // WrtDeviceApisCommon
 
index a5ef354..d52f5a8 100644 (file)
@@ -41,8 +41,7 @@ class JSObject : private DPL::Noncopyable
     virtual RealObject getObject() const;
 
     virtual ~JSObject()
-    {
-    }
+    {}
 
   private:
     RealObject m_object;
index 46a3da3..2ca8c9e 100644 (file)
@@ -31,24 +31,23 @@ JSObjectDeclaration::JSObjectDeclaration(js_entity_definition_ptr_t classD) :
     m_classTemplate(NULL),
     m_constructorCallback(classD->js_class_constructor_cb)
 {
-    if (NULL != classD->js_class_template_getter_fun)
-    {
+    if (NULL != classD->js_class_template_getter_fun) {
         m_classTemplate = classD->js_class_template_getter_fun();
     }
-    if(classD->class_options){
+    if (classD->class_options) {
         LogDebug("class options is not a null");
         m_options = OptionsPtr(new Options(classD->class_options));
     }
 }
 
 JSObjectDeclaration::~JSObjectDeclaration()
-{
-}
+{}
 
-bool JSObjectDeclaration::checkIframesSupported() const{
+bool JSObjectDeclaration::checkIframesSupported() const
+{
     LogDebug("Check iframe supported");
-    if(!m_options ||
-       m_options->getIframeObject() == Options::IFrameObject::None)
+    if (!m_options ||
+        m_options->getIframeObject() == Options::IFrameObject::None)
     {
         LogDebug("Iframe NOT supported for object: " << getName());
         return false;
@@ -60,12 +59,12 @@ bool JSObjectDeclaration::checkIframesSupported() const{
 }
 
 JSObjectDeclaration::Options::ClassType
-    JSObjectDeclaration::Options::getType() const
+JSObjectDeclaration::Options::getType() const
 {
     LogDebug("Get type field from declaration's option");
     Assert(m_options && "Pointer to options is NULL");
 
-    switch(m_options->type){
+    switch (m_options->type) {
     case JS_CLASS: return ClassType::Class;
     case JS_FUNCTION: return ClassType::Function;
     case JS_INTERFACE: return ClassType::Interface;
@@ -74,12 +73,12 @@ JSObjectDeclaration::Options::ClassType
 }
 
 JSObjectDeclaration::Options::IFrameObject
-    JSObjectDeclaration::Options::getIframeObject() const
+JSObjectDeclaration::Options::getIframeObject() const
 {
     LogDebug("Get Frame Option");
     Assert(m_options && "Options object is NULL");
 
-    switch(m_options->iframe_option){
+    switch (m_options->iframe_option) {
     case NONE: return IFrameObject::None;
     case REFERENCE: return IFrameObject::Reference;
     case CREATE_INSTANCE: return IFrameObject::CreateInstance;
@@ -89,12 +88,12 @@ JSObjectDeclaration::Options::IFrameObject
 }
 
 JSObjectDeclaration::Options::IFrameNotice
-    JSObjectDeclaration::Options::getIframeNotice() const
+JSObjectDeclaration::Options::getIframeNotice() const
 {
     LogDebug("Get Frame Option");
     Assert(m_options && "Pointer to options is null");
 
-    switch(m_options->iframe_notice){
+    switch (m_options->iframe_notice) {
     case NONE_NOTICE: return IFrameNotice::None;
     case ALWAYS_NOTICE: return IFrameNotice::AlwaysNotice;
     default:
@@ -103,16 +102,16 @@ JSObjectDeclaration::Options::IFrameNotice
 }
 
 JSObjectDeclaration::Options::IFrameOverlay
-    JSObjectDeclaration::Options::getIframeOverlay() const
+JSObjectDeclaration::Options::getIframeOverlay() const
 {
     LogDebug("Get Frame Option");
     Assert(m_options && "Pointer to options is null");
 
-    switch(m_options->iframe_overlay){
+    switch (m_options->iframe_overlay) {
     case IGNORED: return IFrameOverlay::Ignored;
     case USE_OVERLAYED: return IFrameOverlay::UseOverlayed;
     case OVERLAYED_BEFORE_ORIGINAL:
-            return IFrameOverlay::OverlayedBeforeOriginal;
+        return IFrameOverlay::OverlayedBeforeOriginal;
     default:
         Assert(0 && "Wrong value of overlay option");
     }
@@ -134,7 +133,7 @@ void JSObjectDeclaration::Options::invokeCallback(JsContext ctx,
 }
 
 JSObjectDeclaration::Options::PrivateData
-    JSObjectDeclaration::Options::getPrivateData() const
+JSObjectDeclaration::Options::getPrivateData() const
 {
     Assert(m_options && m_options->private_data && "empty private data");
     return m_options->private_data;
index fa14dce..699936e 100644 (file)
@@ -39,62 +39,65 @@ class JSObjectDeclaration : private DPL::Noncopyable
     typedef js_class_constructor_cb_t ConstructorCallback;
     typedef class_definition_options_t ClassOptions;
 
-
-    class Options : DPL::Noncopyable {
+    class Options : DPL::Noncopyable
+    {
       public:
-        enum class ClassType{
+        enum class ClassType
+        {
             Class,
             Function,
             Interface
         };
 
-        enum class IFrameObject{
+        enum class IFrameObject
+        {
             None,
             Reference,
             CreateInstance
         };
 
-        enum class IFrameNotice{
+        enum class IFrameNotice
+        {
             None,
             AlwaysNotice
         };
 
         //only for function
-        enum class IFrameOverlay{
-           Ignored,
-           UseOverlayed,
-           OverlayedBeforeOriginal
+        enum class IFrameOverlay
+        {
+            Ignored,
+            UseOverlayed,
+            OverlayedBeforeOriginal
         };
 
         typedef js_object_instance_t ObjectInstance;
         typedef java_script_context_t JsContext;
         typedef void* PrivateData;
 
-        public:
-          ClassType getType() const;
+      public:
+        ClassType getType() const;
 
-          IFrameObject getIframeObject() const;
-          IFrameNotice getIframeNotice() const;
-          IFrameOverlay getIframeOverlay() const;
-          js_function_impl getFunctionImpl() const;
+        IFrameObject getIframeObject() const;
+        IFrameNotice getIframeNotice() const;
+        IFrameOverlay getIframeOverlay() const;
+        js_function_impl getFunctionImpl() const;
 
-          void invokeCallback(JsContext ctx,
-                              ObjectInstance iframe,
-                              ObjectInstance object) const;
+        void invokeCallback(JsContext ctx,
+                            ObjectInstance iframe,
+                            ObjectInstance object) const;
 
-          PrivateData getPrivateData() const;
+        PrivateData getPrivateData() const;
 
-        private:
-          const ClassOptions* m_options;
+      private:
+        const ClassOptions* m_options;
 
-        private:
-          explicit Options(const ClassOptions* options) : m_options(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;
@@ -128,8 +131,8 @@ class JSObjectDeclaration : private DPL::Noncopyable
         return m_constructorCallback;
     }
 
-
-    const OptionsPtr getOptions() const{
+    const OptionsPtr getOptions() const
+    {
         return m_options;
     }
 
index 33338bc..7956ab7 100644 (file)
@@ -28,7 +28,6 @@
 
 namespace WrtDeviceApis {
 namespace Commons {
-
 template<class EventClass>
 class ListenerEventEmitter;
 
@@ -90,15 +89,13 @@ class ListenerEvent
     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)
     {
@@ -112,7 +109,8 @@ class ListenerEvent
 
     /**
      * Sets event's private data.
-     * Event's private data object has to implement @see IEventPrivateData interface.
+     * Event's private data object has to implement @see IEventPrivateData
+     * interface.
      * @param data Private data.
      * @throw EventWrongStateExeption When event has already been emitted.
      */
@@ -127,7 +125,6 @@ class ListenerEvent
     Commons::ExceptionCodes::Enumeration m_code; ///< Exception code.
     PrivateDataTypePtr m_privateData; ///< Private data.
 };
-
 }
 } // WrtDeviceApisCommon
 
index 7b52ec9..77bada2 100644 (file)
@@ -29,7 +29,6 @@
 
 namespace WrtDeviceApis {
 namespace Commons {
-
 template<class EmitterClass>
 class Emitters;
 
@@ -64,19 +63,19 @@ class ListenerEventEmitter : private DPL::Noncopyable
 
   public:
     ListenerEventEmitter() : m_listener(NULL)
-    {
-    }
+    {}
 
   public:
     virtual ~ListenerEventEmitter()
-    {
-    }
+    {}
 
     /**
      * Sets event's private data.
-     * Event's private data object has to implement @see IEventPrivateData interface.
+     * 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
+     * @remarks Practically private dat should be only set at object creation
+     * and
      *          not chaged during this object lifetime.
      */
     virtual void setEventPrivateData(const EventPrivateDataTypePtr& data)
@@ -142,7 +141,6 @@ class ListenerEventEmitter : private DPL::Noncopyable
 template<class EventClass>
 const typename ListenerEventEmitter<EventClass>::IdType ListenerEventEmitter<
     EventClass>::emptyId = 0;
-
 }
 } // WrtDeviceApisCommon
 
index 1f905a2..ab731e1 100644 (file)
@@ -22,7 +22,6 @@
 
 namespace WrtDeviceApis {
 namespace Commons {
-
 /**
  * Stores data describing a range of values.
  */
@@ -44,7 +43,6 @@ struct Range
      */
     ValueType max;
 };
-
 }
 } // WrtDeviceApisCommon
 
index 1374a14..9284d3f 100644 (file)
 
 namespace WrtDeviceApis {
 namespace Commons {
-
 bool validate(const std::string &pattern,
-        const std::string &value,
-        unsigned int options)
+              const std::string &value,
+              unsigned int options)
 {
     pcrecpp::RE_Options pcreOpt;
     if (options & VALIDATE_MATCH_CASELESS) {
@@ -35,7 +34,7 @@ bool validate(const std::string &pattern,
 }
 
 std::string filter(const std::string &pattern,
-        const std::string &value)
+                   const std::string &value)
 {
     pcrecpp::RE re(pattern);
     std::string ret = static_cast<std::string>(value);
@@ -50,6 +49,5 @@ std::string toUpper(const std::string &value)
     re.GlobalReplace(UPPER_P, &ret);
     return ret;
 }
-
 }
 } // WrtDeviceApisCommon
index 99d6b0e..f6c046b 100644 (file)
 
 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 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";
 
@@ -34,17 +37,18 @@ const std::string UPPER_P = "P";
  * @return True when value is matched against pattern
  */
 bool validate(const std::string &pattern,
-        const std::string &value,
-        unsigned int options = 0);
+              const std::string &value,
+              unsigned int options = 0);
 
 /**
- * Filter value against pattern(Any character except "0-9+#*Pp" will be removed from value)
+ * 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);
+                   const std::string &value);
 
 /**
  * Replace character "p" in value by "P"
@@ -52,7 +56,6 @@ std::string filter(const std::string &pattern,
  * @return replaced value
  */
 std::string toUpper(const std::string &value);
-
 }
 } // WrtDeviceApisCommon
 
index ffd2f85..3c9ceb6 100644 (file)
 
 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
 
index 1d0494a..db749e7 100644 (file)
@@ -19,7 +19,6 @@
 
 namespace WrtDeviceApis {
 namespace Commons {
-
 std::string addStartPositionMark(const std::string &value)
 {
     if (!String::startsWith(value, "^") && !String::startsWith(value, ".*")) {
@@ -31,7 +30,8 @@ std::string addStartPositionMark(const std::string &value)
 std::string addEndPositionMark(const std::string &value)
 {
     if ((!String::endsWith(value, "$") || String::endsWith(value, "\\$")) &&
-        !String::endsWith(value, ".*")) {
+        !String::endsWith(value, ".*"))
+    {
         return value + "$";
     }
     return value;
@@ -65,10 +65,10 @@ std::string escape(const std::string& str)
     // Escape standard regular expressions' metacharacters,
     // i.e.: \, ., -, +, ?, (, ), [, ], ^, $, |
     const char* metas = "(\\.|\\-|\\+|\\?|\\(|\\)|\\[|\\]|\\^|\\$|\\|"
-        "|(\\\\[^\\*\\%]|\\\\$))";                        // \*, \% won't get additional '\'
+                        "|(\\\\[^\\*\\%]|\\\\$))";        // \*, \% won't get
+                                                          // additional '\'
     pcrecpp::RE(metas).GlobalReplace("\\\\\\1", &result);
     return result;
 }
-
 }
 } // WrtDeviceApisCommon
index e4bc94f..a06e1cd 100644 (file)
@@ -20,7 +20,6 @@
 
 namespace WrtDeviceApis {
 namespace Commons {
-
 /**
  * Adds ^ character at the beginning in proper way
  * @param value Regexp pattern
@@ -66,7 +65,6 @@ std::string prepareAsterisk(const std::string& str);
  * @return String with regex special characters escaped.
  */
 std::string escape(const std::string& str);
-
 }
 } // WrtDeviceApisCommon
 
index 2ccafb3..bbd19f2 100644 (file)
@@ -25,7 +25,6 @@
 
 namespace WrtDeviceApis {
 namespace Commons {
-
 template<bool>
 struct CompileTimeChecker
 {
@@ -37,8 +36,8 @@ struct CompileTimeChecker<false> {};
 
 #define STATIC_CHECK(expr, msg) \
     { \
-        class ERROR_ ## msg {}; \
-        CompileTimeChecker<(expr)!= 0>((ERROR_ ## msg())); \
+        class ERROR_##msg {}; \
+        CompileTimeChecker<(expr) != 0>((ERROR_##msg())); \
     }
 
 /**
@@ -52,9 +51,8 @@ struct CompileTimeChecker<false> {};
  * */
 #define STATIC_ERROR(msg, C) \
     { \
-        C->_ ## msg(); \
+        C->_##msg(); \
     }
-
 }
 } // WrtDeviceApisCommon
 
index 8ebe80c..7fb1cb9 100644 (file)
 
 namespace WrtDeviceApis {
 namespace Commons {
-
 class StringBuilderImpl
 {
   public:
     StringBuilderImpl() : m_counter(1)
-    {
-    }
+    {}
 
     void append(const std::string& str)
     {
@@ -83,8 +81,7 @@ class StringBuilderImpl
 };
 
 StringBuilder::StringBuilder() : m_impl(new StringBuilderImpl())
-{
-}
+{}
 
 StringBuilder::~StringBuilder()
 {
@@ -99,7 +96,9 @@ StringBuilder::StringBuilder(const StringBuilder& other)
 
 StringBuilder & StringBuilder::operator=(const StringBuilder& other)
 {
-    if (this == &other) { return *this; }
+    if (this == &other) {
+        return *this;
+    }
 
     other.m_impl->addRef();
 
@@ -127,6 +126,5 @@ std::string StringBuilder::toString() const
 {
     return m_impl->toString();
 }
-
 }
 } // WrtDeviceApisCommon
index 7e151f0..fa12c37 100644 (file)
@@ -24,7 +24,6 @@
 
 namespace WrtDeviceApis {
 namespace Commons {
-
 class StringBuilderImpl;
 
 class StringBuilder
@@ -43,7 +42,6 @@ class StringBuilder
   private:
     StringBuilderImpl* m_impl;
 };
-
 }
 } // WrtDeviceApisCommon
 
index 1fe0b7a..0b432b6 100644 (file)
@@ -22,7 +22,6 @@
 namespace WrtDeviceApis {
 namespace Commons {
 namespace String {
-
 std::string lTrim(const std::string& str)
 {
     std::string result = str;
@@ -47,13 +46,13 @@ std::string trim(const std::string& str)
 }
 
 bool startsWith(const std::string& str,
-        const std::string& startStr)
+                const std::string& startStr)
 {
     return str.find(startStr) == 0;
 }
 
 bool endsWith(const std::string& str,
-        const std::string& endStr)
+              const std::string& endStr)
 {
     std::size_t pos = str.rfind(endStr);
     if (pos == std::string::npos) {
@@ -63,7 +62,7 @@ bool endsWith(const std::string& str,
 }
 
 std::string unique(const std::string& str,
-        const char needle)
+                   const char needle)
 {
     std::string result = str;
 
@@ -83,7 +82,7 @@ std::string unique(const std::string& str,
 }
 
 bool inCStringArray(const std::string& needle,
-        const char* stack[])
+                    const char* stack[])
 {
     while (*stack) {
         if (needle == *stack) {
@@ -119,7 +118,7 @@ std::string merge(const std::vector<std::string>& strs,
 }
 
 std::vector<std::string> split(const std::string& str,
-        std::string::value_type delim)
+                               std::string::value_type delim)
 {
     std::vector<std::string> result;
     std::string::size_type begin = 0, end = 0;
@@ -130,7 +129,9 @@ std::vector<std::string> split(const std::string& str,
         if (!part.empty()) {
             result.push_back(part);
         }
-        if (std::string::npos == end) { break; }
+        if (std::string::npos == end) {
+            break;
+        }
         begin = end + 1;
     }
     return result;
@@ -140,7 +141,6 @@ int toInt(const std::string& str)
 {
     return convertTo<int>(str);
 }
-
 }
 }
 }
index ee7cbe8..b36071f 100644 (file)
@@ -31,7 +31,6 @@
 namespace WrtDeviceApis {
 namespace Commons {
 namespace String {
-
 /**
  * Removes spaces from begining of the string.
  * @param str String to remove spaces from.
@@ -155,13 +154,11 @@ template<typename T>
 std::string parse(const T& data)
 {
     std::ostringstream oss;
-    if (!(oss << data))
-    {
+    if (!(oss << data)) {
         Throw(ConversionException);
     }
     return oss.str();
 }
-
 }
 }
 }
old mode 100755 (executable)
new mode 100644 (file)
index 5ec65eb..fd5cd3a
@@ -30,7 +30,6 @@
 
 namespace WrtDeviceApis {
 namespace Commons {
-
 ThreadPool &ThreadPool::getInstance()
 {
     static ThreadPool theInstance;
@@ -38,7 +37,7 @@ ThreadPool &ThreadPool::getInstance()
 }
 
 DPL::Event::AbstractEventDispatcher *ThreadPool::getDispatcher(
-        DPL::Event::ThreadEventDispatcher &callingThreadDispatcher)
+    DPL::Event::ThreadEventDispatcher &callingThreadDispatcher)
 {
     DPL::Thread *currentThread = DPL::Thread::GetCurrentThread();
     //if we are in main thread
@@ -50,8 +49,7 @@ DPL::Event::AbstractEventDispatcher *ThreadPool::getDispatcher(
 }
 
 ThreadPool::ThreadPool()
-{
-}
+{}
 
 ThreadPool::~ThreadPool()
 {
@@ -63,7 +61,7 @@ ThreadPool::~ThreadPool()
 }
 
 DPL::Thread* ThreadPool::getThreadHandleCreateIfNotExists(
-        ThreadEnum::Enumeration type)
+    ThreadEnum::Enumeration type)
 {
     DPL::Mutex::ScopedLock lock(&m_threadHandlersMutex);
     ThreadHandleMap::iterator element = m_threadHandlers.find(type);
@@ -73,7 +71,7 @@ DPL::Thread* ThreadPool::getThreadHandleCreateIfNotExists(
         DPL::Thread* newThread = new DPL::Thread();
         m_threadHandlers.insert(
             m_threadHandlers.begin(),
-            std::pair<ThreadEnum::Enumeration,DPL::Thread*>(type, newThread));
+            std::pair<ThreadEnum::Enumeration, DPL::Thread*>(type, newThread));
         newThread->Run();
         return newThread;
     }
@@ -88,7 +86,8 @@ DPL::Thread *ThreadPool::getThreadRef(ThreadEnum::Enumeration type)
     }
     /* we could stay with
      * getThreadHandleCreateIfNotExists(type);
-     * but by switch we can attach actually one thread to more than one ThreadEnums
+     * but by switch we can attach actually one thread to more than one
+     * ThreadEnums
      */
     switch (type) {
     case ThreadEnum::NULL_THREAD:
@@ -155,13 +154,15 @@ DPL::Thread *ThreadPool::getThreadRef(ThreadEnum::Enumeration type)
         thandle = getThreadHandleCreateIfNotExists(ThreadEnum::POWER_THREAD);
         break;
     case ThreadEnum::PLUGIN_TEMPLETE_THREAD:
-        thandle = getThreadHandleCreateIfNotExists(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);
+        thandle = getThreadHandleCreateIfNotExists(
+                ThreadEnum::APPLICATION_THREAD);
         break;
     case ThreadEnum::GYROSCOPE_THREAD:
         thandle = getThreadHandleCreateIfNotExists(ThreadEnum::GYROSCOPE_THREAD);
@@ -170,19 +171,23 @@ DPL::Thread *ThreadPool::getThreadRef(ThreadEnum::Enumeration type)
         thandle = getThreadHandleCreateIfNotExists(ThreadEnum::CLOCK_THREAD);
         break;
     case ThreadEnum::SYSTEMINFO_THREAD:
-        thandle = getThreadHandleCreateIfNotExists(ThreadEnum::SYSTEMINFO_THREAD);
+        thandle = getThreadHandleCreateIfNotExists(
+                ThreadEnum::SYSTEMINFO_THREAD);
         break;
     case ThreadEnum::CALLHISTORY_THREAD:
-        thandle = getThreadHandleCreateIfNotExists(ThreadEnum::CALLHISTORY_THREAD);
+        thandle = getThreadHandleCreateIfNotExists(
+                ThreadEnum::CALLHISTORY_THREAD);
         break;
     case ThreadEnum::ACCOUNT_THREAD:
-        thandle = getThreadHandleCreateIfNotExists(ThreadEnum::CALLHISTORY_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);
+        thandle = getThreadHandleCreateIfNotExists(
+                ThreadEnum::MEDIACONTENT_THREAD);
         break;
     case ThreadEnum::SE_THREAD:
         thandle = getThreadHandleCreateIfNotExists(ThreadEnum::SE_THREAD);
@@ -203,6 +208,5 @@ DPL::Thread *ThreadPool::getThreadRef(ThreadEnum::Enumeration type)
     }
     return thandle;
 }
-
 }
 } // WrtDeviceApisCommon
old mode 100755 (executable)
new mode 100644 (file)
index 7ee9ed6..ada3233
 
 namespace WrtDeviceApis {
 namespace Commons {
-
 class ThreadEnum
 {
   private:
     ThreadEnum()
-    {
-    }
+    {}
+
   public:
     enum Enumeration
     {
@@ -80,7 +79,6 @@ class ThreadEnum
     };
 };
 
-
 class ThreadPool : private DPL::Noncopyable
 {
   private:
@@ -93,6 +91,7 @@ class ThreadPool : private DPL::Noncopyable
     //DPL::MainEventDispatcher m_mainEventDispatcher;
 
     ThreadPool();
+
   public:
     ~ThreadPool();
 
@@ -105,11 +104,10 @@ class ThreadPool : private DPL::Noncopyable
      * Get proper dispatcher for current calling thread
      */
     DPL::Event::AbstractEventDispatcher *getDispatcher(
-            DPL::Event::ThreadEventDispatcher &callingThreadDispatcher);
+        DPL::Event::ThreadEventDispatcher &callingThreadDispatcher);
 
     static ThreadPool& getInstance();
 };
-
 }
 } // WrtDeviceApisCommon
 
index 0467c03..ce5cce8 100644 (file)
 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 )
-    {
+    if (!result || !timep) {
         return NULL;
     }
 
     cal = ucal_open(NULL, 0, NULL, UCAL_DEFAULT, &status);
 
-    if(U_FAILURE(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_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);
+    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))
-    {
+    if (U_FAILURE(status)) {
         return NULL;
-    }
-    else
-    {
+    } else {
         return result;
     }
 }
-
 }
 }
 }
index 27e4038..de55e4c 100644 (file)
@@ -26,9 +26,7 @@
 namespace WrtDeviceApis {
 namespace Commons {
 namespace Time {
-
 struct tm* localtime_r(long long int* timep, struct tm* result);
-
 }
 }
 }
index 3e7e78f..bcc98f7 100644 (file)
@@ -20,7 +20,6 @@
 
 namespace WrtDeviceApis {
 namespace Commons {
-
 template<typename T>
 struct IsNull
 {
@@ -53,7 +52,6 @@ struct AlwaysFalse
 {
     static const bool value = false;
 };
-
 }
 } // WrtDeviceApisCommon
 
index e903fe9..0f2dca2 100644 (file)
@@ -21,7 +21,6 @@
 
 namespace WrtDeviceApis {
 namespace Commons {
-
 struct AceFeature
 {
     AceFeature(const std::string& featName) : name(featName) {}
@@ -33,10 +32,9 @@ typedef std::vector <AceFeature> AceFeatures;
 struct AceDeviceCapParam
 {
     AceDeviceCapParam(const std::string& parName,
-            const std::string& parVal) : name(parName),
+                      const std::string& parVal) : name(parName),
         value(parVal)
-    {
-    }
+    {}
 
     std::string name;
     std::string value;
@@ -48,11 +46,10 @@ struct AceDeviceCapability
 {
     AceDeviceCapability() {}
     AceDeviceCapability(const std::string& name,
-            const AceDeviceCapParams& params) :
+                        const AceDeviceCapParams& params) :
         devCapName(name),
         devCapParams(params)
-    {
-    }
+    {}
 
     std::string devCapName;
     AceDeviceCapParams devCapParams;
index b1f5850..b81c368 100644 (file)
@@ -38,7 +38,6 @@
 IMPLEMENT_SAFE_SINGLETON(WrtDeviceApis::Commons::WrtAccess)
 
 namespace {
-
 /**
  * Helper class - single parameter and its value
  */
@@ -47,11 +46,11 @@ struct AceParam
     const char *name;
     const char *value;
 
-    AceParam():
+    AceParam() :
         name(NULL), value(NULL)
     {}
 
-    AceParam(const char *name, const char *value):
+    AceParam(const char *name, const char *value) :
         name(name), value(value)
     {}
 };
@@ -61,9 +60,9 @@ struct AceParam
  */
 struct AceParamList
 {
-    size_t    count;
+    size_t count;
     AceParam* param;
-    AceParamList():
+    AceParamList() :
         count(0),
         param(NULL)
     {}
@@ -92,10 +91,9 @@ class ScopedDeviceCapArray : public DPL::ScopedResource<DeviceCapParamPolicy>
 {
   public:
     explicit ScopedDeviceCapArray(AceParamList *ptr =
-                DeviceCapParamPolicy::NullValue()) :
+                                      DeviceCapParamPolicy::NullValue()) :
         DPL::ScopedResource<DeviceCapParamPolicy>(ptr)
-    {
-    }
+    {}
 
     AceParamList & operator [](std::ptrdiff_t k) const
     {
@@ -110,35 +108,31 @@ class ScopedDeviceCapArray : public DPL::ScopedResource<DeviceCapParamPolicy>
 
 namespace WrtDeviceApis {
 namespace Commons {
-
 WrtAccess::WrtAccess() :
-        m_initialized(false),
-        m_sessionId(GenerateSessionId())
-{
-}
+    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());
+    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)
-    {
+    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));
+        session_id += (c < 10 ?
+                       static_cast<char>('0' + c) :
+                       static_cast<char>('A' + c - 10));
     }
     return session_id;
 }
@@ -146,23 +140,26 @@ WrtAccess::SessionId WrtAccess::GenerateSessionId()
 void WrtAccess::initialize(int widgetId)
 {
     LogDebug("initialize");
-    if (widgetId < 0)
-    {
+    if (widgetId < 0) {
         LogDebug("Invalid widget id");
         Throw(Exception);
     }
-    ace_return_t ret = ace_client_initialize(Wrt::Popup::run_popup);
-    Assert(ACE_OK == ret);
-    m_initialized = true;
-    m_widgetId = widgetId;
+
+    if (!m_pluginOwners++) {
+        ace_return_t ret = ace_client_initialize(Wrt::Popup::run_popup);
+        Assert(ACE_OK == ret);
+        m_widgetId = widgetId;
+    }
 }
 
 void WrtAccess::deinitialize(int /*widgetId*/)
 {
     LogDebug("deinitialize");
-    m_initialized = false;
-    ace_return_t ret = ace_client_shutdown();
-    Assert(ACE_OK == ret);
+
+    if (!--m_pluginOwners) {
+        ace_return_t ret = ace_client_shutdown();
+        Assert(ACE_OK == ret);
+    }
 }
 
 int WrtAccess::getWidgetId() const
@@ -172,8 +169,9 @@ int WrtAccess::getWidgetId() const
 
 bool WrtAccess::checkAccessControl(const AceFunction& aceFunction) const
 {
-    Assert(m_initialized && "WrtAccessSingleton needs to be initialized with"
-            "WidgetId during on_widget_start_callback in each plugin");
+    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;
@@ -218,10 +216,12 @@ bool WrtAccess::checkAccessControl(const AceFunction& aceFunction) const
     LogDebug("constructing ACE request");
 
     ace_request_t aceRequest;
-    aceRequest.session_id = const_cast<const ace_session_id_t>(m_sessionId.c_str());
+    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.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];
 
@@ -231,16 +231,16 @@ bool WrtAccess::checkAccessControl(const AceFunction& aceFunction) const
     unsigned int i;
     for (i = 0; i < deviceCount; ++i) {
         aceRequest.dev_cap_list.items[i].name =
-                const_cast<const ace_string_t>(devCapNames[i]);
+            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];
+            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);
+                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);
+                const_cast<ace_string_t>(paramList[i].param[j].value);
         }
     }
 
@@ -248,9 +248,9 @@ bool WrtAccess::checkAccessControl(const AceFunction& aceFunction) const
     ace_return_t ret = ace_check_access(&aceRequest, &aceCheckResult);
 
     for (i = 0; i < deviceCount; ++i) {
-        delete [] aceRequest.dev_cap_list.items[i].param_list.items;
+        delete[] aceRequest.dev_cap_list.items[i].param_list.items;
     }
-    delete [] aceRequest.dev_cap_list.items;
+    delete[] aceRequest.dev_cap_list.items;
 
     if (ACE_OK != ret) {
         LogError("Error in ace check: " << static_cast<int>(ret));
@@ -258,6 +258,5 @@ bool WrtAccess::checkAccessControl(const AceFunction& aceFunction) const
     }
     return ACE_TRUE == aceCheckResult;
 }
-
 }
 } // WrtDeviceApisCommon
index 574324f..7467215 100644 (file)
 
 namespace WrtDeviceApis {
 namespace Commons {
-
 class WrtAccess
 {
-public:
+  public:
     void initialize(int widgetId);
     void deinitialize(int widgetId);
     int getWidgetId() const;
     bool checkAccessControl(const AceFunction &aceFunction) const;
 
-private:
+  private:
 
     typedef std::string SessionId;
     SessionId GenerateSessionId();
@@ -46,15 +45,15 @@ private:
     WrtAccess();
     virtual ~WrtAccess();
 
-    bool m_initialized;
     int m_widgetId;
     SessionId m_sessionId;
+    size_t m_pluginOwners;
+
 
     friend class DPL::Singleton<WrtAccess>;
 };
 
 typedef DPL::Singleton<WrtAccess> WrtAccessSingleton;
-
 }
 } // WrtDeviceApisCommon
 
old mode 100755 (executable)
new mode 100644 (file)
index f2429f9..73a6185
 /*
  * @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
+ * @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_
@@ -56,21 +58,22 @@ typedef java_script_context_t JavaScriptContext;
  * */
 #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)
+ * 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)
+ *        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;
+#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
@@ -85,10 +88,13 @@ typedef java_script_context_t JavaScriptContext;
  *        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;
+    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)
+ *  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)
  *        {
@@ -96,10 +102,13 @@ const on_widget_init_proc PLUGIN_WIDGET_INIT_PROC EXPORT_SYMBOL = CALLBACK_NAME;
  *        }
  *        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;
+#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)
+ *  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)
  *        {
@@ -107,10 +116,13 @@ const on_widget_init_proc PLUGIN_WIDGET_INIT_PROC EXPORT_SYMBOL = CALLBACK_NAME;
  *        }
  *        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;
+#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)
+ *  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)
  *        {
@@ -118,42 +130,52 @@ const on_widget_init_proc PLUGIN_WIDGET_INIT_PROC EXPORT_SYMBOL = CALLBACK_NAME;
  *        }
  *        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;
+#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).
+ * 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_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_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(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_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_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_END { NULL, NULL, NULL, NULL, NULL, NULL } };
 
-#define PLUGIN_CLASS_MAP_BEGIN_STATIC static const js_entity_definition_t\
-                PLUGIN_CLASS_MAP[] = {
+#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;
+#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_
index f550032..c6629ad 100644 (file)
@@ -25,14 +25,11 @@ using namespace WrtDeviceApis::Commons;
 
 namespace WrtDeviceApis {
 namespace CommonsJavaScript {
-
 Converter::Converter(JSContextRef context) : m_context(context)
-{
-}
+{}
 
 Converter::~Converter()
-{
-}
+{}
 
 JSObjectRef Converter::toJSObjectRef(const JSValueRef& arg)
 {
@@ -136,7 +133,8 @@ std::string Converter::tryString(const JSValueRef& arg)
 {
     if (!JSValueIsString(m_context, arg) &&
         !JSValueIsNumber(m_context, arg) &&
-        !JSValueIsBoolean(m_context, arg)) {
+        !JSValueIsBoolean(m_context, arg))
+    {
         ThrowMsg(ConversionException,
                  "Argument is not convertable to JS String.");
     }
@@ -222,7 +220,8 @@ std::vector<std::string> Converter::toVectorOfStrings(const JSValueRef& arg)
     return toVectorOfT_(arg, &Converter::toString);
 }
 
-std::vector<time_t> Converter::toVectorOfTimeT(const JSValueRef& arg) {
+std::vector<time_t> Converter::toVectorOfTimeT(const JSValueRef& arg)
+{
     return toVectorOfT_(arg, &Converter::toDateTimeT);
 }
 
@@ -246,7 +245,8 @@ JSValueRef Converter::toJSValueRef(unsigned long arg)
     return JSValueMakeNumber(m_context, arg);
 }
 
-JSValueRef Converter::toJSValueRefLong(const long arg) {
+JSValueRef Converter::toJSValueRefLong(const long arg)
+{
     return JSValueMakeNumber(m_context, arg);
 }
 
@@ -290,8 +290,9 @@ JSValueRef Converter::toJSValueRef(const tm& arg)
 
 JSValueRef Converter::toJSValueRef(const time_t arg)
 {
-    struct tm *tminfo = localtime(&arg);
-    return toJSValueRef(*tminfo);
+    struct tm tminfo = {0, };
+    localtime_r(&arg, &tminfo);
+    return toJSValueRef(tminfo);
 }
 
 JSValueRef Converter::toJSValueRef(const std::vector<std::string>& arg)
@@ -304,11 +305,13 @@ JSValueRef Converter::toJSValueRef(const char* arg)
     return toJSValueRef(std::string(arg));
 }
 
-JSValueRef Converter::toJSValueRef(const std::vector<int>& arg) {
+JSValueRef Converter::toJSValueRef(const std::vector<int>& arg)
+{
     return toJSValueRef_(arg);
 }
 
-JSValueRef Converter::toJSValueRef(const std::vector<time_t>& arg) {
+JSValueRef Converter::toJSValueRef(const std::vector<time_t>& arg)
+{
     return toJSValueRef_(arg);
 }
 
@@ -379,7 +382,6 @@ bool Converter::isNan(double value) const
                  NOT_IEEE754_REPRESENTATION);
     return (value != value);
 }
-
 } // CommonsJavaScript
 } // WrtDeviceApis
 
index 302141d..ff196b6 100644 (file)
@@ -29,7 +29,6 @@
 
 namespace WrtDeviceApis {
 namespace CommonsJavaScript {
-
 class Converter : private DPL::Noncopyable
 {
   public:
@@ -229,14 +228,14 @@ class Converter : private DPL::Noncopyable
     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 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.
@@ -277,12 +276,12 @@ class Converter : private DPL::Noncopyable
     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 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.
@@ -292,7 +291,7 @@ class Converter : private DPL::Noncopyable
      */
     JSValueRef toJSValueRef(long long int arg);
 
-  /**
+    /**
      * Converts STL string to JSValueRef.
      * @param arg STL string to convert.
      * @return JSValueRef object.
@@ -325,22 +324,22 @@ class Converter : private DPL::Noncopyable
     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 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 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.
@@ -397,16 +396,18 @@ class Converter : private DPL::Noncopyable
 
     template<typename T, class Derived>
     std::vector<T> toVectorOfT_(const JSValueRef& arg,
-            T (Derived::*f)(const JSValueRef &),
-            Derived* object)
+                                T (Derived::*f)(const JSValueRef &),
+                                Derived* object)
     {
         if (JSValueIsNull(m_context,
-                          arg) || JSValueIsUndefined(m_context, arg)) {
+                          arg) || JSValueIsUndefined(m_context, arg))
+        {
             return std::vector<T>();
         }
 
         if (!JSIsArrayValue(m_context, arg)) {
-            ThrowMsg(Commons::ConversionException, "Argument is not an JS array.");
+            ThrowMsg(Commons::ConversionException,
+                     "Argument is not an JS array.");
         }
 
         std::vector<T> result;
@@ -420,15 +421,17 @@ class Converter : private DPL::Noncopyable
 
     template<typename T>
     std::vector<T> toVectorOfT_(const JSValueRef& arg,
-            T (Converter::*f)(const JSValueRef &))
+                                T (Converter::*f)(const JSValueRef &))
     {
         if (JSValueIsNull(m_context,
-                          arg) || JSValueIsUndefined(m_context, arg)) {
+                          arg) || JSValueIsUndefined(m_context, arg))
+        {
             return std::vector<T>();
         }
 
         if (!JSIsArrayValue(m_context, arg)) {
-            ThrowMsg(Commons::ConversionException, "Argument is not an JS array.");
+            ThrowMsg(Commons::ConversionException,
+                     "Argument is not an JS array.");
         }
 
         std::vector<T> result;
@@ -442,13 +445,14 @@ class Converter : private DPL::Noncopyable
 
     template<class T, class Derived>
     JSValueRef toJSValueRef_(const std::vector<T>& arg,
-            JSValueRef (Derived::*f)(const T &),
-            Derived* object)
+                             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");
+            ThrowMsg(WrtDeviceApis::Commons::NullPointerException,
+                     "Could not create js array object");
         }
 
         for (std::size_t i = 0; i < arg.size(); ++i) {
@@ -489,7 +493,8 @@ class Converter : private DPL::Noncopyable
         JSObjectRef jsResult = JSCreateArrayObject(m_context, 0, NULL);
 
         if (NULL == jsResult) {
-            ThrowMsg(WrtDeviceApis::Commons::NullPointerException, "Could not create js array object");
+            ThrowMsg(WrtDeviceApis::Commons::NullPointerException,
+                     "Could not create js array object");
         }
 
         typename std::list<T>::const_iterator it = arg.begin();
@@ -506,13 +511,14 @@ class Converter : private DPL::Noncopyable
 
     template<class T, class Derived>
     JSValueRef toJSValueRef_(const std::list<T>& arg,
-            JSValueRef (Derived::*f)(const T &),
-            Derived* object)
+                             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");
+            ThrowMsg(WrtDeviceApis::Commons::NullPointerException,
+                     "Could not create js array object");
         }
 
         typename std::list<T>::const_iterator it = arg.begin();
@@ -534,7 +540,8 @@ class Converter : private DPL::Noncopyable
     {
         std::stringstream ss;
         if (!(ss << arg)) {
-            ThrowMsg(WrtDeviceApis::Commons::ConversionException, "Could not convert to string.");
+            ThrowMsg(WrtDeviceApis::Commons::ConversionException,
+                     "Could not convert to string.");
         }
         return ss.str();
     }
@@ -572,7 +579,6 @@ class ConverterFactory : private DPL::Noncopyable
 typedef ConverterFactory<Converter> BasicConverterFactory;
 
 typedef BasicConverterFactory::ConverterType BasicConverter;
-
 } // CommonsJavaScript
 } // WrtDeviceApis
 
index 6625eca..3eb148a 100644 (file)
 
 namespace WrtDeviceApis {
 namespace CommonsJavaScript {
-
 DOMExceptionData::DOMExceptionData(int code,
                                    const std::string& message) :
     m_code(code),
     m_message(message)
-{
-}
+{}
 
 int DOMExceptionData::getCode() const
 {
@@ -34,6 +32,5 @@ std::string DOMExceptionData::getMessage() const
 {
     return m_message;
 }
-
 } // CommonsJavaScript
 } // WrtDeviceApis
index fee0e86..b6cd760 100644 (file)
 
 namespace WrtDeviceApis {
 namespace CommonsJavaScript {
-
 class DOMExceptionData
 {
   public:
     explicit DOMExceptionData(int code,
-            const std::string& message = std::string());
+                              const std::string& message = std::string());
 
     int getCode() const;
     std::string getMessage() const;
@@ -37,7 +36,6 @@ class DOMExceptionData
 };
 
 typedef DPL::SharedPtr<DOMExceptionData> DOMExceptionDataPtr;
-
 } // CommonsJavaScript
 } // WrtDeviceApis
 
index 21d278a..46a28f2 100644 (file)
 
 namespace WrtDeviceApis {
 namespace CommonsJavaScript {
-
-JSCallbackManagerPtr JSCallbackManager::createObject(JSContextRef context,
-        JSValueRef onSuccess,
-        JSValueRef onError,
-        bool acceptJSNullAsOnSuccess,
-        bool acceptJSNullAsOnError)
+JSCallbackManagerPtr JSCallbackManager::createObject(
+    JSContextRef context,
+    JSValueRef onSuccess,
+    JSValueRef onError,
+    bool
+    acceptJSNullAsOnSuccess,
+    bool acceptJSNullAsOnError)
 {
     LogDebug("entered");
     JSObjectRef l_onSuccess = NULL;
@@ -38,10 +39,12 @@ JSCallbackManagerPtr JSCallbackManager::createObject(JSContextRef context,
     LogDebug("onSuccessCallback ptr=" << onSuccess);
     LogDebug("onErrorCallback   ptr=" << onError);
     if (NULL != onSuccess &&
-        (!acceptJSNullAsOnSuccess || !JSValueIsNull(context, onSuccess))) {
+        (!acceptJSNullAsOnSuccess || !JSValueIsNull(context, onSuccess)))
+    {
         l_onSuccess = JSValueToObject(context, onSuccess, NULL);
         if (!l_onSuccess ||
-            !JSObjectIsFunction(context, l_onSuccess)) {
+            !JSObjectIsFunction(context, l_onSuccess))
+        {
             ThrowMsg(Commons::InvalidArgumentException,
                      "success callback is not a function");
         }
@@ -49,10 +52,12 @@ JSCallbackManagerPtr JSCallbackManager::createObject(JSContextRef context,
         LogWarning("onSuccessCallback is NULL and is not registred");
     }
     if (NULL != onError &&
-        (!acceptJSNullAsOnError || !JSValueIsNull(context, onError))) {
+        (!acceptJSNullAsOnError || !JSValueIsNull(context, onError)))
+    {
         l_onError = JSValueToObject(context, onError, NULL);
         if (!l_onError ||
-            !JSObjectIsFunction(context, l_onError)) {
+            !JSObjectIsFunction(context, l_onError))
+        {
             ThrowMsg(Commons::InvalidArgumentException,
                      "error callback is not a function");
         }
@@ -64,12 +69,12 @@ JSCallbackManagerPtr JSCallbackManager::createObject(JSContextRef context,
 }
 
 JSCallbackManager::JSCallbackManager(JSContextRef context,
-        JSObjectRef onSuccess,
-        JSObjectRef onError) :
+                                     JSObjectRef onSuccess,
+                                     JSObjectRef onError) :
     m_onSuccess(NULL),
     m_onError(NULL),
-    m_object(NULL),
-    m_context(context)
+    m_context(context),
+    m_object(NULL)
 {
     LogDebug("entered");
 
@@ -190,7 +195,7 @@ void JSCallbackManager::callOnSuccess(JSValueRef obj)
 }
 
 void JSCallbackManager::callOnSuccess(JSValueRef obj[],
-        int paramCount)
+                                      int paramCount)
 {
     LogDebug("entered");
     if (m_onSuccess == NULL) {
@@ -222,7 +227,7 @@ void JSCallbackManager::callOnError(JSValueRef obj)
 }
 
 void JSCallbackManager::callOnError(JSValueRef obj[],
-        int paramCount)
+                                    int paramCount)
 {
     LogDebug("entered");
     if (m_onError == NULL) {
@@ -256,6 +261,5 @@ void JSCallbackManager::makeCallback(JSContextRef context,
         return;
     }
 }
-
 }
 }
index 9eb7ea5..457fe95 100644 (file)
@@ -28,7 +28,6 @@
 
 namespace WrtDeviceApis {
 namespace CommonsJavaScript {
-
 class JSCallbackManager;
 typedef DPL::SharedPtr<JSCallbackManager> JSCallbackManagerPtr;
 
@@ -36,37 +35,42 @@ class JSCallbackManager : public WrtDeviceApis::Commons::IEventPrivateData
 {
   private:
     JSCallbackManager()
-    {
-    }
+    {}
 
     /**
-     *  Used to create JSCallbackManagerPtr object by factory method createObject
+     *  Used to create JSCallbackManagerPtr object by factory method
+     * createObject
      */
     JSCallbackManager(JSContextRef context,
-            JSObjectRef onSuccess,
-            JSObjectRef onError);
+                      JSObjectRef onSuccess,
+                      JSObjectRef onError);
 
   public:
 
-    //JSCallbackManager( JSContextRef context, JSValueRef onSuccess, JSValueRef onError );
+    //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 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
+     * @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);
+        JSContextRef context,
+        JSValueRef onSuccess = NULL,
+        JSValueRef onError = NULL,
+        bool acceptJSNullAsOnSuccess = false,
+        bool acceptJSNullAsOnError = false);
 
     virtual ~JSCallbackManager();
 
index e1e476a..ffee065 100644 (file)
@@ -77,14 +77,14 @@ const Error PROPERTY_ERROR[] = {
       WrtDeviceApis::CommonsJavaScript::JSDOMException::SECURITY_ERR },
     { "NETWORK_ERR",
       WrtDeviceApis::CommonsJavaScript::JSDOMException::NETWORK_ERR },
-    { "ABORT_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 },
+    { "IO_ERR",
+      WrtDeviceApis::CommonsJavaScript::JSDOMException::IO_ERR },
     { "QUOTA_EXCEEDED_ERR",
       WrtDeviceApis::CommonsJavaScript::JSDOMException::QUOTA_EXCEEDED_ERR }
 };
@@ -92,7 +92,6 @@ const Error PROPERTY_ERROR[] = {
 
 namespace WrtDeviceApis {
 namespace CommonsJavaScript {
-
 JSClassRef JSDOMException::m_classRef = NULL;
 
 JSClassDefinition JSDOMException::m_classInfo = {
@@ -136,8 +135,7 @@ JSClassRef JSDOMException::getClassRef()
 
 void JSDOMException::initialize(JSContextRef /*context*/,
                                 JSObjectRef /*object*/)
-{
-}
+{}
 
 void JSDOMException::finalize(JSObjectRef object)
 {
@@ -156,7 +154,8 @@ bool JSDOMException::hasProperty(JSContextRef /*context*/,
     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)) {
+                                         PROPERTY_ERROR[i].name))
+        {
             return true;
         }
     }
@@ -180,12 +179,12 @@ JSValueRef JSDOMException::getStaticProperty(JSContextRef context,
         if (JSStringIsEqualToUTF8CString(propertyName, PROPERTY_CODE)) {
             return converter.toJSValueRef(privateObject->getObject()->getCode());
         } else if (JSStringIsEqualToUTF8CString(propertyName,
-                                                PROPERTY_MESSAGE)) {
+                                                PROPERTY_MESSAGE))
+        {
             return converter.toJSValueRef(
                        privateObject->getObject()->getMessage());
         }
-    }
-    catch (const Commons::ConversionException& ex) {
+    } catch (const Commons::ConversionException& ex) {
         LogError("Exception: " << ex.GetMessage());
     }
 
@@ -207,8 +206,7 @@ JSValueRef JSDOMException::getProperty(JSContextRef context,
                 return converter.toJSValueRef(PROPERTY_ERROR[i].value);
             }
         }
-    }
-    catch (const Commons::ConversionException& ex) {
+    } catch (const Commons::ConversionException& ex) {
         LogError("Exception: " << ex.GetMessage());
     }
 
@@ -216,9 +214,9 @@ JSValueRef JSDOMException::getProperty(JSContextRef context,
 }
 
 void JSDOMException::getPropertyNames(
-        JSContextRef /*context*/,
-        JSObjectRef /*object*/,
-        JSPropertyNameAccumulatorRef accumulator)
+    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) {
@@ -235,7 +233,6 @@ bool JSDOMException::hasInstance(JSContextRef context,
 {
     return JSValueIsObjectOfClass(context, possibleInstance, getClassRef());
 }
-
 } // CommonsJavaScript
 } // WrtDeviceApis
 
index e7e97c5..dcea1e4 100644 (file)
@@ -22,7 +22,6 @@
 
 namespace WrtDeviceApis {
 namespace CommonsJavaScript {
-
 class JSDOMException
 {
   public:
@@ -69,7 +68,7 @@ class JSDOMException
      * The callback invoked when an object is first created.
      */
     static void initialize(JSContextRef context,
-            JSObjectRef object);
+                           JSObjectRef object);
 
     /**
      * The callback invoked when an object is finalized.
@@ -80,39 +79,41 @@ class JSDOMException
      * The callback invoked when getting a property's value.
      */
     static bool hasProperty(JSContextRef context,
-            JSObjectRef object,
-            JSStringRef propertyName);
+                            JSObjectRef object,
+                            JSStringRef propertyName);
 
     /**
      * The callback invoked when getting a property's value.
      */
     static JSValueRef getProperty(JSContextRef context,
-            JSObjectRef object,
-            JSStringRef propertyName,
-            JSValueRef* exception);
+                                  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);
+                                        JSObjectRef object,
+                                        JSStringRef propertyName,
+                                        JSValueRef* exception);
 
     static void getPropertyNames(JSContextRef context,
-            JSObjectRef object,
-            JSPropertyNameAccumulatorRef accumulator);
+                                 JSObjectRef object,
+                                 JSPropertyNameAccumulatorRef accumulator);
 
     /**
-     * The callback invoked when an object is used as the target of an 'instanceof' expression.
+     * 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);
+                            JSObjectRef constructor,
+                            JSValueRef possibleInstance,
+                            JSValueRef* exception);
 
     /**
-     * This structure contains properties and callbacks that define a type of object.
+     * This structure contains properties and callbacks that define a type of
+     * object.
      */
     static JSClassDefinition m_classInfo;
 
@@ -123,7 +124,6 @@ class JSDOMException
 
     static JSClassRef m_classRef;
 };
-
 } // CommonsJavaScript
 } // WrtDeviceApis
 
index 398dfa3..94c1797 100644 (file)
@@ -24,7 +24,6 @@
 
 namespace WrtDeviceApis {
 namespace CommonsJavaScript {
-
 #define DEFINE_JS_EXCEPTION_FACTORY(Class, Code) \
     JSDOMExceptionFactory JSDOMExceptionFactory::Class(Code)
 
@@ -69,30 +68,28 @@ 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)
+                                       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);
+                                     JSDOMException::getClassRef(),
+                                     data);
     return JSValueMakeUndefined(context);
 }
 
 JSObjectRef JSDOMExceptionFactory::make(JSContextRef context,
-        const std::string& message)
+                                        const std::string& message)
 {
     JSDOMException::PrivateObject::ObjectType data(new DOMExceptionData(m_code,
                                                                         message));
     return JSUtils::makeObject(context,
-                                        JSDOMException::getClassRef(), data);
+                               JSDOMException::getClassRef(), data);
 }
-
 } // CommonsJavaScript
 } // WrtDeviceApis
index 84f79ba..2bf8329 100644 (file)
@@ -22,7 +22,6 @@
 
 namespace WrtDeviceApis {
 namespace CommonsJavaScript {
-
 #define DECLARE_JS_EXCEPTION_FACTORY(Class) static JSDOMExceptionFactory Class
 
 class JSDOMExceptionFactory : public DPL::Noncopyable
@@ -69,30 +68,31 @@ class JSDOMExceptionFactory : public DPL::Noncopyable
      *                                 JSValueRef* exception)
      * {
      * ...
-     *   return JSExceptionFactory::InvalidArgumentException.make(context, exception);
+     *   return JSExceptionFactory::InvalidArgumentException.make(context,
+     * exception);
      * ...
      * }
      * @endcode
      */
     JSValueRef make(JSContextRef context,
-            JSValueRef* exception,
-            const std::string& message = std::string());
+                    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);
+     * JSObjectRef jsError =
+     * JSExceptionFactory::InvalidArgumentException.make(context);
      * @endcode
      */
     JSObjectRef make(JSContextRef context,
-            const std::string& message = std::string());
+                     const std::string& message = std::string());
 
   private:
     int m_code;
 };
-
 } // CommonsJavaScript
 } // WrtDeviceApis
 
index 23c841e..1891361 100644 (file)
@@ -28,7 +28,6 @@
 
 namespace WrtDeviceApis {
 namespace CommonsJavaScript {
-
 namespace {
 const char* PLUGIN_NAME = "PendingOperation";
 }
index 0f75970..1a67d89 100644 (file)
@@ -32,7 +32,8 @@
 
 namespace WrtDeviceApis {
 namespace CommonsJavaScript {
-//typedef Commons::PrivateObjectT<IJSPendingOperationPrivateObject*>::Type PendingOperationPrivateObject;
+//typedef Commons::PrivateObjectT<IJSPendingOperationPrivateObject*>::Type
+// PendingOperationPrivateObject;
 
 class JSPendingOperation
 {
@@ -47,7 +48,7 @@ class JSPendingOperation
      * The callback invoked when an object is first created.
      */
     static void initialize(JSContextRef context,
-            JSObjectRef object);
+                           JSObjectRef object);
 
     /**
      * The callback invoked when an object is finalized.
@@ -55,7 +56,8 @@ class JSPendingOperation
     static void finalize(JSObjectRef object);
 
     /**
-     * This structure contains properties and callbacks that define a type of object.
+     * This structure contains properties and callbacks that define a type of
+     * object.
      */
     static JSClassDefinition m_classInfo;
 
@@ -70,11 +72,11 @@ class JSPendingOperation
      * 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);
+                             JSObjectRef object,
+                             JSObjectRef thisObject,
+                             size_t argumentCount,
+                             const JSValueRef arguments[],
+                             JSValueRef* exception);
 };
 } // CommonsJavaScript
 } // WrtDeviceApis
index 745d284..3f41bf2 100644 (file)
@@ -35,8 +35,8 @@ class IJSPendingOperationPrivateObject
 {
   public:
     explicit IJSPendingOperationPrivateObject(
-            const DPL::SharedPtr<Commons::IEventController>
-            &event) :
+        const DPL::SharedPtr<Commons::IEventController>
+        &event) :
         m_event(event)
     {
         assert(NULL != m_event);
@@ -49,8 +49,7 @@ class IJSPendingOperationPrivateObject
     }
 
     virtual ~IJSPendingOperationPrivateObject()
-    {
-    }
+    {}
 
   protected:
     DPL::SharedPtr<Commons::IEventController> m_event;
@@ -77,9 +76,9 @@ class IJSExtCancelPendingOperationPrivateObject :
 {
   public:
     IJSExtCancelPendingOperationPrivateObject(
-            const DPL::SharedPtr< TemplateEvent> &event,
-            const DPL::SharedPtr<
-                Commons::IExternEventCanceler<TemplateEvent> > & cancel) :
+        const DPL::SharedPtr< TemplateEvent> &event,
+        const DPL::SharedPtr<
+            Commons::IExternEventCanceler<TemplateEvent> > & cancel) :
         IJSPendingOperationPrivateObject(
             DPL::StaticPointerCast<Commons::IEventController>(event)),
         m_canceler(cancel)
@@ -106,8 +105,7 @@ class IJSExtCancelPendingOperationPrivateObject :
     }
 
     virtual ~IJSExtCancelPendingOperationPrivateObject()
-    {
-    }
+    {}
 
   protected:
     DPL::SharedPtr< Commons::IExternEventCanceler<TemplateEvent> > m_canceler;
index f3248a3..f4c9c95 100644 (file)
 
 namespace WrtDeviceApis {
 namespace CommonsJavaScript {
-
 using namespace WrtDeviceApis::Commons;
 
-
 bool JSUtils::hasProperty(JSStaticValue* properties,
-        JSStringRef name)
+                          JSStringRef name)
 {
     JSStaticValue* property = properties;
     while (property->name) {
@@ -37,9 +35,9 @@ bool JSUtils::hasProperty(JSStaticValue* properties,
 }
 
 JSValueRef JSUtils::getJSProperty(JSContextRef context,
-        JSValueRef jsValue,
-        const std::string &name,
-        JSValueRef *exception)
+                                  JSValueRef jsValue,
+                                  const std::string &name,
+                                  JSValueRef *exception)
 {
     ScopedJSStringRef jsPropName(JSStringCreateWithUTF8CString(name.c_str()));
     Converter converter(context);
@@ -52,8 +50,8 @@ JSValueRef JSUtils::getJSProperty(JSContextRef context,
 }
 
 JSValueRef JSUtils::getJSProperty(JSContextRef context,
-        JSObjectRef object,
-        const std::string& name)
+                                  JSObjectRef object,
+                                  const std::string& name)
 {
     Converter converter(context);
     Try {
@@ -68,14 +66,13 @@ JSValueRef JSUtils::getJSProperty(JSContextRef context,
             }
         }
     }
-    Catch(ConversionException) {
-    }
+    Catch(ConversionException) {}
     return NULL;
 }
 
 JSValueRef JSUtils::getJSPropertyOrUndefined(JSContextRef context,
-        JSObjectRef object,
-        const std::string& name)
+                                             JSObjectRef object,
+                                             const std::string& name)
 {
     Converter converter(context);
     Try {
@@ -84,8 +81,7 @@ JSValueRef JSUtils::getJSPropertyOrUndefined(JSContextRef context,
             return JSObjectGetProperty(context, object, propName.get(), NULL);
         }
     }
-    Catch(ConversionException) {
-    }
+    Catch(ConversionException) {}
     return JSValueMakeUndefined(context);
 }
 } // CommonsJavaScript
index c55f8db..5d835a1 100644 (file)
 
 namespace WrtDeviceApis {
 namespace CommonsJavaScript {
-
 class JSUtils
 {
   public:
     static bool hasProperty(JSStaticValue* properties,
-            JSStringRef name);
+                            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);
+                                    JSValueRef jsValue,
+                                    const std::string &name,
+                                    JSValueRef* exception = NULL);
 
     static JSValueRef getJSProperty(JSContextRef context,
-            JSObjectRef object,
-            const std::string& name);
+                                    JSObjectRef object,
+                                    const std::string& name);
 
     static JSValueRef getJSPropertyOrUndefined(JSContextRef context,
-            JSObjectRef object,
-            const std::string& name);
+                                               JSObjectRef object,
+                                               const std::string& name);
 
     template<class C>
     static JSObjectRef makeObject(JSContextRef context,
-            JSClassRef classRef,
-            C data)
+                                  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.");
+            ThrowMsg(Commons::NullPointerException,
+                     "Could not create JS object.");
         }
 
         return object;
     }
 
     static JSObjectRef makeObject(JSContextRef context,
-            JSClassRef classRef)
+                                  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.");
+            ThrowMsg(Commons::NullPointerException,
+                     "Could not create JS object.");
         }
 
         return object;
     }
 }; // JSUtils
-
 } // CommonsJavaScript
 } // WrtDeviceApis
 
index d303d7a..e73a210 100644 (file)
 
 namespace WrtDeviceApis {
 namespace CommonsJavaScript {
-
 template<class T>
 struct NoAcquire
 {
     void acquire(T*)
-    {
-    }
+    {}
+
   protected:
     ~NoAcquire()
-    {
-    }
+    {}
 };
 
 template<class T>
@@ -45,10 +43,10 @@ struct AcquireByProtect
         Assert(object && "Object passed to protect can't be NULL.");
         JSValueProtect(object->getContext(), object->getObject());
     }
+
   protected:
     ~AcquireByProtect()
-    {
-    }
+    {}
 };
 
 template<class T>
@@ -58,10 +56,10 @@ struct NoRelease
     {
         (void)object;
     }
+
   protected:
     ~NoRelease()
-    {
-    }
+    {}
 };
 
 template<class T>
@@ -71,10 +69,10 @@ struct ReleaseByDelete
     {
         delete object->getObject();
     }
+
   protected:
     ~ReleaseByDelete()
-    {
-    }
+    {}
 };
 
 template<class T>
@@ -85,10 +83,10 @@ struct ReleaseByUnprotect
         Assert(object && "Object passed to unprotect can't be NULL.");
         JSValueUnprotect(object->getContext(), object->getObject());
     }
+
   protected:
     ~ReleaseByUnprotect()
-    {
-    }
+    {}
 };
 
 template<class T>
@@ -97,8 +95,7 @@ struct NoOwnership : protected NoAcquire<T>,
 {
   protected:
     ~NoOwnership()
-    {
-    }
+    {}
 };
 
 template<class T>
@@ -107,8 +104,7 @@ struct OwnershipByAcquisition : protected NoAcquire<T>,
 {
   protected:
     ~OwnershipByAcquisition()
-    {
-    }
+    {}
 };
 
 template<class T>
@@ -117,8 +113,7 @@ struct OwnershipByProtection : protected AcquireByProtect<T>,
 {
   protected:
     ~OwnershipByProtection()
-    {
-    }
+    {}
 };
 
 template<class PrivateClass,
@@ -137,12 +132,13 @@ class PrivateObject : public DPL::Noncopyable,
      * @throw NullPointerException When object is pointer and is set to NULL.
      */
     PrivateObject(JSContextRef context,
-            const PrivateClass& object) :
+                  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.");
+        Assert(!Commons::IsNull<PrivateClass>::value(
+                   object) && "Object is NULL.");
         acquire(this);
     }
 
@@ -198,8 +194,7 @@ class PrivateObject<void, NoOwnership> : private DPL::Noncopyable
      * Destroys instance of the object.
      */
     virtual ~PrivateObject()
-    {
-    }
+    {}
 
     /**
      * Gets stored JS context.
@@ -237,7 +232,6 @@ struct PrivateObjectT<void>
 {
     typedef PrivateObject<void, NoOwnership> Type;
 };
-
 } // CommonsJavaScript
 } // WrtDeviceApis
 
index a16bbcb..2f0c17f 100644 (file)
 
 namespace WrtDeviceApis {
 namespace CommonsJavaScript {
-
 ScopedJSStringRef::ScopedJSStringRef(JSStringRef ref) : m_ref(ref)
-{
-}
+{}
 
 ScopedJSStringRef::~ScopedJSStringRef()
 {
index fe20f9c..87111fd 100644 (file)
 #include <JavaScriptCore/JavaScript.h>
 
 namespace WrtDeviceApis {
-
 namespace CommonsJavaScript {
-
-
 AceSecurityStatus aceCheckAccessSimple(
-        WrtDeviceApis::Commons::AceFunction aceFunction)
+    WrtDeviceApis::Commons::AceFunction aceFunction)
 {
-    return aceCheckAccess2<DefaultArgsVerifier<>>(aceFunction);
+    return aceCheckAccess2<DefaultArgsVerifier<> >(aceFunction);
 }
-
 }
-
 }
index ad93dd8..dcdd452 100644 (file)
@@ -26,7 +26,6 @@
 
 namespace WrtDeviceApis {
 namespace CommonsJavaScript {
-
 enum class AceSecurityStatus
 {
     AccessGranted,
@@ -39,7 +38,7 @@ class DefaultArgsVerifier
 {
   public:
     void operator()(WrtDeviceApis::Commons::AceFunction& aceFunction,
-            Args && ... args) const
+                    Args && ... args) const
     {
         static_assert(
             WrtDeviceApis::Commons::AlwaysFalse<Args ...>::value,
@@ -52,15 +51,14 @@ class DefaultArgsVerifier<>
 {
   public:
     void operator()(WrtDeviceApis::Commons::AceFunction& /*aceFunction*/) const
-    {
-    }
+    {}
 };
 
 template <typename ArgumentsVerifier,
           typename ... Args>
 AceSecurityStatus aceCheckAccess2(
-        WrtDeviceApis::Commons::AceFunction aceFunction,
-        Args && ... args)
+    WrtDeviceApis::Commons::AceFunction aceFunction,
+    Args && ... args)
 {
     using namespace WrtDeviceApis::Commons;
 
@@ -68,9 +66,10 @@ AceSecurityStatus aceCheckAccess2(
     argsVerify(aceFunction, args ...);
 
     Try {
-        if (!(WrtAccessSingleton::Instance().checkAccessControl(aceFunction))) {
-        LogDebug("Function is not allowed to run");
-        return AceSecurityStatus::AccessDenied;
+        if (!(WrtAccessSingleton::Instance().checkAccessControl(aceFunction)))
+        {
+            LogDebug("Function is not allowed to run");
+            return AceSecurityStatus::AccessDenied;
         }
     }
     Catch(WrtDeviceApis::Commons::OutOfRangeException) {
@@ -83,12 +82,9 @@ AceSecurityStatus aceCheckAccess2(
     return AceSecurityStatus::AccessGranted;
 }
 
-
-
 //The simplest version
 AceSecurityStatus aceCheckAccessSimple(
-        WrtDeviceApis::Commons::AceFunction aceFunction);
-
+    WrtDeviceApis::Commons::AceFunction aceFunction);
 }
 }
 
index 736b14a..c089d50 100644 (file)
 
 namespace WrtDeviceApis {
 namespace CommonsJavaScript {
-
 template<typename ParamType,
          typename DeviceCapType,
          typename FunctionType>
-class StaticDeclarations  : public DPL::Noncopyable
+class StaticDeclarations : public DPL::Noncopyable
 {
     struct FunctionTriplet {
         const char* name;
         std::vector<DeviceCapType> devCaps;
         std::vector<const char*> features;
     };
-  public:
 
+  public:
 
     typedef typename std::map<ParamType, const char*>  ParamsMap;
 
     typedef std::map<DeviceCapType,
-               std::pair<const char*,
-                         std::vector<ParamType> > >  DeviceCapsMaps;
+                     std::pair<const char*,
+                               std::vector<ParamType> > >  DeviceCapsMaps;
 
     typedef std::map<FunctionType, FunctionTriplet >  FunctionsMap;
 
     typedef std::map<FunctionType, WrtDeviceApis::Commons::AceFunction>
-        AceFunctionsMap;
+    AceFunctionsMap;
 
     typedef std::map<std::string, std::vector<DeviceCapType> > FeaturesMap;
 
@@ -70,7 +69,7 @@ class StaticDeclarations  : public DPL::Noncopyable
      * for given device capability id
      * */
     static WrtDeviceApis::Commons::AceDeviceCapability
-                getDeviceCapabilityWithoutParams(const DeviceCapType& devCapsId)
+    getDeviceCapabilityWithoutParams(const DeviceCapType& devCapsId)
     {
         WrtDeviceApis::Commons::AceDeviceCapability deviceCap;
         auto it = m_deviceCaps.find(devCapsId);
@@ -87,7 +86,7 @@ class StaticDeclarations  : public DPL::Noncopyable
      * for given device capability id
      * */
     static WrtDeviceApis::Commons::AceDeviceCapability
-                getDeviceCapability(const DeviceCapType& devCapsId)
+    getDeviceCapability(const DeviceCapType& devCapsId)
     {
         auto it = m_deviceCaps.find(devCapsId);
 
@@ -109,11 +108,11 @@ class StaticDeclarations  : public DPL::Noncopyable
     }
 
     static void addDeviceCapabilty(
-                const DeviceCapType& devCapsId,
-                WrtDeviceApis::Commons::AceFunction& aceFunction)
+        const DeviceCapType& devCapsId,
+        WrtDeviceApis::Commons::AceFunction& aceFunction)
     {
         aceFunction.deviceCapabilities.push_back(
-                getDeviceCapability(devCapsId));
+            getDeviceCapability(devCapsId));
     }
 
     /**
@@ -135,16 +134,16 @@ class StaticDeclarations  : public DPL::Noncopyable
                               const std::string& value)
     {
         //get name of the deviceCaps
-        std::string devCapName =  getDevCapNameById(devCapId) ;
+        std::string devCapName = getDevCapNameById(devCapId);
         std::string paramName = getParamName(paramId);
 
         //search throw all the device capabilities
         FOREACH(devCapIt, function.deviceCapabilities) {
-            if(devCapIt->devCapName == devCapName) {
+            if (devCapIt->devCapName == devCapName) {
                 //device capability has been found
                 //check params
                 FOREACH(devParamIt, devCapIt->devCapParams) {
-                    if(devParamIt->name == paramName) {
+                    if (devParamIt->name == paramName) {
                         devParamIt->value = value;
                         return true;
                     }
@@ -160,7 +159,7 @@ class StaticDeclarations  : public DPL::Noncopyable
      * To set param value function you may use setParamValue Function
      * */
     static WrtDeviceApis::Commons::AceFunction getEmptyFunction(
-                const FunctionType& functionId)
+        const FunctionType& functionId)
     {
         WrtDeviceApis::Commons::AceFunction function;
         auto it = m_functions.find(functionId);
@@ -168,7 +167,7 @@ class StaticDeclarations  : public DPL::Noncopyable
         function.name = it->second.first;
 
         return function;
-    };
+    }
 
     /**
      * The most useful Function
@@ -178,7 +177,7 @@ class StaticDeclarations  : public DPL::Noncopyable
      * To set param value function you may use setParamValue function
      * */
     static WrtDeviceApis::Commons::AceFunction getSecurityFunction(
-                const FunctionType& functionId)
+        const FunctionType& functionId)
     {
         WrtDeviceApis::Commons::AceFunction function;
         auto it = m_functions.find(functionId);
@@ -186,15 +185,15 @@ class StaticDeclarations  : public DPL::Noncopyable
 
         function.name = it->second.name;
 
-        FOREACH (featIt, it->second.features)
-            function.features.push_back(std::string(*featIt));
+        FOREACH(featIt, it->second.features)
+        function.features.push_back(std::string(*featIt));
 
         FOREACH(devCapIt, it->second.devCaps) {
             function.deviceCapabilities.push_back(
-                        getDeviceCapability(*devCapIt));
+                getDeviceCapability(*devCapIt));
         }
         return function;
-    };
+    }
 
     /**
      * To create static map
@@ -204,7 +203,7 @@ class StaticDeclarations  : public DPL::Noncopyable
         FOREACH(functionIt, m_functions)
         {
             m_aceFunctions[functionIt->first] =
-                    getSecurityFunction(functionIt->first);
+                getSecurityFunction(functionIt->first);
         }
     }
 
@@ -223,10 +222,10 @@ class StaticDeclarations  : public DPL::Noncopyable
                 strndup(featureIt->first.c_str(), featureIt->first.size() + 1);
 
             mapping->features[i].devCaps.devCapsCount =
-                    featureIt->second.size();
+                featureIt->second.size();
 
             mapping->features[i].devCaps.deviceCaps =
-                    new char*[mapping->features[i].devCaps.devCapsCount];
+                new char*[mapping->features[i].devCaps.devCapsCount];
 
             for (size_t j = 0;
                  j < mapping->features[i].devCaps.devCapsCount;
@@ -253,16 +252,14 @@ class StaticDeclarations  : public DPL::Noncopyable
 
         devcaps_t* ret = NULL;
 
-        for (size_t i = 0; i < feats->featuresCount ; ++i)
-        {
+        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)
-            {
+            if (feature == feat) {
                 ret = &(feats->features[i].devCaps);
                 break;
             }
@@ -273,27 +270,22 @@ class StaticDeclarations  : public DPL::Noncopyable
 
     static void featuresDeinitializer(feature_mapping_t* mapping)
     {
-        if (mapping)
-        {
-            if (mapping->features)
-            {
-                for (size_t i = 0; i < mapping->featuresCount; ++i)
-                {
+        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)
-                        {
+                    if (dc.deviceCaps) {
+                        for (size_t j = 0; j < dc.devCapsCount; ++j) {
                             free(dc.deviceCaps[j]);
                         }
 
-                        delete []dc.deviceCaps;
+                        delete[] dc.deviceCaps;
                     }
                 }
-                delete []mapping->features;
+                delete[] mapping->features;
             }
             delete mapping;
         }
@@ -301,16 +293,15 @@ class StaticDeclarations  : public DPL::Noncopyable
 
     static void getMappingInterface(feature_mapping_interface_t *mapping)
     {
-        if (mapping)
-        {
+        if (mapping) {
             mapping->featGetter =
-                    StaticDeclarations::getFeaturesToDevCapMapping;
+                StaticDeclarations::getFeaturesToDevCapMapping;
             mapping->dcGetter = StaticDeclarations::devcapsGetter;
             mapping->release = StaticDeclarations::featuresDeinitializer;
         }
     }
 
-private:
+  private:
     static ParamsMap m_params;
     static DeviceCapsMaps m_deviceCaps;
     static FunctionsMap m_functions;
@@ -318,7 +309,6 @@ private:
 
     static FeaturesMap m_features;
 };
-
 }
 }
 
old mode 100755 (executable)
new mode 100644 (file)
index 47a06b0..ffc111b
@@ -22,7 +22,6 @@
 
 namespace WrtDeviceApis {
 namespace CommonsJavaScript {
-
 /**
  * synchronously checks access status and throws JS Security exception if
  * necessary
@@ -68,7 +67,6 @@ namespace CommonsJavaScript {
             break;                                                             \
         }                                                                      \
     } while (0)
-
 }
 }
 #endif /*WRTDEVICEAPIS_COMMONSJAVASCRIPT_JS_SECURITYEXCEPTIONS_H_ */
index 59c1987..05567e6 100644 (file)
 
 namespace WrtDeviceApis {
 namespace CommonsJavaScript {
-
 template<typename T>
 class SupportPendingOperation
 {
-public:
-    virtual T getPendingOperation() const {
+  public:
+    virtual T getPendingOperation() const
+    {
         return *m_operation;
     }
 
-    virtual void setPendingOperation(const T& operation){
+    virtual void setPendingOperation(const T& operation)
+    {
         m_operation = operation;
     }
 
-    bool checkPendingOperation() const{
+    bool checkPendingOperation() const
+    {
         return !m_operation.IsNull();
     }
 
     virtual ~SupportPendingOperation(){}
 
-protected:
+  protected:
     DPL::Optional<T> m_operation;
 };
-
 }
 }
 
index ae59476..d8b8f95 100644 (file)
@@ -36,7 +36,7 @@ namespace CommonsJavaScript {
  */
 template<typename EventType>
 JSObjectRef makePendingOperation(JSContextRef context,
-        const DPL::SharedPtr<EventType>& event)
+                                 const DPL::SharedPtr<EventType>& event)
 {
     Commons::IEventControllerPtr eventController =
         DPL::StaticPointerCast<Commons::IEventController>(event);
@@ -48,10 +48,10 @@ JSObjectRef makePendingOperation(JSContextRef context,
 
 template<typename EventType>
 JSObjectRef makeExtCancelSupportedPendingOperation(
-        JSContextRef context,
-        const DPL::SharedPtr<EventType>& event,
-        const DPL::SharedPtr<Commons::IExternEventCanceler<EventType> >&
-        cancel)
+    JSContextRef context,
+    const DPL::SharedPtr<EventType>& event,
+    const DPL::SharedPtr<Commons::IExternEventCanceler<EventType> >&
+    cancel)
 {
     IJSPendingOperationPrivateObject* pendingOperation =
         new IJSExtCancelPendingOperationPrivateObject<EventType>(event, cancel);
index 43b2c84..e73d361 100644 (file)
@@ -21,9 +21,8 @@
 
 namespace WrtDeviceApis {
 namespace CommonsJavaScript {
-
 Validator::Validator(JSContextRef context,
-        JSValueRef* exception) :
+                     JSValueRef* exception) :
     m_context(context),
     m_exception(exception)
 {
@@ -31,15 +30,15 @@ Validator::Validator(JSContextRef context,
 }
 
 Validator::~Validator()
-{
-}
+{}
 
 bool Validator::isDate(const JSValueRef& arg)
 {
     if (JSValueIsNull(m_context,
                       arg) ||
         JSValueIsUndefined(m_context,
-                           arg) || !JSValueIsObject(m_context, arg)) {
+                           arg) || !JSValueIsObject(m_context, arg))
+    {
         return false;
     }
     Converter converter(m_context);
@@ -65,7 +64,7 @@ Validator::isCallback(const JSValueRef& arg)
 
 bool
 Validator::checkArrayKeys(const std::vector<std::string> &allowed,
-        JSValueRef argument)
+                          JSValueRef argument)
 {
     if (argument == NULL) {
         return true;
@@ -95,10 +94,12 @@ Validator::checkArrayKeys(const std::vector<std::string> &allowed,
         found = false;
         for (std::list<JSStringRef>::const_iterator it = allowedJS.begin();
              it != allowedJS.end();
-             it++) {
+             ++it)
+        {
             if (JSStringIsEqual(*it,
                                 JSPropertyNameArrayGetNameAtIndex(jsProps,
-                                                                  i))) {
+                                                                  i)))
+            {
                 found = true;
                 break;
             }
@@ -126,6 +127,5 @@ bool Validator::isNullOrUndefined(const JSValueRef& arg)
     return (JSValueIsNull(m_context, arg) ||
             JSValueIsUndefined(m_context, arg));
 }
-
 } // CommonsJavaScript
 } // WrtDeviceApis
index c015fba..6a89550 100644 (file)
 
 namespace WrtDeviceApis {
 namespace CommonsJavaScript {
-
 class Validator : private DPL::Noncopyable
 {
   public:
     explicit Validator(JSContextRef context,
-            JSValueRef* exception = NULL);
+                       JSValueRef* exception = NULL);
     virtual ~Validator();
 
     /**
@@ -55,7 +54,7 @@ class Validator : private DPL::Noncopyable
      * @return true when object's properties are subset of allowed
      */
     bool checkArrayKeys(const std::vector<std::string> &allowed,
-            JSValueRef argument);
+                        JSValueRef argument);
 
     bool isNullOrUndefined(const JSValueRef& arg);
 
@@ -81,7 +80,7 @@ class ValidatorFactory : private DPL::Noncopyable
      * @return Converter object.
      */
     static ValidatorType getValidator(JSContextRef context,
-            JSValueRef* exception = NULL)
+                                      JSValueRef* exception = NULL)
     {
         C* convert = new C(context, exception);
         return ValidatorType(convert);
@@ -93,7 +92,6 @@ class ValidatorFactory : private DPL::Noncopyable
 
 typedef ValidatorFactory<Validator> BasicValidatorFactory;
 typedef BasicValidatorFactory::ValidatorType BasicValidator;
-
 } // CommonsJavaScript
 } // WrtDeviceApis
 
index 048c149..7bd26e2 100644 (file)
@@ -38,24 +38,24 @@ using namespace WrtDeviceApis::SoftKeyboardChangeEvent::Api;
 #define SOFTKEYBOARD_CHANGE_EVENT_PROPERTY_HEIGHT  "height"
 
 #define CATCH_EXCEPTION_CONVERSION \
-    Catch(Commons::ConversionException) {\
-        LogError("Error on conversion");\
-        return JSDOMExceptionFactory::\
-            UnknownException.make(context, exception);\
+    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);\
+    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);\
+    Catch(Commons::PlatformException){ \
+        LogError("PlatformException occured"); \
+        return JSDOMExceptionFactory:: \
+                   UnknownException.make(context, exception); \
     }
 
 namespace WrtPlugins {
@@ -81,16 +81,19 @@ JSClassDefinition JSSoftKeyboardChangeEvent::m_classInfo = {
 };
 
 JSStaticValue JSSoftKeyboardChangeEvent::m_property[] = {
-    { SOFTKEYBOARD_CHANGE_EVENT_PROPERTY_STATE, JSSoftKeyboardChangeEvent::getState,
+    { SOFTKEYBOARD_CHANGE_EVENT_PROPERTY_STATE,
+      JSSoftKeyboardChangeEvent::getState,
       0, kJSPropertyAttributeReadOnly },
-    { SOFTKEYBOARD_CHANGE_EVENT_PROPERTY_WIDTH, JSSoftKeyboardChangeEvent::getWidth,
+    { SOFTKEYBOARD_CHANGE_EVENT_PROPERTY_WIDTH,
+      JSSoftKeyboardChangeEvent::getWidth,
       0, kJSPropertyAttributeReadOnly },
-    { SOFTKEYBOARD_CHANGE_EVENT_PROPERTY_HEIGHT, JSSoftKeyboardChangeEvent::getHeight,
+    { SOFTKEYBOARD_CHANGE_EVENT_PROPERTY_HEIGHT,
+      JSSoftKeyboardChangeEvent::getHeight,
       0, kJSPropertyAttributeReadOnly },
     { 0, 0, 0, 0 }
 };
 
-const JSClassRef JSSoftKeyboardChangeEvent::getClassRef()
+JSClassRef JSSoftKeyboardChangeEvent::getClassRef()
 {
     if (!m_jsClassRef) {
         m_jsClassRef = JSClassCreate(&m_classInfo);
@@ -103,14 +106,17 @@ const JSClassDefinition* JSSoftKeyboardChangeEvent::getClassInfo()
     return &m_classInfo;
 }
 
-JSClassRef JSSoftKeyboardChangeEvent::m_jsClassRef = JSClassCreate(JSSoftKeyboardChangeEvent::getClassInfo());
+JSClassRef JSSoftKeyboardChangeEvent::m_jsClassRef = JSClassCreate(
+        JSSoftKeyboardChangeEvent::getClassInfo());
 
-void JSSoftKeyboardChangeEvent::initialize(JSContextRef context, JSObjectRef object)
+void JSSoftKeyboardChangeEvent::initialize(JSContextRef /*context*/,
+                                           JSObjectRef object)
 {
     LogDebug("entered");
 
     JSSoftKeyboardChangeEventPrivateObject* priv =
-        static_cast<JSSoftKeyboardChangeEventPrivateObject*>(JSObjectGetPrivate(object));
+        static_cast<JSSoftKeyboardChangeEventPrivateObject*>(JSObjectGetPrivate(
+                                                                 object));
 
     Assert(priv && "Missing private object");
 }
@@ -119,18 +125,18 @@ void JSSoftKeyboardChangeEvent::finalize(JSObjectRef object)
 {
     LogDebug("entered");
     JSSoftKeyboardChangeEventPrivateObject* priv =
-        static_cast<JSSoftKeyboardChangeEventPrivateObject*>(JSObjectGetPrivate(object));
+        static_cast<JSSoftKeyboardChangeEventPrivateObject*>(JSObjectGetPrivate(
+                                                                 object));
 
     delete priv;
     LogDebug("private object is realised");
-
 }
 
 JSValueRef JSSoftKeyboardChangeEvent::getState(
-        JSContextRef context,
-        JSObjectRef object,
-        JSStringRef propertyName,
-        JSValueRef* exception)
+    JSContextRef context,
+    JSObjectRef object,
+    JSStringRef /*propertyName*/,
+    JSValueRef* exception)
 {
     LogDebug("entered!");
 
@@ -141,14 +147,14 @@ JSValueRef JSSoftKeyboardChangeEvent::getState(
     }
     CATCH_EXCEPTION_CONVERSION
     CATCH_EXCEPTION_NULL_PTR
-    CATCH_EXCEPTION_PLATFORM_ERROR
+        CATCH_EXCEPTION_PLATFORM_ERROR
 }
 
 JSValueRef JSSoftKeyboardChangeEvent::getWidth(
-        JSContextRef context,
-        JSObjectRef object,
-        JSStringRef propertyName,
-        JSValueRef* exception)
+    JSContextRef context,
+    JSObjectRef object,
+    JSStringRef /*propertyName*/,
+    JSValueRef* exception)
 {
     LogDebug("entered!");
 
@@ -159,14 +165,14 @@ JSValueRef JSSoftKeyboardChangeEvent::getWidth(
     }
     CATCH_EXCEPTION_CONVERSION
     CATCH_EXCEPTION_NULL_PTR
-    CATCH_EXCEPTION_PLATFORM_ERROR
+        CATCH_EXCEPTION_PLATFORM_ERROR
 }
 
 JSValueRef JSSoftKeyboardChangeEvent::getHeight(
-        JSContextRef context,
-        JSObjectRef object,
-        JSStringRef propertyName,
-        JSValueRef* exception)
+    JSContextRef context,
+    JSObjectRef object,
+    JSStringRef /*propertyName*/,
+    JSValueRef* exception)
 {
     LogDebug("entered");
 
@@ -177,13 +183,15 @@ JSValueRef JSSoftKeyboardChangeEvent::getHeight(
     }
     CATCH_EXCEPTION_CONVERSION
     CATCH_EXCEPTION_NULL_PTR
-    CATCH_EXCEPTION_PLATFORM_ERROR
+        CATCH_EXCEPTION_PLATFORM_ERROR
 }
 
-ISoftKeyboardChangeEventPtr JSSoftKeyboardChangeEvent::getPrivateObject(JSObjectRef arg)
+ISoftKeyboardChangeEventPtr JSSoftKeyboardChangeEvent::getPrivateObject(
+    JSObjectRef arg)
 {
     JSSoftKeyboardChangeEventPrivateObject* priv =
-        static_cast<JSSoftKeyboardChangeEventPrivateObject*>(JSObjectGetPrivate(arg));
+        static_cast<JSSoftKeyboardChangeEventPrivateObject*>(JSObjectGetPrivate(
+                                                                 arg));
 
     if (!priv) {
         LogError("Private object not initialized");
@@ -197,6 +205,5 @@ ISoftKeyboardChangeEventPtr JSSoftKeyboardChangeEvent::getPrivateObject(JSObject
 #undef CATCH_EXCEPTION_CONVERSION
 #undef CATCH_EXCEPTION_NULL_PTR
 #undef CATCH_EXCEPTION_PLATFORM_ERROR
-
 }
 }
index f9dce7f..49da22f 100644 (file)
 
 namespace WrtPlugins {
 namespace Tizen {
-
 typedef WrtDeviceApis::CommonsJavaScript::PrivateObjectT<
-    WrtDeviceApis::SoftKeyboardChangeEvent::Api::ISoftKeyboardChangeEventPtr>::Type
-    JSSoftKeyboardChangeEventPrivateObject;
+    WrtDeviceApis::SoftKeyboardChangeEvent::Api::ISoftKeyboardChangeEventPtr>::
+    Type
+JSSoftKeyboardChangeEventPrivateObject;
 
 class JSSoftKeyboardChangeEvent
 {
@@ -41,7 +41,7 @@ class JSSoftKeyboardChangeEvent
     /**
      * This method initializes this in the JS Engine.
      */
-    static const JSClassRef getClassRef();
+    static JSClassRef getClassRef();
 
     /**
      * Gets object's class description.
@@ -65,7 +65,8 @@ class JSSoftKeyboardChangeEvent
     static JSStaticValue m_property[];
 
     /**
-     * This structure contains properties and callbacks that define a type of object.
+     * This structure contains properties and callbacks that define a type of
+     * object.
      */
     static JSClassDefinition m_classInfo;
 
@@ -73,25 +74,26 @@ class JSSoftKeyboardChangeEvent
 
     // getters for properties
     static JSValueRef getState(
-            JSContextRef context,
-            JSObjectRef object,
-            JSStringRef propertyName,
-            JSValueRef* exception);
+        JSContextRef context,
+        JSObjectRef object,
+        JSStringRef propertyName,
+        JSValueRef* exception);
 
     static JSValueRef getWidth(
-            JSContextRef context,
-            JSObjectRef object,
-            JSStringRef propertyName,
-            JSValueRef* exception);
+        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);
+        JSContextRef context,
+        JSObjectRef object,
+        JSStringRef propertyName,
+        JSValueRef* exception);
+
+    static WrtDeviceApis::SoftKeyboardChangeEvent::Api::
+        ISoftKeyboardChangeEventPtr
+    getPrivateObject(JSObjectRef arg);
 };
 } // Tizen
 } // WrtPlugins
index 09c49ce..489656e 100644 (file)
@@ -41,31 +41,31 @@ using namespace WrtDeviceApis::StorageEvent::Api;
 #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);\
+    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);\
+    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);\
+    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);\
+    Catch(Commons::SecurityException){ \
+        LogError("Security exception occured"); \
+        return JSDOMExceptionFactory:: \
+                   SecurityException.make(context, exception); \
     }
 
 namespace WrtPlugins {
@@ -104,7 +104,7 @@ JSStaticValue JSStorageEvent::m_property[] = {
     { 0, 0, 0, 0 }
 };
 
-const JSClassRef JSStorageEvent::getClassRef()
+JSClassRef JSStorageEvent::getClassRef()
 {
     if (!m_jsClassRef) {
         m_jsClassRef = JSClassCreate(&m_classInfo);
@@ -117,9 +117,10 @@ const JSClassDefinition* JSStorageEvent::getClassInfo()
     return &m_classInfo;
 }
 
-JSClassRef JSStorageEvent::m_jsClassRef = JSClassCreate(JSStorageEvent::getClassInfo());
+JSClassRef JSStorageEvent::m_jsClassRef = JSClassCreate(
+        JSStorageEvent::getClassInfo());
 
-void JSStorageEvent::initialize(JSContextRef context,
+void JSStorageEvent::initialize(JSContextRef /*context*/,
                                 JSObjectRef object)
 {
     LogDebug("entered");
@@ -138,14 +139,13 @@ void JSStorageEvent::finalize(JSObjectRef object)
 
     delete priv;
     LogDebug("private object is realised");
-
 }
 
 JSValueRef JSStorageEvent::getKey(
-        JSContextRef context,
-        JSObjectRef object,
-        JSStringRef propertyName,
-        JSValueRef* exception)
+    JSContextRef context,
+    JSObjectRef object,
+    JSStringRef /*propertyName*/,
+    JSValueRef* exception)
 {
     LogDebug("entered");
 
@@ -154,19 +154,18 @@ JSValueRef JSStorageEvent::getKey(
         Converter converter(context);
 
         return converter.toJSValueRef(getPrivateObject(object)->getKey());
-
     }
     CATCH_EXCEPTION_CONVERSION
     CATCH_EXCEPTION_NULL_PTR
     CATCH_EXCEPTION_PLATFORM_ERROR
-    CATCH_EXCEPTION_SECURITY
+        CATCH_EXCEPTION_SECURITY
 }
 
 JSValueRef JSStorageEvent::getOldValue(
-        JSContextRef context,
-        JSObjectRef object,
-        JSStringRef propertyName,
-        JSValueRef* exception)
+    JSContextRef context,
+    JSObjectRef object,
+    JSStringRef /*propertyName*/,
+    JSValueRef* exception)
 {
     LogDebug("entered");
 
@@ -176,24 +175,23 @@ JSValueRef JSStorageEvent::getOldValue(
 
         DPL::OptionalString oldValue = getPrivateObject(object)->getOldValue();
 
-        if(!oldValue) {
+        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
+        CATCH_EXCEPTION_SECURITY
 }
 
 JSValueRef JSStorageEvent::getNewValue(
-        JSContextRef context,
-        JSObjectRef object,
-        JSStringRef propertyName,
-        JSValueRef* exception)
+    JSContextRef context,
+    JSObjectRef object,
+    JSStringRef /*propertyName*/,
+    JSValueRef* exception)
 {
     LogDebug("entered");
 
@@ -203,24 +201,23 @@ JSValueRef JSStorageEvent::getNewValue(
 
         DPL::OptionalString newValue = getPrivateObject(object)->getNewValue();
 
-        if(!newValue) {
+        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
+        CATCH_EXCEPTION_SECURITY
 }
 
 JSValueRef JSStorageEvent::getUrl(
-        JSContextRef context,
-        JSObjectRef object,
-        JSStringRef propertyName,
-        JSValueRef* exception)
+    JSContextRef context,
+    JSObjectRef object,
+    JSStringRef /*propertyName*/,
+    JSValueRef* exception)
 {
     LogDebug("entered");
 
@@ -229,17 +226,16 @@ JSValueRef JSStorageEvent::getUrl(
         Converter converter(context);
 
         return converter.toJSValueRef(getPrivateObject(object)->getUrl());
-
     }
     CATCH_EXCEPTION_CONVERSION
-    CATCH_EXCEPTION_NULL_PTR
+        CATCH_EXCEPTION_NULL_PTR
 }
 
 JSValueRef JSStorageEvent::getStorageArea(
-        JSContextRef context,
-        JSObjectRef object,
-        JSStringRef propertyName,
-        JSValueRef* exception)
+    JSContextRef context,
+    JSObjectRef /*object*/,
+    JSStringRef /*propertyName*/,
+    JSValueRef* exception)
 {
     LogDebug("entered");
 
@@ -251,7 +247,7 @@ JSValueRef JSStorageEvent::getStorageArea(
     CATCH_EXCEPTION_CONVERSION
     CATCH_EXCEPTION_NULL_PTR
     CATCH_EXCEPTION_PLATFORM_ERROR
-    CATCH_EXCEPTION_SECURITY
+        CATCH_EXCEPTION_SECURITY
 }
 
 IStorageEventPtr JSStorageEvent::getPrivateObject(JSObjectRef arg)
@@ -272,6 +268,5 @@ IStorageEventPtr JSStorageEvent::getPrivateObject(JSObjectRef arg)
 #undef CATCH_EXCEPTION_NULL_PTR
 #undef CATCH_EXCEPTION_PLATFORM_ERROR
 #undef CATCH_EXCEPTION_SECURITY
-
 }
 }
index 67bde4d..0460f39 100644 (file)
 
 namespace WrtPlugins {
 namespace W3C {
-
 typedef WrtDeviceApis::CommonsJavaScript::PrivateObjectT<
     WrtDeviceApis::StorageEvent::Api::IStorageEventPtr>::Type
-    JSStorageEventPrivateObject;
+JSStorageEventPrivateObject;
 
 class JSStorageEvent
 {
@@ -41,7 +40,7 @@ class JSStorageEvent
     /**
      * This method initializes this in the JS Engine.
      */
-    static const JSClassRef getClassRef();
+    static JSClassRef getClassRef();
 
     /**
      * Gets object's class description.
@@ -53,7 +52,7 @@ class JSStorageEvent
      * The callback invoked when an object is first created.
      */
     static void initialize(JSContextRef context,
-            JSObjectRef object);
+                           JSObjectRef object);
 
     /**
      * The callback invoked when an object is finalized.
@@ -66,7 +65,8 @@ class JSStorageEvent
     static JSStaticValue m_property[];
 
     /**
-     * This structure contains properties and callbacks that define a type of object.
+     * This structure contains properties and callbacks that define a type of
+     * object.
      */
     static JSClassDefinition m_classInfo;
 
@@ -74,33 +74,33 @@ class JSStorageEvent
 
     // getters for properties
     static JSValueRef getKey(
-            JSContextRef context,
-            JSObjectRef object,
-            JSStringRef propertyName,
-            JSValueRef* exception);
+        JSContextRef context,
+        JSObjectRef object,
+        JSStringRef propertyName,
+        JSValueRef* exception);
     static JSValueRef getOldValue(
-            JSContextRef context,
-            JSObjectRef object,
-            JSStringRef propertyName,
-            JSValueRef* exception);
+        JSContextRef context,
+        JSObjectRef object,
+        JSStringRef propertyName,
+        JSValueRef* exception);
     static JSValueRef getNewValue(
-            JSContextRef context,
-            JSObjectRef object,
-            JSStringRef propertyName,
-            JSValueRef* exception);
+        JSContextRef context,
+        JSObjectRef object,
+        JSStringRef propertyName,
+        JSValueRef* exception);
     static JSValueRef getUrl(
-            JSContextRef context,
-            JSObjectRef object,
-            JSStringRef propertyName,
-            JSValueRef* exception);
+        JSContextRef context,
+        JSObjectRef object,
+        JSStringRef propertyName,
+        JSValueRef* exception);
     static JSValueRef getStorageArea(
-            JSContextRef context,
-            JSObjectRef object,
-            JSStringRef propertyName,
-            JSValueRef* exception);
+        JSContextRef context,
+        JSObjectRef object,
+        JSStringRef propertyName,
+        JSValueRef* exception);
 
     static WrtDeviceApis::StorageEvent::Api::IStorageEventPtr
-        getPrivateObject(JSObjectRef arg);
+    getPrivateObject(JSObjectRef arg);
 };
 } // W3C
 } // WrtPlugins
index ac4c5ad..516d189 100644 (file)
@@ -38,31 +38,31 @@ using namespace WrtDeviceApis::TizenServiceEvent::Api;
 #define TIZEN_SERVICE_EVENT_PROPERTY_BUNDLE     "__bundle"
 
 #define CATCH_EXCEPTION_CONVERSION \
-    Catch(Commons::ConversionException) {\
-        LogError("Error on conversion");\
-        return JSDOMExceptionFactory::\
-            UnknownException.make(context, exception);\
+    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);\
+    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);\
+    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);\
+    Catch(Commons::SecurityException){ \
+        LogError("Security exception occured"); \
+        return JSDOMExceptionFactory:: \
+                   SecurityException.make(context, exception); \
     }
 
 namespace WrtPlugins {
@@ -95,7 +95,7 @@ JSStaticValue JSTizenServiceEvent::m_property[] = {
     { 0, 0, 0, 0 }
 };
 
-const JSClassRef JSTizenServiceEvent::getClassRef()
+JSClassRef JSTizenServiceEvent::getClassRef()
 {
     if (!m_jsClassRef) {
         m_jsClassRef = JSClassCreate(&m_classInfo);
@@ -108,15 +108,17 @@ const JSClassDefinition* JSTizenServiceEvent::getClassInfo()
     return &m_classInfo;
 }
 
-JSClassRef JSTizenServiceEvent::m_jsClassRef = JSClassCreate(JSTizenServiceEvent::getClassInfo());
+JSClassRef JSTizenServiceEvent::m_jsClassRef = JSClassCreate(
+        JSTizenServiceEvent::getClassInfo());
 
-void JSTizenServiceEvent::initialize(JSContextRef context,
+void JSTizenServiceEvent::initialize(JSContextRef /*context*/,
                                      JSObjectRef object)
 {
     LogDebug("entered");
 
     JSTizenServiceEventPrivateObject* priv =
-        static_cast<JSTizenServiceEventPrivateObject*>(JSObjectGetPrivate(object));
+        static_cast<JSTizenServiceEventPrivateObject*>(JSObjectGetPrivate(
+                                                           object));
 
     Assert(priv && "Missing private object");
 }
@@ -125,18 +127,18 @@ void JSTizenServiceEvent::finalize(JSObjectRef object)
 {
     LogDebug("entered");
     JSTizenServiceEventPrivateObject* priv =
-        static_cast<JSTizenServiceEventPrivateObject*>(JSObjectGetPrivate(object));
+        static_cast<JSTizenServiceEventPrivateObject*>(JSObjectGetPrivate(
+                                                           object));
 
     delete priv;
     LogDebug("private object is realised");
-
 }
 
 JSValueRef JSTizenServiceEvent::getScale(
-        JSContextRef context,
-        JSObjectRef object,
-        JSStringRef propertyName,
-        JSValueRef* exception)
+    JSContextRef context,
+    JSObjectRef object,
+    JSStringRef /*propertyName*/,
+    JSValueRef* exception)
 {
     LogDebug("entered");
 
@@ -148,14 +150,14 @@ JSValueRef JSTizenServiceEvent::getScale(
     CATCH_EXCEPTION_CONVERSION
     CATCH_EXCEPTION_NULL_PTR
     CATCH_EXCEPTION_PLATFORM_ERROR
-    CATCH_EXCEPTION_SECURITY
+        CATCH_EXCEPTION_SECURITY
 }
 
 JSValueRef JSTizenServiceEvent::getBundle(
-        JSContextRef context,
-        JSObjectRef object,
-        JSStringRef propertyName,
-        JSValueRef* exception)
+    JSContextRef context,
+    JSObjectRef object,
+    JSStringRef /*propertyName*/,
+    JSValueRef* exception)
 {
     LogDebug("entered");
 
@@ -167,7 +169,7 @@ JSValueRef JSTizenServiceEvent::getBundle(
     CATCH_EXCEPTION_CONVERSION
     CATCH_EXCEPTION_NULL_PTR
     CATCH_EXCEPTION_PLATFORM_ERROR
-    CATCH_EXCEPTION_SECURITY
+        CATCH_EXCEPTION_SECURITY
 }
 
 ITizenServiceEventPtr JSTizenServiceEvent::getPrivateObject(JSObjectRef arg)
@@ -188,6 +190,5 @@ ITizenServiceEventPtr JSTizenServiceEvent::getPrivateObject(JSObjectRef arg)
 #undef CATCH_EXCEPTION_NULL_PTR
 #undef CATCH_EXCEPTION_PLATFORM_ERROR
 #undef CATCH_EXCEPTION_SECURITY
-
 }
 }
index cb7fbb3..a079dc5 100644 (file)
 
 namespace WrtPlugins {
 namespace Tizen {
-
 typedef WrtDeviceApis::CommonsJavaScript::PrivateObjectT<
     WrtDeviceApis::TizenServiceEvent::Api::ITizenServiceEventPtr>::Type
-    JSTizenServiceEventPrivateObject;
+JSTizenServiceEventPrivateObject;
 
 class JSTizenServiceEvent
 {
@@ -41,7 +40,7 @@ class JSTizenServiceEvent
     /**
      * This method initializes this in the JS Engine.
      */
-    static const JSClassRef getClassRef();
+    static JSClassRef getClassRef();
 
     /**
      * Gets object's class description.
@@ -53,7 +52,7 @@ class JSTizenServiceEvent
      * The callback invoked when an object is first created.
      */
     static void initialize(JSContextRef context,
-            JSObjectRef object);
+                           JSObjectRef object);
 
     /**
      * The callback invoked when an object is finalized.
@@ -66,7 +65,8 @@ class JSTizenServiceEvent
     static JSStaticValue m_property[];
 
     /**
-     * This structure contains properties and callbacks that define a type of object.
+     * This structure contains properties and callbacks that define a type of
+     * object.
      */
     static JSClassDefinition m_classInfo;
 
@@ -74,19 +74,19 @@ class JSTizenServiceEvent
 
     // getters for properties
     static JSValueRef getScale(
-            JSContextRef context,
-            JSObjectRef object,
-            JSStringRef propertyName,
-            JSValueRef* exception);
+        JSContextRef context,
+        JSObjectRef object,
+        JSStringRef propertyName,
+        JSValueRef* exception);
 
     static JSValueRef getBundle(
-            JSContextRef context,
-            JSObjectRef object,
-            JSStringRef propertyName,
-            JSValueRef* exception);
+        JSContextRef context,
+        JSObjectRef object,
+        JSStringRef propertyName,
+        JSValueRef* exception);
 
     static WrtDeviceApis::TizenServiceEvent::Api::ITizenServiceEventPtr
-        getPrivateObject(JSObjectRef arg);
+    getPrivateObject(JSObjectRef arg);
 };
 } // Tizen
 } // WrtPlugins
index d1be598..dfa55b2 100644 (file)
@@ -39,77 +39,70 @@ const char* JSHOOK_NAME = "jsHook";
 const char* ADD_EVENT_LISTENER_NAME = "addEventListener";
 }
 
-namespace JavaScriptFunctions
-{
+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)
-    };
-
-    class_definition_options_t addEventListenerOptions =
-    {
-        JS_FUNCTION,
-        CREATE_INSTANCE,
-        ALWAYS_NOTICE,
-        OVERLAYED_BEFORE_ORIGINAL,
-        IFrameSupport::RegisterAddEventListener,
-        NULL,
-        reinterpret_cast<js_function_impl>(AddEventListenerSupport::AddEventListener)
-    };
-
-    js_entity_definition_t jsPrint =
-    {
-        JSGLOBAL_OBJECT,
-        JSPRINT_NAME,
-        "",
-        NULL,
-        NULL,
-        &jsPrintfunctionsOptions
-    };
-
-    js_entity_definition_t jsHook =
-    {
-        JSGLOBAL_OBJECT,
-        JSHOOK_NAME,
-        "",
-        NULL,
-        NULL,
-        &jsHookfunctionsOptions
-    };
-
-    js_entity_definition_t addEventListener =
-    {
-        JSGLOBAL_OBJECT,
-        ADD_EVENT_LISTENER_NAME,
-        "",
-        NULL,
-        NULL,
-        &addEventListenerOptions
-    };
-    const js_entity_definition_ptr_t jsPrintPtr = &jsPrint;
-    const js_entity_definition_ptr_t jsHookPtr = &jsHook;
-    const js_entity_definition_ptr_t addEventListenerPtr = &addEventListener;
+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)
+};
+
+class_definition_options_t addEventListenerOptions = {
+    JS_FUNCTION,
+    CREATE_INSTANCE,
+    ALWAYS_NOTICE,
+    OVERLAYED_BEFORE_ORIGINAL,
+    IFrameSupport::RegisterAddEventListener,
+    NULL,
+    reinterpret_cast<js_function_impl>(AddEventListenerSupport::
+                                           AddEventListener)
+};
+
+js_entity_definition_t jsPrint = {
+    JSGLOBAL_OBJECT,
+    JSPRINT_NAME,
+    "",
+    NULL,
+    NULL,
+    &jsPrintfunctionsOptions
+};
+
+js_entity_definition_t jsHook = {
+    JSGLOBAL_OBJECT,
+    JSHOOK_NAME,
+    "",
+    NULL,
+    NULL,
+    &jsHookfunctionsOptions
+};
+
+js_entity_definition_t addEventListener = {
+    JSGLOBAL_OBJECT,
+    ADD_EVENT_LISTENER_NAME,
+    "",
+    NULL,
+    NULL,
+    &addEventListenerOptions
+};
+const js_entity_definition_ptr_t jsPrintPtr = &jsPrint;
+const js_entity_definition_ptr_t jsHookPtr = &jsHook;
+const js_entity_definition_ptr_t addEventListenerPtr = &addEventListener;
 }
 
-
 bool JsFunctionManager::initialize()
 {
     LogInfo("JSObjectDeclaration for js functions are intialized");
index 782fc0e..904d4e1 100644 (file)
 
 namespace WrtPlugins {
 namespace W3C {
-
 IFrameSupport::IFramesContainer IFrameSupport::m_iframesObject =
     IFrameSupport::IFramesContainer();
 
-
-void IFrameSupport::RegisterWidget(java_script_context_t global_context,
+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 );
+    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)
+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 );
+    LogDebug("iframe: " << iframe);
+    LogDebug("object: " << object);
     getIFrameData(static_cast<JSObjectRef>(iframe))->addEventListener
         = static_cast<JSObjectRef>(object);
 }
@@ -59,8 +58,7 @@ JSObjectRef IFrameSupport::getIFrameObjectForWidget(JSObjectRef widgetObject)
 {
     FOREACH(it, m_iframesObject)
     {
-        if(it->second->widget == widgetObject)
-        {
+        if (it->second->widget == widgetObject) {
             LogDebug("iframe found");
             return it->first;
         }
@@ -72,12 +70,11 @@ JSObjectRef IFrameSupport::getIFrameObjectForWidget(JSObjectRef widgetObject)
 IFrameDataPtr IFrameSupport::getIFrameData(JSObjectRef iframe)
 {
     auto it = m_iframesObject.find(iframe);
-    if(it != m_iframesObject.end()){
+    if (it != m_iframesObject.end()) {
         return it->second;
     }
 
     return m_iframesObject[iframe] = IFrameDataPtr(new IFrameData());
 }
-
 }
 }
index 92f58f8..de07932 100644 (file)
@@ -31,7 +31,6 @@
 
 namespace WrtPlugins {
 namespace W3C {
-
 struct IFrameData
 {
     IFrameData() : widget(0), addEventListener(0){}
@@ -41,7 +40,6 @@ struct IFrameData
 };
 typedef std::shared_ptr<IFrameData> IFrameDataPtr;
 
-
 class IFrameSupport
 {
   public:
@@ -64,7 +62,6 @@ class IFrameSupport
   private:
     static IFrameDataPtr getIFrameData(JSObjectRef iframe);
 };
-
 }
 }
 
index c14fe5f..1caf179 100644 (file)
@@ -22,7 +22,6 @@
  * @brief
  */
 
-
 #include <string>
 #include <dpl/log/log.h>
 #include <dpl/foreach.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();
+AddEventListenerSupport::m_listeners =
+    AddEventListenerSupport::IFramesListeners();
 
 JSContextRef AddEventListenerSupport::m_context = NULL;
 
 void AddEventListenerSupport::initialize(JSContextRef context)
 {
-    if(!m_context) m_context = context;
+    if (!m_context) {
+        m_context = context;
+    }
 }
 
 void AddEventListenerSupport::deinitialize()
 {
-    if(!m_context) {
+    if (!m_context) {
         LogDebug("Not yet initialized");
     }
 
@@ -59,18 +59,18 @@ void AddEventListenerSupport::deinitialize()
     m_context = NULL;
 }
 
-bool AddEventListenerSupport::isInitialized() 
+bool AddEventListenerSupport::isInitialized()
 {
-    return m_context!=NULL;
+    return m_context != NULL;
 }
 
 JSValueRef AddEventListenerSupport::
-AddEventListener(JSContextRef context,
-                 JSObjectRef object,
-                 JSObjectRef thisObject,
-                 size_t argumentCount,
-                 const JSValueRef arguments[],
-                 JSValueRef* exception)
+    AddEventListener(JSContextRef context,
+                     JSObjectRef object,
+                     JSObjectRef thisObject,
+                     size_t argumentCount,
+                     const JSValueRef arguments[],
+                     JSValueRef* /*exception*/)
 {
     LogDebug("Add event listener invoked");
     LogDebug("This(iframe?):" << thisObject);
@@ -82,12 +82,13 @@ AddEventListener(JSContextRef context,
     }
 
     std::string eventName = WrtDeviceApis::CommonsJavaScript::
-        Converter(context).toString(arguments[0]);
+            Converter(context).toString(arguments[0]);
     LogDebug("Event name: " << eventName);
 
-    if(eventName != storageEventName &&
-       eventName != appServiceEventName &&
-       eventName != softKeyboardChangeEventName) {
+    if (eventName != storageEventName &&
+        eventName != appServiceEventName &&
+        eventName != softKeyboardChangeEventName)
+    {
         LogDebug("Event type not supported");
         return JSValueMakeUndefined(context);
     }
@@ -97,8 +98,7 @@ AddEventListener(JSContextRef context,
         JSValueToObject(m_context,
                         arguments[1],
                         NULL);
-    if(!JSObjectIsFunction(m_context, objectCb))
-    {
+    if (!JSObjectIsFunction(m_context, objectCb)) {
         LogError("JS object is not a function");
         return JSValueMakeUndefined(context);
     }
@@ -108,7 +108,7 @@ AddEventListener(JSContextRef context,
     data.object = objectCb;
     data.thisObject = thisObject;
 
-    if(eventName == storageEventName) {
+    if (eventName == storageEventName) {
         data.eventType = StorageCustomEvent;
     } else if (eventName == appServiceEventName) {
         data.eventType = ServiceCustomEvent;
@@ -122,7 +122,7 @@ AddEventListener(JSContextRef context,
 }
 
 void AddEventListenerSupport::
-CallStorageListenersFromDifferentIFrames(
+    CallStorageListenersFromDifferentIFrames(
     JSObjectRef iframe,
     const WrtDeviceApis::StorageEvent::Api::IStorageEventPtr& event)
 {
@@ -131,7 +131,7 @@ CallStorageListenersFromDifferentIFrames(
 
     FOREACH(it, m_listeners)
     {
-        if(it->first == iframe){
+        if (it->first == iframe) {
             continue;
         }
 
@@ -141,7 +141,7 @@ CallStorageListenersFromDifferentIFrames(
         JSObjectRef eventObject =
             JSObjectMake(m_context, JSStorageEvent::getClassRef(), eventPriv);
         const size_t argc = 1;
-        JSValueRef argv[argc] = {eventObject};
+        JSValueRef argv[argc] = { eventObject };
 
         JSValueProtect(m_context, eventObject);
 
@@ -150,7 +150,7 @@ CallStorageListenersFromDifferentIFrames(
             LogDebug("Call");
 
             if (listener->eventType ==
-                    StorageCustomEvent)
+                StorageCustomEvent)
             {
                 JSObjectCallAsFunction(
                     m_context,
@@ -166,13 +166,13 @@ CallStorageListenersFromDifferentIFrames(
     }
 
     LogDebug("Done");
-};
+}
 
 void AddEventListenerSupport::
-CallCustomEventListenersFromIFrame(
-        JSObjectRef iframe,
-        CustomEventType eventType,
-        JSObjectRef eventObject)
+    CallCustomEventListenersFromIFrame(
+    JSObjectRef iframe,
+    CustomEventType eventType,
+    JSObjectRef eventObject)
 {
     LogDebug("Invoked callbacks");
 
@@ -183,7 +183,7 @@ CallCustomEventListenersFromIFrame(
     }
 
     const size_t argc = 1;
-    JSValueRef argv[argc] = {eventObject};
+    JSValueRef argv[argc] = { eventObject };
 
     JSValueProtect(m_context, eventObject);
     FOREACH(listener, *it->second)
@@ -201,17 +201,17 @@ CallCustomEventListenersFromIFrame(
     }
     JSValueUnprotect(m_context, eventObject);
     LogDebug("Done");
-};
+}
 
 AddEventListenerSupport::ListenersPtr
-AddEventListenerSupport::getIFrameListeners(JSObjectRef iframe){
+AddEventListenerSupport::getIFrameListeners(JSObjectRef iframe)
+{
     auto it = m_listeners.find(iframe);
-    if(it != m_listeners.end()){
+    if (it != m_listeners.end()) {
         return it->second;
     }
 
     return m_listeners[iframe] = ListenersPtr(new Listeners());
 }
-
 }
 }
index d8ea74a..bfbd0b0 100644 (file)
@@ -35,7 +35,6 @@
 
 namespace WrtPlugins {
 namespace W3C {
-
 class AddEventListenerSupport
 {
   public:
@@ -62,8 +61,8 @@ class AddEventListenerSupport
 
   private:
 
-    struct CallbackData{
-        CustomEventType eventType; 
+    struct CallbackData {
+        CustomEventType eventType;
         JSObjectRef object;
         JSObjectRef thisObject;
     };
@@ -80,7 +79,6 @@ class AddEventListenerSupport
   private:
     static ListenersPtr getIFrameListeners(JSObjectRef iframe);
 };
-
 }
 }
 
index 69b1263..8097d20 100644 (file)
@@ -25,7 +25,6 @@
 #include <js_overlay_functions.h>
 
 namespace JSCFunctions {
-
 std::string ConvertJSStringToStdString(JSStringRef value)
 {
     int nSize = JSStringGetLength(value) + 1;
@@ -60,19 +59,19 @@ JSValueRef JavaScriptPrintProc(JSContextRef context,
 }
 
 JSValueRef JavaScriptHookProc(
-        JSContextRef context,
-        JSObjectRef /*object*/,
-        JSObjectRef /*thisObject*/,
-        size_t argumentCount,
-        const JSValueRef arguments[],
-        JSValueRef* exception)
+    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])) {
-
+        !JSValueIsString(context, arguments[1]))
+    {
         inError = true;
     }
 
index 7dbad59..3c7f86a 100644 (file)
@@ -39,7 +39,7 @@ JSValueRef JavaScriptHookProc(
     JSObjectRef /*thisObject*/,
     size_t argumentCount,
     const JSValueRef arguments[],
-    JSValueRef* exception);
+    JSValueRef * exception);
 }
 
 #endif
index 7e2ca84..9bd809e 100644 (file)
@@ -26,9 +26,7 @@
 
 #include <js_overlay_support.h>
 
-namespace JSOverlaySupport
-{
-
+namespace JSOverlaySupport {
 class JSFunctionDispatcher
 {
   public:
@@ -58,8 +56,6 @@ class JSFunctionDispatcher
                                      JSValueRef* exception);
 };
 
-
-
 JSObjectPtr createWrappedFunction(
     JSGlobalContextRef ctx,
     const JSObjectPtr& originalFunction,
@@ -92,8 +88,6 @@ JSObjectPtr createWrappedFunction(
     return JSObjectPtr(new JSObject(fun));
 }
 
-
-
 JSClassDefinition JSFunctionDispatcher::m_classInfo = {
     0,
     kJSClassAttributeNone,
@@ -120,7 +114,6 @@ JSClassRef JSFunctionDispatcher::getClassRef()
     return classRef;
 }
 
-
 void JSFunctionDispatcher::initialize(JSContextRef /*context*/,
                                       JSObjectRef /*object*/)
 {
@@ -131,9 +124,8 @@ void JSFunctionDispatcher::finalize(JSObjectRef object)
 {
     LogDebug("finalize");
 
-    PrivateData* priv = static_cast<PrivateData*> (JSObjectGetPrivate(object));
-    if(priv)
-    {
+    PrivateData* priv = static_cast<PrivateData*>(JSObjectGetPrivate(object));
+    if (priv) {
         JSValueUnprotect(priv->context,
                          static_cast<JSObjectRef>(
                              priv->overlayFunction->getObject()));
@@ -141,8 +133,6 @@ void JSFunctionDispatcher::finalize(JSObjectRef object)
     }
 }
 
-
-
 JSValueRef JSFunctionDispatcher::callAsFunction(
     JSContextRef context,
     JSObjectRef object,
@@ -157,47 +147,40 @@ JSValueRef JSFunctionDispatcher::callAsFunction(
 
     JSFunctionDispatcher::PrivateData* priv =
         static_cast<JSFunctionDispatcher::PrivateData*>
-            (JSObjectGetPrivate(object));
+        (JSObjectGetPrivate(object));
 
-    if(!priv)
-    {
+    if (!priv) {
         LogError("Private object is NULL");
         return result;
     }
 
     //call overlayed function
-    if (priv->overlayFunction->getObject())
-    {
+    if (priv->overlayFunction->getObject()) {
         LogDebug("Overlayed function will be invoked...");
         result = JSObjectCallAsFunction(
-            context,
-            static_cast<JSObjectRef>(
-                priv->overlayFunction->getObject()),
-            thisObject,
-            argumentCount,
-            arguments,
-            exception);
+                context,
+                static_cast<JSObjectRef>(
+                    priv->overlayFunction->getObject()),
+                thisObject,
+                argumentCount,
+                arguments,
+                exception);
     }
 
     //call original function
-    if (priv->originalFunction->getObject())
-    {
+    if (priv->originalFunction->getObject()) {
         LogDebug("Original function will be invoked..");
         result = JSObjectCallAsFunction(
-            context,
-            static_cast<JSObjectRef>(
-                priv->originalFunction->getObject()),
-            thisObject,
-            argumentCount,
-            arguments,
-            exception);
+                context,
+                static_cast<JSObjectRef>(
+                    priv->originalFunction->getObject()),
+                thisObject,
+                argumentCount,
+                arguments,
+                exception);
     }
 
     LogDebug("Done");
     return result;
 }
-
-
-
-
 }
index 3d7cd04..0cfb19b 100644 (file)
@@ -29,8 +29,7 @@
 #include <JavaScriptCore/JSObjectRef.h>
 #include <Commons/JSObject.h>
 
-namespace JSOverlaySupport
-{
+namespace JSOverlaySupport {
 JSObjectPtr createWrappedFunction(
     JSGlobalContextRef ctx,
     const JSObjectPtr& originalFunction,
index c913f62..e47634f 100644 (file)
@@ -28,7 +28,6 @@
 
 namespace WrtPlugins {
 namespace W3C {
-
 // If needed, enum for new custom event should be defined here
 enum CustomEventType {
     StorageCustomEvent,
@@ -41,15 +40,13 @@ typedef struct SoftKeyboardChangeArgs {
     std::string state; // value is 'on' or 'off'
     int width;
     int height;
-    SoftKeyboardChangeArgs():
+    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_
index 79db286..40874d3 100644 (file)
@@ -32,8 +32,8 @@ class AppLauncherFactory : private DPL::Noncopyable
 {
   private:
     AppLauncherFactory()
-    {
-    }
+    {}
+
   public:
     static AppLauncherFactory& getInstance();
     IAppLauncherManagerPtr     createAppLauncherManagerObject();
index dbd4ef7..e55f865 100644 (file)
@@ -38,6 +38,7 @@ class EventGetDefaultApplication : public WrtPlugins::Platform::IEvent<
     std::string m_applicationFullPath;
     std::string m_applicationName;
     std::string m_mime;
+
   public:
     void         setMime(const std::string &value)
     {
@@ -64,11 +65,9 @@ class EventGetDefaultApplication : public WrtPlugins::Platform::IEvent<
         return m_applicationName;
     }
     virtual void clearOnCancel()
-    {
-    }
+    {}
     EventGetDefaultApplication()
-    {
-    }
+    {}
 };
 
 typedef DPL::SharedPtr<EventGetDefaultApplication>
index 2f2b343..65b89f6 100644 (file)
@@ -42,6 +42,7 @@ class EventGetInstalledApplications : public WrtPlugins::Platform::IEvent<
     std::vector<std::string> m_applicationNames;
     std::map<ApplicationType, std::string> m_applicationTypesPath;
     std::map<ApplicationType, std::string> m_applicationTypesName;
+
   public:
     void addApplicationTypeByName(const std::pair<ApplicationType,
                                                   std::string> &value)
@@ -80,11 +81,9 @@ class EventGetInstalledApplications : public WrtPlugins::Platform::IEvent<
         return m_applicationNames;
     }
     virtual void clearOnCancel()
-    {
-    }
+    {}
     EventGetInstalledApplications()
-    {
-    }
+    {}
 };
 
 typedef DPL::SharedPtr<EventGetInstalledApplications>
index 021ff0b..62a799f 100644 (file)
@@ -38,10 +38,12 @@ class EventLaunchApplication : public WrtPlugins::Platform::IEvent<
 {
     //Uri type. http://, file://, sms:, mailto: etc
     ApplicationUriType m_applicationUriType;
-    // used as param to uriType, for example http address, path to file, phone number, etc
+    // used as param to uriType, for example http address, path to file, phone
+    // number, etc
     std::string m_applicationUriParam;
     //optional parameters for file://
     std::vector<std::string> m_applicationParameters;
+
   public:
     void            addApplicationParameter(const std::string &value)
     {
@@ -68,12 +70,10 @@ class EventLaunchApplication : public WrtPlugins::Platform::IEvent<
         return m_applicationUriParam;
     }
     virtual void    clearOnCancel()
-    {
-    }
+    {}
     EventLaunchApplication() : m_applicationUriType(
             APPLICATION_URI_TYPE_UNDEFINED)
-    {
-    }
+    {}
 };
 
 typedef DPL::SharedPtr<EventLaunchApplication> EventLaunchApplicationPtr;
index 525d749..92324a2 100644 (file)
@@ -32,27 +32,25 @@ IAppLauncherManager::IAppLauncherManager() :
                                                      APPLAUNCHER_THREAD),
     EventRequestReceiverLaunchApplication(Platform::ThreadEnum::
                                               APPLAUNCHER_THREAD)
-{
-}
+{}
 
 IAppLauncherManager::~IAppLauncherManager()
-{
-}
+{}
 
 void IAppLauncherManager::getDefaultApplication(
-        const EventGetDefaultApplicationPtr &event)
+    const EventGetDefaultApplicationPtr &event)
 {
     EventRequestReceiverGetDefaultApplication::PostRequest(event);
 }
 
 void IAppLauncherManager::getInstalledApplications(
-        const EventGetInstalledApplicationsPtr &event)
+    const EventGetInstalledApplicationsPtr &event)
 {
     EventRequestReceiverGetInstalledApplications::PostRequest(event);
 }
 
 void IAppLauncherManager::launchApplication(
-        const EventLaunchApplicationPtr &event)
+    const EventLaunchApplicationPtr &event)
 {
     EventRequestReceiverLaunchApplication::PostRequest(event);
 }
index bb07021..3939e83 100644 (file)
@@ -47,15 +47,16 @@ class IAppLauncherManager : public EventRequestReceiverGetDefaultApplication,
     IAppLauncherManager();
     virtual ~IAppLauncherManager();
     virtual void getDefaultApplication(
-            const EventGetDefaultApplicationPtr &event);
+        const EventGetDefaultApplicationPtr &event);
     virtual void getInstalledApplications(
-            const EventGetInstalledApplicationsPtr &event);
+        const EventGetInstalledApplicationsPtr &event);
     virtual void launchApplication(const EventLaunchApplicationPtr &event);
+
   protected:
     virtual void OnRequestReceived(const EventGetDefaultApplicationPtr &event)
         = 0;
     virtual void OnRequestReceived(
-            const EventGetInstalledApplicationsPtr &event) = 0;
+        const EventGetInstalledApplicationsPtr &event) = 0;
     virtual void OnRequestReceived(const EventLaunchApplicationPtr &event) = 0;
 };
 
index d3af2c3..3bea5a9 100644 (file)
@@ -19,12 +19,10 @@ namespace WrtPlugins {
 namespace Api {
 namespace Device {
 EventClamshellStateChange::EventClamshellStateChange() : m_state(CSS_CLOSE)
-{
-}
+{}
 
 EventClamshellStateChange::~EventClamshellStateChange()
-{
-}
+{}
 
 ClamshellState EventClamshellStateChange::getState() const
 {
index 0413fc0..f58af1d 100644 (file)
@@ -19,8 +19,7 @@ namespace WrtPlugins {
 namespace Api {
 namespace Device {
 IClamshell::~IClamshell()
-{
-}
+{}
 } // Device
 } // Api
 } // WrtPlugins
index 232df18..8abba64 100644 (file)
@@ -38,7 +38,7 @@ class IClamshell : private DPL::Noncopyable
      * @throw PlatformException If error in platform occurs.
      */
     virtual void addOnStateChange(
-            const EventClamshellStateChangeEmitterPtr& emitter) = 0;
+        const EventClamshellStateChangeEmitterPtr& emitter) = 0;
 
     /**
      * Removes on change state emitter.
@@ -47,7 +47,7 @@ class IClamshell : private DPL::Noncopyable
      * @throw PlatformException If error in platform occurs.
      */
     virtual void removeOnStateChange(
-            EventClamshellStateChangeEmitter::IdType id) = 0;
+        EventClamshellStateChangeEmitter::IdType id) = 0;
 };
 } // Device
 } // Api
index 78a6de9..9f3f9a8 100644 (file)
@@ -19,8 +19,7 @@ namespace WrtPlugins {
 namespace Api {
 namespace Device {
 IKeypad::~IKeypad()
-{
-}
+{}
 } // Device
 } // Api
 } // WrtPlugins
index fdb4ac5..86ab212 100644 (file)
@@ -25,8 +25,7 @@ IManager& IManager::getInstance()
 }
 
 IManager::~IManager()
-{
-}
+{}
 } // Device
 } // Api
 } // WrtPlugins
index 6c58e09..fa0fa6f 100644 (file)
@@ -19,12 +19,10 @@ namespace WrtPlugins {
 namespace Api {
 namespace Display {
 EventChangeOrientation::EventChangeOrientation() : m_orientation(O_PORTRAIT)
-{
-}
+{}
 
 EventChangeOrientation::~EventChangeOrientation()
-{
-}
+{}
 
 Orientation EventChangeOrientation::getOrientation() const
 {
index 39060f7..e94bb4b 100644 (file)
@@ -19,12 +19,10 @@ namespace WrtPlugins {
 namespace Api {
 namespace Display {
 EventChangeState::EventChangeState() : m_state(ST_OFF)
-{
-}
+{}
 
 EventChangeState::~EventChangeState()
-{
-}
+{}
 
 State EventChangeState::getState() const
 {
index 5f94d11..2ccbeb4 100644 (file)
@@ -25,8 +25,7 @@ IManager& IManager::getInstance()
 }
 
 IManager::~IManager()
-{
-}
+{}
 } // Display
 } // Api
 } // WrtPlugins
index b9811af..45cfa84 100644 (file)
@@ -42,7 +42,8 @@ class IManager
      * @throw UnsupportedException If current platform doesn't support it.
      * @throw OutOfRangeException If specified screen doesn't exist.
      * @throw PlatformException If error in platform occurs.
-     * @remarks On some platforms passing 0 as screen index may result in returning
+     * @remarks On some platforms passing 0 as screen index may result in
+     * returning
      *          some global screen interface. Other may return default screen.
      * @remarks Ownership is NOT passed to the caller.
      */
index fbc6e59..9fd76af 100644 (file)
@@ -19,8 +19,7 @@ namespace WrtPlugins {
 namespace Api {
 namespace Display {
 IScreen::~IScreen()
-{
-}
+{}
 } // Display
 } // Api
 } // WrtPlugins
index 035ff61..95e5cd5 100644 (file)
@@ -84,7 +84,7 @@ class IScreen : private DPL::Noncopyable
      * @throw PlatformException If error in platform occurs.
      */
     virtual void addOnChangeOrientation(
-            const EventChangeOrientationEmitterPtr& emitter) = 0;
+        const EventChangeOrientationEmitterPtr& emitter) = 0;
 
     /**
      * Removes on change size emitter.
@@ -93,7 +93,7 @@ class IScreen : private DPL::Noncopyable
      * @throw PlatformException If error in platform occurs.
      */
     virtual void removeOnChangeOrientation(
-            EventChangeOrientationEmitter::IdType id) = 0;
+        EventChangeOrientationEmitter::IdType id) = 0;
 
     /**
      * Adds on change state event emitter.
index f1590f3..9b1c931 100644 (file)
@@ -32,8 +32,7 @@ class EventLoadFeature : public WrtPlugins::Platform::IEvent<EventLoadFeature>
         m_success(false),
         m_feature(feature),
         m_object(0)
-    {
-    }
+    {}
 
     ~EventLoadFeature()
     {
@@ -66,8 +65,8 @@ class EventLoadFeature : public WrtPlugins::Platform::IEvent<EventLoadFeature>
     }
 
     virtual void clearOnCancel()
-    {
-    }
+    {}
+
   private:
     bool m_success;
     std::string m_feature;
index 831cfae..485e6e1 100644 (file)
@@ -38,11 +38,9 @@ class FeatureManagerFactory :
 
   private:
     FeatureManagerFactory()
-    {
-    }
+    {}
     ~FeatureManagerFactory()
-    {
-    }
+    {}
 };
 } // namespace Api
 } // namespace WrtPlugins
index 7ab099e..19ac1ef 100644 (file)
@@ -25,12 +25,10 @@ namespace Api {
 IFeatureManager::IFeatureManager() :
     Platform::EventRequestReceiver<EventLoadFeature>(Platform::ThreadEnum::
                                                          BONDI_THREAD)
-{
-}
+{}
 
 IFeatureManager::~IFeatureManager()
-{
-}
+{}
 
 void IFeatureManager::loadFeature(const EventLoadFeaturePtr &event)
 {
index 6a14c6b..471c736 100644 (file)
@@ -33,6 +33,7 @@ class IFeatureManager :
      */
 
     virtual void loadFeature(const EventLoadFeaturePtr &event);
+
   protected:
     virtual void OnRequestReceived(const EventLoadFeaturePtr &event) = 0;
 };
index b5ffc60..b0bacc1 100644 (file)
@@ -53,8 +53,7 @@ class IEventClose : public WrtPlugins::Platform::IEvent<IEventClose>
     }
 
     IEventClose() : m_result(Commons::ExceptionCodes::None)
-    {
-    }
+    {}
 };
 
 typedef DPL::SharedPtr<IEventClose> IEventClosePtr;
index a1a9fce..95f0520 100644 (file)
@@ -34,9 +34,10 @@ class IEventGetGalleries : public WrtPlugins::Platform::IEvent<
 {
     Commons::ExceptionCodes::Enumeration m_result;
     IGallerySetPtr m_galleries;
+
   public:
     void             setResult(
-            const Commons::ExceptionCodes::Enumeration &value)
+        const Commons::ExceptionCodes::Enumeration &value)
     {
         m_result = value;
     }
@@ -55,8 +56,7 @@ class IEventGetGalleries : public WrtPlugins::Platform::IEvent<
 
     IEventGetGalleries() : m_result(Commons::ExceptionCodes::None),
         m_galleries(NULL)
-    {
-    }
+    {}
 };
 
 typedef DPL::SharedPtr<IEventGetGalleries> IEventGetGalleriesPtr;
index 4454bf7..f651078 100644 (file)
@@ -74,8 +74,7 @@ class IEventGetMediaItemById : public WrtPlugins::Platform::IEvent<
 
     IEventGetMediaItemById() : m_result(Commons::ExceptionCodes::None),
         m_id(0)
-    {
-    }
+    {}
 };
 
 typedef DPL::SharedPtr<IEventGetMediaItemById> IEventGetMediaItemByIdPtr;
index b3597dc..4dc5ce0 100644 (file)
@@ -38,7 +38,7 @@ class IEventGetMediaItems : public WrtPlugins::Platform::IEvent<
 
   public:
     void                setResult(
-            const Commons::ExceptionCodes::Enumeration &value)
+        const Commons::ExceptionCodes::Enumeration &value)
     {
         m_result = value;
     }
@@ -64,8 +64,7 @@ class IEventGetMediaItems : public WrtPlugins::Platform::IEvent<
     }
 
     IEventGetMediaItems() : m_result(Commons::ExceptionCodes::None)
-    {
-    }
+    {}
 };
 
 typedef DPL::SharedPtr<IEventGetMediaItems> IEventGetMediaItemsPtr;
index fc02c3a..81c3f28 100644 (file)
@@ -36,7 +36,7 @@ class IEventOpen : public WrtPlugins::Platform::IEvent<IEventOpen>
 
   public:
     void                setResult(
-            const Commons::ExceptionCodes::Enumeration &value)
+        const Commons::ExceptionCodes::Enumeration &value)
     {
         m_result = value;
     }
@@ -54,8 +54,7 @@ class IEventOpen : public WrtPlugins::Platform::IEvent<IEventOpen>
     }
 
     IEventOpen() : m_result(Commons::ExceptionCodes::None)
-    {
-    }
+    {}
 };
 
 typedef DPL::SharedPtr<IEventOpen> IEventOpenPtr;
index 19b66aa..05bf525 100644 (file)
@@ -53,8 +53,7 @@ class IEventRefresh : public WrtPlugins::Platform::IEvent<IEventRefresh>
     }
 
     IEventRefresh() : m_result(Commons::ExceptionCodes::None)
-    {
-    }
+    {}
 };
 
 typedef DPL::SharedPtr<IEventRefresh> IEventRefreshPtr;
index 7db716d..c746dce 100644 (file)
@@ -19,12 +19,10 @@ namespace WrtPlugins {
 namespace Api {
 namespace Gallery {
 IGallery::IGallery()
-{
-}
+{}
 
 IGallery::~IGallery()
-{
-}
+{}
 } // Gallery
 } // Api
 } // WrtPlugins
index e0424dd..60e856a 100644 (file)
@@ -58,7 +58,7 @@ void IGalleryRequestManager::getMediaItems(const IEventGetMediaItemsPtr &event)
 }
 
 void IGalleryRequestManager::getMediaItemById(
-        const IEventGetMediaItemByIdPtr &event)
+    const IEventGetMediaItemByIdPtr &event)
 {
     EventRequestReceiver< IEventGetMediaItemById >::PostRequest(event);
 }
index e7e64f0..a21d52a 100644 (file)
@@ -61,12 +61,10 @@ class IGalleryRequestManager :
         ERRChangeView(Platform::ThreadEnum::GALLERY_THREAD),
         ERRGetMediaItems(Platform::ThreadEnum::GALLERY_THREAD),
         ERRGetMediaItemById(Platform::ThreadEnum::GALLERY_THREAD)
-    {
-    }
+    {}
 
     virtual ~IGalleryRequestManager()
-    {
-    }
+    {}
 
     virtual void getGalleries(const IEventGetGalleriesPtr &event);
     virtual void open(const IEventOpenPtr &event);
@@ -92,8 +90,8 @@ class GalleryFactory : private DPL::Noncopyable
 {
   protected:
     GalleryFactory()
-    {
-    }
+    {}
+
   public:
     static GalleryFactory& getInstance();
     IGalleryRequestManagerPtr getGalleryManager();
index 1dc8e40..7367c1d 100644 (file)
@@ -52,11 +52,9 @@ class IMediaItem
     IMediaItem() : m_id(0),
         m_type(UNDEFINED),
         m_date(0)
-    {
-    }
+    {}
     virtual ~IMediaItem()
-    {
-    }
+    {}
 
     virtual const std::string   &getFileName() const
     {
index 68aca66..3865181 100644 (file)
@@ -63,7 +63,7 @@ void IViewProperties::setMetaTag(const std::string &metaTag)
 }
 
 void IViewProperties::setPrimarySortOrder(
-        IViewProperties::SortOrder primarySortOrder)
+    IViewProperties::SortOrder primarySortOrder)
 {
     if (primarySortOrder < NONE || primarySortOrder > BY_TYPE) {
         Throw(Commons::InvalidArgumentException);
@@ -72,7 +72,7 @@ void IViewProperties::setPrimarySortOrder(
 }
 
 void IViewProperties::setSecondarySortOrder(
-        IViewProperties::SortOrder secondarySortOrder)
+    IViewProperties::SortOrder secondarySortOrder)
 {
     if (secondarySortOrder < NONE || secondarySortOrder > BY_TYPE) {
         Throw(Commons::InvalidArgumentException);
@@ -96,8 +96,7 @@ IViewProperties::IViewProperties() :
     m_secondarySortOrder(NONE),
     m_startDate(0),
     m_endDate(0)
-{
-}
+{}
 } // Gallery
 } // Api
 } // WrtPlugins
index b6ad34d..622d5b5 100644 (file)
@@ -124,8 +124,7 @@ class EventGetCurrentPosition : public WrtPlugins::Platform::IEvent<
     }
 
     EventGetCurrentPosition()
-    {
-    }
+    {}
 };
 
 typedef DPL::SharedPtr<EventGetCurrentPosition> EventGetCurrentPositionPtr;
index d3f1946..77ad5ef 100644 (file)
@@ -46,8 +46,7 @@ class EventPositionChanged : public Platform::ListenerEvent<
     }
 
     EventPositionChanged()
-    {
-    }
+    {}
 };
 
 typedef DPL::SharedPtr<EventPositionChanged> EventPositionChangedPtr;
index 735af94..7f679b8 100644 (file)
@@ -35,8 +35,7 @@ GeolocationFactory& GeolocationFactory::getInstance()
 }
 
 GeolocationFactory::GeolocationFactory()
-{
-}
+{}
 }
 }
 }
index e67d96a..7d1f96d 100644 (file)
@@ -28,12 +28,10 @@ using namespace Platform;
 IGeolocation::IGeolocation() :
     EventRequestReceiver<EventGetCurrentPosition>(ThreadEnum::
                                                       GEOLOCATION_THREAD)
-{
-}
+{}
 
 IGeolocation::~IGeolocation()
-{
-}
+{}
 }
 }
 }
index 4da7a31..67f250e 100644 (file)
@@ -66,9 +66,9 @@ class IGeolocation :
      * @exception Commons::PlatformException when platform error occurs
      */
     virtual long watchPosition(const EventPositionChangedEmitterPtr& emitter,
-            long timeout,
-            long maximumAge,
-            bool highAccuracy) = 0;
+                               long timeout,
+                               long maximumAge,
+                               bool highAccuracy) = 0;
 
     /**
      * Stopping periodic location updates started with watchPosition
@@ -81,7 +81,8 @@ class IGeolocation :
      * Choses location method
      * @param method A location method
      * @exception Commons::PlatformException when platform error occurs
-     * @remarks does nothing when executed with the same method as currently used
+     * @remarks does nothing when executed with the same method as currently
+     * used
      */
     virtual void changeLocationMethod(ApiLocationMethod method) = 0;
 
index 31fe3fe..82e5ce8 100644 (file)
@@ -47,8 +47,7 @@ struct PositionProperties
         speed(0.0),
         direction(0.0),
         altitudeSpeed(0.0)
-    {
-    }
+    {}
 };
 
 typedef DPL::SharedPtr<PositionProperties> PositionPropertiesPtr;
index cd25798..2347b42 100644 (file)
@@ -25,8 +25,7 @@ IManager& IManager::getInstance()
 }
 
 IManager::~IManager()
-{
-}
+{}
 } // Memory
 } // Api
 } // WrtPlugins
index a5e9567..9d939f6 100644 (file)
@@ -19,8 +19,7 @@ namespace WrtPlugins {
 namespace Api {
 namespace System {
 IDate::~IDate()
-{
-}
+{}
 } // System
 } // Api
 } // WrtPlugins
index 2ad4f24..abf2b09 100644 (file)
@@ -25,8 +25,7 @@ IEnvironment& IEnvironment::getInstance()
 }
 
 IEnvironment::~IEnvironment()
-{
-}
+{}
 } // System
 } // Api
 } // WrtPlugins
index 7d70cc2..7a13ec9 100644 (file)
@@ -33,6 +33,7 @@ class IEventClearLog : public WrtPlugins::Platform::IEvent<IEventClearLog>
 {
     bool m_result;
     LogFilterPtr m_filter;
+
   public:
     void            setFilter(LogFilterPtr value)
     {
@@ -51,14 +52,11 @@ class IEventClearLog : public WrtPlugins::Platform::IEvent<IEventClearLog>
         return m_result;
     }
     virtual void    clearOnCancel()
-    {
-    }
+    {}
     IEventClearLog() : m_result(false)
-    {
-    }
+    {}
     ~IEventClearLog()
-    {
-    }
+    {}
 };
 
 typedef DPL::SharedPtr<IEventClearLog> IEventClearLogPtr;
index d9dd2f1..40ffd88 100644 (file)
@@ -34,6 +34,7 @@ class IEventDeleteLogEntry : public WrtPlugins::Platform::IEvent<
 {
     bool m_result;
     LogFilterPtr m_filter;
+
   public:
     void            setFilter(LogFilterPtr value)
     {
@@ -52,14 +53,11 @@ class IEventDeleteLogEntry : public WrtPlugins::Platform::IEvent<
         return m_result;
     }
     virtual void    clearOnCancel()
-    {
-    }
+    {}
     IEventDeleteLogEntry() : m_result(false)
-    {
-    }
+    {}
     ~IEventDeleteLogEntry()
-    {
-    }
+    {}
 };
 
 typedef DPL::SharedPtr<IEventDeleteLogEntry> IEventDeleteLogEntryPtr;
index 9be97ce..c8b8111 100644 (file)
@@ -38,6 +38,7 @@ class IEventFindLogEntries : public WrtPlugins::Platform::IEvent<
     LogFilterPtr m_filter;
     int m_firstCall;
     int m_lastCall;
+
   public:
     void                        setFirstCall(int value)
     {
@@ -80,16 +81,13 @@ class IEventFindLogEntries : public WrtPlugins::Platform::IEvent<
         return m_result;
     }
     virtual void                clearOnCancel()
-    {
-    }
+    {}
     IEventFindLogEntries() : m_result(false),
         m_firstCall(0),
         m_lastCall(-1)
-    {
-    }
+    {}
     ~IEventFindLogEntries()
-    {
-    }
+    {}
 };
 
 typedef DPL::SharedPtr<IEventFindLogEntries> IEventFindLogEntriesPtr;
index 8f6831c..c89b9fc 100644 (file)
@@ -35,6 +35,7 @@ class IEventGetNumberOfLogs : public WrtPlugins::Platform::IEvent<
     bool m_result;
     int m_numberOfLogs;
     LogFilterPtr m_filter;
+
   public:
     void            setFilter(LogFilterPtr value)
     {
@@ -61,15 +62,12 @@ class IEventGetNumberOfLogs : public WrtPlugins::Platform::IEvent<
         return m_result;
     }
     virtual void    clearOnCancel()
-    {
-    }
+    {}
     IEventGetNumberOfLogs() : m_result(false),
         m_numberOfLogs(0)
-    {
-    }
+    {}
     ~IEventGetNumberOfLogs()
-    {
-    }
+    {}
 };
 
 typedef DPL::SharedPtr<IEventGetNumberOfLogs> IEventGetNumberOfLogsPtr;
index ebce9a4..d8a58f3 100644 (file)
@@ -29,12 +29,10 @@ ILogManager::ILogManager() :
     EventRequestReceiverFindLogEntries(Platform::ThreadEnum::TELEPHONY_THREAD),
     EventRequestReceiverDeleteLogEntry(Platform::ThreadEnum::TELEPHONY_THREAD),
     EventRequestReceiverClearLogs(Platform::ThreadEnum::TELEPHONY_THREAD)
-{
-}
+{}
 
 ILogManager::~ILogManager()
-{
-}
+{}
 
 void ILogManager::getNumberOfLogs(const IEventGetNumberOfLogsPtr &event)
 {
index ac0a01e..88c9e78 100644 (file)
@@ -52,9 +52,10 @@ class ILogManager : public EventRequestReceiverGetNumberOfLogs,
     virtual void         findLogEntries(const IEventFindLogEntriesPtr &event);
     virtual void         deleteLogEntry(const IEventDeleteLogEntryPtr &event);
     virtual void         clearLogs(const IEventClearLogPtr &event);
+
   protected:
     virtual void         OnRequestReceived(
-            const IEventGetNumberOfLogsPtr &event) = 0;
+        const IEventGetNumberOfLogsPtr &event) = 0;
     virtual void         OnRequestReceived(const IEventFindLogEntriesPtr &event)
         = 0;
     virtual void         OnRequestReceived(const IEventDeleteLogEntryPtr &event)
index fe62d1f..cc6ecdd 100644 (file)
@@ -29,12 +29,10 @@ LogEntry::LogEntry() :
     m_startTime(0),
     m_duration(0),
     m_folder(LogEntry::INVALID_FOLDER)
-{
-}
+{}
 
 LogEntry::~LogEntry()
-{
-}
+{}
 
 int LogEntry::getId() const
 {
index 6f13cc1..9f6ca15 100644 (file)
@@ -41,7 +41,8 @@ class LogEntry
         MISSED_CALLS_FOLDER,
         INITIATED_CALLS_FOLDER,
         INVALID_FOLDER = 10000,
-        UNDEFINED_FOLDER            /* should be used only to mark a fact filter is not set */
+        UNDEFINED_FOLDER            /* should be used only to mark a fact filter
+                                     *is not set */
     } LogFolder;
 
     LogEntry();
index 954723b..842caef 100644 (file)
@@ -36,12 +36,10 @@ LogFilter::LogFilter() :
     m_durationMax(LOG_FILTER_UNDEFINED_DURATION),
     m_phoneNumberIsSet(false),
     m_descriptionIsSet(false)
-{
-}
+{}
 
 LogFilter::~LogFilter()
-{
-}
+{}
 
 int
 LogFilter::getIdFilter() const
index f3bc338..d859c1e 100644 (file)
@@ -31,8 +31,8 @@ class TelephonyFactory : private DPL::Noncopyable
 {
   private:
     TelephonyFactory()
-    {
-    }
+    {}
+
   public:
     static TelephonyFactory& getInstance();
     ILogManagerPtr           createLogManagerObject();
index 7fe7d22..094bd1d 100644 (file)
@@ -44,15 +44,15 @@ class IPreferences : public Platform::EventRequestReceiver< IEventSetWallpaper >
                                                                        ThreadEnum
                                                                        ::
                                                                        UI_THREAD)
-    {
-    }
+    {}
 
     virtual void OnRequestReceived(
-            const DPL::SharedPtr<IEventSetWallpaper> &event) = 0;
+        const DPL::SharedPtr<IEventSetWallpaper> &event) = 0;
     virtual void OnRequestReceived(
-            const DPL::SharedPtr<IEventSetCallRingtone> &event) = 0;
+        const DPL::SharedPtr<IEventSetCallRingtone> &event) = 0;
     virtual void OnRequestReceived(
-            const DPL::SharedPtr<IEventSetMessageRingtone> &event) = 0;
+        const DPL::SharedPtr<IEventSetMessageRingtone> &event) = 0;
+
   public:
     virtual void setWallpaper(DPL::SharedPtr<IEventSetWallpaper> &event)
     {
@@ -63,14 +63,13 @@ class IPreferences : public Platform::EventRequestReceiver< IEventSetWallpaper >
         PostRequest(event);
     }
     virtual void setMessageRingtone(
-            DPL::SharedPtr<IEventSetMessageRingtone> &event)
+        DPL::SharedPtr<IEventSetMessageRingtone> &event)
     {
         PostRequest(event);
     }
 
     virtual ~IPreferences()
-    {
-    }
+    {}
 };
 //============================================================
 } //namespace
index 99d4d23..f27d406 100644 (file)
@@ -33,12 +33,10 @@ class IEventSetWallpaper : public WrtPlugins::Platform::IEvent<
 {
   public:
     IEventSetWallpaper()
-    {
-    }
+    {}
 
     virtual ~IEventSetWallpaper()
-    {
-    }
+    {}
 };
 typedef DPL::SharedPtr<IEventSetWallpaper> IEventSetWallpaperPtr;
 //=========================================================================
@@ -47,12 +45,10 @@ class IEventSetCallRingtone : public WrtPlugins::Platform::IEvent<
 {
   public:
     IEventSetCallRingtone()
-    {
-    }
+    {}
 
     virtual ~IEventSetCallRingtone()
-    {
-    }
+    {}
 };
 typedef DPL::SharedPtr<IEventSetCallRingtone> IEventSetCallRingtonePtr;
 //=========================================================================
@@ -61,12 +57,10 @@ class IEventSetMessageRingtone : public WrtPlugins::Platform::IEvent<
 {
   public:
     IEventSetMessageRingtone()
-    {
-    }
+    {}
 
     virtual ~IEventSetMessageRingtone()
-    {
-    }
+    {}
 };
 typedef DPL::SharedPtr<IEventSetMessageRingtone> IEventSetMessageRingtonePtr;
 //=========================================================================
index 59d5c8e..1a8dc1f 100644 (file)
@@ -31,8 +31,8 @@ class UIFactory : private DPL::Noncopyable
 {
   private:
     UIFactory()
-    {
-    }
+    {}
+
   public:
     static UIFactory& getInstance();
 };
index 81837fb..81e7d0d 100644 (file)
@@ -22,7 +22,6 @@
 namespace WrtDeviceApis {
 namespace Filesystem {
 namespace Api {
-
 enum LocationType
 {
     LT_APPS,
@@ -46,9 +45,9 @@ enum NodeType
 
 enum AccessMode
 {
-    AM_READ     = 0x0001,
-    AM_WRITE    = 0x0002,
-    AM_APPEND   = 0x0004
+    AM_READ = 0x0001,
+    AM_WRITE = 0x0002,
+    AM_APPEND = 0x0004
 };
 
 /**
@@ -56,38 +55,38 @@ enum AccessMode
  */
 enum AccessType
 {
-    AT_EXISTS   = 0x0000, //!< AT_EXISTS - checks for existence
-    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_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
+    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
+    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
+    OPT_NONE = 0x0000,
+    OPT_OVERWRITE = 0x0001,
+    OPT_RECURSIVE = 0x0002
 };
 
 enum FindFilter
@@ -98,7 +97,6 @@ enum FindFilter
     FF_SIZE
 };
 typedef std::map<FindFilter, std::string> FiltersMap;
-
 } // API
 } // Filesystem
 } // WrtDeviceApis
index c54ade5..cd4efa1 100644 (file)
@@ -19,7 +19,6 @@
 namespace WrtDeviceApis {
 namespace Filesystem {
 namespace Api {
-
 EventCopy::EventCopy(const IPathPtr& src,
                      const IPathPtr& dest) :
     m_src(src),
@@ -59,7 +58,6 @@ void EventCopy::setOptions(int options)
 {
     m_options = options;
 }
-
 } // API
 } // Filesystem
 } // WrtDeviceApis
index a587015..62bef44 100644 (file)
@@ -24,7 +24,6 @@
 namespace WrtDeviceApis {
 namespace Filesystem {
 namespace Api {
-
 class EventCopy : public Commons::IEvent<EventCopy>
 {
   public:
@@ -35,7 +34,7 @@ class EventCopy : public Commons::IEvent<EventCopy>
      * @return New object.
      */
     EventCopy(const IPathPtr& src,
-            const IPathPtr& dest);
+              const IPathPtr& dest);
 
     /**
      * Gets destination path.
@@ -77,11 +76,11 @@ class EventCopy : public Commons::IEvent<EventCopy>
     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.
+    int m_options;    ///< Options for copy action @see
+                      // WrtDeviceApis::Api::Filesystem::Options.
 };
 
 typedef DPL::SharedPtr<EventCopy> EventCopyPtr;
-
 } // API
 } // Filesystem
 } // WrtDeviceApis
index 4e9cf48..c8c01a9 100644 (file)
 namespace WrtDeviceApis {
 namespace Filesystem {
 namespace Api {
-
 EventFind::EventFind(const IPathPtr& path) : m_path(path)
-{
-}
+{}
 
 IPathPtr EventFind::getPath() const
 {
@@ -47,7 +45,7 @@ void EventFind::setResult(const NodeList& nodes)
 }
 
 void EventFind::addFilter(FindFilter name,
-        const std::string& value)
+                          const std::string& value)
 {
     m_filters.insert(std::pair<FindFilter, std::string>(name, value));
 }
@@ -56,7 +54,6 @@ FiltersMap EventFind::getFilters() const
 {
     return m_filters;
 }
-
 } // API
 } // Filesystem
 } // WrtDeviceApis
index 531ff2e..47d6e50 100644 (file)
@@ -26,7 +26,6 @@
 namespace WrtDeviceApis {
 namespace Filesystem {
 namespace Api {
-
 class EventFind : public Commons::IEvent<EventFind>
 {
   public:
@@ -67,7 +66,7 @@ class EventFind : public Commons::IEvent<EventFind>
      * @param value Filter value.
      */
     void addFilter(FindFilter name,
-            const std::string& value);
+                   const std::string& value);
 
     /**
      * Gets all filters.
@@ -82,7 +81,6 @@ class EventFind : public Commons::IEvent<EventFind>
 };
 
 typedef DPL::SharedPtr<EventFind> EventFindPtr;
-
 } // API
 } // Filesystem
 } // WrtDeviceApis
index 6802d4d..3fed54f 100644 (file)
@@ -20,7 +20,6 @@
 namespace WrtDeviceApis {
 namespace Filesystem {
 namespace Api {
-
 EventListNodes::EventListNodes(const INodePtr& node) : m_node(node)
 {
     Assert(m_node && "Node can't be NULL.");
@@ -50,7 +49,6 @@ void EventListNodes::setResult(const NodeList& list)
 {
     m_list = list;
 }
-
 } // API
 } // Filesystem
 } // WrtDeviceApis
index f86165e..a856546 100644 (file)
@@ -24,7 +24,6 @@
 namespace WrtDeviceApis {
 namespace Filesystem {
 namespace Api {
-
 class EventListNodes : public Commons::IEvent<EventListNodes>
 {
   public:
@@ -72,7 +71,6 @@ class EventListNodes : public Commons::IEvent<EventListNodes>
 };
 
 typedef DPL::SharedPtr<EventListNodes> EventListNodesPtr;
-
 } // API
 } // Filesystem
 } // WrtDeviceApis
index 2f4f652..0164856 100644 (file)
@@ -19,7 +19,6 @@
 namespace WrtDeviceApis {
 namespace Filesystem {
 namespace Api {
-
 EventMove::EventMove(const IPathPtr& src,
                      const IPathPtr& dest) :
     m_src(src),
@@ -59,7 +58,6 @@ void EventMove::setOptions(int options)
 {
     m_options = options;
 }
-
 } // API
 } // Filesystem
 } // WrtDeviceApis
index a0e7ba5..d9716f0 100644 (file)
@@ -24,7 +24,6 @@
 namespace WrtDeviceApis {
 namespace Filesystem {
 namespace Api {
-
 class EventMove : public Commons::IEvent<EventMove>
 {
   public:
@@ -35,7 +34,7 @@ class EventMove : public Commons::IEvent<EventMove>
      * @return New object.
      */
     EventMove(const IPathPtr& src,
-            const IPathPtr& dest);
+              const IPathPtr& dest);
 
     /**
      * Gets destination path.
@@ -77,11 +76,11 @@ class EventMove : public Commons::IEvent<EventMove>
     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.
+    int m_options;    ///< Options for copy action @see
+                      // WrtDeviceApis::Api::Filesystem::Options.
 };
 
 typedef DPL::SharedPtr<EventMove> EventMovePtr;
-
 } // API
 } // Filesystem
 } // WrtDeviceApis
index df29464..274e963 100644 (file)
 namespace WrtDeviceApis {
 namespace Filesystem {
 namespace Api {
-
 EventOpen::EventOpen(int mode) : m_mode(mode)
-{
-}
+{}
 
 int EventOpen::getMode() const
 {
@@ -37,7 +35,6 @@ void EventOpen::setResult(const IStreamPtr& stream)
 {
     m_stream = stream;
 }
-
 } // API
 } // Filesystem
 } // WrtDeviceApis
index 9d61ad1..5ab5662 100644 (file)
@@ -23,7 +23,6 @@
 namespace WrtDeviceApis {
 namespace Filesystem {
 namespace Api {
-
 class EventOpen : public Commons::IEvent<EventOpen>
 {
   public:
@@ -58,7 +57,6 @@ class EventOpen : public Commons::IEvent<EventOpen>
 };
 
 typedef DPL::SharedPtr<EventOpen> EventOpenPtr;
-
 } // API
 } // Filesystem
 } // WrtDeviceApis
index fd81957..560687e 100644 (file)
@@ -18,7 +18,6 @@
 namespace WrtDeviceApis {
 namespace Filesystem {
 namespace Api {
-
 std::string EventReadText::getResult() const
 {
     return m_result;
@@ -28,7 +27,6 @@ void EventReadText::setResult(const std::string& result)
 {
     m_result = result;
 }
-
 } // API
 } // Filesystem
 } // WrtDeviceApis
index c61c5c8..986b565 100644 (file)
@@ -24,7 +24,6 @@
 namespace WrtDeviceApis {
 namespace Filesystem {
 namespace Api {
-
 class EventReadText : public Commons::IEvent<EventReadText>
 {
   public:
@@ -45,7 +44,6 @@ class EventReadText : public Commons::IEvent<EventReadText>
 };
 
 typedef DPL::SharedPtr<EventReadText> EventReadTextPtr;
-
 } // API
 } // Filesystem
 } // WrtDeviceApis
index 42352da..6be8f41 100644 (file)
@@ -19,7 +19,6 @@
 namespace WrtDeviceApis {
 namespace Filesystem {
 namespace Api {
-
 EventRemove::EventRemove(const IPathPtr& path) :
     m_path(path),
     m_options(OPT_NONE)
@@ -41,7 +40,6 @@ void EventRemove::setOptions(int options)
 {
     m_options = options;
 }
-
 } // API
 } // Filesystem
 } // WrtDeviceApis
index 51ee50e..be3aecd 100644 (file)
@@ -24,7 +24,6 @@
 namespace WrtDeviceApis {
 namespace Filesystem {
 namespace Api {
-
 class EventRemove : public Commons::IEvent<EventRemove>
 {
   public:
@@ -55,11 +54,11 @@ class EventRemove : public Commons::IEvent<EventRemove>
 
   private:
     IPathPtr m_path; ///< Source path.
-    int m_options;  ///< Options for remove action @see WrtDeviceApis::Api::Filesystem::Options.
+    int m_options;  ///< Options for remove action @see
+                    // WrtDeviceApis::Api::Filesystem::Options.
 };
 
 typedef DPL::SharedPtr<EventRemove> EventRemovePtr;
-
 } // API
 } // Filesystem
 } // WrtDeviceApis
index 61f0971..2473795 100644 (file)
 namespace WrtDeviceApis {
 namespace Filesystem {
 namespace Api {
-
 EventResolve::EventResolve(const IPathPtr& path) : m_path(path)
-{
-}
+{}
 
 IPathPtr EventResolve::getPath() const
 {
@@ -37,7 +35,6 @@ void EventResolve::setResult(const INodePtr& node)
 {
     m_node = node;
 }
-
 } // API
 } // Filesystem
 } // WrtDeviceApis
index 7ceefc0..1d50258 100644 (file)
@@ -24,7 +24,6 @@
 namespace WrtDeviceApis {
 namespace Filesystem {
 namespace Api {
-
 class EventResolve : public Commons::IEvent<EventResolve>
 {
   public:
@@ -60,7 +59,6 @@ class EventResolve : public Commons::IEvent<EventResolve>
 };
 
 typedef DPL::SharedPtr<EventResolve> EventResolvePtr;
-
 } // API
 } // Filesystem
 } // WrtDeviceApis
index 7644767..92219f5 100644 (file)
@@ -20,7 +20,6 @@
 namespace WrtDeviceApis {
 namespace Filesystem {
 namespace Api {
-
 IManager& IManager::getInstance()
 {
     static Manager instance;
@@ -43,13 +42,10 @@ IManager::IManager() :
         Commons::ThreadEnum::FILESYSTEM_THREAD),
     Commons::EventRequestReceiver<EventFind>(
         Commons::ThreadEnum::FILESYSTEM_THREAD)
-{
-}
+{}
 
 IManager::~IManager()
-{
-}
-
+{}
 } // API
 } // Filesystem
 } // WrtDeviceApis
index 0f13dcf..bc3cf0d 100644 (file)
@@ -33,7 +33,6 @@
 namespace WrtDeviceApis {
 namespace Filesystem {
 namespace Api {
-
 typedef std::vector<IPathPtr> LocationPaths;
 typedef std::vector<LocationType> LocationTypes;
 
@@ -58,7 +57,8 @@ class IManager :
 
     /**
      * Gets path for specified location type.
-     * @param type Location type @see WrtDeviceApis::Api::Filesystem::LocationType.
+     * @param type Location type @see
+     * WrtDeviceApis::Api::Filesystem::LocationType.
      * @return Valid path or empty shared pointer.
      */
     virtual IPathPtr getLocationPath(LocationType type) const = 0;
@@ -119,12 +119,14 @@ class IManager :
     /**
      * 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
+     * @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.
+     * @return True if specified node has supplied access rights, false
+     * otherwise.
      */
     virtual bool access(const IPathPtr& path,
-            int accessType) const = 0;
+                        int accessType) const = 0;
 
     virtual void addOpenedNode(const INodePtr& node) = 0;
     virtual void removeOpenedNode(const INodePtr& node) = 0;
@@ -139,7 +141,6 @@ class IManager :
     virtual void OnRequestReceived(const EventRemovePtr& event) = 0;
     virtual void OnRequestReceived(const EventFindPtr& event) = 0;
 }; // IManager
-
 } // API
 } // Filesystem
 } // WrtDeviceApis
index 6294148..cd30a04 100644 (file)
@@ -19,7 +19,6 @@
 namespace WrtDeviceApis {
 namespace Filesystem {
 namespace Api {
-
 INode::INode() :
     Commons::EventRequestReceiver<EventListNodes>(
         Commons::ThreadEnum::FILESYSTEM_THREAD),
@@ -27,13 +26,10 @@ INode::INode() :
         Commons::ThreadEnum::FILESYSTEM_THREAD),
     Commons::EventRequestReceiver<EventReadText>(
         Commons::ThreadEnum::FILESYSTEM_THREAD)
-{
-}
+{}
 
 INode::~INode()
-{
-}
-
+{}
 } // API
 } // Filesystem
 } // WrtDeviceApis
index f9cb8d1..c227aa9 100644 (file)
@@ -34,7 +34,6 @@
 namespace WrtDeviceApis {
 namespace Filesystem {
 namespace Api {
-
 class INode :
     public Commons::EventRequestReceiver<EventListNodes>,
     public Commons::EventRequestReceiver<EventOpen>,
@@ -92,7 +91,7 @@ class INode :
      * @deprecated
      */
     virtual NodeList getChildNodes(const NodeFilterPtr& filter =
-                NodeFilterPtr()) const /* WRT_PLUGINS_DEPRECATED */ = 0;
+                                       NodeFilterPtr()) const /*DEPREC*/ = 0;
 
     /**
      * Gets list of direct descendant nodes.
@@ -135,8 +134,8 @@ class INode :
      * - OPT_RECURSIVE - attempt to create all necessary sub-directories
      */
     virtual INodePtr createChild(const IPathPtr& path,
-            NodeType type,
-            int options = OPT_NONE) = 0;
+                                 NodeType type,
+                                 int options = OPT_NONE) = 0;
 
     /**
      * Gets size of this node.
@@ -179,7 +178,6 @@ class INode :
   protected:
     INode();
 };
-
 } // API
 } // Filesystem
 } // WrtDeviceApis
index abd6b39..c1c49f7 100644 (file)
 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
index 70bebe3..de9b32d 100644 (file)
@@ -19,7 +19,6 @@
 namespace WrtDeviceApis {
 namespace Filesystem {
 namespace Api {
-
 IPathPtr IPath::create(const std::string& str)
 {
     return Path::create(str);
@@ -31,9 +30,7 @@ IPath::SeparatorType IPath::getSeparator()
 }
 
 IPath::~IPath()
-{
-}
-
+{}
 } // API
 } // Filesystem
 } // WrtDeviceApis
index 5c6d2f8..3c32abd 100644 (file)
@@ -21,8 +21,7 @@
 
 namespace WrtDeviceApis {
 namespace Filesystem {
-namespace Api{
-
+namespace Api {
 class IPath;
 typedef DPL::SharedPtr<IPath> IPathPtr;
 
@@ -98,19 +97,19 @@ class IPath
 };
 
 inline const IPathPtr operator+(const IPath& lhs,
-        const IPath& rhs)
+                                const IPath& rhs)
 {
     return IPath::create(lhs.getFullPath())->append(rhs.getFullPath());
 }
 
 inline const IPathPtr operator+(const IPath& lhs,
-        const std::string& rhs)
+                                const std::string& rhs)
 {
     return IPath::create(lhs.getFullPath())->append(rhs);
 }
 
 inline const IPathPtr operator+(const std::string& lhs,
-        const IPath& rhs)
+                                const IPath& rhs)
 {
     return IPath::create(lhs)->append(rhs.getFullPath());
 }
@@ -144,7 +143,6 @@ inline bool operator!=(const std::string& lhs, const IPath& rhs)
 {
     return (lhs != rhs.getFullPath());
 }
-
 } // API
 } // Filesystem
 } // WrtDeviceApis
index 6fb245e..b18f188 100644 (file)
 namespace WrtDeviceApis {
 namespace Filesystem {
 namespace Api {
-
 IStream::~IStream()
-{
-}
-
+{}
 } // API
 } // Filesystem
 } // WrtDeviceApis
index 1e3aa86..d39ddb0 100644 (file)
@@ -24,7 +24,6 @@
 namespace WrtDeviceApis {
 namespace Filesystem {
 namespace Api {
-
 class IStream;
 typedef DPL::SharedPtr<IStream> IStreamPtr;
 
@@ -119,7 +118,6 @@ class IStream : private DPL::Noncopyable
      */
     virtual long getSize() const = 0;
 };
-
 } // API
 } // Filesystem
 } // WrtDeviceApis
index c74e433..b26e275 100644 (file)
@@ -22,7 +22,6 @@
 namespace WrtDeviceApis {
 namespace Filesystem {
 namespace Api {
-
 OptionalString NodeFilter::getName() const
 {
     return m_name;
@@ -107,7 +106,6 @@ void NodeFilter::setSize(const OptionalSize& size)
 {
     m_size.min = m_size.max = size;
 }
-
 } // API
 } // Filesystem
 } // WrtDeviceApis
index ec20781..3c47549 100644 (file)
@@ -30,7 +30,6 @@
 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;
@@ -73,7 +72,6 @@ class NodeFilter
 };
 
 typedef DPL::SharedPtr<NodeFilter> NodeFilterPtr;
-
 } // API
 } // Filesystem
 } // WrtDeviceApis
index cdb0695..e2ac7de 100644 (file)
@@ -24,7 +24,6 @@ namespace WrtDeviceApis {
 namespace Filesystem {
 namespace Api {
 namespace PathUtils {
-
 PathList getParts(const IPathPtr& path)
 {
     PathList result;
@@ -36,7 +35,6 @@ PathList getParts(const IPathPtr& path)
     }
     return result;
 }
-
 } // PathUtils
 } // API
 } // Filesystem
index d5fecfc..40642f3 100644 (file)
@@ -27,7 +27,6 @@ namespace WrtDeviceApis {
 namespace Filesystem {
 namespace Api {
 namespace PathUtils {
-
 typedef std::vector<IPathPtr> PathList;
 typedef PathList::iterator PathListIterator;
 
@@ -38,7 +37,6 @@ typedef PathList::iterator PathListIterator;
  * @return List of paths.
  */
 PathList getParts(const IPathPtr& path);
-
 } // PathUtils
 } // API
 } // Filesystem
index d1a4db7..6ee677e 100644 (file)
@@ -30,7 +30,6 @@
 namespace WrtDeviceApis {
 namespace LocalStorage {
 namespace Api {
-
 class ILocalStorage
 {
   public:
@@ -56,19 +55,21 @@ class ILocalStorage
      *
      */
     virtual DPL::Optional<std::string> getValue(
-            const std::string& key) const = 0;
+        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
+     *                          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
+     *                          false - ommit items which have read only flag
+     * set
      */
     virtual size_t getStorageSize() const = 0;
 
@@ -81,13 +82,10 @@ class ILocalStorage
      * virtual destructor
      */
     virtual ~ILocalStorage()
-    {
-    }
-
+    {}
 };
 
 typedef DPL::SharedPtr<ILocalStorage> ILocalStoragePtr;
-
 } // Api
 } // LocalStorage
 } // WrtDeviceApis
index 7ff636e..7cb7492 100644 (file)
 namespace WrtDeviceApis {
 namespace LocalStorage {
 namespace Api {
-
 ILocalStoragePtr getLocalStorage(int widgetId)
 {
     return ILocalStoragePtr(new WrtDeviceApis::WidgetInterfaceDAO(widgetId));
 }
-
 } // Api
 } // LocalStorage
 } // WrtDeviceApis
index 1accb4f..c892376 100644 (file)
@@ -28,9 +28,7 @@
 namespace WrtDeviceApis {
 namespace LocalStorage {
 namespace Api {
-
 ILocalStoragePtr getLocalStorage(int widgetId);
-
 } // Api
 } // LocalStorage
 } // WrtDeviceApis
index 9a6b248..51a5799 100644 (file)
@@ -17,7 +17,6 @@
 
 namespace WrtDeviceApis {
 namespace Networking {
-namespace Api {
-} // Api
+namespace Api {} // Api
 } // Networking
 } // WrtDeviceApis
index 1cdf747..7be367a 100644 (file)
@@ -17,7 +17,6 @@
 
 namespace WrtDeviceApis {
 namespace Networking {
-namespace Api {
-} // Api
+namespace Api {} // Api
 } // Networking
 } // WrtDeviceApis
index 94ba294..5b94609 100644 (file)
@@ -19,8 +19,7 @@ namespace WrtDeviceApis {
 namespace Networking {
 namespace Api {
 IAdapter::~IAdapter()
-{
-}
+{}
 } // Api
 } // Networking
 } // WrtDeviceApis
index b8dabcb..d8bc537 100644 (file)
@@ -19,8 +19,7 @@ namespace WrtDeviceApis {
 namespace Networking {
 namespace Api {
 IConnection::~IConnection()
-{
-}
+{}
 } // Api
 } // Networking
 } // WrtDeviceApis
index a2438d9..fd3f216 100644 (file)
@@ -25,8 +25,7 @@ IManager& IManager::getInstance()
 }
 
 IManager::~IManager()
-{
-}
+{}
 } // Api
 } // Networking
 } // WrtDeviceApis
index 37848fb..d96652c 100644 (file)
@@ -31,7 +31,6 @@
 namespace WrtDeviceApis {
 namespace PluginManager {
 namespace Api {
-
 class IPluginManager
 {
   public:
@@ -52,7 +51,6 @@ class IPluginManager
 };
 
 typedef DPL::SharedPtr<IPluginManager> IPluginManagerPtr;
-
 }
 }
 }
index 9cd39b8..3866028 100644 (file)
 namespace WrtDeviceApis {
 namespace PluginManager {
 namespace Api {
-
 PluginManagerFactory::PluginManagerFactory()
-{
-}
+{}
 
 PluginManagerFactory& PluginManagerFactory::getInstance()
 {
@@ -38,15 +36,14 @@ PluginManagerFactory& PluginManagerFactory::getInstance()
 }
 
 IPluginManagerPtr PluginManagerFactory::getPluginManager(
-        int widgetHandle,
-        const std::string &objectUri,
-        JSObjectRef object,
-        JSContextRef context) const
+    int widgetHandle,
+    const std::string &objectUri,
+    JSObjectRef object,
+    JSContextRef context) const
 {
     return IPluginManagerPtr(
-        new PluginManager(widgetHandle, objectUri, object, context));
+               new PluginManager(widgetHandle, objectUri, object, context));
 }
-
 }
 }
 }
index ed3c578..b13a36a 100644 (file)
 namespace WrtDeviceApis {
 namespace PluginManager {
 namespace Api {
-
 class PluginManagerFactory : private DPL::Noncopyable
 {
-public:
+  public:
     static PluginManagerFactory& getInstance();
     IPluginManagerPtr getPluginManager(
         int widgetHandle,
         const std::string &objectUri,
         JSObjectRef object,
         JSContextRef context) const;
-private:
+
+  private:
     PluginManagerFactory();
 };
-
 }
 }
 }
index 2bc752b..a001b71 100644 (file)
 namespace WrtDeviceApis {
 namespace SoftKeyboardChangeEvent {
 namespace Api {
-
 class ISoftKeyboardChangeEvent
 {
-  public :
+  public:
     virtual std::string getState() const = 0;
     virtual int getWidth() const = 0;
     virtual int getHeight() const = 0;
 
-    virtual ~ISoftKeyboardChangeEvent() {};
+    virtual ~ISoftKeyboardChangeEvent() {}
 };
 
 typedef std::shared_ptr<ISoftKeyboardChangeEvent> ISoftKeyboardChangeEventPtr;
-
 } // Api
 } // SoftKeyboardChangeEvent
 } // WrtDeviceApis
index 154a014..7cd04ba 100644 (file)
 namespace WrtDeviceApis {
 namespace SoftKeyboardChangeEvent {
 namespace Api {
-
 SoftKeyboardChangeEvent::SoftKeyboardChangeEvent(
-        std::string state, int width, int height):
+    std::string state, int width, int height) :
     m_state(state), m_width(width), m_height(height)
-{
-}
+{}
 
 SoftKeyboardChangeEvent::~SoftKeyboardChangeEvent()
-{
-}
+{}
 
 std::string SoftKeyboardChangeEvent::getState() const
 {
@@ -51,7 +48,6 @@ int SoftKeyboardChangeEvent::getHeight() const
 {
     return m_height;
 }
-
 } // Api
 } // SoftKeyboardChangeEvent
 } // WrtDeviceApis
index ef28353..df8f721 100644 (file)
 namespace WrtDeviceApis {
 namespace SoftKeyboardChangeEvent {
 namespace Api {
-
 class SoftKeyboardChangeEvent : public ISoftKeyboardChangeEvent
 {
-  public :
+  public:
     explicit SoftKeyboardChangeEvent(
-            std::string state,
-            int width,
-            int height);
+        std::string state,
+        int width,
+        int height);
     ~SoftKeyboardChangeEvent();
 
     std::string getState() const;
     int getWidth() const;
     int getHeight() const;
 
-  private :
+  private:
     std::string m_state;
     int m_width;
     int m_height;
 };
-
 } // Api
 } // SoftKeyboardChangeEvent
 } // WrtDeviceApis
index 63be2da..5c34514 100644 (file)
 namespace WrtDeviceApis {
 namespace StorageEvent {
 namespace Api {
-
 class IStorageEvent
 {
-  public :
+  public:
 
     virtual std::string getKey() const = 0;
     virtual DPL::OptionalString getOldValue() const = 0;
@@ -47,11 +46,10 @@ class IStorageEvent
     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;
+        const LocalStorage::Api::ILocalStoragePtr &inStorageArea) = 0;
 };
 
 typedef DPL::SharedPtr<IStorageEvent> IStorageEventPtr;
-
 } // Api
 } // StorageEvent
 } // WrtDeviceApis
index fd0734b..11068b7 100644 (file)
 namespace WrtDeviceApis {
 namespace StorageEvent {
 namespace Api {
-
 StorageEvent::StorageEvent() :
     m_storageArea(NULL) {}
 
 StorageEvent::StorageEvent(
-        const LocalStorage::Api::ILocalStoragePtr &storageArea) :
+    const LocalStorage::Api::ILocalStoragePtr &storageArea) :
     m_storageArea(storageArea) {}
 
 std::string StorageEvent::getKey() const
@@ -79,11 +78,10 @@ void StorageEvent::setUrl(const std::string &inUrl)
 }
 
 void StorageEvent::setStorageArea(
-        const LocalStorage::Api::ILocalStoragePtr &inStorageArea)
+    const LocalStorage::Api::ILocalStoragePtr &inStorageArea)
 {
     m_storageArea = inStorageArea;
 }
-
 } // Api
 } // StorageEvent
 } // WrtDeviceApis
index 661743a..37df421 100644 (file)
 namespace WrtDeviceApis {
 namespace StorageEvent {
 namespace Api {
-
 class StorageEvent : public IStorageEvent
 {
-  public :
+  public:
 
     StorageEvent();
     explicit StorageEvent(
-            const LocalStorage::Api::ILocalStoragePtr &storageArea);
+        const LocalStorage::Api::ILocalStoragePtr &storageArea);
 
     std::string getKey() const;
     DPL::OptionalString getOldValue() const;
@@ -50,16 +49,15 @@ class StorageEvent : public IStorageEvent
     void setNewValue(const std::string &inValue);
     void setUrl(const std::string &inUrl);
     void setStorageArea(
-            const LocalStorage::Api::ILocalStoragePtr &inStorageArea);
+        const LocalStorage::Api::ILocalStoragePtr &inStorageArea);
 
-  private :
+  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
index ab7f185..92b8772 100644 (file)
 namespace WrtDeviceApis {
 namespace StorageEvent {
 namespace Api {
-
 IStorageEventPtr getStorageEvent()
 {
     return IStorageEventPtr(new StorageEvent());
 }
-
 } // Api
 } // StorageEvent
 } // WrtDeviceApis
index ca9e423..b519abd 100644 (file)
@@ -29,9 +29,7 @@
 namespace WrtDeviceApis {
 namespace StorageEvent {
 namespace Api {
-
 IStorageEventPtr getStorageEvent();
-
 } // Api
 } // StorageEvent
 } // WrtDeviceApis
index 6a6831d..8882b69 100644 (file)
 namespace WrtDeviceApis {
 namespace TizenServiceEvent {
 namespace Api {
-
 class ITizenServiceEvent
 {
-  public :
+  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() {};
+    virtual ~ITizenServiceEvent() {}
 };
 
 typedef DPL::SharedPtr<ITizenServiceEvent> ITizenServiceEventPtr;
-
 } // Api
 } // TizenServiceEvent
 } // WrtDeviceApis
index ba07076..b6233c6 100644 (file)
 namespace WrtDeviceApis {
 namespace TizenServiceEvent {
 namespace Api {
-
-TizenServiceEvent::TizenServiceEvent()
-{
-}
+TizenServiceEvent::TizenServiceEvent() :
+        m_scale(0)
+{}
 
 TizenServiceEvent::~TizenServiceEvent()
-{
-}
+{}
 
 float TizenServiceEvent::getScale() const
 {
@@ -54,7 +52,6 @@ void TizenServiceEvent::setBundle(const std::string& bundle)
 {
     m_bundle = bundle;
 }
-
 } // Api
 } // TizenServiceEvent
 } // WrtDeviceApis
index 3bceb3b..3b577f0 100644 (file)
 namespace WrtDeviceApis {
 namespace TizenServiceEvent {
 namespace Api {
-
 class TizenServiceEvent : public ITizenServiceEvent
 {
-  public :
+  public:
 
     TizenServiceEvent();
     ~TizenServiceEvent();
@@ -44,11 +43,10 @@ class TizenServiceEvent : public ITizenServiceEvent
     void setScale(const float scale);
     void setBundle(const std::string &bundle);
 
-  private :
+  private:
     float m_scale;
     std::string m_bundle;
 };
-
 } // Api
 } // TizenServiceEvent
 } // WrtDeviceApis
index 9b2f97d..1936ee9 100644 (file)
 
 #include <dpl/shared_ptr.h>
 
-namespace WrtDeviceApis{
-namespace Widget{
+namespace WrtDeviceApis {
+namespace Widget {
 namespace Api {
-
 class IWidget;
 typedef DPL::SharedPtr<IWidget> IWidgetPtr;
 
@@ -120,10 +119,8 @@ class IWidget
     virtual unsigned int getWidth() const = 0;
 
     virtual ~IWidget()
-    {
-    }
+    {}
 };
-
 }
 }
 }
index b402256..2197a75 100644 (file)
 namespace WrtDeviceApis {
 namespace Widget {
 namespace Api {
-
 IWidgetPtr WidgetFactory::createWidget()
 {
     return IWidgetPtr(new WrtDeviceApis::Widget::Widget());
 }
-
 }
 }
 }
index 9773e78..b068dc2 100644 (file)
@@ -31,7 +31,6 @@
 namespace WrtDeviceApis {
 namespace Widget {
 namespace Api {
-
 class WidgetFactory : private DPL::Noncopyable
 {
   public:
@@ -44,10 +43,8 @@ class WidgetFactory : private DPL::Noncopyable
 
   private:
     WidgetFactory()
-    {
-    }
+    {}
 };
-
 }
 }
 }
index d35fd63..e0c3f9b 100644 (file)
 namespace WrtDeviceApis {
 namespace WidgetDB {
 namespace Api {
-
 class IWidgetDB;
 typedef DPL::SharedPtr<IWidgetDB> IWidgetDBPtr;
 
 typedef std::vector<IWidgetFeaturePtr> Features;
 
-enum class ConfigAttribute {
+enum class ConfigAttribute
+{
     ID,
     VERSION,
     DESCRIPTION,
@@ -62,7 +62,6 @@ enum class InstallationStatus
     STATUS_UNINSTALLED
 };
 
-
 class IWidgetDB
 {
   public:
@@ -76,9 +75,9 @@ class IWidgetDB
     virtual std::string getUserAgent() const = 0;
 
     virtual InstallationStatus checkInstallationStatus(
-            const std::string& gid,
-            const std::string& name,
-            const std::string& version) const = 0;
+        const std::string& gid,
+        const std::string& name,
+        const std::string& version) const = 0;
 
     virtual Features getWidgetFeatures() const = 0;
 
@@ -91,11 +90,8 @@ class IWidgetDB
     virtual std::string getWidgetTemporaryStoragePath() const = 0;
 
     virtual ~IWidgetDB()
-    {
-    }
-
+    {}
 };
-
 } // Api
 } // WidgetDB
 } // WrtDeviceApis
index 7ee91eb..17e635d 100644 (file)
@@ -29,7 +29,6 @@
 namespace WrtDeviceApis {
 namespace WidgetDB {
 namespace Api {
-
 class IWidgetFeature
 {
   public:
@@ -40,8 +39,7 @@ class IWidgetFeature
   public:
 
     virtual ~IWidgetFeature()
-    {
-    }
+    {}
 
     virtual std::string getName() const = 0;
 
@@ -50,13 +48,12 @@ class IWidgetFeature
     virtual Params getParams() const = 0;
 
     virtual void addParam(const std::string& paramName,
-            const std::string& paramValue) = 0;
+                          const std::string& paramValue) = 0;
 
     virtual bool isRequestedByWidget() const = 0;
 };
 
 typedef DPL::SharedPtr<IWidgetFeature> IWidgetFeaturePtr;
-
 } // Api
 } // WidgetDB
 } // WrtDeviceApis
index d8d6ab2..b275f33 100644 (file)
 namespace WrtDeviceApis {
 namespace WidgetDB {
 namespace Api {
-
 IWidgetDBPtr getWidgetDB(int widgetId)
 {
     return IWidgetDBPtr(new WrtDeviceApis::WidgetDB::WidgetDB(widgetId));
 }
-
 } // Api
 } // WidgetDB
 } // WrtDeviceApis
index 78810e5..6de3f99 100644 (file)
@@ -28,9 +28,7 @@
 namespace WrtDeviceApis {
 namespace WidgetDB {
 namespace Api {
-
 IWidgetDBPtr getWidgetDB(int widgetId);
-
 } // Api
 } // WidgetDB
 } // WrtDeviceApis
index f4ec621..b0cfc2d 100644 (file)
@@ -42,7 +42,8 @@ const char* EMAIL_PATTERN = "^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+$";
 const char* HTTP_ADDRESS_PATTERN = "^(http(s)?://)?\\w+.*$";
 const char* FILE_ADDRESS_PATTERN = "^.*\\..*$";
 
-const char* APPLICATION_ALARM = "org.tizen.clock";      // alarm has been included in clock app
+const char* APPLICATION_ALARM = "org.tizen.clock";      // alarm has been
+                                                        // included in clock app
 const char* APPLICATION_BROWSER = "org.tizen.browser";
 const char* APPLICATION_CALCULATOR = "org.tizen.calculator";
 const char* APPLICATION_CALENDAR = "org.tizen.efl-calendar";
@@ -234,7 +235,10 @@ bool AppLauncherManager::initializeApplicationList()
                                         APPLICATION_TYPE_WIDGET_MANAGER,
                                         APPLICATION_EMPTY));
 
-    bool registered_application = false; // A variable that gets set if the current pkg_name is needed by WAC spec, needless of weather the package is visible or not.
+    bool registered_application = false; // A variable that gets set if the
+                                         // current pkg_name is needed by WAC
+                                         // spec, needless of weather the
+                                         // package is visible or not.
     app_info info = {};
     unsigned int count = record_count(COUNT_MENU, &info);
     LogDebug("number of registered applications: " << count);
@@ -254,14 +258,16 @@ bool AppLauncherManager::initializeApplicationList()
             LogDebug("app_name " << infoAll.Get()[i].app_name);
             registered_application = false;
             if (infoAll.Get()[i].app_path == NULL ||
-                infoAll.Get()[i].app_name == NULL) {
+                infoAll.Get()[i].app_name == NULL)
+            {
                 LogDebug("Not Registered.");
                 LogDebug("-----");
                 continue;
             }
             if (0 ==
                 strncmp(APPLICATION_ALARM, infoAll.Get()[i].pkg_name,
-                        NAME_LEN)) {
+                        NAME_LEN))
+            {
                 m_applicationTypesByPath[APPLICATION_TYPE_ALARM] =
                     infoAll.Get()[i].app_path;
                 m_applicationTypesByName[APPLICATION_TYPE_ALARM] =
@@ -270,7 +276,8 @@ bool AppLauncherManager::initializeApplicationList()
             }
             if (0 ==
                 strncmp(APPLICATION_BROWSER, infoAll.Get()[i].pkg_name,
-                        NAME_LEN)) {
+                        NAME_LEN))
+            {
                 m_applicationTypesByPath[APPLICATION_TYPE_BROWSER] =
                     infoAll.Get()[i].app_path;
                 m_applicationTypesByName[APPLICATION_TYPE_BROWSER] =
@@ -279,7 +286,8 @@ bool AppLauncherManager::initializeApplicationList()
             }
             if (0 ==
                 strncmp(APPLICATION_CALCULATOR, infoAll.Get()[i].pkg_name,
-                        NAME_LEN)) {
+                        NAME_LEN))
+            {
                 m_applicationTypesByPath[APPLICATION_TYPE_CALCULATOR] =
                     infoAll.Get()[i].app_path;
                 m_applicationTypesByName[APPLICATION_TYPE_CALCULATOR] =
@@ -288,7 +296,8 @@ bool AppLauncherManager::initializeApplicationList()
             }
             if (0 ==
                 strncmp(APPLICATION_CALENDAR, infoAll.Get()[i].pkg_name,
-                        NAME_LEN)) {
+                        NAME_LEN))
+            {
                 m_applicationTypesByPath[APPLICATION_TYPE_CALENDAR] =
                     infoAll.Get()[i].app_path;
                 m_applicationTypesByName[APPLICATION_TYPE_CALENDAR] =
@@ -297,7 +306,8 @@ bool AppLauncherManager::initializeApplicationList()
             }
             if (0 ==
                 strncmp(APPLICATION_CAMERA, infoAll.Get()[i].pkg_name,
-                        NAME_LEN)) {
+                        NAME_LEN))
+            {
                 m_applicationTypesByPath[APPLICATION_TYPE_CAMERA] =
                     infoAll.Get()[i].app_path;
                 m_applicationTypesByName[APPLICATION_TYPE_CAMERA] =
@@ -306,7 +316,8 @@ bool AppLauncherManager::initializeApplicationList()
             }
             if (0 ==
                 strncmp(APPLICATION_CONTACTS, infoAll.Get()[i].pkg_name,
-                        NAME_LEN)) {
+                        NAME_LEN))
+            {
                 m_applicationTypesByPath[APPLICATION_TYPE_CONTACTS] =
                     infoAll.Get()[i].app_path;
                 m_applicationTypesByName[APPLICATION_TYPE_CONTACTS] =
@@ -315,7 +326,8 @@ bool AppLauncherManager::initializeApplicationList()
             }
             if (0 ==
                 strncmp(APPLICATION_FILES, infoAll.Get()[i].pkg_name,
-                        NAME_LEN)) {
+                        NAME_LEN))
+            {
                 m_applicationTypesByPath[APPLICATION_TYPE_FILES] =
                     infoAll.Get()[i].app_path;
                 m_applicationTypesByName[APPLICATION_TYPE_FILES] =
@@ -324,7 +336,8 @@ bool AppLauncherManager::initializeApplicationList()
             }
             if (0 ==
                 strncmp(APPLICATION_GAMES, infoAll.Get()[i].pkg_name,
-                        NAME_LEN)) {
+                        NAME_LEN))
+            {
                 m_applicationTypesByPath[APPLICATION_TYPE_GAMES] =
                     infoAll.Get()[i].app_path;
                 m_applicationTypesByName[APPLICATION_TYPE_GAMES] =
@@ -333,7 +346,8 @@ bool AppLauncherManager::initializeApplicationList()
             }
             if (0 ==
                 strncmp(APPLICATION_MAIL, infoAll.Get()[i].pkg_name,
-                        NAME_LEN)) {
+                        NAME_LEN))
+            {
                 m_applicationTypesByPath[APPLICATION_TYPE_MAIL] =
                     infoAll.Get()[i].app_path;
                 m_applicationTypesByName[APPLICATION_TYPE_MAIL] =
@@ -342,7 +356,8 @@ bool AppLauncherManager::initializeApplicationList()
             }
             if (0 ==
                 strncmp(APPLICATION_MEDIAPLAYER, infoAll.Get()[i].pkg_name,
-                        NAME_LEN)) {
+                        NAME_LEN))
+            {
                 m_applicationTypesByPath[APPLICATION_TYPE_MEDIAPLAYER] =
                     infoAll.Get()[i].app_path;
                 m_applicationTypesByName[APPLICATION_TYPE_MEDIAPLAYER] =
@@ -351,7 +366,8 @@ bool AppLauncherManager::initializeApplicationList()
             }
             if (0 ==
                 strncmp(APPLICATION_MESSAGING, infoAll.Get()[i].pkg_name,
-                        NAME_LEN)) {
+                        NAME_LEN))
+            {
                 m_applicationTypesByPath[APPLICATION_TYPE_MESSAGING] =
                     infoAll.Get()[i].app_path;
                 m_applicationTypesByName[APPLICATION_TYPE_MESSAGING] =
@@ -360,7 +376,8 @@ bool AppLauncherManager::initializeApplicationList()
             }
             if (0 ==
                 strncmp(APPLICATION_PHONECALL, infoAll.Get()[i].pkg_name,
-                        NAME_LEN)) {
+                        NAME_LEN))
+            {
                 m_applicationTypesByPath[APPLICATION_TYPE_PHONECALL] =
                     infoAll.Get()[i].app_path;
                 m_applicationTypesByName[APPLICATION_TYPE_PHONECALL] =
@@ -369,7 +386,8 @@ bool AppLauncherManager::initializeApplicationList()
             }
             if (0 ==
                 strncmp(APPLICATION_PICTURES, infoAll.Get()[i].pkg_name,
-                        NAME_LEN)) {
+                        NAME_LEN))
+            {
                 m_applicationTypesByPath[APPLICATION_TYPE_PICTURES] =
                     infoAll.Get()[i].app_path;
                 m_applicationTypesByName[APPLICATION_TYPE_PICTURES] =
@@ -378,7 +396,8 @@ bool AppLauncherManager::initializeApplicationList()
             }
             if (0 ==
                 strncmp(APPLICATION_PROG_MANAGER, infoAll.Get()[i].pkg_name,
-                        NAME_LEN)) {
+                        NAME_LEN))
+            {
                 m_applicationTypesByPath[APPLICATION_TYPE_PROG_MANAGER] =
                     infoAll.Get()[i].app_path;
                 m_applicationTypesByName[APPLICATION_TYPE_PROG_MANAGER] =
@@ -387,7 +406,8 @@ bool AppLauncherManager::initializeApplicationList()
             }
             if (0 ==
                 strncmp(APPLICATION_SETTINGS, infoAll.Get()[i].pkg_name,
-                        NAME_LEN)) {
+                        NAME_LEN))
+            {
                 m_applicationTypesByPath[APPLICATION_TYPE_SETTINGS] =
                     infoAll.Get()[i].app_path;
                 m_applicationTypesByName[APPLICATION_TYPE_SETTINGS] =
@@ -396,7 +416,8 @@ bool AppLauncherManager::initializeApplicationList()
             }
             if (0 ==
                 strncmp(APPLICATION_TASKS, infoAll.Get()[i].pkg_name,
-                        NAME_LEN)) {
+                        NAME_LEN))
+            {
                 m_applicationTypesByPath[APPLICATION_TYPE_TASKS] =
                     infoAll.Get()[i].app_path;
                 m_applicationTypesByName[APPLICATION_TYPE_TASKS] =
@@ -405,7 +426,8 @@ bool AppLauncherManager::initializeApplicationList()
             }
             if (0 ==
                 strncmp(APPLICATION_WIDGET_MANAGER, infoAll.Get()[i].pkg_name,
-                        NAME_LEN)) {
+                        NAME_LEN))
+            {
                 m_applicationTypesByPath[APPLICATION_TYPE_WIDGET_MANAGER] =
                     infoAll.Get()[i].app_path;
                 m_applicationTypesByName[APPLICATION_TYPE_WIDGET_MANAGER] =
@@ -413,7 +435,8 @@ bool AppLauncherManager::initializeApplicationList()
                 registered_application = true;
             }
             if (infoAll.Get()[i].visible == 0 && registered_application ==
-                false) {
+                false)
+            {
                 LogDebug("Not Registered.");
                 LogDebug("-----");
                 continue;
@@ -428,13 +451,14 @@ bool AppLauncherManager::initializeApplicationList()
 }
 
 ApplicationType AppLauncherManager::getRegisteredApplicationType(
-        const std::string &name) const
+    const std::string &name) const
 {
     if (!name.empty()) {
         std::map<ApplicationType, std::string>::const_iterator it;
         for (it = m_applicationTypesByPath.begin();
              it != m_applicationTypesByPath.end();
-             ++it) {
+             ++it)
+        {
             if (it->second == name) {
                 return it->first;
             }
@@ -496,16 +520,19 @@ std::string AppLauncherManager::getRealPath(const std::string &path) const
 }
 
 std::string AppLauncherManager::getPathFromApplicationName(
-        const std::string &applicationName) const
+    const std::string &applicationName) const
 {
     if (0 == applicationName.find(WIDGET_URI_PREFIX) && std::string::npos !=
-        applicationName.find("?")) {
+        applicationName.find("?"))
+    {
         //uri format is: widget://{widgetId}?wname={WidgetName}
         LogDebug("found widget:// URI");
         std::string uri = applicationName;
         uri.erase(0, strlen(WIDGET_URI_PREFIX)); //remove widget://part
         std::string widgetId = uri.substr(0, uri.find("?"));
-        uri.erase(0, widgetId.size() + 7); //remove widget id and "?wname=" string, so uri contains only widget name now
+        uri.erase(0, widgetId.size() + 7); //remove widget id and "?wname="
+                                           // string, so uri contains only
+                                           // widget name now
         std::string packageName = APPLICATION_WIDGET + widgetId;
         LogDebug(
             "Widget id: " << widgetId << ", widget name: " << uri <<
@@ -527,7 +554,7 @@ std::string AppLauncherManager::getPathFromApplicationName(
 }
 
 std::string AppLauncherManager::getPathFromPackageName(
-        const std::string &packageName) const
+    const std::string &packageName) const
 {
     app_info info = { 0, };
     strncpy(info.pkg_name, packageName.c_str(), NAME_LEN);
@@ -559,8 +586,8 @@ const
 }
 
 int AppLauncherManager::launchApplicationFileInternal(
-        const std::string &uriParameter,
-        const std::vector<std::string> &applicationParams)
+    const std::string &uriParameter,
+    const std::vector<std::string> &applicationParams)
 {
     LogDebug("entered with uriParameter: '" << uriParameter << "'");
     ApplicationType appType = getRegisteredApplicationType(uriParameter);
@@ -577,7 +604,8 @@ int AppLauncherManager::launchApplicationFileInternal(
         std::vector<std::string>::const_iterator it;
         for (it = applicationParams.begin();
              it != applicationParams.end();
-             ++it) {
+             ++it)
+        {
             std::string param(Commons::String::trim(*it));
             if (param.empty()) {
                 continue;
@@ -588,14 +616,18 @@ int AppLauncherManager::launchApplicationFileInternal(
         if (params.size() > 0) {
             if (appType == APPLICATION_TYPE_PHONECALL) {
                 //phone number is provided.
-                //replace package to make a call, not run application with this functionality
+                //replace package to make a call, not run application with this
+                // functionality
 
                 packageName = APPLICATION_PHONECALL_CALLING;
                 kb = bundle_create();
                 if (!kb) {
                     return ERROR_LAUNCHER_EXECUTION_ERROR;
                 }
-                if (bundle_add(kb, "launch-type", "MO") < 0) { // "MO" : normal call, "EMERGENCY" : emergency call
+                if (bundle_add(kb, "launch-type", "MO") < 0) { // "MO" : normal
+                                                               // call,
+                                                               // "EMERGENCY" :
+                                                               // emergency call
                     bundle_free(kb);
                     return ERROR_LAUNCHER_EXECUTION_ERROR;
                 }
@@ -650,7 +682,8 @@ int AppLauncherManager::launchApplicationFileInternal(
                         }
                         if (bundle_add(kb, "path",
                                        getRealPath(params.front()).c_str()) <
-                            0) {
+                            0)
+                        {
                             bundle_free(kb);
                             return ERROR_LAUNCHER_EXECUTION_ERROR;
                         }
@@ -671,7 +704,8 @@ int AppLauncherManager::launchApplicationFileInternal(
                     return ERROR_LAUNCHER_EXECUTION_ERROR;
                 }
                 if (bundle_add(kb, "Path",
-                               getRealPath(params.front()).c_str()) < 0) {
+                               getRealPath(params.front()).c_str()) < 0)
+                {
                     bundle_free(kb);
                     return ERROR_LAUNCHER_EXECUTION_ERROR;
                 }
@@ -694,9 +728,9 @@ int AppLauncherManager::launchApplicationFileInternal(
 }
 
 int AppLauncherManager::launchApplicationInternal(
-        const ApplicationUriType uriType,
-        const std::string &uriParameter,
-        const std::vector<std::string> &applicationParams)
+    const ApplicationUriType uriType,
+    const std::string &uriParameter,
+    const std::vector<std::string> &applicationParams)
 {
     LogDebug(
         "entered with uriType: " << uriType << ", uriParameter: " <<
@@ -753,7 +787,7 @@ int AppLauncherManager::launchApplicationInternal(
 }
 
 std::string AppLauncherManager::getDefaultApplicationByMimeInternal(
-        const std::string &mime) const
+    const std::string &mime) const
 {
     LogDebug("entered with mime: " << mime);
     const int bufferSize = 1024;
@@ -770,7 +804,7 @@ std::string AppLauncherManager::getDefaultApplicationByMimeInternal(
 }
 
 void AppLauncherManager::OnRequestReceived(
-        const EventGetDefaultApplicationPtr &event)
+    const EventGetDefaultApplicationPtr &event)
 {
     LogDebug("entered");
     Try
@@ -786,36 +820,40 @@ void AppLauncherManager::OnRequestReceived(
 }
 
 void AppLauncherManager::OnRequestReceived(
-        const EventGetInstalledApplicationsPtr &event)
+    const EventGetInstalledApplicationsPtr &event)
 {
     LogDebug("entered");
     std::vector<std::string>::const_iterator it1;
     for (it1 = m_installedApplications.begin();
          it1 != m_installedApplications.end();
-         ++it1) {
+         ++it1)
+    {
         event->addApplicationFullPath(*it1);
     }
     for (it1 = m_installedApplicationsNames.begin();
          it1 != m_installedApplicationsNames.end();
-         ++it1) {
+         ++it1)
+    {
         event->addApplicationName(*it1);
     }
     std::map<ApplicationType, std::string>::const_iterator it2;
     for (it2 = m_applicationTypesByPath.begin();
          it2 != m_applicationTypesByPath.end();
-         ++it2) {
+         ++it2)
+    {
         event->addApplicationTypeByPath(*it2);
     }
     for (it2 = m_applicationTypesByName.begin();
          it2 != m_applicationTypesByName.end();
-         ++it2) {
+         ++it2)
+    {
         event->addApplicationTypeByName(*it2);
     }
     event->setExceptionCode(Commons::ExceptionCodes::None);
 }
 
 void AppLauncherManager::OnRequestReceived(
-        const EventLaunchApplicationPtr &event)
+    const EventLaunchApplicationPtr &event)
 {
     LogDebug("entered");
     ApplicationUriType uriType = event->getApplicationUriType();
@@ -825,7 +863,8 @@ void AppLauncherManager::OnRequestReceived(
     if (result == SUCCESS_LAUNCHER) {
         event->setExceptionCode(Commons::ExceptionCodes::None);
     } else if (result == ERROR_LAUNCHER_INVALID_PARAMETER ||
-               result == ERROR_LAUNCHER_INVALID_URI) {
+               result == ERROR_LAUNCHER_INVALID_URI)
+    {
         event->setExceptionCode(
             Commons::ExceptionCodes::InvalidArgumentException);
     } else {
index d540831..f34fc4a 100644 (file)
@@ -39,16 +39,17 @@ class AppLauncherManager : public Api::AppLauncher::IAppLauncherManager
   public:
     AppLauncherManager();
     virtual ~AppLauncherManager();
+
   protected:
     virtual void OnRequestReceived(
-            const Api::AppLauncher::EventGetDefaultApplicationPtr &event);
+        const Api::AppLauncher::EventGetDefaultApplicationPtr &event);
     virtual void OnRequestReceived(
-            const Api::AppLauncher::EventGetInstalledApplicationsPtr &event);
+        const Api::AppLauncher::EventGetInstalledApplicationsPtr &event);
     virtual void OnRequestReceived(
-            const Api::AppLauncher::EventLaunchApplicationPtr &event);
+        const Api::AppLauncher::EventLaunchApplicationPtr &event);
     virtual bool isRegisteredApplication(const std::string &name) const;
     virtual Api::AppLauncher::ApplicationType getRegisteredApplicationType(
-            const std::string &name) const;
+        const std::string &name) const;
     virtual std::string getRealPath(const std::string &path) const;
     virtual bool validateHttpAddress(const std::string &value) const;
     virtual bool validateEmailAddress(const std::string &value) const;
@@ -63,11 +64,13 @@ class AppLauncherManager : public Api::AppLauncher::IAppLauncherManager
     std::string getDefaultApplicationByMimeInternal(const std::string &mime)
     const;
     int launchApplicationInternal(
-            const Api::AppLauncher::ApplicationUriType uriType,
-            const std::string &uriParameter,
-            const std::vector<std::string> &applicationParams);
-    int launchApplicationFileInternal(const std::string &uriParameter,
-            const std::vector<std::string> &applicationParam);
+        const Api::AppLauncher::ApplicationUriType uriType,
+        const std::string &uriParameter,
+        const std::vector<std::string> &applicationParams);
+    int launchApplicationFileInternal(
+        const std::string &uriParameter,
+        const std::vector<std::string> &
+        applicationParam);
     static std::map<Api::AppLauncher::ApplicationType,
                     std::string> m_applicationTypesByPath;
     static std::map<Api::AppLauncher::ApplicationType,
index 33e4ded..74ccb2e 100644 (file)
 #include <Commons/Exception.h>
 #include <Commons/TypeTraits.h>
 
-
 namespace WrtDeviceApis {
 namespace Camera {
-
 template<typename EventPtr>
 class CameraPrivateData
 {
-public:
+  public:
     Camera* camera;
     EventPtr event;
 };
@@ -48,15 +46,17 @@ enum EventTypeId
 
 class OpaquePrivateData
 {
-public:
+  public:
     EventTypeId eventTypeId;
     void* cameraPrivateData;
 };
 
-
 //GetEventTypeId
 template<typename T>
-EventTypeId getEventTypeId(const T& event){ Assert(0); }
+EventTypeId getEventTypeId(const T& event)
+{
+    Assert(0);
+}
 
 template<>
 EventTypeId getEventTypeId<Api::EventBeginRecordingSharedPtr>(
@@ -99,7 +99,7 @@ OpaquePrivateData* createPrivateOpaqueData(Camera* camera,
 template<typename EventPtr>
 CameraPrivateData<EventPtr>* getPrivateData(void* data)
 {
-    OpaquePrivateData* opaqueData = static_cast<OpaquePrivateData*> (data);
+    OpaquePrivateData* opaqueData = static_cast<OpaquePrivateData*>(data);
 
     CameraPrivateData<EventPtr>* privateData =
         static_cast<CameraPrivateData<EventPtr> *>
@@ -111,7 +111,7 @@ CameraPrivateData<EventPtr>* getPrivateData(void* data)
 template<typename EventPtr>
 void deletePrivateData(void* data)
 {
-    OpaquePrivateData* opaqueData = static_cast<OpaquePrivateData*> (data);
+    OpaquePrivateData* opaqueData = static_cast<OpaquePrivateData*>(data);
 
     CameraPrivateData<EventPtr>* privateData =
         static_cast<CameraPrivateData<EventPtr> *>
@@ -121,18 +121,16 @@ void deletePrivateData(void* data)
     delete opaqueData;
 }
 
-
 template<typename EventType, typename EventArg>
 EventType createEvent(const EventArg& arg1)
 {
     return EventType(arg1);
 }
 
-
 template<typename EventType>
 class BaseCallbackHandler : private DPL::Noncopyable
 {
-public:
+  public:
     explicit BaseCallbackHandler(void* data) :
         m_camera(NULL)
     {
@@ -163,9 +161,9 @@ public:
     virtual ~BaseCallbackHandler(){ }
 
   protected:
-    virtual void setPrivate(void* /*data*/) {};
+    virtual void setPrivate(void* /*data*/) {}
 
-protected:
+  protected:
     Camera* m_camera;
     EventType m_event;
 };
@@ -174,32 +172,33 @@ template<typename EventType>
 class CallbackHandler : public BaseCallbackHandler<EventType>
 {
     static_assert(WrtDeviceApis::Commons::AlwaysFalse<EventType>::value,
-                      "Error, no specialization found for given type");
+                  "Error, no specialization found for given type");
 
   public:
     explicit CallbackHandler(void* data) :
         BaseCallbackHandler<EventType>(data)
-    {
-    }
+    {}
 
     //virtual void post(){ }
 };
 
 template<>
-class CallbackHandler<Api::EventBeginRecordingSharedPtr>
: public BaseCallbackHandler<Api::EventBeginRecordingSharedPtr>
+class CallbackHandler<Api::EventBeginRecordingSharedPtr>:
   public BaseCallbackHandler<Api::EventBeginRecordingSharedPtr>
 {
   public:
     explicit CallbackHandler(void* data) :
         BaseCallbackHandler(data)
     {}
 
-    virtual void post(){
+    virtual void post()
+    {
         this->m_camera->setRecordingState(Camera::COMPLETED);
         this->m_camera->
-            DPL::Event::ControllerEventHandler<JobDoneVideoRecordingEvent>::PostEvent(
-                createEvent<JobDoneVideoRecordingEvent,
-                Api::EventBeginRecordingSharedPtr>(this->m_event));
+            DPL::Event::ControllerEventHandler<JobDoneVideoRecordingEvent>::
+            PostEvent(
+            createEvent<JobDoneVideoRecordingEvent,
+                        Api::EventBeginRecordingSharedPtr>(this->m_event));
     }
 
     virtual void handleSuccessCallback(void* data)
@@ -211,19 +210,21 @@ class CallbackHandler<Api::EventBeginRecordingSharedPtr>
 };
 
 template<>
-class CallbackHandler<Api::EventTakePictureSharedPtr>
: public BaseCallbackHandler<Api::EventTakePictureSharedPtr>
+class CallbackHandler<Api::EventTakePictureSharedPtr>:
   public BaseCallbackHandler<Api::EventTakePictureSharedPtr>
 {
   public:
     explicit CallbackHandler(void* data) :
         BaseCallbackHandler(data)
     {}
 
-    virtual void post(){
+    virtual void post()
+    {
         this->m_camera->
-            DPL::Event::ControllerEventHandler<JobDoneTakePictureEvent>::PostEvent(
-                createEvent<JobDoneTakePictureEvent,
-                Api::EventTakePictureSharedPtr>(this->m_event));
+            DPL::Event::ControllerEventHandler<JobDoneTakePictureEvent>::
+            PostEvent(
+            createEvent<JobDoneTakePictureEvent,
+                        Api::EventTakePictureSharedPtr>(this->m_event));
     }
 
     virtual void setPrivate(void* data)
@@ -233,19 +234,21 @@ class CallbackHandler<Api::EventTakePictureSharedPtr>
 };
 
 template<>
-class CallbackHandler<Api::EventGetPreviewNodeSharedPtr>
: public BaseCallbackHandler<Api::EventGetPreviewNodeSharedPtr>
+class CallbackHandler<Api::EventGetPreviewNodeSharedPtr>:
   public BaseCallbackHandler<Api::EventGetPreviewNodeSharedPtr>
 {
   public:
     explicit CallbackHandler(void* data) :
         BaseCallbackHandler(data)
     {}
 
-    virtual void post(){
+    virtual void post()
+    {
         this->m_camera->
-            DPL::Event::ControllerEventHandler<JobDoneCreatePreviewEvent>::PostEvent(
-                createEvent<JobDoneCreatePreviewEvent,
-                Api::EventGetPreviewNodeSharedPtr>(this->m_event));
+            DPL::Event::ControllerEventHandler<JobDoneCreatePreviewEvent>::
+            PostEvent(
+            createEvent<JobDoneCreatePreviewEvent,
+                        Api::EventGetPreviewNodeSharedPtr>(this->m_event));
     }
 
     virtual void setPrivate(void* data)
@@ -257,7 +260,7 @@ class CallbackHandler<Api::EventGetPreviewNodeSharedPtr>
 
 Camera::Camera(const Commons::IWrtCameraPtr& wrtCamera) :
     m_wrtCamera(wrtCamera),
-    m_stateRecordingVideo (Camera::IDLE)
+    m_stateRecordingVideo(Camera::IDLE)
 {
     CameraJobDoneController::Touch();
 }
@@ -269,9 +272,8 @@ Camera::~Camera()
     CameraJobDoneController::SwitchToThread(NULL);
 }
 
-
 void Camera::OnRequestReceived(
-        const Api::EventTakePictureSharedPtr & event)
+    const Api::EventTakePictureSharedPtr & event)
 {
     LogDebug("enter");
 
@@ -282,13 +284,13 @@ void Camera::OnRequestReceived(
                               camCaptureImageSuccessCallback,
                               camCaptureImageErrorCallback,
                               setPendingOperation,
-                              createPrivateOpaqueData(this,event));
+                              createPrivateOpaqueData(this, event));
 
     LogDebug("leaving");
 }
 
 void Camera::OnRequestReceived(
-        const Api::EventBeginRecordingSharedPtr & event)
+    const Api::EventBeginRecordingSharedPtr & event)
 {
     LogDebug("enter");
 
@@ -306,13 +308,13 @@ void Camera::OnRequestReceived(
                                    camCaptureVideoSuccessCallback,
                                    camCaptureVideoErrorCallback,
                                    setPendingOperation,
-                                   createPrivateOpaqueData(this,event));
+                                   createPrivateOpaqueData(this, event));
 
     LogDebug("leaving");
 }
 
 void Camera::OnRequestReceived(
-        const Api::EventEndRecordingSharedPtr & event)
+    const Api::EventEndRecordingSharedPtr & event)
 {
     LogDebug("end request");
     if (m_stateRecordingVideo == Camera::PROCESSING) {
@@ -324,7 +326,7 @@ void Camera::OnRequestReceived(
 }
 
 void Camera::OnRequestReceived(
-        const Api::EventGetPreviewNodeSharedPtr & event)
+    const Api::EventGetPreviewNodeSharedPtr & event)
 {
     LogDebug("enter");
 
@@ -335,12 +337,12 @@ void Camera::OnRequestReceived(
     m_wrtCamera->createPreviewNode(camPreviewSuccessCallback,
                                    camPreviewErrorCallback,
                                    setPendingOperation,
-                                   createPrivateOpaqueData(this,event));
+                                   createPrivateOpaqueData(this, event));
     LogDebug("leaving");
 }
 
 void Camera::camCaptureImageSuccessCallback(
-        const char* filename, void* data)
+    const char* filename, void* data)
 {
     LogDebug("*Picture* Captured. !!!");
 
@@ -357,7 +359,7 @@ void Camera::camCaptureVideoSuccessCallback(const char* filename, void* data)
 }
 
 void Camera::camPreviewSuccessCallback(
-        Commons::IWrtCamera::CameraPreviewNode node, void* data)
+    Commons::IWrtCamera::CameraPreviewNode node, void* data)
 {
     LogDebug("enter");
 
@@ -411,7 +413,7 @@ void Camera::OnEventReceived(const JobDoneTakePictureEvent &event)
 }
 
 void Camera::OnCancelEvent(
-        const Api::EventBeginRecordingSharedPtr& event)
+    const Api::EventBeginRecordingSharedPtr& event)
 {
     LogDebug(__FUNCTION__);
 
@@ -447,36 +449,34 @@ void Camera::setPendingOperation(
     LogDebug("Set pending operation callback invoked");
 
     Assert(data);
-    OpaquePrivateData* opaqueData = static_cast<OpaquePrivateData*> (data);
+    OpaquePrivateData* opaqueData = static_cast<OpaquePrivateData*>(data);
     Assert(opaqueData->cameraPrivateData);
 
     switch (opaqueData->eventTypeId) {
     case BeginRecordingType:
-        {
-            static_cast<CameraPrivateData<Api::EventBeginRecordingSharedPtr>* > (
-                    opaqueData->cameraPrivateData)
-                ->event->setPendingOperation(pendingOperation);
-            break;
-        }
+    {
+        static_cast<CameraPrivateData<Api::EventBeginRecordingSharedPtr>* >(
+            opaqueData->cameraPrivateData)
+            ->event->setPendingOperation(pendingOperation);
+        break;
+    }
     case CreatePreviewType:
-        {
-            static_cast<CameraPrivateData<Api::EventGetPreviewNodeSharedPtr>* > (
-                    opaqueData->cameraPrivateData)
-                ->event->setPendingOperation(pendingOperation);
-            break;
-        }
+    {
+        static_cast<CameraPrivateData<Api::EventGetPreviewNodeSharedPtr>* >(
+            opaqueData->cameraPrivateData)
+            ->event->setPendingOperation(pendingOperation);
+        break;
+    }
     case TakePictureType:
-        {
-            static_cast<CameraPrivateData<Api::EventGetPreviewNodeSharedPtr>* > (
-                    opaqueData->cameraPrivateData)
-                ->event->setPendingOperation(pendingOperation);
-            break;
-        }
-        default:
-            Assert(0);
+    {
+        static_cast<CameraPrivateData<Api::EventGetPreviewNodeSharedPtr>* >(
+            opaqueData->cameraPrivateData)
+            ->event->setPendingOperation(pendingOperation);
+        break;
+    }
+    default:
+        Assert(0);
     }
 }
-
-
 }
 }
index 27201fe..c1abf01 100644 (file)
@@ -37,9 +37,8 @@
 #include <Commons/Dimension.h>
 #include <Commons/WrtWrapper/IWrtCamera.h>
 
-namespace WrtDeviceApis{
-namespace Camera{
-
+namespace WrtDeviceApis {
+namespace Camera {
 DECLARE_GENERIC_EVENT_1(JobDoneTakePictureEvent,
                         Camera::Api::EventTakePictureSharedPtr)
 DECLARE_GENERIC_EVENT_1(JobDoneVideoRecordingEvent,
@@ -47,25 +46,24 @@ DECLARE_GENERIC_EVENT_1(JobDoneVideoRecordingEvent,
 DECLARE_GENERIC_EVENT_1(JobDoneCreatePreviewEvent,
                         Camera::Api::EventGetPreviewNodeSharedPtr)
 
-
 typedef DPL::TypeListDecl<JobDoneTakePictureEvent,
                           JobDoneVideoRecordingEvent,
                           JobDoneCreatePreviewEvent
-                              >::Type JobDoneEvents;
+                          >::Type JobDoneEvents;
 
 typedef DPL::Event::Controller<JobDoneEvents> CameraJobDoneController;
 
-class Camera: public Api::ICamera,
-              public CameraJobDoneController
+class Camera : public Api::ICamera,
+    public CameraJobDoneController
 {
-public:
-    enum CameraState{
+  public:
+    enum CameraState {
         IDLE,
         PROCESSING,
         COMPLETED
     };
 
-public:
+  public:
     explicit Camera(const Commons::IWrtCameraPtr& wrtCamera);
 
     virtual ~Camera();
@@ -89,13 +87,13 @@ public:
 
     void setRecordingState(CameraState state);
 
-private:
+  private:
     static void camCaptureImageSuccessCallback(const char* filename,
                                                void* data);
     static void camCaptureVideoSuccessCallback(const char* filename,
                                                void* data);
     static void camPreviewSuccessCallback(
-            Commons::IWrtCamera::CameraPreviewNode node, void* data);
+        Commons::IWrtCamera::CameraPreviewNode node, void* data);
 
     static void camCaptureImageErrorCallback(int errorCode, void* data);
     static void camCaptureVideoErrorCallback(int errorCode, void* data);
@@ -105,7 +103,7 @@ private:
     bool checkHighResolutionRequired(const EventType& event) const
     {
         return event->getCaptureOptionsRef()->getImageResolution()
-            == Api::ICaptureOptions::IMAGE_RESOLUTION_HIGH;
+               == Api::ICaptureOptions::IMAGE_RESOLUTION_HIGH;
     }
 
     template<typename EventData>
@@ -129,14 +127,14 @@ private:
     }
 
     static void setPendingOperation(
-        Commons::IWrtCamera::CameraPendingOperation pendingOperation, void* data);
+        Commons::IWrtCamera::CameraPendingOperation pendingOperation,
+        void* data);
 
-private:
+  private:
     Commons::IWrtCameraPtr m_wrtCamera;
 
     CameraState m_stateRecordingVideo;
 };
-
 }
 }
 #endif /* WRTPLUGINSCAMERA_H_ */
index 53d26dd..cc7fa88 100644 (file)
 
 namespace WrtDeviceApis {
 namespace Camera {
-
 void CameraManager::OnRequestReceived(
     const Api::EventGetCamerasPtr &event)
 {
     LogDebug(__FUNCTION__);
-    try
-    {
+    try {
         if (m_cameras.empty()) {
             DPL::Mutex::ScopedLock lock(&m_accessMutex);
 
             if (m_cameras.empty()) {
                 Commons::IWrtCameraManager::WrtCamerasPtr cameras;
                 cameras = event->
-                    getConfiguration()->
+                        getConfiguration()->
                         getWrtWrapper()->
-                            getCameraManagerInterface()->
-                                getCameras();
+                        getCameraManagerInterface()->
+                        getCameras();
 
                 FOREACH(it, *cameras)
                 {
@@ -52,15 +50,12 @@ void CameraManager::OnRequestReceived(
                 }
             }
         }
-        event->setCamerasRef(m_cameras,0);
+        event->setCamerasRef(m_cameras, 0);
         LogDebug("Nr of cameras: " << m_cameras.size());
-    }
-    catch(const Commons::Exception &exc)
-    {
+    } catch (const Commons::Exception &exc) {
         LogError("Exception has occurred: " << std::hex << exc.getCode());
         event->setExceptionCode(exc.getCode());
     }
 }
-
 }
 }
index 6fce3eb..754717a 100644 (file)
 
 namespace WrtDeviceApis {
 namespace Camera {
-
 class CameraManager : public Api::ICameraManager
 {
-protected:
+  protected:
     virtual void OnRequestReceived(
         const Api::EventGetCamerasPtr &event);
 
-private:
+  private:
     DPL::Mutex m_accessMutex;
 };
-
 }
 }
 #endif /* */
index f77c660..3677a1c 100644 (file)
@@ -31,8 +31,7 @@ Manager& Manager::getInstance()
 }
 
 Manager::~Manager()
-{
-}
+{}
 
 bool Manager::hasClamshell() const
 {
@@ -67,8 +66,7 @@ std::string Manager::getImei() const
 }
 
 Manager::Manager() : m_imei(VCONFKEY_TELEPHONY_IMEI)
-{
-}
+{}
 } // Device
 } // Platform
 } // WrtPlugins
index 3bdb2c1..e732980 100644 (file)
@@ -64,8 +64,7 @@ Manager::~Manager()
 }
 
 Manager::Manager()
-{
-}
+{}
 } // Display
 } // Platform
 } // WrtPlugins
index 214bb6f..bc2dc4c 100644 (file)
@@ -96,7 +96,7 @@ Api::Display::State Screen::getState() const
 }
 
 void Screen::addOnChangeOrientation(
-        const Api::Display::EventChangeOrientationEmitterPtr& emitter)
+    const Api::Display::EventChangeOrientationEmitterPtr& emitter)
 {
     m_onChangeOrientation.attach(emitter);
     ChangeOrientationEmitters::LockType lock = m_onChangeOrientation.getLock();
@@ -109,7 +109,7 @@ void Screen::addOnChangeOrientation(
 }
 
 void Screen::removeOnChangeOrientation(
-        Api::Display::EventChangeOrientationEmitter::IdType id)
+    Api::Display::EventChangeOrientationEmitter::IdType id)
 {
     m_onChangeOrientation.detach(id);
     ChangeOrientationEmitters::LockType lock = m_onChangeOrientation.getLock();
@@ -122,7 +122,7 @@ void Screen::removeOnChangeOrientation(
 }
 
 void Screen::addOnChangeState(
-        const Api::Display::EventChangeStateEmitterPtr& emitter)
+    const Api::Display::EventChangeStateEmitterPtr& emitter)
 {
     m_onChangeState.attach(emitter);
     ChangeStateEmitters::LockType lock = m_onChangeState.getLock();
@@ -132,7 +132,7 @@ void Screen::addOnChangeState(
 }
 
 void Screen::removeOnChangeState(
-        Api::Display::EventChangeStateEmitter::IdType id)
+    Api::Display::EventChangeStateEmitter::IdType id)
 {
     m_onChangeState.detach(id);
     ChangeStateEmitters::LockType lock = m_onChangeState.getLock();
@@ -144,12 +144,11 @@ void Screen::removeOnChangeState(
 Screen::Screen(std::size_t index) :
     m_index(index),
     m_powerState(VCONFKEY_PM_STATE)
-{
-}
+{}
 
 bool Screen::getXDpyProperty(const char* pattern,
-        const pcrecpp::Arg& arg1,
-        const pcrecpp::Arg& arg2)
+                             const pcrecpp::Arg& arg1,
+                             const pcrecpp::Arg& arg2)
 {
     FILE* pipe = popen(COMMAND_XDPYINFO, "r");
     if (pipe == NULL) {
@@ -172,7 +171,7 @@ bool Screen::getXDpyProperty(const char* pattern,
 }
 
 void Screen::onChangeState(const VConf::Node* /*node*/,
-        void* data)
+                           void* data)
 {
     Screen* this_ = static_cast<Screen*>(data);
     Api::Display::EventChangeStatePtr event(new Api::Display::EventChangeState());
@@ -186,7 +185,7 @@ void Screen::onChangeState(const VConf::Node* /*node*/,
 }
 
 int Screen::onChangeOrientation(appcore_rm rot,
-        void* data)
+                                void* data)
 {
     Screen* this_ = static_cast<Screen*>(data);
     Api::Display::EventChangeOrientationPtr event(
index 143a66d..c09b772 100644 (file)
@@ -66,19 +66,19 @@ class Screen : public Api::Display::IScreen
      * @see WrtPlugins::Api::Display::IScreen::addOnChangeOrientation()
      */
     void addOnChangeOrientation(
-            const Api::Display::EventChangeOrientationEmitterPtr& emitter);
+        const Api::Display::EventChangeOrientationEmitterPtr& emitter);
 
     /**
      * @see WrtPlugins::Api::Display::IScreen::removeOnChangeOrientation()
      */
     void removeOnChangeOrientation(
-            Api::Display::EventChangeOrientationEmitter::IdType id);
+        Api::Display::EventChangeOrientationEmitter::IdType id);
 
     /**
      * @see WrtPlugins::Api::Display::IScreen::addOnChangeState()
      */
     void addOnChangeState(
-            const Api::Display::EventChangeStateEmitterPtr& emitter);
+        const Api::Display::EventChangeStateEmitterPtr& emitter);
 
     /**
      * @see WrtPlugins::Api::Display::IScreen::removeOnChangeState()
@@ -97,8 +97,8 @@ class Screen : public Api::Display::IScreen
      * @return Zero or positive value on success, -1 on failure.
      */
     static bool getXDpyProperty(const char* pattern,
-            const pcrecpp::Arg& arg1 = pcrecpp::RE::no_arg,
-            const pcrecpp::Arg& arg2 = pcrecpp::RE::no_arg);
+                                const pcrecpp::Arg& arg1 = pcrecpp::RE::no_arg,
+                                const pcrecpp::Arg& arg2 = pcrecpp::RE::no_arg);
 
     /**
      * Callback run when device's power state changes.
@@ -106,7 +106,7 @@ class Screen : public Api::Display::IScreen
      * @param data User data.
      */
     static void onChangeState(const VConf::Node* node,
-            void* data);
+                              void* data);
 
     /**
      * Callback run when device's orientation changes.
@@ -115,14 +115,15 @@ class Screen : public Api::Display::IScreen
      * @return Error code (?) - not specified in documentation.
      */
     static int onChangeOrientation(appcore_rm rot,
-            void* data);
+                                   void* data);
 
   protected:
     explicit Screen(std::size_t index);
 
   protected:
     std::size_t m_index; ///< Index of the screen.
-    ChangeOrientationEmitters m_onChangeOrientation; ///< Change orientation emitters.
+    ChangeOrientationEmitters m_onChangeOrientation; ///< Change orientation
+                                                     // emitters.
     ChangeStateEmitters m_onChangeState; ///< Change state emitters.
     VConf::Key m_powerState; ///< Key for power manager state.
 };
index 35b08ac..484d664 100644 (file)
@@ -26,9 +26,11 @@ using namespace WrtPlugins::Api;
 
 namespace WrtPlugins {
 namespace Platform {
-//static void wrtPlatformCallback(int widgetHandler, JSObjectRef object, void* userParam)
+//static void wrtPlatformCallback(int widgetHandler, JSObjectRef object, void*
+// userParam)
 //{
-//    FeatureManager::platformCallback(widgetHandler, static_cast<void*>(object), userParam);
+//    FeatureManager::platformCallback(widgetHandler,
+// static_cast<void*>(object), userParam);
 //}
 
 void FeatureManager::OnRequestReceived(const Api::EventLoadFeaturePtr &event)
@@ -40,14 +42,16 @@ void FeatureManager::OnRequestReceived(const Api::EventLoadFeaturePtr &event)
         DPL::StaticPointerCast<JSCallbackManager,
                                Platform::IEventPrivateData>(
             event->getPrivateData());
-    /* TODO uncomment - this function _will_ be available in new wrt-engine API */
+    /* TODO uncomment - this function _will_ be available in new wrt-engine API
+    **/
     LogError("*** CRITICAL wrt_dynamic_feature_request is disable!");
-    //    wrt_dynamic_feature_request(jsCallbackManager->getContext(), event->getFeature().c_str(), wrtPlatformCallback, eventWrapper);
+    //    wrt_dynamic_feature_request(jsCallbackManager->getContext(),
+    // event->getFeature().c_str(), wrtPlatformCallback, eventWrapper);
 }
 
 void FeatureManager::platformCallback(int,
-        void* object,
-        void* userParam)
+                                      void* object,
+                                      void* userParam)
 {
     if (object == NULL) {
         LogError("Request has been rejected.");
index ffa419a..3187b55 100644 (file)
@@ -29,29 +29,27 @@ class FeatureManager :
 {
   public:
     FeatureManager()
-    {
-    }
+    {}
     virtual ~FeatureManager()
-    {
-    }
+    {}
     static void platformCallback(int,
-            void* object,
-            void* userParam);
+                                 void* object,
+                                 void* userParam);
+
   protected:
     virtual void OnRequestReceived(const Api::EventLoadFeaturePtr &event);
+
   private:
     struct EventWrapper
     {
         EventWrapper(FeatureManager *featureManager,
-                const Api::EventLoadFeaturePtr &event) :
+                     const Api::EventLoadFeaturePtr &event) :
             m_featureManager(featureManager),
             m_event(event)
-        {
-        }
+        {}
 
         ~EventWrapper()
-        {
-        }
+        {}
 
         FeatureManager *m_featureManager;
         Api::EventLoadFeaturePtr m_event;
index 5132aec..3e4b918 100644 (file)
@@ -68,19 +68,19 @@ map<string, string> &createExtToMimeMap()
 }
 
 bool compareByFilename(const IMediaItemPtr &lpm,
-        const IMediaItemPtr &rpm)
+                       const IMediaItemPtr &rpm)
 {
     return lpm->getFileName().compare(rpm->getFileName()) < 0;
 }
 
 bool compareByFileDate(const IMediaItemPtr &lpm,
-        const IMediaItemPtr &rpm)
+                       const IMediaItemPtr &rpm)
 {
     return lpm->getDate() < rpm->getDate();
 }
 
 bool compareByType(const IMediaItemPtr &lpm,
-        const IMediaItemPtr &rpm)
+                   const IMediaItemPtr &rpm)
 {
     return lpm->getType() < rpm->getType();
 }
@@ -88,10 +88,10 @@ bool compareByType(const IMediaItemPtr &lpm,
 class SearchIdObj
 {
     unsigned long m_id;
+
   public:
     SearchIdObj(unsigned long id) : m_id(id)
-    {
-    }
+    {}
     bool operator ()(const IMediaItemPtr &elem)
     {
         return elem->getId() == m_id;
@@ -163,7 +163,8 @@ void Gallery::searchFiles(const SharedPtr<INode> &node)
     NodeList nodes = node->getChildNodes();
     NodeList::iterator it = nodes.begin(), end = nodes.end();
     while (it != end) {
-        //Warning: '*it' element will be deleted after out of scope (next iteration)
+        //Warning: '*it' element will be deleted after out of scope (next
+        // iteration)
         (*it)->setPermissions(PERM_READ);
         searchFiles(SharedPtr<INode>(*it));
         ++it;
@@ -218,9 +219,11 @@ void Gallery::changeView(const IViewProperties &props)
     //Copy elements within date period to view struct
     for (IMediaItemsSetIterator it = m_mediaItems.begin(),
          end = m_mediaItems.end();
-         it != end; ++it) {
+         it != end; ++it)
+    {
         if ((m_viewProperties.getStartDate() <= (*it)->getDate()) &&
-            ((*it)->getDate() <= m_viewProperties.getEndDate())) {
+            ((*it)->getDate() <= m_viewProperties.getEndDate()))
+        {
             m_view->push_back(*it);
         }
     }
index 122e1db..c1d98e4 100644 (file)
@@ -86,14 +86,12 @@ class Gallery : public Api::Gallery::IGallery
         m_name(name),
         m_opened(false),
         m_lastId(0)
-    {
-    }
+    {}
     /*
      * Destructor of the gallery
      */
     virtual ~Gallery()
-    {
-    }
+    {}
 
     /*
      * Gets number of media items selected by current view
@@ -108,7 +106,8 @@ class Gallery : public Api::Gallery::IGallery
     virtual std::string getName() const;
     /*
      * Opens the gallery
-     * \exception Commons::PlatformWrongStateException when gallery is already open
+     * \exception Commons::PlatformWrongStateException when gallery is already
+     * open
      */
     virtual void open();
     /* Gets the current state of the gallery
index eec5a02..1e5606e 100644 (file)
@@ -30,7 +30,7 @@ using namespace WrtPlugins::Api::Gallery;
 namespace WrtPlugins {
 namespace Platform {
 void GalleryRequestManager::OnRequestReceived(
-        const IEventGetGalleriesPtr &event)
+    const IEventGetGalleriesPtr &event)
 {
     IGallerySetPtr galleries(new IGallerySet());
     galleries->push_back(IGalleryPtr(new Gallery("Device")));
@@ -107,7 +107,7 @@ void GalleryRequestManager::OnRequestReceived(const IEventChangeViewPtr &event)
 }
 
 void GalleryRequestManager::OnRequestReceived(
-        const IEventGetMediaItemsPtr &event)
+    const IEventGetMediaItemsPtr &event)
 {
     Try
     {
@@ -126,7 +126,7 @@ void GalleryRequestManager::OnRequestReceived(
 }
 
 void GalleryRequestManager::OnRequestReceived(
-        const IEventGetMediaItemByIdPtr &event)
+    const IEventGetMediaItemByIdPtr &event)
 {
     Try
     {
index da344b1..204675e 100644 (file)
@@ -32,16 +32,16 @@ class GalleryRequestManager : public Api::Gallery::IGalleryRequestManager
 
   protected:
     virtual void OnRequestReceived(
-            const Api::Gallery::IEventGetGalleriesPtr &event);
+        const Api::Gallery::IEventGetGalleriesPtr &event);
     virtual void OnRequestReceived(const Api::Gallery::IEventOpenPtr &event);
     virtual void OnRequestReceived(const Api::Gallery::IEventRefreshPtr &event);
     virtual void OnRequestReceived(const Api::Gallery::IEventClosePtr &event);
     virtual void OnRequestReceived(
-            const Api::Gallery::IEventChangeViewPtr &event);
+        const Api::Gallery::IEventChangeViewPtr &event);
     virtual void OnRequestReceived(
-            const Api::Gallery::IEventGetMediaItemsPtr &event);
+        const Api::Gallery::IEventGetMediaItemsPtr &event);
     virtual void OnRequestReceived(
-            const Api::Gallery::IEventGetMediaItemByIdPtr &event);
+        const Api::Gallery::IEventGetMediaItemByIdPtr &event);
 };
 }
 }
index 53a94c2..41fb02c 100644 (file)
@@ -30,10 +30,10 @@ namespace Platform {
 namespace Geolocation {
 namespace {
 static void positionChangedCallback(LocationObject *obj,
-        guint type,
-        gpointer data,
-        gpointer accuracy,
-        Geolocation* this_)
+                                    guint type,
+                                    gpointer data,
+                                    gpointer accuracy,
+                                    Geolocation* this_)
 {
     if (this_) {
         this_->positionHasChanged(obj, type, data, accuracy);
@@ -108,9 +108,9 @@ void Geolocation::OnRequestReceived(const EventGetCurrentPositionPtr& event)
 }
 
 long Geolocation::watchPosition(const EventPositionChangedEmitterPtr& emitter,
-        long timeout,
-        long maximumAge,
-        bool highAccuracy)
+                                long timeout,
+                                long maximumAge,
+                                bool highAccuracy)
 {
     initialize();
     m_positionEmitters.attach(emitter);
@@ -123,9 +123,9 @@ void Geolocation::clearWatch(EventPositionChangedEmitter::IdType id)
 }
 
 void Geolocation::positionHasChanged(LocationObject *obj,
-        guint type,
-        gpointer data,
-        gpointer accuracy)
+                                     guint type,
+                                     gpointer data,
+                                     gpointer accuracy)
 {
     LogDebug("Enter");
     if (POSITION_UPDATED != type) {
@@ -208,7 +208,9 @@ void Geolocation::start()
         return;
     }
 
-    m_location = location_new(convertMethodToPlatform(m_currentLocationMethod)); //may return NULL
+    //may return NULL
+    m_location = location_new(convertMethodToPlatform(m_currentLocationMethod));
+
     if (NULL == m_location) {
         ThrowMsg(Commons::PlatformException,
                  "Couldn't create new location object.");
index b13bcc5..ac3b3cd 100644 (file)
@@ -49,22 +49,22 @@ class Geolocation : public Api::Geolocation::IGeolocation
      * @See: IGelocation::getCurrentPosition
      */
     virtual void getCurrentPosition(
-            const Api::Geolocation::EventGetCurrentPositionPtr& event);
+        const Api::Geolocation::EventGetCurrentPositionPtr& event);
 
     /**
      * @See: IGelocation::watchPosition
      */
     virtual long watchPosition(
-            const Api::Geolocation::EventPositionChangedEmitterPtr& emitter,
-            long timeout,
-            long maximumAge,
-            bool highAccuracy);
+        const Api::Geolocation::EventPositionChangedEmitterPtr& emitter,
+        long timeout,
+        long maximumAge,
+        bool highAccuracy);
 
     /**
      * @See: IGelocation::clearWatch
      */
     virtual void clearWatch(
-            Api::Geolocation::EventPositionChangedEmitter::IdType id);
+        Api::Geolocation::EventPositionChangedEmitter::IdType id);
 
     /**
      * @See: IGelocation::changeLocationMethod
@@ -75,14 +75,14 @@ class Geolocation : public Api::Geolocation::IGeolocation
      * Method to run from platform's callback function
      */
     void positionHasChanged(LocationObject *obj,
-            guint type,
-            gpointer data,
-            gpointer accuracy);
+                            guint type,
+                            gpointer data,
+                            gpointer accuracy);
 
   protected:
     Geolocation();
     virtual void OnRequestReceived(
-            const Api::Geolocation::EventGetCurrentPositionPtr& event);
+        const Api::Geolocation::EventGetCurrentPositionPtr& event);
 
   private:
     typedef Emitters<Api::Geolocation::EventPositionChangedEmitter>
index 2bde62d..da505be 100644 (file)
@@ -45,8 +45,7 @@ unsigned long Manager::getFree() const
 }
 
 Manager::Manager()
-{
-}
+{}
 
 unsigned long Manager::getMeminfoValue(const char* pattern) const
 {
@@ -61,7 +60,8 @@ unsigned long Manager::getMeminfoValue(const char* pattern) const
     bool matched = false;
     std::string line;
     while ((std::getline(file, line).rdstate() &
-            (std::ifstream::failbit | std::ifstream::eofbit)) == 0) {
+            (std::ifstream::failbit | std::ifstream::eofbit)) == 0)
+    {
         if (pcrecpp::RE(pattern).FullMatch(line, &result)) {
             matched = true;
             break;
index a40608c..0049155 100644 (file)
@@ -34,12 +34,15 @@ class Manager : public Api::Memory::IManager
     Manager();
 
     /**
-     * Reads value from meminfo file looking it up using specified regex pattern.
+     * Reads value from meminfo file looking it up using specified regex
+     * pattern.
      * Function matches each (whole!) line against specified pattern.
-     * @param pattern Perl-like regular expresion used to search through meminfo.
+     * @param pattern Perl-like regular expresion used to search through
+     * meminfo.
      * @return Found value.
      * @throw PlatformException If could not find meminfo file.
-     * @throw UnsupportedException If pattern didn't match any line in meminfo file.
+     * @throw UnsupportedException If pattern didn't match any line in meminfo
+     * file.
      */
     unsigned long getMeminfoValue(const char* pattern) const;
 };
index b75dfa9..39c80aa 100644 (file)
@@ -93,8 +93,7 @@ std::string Environment::getHardwareName() const
     std::string result;
     char line[LINE_MAX] = { 0 };
     pcrecpp::RE re(PATTERN_CPUINFO_HARDWARE);
-    while (fgets(line, LINE_MAX, file) && !re.FullMatch(line, &result)) {
-    }
+    while (fgets(line, LINE_MAX, file) && !re.FullMatch(line, &result)) {}
     fclose(file);
 
     if (result.empty()) {
@@ -121,8 +120,7 @@ std::string Environment::getVariable(const char* name)
 }
 
 Environment::Environment()
-{
-}
+{}
 } // System
 } // Platform
 } // WrtPlugins
index 7d8bd57..3b4b32f 100644 (file)
@@ -55,12 +55,14 @@ bool LogEntryWrapper::matchFilters(const LogFilterPtr &filter)
     }
     if (filter->getStartTimeIsSet() &&
         (filter->getStartTimeMinFilter() > m_logEntry->getStartTime() ||
-         filter->getStartTimeMaxFilter() < m_logEntry->getStartTime())) {
+         filter->getStartTimeMaxFilter() < m_logEntry->getStartTime()))
+    {
         return false;
     }
     if (filter->getDurationIsSet() &&
         (filter->getDurationMinFilter() > m_logEntry->getDuration() ||
-         filter->getDurationMaxFilter() < m_logEntry->getDuration())) {
+         filter->getDurationMaxFilter() < m_logEntry->getDuration()))
+    {
         return false;
     }
     if (filter->getPhoneNumberIsSet() &&
@@ -76,7 +78,8 @@ bool LogEntryWrapper::matchFilters(const LogFilterPtr &filter)
         return false;
     }
     if (filter->getFolderIsSet() &&
-        !filter->checkIfFolderIsSet(m_logEntry->getFolder())) {
+        !filter->checkIfFolderIsSet(m_logEntry->getFolder()))
+    {
         return false;
     } else if (m_logEntry->getFolder() == LogEntry::INVALID_FOLDER) {
         return false;
index d317034..571e9ab 100644 (file)
@@ -36,6 +36,7 @@ class LogEntryWrapper
     virtual ~LogEntryWrapper();
     bool             matchFilters(const Api::LogFilterPtr &filter);
     Api::LogEntryPtr getAbstractCall() const;
+
   private:
     Api::LogEntryPtr m_logEntry;
     bool             convertPlatformStructToAbstractStruct(CTSvalue *log);
index a14061f..eca34cf 100644 (file)
@@ -150,9 +150,9 @@ int LogManager::getNumberOfLogsInternal(const LogFilterPtr &filter)
 }
 
 std::vector<Api::LogEntryPtr> LogManager::findLogEntriesInternal(
-        const LogFilterPtr &filter,
-        const int minIndex,
-        const int maxIndex)
+    const LogFilterPtr &filter,
+    const int minIndex,
+    const int maxIndex)
 {
     LogDebug("entered");
     std::vector<LogEntryPtr> result;
index c5c53a3..bfb7b22 100644 (file)
@@ -40,24 +40,25 @@ class LogManager : public Api::ILogManager
   public:
     LogManager();
     virtual ~LogManager();
+
   protected:
     virtual void                OnRequestReceived(
-            const Api::IEventGetNumberOfLogsPtr &event);
+        const Api::IEventGetNumberOfLogsPtr &event);
     virtual void                OnRequestReceived(
-            const Api::IEventFindLogEntriesPtr &event);
+        const Api::IEventFindLogEntriesPtr &event);
     virtual void                OnRequestReceived(
-            const Api::IEventDeleteLogEntryPtr &event);
+        const Api::IEventDeleteLogEntryPtr &event);
     virtual void                OnRequestReceived(
-            const Api::IEventClearLogPtr &event);
+        const Api::IEventClearLogPtr &event);
     int                         getNumberOfLogsInternal(
-            const Api::LogFilterPtr &filter);
+        const Api::LogFilterPtr &filter);
     std::vector<Api::LogEntryPtr> findLogEntriesInternal(
-            const Api::LogFilterPtr &filter,
-            const int minIndex = -1,
-            const int maxIndex = -1);
+        const Api::LogFilterPtr &filter,
+        const int minIndex = -1,
+        const int maxIndex = -1);
     void                        deleteLogEntryInternal(int id) const;
     void                        clearLogInternal(
-            const Api::LogFilterPtr &filter);
+        const Api::LogFilterPtr &filter);
     static int m_instanceCount;
     DPL::Mutex m_constructorMutex;
 };
old mode 100755 (executable)
new mode 100644 (file)
index 68d533f..5ecfe2f
@@ -46,7 +46,6 @@ const char* PATH_SDCARD = "/opt/storage/sdcard";
 
 namespace WrtDeviceApis {
 namespace Filesystem {
-
 using namespace Api;
 
 Manager::Locations Manager::m_locations;
@@ -110,8 +109,7 @@ Manager::Manager()
 }
 
 Manager::~Manager()
-{
-}
+{}
 
 IPathPtr Manager::getBasePath() const
 {
@@ -182,74 +180,79 @@ void Manager::find(const EventFindPtr& event)
 }
 
 void Manager::find(const IPathPtr& path,
-        const FiltersMap& filters,
-        NodeList& result,
-        const EventFindPtr& event)
+                   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};
+        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) {
+        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));
+                                         << pth
+                                         << " failed with error: "
+                                         << strerror(error));
             return;
         }
 
         while ((ftsent = fts_read(fts)) != NULL) {
-            if(event && event->checkCancelled()) break;
+            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");
+            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));
+                                           << strerror(error));
             ThrowMsg(Commons::PlatformException,
                      "Could not close platform node.");
         }
     }
-    Catch(Commons::Exception) {
-    }
+    Catch(Commons::Exception) {}
 }
 
 void Manager::copyElement(
-        const std::string &src, const std::string &dest, bool recursive) const
+    const std::string &src, const std::string &dest, bool recursive) const
 {
     LogDebug("Copying src: " << src << " to: " << dest);
 
@@ -288,44 +291,60 @@ void Manager::copyElement(
             free(data);
         }
     }
-
 }
 
 bool Manager::access(const IPathPtr& path,
-        int accessType) const
+                     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; }
+    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)
+                           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; }
+            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; }
+                (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; }
+            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; }
+            if (!ss || (modified != info.st_mtime)) {
+                return false;
+            }
         }
     }
     return true;
@@ -335,8 +354,7 @@ void Manager::OnRequestReceived(const EventResolvePtr& event)
 {
     try {
         event->setResult(Node::resolve(event->getPath()));
-    }
-    catch (const Commons::PlatformException& ex) {
+    } catch (const Commons::PlatformException& ex) {
         LogError("Exception: " << ex.GetMessage());
         event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
     }
@@ -344,8 +362,9 @@ void Manager::OnRequestReceived(const EventResolvePtr& event)
 }
 
 void Manager::checkPaths(
-        Api::IPathPtr &src,
-        Api::IPathPtr &dest) {
+    Api::IPathPtr &src,
+    Api::IPathPtr &dest)
+{
     Assert(dest);
     Assert(src);
     if (!dest->isAbsolute()) {
@@ -373,11 +392,12 @@ void Manager::checkPaths(
 
     if (!access(parent->getPath(), AT_WRITE)) {
         ThrowMsg(Commons::SecurityException,
-            "Not enough permissions to write to destination.");
+                 "Not enough permissions to write to destination.");
     }
 }
 
-bool Manager::pathExists(const std::string &path) {
+bool Manager::pathExists(const std::string &path)
+{
     errno = 0;
     struct stat info;
     memset(&info, 0, sizeof(struct stat));
@@ -395,16 +415,16 @@ void Manager::OnRequestReceived(const EventCopyPtr& event)
         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;
+        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.");
+                     "Not enough permissions to copy source node.");
         }
 
         IPathPtr src = event->getSource();
@@ -446,12 +466,10 @@ void Manager::OnRequestReceived(const EventCopyPtr& event)
         copyElement(realSrc, realDest);
 
         event->setResult(Node::resolve(dest));
-    }
-    catch (const Commons::PlatformException& ex) {
+    } catch (const Commons::PlatformException& ex) {
         LogError("Exception: " << ex.GetMessage());
         event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
-    }
-    catch (const Commons::SecurityException& ex) {
+    } catch (const Commons::SecurityException& ex) {
         LogError("Exception: " << ex.GetMessage());
         event->setExceptionCode(Commons::ExceptionCodes::SecurityException);
     }
@@ -468,7 +486,7 @@ void Manager::OnRequestReceived(const EventMovePtr& event)
         INodePtr srcNode = Node::resolve(src);
         if (!access(srcNode->getParent()->getPath(), AT_WRITE)) {
             ThrowMsg(Commons::SecurityException,
-                "Not enough permissions to move source node.");
+                     "Not enough permissions to move source node.");
         }
 
         checkPaths(src, dest);
@@ -490,41 +508,40 @@ void Manager::OnRequestReceived(const EventMovePtr& event)
                           dest->getFullPath().c_str()))
         {
             int error = errno;
-            switch (error)
-            {
+            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
+            {
+                if (destExists) {
+                    //destination exist. Need to be removed
                     Try {
-                        INodePtr node = Node::resolve(event->getSource());
+                        INodePtr node = Node::resolve(
+                                event->getDestination());
                         node->remove(event->getOptions());
                     }
-                    Catch(Commons::Exception) {
-                        LogError("Exception: "
-                                 << _rethrown_exception.GetMessage());
+                    Catch(Commons::PlatformException) {
+                        LogError("Exception while removing dest directory");
+                        event->setExceptionCode(
+                            Commons::ExceptionCodes::PlatformException);
+                    }
+                    Catch(Commons::SecurityException) {
+                        event->setExceptionCode(
+                            Commons::ExceptionCodes::SecurityException);
                     }
-                    break;
                 }
+
+                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));
@@ -533,12 +550,10 @@ void Manager::OnRequestReceived(const EventMovePtr& event)
         }
 
         event->setResult(Node::resolve(dest));
-    }
-    catch (const Commons::PlatformException& ex) {
+    } catch (const Commons::PlatformException& ex) {
         LogError("Exception: " << ex.GetMessage());
         event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
-    }
-    catch (const Commons::SecurityException& ex) {
+    } catch (const Commons::SecurityException& ex) {
         LogError("Exception: " << ex.GetMessage());
         event->setExceptionCode(Commons::ExceptionCodes::SecurityException);
     }
@@ -571,8 +586,7 @@ void Manager::OnRequestReceived(const EventFindPtr& event)
         NodeList result;
         find(event->getPath(), event->getFilters(), result, event);
         event->setResult(result);
-    }
-    catch (const Commons::Exception& ex) {
+    } catch (const Commons::Exception& ex) {
         LogError("Exception: " << ex.GetMessage());
         event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
     }
@@ -593,19 +607,17 @@ bool Manager::init()
 }
 
 void Manager::setupLocation(LocationType location,
-        const char* path)
+                            const char* path)
 {
     if (!nodeExists(path)) {
         try {
             makePath(path, 0755);
-        }
-        catch (const Commons::PlatformException& ex) {
+        } catch (const Commons::PlatformException& ex) {
             LogError("Exception: " << ex.DumpToString());
             return;
         }
     }
     m_locations[location] = IPath::create(path);
 }
-
 } // Filesystem
 } // WrtDeviceApis
index e582a89..fa59e3d 100644 (file)
@@ -27,7 +27,6 @@
 
 namespace WrtDeviceApis {
 namespace Filesystem {
-
 class Manager : public Api::IManager
 {
   public:
@@ -84,7 +83,7 @@ class Manager : public Api::IManager
      *          only by virtual roots.
      */
     bool access(const Api::IPathPtr& path,
-            int accessType) const;
+                int accessType) const;
 
     void addOpenedNode(const Api::INodePtr& node);
     void removeOpenedNode(const Api::INodePtr& node);
@@ -92,8 +91,8 @@ class Manager : public Api::IManager
 
   protected:
     bool matchFilters(const std::string& name,
-            const struct stat& info,
-            const Api::FiltersMap& filter);
+                      const struct stat& info,
+                      const Api::FiltersMap& filter);
 
     void OnRequestReceived(const Api::EventResolvePtr& event);
     void OnRequestReceived(const Api::EventCopyPtr& event);
@@ -127,12 +126,13 @@ class Manager : public Api::IManager
      */
     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.
+    static Api::NodeList m_openedNodes; ///< List of nodes that has opened
+                                        // streams.
 };
-
 } // Filesystem
 } // WrtDeviceApis
 
old mode 100755 (executable)
new mode 100644 (file)
index 582fcba..221285c
@@ -33,7 +33,6 @@
 
 namespace WrtDeviceApis {
 namespace Filesystem {
-
 using namespace Api;
 
 INodePtr Node::resolve(const IPathPtr& path)
@@ -45,7 +44,7 @@ INodePtr Node::resolve(const IPathPtr& path)
                  "Node does not exist or access denied.");
     }
 
-    if (!S_ISDIR(info.st_mode) & !S_ISREG(info.st_mode)) {
+    if (!S_ISDIR(info.st_mode) && !S_ISREG(info.st_mode)) {
         ThrowMsg(Commons::PlatformException,
                  "Platform node is of unsupported type.");
     }
@@ -101,15 +100,20 @@ Node::NameList Node::getChildNames() const
 
     NameList result;
     errno = 0;
-    struct dirent *entry = NULL;
-    while ((entry = readdir(dir))) {
-        if (!strncmp(entry->d_name, ".",
-                     1) || !strncmp(entry->d_name, "..", 2)) {
+    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);
+        result.push_back(entry.d_name);
     }
-    if (errno != 0) {
+    if (return_code != 0 || errno != 0) {
         ThrowMsg(Commons::PlatformException, "Error while reading directory.");
     }
 
@@ -138,25 +142,29 @@ NodeList Node::getChildNodes(const NodeFilterPtr& filter) const
 
     errno = 0;
     NodeList result;
-    struct dirent *entry = NULL;
-    while ((entry = readdir(dir))) {
-        if (!strncmp(entry->d_name, ".",
-                     1) || !strncmp(entry->d_name, "..", 2)) {
+    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);
+            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) {
-        }
+        Catch(Commons::PlatformException) {}
     }
 
-    if (errno != 0) {
+    if (return_code != 0 || errno != 0) {
         ThrowMsg(Commons::PlatformException, "Error while reading directory.");
     }
 
@@ -174,9 +182,9 @@ void Node::getChildNodes(const EventListNodesPtr& event)
 }
 
 INodePtr Node::createChild(
-        const IPathPtr& path,
-        NodeType type,
-        int options)
+    const IPathPtr& path,
+    NodeType type,
+    int options)
 {
     if (m_type != NT_DIRECTORY) {
         ThrowMsg(Commons::PlatformException, "Parent node is not a directory.");
@@ -222,7 +230,8 @@ IStreamPtr Node::open(int mode)
 
     if (((mode & AM_READ) && ((m_perms & PERM_READ) == 0)) ||
         (((mode & AM_WRITE) ||
-          (mode & AM_APPEND)) && ((m_perms & PERM_WRITE) == 0))) {
+          (mode & AM_APPEND)) && ((m_perms & PERM_WRITE) == 0)))
+    {
         ThrowMsg(Commons::SecurityException, "Not enough permissions.");
     }
 
@@ -296,15 +305,33 @@ 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; }
+    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;
 }
 
@@ -342,7 +369,7 @@ struct stat Node::stat(const IPathPtr& path)
     struct stat result;
     memset(&result, 0, sizeof(struct stat));
     if (::stat(path->getFullPath().c_str(),
-                &result) != 0)
+               &result) != 0)
     {
         LogError("File: " << path->getFullPath().c_str());
         ThrowMsg(Commons::PlatformException, "Node does not exist or no access");
@@ -355,11 +382,10 @@ Node::Node(const IPathPtr& path,
     m_path(path),
     m_type(type),
     m_perms(PERM_NONE)
-{
-}
+{}
 
 Node* Node::createAsFile(const IPathPtr& path,
-        int /* options */)
+                         int /* options */)
 {
     LogDebug("ENTER");
     createAsFileInternal(path);
@@ -378,13 +404,15 @@ void Node::createAsFileInternal(const IPathPtr& path)
 }
 
 Node* Node::createAsDirectory(const IPathPtr& path,
-        int options)
+                              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); }
+            if (!exists(*it)) {
+                createAsDirectoryInternal(*it);
+            }
         }
     }
     createAsDirectoryInternal(path);
@@ -394,7 +422,8 @@ Node* Node::createAsDirectory(const IPathPtr& path,
 void Node::createAsDirectoryInternal(const IPathPtr& path)
 {
     if (mkdir(path->getFullPath().c_str(), S_IRWXU | S_IRWXG | S_IROTH |
-              S_IXOTH) != 0) {
+              S_IXOTH) != 0)
+    {
         ThrowMsg(Commons::PlatformException,
                  "Platform node could not be created.");
     }
@@ -424,64 +453,66 @@ void Node::removeAsDirectory(const IPathPtr& path,
         FTS *fts;
         FTSENT *ftsent;
         int error = 0;
-        std::string pth=path->getFullPath();
-        char * const paths[] = {const_cast<char * const>(pth.c_str()), NULL};
+        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) {
+        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));
+                                         << 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.");
-                        }
+            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,
-                                "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;
+                                 "Node has child nodes.");
                     }
-                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;
+                    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));
+                                           << strerror(error));
         }
     } else {
         if (rmdir(path->getFullPath().c_str()) != 0) {
@@ -489,7 +520,7 @@ void Node::removeAsDirectory(const IPathPtr& path,
                 ThrowMsg(Commons::PlatformException, "Node has child nodes.");
             }
             ThrowMsg(Commons::PlatformException,
-                    "Error while removing platform node.");
+                     "Error while removing platform node.");
         }
     }
 }
@@ -499,12 +530,10 @@ void Node::OnRequestReceived(const EventListNodesPtr& event)
     try {
         NodeList list = event->getNode()->getChildNodes(event->getFilter());
         event->setResult(list);
-    }
-    catch (const Commons::PlatformException& ex) {
+    } catch (const Commons::PlatformException& ex) {
         LogError("Exception: " << ex.GetMessage());
         event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
-    }
-    catch (const Commons::SecurityException& ex) {
+    } catch (const Commons::SecurityException& ex) {
         LogError("Exception: " << ex.GetMessage());
         event->setExceptionCode(Commons::ExceptionCodes::SecurityException);
     }
@@ -516,12 +545,10 @@ void Node::OnRequestReceived(const EventOpenPtr& event)
         try {
             IStreamPtr result = open(event->getMode());
             event->setResult(result);
-        }
-        catch (const Commons::PlatformException& ex) {
+        } catch (const Commons::PlatformException& ex) {
             LogError("Exception: " << ex.GetMessage());
             event->setExceptionCode(Commons::ExceptionCodes::PlatformException);
-        }
-        catch (const Commons::SecurityException& ex) {
+        } catch (const Commons::SecurityException& ex) {
             LogError("Exception: " << ex.GetMessage());
             event->setExceptionCode(Commons::ExceptionCodes::SecurityException);
         }
@@ -564,8 +591,9 @@ std::string Node::readText()
     DPL::SharedPtr<Stream> stream(new Stream(SharedFromThis(), AM_READ));
     while (!stream->isEof()) {
         result << stream->getLine();
-        if(!stream->isEof())
+        if (!stream->isEof()) {
             result << '\n';
+        }
     }
     stream->close();
     return result.str();
@@ -576,6 +604,5 @@ 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
index 0abcaf9..de95317 100644 (file)
@@ -31,7 +31,6 @@
 
 namespace WrtDeviceApis {
 namespace Filesystem {
-
 class Node :
     public Api::INode,
     public DPL::EnableSharedFromThis<Node>
@@ -53,7 +52,7 @@ class Node :
     Api::INodePtr getChild(const Api::IPathPtr& path);
     NameList getChildNames() const;
     Api::NodeList getChildNodes(
-            const Api::NodeFilterPtr& filter = Api::NodeFilterPtr()) const;
+        const Api::NodeFilterPtr& filter = Api::NodeFilterPtr()) const;
     void getChildNodes(const Api::EventListNodesPtr& event);
     Api::INodePtr createChild(const Api::IPathPtr & path,
                               Api::NodeType,
@@ -85,7 +84,7 @@ class Node :
 
     void removeAsFile(const Api::IPathPtr& path);
     void removeAsDirectory(const Api::IPathPtr& path,
-            bool recursive);
+                           bool recursive);
 
     void OnRequestReceived(const Api::EventListNodesPtr& event);
     void OnRequestReceived(const Api::EventOpenPtr& event);
@@ -104,7 +103,6 @@ class Node :
 };
 
 typedef DPL::SharedPtr<Node> NodePtr;
-
 } // Filesystem
 } // WrtDeviceApis
 
index 254be88..d85f4f0 100644 (file)
@@ -23,7 +23,6 @@
 
 namespace WrtDeviceApis {
 namespace Filesystem {
-
 using namespace Api;
 
 bool NodeFilterMatcher::match(const INodePtr& value,
@@ -36,19 +35,22 @@ bool NodeFilterMatcher::match(const INodePtr& value,
 
         if (!matchRange(value->getCreated(),
                         filter->getMinCreated(),
-                        filter->getMaxCreated())) {
+                        filter->getMaxCreated()))
+        {
             return false;
         }
 
         if (!matchRange(value->getModified(),
                         filter->getMinModified(),
-                        filter->getMaxModified())) {
+                        filter->getMaxModified()))
+        {
             return false;
         }
 
         if (!matchRange(value->getSize(),
                         filter->getMinSize(),
-                        filter->getMaxSize())) {
+                        filter->getMaxSize()))
+        {
             return false;
         }
     }
@@ -56,7 +58,7 @@ bool NodeFilterMatcher::match(const INodePtr& value,
 }
 
 bool NodeFilterMatcher::matchString(const std::string& value,
-        const OptionalString& filter)
+                                    const OptionalString& filter)
 {
     if (!filter.IsNull()) {
         return pcrecpp::RE(*filter).PartialMatch(value);
@@ -66,15 +68,15 @@ bool NodeFilterMatcher::matchString(const std::string& value,
 
 template<typename Type>
 bool NodeFilterMatcher::matchRange(const Type& value,
-        const DPL::Optional<Type>& min,
-        const DPL::Optional<Type>& max)
+                                   const DPL::Optional<Type>& min,
+                                   const DPL::Optional<Type>& max)
 {
     if ((!min.IsNull() && (value < *min)) ||
-        (!max.IsNull() && (value > *max))) {
+        (!max.IsNull() && (value > *max)))
+    {
         return false;
     }
     return true;
 }
-
 } // Filesystem
 } // WrtDeviceApis
index fe22a23..e300058 100644 (file)
@@ -27,7 +27,6 @@
 
 namespace WrtDeviceApis {
 namespace Filesystem {
-
 class NodeFilterMatcher
 {
   public:
@@ -46,7 +45,6 @@ class NodeFilterMatcher
   private:
     NodeFilterMatcher();
 };
-
 } // Filesystem
 } // WrtDeviceApis
 
index 31edceb..9aa1197 100644 (file)
@@ -26,7 +26,6 @@
 
 namespace WrtDeviceApis {
 namespace Filesystem {
-
 using namespace Api;
 
 const Path::SeparatorType Path::m_pathSeparator = '/';
@@ -86,8 +85,7 @@ IPathPtr Path::clone() const
 }
 
 Path::Path()
-{
-}
+{}
 
 void Path::reset(const std::string& str)
 {
@@ -113,6 +111,5 @@ void Path::reset(const std::string& str)
         m_fullPath += m_name;
     }
 }
-
 } // Filesystem
 } // WrtDeviceApis
index 6a25f66..6c7b314 100644 (file)
@@ -23,7 +23,6 @@
 
 namespace WrtDeviceApis {
 namespace Filesystem {
-
 class Path : public Api::IPath,
     public DPL::EnableSharedFromThis<Path>
 {
@@ -60,7 +59,6 @@ class Path : public Api::IPath,
     std::string m_path;   ///< Base path.
     std::string m_name;   ///< Last part of the path.
 };
-
 } // Filesystem
 } // WrtDeviceApis
 
old mode 100755 (executable)
new mode 100644 (file)
index f999484..f63d7c4
@@ -24,7 +24,6 @@
 
 namespace WrtDeviceApis {
 namespace Filesystem {
-
 using namespace Api;
 
 Stream::Stream(const NodePtr& parent,
@@ -35,9 +34,14 @@ Stream::Stream(const NodePtr& parent,
     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) {
+    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);
     }
 
@@ -237,7 +241,7 @@ IStreamPtr Stream::write_(T arg)
     if (!(m_stream << arg)) {
         LogError("Error while writing to the stream.");
         ThrowMsg(Commons::PlatformException,
-             "Error while writing to the stream.");
+                 "Error while writing to the stream.");
     }
     m_stream.flush();
 
@@ -294,6 +298,5 @@ void Stream::checkForWriting() const
         ThrowMsg(Commons::PlatformException, "Stream is not writeable.");
     }
 }
-
 } // Filesystem
 } // WrtDeviceApis
index 1e1da11..777168f 100644 (file)
@@ -26,7 +26,6 @@
 
 namespace WrtDeviceApis {
 namespace Filesystem {
-
 class Node;
 typedef DPL::SharedPtr<Node> NodePtr;
 
@@ -92,7 +91,7 @@ class Stream :
 
   private:
     Stream(const NodePtr& parent,
-            int mode);
+           int mode);
 
   private:
     NodePtr m_parent;
@@ -101,7 +100,6 @@ class Stream :
 };
 
 typedef DPL::SharedPtr<Stream> StreamPtr;
-
 } // Filesystem
 } // WrtDeviceApis
 
index 7fa5b6b..fc9cde0 100644 (file)
@@ -78,7 +78,6 @@ int mkpath(const char* path,
 
 namespace WrtDeviceApis {
 namespace Filesystem {
-
 bool nodeExists(const std::string& path)
 {
     struct stat info;
@@ -91,12 +90,11 @@ bool nodeExists(const std::string& path)
 }
 
 void makePath(const std::string& path,
-        mode_t mode)
+              mode_t mode)
 {
     if (mkpath(path.c_str(), mode) == -1) {
         ThrowMsg(Commons::PlatformException, "Couldn't create path: " << path);
     }
 }
-
 }
 }
index a094dad..2b1eeb3 100644 (file)
 
 namespace WrtDeviceApis {
 namespace Filesystem {
-
 bool nodeExists(const std::string& path);
 
 void makePath(const std::string& path, mode_t mode);
-
 }
 }
 
index 4523db8..e2cf447 100644 (file)
 namespace WrtDeviceApis {
 namespace Networking {
 EthernetAdapter::EthernetAdapter()
-{
-}
+{}
 
 void EthernetAdapter::addOnConnected(
-        const Api::EventConnectedEmitterPtr& emitter)
+    const Api::EventConnectedEmitterPtr& emitter)
 {
     m_onConnected.attach(emitter);
 }
 
 void EthernetAdapter::removeOnConnected(
-        Api::EventConnectedEmitter::IdType id)
+    Api::EventConnectedEmitter::IdType id)
 {
     m_onConnected.detach(id);
 }
 
 void EthernetAdapter::addOnDisconnected(
-        const Api::EventDisconnectedEmitterPtr& emitter)
+    const Api::EventDisconnectedEmitterPtr& emitter)
 {
     m_onDisconnected.attach(emitter);
 }
 
 void EthernetAdapter::removeOnDisconnected(
-        Api::EventDisconnectedEmitter::IdType id)
+    Api::EventDisconnectedEmitter::IdType id)
 {
     m_onDisconnected.detach(id);
 }
index d51683a..6193531 100644 (file)
@@ -35,21 +35,22 @@ class EthernetAdapter : public Api::IAdapter
 
   public:
     bool isConnected() const /* TODO */
-    {                                      return false;
+    {
+        return false;
     }
 
     // Api::Networking::IConnectionPtr getConnection() const { /* TODO */ }
 
     void addOnConnected(
-            const Api::EventConnectedEmitterPtr& emitter);
+        const Api::EventConnectedEmitterPtr& emitter);
 
     void removeOnConnected(Api::EventConnectedEmitter::IdType id);
 
     void addOnDisconnected(
-            const Api::EventDisconnectedEmitterPtr& emitter);
+        const Api::EventDisconnectedEmitterPtr& emitter);
 
     void removeOnDisconnected(
-            Api::EventDisconnectedEmitter::IdType id);
+        Api::EventDisconnectedEmitter::IdType id);
 
     Api::IAdapter::Type getAdapterType() const;
 
index 89d2dcb..0f1e7c0 100644 (file)
@@ -30,7 +30,8 @@
 
 namespace WrtDeviceApis {
 namespace Networking {
-//net_event_callbacks Manager::m_netEventCallbacks = Manager::getNetEventCallbacks();
+//net_event_callbacks Manager::m_netEventCallbacks =
+// Manager::getNetEventCallbacks();
 
 Manager& Manager::getInstance()
 {
@@ -89,7 +90,8 @@ void Manager::getAvailableAdapters(Api::AdaptersSet *retSet) const
 //
 //void Manager::onNetStatusChange(NetStatusInfo_t* status, void *userData) {
 //  LogDebug("--| ENTER");
-//  LogInfo("Type: " << status->transportType << ", status: " << status->WiFiStatus);
+//  LogInfo("Type: " << status->transportType << ", status: " <<
+// status->WiFiStatus);
 //}
 
 Manager::Manager()
@@ -108,7 +110,8 @@ void Manager::setupAdapters()
     //  Api::IAdapter* adapter = NULL;
     //
     //  adapter = new EthernetAdapter();
-    //  m_adapters.insert(Adapters::value_type(Api::IAdapter::T_ETHERNET, adapter));
+    //  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));
@@ -127,8 +130,10 @@ void Manager::removeAdapters()
 //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 = 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) {
@@ -140,7 +145,8 @@ void Manager::removeAdapters()
 //  int error = 0;
 //
 //  if ((error = net_deregister_client()) != NET_ERR_NONE) {
-//    LogError("Could not deregister from datanetworking module (" << error << ").");
+//    LogError("Could not deregister from datanetworking module (" << error <<
+// ").");
 //  }
 //
 //  if ((error = wlan_client_deregister()) != WLAN_ERR_NONE) {
@@ -152,7 +158,8 @@ void Manager::removeAdapters()
 //  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) {
+//  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);
index 748c069..6ad6077 100644 (file)
 namespace WrtDeviceApis {
 namespace Networking {
 WifiAdapter::WifiAdapter()
-{
-}
+{}
 
 void WifiAdapter::addOnConnected(
-        const Api::EventConnectedEmitterPtr& emitter)
+    const Api::EventConnectedEmitterPtr& emitter)
 {
     m_onConnected.attach(emitter);
 }
 
 void WifiAdapter::removeOnConnected(
-        Api::EventConnectedEmitter::IdType id)
+    Api::EventConnectedEmitter::IdType id)
 {
     m_onConnected.detach(id);
 }
 
 void WifiAdapter::addOnDisconnected(
-        const Api::EventDisconnectedEmitterPtr& emitter)
+    const Api::EventDisconnectedEmitterPtr& emitter)
 {
     m_onDisconnected.attach(emitter);
 }
 
 void WifiAdapter::removeOnDisconnected(
-        Api::EventDisconnectedEmitter::IdType id)
+    Api::EventDisconnectedEmitter::IdType id)
 {
     m_onDisconnected.detach(id);
 }
index 001c708..ebb4245 100644 (file)
@@ -35,21 +35,22 @@ class WifiAdapter : public Api::IAdapter
 
   public:
     bool isConnected() const /* TODO */
-    {                                      return false;
+    {
+        return false;
     }
 
     //Api::Networking::IConnectionPtr getConnection() const { /* TODO */ }
 
     void addOnConnected(
-            const Api::EventConnectedEmitterPtr& emitter);
+        const Api::EventConnectedEmitterPtr& emitter);
 
     void removeOnConnected(Api::EventConnectedEmitter::IdType id);
 
     void addOnDisconnected(
-            const Api::EventDisconnectedEmitterPtr& emitter);
+        const Api::EventDisconnectedEmitterPtr& emitter);
 
     void removeOnDisconnected(
-            Api::EventDisconnectedEmitter::IdType id);
+        Api::EventDisconnectedEmitter::IdType id);
 
     Api::IAdapter::Type getAdapterType() const;
 
index 8f71524..2d868d8 100644 (file)
@@ -34,7 +34,6 @@
 #include <dpl/log/log.h>
 #include <dpl/foreach.h>
 
-
 using namespace std;
 
 namespace {
@@ -44,8 +43,6 @@ const char* SEPARATOR = ".";
 
 namespace WrtDeviceApis {
 namespace PluginManager {
-
-
 PluginManager::PluginManager(int widgetHandle,
                              const string &objectUri,
                              JSObjectRef object,
@@ -63,8 +60,7 @@ PluginManager::PluginManager(int widgetHandle,
 PluginManager::~PluginManager()
 {
     ObjectList::iterator it = m_objectList.begin();
-    for (; it != m_objectList.end(); ++it)
-    {
+    for (; it != m_objectList.end(); ++it) {
         JSValueUnprotect(m_context, it->second);
     }
     WrtDB::WrtDatabase::detachFromThread();
@@ -106,28 +102,27 @@ bool PluginManager::loadChild(const string &name) const
     }
 
     if (widgetType == WrtDB::APP_TYPE_TIZENWEBAPP) {
-        JavaScriptObject jsObject = {m_objectInstance,
-                                          m_shortUri};
+        JavaScriptObject jsObject = { m_objectInstance,
+                                      m_shortUri };
         return PluginLogicSingleton::Instance().loadPluginOnDemand(
-            handle, jsObject, const_cast<JSGlobalContextRef>(m_context));
+                   handle, jsObject, const_cast<JSGlobalContextRef>(m_context));
     }
 
     //check does plugin with feature was requested
-    FOREACH (it, features)
+    FOREACH(it, features)
     {
-        if (it->pluginId == handle)
-        {
-            if(it->rejected)
-            {
+        if (it->pluginId == handle) {
+            if (it->rejected) {
                 LogWarning("Feature rejected by ACE");
                 continue;
             }
 
-            JavaScriptObject jsObject = {m_objectInstance,
-                                                      m_shortUri};
+            JavaScriptObject jsObject = { m_objectInstance,
+                                          m_shortUri };
 
             return PluginLogicSingleton::Instance().loadPluginOnDemand(
-                handle, jsObject, const_cast<JSGlobalContextRef>(m_context));
+                       handle, jsObject,
+                       const_cast<JSGlobalContextRef>(m_context));
         }
     }
     LogError("Plugin not loaded");
@@ -179,7 +174,6 @@ bool PluginManager::deleteProperty(const string &name)
     return false;
 }
 
-
 Api::IPluginManager::PropertyList PluginManager::getProperties() const
 {
     if (!m_propertyCache.IsNull()) {
@@ -191,8 +185,7 @@ Api::IPluginManager::PropertyList PluginManager::getProperties() const
     WrtDB::WidgetDAOReadOnly dao(m_widgetHandle);
     string localUri = m_objectUri + SEPARATOR;
 
-    if (dao.getWidgetType() == WrtDB::APP_TYPE_TIZENWEBAPP)
-    {
+    if (dao.getWidgetType() == WrtDB::APP_TYPE_TIZENWEBAPP) {
         WrtDB::PluginHandleList pluginHandleList =
             WrtDB::PluginDAOReadOnly::getPluginHandleList();
 
@@ -219,9 +212,7 @@ Api::IPluginManager::PropertyList PluginManager::getProperties() const
                 }
             }
         }
-    }
-    else
-    {
+    } else {
         WrtDB::DbWidgetFeatureSet features;
 
         Try
@@ -261,7 +252,7 @@ Api::IPluginManager::PropertyList PluginManager::getProperties() const
 }
 
 void PluginManager::addPropertiesToList(
-        JSPropertyNameAccumulatorRef propertyNames) const
+    JSPropertyNameAccumulatorRef propertyNames) const
 {
     PropertyList properties = getProperties();
     CommonsJavaScript::Converter converter(m_context);
@@ -270,8 +261,6 @@ void PluginManager::addPropertiesToList(
         JSPropertyNameAccumulatorAddName(propertyNames, name);
         JSStringRelease(name);
     }
-
 }
-
 }
 }
index b6564e1..30b72a3 100644 (file)
 
 namespace WrtDeviceApis {
 namespace PluginManager {
-
 class PluginManager : public Api::IPluginManager
 {
-public:
+  public:
     PluginManager(int widgetHandle,
                   const std::string &objectUri,
                   JSObjectRef object,
@@ -50,7 +49,7 @@ public:
     PropertyList getProperties() const;
     void addPropertiesToList(JSPropertyNameAccumulatorRef propertyNames) const;
 
-private:
+  private:
     typedef std::map<std::string, JSValueRef> ObjectList;
 
     int m_widgetHandle;
@@ -61,7 +60,6 @@ private:
     ObjectList m_objectList;
     JSContextRef m_context;
 };
-
 }
 }
 
index 251783d..d1a19d1 100644 (file)
@@ -30,7 +30,6 @@
 
 namespace WrtDeviceApis {
 namespace Widget {
-
 template<typename T>
 class Property
 {
@@ -38,8 +37,7 @@ class Property
     explicit Property() :
         m_value(),
         m_valid(false)
-    {
-    }
+    {}
 
     void setValue(const T& value)
     {
@@ -61,8 +59,8 @@ class Property
     }
 
     virtual ~Property()
-    {
-    }
+    {}
+
   private:
     T m_value;
     bool m_valid;
index 3bc7341..d250452 100644 (file)
 #include <WidgetDB/IWidgetDB.h>
 #include <WidgetDB/WidgetDBMgr.h>
 
-
 namespace WrtDeviceApis {
 namespace Widget {
 using namespace std;
 using namespace WidgetDB::Api;
 
-Widget::Widget() 
+Widget::Widget()
 {
     using namespace WrtDeviceApis::Commons;
     m_widgetId = WrtAccessSingleton::Instance().getWidgetId();
 }
 
 Widget::~Widget()
-{
-}
+{}
 
 string Widget::getProperty(ConfigAttribute attr) const
 {
@@ -148,8 +146,8 @@ unsigned int Widget::getHeight() const
     checkWidgetId();
 
     if (!m_height.isValid()) {
-        m_height.setValue(Commons::String::toInt(
-            getProperty(ConfigAttribute::HEIGHT)));
+        m_height.setValue(Commons::String::convertTo<int>(
+                              getProperty(ConfigAttribute::HEIGHT)));
     }
     return m_height.getValue();
 }
@@ -159,8 +157,8 @@ unsigned int Widget::getWidth() const
     checkWidgetId();
 
     if (!m_width.isValid()) {
-        m_width.setValue(Commons::String::toInt(
-            getProperty(ConfigAttribute::WIDTH)));
+        m_width.setValue(Commons::String::convertTo<int>(
+                             getProperty(ConfigAttribute::WIDTH)));
     }
     return m_width.getValue();
 }
index eb2ca30..1dee043 100644 (file)
@@ -35,7 +35,6 @@
 
 namespace WrtDeviceApis {
 namespace Widget {
-
 class Widget : public Api::IWidget
 {
   public:
@@ -74,7 +73,6 @@ class Widget : public Api::IWidget
 
     int m_widgetId;
 };
-
 }
 }
 
index 0618c65..b37711c 100644 (file)
 
 #include "WidgetFeature.h"
 
-
 namespace WrtDeviceApis {
 namespace WidgetDB {
-
 WidgetDB::WidgetDB(int widgetId) : m_widgetId(widgetId) {}
 
-
 int WidgetDB::getWidgetId() const
 {
     return m_widgetId;
@@ -70,25 +67,24 @@ std::string WidgetDB::getLanguage() const
     }
 
     // get 'en' language or first from the list if 'en' does not exist
-    if (languageTags.size() > 1)
-    {
+    if (languageTags.size() > 1) {
         FOREACH(lang, languageTags)
         {
-            if ("en" == DPL::ToUTF8String(*lang))
+            if ("en" == DPL::ToUTF8String(*lang)) {
                 return "en";
+            }
         }
     }
 
-    if (!languageTags.empty())
-    {
-            // get first language tag
+    if (!languageTags.empty()) {
+        // get first language tag
         outLanguage = DPL::ToUTF8String(*(languageTags.begin()));
     }
     return outLanguage;
 }
 
 /*License,LicenseHref,Description,Name can be \
   returned with incorect language*/
*  returned with incorect language*/
 std::string WidgetDB::getConfigValue(Api::ConfigAttribute attribute) const
 {
     LogDebug("entered");
@@ -102,55 +98,65 @@ std::string WidgetDB::getConfigValue(Api::ConfigAttribute attribute) const
         std::ostringstream out;
 
         switch (attribute) {
-            case Api::ConfigAttribute::ID: {
+        case Api::ConfigAttribute::ID: {
             DPL::OptionalString val = dao.getGUID();
             value = !val ? "" : DPL::ToUTF8String(*val);
-            break; }
+            break;
+        }
 
         case Api::ConfigAttribute::VERSION: {
             DPL::OptionalString val = dao.getVersion();
             value = !val ? "" : DPL::ToUTF8String(*val);
-            break; }
+            break;
+        }
 
         case Api::ConfigAttribute::DESCRIPTION: {
             DPL::OptionalString val = widgetInfo.description;
             value = !val ? "" : DPL::ToUTF8String(*val);
-            break; }
+            break;
+        }
 
         case Api::ConfigAttribute::LICENSE: {
             DPL::OptionalString val = widgetInfo.license;
             value = !val ? "" : DPL::ToUTF8String(*val);
-            break; }
+            break;
+        }
 
         case Api::ConfigAttribute::LICENSE_HREF: {
             DPL::OptionalString val = widgetInfo.licenseHref;
             value = !val ? "" : DPL::ToUTF8String(*val);
-            break; }
+            break;
+        }
 
         case Api::ConfigAttribute::AUTHOR_NAME: {
             DPL::OptionalString val = dao.getAuthorName();
             value = !val ? "" : DPL::ToUTF8String(*val);
-            break; }
+            break;
+        }
 
         case Api::ConfigAttribute::AUTHOR_EMAIL: {
             DPL::OptionalString val = dao.getAuthorEmail();
             value = !val ? "" : DPL::ToUTF8String(*val);
-            break; }
+            break;
+        }
 
         case Api::ConfigAttribute::AUTHOR_HREF: {
             DPL::OptionalString val = dao.getAuthorHref();
             value = !val ? "" : DPL::ToUTF8String(*val);
-            break; }
+            break;
+        }
 
         case Api::ConfigAttribute::NAME: {
             DPL::OptionalString val = widgetInfo.name;
             value = !val ? "" : DPL::ToUTF8String(*val);
-            break; }
+            break;
+        }
 
         case Api::ConfigAttribute::SHORT_NAME: {
             DPL::OptionalString val = widgetInfo.shortName;
             value = !val ? "" : DPL::ToUTF8String(*val);
-            break; }
+            break;
+        }
 
         case Api::ConfigAttribute::ACCESS_NETWORK:
             value = dao.getAccessNetworkMode() ? "yes" : "no";
@@ -160,13 +166,15 @@ std::string WidgetDB::getConfigValue(Api::ConfigAttribute attribute) const
             DPL::OptionalInt width = dao.getPreferredSize().width;
             !width ? out << "0" : out << *width;
             value = out.str();
-            break; }
+            break;
+        }
 
         case Api::ConfigAttribute::HEIGHT: {
             DPL::OptionalInt height = dao.getPreferredSize().height;
             !height ? out << "0" : out << *height;
             value = out.str();
-            break; }
+            break;
+        }
 
         case Api::ConfigAttribute::INSTALL_PATH:
             value = DPL::ToUTF8String(dao.getPath());
@@ -195,14 +203,12 @@ std::string WidgetDB::getConfigValue(Api::ConfigAttribute attribute) const
     return value;
 }
 
-
-
 std::string WidgetDB::getUserAgent() const
 {
-        LogDebug("Widget User_Agent data get");
+    LogDebug("Widget User_Agent data get");
 
-        std::string outUA("not implemented");
-        return outUA;
+    std::string outUA("not implemented");
+    return outUA;
 }
 
 Api::InstallationStatus WidgetDB::checkInstallationStatus(
@@ -210,8 +216,8 @@ Api::InstallationStatus WidgetDB::checkInstallationStatus(
     const std::string& name,
     const std::string& version) const
 {
-        LogDebug("Checking widget ( gid(" << gid << "), name(" << name <<
-                 "), version(" << version << ")) installation status");
+    LogDebug("Checking widget ( gid(" << gid << "), name(" << name <<
+             "), version(" << version << ")) installation status");
 
     Api::InstallationStatus outStatus;
     Try
@@ -221,7 +227,7 @@ Api::InstallationStatus WidgetDB::checkInstallationStatus(
 
         try {
             WrtDB::DbWidgetHandle widgetHandle =
-                    WrtDB::WidgetDAOReadOnly::getHandle(w_guid);
+                WrtDB::WidgetDAOReadOnly::getHandle(w_guid);
 
             WrtDB::WidgetDAOReadOnly dao(widgetHandle);
             DPL::OptionalString ver = dao.getVersion();
@@ -232,7 +238,7 @@ Api::InstallationStatus WidgetDB::checkInstallationStatus(
             } else {
                 outStatus = Api::InstallationStatus::STATUS_LATEST;
             }
-        }catch (WrtDB::WidgetDAOReadOnly::Exception::WidgetNotExist) {
+        } catch (WrtDB::WidgetDAOReadOnly::Exception::WidgetNotExist) {
             outStatus = Api::InstallationStatus::STATUS_UNINSTALLED;
         }
     }
@@ -244,7 +250,6 @@ Api::InstallationStatus WidgetDB::checkInstallationStatus(
     return outStatus;
 }
 
-
 Api::Features WidgetDB::getWidgetFeatures() const
 {
     LogDebug("entered");
@@ -267,9 +272,9 @@ Api::Features WidgetDB::getWidgetFeatures() const
     FOREACH(it, features)
     {
         Api::IWidgetFeaturePtr feature(
-                new WidgetFeature(DPL::ToUTF8String((*it).name),
-                                  (*it).required,
-                                  true));  // requested (WidgetFeature param)
+            new WidgetFeature(DPL::ToUTF8String((*it).name),
+                              (*it).required,
+                              true));      // requested (WidgetFeature param)
         // iterating multimap
         FOREACH(iterator, (*it).params)
         {
@@ -321,9 +326,9 @@ Api::Features WidgetDB::getRegisteredFeatures() const
                 // feature is not on outRegisteredFeature so add it with
                 // 'required' property false
                 Api::IWidgetFeaturePtr newFeature(new WidgetFeature(
-                    dao.GetName(),
-                    false,
-                    false));
+                                                      dao.GetName(),
+                                                      false,
+                                                      false));
 
                 // TODO what about feature params? aren't they needed
                 outRegisteredFeatures.push_back(newFeature);
@@ -340,22 +345,20 @@ Api::Features WidgetDB::getRegisteredFeatures() const
     return outRegisteredFeatures;
 }
 
-
 std::string WidgetDB::getWidgetInstallationPath() const
 {
     Try
     {
         WrtDB::WidgetDAOReadOnly dao(getWidgetId());
         std::string result(DPL::ToUTF8String(dao.getFullPath()));
-        result.erase(0,strlen("file://"));
+        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)
-        {
+        if ((result.size() - pos) > 0 && (result.size() - pos) < 2) {
             result.erase(pos, result.size());
         }
-       return result;
+        return result;
     }
     Catch(DPL::Exception)
     {
@@ -368,7 +371,9 @@ std::string WidgetDB::getWidgetPersistentStoragePath() const
     Try
     {
         WrtDB::WidgetDAOReadOnly dao(getWidgetId());
-        return WrtDB::WidgetConfig::GetWidgetPersistentStoragePath(dao.getPkgName());
+        return
+            WrtDB::WidgetConfig::GetWidgetPersistentStoragePath(
+                dao.getTizenPkgId());
     }
     Catch(DPL::Exception)
     {
@@ -381,13 +386,14 @@ std::string WidgetDB::getWidgetTemporaryStoragePath() const
     Try
     {
         WrtDB::WidgetDAOReadOnly dao(getWidgetId());
-        return WrtDB::WidgetConfig::GetWidgetTemporaryStoragePath(dao.getPkgName());
+        return
+            WrtDB::WidgetConfig::GetWidgetTemporaryStoragePath(
+                dao.getTizenPkgId());
     }
     Catch(DPL::Exception)
     {
         ReThrow(Commons::PlatformException);
     }
 }
-
 } // WidgetDB
 } // WrtDeviceApis
index 46af26d..b471e1a 100644 (file)
@@ -28,7 +28,6 @@
 
 namespace WrtDeviceApis {
 namespace WidgetDB {
-
 class WidgetDB : public Api::IWidgetDB
 {
   public:
@@ -44,9 +43,9 @@ class WidgetDB : public Api::IWidgetDB
     virtual std::string getUserAgent() const;
 
     virtual Api::InstallationStatus checkInstallationStatus(
-            const std::string& gid,
-            const std::string& name,
-            const std::string& version) const;
+        const std::string& gid,
+        const std::string& name,
+        const std::string& version) const;
 
     virtual Api::Features getWidgetFeatures() const;
 
@@ -61,12 +60,9 @@ class WidgetDB : public Api::IWidgetDB
   private:
 
     int m_widgetId;
-
 };
-
 } // WidgetDB
 } // WrtDeviceApis
 
 #endif // WRTDEVICEAPIS_WIDGETDB_WIDGETDB_H
 
-
index 530acff..5733926 100644 (file)
@@ -24,7 +24,6 @@
 
 namespace WrtDeviceApis {
 namespace WidgetDB {
-
 WidgetFeature::WidgetFeature(const std::string& name,
                              bool required,
                              bool requested) :
@@ -54,7 +53,7 @@ Api::IWidgetFeature::Params WidgetFeature::getParams() const
 }
 
 void WidgetFeature::addParam(const std::string& paramName,
-        const std::string& paramValue)
+                             const std::string& paramValue)
 {
     //LogDebug("entered");
     m_params.push_back(std::make_pair(paramName, paramValue));
@@ -69,6 +68,5 @@ bool WidgetFeature::isRequestedByWidget() const
 {
     return m_requested;
 }
-
 } // WidgetDB
 } // WrtDeviceApis
index 0634a3a..11be686 100644 (file)
 
 namespace WrtDeviceApis {
 namespace WidgetDB {
-
 class WidgetFeature : public Api::IWidgetFeature
 {
   public:
     WidgetFeature(const std::string& name,
-            bool required,
-            bool requested);
+                  bool required,
+                  bool requested);
 
     std::string getName() const;
 
@@ -44,7 +43,7 @@ class WidgetFeature : public Api::IWidgetFeature
     virtual ~WidgetFeature();
 
     virtual void addParam(const std::string& paramName,
-            const std::string& paramValue);
+                          const std::string& paramValue);
 
     virtual bool isRequestedByWidget() const;
 
@@ -54,7 +53,6 @@ class WidgetFeature : public Api::IWidgetFeature
     bool m_requested;
     Params m_params;
 };
-
 } // WidgetDB
 } // WrtDeviceApis
 
index f78ab4a..f560fdd 100644 (file)
@@ -44,7 +44,6 @@ const char *KEY_WIDGET_ARG = "widget_arg";
 }
 
 namespace WrtDeviceApis {
-
 WidgetInterfaceDAO::WidgetInterfaceDAO(int widgetHandle) :
     m_widgetHandle(widgetHandle),
     m_databaseInterface(databaseFileName(widgetHandle), DATABASE_FLAGS)
@@ -66,7 +65,6 @@ bool WidgetInterfaceDAO::checkDatabase()
     std::string databaseFile = databaseFileName(m_widgetHandle);
     struct stat buffer;
     if (stat(databaseFile.c_str(), &buffer) != 0) {
-
         //Create fresh database
 
         LogInfo("Creating database " << databaseFile);
@@ -86,7 +84,7 @@ bool WidgetInterfaceDAO::checkDatabase()
         Try
         {
             DPL::DB::SqlConnection con(databaseFile,
-                DATABASE_FLAGS, DATABASE_OPTIONS);
+                                       DATABASE_FLAGS, DATABASE_OPTIONS);
             con.ExecCommand(buffer.str().c_str());
         }
         Catch(DPL::DB::SqlConnection::Exception::Base)
@@ -169,7 +167,7 @@ void WidgetInterfaceDAO::setItem(const std::string& key,
             Equals<Properties::key>(DPL::FromUTF8String(key)));
         std::list<Properties::Row> rows = select.GetRowList();
 
-        if (rows.size() == 0) {
+        if (rows.empty()) {
             Properties::Insert insert(&m_databaseInterface);
             Properties::Row row;
             row.Set_key(DPL::FromUTF8String(key));
@@ -178,8 +176,7 @@ void WidgetInterfaceDAO::setItem(const std::string& key,
             row.Set_configxml(fromConfigXml ? 1 : 0);
             insert.Values(row);
             insert.Execute();
-        }
-        else {
+        } else {
             Assert(rows.size() == 1);
             Properties::Row row = rows.front();
             if (row.Get_readonly() != 0) {
@@ -199,7 +196,6 @@ void WidgetInterfaceDAO::setItem(const std::string& key,
         LogError("Cannot set item " << key << " with value " << value);
         ReThrow(Commons::PlatformException);
     }
-
 }
 
 void WidgetInterfaceDAO::removeItem(const std::string& key)
@@ -214,7 +210,7 @@ void WidgetInterfaceDAO::removeItem(const std::string& key)
         bool readonly = select.GetSingleValue<Properties::readonly>();
         if (readonly) {
             ThrowMsg(Commons::LocalStorageValueNoModifableException,
-                "Cannot delete item. Item is readonly");
+                     "Cannot delete item. Item is readonly");
         }
         Properties::Delete deleteItem(&m_databaseInterface);
         deleteItem.Where(Equals<Properties::key>(DPL::FromUTF8String(key)));
@@ -228,7 +224,7 @@ void WidgetInterfaceDAO::removeItem(const std::string& key)
 }
 
 DPL::Optional<std::string> WidgetInterfaceDAO::getValue(
-        const std::string& key) const
+    const std::string& key) const
 {
     using namespace DPL::DB::ORM;
     using namespace DPL::DB::ORM::widget_interface;
@@ -238,7 +234,7 @@ DPL::Optional<std::string> WidgetInterfaceDAO::getValue(
         Properties::Select select(&m_databaseInterface);
         select.Where(Equals<Properties::key>(DPL::FromUTF8String(key)));
         std::list<DPL::String> value = select.GetValueList<Properties::value>();
-        if (value.size() == 0) {
+        if (value.empty()) {
             return DPL::Optional<std::string>();
         }
         return DPL::Optional<std::string>(DPL::ToUTF8String(value.front()));
@@ -327,9 +323,9 @@ std::string WidgetInterfaceDAO::databaseFileName(int widgetHandle)
     Try
     {
         WrtDB::WidgetDAOReadOnly widgetDAO(widgetHandle);
-        WrtDB::WidgetPkgName pkgname = widgetDAO.getPkgName();
+        WrtDB::TizenPkgId pkgid = widgetDAO.getTizenPkgId();
 
-        filename << GetWidgetPersistentStoragePath(pkgname)
+        filename << GetWidgetPersistentStoragePath(pkgid)
                  << "/"
                  << GetWidgetInterfaceDatabaseFile();
     }
@@ -341,5 +337,4 @@ std::string WidgetInterfaceDAO::databaseFileName(int widgetHandle)
     WrtDB::WrtDatabase::detachFromThread();
     return filename.str();
 }
-
 }
index 371ae58..b4141c0 100644 (file)
@@ -28,7 +28,6 @@
 #include <LocalStorage/ILocalStorage.h>
 
 namespace WrtDeviceApis {
-
 class WidgetInterfaceDAO :
     public LocalStorage::Api::ILocalStorage
 {
@@ -58,7 +57,6 @@ class WidgetInterfaceDAO :
     bool copyPropertiesFromWrtDatabase();
     static std::string databaseFileName(int widgetHandle);
 };
-
 }
 
 #endif //WRTDEVICEAPIS_COMMONS_WIDGET_INTERFACE_DAO_H_
\ No newline at end of file
index a45dc93..b4ce0b6 100644 (file)
@@ -17,7 +17,8 @@
  * @file        wrt_db_sql_generator.h
  * @author      Bartosz Janiak (b.janiak@samsung.com)
  * @version     1.0
- * @brief       Macro definitions for generating the SQL input file from database definition.
+ * @brief       Macro definitions for generating the SQL input file from
+ * database definition.
  */
 
 //Do not include this file directly! It is used only for SQL code generation.
index bbb22d4..fc69a28 100644 (file)
@@ -27,7 +27,7 @@
 #include "explorer.h"
 #include "plugin_property_support.h"
 
-// JS overlay 
+// JS overlay
 #include <js_overlay_support.h>
 #include <js_overlay_types.h>
 #include <js_overlay_addEventListener.h>
@@ -38,7 +38,6 @@
 #include <JSClass/JSTizenServiceEvent.h>
 #include <JSClass/JSSoftKeyboardChangeEvent.h>
 
-
 namespace {
 //const char* SEPARATOR = ".";
 const std::string GLOBAL_OBJECT_NAME = "GLOBAL_OBJECT";
@@ -66,8 +65,7 @@ Explorer::Explorer(JSGlobalContextRef context) :
     m_propertySupport.reset(new WindowPropertySupport(m_context));
 
     // initialization for use of custom event
-    if (!AddEventListenerSupport::isInitialized())
-    {
+    if (!AddEventListenerSupport::isInitialized()) {
         LogInfo("initialization for use of custom event");
         AddEventListenerSupport::initialize(context);
     }
@@ -81,23 +79,22 @@ Explorer::~Explorer()
         AddEventListenerSupport::deinitialize();
     }
 }
-    
+
 JSObjectPtr Explorer::getJSObjectProperty(const std::string& propertyName,
-                                        JSObjectPtr object)
+                                          JSObjectPtr object)
 {
     LogDebug("Get object property " << propertyName);
     return JavaScriptInterfaceSingleton::Instance().getJSObjectProperty(
-            m_context, object, propertyName);
+               m_context, object, propertyName);
 }
 
 JSObjectPtr Explorer::getProperty(
     const string& requestedProperty,
-    JSObjectPtr   providedObject)
+    JSObjectPtr providedObject)
 {
     LogDebug("Requested Property: " << requestedProperty);
 
-    if(!providedObject)
-    {
+    if (!providedObject) {
         LogError("Provided object is empty");
         return JSObjectPtr();
     }
@@ -106,27 +103,23 @@ JSObjectPtr Explorer::getProperty(
     std::string currentPropertyRequested = requestedProperty;
     JSObjectPtr currentObject = providedObject;
 
-    while(true)
-    {
+    while (true) {
         auto pos = currentPropertyRequested.find(".");
-        if (pos == string::npos)
-        {
+        if (pos == string::npos) {
             return getJSObjectProperty(currentPropertyRequested, currentObject);
         }
 
         //check if requested object has child
-        currentObjectName = currentPropertyRequested.substr(0,pos);
+        currentObjectName = currentPropertyRequested.substr(0, pos);
 
-        if (currentPropertyRequested.size() <= pos+1)
-        {
+        if (currentPropertyRequested.size() <= pos + 1) {
             LogError("Wrong name of requested property");
             return JSObjectPtr();
         }
-        currentPropertyRequested = currentPropertyRequested.substr(pos+1);
+        currentPropertyRequested = currentPropertyRequested.substr(pos + 1);
 
         currentObject = getJSObjectProperty(currentObjectName, currentObject);
-        if(!currentObject)
-        {
+        if (!currentObject) {
             LogError("Failed to get property: " << currentObjectName);
             return JSObjectPtr();
         }
@@ -140,92 +133,91 @@ bool Explorer::registerObject(const JSObjectDeclarationPtr& declaration,
 
     bool retValue;
 
-    if (declaration->getParentName() == GLOBAL_OBJECT_NAME)
-    {
+    if (declaration->getParentName() == GLOBAL_OBJECT_NAME) {
         LogDebug("Connect to Global object");
         retValue = register_(declaration, m_globalObject, context);
-    }
-    else //PIM support
-    {
+    } else { //PIM support
         LogDebug("Connect to NOT global object");
         //it should be master object name
         string masterName = declaration->getParentName();
         auto pos = masterName.find(".");
-        if (string::npos != pos)
-        {
+        if (string::npos != pos) {
             LogError("ParentName not allowed");
             return false;
         }
         auto masterObject = getJSObjectProperty(masterName, m_globalObject);
-        if (masterObject->getObject() == 0)
-        {
+        if (masterObject->getObject() == 0) {
             return false;
         }
-        retValue = registerObject(declaration, masterName, masterObject, context);
+        retValue = registerObject(declaration,
+                                  masterName,
+                                  masterObject,
+                                  context);
     }
 
     if (declaration->checkIframesSupported()) {
         LogDebug("Iframe supported");
         m_iframeSupport.registerDeclaration(declaration);
-//        m_iframeSupport.invokeCallbackForMainFrame(m_context,
-//                                                   declaration,
-//                                                   newObject);
-    }
-    else {
+        //        m_iframeSupport.invokeCallbackForMainFrame(m_context,
+        //                                                   declaration,
+        //                                                   newObject);
+    } else {
         LogDebug("Iframe NOT supported");
     }
 
     return retValue;
 }
 
-
 bool Explorer::registerObject(const JSObjectDeclarationPtr& declaration,
-                               const std::string& providedObjectName,
-                               JSObjectPtr providedObject,
-                               JSGlobalContextRef context)
+                              const std::string& providedObjectName,
+                              JSObjectPtr providedObject,
+                              JSGlobalContextRef context)
 {
-    LogDebug("Register object. Provided object name: '" << providedObjectName
-             << "', registration of: '"  <<  declaration->getName() << "'");
+    LogDebug(
+        "Register object. Provided object name: '" << providedObjectName
+                                                   <<
+        "', registration of: '" << declaration->getName() << "'");
 
     std::string fullParentName = declaration->getParentName();
     LogDebug("Parent name: " << declaration->getParentName());
 
-    if(fullParentName == providedObjectName)
-    {
+    if (fullParentName == providedObjectName) {
         LogDebug("Provided object match equaly to requested parent");
         return register_(declaration, providedObject, context);
     }
 
     //check if object exists in fullParentName
     auto pos = fullParentName.find(providedObjectName);
-    if(pos == string::npos)
-    {
-        LogError("Object: " << declaration->getName()
-                 << " should be child of: " << declaration->getParentName()
-                 << " but you provided object: " << providedObjectName);
+    if (pos == string::npos) {
+        LogError(
+            "Object: " << declaration->getName()
+                       << " should be child of: " <<
+            declaration->getParentName()
+                       << " but you provided object: " <<
+            providedObjectName);
 
         return false;
     }
 
-    if (fullParentName.size() <= pos+providedObjectName.size()+1)
-    {
+    if (fullParentName.size() <= pos + providedObjectName.size() + 1) {
         LogError("Invalid object name");
         return false;
     }
 
     auto currentRequesteProperty =
-        fullParentName.substr(pos+providedObjectName.size()+1);
-
+        fullParentName.substr(pos + providedObjectName.size() + 1);
 
     JSObjectPtr jsObject = getProperty(
-        currentRequesteProperty, providedObject);
+            currentRequesteProperty, providedObject);
 
-    if(!jsObject->getObject())
-    {
-        LogError("Object: '" << declaration->getName()
-                 << "' should be child of: '" << declaration->getParentName()
-                 << "'. you provided object: '" << providedObjectName
-                 << "' but object is null");
+    if (!jsObject->getObject()) {
+        LogError(
+            "Object: '" << declaration->getName()
+                        << "' should be child of: '" <<
+            declaration->getParentName()
+                        << "'. you provided object: '" <<
+            providedObjectName
+                        << "' but object is null");
 
         return false;
     }
@@ -234,8 +226,8 @@ bool Explorer::registerObject(const JSObjectDeclarationPtr& declaration,
 }
 
 bool Explorer::register_(const JSObjectDeclarationPtr& declaration,
-                              JSObjectPtr parent,
-                              JSGlobalContextRef context)
+                         JSObjectPtr parent,
+                         JSGlobalContextRef context)
 {
     LogInfo("Registration object: " << declaration->getParentName() <<
             "<-" << declaration->getName());
@@ -244,11 +236,11 @@ bool Explorer::register_(const JSObjectDeclarationPtr& declaration,
 
     typedef JSObjectDeclaration::Options JO;
 
-    JSGlobalContextRef gContext = (context==NULL)?m_context:context;
+    JSGlobalContextRef gContext = (context == NULL) ? m_context : context;
     JSObjectPtr newObject;
 
     JSObjectPtr objectInstance = JavaScriptInterfaceSingleton::Instance().
-        createObject(gContext,declaration);
+            createObject(gContext, declaration);
 
     //function creation
     if (declaration->getOptions() &&
@@ -257,33 +249,28 @@ bool Explorer::register_(const JSObjectDeclarationPtr& declaration,
         LogDebug("Loading function object " << declaration->getName());
 
         auto type = declaration->getOptions()->getIframeOverlay();
-        if (JO::IFrameOverlay::OverlayedBeforeOriginal == type)
-        {
+        if (JO::IFrameOverlay::OverlayedBeforeOriginal == type) {
             LogDebug("Create overlayed function");
             JSObjectPtr original =
                 JavaScriptInterfaceSingleton::Instance().
-                getJSObjectProperty(gContext,
-                                    parent,
-                                    declaration->getName());
+                    getJSObjectProperty(gContext,
+                                        parent,
+                                        declaration->getName());
             newObject = JSOverlaySupport::
-                createWrappedFunction(gContext,
-                                      original,
-                                      objectInstance,
-                                      declaration->getName());
-        }
-        else
-        {
+                    createWrappedFunction(gContext,
+                                          original,
+                                          objectInstance,
+                                          declaration->getName());
+        } else {
             LogDebug("create normal function");
             newObject = objectInstance;
         }
-    }
-    else //object creation
-    {
+    } else { //object creation
         newObject = objectInstance;
     }
 
     JavaScriptInterfaceSingleton::Instance().setObjectProperty(
-            gContext,
+        gContext,
         parent,
         declaration->getName(),
         newObject);
@@ -298,16 +285,15 @@ bool Explorer::register_(const JSObjectDeclarationPtr& declaration,
                                                   objectInstance->getObject());
     }
 
-
     return true;
 }
 
-void Explorer::registerObjectIntoIframe(const JSObjectDeclarationPtr& declaration,
-                                        JSObjectPtr frameObject,
-                                        JSGlobalContextRef context)
+void Explorer::registerObjectIntoIframe(
+    const JSObjectDeclarationPtr& declaration,
+    JSObjectPtr frameObject,
+    JSGlobalContextRef context)
 {
-    if (declaration->getParentName() == GLOBAL_OBJECT_NAME)
-    {
+    if (declaration->getParentName() == GLOBAL_OBJECT_NAME) {
         LogDebug("Connect to Global object of IFRAME");
         register_(declaration, frameObject, context);
         return;
@@ -319,14 +305,12 @@ void Explorer::registerObjectIntoIframe(const JSObjectDeclarationPtr& declaratio
         //it should be master object name
         string masterName = declaration->getParentName();
         auto pos = masterName.find(".");
-        if (string::npos != pos)
-        {
+        if (string::npos != pos) {
             LogError("ParentName not allowed");
             return;
         }
         auto masterObject = getJSObjectProperty(masterName, frameObject);
-        if (!masterObject->getObject())
-        {
+        if (!masterObject->getObject()) {
             LogError("Object not exist in frame");
             return;
         }
@@ -334,7 +318,6 @@ void Explorer::registerObjectIntoIframe(const JSObjectDeclarationPtr& declaratio
     }
 }
 
-
 void Explorer::loadFrame(JSGlobalContextRef context)
 {
     LogDebug("Frame attached");
@@ -345,8 +328,7 @@ void Explorer::loadFrame(JSGlobalContextRef context)
     LogDebug("Register main frame");
     //register main frame;
 
-    if(frameObject->getObject() == m_globalObject->getObject())
-    {
+    if (frameObject->getObject() == m_globalObject->getObject()) {
         // Main page was already loaded from constructor
         LogDebug("Main page loaded");
         return;
@@ -378,8 +360,7 @@ void Explorer::removePluginsFromIframes()
 {
     LogDebug("Remove plugins from iframes");
 
-    if (m_iframeSupport.hasIframes())
-    {
+    if (m_iframeSupport.hasIframes()) {
         LogDebug("Removing iframes");
         JavaScriptInterfaceSingleton::Instance().removeIframes(m_context);
     }
@@ -389,8 +370,7 @@ void Explorer::deregisterObject(const JSObjectDeclarationPtr& declaration)
 {
     LogDebug("Deregister object " << declaration->getName());
 
-    if (GLOBAL_OBJECT_NAME != declaration->getParentName())
-    {
+    if (GLOBAL_OBJECT_NAME != declaration->getParentName()) {
         LogWarning("Ignored remove property " << declaration->getName());
         return;
     }
@@ -421,7 +401,8 @@ void Explorer::callEventListeners(CustomEventType eventType, void* data)
     if (eventType == ServiceCustomEvent) {
         using namespace WrtDeviceApis::TizenServiceEvent::Api;
         // set user data of js callback function for 'appservice' js event
-        ITizenServiceEventPtr event = ITizenServiceEventPtr(new TizenServiceEvent());
+        ITizenServiceEventPtr event = ITizenServiceEventPtr(
+                new TizenServiceEvent());
         event->setScale(m_propertySupport->getScale());
         event->setBundle(m_propertySupport->getBundle());
 
@@ -433,10 +414,11 @@ void Explorer::callEventListeners(CustomEventType eventType, void* data)
             auto eventPriv =
                 new JSTizenServiceEventPrivateObject(m_context, event);
             JSObjectRef eventObject =
-                JSObjectMake(m_context, JSTizenServiceEvent::getClassRef(), eventPriv);
+                JSObjectMake(m_context,
+                             JSTizenServiceEvent::getClassRef(), eventPriv);
 
             AddEventListenerSupport::CallCustomEventListenersFromIFrame(
-                    frame, eventType, eventObject);
+                frame, eventType, eventObject);
         }
     } else if (eventType == SoftKeyboardChangeCustomEvent) {
         using namespace WrtDeviceApis::SoftKeyboardChangeEvent::Api;
@@ -445,17 +427,20 @@ void Explorer::callEventListeners(CustomEventType eventType, void* data)
             return;
         }
 
-        // set user data of js callback function for 'softkeyboardchange' js event
-        SoftKeyboardChangeArgs* args = static_cast<SoftKeyboardChangeArgs *>(data);
+        // 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));
+                new SoftKeyboardChangeEvent(
+                    args->state,
+                    args->width,
+                    args->height));
         LogInfo("softkeyboard event's state: " << args->state);
 
-        // call js callback function for 'softkeyboardchange' js event on each frame
+        // call js callback function for 'softkeyboardchange' js event on each
+        // frame
         FOREACH(it, *frameLists)
         {
             JSObjectRef frame = static_cast<JSObjectRef>((*it).Get()->getObject());
@@ -464,18 +449,17 @@ void Explorer::callEventListeners(CustomEventType eventType, void* data)
                 new JSSoftKeyboardChangeEventPrivateObject(m_context, event);
             JSObjectRef eventObject =
                 JSObjectMake(
-                        m_context,
-                        JSSoftKeyboardChangeEvent::getClassRef(),
-                        eventPriv);
+                    m_context,
+                    JSSoftKeyboardChangeEvent::getClassRef(),
+                    eventPriv);
 
             AddEventListenerSupport::CallCustomEventListenersFromIFrame(
-                    frame, eventType, eventObject);
+                frame, eventType, eventObject);
         }
     } else {
         LogInfo("Not supported custom event type");
         return;
     }
-
 }
 
 WindowPropertySupport* Explorer::getWindowPropertySupport()
index 0c81dcf..60d2fb6 100644 (file)
@@ -87,16 +87,15 @@ class Explorer : private DPL::Noncopyable
                                   JSGlobalContextRef context);
 
     bool register_(const JSObjectDeclarationPtr& declaration,
-                              JSObjectPtr parent,
-                              JSGlobalContextRef context);
-
+                   JSObjectPtr parent,
+                   JSGlobalContextRef context);
 
     JSObjectPtr getJSObjectProperty(const std::string& propertyName,
-                                  JSObjectPtr object);
+                                    JSObjectPtr object);
 
     JSObjectPtr getProperty(
         const std::string& requestedProperty,
-        JSObjectPtr   providedObject);
+        JSObjectPtr providedObject);
 };
 
 typedef DPL::SharedPtr<Explorer> ExplorerPtr;
index 0534397..9cb8827 100644 (file)
 IMPLEMENT_SINGLETON(JavaScriptInterface)
 
 #define CHECK_JSVALUE_IS_UNDEFINED_RETURN(context, object, ret) \
-    if (JSValueIsUndefined(context, object)) {\
-        LogError("Object " << #object << " is undefined");\
-        return ret;\
+    if (JSValueIsUndefined(context, object)) { \
+        LogError("Object " << #object << " is undefined"); \
+        return ret; \
     }
 
 #define CHECK_JSOBJECT_IS_NULL_RETURN(object, ret) \
-    if (!object) {\
-        LogError("Object " << #object << " is NULL");\
-        return ret;\
+    if (!object) { \
+        LogError("Object " << #object << " is NULL"); \
+        return ret; \
     }
 
 namespace {
@@ -71,39 +71,42 @@ std::string toString(const JSStringRef& arg)
 /**
  * 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;
+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 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;
+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){
+JSObjectRef getJSGlobalObject(JSGlobalContextRef context)
+{
     return JSContextGetGlobalObject(context);
 }
-
 }
 
 typedef JSValueRef (*JSCFunction)(
@@ -114,11 +117,10 @@ typedef JSValueRef (*JSCFunction)(
     const JSValueRef arguments[],
     JSValueRef* exception);
 
-
 void JavaScriptInterface::setObjectProperty(JSGlobalContextRef context,
-                                        const JSObjectPtr& parentObject,
-                                        const std::string &propertyName,
-                                        const JSObjectPtr& propertyObject)
+                                            const JSObjectPtr& parentObject,
+                                            const std::string &propertyName,
+                                            const JSObjectPtr& propertyObject)
 {
     LogInfo("Webkit:setting property --" << propertyName << "--");
 
@@ -135,8 +137,8 @@ void JavaScriptInterface::setObjectProperty(JSGlobalContextRef context,
 }
 
 void JavaScriptInterface::removeObjectProperty(JSGlobalContextRef context,
-        const JSObjectPtr& parentObject,
-        const std::string &propertyName)
+                                               const JSObjectPtr& parentObject,
+                                               const std::string &propertyName)
 {
     if (!context) {
         //nothing to do -> no context
@@ -152,9 +154,10 @@ void JavaScriptInterface::removeObjectProperty(JSGlobalContextRef context,
     JSStringRelease(name);
 }
 
-JavaScriptInterface::PropertiesList JavaScriptInterface::getObjectPropertiesList(
-        JSGlobalContextRef context,
-        const JSObjectPtr& object) const
+JavaScriptInterface::PropertiesList JavaScriptInterface::
+    getObjectPropertiesList(
+    JSGlobalContextRef context,
+    const JSObjectPtr& object) const
 {
     PropertiesList result;
     JSPropertyNameArrayRef properties = JSObjectCopyPropertyNames(
@@ -172,17 +175,17 @@ JavaScriptInterface::PropertiesList JavaScriptInterface::getObjectPropertiesList
 }
 
 JSObjectPtr JavaScriptInterface::makeJSFunctionObject(
-        JSGlobalContextRef context,
-        const std::string &name,
-        js_function_impl functionImplementation) const
+    JSGlobalContextRef context,
+    const std::string &name,
+    js_function_impl functionImplementation) const
 {
     LogDebug("Create JS function");
     JSStringRef jsFunName = JSStringCreateWithUTF8CString(name.c_str());
 
     JSObjectRef object = JSObjectMakeFunctionWithCallback(
-        context,
-        jsFunName,
-        reinterpret_cast<JSObjectCallAsFunctionCallback>(
+            context,
+            jsFunName,
+            reinterpret_cast<JSObjectCallAsFunctionCallback>(
                 functionImplementation));
 
     JSStringRelease(jsFunName);
@@ -190,8 +193,8 @@ JSObjectPtr JavaScriptInterface::makeJSFunctionObject(
 }
 
 JSObjectPtr JavaScriptInterface::makeJSClassObject(
-        JSGlobalContextRef context,
-        JSObjectDeclaration::ConstClassTemplate classTemplate) const
+    JSGlobalContextRef context,
+    JSObjectDeclaration::ConstClassTemplate classTemplate) const
 {
     LogDebug("Create JS object");
     JSObjectRef object = JSObjectMake(
@@ -203,92 +206,102 @@ JSObjectPtr JavaScriptInterface::makeJSClassObject(
 }
 
 JSObjectPtr JavaScriptInterface::makeJSObjectBasedOnInterface(
-        JSGlobalContextRef context,
-        const std::string &interfaceName) const
+    JSGlobalContextRef context,
+    const std::string &interfaceName) const
 {
     LogDebug("Create JS object base on interface: " << interfaceName);
     LogDebug("Context: " << context);
 
-
     JSObjectPtr jsInterfaceObj = getJSObjectProperty(context,
-            getGlobalObject(context), interfaceName);
+                                                     getGlobalObject(
+                                                         context),
+                                                     interfaceName);
     JSObjectRef object = JSObjectCallAsConstructor(context,
-            static_cast<JSObjectRef>(jsInterfaceObj->getObject()), 0, NULL,
-            NULL);
+                                                   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
+    JSGlobalContextRef context,
+    JSObjectDeclaration::ConstClassTemplate classTemplate,
+    JSObjectDeclaration::ConstructorCallback constructorCallback) const
 {
     LogDebug("Create JS interface. Context: " << context);
     JSObjectRef object = JSObjectMakeConstructor(context,
-            static_cast<JSClassRef>(
-                    const_cast<JSObjectDeclaration::ClassTemplate>(
-                            classTemplate)),
-            reinterpret_cast<JSObjectCallAsConstructorCallback>(
-                    constructorCallback)
-            );
+                                                 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)
+JSObjectPtr JavaScriptInterface::createObject(
+    JSGlobalContextRef context,
+    const JSObjectDeclarationPtr&
+    declaration)
 {
     typedef JSObjectDeclaration::Options JO;
 
-    if( declaration->getOptions())
-    {
-        switch (declaration->getOptions()->getType())
-        {
+    if (declaration->getOptions()) {
+        switch (declaration->getOptions()->getType()) {
         case JO::ClassType::Function:
             return makeJSFunctionObject(
-                    context,
-                    declaration->getName(),
-                    declaration->getOptions()->getFunctionImpl());
+                       context,
+                       declaration->getName(),
+                       declaration->getOptions()->getFunctionImpl());
 
         case JO::ClassType::Class:
             if (declaration->getInterfaceName().empty()) {
                 return makeJSClassObject(
-                        context,
-                        declaration->getClassTemplate());
+                           context,
+                           declaration->getClassTemplate());
             } else {
                 return makeJSObjectBasedOnInterface(
-                        context,
-                        declaration->getInterfaceName());
+                           context,
+                           declaration->getInterfaceName());
             }
 
         case JO::ClassType::Interface:
             return makeJSInterface(
-                    context,
-                    /* product class template */
-                    declaration->getClassTemplate(),
-                    declaration->getConstructorCallback());
+                       context,
+                       /* product class template */
+                       declaration->getClassTemplate(),
+                       declaration->getConstructorCallback());
 
         default:
             LogError("Invalid class type. Making empty JS object.");
             return JSObjectPtr(new JSObject(
-                    JSObjectMake(context, NULL, NULL)));
+                                   JSObjectMake(context, NULL, NULL)));
         }
     } else {
         LogDebug("No declaration options");
         return JSObjectPtr(new JSObject(
-                JSObjectMake(
-                    context,
-                    static_cast<JSClassRef>(
-                            const_cast<JSObjectDeclaration::ClassTemplate>(
-                                    declaration->getClassTemplate())),
-                    NULL)));
+                               JSObjectMake(
+                                   context,
+                                   static_cast<JSClassRef>(
+                                       const_cast<JSObjectDeclaration::
+                                                      ClassTemplate>(
+                                           declaration->getClassTemplate())),
+                                   NULL)));
     }
 }
 
 JSObjectPtr JavaScriptInterface::getGlobalObject(JSGlobalContextRef context)
-    const
+const
 {
     return JSObjectPtr(new JSObject(static_cast<JSObject::RealObject>(
-        JSContextGetGlobalObject(static_cast<JSGlobalContextRef>(context)))));
+                                        JSContextGetGlobalObject(static_cast<
+                                                                     JSGlobalContextRef>(
+                                                                     context)))));
 }
 
 JSObjectPtr JavaScriptInterface::copyObjectToIframe(
@@ -323,7 +336,7 @@ JSObjectPtr JavaScriptInterface::copyObjectToIframe(
     JSStringRelease(requestedObjectStr);
 
     return JSObjectPtr(
-        new JSObject(const_cast<OpaqueJSValue*>(requestedObject)));
+               new JSObject(const_cast<OpaqueJSValue*>(requestedObject)));
 }
 
 JavaScriptInterface::ObjectsListPtr
@@ -384,8 +397,9 @@ JavaScriptInterface::getIframesList(JSContextRef context,
 }
 
 JSObjectPtr JavaScriptInterface::getJSObjectProperty(JSGlobalContextRef ctx,
-                                         const JSObjectPtr& frame,
-                                         const std::string& name) const
+                                                     const JSObjectPtr& frame,
+                                                     const std::string& name)
+const
 {
     JSObjectRef frame_js = static_cast<JSObjectRef>(frame->getObject());
 
index 7b77cc6..c3aa171 100644 (file)
@@ -34,9 +34,9 @@
 
 //forward declaration of JSConectexRef
 extern "C" {
-    typedef const struct OpaqueJSContext* JSContextRef;
-    typedef struct OpaqueJSContext* JSGlobalContextRef;
-    typedef struct OpaqueJSValue* JSObjectRef;
+typedef const struct OpaqueJSContext* JSContextRef;
+typedef struct OpaqueJSContext* JSGlobalContextRef;
+typedef struct OpaqueJSValue* JSObjectRef;
 }
 
 class JavaScriptInterface : DPL::Noncopyable
@@ -79,31 +79,30 @@ class JavaScriptInterface : DPL::Noncopyable
     void invokeGarbageCollector(JSGlobalContextRef context);
 
     JSObjectPtr getJSObjectProperty(JSGlobalContextRef ctx,
-                            const JSObjectPtr& frame,
-                            const std::string& name) const;
+                                    const JSObjectPtr& frame,
+                                    const std::string& name) const;
 
   private:
     JavaScriptInterface()
-    {
-    }
+    {}
 
     JSObjectPtr makeJSFunctionObject(
-            JSGlobalContextRef context,
-            const std::string &name,
-            js_function_impl functionImplementation) const;
+        JSGlobalContextRef context,
+        const std::string &name,
+        js_function_impl functionImplementation) const;
     JSObjectPtr makeJSClassObject(
-            JSGlobalContextRef context,
-            JSObjectDeclaration::ConstClassTemplate classTemplate) const;
+        JSGlobalContextRef context,
+        JSObjectDeclaration::ConstClassTemplate classTemplate) const;
     JSObjectPtr makeJSObjectBasedOnInterface(
-            JSGlobalContextRef context,
-            const std::string &interfaceName) const;
+        JSGlobalContextRef context,
+        const std::string &interfaceName) const;
     JSObjectPtr makeJSInterface(
-            JSGlobalContextRef context,
-            JSObjectDeclaration::ConstClassTemplate classTemplate,
-            JSObjectDeclaration::ConstructorCallback constructorCallback) const;
+        JSGlobalContextRef context,
+        JSObjectDeclaration::ConstClassTemplate classTemplate,
+        JSObjectDeclaration::ConstructorCallback constructorCallback) const;
 
     ObjectsListPtr getIframesList(JSContextRef context,
-            JSObjectRef object) const;
+                                  JSObjectRef object) const;
 
     friend class DPL::Singleton<JavaScriptInterface>;
 };
index 1534d24..91f8cec 100644 (file)
@@ -141,26 +141,26 @@ class JSPageSession::Impl
                              const char* theme);
 
     void dispatchJavaScriptEvent(CustomEventType eventType, void* data);
-
 };
 
-
 JSPageSession::Impl::Impl(const PluginContainerSupportPtr& support) :
-    m_sessionStarted(false)
+        m_widgetHandle(0),
+        m_context(NULL),
+        m_sessionStarted(false),
+        m_objectExplorer(NULL)
 {
-//    DPL::Log::LogSystemSingleton::Instance().SetTag("WRT_PLUGINS");
+    //    DPL::Log::LogSystemSingleton::Instance().SetTag("WRT_PLUGINS");
     LogDebug("Initializing Page Session");
     m_pluginsSupport = support;
 
     // explicit call to keep singleton's lifetime until calling destructor.
-//    JsFunctionManagerSingleton::Instance();
-//    JavaScriptInterfaceSingleton::Instance();
+    //    JsFunctionManagerSingleton::Instance();
+    //    JavaScriptInterfaceSingleton::Instance();
 }
 
 JSPageSession::Impl::~Impl()
 {
-    if(m_sessionStarted)
-    {
+    if (m_sessionStarted) {
         LogError("Must stop widget session before exit!");
         stopSession();
     }
@@ -207,9 +207,7 @@ bool JSPageSession::Impl::installPlugin(PluginModelPtr plugin)
 
     LogInfo("Install Plugin '" << library->GetFileName());
 
-
-    if(!library)
-    {
+    if (!library) {
         LogError("Loading library failed");
         return false;
     }
@@ -231,7 +229,7 @@ void JSPageSession::Impl::installRequestedFeatures()
     LogInfo("Installing requested widget features...");
 
     std::list<std::string> allowedFeatures =
-            m_pluginsSupport->getAllowedFeatures(m_widgetHandle);
+        m_pluginsSupport->getAllowedFeatures(m_widgetHandle);
 
     PluginContainerSupport::PluginsList allowedPlugins;
 
@@ -242,14 +240,14 @@ void JSPageSession::Impl::installRequestedFeatures()
         auto plugin = m_pluginsSupport->getPluginForFeature(*feature);
         ImplementedObjectsList implObjs =
             PluginDAOReadOnly::
-            getImplementedObjectsForPluginHandle(plugin->Handle.Get());
+                getImplementedObjectsForPluginHandle(plugin->Handle.Get());
 
         FOREACH(obj, implObjs)
         {
             LogDebug("Processing object: " << *obj);
             /* 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 */
+             * 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);
                 LogWarning("Plugin will be added: "
@@ -283,50 +281,49 @@ bool JSPageSession::Impl::loadPluginOnDemand(
         LogError("Session not started");
         return false;
     }
-//    //TODO here may be a bug. if plugin contains feature rejected and accepted
-//    LogInfo("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;
-//    }
+    //    //TODO here may be a bug. if plugin contains feature rejected and
+    // accepted
+    //    LogInfo("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);
+               m_pluginsSupport->getPluginModelById(pluginHandle),
+               parentObject,
+               context);
 }
 
 bool JSPageSession::Impl::installPluginOnDemand(PluginModelPtr plugin,
-                                              JavaScriptObject& parentObject,
-                                              JSGlobalContextRef context)
+                                                JavaScriptObject& parentObject,
+                                                JSGlobalContextRef context)
 {
     Assert(plugin && "Plugin Model is NULL");
     auto library = loadLibrary(plugin);
 
     LogInfo("Install Plugin '" << library->GetFileName());
 
-    if(!library)
-    {
+    if (!library) {
         LogError("Loading library failed");
         return false;
     }
 
-    if(!(parentObject.instance))
-    {
+    if (!(parentObject.instance)) {
         LogError("NULL pointer value");
         return false;
     }
 
     JSObjectPtr parent(new JSObject(parentObject.instance));
 
-    if (!parent->getObject())
-    {
+    if (!parent->getObject()) {
         LogError("NULL pointer value");
         assert(false);
         return false;
@@ -340,10 +337,11 @@ bool JSPageSession::Impl::installPluginOnDemand(PluginModelPtr plugin,
                                              parent,
                                              context);
 
-        if(!installationStatus)
-        {
-            LogError("Object Registration failed : " << (*it)->getName()
-                     << "; Parent object name: " << parentObject.name);
+        if (!installationStatus) {
+            LogError(
+                "Object Registration failed : " << (*it)->getName()
+                                                <<
+                "; Parent object name: " << parentObject.name);
             return false;
         }
     }
@@ -353,11 +351,13 @@ bool JSPageSession::Impl::installPluginOnDemand(PluginModelPtr plugin,
 }
 
 void JSPageSession::Impl::setCustomProperties(double scaleFactor,
-                                            const char* encodedBundle,
-                                            const char* theme)
+                                              const char* encodedBundle,
+                                              const char* theme)
 {
-    LogInfo("set properties of window object " << scaleFactor << ", "
-            << encodedBundle << ", " << theme);
+    LogInfo(
+        "set properties of window object " << scaleFactor << ", "
+                                           << encodedBundle << ", " <<
+        theme);
 
     m_objectExplorer->getWindowPropertySupport()
         ->setScaleToNavigatorProperty(scaleFactor);
@@ -367,7 +367,8 @@ void JSPageSession::Impl::setCustomProperties(double scaleFactor,
         ->setThemeToNavigatorProperty(theme);
 }
 
-void JSPageSession::Impl::dispatchJavaScriptEvent(CustomEventType eventType, void* data)
+void JSPageSession::Impl::dispatchJavaScriptEvent(CustomEventType eventType,
+                                                  void* data)
 {
     // Check if session is already started
     if (!m_sessionStarted) {
@@ -383,37 +384,40 @@ void JSPageSession::Impl::loadInjectedJavaScript()
 {
     LogInfo("Entered");
 
-    std::string DIR_PATH     = "/usr/etc/wrt/injected-javascript";
+    std::string DIR_PATH = "/usr/etc/wrt/injected-javascript";
     std::string JS_EXTENSION = ".js";
 
     DIR *dir = opendir(DIR_PATH.c_str());
 
     if (!dir) {
-        LogError("opendir(\"" << DIR_PATH << "\") error!" );
+        LogError("opendir(\"" << DIR_PATH << "\") error!");
         return;
     }
 
-    struct dirent* libdir;
+    int return_code;
+    struct dirent libdir;
+    struct dirent* result;
     std::list<std::string> jsFiles;
 
     // make file list from DIR_PATH
-    while ((libdir = readdir(dir)) != 0)
-    {
-        if (strncmp(libdir->d_name, ".", 2) == 0 ||
-            strncmp(libdir->d_name, "..", 3) == 0)
+    for (return_code = readdir_r(dir, &libdir, &result);
+            result != NULL && return_code == 0;
+            return_code = readdir_r(dir, &libdir, &result)) {
+        if (strncmp(libdir.d_name, ".", 2) == 0 ||
+            strncmp(libdir.d_name, "..", 3) == 0)
         {
             continue;
         }
 
         std::string filepath = DIR_PATH;
         filepath += "/";
-        filepath += libdir->d_name;
+        filepath += libdir.d_name;
 
         std::string lowercase = filepath;
         std::transform(lowercase.begin(), lowercase.end(), lowercase.begin(),
                        towlower);
 
-        iflowercase.rfind(JS_EXTENSION) == std::string::npos ||
+        if (lowercase.rfind(JS_EXTENSION) == std::string::npos ||
             lowercase.length() !=
             lowercase.rfind(JS_EXTENSION) + JS_EXTENSION.length() )
         {
@@ -436,10 +440,11 @@ void JSPageSession::Impl::loadInjectedJavaScript()
         LogInfo("Added : " << filepath);
         jsFiles.push_back(filepath);
     }
+    if (0 != return_code)
+        LogError("Error while reading directory.");
 
     closedir(dir);
 
-
     FOREACH(it, jsFiles)
     {
         LogDebug("load file : " << (*it));
@@ -447,8 +452,7 @@ void JSPageSession::Impl::loadInjectedJavaScript()
         std::string content;
         std::ifstream fin(it->c_str());
 
-        while(fin.good())
-        {
+        while (fin.good()) {
             string line;
             std::getline(fin, line);
             content += line + "\n";
@@ -456,8 +460,7 @@ void JSPageSession::Impl::loadInjectedJavaScript()
 
         fin.close();
         // execute
-        if(!content.empty())
-        {
+        if (!content.empty()) {
             JSValueRef exception = NULL;
             JSStringRef script =
                 JSStringCreateWithUTF8CString(content.c_str());
@@ -466,10 +469,9 @@ void JSPageSession::Impl::loadInjectedJavaScript()
 
             JSStringRelease(script);
 
-            if(exception)
-            {
+            if (exception) {
                 LogDebug("Exception Occured while injecting javascript "
-                    "file. : " << *it);
+                         "file. : " << *it);
 
                 JSStringRef exceptionJSString =
                     JSValueToStringCopy(m_context, exception, NULL);
@@ -480,18 +482,18 @@ void JSPageSession::Impl::loadInjectedJavaScript()
                                        exceptionString, size);
                 LogDebug("Exception : " << exceptionString);
 
-                delete [] exceptionString;
+                delete[] exceptionString;
                 JSStringRelease(exceptionJSString);
-             }
+            }
         }
     }
 }
 
 void JSPageSession::Impl::startSession(int widgetHandle,
-                                     JSGlobalContextRef context,
-                                     double scaleFactor,
-                                     const char* encodedBundle,
-                                     const char* theme)
+                                       JSGlobalContextRef context,
+                                       double scaleFactor,
+                                       const char* encodedBundle,
+                                       const char* theme)
 {
     LogInfo("Starting widget session...");
 
@@ -543,7 +545,6 @@ void JSPageSession::Impl::stopSession()
     LogInfo("Widget session stopped.");
 }
 
-
 void JSPageSession::Impl::unloadPluginsFromSession()
 {
     LogDebug("Unload plugins from session");
@@ -580,9 +581,6 @@ void JSPageSession::Impl::unloadPluginsFromSession()
     m_objectExplorer = NULL;
 }
 
-
-
-
 void JSPageSession::Impl::performLibrariesUnload()
 {
 #if 0
@@ -610,19 +608,16 @@ void JSPageSession::Impl::performLibrariesUnload()
 PluginPtr JSPageSession::Impl::loadLibrary(PluginModelPtr& pluginModel)
 {
     PluginPtr pluginLib = pluginModel->LibraryInstance.Get();
-    if (!pluginLib)
-    {
+    if (!pluginLib) {
         std::string path = pluginModel->LibraryPath.Get() +
-                           std::string(LIBRARY_PATH_SEPARATOR) +
-                           pluginModel->LibraryName.Get();
+            std::string(LIBRARY_PATH_SEPARATOR) +
+            pluginModel->LibraryName.Get();
 
         pluginLib = Plugin::LoadFromFile(path);
 
-        if (!pluginLib)
-        {
+        if (!pluginLib) {
             LogError("Loading library failed");
-        } else
-        {
+        } else {
             pluginModel->LibraryInstance.Set(pluginLib);
 
             LogDebug("On widget start");
@@ -636,9 +631,7 @@ PluginPtr JSPageSession::Impl::loadLibrary(PluginModelPtr& pluginModel)
                 pluginLib->OnFrameLoad(*context);
             }
         }
-    }
-    else
-    {
+    } else {
         LogDebug("Get from LibraryInstance");
         LogDebug("On widget start");
         // This is first time for this plugin, start widget Session
@@ -655,7 +648,6 @@ PluginPtr JSPageSession::Impl::loadLibrary(PluginModelPtr& pluginModel)
     return pluginLib;
 }
 
-
 void JSPageSession::Impl::loadFrame(JSGlobalContextRef context)
 {
     LogDebug("Load a frame");
@@ -698,12 +690,11 @@ void JSPageSession::Impl::unloadFrame(JSGlobalContextRef context)
     m_objectExplorer->unloadFrame(context);
 }
 
-
 void JSPageSession::startSession(int widgetHandle,
-                               JSGlobalContextRef ctx,
-                               double scaleFactor,
-                               const char* encodedBundle,
-                               const char* theme)
+                                 JSGlobalContextRef ctx,
+                                 double scaleFactor,
+                                 const char* encodedBundle,
+                                 const char* theme)
 {
     m_impl->startSession(widgetHandle, ctx, scaleFactor, encodedBundle, theme);
 }
@@ -727,13 +718,14 @@ bool JSPageSession::loadPluginOnDemand(
 }
 
 void JSPageSession::setCustomProperties(double scaleFactor,
-                                      const char* encodedBundle,
-                                      const char* theme)
+                                        const char* encodedBundle,
+                                        const char* theme)
 {
     m_impl->setCustomProperties(scaleFactor, encodedBundle, theme);
 }
 
-void JSPageSession::dispatchJavaScriptEvent(CustomEventType eventType, void* data)
+void JSPageSession::dispatchJavaScriptEvent(CustomEventType eventType,
+                                            void* data)
 {
     m_impl->dispatchJavaScriptEvent(eventType, data);
 }
@@ -749,10 +741,9 @@ void JSPageSession::unloadFrame(JSGlobalContextRef context)
 }
 
 JSPageSession::JSPageSession(const PluginContainerSupportPtr& containerSupport)
-    : m_impl(new JSPageSession::Impl(containerSupport))
-{
-}
+    :
+    m_impl(new JSPageSession::Impl(containerSupport))
+{}
 
 JSPageSession::~JSPageSession()
-{
-}
+{}
index bb85699..076582e 100644 (file)
@@ -24,8 +24,8 @@
 
 //forward declaration of JSConectexRef
 extern "C" {
-    typedef struct OpaqueJSContext* JSGlobalContextRef;
-    typedef struct OpaqueJSValue* JSObjectRef;
+typedef struct OpaqueJSContext* JSGlobalContextRef;
+typedef struct OpaqueJSValue* JSObjectRef;
 }
 
 struct JavaScriptObject
index 9ab4518..7a468a4 100644 (file)
 #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) :
+               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),
@@ -40,8 +40,7 @@ Plugin::Plugin(const std::string &fileName,
     m_apiOnFrameLoad(apiOnFrameLoad),
     m_apiOnFrameUnload(apiOnFrameUnload),
     m_apiClassList(apiClassList)
-{
-}
+{}
 
 Plugin::~Plugin()
 {
@@ -59,10 +58,10 @@ PluginPtr Plugin::LoadFromFile(const std::string& fileName)
 {
     LogDebug("LoadFromFile" << fileName);
 
-    LogDebug("Loading plugin: " << fileName);
-
     void *dllHandle;
-    dllHandle = dlopen(fileName.c_str(), RTLD_NOW);
+    dllHandle = dlopen(fileName.c_str(), RTLD_LAZY);
+
+    LogDebug("dlopen() done!");
 
     if (dllHandle == NULL) {
         LogError(
@@ -100,22 +99,21 @@ PluginPtr Plugin::LoadFromFile(const std::string& fileName)
         reinterpret_cast<get_widget_entity_map_proc *>(
             dlsym(dllHandle, PLUGIN_GET_CLASS_MAP_PROC_NAME));
 
-    if( getWidgetEntityMapProcPtr )
-    {
+    if (getWidgetEntityMapProcPtr) {
         rawClassList = (*getWidgetEntityMapProcPtr)();
-        LogDebug("rawClassList : " << rawClassList  << "by getWidgetClassMapProcPtr()");
-    }
-    else
-    {
+        LogDebug(
+            "rawClassList : " << rawClassList <<
+            "by getWidgetClassMapProcPtr()");
+    } else {
         rawClassList =
             static_cast<const js_entity_definition_t *>(dlsym(dllHandle,
-                                                        PLUGIN_CLASS_MAP_NAME));
-        LogDebug("rawClassList : " << rawClassList );
+                                                              PLUGIN_CLASS_MAP_NAME));
+        LogDebug("rawClassList : " << rawClassList);
     }
 
-
     if (NULL == onWidgetStartProcPtr || NULL == onWidgetStopProcPtr ||
-        /*NULL == onWidgetInitProcPtr ||*/ NULL == rawClassList) {
+        /*NULL == onWidgetInitProcPtr ||*/ NULL == rawClassList)
+    {
         LogWarning("#####");
         LogWarning(
             "##### Warning: The following plugin does not support new plugin API.");
@@ -151,7 +149,7 @@ PluginPtr Plugin::LoadFromFile(const std::string& fileName)
 
     // Parse all class definitions
     while (rawEntityListIterator->parent_name != NULL &&
-            rawEntityListIterator->object_name != NULL)
+           rawEntityListIterator->object_name != NULL)
     {
         // Logging
         LogInfo("#####");
@@ -193,12 +191,9 @@ std::string Plugin::GetFileName() const
 
 void Plugin::OnWidgetStart(int widgetId)
 {
-    if (NULL != m_apiOnWidgetStart)
-    {
+    if (NULL != m_apiOnWidgetStart) {
         (*m_apiOnWidgetStart)(widgetId);
-    }
-    else
-    {
+    } else {
         LogWarning("OnWidgetStart not set!");
     }
 }
@@ -206,48 +201,36 @@ void Plugin::OnWidgetStart(int widgetId)
 void Plugin::OnWidgetInit(feature_mapping_interface_t* mapping)
 {
     Assert(NULL != mapping && "NULL mapping interface provided");
-    if (NULL != m_apiOnWidgetInit)
-    {
+    if (NULL != m_apiOnWidgetInit) {
         (*m_apiOnWidgetInit)(mapping);
-    }
-    else
-    {
+    } else {
         LogWarning("OnWidgetInit not set!");
     }
 }
 
 void Plugin::OnWidgetStop(int widgetId)
 {
-    if (NULL != m_apiOnWidgetStop)
-    {
+    if (NULL != m_apiOnWidgetStop) {
         (*m_apiOnWidgetStop)(widgetId);
-    }
-    else
-    {
+    } else {
         LogWarning("OnWidgetStop not set!");
     }
 }
 
 void Plugin::OnFrameLoad(java_script_context_t context)
 {
-    if (NULL != m_apiOnFrameLoad)
-    {
+    if (NULL != m_apiOnFrameLoad) {
         (*m_apiOnFrameLoad)(context);
-    }
-    else
-    {
+    } else {
         LogWarning("OnFrameLoad not set!");
     }
 }
 
 void Plugin::OnFrameUnload(java_script_context_t context)
 {
-    if (NULL != m_apiOnFrameUnload)
-    {
+    if (NULL != m_apiOnFrameUnload) {
         (*m_apiOnFrameUnload)(context);
-    }
-    else
-    {
+    } else {
         LogWarning("OnFrameUnload not set!");
     }
 }
index d3eec30..1eb277f 100644 (file)
@@ -58,13 +58,13 @@ class Plugin : private DPL::Noncopyable
     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);
+           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();
index 4518b0f..5565e96 100644 (file)
@@ -36,7 +36,7 @@ using namespace WrtDB;
 
 #include <dpl/wrt-dao-ro/widget_dao_read_only.h>
 
-PluginContainerSupport::PluginContainerSupport(): m_initialized(false)
+PluginContainerSupport::PluginContainerSupport() : m_initialized(false)
 {
     // Reading standard features list from file
     readStandardFeaturesList();
@@ -56,14 +56,14 @@ PluginContainerSupport::~PluginContainerSupport()
 
 void PluginContainerSupport::Initialize(int widgetHandle)
 {
-    if (isInitialized() == false)
-    {
+    if (isInitialized() == false) {
         readAllowedPlugins(widgetHandle);
         readRootPlugins(widgetHandle);
     }
 }
 
-std::list<std::string> PluginContainerSupport::getAllowedFeatures(int widgetHandle) const
+std::list<std::string> PluginContainerSupport::getAllowedFeatures(
+    int widgetHandle) const
 {
     //TODO it has to return LIST NOT SET!!!
     WidgetDAOReadOnly widgetDao(widgetHandle);
@@ -74,7 +74,7 @@ std::list<std::string> PluginContainerSupport::getAllowedFeatures(int widgetHand
         LogInfo("Loading api-feature: " << it->name);
         if (it->rejected) {
             LogWarning("Api-feature was rejected by ace. (Api-feature name: "
-                       << it->name << ")" );
+                       << it->name << ")");
             continue;
         }
 
@@ -93,8 +93,11 @@ void PluginContainerSupport::readAllowedPlugins(int widgetHandle)
     }
 
     FeatureData* dt = NULL;
-    std::map<FeatureHandle, FeatureData> featureDataList = FeatureDAOReadOnly::GetFeatures(allowedFeatures);
-    DeviceCapList deviceCapabilities = FeatureDAOReadOnly::GetDevCapWithFeatureHandle();
+    std::map<FeatureHandle,
+             FeatureData> featureDataList = FeatureDAOReadOnly::GetFeatures(
+            allowedFeatures);
+    DeviceCapList deviceCapabilities =
+        FeatureDAOReadOnly::GetDevCapWithFeatureHandle();
     FOREACH(data, featureDataList) {
         dt = &(data->second);
         registerPluginModel(dt->pluginHandle);
@@ -117,7 +120,11 @@ void PluginContainerSupport::readRootPlugins(int widgetHandle)
     m_initialized = true;
 }
 
-void PluginContainerSupport::registerFeatureModel(FeatureHandle handle, FeatureData* data, DeviceCapList deviceCapabilities)
+void PluginContainerSupport::registerFeatureModel(
+    FeatureHandle handle,
+    FeatureData* data,
+    DeviceCapList
+    deviceCapabilities)
 {
     LogDebug("Analyzing feature: " << handle);
     FeatureModelPtr model = getFeatureModel(handle);
@@ -277,8 +284,7 @@ PluginContainerSupport::getStandardPlugins() const
     FOREACH(it, features)
     {
         auto plugin = getPluginModel(*it);
-        if(!plugin)
-        {
+        if (!plugin) {
             LogError("PluginModel not found");
             continue;
         }
@@ -307,5 +313,5 @@ PluginContainerSupport::getPluginsList() const
 PluginModelPtr
 PluginContainerSupport::getPluginForFeature(const std::string& featureName)
 {
-   return getPluginModel(getFeatureModel(featureName));
+    return getPluginModel(getFeatureModel(featureName));
 }
index 8bd361e..1069cf9 100644 (file)
 
 class PluginContainerSupport
 {
-public:
+  public:
     typedef std::list<WrtDB::FeatureModelPtr> FeaturesList;
     typedef std::list<PluginModelPtr> PluginsList;
 
-private:
+  private:
     // Standard features
     typedef std::list<std::string> StandardFeatureList;
 
@@ -54,23 +54,28 @@ private:
 
     bool m_initialized;
 
-private:
+  private:
     // Reading
     void readStandardFeaturesList();
 
     // Plugin models
     typedef std::multimap<WrtDB::FeatureHandle, std::string> DeviceCapList;
-    void registerFeatureModel(WrtDB::FeatureHandle handle, WrtDB::FeatureData* data, DeviceCapList deviceCapabilities);
+    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 ;
+    WrtDB::FeatureModelPtr getFeatureModel(const std::string &name) const;
+    WrtDB::FeatureModelPtr getFeatureModel(WrtDB::FeatureHandle handle) const;
 
     PluginModelPtr getPluginModel(const WrtDB::FeatureModelPtr &feature) const;
 
-public:
+  public:
     PluginContainerSupport();
 
-    bool isInitialized() { return m_initialized; }
+    bool isInitialized()
+    {
+        return m_initialized;
+    }
     void Initialize(int widgetHandle);
     void registerPluginModel(WrtDB::DbPluginHandle handle);
     std::list<std::string> getAllowedFeatures(int widgetHandle) const;
@@ -87,7 +92,6 @@ public:
     ~PluginContainerSupport();
 };
 
-
 typedef std::shared_ptr<PluginContainerSupport> PluginContainerSupportPtr;
 
 #endif // PLUGIN_CONTAINER_SUPPORT_H
index 311d847..2e1c8c6 100644 (file)
@@ -30,28 +30,29 @@ void IframesSupport::registerDeclaration(
     LogDebug("Registration iframes-supported plugins " <<
              declaration->getName());
 
-    if(declaration->getParentName().find('.') != std::string::npos)
-    {
+    if (declaration->getParentName().find('.') != std::string::npos) {
         LogWarning("The object will not be loaded to iframes");
         return;
     }
     m_iframesObjects.push_back(declaration);
 }
 
-void IframesSupport::registerIframe(const JSObjectPtr& iframe){
+void IframesSupport::registerIframe(const JSObjectPtr& iframe)
+{
     LogDebug("LoadedIframes size: " << m_loadedIframes.size() );
 
     m_loadedIframes.insert(iframe);
 }
 
-void IframesSupport::unregisterIframe(const JSObjectPtr& iframe){
+void IframesSupport::unregisterIframe(const JSObjectPtr& iframe)
+{
     LogDebug("LoadedIframes size: " << m_loadedIframes.size() );
 
     auto it_loaded = std::find_if(m_loadedIframes.begin(),
-            m_loadedIframes.end(),
-            std::bind2nd(EqualToJSObjectPtr(), iframe));
+                                  m_loadedIframes.end(),
+                                  std::bind2nd(EqualToJSObjectPtr(), iframe));
     //object not found, so thats the new iframe
-    if(it_loaded == m_loadedIframes.end()){
+    if (it_loaded == m_loadedIframes.end()) {
         LogDebug("Nothing to unregister");
         return;
     }
index ce5cd14..0c98768 100644 (file)
@@ -22,8 +22,8 @@
 #ifndef _WRTENGINE_SRC_PLUGINSERVICE_IFRAME_SUPPORT_H_
 #define _WRTENGINE_SRC_PLUGINSERVICE_IFRAME_SUPPORT_H_
 
-#include<list>
-#include<set>
+#include <list>
+#include <set>
 #include <Commons/JSObjectDeclaration.h>
 #include <Commons/JSObject.h>
 #include "javascript_interface.h"
@@ -53,12 +53,12 @@ class IframesSupport
     // used to find matching object from m_loadedIframes
     struct EqualToJSObjectPtr
     {
-        typedef JSObjectPtr     first_argument_type;
-        typedef JSObjectPtr     second_argument_type;
-        typedef bool            result_type;
+        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
+                               const second_argument_type &s2) const
         {
             return (s1->getObject() == s2->getObject());
         }
index 5fb5d70..c3bf0fd 100644 (file)
@@ -67,7 +67,6 @@ using namespace WrtPlugins::W3C;
 
 namespace {
 const char *LIBRARY_PATH_SEPARATOR = "/";
-const char* FEATURE_WAC20_DEVICAPIS_NAME = "http://wacapps.net/api/deviceapis";
 }
 
 class PluginLogic::Impl
@@ -77,7 +76,6 @@ class PluginLogic::Impl
     typedef std::map<JSContextRef, JSPageSessionPtr> PagesSessionsSet;
     PagesSessionsSet m_sessions;
 
-
   public:
     Impl();
     ~Impl();
@@ -118,10 +116,10 @@ IMPLEMENT_SINGLETON(PluginLogic);
 bool PluginLogic::Impl::s_sanityCheck = false;
 
 #define PLUGIN_LOGIC_SANITY_CHECK \
-    if(!s_sanityCheck)\
-    {\
-        LogError("Object is not available. Wrong flow occured");\
-        return;\
+    if (!s_sanityCheck) \
+    { \
+        LogError("Object is not available. Wrong flow occured"); \
+        return; \
     }
 
 PluginLogic::Impl::Impl()
@@ -174,7 +172,7 @@ void PluginLogic::stopSession(JSGlobalContextRef context)
 void PluginLogic::performLibrariesUnload()
 {
     LogError("Libraries unload TURNED OFF");
-//    m_impl->performLibrariesUnload();
+    //    m_impl->performLibrariesUnload();
 }
 
 bool PluginLogic::loadPluginOnDemand(
@@ -185,14 +183,14 @@ bool PluginLogic::loadPluginOnDemand(
     return m_impl->loadPluginOnDemand(pluginHandle, parentObject, context);
 }
 
-void PluginLogic::loadPluginsIntoIframes(JSGlobalContextRef context)
+void PluginLogic::loadPluginsIntoIframes(JSGlobalContextRef /*context*/)
 {
     LogError("This function is Deprecated");
 }
 
-void PluginLogic::setCustomProperties(double scaleFactor,
-                                      const char* encodedBundle,
-                                      const char* theme)
+void PluginLogic::setCustomProperties(double /*scaleFactor*/,
+                                      const char* /*encodedBundle*/,
+                                      const char* /*theme*/)
 {
     LogError("This function is DEPRECATED");
 }
@@ -205,7 +203,7 @@ void PluginLogic::setCustomProperties(JSGlobalContextRef context,
     m_impl->setCustomProperties(context, scaleFactor, encodedBundle, theme);
 }
 
-void PluginLogic::dispatchJavaScriptEvent(CustomEventType eventType)
+void PluginLogic::dispatchJavaScriptEvent(CustomEventType /*eventType*/)
 {
     LogError("This function is DEPRECATED");
 }
@@ -228,12 +226,10 @@ void PluginLogic::unloadFrame(JSGlobalContextRef context)
 }
 
 PluginLogic::PluginLogic() : m_impl(new PluginLogic::Impl())
-{
-}
+{}
 
 PluginLogic::~PluginLogic()
-{
-}
+{}
 
 void PluginLogic::Impl::initSession(int widgetHandle)
 {
@@ -245,33 +241,36 @@ void PluginLogic::Impl::initSession(int widgetHandle)
     LogDebug("Preload plugins so file");
 
     PluginContainerSupport::PluginsList pluginList =
-                                          m_pluginsSupport->getPluginsList();
+        m_pluginsSupport->getPluginsList();
 
     FOREACH(it, pluginList)
     {
         PluginModelPtr& pluginModel = *it;
+
+        if (!pluginModel->LibraryDependencies.Get()->empty()) {
+            // Only Root Object
+            continue;
+        }
+
         PluginPtr pluginLib = pluginModel->LibraryInstance.Get();
 
-        if (!pluginLib)
-        {
+        if (!pluginLib) {
             std::string path = pluginModel->LibraryPath.Get() +
-                               std::string(LIBRARY_PATH_SEPARATOR) +
-                               pluginModel->LibraryName.Get();
+                std::string(LIBRARY_PATH_SEPARATOR) +
+                pluginModel->LibraryName.Get();
 
             pluginLib = Plugin::LoadFromFile(path);
 
-            if (!pluginLib)
-            {
+            if (!pluginLib) {
                 LogError("Loading library failed");
-            } else
-            {
+            } else {
                 pluginModel->LibraryInstance.Set(pluginLib);
 
-                LogDebug("pluginModel->LibraryInstance.Set() : " << pluginLib->GetFileName());
+                LogDebug(
+                    "pluginModel->LibraryInstance.Set() : " <<
+                    pluginLib->GetFileName());
             }
-        }
-        else
-        {
+        } else {
             LogDebug("Already loaded");
         }
     }
@@ -287,15 +286,13 @@ void PluginLogic::Impl::startSession(int widgetHandle,
 {
     LogInfo("Starting widget session...");
 
-    if (!m_pluginsSupport->isInitialized())
-    {
+    if (!m_pluginsSupport->isInitialized()) {
         m_pluginsSupport->Initialize(widgetHandle);
     }
     auto sessionIt = m_sessions.find(context);
 
     // Check if corresponding session if not already created
-    if (sessionIt != m_sessions.end())
-    {
+    if (sessionIt != m_sessions.end()) {
         LogWarning("Session already started!");
         return;
     }
@@ -315,8 +312,7 @@ void PluginLogic::Impl::stopSession(JSGlobalContextRef context)
     LogInfo("Stopping widget session...");
 
     auto sessionIt = m_sessions.find(context);
-    if (sessionIt == m_sessions.end())
-    {
+    if (sessionIt == m_sessions.end()) {
         LogError("Session not exist!");
         return;
     }
@@ -336,8 +332,7 @@ bool PluginLogic::Impl::loadPluginOnDemand(
     LogInfo("Load plugin on demand");
 
     auto sessionIt = m_sessions.find(context);
-    if (sessionIt == m_sessions.end())
-    {
+    if (sessionIt == m_sessions.end()) {
         LogWarning("Session not exist!");
         return false;
     }
@@ -354,8 +349,7 @@ void PluginLogic::Impl::loadFrame(JSGlobalContextRef context)
     PLUGIN_LOGIC_SANITY_CHECK
 
     auto sessionIt = m_sessions.find(context);
-    if (sessionIt == m_sessions.end())
-    {
+    if (sessionIt == m_sessions.end()) {
         LogWarning("Session not exist!");
         return;
     }
@@ -370,14 +364,16 @@ void PluginLogic::Impl::unloadFrame(JSGlobalContextRef context)
     PLUGIN_LOGIC_SANITY_CHECK
 
     auto sessionIt = m_sessions.find(context);
-    if (sessionIt == m_sessions.end())
-    {
+    if (sessionIt == m_sessions.end()) {
         LogWarning("Session not exist!");
         return;
     }
 
     sessionIt->second->unloadFrame(context);
-    m_sessions.erase(sessionIt);
+
+    // I don't know why this session should be removed here.
+    // session list is removed also from stopSession().
+    //m_sessions.erase(sessionIt);
 }
 
 void PluginLogic::Impl::setCustomProperties(JSGlobalContextRef context,
@@ -385,14 +381,15 @@ void PluginLogic::Impl::setCustomProperties(JSGlobalContextRef context,
                                             const char* encodedBundle,
                                             const char* theme)
 {
-    LogInfo("set properties of window object " << scaleFactor << ", "
-            << encodedBundle << ", " << theme);
+    LogInfo(
+        "set properties of window object " << scaleFactor << ", "
+                                           << encodedBundle << ", " <<
+        theme);
 
     PLUGIN_LOGIC_SANITY_CHECK
 
     auto sessionIt = m_sessions.find(context);
-    if (sessionIt == m_sessions.end())
-    {
+    if (sessionIt == m_sessions.end()) {
         LogWarning("Session not exist!");
         return;
     }
@@ -400,7 +397,6 @@ void PluginLogic::Impl::setCustomProperties(JSGlobalContextRef context,
     sessionIt->second->setCustomProperties(scaleFactor,
                                            encodedBundle,
                                            theme);
-
 }
 
 void PluginLogic::Impl::dispatchJavaScriptEvent(JSGlobalContextRef context,
@@ -412,13 +408,10 @@ void PluginLogic::Impl::dispatchJavaScriptEvent(JSGlobalContextRef context,
     PLUGIN_LOGIC_SANITY_CHECK
 
     auto sessionIt = m_sessions.find(context);
-    if (sessionIt == m_sessions.end())
-    {
+    if (sessionIt == m_sessions.end()) {
         LogWarning("Session not exist!");
         return;
     }
 
     sessionIt->second->dispatchJavaScriptEvent(eventType, data);
-
-
 }
index e524ec0..10bcb08 100644 (file)
@@ -38,7 +38,6 @@
 
 using namespace WrtPlugins::W3C;
 
-
 class PluginLogic : DPL::Noncopyable
 {
   public:
@@ -74,11 +73,12 @@ class PluginLogic : DPL::Noncopyable
                              const char* encodedBundle,
                              const char* theme);
 
-    WRT_PLUGINS_DEPRECATED void dispatchJavaScriptEvent(CustomEventType eventType);
+    WRT_PLUGINS_DEPRECATED void dispatchJavaScriptEvent(
+        CustomEventType eventType);
 
     void dispatchJavaScriptEvent(JSGlobalContextRef ctx,
-                                CustomEventType eventType,
-                                void* data);
+                                 CustomEventType eventType,
+                                 void* data);
 
   private:
     PluginLogic();
index 58b56d8..ee6dd6f 100644 (file)
@@ -36,8 +36,7 @@ struct BindToPluginDAO :
                           PluginDAOReadOnly,
                           &PluginModel::getHandle,
                           extFun>
-{
-};
+{};
 
 template <typename RetType, RetType(*extFun) (WrtDB::DbPluginHandle)>
 struct BindToFeatureDAOStatic :
@@ -46,26 +45,27 @@ struct BindToFeatureDAOStatic :
                                  WrtDB::DbPluginHandle,
                                  &PluginModel::getHandle,
                                  extFun>
-{
-};
+{};
 
 PluginModel::PluginModel(const WrtDB::DbPluginHandle& handle) :
     Handle(this, handle),
     LibraryName(this,
                 BindToPluginDAO<std::string,
-                &PluginDAOReadOnly::getLibraryName>::Get),
+                                &PluginDAOReadOnly::getLibraryName>::Get),
     LibraryPath(this,
                 BindToPluginDAO<std::string,
-                &PluginDAOReadOnly::getLibraryPath>::Get),
+                                &PluginDAOReadOnly::getLibraryPath>::Get),
     FeatureHandles(this,
                    BindToFeatureDAOStatic<FeatureHandleListPtr,
-                   FeatureDAOReadOnly::GetFeatureHandleListForPlugin>::Get),
+                                          FeatureDAOReadOnly::
+                                              GetFeatureHandleListForPlugin>::
+                       Get),
     LibraryDependencies(this,
                         BindToPluginDAO<PluginHandleSetPtr,
-                        &PluginDAOReadOnly::getLibraryDependencies>::Get),
+                                        &PluginDAOReadOnly::
+                                            getLibraryDependencies>::Get),
     LibraryInstance(this, PluginPtr())
-{
-}
+{}
 
 WrtDB::DbPluginHandle PluginModel::getHandle() const
 {
index 624f86e..e834cd1 100644 (file)
@@ -41,44 +41,47 @@ class PluginModel : public DPL::Event::Model
   public:
 
     /**
-       *@brief Plugin handle
+     * *@brief Plugin handle
      */
-    DPL::Event::Property<WrtDB::DbPluginHandle, DPL::Event::PropertyReadOnly> Handle;
+    DPL::Event::Property<WrtDB::DbPluginHandle,
+                         DPL::Event::PropertyReadOnly> Handle;
 
     /**
-       *@brief LibraryName
+     * *@brief LibraryName
      */
     DPL::Event::Property<std::string,
-                  DPL::Event::PropertyReadOnly,
-                  DPL::Event::PropertyStorageDynamicCached> LibraryName;
+                         DPL::Event::PropertyReadOnly,
+                         DPL::Event::PropertyStorageDynamicCached> LibraryName;
 
     /**
-       *@brief Library Path
+     * *@brief Library Path
      */
     DPL::Event::Property<std::string,
-                  DPL::Event::PropertyReadOnly,
-                  DPL::Event::PropertyStorageDynamicCached> LibraryPath;
+                         DPL::Event::PropertyReadOnly,
+                         DPL::Event::PropertyStorageDynamicCached> LibraryPath;
 
     /**
-       *@brief Feature set
+     * *@brief Feature set
      */
     DPL::Event::Property<WrtDB::FeatureHandleListPtr,
-                  DPL::Event::PropertyReadOnly,
-                  DPL::Event::PropertyStorageDynamicCached> FeatureHandles;
+                         DPL::Event::PropertyReadOnly,
+                         DPL::Event::PropertyStorageDynamicCached>
+    FeatureHandles;
 
     /**
-       *@brief Librarydepencies
+     * *@brief Librarydepencies
      */
     DPL::Event::Property<WrtDB::PluginHandleSetPtr,
-                  DPL::Event::PropertyReadOnly,
-                  DPL::Event::PropertyStorageDynamicCached> LibraryDependencies;
+                         DPL::Event::PropertyReadOnly,
+                         DPL::Event::PropertyStorageDynamicCached>
+    LibraryDependencies;
 
     /**
-       *@brief Library instance Low Level
+     * *@brief Library instance Low Level
      * */
     DPL::Event::Property<PluginPtr,
-                  DPL::Event::PropertyReadWrite,
-                  DPL::Event::PropertyStorageCached> LibraryInstance;
+                         DPL::Event::PropertyReadWrite,
+                         DPL::Event::PropertyStorageCached> LibraryInstance;
 
   public:
     PluginModel(const WrtDB::DbPluginHandle& handle);
index bf54b6f..c88f0c2 100644 (file)
 
 using namespace PluginModule;
 
-
-const char *NAVIGATOR_PROPERTY_NAME  =  "navigator";
+const char *NAVIGATOR_PROPERTY_NAME = "navigator";
 const char *SCALE_PROPERTY_NAME = "scale";
-const char *BUNDLE_PROPERTY_NAME  =  "__bundle";
-const char *THEME_PROPERTY_NAME  =  "theme";
+const char *BUNDLE_PROPERTY_NAME = "__bundle";
+const char *THEME_PROPERTY_NAME = "theme";
 
 WindowPropertySupport::WindowPropertySupport(
-        JSGlobalContextRef context):
+    JSGlobalContextRef context) :
     m_scale(0),
     m_bundle(""),
     m_theme(""),
     m_context(context)
-{
-}
+{}
 
 WindowPropertySupport::~WindowPropertySupport()
-{
-}
+{}
 
 float WindowPropertySupport::getScale() const
 {
@@ -69,16 +66,16 @@ void WindowPropertySupport::setScaleToNavigatorProperty(const double scale)
     LogInfo("set window.navigator.scale: " << scale);
 
     m_scale = scale;
-    
-    setPropertyToNavigator(SCALE_PROPERTY_NAME,  JSValueMakeNumber(m_context, scale));
+
+    setPropertyToNavigator(SCALE_PROPERTY_NAME,
+                           JSValueMakeNumber(m_context, scale));
 }
 
 void WindowPropertySupport::setBundleToWindowProperty(const char* bundle)
 {
     LogInfo("set window.__bundle: " << bundle);
 
-    if(bundle)
-    {
+    if (bundle) {
         m_bundle = bundle;
 
         JSStringRef bundleString = JSStringCreateWithUTF8CString(bundle);
@@ -94,8 +91,7 @@ void WindowPropertySupport::setThemeToNavigatorProperty(const char* theme)
 {
     LogInfo("set window.navigator.__theme: " << theme);
 
-    if(theme)
-    {
+    if (theme) {
         m_theme = theme;
 
         JSStringRef themeString = JSStringCreateWithUTF8CString(theme);
@@ -108,10 +104,9 @@ void WindowPropertySupport::setThemeToNavigatorProperty(const char* theme)
 }
 
 void WindowPropertySupport::setPropertyToWindow(const char* propertyName,
-                                                             JSValueRef jsValue)
+                                                JSValueRef jsValue)
 {
-    if(propertyName)
-    {
+    if (propertyName) {
         JSObjectRef globalObject = JSContextGetGlobalObject(m_context);
 
         JSStringRef propertyNameString =
@@ -128,10 +123,9 @@ void WindowPropertySupport::setPropertyToWindow(const char* propertyName,
 }
 
 void WindowPropertySupport::setPropertyToNavigator(const char* propertyName,
-                                                             JSValueRef jsValue)
+                                                   JSValueRef jsValue)
 {
-    if(propertyName)
-    {
+    if (propertyName) {
         JSObjectRef globalObject = JSContextGetGlobalObject(m_context);
 
         JSStringRef navigatorString =
index a1914da..fc946c4 100644 (file)
 #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);
+    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_
index f460fd1..bcaa849 100644 (file)
 #include <string>
 #include <dpl/foreach.h>
 
-namespace WrtPluginsApi
-{
-
+namespace WrtPluginsApi {
 template<typename Sig>
 class CallbackSupport
 {
-public:
+  public:
     typedef typename Sig::Signature SlotSignature;
     typedef typename Sig::Type SlotType;
     typedef std::string GroupType;
@@ -41,8 +39,7 @@ public:
     void Connect(const GroupType& group, const SlotType& slot)
     {
         auto groupIt = m_slots.find(group);
-        if (m_slots.end() == groupIt)
-        {
+        if (m_slots.end() == groupIt) {
             groupIt = m_slots.insert(std::make_pair(group, SlotList())).first;
         }
         groupIt->second.push_back(slot);
@@ -53,36 +50,33 @@ public:
         m_slots.erase(group);
     }
 
-    template<typename...Args>
-    void Invoke(const Args&... args)
+    template<typename ... Args>
+    void Invoke(const Args& ... args)
     {
-
         FOREACH(groupIt, m_slots)
         {
             FOREACH(slotIt, groupIt->second)
             {
-                (*slotIt)(args...);
+                (*slotIt)(args ...);
             }
         }
     }
 
-    template<typename...Args>
-    void InvokeGroup(const GroupType& group, const Args&... 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)
+        if (m_slots.end() != groupIt) {
+            FOREACH(slotIt, groupIt->second)
             {
-                (*slotIt)(args...);
+                (*slotIt)(args ...);
             }
         }
     }
 
-private:
+  private:
     std::map<GroupType, SlotList> m_slots;
 };
-
 }
 #endif
index f11395c..28886d0 100644 (file)
  *
  * 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
* #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
  *
  *
  * */
 struct feature_mapping_interface_s;
 typedef struct feature_mapping_interface_s feature_mapping_interface_t;
 
-class WrtPluginsApi::Plugin;
-
 extern "C" struct ExportedApi
 {
     /*
@@ -144,7 +142,6 @@ extern "C" struct ExportedApi
     void (*GetProvidedFeatures)(feature_mapping_interface_t*);
 };
 
-
 constexpr const char* GetExportedSymbolName()
 {
     return "dll_api";
index a3acf24..4148d91 100644 (file)
 #include <list>
 
 extern "C" {
-    typedef struct OpaqueJSClass* const (*ClassRef)();
+typedef struct OpaqueJSClass* (*ClassRef)();
 }
 
-namespace WrtPluginsApi
-{
-
+namespace WrtPluginsApi {
 enum class IObjectType
 {
     Object,
@@ -56,18 +54,17 @@ class IObject
         return "window";
     }
 
-    virtual void AddChild(const IObjectPtr& ) = 0;
+    virtual void AddChild(const IObjectPtr&) = 0;
 
     /*
      * Optional
      * */
     virtual void setBoolOption(IObjectOption option, bool value) = 0;
 
-    virtual ~IObject(){};
+    virtual ~IObject(){}
 };
 
 typedef std::list<IObjectPtr> IObjectsList;
 typedef std::shared_ptr<IObjectsList> IObjectsListPtr;
-
 }
 #endif
index 8dcf234..105a31d 100644 (file)
 #include <IObject.h>
 #include <Object.h>
 
-namespace WrtPluginsApi
-{
-
+namespace WrtPluginsApi {
 inline ObjectPtr CAST(const IObjectPtr& object)
 {
     return std::dynamic_pointer_cast<Object>(object);
 }
-
 }
 #endif
index 1aa039e..7db93e4 100644 (file)
 
 #include "Object.h"
 
-namespace WrtPluginsApi
-{
-
+namespace WrtPluginsApi {
 void Object::AddChild(const IObjectPtr& child)
 {
-    if(!m_children)
-    {
+    if (!m_children) {
         m_children = IObjectsListPtr(new IObjectsList);
     }
     m_children->push_back(child);
@@ -36,19 +33,17 @@ void Object::AddChild(const IObjectPtr& child)
 
 void Object::setBoolOption(IObjectOption option, bool value)
 {
-   if(!m_options)
-   {
+    if (!m_options) {
         m_options = ObjectOptionPtr(new ObjectOption);
-   }
-
-   switch(option)
-   {
-   case IObjectOption::Overlayed:
-       m_options->overlayedMode = value;
-       break;
-   default:
-       break;
-   }
+    }
+
+    switch (option) {
+    case IObjectOption::Overlayed:
+        m_options->overlayedMode = value;
+        break;
+    default:
+        break;
+    }
 }
 
 IObjectsListPtr Object::GetChildren() const
@@ -88,53 +83,48 @@ const char* Object::GetParentName() const
 
 ObjectOptionPtr Object::GetOptions() const
 {
-   return m_options;
+    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)
-{
-}
+               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)
-{
-}
+               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)
-{
-}
+               IObjectType type) :
+    m_name(name),
+    m_parentName(parentName),
+    m_type(type),
+    m_interfaceRef(interfaceRef),
+    m_interfaceName(interfaceName),
+    m_constructorRef(constructorRef)
+{}
 
 Object::~Object()
-{
-}
-
+{}
 }
index 285f3fe..5417453 100644 (file)
@@ -29,9 +29,7 @@
 #include <IObject.h>
 #include <dpl/optional.h>
 
-namespace WrtPluginsApi
-{
-
+namespace WrtPluginsApi {
 class Object;
 typedef std::shared_ptr<Object> ObjectPtr;
 
@@ -41,7 +39,6 @@ struct ObjectOption
 };
 typedef std::shared_ptr<ObjectOption> ObjectOptionPtr;
 
-
 class Object : public IObject
 {
   public:
@@ -63,11 +60,11 @@ class Object : public IObject
 
     ~Object();
 
-    void AddChild(const IObjectPtr& );
+    void AddChild(const IObjectPtr&);
 
     void setBoolOption(IObjectOption option, bool value);
 
-    IObjectsListPtr GetChildren() const ;
+    IObjectsListPtr GetChildren() const;
 
     ClassRef GetClass() const;
 
@@ -102,7 +99,6 @@ class Object : public IObject
 
     IObjectsListPtr m_children;
 };
-
 }
 
 #endif
index c854344..b897399 100644 (file)
@@ -25,7 +25,6 @@
 
 namespace WrtPluginsApi {
 namespace ObjectFactory {
-
 IObjectPtr createObject(
     const char* name,
     ClassRef ref,
@@ -58,6 +57,5 @@ IObjectPtr createObjectWithInterface(
                                  parentName,
                                  type));
 }
-
 }
 }
index bd43878..59bff1d 100644 (file)
 
 namespace WrtPluginsApi {
 namespace ObjectFactory {
+IObjectPtr createObject(
+    const char* name,
+    ClassRef ref,
+    IObjectType type = IObjectType::Object);
 
-    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 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);
+IObjectPtr createObjectWithInterface(
+    const char* name,
+    ClassRef interfaceRef,
+    const char* interfaceName,
+    ClassRef constructorRef,
+    const char* parentName = IObject::WINDOW_OBJECT(),
+    IObjectType type = IObjectType::Object);
 }
 }
 #endif
index a3c1d04..6303c32 100644 (file)
  */
 #include "Plugin.h"
 
-namespace WrtPluginsApi
-{
-
+namespace WrtPluginsApi {
 void Plugin::AddObject(const IObjectPtr& object)
 {
-   m_objects->push_back(object);
+    m_objects->push_back(object);
 }
 
 IObjectsListPtr Plugin::GetObjects() const
@@ -35,11 +33,8 @@ IObjectsListPtr Plugin::GetObjects() const
 }
 
 Plugin::~Plugin()
-{
-}
+{}
 
 Plugin::Plugin() : m_objects(new IObjectsList())
-{
-}
-
+{}
 }
index 3cee0a2..5458714 100644 (file)
 #include <list>
 #include <IObject.h>
 
-namespace WrtPluginsApi
-{
-
+namespace WrtPluginsApi {
 class Plugin
 {
-public:
+  public:
     void AddObject(const IObjectPtr& object);
 
     IObjectsListPtr GetObjects() const;
@@ -39,10 +37,9 @@ public:
 
     virtual ~Plugin();
 
-private:
+  private:
     IObjectsListPtr m_objects;
 };
-
 }
 
 #endif
index dadd367..089fdec 100644 (file)
@@ -24,9 +24,7 @@
 #include "Plugin.h"
 #include <dpl/assert.h>
 
-namespace WrtPluginsApi
-{
-
+namespace WrtPluginsApi {
 PluginRegistration::PluginRegistration(Impl* impl) : m_impl(impl)
 {
     Assert(impl != 0 && "impl is NULL");
@@ -49,12 +47,11 @@ void PluginRegistration::AddPlugin(Plugin& plugin)
 }
 
 #define EXPLICIT_INSTATIATE_PLUGIN_REGISTRATION(SignalSignature)               \
-        template void PluginRegistration::Connect<SignalSignature>(            \
-                const typename SignalSignature::Type&)
+    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);
-
 }
index ea7972f..e871a76 100644 (file)
 #include "Plugin.h"
 #include "PluginSignals.h"
 
-namespace WrtPluginsApi
-{
-
+namespace WrtPluginsApi {
 class PluginRegistration
 {
-public:
+  public:
     class Impl;
 
     explicit PluginRegistration(PluginRegistration::Impl* impl);
@@ -42,10 +40,9 @@ public:
 
     void AddPlugin(Plugin& plugin);
 
-private:
+  private:
     std::unique_ptr<Impl> m_impl;
 };
-
 }
 
 #endif
index 3e1c752..1c17859 100644 (file)
 #include "Plugin.h"
 #include <dpl/log/log.h>
 
-namespace WrtPluginsApi
-{
-
+namespace WrtPluginsApi {
 class PluginRegistration::Impl
 {
-public:
-    Impl(SignalsSupport& registry, const std::string& libraryName)
-        m_registry(registry),
-          m_libraryName(libraryName)
+  public:
+    Impl(SignalsSupport& registry, const std::string& libraryName) :
+        m_registry(registry),
+        m_libraryName(libraryName)
     {}
 
     void AddPlugin(Plugin& plugin)
@@ -53,11 +51,10 @@ public:
         m_registry.Disconnect(m_libraryName);
     }
 
-private:
+  private:
     SignalsSupport& m_registry;
     std::string m_libraryName;
 };
-
 }
 
 #endif
index 761ba9d..af9cc2d 100644 (file)
 #include <dpl/log/log.h>
 #include <dpl/foreach.h>
 
-
-namespace {
-const char* DLL_ENTRY_POINT_NAME = "dll_api";
-}
-
-namespace WrtPluginsApi
-{
-
+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)
-    {
+    if (m_plugins.end() == libraryIt) {
         m_plugins[libraryName] = &plugin;
     }
 }
@@ -56,12 +48,10 @@ void PluginRegistry::AddPlugin(const std::string& libraryName,
 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");
+    if (it == m_plugins.end()) {
+        if (!LoadFromFile(libraryName)) {
+            LogError("Failed to load lib" << libraryName);
+            ThrowMsg(PluginNotFound, "Failed to load plugin");
         }
 
         return m_plugins[libraryName];
@@ -74,10 +64,8 @@ void PluginRegistry::RemovePlugin(const std::string& libraryName,
                                   Plugin& plugin)
 {
     auto it = m_plugins.find(libraryName);
-    if (it != m_plugins.end())
-    {
-        if (&plugin == it->second)
-        {
+    if (it != m_plugins.end()) {
+        if (&plugin == it->second) {
             m_plugins.erase(it);
         }
     }
@@ -87,13 +75,12 @@ void PluginRegistry::UnloadAll()
 {
     LogDebug("Unload all plugins");
 
-    typedef void (*UnregisterFunction) (PluginRegistration&, Plugin&);
+    typedef void (*UnregisterFunction)(PluginRegistration&, Plugin&);
 
     FOREACH(libraryIt, m_libraries)
     {
         auto pluginIt = m_plugins.find(libraryIt->first);
-        if (m_plugins.end() != pluginIt)
-        {
+        if (m_plugins.end() != pluginIt) {
             void* handle = dlopen(libraryIt->first.c_str(), RTLD_NOW);
             if (!handle) {
                 LogError("Error: " << dlerror());
@@ -102,14 +89,12 @@ void PluginRegistry::UnloadAll()
 
             ExportedApi* entryPoint =
                 static_cast<ExportedApi*>
-                    (dlsym(handle, GetExportedSymbolName()));
-            if (NULL == entryPoint)
-            {
+                (dlsym(handle, GetExportedSymbolName()));
+            if (NULL == entryPoint) {
                 LogError("Error: " << dlerror());
                 continue;
             }
-            if (entryPoint->Unregister == NULL)
-            {
+            if (entryPoint->Unregister == NULL) {
                 LogError("Error Unregister function not set");
                 continue;
             }
@@ -136,35 +121,30 @@ bool PluginRegistry::LoadFromFile(const std::string& libraryName)
 
     ExportedApi* entryPoint =
         static_cast<ExportedApi*>(dlsym(handle, GetExportedSymbolName()));
-    if (NULL == entryPoint)
-    {
+    if (NULL == entryPoint) {
         LogError("Error: " << dlerror());
         return false;
     }
 
-    if (entryPoint->Register == NULL)
-    {
+    if (entryPoint->Register == NULL) {
         LogError("Error Register function not set");
         return false;
     }
-    if (entryPoint->Unregister== NULL)
-    {
+    if (entryPoint->Unregister == NULL) {
         LogError("Error Unregister function not set");
         return false;
     }
 
     PluginRegistration registration(
-            new PluginRegistration::Impl(*this, libraryName));
+        new PluginRegistration::Impl(*this, libraryName));
     entryPoint->Register(registration);
 
     return true;
 }
 
-
 PluginRegistry::~PluginRegistry()
 {
     //TODO discuss ... when the unload should be called
-//    UnloadAll();
+    //    UnloadAll();
 }
-
 }
index d3e66b4..5db1ea4 100644 (file)
 #include "Plugin.h"
 #include <dpl/exception.h>
 
-namespace WrtPluginsApi
-{
-
+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:
+  public:
     DECLARE_EXCEPTION_TYPE(DPL::Exception, Base)
     DECLARE_EXCEPTION_TYPE(Base, PluginNotFound)
 
-    template <typename T, typename ...Args>
-    void Call(Args... args)
+    template <typename T, typename ... Args>
+    void Call(Args ... args)
     {
-        Invoke<T>(args...);
+        Invoke<T>(args ...);
     }
 
-    template <typename T, typename ...Args>
+    template <typename T, typename ... Args>
     void CallGroup(const typename CallbackSupport<T>::GroupType& type,
-                   Args... args)
+                   Args ... args)
     {
-        InvokeGroup<T>(type, args...);
+        InvokeGroup<T>(type, args ...);
     }
 
     void AddPlugin(const std::string& libraryName, Plugin& plugin);
@@ -66,7 +64,8 @@ public:
     void UnloadAll();
 
     ~PluginRegistry();
-private:
+
+  private:
     bool LoadFromFile(const std::string& libraryName);
 
     typedef void* Symbol;
@@ -76,7 +75,6 @@ private:
 };
 
 typedef std::shared_ptr<PluginRegistry> PluginRegistryPtr;
-
 }
 
 #endif
index ab22da1..556d620 100644 (file)
 
 #include "SignalSignature.h"
 
-namespace WrtPluginsApi
-{
-
+namespace WrtPluginsApi {
 struct OnWidgetStart : SignalSignature<void (int)> {};
 
 struct OnWidgetStop : SignalSignature<void (int)> {};
 
-struct OnFrameLoad: SignalSignature<void (void*)> {};
+struct OnFrameLoad : SignalSignature<void (void*)> {};
 
 struct OnFrameUnload : SignalSignature<void (void*)> {};
-
 }
 
 #endif
index 19fce6c..b43747e 100644 (file)
 
 #include <functional>
 
-namespace WrtPluginsApi
-{
-
+namespace WrtPluginsApi {
 template<typename> struct SignalSignature;
 
-template<typename R, typename ...Args>
-struct SignalSignature<R (Args...)>
+template<typename R, typename ... Args>
+struct SignalSignature<R(Args ...)>
 {
-    typedef R (*Signature) (Args...);
-    typedef std::function<R (Args...)> Type;
+    typedef R (*Signature)(Args ...);
+    typedef std::function<R(Args ...)> Type;
 };
-
 }
 
 #endif
index 56e7e67..9c47af2 100644 (file)
 #include "PluginSignals.h"
 #include "Plugin.h"
 
-namespace WrtPluginsApi
-{
-
+namespace WrtPluginsApi {
 class SignalsSupport
 {
-public:
+  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);
+        Tuple::get_by_type<CallbackSupport<T> >(m_slots).Connect(libraryName,
+                                                                 slot);
     }
 
     void Disconnect(const std::string& libraryName)
@@ -52,50 +50,49 @@ public:
 
     virtual void AddPlugin(const std::string& libraryName, Plugin& plugin) = 0;
 
-protected:
-    template<typename T, typename ...Args>
-    void Invoke(const Args&... args)
+  protected:
+    template<typename T, typename ... Args>
+    void Invoke(const Args& ... args)
     {
-        Tuple::get_by_type<CallbackSupport<T>>(m_slots).Invoke(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)
+    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...);
+        Tuple::get_by_type<CallbackSupport<T> >(m_slots).InvokeGroup(
+            libraryName,
+            args ...);
     }
 
-private:
-    template<int N, typename ...Args>
-    void DisconnectSlot(std::tuple<Args...>& slots,
+  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);
+        DisconnectSlot<N - 1>(slots, libraryName);
     }
 
-    template<int N, typename ...Args>
-    void DisconnectSlot(std::tuple<Args...>& slots,
-                        const std::string& 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,
+    template<typename ... Args>
+    void DisconnectGroup(std::tuple<Args ...>& slots,
                          const std::string& libraryName)
     {
-        DisconnectSlot<sizeof...(Args)-1>(slots, libraryName);
+        DisconnectSlot<sizeof ... (Args)-1>(slots, libraryName);
     }
 
     std::tuple<CallbackSupport<OnWidgetStart>,
                CallbackSupport<OnWidgetStop>,
                CallbackSupport<OnFrameLoad>,
-               CallbackSupport<OnFrameUnload>> m_slots;
+               CallbackSupport<OnFrameUnload> > m_slots;
 };
-
 }
 
 #endif
index 54b1bd7..a42963e 100644 (file)
@@ -55,7 +55,6 @@ typedef struct feature_mapping_s
     size_t featuresCount;
 } feature_mapping_t;
 
-
 typedef feature_mapping_t* pfeature_mapping_t;
 
 typedef pfeature_mapping_t (*features_getter)(void);
index 912e286..7ab56db 100644 (file)
 namespace WrtPluginsApi {
 namespace Traits {
 namespace Detail {
-
-template<size_t, typename RequiredType, typename ...TupleArgTypes>
+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...>
+         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;
+                                          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...>
+template<size_t n, typename RequiredType, typename ... TupleArgTypes>
+struct index_of_<n, RequiredType, RequiredType, TupleArgTypes ...>
 {
     static const size_t value = n;
 };
@@ -59,7 +58,7 @@ struct index_of_<n, RequiredType, RequiredType, TupleArgTypes...>
 template<size_t n, typename RequiredType>
 struct index_of_<n, RequiredType, RequiredType>
 {
-  static const size_t value = n;
+    static const size_t value = n;
 };
 
 /*
@@ -70,7 +69,6 @@ struct index_of_<n, RequiredType, LastArgType>
 {
     static const size_t value = -1;
 };
-
 }
 }
 }
index 69181ee..387c5bc 100644 (file)
 
 //forward declaration
 extern "C" {
-    typedef struct OpaqueJSContext* JSGlobalContextRef;
-    typedef struct OpaqueJSValue* JSObjectRef;
+typedef struct OpaqueJSContext* JSGlobalContextRef;
+typedef struct OpaqueJSValue* JSObjectRef;
 }
 
-namespace WrtPluginsApi
-{
-
+namespace WrtPluginsApi {
 struct JavaScriptObject
 {
     JSObjectRef instance;
     std::string name;
 };
-
 }
 
 #endif
index 7635a0a..286c510 100644 (file)
 
 #include "detail/traits.h"
 
-namespace WrtPluginsApi
-{
-
+namespace WrtPluginsApi {
 namespace Traits {
-
 /**
  * Gets index of specified type in the type list.
  */
-template<typename RequiredType, typename ...TupleArgTypes>
+template<typename RequiredType, typename ... TupleArgTypes>
 struct index_of
 {
     static const size_t value = Detail::index_of_<0,
-                                               RequiredType,
-                                               TupleArgTypes...>::value;
+                                                  RequiredType,
+                                                  TupleArgTypes ...>::value;
 };
-
 }
-
 }
 
 #endif
index ef3b62c..ec7c3b3 100644 (file)
 
 namespace WrtPluginsApi {
 namespace Tuple {
-
-template<typename T, typename ...Args>
-T& get_by_type(std::tuple<Args...>& tuple)
+template<typename T, typename ... Args>
+T& get_by_type(std::tuple<Args ...>& tuple)
 {
-    return std::get<Traits::index_of<T, Args...>::value>(tuple);
+    return std::get<Traits::index_of<T, Args ...>::value>(tuple);
 }
-
 }
 }
 
index a2c668d..929971b 100644 (file)
@@ -63,8 +63,8 @@ const std::string DIRECTORY_SEPARATOR = std::string("/");
 
 const int PluginsInstaller::INSTALLATION_ERROR = -1;
 
-PluginsInstaller::PluginsInstaller()
-    m_initialized(false)
+PluginsInstaller::PluginsInstaller() :
+    m_initialized(false)
 {
     LogInfo("PluginsInstaller created.");
 }
@@ -124,7 +124,7 @@ void PluginsInstaller::deinitialize()
 }
 
 PluginsInstaller::ReturnStatus PluginsInstaller::installPlugin(
-        const std::string& libPath)
+    const std::string& libPath)
 {
     if (!m_initialized) {
         LogError("Plugins installer not initialized.");
@@ -132,23 +132,25 @@ PluginsInstaller::ReturnStatus PluginsInstaller::installPlugin(
     }
     LogInfo("Plugin installation started. Checking path: " << libPath);
 
-    if (!PluginUtils::checkPath(libPath))
+    if (!PluginUtils::checkPath(libPath)) {
         return ReturnStatus::WrongPluginPath;
+    }
 
     LogInfo("Plugin path ok. Searching for config file...");
 
     std::string metaFileName = libPath + DIRECTORY_SEPARATOR +
         std::string(WrtDB::GlobalConfig::GetPluginMetafileName());
-    if (PluginUtils::checkFileExistance(metaFileName))
-    {
+    if (PluginUtils::checkFileExistance(metaFileName)) {
         return installPluginFromMetafile(libPath, metaFileName);
     }
 
     PluginMetafileData pluginInfo;
     pluginInfo.m_libraryName = getLibraryName(libPath);
 
-    LogInfo("Config file done. Lib name: " << pluginInfo.m_libraryName
-            << ". Searching for installed plugin...");
+    LogInfo(
+        "Config file done. Lib name: " << pluginInfo.m_libraryName
+                                       <<
+        ". Searching for installed plugin...");
 
     if (WrtDB::PluginDAO::isPluginInstalled(pluginInfo.m_libraryName)) {
         LogInfo("Plugin already installed.");
@@ -181,11 +183,11 @@ PluginsInstaller::ReturnStatus PluginsInstaller::installPlugin(
 
     FOREACH(o, *plugin->GetObjects()) {
         libraryObjects->addObjects(CAST(*o)->GetParentName(),
-            CAST(*o)->GetName());
+                                   CAST(*o)->GetName());
 
         LogDebug("[Parent << Object] " << CAST(*o)->GetParentName()
-            << " << "
-            << CAST(*o)->GetName());
+                                       << " << "
+                                       << CAST(*o)->GetName());
 
         registerObjects(libraryObjects, plugin->GetObjects());
     }
@@ -217,9 +219,10 @@ PluginsInstaller::ReturnStatus PluginsInstaller::installPlugin(
         LogInfo("Registration done. Resolving dependencies...");
 
         //TODO: can it be replaced with resolvePluginDependencies(handle)
-        if (!registerAndUpdateInstallation(pluginHandle, libraryObjects))
+        if (!registerAndUpdateInstallation(pluginHandle, libraryObjects)) {
             return ReturnStatus::InstallationWaiting;
-    } Catch (DPL::Exception) {
+        }
+    } Catch(DPL::Exception) {
         LogError("Failed to make database entry.");
         return ReturnStatus::DatabaseError;
     }
@@ -229,15 +232,15 @@ PluginsInstaller::ReturnStatus PluginsInstaller::installPlugin(
 }
 
 PluginObjectsPtr PluginsInstaller::loadLibraryFromMetafile(
-        const std::string& libName) const
+    const std::string& libName) const
 {
     LogInfo("Loading library: " << libName);
 
     void *dlHandle = dlopen(libName.c_str(), RTLD_NOW);
-    if (dlHandle == NULL ) {
+    if (dlHandle == NULL) {
         LogError(
-                "Failed to load plugin: " << libName <<
-                ". Reason: " << dlerror());
+            "Failed to load plugin: " << libName <<
+            ". Reason: " << dlerror());
         ThrowMsg(PluginInstall::Exceptions::LibraryException, "Library error");
     }
 
@@ -246,14 +249,14 @@ PluginObjectsPtr PluginsInstaller::loadLibraryFromMetafile(
 
     getWidgetEntityMapProcPtr =
         reinterpret_cast<get_widget_entity_map_proc *>(dlsym(dlHandle,
-                    PLUGIN_GET_CLASS_MAP_PROC_NAME));
+                                                             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));
+                                                              PLUGIN_CLASS_MAP_NAME));
     }
 
     if (rawEntityList == NULL) {
@@ -270,14 +273,14 @@ PluginObjectsPtr PluginsInstaller::loadLibraryFromMetafile(
     LogInfo("#####");
 
     while (rawEntityListIterator->parent_name != NULL &&
-            rawEntityListIterator->object_name != NULL)
+           rawEntityListIterator->object_name != NULL)
     {
         LogInfo("#####     [" << rawEntityListIterator->object_name << "]: ");
         LogInfo("#####     Parent: " << rawEntityListIterator->parent_name);
         LogInfo("#####");
 
         libraryObjects->addObjects(rawEntityListIterator->parent_name,
-                rawEntityListIterator->object_name);
+                                   rawEntityListIterator->object_name);
 
         ++rawEntityListIterator;
     }
@@ -295,9 +298,8 @@ PluginObjectsPtr PluginsInstaller::loadLibraryFromMetafile(
     return libraryObjects;
 }
 
-
 PluginsInstaller::ReturnStatus PluginsInstaller::installPluginFromMetafile(
-        const std::string& path, const std::string& metaFilePath)
+    const std::string& path, const std::string& metaFilePath)
 {
     if (!m_initialized) {
         LogError("Plugins installer not initialized.");
@@ -308,7 +310,7 @@ PluginsInstaller::ReturnStatus PluginsInstaller::installPluginFromMetafile(
     {
         pluginData = parseMetafile(metaFilePath);
     }
-    Catch (PluginInstall::Exceptions::XMLFileParsingException)
+    Catch(PluginInstall::Exceptions::XMLFileParsingException)
     {
         LogError("Parsing metafile failed.");
         return ReturnStatus::MetafileError;
@@ -322,10 +324,11 @@ PluginsInstaller::ReturnStatus PluginsInstaller::installPluginFromMetafile(
         return ReturnStatus::AlreadyInstalled;
     }
     Try {
-
-        LogError("path is: " << path << ", libraryName: " << pluginData->m_libraryName);
+        LogError(
+            "path is: " << path << ", libraryName: " <<
+            pluginData->m_libraryName);
         PluginObjectsPtr objects = loadLibraryFromMetafile(
-            path + DIRECTORY_SEPARATOR + pluginData->m_libraryName);
+                path + DIRECTORY_SEPARATOR + pluginData->m_libraryName);
 
         PluginHandle pluginHandle =
             PluginDAO::registerPlugin(*pluginData, path);
@@ -344,9 +347,10 @@ PluginsInstaller::ReturnStatus PluginsInstaller::installPluginFromMetafile(
 
         LogInfo("Objects registered. Finishing...");
 
-        if (!registerAndUpdateInstallation(pluginHandle, objects))
+        if (!registerAndUpdateInstallation(pluginHandle, objects)) {
             return ReturnStatus::InstallationWaiting;
-    } Catch (DPL::Exception) {
+        }
+    } Catch(DPL::Exception) {
         LogError("Failed to make database entry.");
         return ReturnStatus::DatabaseError;
     }
@@ -373,21 +377,26 @@ int PluginsInstaller::installAllPlugins()
     }
 
     LogInfo("Plugin DIRECTORY IS" << PLUGIN_PATH);
-    struct dirent* libdir;
+    int return_code;
+    struct dirent libdir;
+    struct dirent* result;
 
     errno = 0;
 
     std::list<std::string> pluginsPaths;
 
-    while ((libdir = readdir(dir)) != 0) {
-        if (strcmp(libdir->d_name, ".") == 0 ||
-            strcmp(libdir->d_name, "..") == 0) {
+    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;
+        path += libdir.d_name;
 
         struct stat tmp;
 
@@ -405,14 +414,18 @@ int PluginsInstaller::installAllPlugins()
         pluginsPaths.push_back(path);
     }
 
+    if (0 != return_code)
+        LogError("Error while reading directory.");
+
     if (-1 == TEMP_FAILURE_RETRY(closedir(dir))) {
         LogError("Failed to close dir: " << PLUGIN_PATH);
     }
 
     LogDebug("Plugins to install: " << pluginsPaths.size());
 
-    for (int k = 0; k <= pluginsPaths.size(); ++k)
+    for (size_t k = 0; k <= pluginsPaths.size(); ++k) {
         printf(" ");
+    }
     printf("]\r[");
     int installedPluginsCount = 0;
     ReturnStatus ret = ReturnStatus::Unknown;
@@ -434,7 +447,7 @@ int PluginsInstaller::installAllPlugins()
     installedPluginsCount += installWaitingPlugins();
     m_registry.UnloadAll();
     LogInfo("Installed " << installedPluginsCount
-            << " plugins of total: " << pluginsPaths.size());
+                         << " plugins of total: " << pluginsPaths.size());
     return installedPluginsCount;
 }
 
@@ -448,8 +461,9 @@ int PluginsInstaller::installWaitingPlugins()
     int pluginsInstalled = 0;
     FOREACH(it, *waitingPlugins)
     {
-        if (resolvePluginDependencies(*it))
+        if (resolvePluginDependencies(*it)) {
             ++pluginsInstalled;
+        }
     }
     return pluginsInstalled;
 }
@@ -486,31 +500,29 @@ bool PluginsInstaller::resolvePluginDependencies(PluginHandle handle)
 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);
-       }
-   }
-}
+    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
+    const std::string& path) const
 {
     LogInfo("Plugin Config file::" << path);
     Try
@@ -532,7 +544,7 @@ PluginsInstaller::OptionalPluginMetafileData PluginsInstaller::parseMetafile(
     Catch(ValidationCore::ParserSchemaException::Base) {
         LogError("Error during file processing " << path);
         ThrowMsg(PluginInstall::Exceptions::XMLFileParsingException,
-            "Parsing metafile failed");
+                 "Parsing metafile failed");
     }
 }
 
@@ -541,12 +553,9 @@ 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)
-    {
+    if (std::string::npos == indexpos) {
         indexpos = 0;
-    }
-    else
-    {
+    } else {
         indexpos += 1;  // move after '/'
     }
 
@@ -558,8 +567,8 @@ std::string PluginsInstaller::getLibraryName(const std::string& dirPath) const
 }
 
 bool PluginsInstaller::registerAndUpdateInstallation(
-        const WrtDB::DbPluginHandle& pluginHandle,
-        const PluginObjectsPtr& libraries)
+    const WrtDB::DbPluginHandle& pluginHandle,
+    const PluginObjectsPtr& libraries)
 {
     PluginHandleSetPtr handles = PluginHandleSetPtr(new PluginHandleSet);
 
@@ -597,26 +606,30 @@ bool PluginsInstaller::fillMappingInterfaces(PluginMetafileData& pluginData,
 {
     void *dlHandle = dlopen(filename.c_str(), RTLD_NOW);
     if (dlHandle == NULL) {
-        LogError("Failed to load plugin: " << filename << ". Reason: " << dlerror());
+        LogError(
+            "Failed to load plugin: " << filename << ". Reason: " << dlerror());
         return false;
     }
     Try
     {
         ExportedApi* entryPoint =
-            static_cast<ExportedApi*> (dlsym(dlHandle, GetExportedSymbolName()));
+            static_cast<ExportedApi*>(dlsym(dlHandle, GetExportedSymbolName()));
         if (NULL == entryPoint) {
             LogError("Error: " << dlerror());
-            ThrowMsg(PluginInstall::Exceptions::LibraryException, "Library error");
+            ThrowMsg(PluginInstall::Exceptions::LibraryException,
+                     "Library error");
         }
 
         // obtain feature -> dev-cap mapping
-        feature_mapping_interface_t mappingInterface = {NULL, NULL, NULL};
+        feature_mapping_interface_t mappingInterface = { NULL, NULL, NULL };
         entryPoint->GetProvidedFeatures(&mappingInterface);
 
         if (!mappingInterface.featGetter || !mappingInterface.release ||
-            !mappingInterface.dcGetter) {
+            !mappingInterface.dcGetter)
+        {
             LogError("Failed to obtain mapping interface from .so");
-            ThrowMsg(PluginInstall::Exceptions::LibraryException, "Library error");
+            ThrowMsg(PluginInstall::Exceptions::LibraryException,
+                     "Library error");
         }
 
         feature_mapping_t* devcapMapping = mappingInterface.featGetter();
@@ -630,8 +643,10 @@ bool PluginsInstaller::fillMappingInterfaces(PluginMetafileData& pluginData,
             LogDebug("Feature: " << feature.m_name);
 
             const devcaps_t* dc =
-                mappingInterface.dcGetter(devcapMapping,
-                devcapMapping->features[i].feature_name);
+                mappingInterface.dcGetter(
+                    devcapMapping,
+                    devcapMapping->features[i].
+                        feature_name);
 
             LogDebug("device=cap: " << dc);
 
@@ -648,7 +663,7 @@ bool PluginsInstaller::fillMappingInterfaces(PluginMetafileData& pluginData,
         }
 
         mappingInterface.release(devcapMapping);
-    } Catch (PluginInstall::Exceptions::PluginsInstallerException)
+    } Catch(PluginInstall::Exceptions::PluginsInstallerException)
     {
         LogError("Exception while feature mapping");
         dlclose(dlHandle);
@@ -664,10 +679,12 @@ bool PluginsInstaller::fillMappingInterfaces(PluginMetafileData& pluginData,
     return true;
 }
 
-void PluginsInstaller::registerPluginObjects(const WrtDB::DbPluginHandle& handle,
-                                             const PluginObjectsPtr libObjects) const
+void PluginsInstaller::registerPluginObjects(
+    const WrtDB::DbPluginHandle& handle,
+    const PluginObjectsPtr libObjects)
+const
 {
-        //register implemented objects
+    //register implemented objects
     PluginObjects::ObjectsPtr objects =
         libObjects->getImplementedObject();
 
index 899be3c..2ad33b0 100644 (file)
@@ -33,7 +33,7 @@
 
 class PluginsInstaller
 {
-public:
+  public:
     static const int INSTALLATION_ERROR;
     enum class ReturnStatus
     {
@@ -62,7 +62,8 @@ public:
     bool resolvePluginDependencies(PluginHandle handle);
 
     bool isInitialized();
-private:
+
+  private:
     friend class DPL::Singleton<PluginsInstaller>;
 
     PluginsInstaller();
@@ -91,6 +92,5 @@ private:
 
 typedef DPL::Singleton<PluginsInstaller> PluginsInstallerSingleton;
 
-
 #endif  /* WRT_PLUGINS_INSTALLER_PLUGIN_INSTALLER_H */
 
index 55aa39b..9a94a79 100644 (file)
 
 namespace PluginInstall {
 namespace Exceptions {
-
 DECLARE_EXCEPTION_TYPE(DPL::Exception, PluginsInstallerException)
 DECLARE_EXCEPTION_TYPE(PluginsInstallerException, LibraryException)
 DECLARE_EXCEPTION_TYPE(PluginsInstallerException, XMLFileParsingException)
-
 } //namespace
 } //namespace
 
index ac500e8..b65c2e3 100644 (file)
@@ -57,8 +57,7 @@ PluginMetafileReader::PluginMetafileReader() : m_parserSchema(this)
 }
 
 void PluginMetafileReader::blankFunction(PluginMetafileData & /* data */)
-{
-}
+{}
 
 void PluginMetafileReader::tokenEndLibraryName(PluginMetafileData &data)
 {
index 2ded4f5..ae65b0f 100644 (file)
@@ -37,11 +37,12 @@ std::string normalizeName(const std::string& objectName)
     }
 
     if (!objectName.compare(0, GLOBAL_OBJECT_NAME.size(),
-                            GLOBAL_OBJECT_NAME)) {
+                            GLOBAL_OBJECT_NAME))
+    {
         return objectName;
     }
     if (!objectName.compare(0, OLD_GLOBAL_OBJECT_NAME.size(),
-        OLD_GLOBAL_OBJECT_NAME))
+                            OLD_GLOBAL_OBJECT_NAME))
     {
         return GLOBAL_OBJECT_NAME;
     }
@@ -51,7 +52,7 @@ std::string normalizeName(const std::string& objectName)
 }
 
 std::string normalizeName(const std::string& objectName,
-        const std::string& parentName)
+                          const std::string& parentName)
 {
     if (objectName.empty() || parentName.empty()) {
         LogError("Normalize name, name size or parent name size is 0");
@@ -83,12 +84,14 @@ PluginObjects::ObjectsPtr PluginObjects::getDependentObjects() const
 }
 
 void PluginObjects::addObjects(const std::string& parentName,
-        const std::string& name)
+                               const std::string& name)
 {
-    LogDebug("\n Parent: "  << parentName
-             << "\n Name: " << name
-            << "\n After: Implemented: "  << normalizeName(name, parentName)
-             << "\n After Dependent: " << normalizeName(parentName)
+    LogDebug("\n Parent: " << parentName
+                           << "\n Name: " << name
+                           << "\n After: Implemented: " <<
+             normalizeName(name, parentName)
+                           << "\n After Dependent: " <<
+             normalizeName(parentName)
              );
 
     addImplementedObject(normalizeName(name, parentName));
index c4cda28..eda28a3 100644 (file)
@@ -43,7 +43,7 @@ class PluginObjects : public WrtDB::PluginObjectsDAO
 
     //add object declaration
     void addObjects(const std::string& parentName,
-            const std::string& name);
+                    const std::string& name);
 
     //check if library implemements object given as name
     bool hasObject(const std::string& name) const;
index dbf50ae..42cc49d 100644 (file)
@@ -29,7 +29,6 @@
 using namespace WrtDB;
 
 namespace PluginUtils {
-
 //checks if file exists and is regular file
 bool checkFileExistance(const std::string& filename)
 {
@@ -41,7 +40,8 @@ bool checkFileExistance(const std::string& filename)
     return false;
 }
 
-std::string cutOffFileName(const std::string& path) {
+std::string cutOffFileName(const std::string& path)
+{
     size_t found = path.find_last_of("/");
     if (found == std::string::npos) {
         return path;
@@ -50,7 +50,8 @@ std::string cutOffFileName(const std::string& path) {
     }
 }
 
-bool checkPath(const std::string& path) {
+bool checkPath(const std::string& path)
+{
     struct stat st;
     if (0 == stat(path.c_str(), &st) && S_ISDIR(st.st_mode)) {
         return true;
@@ -63,27 +64,26 @@ bool checkPaths()
 {
     bool if_ok = true;
     if_ok &= (checkPath(cutOffFileName(
-            GlobalConfig::GetWrtDatabaseFilePath())));
+                            GlobalConfig::GetWrtDatabaseFilePath())));
     if (!if_ok) {
         LogError(
-                "Path <" << GlobalConfig::GetWrtDatabaseFilePath() <<
-                "> does not exist.");
+            "Path <" << GlobalConfig::GetWrtDatabaseFilePath() <<
+            "> does not exist.");
     }
 
     if_ok &= (checkPath(GlobalConfig::GetDevicePluginPath()));
     if (!if_ok) {
         LogError(
-                "Path <" << GlobalConfig::GetDevicePluginPath() <<
-                "> does not exist.");
+            "Path <" << GlobalConfig::GetDevicePluginPath() <<
+            "> does not exist.");
     }
 
     if_ok &= (checkPath(GlobalConfig::GetUserInstalledWidgetPath()));
     if (!if_ok) {
         LogError(
-                "Path <" << GlobalConfig::GetUserInstalledWidgetPath() <<
-                "> does not exist.");
+            "Path <" << GlobalConfig::GetUserInstalledWidgetPath() <<
+            "> does not exist.");
     }
     return if_ok;
 }
-
 } //namespace PluginUtils
old mode 100755 (executable)
new mode 100644 (file)
index 3109ab3..a542e28
 #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
index 5f78b72..39a81aa 100644 (file)
@@ -24,7 +24,7 @@
 #include <string>
 #include <cstdio>
 
-int main(int argc, char *argv[])
+int main(int /*argc*/, char */*argv*/[])
 {
     DPL::Log::LogSystemSingleton::Instance().SetTag("PLUGINS_INSTALLER");
     LogInfo("Plugins installation started.");
index c461fc8..2f962f0 100644 (file)
@@ -44,57 +44,55 @@ using namespace WrtDeviceApis::StorageEvent::Api;
 #define LOCAL_STORAGE_PROPERTY_LENGTH "length"
 
 #define CATCH_EXCEPTION_NO_MODIFABLE \
-    Catch(Commons::LocalStorageValueNoModifableException) {\
-        LogError("The item is read only");\
-        return JSDOMExceptionFactory::\
-            NoModificationAllowedException.make(context, exception);\
+    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);\
+    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);\
+    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);\
+    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);\
+    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);\
+    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);\
+    Catch(Commons::InvalidArgumentException) { \
+        LogError("Pair for given key doesnt exist"); \
+        return JSValueMakeNull(context); \
     }
 
 namespace WrtPlugins {
 namespace W3C {
-
-
 ILocalStoragePtr getIStorage(JSObjectRef arg)
 {
     LogWarning("get localstorage object");
@@ -125,10 +123,10 @@ JSObjectRef getWidgetObject(JSObjectRef arg)
     }
 
     return priv->widgetObject;
-
 }
 
-enum class ModificationType{
+enum class ModificationType
+{
     RemoveItem,
     SetItem
 };
@@ -142,16 +140,11 @@ IStorageEventPtr modifyItemAndCreateEvent(ModificationType type,
     DPL::Optional<std::string> oldValue =
         getIStorage(thisObject)->getValue(key);
 
-    if (ModificationType::SetItem == type)
-    {
+    if (ModificationType::SetItem == type) {
         getIStorage(thisObject)->setItem(key, value, false);
-    }
-    else if (ModificationType::RemoveItem == type)
-    {
+    } else if (ModificationType::RemoveItem == type) {
         getIStorage(thisObject)->removeItem(key);
-    }
-    else
-    {
+    } else {
         Assert(0 && "Wrong Modification type");
     }
 
@@ -164,16 +157,18 @@ IStorageEventPtr modifyItemAndCreateEvent(ModificationType type,
     //key
     storageEvent->setKey(key);
     //oldvalue
-    if (!!oldValue) { storageEvent->setOldValue(*oldValue); }
+    if (!!oldValue) {
+        storageEvent->setOldValue(*oldValue);
+    }
     //newValue
-    if(!!newValue){ storageEvent->setNewValue(*newValue); }
+    if (!!newValue) {
+        storageEvent->setNewValue(*newValue);
+    }
 
     return storageEvent;
 }
 
-
-JSClassDefinition JSPreferences::m_classInfo =
-{
+JSClassDefinition JSPreferences::m_classInfo = {
     0,
     kJSClassAttributeNone,
     PREFERENCES_PLUGIN_NAME,
@@ -185,12 +180,12 @@ JSClassDefinition JSPreferences::m_classInfo =
     hasProperty,
     getProperty,
     setProperty,
-    NULL,//DeleteProperty,
-    NULL,//GetPropertyNames,
-    NULL,//CallAsFunction,
-    NULL,//CallAsConstructor,
-    NULL,//HasInstance,
-    NULL,//ConvertToType,
+    NULL, //DeleteProperty,
+    NULL, //GetPropertyNames,
+    NULL, //CallAsFunction,
+    NULL, //CallAsConstructor,
+    NULL, //HasInstance,
+    NULL, //ConvertToType,
 };
 
 JSStaticFunction JSPreferences::m_function[] = {
@@ -202,16 +197,15 @@ JSStaticFunction JSPreferences::m_function[] = {
     { 0, 0, 0 }
 };
 
-JSStaticValue JSPreferences::m_property[] =
-{
-    {LOCAL_STORAGE_PROPERTY_LENGTH,
-        JSPreferences::getLength,
-        NULL,
-        kJSPropertyAttributeReadOnly},
+JSStaticValue JSPreferences::m_property[] = {
+    { LOCAL_STORAGE_PROPERTY_LENGTH,
+      JSPreferences::getLength,
+      NULL,
+      kJSPropertyAttributeReadOnly },
     { 0, 0, 0, 0 }
 };
 
-const JSClassRef JSPreferences::getClassRef()
+JSClassRef JSPreferences::getClassRef()
 {
     if (!m_jsClassRef) {
         m_jsClassRef = JSClassCreate(&m_classInfo);
@@ -228,12 +222,12 @@ JSClassRef JSPreferences::m_jsClassRef =
     JSClassCreate(JSPreferences::getClassInfo());
 
 void JSPreferences::initialize(JSContextRef context,
-        JSObjectRef object)
+                               JSObjectRef object)
 {
     LogDebug("entered. Context: " << context);
 
     LocalStoragePrivateData* priv =
-      static_cast<LocalStoragePrivateData*>(JSObjectGetPrivate(object));
+        static_cast<LocalStoragePrivateData*>(JSObjectGetPrivate(object));
 
     Assert(priv && "private object of preferences is NULL");
 }
@@ -242,16 +236,16 @@ void JSPreferences::finalize(JSObjectRef object)
 {
     LogDebug("entered");
     LocalStoragePrivateData* priv =
-      static_cast<LocalStoragePrivateData*>(JSObjectGetPrivate(object));
+        static_cast<LocalStoragePrivateData*>(JSObjectGetPrivate(object));
 
     delete priv;
     LogDebug("private object is realised");
 }
 
 JSValueRef JSPreferences::removeItem(JSContextRef context,
-                                     JSObjectRef object,
+                                     JSObjectRef /*object*/,
                                      JSObjectRef thisObject,
-                                     size_t argumentCount,
+                                     size_t /*argumentCount*/,
                                      const JSValueRef arguments[],
                                      JSValueRef* exception)
 {
@@ -267,7 +261,7 @@ JSValueRef JSPreferences::removeItem(JSContextRef context,
                                               key);
 
         auto iframe = IFrameSupport::
-            getIFrameObjectForWidget(getWidgetObject(thisObject));
+                getIFrameObjectForWidget(getWidgetObject(thisObject));
 
         Assert(iframe && "Iframe is NULL");
 
@@ -281,13 +275,13 @@ JSValueRef JSPreferences::removeItem(JSContextRef context,
     CATCH_EXCEPTION_CONVERSION
     CATCH_EXCEPTION_NULL_PTR
     CATCH_EXCEPTION_PLATFORM_ERROR
-    CATCH_EXCEPTION_SECURITY
+        CATCH_EXCEPTION_SECURITY
 }
 
 JSValueRef JSPreferences::setItem(JSContextRef context,
                                   JSObjectRef object,
                                   JSObjectRef thisObject,
-                                  size_t argumentCount,
+                                  size_t /*argumentCount*/,
                                   const JSValueRef arguments[],
                                   JSValueRef* exception)
 {
@@ -307,7 +301,7 @@ JSValueRef JSPreferences::setItem(JSContextRef context,
                                               value);
 
         auto iframe = IFrameSupport::
-            getIFrameObjectForWidget(getWidgetObject(thisObject));
+                getIFrameObjectForWidget(getWidgetObject(thisObject));
         Assert(iframe && "Iframe is NULL");
 
         AddEventListenerSupport::
@@ -322,15 +316,14 @@ JSValueRef JSPreferences::setItem(JSContextRef context,
     CATCH_EXCEPTION_NULL_PTR
     CATCH_EXCEPTION_PLATFORM_ERROR
     CATCH_EXCEPTION_SECURITY
-    CATCH_EXCEPTION_OUT_OF_RANGE
+        CATCH_EXCEPTION_OUT_OF_RANGE
 }
 
-
 JSValueRef JSPreferences::clear(JSContextRef context,
-                                JSObjectRef object,
+                                JSObjectRef /*object*/,
                                 JSObjectRef thisObject,
-                                size_t argumentCount,
-                                const JSValueRef arguments[],
+                                size_t /*argumentCount*/,
+                                const JSValueRef /*arguments*/[],
                                 JSValueRef* exception)
 {
     LogDebug("entered");
@@ -338,9 +331,8 @@ JSValueRef JSPreferences::clear(JSContextRef context,
     Try {
         getIStorage(thisObject)->clear(false);
 
-
         auto iframe = IFrameSupport::
-            getIFrameObjectForWidget(getWidgetObject(thisObject));
+                getIFrameObjectForWidget(getWidgetObject(thisObject));
 
         Assert(iframe && "Iframe is NULL");
 
@@ -356,13 +348,13 @@ JSValueRef JSPreferences::clear(JSContextRef context,
     }
     CATCH_EXCEPTION_NULL_PTR
     CATCH_EXCEPTION_PLATFORM_ERROR
-    CATCH_EXCEPTION_SECURITY
+        CATCH_EXCEPTION_SECURITY
 }
 
 JSValueRef JSPreferences::getItem(JSContextRef context,
-                                  JSObjectRef object,
+                                  JSObjectRef /*object*/,
                                   JSObjectRef thisObject,
-                                  size_t argumentCount,
+                                  size_t /*argumentCount*/,
                                   const JSValueRef arguments[],
                                   JSValueRef* exception)
 {
@@ -378,20 +370,21 @@ JSValueRef JSPreferences::getItem(JSContextRef context,
         DPL::Optional<std::string> value =
             getIStorage(thisObject)->getValue(key);
 
-        if (!value)
+        if (!value) {
             return JSValueMakeNull(context);
-        else
+        } else {
             return converter.toJSValueRef(*value);
+        }
     }
     CATCH_EXCEPTION_INVALID_ARG
     CATCH_EXCEPTION_CONVERSION
     CATCH_EXCEPTION_NULL_PTR
     CATCH_EXCEPTION_PLATFORM_ERROR
-    CATCH_EXCEPTION_SECURITY
+        CATCH_EXCEPTION_SECURITY
 }
 
 JSValueRef JSPreferences::key(JSContextRef context,
-                              JSObjectRef object,
+                              JSObjectRef /*object*/,
                               JSObjectRef thisObject,
                               size_t argumentCount,
                               const JSValueRef arguments[],
@@ -399,8 +392,8 @@ JSValueRef JSPreferences::key(JSContextRef context,
 {
     LogDebug("entered");
 
-    Try{
-        if (argumentCount<1) {
+    Try {
+        if (argumentCount < 1) {
             LogError("No argument found");
             Throw(Commons::InvalidArgumentException);
         }
@@ -419,12 +412,12 @@ JSValueRef JSPreferences::key(JSContextRef context,
     CATCH_EXCEPTION_NULL_PTR
     CATCH_EXCEPTION_PLATFORM_ERROR
     CATCH_EXCEPTION_SECURITY
-    CATCH_EXCEPTION_INVALID_ARG
+        CATCH_EXCEPTION_INVALID_ARG
 }
 
 JSValueRef JSPreferences::getLength(JSContextRef context,
                                     JSObjectRef object,
-                                    JSStringRef propertyName,
+                                    JSStringRef /*propertyName*/,
                                     JSValueRef* exception)
 {
     LogDebug("enter");
@@ -440,21 +433,21 @@ JSValueRef JSPreferences::getLength(JSContextRef context,
     CATCH_EXCEPTION_NULL_PTR
     CATCH_EXCEPTION_PLATFORM_ERROR
     CATCH_EXCEPTION_SECURITY
-    CATCH_EXCEPTION_INVALID_ARG
+        CATCH_EXCEPTION_INVALID_ARG
 }
 
 bool JSPreferences::hasProperty(JSContextRef context,
-                           JSObjectRef object,
-                           JSStringRef propertyName)
+                                JSObjectRef object,
+                                JSStringRef propertyName)
 {
     LogDebug("enter");
 
-    Try{
+    Try {
         Converter converter(context);
 
         std::string key = converter.toString(propertyName);
 
-        if(!getIStorage(object)->getValue(key)) {
+        if (!getIStorage(object)->getValue(key)) {
             return false;
         } else {
             return true;
@@ -486,7 +479,7 @@ JSValueRef JSPreferences::getProperty(JSContextRef context,
 {
     LogDebug("enter");
 
-    Try{
+    Try {
         Converter converter(context);
 
         std::string key = converter.toString(propertyName);
@@ -496,16 +489,17 @@ JSValueRef JSPreferences::getProperty(JSContextRef context,
 
         LogDebug("end");
 
-        if (!value)
+        if (!value) {
             return JSValueMakeNull(context);
-        else
+        } else {
             return converter.toJSValueRef(*value);
+        }
     }
 
     CATCH_EXCEPTION_CONVERSION
     CATCH_EXCEPTION_NULL_PTR
     CATCH_EXCEPTION_PLATFORM_ERROR
-    CATCH_EXCEPTION_INVALID_ARG
+        CATCH_EXCEPTION_INVALID_ARG
 }
 
 bool JSPreferences::setProperty(JSContextRef context,
@@ -516,7 +510,7 @@ bool JSPreferences::setProperty(JSContextRef context,
 {
     LogDebug("enter");
 
-    Try{
+    Try {
         Converter converter(context);
 
         std::string key = converter.toString(propertyName);
@@ -528,7 +522,7 @@ bool JSPreferences::setProperty(JSContextRef context,
                                               value);
 
         auto iframe = IFrameSupport::
-            getIFrameObjectForWidget(getWidgetObject(object));
+                getIFrameObjectForWidget(getWidgetObject(object));
         Assert(iframe && "Iframe is NULL");
 
         AddEventListenerSupport::
@@ -544,7 +538,7 @@ bool JSPreferences::setProperty(JSContextRef context,
     CATCH_EXCEPTION_CONVERSION
     CATCH_EXCEPTION_NULL_PTR
     CATCH_EXCEPTION_PLATFORM_ERROR
-    CATCH_EXCEPTION_SECURITY
+        CATCH_EXCEPTION_SECURITY
 
     return false;
 }
@@ -556,6 +550,5 @@ bool JSPreferences::setProperty(JSContextRef context,
 #undef CATCH_EXCEPTION_SECURITY
 #undef CATCH_EXCEPTION_OUT_OF_RANGE
 #undef CATCH_EXCEPTION_INVALID_ARG
-
 }
 }
index c91d4c5..b86bae8 100644 (file)
@@ -30,8 +30,7 @@
 
 namespace WrtPlugins {
 namespace W3C {
-
-struct LocalStoragePrivateData{
+struct LocalStoragePrivateData {
     WrtDeviceApis::LocalStorage::Api::ILocalStoragePtr istorage;
     //parent
     JSObjectRef widgetObject;
@@ -39,18 +38,18 @@ struct LocalStoragePrivateData{
 
 class JSPreferences
 {
-public:
+  public:
     /**
      * This method initializes this in the JS Engine.
      */
-    static const JSClassRef getClassRef();
+    static JSClassRef getClassRef();
 
     /**
      * Gets object's class description.
      */
     static const JSClassDefinition* getClassInfo();
 
-private:
+  private:
     /**
      * The callback invoked when an object is first created.
      */
@@ -121,7 +120,6 @@ private:
                             JSStringRef propertyName,
                             JSValueRef value,
                             JSValueRef* exception);
-
 };
 }
 }
index 9daec95..6dd18ba 100644 (file)
 #include <Commons/WrtAccess/WrtAccess.h>
 #include <js-overlay/js_iframe_support.h>
 
-
 #define CATCH_EXCEPTION_NO_MODIFABLE \
-    Catch(Commons::LocalStorageValueNoModifableException) {\
-        LogError("The item is read only");\
-        return JSDOMExceptionFactory::\
-            NoModificationAllowedException.make(context, exception);\
+    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);\
+    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);\
+    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);\
+    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);\
+    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);\
+    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);\
+    Catch(Commons::InvalidArgumentException) { \
+        LogError("Pair for given key doesnt exist"); \
+        return JSValueMakeNull(context); \
     }
 
 #define WIDGET_PLUGIN_NAME "Widget"
 
 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;
+    //int widgetId     // TODO: check is it necessary (g.rynkowski)
     JSObjectRef widgetObject;
 };
 typedef std::shared_ptr<WidgetPrivateObject> WidgetPrivateObjectPtr;
 
 typedef WrtDeviceApis::CommonsJavaScript::PrivateObjectT
-    <WidgetPrivateObjectPtr>::Type JSWidgetPrivateObject;
+<WidgetPrivateObjectPtr>::Type JSWidgetPrivateObject;
 
 WrtDeviceApis::Widget::Api::IWidgetPtr getIWidget(JSObjectRef arg)
 {
@@ -131,7 +128,6 @@ WrtDeviceApis::Widget::Api::IWidgetPtr getIWidget(JSObjectRef arg)
     return priv->getObject()->iwidget;
 }
 
-
 LocalStorage::Api::ILocalStoragePtr getLocalStorage(int widgetId)
 {
     LocalStorage::Api::ILocalStoragePtr storage(
@@ -168,7 +164,7 @@ JSObjectRef createPreferencesObject(JSContextRef context,
                                            JSPreferences::getClassRef(),
                                            priv);
 
-    if(!preferences){
+    if (!preferences) {
         LogError("Preferences object is null");
         delete priv;
     }
@@ -176,8 +172,7 @@ JSObjectRef createPreferencesObject(JSContextRef context,
     JSValueProtect(context, preferences);
 
     return preferences;
-};
-
+}
 
 JSClassDefinition JSWidget::m_classInfo = {
     0,
@@ -223,7 +218,7 @@ JSStaticValue JSWidget::m_property[] = {
     { 0, 0, 0, 0 }
 };
 
-const JSClassRef JSWidget::getClassRef()
+JSClassRef JSWidget::getClassRef()
 {
     if (!m_jsClassRef) {
         m_jsClassRef = JSClassCreate(&m_classInfo);
@@ -241,7 +236,7 @@ JSClassRef JSWidget::m_jsClassRef = JSClassCreate(JSWidget::getClassInfo());
 JSContextRef JSWidget::m_globalContext = NULL;
 
 void JSWidget::initialize(JSContextRef context,
-        JSObjectRef object)
+                          JSObjectRef object)
 {
     LogDebug("entered. Context : " << context);
     LogDebug("Object: " << object);
@@ -262,7 +257,7 @@ void JSWidget::initialize(JSContextRef context,
                 createPreferencesObject(context,
                                         object,
                                         widgetId);
-            if(!preferences){
+            if (!preferences) {
                 LogError("Failed to create preferences object");
             }
 
@@ -273,7 +268,6 @@ void JSWidget::initialize(JSContextRef context,
             priv = new JSWidgetPrivateObject(context, widgetPriv);
             JSObjectSetPrivate(object, priv);
             LogDebug("private object created");
-
         }
         Catch(Commons::InvalidArgumentException){
             LogError("You should register widget id in ON_WIDGET_START");
@@ -283,7 +277,6 @@ void JSWidget::initialize(JSContextRef context,
             LogError("Failed to create private object for JSWidget");
             return;
         }
-
     }
 }
 
@@ -306,8 +299,8 @@ void JSWidget::finalize(JSObjectRef object)
 }
 
 void JSWidget::acquireGlobalContext(java_script_context_t global_context,
-        js_object_instance_t iframe,
-        js_object_instance_t object)
+                                    js_object_instance_t iframe,
+                                    js_object_instance_t object)
 {
     IFrameSupport::RegisterWidget(global_context, iframe, object);
     if (!m_globalContext) {
@@ -319,9 +312,9 @@ void JSWidget::acquireGlobalContext(java_script_context_t global_context,
 }
 
 JSValueRef JSWidget::getAuthor(JSContextRef context,
-        JSObjectRef object,
-        JSStringRef propertyName,
-        JSValueRef* exception)
+                               JSObjectRef object,
+                               JSStringRef /*propertyName*/,
+                               JSValueRef* exception)
 {
     LogDebug("entered");
 
@@ -331,13 +324,13 @@ JSValueRef JSWidget::getAuthor(JSContextRef context,
     }
     CATCH_EXCEPTION_CONVERSION
     CATCH_EXCEPTION_NULL_PTR
-    CATCH_EXCEPTION_PLATFORM_ERROR
+        CATCH_EXCEPTION_PLATFORM_ERROR
 }
 
 JSValueRef JSWidget::getAuthorEmail(JSContextRef context,
-        JSObjectRef object,
-        JSStringRef propertyName,
-        JSValueRef* exception)
+                                    JSObjectRef object,
+                                    JSStringRef /*propertyName*/,
+                                    JSValueRef* exception)
 {
     Try {
         Converter converter(context);
@@ -345,13 +338,13 @@ JSValueRef JSWidget::getAuthorEmail(JSContextRef context,
     }
     CATCH_EXCEPTION_CONVERSION
     CATCH_EXCEPTION_NULL_PTR
-    CATCH_EXCEPTION_PLATFORM_ERROR
+        CATCH_EXCEPTION_PLATFORM_ERROR
 }
 
 JSValueRef JSWidget::getAuthorHref(JSContextRef context,
-        JSObjectRef object,
-        JSStringRef propertyName,
-        JSValueRef* exception)
+                                   JSObjectRef object,
+                                   JSStringRef /*propertyName*/,
+                                   JSValueRef* exception)
 {
     Try {
         Converter converter(context);
@@ -359,13 +352,13 @@ JSValueRef JSWidget::getAuthorHref(JSContextRef context,
     }
     CATCH_EXCEPTION_CONVERSION
     CATCH_EXCEPTION_NULL_PTR
-    CATCH_EXCEPTION_PLATFORM_ERROR
+        CATCH_EXCEPTION_PLATFORM_ERROR
 }
 
 JSValueRef JSWidget::getDescription(JSContextRef context,
-        JSObjectRef object,
-        JSStringRef propertyName,
-        JSValueRef* exception)
+                                    JSObjectRef object,
+                                    JSStringRef /*propertyName*/,
+                                    JSValueRef* exception)
 {
     Try {
         Converter converter(context);
@@ -373,13 +366,13 @@ JSValueRef JSWidget::getDescription(JSContextRef context,
     }
     CATCH_EXCEPTION_CONVERSION
     CATCH_EXCEPTION_NULL_PTR
-    CATCH_EXCEPTION_PLATFORM_ERROR
+        CATCH_EXCEPTION_PLATFORM_ERROR
 }
 
 JSValueRef JSWidget::getId(JSContextRef context,
-        JSObjectRef object,
-        JSStringRef propertyName,
-        JSValueRef* exception)
+                           JSObjectRef object,
+                           JSStringRef /*propertyName*/,
+                           JSValueRef* exception)
 {
     Try {
         Converter converter(context);
@@ -387,13 +380,13 @@ JSValueRef JSWidget::getId(JSContextRef context,
     }
     CATCH_EXCEPTION_CONVERSION
     CATCH_EXCEPTION_NULL_PTR
-    CATCH_EXCEPTION_PLATFORM_ERROR
+        CATCH_EXCEPTION_PLATFORM_ERROR
 }
 
 JSValueRef JSWidget::getName(JSContextRef context,
-        JSObjectRef object,
-        JSStringRef propertyName,
-        JSValueRef* exception)
+                             JSObjectRef object,
+                             JSStringRef /*propertyName*/,
+                             JSValueRef* exception)
 {
     Try {
         Converter converter(context);
@@ -401,13 +394,13 @@ JSValueRef JSWidget::getName(JSContextRef context,
     }
     CATCH_EXCEPTION_CONVERSION
     CATCH_EXCEPTION_NULL_PTR
-    CATCH_EXCEPTION_PLATFORM_ERROR
+        CATCH_EXCEPTION_PLATFORM_ERROR
 }
 
 JSValueRef JSWidget::getShortName(JSContextRef context,
-        JSObjectRef object,
-        JSStringRef propertyName,
-        JSValueRef* exception)
+                                  JSObjectRef object,
+                                  JSStringRef /*propertyName*/,
+                                  JSValueRef* exception)
 {
     Try {
         Converter converter(context);
@@ -415,13 +408,13 @@ JSValueRef JSWidget::getShortName(JSContextRef context,
     }
     CATCH_EXCEPTION_CONVERSION
     CATCH_EXCEPTION_NULL_PTR
-    CATCH_EXCEPTION_PLATFORM_ERROR
+        CATCH_EXCEPTION_PLATFORM_ERROR
 }
 
 JSValueRef JSWidget::getVersion(JSContextRef context,
-        JSObjectRef object,
-        JSStringRef propertyName,
-        JSValueRef* exception)
+                                JSObjectRef object,
+                                JSStringRef /*propertyName*/,
+                                JSValueRef* exception)
 {
     Try {
         Converter converter(context);
@@ -429,13 +422,13 @@ JSValueRef JSWidget::getVersion(JSContextRef context,
     }
     CATCH_EXCEPTION_CONVERSION
     CATCH_EXCEPTION_NULL_PTR
-    CATCH_EXCEPTION_PLATFORM_ERROR
+        CATCH_EXCEPTION_PLATFORM_ERROR
 }
 
 JSValueRef JSWidget::getHeight(JSContextRef context,
-        JSObjectRef object,
-        JSStringRef propertyName,
-        JSValueRef* exception)
+                               JSObjectRef object,
+                               JSStringRef /*propertyName*/,
+                               JSValueRef* exception)
 {
     Try {
         Converter converter(context);
@@ -447,13 +440,13 @@ JSValueRef JSWidget::getHeight(JSContextRef context,
     }
     CATCH_EXCEPTION_CONVERSION
     CATCH_EXCEPTION_NULL_PTR
-    CATCH_EXCEPTION_PLATFORM_ERROR
+        CATCH_EXCEPTION_PLATFORM_ERROR
 }
 
 JSValueRef JSWidget::getWidth(JSContextRef context,
-        JSObjectRef object,
-        JSStringRef propertyName,
-        JSValueRef* exception)
+                              JSObjectRef object,
+                              JSStringRef /*propertyName*/,
+                              JSValueRef* exception)
 {
     Try {
         Converter converter(context);
@@ -465,16 +458,16 @@ JSValueRef JSWidget::getWidth(JSContextRef context,
     }
     CATCH_EXCEPTION_CONVERSION
     CATCH_EXCEPTION_NULL_PTR
-    CATCH_EXCEPTION_PLATFORM_ERROR
+        CATCH_EXCEPTION_PLATFORM_ERROR
 }
 
 bool JSWidget::hasProperty(JSContextRef context,
-                           JSObjectRef object,
+                           JSObjectRef /*object*/,
                            JSStringRef propertyName)
 {
     LogDebug("enter");
 
-    Try{
+    Try {
         Converter converter(context);
 
         std::string key = converter.toString(propertyName);
@@ -512,11 +505,10 @@ JSValueRef JSWidget::getProperty(JSContextRef context,
 
         std::string key = converter.toString(propertyName);
 
-        if (key=="preferences") {
+        if (key == "preferences") {
             Converter converter(context);
             JSObjectRef pref = getPreferences(object);
-            if (!pref)
-            {
+            if (!pref) {
                 LogError("Preferences object is NULL");
                 return JSValueMakeUndefined(context);
             }
@@ -528,43 +520,43 @@ JSValueRef JSWidget::getProperty(JSContextRef context,
 
     CATCH_EXCEPTION_CONVERSION
     CATCH_EXCEPTION_NULL_PTR
-    CATCH_EXCEPTION_INVALID_ARG
+        CATCH_EXCEPTION_INVALID_ARG
 }
 
 bool JSWidget::setProperty(JSContextRef context,
-                           JSObjectRef object,
+                           JSObjectRef /*object*/,
                            JSStringRef propertyName,
-                           JSValueRef jvalue,
+                           JSValueRef /*jvalue*/,
                            JSValueRef* exception)
 {
     LogDebug("enter");
 
-    Try{
+    Try {
         Converter converter(context);
 
         std::string key = converter.toString(propertyName);
-        if (key == "preferences"){
+        if (key == "preferences") {
             LogError("Object is read only");
             return true;
         }
     }
     CATCH_EXCEPTION_INVALID_ARG
     CATCH_EXCEPTION_CONVERSION
-    CATCH_EXCEPTION_NULL_PTR
+        CATCH_EXCEPTION_NULL_PTR
 
     return false;
 }
 
 JSObjectRef JSWidget::callAsConstructor(JSContextRef context,
-                                        JSObjectRef constructor,
-                                        size_t argumentCount,
-                                        const JSValueRef arguments[],
-                                        JSValueRef* exception)
+                                        JSObjectRef /*constructor*/,
+                                        size_t /*argumentCount*/,
+                                        const JSValueRef /*arguments*/[],
+                                        JSValueRef* /*exception*/)
 {
     LogDebug("widget constructor");
     if (!m_globalContext) {
         LogError("Global context not set. Creating 'widget' object with "
-                "local context!");
+                 "local context!");
         return JSObjectMake(context, JSWidget::getClassRef(), NULL);
     }
     return JSObjectMake(m_globalContext, JSWidget::getClassRef(), NULL);
@@ -577,6 +569,5 @@ JSObjectRef JSWidget::callAsConstructor(JSContextRef context,
 #undef CATCH_EXCEPTION_SECURITY
 #undef CATCH_EXCEPTION_OUT_OF_RANGE
 #undef CATCH_EXCEPTION_INVALID_ARG
-
 }
 }
index 3be203a..c0bf403 100644 (file)
 
 namespace WrtPlugins {
 namespace W3C {
-
-
 class JSWidget
 {
   public:
     /**
      * This method initializes this in the JS Engine.
      */
-    static const JSClassRef getClassRef();
+    static JSClassRef getClassRef();
 
     /**
      * Gets object's class description.
@@ -60,15 +58,15 @@ class JSWidget
      * called in finalize may fail because of invalid context.
      */
     static void acquireGlobalContext(java_script_context_t global_context,
-            js_object_instance_t iframe,
-            js_object_instance_t object);
+                                     js_object_instance_t iframe,
+                                     js_object_instance_t object);
 
   private:
     /**
      * The callback invoked when an object is first created.
      */
     static void initialize(JSContextRef context,
-            JSObjectRef object);
+                           JSObjectRef object);
 
     /**
      * The callback invoked when an object is finalized.
@@ -81,7 +79,8 @@ class JSWidget
     static JSStaticValue m_property[];
 
     /**
-     * This structure contains properties and callbacks that define a type of object.
+     * This structure contains properties and callbacks that define a type of
+     * object.
      */
     static JSClassDefinition m_classInfo;
 
@@ -148,7 +147,6 @@ class JSWidget
                             JSStringRef propertyName,
                             JSValueRef value,
                             JSValueRef* exception);
-
 };
 }
 }
index 581bec5..8588aca 100644 (file)
 
 namespace WrtPlugins {
 namespace W3C {
-
 template <>
 WidgetDeclarations::ParamsMap WidgetDeclarations::m_params =
-        WrtPlugins::W3C::WidgetDeclarations::ParamsMap();
+    WrtPlugins::W3C::WidgetDeclarations::ParamsMap();
 
 template <>
 WidgetDeclarations::DeviceCapsMaps WidgetDeclarations::m_deviceCaps =
-        WrtPlugins::W3C::WidgetDeclarations::DeviceCapsMaps();
-
+    WrtPlugins::W3C::WidgetDeclarations::DeviceCapsMaps();
 
 template <>
-WidgetDeclarations::FeaturesMap WidgetDeclarations::m_features =
-{
+WidgetDeclarations::FeaturesMap WidgetDeclarations::m_features = {
     {
         "http://w3cWidgetInterface.com/w3c-widget-interface",
-        {
-        }
+        {}
     }
 };
 
 template <>
 WidgetDeclarations::FunctionsMap WidgetDeclarations::m_functions =
-        WrtPlugins::W3C::WidgetDeclarations::FunctionsMap();
-
+    WrtPlugins::W3C::WidgetDeclarations::FunctionsMap();
 } // namespace Wac2_0
 } // namespace WrtPlugins
index f0f8326..13de247 100644 (file)
 
 namespace WrtPlugins {
 namespace W3C {
+enum class WidgetParamId
+{};
 
-enum class WidgetParamId {
-};
+enum class WidgetDeviceCapId
+{};
 
-enum class WidgetDeviceCapId {
-};
-
-enum class WidgetFunctionId {
-};
+enum class WidgetFunctionId
+{};
 
 typedef WrtDeviceApis::CommonsJavaScript::StaticDeclarations <
-        WidgetParamId,
-        WidgetDeviceCapId,
-        WidgetFunctionId> WidgetDeclarations;
-
+    WidgetParamId,
+    WidgetDeviceCapId,
+    WidgetFunctionId> WidgetDeclarations;
 }
 }
 
index 6042af9..6b64770 100644 (file)
@@ -41,10 +41,8 @@ using namespace WrtPlugins::W3C;
 using namespace WrtDeviceApis;
 using namespace WrtDeviceApis::Commons;
 
-namespace Options{
-
-class_definition_options_t WidgetOptions =
-{
+namespace Options {
+class_definition_options_t WidgetOptions = {
     JS_CLASS,
     CREATE_INSTANCE,
     ALWAYS_NOTICE,
@@ -54,8 +52,7 @@ class_definition_options_t WidgetOptions =
     NULL
 };
 
-class_definition_options_t WidgetInterfaceOptions =
-{
+class_definition_options_t WidgetInterfaceOptions = {
     JS_INTERFACE,
     CREATE_INSTANCE,
     ALWAYS_NOTICE,
@@ -64,7 +61,6 @@ class_definition_options_t WidgetInterfaceOptions =
     NULL,
     NULL
 };
-
 };
 
 void on_widget_init_callback(feature_mapping_interface_t *mapping)
@@ -82,7 +78,7 @@ void on_widget_start_callback(int widgetId)
     {
         WrtAccessSingleton::Instance().initialize(widgetId);
     }
-    Catch (Commons::Exception)
+    Catch(Commons::Exception)
     {
         LogError("Wrt wrapper registration failed");
         return;
@@ -96,12 +92,11 @@ void on_widget_stop_callback(int widgetId)
     {
         WrtAccessSingleton::Instance().deinitialize(widgetId);
     }
-    Catch (Commons::Exception)
+    Catch(Commons::Exception)
     {
         LogError("Wrt wrapper registration failed");
         return;
     }
-
 }
 
 PLUGIN_ON_WIDGET_START(on_widget_start_callback)
@@ -110,16 +105,17 @@ 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)
+    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)
+    WRT_JS_EXTENSION_OBJECT_GLOBAL,
+    OBJECT_WIDGET,
+    INTERFACE_WIDGET_NAME,
+    &Options::WidgetOptions)
 
 PLUGIN_CLASS_MAP_END
 
index 16b0640..6d51ace 100644 (file)
@@ -20,7 +20,8 @@
  */
 
 /*
- * This is just a example pop-up that shows how to use a new C-API in wrt-security.
+ * 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 "Popup.h"
 
 namespace { // anonymous
-
-static void set_validity_from_checkbox(struct ace_popup_data *pdp) {
-
-    if(NULL == pdp){
+static void set_validity_from_checkbox(struct ace_popup_data *pdp)
+{
+    if (NULL == pdp) {
         LogError("pdp is NULL; return");
         return;
     }
@@ -65,20 +65,23 @@ static void set_validity_from_checkbox(struct ace_popup_data *pdp) {
     return;
 }
 
-static void on_done(void) {
+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 */) {
-
+static void grant_answer(void *data,
+                         Evas_Object * /* obj */,
+                         void * /* event_info */)
+{
     LogDebug("grant_answer");
-    if(NULL == data){
+    if (NULL == data) {
         LogError("data is NULL; return");
         return;
     }
-    struct ace_popup_data *pdp = static_cast <struct ace_popup_data *> (data);
+    struct ace_popup_data *pdp = static_cast <struct ace_popup_data *>(data);
 
     set_validity_from_checkbox(pdp);
 
@@ -96,14 +99,16 @@ static void grant_answer(void *data, Evas_Object * /* obj */, void * /* event_in
     on_done();
 }
 
-static void deny_answer(void *data, Evas_Object * /* obj */, void * /* event_info */) {
-
+static void deny_answer(void *data,
+                        Evas_Object * /* obj */,
+                        void * /* event_info */)
+{
     LogDebug("deny_answer");
-    if(NULL == data){
+    if (NULL == data) {
         LogError("data is NULL; return");
         return;
     }
-    struct ace_popup_data *pdp = static_cast <struct ace_popup_data *> (data);
+    struct ace_popup_data *pdp = static_cast <struct ace_popup_data *>(data);
 
     set_validity_from_checkbox(pdp);
 
@@ -121,11 +126,12 @@ static void deny_answer(void *data, Evas_Object * /* obj */, void * /* event_inf
     on_done();
 }
 
-static int _ace_params_deserializer(ace_param_list_t* ace_param_list, Wrt::Popup::BinaryStream *stream){
-
+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){
+    if (NULL == ace_param_list || NULL == stream) {
         LogError("ace_param_list or stream is NULL; return -1");
         return -1;
     }
@@ -138,26 +144,28 @@ static int _ace_params_deserializer(ace_param_list_t* ace_param_list, Wrt::Popup
 
     std::string name;
     std::string value;
-    if(count == 0){
+    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)));
+    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){
+    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()));
+            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()));
+            strdup(const_cast <char *>(value.c_str()));
     }
     return 0;
 }
 
-static void _ace_params_finalize(ace_param_list_t* ace_param_list) {
+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;
@@ -171,25 +179,24 @@ static void _ace_params_finalize(ace_param_list_t* ace_param_list) {
     ace_param_list->count = 0;
 }
 
-static void show_popup(struct ace_popup_data *pdp) {
+static void show_popup(struct ace_popup_data *pdp)
+{
     LogDebug("show_popup()");
 
-    if(NULL == pdp){
+    if (NULL == pdp) {
         LogError("pdp is NULL; return");
         return;
     }
 
-    const char *resource_type = static_cast <char *> (pdp->resource_name);
+    const char *resource_type = static_cast <char *>(pdp->resource_name);
 
-    Evas_Object *win          = NULL;
-    Evas_Object *cb_session   = NULL;
-    Evas_Object *cb_always    = NULL;
-    Evas_Object *box          = NULL;
-    Evas_Object *label        = NULL;
+    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;
+    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);
@@ -207,7 +214,10 @@ static void show_popup(struct ace_popup_data *pdp) {
     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)){
+    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);
@@ -224,23 +234,31 @@ static void show_popup(struct ace_popup_data *pdp) {
     LogDebug("popup_type == " << pdp->popup_type);
     if (pdp->popup_type == ACE_SESSION || pdp->popup_type == ACE_BLANKET) {
         LogDebug("popup_type == ACE_SESSION || ACE_BLANKET");
-        cb_session = elm_check_add(pdp->popup);
+        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_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");
-            cb_always = elm_check_add(pdp->popup);
+            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_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);
         }
@@ -266,23 +284,21 @@ static void show_popup(struct ace_popup_data *pdp) {
     // Run the efl mainloop
     elm_run();
 }
-
 } // anonymous
 
-
 EAPI_MAIN int
-elm_main(int argc , char ** argv)
+elm_main(int argc, char ** argv)
 {
     UNHANDLED_EXCEPTION_HANDLER_BEGIN
     {
-// int pipe_in and int pipe_out should be passed to Popup via args.
+        // 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
+        //  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");
@@ -290,31 +306,41 @@ elm_main(int argc , char ** argv)
             //cannot run logger
             return ACE_INTERNAL_ERROR;
         }
-        LogDebug("############################ popup binary ################################");
+        LogDebug(
+            "############################ popup binary ################################");
 
-        if(argc < 3){
-            LogError("To few args passed in exec to popup-bin - should be at least 3:");
+        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]);
+        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)
-        if ( 0 == sscanf(argv[1], "%d", &pipe_in) ){
+        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;
         }
-        if ( 0 == sscanf(argv[2], "%d", &pipe_out) ){
+        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;
         }
-        LogDebug("Parsed pipes: IN: " << pipe_in <<", OUT: " <<  pipe_out);
+        parsing_stream.clear();
+        LogDebug("Parsed pipes: IN: " << pipe_in << ", OUT: " << pipe_out);
 
-        int  buff_size = 1024;
+        int buff_size = 1024;
         char line[buff_size];
 
         struct ace_popup_data pd;
@@ -330,26 +356,27 @@ elm_main(int argc , char ** argv)
         // timeout is set for 10 seconds
         do {
             count = TEMP_FAILURE_RETRY(read(pipe_in, line, buff_size));
-            if ( timeout < difftime(time(NULL), time_start) ) {
+            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){
+        if (count < 0) {
             close(pipe_in);
             close(pipe_out);
-            LogError("read returned a negative value (" << count <<")");
-            LogError("errno: " << strerror( errno ) );
+            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)");
+        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));
+        stream.Write(count, static_cast <void *>(line));
         int popup_type = ACE_ONESHOT;
         std::string resource_name_str;
         std::string session_id_str;
@@ -361,23 +388,23 @@ elm_main(int argc , char ** argv)
 
         DPL::Deserialization::Deserialize(stream, popup_type);
         LogDebug("popup_type_int : " << popup_type);
-        pdp->popup_type = static_cast <ace_popup_t> (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()));
+            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()));
+            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);
+        pdp->handle = static_cast <ace_widget_handle_t>(handle);
 
-        if(_ace_params_deserializer(&(pdp->param_list), &stream)){
+        if (_ace_params_deserializer(&(pdp->param_list), &stream)) {
             return ACE_INTERNAL_ERROR;
         }
 
@@ -394,7 +421,10 @@ elm_main(int argc , char ** argv)
         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()))){
+        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;
@@ -403,27 +433,26 @@ elm_main(int argc , char ** argv)
 
         if (pdp->validation_return == ACE_OK) {
             LogDebug("ACE_OK");
-        }
-        else if (pdp->validation_return == ACE_INVALID_ARGUMENTS) {
+        } else if (pdp->validation_return == ACE_INVALID_ARGUMENTS) {
             LogError("ACE_INVALID_ARGUMENTS");
-        }
-        else if (pdp->validation_return == ACE_INTERNAL_ERROR) {
+        } else if (pdp->validation_return == ACE_INTERNAL_ERROR) {
             LogError("ACE_INTERNAL_ERROR");
-        }
-        else if (pdp->validation_return == ACE_ACE_UNKNOWN_ERROR) {
+        } else if (pdp->validation_return == ACE_ACE_UNKNOWN_ERROR) {
             LogError("ACE_ACE_UNKNOWN_ERROR");
-        }
-        else {
+        } else {
             LogError("Really unknown error!!!");
         }
 
-        LogDebug("############################ /popup binary ################################");
+        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
+        // 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));
index 8c841d6..388c921 100644 (file)
 #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;
+    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;
+    Eina_Bool per_session;
+    Eina_Bool always;
 
-    ace_validity_t       remember_choice;
+    ace_validity_t remember_choice;
 };
index 0068bcc..e46fc16 100644 (file)
@@ -20,7 +20,8 @@
  */
 
 /*
- * This is just a example pop-up that shows how to use a new C-API in wrt-security.
+ * 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 "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){
-
+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){
+    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);
+    size_t count = static_cast <size_t>(ace_param_list->count);
     DPL::Serialization::Serialize(*stream, count);
 
-    for(size_t i=0; i < count; ++i){
+    for (size_t i = 0; i < count; ++i) {
         std::string name(ace_param_list->items[i].name);
         DPL::Serialization::Serialize(*stream, name);
 
@@ -62,58 +63,60 @@ void _ace_params_serializer (const ace_param_list_t* ace_param_list, Wrt::Popup:
         DPL::Serialization::Serialize(*stream, value);
     }
 }
-
 } // anonymous namespace
 
 namespace Wrt {
 namespace Popup {
-
 // BinaryStream class implementation
-void BinaryStream::Read(size_t num, void * bytes) {
+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){
+        if (i + m_readPosition >= max_size) {
             return;
         }
-        static_cast <unsigned char*> (bytes)[i] = m_data[i + m_readPosition];
+        static_cast <unsigned char*>(bytes)[i] = m_data[i + m_readPosition];
     }
     m_readPosition += num;
 }
 
-void BinaryStream::Write(size_t num, const void * bytes) {
+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]);
+        m_data.push_back(static_cast <const unsigned char*>(bytes)[i]);
     }
 }
 
-BinaryStream::BinaryStream() {
+BinaryStream::BinaryStream()
+{
     m_readPosition = 0;
 }
 
-BinaryStream::~BinaryStream() {
-}
+BinaryStream::~BinaryStream() {}
 
-const unsigned char* BinaryStream::char_pointer() const {
+const unsigned char* BinaryStream::char_pointer() const
+{
     return &m_data[0];
 }
 
-size_t BinaryStream::size() const {
+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)
+    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 )
+    if (NULL == resource_name ||
+        NULL == session_id ||
+        NULL == ace_param_list ||
+        NULL == validation_result)
     {
         LogError("run_popup : ACE_INVALID_ARGUMENTS");
         return ACE_INVALID_ARGUMENTS;
@@ -123,10 +126,10 @@ ace_return_t run_popup(
     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);
+    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;
@@ -140,17 +143,17 @@ ace_return_t run_popup(
 
     DPL::Serialization::Serialize(stream, handle_int);
 
-    _ace_params_serializer (ace_param_list, &stream);
+    _ace_params_serializer(ace_param_list, &stream);
 
-    int   fd_send_to_child[2];
-    int   fd_send_to_parent[2];
+    int fd_send_to_child[2];
+    int fd_send_to_parent[2];
     pid_t childpid;
 
-    if(0 != pipe(fd_send_to_child)){
+    if (0 != pipe(fd_send_to_child)) {
         LogError("Cannot create pipes!");
         return ACE_INTERNAL_ERROR;
     }
-    if(0 != pipe(fd_send_to_parent)){
+    if (0 != pipe(fd_send_to_parent)) {
         LogError("Cannot create pipes!");
         return ACE_INTERNAL_ERROR;
     }
@@ -160,7 +163,7 @@ ace_return_t run_popup(
         return ACE_ACE_UNKNOWN_ERROR;
     }
 
-    if(childpid == 0) { // Child process
+    if (childpid == 0) { // Child process
         LogDebug("Child");
 
         // read data from parent
@@ -171,31 +174,37 @@ ace_return_t run_popup(
 
         std::stringstream pipe_in_buff;
         std::stringstream pipe_out_buff;
-        pipe_in_buff  << fd_send_to_parent[1];
+        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_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]);
+        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){
+        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;
+        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()))){
+        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;
         }
@@ -208,8 +217,7 @@ ace_return_t run_popup(
         int status;
         wait(&status);
         LogDebug("STATUS EXIT ON POPUP (CHILD): " << status);
-        switch (status){
-
+        switch (status) {
         case ACE_OK:
             LogDebug("ACE_OK");
             break;
@@ -217,43 +225,44 @@ ace_return_t run_popup(
         case ACE_INVALID_ARGUMENTS:
             LogDebug("ACE_INVALID_ARGUMENTS");
             close(fd_send_to_parent[0]);
-            return static_cast <ace_return_t> (status);
+            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);
+            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);
+            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);
+            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
-        int validation_result_int;
 
-        if(0 < count){
+
+        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);
+            *validation_result = static_cast <ace_bool_t>(validation_result_int);
 
             LogDebug("validation_result :");
-            switch (*validation_result){
+            switch (*validation_result) {
             case ACE_FALSE:
                 LogDebug("ACE_FALSE");
                 break;
@@ -264,8 +273,7 @@ ace_return_t run_popup(
                 LogDebug("UNKNOWN - DEFAULT");
                 break;
             }
-        }
-        else {
+        } else {
             LogDebug("count = " << count);
             LogDebug("UNKNOWN_ERROR");
             return ACE_ACE_UNKNOWN_ERROR;
@@ -278,6 +286,5 @@ ace_return_t run_popup(
     LogError("This should not happend!!!");
     return ACE_ACE_UNKNOWN_ERROR;
 }
-
 } // Popup
 } // Wrt
index e3cf0ad..d136fb1 100644 (file)
 
 namespace Wrt {
 namespace Popup {
-
-class BinaryStream : public DPL::IStream {
+class BinaryStream : public DPL::IStream
+{
   public:
-    void Read (size_t num,       void * bytes);
+    void Read (size_t num, void * bytes);
     void Write(size_t num, const void * bytes);
 
     BinaryStream();
@@ -44,13 +44,12 @@ class BinaryStream : public DPL::IStream {
 };
 
 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
-        );
-
+    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
index 481519a..e9dd99f 100644 (file)
@@ -20,7 +20,6 @@
 
 namespace Wrt {
 namespace PopupSerializer {
-
 void appendArg(int arg, DPL::BinaryQueue &buffer)
 {
     size_t argSize = sizeof(arg);
@@ -54,6 +53,5 @@ std::string getStringArg(DPL::BinaryQueue &buffer)
     buffer.FlattenConsume(str.get(), size);
     return std::string(str.get(), str.get() + size);
 }
-
 }
 } // Wrt
index 27094fd..70407ec 100644 (file)
 
 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
 
index 2b9cc37..faa3807 100644 (file)
@@ -29,6 +29,9 @@
 
 namespace Wrt {
 namespace Popup {
+InfoPopup::InfoPopup() :
+        m_parent(NULL)
+{}
 
 void InfoPopup::show(DPL::BinaryQueueAutoPtr data, WrtPopup* parent)
 {
@@ -69,6 +72,5 @@ void InfoPopup::responseCallback(const Renderer::AnswerCallbackData &answer)
     PopupSerializer::appendArg(answer.buttonAnswer, retValue);
     m_parent->response(retValue);
 }
-
 } // Popup
 } // Wrt
index 7c83b59..3a29fc0 100644 (file)
 
 namespace Wrt {
 namespace Popup {
-
 class InfoPopup : public IPopup
 {
-public:
+  public:
+    InfoPopup();
     virtual void show(DPL::BinaryQueueAutoPtr data, WrtPopup* parent);
 
-private:
+  private:
 
     void responseCallback(const Renderer::AnswerCallbackData &answer);
     WrtPopup* m_parent;
 };
-
 } // Popup
 } // Wrt
 
index 4a7e597..ea743a6 100644 (file)
 
 namespace Wrt {
 namespace Popup {
-
 YesNoCheckPopup::~YesNoCheckPopup()
-{
-}
+{}
 
-Renderer::CtrlPopupPtr YesNoCheckPopup::createPopup(DPL::BinaryQueueAutoPtr data)
+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);
+             checkboxLabel);
     Renderer::CtrlPopupPtr popup =
         Renderer::PopupControllerSingleton::Instance().CreatePopup();
 
@@ -38,7 +37,7 @@ Renderer::CtrlPopupPtr YesNoCheckPopup::createPopup(DPL::BinaryQueueAutoPtr data
 }
 
 void YesNoCheckPopup::responseCallback(
-        const Renderer::AnswerCallbackData &answer)
+    const Renderer::AnswerCallbackData &answer)
 {
     bool result = (POPUP_YES_VALUE == answer.buttonAnswer);
     DPL::BinaryQueue retValue;
@@ -47,7 +46,5 @@ void YesNoCheckPopup::responseCallback(
     PopupSerializer::appendArg(answer.chackState, retValue);
     m_parent->response(retValue);
 }
-
-
 } // Popup
 } // Wrt
index 710fc6c..9012df5 100644 (file)
@@ -17,7 +17,8 @@
  * @file        YesNoCheckPopup.cpp
  * @author      Przmeyslaw Ciezkowsko (p.ciezkowski@samsung.com)
  * @version     1.0
- * @brief       Popup that contains 'Yes' and 'No' buttons and checkbox. Inplementation
+ * @brief       Popup that contains 'Yes' and 'No' buttons and checkbox.
+ * Inplementation
  */
 
 #include "YesNoPopup.h"
 
 namespace Wrt {
 namespace Popup {
-
-class YesNoCheckPopup: public YesNoPopup {
-public:
+class YesNoCheckPopup : public YesNoPopup
+{
+  public:
     virtual ~YesNoCheckPopup();
-protected:
+
+  protected:
     virtual Renderer::CtrlPopupPtr createPopup(DPL::BinaryQueueAutoPtr data);
     virtual void responseCallback(const Renderer::AnswerCallbackData &answer);
-
 };
-
 } // Popup
 } // Wrt
 
index 9951954..f2953a8 100644 (file)
@@ -28,7 +28,6 @@
 
 namespace Wrt {
 namespace Popup {
-
 void YesNoPopup::show(DPL::BinaryQueueAutoPtr data, WrtPopup* parent)
 {
     LogDebug("Entered");
@@ -57,8 +56,7 @@ void YesNoPopup::responseCallback(const Renderer::AnswerCallbackData &answer)
 }
 
 YesNoPopup::~YesNoPopup()
-{
-}
+{}
 
 Renderer::CtrlPopupPtr YesNoPopup::createPopup(DPL::BinaryQueueAutoPtr data)
 {
@@ -76,6 +74,5 @@ Renderer::CtrlPopupPtr YesNoPopup::createPopup(DPL::BinaryQueueAutoPtr data)
     popup->Append(new Renderer::PopupObject::Button(NO_LABEL, POPUP_NO_VALUE));
     return popup;
 }
-
 } // Popup
 } // Wrt
index 8b07ba7..5dbe2f8 100644 (file)
@@ -27,7 +27,6 @@
 
 namespace Wrt {
 namespace Popup {
-
 const char YES_LABEL[] = "Yes";
 const char NO_LABEL[] = "No";
 const int POPUP_YES_VALUE = 1;
@@ -35,15 +34,15 @@ const int POPUP_NO_VALUE = 2;
 
 class YesNoPopup : public IPopup
 {
-public:
+  public:
     virtual void show(DPL::BinaryQueueAutoPtr data, WrtPopup* parent);
     virtual ~YesNoPopup();
-protected:
+
+  protected:
     virtual Renderer::CtrlPopupPtr createPopup(DPL::BinaryQueueAutoPtr data);
     virtual void responseCallback(const Renderer::AnswerCallbackData &answer);
     WrtPopup* m_parent;
 };
-
 } // Popup
 } // Wrt
 
index 9510c83..13b38c1 100644 (file)
  * @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.
+ * @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();
@@ -41,12 +40,11 @@ void EvasObject::IConnection::Disconnect()
 
 EvasObject::IConnection::IConnection(EvasObject::EvasObjectShared* object) :
     m_object(object)
-{
-}
+{}
 
 void EvasObject::IConnection::SmartCallbackWrapper(void* data,
-        Evas_Object* /*object*/,
-        void* event_info)
+                                                   Evas_Object* /*object*/,
+                                                   void* event_info)
 {
     Assert(data);
     IConnection* Calle = static_cast<IConnection*>(data);
@@ -54,9 +52,9 @@ void EvasObject::IConnection::SmartCallbackWrapper(void* data,
 }
 
 void EvasObject::IConnection::EvasCallbackWrapper(void* data,
-        Evas* /*evas*/,
-        Evas_Object* /*object*/,
-        void* event_info)
+                                                  Evas* /*evas*/,
+                                                  Evas_Object* /*object*/,
+                                                  void* event_info)
 {
     Assert(data);
     IConnection* Calle = static_cast<IConnection*>(data);
@@ -69,12 +67,11 @@ Evas_Object* EvasObject::EvasObjectShared::GetObject()
 }
 
 EvasObject::EvasObjectShared::SmartConnectionBase::SmartConnectionBase(
-        const std::string& name,
-        EvasObject::EvasObjectShared* object) :
+    const std::string& name,
+    EvasObject::EvasObjectShared* object) :
     IConnection(object),
     m_callbackName(name)
-{
-}
+{}
 
 void EvasObject::EvasObjectShared::SmartConnectionBase::ConnectPrv()
 {
@@ -91,12 +88,11 @@ void EvasObject::EvasObjectShared::SmartConnectionBase::DisconnectPrv()
 }
 
 EvasObject::EvasObjectShared::EvasConnectionBase::EvasConnectionBase(
-        Evas_Callback_Type type,
-        EvasObject::EvasObjectShared* object) :
+    Evas_Callback_Type type,
+    EvasObject::EvasObjectShared* object) :
     IConnection(object),
     m_callbackType(type)
-{
-}
+{}
 
 void EvasObject::EvasObjectShared::EvasConnectionBase::ConnectPrv()
 {
@@ -114,8 +110,7 @@ void EvasObject::EvasObjectShared::EvasConnectionBase::DisconnectPrv()
 
 EvasObject::EvasObjectShared::EvasObjectShared() :
     m_object(NULL)
-{
-}
+{}
 
 EvasObject::EvasObjectShared::EvasObjectShared(Evas_Object* object) :
     m_object(object)
@@ -172,9 +167,9 @@ void EvasObject::EvasObjectShared::DisconnectAll()
 }
 
 void EvasObject::EvasObjectShared::StaticOnDelEvent(void* data,
-        Evas* /*e*/,
-        Evas_Object* /*o*/,
-        void* /*ev*/)
+                                                    Evas* /*e*/,
+                                                    Evas_Object* /*o*/,
+                                                    void* /*ev*/)
 {
     Assert(data);
     EvasObjectShared* This = static_cast<EvasObjectShared*>(data);
@@ -189,23 +184,19 @@ void EvasObject::EvasObjectShared::StaticOnDelEvent(void* data,
 
 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)
 {
@@ -238,7 +229,6 @@ EvasObject::operator Evas_Object *()
     Assert(m_object);
     return m_object->GetObject();
 }
-
 }
 } // namespace DPL
 } // namespace Popup
index b7ccda1..2758fa1 100644 (file)
@@ -38,7 +38,6 @@
 namespace Wrt {
 namespace Popup {
 namespace Renderer {
-
 class EvasObject
 {
     class EvasObjectShared;
@@ -54,17 +53,16 @@ class EvasObject
       private:
         IConnection(EvasObjectShared* object);
         virtual ~IConnection()
-        {
-        }
+        {}
         virtual void Call(void* /*event_info*/) = 0;
 
         static void SmartCallbackWrapper(void* data,
-                Evas_Object* /*object*/,
-                void* event_info);
+                                         Evas_Object* /*object*/,
+                                         void* event_info);
         static void EvasCallbackWrapper(void* data,
-                Evas* /*evas*/,
-                Evas_Object* /*object*/,
-                void* event_info);
+                                        Evas* /*evas*/,
+                                        Evas_Object* /*object*/,
+                                        void* event_info);
 
         virtual void ConnectPrv() = 0;
         virtual void DisconnectPrv() = 0;
@@ -87,7 +85,7 @@ class EvasObject
         {
           public:
             SmartConnectionBase(const std::string& name,
-                    EvasObjectShared* object);
+                                EvasObjectShared* object);
 
             virtual void ConnectPrv();
             virtual void DisconnectPrv();
@@ -103,18 +101,16 @@ class EvasObject
                                    Args ... args);
 
             SmartConnection(const std::string& name,
-                    CbType callback,
-                    EvasObjectShared* object,
-                    Args ... args) :
+                            CbType callback,
+                            EvasObjectShared* object,
+                            Args ... args) :
                 SmartConnectionBase(name, object),
                 m_callback(callback),
                 m_args(args ...)
-            {
-            }
+            {}
 
             virtual ~SmartConnection()
-            {
-            }
+            {}
 
             virtual void Call(void* event_info)
             {
@@ -138,20 +134,18 @@ class EvasObject
                                              void* event_info, ArgType1 *arg1);
 
             SmartMemberConnection1(const std::string& name,
-                    CbType callback,
-                    ThisType* callee,
-                    ArgType1* arg1,
-                    EvasObjectShared* object) :
+                                   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)
             {
@@ -173,22 +167,20 @@ class EvasObject
                                              ArgType2* arg2);
 
             SmartMemberConnection2(const std::string& name,
-                    CbType callback,
-                    ThisType* callee,
-                    ArgType1* arg1,
-                    ArgType2* arg2,
-                    EvasObjectShared* object) :
+                                   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)
             {
@@ -206,7 +198,7 @@ class EvasObject
         {
           public:
             EvasConnectionBase(Evas_Callback_Type type,
-                    EvasObjectShared* object);
+                               EvasObjectShared* object);
 
             virtual void ConnectPrv();
             virtual void DisconnectPrv();
@@ -222,18 +214,16 @@ class EvasObject
                                    ArgType1 *arg1);
 
             EvasConnection1(Evas_Callback_Type type,
-                    CbType callback,
-                    ArgType1* arg1,
-                    EvasObjectShared* object) :
+                            CbType callback,
+                            ArgType1* arg1,
+                            EvasObjectShared* object) :
                 EvasConnectionBase(type, object),
                 m_callback(callback),
                 m_arg1(arg1)
-            {
-            }
+            {}
 
             virtual ~EvasConnection1()
-            {
-            }
+            {}
 
             virtual void Call(void* event_info)
             {
@@ -253,20 +243,18 @@ class EvasObject
                                    ArgType1 *arg1, ArgType2 *arg2);
 
             EvasConnection2(Evas_Callback_Type type,
-                    CbType callback,
-                    ArgType1* arg1,
-                    ArgType2* arg2,
-                    EvasObjectShared* object) :
+                            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)
             {
@@ -287,20 +275,18 @@ class EvasObject
                                              void* event_info, ArgType1 *arg1);
 
             EvasMemberConnection1(Evas_Callback_Type type,
-                    CbType callback,
-                    ThisType* callee,
-                    ArgType1* arg1,
-                    EvasObjectShared* object) :
+                                  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)
             {
@@ -322,22 +308,20 @@ class EvasObject
                                              ArgType2* arg2);
 
             EvasMemberConnection2(Evas_Callback_Type type,
-                    CbType callback,
-                    ThisType* callee,
-                    ArgType1* arg1,
-                    ArgType2* arg2,
-                    EvasObjectShared* object) :
+                                  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)
             {
@@ -357,9 +341,11 @@ class EvasObject
         ~EvasObjectShared();
 
         template<typename ... Args>
-        IConnection* ConnectSmartCallback(const char* callbackName,
-                typename SmartConnection<Args ...>::CbType callback,
-                Args ... args)
+        IConnection* ConnectSmartCallback(
+            const char* callbackName,
+            typename SmartConnection<Args ...>::
+                CbType callback,
+            Args ... args)
         {
             Assert(m_object);
             Assert(callbackName);
@@ -376,12 +362,12 @@ class EvasObject
 
         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)
+            const char* callbackName,
+            typename SmartMemberConnection2<ThisType, ArgType1,
+                                            ArgType2>::CbType callback,
+            ThisType* callee,
+            ArgType1* arg1,
+            ArgType2* arg2)
         {
             Assert(m_object);
             Assert(callee);
@@ -402,11 +388,11 @@ class EvasObject
 
         template <class ThisType, class ArgType1>
         IConnection* ConnectMemberSmartCallback(
-                const char* callbackName,
-                typename SmartMemberConnection1<ThisType,
-                                                ArgType1>::CbType callback,
-                ThisType* callee,
-                ArgType1* arg1)
+            const char* callbackName,
+            typename SmartMemberConnection1<ThisType,
+                                            ArgType1>::CbType callback,
+            ThisType* callee,
+            ArgType1* arg1)
         {
             Assert(m_object);
             Assert(callee);
@@ -425,9 +411,11 @@ class EvasObject
 
         template <class ArgType1, class ArgType2>
         IConnection* ConnectEvasCallback(Evas_Callback_Type callbackType,
-                typename EvasConnection2<ArgType1, ArgType2>::CbType callback,
-                ArgType1* arg1,
-                ArgType2* arg2)
+                                         typename EvasConnection2<ArgType1,
+                                                                  ArgType2>::
+                                             CbType callback,
+                                         ArgType1* arg1,
+                                         ArgType2* arg2)
         {
             Assert(m_object);
             Assert(callbackType);
@@ -444,9 +432,11 @@ class EvasObject
         }
 
         template <class ArgType1>
-        IConnection* ConnectEvasCallback(Evas_Callback_Type callbackType,
-                typename EvasConnection1<ArgType1>::CbType callback,
-                ArgType1* arg1)
+        IConnection* ConnectEvasCallback(
+            Evas_Callback_Type callbackType,
+            typename EvasConnection1<ArgType1>::
+                CbType callback,
+            ArgType1* arg1)
         {
             Assert(m_object);
             Assert(callbackType);
@@ -463,12 +453,12 @@ class EvasObject
 
         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)
+            Evas_Callback_Type callbackType,
+            typename EvasMemberConnection2<ThisType, ArgType1,
+                                           ArgType2>::CbType callback,
+            ThisType* callee,
+            ArgType1* arg1,
+            ArgType2* arg2)
         {
             Assert(m_object);
             Assert(callee);
@@ -489,11 +479,11 @@ class EvasObject
 
         template <class ThisType, class ArgType1>
         IConnection* ConnectMemberEvasCallback(
-                Evas_Callback_Type callbackType,
-                typename EvasMemberConnection1<ThisType,
-                                               ArgType1>::CbType callback,
-                ThisType* callee,
-                ArgType1* arg1)
+            Evas_Callback_Type callbackType,
+            typename EvasMemberConnection1<ThisType,
+                                           ArgType1>::CbType callback,
+            ThisType* callee,
+            ArgType1* arg1)
         {
             Assert(m_object);
             Assert(callee);
@@ -514,9 +504,9 @@ class EvasObject
         void DisconnectAll();
 
         static void StaticOnDelEvent(void* data,
-                Evas* /*e*/,
-                Evas_Object* /*o*/,
-                void* /*ev*/);
+                                     Evas* /*e*/,
+                                     Evas_Object* /*o*/,
+                                     void* /*ev*/);
 
         IConnectionsSet m_connections;
         Evas_Object* m_object;
@@ -544,10 +534,10 @@ class EvasObject
 
     template <class ... Args>
     IConnection* ConnectSmartCallback(
-            const char* callbackName,
-            typename EvasObjectShared::SmartConnection<Args ...>::CbType
-            callback,
-            Args ... args)
+        const char* callbackName,
+        typename EvasObjectShared::SmartConnection<Args ...>::CbType
+        callback,
+        Args ... args)
     {
         Assert(m_object);
         return m_object->ConnectSmartCallback(callbackName, callback, args ...);
@@ -555,14 +545,14 @@ class EvasObject
 
     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)
+        const char* callbackName,
+        typename EvasObjectShared::SmartMemberConnection2<ThisType,
+                                                          ArgType1,
+                                                          ArgType2>::CbType
+        callback,
+        ThisType* callee,
+        ArgType1* arg1,
+        ArgType2* arg2)
     {
         Assert(m_object);
         Assert(callee);
@@ -576,12 +566,12 @@ class EvasObject
 
     template <class ThisType, class ArgType1>
     IConnection* ConnectMemberSmartCallback(
-            const char* callbackName,
-            typename EvasObjectShared::SmartMemberConnection1<ThisType,
-                                                              ArgType1>::CbType
-            callback,
-            ThisType* callee,
-            ArgType1* arg1)
+        const char* callbackName,
+        typename EvasObjectShared::SmartMemberConnection1<ThisType,
+                                                          ArgType1>::CbType
+        callback,
+        ThisType* callee,
+        ArgType1* arg1)
     {
         Assert(m_object);
         Assert(callee);
@@ -594,11 +584,11 @@ class EvasObject
 
     template <class ArgType1, class ArgType2>
     IConnection* ConnectEvasCallback(
-            Evas_Callback_Type callbackType,
-            typename EvasObjectShared::EvasConnection1<ArgType1>::CbType
-            callback,
-            ArgType1* arg1,
-            ArgType2* arg2)
+        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);
@@ -606,10 +596,10 @@ class EvasObject
 
     template <class ArgType1>
     IConnection* ConnectEvasCallback(
-            Evas_Callback_Type callbackType,
-            typename EvasObjectShared::EvasConnection1<ArgType1>::CbType
-            callback,
-            ArgType1* arg1)
+        Evas_Callback_Type callbackType,
+        typename EvasObjectShared::EvasConnection1<ArgType1>::CbType
+        callback,
+        ArgType1* arg1)
     {
         Assert(m_object);
         return m_object->ConnectEvasCallback(callbackType, callback, arg1);
@@ -617,12 +607,12 @@ class EvasObject
 
     template <class ThisType, class ArgType1>
     IConnection* ConnectMemberEvasCallback(
-            Evas_Callback_Type callbackType,
-            typename EvasObjectShared::EvasMemberConnection1<ThisType,
-                                                             ArgType1>::CbType
-            callback,
-            ThisType* callee,
-            ArgType1* arg1)
+        Evas_Callback_Type callbackType,
+        typename EvasObjectShared::EvasMemberConnection1<ThisType,
+                                                         ArgType1>::CbType
+        callback,
+        ThisType* callee,
+        ArgType1* arg1)
     {
         Assert(m_object);
         Assert(callee);
@@ -635,13 +625,13 @@ class EvasObject
 
     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)
+        Evas_Callback_Type callbackType,
+        typename EvasObjectShared::EvasMemberConnection2<ThisType, ArgType1,
+                                                         ArgType2>::CbType
+        callback,
+        ThisType* callee,
+        ArgType1* arg1,
+        ArgType2* arg2)
     {
         Assert(m_object);
         Assert(callee);
@@ -656,11 +646,9 @@ class EvasObject
   private:
     EvasObjectSharedPtr m_object;
 };
-
 }
-}//namespace
-}//namespace
-
+} //namespace
+} //namespace
 
 #endif //WRT_SRC_DOMAIN_EFL_EVAS_OBJECT_H
 
index 3b2e867..149b7eb 100644 (file)
@@ -33,7 +33,6 @@
 namespace Wrt {
 namespace Popup {
 namespace Renderer {
-
 struct AnswerCallbackData
 {
     int buttonAnswer;
@@ -56,16 +55,14 @@ class IPopup : public std::enable_shared_from_this<IPopup>
     typedef void (*PopupCallbackType)(const AnswerCallbackData& answer,
                                       void *data);
     virtual void Show(PopupCallbackType callback,
-            void* data) = 0;
+                      void* data) = 0;
     virtual ~IPopup()
-    {
-    }
+    {}
 
   private:
     friend class PopupManager;
     friend class std::shared_ptr<IPopup>;
 };
-
 }
 } // namespace Popup
 } // namespace Wrt
index eaafaff..b9bb5b3 100644 (file)
@@ -31,7 +31,6 @@ IMPLEMENT_SINGLETON(Wrt::Popup::Renderer::PopupController)
 namespace Wrt {
 namespace Popup {
 namespace Renderer {
-
 void CtrlPopup::SetTitle(const std::string &title)
 {
     Assert(m_popup);
@@ -52,8 +51,7 @@ CtrlPopup::CtrlPopup(IPopupPtr popup) :
 }
 
 CtrlPopup::~CtrlPopup()
-{
-}
+{}
 
 void CtrlPopup::EmitAnswer(const AnswerCallbackData & answer)
 {
@@ -63,8 +61,7 @@ void CtrlPopup::EmitAnswer(const AnswerCallbackData & answer)
 }
 
 PopupController::PopupController() : m_canvas(NULL)
-{
-}
+{}
 
 CtrlPopupPtr PopupController::CreatePopup() const
 {
@@ -88,7 +85,7 @@ void PopupController::OnEventReceived(const ShowPopupEventShort& event)
 }
 
 void PopupController::StaticOnAnswerReceived(const AnswerCallbackData & answer,
-        CtrlPopupPtr* popup)
+                                             CtrlPopupPtr* popup)
 {
     Assert(popup != NULL);
     (*popup)->EmitAnswer(answer);
@@ -101,14 +98,14 @@ void PopupControllerUser::OnEventReceived(const PopupAnswerEvent& event)
     PopupAnswerCallback answerCall = event.GetArg1();
     AnswerCallbackData answer = event.GetArg2();
     answerCall.Call(answer);
-    event.GetArg0()->DPL::Event::EventSupport<PopupAnswerEvent>::RemoveListener(this);
+    event.GetArg0()->DPL::Event::EventSupport<PopupAnswerEvent>::RemoveListener(
+        this);
 }
 
 void PopupControllerUser::ListenForAnswer(CtrlPopupPtr popup)
 {
     popup->DPL::Event::EventSupport<PopupAnswerEvent>::AddListener(this);
 }
-
 }
 } //namespace Popup
 } //namespace Wrt
index eea2d0d..066fd2d 100644 (file)
@@ -23,8 +23,8 @@
 /**
  * To display a popup from a given class:
  *
- **class ABC
- **{
+ * class ABC
+ * {
  *    void AskUser()
  *    {
  *    }
  *    void DoSomeLogicWithAnswer()
  *    {
  *    }
- **};
+ * };
  *
  * ... update the class to something simmilar:
  *
- **class ABC : Popup::PopupControllerUser
- **{
+ * class ABC : Popup::PopupControllerUser
+ * {
  *    void AskUser() {
  *        using namespace Popup;
  *        CtrlPopupPtr popup =
@@ -59,7 +59,7 @@
  *        else if (answer == 2)
  *            ;//name2 pressed
  *    }
- **};
+ * };
  **/
 
 #ifndef WRT_SRC_POPUP_CONTROLLER_POPUP_CONTROLLER_H_
@@ -79,7 +79,6 @@
 namespace Wrt {
 namespace Popup {
 namespace Renderer {
-
 typedef int LabelId;
 
 struct PopupAnswerCallback
@@ -89,7 +88,7 @@ struct PopupAnswerCallback
     void* callee;
     MemberPtr member;
     void (*callTranslator)(PopupAnswerCallback* callData,
-            const AnswerCallbackData& answer);
+                           const AnswerCallbackData& answer);
 
     void Call(const AnswerCallbackData& answer)
     {
@@ -119,6 +118,7 @@ class CtrlPopup : public DPL::Event::EventSupport<PopupAnswerEvent>,
     void Append(PopupObject::IPopupObject *object);
 
     ~CtrlPopup();
+
   private:
     friend class PopupController;
     friend class std::shared_ptr<CtrlPopup>;
@@ -152,7 +152,7 @@ class PopupController :
 
   private:
     static void StaticOnAnswerReceived(const AnswerCallbackData& answer,
-            CtrlPopupPtr* popup);
+                                       CtrlPopupPtr* popup);
 };
 
 class PopupControllerUser : DPL::Event::EventListener<PopupAnswerEvent>
@@ -168,7 +168,7 @@ class PopupControllerUser : DPL::Event::EventListener<PopupAnswerEvent>
         };
 
         static PopupAnswerCallback Create(Type* callee,
-                MemberPtr callback)
+                                          MemberPtr callback)
         {
             PopupAnswerCallback callData;
 
@@ -185,7 +185,7 @@ class PopupControllerUser : DPL::Event::EventListener<PopupAnswerEvent>
         }
 
         static void MemberCallbackTranslator(PopupAnswerCallback* callData,
-                const AnswerCallbackData& answer)
+                                             const AnswerCallbackData& answer)
         {
             Type* typedThis = static_cast<Type*>(callData->callee);
             Caster caster;
@@ -201,15 +201,14 @@ class PopupControllerUser : DPL::Event::EventListener<PopupAnswerEvent>
 
     template <class Type>
     PopupAnswerCallback MakeAnswerCallback(Type* This,
-            void (Type::*callback)
-            (const AnswerCallbackData &))
+                                           void (Type::*callback)
+                                           (const AnswerCallbackData &))
     {
         return PopupAnswerCallbackCreator<Type>::Create(This, callback);
     }
 };
 
 typedef DPL::Singleton<PopupController> PopupControllerSingleton;
-
 }
 } //namespace Popup
 } //namespace Wrt
index e50c530..040f445 100644 (file)
@@ -32,7 +32,6 @@ IMPLEMENT_SINGLETON(Wrt::Popup::Renderer::PopupManager)
 namespace Wrt {
 namespace Popup {
 namespace Renderer {
-
 void PopupManager::Initialize(PopupRendererPtr renderer)
 {
     Assert(!m_initialized);
@@ -54,7 +53,6 @@ IPopupPtr PopupManager::CreatePopup()
     Assert(m_initialized);
     return m_popupRenderer->CreatePopup();
 }
-
 }
 } // namespace Popup
 } // namespace Wrt
index 4b90ace..125ac22 100644 (file)
@@ -35,7 +35,6 @@
 namespace Wrt {
 namespace Popup {
 namespace Renderer {
-
 class PopupManager : DPL::Noncopyable
 {
     template <class ArgType>
@@ -58,9 +57,11 @@ class PopupManager : DPL::Noncopyable
     IPopupPtr CreatePopup();
 
     template <class ArgType>
-    void RunAsyncWithArgType(IPopupPtr popup,
-            typename TemplatedPopupCallback<ArgType>::Type callback,
-            ArgType* argument)
+    void RunAsyncWithArgType(
+        IPopupPtr popup,
+        typename TemplatedPopupCallback<ArgType>::Type
+        callback,
+        ArgType* argument)
     {
         Assert(callback);
         WrapCbAndArg<ArgType>* wrapped =
@@ -69,8 +70,8 @@ class PopupManager : DPL::Noncopyable
     }
 
     void Show(IPopupPtr popup,
-            IPopup::PopupCallbackType callback,
-            void* userdata)
+              IPopup::PopupCallbackType callback,
+              void* userdata)
     {
         popup->Show(callback, userdata);
     }
@@ -86,11 +87,10 @@ class PopupManager : DPL::Noncopyable
     struct WrapCbAndArg
     {
         WrapCbAndArg(typename TemplatedPopupCallback<ArgType>::Type cb,
-                ArgType* arg) :
+                     ArgType* arg) :
             callback(cb),
             argument(arg)
-        {
-        }
+        {}
 
         typename TemplatedPopupCallback<ArgType>::Type callback;
         ArgType* argument;
@@ -98,7 +98,7 @@ class PopupManager : DPL::Noncopyable
 
     template <class ArgType>
     static void CallbackArgTypeTranslator(const AnswerCallbackData & answer,
-            void* data)
+                                          void* data)
     {
         WrapCbAndArg<ArgType>* wrapped =
             static_cast< WrapCbAndArg<ArgType>* >(data);
@@ -111,7 +111,6 @@ class PopupManager : DPL::Noncopyable
 };
 
 typedef DPL::Singleton<PopupManager> PopupManagerSingleton;
-
 }
 } // namespace Popup
 } // namespace Wrt
index 090b874..86f7484 100644 (file)
@@ -31,7 +31,6 @@
 namespace Wrt {
 namespace Popup {
 namespace Renderer {
-
 namespace PopupObject {
 class IPopupObject;
 class PopupObjectBase;
@@ -56,8 +55,7 @@ class IPopupObject
     virtual Check* asCheck() = 0;
     virtual PopupType getType() const = 0;
     virtual ~IPopupObject()
-    {
-    }
+    {}
 };
 
 class PopupObjectBase : public IPopupObject
@@ -86,8 +84,7 @@ class PopupObjectBase : public IPopupObject
 
   protected:
     PopupObjectBase(PopupType type) : m_type(type)
-    {
-    }
+    {}
 
     PopupType m_type;
 };
@@ -96,12 +93,11 @@ class Button : public PopupObjectBase
 {
   public:
     Button(const std::string& label,
-            int labelId) :
+           int labelId) :
         PopupObjectBase(BUTTON),
         m_label(label),
         m_labelId(labelId)
-    {
-    }
+    {}
 
     Button* asButton()
     {
@@ -129,8 +125,7 @@ class Label : public PopupObjectBase
     Label(const std::string &label) :
         PopupObjectBase(LABEL),
         m_label(label)
-    {
-    }
+    {}
 
     Label* asLabel()
     {
@@ -152,8 +147,7 @@ class Check : public PopupObjectBase
     Check(const std::string &label) :
         PopupObjectBase(CHECK),
         m_checkLabel(label)
-    {
-    }
+    {}
 
     Check* asCheck()
     {
@@ -169,9 +163,8 @@ class Check : public PopupObjectBase
     std::string m_checkLabel;
 };
 } /*PopupObject*/
-
 }
-}//namespace Popup
-}//namespace Wrt
+} //namespace Popup
+} //namespace Wrt
 
 #endif //WRT_SRC_POPUP_POPUPOBJECT_H_
index ed00236..2f3a872 100644 (file)
@@ -34,7 +34,6 @@
 #include "evas_object.h"
 
 namespace Wrt {
-
 namespace {
 using namespace Popup;
 const char* EDJ_NAME = "/usr/share/edje/ace/generic_popup.edj";
@@ -68,16 +67,17 @@ Evas_Object* create_layout_main(Evas_Object* parent, int totalV)
 
 namespace Popup {
 namespace Renderer {
-
 class PopupRenderer::Impl
 {
   public:
     Impl() :
         m_popupsToRender(),
         m_current(),
-        m_initialized(false)
-    {
-    }
+        m_initialized(false),
+        m_checkState(false),
+        m_themeIndexV(0),
+        m_externalCanvas(NULL)
+    {}
 
     ~Impl()
     {
@@ -103,8 +103,8 @@ class PopupRenderer::Impl
     }
 
     void ButtonCallback(EvasObject::IConnection* /*connection*/,
-            void* /*event_info*/,
-            void* data)
+                        void* /*event_info*/,
+                        void* data)
     {
         LogInfo("ButtonCallback");
         Assert(m_initialized);
@@ -128,8 +128,8 @@ class PopupRenderer::Impl
     }
 
     void CheckCallback(EvasObject::IConnection* connection,
-            void* /*event_info*/,
-            void* /* unused */)
+                       void* /*event_info*/,
+                       void* /* unused */)
     {
         m_checkState =
             elm_check_state_get(connection->GetEvasObject());
@@ -143,9 +143,9 @@ class PopupRenderer::Impl
     }
 
     void DoRender(const PopupObject::Label& object,
-            EvasObject& parent,
-            EvasObject& layout,
-            int themeIndex)
+                  EvasObject& parent,
+                  EvasObject& layout,
+                  int themeIndex)
     {
         EvasObject label(elm_label_add(parent));
 
@@ -164,9 +164,9 @@ class PopupRenderer::Impl
     }
 
     void DoRender(const PopupObject::Check& object,
-            EvasObject& parent,
-            EvasObject& layout,
-            int themeIndex)
+                  EvasObject& parent,
+                  EvasObject& layout,
+                  int themeIndex)
     {
         EvasObject check(elm_check_add(parent));
 
@@ -188,7 +188,7 @@ class PopupRenderer::Impl
     }
 
     void DoRender(const PopupObject::Button& object,
-            EvasObject &parent)
+                  EvasObject &parent)
     {
         EvasObject btn(elm_button_add(parent));
 
@@ -197,13 +197,14 @@ class PopupRenderer::Impl
         btn.ConnectMemberSmartCallback(BUTTON_CLICKED_CALLBACK_NAME,
                                        &Impl::ButtonCallback,
                                        this,
-                                       reinterpret_cast<void*>(object.getLabelId()));
+                                       reinterpret_cast<void*>(object.
+                                                                   getLabelId()));
         m_createdObjects.push_back(btn);
     }
 
     void DoRender(const PopupObject::Button& object1,
-            const PopupObject::Button& object2,
-            EvasObject &parent)
+                  const PopupObject::Button& object2,
+                  EvasObject &parent)
     {
         DoRender(object1, parent);
 
@@ -214,14 +215,15 @@ class PopupRenderer::Impl
         btn2.ConnectMemberSmartCallback(BUTTON_CLICKED_CALLBACK_NAME,
                                         &Impl::ButtonCallback,
                                         this,
-                                        reinterpret_cast<void*>(object2.getLabelId()));
+                                        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)
+                  const PopupObject::Button& object2,
+                  const PopupObject::Button& object3,
+                  EvasObject &parent)
     {
         DoRender(object1, object2, parent);
 
@@ -232,7 +234,8 @@ class PopupRenderer::Impl
         btn3.ConnectMemberSmartCallback(BUTTON_CLICKED_CALLBACK_NAME,
                                         &Impl::ButtonCallback,
                                         this,
-                                        reinterpret_cast<void*>(object3.getLabelId()));
+                                        reinterpret_cast<void*>(object3.
+                                                                    getLabelId()));
         m_createdObjects.push_back(btn3);
     }
 
@@ -274,12 +277,12 @@ class PopupRenderer::Impl
             m_themeIndexV = 0;
 
             // preprocessing
-            std::vector<int> countPopupObjects = {0 /* PopupObject::BUTTON */,
-                                                  0 /* PopupObject::LABEL */,
-                                                  0 /* PopupObject::CHECK */};
+            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");
+                       "Wrong PopupObject assigned");
                 countPopupObjects[(*it)->getType()]++;
             }
             int needsIndexV = countPopupObjects[PopupObject::LABEL] +
@@ -326,7 +329,7 @@ class PopupRenderer::Impl
                                    layout);
 
             // show buution
-            switch(buttonObjectList.size()) {
+            switch (buttonObjectList.size()) {
             case 0:
                 LogInfo("no button");
                 break;
@@ -401,7 +404,7 @@ void PopupRenderer::Deinitialize()
 IPopupPtr PopupRenderer::CreatePopup()
 {
     return std::static_pointer_cast<IPopup>(IPopupPtr
-                                              (new Popup(shared_from_this())));
+                                                (new Popup(shared_from_this())));
 }
 
 void PopupRenderer::Render(PopupPtr popup)
@@ -413,7 +416,6 @@ void PopupRenderer::setExternalCanvas(void* externalCanvas)
 {
     m_impl->setExternalCanvas(externalCanvas);
 }
-
 }
 } // namespace Popup
 } // namespace Wrt
index 0a34547..3538bbb 100644 (file)
@@ -36,7 +36,6 @@
 namespace Wrt {
 namespace Popup {
 namespace Renderer {
-
 class PopupRenderer : public std::enable_shared_from_this<PopupRenderer>
 {
   public:
@@ -46,6 +45,7 @@ class PopupRenderer : public std::enable_shared_from_this<PopupRenderer>
     void Deinitialize();
     IPopupPtr CreatePopup();
     virtual void setExternalCanvas(void* externalCanvas);
+
   protected:
     class Popup;
     typedef std::shared_ptr<Popup> PopupPtr;
@@ -67,7 +67,7 @@ class PopupRenderer : public std::enable_shared_from_this<PopupRenderer>
         }
 
         virtual void Show(IPopup::PopupCallbackType callback,
-                void* data)
+                          void* data)
         {
             Assert(callback);
             m_data = data;
@@ -98,8 +98,7 @@ class PopupRenderer : public std::enable_shared_from_this<PopupRenderer>
         friend class PopupObjectTheme;
 
         Popup(std::shared_ptr<PopupRenderer> renderer) : m_renderer(renderer)
-        {
-        }
+        {}
 
         void ForwardAnswer(const AnswerCallbackData & answer) const
         {
@@ -121,7 +120,6 @@ class PopupRenderer : public std::enable_shared_from_this<PopupRenderer>
 };
 
 typedef std::shared_ptr<PopupRenderer> PopupRendererPtr;
-
 }
 } // namespace Popup
 } // namespace Wrt
index 3023302..c1dd04a 100644 (file)
@@ -30,7 +30,6 @@
 
 namespace Wrt {
 namespace Popup {
-
 bool WrtPopup::openPipes()
 {
     Try
@@ -61,8 +60,7 @@ void WrtPopup::closePipes()
 {
     Try
     {
-        if (m_pipesOpened)
-        {
+        if (m_pipesOpened) {
             DPL::WaitableHandleWatchSupport::InheritedContext()->
                 RemoveWaitableHandleWatch(this,
                                           m_input.WaitableReadHandle(),
@@ -78,7 +76,7 @@ void WrtPopup::closePipes()
     }
 }
 
-void WrtPopup::OnEventReceived(const QuitEvent &/* event */)
+void WrtPopup::OnEventReceived(const QuitEvent & /* event */)
 {
     LogDebug("Quiting");
     closePipes();
@@ -88,8 +86,7 @@ void WrtPopup::OnEventReceived(const QuitEvent &/* event */)
 void WrtPopup::OnWaitableHandleEvent(DPL::WaitableHandle waitableHandle,
                                      DPL::WaitMode::Type /*mode*/)
 {
-    if (waitableHandle == m_input.WaitableReadHandle())
-    {
+    if (waitableHandle == m_input.WaitableReadHandle()) {
         readInputData();
     }
 }
@@ -100,7 +97,7 @@ void WrtPopup::readInputData()
         m_input.Read(std::numeric_limits<std::size_t>::max());
     int popupType = PopupSerializer::getIntArg(*data);
     LogDebug("popup type " << popupType);
-    switch(popupType) {
+    switch (popupType) {
     case YES_NO_PROMPT:
         m_popup.reset(new YesNoPopup());
         m_popup->show(data, this);
@@ -131,8 +128,7 @@ void WrtPopup::OnStop()
 
 void WrtPopup::OnCreate()
 {
-    if (!openPipes())
-    {
+    if (!openPipes()) {
         PostEvent(QuitEvent());
     }
     LogInfo("On Create");
@@ -174,7 +170,6 @@ WrtPopup::~WrtPopup()
     Renderer::PopupManagerSingleton::Instance().Deinitialize();
     LogDebug("App Finished");
 }
-
 }
 }
 
index 47ddaa1..ab9c519 100644 (file)
 
 namespace Wrt {
 namespace Popup {
-
 DECLARE_GENERIC_EVENT_0(QuitEvent)
 class WrtPopup;
 
 class IPopup : public Renderer::PopupControllerUser
 {
-public:
+  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:
+  public:
     WrtPopup(int argc, char **argv);
     virtual ~WrtPopup();
 
     void response(DPL::BinaryQueue result);
 
-protected:
+  protected:
     //DPL::Application functions
     virtual void OnStop();
     virtual void OnCreate();
@@ -66,7 +64,8 @@ protected:
     virtual void OnEventReceived(const QuitEvent &event);
     virtual void OnWaitableHandleEvent(DPL::WaitableHandle waitableHandle,
                                        DPL::WaitMode::Type mode);
-private:
+
+  private:
 
     void showAcePrompt(DPL::BinaryQueueAutoPtr data);
     void communicationBoxResponse(int buttonAnswer,
@@ -82,7 +81,6 @@ private:
     DPL::NamedInputPipe m_input;
     DPL::NamedOutputPipe m_output;
 };
-
 }
 }
 
index 9b50a88..10997dc 100644 (file)
@@ -33,10 +33,9 @@ const char *POPUP_EXEC = "/usr/bin/wrt-popup-wrt-runtime";
 
 namespace Wrt {
 namespace Popup {
-
 PopupInvoker::PopupInvoker() :
-    m_inputName(tmpnam(NULL)),
-    m_outputName(tmpnam(NULL))
+    m_inputName(tmpnam_r(NULL)),
+    m_outputName(tmpnam_r(NULL))
 {
     Try
     {
@@ -44,7 +43,7 @@ PopupInvoker::PopupInvoker() :
         m_output.Create(m_outputName);
         LogDebug("Pipes created");
     }
-    Catch (DPL::Exception)
+    Catch(DPL::Exception)
     {
         LogError("Cannot create pipes");
     }
@@ -58,13 +57,14 @@ PopupInvoker::~PopupInvoker()
         m_output.Destroy(m_outputName);
         LogDebug("Pipes destroyed");
     }
-    Catch (DPL::Exception)
+    Catch(DPL::Exception)
     {
         LogError("Cannot destroy pipes");
     }
 }
 
-bool PopupInvoker::askYesNo(const std::string& title, const std::string& message)
+bool PopupInvoker::askYesNo(const std::string& title,
+                            const std::string& message)
 {
     Try
     {
@@ -135,7 +135,8 @@ void PopupInvoker::showInfo(const std::string& title,
 }
 
 PopupResponse PopupInvoker::askYesNoCheckbox(const std::string& title,
-    const std::string& message, const std::string& checkboxLabel)
+                                             const std::string& message,
+                                             const std::string& checkboxLabel)
 {
     Try
     {
@@ -158,7 +159,8 @@ PopupResponse PopupInvoker::askYesNoCheckbox(const std::string& title,
         const int result = PopupSerializer::getIntArg(*resultData);
         const int rememberResult = PopupSerializer::getIntArg(*resultData);
 
-        LogDebug("Popup result is: " << result << " remeber: " << rememberResult);
+        LogDebug(
+            "Popup result is: " << result << " remeber: " << rememberResult);
 
         Assert(resultData->Empty());
         tmp.Close();
@@ -189,14 +191,12 @@ PopupResponse PopupInvoker::askYesNoCheckbox(const std::string& title,
 void PopupInvoker::executePopup()
 {
     pid_t pid = fork();
-    if (pid == -1)
-    {
+    if (pid == -1) {
         //error occured
         LogError("Cannot display popup!");
         Assert(false);
     }
-    if (pid == 0)
-    {
+    if (pid == 0) {
         //child process
         int ret = execl(POPUP_EXEC,
                         POPUP_EXEC,
@@ -213,6 +213,5 @@ void PopupInvoker::executePopup()
     DPL::WaitableHandle handle = m_input.WaitableReadHandle();
     DPL::WaitForSingleHandle(handle);
 }
-
 } // Popup
 } // Wrt
index 112028f..157640a 100644 (file)
 #include <dpl/named_output_pipe.h>
 
 /*
-
- Example usage:
-
- bool result = PopupInvoker().askYesNo("title", "message");
-
+ *
Example usage:
+ *
bool result = PopupInvoker().askYesNo("title", "message");
+ *
  */
 
 namespace Wrt {
 namespace Popup {
-
 enum PopupResponse {
     NO_DO_REMEMBER,
     NO_DONT_REMEMBER,
@@ -42,7 +41,7 @@ enum PopupResponse {
 
 class PopupInvoker
 {
-public:
+  public:
     class Exception
     {
       public:
@@ -58,9 +57,10 @@ public:
                   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);
+                                   const std::string& message,
+                                   const std::string& checkboxLabel);
 
-private:
+  private:
 
     void executePopup();
 
@@ -69,7 +69,6 @@ private:
     const std::string m_inputName;
     const std::string m_outputName;
 };
-
 } // Popup
 } // Wrt
 
index c088821..e970f44 100644 (file)
@@ -18,7 +18,7 @@
 # @brief
 #
 
-SET(TARGET_WIDGETDB_TEST "plugins-tests-widgetdb")
+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)
index 0474752..ddea164 100644 (file)
@@ -30,14 +30,17 @@ int main (int argc, char *argv[])
 {
     int ret = system("/usr/bin/widgetdb_tests_prepare_db.sh start");
 
-    if (!WIFEXITED(ret)) {      //unexpected termiate
+    if (!WIFEXITED(ret)) {      //unexpected terminate
         LogDebug("Fail while preparing database. Restoring");
-        system("/usr/bin/widgetdb_tests_prepare_db.sh stop");
+        ret = system("/usr/bin/widgetdb_tests_prepare_db.sh stop");
+        if (ret != 0)
+            LogError("Finalization script has return error: " << ret);
+
         return -1;
     } else if (WEXITSTATUS(ret)) { //wrong script command, nothing done
-            LogError("Preparation script has return error: " << ret
-                     << ". Quitting");
-            return -1;
+        LogError("Preparation script has return error: " << ret
+                                                         << ". Quitting");
+        return -1;
     }
 
     LogInfo("Starting tests");
@@ -49,6 +52,11 @@ int main (int argc, char *argv[])
 
     WrtDB::WrtDatabase::detachFromThread();
 
-    system("/usr/bin/widgetdb_tests_prepare_db.sh stop");
+    ret = system("/usr/bin/widgetdb_tests_prepare_db.sh stop");
+    if (ret != 0) {
+        LogError("Finalization script has return error: " << ret);
+        return -1;
+    }
+
     return status;
 }
index 1e87fde..ea6ca11 100644 (file)
@@ -35,470 +35,420 @@ using namespace WrtDeviceApis::WidgetDB::Api;
         std::string temp(in);                                                  \
         RUNNER_ASSERT_MSG(temp == (test), "Equals: [" << temp << "]");         \
     }                                                                          \
-    while(0)
+    while (0)
 
 RUNNER_TEST_GROUP_INIT(WidgetDB)
 
 /*
-Name: widgetDB_test_get_language1
-Description: check default widget language
-Expected: default should be "en"
-*/
+ * Name: widgetDB_test_get_language1
+ * Description: check default widget language
+ * Expected: default should be "en"
+ */
 RUNNER_TEST(widgetDB_test_get_language1)
 {
-    try
-    {
+    try {
         IWidgetDBPtr widget = getWidgetDB(2000);
         std::string lang = widget->getLanguage();
 
         LogDebug("language is: " << lang);
         RUNNER_ASSERT_WHAT_EQUALS(lang, "en");
-
-    }
-    catch(const WrtDeviceApis::Commons::SecurityException &e)
-    {
+    } catch (const WrtDeviceApis::Commons::SecurityException &e) {
         LogError("Exception thrown." << e.DumpToString());
         RUNNER_ASSERT(false);
     }
 }
 
 /*
-Name: widgetDB_test_get_language2
-Description: check language returned by WidgetDB if widget does nto exists
-Expected: result should be ""
-*/
+ * Name: widgetDB_test_get_language2
+ * Description: check language returned by WidgetDB if widget does nto exists
+ * Expected: result should be ""
+ */
 RUNNER_TEST(widgetDB_test_get_language2)
 {
-    try
-    {
+    try {
         IWidgetDBPtr widget = getWidgetDB(1000); //widget not exist
         std::string lang = widget->getLanguage();
 
         LogDebug("language is: " << lang);
         RUNNER_ASSERT_WHAT_EQUALS(lang, "");
-
-    }
-    catch(const WrtDeviceApis::Commons::SecurityException &e)
-    {
+    } catch (const WrtDeviceApis::Commons::SecurityException &e) {
         LogError("Exception thrown." << e.DumpToString());
         RUNNER_ASSERT(false);
     }
 }
 
 /*
-Name: widgetDB_test_get_config_value_id
-Description: check GUID returned by WidgetDB
-Expected: GUID should match this, which was inserted into widget database
-*/
+ * Name: widgetDB_test_get_config_value_id
+ * Description: check GUID returned by WidgetDB
+ * Expected: GUID should match this, which was inserted into widget database
+ */
 RUNNER_TEST(widgetDB_test_get_config_value_id)
 {
-    try
-    {
+    try {
         IWidgetDBPtr widget = getWidgetDB(2000);
         std::string tmp = widget->getConfigValue(ConfigAttribute::ID);
 
         LogDebug("id is: " << tmp);
         RUNNER_ASSERT_WHAT_EQUALS(tmp, "w_id_2000");
-    }
-    catch(const WrtDeviceApis::Commons::SecurityException &e)
-    {
+    } catch (const WrtDeviceApis::Commons::SecurityException &e) {
         LogError("Exception thrown." << e.DumpToString());
         RUNNER_ASSERT(false);
     }
 }
 
 /*
-Name: widgetDB_test_get_config_value_version
-Description: check version returned by WidgetDB
-Expected: version should match this, which was inserted into widget database
-*/
+ * Name: widgetDB_test_get_config_value_version
+ * Description: check version returned by WidgetDB
+ * Expected: version should match this, which was inserted into widget database
+ */
 RUNNER_TEST(widgetDB_test_get_config_value_version)
 {
-    try
-    {
+    try {
         IWidgetDBPtr widget = getWidgetDB(2000);
         std::string tmp = widget->getConfigValue(ConfigAttribute::VERSION);
 
         LogDebug("version is: " << tmp);
         RUNNER_ASSERT_WHAT_EQUALS(tmp, "1.0.0");
-    }
-    catch(const WrtDeviceApis::Commons::SecurityException &e)
-    {
+    } catch (const WrtDeviceApis::Commons::SecurityException &e) {
         LogError("Exception thrown." << e.DumpToString());
         RUNNER_ASSERT(false);
     }
 }
 
 /*
-Name: widgetDB_test_get_config_value_description
-Description: check description returned by WidgetDB
-Expected: description should match this, which was inserted into widget database
-*/
+ * Name: widgetDB_test_get_config_value_description
+ * Description: check description returned by WidgetDB
+ * Expected: description should match this, which was inserted into widget
+ * database
+ */
 RUNNER_TEST(widgetDB_test_get_config_value_description)
 {
-    try
-    {
+    try {
         IWidgetDBPtr widget = getWidgetDB(2000);
         std::string tmp = widget->getConfigValue(ConfigAttribute::DESCRIPTION);
 
         LogDebug("description is: " << tmp);
         RUNNER_ASSERT_WHAT_EQUALS(tmp, "w_desc_2000_en");
-    }
-    catch(const WrtDeviceApis::Commons::SecurityException &e)
-    {
+    } catch (const WrtDeviceApis::Commons::SecurityException &e) {
         LogError("Exception thrown." << e.DumpToString());
         RUNNER_ASSERT(false);
     }
 }
 
 /*
-Name: widgetDB_test_get_config_value_license
-Description: check license returned by WidgetDB
-Expected: license should match this, which was inserted into widget database
-*/
+ * Name: widgetDB_test_get_config_value_license
+ * Description: check license returned by WidgetDB
+ * Expected: license should match this, which was inserted into widget database
+ */
 RUNNER_TEST(widgetDB_test_get_config_value_license)
 {
-    try
-    {
+    try {
         IWidgetDBPtr widget = getWidgetDB(2000);
         std::string tmp = widget->getConfigValue(ConfigAttribute::LICENSE);
 
         LogDebug("licence is: " << tmp);
         RUNNER_ASSERT_WHAT_EQUALS(tmp, "w_lic_2000_en");
-    }
-    catch(const WrtDeviceApis::Commons::SecurityException &e)
-    {
+    } catch (const WrtDeviceApis::Commons::SecurityException &e) {
         LogError("Exception thrown." << e.DumpToString());
         RUNNER_ASSERT(false);
     }
 }
 
 /*
-Name: widgetDB_test_get_config_value_license_href
-Description: check license href returned by WidgetDB
-Expected: license href should match this, which was inserted into widget database
-*/
+ * Name: widgetDB_test_get_config_value_license_href
+ * Description: check license href returned by WidgetDB
+ * Expected: license href should match this, which was inserted into widget
+ * database
+ */
 RUNNER_TEST(widgetDB_test_get_config_value_license_href)
 {
-    try
-    {
+    try {
         IWidgetDBPtr widget = getWidgetDB(2000);
         std::string tmp = widget->getConfigValue(ConfigAttribute::LICENSE_HREF);
 
         LogDebug("license href is: " << tmp);
         RUNNER_ASSERT_WHAT_EQUALS(tmp, "w_lic_href_2000_en");
-    }
-    catch(const WrtDeviceApis::Commons::SecurityException &e)
-    {
+    } catch (const WrtDeviceApis::Commons::SecurityException &e) {
         LogError("Exception thrown." << e.DumpToString());
         RUNNER_ASSERT(false);
     }
 }
 
 /*
-Name: widgetDB_test_get_config_value_author_name
-Description: check author name href returned by WidgetDB
-Expected: author name should match this, which was inserted into widget database
-*/
+ * Name: widgetDB_test_get_config_value_author_name
+ * Description: check author name href returned by WidgetDB
+ * Expected: author name should match this, which was inserted into widget
+ * database
+ */
 RUNNER_TEST(widgetDB_test_get_config_value_author_name)
 {
-    try
-    {
+    try {
         IWidgetDBPtr widget = getWidgetDB(2000);
         std::string tmp = widget->getConfigValue(ConfigAttribute::AUTHOR_NAME);
 
         LogDebug("author name is: " << tmp);
         RUNNER_ASSERT_WHAT_EQUALS(tmp, "a_name_2000");
-    }
-    catch(const WrtDeviceApis::Commons::SecurityException &e)
-    {
+    } catch (const WrtDeviceApis::Commons::SecurityException &e) {
         LogError("Exception thrown." << e.DumpToString());
         RUNNER_ASSERT(false);
     }
 }
 
 /*
-Name: widgetDB_test_get_config_value_author_href
-Description: check author href returned by WidgetDB
-Expected: author href should match this, which was inserted into widget database
-*/
+ * Name: widgetDB_test_get_config_value_author_href
+ * Description: check author href returned by WidgetDB
+ * Expected: author href should match this, which was inserted into widget
+ * database
+ */
 RUNNER_TEST(widgetDB_test_get_config_value_author_href)
 {
-    try
-    {
+    try {
         IWidgetDBPtr widget = getWidgetDB(2000);
         std::string tmp = widget->getConfigValue(ConfigAttribute::AUTHOR_HREF);
 
         LogDebug("author href is: " << tmp);
         RUNNER_ASSERT_WHAT_EQUALS(tmp, "a_href_2000");
-    }
-    catch(const WrtDeviceApis::Commons::SecurityException &e)
-    {
+    } catch (const WrtDeviceApis::Commons::SecurityException &e) {
         LogError("Exception thrown." << e.DumpToString());
         RUNNER_ASSERT(false);
     }
 }
 
 /*
-Name: widgetDB_test_get_config_value_author_email
-Description: check author email returned by WidgetDB
-Expected: author email should match this, which was inserted into widget database
-*/
+ * Name: widgetDB_test_get_config_value_author_email
+ * Description: check author email returned by WidgetDB
+ * Expected: author email should match this, which was inserted into widget
+ * database
+ */
 RUNNER_TEST(widgetDB_test_get_config_value_author_email)
 {
-    try
-    {
+    try {
         IWidgetDBPtr widget = getWidgetDB(2000);
         std::string tmp = widget->getConfigValue(ConfigAttribute::AUTHOR_EMAIL);
 
         LogDebug("author email is: " << tmp);
         RUNNER_ASSERT_WHAT_EQUALS(tmp, "a_email_2000");
-    }
-    catch(const WrtDeviceApis::Commons::SecurityException &e)
-    {
+    } catch (const WrtDeviceApis::Commons::SecurityException &e) {
         LogError("Exception thrown." << e.DumpToString());
         RUNNER_ASSERT(false);
     }
 }
 
 /*
-Name: widgetDB_test_get_config_value_name
-Description: check localized widget name returned by WidgetDB
-Expected: localized widget name should match this, which was inserted into widget database
-*/
+ * Name: widgetDB_test_get_config_value_name
+ * Description: check localized widget name returned by WidgetDB
+ * Expected: localized widget name should match this, which was inserted into
+ * widget database
+ */
 RUNNER_TEST(widgetDB_test_get_config_value_name)
 {
-    try
-    {
+    try {
         IWidgetDBPtr widget = getWidgetDB(2000);
         std::string tmp = widget->getConfigValue(ConfigAttribute::NAME);
 
         LogDebug("name is: " << tmp);
         RUNNER_ASSERT_WHAT_EQUALS(tmp, "w_name_2000_en");
-    }
-    catch(const WrtDeviceApis::Commons::SecurityException &e)
-    {
+    } catch (const WrtDeviceApis::Commons::SecurityException &e) {
         LogError("Exception thrown." << e.DumpToString());
         RUNNER_ASSERT(false);
     }
 }
 
 /*
-Name: widgetDB_test_get_config_value_short_name
-Description: check localized widget short name returned by WidgetDB
-Expected: localized widget short name should match this, which was inserted into widget database
-*/
+ * Name: widgetDB_test_get_config_value_short_name
+ * Description: check localized widget short name returned by WidgetDB
+ * Expected: localized widget short name should match this, which was inserted
+ * into widget database
+ */
 RUNNER_TEST(widgetDB_test_get_config_value_short_name)
 {
-    try
-    {
+    try {
         IWidgetDBPtr widget = getWidgetDB(2000);
         std::string tmp = widget->getConfigValue(ConfigAttribute::SHORT_NAME);
 
         LogDebug("short name is: " << tmp);
         RUNNER_ASSERT_WHAT_EQUALS(tmp, "w_shortname_2000_en");
-    }
-    catch(const WrtDeviceApis::Commons::SecurityException &e)
-    {
+    } catch (const WrtDeviceApis::Commons::SecurityException &e) {
         LogError("Exception thrown." << e.DumpToString());
         RUNNER_ASSERT(false);
     }
 }
 
 /*
-Name: widgetDB_test_get_config_value_access_network
-Description: check network access returned by WidgetDB
-Expected: network access should be set to "yes"
-*/
+ * Name: widgetDB_test_get_config_value_access_network
+ * Description: check network access returned by WidgetDB
+ * Expected: network access should be set to "yes"
+ */
 RUNNER_TEST(widgetDB_test_get_config_value_access_network)
 {
-    try
-    {
+    try {
         IWidgetDBPtr widget = getWidgetDB(2000);
         std::string tmp = widget->getConfigValue(
-            ConfigAttribute::ACCESS_NETWORK);
+                ConfigAttribute::ACCESS_NETWORK);
 
         LogDebug("acces network is always true: " << tmp);
         RUNNER_ASSERT_WHAT_EQUALS(tmp, "yes");
-    }
-    catch(const WrtDeviceApis::Commons::SecurityException &e)
-    {
+    } catch (const WrtDeviceApis::Commons::SecurityException &e) {
         LogError("Exception thrown." << e.DumpToString());
         RUNNER_ASSERT(false);
     }
 }
 
 /*
-Name: widgetDB_test_get_config_value_width
-Description: check widget prefered width returned by WidgetDB
-Expected: widget prefered width should match this, which was inserted into widget database
-*/
+ * Name: widgetDB_test_get_config_value_width
+ * Description: check widget prefered width returned by WidgetDB
+ * Expected: widget prefered width should match this, which was inserted into
+ * widget database
+ */
 RUNNER_TEST(widgetDB_test_get_config_value_width)
 {
-    try
-    {
+    try {
         IWidgetDBPtr widget = getWidgetDB(2000);
         std::string tmp = widget->getConfigValue(ConfigAttribute::WIDTH);
 
         LogDebug("width is: " << tmp);
         RUNNER_ASSERT_WHAT_EQUALS(tmp, "100");
-    }
-    catch(const WrtDeviceApis::Commons::SecurityException &e)
-    {
+    } catch (const WrtDeviceApis::Commons::SecurityException &e) {
         LogError("Exception thrown." << e.DumpToString());
         RUNNER_ASSERT(false);
     }
 }
 
 /*
-Name: widgetDB_test_get_config_value_height
-Description: check widget prefered height returned by WidgetDB
-Expected: widget prefered height should match this, which was inserted into widget database
-*/
+ * Name: widgetDB_test_get_config_value_height
+ * Description: check widget prefered height returned by WidgetDB
+ * Expected: widget prefered height should match this, which was inserted into
+ * widget database
+ */
 RUNNER_TEST(widgetDB_test_get_config_value_height)
 {
-    try
-    {
+    try {
         IWidgetDBPtr widget = getWidgetDB(2000);
         std::string tmp = widget->getConfigValue(ConfigAttribute::HEIGHT);
 
         LogDebug("height is: " << tmp);
         RUNNER_ASSERT_WHAT_EQUALS(tmp, "200");
-    }
-    catch(const WrtDeviceApis::Commons::SecurityException &e)
-    {
+    } catch (const WrtDeviceApis::Commons::SecurityException &e) {
         LogError("Exception thrown." << e.DumpToString());
         RUNNER_ASSERT(false);
     }
 }
 
 /*
-Name: widgetDB_test_get_config_value_paths
-Description: check widget installation path returned by WidgetDB
-Expected: widget installation path should match this, which was inserted into widget database
-*/
+ * Name: widgetDB_test_get_config_value_paths
+ * Description: check widget installation path returned by WidgetDB
+ * Expected: widget installation path should match this, which was inserted into
+ * widget database
+ */
 RUNNER_TEST(widgetDB_test_get_config_value_paths)
 {
-    try
-    {
+    try {
         IWidgetDBPtr widget = getWidgetDB(2000);
         std::string tmp = widget->getConfigValue(ConfigAttribute::INSTALL_PATH);
 
         LogDebug("install path is: " << tmp);
 
         tmp = widget->getConfigValue(
-            ConfigAttribute::PUBLIC_STORAGE_PATH);
+                ConfigAttribute::PUBLIC_STORAGE_PATH);
 
         LogDebug("public storage path is: " << tmp);
-
-    }
-    catch(const WrtDeviceApis::Commons::SecurityException &e)
-    {
+    } catch (const WrtDeviceApis::Commons::SecurityException &e) {
         LogDebug("Exception thrown." << e.DumpToString());
         RUNNER_ASSERT(false);
     }
 }
 
 /*
-Name: widgetDB_test_get_config_value_empty
-Description: check if requesting GUID from WidgetDB throw excpetion if widget does not exists
-Expected: accessing GUID should throw WrtDeviceApis::Commons::SecurityException
-*/
+ * Name: widgetDB_test_get_config_value_empty
+ * Description: check if requesting GUID from WidgetDB throw excpetion if widget
+ * does not exists
+ * Expected: accessing GUID should throw
+ * WrtDeviceApis::Commons::SecurityException
+ */
 RUNNER_TEST(widgetDB_test_get_config_value_empty)
 {
-    try
-    {
+    try {
         IWidgetDBPtr widget = getWidgetDB(2005);
-        std::string tmp = widget->getConfigValue(ConfigAttribute::ID);
+        widget->getConfigValue(ConfigAttribute::ID);
 
         //exception should be thrown
         RUNNER_ASSERT(false);
-
-    }
-    catch(const WrtDeviceApis::Commons::SecurityException &e)
-    {
+    } catch (const WrtDeviceApis::Commons::SecurityException &e) {
         LogDebug("OK. Exception thrown." << e.DumpToString());
     }
 }
 
 /*
-Name: widgetDB_test_check_installation_status_installed
-Description: check if widget is installed by WidgetDB
-Expected: plugin should be notified that widget is installed
-*/
+ * Name: widgetDB_test_check_installation_status_installed
+ * Description: check if widget is installed by WidgetDB
+ * Expected: plugin should be notified that widget is installed
+ */
 RUNNER_TEST(widgetDB_test_check_installation_status_installed)
 {
-    try
-    {
+    try {
         IWidgetDBPtr widget = getWidgetDB(2000);
         InstallationStatus tmp = widget->checkInstallationStatus(
-            "w_id_2000", "w_name_2000_en", "2.0.0");
+                "w_id_2000", "w_name_2000_en", "2.0.0");
 
         RUNNER_ASSERT(tmp == InstallationStatus::STATUS_INSTALLED);
-    }
-    catch(const WrtDeviceApis::Commons::SecurityException &e)
-    {
+    } catch (const WrtDeviceApis::Commons::SecurityException &e) {
         LogError("Exception thrown." << e.DumpToString());
         RUNNER_ASSERT(false);
     }
 }
 
 /*
-Name: widgetDB_test_check_installation_status_uninstalled
-Description: check if widget is not installed by WidgetDB
-Expected: plugin should be notified that widget is not installed
-*/
+ * Name: widgetDB_test_check_installation_status_uninstalled
+ * Description: check if widget is not installed by WidgetDB
+ * Expected: plugin should be notified that widget is not installed
+ */
 RUNNER_TEST(widgetDB_test_check_installation_status_uninstalled)
 {
-    try
-    {
+    try {
         IWidgetDBPtr widget = getWidgetDB(2000);
         InstallationStatus tmp = widget->checkInstallationStatus(
-            "w_id_2011", "w_name_2000_en", "2.0.0");
+                "w_id_2011", "w_name_2000_en", "2.0.0");
 
         RUNNER_ASSERT(tmp == InstallationStatus::STATUS_UNINSTALLED);
-    }
-    catch(const WrtDeviceApis::Commons::SecurityException &e)
-    {
+    } catch (const WrtDeviceApis::Commons::SecurityException &e) {
         LogError("Exception thrown." << e.DumpToString());
         RUNNER_ASSERT(false);
     }
 }
 
 /*
-Name: widgetDB_test_check_installation_status_latest
-Description: check if widget installation information is taken from latest version
-Expected: plugin installation status should be same is both calls of WidgetDB
-*/
+ * Name: widgetDB_test_check_installation_status_latest
+ * Description: check if widget installation information is taken from latest
+ * version
+ * Expected: plugin installation status should be same is both calls of WidgetDB
+ */
 RUNNER_TEST(widgetDB_test_check_installation_status_latest)
 {
-    try
-    {
+    try {
         IWidgetDBPtr widget = getWidgetDB(2000);
         InstallationStatus tmp1 = widget->checkInstallationStatus(
-            "w_id_2000", "w_name_2000_en", "0.1.0");
+                "w_id_2000", "w_name_2000_en", "0.1.0");
         InstallationStatus tmp2 = widget->checkInstallationStatus(
-            "w_id_2000", "w_name_2000_en", "1.0.0");
+                "w_id_2000", "w_name_2000_en", "1.0.0");
 
         RUNNER_ASSERT(tmp1 == InstallationStatus::STATUS_LATEST);
         RUNNER_ASSERT(tmp2 == InstallationStatus::STATUS_LATEST);
-    }
-    catch(const WrtDeviceApis::Commons::SecurityException &e)
-    {
+    } catch (const WrtDeviceApis::Commons::SecurityException &e) {
         LogError("Exception thrown." << e.DumpToString());
         RUNNER_ASSERT(false);
     }
 }
 
 /*
-Name: widgetDB_test_widget_feature
-Description: check accessiblity of widget features and their values by WidgetDB
-Expected: feature names and values should match this, which was inserted into widget database
-*/
+ * Name: widgetDB_test_widget_feature
+ * Description: check accessiblity of widget features and their values by
+ * WidgetDB
+ * Expected: feature names and values should match this, which was inserted into
+ * widget database
+ */
 RUNNER_TEST(widgetDB_test_widget_feature)
 {
-    try
-    {
+    try {
         IWidgetDBPtr widget = getWidgetDB(2000);
         Features features = widget->getWidgetFeatures();
 
@@ -506,61 +456,48 @@ RUNNER_TEST(widgetDB_test_widget_feature)
 
         FOREACH(it, features)
         {
-           std::string name = (*it)->getName();
-           if ("first_2000" == name)
-           {
-               RUNNER_ASSERT((*it)->getParams().size() == 4);
-
-               RUNNER_ASSERT((*it)->isRequired());
-           }
-           else if ("second_2000" == name)
-           {
-               RUNNER_ASSERT((*it)->getParams().size() == 1);
-           }
-           else if ("third_2000" == name)
-           {
-               IWidgetFeature::Params params = (*it)->getParams();
-
-               RUNNER_ASSERT(params.size() == 1);
-               RUNNER_ASSERT_WHAT_EQUALS("third_2000", params.begin()->first);
-               RUNNER_ASSERT_WHAT_EQUALS("thirdValue1", params.begin()->second);
-               RUNNER_ASSERT(!(*it)->isRequired());
-           }
-           else if ("fourth_2000" == name)
-           {
-               RUNNER_ASSERT((*it)->getParams().size() == 0);
-           }
-           else if ("fifth_2000" == name)
-           {
-               RUNNER_ASSERT((*it)->getParams().size() == 0);
-           }
-           else
-               RUNNER_ASSERT(false);
+            std::string name = (*it)->getName();
+            if ("first_2000" == name) {
+                RUNNER_ASSERT((*it)->getParams().size() == 4);
+
+                RUNNER_ASSERT((*it)->isRequired());
+            } else if ("second_2000" == name) {
+                RUNNER_ASSERT((*it)->getParams().size() == 1);
+            } else if ("third_2000" == name) {
+                IWidgetFeature::Params params = (*it)->getParams();
+
+                RUNNER_ASSERT(params.size() == 1);
+                RUNNER_ASSERT_WHAT_EQUALS("third_2000", params.begin()->first);
+                RUNNER_ASSERT_WHAT_EQUALS("thirdValue1", params.begin()->second);
+                RUNNER_ASSERT(!(*it)->isRequired());
+            } else if ("fourth_2000" == name) {
+                RUNNER_ASSERT((*it)->getParams().size() == 0);
+            } else if ("fifth_2000" == name) {
+                RUNNER_ASSERT((*it)->getParams().size() == 0);
+            } else {
+                RUNNER_ASSERT(false);
+            }
         }
-    }
-    catch(const WrtDeviceApis::Commons::SecurityException &e)
-    {
+    } catch (const WrtDeviceApis::Commons::SecurityException &e) {
         LogError("Exception thrown." << e.DumpToString());
         RUNNER_ASSERT(false);
     }
 }
 
 /*
-Name: widgetDB_test_widget_feature2
-Description: check if requesting features from WidgetDB throw excpetion if widget does not exists
-Expected: exception should be raise if widget does not exists
-*/
+ * Name: widgetDB_test_widget_feature2
+ * Description: check if requesting features from WidgetDB throw excpetion if
+ * widget does not exists
+ * Expected: exception should be raise if widget does not exists
+ */
 RUNNER_TEST(widgetDB_test_widget_feature2)
 {
-    try
-    {
+    try {
         IWidgetDBPtr widget = getWidgetDB(2011); //no such widget
         Features features = widget->getWidgetFeatures();
 
         RUNNER_ASSERT(false);
-    }
-    catch(const WrtDeviceApis::Commons::SecurityException &e)
-    {
+    } catch (const WrtDeviceApis::Commons::SecurityException &e) {
         LogDebug("OK. Exception thrown." << e.DumpToString());
     }
 }
index 31f29fb..1a0f82a 100755 (executable)
@@ -46,14 +46,14 @@ if [ "x$1" == "xstart" ]; then
 
     #Widgets
     INS_ALL_WIDGETEXT="insert into WidgetExtendedInfo(app_id, share_href, signature_type)"
-    INS_ALL_WIDGET="insert into WidgetInfo(app_id, widget_id, widget_version, widget_width, widget_height, author_name, author_email, author_href, base_folder, webkit_plugins_required, recognized, wac_signed, distributor_signed, min_version, back_supported, access_network, defaultlocale, pkgname)"
+    INS_ALL_WIDGET="insert into WidgetInfo(app_id, widget_id, widget_version, widget_width, widget_height, author_name, author_email, author_href, base_folder, webkit_plugins_required, recognized, wac_signed, distributor_signed, min_version, back_supported, access_network, defaultlocale, tizen_appid)"
     INS_ALL_WIDGET_LOC="insert into LocalizedWidgetInfo(app_id, widget_locale, widget_name, widget_shortname, widget_description, widget_license, widget_license_file, widget_license_href)"
     INS_ALL_WIDGET_ICONS="insert into WidgetIcon(app_id, icon_src, icon_width, icon_height)"
     INS_ALL_WIDGET_LOC_ICONS="insert into WidgetLocalizedIcon(app_id, icon_id, widget_locale)"
     INS_ALL_WIDGET_STARTFILE="insert into WidgetStartFile(app_id, src)"
     INS_ALL_WIDGET_LOC_STARTFILE="insert into WidgetLocalizedStartFile(app_id, start_file_id, widget_locale, type, encoding)"
     INS_ALL_WIDGET_DEFPREF="insert into WidgetDefaultPreference(app_id, key_name, key_value, readonly)"
-    INS_ALL_WIDGET_PREF="insert into WidgetPreference(pkgname, key_name, key_value, readonly)"
+    INS_ALL_WIDGET_PREF="insert into WidgetPreference(tizen_appid, key_name, key_value, readonly)"
     INS_ALL_WIDGET_FEATURE="insert into WidgetFeature(widget_feature_id, app_id, name, required, rejected)"
     INS_ALL_WIDGET_FEATURE_PARAM="insert into FeatureParam(widget_feature_id, name, value)"
     INS_ALL_WIDGET_WINMODES="insert into WidgetWindowModes(app_id, window_mode)"
@@ -65,8 +65,8 @@ if [ "x$1" == "xstart" ]; then
 
     sqlite3 $WRT_DB "${INS_ALL_WIDGET} VALUES(2000, 'w_id_2000', '1.0.0', 100, 200, 'a_name_2000', 'a_email_2000', 'a_href_2000', 'basef_2000', 1, 1, 1, 1, '1.0', 0, 0, 'en', 'tid2000')";
     sqlite3 $WRT_DB "${INS_ALL_WIDGET} VALUES(2001, 'w_id_2001', '2.0.0', 100, 200, 'a_name_2001', 'a_email_2001', 'a_href_2001', 'basef_2001', 1, 1, 1, 1, '0.5', 0, 0, 'en', 'tid2001')";
-    sqlite3 $WRT_DB "insert into WidgetInfo(app_id, back_supported, pkgname) VALUES(2002, 0, 'tid2002')";
-    sqlite3 $WRT_DB "insert into WidgetInfo(app_id, back_supported, pkgname) VALUES(2003, 0, 'NOTUSEDPKGNAME3')"; # for properties tests
+    sqlite3 $WRT_DB "insert into WidgetInfo(app_id, back_supported, tizen_appid) VALUES(2002, 0, 'tid2002')";
+    sqlite3 $WRT_DB "insert into WidgetInfo(app_id, back_supported, tizen_appid) VALUES(2003, 0, 'NOTUSEDPKGNAME3')"; # for properties tests
 
     sqlite3 $WRT_DB "${INS_ALL_WIDGETEXT} VALUES(2000, 'share_href_2000', 0)";
     sqlite3 $WRT_DB "${INS_ALL_WIDGETEXT} VALUES(2001, 'share_href_2001', 0)";
diff --git a/uncrustify.cfg b/uncrustify.cfg
new file mode 100644 (file)
index 0000000..2bf1d96
--- /dev/null
@@ -0,0 +1,170 @@
+indent_align_string=true\r
+indent_braces=false\r
+indent_braces_no_func=false\r
+indent_brace_parent=false\r
+indent_namespace=false\r
+indent_extern=false\r
+indent_class=true\r
+indent_class_colon=false\r
+indent_else_if=false\r
+indent_func_call_param=false\r
+indent_func_def_param=false\r
+indent_func_proto_param=false\r
+indent_func_class_param=false\r
+indent_func_ctor_var_param=false\r
+indent_template_param=false\r
+indent_func_param_double=false\r
+indent_relative_single_line_comments=false\r
+indent_col1_comment=true\r
+indent_access_spec_body=false\r
+indent_paren_nl=false\r
+indent_comma_paren=false\r
+indent_bool_paren=false\r
+indent_square_nl=false\r
+indent_preserve_sql=false\r
+indent_align_assign=false\r
+sp_balance_nested_parens=false\r
+align_keep_tabs=false\r
+align_with_tabs=false\r
+align_on_tabstop=false\r
+align_number_left=false\r
+align_func_params=false\r
+align_same_func_call_params=false\r
+align_var_def_colon=false\r
+align_var_def_attribute=false\r
+align_var_def_inline=false\r
+align_right_cmt_mix=false\r
+align_on_operator=false\r
+align_mix_var_proto=false\r
+align_single_line_func=false\r
+align_single_line_brace=false\r
+align_nl_cont=false\r
+align_left_shift=true\r
+nl_collapse_empty_body=true\r
+nl_assign_leave_one_liners=false\r
+nl_class_leave_one_liners=false\r
+nl_enum_leave_one_liners=false\r
+nl_getset_leave_one_liners=false\r
+nl_func_leave_one_liners=false\r
+nl_if_leave_one_liners=false\r
+nl_multi_line_cond=true\r
+nl_multi_line_define=false\r
+nl_before_case=false\r
+nl_after_case=false\r
+nl_after_return=false\r
+nl_after_semicolon=true\r
+nl_after_brace_open=false\r
+nl_after_brace_open_cmt=false\r
+nl_after_vbrace_open=false\r
+nl_after_brace_close=false\r
+nl_define_macro=false\r
+nl_squeeze_ifdef=false\r
+nl_ds_struct_enum_cmt=false\r
+nl_ds_struct_enum_close_brace=false\r
+nl_create_if_one_liner=false\r
+nl_create_for_one_liner=false\r
+nl_create_while_one_liner=false\r
+ls_for_split_full=true\r
+ls_func_split_full=true\r
+nl_after_multiline_comment=false\r
+eat_blanks_after_open_brace=true\r
+eat_blanks_before_close_brace=true\r
+mod_pawn_semicolon=false\r
+mod_full_paren_if_bool=false\r
+mod_remove_extra_semicolon=true\r
+mod_sort_import=false\r
+mod_sort_using=false\r
+mod_sort_include=false\r
+mod_move_case_break=false\r
+mod_remove_empty_return=false\r
+cmt_indent_multi=true\r
+cmt_c_group=false\r
+cmt_c_nl_start=false\r
+cmt_c_nl_end=false\r
+cmt_cpp_group=false\r
+cmt_cpp_nl_start=false\r
+cmt_cpp_nl_end=false\r
+cmt_cpp_to_c=false\r
+cmt_star_cont=true\r
+cmt_multi_check_last=true\r
+cmt_insert_before_preproc=false\r
+pp_indent_at_level=false\r
+pp_region_indent_code=false\r
+pp_if_indent_code=false\r
+pp_define_at_level=false\r
+indent_columns=4\r
+indent_member=4\r
+indent_access_spec=-2\r
+code_width=80\r
+nl_max=2\r
+nl_before_access_spec=2\r
+cmt_width=80\r
+indent_with_tabs=0\r
+sp_arith=force\r
+sp_assign=force\r
+sp_enum_assign=force\r
+sp_pp_concat=remove\r
+sp_pp_stringify=remove\r
+sp_bool=force\r
+sp_compare=force\r
+sp_paren_brace=force\r
+sp_angle_paren=remove\r
+sp_before_sparen=force\r
+sp_inside_sparen=remove\r
+sp_after_sparen=force\r
+sp_sparen_brace=force\r
+sp_before_semi=remove\r
+sp_after_semi_for_empty=remove\r
+sp_before_square=remove\r
+sp_before_squares=remove\r
+sp_inside_square=remove\r
+sp_after_comma=force\r
+sp_before_comma=remove\r
+sp_after_class_colon=force\r
+sp_before_class_colon=force\r
+sp_before_case_colon=remove\r
+sp_inside_braces=add\r
+sp_inside_fparens=remove\r
+sp_inside_fparen=remove\r
+sp_func_call_paren=remove\r
+sp_func_class_paren=remove\r
+sp_else_brace=force\r
+sp_brace_else=force\r
+sp_catch_brace=force\r
+sp_brace_catch=force\r
+sp_try_brace=force\r
+sp_before_dc=remove\r
+sp_after_dc=remove\r
+sp_not=remove\r
+sp_inv=remove\r
+sp_addr=remove\r
+sp_member=remove\r
+sp_deref=remove\r
+sp_sign=remove\r
+sp_incdec=remove\r
+sp_cond_colon=force\r
+sp_cond_question=force\r
+sp_case_label=force\r
+nl_assign_brace=remove\r
+nl_if_brace=remove\r
+nl_brace_else=remove\r
+nl_elseif_brace=remove\r
+nl_else_brace=remove\r
+nl_else_if=remove\r
+nl_try_brace=remove\r
+nl_for_brace=remove\r
+nl_catch_brace=remove\r
+nl_brace_catch=remove\r
+nl_while_brace=remove\r
+nl_do_brace=remove\r
+nl_brace_while=remove\r
+nl_switch_brace=remove\r
+nl_namespace_brace=remove\r
+nl_class_brace=force\r
+nl_fdef_brace=force\r
+pos_class_comma=trail\r
+pos_class_colon=trail\r
+mod_full_brace_do=add\r
+mod_full_brace_for=add\r
+mod_full_brace_if=add\r
+mod_full_brace_while=add\r
diff --git a/uncrustify.sh b/uncrustify.sh
new file mode 100755 (executable)
index 0000000..49ad3cf
--- /dev/null
@@ -0,0 +1 @@
+uncrustify -c uncrustify.cfg --no-backup `find . -regex "\(.*\.cpp\|.*\.h\|.*\.c\|.*\.cc\)" | grep -v "orm.h\|orm_generator.h\|3rdparty\|examples"`