fix checking logic to get valid size of overlaypanel(JIRA ISSUE : N_SE-29663, N_SE...
authorwoo <s-w.woo@samsung.com>
Fri, 22 Mar 2013 12:48:50 +0000 (21:48 +0900)
committerwoo <s-w.woo@samsung.com>
Fri, 22 Mar 2013 12:48:59 +0000 (21:48 +0900)
Change-Id: I31968616c22fb79c7d55d9fe05e5f4852fcf9bbb
Signed-off-by: woo <s-w.woo@samsung.com>
src/ui/controls/FUiCtrl_OverlayAgent.cpp
src/ui/controls/FUiCtrl_OverlayPanel.cpp
src/ui/controls/FUiCtrl_OverlayPanelImpl.cpp
src/ui/inc/FUiCtrl_OverlayAgent.h

index 21ca3c0..f95966e 100644 (file)
@@ -43,11 +43,7 @@ extern "C"{
 #include <Ecore_Evas.h>
 
 #include <FBaseResult.h>
-#include <FGrpBufferInfo.h>
-#include <FGrpRectangle.h>
-#include <FGrpFloatRectangle.h>
 #include <FUiIOrientationEventListener.h>
-
 #include <FGrp_BufferInfoImpl.h>
 #include <FGrp_Screen.h>
 #include <FIo_RegistryImpl.h>
index 9e727e1..2d67a12 100644 (file)
@@ -298,8 +298,6 @@ void
 _OverlayPanel::OnBoundsChanged(void)
 {
        SysTryReturnVoidResult(NID_UI_CTRL, __pOverlayAgent != null, E_SYSTEM, "[E_SYSTEM] OverlayAgent must not be null.");
-
-       //To do
 }
 
 void
index 9950f1b..817b22d 100644 (file)
 #include <FUiCtrlOverlayPanel.h>
 
 #include <FIo_RegistryImpl.h>
-#include <FGrp_Screen.h>
+#include <FGrpCoordinateSystem.h>
 #include <FSys_EnvironmentImpl.h>
 #include "FUi_CoordinateSystemUtils.h"
+#include "FUi_ControlManager.h"
 #include "FUi_ResourceSizeInfo.h"
 #include "FUi_UiBuilder.h"
 #include "FUiCtrl_OverlayAgent.h"
 #include "FUiCtrl_OverlayPanelImpl.h"
 
-
 using namespace Tizen::Base;
 using namespace Tizen::Base::Collection;
 using namespace Tizen::Graphics;
@@ -63,22 +63,22 @@ _OverlayPanelImpl::OverlayPanelSizeInfo::GetDefaultMinimumSize(_ControlOrientati
 Dimension
 _OverlayPanelImpl::OverlayPanelSizeInfo::GetDefaultMaximumSize(_ControlOrientation orientation) const
 {
-       Dimension screenSize = Dimension(_Screen::GetWidth(), _Screen::GetHeight());
-       Dimension overlayPanelMaxSize = screenSize;
+       Dimension overlayPanelMaxSize = CoordinateSystem::GetLogicalResolution();
 
-       if (orientation == _CONTROL_ORIENTATION_LANDSCAPE)
+       if (orientation == _CONTROL_ORIENTATION_PORTRAIT)
        {
-               overlayPanelMaxSize.width = screenSize.height;
-               overlayPanelMaxSize.height = screenSize.width;
+               return overlayPanelMaxSize;
+       }
+       else
+       {
+               return Dimension(overlayPanelMaxSize.height, overlayPanelMaxSize.width);
        }
-
-       return overlayPanelMaxSize;
 }
 
 _OverlayPanelImpl*
 _OverlayPanelImpl::CreateOverlayPanelImplN(OverlayPanel* pPublic, const Rectangle& bounds)
 {
-       result r = GET_SIZE_INFO(OverlayPanel).CheckInitialSizeValid(Dimension(bounds.width, bounds.height), _CONTROL_ORIENTATION_PORTRAIT);
+       result r = GET_SIZE_INFO(OverlayPanel).CheckInitialSizeValid(Dimension(bounds.width, bounds.height), _ControlManager::GetInstance()->GetOrientation());
        SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, E_INVALID_ARG, "[E_INVALID_ARG] The size of overlay panel(%d, %d) is invalid.", bounds.width, bounds.height);
 
        _OverlayPanel* pCore = _OverlayPanel::CreateOverlayPanelN();
@@ -89,7 +89,7 @@ _OverlayPanelImpl::CreateOverlayPanelImplN(OverlayPanel* pPublic, const Rectangl
        r = _ControlImpl::CheckConstruction(pCore, pImpl.get());
        SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
 
-       r = pImpl->InitializeBoundsProperties(GET_SIZE_INFO(OverlayPanel), bounds, _CONTROL_ORIENTATION_PORTRAIT);
+       r = pImpl->InitializeBoundsProperties(GET_SIZE_INFO(OverlayPanel), bounds, _ControlManager::GetInstance()->GetOrientation());
        SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
 
        return pImpl.release();
@@ -98,7 +98,7 @@ _OverlayPanelImpl::CreateOverlayPanelImplN(OverlayPanel* pPublic, const Rectangl
 _OverlayPanelImpl*
 _OverlayPanelImpl::CreateOverlayPanelImplN(OverlayPanel* pPublic, const FloatRectangle& bounds)
 {
-       result r = GET_SIZE_INFO(OverlayPanel).CheckInitialSizeValid(Dimension(bounds.width, bounds.height), _CONTROL_ORIENTATION_PORTRAIT);
+       result r = GET_SIZE_INFO(OverlayPanel).CheckInitialSizeValid(Dimension(bounds.width, bounds.height), _ControlManager::GetInstance()->GetOrientation());
        SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, E_INVALID_ARG, "[E_INVALID_ARG] The size of overlay panel(%d, %d) is invalid.", bounds.width, bounds.height);
 
        _OverlayPanel* pCore = _OverlayPanel::CreateOverlayPanelN();
@@ -109,7 +109,7 @@ _OverlayPanelImpl::CreateOverlayPanelImplN(OverlayPanel* pPublic, const FloatRec
        r = _ControlImpl::CheckConstruction(pCore, pImpl.get());
        SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
 
-       r = pImpl->InitializeBoundsPropertiesF(GET_SIZE_INFO(OverlayPanel), bounds, _CONTROL_ORIENTATION_PORTRAIT);
+       r = pImpl->InitializeBoundsPropertiesF(GET_SIZE_INFO(OverlayPanel), bounds, _ControlManager::GetInstance()->GetOrientation());
        SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, null, r, "[%s] Propagating.", GetErrorMessage(r));
 
        return pImpl.release();
index f09e2cf..ca0c4fa 100644 (file)
 #include <Ecore_X.h>
 
 #include <FBaseDataType.h>
-
-namespace Tizen { namespace Base
-{
-class ByteBuffer;
-}} // Tizen::Base
-
-namespace Tizen { namespace Graphics
-{
-class BufferInfo;
-class Dimension;
-class Rectangle;
-}} // Tizen::Graphics
-
-namespace Tizen { namespace Ui
-{
-class _Controls;
-}} // Tizen::Ui
+#include <FBaseByteBuffer.h>
+#include <FGrpBufferInfo.h>
+#include <FGrpDimension.h>
+#include <FGrpRectangle.h>
+#include <FGrpFloatRectangle.h>
 
 namespace Tizen { namespace Ui { namespace Animations
 {