void
_ControlImplManager::OnScreenRotated(int rotation)
{
+#if defined(WINDOW_BASE_ROTATE)
+ return;
+#endif
+
_ControlManager* pCore = _ControlManager::GetInstance();
SysAssert(pCore);
if (window.IsOrientationRoot() == false)
{
+#if !defined(WINDOW_BASE_ROTATE)
window.ChangeLayout(GetOrientation());
_EcoreEvas* pEcoreEvas = ::GetEcoreEvasMgr()->GetEcoreEvas();
{
pEcoreEvas->RotateWindow(window, ::Convert(__orientationStatus));
}
+#else
+ // Initialize window rotation.
+ _EcoreEvas* pEcoreEvas = ::GetEcoreEvasMgr()->GetEcoreEvas();
+ if (pEcoreEvas)
+ {
+ pEcoreEvas->SetWindowPreferredRotation(window, ::Convert(__orientationStatus));
+ }
+#endif
}
r = window.GetControlDelegate().OnAttached();
int __clipboardHeight = 0;
+#if defined(WINDOW_BASE_ROTATE)
+void
+OnWindowStateChanged(Ecore_Evas* pEcoreEvas)
+{
+ _ControlManager* pControlManager = _ControlManager::GetInstance();
+ if (!pControlManager)
+ {
+ return;
+ }
+
+ Ecore_X_Window targetWin = (Ecore_X_Window) ecore_evas_window_get(pEcoreEvas);
+
+ SysLog(NID_UI, "[Window-based Rotation][Window : 0x%x] OnWindowStateChanged is called.", targetWin);
+
+ int winCount = pControlManager->GetWindowCount();
+ for (int i = 0; i < winCount; i++)
+ {
+ _Window* pWindow = pControlManager->GetWindow(i);
+ if (!pWindow)
+ {
+ continue;
+ }
+
+ Ecore_X_Window win = (Ecore_X_Window)pWindow->GetNativeHandle();
+
+ if (win == targetWin)
+ {
+ pWindow->OnWindowStateChanged();
+
+ return;
+ }
+ }
+}
+#endif
+
Eina_Bool
OnWindowPropertyChanged(void* pData, int type, void* pEvent)
{
Eina_Bool
OnWindowShown(void* pData, int type, void* pEvent)
{
+#if !defined(WINDOW_BASE_ROTATE)
Ecore_X_Event_Window_Show* pEv = (Ecore_X_Event_Window_Show*) pEvent;
if (!pEv)
{
}
}
}
+#endif
return ECORE_CALLBACK_PASS_ON;
}
-// [ToDo] Remove API
-/*
-void
-OnAutoRotationChanged(runtime_info_key_e key, void* pUserData)
-{
- if (key != RUNTIME_INFO_KEY_ROTATION_LOCK_ENABLED)
- {
- return;
- }
-
- bool autoRotationLock = false;
- int ret = runtime_info_get_value_bool(RUNTIME_INFO_KEY_ROTATION_LOCK_ENABLED, &autoRotationLock);
-
- if (ret != RUNTIME_INFO_ERROR_NONE)
- {
- SysLog(NID_UI, "It's failed to get the flag of auto-rotation.");
- return;
- }
-
- int angle = 0;
-
- if (autoRotationLock == false)
- {
- angle = app_get_device_orientation();
- }
-
- _ControlImplManager* pControlImplManager = _ControlImplManager::GetInstance();
- if (pControlImplManager)
- {
- pControlImplManager->OnScreenRotated(angle);
- }
-}
-*/
-
Eina_Bool
OnAccessibilitySettingMessageReceived(void* pData, int type, void* pEvent)
{
{
#define __UNUSED__
+#if !defined(WINDOW_BASE_ROTATE)
Ecore_X_Atom __atomRotateAuto = 0;
+#endif
enum _ClipType
{
void
_EcoreEvas::RotateWindow(const _Window& window, int orientation)
{
+#if defined(WINDOW_BASE_ROTATE)
+ return;
+#endif
+
_EflLayer* pLayer = GetEflLayer(window);
if (!pLayer)
{
}
}
+#if defined(WINDOW_BASE_ROTATE)
+void
+_EcoreEvas::UpdateWindowBounds(const _Window& window)
+{
+ _EflLayer* pLayer = GetEflLayer(window);
+ if (!pLayer)
+ {
+ return;
+ }
+
+ bool fullScreen = false;
+
+ _Frame* pFrame = dynamic_cast<_Frame*>(const_cast<_Window*>(&window));
+
+ if (pFrame)
+ {
+ FrameShowMode showMode = pFrame->GetShowMode();
+ if (showMode == FRAME_SHOW_MODE_FULL_SCREEN)
+ {
+ fullScreen = true;
+ }
+ }
+
+ _Window* pWindow = const_cast<_Window*>(&window);
+
+ if (pWindow->IsLayoutChangable() == true)
+ {
+ fullScreen = true;
+ }
+
+ Evas_Object* pWinObj = pLayer->GetElmWin();
+ Ecore_X_Window win = (Ecore_X_Window) ecore_evas_window_get(pLayer->GetEcoreEvas());
+
+ int rootW = 0;
+ int rootH = 0;
+ ecore_x_window_size_get(ecore_x_window_root_get(win), &rootW, &rootH);
+
+ int rotation = ecore_evas_rotation_get(pLayer->GetEcoreEvas());
+
+ if (fullScreen == false)
+ {
+ Rectangle winBounds = _CoordinateSystemUtils::Transform(window.GetBounds());
+
+ int winX = winBounds.x;
+ int winY = winBounds.y;
+
+ switch (rotation)
+ {
+ 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(pWinObj, winX, winY);
+ evas_object_resize(pWinObj, winBounds.width, winBounds.height);
+ }
+}
+#else
void
_EcoreEvas::SetWindowOrientationEnabled(const _Window& window, bool enable)
{
unsigned int supportRotation = (unsigned int)enable;
ecore_x_window_prop_card32_set(win, __atomRotateAuto, &supportRotation, 1);
}
+#endif
_EflLayer*
_EcoreEvas::GetEflLayer(const _Window& window) const
evas_object_move(pWinObject, winX, winY);
evas_object_resize(pWinObject, winBounds.width, winBounds.height);
- SysLog(NID_UI, "The window is moved to (%d, %d) and is resized to (%d, %d) with %d degree by setting bounds." , winX, winY, winBounds.width, winBounds.height, rotate);
-
- // [SLP]
- //Rectangle rectangle = GetIndicatorBounds(window);
-
SetLastResult(E_SUCCESS);
}
void
_EcoreEvas::SetOwner(const _Window& ownee, const _Control& owner)
{
- _EflLayer* pOwneeLayer = GetEflLayer(ownee);
- SysTryReturnVoidResult(NID_UI, pOwneeLayer, E_INVALID_ARG, "[E_INVALID_ARG] The ownee doesn't have a elf layer.");
-
_Window* pOwnerWindow = owner.GetRootWindow();
SysTryReturnVoidResult(NID_UI, pOwnerWindow, E_INVALID_ARG, "[E_INVALID_ARG] The owner doesn't have a root window.");
_EflLayer* pOwnerLayer = GetEflLayer(*pOwnerWindow);
SysTryReturnVoidResult(NID_UI, pOwnerLayer, E_INVALID_ARG, "[E_INVALID_ARG] The owner doesn't have a elf layer.");
- Ecore_X_Window owneeWin = (Ecore_X_Window) ecore_evas_window_get(pOwneeLayer->GetEcoreEvas());
+ _EflLayer* pOwneeLayer = GetEflLayer(ownee);
+ SysTryReturnVoidResult(NID_UI, pOwneeLayer, E_INVALID_ARG, "[E_INVALID_ARG] The ownee doesn't have a elf layer.");
+
Ecore_X_Window ownerWin = (Ecore_X_Window) ecore_evas_window_get(pOwnerLayer->GetEcoreEvas());
+ Ecore_X_Window owneeWin = (Ecore_X_Window) ecore_evas_window_get(pOwneeLayer->GetEcoreEvas());
ecore_x_icccm_transient_for_unset(owneeWin);
ecore_x_icccm_transient_for_set(owneeWin, ownerWin);
+#if !defined(WINDOW_BASE_ROTATE)
int rotation = GetWindowRotation(*pOwnerWindow);
RotateWindow(ownee, rotation);
+#else
+ int* rotations = null;
+ unsigned int count = 0;
+ Eina_Bool ret = ecore_evas_wm_rotation_available_rotations_get(pOwnerLayer->GetEcoreEvas(), &rotations, &count);
+
+ if (ret)
+ {
+ if (rotations)
+ {
+ SetWindowPreferredRotation(ownee, -1);
+ SetWindowAvailabledRotation(ownee, rotations, count);
+ free(rotations);
+ }
+ }
+ else
+ {
+ int preferredRotation = ecore_evas_wm_rotation_preferred_rotation_get(pOwnerLayer->GetEcoreEvas());
+ SetWindowPreferredRotation(ownee, preferredRotation);
+ }
+#endif
SetLastResult(E_SUCCESS);
}
return rotation;
}
+#if defined(WINDOW_BASE_ROTATE)
+void
+_EcoreEvas::SetWindowPreferredRotation(const _Window& window, int rotation)
+{
+ _EflLayer* pLayer = GetEflLayer(window);
+ if (!pLayer)
+ {
+ return;
+ }
+
+ Ecore_X_Window win = (Ecore_X_Window) ecore_evas_window_get(pLayer->GetEcoreEvas());
+ SysLog(NID_UI, "[Window-based Rotation][Window : 0x%x] Set window preferred rotation(%d).", win, rotation);
+ ecore_evas_wm_rotation_preferred_rotation_set(pLayer->GetEcoreEvas(), rotation);
+}
+
+void
+_EcoreEvas::SetWindowAvailabledRotation(const _Window& window, int* rotations, unsigned int count)
+{
+ _EflLayer* pLayer = GetEflLayer(window);
+ if (!pLayer)
+ {
+ return;
+ }
+
+ Ecore_X_Window win = (Ecore_X_Window) ecore_evas_window_get(pLayer->GetEcoreEvas());
+ SysLog(NID_UI, "[Window-based Rotation][Window : 0x%x] Set window available rotation(%d).", win, count);
+ ecore_evas_wm_rotation_available_rotations_set(pLayer->GetEcoreEvas(), rotations, count);
+}
+
+void
+_EcoreEvas::RegisterWindowStateCallback(const _Window& window)
+{
+ _EflLayer* pLayer = GetEflLayer(window);
+ if (!pLayer)
+ {
+ return;
+ }
+
+ ecore_evas_callback_state_change_set(pLayer->GetEcoreEvas(), OnWindowStateChanged);
+}
+#endif
+
// [ToDo] Remove API
const _Control*
_EcoreEvas::GetFrame(void) const
*/
#include <unique_ptr.h>
+#include <app.h>
#include <FBaseSysLog.h>
#include <FBaseColArrayList.h>
#include "FUi_OrientationAgent.h"
, __firePublicEvent(false)
, __statusChanged(false)
, __updateStatus(true)
+#if defined(WINDOW_BASE_ROTATE)
+ , __draw(false)
+#endif
{
_PublicOrientationEvent* pPublicEvent = _PublicOrientationEvent::CreateInstanceN(publicControl);
void
_OrientationAgent::Update(bool draw)
{
+#if defined(WINDOW_BASE_ROTATE)
+ _ControlImplManager* pImplManager = _ControlImplManager::GetInstance();
+ SysAssert(pImplManager);
+
+ _ControlImpl* pImpl = _ControlImpl::GetInstance(__publicControl);
+ if (!pImpl)
+ {
+ return;
+ }
+
+ // Set window rotation.
+ _Form* pForm = dynamic_cast<_Form*>(&(pImpl->GetCore()));
+ if (pForm)
+ {
+ _Control* pParent = pForm->GetParent();
+ if (pParent)
+ {
+ _Form* pCurrentForm = null;
+ int childCount = pParent->GetChildCount();
+
+ for (int i = childCount; i > 0; i--)
+ {
+ _Control* pChild = pParent->GetChild(i - 1);
+
+ _Form* pChildForm = dynamic_cast<_Form*>(pChild);
+ if (pChildForm)
+ {
+ if (pChildForm->IsVisible())
+ {
+ pCurrentForm = pChildForm;
+
+ break;
+ }
+ }
+ }
+
+ // Current Form
+ if (pCurrentForm == pForm)
+ {
+ _Window* pWindow = pForm->GetRootWindow();
+ if (pWindow)
+ {
+ Rectangle bounds = pWindow->GetBounds();
+ SysLog(NID_UI, "[Window-based Rotation][Window : 0x%x, %d, %d, %d, %d, Form] Set window rotation with mode(%d).",
+ pWindow->GetNativeHandle(), bounds.x, bounds.y, bounds.width, bounds.height, __mode);
+ SetRotation(*pWindow, __mode);
+ }
+
+ int owneeCount = pForm->GetOwneeCount();
+ for (int i = 0; i < owneeCount; i++)
+ {
+ _Window* pOwnee = pForm->GetOwnee(i);
+
+ if (pOwnee)
+ {
+ SetRotation(*pOwnee, __mode);
+ }
+ }
+ }
+ }
+ }
+ else
+ {
+ _Frame* pFrame = dynamic_cast<_Frame*>(&(pImpl->GetCore()));
+
+ if (pFrame)
+ {
+ // Frame which has no forms
+ int childCount = pFrame->GetChildCount();
+ if (childCount == 0)
+ {
+ Rectangle bounds = pFrame->GetBounds();
+ SysLog(NID_UI, "[Window-based Rotation][Window : 0x%x, %d, %d, %d, %d, Frame] Set window rotation with mode(%d).",
+ pFrame->GetNativeHandle(), bounds.x, bounds.y, bounds.width, bounds.height, __mode);
+ SetRotation(*pFrame, __mode);
+
+ int owneeCount = pFrame->GetOwneeCount();
+
+ for (int i = 0; i < owneeCount; i++)
+ {
+ _Window* pOwnee = pFrame->GetOwnee(i);
+
+ if (pOwnee)
+ {
+ SetRotation(*pOwnee, __mode);
+ }
+ }
+ }
+ }
+ }
+
+ __draw = draw;
+#else
_ControlImplManager* pImplManager = _ControlImplManager::GetInstance();
SysAssert(pImplManager);
// Despite not changing status, it needs to rotate screen.
_ControlImpl* pControlImpl = _ControlImpl::GetInstance(__publicControl);
pImplManager->RotateScreen(pControlImpl, status);
+#endif
+}
+
+#if defined(WINDOW_BASE_ROTATE)
+void
+_OrientationAgent::UpdateOrientation(void)
+{
+ _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
+ if (!pEcoreEvas)
+ {
+ return;
+ }
+
+ _ControlImpl* pImpl = _ControlImpl::GetInstance(__publicControl);
+ if (!pImpl)
+ {
+ return;
+}
+
+ int rotation = pEcoreEvas->GetWindowRotation(*(pImpl->GetCore().GetRootWindow()));
+
+ // Update evas objects.
+ OrientationStatus status = ORIENTATION_STATUS_NONE;
+ switch (rotation)
+ {
+ case 0:
+ status = ORIENTATION_STATUS_PORTRAIT;
+ break;
+ case 270:
+ status = ORIENTATION_STATUS_LANDSCAPE;
+ break;
+ case 180:
+ status = ORIENTATION_STATUS_PORTRAIT_REVERSE;
+ break;
+ case 90:
+ status = ORIENTATION_STATUS_LANDSCAPE_REVERSE;
+ break;
+ default:
+ break;
+ }
+
+ if (__updateStatus == true)
+ {
+ __statusChanged = false;
+ if (__status != status)
+ {
+ __statusChanged = true;
+ __updateStatus = false;
+ }
+ }
+
+ __status = status;
+
+ pEcoreEvas->AllowSetWindowBounds(false);
+ FireEvent(status);
+ pEcoreEvas->AllowSetWindowBounds(true);
+
+ // For the form to be made by Ui-Builder
+ if ((__draw == true) && (__statusChanged == true))
+ {
+ _ControlOrientation coreOrientation =
+ (status == ORIENTATION_STATUS_PORTRAIT || status == ORIENTATION_STATUS_PORTRAIT_REVERSE) ?
+ _CONTROL_ORIENTATION_PORTRAIT : _CONTROL_ORIENTATION_LANDSCAPE;
+
+ Rectangle temp;
+ bool exist = pImpl->GetBuilderBounds(coreOrientation, temp);
+ if (exist)
+ {
+ pImpl->Invalidate(true);
+ }
+ }
+
+ _Window* pRootWindow = pImpl->GetCore().GetRootWindow();
+ if (pRootWindow)
+ {
+ pEcoreEvas->UpdateWindowBounds(*pRootWindow);
+
+ Rectangle bounds = pRootWindow->GetBounds();
+ SysLog(NID_UI, "[Window-based Rotation][Window : 0x%x, %d, %d, %d, %d] Update evas objects to %d degree.",
+ pRootWindow->GetNativeHandle(), bounds.x, bounds.y, bounds.width, bounds.height, rotation);
+ }
}
+#endif
void
_OrientationAgent::RequestOrientationEvent(void)
pImplManager->SetOrientationStatus(status);
pImpl->GetCore().ChangeLayout(coreOrientation);
+#if !defined(WINDOW_BASE_ROTATE)
// Ownee
int owneeCount = pImpl->GetCore().GetOwneeCount();
for (int i = 0; i < owneeCount; i++)
pOwnee->ChangeLayout(coreOrientation);
}
}
+#endif
// Public
if (__firePublicEvent && __statusChanged)
}
}
+#if defined(WINDOW_BASE_ROTATE)
+void
+_OrientationAgent::SetRotation(const _Window& window, Orientation orientation)
+{
+ _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
+ if (!pEcoreEvas)
+ {
+ return;
+ }
+
+ int deviceOrientation = app_get_device_orientation();
+ int windowRotation = pEcoreEvas->GetWindowRotation(window);
+
+ bool callback = true;
+
+ // Decide updating orientation forcibly.
+ switch (orientation)
+ {
+ case ORIENTATION_PORTRAIT:
+ pEcoreEvas->SetWindowPreferredRotation(window, 0);
+
+ if ((deviceOrientation == 0) || (windowRotation == 0))
+ {
+ callback = false;
+ }
+
+ break;
+ case ORIENTATION_LANDSCAPE:
+ pEcoreEvas->SetWindowPreferredRotation(window, 270);
+
+ if ((deviceOrientation == 270) || (windowRotation == 270))
+ {
+ callback = false;
+ }
+
+ break;
+ case ORIENTATION_PORTRAIT_REVERSE:
+ pEcoreEvas->SetWindowPreferredRotation(window, 180);
+
+ if ((deviceOrientation == 180) || (windowRotation == 180))
+ {
+ callback = false;
+ }
+
+ break;
+ case ORIENTATION_LANDSCAPE_REVERSE:
+ pEcoreEvas->SetWindowPreferredRotation(window, 90);
+
+ if ((deviceOrientation == 90) || (windowRotation == 90))
+ {
+ callback = false;
+ }
+
+ break;
+ case ORIENTATION_AUTOMATIC:
+ {
+ pEcoreEvas->SetWindowPreferredRotation(window, -1);
+
+ int autoRotation[3] = {0, 90, 270};
+ pEcoreEvas->SetWindowAvailabledRotation(window, autoRotation, 3);
+
+ if (deviceOrientation == windowRotation)
+ {
+ callback = false;
+ }
+ else
+ {
+ if (deviceOrientation == 180)
+ {
+ callback = false;
+ }
+ }
+ }
+ break;
+ case ORIENTATION_AUTOMATIC_FOUR_DIRECTION:
+ {
+ pEcoreEvas->SetWindowPreferredRotation(window, -1);
+
+ int autoFourRotation[4] = {0, 90, 180, 270};
+ pEcoreEvas->SetWindowAvailabledRotation(window, autoFourRotation, 4);
+
+ if (deviceOrientation == windowRotation)
+ {
+ callback = false;
+ }
+ }
+ break;
+ default:
+ break;
+ }
+
+ if (callback == false)
+ {
+ UpdateOrientation();
+ }
+}
+#endif
+
}} // Tizen::Ui
class _PublicOrientationEvent;
+#if defined(WINDOW_BASE_ROTATE)
+class _Window;
+#endif
+
class _OrientationAgent
{
public:
Orientation GetMode(void) const;
OrientationStatus GetStatus(void) const;
void SetMode(Orientation orientation);
+
void Update(bool draw = false);
+#if defined(WINDOW_BASE_ROTATE)
+ void UpdateOrientation(void);
+#endif
void RequestOrientationEvent(void);
void FireOrientationEvent(void);
private:
void FireEvent(OrientationStatus status);
+#if defined(WINDOW_BASE_ROTATE)
+ void SetRotation(const _Window& window, Orientation orientation);
+#endif
_OrientationAgent(Control& publicControl);
bool __firePublicEvent;
bool __statusChanged;
bool __updateStatus;
+#if defined(WINDOW_BASE_ROTATE)
+ bool __draw;
+#endif
}; // _OrientationAgent
}} // Tizen::Ui
#include "FUi_EcoreEvas.h"
#include "FUiAnim_DisplayManager.h"
#include "FUiAnim_EflLayer.h"
+#include "FUiCtrl_Form.h"
+#include "FUiCtrl_FormImpl.h"
+#include "FUiCtrl_FrameImpl.h"
using namespace Tizen::Base;
using namespace Tizen::Base::Collection;
using namespace Tizen::Graphics;
using namespace Tizen::Ui::Animations;
+using namespace Tizen::Ui::Controls;
namespace Tizen { namespace Ui
{
_EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
SysAssert(pEcoreEvas);
+#if !defined(WINDOW_BASE_ROTATE)
pEcoreEvas->SetWindowOrientationEnabled(*this, false);
+#else
+ __rotation = pEcoreEvas->GetWindowRotation(*this);
+ pEcoreEvas->RegisterWindowStateCallback(*this);
+#endif
// Get visual element.
_VisualElement* pVisualElement = GetVisualElement();
__pRootVisualElement->SetName(L"Root");
- //Ecore_X_Window win = (Ecore_X_Window) ecore_evas_window_get(pLayer->GetEcoreEvas());
- //SysLog(NID_UI, "[Multi_Window] create x window(0x%x)", win);
-
return E_SUCCESS;
}
return enable;
}
+#if !defined(WINDOW_BASE_ROTATE)
void
_Window::SetOrientationEnabled(bool enable)
{
{
return __orientationEnabled;
}
+#endif
_RootVisualElement*
_Window::GetRootVisualElement(void) const
return E_SUCCESS;
}
+#if defined(WINDOW_BASE_ROTATE)
+void
+_Window::OnWindowStateChanged(void)
+{
+ _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
+ if (!pEcoreEvas)
+ {
+ return;
+ }
+
+ int rotation = pEcoreEvas->GetWindowRotation(*this);
+
+ Rectangle bounds = GetBounds();
+ SysLog(NID_UI, "[Window-based Rotation][Window : 0x%x, %d, %d, %d, %d] OnWindowStateChanged is called with prev rotation(__rotation) and cur rotation(rotation)",
+ GetNativeHandle(), bounds.x, bounds.y, bounds.width, bounds.height, __rotation, rotation);
+
+ if (__rotation != rotation)
+ {
+ __rotation = rotation;
+
+ int childCount = GetChildCount();
+ for (int i = childCount; i > 0; i--)
+ {
+ _Control* pChild = GetChild(i - 1);
+
+ _Form* pForm = dynamic_cast<_Form*>(pChild);
+ if (pForm)
+ {
+ if (pForm->IsVisible())
+ {
+ // Current Form
+ _FormImpl* pFormImpl = static_cast<_FormImpl*>(pForm->GetUserData());
+ if (pFormImpl)
+ {
+ pFormImpl->UpdateOrientation();
+ }
+
+ return;
+ }
+ }
+ }
+
+ if (IsOrientationRoot())
+ {
+ _FrameImpl* pFrameImpl = static_cast<_FrameImpl*>(GetUserData());
+ if (pFrameImpl)
+ {
+ pFrameImpl->UpdateOrientation();
+ }
+ }
+ else
+ {
+ _ControlOrientation controlOrientation = (rotation == 0 || rotation == 180) ? _CONTROL_ORIENTATION_PORTRAIT : _CONTROL_ORIENTATION_LANDSCAPE;
+ ChangeLayout(controlOrientation);
+ pEcoreEvas->UpdateWindowBounds(*this);
+ }
+ }
+}
+#endif
+
bool
_Window::IsLayoutChangable(void) const
{
, __isOpened(false)
, __isInitialized(false)
, __pFocusedControl(null)
- , __orientationEnabled(false)
, __transient(true)
+#if !defined(WINDOW_BASE_ROTATE)
+ , __orientationEnabled(false)
+#else
+ , __rotation(0)
+#endif
{
SetControlDelegate(*this);
SetWindowDelegate(*this);
__pOriAgent->Update(draw);
}
+#if defined(WINDOW_BASE_ROTATE)
+void
+_FormImpl::UpdateOrientation(void)
+{
+ __pOriAgent->UpdateOrientation();
+}
+#endif
+
bool
_FormImpl::HasOptionkey(void) const
{
__pOrientationAgent->Update();
}
+#if defined(WINDOW_BASE_ROTATE)
+void
+_FrameImpl::UpdateOrientation(void)
+{
+ __pOrientationAgent->UpdateOrientation();
+}
+#endif
+
bool
_FrameImpl::IsOpaque(void) const
{
Tizen::Ui::Orientation GetOrientation(void) const;
Tizen::Ui::OrientationStatus GetOrientationStatus(void) const;
void UpdateOrientationStatus(bool draw = false);
+#if defined(WINDOW_BASE_ROTATE)
+ void UpdateOrientation(void);
+#endif
// Invoked by operations
virtual void OnChangeLayout(Tizen::Ui::_ControlOrientation orientation);
Tizen::Ui::OrientationStatus GetOrientationStatus(void) const;
void SetOrientation(Tizen::Ui::Orientation orientation);
void UpdateOrientationStatus(void);
+#if defined(WINDOW_BASE_ROTATE)
+ void UpdateOrientation(void);
+#endif
// Callback
virtual void OnDraw(void);
void ActivateWindow(const _Window& window);
void MinimizeWindow(_Window& window);
+
void RotateWindow(const _Window& window, int orientation);
- void SetWindowOrientationEnabled(const _Window& window, bool enable);
int GetWindowRotation(const _Window& window);
+#if defined(WINDOW_BASE_ROTATE)
+ void UpdateWindowBounds(const _Window& window);
+ void SetWindowPreferredRotation(const _Window& window, int rotation);
+ void SetWindowAvailabledRotation(const _Window& window, int* rotations, unsigned int count);
+ void RegisterWindowStateCallback(const _Window& window);
+#else
+ void SetWindowOrientationEnabled(const _Window& window, bool enable);
+#endif
+
result SetFloatingMode(const _Window& window, bool enable);
bool GetFloatingMode(const _Window& window) const;
void SetWindowActivationEnabled(const _Window& window, bool enable);
#include <FBase_ObjectManagerT.h>
#define MULTI_WINDOW
+//#define WINDOW_BASE_ROTATE
namespace Tizen { namespace Ui
{
virtual result OnBoundsChanging(const Tizen::Graphics::Rectangle& bounds);
virtual result OnAttachingToMainTree(const _Control* pParent);
virtual result OnDetachingFromMainTree(void);
+#if defined(WINDOW_BASE_ROTATE)
+ void OnWindowStateChanged(void);
+#else
+ void SetOrientationEnabled(bool enable);
+ bool IsOrientationEnabled(void);
+#endif
void SetActivationEnabled(bool enable);
bool IsActivationEnabled(void);
- void SetOrientationEnabled(bool enable);
- bool IsOrientationEnabled(void);
-
Tizen::Ui::Animations::_RootVisualElement* GetRootVisualElement(void) const;
NativeWindowHandle GetNativeHandle(void) const;
bool __isOpened;
bool __isInitialized;
_Control* __pFocusedControl;
- bool __orientationEnabled;
bool __transient;
+#if !defined(WINDOW_BASE_ROTATE)
+ bool __orientationEnabled;
+#else
+ int __rotation;
+#endif
friend class _ControlManager;
}; // _Window