Rollback code about quichpanel.
authorKeuckdo Bang <keuckdo.bang@samsung.net>
Sun, 14 Apr 2013 08:33:26 +0000 (17:33 +0900)
committerKeuckdo Bang <keuckdo.bang@samsung.net>
Sun, 14 Apr 2013 08:33:26 +0000 (17:33 +0900)
Change-Id: I3072abc942aa4806a48abfe6c6f94f72ac745578

src/ui/FUi_Control.cpp
src/ui/FUi_EcoreEvas.cpp
src/ui/FUi_EflUiEventManager.cpp
src/ui/controls/FUiCtrl_MessageBox.cpp
src/ui/controls/FUiCtrl_Popup.cpp
src/ui/controls/FUiCtrl_ProgressPopup.cpp
src/ui/inc/FUiCtrl_Popup.h

index 6f7e49f..f02801b 100644 (file)
@@ -53,7 +53,6 @@
 #include "FUiCtrl_Form.h"\r
 #include "FUiCtrl_Frame.h"\r
 #include "FUi_ContainerImpl.h"\r
-#include "FUiCtrl_Popup.h"\r
 \r
 using namespace std;\r
 using namespace Tizen::Base;\r
@@ -62,7 +61,6 @@ using namespace Tizen::Base::Runtime;
 using namespace Tizen::Graphics;\r
 using namespace Tizen::Ui;\r
 using namespace Tizen::Ui::Animations;\r
-using namespace Tizen::Ui::Controls;\r
 \r
 namespace {\r
 \r
@@ -3539,22 +3537,8 @@ _Control::GetAbsoluteBounds(void) const
        {\r
                Point winPoint = pWindow->GetPosition();\r
 \r
-               Rectangle popupRect(0, 0, 0, 0);\r
-               _Popup* pPopup = dynamic_cast<_Popup*>(pWindow);\r
-               if (pPopup)\r
-               {\r
-                       if (GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT)\r
-                       {\r
-                               popupRect = _CoordinateSystemUtils::ConvertToInteger(pPopup->GetNativeBounds(true));\r
-                       }\r
-                       else\r
-                       {\r
-                               popupRect = _CoordinateSystemUtils::ConvertToInteger(pPopup->GetNativeBounds(false));\r
-                       }\r
-               }\r
-\r
-               accumPoint.x = accumPoint.x + winPoint.x + popupRect.x;\r
-               accumPoint.y = accumPoint.y + winPoint.y + popupRect.y;\r
+               accumPoint.x += winPoint.x;\r
+               accumPoint.y += winPoint.y;\r
        }\r
 \r
        absoluteBounds.x = accumPoint.x;\r
@@ -3596,22 +3580,8 @@ _Control::GetAbsoluteBoundsF(void) const
        {\r
                FloatPoint winPoint = pWindow->GetPositionF();\r
 \r
-               FloatRectangle popupRect(0.0f, 0.0f, 0.0f, 0.0f);\r
-               _Popup* pPopup = dynamic_cast<_Popup*>(pWindow);\r
-               if (pPopup)\r
-               {\r
-                       if (GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT)\r
-                       {\r
-                               popupRect = pPopup->GetNativeBounds(true);\r
-                       }\r
-                       else\r
-                       {\r
-                               popupRect = pPopup->GetNativeBounds(false);\r
-                       }\r
-               }\r
-\r
-               accumPoint.x = accumPoint.x + winPoint.x + popupRect.x;\r
-               accumPoint.y = accumPoint.y + winPoint.y + popupRect.y;\r
+               accumPoint.x += winPoint.x;\r
+               accumPoint.y += winPoint.y;\r
        }\r
 \r
        absoluteBounds.x = accumPoint.x;\r
index 005b040..65c8551 100644 (file)
@@ -1231,6 +1231,12 @@ _EcoreEvas::RotateWindow(const _Window& window, int orientation)
                }
        }
 
+       _Window* pWindow = const_cast<_Window*>(&window);
+       if (pWindow->IsLayoutChangable() == true)
+       {
+               rotatePartial = false;
+       }
+
        Evas_Object* pWinObj = pLayer->GetElmWin();
        Ecore_X_Window win = (Ecore_X_Window) ecore_evas_window_get(pEcoreEvas);
 
@@ -1262,32 +1268,6 @@ _EcoreEvas::RotateWindow(const _Window& window, int orientation)
                Rectangle winBounds = _CoordinateSystemUtils::Transform(window.GetBounds());
                int rotate = ecore_evas_rotation_get(pEcoreEvas);
 
-               _Window* pWindow = const_cast<_Window*>(&window);
-               if (pWindow->IsLayoutChangable() == true)
-               {
-                       _Popup* pPopup = dynamic_cast<_Popup*>(pWindow);
-                       if (pPopup)
-                       {
-                               FloatRectangle nativeBoundsF(0.0f, 0.0f, 0.0f, 0.0f);
-
-                               if ((rotate == 0) || (rotate == 180))
-                               {
-                                       nativeBoundsF = pPopup->GetNativeBounds(true);
-                               }
-                               else
-                               {
-                                       nativeBoundsF = pPopup->GetNativeBounds(false);
-                               }
-
-                               nativeBoundsF = _CoordinateSystemUtils::Transform(nativeBoundsF);
-                               Rectangle nativeBounds = _CoordinateSystemUtils::ConvertToInteger(nativeBoundsF);
-
-                               winBounds.x = nativeBounds.x;
-                               winBounds.y = nativeBounds.y;
-                               winBounds.width = nativeBounds.width;
-                               winBounds.height = nativeBounds.height;
-                       }
-               }
 
                int winX = winBounds.x;
                int winY = winBounds.y;
@@ -2271,31 +2251,6 @@ _EcoreEvas::SetWindowBounds(const _Window& window, const Rectangle& bounds)
                }
        }
 
-       if (pWindow->IsLayoutChangable() == true)
-       {
-               _Popup* pPopup = dynamic_cast<_Popup*>(pWindow);
-               if (pPopup)
-               {
-                       FloatRectangle nativeBoundsF(0.0f, 0.0f, 0.0f, 0.0f);
-
-                       if ((rotate == 0) || (rotate == 180))
-                       {
-                               nativeBoundsF = pPopup->GetNativeBounds(true);
-                       }
-                       else
-                       {
-                               nativeBoundsF = pPopup->GetNativeBounds(false);
-                       }
-
-                       nativeBoundsF = _CoordinateSystemUtils::Transform(nativeBoundsF);
-                       Rectangle nativeBounds = _CoordinateSystemUtils::ConvertToInteger(nativeBoundsF);
-
-                       winBounds.x = nativeBounds.x;
-                       winBounds.y = nativeBounds.y;
-                       winBounds.width = nativeBounds.width;
-                       winBounds.height = nativeBounds.height;
-               }
-       }
 
        int winX = winBounds.x;
        int winY = winBounds.y;
@@ -2389,31 +2344,6 @@ _EcoreEvas::SetWindowBounds(const _Window& window, const FloatRectangle& bounds)
                }
        }
 
-       if (pWindow->IsLayoutChangable() == true)
-       {
-               _Popup* pPopup = dynamic_cast<_Popup*>(pWindow);
-               if (pPopup)
-               {
-                       FloatRectangle nativeBoundsF(0.0f, 0.0f, 0.0f, 0.0f);
-
-                       if ((rotate == 0) || (rotate == 180))
-                       {
-                               nativeBoundsF = pPopup->GetNativeBounds(true);
-                       }
-                       else
-                       {
-                               nativeBoundsF = pPopup->GetNativeBounds(false);
-                       }
-                       
-                       nativeBoundsF = _CoordinateSystemUtils::Transform(nativeBoundsF);
-                       Rectangle nativeBounds = _CoordinateSystemUtils::ConvertToInteger(nativeBoundsF);
-
-                       winBounds.x = nativeBounds.x;
-                       winBounds.y = nativeBounds.y;
-                       winBounds.width = nativeBounds.width;
-                       winBounds.height = nativeBounds.height;
-               }
-       }
 
        int winX = winBounds.x;
        int winY = winBounds.y;
index 30253c5..40a27d3 100644 (file)
 #include "FUiAnim_ControlVisualElement.h"
 #include "FUiAnim_RootVisualElement.h"
 #include "FUiAnim_EflLayer.h"
-#include "FUiCtrl_Popup.h"
 
 using namespace std;
 using namespace Tizen::Ui;
 using namespace Tizen::Ui::Animations;
-using namespace Tizen::Ui::Controls;
 using namespace Tizen::Graphics;
 using namespace Tizen::Base::Collection;
 using namespace Tizen::Base;
@@ -717,24 +715,10 @@ private:
                        pWindow = pControlManager->GetTouchedWindow();
                        SysTryReturn(NID_UI, pWindow, null, E_SYSTEM, "[E_SYSTEM] A system error occurred.");
 
-                       Rectangle popupRect(0, 0, 0, 0);
-                       _Popup* pPopup = dynamic_cast<_Popup*>(pWindow);
-                       if (pPopup)
-                       {
-                               if (pPopup->GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT)
-                               {
-                                       popupRect = _CoordinateSystemUtils::ConvertToInteger(pPopup->GetNativeBounds(true));
-                               }
-                               else
-                               {
-                                       popupRect = _CoordinateSystemUtils::ConvertToInteger(pPopup->GetNativeBounds(false));
-                               }
-                       }
-
                        Rectangle winBounds = pWindow->GetBounds();
 
-                       ptf.x = static_cast<float>(x - winBounds.x - popupRect.x);
-                       ptf.y = static_cast<float>(y - winBounds.y - popupRect.y);
+                       ptf.x = static_cast<float>(x - winBounds.x);
+                       ptf.y = static_cast<float>(y - winBounds.y);
 
                        pRootControlElement = dynamic_cast <_ControlVisualElement*>(pWindow->GetVisualElement());
                }
index 5356090..0691e14 100644 (file)
@@ -74,34 +74,9 @@ _MessageBox::CreateMessageBoxN(void)
        _MessageBox* pMsgbox = new (std::nothrow) _MessageBox();
        SysTryReturn(NID_UI, pMsgbox != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
 
-       FloatDimension screenSize = _ControlManager::GetInstance()->GetScreenSizeF();
-
-       _Frame* pFrame = dynamic_cast<_Frame*>(_ControlManager::GetInstance()->GetCurrentFrame());
-       SysTryReturn(NID_UI_CTRL, pFrame != null, null, E_SYSTEM, "[E_SYSTEM] This instance is not constructed.");
-
-       _Form* pForm = pFrame->GetCurrentForm();
-       float portIndiHeight = 0.0f;
-       float landIndiHeight = 0.0f;
-
-       if (pForm && pForm->IsIndicatorVisible())
-       {
-               GET_SHAPE_CONFIG(FORM::INDICATOR_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, portIndiHeight);
-               GET_SHAPE_CONFIG(FORM::INDICATOR_MINIMIZE_HEIGHT, _CONTROL_ORIENTATION_LANDSCAPE, landIndiHeight);
-       }
-
-       FloatRectangle portBoundsF(0.0f, 0.0f, screenSize.width, screenSize.height - portIndiHeight);
-       FloatRectangle landBoundsF(0.0f, 0.0f, screenSize.width - landIndiHeight, screenSize.height);
-
-       _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
-
        result r = pMsgbox->CreateRootVisualElement(_WINDOW_TYPE_SUB);
        SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
 
-       pEcoreEvas->SetWindowRotationBounds(*pMsgbox, 0, portBoundsF);
-       pEcoreEvas->SetWindowRotationBounds(*pMsgbox, 180, portBoundsF);
-       pEcoreEvas->SetWindowRotationBounds(*pMsgbox, 90, landBoundsF);
-       pEcoreEvas->SetWindowRotationBounds(*pMsgbox, 270, landBoundsF);
-
        // for taking touch event
        pMsgbox->AcquireHandle();
 
@@ -220,8 +195,16 @@ _MessageBox::OnDeactivated(void)
 result
 _MessageBox::OnAttachedToMainTree(void)
 {
-       result r = _Popup::OnAttachedToMainTree();
-       SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+       result r = E_SUCCESS;
+
+       SysTryReturn(NID_UI_CTRL, GetVisibleState() != false, E_INVALID_OPERATION,
+                               E_INVALID_OPERATION, "[E_INVALID_OPERATION] This control is not 'displayable'");
+
+       _Control* pOwner = GetOwner();
+       if (pOwner)
+       {
+               GetEcoreEvasMgr()->GetEcoreEvas()->SetOwner(*this, *pOwner);
+       }
 
        r = __pMsgboxPresenter->OnAttachedToMainTree();
        SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
index 5cd8396..d45d32a 100644 (file)
@@ -60,24 +60,7 @@ _Popup::_Popup(void)
        , __pPopupPresenter(null)
        , __bounds(0.0f, 0.0f, 0.0f, 0.0f)
        , __popupResult(POPUP_RESULT_NONE)
-       , __portBounds(0.0f, 0.0f, 0.0f, 0.0f)
-       , __landBounds(0.0f, 0.0f, 0.0f, 0.0f)
 {
-       FloatDimension screenSize = _ControlManager::GetInstance()->GetScreenSizeF();
-
-       _Frame* pFrame = dynamic_cast<_Frame*>(_ControlManager::GetInstance()->GetCurrentFrame());
-       SysTryReturnVoidResult(NID_UI_CTRL, pFrame != null, E_SYSTEM, "[E_SYSTEM] This instance is not constructed.");
-
-       _Form* pForm = pFrame->GetCurrentForm();
-       int portIndiHeight = 0;
-       int landIndiHeight = 0;
-       if (pForm && pForm->IsIndicatorVisible())
-       {
-               GET_SHAPE_CONFIG(FORM::INDICATOR_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, portIndiHeight);
-               GET_SHAPE_CONFIG(FORM::INDICATOR_MINIMIZE_HEIGHT, _CONTROL_ORIENTATION_LANDSCAPE, landIndiHeight);
-       }
-       __portBounds = FloatRectangle(0, portIndiHeight, screenSize.width, screenSize.height - portIndiHeight);
-       __landBounds = FloatRectangle(0, landIndiHeight, screenSize.height, screenSize.width - landIndiHeight);
 }
 
 _Popup::~_Popup(void)
@@ -115,34 +98,9 @@ _Popup::CreatePopupN(void)
        _Popup* pPopup = new (std::nothrow) _Popup();
        SysTryReturn(NID_UI_CTRL, pPopup != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
 
-       FloatDimension screenSize = _ControlManager::GetInstance()->GetScreenSizeF();
-
-       _Frame* pFrame = dynamic_cast<_Frame*>(_ControlManager::GetInstance()->GetCurrentFrame());
-       SysTryReturn(NID_UI_CTRL, pFrame != null, null, E_SYSTEM, "[E_SYSTEM] This instance is not constructed.");
-
-       _Form* pForm = pFrame->GetCurrentForm();
-       float portIndiHeight = 0.0f;
-       float landIndiHeight = 0.0f;
-
-       if (pForm && pForm->IsIndicatorVisible())
-       {
-               GET_SHAPE_CONFIG(FORM::INDICATOR_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, portIndiHeight);
-               GET_SHAPE_CONFIG(FORM::INDICATOR_MINIMIZE_HEIGHT, _CONTROL_ORIENTATION_LANDSCAPE, landIndiHeight);
-       }
-
-       FloatRectangle portBoundsF(0.0f, 0.0f, screenSize.width, screenSize.height - portIndiHeight);
-       FloatRectangle landBoundsF(0.0f, 0.0f, screenSize.width - landIndiHeight, screenSize.height);
-
-       _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
-
        result r = pPopup->CreateRootVisualElement(_WINDOW_TYPE_SUB);
        SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
 
-       pEcoreEvas->SetWindowRotationBounds(*pPopup, 0, portBoundsF);
-       pEcoreEvas->SetWindowRotationBounds(*pPopup, 180, portBoundsF);
-       pEcoreEvas->SetWindowRotationBounds(*pPopup, 90, landBoundsF);
-       pEcoreEvas->SetWindowRotationBounds(*pPopup, 270, landBoundsF);
-
        // for taking touch event
        pPopup->AcquireHandle();
        
@@ -499,34 +457,6 @@ _Popup::OnAttachedToMainTree(void)
 
        GetEcoreEvasMgr()->GetEcoreEvas()->SetOwner(*this, *GetOwner());
 
-       FloatDimension screenSize = _ControlManager::GetInstance()->GetScreenSizeF();
-
-       _Frame* pFrame = dynamic_cast<_Frame*>(_ControlManager::GetInstance()->GetCurrentFrame());
-       SysTryReturnResult(NID_UI_CTRL, pFrame != null, E_SYSTEM, "[E_SYSTEM] This instance is not constructed.");
-
-       _Form* pForm = pFrame->GetCurrentForm();
-
-       float portIndiHeight = 0.0f;
-       float landIndiHeight = 0.0f;
-       if (pForm && pForm->IsIndicatorVisible())
-       {
-               GET_SHAPE_CONFIG(FORM::INDICATOR_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, portIndiHeight);
-               GET_SHAPE_CONFIG(FORM::INDICATOR_MINIMIZE_HEIGHT, _CONTROL_ORIENTATION_LANDSCAPE, landIndiHeight);
-       }
-
-       FloatRectangle portBoundsF(0.0f, 0.0f, screenSize.width, screenSize.height - portIndiHeight);
-       FloatRectangle landBoundsF(0.0f, 0.0f, screenSize.width - landIndiHeight, screenSize.height);
-
-       _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
-
-       pEcoreEvas->SetWindowRotationBounds(*this, 0, portBoundsF);
-       pEcoreEvas->SetWindowRotationBounds(*this, 180, portBoundsF);
-       pEcoreEvas->SetWindowRotationBounds(*this, 90, landBoundsF);
-       pEcoreEvas->SetWindowRotationBounds(*this, 270, landBoundsF);
-
-       __portBounds = FloatRectangle(0, portIndiHeight, screenSize.width, screenSize.height - portIndiHeight);
-       __landBounds = FloatRectangle(0, landIndiHeight, screenSize.height, screenSize.width - landIndiHeight);
-
        return E_SUCCESS;
 }
 
@@ -557,6 +487,12 @@ _Popup::OnDetachingFromMainTree(void)
        return _Window::OnDetachingFromMainTree();
 }
 
+result
+_Popup::OnBoundsChanging(const FloatRectangle& bounds)
+{
+       return E_SUCCESS;
+}
+
 void
 _Popup::OnBoundsChanged(void)
 {
@@ -640,18 +576,5 @@ _Popup::IsRotationSynchronized(void) const
        return true;
 }
 
-FloatRectangle
-_Popup::GetNativeBounds(bool isPortrait) const
-{
-       if (isPortrait)
-       {
-               return __portBounds;
-       }
-       else
-       {
-               return __landBounds;
-       }
-}
-
 }}} // Tizen::Ui::Controls
 
index eb6e285..f1a53e3 100755 (executable)
@@ -99,34 +99,9 @@ _ProgressPopup::CreateProgressPopupN(void)
        _ProgressPopup* pProgressPopup = new (std::nothrow) _ProgressPopup();
        SysTryReturn(NID_UI_CTRL, pProgressPopup != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Memory allocation failed.");
 
-       FloatDimension screenSize = _ControlManager::GetInstance()->GetScreenSizeF();
-
-       _Frame* pFrame = dynamic_cast<_Frame*>(_ControlManager::GetInstance()->GetCurrentFrame());
-       SysTryReturn(NID_UI_CTRL, pFrame != null, null, E_SYSTEM, "[E_SYSTEM] This instance is not constructed.");
-
-       _Form* pForm = pFrame->GetCurrentForm();
-       float portIndiHeight = 0.0f;
-       float landIndiHeight = 0.0f;
-
-       if (pForm && pForm->IsIndicatorVisible())
-       {
-               GET_SHAPE_CONFIG(FORM::INDICATOR_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, portIndiHeight);
-               GET_SHAPE_CONFIG(FORM::INDICATOR_MINIMIZE_HEIGHT, _CONTROL_ORIENTATION_LANDSCAPE, landIndiHeight);
-       }
-
-       FloatRectangle portBoundsF(0.0f, 0.0f, screenSize.width, screenSize.height - portIndiHeight);
-       FloatRectangle landBoundsF(0.0f, 0.0f, screenSize.width - landIndiHeight, screenSize.height);
-
-       _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
-
-       result r = pProgressPopup->CreateRootVisualElement();
+       result r = pProgressPopup->CreateRootVisualElement(_WINDOW_TYPE_SUB);
        SysTryCatch(NID_UI_CTRL, r == E_SUCCESS, , r, "[%s] Propagating.", GetErrorMessage(r));
 
-       pEcoreEvas->SetWindowRotationBounds(*pProgressPopup, 0, portBoundsF);
-       pEcoreEvas->SetWindowRotationBounds(*pProgressPopup, 180, portBoundsF);
-       pEcoreEvas->SetWindowRotationBounds(*pProgressPopup, 90, landBoundsF);
-       pEcoreEvas->SetWindowRotationBounds(*pProgressPopup, 270, landBoundsF);
-
        // for taking touch event
        pProgressPopup->AcquireHandle();
        return pProgressPopup;
@@ -546,8 +521,10 @@ _ProgressPopup::OnVisibleStateChanged(void)
 result
 _ProgressPopup::OnAttachedToMainTree(void)
 {
-       result r = _Popup::OnAttachedToMainTree();
-       SysTryReturn(NID_UI_CTRL, r == E_SUCCESS, r, r, "[%s] Propagating.", GetErrorMessage(r));
+       SysTryReturn(NID_UI_CTRL, GetVisibleState() != false, E_INVALID_OPERATION,
+                               E_INVALID_OPERATION, "[E_INVALID_OPERATION] This control is not 'displayable'");
+
+       GetEcoreEvasMgr()->GetEcoreEvas()->SetOwner(*this, *GetOwner());
 
        return E_SUCCESS;
 }
index 30c16af..a37b229 100644 (file)
@@ -99,14 +99,14 @@ public:
        virtual bool OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo);
        virtual bool OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo);
 
+       virtual result OnBoundsChanging(const Tizen::Graphics::FloatRectangle& bounds);
+
        virtual void OnBoundsChanged(void);
        virtual bool IsLayoutChangable(void) const;
        virtual void OnOwnerChanged(_Control* pOldOwner);
        virtual void UpdateClientBounds(const Tizen::Graphics::FloatDimension& size, Tizen::Graphics::FloatRectangle& clientBounds);
        virtual bool IsRotationSynchronized(void) const;
 
-       Tizen::Graphics::FloatRectangle GetNativeBounds(bool isPortrait) const;
-
 // Accessor
 public:
        void SetColor(const Tizen::Graphics::Color& color);
@@ -160,9 +160,6 @@ private:
        Tizen::Graphics::FloatRectangle __bounds;
 
        PopupModalResult __popupResult;
-
-       Tizen::Graphics::FloatRectangle __portBounds;
-       Tizen::Graphics::FloatRectangle __landBounds;
 };  // _Popup