Changed to get prefer ROT
[platform/framework/native/uifw.git] / src / ui / FUi_EcoreEvas.cpp
index 32ffc40..2f69919 100644 (file)
@@ -109,12 +109,12 @@ OnWindowStateChanged(Ecore_Evas* pEcoreEvas)
 
        Ecore_X_Window targetWin = (Ecore_X_Window) ecore_evas_window_get(pEcoreEvas);
 
-       SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x] OnWindowStateChanged is called.", targetWin);
+       SysLog(NID_UI, "[WM ROTATION][WIN 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;
@@ -1201,7 +1201,7 @@ _EcoreEvas::_EcoreEvas(void)
        , __openClipboard(false)
 {
        int ret = appcore_unset_rotation_cb();
-       SysLog(NID_UI, "[Window Manager Rotation] appcore_unset_rotation_cb = %d", ret);
+       SysLog(NID_UI, "[WM ROTATION] appcore_unset_rotation_cb = %d", ret);
 
        __pWindowVisibilityChanged = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_VISIBILITY_CHANGE, OnWindowVisibilityChanged, (void*) this);
        SysTryReturnVoidResult(NID_UI, __pWindowVisibilityChanged, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
@@ -1356,7 +1356,6 @@ _EcoreEvas::RotateWindow(const _Window& window, int orientation, bool rotateEvas
                rotatePartial = false;
        }
 
-       Evas_Object* pWinObj = pLayer->GetElmWin();
        Ecore_X_Window win = (Ecore_X_Window) ecore_evas_window_get(pEcoreEvas);
 
        int rootW = 0;
@@ -1369,18 +1368,17 @@ _EcoreEvas::RotateWindow(const _Window& window, int orientation, bool rotateEvas
                {
                        ecore_evas_rotation_with_resize_set(pEcoreEvas, orientation);
 
-                       evas_object_move(pWinObj, 0, 0);
 
                        if ((orientation == 0) || (orientation == 180))
                        {
-                               evas_object_resize(pWinObj, rootW, rootH);
+                               pLayer->SetBounds(FloatRectangle(0, 0, rootW, rootH));
                        }
                        else
                        {
-                               evas_object_resize(pWinObj, rootH, rootW);
+                               pLayer->SetBounds(FloatRectangle(0, 0, rootH, rootW));
                        }
 
-                       SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x, FULL SCREEN] Rotate bounds(rot = %d).", win, orientation);
+                       SysLog(NID_UI, "[WM ROTATION][WIN 0x%x, FULL SCREEN] Rotate bounds(ROT %d).", win, orientation);
                }
        }
        else
@@ -1393,7 +1391,6 @@ _EcoreEvas::RotateWindow(const _Window& window, int orientation, bool rotateEvas
                Rectangle winBounds = _CoordinateSystemUtils::Transform(window.GetBounds());
                int rotate = ecore_evas_rotation_get(pEcoreEvas);
 
-
                int winX = winBounds.x;
                int winY = winBounds.y;
 
@@ -1421,16 +1418,16 @@ _EcoreEvas::RotateWindow(const _Window& window, int orientation, bool rotateEvas
                int h = 0;
                Eina_Bool ret = ecore_x_e_window_rotation_geometry_get(win, rotate, &x, &y, &w, &h);
 
-               evas_object_move(pWinObj, winX, winY);
 
                if (ret == EINA_FALSE)
                {
-                       evas_object_resize(pWinObj, winBounds.width, winBounds.height);
-                       SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x, PARTIAL SCREEN] Rotate bounds(rot = %d, %d, %d, %d, %d).", win, orientation, winX, winY, winBounds.width, winBounds.height);
+                       pLayer->SetBounds(FloatRectangle(winX, winY, winBounds.width, winBounds.height));
+                       SysLog(NID_UI, "[WM ROTATION][WIN 0x%x, PARTIAL SCREEN] Rotate bounds(ROT %d, %d, %d, %d, %d).", win, orientation, winX, winY, winBounds.width, winBounds.height);
                }
                else
                {
-                       SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x, PARTIAL SCREEN] Rotate bounds(rot = %d, %d, %d) ONLY MOVE.", win, orientation, winX, winY);
+                       pLayer->SetBounds(FloatRectangle(winX, winY, w, h));
+                       SysLog(NID_UI, "[WM ROTATION][WIN 0x%x, PARTIAL SCREEN] Rotate bounds(ROT %d, %d, %d) ONLY MOVE.", win, orientation, winX, winY);
                }
        }
 }
@@ -1544,7 +1541,7 @@ _EcoreEvas::SetOwner(NativeWindowHandle ownee, NativeWindowHandle owner)
        {
                ecore_x_icccm_transient_for_unset(ownee);
                ecore_x_icccm_transient_for_set(ownee, owner);
-               SysLog(NID_UI, "[Window Order Group][Window : 0x%x] transient_for_set -> 0x%x", ownee, owner);
+               SysLog(NID_UI, "[WIN ORDER][WIN 0x%x] transient_for_set -> 0x%x", ownee, owner);
        }
 }
 
@@ -2282,20 +2279,24 @@ _EcoreEvas::SetWindowLevel(const _Window& window, _WindowLevel level)
 
        Ecore_X_Window win = (Ecore_X_Window) ecore_evas_window_get(pEcoreEvas);
        ecore_x_icccm_transient_for_unset(win);
+       SysLog(NID_UI, "[WIN ORDER][WIN 0x%x] transient_for_unset", win);
 
        if (level == _WINDOW_LEVEL_NORMAL)
        {
                ecore_x_netwm_window_type_set(win, ECORE_X_WINDOW_TYPE_NORMAL);
+               SysLog(NID_UI, "[WIN ORDER][WIN 0x%x] set : ECORE_X_WINDOW_TYPE_NORMAL", win);
        }
        else if (level == _WINDOW_LEVEL_NOTIFICATION_HIGH)
        {
                ecore_x_netwm_window_type_set(win, ECORE_X_WINDOW_TYPE_NOTIFICATION);
                utilx_set_system_notification_level((Display*)ecore_x_display_get(), win, UTILX_NOTIFICATION_LEVEL_HIGH);
+               SysLog(NID_UI, "[WIN ORDER][WIN 0x%x] set : ECORE_X_WINDOW_TYPE_NOTIFICATION, UTILX_NOTIFICATION_LEVEL_HIGH", win);
        }
        else if (level == _WINDOW_LEVEL_NOTIFICATION_MIDDLE)
        {
                ecore_x_netwm_window_type_set(win, ECORE_X_WINDOW_TYPE_NOTIFICATION);
                utilx_set_system_notification_level((Display*)ecore_x_display_get(), win, UTILX_NOTIFICATION_LEVEL_NORMAL);
+               SysLog(NID_UI, "[WIN ORDER][WIN 0x%x] set : ECORE_X_WINDOW_TYPE_NOTIFICATION, UTILX_NOTIFICATION_LEVEL_NORMAL", win);
        }
 
        SetLastResult(E_SUCCESS);
@@ -2411,16 +2412,16 @@ _EcoreEvas::SetWindowBounds(const _Window& window, const Rectangle& bounds)
        int h = 0;
        Eina_Bool ret = ecore_x_e_window_rotation_geometry_get(win, rotate, &x, &y, &w, &h);
 
-       evas_object_move(pWinObject, winX, winY);
 
        if (ret == EINA_FALSE)
        {
-               evas_object_resize(pWinObject, winBounds.width, winBounds.height);
-               SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x] Set bounds(rot = %d, %d, %d, %d, %d).", win, rotate, winX, winY, winBounds.width, winBounds.height);
+               pLayer->SetBounds(FloatRectangle(winX, winY, winBounds.width, winBounds.height));
+               SysLog(NID_UI, "[WM ROTATION][WIN 0x%x] Set bounds(ROT %d, %d, %d, %d, %d).", win, rotate, winX, winY, winBounds.width, winBounds.height);
        }
        else
        {
-               SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x] Set bounds(rot = %d, %d, %d) ONLY MOVE.", win, rotate, winX, winY);
+               pLayer->SetBounds(FloatRectangle(winX, winY, w, h));
+               SysLog(NID_UI, "[WM ROTATION][WIN 0x%x] Set bounds(ROT %d, %d, %d, %d, %d) ONLY MOVE.", win, rotate, winX, winY, w, h);
        }
 
        SetLastResult(E_SUCCESS);
@@ -2499,16 +2500,16 @@ _EcoreEvas::SetWindowBounds(const _Window& window, const FloatRectangle& bounds)
        int h = 0;
        Eina_Bool ret = ecore_x_e_window_rotation_geometry_get(win, rotate, &x, &y, &w, &h);
 
-       evas_object_move(pWinObject, winX, winY);
 
        if (ret == EINA_FALSE)
        {
-               evas_object_resize(pWinObject, winBounds.width, winBounds.height);
-               SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x] Set bounds(rot = %d, %d, %d, %d, %d).", win, rotate, winX, winY, winBounds.width, winBounds.height);
+               pLayer->SetBounds(FloatRectangle(winX, winY, winBounds.width, winBounds.height));
+               SysLog(NID_UI, "[WM ROTATION][WIN 0x%x] Set bounds(ROT %d, %d, %d, %d, %d).", win, rotate, winX, winY, winBounds.width, winBounds.height);
        }
        else
        {
-               SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x] Set bounds(rot = %d, %d, %d) ONLY MOVE.", win, rotate, winX, winY);
+               pLayer->SetBounds(FloatRectangle(winX, winY, w, h));
+               SysLog(NID_UI, "[WM ROTATION][WIN 0x%x] Set bounds(ROT %d, %d, %d, %d, %d) ONLY MOVE.", win, rotate, winX, winY, w, h);
        }
 
        SetLastResult(E_SUCCESS);
@@ -2552,12 +2553,12 @@ _EcoreEvas::SetOwner(const _Window& ownee, const _Control& owner)
                {
                        ecore_x_icccm_transient_for_unset(owneeWin);
                        ecore_x_icccm_transient_for_set(owneeWin, ownerWin);
-                       SysLog(NID_UI, "[Window Order Group][Window : 0x%x] transient_for_set -> 0x%x", owneeWin, ownerWin);
+                       SysLog(NID_UI, "[WIN ORDER][WIN 0x%x] transient_for_set -> 0x%x", owneeWin, ownerWin);
                }
        }
        else
        {
-               SysLog(NID_UI, "[Window Order Group][Window : 0x%x] Skip to transient_for_set", owneeWin);
+               SysLog(NID_UI, "[WIN ORDER][WIN 0x%x] Skip to transient_for_set", owneeWin);
        }
 
        // Ownee window
@@ -2583,7 +2584,9 @@ _EcoreEvas::SetOwner(const _Window& ownee, const _Control& owner)
                bool preferredRoation = pOwnerWindow->GetPreferredRotation();
                if (preferredRoation == true)
                {
-                       int preferredRotation = ecore_evas_wm_rotation_preferred_rotation_get(pOwnerLayer->GetEcoreEvas());
+                       //int preferredRotation = ecore_evas_wm_rotation_preferred_rotation_get(pOwnerLayer->GetEcoreEvas());
+                       int preferredRotation = 0;
+                       ecore_x_e_window_rotation_preferred_rotation_get(ownerWin, &preferredRotation);
                        SetWindowPreferredRotation(ownee, preferredRotation);
                }
                else
@@ -2628,7 +2631,7 @@ _EcoreEvas::SetWindowPreferredRotation(const _Window& window, int rotation, bool
        {
                ecore_x_e_window_rotation_app_set(win, EINA_TRUE);
        }
-       SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x] Set window preferred rotation(%d).", win, rotation);
+       SysLog(NID_UI, "[WM ROTATION][WIN 0x%x] Set window preferred rotation(%d).", win, rotation);
        ecore_evas_wm_rotation_preferred_rotation_set(pLayer->GetEcoreEvas(), rotation);
 
        _Window* pWindow = const_cast<_Window*>(&window);
@@ -2677,7 +2680,7 @@ _EcoreEvas::SetWindowAvailabledRotation(const _Window& window, int* rotations, u
                ecore_x_e_window_rotation_app_set(win, EINA_TRUE);
        }
 
-       SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x] Set window available rotation(%d).", win, count);
+       SysLog(NID_UI, "[WM ROTATION][WIN 0x%x] Set window available rotation(%d).", win, count);
        ecore_evas_wm_rotation_available_rotations_set(pLayer->GetEcoreEvas(), rotations, count);
 }
 
@@ -2705,7 +2708,7 @@ _EcoreEvas::SetWindowRotationBounds(const _Window& window, int rotation, const T
        Rectangle winBounds = _CoordinateSystemUtils::Transform(bounds);
 
        Ecore_X_Window win = (Ecore_X_Window) ecore_evas_window_get(pLayer->GetEcoreEvas());
-       SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x] Set rotation bounds(rot = %d, %d, %d, %d, %d).", win, rotation, winBounds.x, winBounds.y, winBounds.width, winBounds.height);
+       SysLog(NID_UI, "[WM ROTATION][WIN 0x%x] Set rotation bounds(ROT %d, %d, %d, %d, %d).", win, rotation, winBounds.x, winBounds.y, winBounds.width, winBounds.height);
        ecore_x_e_window_rotation_geometry_set(win, rotation, winBounds.x, winBounds.y, winBounds.width, winBounds.height);
 }
 
@@ -2722,7 +2725,7 @@ _EcoreEvas::SetWindowRotationBounds(const _Window& window, int rotation, const T
        Rectangle winBounds = _CoordinateSystemUtils::ConvertToInteger(winBoundsF);
 
        Ecore_X_Window win = (Ecore_X_Window) ecore_evas_window_get(pLayer->GetEcoreEvas());
-       SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x] Set rotation bounds(rot = %d, %d, %d, %d, %d).", win, rotation, winBounds.x, winBounds.y, winBounds.width, winBounds.height);
+       SysLog(NID_UI, "[WM ROTATION][WIN 0x%x] Set rotation bounds(ROT %d, %d, %d, %d, %d).", win, rotation, winBounds.x, winBounds.y, winBounds.width, winBounds.height);
        ecore_x_e_window_rotation_geometry_set(win, rotation, winBounds.x, winBounds.y, winBounds.width, winBounds.height);
 }