static void
_elm_button_smart_sizing_eval(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
{
- Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
+ Elm_Widget_Smart_Data *wd = eo_data_scope_get(obj, ELM_OBJ_WIDGET_CLASS);
Evas_Coord minw = -1, minh = -1;
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
if (ret) *ret = EINA_FALSE;
Eina_Bool int_ret = EINA_FALSE;
- eo_do_super(obj, elm_wdg_theme(&int_ret));
+ eo_do_super(obj, MY_CLASS, elm_wdg_theme(&int_ret));
if (!int_ret) return;
-
_icon_signal_emit(obj);
if (ret) *ret = EINA_TRUE;
if (ret) *ret = EINA_FALSE;
Eina_Bool int_ret = EINA_FALSE;
- eo_do_super(obj, elm_wdg_sub_object_del(sobj, &int_ret));
+ eo_do_super(obj, MY_CLASS, elm_wdg_sub_object_del(sobj, &int_ret));
if (!int_ret) return;
_icon_signal_emit(obj);
if (ret) *ret = EINA_FALSE;
Eina_Bool int_ret = EINA_FALSE;
- eo_do_super(obj, elm_obj_container_content_set(part, content, &int_ret));
+ eo_do_super(obj, MY_CLASS, elm_obj_container_content_set(part, content, &int_ret));
if (!int_ret) return;
_icon_signal_emit(obj);
}
static void
-_elm_button_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
+_elm_button_smart_add(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
{
- Elm_Button_Smart_Data *priv = _pd;
- Elm_Widget_Smart_Data *wd = eo_data_get(obj, ELM_OBJ_WIDGET_CLASS);
+ Elm_Widget_Smart_Data *wd = eo_data_scope_get(obj, ELM_OBJ_WIDGET_CLASS);
+
+ eo_do_super(obj, MY_CLASS, evas_obj_smart_add());
- eo_do_super(obj, evas_obj_smart_add());
+ elm_widget_sub_object_add(eo_parent_get(obj), obj);
edje_object_signal_callback_add
(wd->resize_obj, "elm,action,click", "",
_elm_access_callback_set
(_elm_access_object_get(obj), ELM_ACCESS_INFO, _access_info_cb, NULL);
_elm_access_callback_set
- (_elm_access_object_get(obj), ELM_ACCESS_STATE, _access_state_cb, priv);
+ (_elm_access_object_get(obj), ELM_ACCESS_STATE, _access_state_cb, obj);
elm_widget_can_focus_set(obj, EINA_TRUE);
-
- elm_layout_theme_set(obj, "button", "base", elm_widget_style_get(obj));
+ if (!elm_layout_theme_set(obj, "button", "base", elm_widget_style_get(obj)))
+ CRITICAL("Failed to set layout!");
}
static void
static void
_constructor(Eo *obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
{
- eo_do_super(obj, eo_constructor());
+ eo_do_super(obj, MY_CLASS, eo_constructor());
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 void
EO_DEFINE_CLASS(elm_obj_button_class_get, &class_desc, ELM_OBJ_LAYOUT_CLASS, EVAS_SMART_CLICKABLE_INTERFACE, NULL);
-