let elm_wdg_orientation_set() have return value and call the elm_wdg_theme() inside.
since every widgets tend to do same task with smart_theme() when it's orient mode is changed.
SVN revision: 83981
}
static void
-_theme_update(Evas_Object *obj, Elm_Naviframe_Smart_Data *sd)
+_elm_naviframe_smart_theme(Eo *obj, void *_pd, va_list *list)
{
Elm_Naviframe_Item *it;
+ Elm_Naviframe_Smart_Data *sd = _pd;
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Eina_Bool int_ret = EINA_FALSE;
+ eo_do_super(obj, elm_wdg_theme(&int_ret));
+ if (!int_ret) return;
EINA_INLIST_FOREACH(sd->stack, it)
{
}
elm_layout_sizing_eval(obj);
-}
-
-static void
-_elm_naviframe_smart_theme(Eo *obj, void *_pd, va_list *list)
-{
- Eina_Bool *ret = va_arg(*list, Eina_Bool *);
- Eina_Bool int_ret = EINA_FALSE;
- eo_do_super(obj, elm_wdg_theme(&int_ret));
- if (!int_ret) return;
- _theme_update(obj, _pd);
if (ret) *ret = EINA_TRUE;
}
-static void
-_elm_naviframe_smart_orientation_set(Eo *obj, void *_pd, va_list *list)
-{
- int rotation = va_arg(*list, int);
- eo_do_super(obj, elm_wdg_orientation_set(rotation));
- //TODO: Deffered Updation. update only top item.
- _theme_update(obj, _pd);
-}
-
static char *
_access_info_cb(void *data, Evas_Object *obj __UNUSED__)
{
evas_object_event_callback_add(obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_on_obj_size_hints_changed, obj);
elm_widget_can_focus_set(obj, EINA_FALSE);
+
+ if (!elm_widget_sub_object_add(eo_parent_get(obj), obj))
+ ERR("could not add %p as sub object of %p", obj, eo_parent_get(obj));
}
static Eina_Bool
eo_do(obj,
evas_obj_type_set(MY_CLASS_NAME),
evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
-
- Evas_Object *parent = eo_parent_get(obj);
- if (!elm_widget_sub_object_add(parent, obj))
- ERR("could not add %p as sub object of %p", obj, parent);
}
EAPI Elm_Object_Item *
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT), _elm_naviframe_smart_focus_next),
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_naviframe_smart_theme),
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ACCESS), _elm_naviframe_smart_access),
- EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ORIENTATION_SET), _elm_naviframe_smart_orientation_set),
EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_SET), _elm_naviframe_smart_content_set),
EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_GET), _elm_naviframe_smart_content_get),
Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
eo_do_super(obj, evas_obj_smart_add());
- elm_layout_theme_set(obj, "popup", "base", elm_widget_style_get(obj));
-
evas_object_size_hint_weight_set
(wd->resize_obj, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set
(wd->resize_obj, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ if (!elm_widget_sub_object_add(eo_parent_get(obj), obj))
+ ERR("could not add %p as sub object of %p", obj, eo_parent_get(obj));
+
+ elm_layout_theme_set(obj, "popup", "base", elm_widget_style_get(obj));
priv->notify = elm_notify_add(obj);
elm_notify_align_set(priv->notify, 0.5, 0.5);
eo_do(obj,
evas_obj_type_set(MY_CLASS_NAME),
evas_obj_smart_callbacks_descriptions_set(_smart_callbacks, NULL));
-
- if (!elm_widget_sub_object_add(eo_parent_get(obj), obj))
- ERR("could not add %p as sub object of %p", obj, eo_parent_get(obj));
}
EAPI void
Eina_Bool *ret = va_arg(*list, Eina_Bool *);
if (ret) *ret = EINA_FALSE;
Eina_Bool int_ret = EINA_FALSE;
-
eo_do_super(obj, elm_wdg_theme(&int_ret));
if (!int_ret) return;
-
_icon_signal_emit(obj);
if (ret) *ret = EINA_TRUE;
}
static void
-_elm_button_smart_orientation_set(Eo *obj __UNUSED__, void *_pd __UNUSED__, va_list *list)
-
-{
- int rotation = va_arg(*list, int);
- eo_do_super(obj, elm_wdg_orientation_set(rotation));
- elm_layout_theme_set(obj, "button", "base", elm_widget_style_get(obj));
- _icon_signal_emit(obj);
-}
-
-static void
_class_constructor(Eo_Class *klass)
{
const Eo_Op_Func_Description func_desc[] = {
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ACTIVATE), _elm_button_smart_activate),
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_button_smart_focus_next_manager_is),
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_button_smart_focus_direction_manager_is),
- EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ORIENTATION_SET), _elm_button_smart_orientation_set),
EO_OP_FUNC(ELM_OBJ_CONTAINER_ID(ELM_OBJ_CONTAINER_SUB_ID_CONTENT_SET), _elm_button_smart_content_set),
}
static void
-_elm_label_smart_orientation_set(Eo *obj, void *_pd, va_list *list)
-{
- int rotation = va_arg(*list, int);
- Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
- Elm_Label_Smart_Data *sd = _pd;
-
- eo_do_super(obj, elm_wdg_orientation_set(rotation));
-
- elm_layout_theme_set(obj, "label", "base", elm_widget_style_get(obj));
- evas_event_freeze(evas_object_evas_get(obj));
- _label_format_set(wd->resize_obj, sd->format);
- _label_slide_change(obj);
- evas_event_thaw(evas_object_evas_get(obj));
- evas_event_thaw_eval(evas_object_evas_get(obj));
-}
-
-static void
_elm_label_smart_theme(Eo *obj, void *_pd, va_list *list)
{
Eina_Bool *ret = va_arg(*list, Eina_Bool *);
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_TRANSLATE), _elm_label_smart_translate),
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_label_smart_focus_next_manager_is),
EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_label_smart_focus_direction_manager_is),
- EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ORIENTATION_SET), _elm_label_smart_orientation_set),
EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_SIZING_EVAL), _elm_label_smart_sizing_eval),
EO_OP_FUNC(ELM_OBJ_LAYOUT_ID(ELM_OBJ_LAYOUT_SUB_ID_TEXT_SET), _elm_label_smart_text_set),
if (!elm_widget_sub_object_del(data, sobj)) return;
}
}
-
sd->subobjs = eina_list_append(sd->subobjs, sobj);
evas_object_data_set(sobj, "elm-parent", obj);
evas_object_event_callback_add
const char *welement = va_arg(*list, const char *);
const char *wstyle = va_arg(*list, const char *);
Eina_Bool *ret = va_arg(*list, Eina_Bool *);
+ Eina_Bool ret2 = EINA_FALSE;
Elm_Widget_Smart_Data *sd = _pd;
char buf[128];
- if (*ret) *ret = EINA_FALSE;
-
//Apply orientation styles.
if (welement)
{
strncpy(buf, welement, sizeof(buf));
break;
}
- *ret = _elm_theme_object_set(obj, edj, wname, buf, wstyle);
+ ret2 = _elm_theme_object_set(obj, edj, wname, buf, wstyle);
}
- if (!*ret)
+ if (!ret2)
{
- *ret = _elm_theme_object_set(obj, edj, wname, welement, wstyle);
- strncpy(buf, "elm,state,orient,default", sizeof(buf));
+ ret2 = _elm_theme_object_set(obj, edj, wname, welement, wstyle);
+ strncpy(buf, "elm,state,orient,0", sizeof(buf));
}
else
snprintf(buf, sizeof(buf), "elm,state,orient,%d", sd->orient_mode);
elm_object_signal_emit(obj, buf, "elm");
+
+ if (ret) *ret = ret2;
}
static void
if (!disabled)
{
- //Get current orient mode form it's parent otherwise, 0.
+ //Get current orient mode from it's parent otherwise, 0.
sd->orient_mode = 0;
ELM_WIDGET_DATA_GET(sd->parent_obj, sd_parent);
if (!sd_parent) orient_mode = 0;
else orient_mode = sd_parent->orient_mode;
}
- eo_do((Eo *) obj, elm_wdg_orientation_set(orient_mode));
+ eo_do((Eo *) obj, elm_wdg_orientation_set(orient_mode, NULL));
}
EAPI Eina_Bool
ELM_WIDGET_CHECK(obj);
ELM_WIDGET_DATA_GET(obj, sd);
if ((sd->orient_mode == rotation) || (sd->orient_mode == -1)) return;
- eo_do((Eo *) obj, elm_wdg_orientation_set(rotation));
+ eo_do((Eo *) obj, elm_wdg_orientation_set(rotation, NULL));
}
static void
Evas_Object *child;
Eina_List *l;
int orient_mode = va_arg(*list, int);
+ Eina_Bool *ret = va_arg(*list, Eina_Bool *);
Elm_Widget_Smart_Data *sd = _pd;
sd->orient_mode = orient_mode;
+ eo_do(obj, elm_wdg_theme(NULL));
+
EINA_LIST_FOREACH (sd->subobjs, l, child)
elm_widget_orientation_set(child, orient_mode);
+
+ if (ret) *ret = EINA_TRUE;
}
/**
*
* No description supplied by the EAPI.
*
+ * @param[in] degree
* @param[out] ret
*
*/
-#define elm_wdg_orientation_set(rotation) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ORIENTATION_SET), EO_TYPECHECK(int, rotation)
+#define elm_wdg_orientation_set(rotation, ret) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ORIENTATION_SET), EO_TYPECHECK(int, rotation), EO_TYPECHECK(Eina_Bool *, ret)
/**
* @def elm_wdg_orientation_mode_disabled_set