[Release] wrt-commons_0.2.92 submit/tizen_2.0/20130116.021757
authorJihoon Chung <jihoon.chung@samsung.com>
Wed, 16 Jan 2013 02:17:41 +0000 (11:17 +0900)
committerJihoon Chung <jihoon.chung@samsung.com>
Wed, 16 Jan 2013 02:17:41 +0000 (11:17 +0900)
Change-Id: I61c9a38ba9408af14e1613b4b08bf6d79ba6a383

23 files changed:
CMakeLists.txt
build/CMakeLists.txt
build/popup/CMakeLists.txt [deleted file]
build/popup/dpl-popup-efl.pc.in [deleted file]
debian/changelog
modules/CMakeLists.txt
modules/event/include/dpl/event/main_event_dispatcher.h
modules/event/src/main_event_dispatcher.cpp
modules/popup/DESCRIPTION [deleted file]
modules/popup/config.cmake [deleted file]
modules/popup/include/dpl/popup/evas_object.h [deleted file]
modules/popup/include/dpl/popup/popup.h [deleted file]
modules/popup/include/dpl/popup/popup_controller.h [deleted file]
modules/popup/include/dpl/popup/popup_manager.h [deleted file]
modules/popup/include/dpl/popup/popup_object.h [deleted file]
modules/popup/include/dpl/popup/popup_renderer.h [deleted file]
modules/popup/src/evas_object.cpp [deleted file]
modules/popup/src/popup_controller.cpp [deleted file]
modules/popup/src/popup_manager.cpp [deleted file]
modules/popup/src/popup_renderer.cpp [deleted file]
modules/test/src/test_results_collector.cpp
packaging/wrt-commons.spec
tests/dao/CMakeLists.txt

index 084e4c25915235162284943ebaecd3584caf70bd..64704d2b0965ba370262c754eb9aabf644032657 100644 (file)
@@ -182,7 +182,6 @@ SET(TARGET_DPL_SOCKET_EFL "lib${PROJECT_NAME}-socket-efl")
 SET(TARGET_DPL_RPC_EFL "lib${PROJECT_NAME}-rpc-efl")
 SET(TARGET_DPL_TEST_ENGINE_EFL "lib${PROJECT_NAME}-test-efl")
 SET(TARGET_DPL_LOG_EFL "lib${PROJECT_NAME}-log-efl")
-SET(TARGET_DPL_POPUP "lib${PROJECT_NAME}-popup-efl")
 SET(TARGET_WRT_DAO_RW_LIB "dpl-wrt-dao-rw")
 SET(TARGET_WRT_DAO_RO_LIB "dpl-wrt-dao-ro")
 SET(TARGET_AUTO_SAVE_DAO_LIB "wrt-commons-auto-save-dao")
index e11b0e94b5024a528a3361c6a99e105dc40de55c..b27d01f6b925868871a62ac742b826f6b9cffd2d 100644 (file)
@@ -30,7 +30,6 @@ ADD_SUBDIRECTORY(widget_dao)
 ADD_SUBDIRECTORY(auto_save_dao)
 ADD_SUBDIRECTORY(security_origin_dao)
 ADD_SUBDIRECTORY(custom_handler_dao)
-ADD_SUBDIRECTORY(popup)
 ADD_SUBDIRECTORY(utils)
 ADD_SUBDIRECTORY(support)
 ADD_SUBDIRECTORY(encryption)
diff --git a/build/popup/CMakeLists.txt b/build/popup/CMakeLists.txt
deleted file mode 100644 (file)
index 07425a3..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-# Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
-#
-#    Licensed under the Apache License, Version 2.0 (the "License");
-#    you may not use this file except in compliance with the License.
-#    You may obtain a copy of the License at
-#
-#        http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS,
-#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#    See the License for the specific language governing permissions and
-#    limitations under the License.
-#
-# @file        CMakeLists.txt
-# @author      Pawel Sikorski (p.sikorski@samsung.com)
-# @version     1.0
-# @brief
-#
-
-# Check required modules
-INCLUDE(FindPkgConfig)
-PKG_CHECK_MODULES(SYS_POPUP
-    elementary
-    REQUIRED)
-
-# Add core include directories
-INCLUDE_DIRECTORIES(
-    ${DPL_LOG_INCLUDE_DIR}
-    ${DPL_CORE_INCLUDE_DIR}
-    ${DPL_POPUP_INCLUDE_DIR}
-    ${DPL_EVENT_INCLUDE_DIR}
-)
-
-INCLUDE_DIRECTORIES(SYSTEM ${SYS_EFL_INCLUDE_DIRS})
-INCLUDE_DIRECTORIES(SYSTEM ${SYS_POPUP_INCLUDE_DIRS})
-
-LINK_DIRECTORIES(
-    ${SYS_POPUP_LIBRARY_DIRS}
-)
-
-# Base EFL based DPL library
-SET(DPL_POPUP_LIBRARY "${PROJECT_NAME}-popup-efl")
-
-# Build shared library
-
-ADD_LIBRARY(${TARGET_DPL_POPUP} SHARED  ${DPL_POPUP_SOURCES})
-
-TARGET_LINK_LIBRARIES(${TARGET_DPL_POPUP}
-    ${SYS_POPUP_LIBRARIES}
-    ${TARGET_DPL_EFL}
-)
-
-# Target library properties
-SET_TARGET_PROPERTIES(${TARGET_DPL_POPUP} PROPERTIES
-    SOVERSION ${API_VERSION} 
- VERSION ${VERSION}
-    CLEAN_DIRECT_OUTPUT 1
-    OUTPUT_NAME ${DPL_POPUP_LIBRARY})
-
-# Install libraries
-INSTALL(TARGETS ${TARGET_DPL_POPUP}
-        DESTINATION lib)
-
-# Install detail headers
-INSTALL(FILES ${DPL_POPUP_HEADERS}
-        DESTINATION include/dpl-efl/dpl/popup)
-
-# Install pkgconfig script
-configure_and_install_pkg(dpl-popup-efl.pc)
diff --git a/build/popup/dpl-popup-efl.pc.in b/build/popup/dpl-popup-efl.pc.in
deleted file mode 100644 (file)
index 98dfdf4..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-prefix=/usr
-exec_prefix=${prefix}
-libdir=${prefix}/lib
-includedir=${prefix}/include
-
-Name: dpl-popup-efl
-Description: DPL Popup functionality - EFL based
-Version: @VERSION@
-Requires: dpl-efl
-Libs: -L${libdir} -ldpl-popup-efl
-Cflags: -I${includedir}/dpl-efl
index 8f736c53ab01b1a2e5bbadf8a7e1677850715fe6..736b898245df91385acc3e28455a6dfd42702ef5 100644 (file)
@@ -1,4 +1,13 @@
-wrt-commons (0.2.91) precise; urgency=low
+wrt-commons (0.2.92) unstable; urgency=low
+
+  * Removal of popup implementation
+  * Clean up unnecessary cmake log
+  * Improve XML test results collector
+  * Add method for reset crossEventCallHandler
+
+ -- Jihoon Chung <jihoon.chung@samsung.com>  Wed, 16 Jan 2013 10:49:45 +0900
+
+wrt-commons (0.2.91) unstable; urgency=low
 
   * Fix issue Prevent Defect -17677
   * Fixing issues: 17677
@@ -6,7 +15,7 @@ wrt-commons (0.2.91) precise; urgency=low
   * Git : framework/web/wrt-commons
   * Tag : wrt-commons_0.2.91
 
- -- leerang <jihoon.chung@samsung.com>  Thu, 10 Jan 2013 19:30:41 +0900
+ -- leerang <leerang.song@samsung.com>  Wed, 09 Jan 2013 18:03:04 +0900
 
 wrt-commons (0.2.90) unstable; urgency=low
 
@@ -65,7 +74,7 @@ wrt-commons (0.2.85) unstable; urgency=low
 
  -- Soyoung Kim <sy037.kim@samsung.com>  Fri, 28 Dec 2012 14:05:27 +0900
 
-wrt-commons (0.2.84) unstable; urgency=low
+wrt-commons (0.2.83) unstable; urgency=low
 
   * Replacing widget handle with tizenid in property DAO
 
index 587ba94e8873d3dc8f6864b08e6df877e55c9c0e..4d3918910daa21458696200df667b1cc52bd0a59 100644 (file)
@@ -31,7 +31,6 @@ ADD_SUBDIRECTORY(widget_dao)
 ADD_SUBDIRECTORY(auto_save_dao)
 ADD_SUBDIRECTORY(security_origin_dao)
 ADD_SUBDIRECTORY(custom_handler_dao)
-include(popup/config.cmake)
 include(utils/config.cmake)
 include(localization/config.cmake)
 include(support/config.cmake)
index 97145f69cd4a5cd02882606baf3083a6c15214c7..7bfabad304a13932087b9b71910a76b3e4c50bf0 100644 (file)
@@ -71,7 +71,7 @@ protected:
     // Cross thread send support
     WrappedEventCallList m_wrappedCrossEventCallList;
     Mutex m_crossEventCallMutex;
-    WaitableEvent m_crossEventCallInvoker;
+    WaitableEvent* m_crossEventCallInvoker;
 
     Ecore_Event_Handler *m_eventCallHandler;
     Ecore_Fd_Handler *m_crossEventCallHandler;
@@ -110,6 +110,7 @@ public:
 
     virtual void AddEventCall(AbstractEventCall *abstractEventCall);
     virtual void AddTimedEventCall(AbstractEventCall *abstractEventCall, double dueTime);
+    virtual void ResetCrossEventCallHandler();
 };
 
 MainEventDispatcher& GetMainEventDispatcherInstance();
index 6faf09031303b4dbd6c118d2fdddca09ff9bb91d..ae1107d7469b2b1ca685767dddd59adcb2919293 100644 (file)
@@ -64,8 +64,11 @@ MainEventDispatcher::MainEventDispatcher()
     if ((m_eventCallHandler = ecore_event_handler_add(m_eventId, &StaticDispatchEvent, this)) == NULL)
         ThrowMsg(Exception::CreateFailed, "Failed to register event handler!");
 
+    // Allocate WaitableEvent
+    m_crossEventCallInvoker = new WaitableEvent();
+
     // Register cross event handler
-    m_crossEventCallHandler = ecore_main_fd_handler_add(m_crossEventCallInvoker.GetHandle(), ECORE_FD_READ, &StaticDispatchCrossInvoker, this, NULL, NULL);
+    m_crossEventCallHandler = ecore_main_fd_handler_add(m_crossEventCallInvoker->GetHandle(), ECORE_FD_READ, &StaticDispatchCrossInvoker, this, NULL, NULL);
 
     if (m_crossEventCallHandler == NULL)
         ThrowMsg(Exception::CreateFailed, "Failed to register cross event handler!");
@@ -75,16 +78,19 @@ MainEventDispatcher::MainEventDispatcher()
 
 MainEventDispatcher::~MainEventDispatcher()
 {
-    // Remove event class handler
-    ecore_event_handler_del(m_eventCallHandler);
-    m_eventCallHandler = NULL;
-
     // Remove cross event handler
     ecore_main_fd_handler_del(m_crossEventCallHandler);
     m_crossEventCallHandler = NULL;
-
     LogPedantic("ECORE cross-event handler unregistered");
 
+    // Remove m_crossEventCallInvoker
+    delete m_crossEventCallInvoker;
+    m_crossEventCallInvoker = NULL;
+
+    // Remove event class handler
+    ecore_event_handler_del(m_eventCallHandler);
+    m_eventCallHandler = NULL;
+
     // Decrement ECORE init count
     // We do not need ecore routines any more
     ecore_shutdown();
@@ -94,6 +100,33 @@ MainEventDispatcher::~MainEventDispatcher()
     g_lateMainEventDispatcher = NULL;
 }
 
+void MainEventDispatcher::ResetCrossEventCallHandler()
+{
+    // Remove cross event handler
+    ecore_main_fd_handler_del(m_crossEventCallHandler);
+    m_crossEventCallHandler = NULL;
+    LogPedantic("ECORE cross-event handler unregistered");
+
+    // Re-allocate WaitableEvent
+    delete m_crossEventCallInvoker;
+    m_crossEventCallInvoker = new WaitableEvent();
+
+    // Register cross event handler
+    m_crossEventCallHandler =
+        ecore_main_fd_handler_add(m_crossEventCallInvoker->GetHandle(),
+                                  ECORE_FD_READ,
+                                  &StaticDispatchCrossInvoker,
+                                  this,
+                                  NULL,
+                                  NULL);
+
+    if (m_crossEventCallHandler == NULL) {
+        ThrowMsg(Exception::CreateFailed, "Failed to register cross event handler!");
+    }
+
+    LogPedantic("ECORE cross-event handler re-registered");
+}
+
 void MainEventDispatcher::StaticDeleteEvent(void *data, void *event)
 {
     LogPedantic("Static ECORE delete event handler");
@@ -226,7 +259,7 @@ void MainEventDispatcher::DispatchCrossInvoker()
 
     // Critical section
     {
-        m_crossEventCallInvoker.Reset();
+        m_crossEventCallInvoker->Reset();
         Mutex::ScopedLock lock(&m_crossEventCallMutex);
         m_wrappedCrossEventCallList.swap(stolenCrossEvents);
     }
@@ -261,7 +294,7 @@ void MainEventDispatcher::AddEventCall(AbstractEventCall *abstractEventCall)
         {
             Mutex::ScopedLock lock(&m_crossEventCallMutex);
             m_wrappedCrossEventCallList.push_back(WrappedEventCall(abstractEventCall, false, 0.0));
-            m_crossEventCallInvoker.Signal();
+            m_crossEventCallInvoker->Signal();
         }
 
         LogPedantic("Event pushed to cross-thread event list");
@@ -283,7 +316,7 @@ void MainEventDispatcher::AddTimedEventCall(AbstractEventCall *abstractEventCall
         {
             Mutex::ScopedLock lock(&m_crossEventCallMutex);
             m_wrappedCrossEventCallList.push_back(WrappedEventCall(abstractEventCall, true, dueTime));
-            m_crossEventCallInvoker.Signal();
+            m_crossEventCallInvoker->Signal();
         }
 
         LogPedantic("Event pushed to cross-thread event list");
diff --git a/modules/popup/DESCRIPTION b/modules/popup/DESCRIPTION
deleted file mode 100644 (file)
index 665e43e..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-!!!options!!! stop
-UI module for displaying all kinds of pop-up dialogs
diff --git a/modules/popup/config.cmake b/modules/popup/config.cmake
deleted file mode 100644 (file)
index 7a304d9..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-# Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
-#
-#    Licensed under the Apache License, Version 2.0 (the "License");
-#    you may not use this file except in compliance with the License.
-#    You may obtain a copy of the License at
-#
-#        http://www.apache.org/licenses/LICENSE-2.0
-#
-#    Unless required by applicable law or agreed to in writing, software
-#    distributed under the License is distributed on an "AS IS" BASIS,
-#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#    See the License for the specific language governing permissions and
-#    limitations under the License.
-#
-#
-# @file     CMakeLists.txt
-# @author   Pawel Sikorski (p.sikorski@samsung.com)
-# @version     1.0
-#
-
-SET(DPL_POPUP_SOURCES
-    ${PROJECT_SOURCE_DIR}/modules/popup/src/popup_manager.cpp
-    ${PROJECT_SOURCE_DIR}/modules/popup/src/evas_object.cpp
-    ${PROJECT_SOURCE_DIR}/modules/popup/src/popup_renderer.cpp
-    ${PROJECT_SOURCE_DIR}/modules/popup/src/popup_controller.cpp
-    PARENT_SCOPE
-    )
-
-SET(DPL_POPUP_HEADERS
-    ${PROJECT_SOURCE_DIR}/modules/popup/include/dpl/popup/popup.h
-    ${PROJECT_SOURCE_DIR}/modules/popup/include/dpl/popup/evas_object.h
-    ${PROJECT_SOURCE_DIR}/modules/popup/include/dpl/popup/popup_controller.h
-    ${PROJECT_SOURCE_DIR}/modules/popup/include/dpl/popup/popup_manager.h
-    ${PROJECT_SOURCE_DIR}/modules/popup/include/dpl/popup/popup_object.h
-    ${PROJECT_SOURCE_DIR}/modules/popup/include/dpl/popup/popup_renderer.h
-    PARENT_SCOPE
-    )
-
-SET(DPL_POPUP_INCLUDE_DIR
-    ${PROJECT_SOURCE_DIR}/modules/popup/include
-    PARENT_SCOPE
-)
\ No newline at end of file
diff --git a/modules/popup/include/dpl/popup/evas_object.h b/modules/popup/include/dpl/popup/evas_object.h
deleted file mode 100644 (file)
index 25d7a66..0000000
+++ /dev/null
@@ -1,661 +0,0 @@
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- *    Licensed under the Apache License, Version 2.0 (the "License");
- *    you may not use this file except in compliance with the License.
- *    You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *    Unless required by applicable law or agreed to in writing, software
- *    distributed under the License is distributed on an "AS IS" BASIS,
- *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *    See the License for the specific language governing permissions and
- *    limitations under the License.
- */
-/*
- * @file        evas_object.h
- * @author      Lukasz Wrzosek (l.wrzosel@samsung.com)
- * @version     1.0
- * @brief       This file is the header for Evas_Object wrapper from Efl.
- */
-#ifndef WRT_SRC_DOMAIN_EFL_EVAS_OBJECT_H
-#define WRT_SRC_DOMAIN_EFL_EVAS_OBJECT_H
-
-#include <dpl/noncopyable.h>
-#include <dpl/framework_efl.h>
-#include <dpl/assert.h>
-#include <dpl/foreach.h>
-#include <dpl/apply.h>
-#include <set>
-#include <string>
-#include <tuple>
-#include <utility>
-#include <memory>
-namespace DPL {
-namespace Popup {
-
-class EvasObject
-{
-    class EvasObjectShared;
-    typedef std::shared_ptr<EvasObjectShared> EvasObjectSharedPtr;
-
-  public:
-    class IConnection
-    {
-      public:
-        Evas_Object* GetEvasObject();
-        void Disconnect();
-
-      private:
-        IConnection(EvasObjectShared* object);
-        virtual ~IConnection()
-        {
-        }
-        virtual void Call(void* /*event_info*/) = 0;
-
-        static void SmartCallbackWrapper(void* data,
-                Evas_Object* /*object*/,
-                void* event_info);
-        static void EvasCallbackWrapper(void* data,
-                Evas* /*evas*/,
-                Evas_Object* /*object*/,
-                void* event_info);
-
-        virtual void ConnectPrv() = 0;
-        virtual void DisconnectPrv() = 0;
-
-        friend class EvasObjectShared;
-
-        EvasObjectShared* m_object;
-    };
-
-  private:
-    class EvasObjectShared : DPL::Noncopyable
-    {
-      public:
-        friend class IConnection;
-        Evas_Object* GetObject();
-
-        typedef std::set<IConnection*> IConnectionsSet;
-
-        class SmartConnectionBase : public IConnection
-        {
-          public:
-            SmartConnectionBase(const std::string& name,
-                    EvasObjectShared* object);
-
-            virtual void ConnectPrv();
-            virtual void DisconnectPrv();
-            std::string m_callbackName;
-        };
-
-        template<typename ... Args>
-        class SmartConnection : public SmartConnectionBase
-        {
-          public:
-            typedef void (*CbType)(IConnection* connection,
-                                   void* event_info,
-                                   Args ... args);
-
-            SmartConnection(const std::string& name,
-                    CbType callback,
-                    EvasObjectShared* object,
-                    Args ... args) :
-                SmartConnectionBase(name, object),
-                m_callback(callback),
-                m_args(args ...)
-            {
-            }
-
-            virtual ~SmartConnection()
-            {
-            }
-
-            virtual void Call(void* event_info)
-            {
-                DPL::Apply<void,
-                           DPL::ExtraArgsInsertPolicy::Prepend>(m_callback,
-                                                                m_args,
-                                                                this,
-                                                                event_info);
-            }
-
-          private:
-            CbType m_callback;
-            std::tuple<Args ...> m_args;
-        };
-
-        template <class ThisType, class ArgType1>
-        class SmartMemberConnection1 : public SmartConnectionBase
-        {
-          public:
-            typedef void (ThisType::*CbType)(IConnection* connection,
-                                             void* event_info, ArgType1 *arg1);
-
-            SmartMemberConnection1(const std::string& name,
-                    CbType callback,
-                    ThisType* callee,
-                    ArgType1* arg1,
-                    EvasObjectShared* object) :
-                SmartConnectionBase(name, object),
-                m_callback(callback),
-                m_callee(callee),
-                m_arg1(arg1)
-            {
-            }
-
-            virtual ~SmartMemberConnection1()
-            {
-            }
-
-            virtual void Call(void* event_info)
-            {
-                (m_callee->*m_callback)(this, event_info, m_arg1);
-            }
-
-          private:
-            CbType m_callback;
-            ThisType* m_callee;
-            ArgType1* m_arg1;
-        };
-
-        template <class ThisType, class ArgType1, class ArgType2>
-        class SmartMemberConnection2 : public SmartConnectionBase
-        {
-          public:
-            typedef void (ThisType::*CbType)(IConnection* connection,
-                                             void* event_info, ArgType1 *arg1,
-                                             ArgType2* arg2);
-
-            SmartMemberConnection2(const std::string& name,
-                    CbType callback,
-                    ThisType* callee,
-                    ArgType1* arg1,
-                    ArgType2* arg2,
-                    EvasObjectShared* object) :
-                SmartConnectionBase(name, object),
-                m_callback(callback),
-                m_callee(callee),
-                m_arg1(arg1),
-                m_arg2(arg2)
-            {
-            }
-
-            virtual ~SmartMemberConnection2()
-            {
-            }
-
-            virtual void Call(void* event_info)
-            {
-                (m_callee->*m_callback)(this, event_info, m_arg1, m_arg2);
-            }
-
-          private:
-            CbType m_callback;
-            ThisType* m_callee;
-            ArgType1* m_arg1;
-            ArgType2* m_arg2;
-        };
-
-        class EvasConnectionBase : public IConnection
-        {
-          public:
-            EvasConnectionBase(Evas_Callback_Type type,
-                    EvasObjectShared* object);
-
-            virtual void ConnectPrv();
-            virtual void DisconnectPrv();
-
-            Evas_Callback_Type m_callbackType;
-        };
-
-        template <class ArgType1>
-        class EvasConnection1 : public EvasConnectionBase
-        {
-          public:
-            typedef void (*CbType)(IConnection* connection, void* event_info,
-                                   ArgType1 *arg1);
-
-            EvasConnection1(Evas_Callback_Type type,
-                    CbType callback,
-                    ArgType1* arg1,
-                    EvasObjectShared* object) :
-                EvasConnectionBase(type, object),
-                m_callback(callback),
-                m_arg1(arg1)
-            {
-            }
-
-            virtual ~EvasConnection1()
-            {
-            }
-
-            virtual void Call(void* event_info)
-            {
-                m_callback(this, event_info, m_arg1);
-            }
-
-          private:
-            CbType m_callback;
-            ArgType1* m_arg1;
-        };
-
-        template <class ArgType1, class ArgType2>
-        class EvasConnection2 : public EvasConnectionBase
-        {
-          public:
-            typedef void (*CbType)(IConnection* connection, void* event_info,
-                                   ArgType1 *arg1, ArgType2 *arg2);
-
-            EvasConnection2(Evas_Callback_Type type,
-                    CbType callback,
-                    ArgType1* arg1,
-                    ArgType2* arg2,
-                    EvasObjectShared* object) :
-                EvasConnectionBase(type, object),
-                m_callback(callback),
-                m_arg1(arg1),
-                m_arg2(arg2)
-            {
-            }
-
-            virtual ~EvasConnection2()
-            {
-            }
-
-            virtual void Call(void* event_info)
-            {
-                m_callback(this, event_info, m_arg1, m_arg2);
-            }
-
-          private:
-            CbType m_callback;
-            ArgType1* m_arg1;
-            ArgType2* m_arg2;
-        };
-
-        template <class ThisType, class ArgType1>
-        class EvasMemberConnection1 : public EvasConnectionBase
-        {
-          public:
-            typedef void (ThisType::*CbType)(IConnection* connection,
-                                             void* event_info, ArgType1 *arg1);
-
-            EvasMemberConnection1(Evas_Callback_Type type,
-                    CbType callback,
-                    ThisType* callee,
-                    ArgType1* arg1,
-                    EvasObjectShared* object) :
-                EvasConnectionBase(type, object),
-                m_callback(callback),
-                m_callee(callee),
-                m_arg1(arg1)
-            {
-            }
-
-            virtual ~EvasMemberConnection1()
-            {
-            }
-
-            virtual void Call(void* event_info)
-            {
-                (m_callee->*m_callback)(this, event_info, m_arg1);
-            }
-
-          private:
-            CbType m_callback;
-            ThisType* m_callee;
-            ArgType1* m_arg1;
-        };
-
-        template <class ThisType, class ArgType1, class ArgType2>
-        class EvasMemberConnection2 : public EvasConnectionBase
-        {
-          public:
-            typedef void (ThisType::*CbType)(IConnection* connection,
-                                             void* event_info, ArgType1* arg1,
-                                             ArgType2* arg2);
-
-            EvasMemberConnection2(Evas_Callback_Type type,
-                    CbType callback,
-                    ThisType* callee,
-                    ArgType1* arg1,
-                    ArgType2* arg2,
-                    EvasObjectShared* object) :
-                EvasConnectionBase(type, object),
-                m_callback(callback),
-                m_callee(callee),
-                m_arg1(arg1),
-                m_arg2(arg2)
-            {
-            }
-
-            virtual ~EvasMemberConnection2()
-            {
-            }
-
-            virtual void Call(void* event_info)
-            {
-                (m_callee->*m_callback)(this, event_info, m_arg1, m_arg2);
-            }
-
-          private:
-            CbType m_callback;
-            ThisType* m_callee;
-            ArgType1* m_arg1;
-            ArgType2* m_arg2;
-        };
-
-        EvasObjectShared();
-        explicit EvasObjectShared(Evas_Object* object);
-        void SetObject(Evas_Object* object);
-        ~EvasObjectShared();
-
-        template<typename ... Args>
-        IConnection* ConnectSmartCallback(const char* callbackName,
-                typename SmartConnection<Args ...>::CbType callback,
-                Args ... args)
-        {
-            Assert(m_object);
-            Assert(callbackName);
-            Assert(callback);
-            IConnection* connection = new SmartConnection<Args ...>(
-                    callbackName,
-                    callback,
-                    this,
-                    args ...);
-            m_connections.insert(connection);
-            connection->ConnectPrv();
-            return connection;
-        }
-
-        template <class ThisType, class ArgType1, class ArgType2>
-        IConnection* ConnectMemberSmartCallback(
-                const char* callbackName,
-                typename SmartMemberConnection2<ThisType, ArgType1,
-                                                ArgType2>::CbType callback,
-                ThisType* callee,
-                ArgType1* arg1,
-                ArgType2* arg2)
-        {
-            Assert(m_object);
-            Assert(callee);
-            Assert(callbackName);
-            Assert(callback);
-            IConnection* connection =
-                new SmartMemberConnection2<ThisType, ArgType1, ArgType2>(
-                    callbackName,
-                    callback,
-                    callee,
-                    arg1,
-                    arg2,
-                    this);
-            m_connections.insert(connection);
-            connection->ConnectPrv();
-            return connection;
-        }
-
-        template <class ThisType, class ArgType1>
-        IConnection* ConnectMemberSmartCallback(
-                const char* callbackName,
-                typename SmartMemberConnection1<ThisType,
-                                                ArgType1>::CbType callback,
-                ThisType* callee,
-                ArgType1* arg1)
-        {
-            Assert(m_object);
-            Assert(callee);
-            Assert(callbackName);
-            Assert(callback);
-            IConnection* connection =
-                new SmartMemberConnection1<ThisType, ArgType1>(callbackName,
-                                                               callback,
-                                                               callee,
-                                                               arg1,
-                                                               this);
-            m_connections.insert(connection);
-            connection->ConnectPrv();
-            return connection;
-        }
-
-        template <class ArgType1, class ArgType2>
-        IConnection* ConnectEvasCallback(Evas_Callback_Type callbackType,
-                typename EvasConnection2<ArgType1, ArgType2>::CbType callback,
-                ArgType1* arg1,
-                ArgType2* arg2)
-        {
-            Assert(m_object);
-            Assert(callbackType);
-            Assert(callback);
-            IConnection* connection = new EvasConnection2<ArgType1, ArgType2>(
-                    callbackType,
-                    callback,
-                    arg1,
-                    arg2,
-                    this);
-            m_connections.insert(connection);
-            connection->ConnectPrv();
-            return connection;
-        }
-
-        template <class ArgType1>
-        IConnection* ConnectEvasCallback(Evas_Callback_Type callbackType,
-                typename EvasConnection1<ArgType1>::CbType callback,
-                ArgType1* arg1)
-        {
-            Assert(m_object);
-            Assert(callbackType);
-            Assert(callback);
-            IConnection* connection = new EvasConnection1<ArgType1>(
-                    callbackType,
-                    callback,
-                    arg1,
-                    this);
-            m_connections.insert(connection);
-            connection->ConnectPrv();
-            return connection;
-        }
-
-        template <class ThisType, class ArgType1, class ArgType2>
-        IConnection* ConnectMemberEvasCallback(
-                Evas_Callback_Type callbackType,
-                typename EvasMemberConnection2<ThisType, ArgType1,
-                                               ArgType2>::CbType callback,
-                ThisType* callee,
-                ArgType1* arg1,
-                ArgType2* arg2)
-        {
-            Assert(m_object);
-            Assert(callee);
-            Assert(callbackType);
-            Assert(callback);
-            IConnection* connection =
-                new EvasMemberConnection2<ThisType, ArgType1, ArgType2>(
-                    callbackType,
-                    callback,
-                    callee,
-                    arg1,
-                    arg2,
-                    this);
-            m_connections.insert(connection);
-            connection->ConnectPrv();
-            return connection;
-        }
-
-        template <class ThisType, class ArgType1>
-        IConnection* ConnectMemberEvasCallback(
-                Evas_Callback_Type callbackType,
-                typename EvasMemberConnection1<ThisType,
-                                               ArgType1>::CbType callback,
-                ThisType* callee,
-                ArgType1* arg1)
-        {
-            Assert(m_object);
-            Assert(callee);
-            Assert(callbackType);
-            Assert(callback);
-            IConnection* connection =
-                new EvasMemberConnection1<ThisType, ArgType1>(callbackType,
-                                                              callback,
-                                                              callee,
-                                                              arg1,
-                                                              this);
-            m_connections.insert(connection);
-            connection->ConnectPrv();
-            return connection;
-        }
-
-        bool DisconnectCallback(IConnection* connection);
-        void DisconnectAll();
-
-        static void StaticOnDelEvent(void* data,
-                Evas* /*e*/,
-                Evas_Object* /*o*/,
-                void* /*ev*/);
-
-        IConnectionsSet m_connections;
-        Evas_Object* m_object;
-    };
-
-  public:
-    EvasObject();
-    explicit EvasObject(Evas_Object* object);
-    EvasObject(const EvasObject& other);
-    ~EvasObject();
-
-    EvasObject& operator=(const EvasObject& other);
-    EvasObject* operator=(Evas_Object* object);
-
-    operator Evas_Object *();
-
-    bool IsValid() const
-    {
-        Assert(m_object);
-        return m_object->GetObject() != NULL;
-    }
-
-    bool DisconnectCallback(IConnection* connection);
-    void DisconnectAll();
-
-    template <class ... Args>
-    IConnection* ConnectSmartCallback(
-            const char* callbackName,
-            typename EvasObjectShared::SmartConnection<Args ...>::CbType
-            callback,
-            Args ... args)
-    {
-        Assert(m_object);
-        return m_object->ConnectSmartCallback(callbackName, callback, args ...);
-    }
-
-    template <class ThisType, class ArgType1, class ArgType2>
-    IConnection* ConnectMemberSmartCallback(
-            const char* callbackName,
-            typename EvasObjectShared::SmartMemberConnection2<ThisType,
-                                                              ArgType1,
-                                                              ArgType2>::CbType
-            callback,
-            ThisType* callee,
-            ArgType1* arg1,
-            ArgType2* arg2)
-    {
-        Assert(m_object);
-        Assert(callee);
-        Assert(callback);
-        return m_object->ConnectMemberSmartCallback(callbackName,
-                                                    callback,
-                                                    callee,
-                                                    arg1,
-                                                    arg2);
-    }
-
-    template <class ThisType, class ArgType1>
-    IConnection* ConnectMemberSmartCallback(
-            const char* callbackName,
-            typename EvasObjectShared::SmartMemberConnection1<ThisType,
-                                                              ArgType1>::CbType
-            callback,
-            ThisType* callee,
-            ArgType1* arg1)
-    {
-        Assert(m_object);
-        Assert(callee);
-        Assert(callback);
-        return m_object->ConnectMemberSmartCallback(callbackName,
-                                                    callback,
-                                                    callee,
-                                                    arg1);
-    }
-
-    template <class ArgType1, class ArgType2>
-    IConnection* ConnectEvasCallback(
-            Evas_Callback_Type callbackType,
-            typename EvasObjectShared::EvasConnection1<ArgType1>::CbType
-            callback,
-            ArgType1* arg1,
-            ArgType2* arg2)
-    {
-        Assert(m_object);
-        return m_object->ConnectEvasCallback(callbackType, callback, arg1, arg2);
-    }
-
-    template <class ArgType1>
-    IConnection* ConnectEvasCallback(
-            Evas_Callback_Type callbackType,
-            typename EvasObjectShared::EvasConnection1<ArgType1>::CbType
-            callback,
-            ArgType1* arg1)
-    {
-        Assert(m_object);
-        return m_object->ConnectEvasCallback(callbackType, callback, arg1);
-    }
-
-    template <class ThisType, class ArgType1>
-    IConnection* ConnectMemberEvasCallback(
-            Evas_Callback_Type callbackType,
-            typename EvasObjectShared::EvasMemberConnection1<ThisType,
-                                                             ArgType1>::CbType
-            callback,
-            ThisType* callee,
-            ArgType1* arg1)
-    {
-        Assert(m_object);
-        Assert(callee);
-        Assert(callback);
-        return m_object->ConnectMemberEvasCallback(callbackType,
-                                                   callback,
-                                                   callee,
-                                                   arg1);
-    }
-
-    template <class ThisType, class ArgType1, class ArgType2>
-    IConnection* ConnectMemberEvasCallback(
-            Evas_Callback_Type callbackType,
-            typename EvasObjectShared::EvasMemberConnection2<ThisType, ArgType1,
-                                                             ArgType2>::CbType
-            callback,
-            ThisType* callee,
-            ArgType1* arg1,
-            ArgType2* arg2)
-    {
-        Assert(m_object);
-        Assert(callee);
-        Assert(callback);
-        return m_object->ConnectMemberEvasCallback(callbackType,
-                                                   callback,
-                                                   callee,
-                                                   arg1,
-                                                   arg2);
-    }
-
-  private:
-    EvasObjectSharedPtr m_object;
-};
-
-}//namespace
-}//namespace
-
-
-#endif //WRT_SRC_DOMAIN_EFL_EVAS_OBJECT_H
-
diff --git a/modules/popup/include/dpl/popup/popup.h b/modules/popup/include/dpl/popup/popup.h
deleted file mode 100644 (file)
index 84c2c4e..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- *    Licensed under the Apache License, Version 2.0 (the "License");
- *    you may not use this file except in compliance with the License.
- *    You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *    Unless required by applicable law or agreed to in writing, software
- *    distributed under the License is distributed on an "AS IS" BASIS,
- *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *    See the License for the specific language governing permissions and
- *    limitations under the License.
- */
-/*
- * @file        popup.h
- * @author      Lukasz Wrzosek (l.wrzosek@samsung.com)
- * @version     1.0
- * @brief       This is popup inteface declaration
- */
-
-#ifndef WRT_SRC_POPUP_POPUP_H_
-#define WRT_SRC_POPUP_POPUP_H_
-
-#include <memory>
-#include <dpl/assert.h>
-#include <dpl/log/log.h>
-#include <string>
-#include <dpl/optional.h>
-#include <dpl/popup/popup_object.h>
-
-namespace DPL {
-namespace Popup {
-
-struct AnswerCallbackData
-{
-    int buttonAnswer;
-    DPL::Optional<std::string> password;
-    bool chackState;
-};
-
-class PopupManager;
-class IPopup;
-typedef std::shared_ptr<IPopup> IPopupPtr;
-
-class IPopup : public std::enable_shared_from_this<IPopup>
-{
-  public:
-    virtual void SetTitle(const std::string &title) = 0;
-    /*The object is deleted automatically after rendered */
-    virtual void Append(PopupObject::IPopupObject *object) = 0;
-
-  protected:
-    typedef void (*PopupCallbackType)(const AnswerCallbackData& answer,
-                                      void *data);
-    virtual void Show(PopupCallbackType callback,
-            void* data) = 0;
-    virtual ~IPopup()
-    {
-    }
-
-  private:
-    friend class PopupManager;
-    friend class std::shared_ptr<IPopup>;
-};
-
-} // namespace Popup
-} // namespace DPL
-
-#endif //WRT_SRC_POPUP_POPUP_H_
diff --git a/modules/popup/include/dpl/popup/popup_controller.h b/modules/popup/include/dpl/popup/popup_controller.h
deleted file mode 100644 (file)
index 5f2938a..0000000
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- *    Licensed under the Apache License, Version 2.0 (the "License");
- *    you may not use this file except in compliance with the License.
- *    You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *    Unless required by applicable law or agreed to in writing, software
- *    distributed under the License is distributed on an "AS IS" BASIS,
- *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *    See the License for the specific language governing permissions and
- *    limitations under the License.
- */
-/**
- * @file    popup_controller.h
- * @author  Lukasz Wrzosek (l.wrzosek@samsung.com)
- * @version 1.0
- * @bref    Header file for popup controller
- */
-
-/**
- * To display a popup from a given class:
- *
- **class ABC
- **{
- *    void AskUser()
- *    {
- *    }
- *
- *    void DoSomeLogicWithAnswer()
- *    {
- *    }
- **};
- *
- * ... update the class to something simmilar:
- *
- **class ABC : Popup::PopupControllerUser
- **{
- *    void AskUser() {
- *        using namespace Popup;
- *        CtrlPopupPtr popup =
- *                PopupControllerSingletion::Instance().CreatePopup();
- *        popup->SetTitle("Title");
- *        popup->SetContent("Content");
- *        popup->AddButton("name1", 1);
- *        popup->AddButton("name2", 2);
- *        ListenForAnswer(popup);
- *        ShowPopupEvent event(popup,
- *                             MakeAnswerCallback(this,
- *                                                &ABC::DoSomeLogicWithAnswer));
- *        CONTROLLER_POST_EVENT(PopupController, event);
- *    }
- *
- *    void DoSomeLogicWithAnswer(Popup::LabelId answer) {
- *        if (answer == 1)
- *            ;//name1 pressed
- *        else if (answer == 2)
- *            ;//name2 pressed
- *    }
- **};
- **/
-
-#ifndef WRT_SRC_POPUP_CONTROLLER_POPUP_CONTROLLER_H_
-#define WRT_SRC_POPUP_CONTROLLER_POPUP_CONTROLLER_H_
-
-#include <memory>
-#include <dpl/singleton.h>
-#include <dpl/event/controller.h>
-#include <dpl/event/event_listener.h>
-#include <dpl/generic_event.h>
-#include <dpl/mutex.h>
-#include <dpl/exception.h>
-#include <dpl/noncopyable.h>
-#include <dpl/log/log.h>
-#include <dpl/popup/popup_manager.h>
-
-namespace DPL {
-namespace Popup {
-typedef int LabelId;
-
-struct PopupAnswerCallback
-{
-    typedef void (PopupAnswerCallback::*MemberPtr)();
-
-    void* callee;
-    MemberPtr member;
-    void (*callTranslator)(PopupAnswerCallback* callData,
-            const AnswerCallbackData& answer);
-
-    void Call(const AnswerCallbackData& answer)
-    {
-        callTranslator(this, answer);
-    }
-};
-
-class PopupController;
-class CtrlPopup;
-
-typedef std::shared_ptr<CtrlPopup> CtrlPopupPtr;
-
-DECLARE_GENERIC_EVENT_3(PopupAnswerEvent,
-                        CtrlPopupPtr,
-                        PopupAnswerCallback,
-                        AnswerCallbackData)
-
-DECLARE_GENERIC_EVENT_2(ShowPopupEventShort,
-                        CtrlPopupPtr,
-                        PopupAnswerCallback)
-
-class CtrlPopup : public DPL::Event::EventSupport<PopupAnswerEvent>,
-    public std::enable_shared_from_this<CtrlPopup>
-{
-  public:
-    void SetTitle(const std::string &title);
-    void Append(PopupObject::IPopupObject *object);
-
-    ~CtrlPopup();
-  private:
-    friend class PopupController;
-    friend class std::shared_ptr<CtrlPopup>;
-
-    explicit CtrlPopup(IPopupPtr popup);
-    void EmitAnswer(const AnswerCallbackData& answer);
-
-    IPopupPtr m_popup;
-    PopupAnswerCallback m_callback;
-};
-
-class PopupController :
-    public DPL::Event::Controller<DPL::TypeListDecl<ShowPopupEventShort>::Type>
-{
-  public:
-    CtrlPopupPtr CreatePopup() const;
-
-    void setExternalCanvas(void* canvas)
-    {
-        m_canvas = canvas;
-    }
-    void* getExternalCanvas() const
-    {
-        return m_canvas;
-    }
-    void* m_canvas;
-
-  protected:
-    virtual void OnEventReceived(const ShowPopupEventShort& event);
-    PopupController();
-
-  private:
-    static void StaticOnAnswerReceived(const AnswerCallbackData& answer,
-            CtrlPopupPtr* popup);
-};
-
-class PopupControllerUser : DPL::Event::EventListener<PopupAnswerEvent>
-{
-    template <class Type>
-    struct PopupAnswerCallbackCreator
-    {
-        typedef void (Type::*MemberPtr)(const AnswerCallbackData& answer);
-        union Caster
-        {
-            MemberPtr specific;
-            PopupAnswerCallback::MemberPtr generic;
-        };
-
-        static PopupAnswerCallback Create(Type* callee,
-                MemberPtr callback)
-        {
-            PopupAnswerCallback callData;
-
-            callData.callee = callee;
-
-            Caster caster;
-            caster.specific = callback;
-            callData.member = caster.generic;
-
-            callData.callTranslator =
-                &PopupAnswerCallbackCreator::MemberCallbackTranslator;
-
-            return callData;
-        }
-
-        static void MemberCallbackTranslator(PopupAnswerCallback* callData,
-                const AnswerCallbackData& answer)
-        {
-            Type* typedThis = static_cast<Type*>(callData->callee);
-            Caster caster;
-            caster.generic = callData->member;
-            MemberPtr typedCallback = caster.specific;
-            (typedThis->*typedCallback)(answer);
-        }
-    };
-
-  protected:
-    virtual void OnEventReceived(const PopupAnswerEvent& event);
-    void ListenForAnswer(CtrlPopupPtr popup);
-
-    template <class Type>
-    PopupAnswerCallback MakeAnswerCallback(Type* This,
-            void (Type::*callback)
-            (const AnswerCallbackData &))
-    {
-        return PopupAnswerCallbackCreator<Type>::Create(This, callback);
-    }
-};
-
-typedef DPL::Singleton<PopupController> PopupControllerSingleton;
-
-} //namespace Popup
-} //namespace DPL
-
-#endif //WRT_SRC_POPUP_CONTROLLER_POPUP_CONTROLLER_H_
diff --git a/modules/popup/include/dpl/popup/popup_manager.h b/modules/popup/include/dpl/popup/popup_manager.h
deleted file mode 100644 (file)
index 42a4de5..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- *    Licensed under the Apache License, Version 2.0 (the "License");
- *    you may not use this file except in compliance with the License.
- *    You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *    Unless required by applicable law or agreed to in writing, software
- *    distributed under the License is distributed on an "AS IS" BASIS,
- *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *    See the License for the specific language governing permissions and
- *    limitations under the License.
- */
-/*
- * @file        popup_manager.h
- * @author      Lukasz Wrzosek (l.wrzosek@samsung.com)
- * @version     1.0
- * @brief       This is popup_manager declaration file
- */
-
-#ifndef WRT_SRC_POPUP_POPUP_MANAGER_H_
-#define WRT_SRC_POPUP_POPUP_MANAGER_H_
-
-#include <memory>
-#include <dpl/assert.h>
-#include <dpl/noncopyable.h>
-#include <dpl/singleton.h>
-#include <dpl/optional.h>
-#include <dpl/popup/popup.h>
-#include <dpl/popup/popup_renderer.h>
-#include <dpl/log/log.h>
-
-namespace DPL {
-namespace Popup {
-
-class PopupManager : DPL::Noncopyable
-{
-    template <class ArgType>
-    struct TemplatedPopupCallback
-    {
-        typedef void (*Type)(const AnswerCallbackData& answer, ArgType* data);
-    };
-
-  public:
-    PopupManager() : m_initialized(false) {}
-    ~PopupManager()
-    {
-        if (m_initialized) {
-            LogError("Destroyed without Deinitialize");
-        }
-    }
-    void Initialize (PopupRendererPtr creator);
-    void Deinitialize();
-    void SetPopupRenderer (PopupRendererPtr creator);
-    IPopupPtr CreatePopup();
-
-    template <class ArgType>
-    void RunAsyncWithArgType(IPopupPtr popup,
-            typename TemplatedPopupCallback<ArgType>::Type callback,
-            ArgType* argument)
-    {
-        Assert(callback);
-        WrapCbAndArg<ArgType>* wrapped =
-            new WrapCbAndArg<ArgType>(callback, argument);
-        popup->Show(&CallbackArgTypeTranslator<ArgType>, wrapped);
-    }
-
-    void Show(IPopupPtr popup,
-            IPopup::PopupCallbackType callback,
-            void* userdata)
-    {
-        popup->Show(callback, userdata);
-    }
-
-    void setExternalCanvas(void* externalCanvas)
-    {
-        Assert(m_initialized && "Manger should be initialized");
-        m_popupRenderer->setExternalCanvas(externalCanvas);
-    }
-
-  private:
-    template <class ArgType>
-    struct WrapCbAndArg
-    {
-        WrapCbAndArg(typename TemplatedPopupCallback<ArgType>::Type cb,
-                ArgType* arg) :
-            callback(cb),
-            argument(arg)
-        {
-        }
-
-        typename TemplatedPopupCallback<ArgType>::Type callback;
-        ArgType* argument;
-    };
-
-    template <class ArgType>
-    static void CallbackArgTypeTranslator(const AnswerCallbackData & answer,
-            void* data)
-    {
-        WrapCbAndArg<ArgType>* wrapped =
-            static_cast< WrapCbAndArg<ArgType>* >(data);
-        wrapped->callback(answer, wrapped->argument);
-        delete wrapped;
-    }
-
-    bool m_initialized;
-    PopupRendererPtr m_popupRenderer;
-};
-
-typedef DPL::Singleton<Popup::PopupManager> PopupManagerSingleton;
-
-} // namespace Popup
-} // namespace DPL
-
-#endif //WRT_SRC_POPUP_POPUP_MANAGER_H_
diff --git a/modules/popup/include/dpl/popup/popup_object.h b/modules/popup/include/dpl/popup/popup_object.h
deleted file mode 100644 (file)
index 5eddc49..0000000
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- *    Licensed under the Apache License, Version 2.0 (the "License");
- *    you may not use this file except in compliance with the License.
- *    You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *    Unless required by applicable law or agreed to in writing, software
- *    distributed under the License is distributed on an "AS IS" BASIS,
- *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *    See the License for the specific language governing permissions and
- *    limitations under the License.
- */
-/*
- * @file        popup_object.h
- * @author      Justyna Mejzner (j.mejzner@samsung.com)
- * @version     1.0
- * @brief       This is declaration file of PopupObject
- */
-
-#ifndef WRT_SRC_POPUP_POPUPOBJECT_H_
-#define WRT_SRC_POPUP_POPUPOBJECT_H_
-
-#include <dpl/foreach.h>
-
-#include <list>
-#include <string>
-
-namespace DPL {
-namespace Popup {
-
-namespace PopupObject {
-class IPopupObject;
-class PopupObjectBase;
-class Button;
-class Label;
-class Check;
-
-typedef std::list<IPopupObject*> PopupObjects;
-
-enum PopupType
-{
-    BUTTON,
-    LABEL,
-    CHECK
-};
-
-class IPopupObject
-{
-  public:
-    virtual Button* asButton() = 0;
-    virtual Label* asLabel() = 0;
-    virtual Check* asCheck() = 0;
-    virtual PopupType getType() const = 0;
-    virtual ~IPopupObject()
-    {
-    }
-};
-
-class PopupObjectBase : public IPopupObject
-{
-  public:
-    virtual Button* asButton()
-    {
-        Assert("wrong type");
-        return NULL;
-    }
-    virtual Label* asLabel()
-    {
-        Assert("wrong type");
-        return NULL;
-    }
-    virtual Check* asCheck()
-    {
-        Assert("wrong type");
-        return NULL;
-    }
-
-    PopupType getType() const
-    {
-        return m_type;
-    }
-
-  protected:
-    PopupObjectBase(PopupType type) : m_type(type)
-    {
-    }
-
-    PopupType m_type;
-};
-
-class Button : public PopupObjectBase
-{
-  public:
-    Button(const std::string& label,
-            int labelId) :
-        PopupObjectBase(BUTTON),
-        m_label(label),
-        m_labelId(labelId)
-    {
-    }
-
-    Button* asButton()
-    {
-        return this;
-    }
-
-    const std::string& getLabel() const
-    {
-        return m_label;
-    }
-
-    int getLabelId() const
-    {
-        return m_labelId;
-    }
-
-  private:
-    std::string m_label;
-    int m_labelId;
-};
-
-class Label : public PopupObjectBase
-{
-  public:
-    Label(const std::string &label) :
-        PopupObjectBase(LABEL),
-        m_label(label)
-    {
-    }
-
-    Label* asLabel()
-    {
-        return this;
-    }
-
-    const std::string& getLabel() const
-    {
-        return m_label;
-    }
-
-  private:
-    std::string m_label;
-};
-
-class Check : public PopupObjectBase
-{
-  public:
-    Check(const std::string &label) :
-        PopupObjectBase(CHECK),
-        m_checkLabel(label)
-    {
-    }
-
-    Check* asCheck()
-    {
-        return this;
-    }
-
-    const std::string& getCheckLabel() const
-    {
-        return m_checkLabel;
-    }
-
-  private:
-    std::string m_checkLabel;
-};
-} /*PopupObject*/
-
-}//namespace Popup
-}//namespace DPL
-
-#endif //WRT_SRC_POPUP_POPUPOBJECT_H_
diff --git a/modules/popup/include/dpl/popup/popup_renderer.h b/modules/popup/include/dpl/popup/popup_renderer.h
deleted file mode 100644 (file)
index 18d2aab..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- *    Licensed under the Apache License, Version 2.0 (the "License");
- *    you may not use this file except in compliance with the License.
- *    You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *    Unless required by applicable law or agreed to in writing, software
- *    distributed under the License is distributed on an "AS IS" BASIS,
- *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *    See the License for the specific language governing permissions and
- *    limitations under the License.
- */
-/*
- * @file        popup_renderer.h
- * @author      Lukasz Wrzosek (l.wrzosek@samsung.com)
- * @version     1.0
- * @brief       This is declaration file of PopupRenderer
- */
-
-#ifndef WRT_SRC_POPUP_POPUP_RENDERER_H_
-#define WRT_SRC_POPUP_POPUP_RENDERER_H_
-
-#include <map>
-#include <string>
-#include <memory>
-
-#include <dpl/noncopyable.h>
-#include <dpl/log/log.h>
-#include <dpl/assert.h>
-#include <dpl/foreach.h>
-#include <dpl/popup/popup.h>
-
-namespace DPL {
-namespace Popup {
-
-class PopupRenderer : public std::enable_shared_from_this<PopupRenderer>
-{
-  public:
-    PopupRenderer();
-    ~PopupRenderer();
-    void Initialize();
-    void Deinitialize();
-    IPopupPtr CreatePopup();
-    virtual void setExternalCanvas(void* externalCanvas);
-  protected:
-    class Popup;
-    typedef std::shared_ptr<Popup> PopupPtr;
-
-    class Popup : public IPopup
-    {
-      public:
-        typedef std::map<int, std::string> ButtonMap;
-        virtual void SetTitle(const std::string &title)
-        {
-            LogDebug(title);
-            Assert(m_title.empty());
-            m_title = title;
-        }
-
-        virtual void Append(PopupObject::IPopupObject *object)
-        {
-            m_popupObjectList.push_back(object);
-        }
-
-        virtual void Show(IPopup::PopupCallbackType callback,
-                void* data)
-        {
-            Assert(callback);
-            m_data = data;
-            m_callback = callback;
-            m_renderer->Render(std::static_pointer_cast<Popup>(shared_from_this()));
-        }
-
-        const std::string& GetTitle() const
-        {
-            return m_title;
-        }
-
-        PopupObject::PopupObjects& GetPopupObjects()
-        {
-            return m_popupObjectList;
-        }
-
-        virtual ~Popup()
-        {
-            FOREACH(it, m_popupObjectList) {
-                delete *it;
-            }
-        }
-
-      private:
-        friend class PopupRenderer;
-        friend class std::shared_ptr<Popup>;
-        friend class PopupObjectTheme;
-
-        Popup(std::shared_ptr<PopupRenderer> renderer) : m_renderer(renderer)
-        {
-        }
-
-        void ForwardAnswer(const AnswerCallbackData & answer) const
-        {
-            m_callback(answer, m_data);
-        }
-
-        std::string m_title;
-        void* m_data;
-        IPopup::PopupCallbackType m_callback;
-        PopupObject::PopupObjects m_popupObjectList;
-        std::shared_ptr<PopupRenderer> m_renderer;
-    };
-
-  private:
-    void Render (PopupPtr popup);
-
-    class Impl;
-    Impl* m_impl;
-};
-
-typedef std::shared_ptr<PopupRenderer> PopupRendererPtr;
-
-} // namespace Popup
-} // namespace DPL
-
-#endif //WRT_SRC_POPUP_POPUP_RENDERER_H_
diff --git a/modules/popup/src/evas_object.cpp b/modules/popup/src/evas_object.cpp
deleted file mode 100644 (file)
index f95e13b..0000000
+++ /dev/null
@@ -1,240 +0,0 @@
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- *    Licensed under the Apache License, Version 2.0 (the "License");
- *    you may not use this file except in compliance with the License.
- *    You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *    Unless required by applicable law or agreed to in writing, software
- *    distributed under the License is distributed on an "AS IS" BASIS,
- *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *    See the License for the specific language governing permissions and
- *    limitations under the License.
- */
-/*
- * @file        evas_object.cpp
- * @author      Lukasz Wrzosek (l.wrzosel@samsung.com)
- * @version     1.0
- * @brief       This file is the implementation for Evas_Object wrapper from Efl.
- */
-#include <stddef.h>
-#include <dpl/popup/evas_object.h>
-#include <dpl/foreach.h>
-
-namespace DPL {
-namespace Popup {
-
-Evas_Object* EvasObject::IConnection::GetEvasObject()
-{
-    return m_object->GetObject();
-}
-
-void EvasObject::IConnection::Disconnect()
-{
-    m_object->DisconnectCallback(this);
-}
-
-EvasObject::IConnection::IConnection(EvasObject::EvasObjectShared* object) :
-    m_object(object)
-{
-}
-
-void EvasObject::IConnection::SmartCallbackWrapper(void* data,
-        Evas_Object* /*object*/,
-        void* event_info)
-{
-    Assert(data);
-    IConnection* Calle = static_cast<IConnection*>(data);
-    Calle->Call(event_info);
-}
-
-void EvasObject::IConnection::EvasCallbackWrapper(void* data,
-        Evas* /*evas*/,
-        Evas_Object* /*object*/,
-        void* event_info)
-{
-    Assert(data);
-    IConnection* Calle = static_cast<IConnection*>(data);
-    Calle->Call(event_info);
-}
-
-Evas_Object* EvasObject::EvasObjectShared::GetObject()
-{
-    return m_object;
-}
-
-EvasObject::EvasObjectShared::SmartConnectionBase::SmartConnectionBase(
-        const std::string& name,
-        EvasObject::EvasObjectShared* object) :
-    IConnection(object),
-    m_callbackName(name)
-{
-}
-
-void EvasObject::EvasObjectShared::SmartConnectionBase::ConnectPrv()
-{
-    evas_object_smart_callback_add(GetEvasObject(),
-                                   m_callbackName.c_str(),
-                                   &IConnection::SmartCallbackWrapper, this);
-}
-
-void EvasObject::EvasObjectShared::SmartConnectionBase::DisconnectPrv()
-{
-    evas_object_smart_callback_del(GetEvasObject(),
-                                   m_callbackName.c_str(),
-                                   &IConnection::SmartCallbackWrapper);
-}
-
-EvasObject::EvasObjectShared::EvasConnectionBase::EvasConnectionBase(
-        Evas_Callback_Type type,
-        EvasObject::EvasObjectShared* object) :
-    IConnection(object),
-    m_callbackType(type)
-{
-}
-
-void EvasObject::EvasObjectShared::EvasConnectionBase::ConnectPrv()
-{
-    evas_object_event_callback_add(
-        GetEvasObject(), m_callbackType, &IConnection::EvasCallbackWrapper,
-        this);
-}
-
-void EvasObject::EvasObjectShared::EvasConnectionBase::DisconnectPrv()
-{
-    evas_object_event_callback_del_full(
-        GetEvasObject(), m_callbackType, &IConnection::EvasCallbackWrapper,
-        this);
-}
-
-EvasObject::EvasObjectShared::EvasObjectShared() :
-    m_object(NULL)
-{
-}
-
-EvasObject::EvasObjectShared::EvasObjectShared(Evas_Object* object) :
-    m_object(object)
-{
-    Assert(m_object);
-    evas_object_event_callback_add(m_object,
-                                   EVAS_CALLBACK_DEL,
-                                   &StaticOnDelEvent,
-                                   this);
-}
-
-void EvasObject::EvasObjectShared::SetObject(Evas_Object* object)
-{
-    Assert(m_object == NULL);
-    Assert(object != NULL);
-    m_object = object;
-    evas_object_event_callback_add(m_object,
-                                   EVAS_CALLBACK_DEL,
-                                   &StaticOnDelEvent,
-                                   this);
-}
-
-EvasObject::EvasObjectShared::~EvasObjectShared()
-{
-    if (m_object) {
-        DisconnectAll();
-        evas_object_event_callback_del(m_object,
-                                       EVAS_CALLBACK_DEL,
-                                       &StaticOnDelEvent);
-        m_object = NULL;
-    }
-}
-
-bool EvasObject::EvasObjectShared::DisconnectCallback(IConnection* connection)
-{
-    IConnectionsSet::iterator it = m_connections.find(connection);
-    if (it != m_connections.end()) {
-        (*it)->DisconnectPrv();
-        delete connection;
-        m_connections.erase(it);
-        return true;
-    }
-    return false;
-}
-
-void EvasObject::EvasObjectShared::DisconnectAll()
-{
-    FOREACH(it, m_connections)
-    {
-        (*it)->DisconnectPrv();
-        delete *it;
-    }
-    m_connections.clear();
-}
-
-void EvasObject::EvasObjectShared::StaticOnDelEvent(void* data,
-        Evas* /*e*/,
-        Evas_Object* /*o*/,
-        void* /*ev*/)
-{
-    Assert(data);
-    EvasObjectShared* This = static_cast<EvasObjectShared*>(data);
-    if (This->m_object) {
-        evas_object_event_callback_del(This->m_object,
-                                       EVAS_CALLBACK_DEL,
-                                       &StaticOnDelEvent);
-        This->DisconnectAll();
-        This->m_object = NULL;
-    }
-}
-
-EvasObject::EvasObject() :
-    m_object(new EvasObjectShared())
-{
-}
-
-EvasObject::EvasObject(Evas_Object* object) :
-    m_object(new EvasObjectShared(object))
-{
-}
-
-EvasObject::EvasObject(const EvasObject& other) :
-    m_object(other.m_object)
-{
-}
-
-//this destructor must be here to let pimpl with shared_ptr work without warning
-EvasObject::~EvasObject()
-{
-}
-
-EvasObject& EvasObject::operator=(const EvasObject& other)
-{
-    Assert(m_object);
-    m_object = other.m_object;
-    return *this;
-}
-
-EvasObject* EvasObject::operator=(Evas_Object* object)
-{
-    Assert(m_object);
-    m_object->SetObject(object);
-    return this;
-}
-
-bool EvasObject::DisconnectCallback(IConnection* connection)
-{
-    Assert(m_object);
-    return m_object->DisconnectCallback(connection);
-}
-
-void EvasObject::DisconnectAll()
-{
-    Assert(m_object);
-    m_object->DisconnectAll();
-}
-
-EvasObject::operator Evas_Object *()
-{
-    Assert(m_object);
-    return m_object->GetObject();
-}
-
-} // namespace DPL
-} // namespace Popup
diff --git a/modules/popup/src/popup_controller.cpp b/modules/popup/src/popup_controller.cpp
deleted file mode 100644 (file)
index 5bd1cf1..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- *    Licensed under the Apache License, Version 2.0 (the "License");
- *    you may not use this file except in compliance with the License.
- *    You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *    Unless required by applicable law or agreed to in writing, software
- *    distributed under the License is distributed on an "AS IS" BASIS,
- *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *    See the License for the specific language governing permissions and
- *    limitations under the License.
- */
-/**
- * @file    popup_controller.cpp
- * @author  Lukasz Wrzosek (l.wrzosek@samsung.com)
- * @version 1.0
- * @bref    Implementation file for popup controller
- */
-#include <stddef.h>
-#include <dpl/popup/popup_controller.h>
-
-#include <dpl/assert.h>
-#include <dpl/log/log.h>
-#include <dpl/singleton_impl.h>
-IMPLEMENT_SINGLETON(DPL::Popup::PopupController)
-
-namespace DPL {
-namespace Popup {
-
-void CtrlPopup::SetTitle(const std::string &title)
-{
-    Assert(m_popup);
-    m_popup->SetTitle(title);
-}
-
-void CtrlPopup::Append(PopupObject::IPopupObject *object)
-{
-    Assert(m_popup);
-    m_popup->Append(object);
-}
-
-CtrlPopup::CtrlPopup(IPopupPtr popup) :
-    m_popup(popup),
-    m_callback()
-{
-    Assert(m_popup);
-}
-
-CtrlPopup::~CtrlPopup()
-{
-}
-
-void CtrlPopup::EmitAnswer(const AnswerCallbackData & answer)
-{
-    AnswerCallbackData l_answer = answer;
-    PopupAnswerEvent event(shared_from_this(), m_callback, l_answer);
-    DPL::Event::EventSupport<PopupAnswerEvent>::EmitEvent(event);
-}
-
-PopupController::PopupController() : m_canvas(NULL)
-{
-}
-
-CtrlPopupPtr PopupController::CreatePopup() const
-{
-    return CtrlPopupPtr(
-               new CtrlPopup(PopupManagerSingleton::Instance().CreatePopup()));
-}
-
-void PopupController::OnEventReceived(const ShowPopupEventShort& event)
-{
-    CtrlPopupPtr popup = event.GetArg0();
-    popup->m_callback = event.GetArg1();
-
-    //pass canvas from controller to manager
-    //canvas is not passed earlier because value wasn't set properly
-    PopupManagerSingleton::Instance().setExternalCanvas(getExternalCanvas());
-
-    PopupManagerSingleton::Instance().RunAsyncWithArgType(
-        popup->m_popup,
-        &PopupController::StaticOnAnswerReceived,
-        new CtrlPopupPtr(popup));
-}
-
-void PopupController::StaticOnAnswerReceived(const AnswerCallbackData & answer,
-        CtrlPopupPtr* popup)
-{
-    Assert(popup != NULL);
-    (*popup)->EmitAnswer(answer);
-    delete popup; // Just SharedPtr is destroyed, not the popup itself
-}
-
-void PopupControllerUser::OnEventReceived(const PopupAnswerEvent& event)
-{
-    //Here we are in a proper context to call the callback
-    PopupAnswerCallback answerCall = event.GetArg1();
-    AnswerCallbackData answer = event.GetArg2();
-    answerCall.Call(answer);
-    event.GetArg0()->DPL::Event::EventSupport<PopupAnswerEvent>::RemoveListener(this);
-}
-
-void PopupControllerUser::ListenForAnswer(CtrlPopupPtr popup)
-{
-    popup->DPL::Event::EventSupport<PopupAnswerEvent>::AddListener(this);
-}
-} //namespace Popup
-} //namespace DPL
diff --git a/modules/popup/src/popup_manager.cpp b/modules/popup/src/popup_manager.cpp
deleted file mode 100644 (file)
index a6fa465..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- *    Licensed under the Apache License, Version 2.0 (the "License");
- *    you may not use this file except in compliance with the License.
- *    You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *    Unless required by applicable law or agreed to in writing, software
- *    distributed under the License is distributed on an "AS IS" BASIS,
- *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *    See the License for the specific language governing permissions and
- *    limitations under the License.
- */
-/*
- * @file        popup_manager.cpp
- * @author      Lukasz Wrzosek (l.wrzosek@samsung.com)
- * @version     1.0
- * @brief       This is popup_manager implementation file
- */
-#include <stddef.h>
-#include <dpl/popup/popup_manager.h>
-#include <dpl/popup/popup.h>
-#include <dpl/log/log.h>
-#include <dpl/assert.h>
-#include <dpl/singleton_impl.h>
-
-IMPLEMENT_SINGLETON(DPL::Popup::PopupManager)
-
-namespace DPL {
-namespace Popup {
-
-void PopupManager::Initialize(PopupRendererPtr renderer)
-{
-    Assert(!m_initialized);
-    m_popupRenderer = renderer;
-    m_popupRenderer->Initialize();
-    m_initialized = true;
-}
-
-void PopupManager::Deinitialize()
-{
-    m_popupRenderer->Deinitialize();
-    Assert(m_initialized);
-    m_popupRenderer.reset();
-    m_initialized = false;
-}
-
-IPopupPtr PopupManager::CreatePopup()
-{
-    Assert(m_initialized);
-    return m_popupRenderer->CreatePopup();
-}
-
-} // namespace Popup
-} // namespace DPL
diff --git a/modules/popup/src/popup_renderer.cpp b/modules/popup/src/popup_renderer.cpp
deleted file mode 100644 (file)
index 411c709..0000000
+++ /dev/null
@@ -1,415 +0,0 @@
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- *    Licensed under the Apache License, Version 2.0 (the "License");
- *    you may not use this file except in compliance with the License.
- *    You may obtain a copy of the License at
- *
- *        http://www.apache.org/licenses/LICENSE-2.0
- *
- *    Unless required by applicable law or agreed to in writing, software
- *    distributed under the License is distributed on an "AS IS" BASIS,
- *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *    See the License for the specific language governing permissions and
- *    limitations under the License.
- */
-/*
- * @file        popup_renderer.cpp
- * @author      Lukasz Wrzosek (l.wrzosek@samsung.com)
- * @version     1.0
- * @brief       This is efl specific implementation for PopupRenderer
- */
-#include <stddef.h>
-#include <dpl/popup/popup_manager.h>
-#include <dpl/popup/popup_renderer.h>
-#include <dpl/popup/popup_manager.h>
-#include <dpl/popup/evas_object.h>
-#include <dpl/scoped_array.h>
-#include <dpl/assert.h>
-#include <dpl/log/log.h>
-#include <dpl/foreach.h>
-#include <dpl/framework_efl.h>
-#include <dpl/lexical_cast.h>
-#include <queue>
-
-namespace DPL {
-
-namespace {
-using namespace Popup;
-const char* EDJ_NAME = "/usr/share/edje/ace/generic_popup.edj";
-const char* POPUP_LAYOUT1 = "popup_layout1";
-const char* POPUP_LAYOUT2 = "popup_layout2";
-const char* POPUP_PART_TITLE = "title,text";
-const char* POPUP_PART_BUTTON1 = "button1";
-const char* POPUP_PART_BUTTON2 = "button2";
-const char* POPUP_PART_BUTTON3 = "button3";
-const char* BUTTON_CLICKED_CALLBACK_NAME = "clicked";
-const char* CHANGED_CALLBACK_NAME = "changed";
-const unsigned int MAX_NUMBER_OF_VERTICAL = 2;
-
-Evas_Object* create_layout_main(Evas_Object* parent, int totalV)
-{
-    Evas_Object *layout = elm_layout_add(parent);
-
-    if (totalV == 1) {
-        elm_layout_file_set(layout, EDJ_NAME, POPUP_LAYOUT1);
-    } else if (totalV == 2) {
-        elm_layout_file_set(layout, EDJ_NAME, POPUP_LAYOUT2);
-    } else {
-        Assert("popup needs define new group in the edc");
-    }
-
-    evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND,
-                                     EVAS_HINT_EXPAND);
-    return layout;
-}
-} //namespace
-
-namespace Popup {
-class PopupRenderer::Impl
-{
-  public:
-    Impl() :
-        m_popupsToRender(),
-        m_current(),
-        m_initialized(false)
-    {
-    }
-
-    ~Impl()
-    {
-        if (m_initialized) {
-            LogError("Destroyed without Deinitialize");
-        }
-    }
-
-    void Initialize()
-    {
-        Assert(!m_initialized);
-        m_initialized = true;
-    }
-
-    void Deinitialize()
-    {
-        Assert(m_initialized);
-        m_current.reset();
-        while (!m_popupsToRender.empty()) {
-            m_popupsToRender.pop();
-        }
-        m_initialized = false;
-    }
-
-    void ButtonCallback(EvasObject::IConnection* /*connection*/,
-            void* /*event_info*/,
-            void* data)
-    {
-        LogInfo("ButtonCallback");
-        Assert(m_initialized);
-        AnswerCallbackData answerData;
-
-        answerData.buttonAnswer = reinterpret_cast<int>(data);
-        answerData.chackState = m_checkState;
-        answerData.password = m_password;
-        m_current->ForwardAnswer(answerData);
-        m_current.reset();
-
-        FOREACH(it, m_createdObjects)
-        {
-            if (it->IsValid()) {
-                evas_object_del(*it);
-            }
-        }
-        m_createdObjects.clear();
-        m_checkState = false;
-        DoRender();
-    }
-
-    void CheckCallback(EvasObject::IConnection* connection,
-            void* /*event_info*/,
-            void* /* unused */)
-    {
-        m_checkState =
-            elm_check_state_get(connection->GetEvasObject());
-    }
-
-    void Render (PopupPtr popup)
-    {
-        Assert(m_initialized);
-        m_popupsToRender.push(popup);
-        DoRender();
-    }
-
-    void DoRender(const PopupObject::Label& object,
-            EvasObject& parent,
-            EvasObject& layout,
-            int themeIndex)
-    {
-        EvasObject label(elm_label_add(parent));
-
-        elm_object_style_set(label, "popup_description/default");
-        elm_label_line_wrap_set(label, ELM_WRAP_WORD);
-        elm_object_text_set(label, object.getLabel().c_str());
-        evas_object_size_hint_weight_set(label, EVAS_HINT_EXPAND, 0.0);
-        evas_object_size_hint_align_set(label, EVAS_HINT_FILL, EVAS_HINT_FILL);
-        evas_object_show(label);
-
-        elm_object_part_content_set(
-            layout,
-            DPL::lexical_cast<std::string>(themeIndex).c_str(),
-            label);
-        m_createdObjects.push_back(label);
-    }
-
-    void DoRender(const PopupObject::Check& object,
-            EvasObject& parent,
-            EvasObject& layout,
-            int themeIndex)
-    {
-        EvasObject check(elm_check_add(parent));
-
-        evas_object_size_hint_align_set(check, EVAS_HINT_FILL, EVAS_HINT_FILL);
-        evas_object_size_hint_weight_set(check, EVAS_HINT_EXPAND, 0.0);
-        elm_object_text_set(check,
-                            object.getCheckLabel().c_str());
-        elm_object_part_content_set(
-            layout,
-            DPL::lexical_cast<std::string>(themeIndex).c_str(),
-            check);
-
-        check.ConnectMemberSmartCallback(CHANGED_CALLBACK_NAME,
-                                         &Impl::CheckCallback,
-                                         this,
-                                         static_cast<void*>(NULL));
-        evas_object_show(check);
-        m_createdObjects.push_back(check);
-    }
-
-    void DoRender(const PopupObject::Button& object,
-            EvasObject &parent)
-    {
-        EvasObject btn(elm_button_add(parent));
-
-        elm_object_text_set(btn, object.getLabel().c_str());
-        elm_object_part_content_set(parent, POPUP_PART_BUTTON1, btn);
-        btn.ConnectMemberSmartCallback(BUTTON_CLICKED_CALLBACK_NAME,
-                                       &Impl::ButtonCallback,
-                                       this,
-                                       reinterpret_cast<void*>(object.getLabelId()));
-        m_createdObjects.push_back(btn);
-    }
-
-    void DoRender(const PopupObject::Button& object1,
-            const PopupObject::Button& object2,
-            EvasObject &parent)
-    {
-        DoRender(object1, parent);
-
-        EvasObject btn2(elm_button_add(parent));
-
-        elm_object_text_set(btn2, object2.getLabel().c_str());
-        elm_object_part_content_set(parent, POPUP_PART_BUTTON2, btn2);
-        btn2.ConnectMemberSmartCallback(BUTTON_CLICKED_CALLBACK_NAME,
-                                        &Impl::ButtonCallback,
-                                        this,
-                                        reinterpret_cast<void*>(object2.getLabelId()));
-        m_createdObjects.push_back(btn2);
-    }
-
-    void DoRender(const PopupObject::Button& object1,
-            const PopupObject::Button& object2,
-            const PopupObject::Button& object3,
-            EvasObject &parent)
-    {
-        DoRender(object1, object2, parent);
-
-        EvasObject btn3(elm_button_add(parent));
-
-        elm_object_text_set(btn3, object3.getLabel().c_str());
-        elm_object_part_content_set(parent, POPUP_PART_BUTTON3, btn3);
-        btn3.ConnectMemberSmartCallback(BUTTON_CLICKED_CALLBACK_NAME,
-                                        &Impl::ButtonCallback,
-                                        this,
-                                        reinterpret_cast<void*>(object3.getLabelId()));
-        m_createdObjects.push_back(btn3);
-    }
-
-    EvasObject getBaseObject()
-    {
-        if (getExternalCanvas() == NULL) {
-            LogInfo("Create old style popup");
-            EvasObject win(elm_win_add(NULL, "Popup", ELM_WIN_DIALOG_BASIC));
-            elm_win_borderless_set(win, EINA_TRUE);
-            elm_win_alpha_set(win, EINA_TRUE);
-            elm_win_raise(win);
-            {
-                int w, h, x, y;
-                ecore_x_window_geometry_get(ecore_x_window_root_first_get(),
-                                            &x,
-                                            &y,
-                                            &w,
-                                            &h);
-                evas_object_resize(win, w, h);
-                evas_object_move(win, x, y);
-            }
-            m_createdObjects.push_back(win);
-            evas_object_show(win);
-            return win;
-        } else {
-            LogInfo("Create new style popup");
-            EvasObject win(getExternalCanvas());
-            evas_object_show(win);
-            return win;
-        }
-    }
-
-    void DoRender()
-    {
-        if (!m_current && !m_popupsToRender.empty()) {
-            m_current = m_popupsToRender.front();
-            m_popupsToRender.pop();
-
-            m_themeIndexV = 0;
-
-            // preprocessing
-            std::vector<int> countPopupObjects = {0 /* PopupObject::BUTTON */,
-                                                  0 /* PopupObject::LABEL */,
-                                                  0 /* PopupObject::CHECK */};
-            FOREACH(it, m_current->GetPopupObjects()) {
-                Assert((*it)->getType() < countPopupObjects.size() &&
-                    "Wrong PopupObject assigned");
-                countPopupObjects[(*it)->getType()]++;
-            }
-            int needsIndexV = countPopupObjects[PopupObject::LABEL] +
-                countPopupObjects[PopupObject::CHECK];
-
-            EvasObject win = getBaseObject();
-            EvasObject main(elm_popup_add(win));
-
-            evas_object_size_hint_weight_set(main,
-                                             EVAS_HINT_EXPAND,
-                                             EVAS_HINT_EXPAND);
-            elm_object_part_text_set(main,
-                                     POPUP_PART_TITLE,
-                                     m_current->GetTitle().c_str());
-
-            m_createdObjects.push_back(main);
-            std::vector<PopupObject::Button> buttonObjectList;
-            EvasObject layout(create_layout_main(main, needsIndexV));
-            m_createdObjects.push_back(layout);
-
-            FOREACH(it, m_current->GetPopupObjects()) {
-                switch ((*it)->getType()) {
-                case PopupObject::BUTTON:
-                    buttonObjectList.push_back(*(*it)->asButton());
-                    break;
-                case PopupObject::LABEL:
-                    DoRender(*(*it)->asLabel(),
-                             main,
-                             layout,
-                             m_themeIndexV++);
-                    break;
-                case PopupObject::CHECK:
-                    DoRender(*(*it)->asCheck(),
-                             main,
-                             layout,
-                             m_themeIndexV++);
-                    break;
-                default:
-                    Assert("incorrect type");
-                }
-                Assert(m_themeIndexV <= MAX_NUMBER_OF_VERTICAL);
-            }
-            elm_object_content_set(main,
-                                   layout);
-
-            // show buution
-            switch(buttonObjectList.size()) {
-            case 0:
-                LogInfo("no button");
-                break;
-            case 1:
-                DoRender(buttonObjectList.at(0),
-                         main);
-                break;
-            case 2:
-                DoRender(buttonObjectList.at(0),
-                         buttonObjectList.at(1),
-                         main);
-                break;
-            case 3:
-                DoRender(buttonObjectList.at(0),
-                         buttonObjectList.at(1),
-                         buttonObjectList.at(2),
-                         main);
-                break;
-            default:
-                Assert("incorrect button number");
-                break;
-            }
-
-            evas_object_show(main);
-        }
-    }
-
-    void setExternalCanvas(void* externalCanvas)
-    {
-        m_externalCanvas = static_cast<Evas_Object*>(externalCanvas);
-    }
-
-    Evas_Object* getExternalCanvas() const
-    {
-        return m_externalCanvas;
-    }
-
-    std::queue<PopupPtr> m_popupsToRender;
-    std::list<EvasObject> m_createdObjects;
-    PopupPtr m_current;
-    bool m_initialized;
-    bool m_checkState;
-    DPL::Optional<std::string> m_password;
-    unsigned int m_themeIndexV;
-
-  private:
-    Evas_Object* m_externalCanvas;
-};
-
-PopupRenderer::PopupRenderer()
-{
-    m_impl = new PopupRenderer::Impl();
-}
-
-PopupRenderer::~PopupRenderer()
-{
-    delete m_impl;
-}
-
-void PopupRenderer::Initialize()
-{
-    Assert(m_impl);
-    m_impl->Initialize();
-}
-
-void PopupRenderer::Deinitialize()
-{
-    Assert(m_impl);
-    m_impl->Deinitialize();
-}
-
-IPopupPtr PopupRenderer::CreatePopup()
-{
-    return std::static_pointer_cast<IPopup>(IPopupPtr
-                                              (new Popup(shared_from_this())));
-}
-
-void PopupRenderer::Render(PopupPtr popup)
-{
-    m_impl->Render(popup);
-}
-
-void PopupRenderer::setExternalCanvas(void* externalCanvas)
-{
-    m_impl->setExternalCanvas(externalCanvas);
-}
-
-} // namespace Popup
-} // namespace DPL
index d481aa5d471e3883055ac469d015ae4faebf1cb2..c9c6ea4fe32d53318ee8616739128ebb6587b5b1 100644 (file)
  * @version     1.0
  * @brief       Implementation file some concrete TestResulstsCollector
  */
-#include <stddef.h>
+#include <cstddef>
 #include <dpl/test/test_results_collector.h>
 #include <dpl/colors.h>
 #include <dpl/assert.h>
 #include <dpl/foreach.h>
 #include <dpl/scoped_fclose.h>
+#include <dpl/exception.h>
+#include <dpl/errno_string.h>
 
 #include <string>
 #include <string.h>
@@ -80,11 +82,11 @@ class Statistic
         }
     }
 
-    size_t GetTotal() const { return m_count; }
-    size_t GetPassed() const { return m_passed; }
-    size_t GetSuccesed() const { return m_passed; }
-    size_t GetFailed() const { return m_failed; }
-    size_t GetIgnored() const { return m_ignored; }
+    std::size_t GetTotal() const { return m_count; }
+    std::size_t GetPassed() const { return m_passed; }
+    std::size_t GetSuccesed() const { return m_passed; }
+    std::size_t GetFailed() const { return m_failed; }
+    std::size_t GetIgnored() const { return m_ignored; }
     float GetPassedOrIgnoredPercend() const
     {
         float passIgnoredPercent =
@@ -95,10 +97,10 @@ class Statistic
     }
 
   private:
-    size_t m_failed;
-    size_t m_ignored;
-    size_t m_passed;
-    size_t m_count;
+    std::size_t m_failed;
+    std::size_t m_ignored;
+    std::size_t m_passed;
+    std::size_t m_count;
 };
 
 class ConsoleCollector
@@ -387,19 +389,39 @@ class XmlCollector
 
     virtual void CollectCurrentTestGroupName(const std::string& name)
     {
-        std::string groupHeader;
-        groupHeader.append("\n\t<testsuite name=\"");
-        groupHeader.append(EscapeSpecialCharacters(name));
-        groupHeader.append("\">\n\t\t<testcase name=\"unknown\" status=\"FAILED\">\n");
-        groupHeader.append("\t\t\t<failure type=\"FAILED\" message=\"segmentation fault\"/>\n");
-        groupHeader.append("\t\t</testcase>\n\t</testsuite>");
-        size_t pos = m_outputBuffer.find("</testsuites>");
-        m_outputBuffer.insert(pos - 1, groupHeader);
-        m_currentGroup = name;
-        fseek(m_fp.Get(), 0L, SEEK_SET);
-        fprintf(m_fp.Get(), "%s", m_outputBuffer.c_str());
-        fflush(m_fp.Get());
+        std::size_t pos = GetCurrentGroupPosition();
+        if (std::string::npos != pos)
+        {
+            GroupFinish(pos);
+            FlushOutput();
+            m_stats = Statistic();
+        }
+
+        pos = m_outputBuffer.find("</testsuites>");
+        if (std::string::npos == pos)
+        {
+            ThrowMsg(DPL::Exception, "Could not find test suites closing tag");
+        }
+        GroupStart(pos, name);
+    }
+
+    void GroupStart(const std::size_t pos, const std::string& name)
+    {
+        std::stringstream groupHeader;
+        groupHeader << "\n\t<testsuite";
+        groupHeader << " name=\"" << EscapeSpecialCharacters(name) << "\"";
+        groupHeader << R"( tests="1")"; // include SegFault
+        groupHeader << R"( failures="1")"; // include SegFault
+        groupHeader << R"( skipped="0")";
+        groupHeader << ">";
+
+        groupHeader << "\n\t\t<testcase name=\"unknown\" status=\"FAILED\">";
+        groupHeader << "\n\t\t\t<failure type=\"FAILED\" message=\"segmentation fault\"/>";
+        groupHeader << "\n\t\t</testcase>";
+
+        groupHeader << "\n\t</testsuite>";
 
+        m_outputBuffer.insert(pos - 1, groupHeader.str());
     }
 
     virtual bool Configure()
@@ -423,31 +445,17 @@ class XmlCollector
         Assert(!!m_fp && "File handle must not be null");
         m_outputBuffer.append("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n");
         m_outputBuffer.append("<testsuites>\n</testsuites>");
-        fseek(m_fp.Get(), 0L, SEEK_SET);
-        fprintf(m_fp.Get(), "%s", m_outputBuffer.c_str());
-        fflush(m_fp.Get());
-
+        FlushOutput();
     }
 
     virtual void Finish()
     {
-        // Show result
-        FOREACH(group, m_groupsStats) {
-            PrintStats(group->first, group->second);
-            size_t posBegin = m_outputBuffer.find("<testcase name=\"unknown\"");
-            size_t posEnd = m_outputBuffer.find("</testcase>", posBegin);
-            m_outputBuffer.erase(posBegin - 3, posEnd - posBegin + sizeof("</testcase>") + 2);
+        std::size_t pos = GetCurrentGroupPosition();
+        if (std::string::npos != pos)
+        {
+            GroupFinish(pos);
+            FlushOutput();
         }
-
-        if(remove(m_filename.c_str())!=0){
-            LogError("Can't remove file. Error: " << strerror(errno));
-        }
-
-        m_fp.Reset(fopen (m_filename.c_str(), "w"));
-        Assert(!!m_fp && "File handle must not be null");
-        fseek(m_fp.Get(), 0L, SEEK_SET);
-        fprintf(m_fp.Get(),"%s", m_outputBuffer.c_str());
-        fflush(m_fp.Get());
     }
 
     virtual bool ParseCollectorSpecificArg(const std::string& arg)
@@ -469,7 +477,7 @@ class XmlCollector
                 m_resultBuffer.append(" status=\"OK\"/>\n");
                 break;
             case TestResultsCollectorBase::FailStatus::FAILED:
-                m_resultBuffer.append(" status=\"FAILED\">\n\t\t\t<failure");
+                m_resultBuffer.append(" status=\"FAILED\">\n");
                 PrintfErrorMessage("FAILED", EscapeSpecialCharacters(reason), true);
                 m_resultBuffer.append("\t\t</testcase>\n");
                 break;
@@ -479,22 +487,138 @@ class XmlCollector
                 m_resultBuffer.append("\t\t</testcase>\n");
                 break;
             case TestResultsCollectorBase::FailStatus::INTERNAL:
-                m_resultBuffer.append(" status=\"INTERNAL\">\n\t\t\t<failure");
+                m_resultBuffer.append(" status=\"FAILED\">\n");
                 PrintfErrorMessage("INTERNAL", EscapeSpecialCharacters(reason), true);
                 m_resultBuffer.append("\t\t</testcase>");
                 break;
             default:
                 Assert(false && "Bad status");
         }
-        size_t group_pos = m_outputBuffer.find(m_currentGroup);
-        size_t last_case_pos = m_outputBuffer.find("<testcase name=\"unknown\"", group_pos);
+        std::size_t group_pos = GetCurrentGroupPosition();
+        if (std::string::npos == group_pos)
+        {
+            ThrowMsg(DPL::Exception, "No current group set");
+        }
+
+        std::size_t last_case_pos = m_outputBuffer.find("<testcase name=\"unknown\"", group_pos);
+        if (std::string::npos == last_case_pos)
+        {
+            ThrowMsg(DPL::Exception, "Could not find SegFault test case");
+        }
         m_outputBuffer.insert(last_case_pos - 2, m_resultBuffer);
-        fseek(m_fp.Get(), 0L, SEEK_SET);
-        fprintf(m_fp.Get(), "%s", m_outputBuffer.c_str());
-        fflush(m_fp.Get());
-        m_groupsStats[m_currentGroup].AddTest(status);
+
         m_stats.AddTest(status);
 
+        UpdateGroupHeader(group_pos,
+                          m_stats.GetTotal() + 1, // include SegFault
+                          m_stats.GetFailed() + 1, // include SegFault
+                          m_stats.GetIgnored());
+        FlushOutput();
+    }
+
+    std::size_t GetCurrentGroupPosition() const
+    {
+        return m_outputBuffer.rfind("<testsuite ");
+    }
+
+    void UpdateGroupHeader(const std::size_t groupPosition,
+                           const unsigned int tests,
+                           const unsigned int failures,
+                           const unsigned int skipped)
+    {
+        UpdateElementAttribute(groupPosition, "tests", UIntToString(tests));
+        UpdateElementAttribute(groupPosition, "failures", UIntToString(failures));
+        UpdateElementAttribute(groupPosition, "skipped", UIntToString(skipped));
+    }
+
+    void UpdateElementAttribute(const std::size_t elementPosition,
+                                const std::string& name,
+                                const std::string& value)
+    {
+        std::string pattern = name + "=\"";
+
+        std::size_t start = m_outputBuffer.find(pattern, elementPosition);
+        if (std::string::npos == start)
+        {
+            ThrowMsg(DPL::Exception, "Could not find attribute " << name << " beginning");
+        }
+
+        std::size_t end = m_outputBuffer.find("\"", start + pattern.length());
+        if (std::string::npos == end)
+        {
+            ThrowMsg(DPL::Exception, "Could not find attribute " << name << " end");
+        }
+
+        m_outputBuffer.replace(start + pattern.length(),
+                               end - start - pattern.length(),
+                               value);
+    }
+
+    std::string UIntToString(const unsigned int value)
+    {
+        std::stringstream result;
+        result << value;
+        return result.str();
+    }
+
+    void GroupFinish(const std::size_t groupPosition)
+    {
+        std::size_t segFaultStart =
+                m_outputBuffer.find("<testcase name=\"unknown\"", groupPosition);
+        if (std::string::npos == segFaultStart)
+        {
+            ThrowMsg(DPL::Exception, "Could not find SegFault test case start position");
+        }
+        segFaultStart -= 2; // to erase tabs
+
+        std::string closeTag = "</testcase>";
+        std::size_t segFaultEnd = m_outputBuffer.find(closeTag, segFaultStart);
+        if (std::string::npos == segFaultEnd)
+        {
+            ThrowMsg(DPL::Exception, "Could not find SegFault test case end position");
+        }
+        segFaultEnd += closeTag.length() + 1; // to erase new line
+
+        m_outputBuffer.erase(segFaultStart, segFaultEnd - segFaultStart);
+
+        UpdateGroupHeader(groupPosition,
+                          m_stats.GetTotal(),
+                          m_stats.GetFailed(),
+                          m_stats.GetIgnored());
+    }
+
+    void FlushOutput()
+    {
+        int fd = fileno(m_fp.Get());
+        if (-1 == fd)
+        {
+            int error = errno;
+            ThrowMsg(DPL::Exception, DPL::GetErrnoString(error));
+        }
+
+        if (-1 == TEMP_FAILURE_RETRY(ftruncate(fd, 0L)))
+        {
+            int error = errno;
+            ThrowMsg(DPL::Exception, DPL::GetErrnoString(error));
+        }
+
+        if (-1 == TEMP_FAILURE_RETRY(fseek(m_fp.Get(), 0L, SEEK_SET)))
+        {
+            int error = errno;
+            ThrowMsg(DPL::Exception, DPL::GetErrnoString(error));
+        }
+
+        if (0 > fprintf(m_fp.Get(), m_outputBuffer.c_str()))
+        {
+            int error = errno;
+            ThrowMsg(DPL::Exception, DPL::GetErrnoString(error));
+        }
+
+        if (-1 == TEMP_FAILURE_RETRY(fflush(m_fp.Get())))
+        {
+            int error = errno;
+            ThrowMsg(DPL::Exception, DPL::GetErrnoString(error));
+        }
     }
 
     void PrintfErrorMessage(const char* type,
@@ -502,7 +626,7 @@ class XmlCollector
                             bool verbosity)
     {
         if (verbosity) {
-            m_resultBuffer.append(" type=\"");
+            m_resultBuffer.append("\t\t\t<failure type=\"");
             m_resultBuffer.append(EscapeSpecialCharacters(type));
             m_resultBuffer.append("\" message=\"");
             m_resultBuffer.append(EscapeSpecialCharacters(message));
@@ -510,7 +634,7 @@ class XmlCollector
 
         } else {
 
-            m_resultBuffer.append(" type=\"");
+            m_resultBuffer.append("\t\t\t<failure type=\"");
             m_resultBuffer.append(EscapeSpecialCharacters(type));
             m_resultBuffer.append("\"/>\n");
         }
@@ -534,26 +658,9 @@ class XmlCollector
         }
     }
 
-    void PrintStats(const std::string& name, const Statistic& stats)
-    {
-        std::stringstream totalStats;
-        totalStats << " tests=\"";
-        totalStats << stats.GetTotal();
-        totalStats << "\" failures=\"";
-        totalStats << stats.GetFailed();
-        totalStats << "\" skipped=\"";
-        totalStats << stats.GetIgnored();
-        totalStats << "\"";
-        std::string suiteHeader;
-        suiteHeader.append("<testsuite name=\"");
-        suiteHeader.append(EscapeSpecialCharacters(name));
-        size_t pos = m_outputBuffer.find(suiteHeader);
-        m_outputBuffer.insert(pos+suiteHeader.size()+1,totalStats.str());
-    }
-
     std::string EscapeSpecialCharacters(std::string s)
     {
-        for(unsigned int i = 0; i < s.size();){
+        for (unsigned int i = 0; i < s.size();) {
             switch(s[i]){
             case '"':
                 s.erase(i,1);
@@ -595,8 +702,6 @@ class XmlCollector
     std::string m_filename;
     ScopedFClose m_fp;
     Statistic m_stats;
-    std::string m_currentGroup;
-    std::map<std::string, Statistic> m_groupsStats;
     std::string m_outputBuffer;
     std::string m_resultBuffer;
 };
index 8465b6e9cc5413b12e60265ddb2e0332735fbe4f..e217f8b6cfe1aca70d332483c8ac7feeda43f9aa 100644 (file)
@@ -1,7 +1,7 @@
-#git:framework/web/wrt-commons wrt-commons 0.2.91
+#git:framework/web/wrt-commons wrt-commons 0.2.92
 Name:       wrt-commons
 Summary:    Wrt common library
-Version:    0.2.91
+Version:    0.2.92
 Release:    1
 Group:      Development/Libraries
 License:    Apache License, Version 2.0
index 75ff334aa39bf40eef4890d4f7a487f1b82f7eed..350431c8445e503049c5c411693dd23bef837ec9 100644 (file)
@@ -20,7 +20,6 @@
 
 # common part
 FILE(GLOB DAO_TESTS_SOURCES "${PROJECT_SOURCE_DIR}/tests/dao/*DAO.cpp")
-MESSAGE(STATUS "DAO_TESTS_SOURCES: ${DAO_TESTS_SOURCES}")
 
 # target wrt-tests-dao
 SET(TARGET_DAO_TEST "wrt-tests-dao")