__orientationStatus = orientationStatus;
}
+_ControlRotation
+_ControlManager::GetOrientationStatus(void) const
+{
+ return __orientationStatus;
+}
+
void
_ControlManager::RotateScreen(const _Control& control, _ControlRotation screenRotation)
{
GET_SHAPE_CONFIG(FORM::INDICATOR_HEIGHT, GetOrientation(), indicatorheight);
__pIndicator->SetBounds(FloatRectangle(0.0f, 0.0f, indicatorwidth, indicatorheight));
- r = AttachSystemChild(*__pIndicator);
- SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
r = GetLastResult();
SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
}
- if (_FORM_STYLE_INDICATOR & formStyle)
- {
- r = SetIndicatorShowState(true);
- SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
- }
- else if(FORM_STYLE_INDICATOR_AUTO_HIDE & formStyle)
- {
- r = SetIndicatorShowState(false, true);
- r = GetLastResult();
- SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
- }
- else
- {
- r = SetIndicatorShowState(false);
- SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
- }
}
result
int indicatorwidth = GetClientBounds().width;
int indicatorheight = 0;
- GET_SHAPE_CONFIG(FORM::INDICATOR_HEIGHT, GetOrientation(), indicatorheight);
+ if (GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT)
+ {
+ GET_SHAPE_CONFIG(FORM::INDICATOR_HEIGHT, GetOrientation(), indicatorheight);
+ }
+ else
+ {
+ GET_SHAPE_CONFIG(FORM::INDICATOR_MINIMIZE_HEIGHT, GetOrientation(), indicatorheight);
+ }
Rectangle rect (0, 0, indicatorwidth, indicatorheight);
float indicatorwidth = GetClientBoundsF().width;
float indicatorheight = 0.0f;
- GET_SHAPE_CONFIG(FORM::INDICATOR_HEIGHT, GetOrientation(), indicatorheight);
+ if (GetOrientation() == _CONTROL_ORIENTATION_PORTRAIT)
+ {
+ GET_SHAPE_CONFIG(FORM::INDICATOR_HEIGHT, GetOrientation(), indicatorheight);
+ }
+ else
+ {
+ GET_SHAPE_CONFIG(FORM::INDICATOR_MINIMIZE_HEIGHT, GetOrientation(), indicatorheight);
+ }
FloatRectangle rect (0.0f, 0.0f, indicatorwidth, indicatorheight);
if (FORM_STYLE_INDICATOR & formStyle)
{
+ GetCore().SetIndicatorShowState(true);
indicatorBounds = GetCore().GetIndicatorBoundsF();
r = GetLastResult();
SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+
+ }
+ else if(FORM_STYLE_INDICATOR_AUTO_HIDE & formStyle)
+ {
+ r = GetCore().SetIndicatorShowState(false, true);
+ SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+ }
+ else
+ {
+ r = GetCore().SetIndicatorShowState(false);
+ SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
}
if (formStyle & FORM_STYLE_HEADER)
}
}
+ _Indicator* pIndicator = GetCore().GetIndicator();
+ r = GetCore().AttachSystemChild(*pIndicator);
+ SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
+
if (formStyle & FORM_STYLE_TEXT_TAB)
{
float titleHeight = 0.0f;
_Indicator* pIndicator = GetCore().GetIndicator();
if (pIndicator)
{
- pIndicator->SetBounds(FloatRectangle(0.0f, 0.0f, GetClientBoundsF().width, indicatorheight));
+ if (orientation == _CONTROL_ORIENTATION_PORTRAIT)
+ {
+ pIndicator->SetBounds(FloatRectangle(0.0f, 0.0f, GetClientBoundsF().width, indicatorheight));
+ }
+ else
+ {
+ GET_SHAPE_CONFIG(FORM::INDICATOR_MINIMIZE_HEIGHT, GetCore().GetOrientation(), indicatorheight);
+ pIndicator->SetBounds(FloatRectangle(0.0f, 0.0f, GetClientBoundsF().width, indicatorheight));
+ }
}
GetCore().AdjustClientBounds();
}
static const char* pIndicatorKey = "Inidcator_Manager_Object";
static const int CONNECTION_INTERVAL = 1000;
+#define MSG_DOMAIN_CONTROL_INDICATOR 0x10001
+#define MSG_ID_INDICATOR_REPEAT_EVENT 0x10002
+#define MSG_ID_INDICATOR_ROTATION 0x10003
+#define MSG_ID_INDICATOR_OPACITY 0X1004
+#define MSG_ID_INDICATOR_TYPE 0X1005
+
+typedef enum
+{
+ INDICATOR_TYPE_UNKNOWN, /**< Unknown indicator type mode */
+ INDICATOR_TYPE_1, /**< Type 0 the the indicator */
+ INDICATOR_TYPE_2, /**< Type 1 the indicator */
+} IndicatorTypeMode;
+
_Indicator*
_Indicator::CreateIndicator(void)
{
}
else if (opacity == _INDICATOR_OPACITY_TRANSLUCENT)
{
- SetBackgroundColor(0x7f000000);
+ _ControlOrientation orientation = GetOrientation();
+
+ if (orientation == _CONTROL_ORIENTATION_PORTRAIT)
+ {
+ SetBackgroundColor(0x7f000000);
+ }
+ else
+ {
+ SetBackgroundColor(0x00000000);
+ }
}
__opacity = opacity;
ecore_evas_data_set(pEe, pIndicatorKey, this);
ecore_evas_callback_delete_request_set(pEe, _Indicator::OnDisconnected);
+ ecore_evas_callback_msg_handle_set(pEe, _Indicator::OnMessageHandle);
+
+ _ControlRotation controlRotation = _ControlManager::GetInstance()->GetOrientationStatus();
+ int rotation = 0;
+
+ switch(controlRotation)
+ {
+ case _CONTROL_ROTATION_0 :
+ rotation = 0;
+ break;
+ case _CONTROL_ROTATION_90 :
+ rotation = 90;
+ break;
+ case _CONTROL_ROTATION_180 :
+ rotation = 180;
+ break;
+ case _CONTROL_ROTATION_270 :
+ rotation = 270;
+ break;
+ default :
+ break;
+ }
+ ecore_evas_msg_parent_send(pEe, MSG_DOMAIN_CONTROL_INDICATOR, MSG_ID_INDICATOR_ROTATION, &rotation, sizeof(int));
+
return r;
}
if (orientation == _CONTROL_ORIENTATION_PORTRAIT)
{
ChangeCurrentVisualElement(__pPortraitVisualElement);
+ SetClipChildrenEnabled(true);
}
else
{
ChangeCurrentVisualElement(__pLandscapeVisualElement);
+ SetClipChildrenEnabled(false);
+ }
+ SetIndicatorOpacity(__opacity);
+
+ _ControlRotation controlRotation = _ControlManager::GetInstance()->GetOrientationStatus();
+ int rotation = 0;
+ Ecore_Evas *pEe = ecore_evas_object_ecore_evas_get(__pPortraitIndicatorEvasObject);
+ SysTryReturnVoidResult(NID_UI_CTRL, pEe, E_SYSTEM, "[E_SYSTEM] Unable to get evas.");
+
+ switch(controlRotation)
+ {
+ case _CONTROL_ROTATION_0 :
+ rotation = 0;
+ break;
+ case _CONTROL_ROTATION_90 :
+ rotation = 90;
+ break;
+ case _CONTROL_ROTATION_180 :
+ rotation = 180;
+ break;
+ case _CONTROL_ROTATION_270 :
+ rotation = 270;
+ break;
+ default :
+ break;
}
+ ecore_evas_msg_parent_send(pEe, MSG_DOMAIN_CONTROL_INDICATOR, MSG_ID_INDICATOR_ROTATION, &rotation, sizeof(int));
}
result
}
}
+void
+_Indicator::OnMessageHandle(Ecore_Evas *pEe, int msgDomain, int msgId, void *data, int size)
+{
+ if (!data)
+ {
+ return;
+ }
+
+ if (msgDomain == MSG_DOMAIN_CONTROL_INDICATOR)
+ {
+ /*if (msg_id == MSG_ID_INDICATOR_REPEAT_EVENT)
+ {
+ int *repeat = static_cast<int*>(data);
+ }*/
+ if (msgId == MSG_ID_INDICATOR_TYPE)
+ {
+ IndicatorTypeMode *pIndicatorTypeMode = (IndicatorTypeMode*)(data);
+
+ _Window* pWindow = _ControlManager::GetInstance()->_ControlManager::GetCurrentFrame();
+ SysTryReturnVoidResult(NID_UI_CTRL, pWindow, E_INVALID_STATE, "[E_INVALID_STATE] Indicator is not attached main tree.");
+
+ Ecore_X_Window win = (Ecore_X_Window)pWindow->GetNativeHandle();
+
+ if (*pIndicatorTypeMode == INDICATOR_TYPE_1)
+ {
+ ecore_x_e_illume_indicator_type_set(win, ECORE_X_ILLUME_INDICATOR_TYPE_1);
+ }
+ else if (*pIndicatorTypeMode == INDICATOR_TYPE_2)
+ {
+ ecore_x_e_illume_indicator_type_set (win, ECORE_X_ILLUME_INDICATOR_TYPE_2);
+ }
+ }
+ }
+}
+
}}} // Tizen::Ui::Controls
virtual result OnAttachedToMainTree(void);
virtual void OnTimerExpired(Tizen::Base::Runtime::Timer& timer);
static void OnDisconnected(Ecore_Evas *pEe);
+ static void OnMessageHandle(Ecore_Evas *pEe, int msgDomain, int msgId, void *data, int size);
private:
_Indicator(const _Indicator& value);
// Do not use. System only.
void SetOrientationStatus(_ControlRotation orientationStatus);
+ _ControlRotation GetOrientationStatus(void) const;
void RotateScreen(const _Control& control, _ControlRotation screenRotation);
void OnScreenRotated(int rotation);
void OnWindowRotated(int rotation);
ADD_SHAPE_CONFIG(INDICATOR_HEIGHT, 60);
END_UI_CONFIG_MODE(1280x720);
+ START_UI_CONFIG_MODE(1280x720);
+ ADD_SHAPE_CONFIG(INDICATOR_MINIMIZE_WIDTH, _SCREEN_HEIGHT_);
+ ADD_SHAPE_CONFIG(INDICATOR_MINIMIZE_HEIGHT, 21);
+ END_UI_CONFIG_MODE(1280x720);
+
+ START_UI_CONFIG_MODE(800x480);
+ ADD_SHAPE_CONFIG(INDICATOR_MINIMIZE_WIDTH, _SCREEN_HEIGHT_);
+ ADD_SHAPE_CONFIG(INDICATOR_MINIMIZE_HEIGHT, 14);
+ END_UI_CONFIG_MODE(800x480);
+
}
END_UI_CONFIG(FORM);