Added the All window list
authorChoi Munseok <ms47.choi@samsung.com>
Wed, 10 Jul 2013 13:24:19 +0000 (22:24 +0900)
committerChoi Munseok <ms47.choi@samsung.com>
Wed, 10 Jul 2013 13:24:19 +0000 (22:24 +0900)
Change-Id: I6c2f7a840a5195f82c87740470f4e29685cdc6cd
Signed-off-by: Choi Munseok <ms47.choi@samsung.com>
src/ui/FUi_ControlManager.cpp
src/ui/FUi_EcoreEvas.cpp
src/ui/FUi_Window.cpp
src/ui/inc/FUi_ControlManager.h

index 56a7b96..648ecc3 100644 (file)
@@ -304,6 +304,7 @@ _ControlManager::GetLogicalBaseScreenSize(void) const
 
 _ControlManager::_ControlManager(void) // [ToDo] exception check.
        : __pWindowList(null)
+       , __pAllWindowList(null)
        , __isCoordinateSystemLogical(true)
        , __logicalCoordinateSystem(0)
        , __logicalBaseScreenSize(BASE_SCREEN_SIZE_NONE)
@@ -343,6 +344,9 @@ _ControlManager::_ControlManager(void) // [ToDo] exception check.
        __pWindowList = new (std::nothrow)LinkedListT<_Window*>;
        SysTryCatch(NID_UI, __pWindowList, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
 
+       __pAllWindowList = new (std::nothrow)LinkedListT<_Window*>;
+       SysTryCatch(NID_UI, __pAllWindowList, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
+
        __pGestureList = new (std::nothrow)LinkedListT<_TouchGestureDetector*>;
        SysTryCatch(NID_UI, __pGestureList, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
 
@@ -365,6 +369,12 @@ CATCH:
                __pWindowList = null;
        }
 
+       if (__pAllWindowList)
+       {
+               delete __pAllWindowList;
+               __pAllWindowList = null;
+       }
+
        if (__pGestureList)
        {
                delete __pGestureList;
@@ -382,6 +392,12 @@ _ControlManager::~_ControlManager(void)
                __pWindowList = null;
        }
 
+       if (__pAllWindowList)
+       {
+               delete __pAllWindowList;
+               __pAllWindowList = null;
+       }
+
        if (__pGestureList)
        {
                delete __pGestureList;
@@ -789,6 +805,27 @@ _ControlManager::GetWindowCount(void) const
        return __pWindowList->GetCount();
 }
 
+_Window*
+_ControlManager::GetAllWindow(int index) const
+{
+       _Window* pWindow;
+       __pAllWindowList->GetAt(index, pWindow);
+
+       return pWindow;
+}
+
+int
+_ControlManager::GetAllWindowCount(void) const
+{
+       return __pAllWindowList->GetCount();
+}
+
+result
+_ControlManager::DetachAllWindow(_Window& window)
+{
+       return __pAllWindowList->Remove(&window);
+}
+
 result
 _ControlManager::AttachWindow(_Window& window)
 {
@@ -815,6 +852,8 @@ _ControlManager::AttachWindow(_Window& window)
                }
        }
 
+       __pAllWindowList->Add(&window);
+
        return __pWindowList->Add(&window);
 }
 
index 32ffc40..7d4546b 100644 (file)
@@ -111,10 +111,10 @@ OnWindowStateChanged(Ecore_Evas* pEcoreEvas)
 
        SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x] OnWindowStateChanged is called.", targetWin);
 
-       int winCount = pControlManager->GetWindowCount();
+       int winCount = pControlManager->GetAllWindowCount();
        for (int i = 0; i < winCount; i++)
        {
-               _Window* pWindow = pControlManager->GetWindow(i);
+               _Window* pWindow = pControlManager->GetAllWindow(i);
                if (!pWindow)
                {
                        continue;
index 501280a..ac9160c 100644 (file)
@@ -109,6 +109,8 @@ _Window::~_Window(void)
        __pDimmingLayer = null;
 
        __pRootVisualElement =NULL;
+
+       _ControlManager::GetInstance()->DetachAllWindow(*this);
 }
 
 _IWindowDelegate&
index 8795cd3..f63957f 100644 (file)
@@ -133,6 +133,10 @@ public:
        result AddControlManagerEventListener(_IControlManagerEventListener& listener);
        result RemoveControlManagerEventListener(_IControlManagerEventListener& listener);
 
+       _Window* GetAllWindow(int index) const;
+       int GetAllWindowCount(void) const;
+       result DetachAllWindow(_Window& window);
+
 private:
        ~_ControlManager(void);
        _ControlManager(void);
@@ -165,6 +169,7 @@ private:
 private:
        Tizen::Base::_ObjectManagerT <_Control> __objectManager;
        Tizen::Base::Collection::LinkedListT<_Window*>* __pWindowList;
+       Tizen::Base::Collection::LinkedListT<_Window*>* __pAllWindowList;
 
        bool __isCoordinateSystemLogical;
        int __logicalCoordinateSystem;