Elementary ui-mirroring: Added on-the-fly ui-mirroring infrastructure
SVN revision: 56845
This commit is contained in:
parent
863cd6e598
commit
f5cad764e6
|
@ -278,6 +278,8 @@ extern "C" {
|
|||
EAPI Eina_Bool elm_object_disabled_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||
EAPI Eina_Bool elm_widget_mirrored_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||
EAPI void elm_widget_mirrored_set(Evas_Object *obj, Eina_Bool mirrored) EINA_ARG_NONNULL(1);
|
||||
EAPI Eina_Bool elm_widget_mirrored_automatic_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||
EAPI void elm_widget_mirrored_automatic_set(Evas_Object *obj, Eina_Bool automatic) EINA_ARG_NONNULL(1);
|
||||
|
||||
EAPI Eina_Bool elm_object_widget_check(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||
EAPI Evas_Object *elm_object_parent_widget_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||
|
|
|
@ -1597,8 +1597,8 @@ elm_mirrored_get(void)
|
|||
EAPI void
|
||||
elm_mirrored_set(Eina_Bool mirrored)
|
||||
{
|
||||
/* TODO: Should update all interface */
|
||||
_elm_config->is_mirrored = mirrored;
|
||||
_elm_rescale();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -157,6 +157,7 @@ void _elm_widget_focus_region_show(const Evas_Object *obj);
|
|||
void _elm_unneed_ethumb(void);
|
||||
|
||||
void _elm_rescale(void);
|
||||
void _elm_widget_mirrored_reload(Evas_Object *obj);
|
||||
|
||||
void _elm_config_init(void);
|
||||
void _elm_config_sub_init(void);
|
||||
|
|
|
@ -77,6 +77,7 @@ struct _Smart_Data
|
|||
Eina_Bool highlight_in_theme : 1;
|
||||
Eina_Bool disabled : 1;
|
||||
Eina_Bool is_mirrored : 1;
|
||||
Eina_Bool mirrored_auto_mode : 1; /* This is TRUE by default */
|
||||
|
||||
Eina_List *focus_chain;
|
||||
Eina_List *event_cb;
|
||||
|
@ -562,6 +563,61 @@ elm_widget_mirrored_set(Evas_Object *obj, Eina_Bool mirrored)
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* Resets the mirrored mode from the system mirror mode for widgets that are in
|
||||
* automatic mirroring mode. This function does not call elm_widget_theme.
|
||||
*
|
||||
* @param obj The widget.
|
||||
* @param mirrored EINA_TRUE to set mirrored mode. EINA_FALSE to unset.
|
||||
*/
|
||||
void
|
||||
_elm_widget_mirrored_reload(Evas_Object *obj)
|
||||
{
|
||||
API_ENTRY return;
|
||||
Eina_Bool mirrored = elm_mirrored_get();
|
||||
if (elm_widget_mirrored_automatic_get(obj) && (sd->is_mirrored != mirrored))
|
||||
{
|
||||
sd->is_mirrored = mirrored;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the widget's mirrored mode setting.
|
||||
*
|
||||
* @param obj The widget.
|
||||
* @return mirrored mode setting of the object.
|
||||
*
|
||||
**/
|
||||
EAPI Eina_Bool
|
||||
elm_widget_mirrored_automatic_get(const Evas_Object *obj)
|
||||
{
|
||||
API_ENTRY return EINA_FALSE;
|
||||
return sd->mirrored_auto_mode;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the widget's mirrored mode setting.
|
||||
* When widget in automatic mode, it follows the system mirrored mode set by
|
||||
* elm_mirrored_set().
|
||||
* @param obj The widget.
|
||||
* @param automatic EINA_TRUE for auto mirrored mode. EINA_FALSE for manual.
|
||||
*/
|
||||
EAPI void
|
||||
elm_widget_mirrored_automatic_set(Evas_Object *obj, Eina_Bool automatic)
|
||||
{
|
||||
API_ENTRY return;
|
||||
if (sd->mirrored_auto_mode != automatic)
|
||||
{
|
||||
sd->mirrored_auto_mode = automatic;
|
||||
|
||||
if (automatic)
|
||||
{
|
||||
elm_widget_mirrored_set(obj, elm_mirrored_get());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EAPI void
|
||||
elm_widget_on_focus_hook_set(Evas_Object *obj, void (*func) (void *data, Evas_Object *obj), void *data)
|
||||
{
|
||||
|
@ -2456,6 +2512,7 @@ _smart_add(Evas_Object *obj)
|
|||
sd->obj = obj;
|
||||
sd->x = sd->y = sd->w = sd->h = 0;
|
||||
sd->can_focus = 1;
|
||||
sd->mirrored_auto_mode = EINA_TRUE; /* will follow system locale settings */
|
||||
evas_object_smart_data_set(obj, sd);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue