Frame is made by full screen.
authorKeuckdo Bang <keuckdo.bang@samsung.net>
Wed, 27 Mar 2013 01:36:33 +0000 (10:36 +0900)
committerGerrit Code Review <gerrit2@kim11>
Wed, 27 Mar 2013 10:32:34 +0000 (19:32 +0900)
Change-Id: I57a83c018c70ebbf64ed0501bffd9cc792c58f3b

src/ui/FUi_EcoreEvas.cpp
src/ui/FUi_Window.cpp
src/ui/controls/FUiCtrl_FrameImpl.cpp
src/ui/inc/FUi_EcoreEvas.h
src/ui/inc/FUi_Window.h

index 1bbcd83..8a0360d 100644 (file)
@@ -2182,6 +2182,60 @@ _EcoreEvas::SetWindowBounds(const _Window& window, const Rectangle& bounds)
 }
 
 void
+_EcoreEvas::SetWindowBounds(const _Window& window, const FloatRectangle& bounds)
+{
+       if (__changeBounds == false)
+       {
+               return;
+       }
+
+       _EflLayer* pLayer = GetEflLayer(window);
+       SysTryReturnVoidResult(NID_UI, pLayer, E_INVALID_ARG, "[E_INVALID_ARG] The window doesn't have a elf layer.");
+
+       Ecore_Evas* pEcoreEvas = pLayer->GetEcoreEvas();
+       Ecore_X_Window win = (Ecore_X_Window) ecore_evas_window_get(pEcoreEvas);
+
+       Evas_Object* pWinObject = pLayer->GetElmWin();
+       SysTryReturnVoidResult(NID_UI, pWinObject, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
+
+       FloatRectangle winBoundsF = _CoordinateSystemUtils::Transform(bounds);
+       Rectangle winBounds = _CoordinateSystemUtils::ConvertToInteger(winBoundsF);
+
+       int winX = winBounds.x;
+       int winY = winBounds.y;
+
+       int rootW = 0;
+       int rootH = 0;
+       ecore_x_window_size_get(ecore_x_window_root_get(win), &rootW, &rootH);
+
+       int rotate = ecore_evas_rotation_get(pEcoreEvas);
+       switch (rotate)
+       {
+       case 270:
+               winX = rootW - winBounds.y - winBounds.height;
+               winY = winBounds.x;
+               break;
+       case 90:
+               winX = winBounds.y;
+               winY = rootH - winBounds.x - winBounds.width;
+               break;
+       case 180:
+               winX = rootW - winBounds.x - winBounds.width;
+               winY = rootH - winBounds.y - winBounds.height;
+               break;
+       default:
+               break;
+       }
+
+       evas_object_move(pWinObject, winX, winY);
+       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);
+
+       SetLastResult(E_SUCCESS);
+}
+
+void
 _EcoreEvas::SetWindowVisibleState(const _Window& window, bool visibleState)
 {
        _EflLayer* pLayer = GetEflLayer(window);
index e3cc7a4..fcecddc 100644 (file)
@@ -466,7 +466,7 @@ _Window::OnOwnerChanged(_Control* pOldOwner)
 }
 
 result
-_Window::OnBoundsChanging(const Rectangle& bounds)
+_Window::OnBoundsChanging(const FloatRectangle& bounds)
 {
        _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
        SysTryReturn(NID_UI, pEcoreEvas, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
index 23089d8..7177ed4 100644 (file)
@@ -231,7 +231,7 @@ _FrameImpl::CreateFrameImplN(Frame* pPublic)
        r = _ControlImpl::CheckConstruction(pCore, pImpl);
        SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
 
-       pCore->SetSize(_ControlManager::GetInstance()->GetScreenSize());
+       pCore->SetSize(_ControlManager::GetInstance()->GetScreenSizeF());
 
        pCore->AddFrameEventListener(*pImpl);
 
@@ -300,7 +300,7 @@ _FrameImpl::OnChangeLayout(_ControlOrientation orientation)
 
        _ControlManager* pCoreManager = _ControlManager::GetInstance();
        SysAssert(pCoreManager);
-       const Dimension& screenSize = pCoreManager->GetScreenSize();
+       const FloatDimension& screenSize = pCoreManager->GetScreenSizeF();
 
        if (GetCore().GetShowMode() == FRAME_SHOW_MODE_FULL_SCREEN)
        {
@@ -310,7 +310,7 @@ _FrameImpl::OnChangeLayout(_ControlOrientation orientation)
                }
                else
                {
-                       SetSize(Dimension(screenSize.height, screenSize.width));
+                       SetSize(FloatDimension(screenSize.height, screenSize.width));
                }
        }
 
index 3cd4036..2e1d9ab 100644 (file)
@@ -40,6 +40,7 @@ class _IActiveWindowEventListener;
 namespace Tizen { namespace Graphics
 {
 class Rectangle;
+class FloatRectangle;
 }} // Tizen::Graphics
 
 namespace Tizen { namespace Ui { namespace Animations
@@ -125,6 +126,7 @@ public:
        void SetWindowLevel(const _Window& window, _WindowLevel level);
        _WindowLevel GetWindowLevel(const _Window& window) const;
        void SetWindowBounds(const _Window& window, const Tizen::Graphics::Rectangle& bounds);
+       void SetWindowBounds(const _Window& window, const Tizen::Graphics::FloatRectangle& bounds);
        void SetWindowVisibleState(const _Window& window, bool visibleState);
        void AllowSetWindowBounds(bool allow);
        bool IsWindowVisible(const _Window& window);
index 48d2d51..3e9f5ee 100644 (file)
@@ -85,7 +85,7 @@ public:
        virtual void OnOwnerChanged(_Control* pOldOwner);
        virtual void OnVisibleStateChanged(void);
        virtual bool OnNotifiedN(const Tizen::Ui::_Control& source, Tizen::Base::Collection::IList* pArgs);
-       virtual result OnBoundsChanging(const Tizen::Graphics::Rectangle& bounds);
+       virtual result OnBoundsChanging(const Tizen::Graphics::FloatRectangle& bounds);
        virtual result OnAttachingToMainTree(const _Control* pParent);
        virtual result OnDetachingFromMainTree(void);
 #if defined(WINDOW_BASE_ROTATE)