From 56d9e412ed12ddafa44b00004bbe78d0e6719237 Mon Sep 17 00:00:00 2001 From: Keuckdo Bang Date: Wed, 27 Mar 2013 10:36:33 +0900 Subject: [PATCH] Frame is made by full screen. Change-Id: I57a83c018c70ebbf64ed0501bffd9cc792c58f3b --- src/ui/FUi_EcoreEvas.cpp | 54 +++++++++++++++++++++++++++++++++++ src/ui/FUi_Window.cpp | 2 +- src/ui/controls/FUiCtrl_FrameImpl.cpp | 6 ++-- src/ui/inc/FUi_EcoreEvas.h | 2 ++ src/ui/inc/FUi_Window.h | 2 +- 5 files changed, 61 insertions(+), 5 deletions(-) diff --git a/src/ui/FUi_EcoreEvas.cpp b/src/ui/FUi_EcoreEvas.cpp index 1bbcd83..8a0360d 100644 --- a/src/ui/FUi_EcoreEvas.cpp +++ b/src/ui/FUi_EcoreEvas.cpp @@ -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); diff --git a/src/ui/FUi_Window.cpp b/src/ui/FUi_Window.cpp index e3cc7a4..fcecddc 100644 --- a/src/ui/FUi_Window.cpp +++ b/src/ui/FUi_Window.cpp @@ -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."); diff --git a/src/ui/controls/FUiCtrl_FrameImpl.cpp b/src/ui/controls/FUiCtrl_FrameImpl.cpp index 23089d8..7177ed4 100644 --- a/src/ui/controls/FUiCtrl_FrameImpl.cpp +++ b/src/ui/controls/FUiCtrl_FrameImpl.cpp @@ -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)); } } diff --git a/src/ui/inc/FUi_EcoreEvas.h b/src/ui/inc/FUi_EcoreEvas.h index 3cd4036..2e1d9ab 100644 --- a/src/ui/inc/FUi_EcoreEvas.h +++ b/src/ui/inc/FUi_EcoreEvas.h @@ -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); diff --git a/src/ui/inc/FUi_Window.h b/src/ui/inc/FUi_Window.h index 48d2d51..3e9f5ee 100644 --- a/src/ui/inc/FUi_Window.h +++ b/src/ui/inc/FUi_Window.h @@ -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) -- 2.7.4