_ControlRotation
_ControlManager::GetScreenRotation(void) const
{
-#ifdef BUILD_BREAK
bool autoRotate = true;
int ret = runtime_info_get_value_bool(RUNTIME_INFO_KEY_AUTO_ROTATION_ENABLED, &autoRotate);
_Window* pCurrentFrame = GetCurrentFrame();
if (pCurrentFrame)
{
- _EcoreEvas* pEcoreEvas = ::GetEcoreEvasMgr()->GetEcoreEvas();
- if (pEcoreEvas)
- {
- SysLog(NID_UI, "[Window Manager Rotation] ROTATION_UNKNOWN");
- device_rotation = pEcoreEvas->GetWindowRotation(*pCurrentFrame);
- }
+ device_rotation = pCurrentFrame->GetRotation();
}
}
break;
}
return ::Convert(device_rotation);
- }
-#endif
+ }
}
void
}
__status = status;
-#ifdef BUILD_BREAK
- pEcoreEvas->AllowSetWindowBounds(false);
+
+ //pEcoreEvas->AllowSetWindowBounds(false);
FireEvent(status);
- pEcoreEvas->AllowSetWindowBounds(true);
-#endif
+ //pEcoreEvas->AllowSetWindowBounds(true);
+
// For the form to be made by Ui-Builder
if ((draw == true) && (__statusChanged == true))
{
// Invalidate
SysLog(NID_UI, "[Window Manager Rotation] ---------- UpdateOrientation : START ----------");
-#ifdef BUILD_BREAK
- _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
- if (!pEcoreEvas)
- {
- return;
- }
_ControlImpl* pImpl = _ControlImpl::GetInstance(__publicControl);
if (!pImpl)
return;
}
- int rotation = pEcoreEvas->GetWindowRotation(*pRootWindow);
+ int rotation = pRootWindow->GetRotation();
OrientationStatus status = ORIENTATION_STATUS_NONE;
switch (rotation)
{
__status = status;
- pEcoreEvas->AllowSetWindowBounds(false);
+ //pEcoreEvas->AllowSetWindowBounds(false);
FireEvent(status, true);
- pEcoreEvas->AllowSetWindowBounds(true);
+ //pEcoreEvas->AllowSetWindowBounds(true);
// For the form to be made by Ui-Builder
if ((__draw == true) && (__statusChanged == true))
}
}
- pEcoreEvas->RotateWindow(*pRootWindow, rotation, false);
+ //pEcoreEvas->RotateWindow(*pRootWindow, rotation, false);
if (__statusChanged == true)
{
SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x, rot = %d, %d, %d, %d, %d] Update Orientation.", pRootWindow->GetNativeHandle(), rotation, bounds.x, bounds.y, bounds.width, bounds.height);
SysLog(NID_UI, "[Window Manager Rotation] ---------- UpdateOrientation : END ----------");
-#endif
+
}
void
}
void
-_Window::OnOrientationChanged(void)
+_Window::OnOrientationChanged(int orientation)
{
-#ifdef BUILD_BREAK
// <0>
// Update rotation
// <1>
// Rotate window
SetOrientationCallbackModeEnabled(true);
- _EcoreEvas* pEcoreEvas = GetEcoreEvasMgr()->GetEcoreEvas();
- if (!pEcoreEvas)
- {
- return;
- }
-
- int rotation = pEcoreEvas->GetWindowRotation(*this);
Rectangle winBounds = GetBounds();
- SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x, %d, %d, %d, %d] OnWindowStateChanged : prev rot = %d, cur rot = %d", GetNativeHandle(), winBounds.x, winBounds.y, winBounds.width, winBounds.height, __rotation, rotation);
+ SysLog(NID_UI, "[Window Manager Rotation][Window : 0x%x, %d, %d, %d, %d] OnOrientationChanged : prev rot = %d, cur rot = %d", GetNativeHandle(), winBounds.x, winBounds.y, winBounds.width, winBounds.height, __rotation, orientation);
- if (rotation == __rotation)
+ if (orientation == __rotation)
{
return;
}
- __rotation = rotation;
+ __rotation = orientation;
+
+ if (__pLayer)
+ {
+ __pLayer->SetOrientationChanged(__rotation);
+ }
// <1>
int childCount = GetChildCount();
// <3>
SysLog(NID_UI, "[Window Manager Rotation] ---------- Update Ownee Window : START ----------");
- _ControlOrientation controlOrientation = (rotation == 0 || rotation == 180) ? _CONTROL_ORIENTATION_PORTRAIT : _CONTROL_ORIENTATION_LANDSCAPE;
+ _ControlOrientation controlOrientation = (__rotation == 0 || __rotation == 180) ? _CONTROL_ORIENTATION_PORTRAIT : _CONTROL_ORIENTATION_LANDSCAPE;
ChangeLayout(controlOrientation, false);
_ControlRotation controlRotation = _CONTROL_ROTATION_0;
- switch (rotation)
+ switch (__rotation)
{
case 0:
controlRotation = _CONTROL_ROTATION_0;
default:
break;
}
+
ChangeLayout(controlRotation);
- pEcoreEvas->RotateWindow(*this, __rotation, false);
+ //pEcoreEvas->RotateWindow(*this, __rotation, false);
Invalidate(true);
SysLog(NID_UI, "[Window Manager Rotation] ---------- Update Ownee Window : END ----------");
SetOrientationCallbackModeEnabled(false);
-#endif
+
}
void
__rotation = rotation;
}
+int
+_Window::GetRotation(void)
+{
+ return __rotation;
+}
+
_WindowType
_Window::GetWindowType(void)
{
if (rawEvent.rawWindow == pWindow->GetNativeHandle())
{
- pWindow->OnOrientationChanged();
+ pWindow->OnOrientationChanged(rawEvent.data.rotate.angle);
break;
}
}
pEcoreXWindow->SetOrientation(rotationInfo);
}
-
- pGlLayer->SetOrientationChanged(pEvent->data.l[1]);
}
_RawEvent rawEvent;
{
if (pIndicator)
{
+ pIndicator->SetIndicatorOrientation(orientation);
if (orientation == _CONTROL_ORIENTATION_PORTRAIT)
{
pIndicator->SetBounds(FloatRectangle(0.0f, 0.0f, GetClientBoundsF().width, indicatorheight));
{
GetCore().SetIndicatorShowState(false);
}
+
if (pIndicator)
{
pIndicator->OnChangeLayout(orientation);
}
-
float adjHeight = 0.0f;
if (GetCore().HasHeader())
#include "FUiCtrl_Form.h"
#include "FUiCtrl_Indicator.h"
#include "FUiAnim_ControlVisualElement.h"
+#include "FUi_UiEventManager.h"
using namespace Tizen::Base::Runtime;
using namespace Tizen::Graphics;
_Indicator::~_Indicator(void)
{
_IndicatorManager::GetInstance()->RemoveIndicatorSurfaceEventListener(this);
+ //_UiEventManager::GetInstance()->RemoveTouchEventListener(*this);
}
result
}
}
+ //_UiEventManager::GetInstance()->AddTouchEventListener(*this);
+
return r;
}
}
}
+void
+_Indicator::SetIndicatorOrientation(Tizen::Ui::_ControlOrientation orientation)
+{
+ __orientation = orientation;
+}
+
result
_Indicator::SetNotificationTrayOpenEnabled(bool enable)
{
#include "FUi_UiTouchEvent.h"
#include "FUiAnim_ControlVisualElement.h"
#include "FUiCtrl_IndicatorManager.h"
+#include "FUi_ITouchEventListener.h"
namespace Tizen { namespace Ui { namespace Controls {
enum _IndicatorOpacity
class _Indicator
: public Tizen::Ui::Animations::_ControlVisualElement
, public _IIndicatorSurfaceEventListener
+ , public Tizen::Ui::_ITouchEventListener
{
public:
_Indicator(void);
void SetIndicatorAutoHide(bool portrait, bool landscape);
bool GetIndicatorAutoHide(void) const;
+ void SetIndicatorOrientation(Tizen::Ui::_ControlOrientation orientation);
+
result SetNotificationTrayOpenEnabled(bool enable);
bool IsNotificationTrayOpenEnabled(void) const;
-
virtual bool OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo);
virtual bool OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo);
virtual bool OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo);
virtual bool OnTouchCanceled(const _Control& source, const _TouchInfo& touchinfo);
+
virtual bool OnFocusGained(const _Control& source);
virtual bool OnFocusLost(const _Control& source);
void OnChangeLayout(_ControlOrientation orientation);
- result OnAttachedToMainTree(void);
+ result OnAttachedToMainTree(void);
virtual void OnPortraitSurfaceContentUpdated(void);
virtual void OnLandscapeSurfaceContentUpdated(void);
virtual result CreateLayer(void);
virtual bool IsLayoutChangable(void) const;
void SetRotation(int rotation);
+ int GetRotation(void);
_WindowType GetWindowType(void);
// Focus
virtual result OnAttachingToMainTree(const _Control* pParent);
virtual result OnDetachingFromMainTree(void);
virtual void OnFocusableStateChanged(bool focusalbeState);
- virtual void OnOrientationChanged(void);
+ virtual void OnOrientationChanged(int orientation);
virtual void OnTouchCaptureGained(void);
virtual void OnTouchCaptureLost(void);
void SetPreferredRotation(bool enable);
TARGET_LINK_LIBRARIES(${this_target} "-lappcore-common" )
TARGET_LINK_LIBRARIES(${this_target} "-lappcore-efl" )
TARGET_LINK_LIBRARIES(${this_target} "-lappsvc" )
+TARGET_LINK_LIBRARIES(${this_target} "-lsensor" )
TARGET_LINK_LIBRARIES(${this_target} "-lX11" )
TARGET_LINK_LIBRARIES(${this_target} "-lXdamage" )
TARGET_LINK_LIBRARIES(${this_target} "-lvconf" )