From: Keuckdo Bang Date: Sun, 14 Apr 2013 08:33:26 +0000 (+0900) Subject: Rollback code about quichpanel. X-Git-Tag: accepted/tizen_2.1/20130425.033138~233 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=486c391f7d20ed951444ed860c35c8674545218d;p=platform%2Fframework%2Fnative%2Fuifw.git Rollback code about quichpanel. Change-Id: I3072abc942aa4806a48abfe6c6f94f72ac745578 --- diff --git a/src/ui/FUi_Control.cpp b/src/ui/FUi_Control.cpp index 6f7e49f..f02801b 100644 --- a/src/ui/FUi_Control.cpp +++ b/src/ui/FUi_Control.cpp @@ -53,7 +53,6 @@ #include "FUiCtrl_Form.h" #include "FUiCtrl_Frame.h" #include "FUi_ContainerImpl.h" -#include "FUiCtrl_Popup.h" using namespace std; using namespace Tizen::Base; @@ -62,7 +61,6 @@ using namespace Tizen::Base::Runtime; using namespace Tizen::Graphics; using namespace Tizen::Ui; using namespace Tizen::Ui::Animations; -using namespace Tizen::Ui::Controls; namespace { @@ -3539,22 +3537,8 @@ _Control::GetAbsoluteBounds(void) const { Point winPoint = pWindow->GetPosition(); - Rectangle popupRect(0, 0, 0, 0); - _Popup* pPopup = dynamic_cast<_Popup*>(pWindow); - if (pPopup) - { - if (GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT) - { - popupRect = _CoordinateSystemUtils::ConvertToInteger(pPopup->GetNativeBounds(true)); - } - else - { - popupRect = _CoordinateSystemUtils::ConvertToInteger(pPopup->GetNativeBounds(false)); - } - } - - accumPoint.x = accumPoint.x + winPoint.x + popupRect.x; - accumPoint.y = accumPoint.y + winPoint.y + popupRect.y; + accumPoint.x += winPoint.x; + accumPoint.y += winPoint.y; } absoluteBounds.x = accumPoint.x; @@ -3596,22 +3580,8 @@ _Control::GetAbsoluteBoundsF(void) const { FloatPoint winPoint = pWindow->GetPositionF(); - FloatRectangle popupRect(0.0f, 0.0f, 0.0f, 0.0f); - _Popup* pPopup = dynamic_cast<_Popup*>(pWindow); - if (pPopup) - { - if (GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT) - { - popupRect = pPopup->GetNativeBounds(true); - } - else - { - popupRect = pPopup->GetNativeBounds(false); - } - } - - accumPoint.x = accumPoint.x + winPoint.x + popupRect.x; - accumPoint.y = accumPoint.y + winPoint.y + popupRect.y; + accumPoint.x += winPoint.x; + accumPoint.y += winPoint.y; } absoluteBounds.x = accumPoint.x; diff --git a/src/ui/FUi_EcoreEvas.cpp b/src/ui/FUi_EcoreEvas.cpp index 005b040..65c8551 100644 --- a/src/ui/FUi_EcoreEvas.cpp +++ b/src/ui/FUi_EcoreEvas.cpp @@ -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; diff --git a/src/ui/FUi_EflUiEventManager.cpp b/src/ui/FUi_EflUiEventManager.cpp index 30253c5..40a27d3 100644 --- a/src/ui/FUi_EflUiEventManager.cpp +++ b/src/ui/FUi_EflUiEventManager.cpp @@ -46,12 +46,10 @@ #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(x - winBounds.x - popupRect.x); - ptf.y = static_cast(y - winBounds.y - popupRect.y); + ptf.x = static_cast(x - winBounds.x); + ptf.y = static_cast(y - winBounds.y); pRootControlElement = dynamic_cast <_ControlVisualElement*>(pWindow->GetVisualElement()); } diff --git a/src/ui/controls/FUiCtrl_MessageBox.cpp b/src/ui/controls/FUiCtrl_MessageBox.cpp index 5356090..0691e14 100644 --- a/src/ui/controls/FUiCtrl_MessageBox.cpp +++ b/src/ui/controls/FUiCtrl_MessageBox.cpp @@ -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)); diff --git a/src/ui/controls/FUiCtrl_Popup.cpp b/src/ui/controls/FUiCtrl_Popup.cpp index 5cd8396..d45d32a 100644 --- a/src/ui/controls/FUiCtrl_Popup.cpp +++ b/src/ui/controls/FUiCtrl_Popup.cpp @@ -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 diff --git a/src/ui/controls/FUiCtrl_ProgressPopup.cpp b/src/ui/controls/FUiCtrl_ProgressPopup.cpp index eb6e285..f1a53e3 100755 --- a/src/ui/controls/FUiCtrl_ProgressPopup.cpp +++ b/src/ui/controls/FUiCtrl_ProgressPopup.cpp @@ -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; } diff --git a/src/ui/inc/FUiCtrl_Popup.h b/src/ui/inc/FUiCtrl_Popup.h index 30c16af..a37b229 100644 --- a/src/ui/inc/FUiCtrl_Popup.h +++ b/src/ui/inc/FUiCtrl_Popup.h @@ -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