Inline mode support
authorLukasz Marek <l.marek@samsung.com>
Wed, 3 Apr 2013 14:44:25 +0000 (16:44 +0200)
committerJihoon Chung <jihoon.chung@samsung.com>
Sat, 13 Apr 2013 07:46:44 +0000 (16:46 +0900)
[Issue#] N/A
[Problem] N/A
[Cause] N/A
[Solution] Preparation for services in inline mode.
[SCMRequest] Require updated wrt-commons
[Verification] Install and run any widget

requires http://slp-info.sec.samsung.net/gerrit/#/c/175737/

Change-Id: I0d4d622c7c5813f07c4feb23523c06721b4e64a1

CMakeLists.txt
src/configuration_parser/widget_parser.cpp
src/jobs/widget_install/task_manifest_file.cpp

index 4a9698b..fdb5f18 100644 (file)
@@ -55,6 +55,7 @@ SET(CMAKE_CXX_FLAGS_CCOV       "-O0 -std=c++0x -g --coverage")
 OPTION(DPL_LOG "DPL logs status" ON)
 OPTION(WITH_TESTS "Build tests" OFF)
 OPTION(MULTIPROCESS_SERVICE_SUPPORT "Process per service" OFF)
+OPTION(MULTIPROCESS_SERVICE_SUPPORT_INLINE "Process per service - inline mode support" OFF)
 IF(DPL_LOG AND NOT CMAKE_BUILD_TYPE MATCHES "profiling")
     MESSAGE(STATUS "Logging enabled for DPL")
     ADD_DEFINITIONS("-DDPL_LOGS_ENABLED")
@@ -64,6 +65,9 @@ ENDIF(DPL_LOG AND NOT CMAKE_BUILD_TYPE MATCHES "profiling")
 MESSAGE(STATUS "WITH_TESTS: " ${WITH_TESTS})
 IF(MULTIPROCESS_SERVICE_SUPPORT)
     ADD_DEFINITIONS("-DMULTIPROCESS_SERVICE_SUPPORT")
+    IF (MULTIPROCESS_SERVICE_SUPPORT_INLINE)
+        ADD_DEFINITIONS("-DMULTIPROCESS_SERVICE_SUPPORT_INLINE")
+    ENDIF(MULTIPROCESS_SERVICE_SUPPORT_INLINE)
 ENDIF(MULTIPROCESS_SERVICE_SUPPORT)
 
 # If supported for the target machine, emit position-independent code,suitable
index a7e68d5..2f12265 100644 (file)
@@ -1252,6 +1252,53 @@ class AppControlParser : public ElementParser
         ConfigParserData::AppControlInfo& m_data;
     };
 
+    struct DispositionParser : public ElementParser
+    {
+      public:
+        virtual ActionFunc GetElementParser(const DPL::String& /*ns*/,
+                                            const DPL::String& /*name*/)
+        {
+            return &IgnoringParser::Create;
+        }
+
+        virtual void Accept(const Text& /*text*/)
+        {}
+
+        virtual void Accept(const Element& /*element*/)
+        {}
+
+        virtual void Accept(const XmlAttribute& attribute)
+        {
+            if (attribute.name == L"disposition") {
+                if (attribute.value.size() > 0) {
+                    m_value = attribute.value;
+                    NormalizeString(m_value);
+                }
+            }
+        }
+
+        virtual void Verify()
+        {
+            if (m_value.IsNull() || *m_value != L"inline") {
+                m_data.m_disposition = ConfigParserData::AppControlInfo::Disposition::WINDOW;
+            }
+            else {
+                m_data.m_disposition = ConfigParserData::AppControlInfo::Disposition::INLINE;
+            }
+        }
+
+        DispositionParser(ConfigParserData::AppControlInfo& data) :
+            ElementParser(),
+            m_properNamespace(false),
+            m_data(data)
+        {}
+
+      private:
+        bool m_properNamespace;
+        DPL::OptionalString m_value;
+        ConfigParserData::AppControlInfo& m_data;
+    };
+
     virtual ActionFunc GetElementParser(const DPL::String& /*ns*/,
                                         const DPL::String& name)
     {
@@ -1264,6 +1311,9 @@ class AppControlParser : public ElementParser
             return DPL::MakeDelegate(this, &AppControlParser::OnUriElement);
         } else if (name == L"mime") {
             return DPL::MakeDelegate(this, &AppControlParser::OnMimeElement);
+        } else if (name == L"disposition") {
+            return DPL::MakeDelegate(this,
+                                     &AppControlParser::OnDispositionElement);
         } else {
             return &IgnoringParser::Create;
         }
@@ -1321,6 +1371,11 @@ class AppControlParser : public ElementParser
         return ElementParserPtr(new MimeParser(m_appControl));
     }
 
+    ElementParserPtr OnDispositionElement()
+    {
+        return ElementParserPtr(new DispositionParser(m_appControl));
+    }
+
     AppControlParser(ConfigParserData& data) :
         ElementParser(),
         m_data(data),
index f6bc038..009b315 100644 (file)
@@ -626,7 +626,10 @@ void TaskManifestFile::writeManifest(const DPL::String & path)
 
         uiApp.setTaskmanage(true);
         uiApp.setNodisplay(true);
-
+#ifdef MULTIPROCESS_SERVICE_SUPPORT_INLINE
+        uiApp.setTaskmanage(ConfigParserData::AppControlInfo::Disposition::INLINE != it->m_disposition);
+        uiApp.setMultiple(ConfigParserData::AppControlInfo::Disposition::INLINE == it->m_disposition);
+#endif
         std::stringstream postfix;
         postfix << "-__SERVICE_PROCESS__" << count++;
 
@@ -651,6 +654,10 @@ void TaskManifestFile::writeManifest(const DPL::String & path)
 
         uiApp.setTaskmanage(true);
         uiApp.setNodisplay(true);
+#ifdef MULTIPROCESS_SERVICE_SUPPORT_INLINE
+        uiApp.setTaskmanage(ConfigParserData::ServiceInfo::Disposition::INLINE != it->m_disposition);
+        uiApp.setMultiple(ConfigParserData::ServiceInfo::Disposition::INLINE == it->m_disposition);
+#endif
 
         std::stringstream postfix;
         postfix << "-__SERVICE_PROCESS__" << count++;