static void _index_box_clear(Evas_Object *obj, Evas_Object *box, int level);
static void _item_free(Elm_Index_Item *it);
+static const char SIG_CHANGED[] = "changed";
+static const char SIG_DELAY_CHANGED[] = "delay,changed";
+static const char SIG_SELECTED[] = "selected";
+static const char SIG_LEVEL_UP[] = "level,up";
+static const char SIG_LEVEL_DOWN[] = "level,down";
+
+static const Evas_Smart_Cb_Description _signals[] = {
+ {SIG_CHANGED, ""},
+ {SIG_DELAY_CHANGED, ""},
+ {SIG_SELECTED, ""},
+ {SIG_LEVEL_UP, ""},
+ {SIG_LEVEL_DOWN, ""},
+ {NULL, NULL}
+};
+
static void
_del_pre_hook(Evas_Object *obj)
{
if (!wd) return ECORE_CALLBACK_CANCEL;
wd->delay = NULL;
d = (void *)elm_index_item_selected_get(data, wd->level);
- if (d) evas_object_smart_callback_call(data, "delay,changed", d);
+ if (d) evas_object_smart_callback_call(data, SIG_DELAY_CHANGED, d);
return ECORE_CALLBACK_CANCEL;
}
selectraise = edje_object_data_get(it->base.view, "selectraise");
if ((selectraise) && (!strcmp(selectraise, "on")))
evas_object_raise(it->base.view);
- evas_object_smart_callback_call((void *)obj, "changed", (void *)it->base.data);
+ evas_object_smart_callback_call((void *)obj, SIG_CHANGED, (void *)it->base.data);
if (wd->delay) ecore_timer_del(wd->delay);
wd->delay = ecore_timer_add(0.2, _delay_change, obj);
}
if (ev->button != 1) return;
wd->down = 0;
d = (void *)elm_index_item_selected_get(data, wd->level);
- if (d) evas_object_smart_callback_call(data, "selected", d);
+ if (d) evas_object_smart_callback_call(data, SIG_SELECTED, d);
elm_index_active_set(data, 0);
edje_object_signal_emit(wd->base, "elm,state,level,0", "elm");
}
wd->level = 1;
snprintf(buf, sizeof(buf), "elm,state,level,%i", wd->level);
edje_object_signal_emit(wd->base, buf, "elm");
- evas_object_smart_callback_call(data, "level,up", NULL);
+ evas_object_smart_callback_call(data, SIG_LEVEL_UP, NULL);
}
}
else
wd->level = 0;
snprintf(buf, sizeof(buf), "elm,state,level,%i", wd->level);
edje_object_signal_emit(wd->base, buf, "elm");
- evas_object_smart_callback_call(data, "level,down", NULL);
+ evas_object_smart_callback_call(data, SIG_LEVEL_DOWN, NULL);
}
}
}
evas_object_show(wd->bx[1]);
}
+ evas_object_smart_callbacks_descriptions_set(obj, _signals);
+
_mirrored_set(obj, elm_widget_mirrored_get(obj));
_sizing_eval(obj);
return obj;
Evas_Callback_Type type, void *event_info);
static Eina_Bool _deselect_all_items(Widget_Data *wd);
+static const char SIG_CLICKED_DOUBLE[] = "clicked,double";
+static const char SIG_SELECTED[] = "selected";
+static const char SIG_UNSELECTED[] = "unselected";
+static const char SIG_LONGPRESSED[] = "longpressed";
+static const char SIG_SCROLL_EDGE_TOP[] = "scroll,edge,top";
+static const char SIG_SCROLL_EDGE_BOTTOM[] = "scroll,edge,bottom";
+static const char SIG_SCROLL_EDGE_LEFT[] = "scroll,edge,left";
+static const char SIG_SCROLL_EDGE_RIGHT[] = "scroll,edge,right";
+
+static const Evas_Smart_Cb_Description _signals[] = {
+ {SIG_CLICKED_DOUBLE, ""},
+ {SIG_SELECTED, ""},
+ {SIG_UNSELECTED, ""},
+ {SIG_LONGPRESSED, ""},
+ {SIG_SCROLL_EDGE_TOP, ""},
+ {SIG_SCROLL_EDGE_BOTTOM, ""},
+ {SIG_SCROLL_EDGE_LEFT, ""},
+ {SIG_SCROLL_EDGE_RIGHT, ""},
+ {NULL, NULL}
+};
+
#define ELM_LIST_ITEM_CHECK_DELETED_RETURN(it, ...) \
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(it, __VA_ARGS__); \
if (it->deleted) \
return __VA_ARGS__; \
}
+
+
static inline void
_elm_list_item_free(Elm_List_Item *it)
{
_elm_list_walk(wd);
if (it->func) it->func((void *)it->base.data, it->base.widget, it);
- evas_object_smart_callback_call(obj, "selected", it);
+ evas_object_smart_callback_call(obj, SIG_SELECTED, it);
it->wd->last_selected_item = it;
_elm_list_unwalk(wd);
{
it->selected = EINA_FALSE;
wd->selected = eina_list_remove(wd->selected, it);
- evas_object_smart_callback_call(it->base.widget, "unselected", it);
+ evas_object_smart_callback_call(it->base.widget, SIG_UNSELECTED, it);
}
_elm_list_unwalk(wd);
_scroll_edge_left(void *data, Evas_Object *scr __UNUSED__, void *event_info __UNUSED__)
{
Evas_Object *obj = data;
- evas_object_smart_callback_call(obj, "scroll,edge,left", NULL);
+ evas_object_smart_callback_call(obj, SIG_SCROLL_EDGE_LEFT, NULL);
}
static void
_scroll_edge_right(void *data, Evas_Object *scr __UNUSED__, void *event_info __UNUSED__)
{
Evas_Object *obj = data;
- evas_object_smart_callback_call(obj, "scroll,edge,right", NULL);
+ evas_object_smart_callback_call(obj, SIG_SCROLL_EDGE_RIGHT, NULL);
}
static void
_scroll_edge_top(void *data, Evas_Object *scr __UNUSED__, void *event_info __UNUSED__)
{
Evas_Object *obj = data;
- evas_object_smart_callback_call(obj, "scroll,edge,top", NULL);
+ evas_object_smart_callback_call(obj, SIG_SCROLL_EDGE_TOP, NULL);
}
static void
_scroll_edge_bottom(void *data, Evas_Object *scr __UNUSED__, void *event_info __UNUSED__)
{
Evas_Object *obj = data;
- evas_object_smart_callback_call(obj, "scroll,edge,bottom", NULL);
+ evas_object_smart_callback_call(obj, SIG_SCROLL_EDGE_BOTTOM, NULL);
}
static Eina_Bool
if (it->disabled) goto end;
wd->longpressed = EINA_TRUE;
- evas_object_smart_callback_call(it->base.widget, "longpressed", it);
+ evas_object_smart_callback_call(it->base.widget, SIG_LONGPRESSED, it);
end:
return ECORE_CALLBACK_CANCEL;
/* Always call the callbacks last - the user may delete our context! */
if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK)
{
- evas_object_smart_callback_call(it->base.widget, "clicked,double", it);
+ evas_object_smart_callback_call(it->base.widget, SIG_CLICKED_DOUBLE, it);
evas_object_smart_callback_call(it->base.widget, "clicked", it); // will be removed
}
wd->swipe = EINA_FALSE;
evas_object_smart_callback_add(obj, "scroll-freeze-on", _freeze_on, obj);
evas_object_smart_callback_add(obj, "scroll-freeze-off", _freeze_off, obj);
+ evas_object_smart_callbacks_descriptions_set(obj, _signals);
+
_mirrored_set(obj, elm_widget_mirrored_get(obj));
_sizing_eval(obj);
return obj;
static void _parent_del(void *data, Evas *e, Evas_Object *obj, void *event_info);
static void _menu_hide(void *data, Evas_Object *obj, void *event_info);
+static const char SIG_CLICKED[] = "clicked";
+
+static const Evas_Smart_Cb_Description _signals[] = {
+ {SIG_CLICKED, ""},
+ {NULL, NULL}
+};
+
+
static void
_del_item(Elm_Menu_Item *item)
{
_hover_clicked_cb(void *data, Evas_Object *obj, void *event_info)
{
_menu_hide(data, obj, event_info);
- evas_object_smart_callback_call(data, "clicked", NULL);
+ evas_object_smart_callback_call(data, SIG_CLICKED, NULL);
}
static void
evas_object_event_callback_add(wd->bx, EVAS_CALLBACK_RESIZE, _menu_resize, obj);
+ evas_object_smart_callbacks_descriptions_set(obj, _signals);
+
_sizing_eval(obj);
return obj;
}
static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info);
static void _sub_del(void *data, Evas_Object *obj, void *event_info);
+static const char SIG_HIDE_FINISHED[] = "hide,finished";
+
+static const Evas_Smart_Cb_Description _signals[] = {
+ {SIG_HIDE_FINISHED, ""},
+ {NULL, NULL}
+};
+
+
static void
_del_hook(Evas_Object *obj)
{
Evas_Object *obj2 = it->obj;
evas_object_hide(it->base);
edje_object_signal_emit(it->base, "elm,action,reset", "elm");
- evas_object_smart_callback_call(obj2, "hide,finished", it->content);
+ evas_object_smart_callback_call(obj2, SIG_HIDE_FINISHED, it->content);
edje_object_message_signal_process(it->base);
evas_object_hide(it->content);
if (it->popme) evas_object_del(it->content);
evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
+ evas_object_smart_callbacks_descriptions_set(obj, _signals);
+
_mirrored_set(obj, elm_widget_mirrored_get(obj));
_sizing_eval(obj);
return obj;