diff --git a/legacy/elementary/src/lib/Elementary.h.in b/legacy/elementary/src/lib/Elementary.h.in index c8c9ca2e8c..2003c0ec87 100644 --- a/legacy/elementary/src/lib/Elementary.h.in +++ b/legacy/elementary/src/lib/Elementary.h.in @@ -1388,7 +1388,6 @@ extern "C" { EAPI void elm_photo_editable_set(Evas_Object *obj, Eina_Bool set) EINA_ARG_NONNULL(1); /* smart callbacks called: * "clicked" - the user clicked the icon - * "drop" - Something was dropped on the widget * "drag,start" - Someone started dragging the image out of the object * "drag,end" - Dragged item was dropped (somewhere) */ @@ -2157,8 +2156,8 @@ extern "C" { * "clicked,double" - when mouse/finger double-clicked * "load" - when photo load begins * "loaded" - when photo load done - * "load,details" - when detailed image load begins - * "loaded,details" - when detailed image load done + * "load,detail" - when detailed image load begins + * "loaded,detail" - when detailed image load done * "zoom,start" - when zooming started * "zoom,stop" - when zooming stopped * "zoom,change" - when auto zoom mode changed zoom level @@ -2879,6 +2878,11 @@ extern "C" { EAPI Evas_Object *elm_segment_control_item_object_get(const Elm_Segment_Item *it) EINA_ARG_NONNULL(1); EAPI Elm_Segment_Item *elm_segment_control_item_selected_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); EAPI void elm_segment_control_item_selected_set(Elm_Segment_Item *it, Eina_Bool select) EINA_ARG_NONNULL(1); + /* smart callbacks called: + * "changed" -when the user clicks on a segment item which is not previously + * selected and get selected. The event_info parameter is the + * segment item index. + */ #ifdef __cplusplus } diff --git a/legacy/elementary/src/lib/elm_panes.c b/legacy/elementary/src/lib/elm_panes.c index 4337e0a5f0..421ee4f68f 100644 --- a/legacy/elementary/src/lib/elm_panes.c +++ b/legacy/elementary/src/lib/elm_panes.c @@ -36,6 +36,19 @@ static void _theme_hook(Evas_Object *obj); static void _sizing_eval(Evas_Object *obj); static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info); +static const char SIG_CLICKED[] = "clicked"; +static const char SIG_PRESS[] = "press"; +static const char SIG_UNPRESS[] = "unpress"; +static const char SIG_CLICKED_DOUBLE[] = "clicked,double"; + +static const Evas_Smart_Cb_Description _signals[] = { + {SIG_CLICKED, ""}, + {SIG_PRESS, ""}, + {SIG_UNPRESS, ""}, + {SIG_CLICKED_DOUBLE, ""}, + {NULL, NULL} +}; + static void _del_hook(Evas_Object *obj) { @@ -162,10 +175,11 @@ _sub_del(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __ } } + static void _clicked(void *data, Evas_Object *obj __UNUSED__ , const char *emission __UNUSED__, const char *source __UNUSED__) { - evas_object_smart_callback_call(data, "clicked", NULL); + evas_object_smart_callback_call(data, SIG_CLICKED, NULL); } static void @@ -179,18 +193,18 @@ _clicked_double(void *data, Evas_Object *obj __UNUSED__ , const char *emission _ static void _press(void *data, Evas_Object *obj __UNUSED__ , const char *emission __UNUSED__, const char *source __UNUSED__) { - evas_object_smart_callback_call(data, "press", NULL); + evas_object_smart_callback_call(data, SIG_PRESS, NULL); } static void _unpress(void *data, Evas_Object *obj __UNUSED__ , const char *emission __UNUSED__, const char *source __UNUSED__) { Widget_Data *wd = elm_widget_data_get(data); - evas_object_smart_callback_call(data, "unpress", NULL); + evas_object_smart_callback_call(data, SIG_UNPRESS, NULL); if (wd->clicked_double) { - evas_object_smart_callback_call(data, "clicked,double", NULL); + evas_object_smart_callback_call(data, SIG_CLICKED_DOUBLE, NULL); wd->clicked_double = EINA_FALSE; } } @@ -241,6 +255,8 @@ elm_panes_add(Evas_Object *parent) evas_object_event_callback_add(obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj); + evas_object_smart_callbacks_descriptions_set(obj, _signals); + _mirrored_set(obj, elm_widget_mirrored_get(obj)); _sizing_eval(obj); return obj; diff --git a/legacy/elementary/src/lib/elm_photo.c b/legacy/elementary/src/lib/elm_photo.c index d95f54963c..4cee1845ac 100644 --- a/legacy/elementary/src/lib/elm_photo.c +++ b/legacy/elementary/src/lib/elm_photo.c @@ -10,7 +10,6 @@ * Signals that you can add callbacks for are: * * "clicked" - This is called when a user has clicked the photo - * "drop" - Something was dropped on the widget * "drag,start" - Someone started dragging the image out of the object * "drag,end" - Dragged item was dropped (somewhere) */ @@ -34,6 +33,18 @@ static void _sizing_eval(Evas_Object *obj); static void _mouse_up(void *data, Evas *e, Evas_Object *obj, void *event_info); static void _mouse_move(void *data, Evas *e, Evas_Object *obj, void *event_info); +static const char SIG_CLICKED[] = "clicked"; +static const char SIG_DRAG_START[] = "drag,start"; +static const char SIG_DRAG_END[] = "drag,end"; + +static const Evas_Smart_Cb_Description _signals[] = { + {SIG_CLICKED, ""}, + {SIG_DRAG_START, ""}, + {SIG_DRAG_END, ""}, + {NULL, NULL} +}; + + static void _del_hook(Evas_Object *obj) { @@ -116,7 +127,7 @@ static void _drag_done_cb(void *unused __UNUSED__, Evas_Object *obj) { elm_object_scroll_freeze_pop(obj); - evas_object_smart_callback_call(obj, "drag,end", NULL); + evas_object_smart_callback_call(obj, SIG_DRAG_END, NULL); } static Eina_Bool @@ -144,7 +155,7 @@ _longpress(void *objv) } elm_object_scroll_freeze_push(objv); - evas_object_smart_callback_call(objv, "drag,start", NULL); + evas_object_smart_callback_call(objv, SIG_DRAG_START, NULL); return 0; /* Don't call again */ } @@ -197,7 +208,7 @@ _mouse_up(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *eve wd->longtimer = NULL; } - evas_object_smart_callback_call(data, "clicked", NULL); + evas_object_smart_callback_call(data, SIG_CLICKED, NULL); } @@ -257,6 +268,8 @@ elm_photo_add(Evas_Object *parent) evas_object_event_callback_add(icon, EVAS_CALLBACK_RESIZE, _icon_move_resize, obj); + evas_object_smart_callbacks_descriptions_set(obj, _signals); + _mirrored_set(obj, elm_widget_mirrored_get(obj)); _sizing_eval(obj); return obj; diff --git a/legacy/elementary/src/lib/elm_photocam.c b/legacy/elementary/src/lib/elm_photocam.c index 12d43b2142..eacc02f8e8 100644 --- a/legacy/elementary/src/lib/elm_photocam.c +++ b/legacy/elementary/src/lib/elm_photocam.c @@ -21,8 +21,8 @@ * "load" - Photo load begins. * "loaded" - This is called when the image file load is complete for the first * view (low resolution blurry version). - * "load,details" - Photo detailed data load begins. - * "loaded,details" - This is called when the image file load is complete for + * "load,detail" - Photo detailed data load begins. + * "loaded,detail" - This is called when the image file load is complete for * the detailed image data (full resolution needed). * "zoom,start" - Zoom animation started. * "zoom,stop" - Zoom animation stopped. @@ -135,6 +135,44 @@ static void grid_clear(Evas_Object *obj, Grid *g); static Grid *grid_create(Evas_Object *obj); static void grid_load(Evas_Object *obj, Grid *g); +static const char SIG_CLICKED[] = "clicked"; +static const char SIG_PRESS[] = "press"; +static const char SIG_LONGPRESSED[] = "longpressed"; +static const char SIG_CLICKED_DOUBLE[] = "clicked,double"; +static const char SIG_LOAD[] = "load"; +static const char SIG_LOADED[] = "loaded"; +static const char SIG_LOAD_DETAIL[] = "load,detail"; +static const char SIG_LOADED_DETAIL[] = "loaded,detail"; +static const char SIG_ZOOM_START[] = "zoom,start"; +static const char SIG_ZOOM_STOP[] = "zoom,stop"; +static const char SIG_ZOOM_CHANGE[] = "zoom,change"; +static const char SIG_SCROLL[] = "scroll"; +static const char SIG_SCROLL_ANIM_START[] = "scroll,anim,start"; +static const char SIG_SCROLL_ANIM_STOP[] = "scroll,anim,stop"; +static const char SIG_SCROLL_DRAG_START[] = "scroll,drag,start"; +static const char SIG_SCROLL_DRAG_STOP[] = "scroll,drag,stop"; + +static const Evas_Smart_Cb_Description _signals[] = { + {SIG_CLICKED, ""}, + {SIG_PRESS, ""}, + {SIG_LONGPRESSED, ""}, + {SIG_CLICKED_DOUBLE, ""}, + {SIG_LOAD, ""}, + {SIG_LOADED, ""}, + {SIG_LOAD_DETAIL, ""}, + {SIG_LOADED_DETAIL, ""}, + {SIG_ZOOM_START, ""}, + {SIG_ZOOM_STOP, ""}, + {SIG_ZOOM_CHANGE, ""}, + {SIG_SCROLL, ""}, + {SIG_SCROLL_ANIM_START, ""}, + {SIG_SCROLL_ANIM_STOP, ""}, + {SIG_SCROLL_DRAG_START, ""}, + {SIG_SCROLL_DRAG_STOP, ""}, + {NULL, NULL} +}; + + static int nearest_pow2(int num) { @@ -235,7 +273,7 @@ grid_clear(Evas_Object *obj, Grid *g) { edje_object_signal_emit(elm_smart_scroller_edje_object_get(wd->scr), "elm,state,busy,stop", "elm"); - evas_object_smart_callback_call(obj, "loaded,detail", NULL); + evas_object_smart_callback_call(obj, SIG_LOAD_DETAIL, NULL); } } } @@ -261,7 +299,7 @@ _tile_preloaded(void *data, Evas *e __UNUSED__, Evas_Object *o __UNUSED__, void { edje_object_signal_emit(elm_smart_scroller_edje_object_get(git->wd->scr), "elm,state,busy,stop", "elm"); - evas_object_smart_callback_call(git->wd->obj, "loaded,detail", NULL); + evas_object_smart_callback_call(git->wd->obj, SIG_LOADED_DETAIL, NULL); } } } @@ -401,7 +439,7 @@ grid_load(Evas_Object *obj, Grid *g) { edje_object_signal_emit(elm_smart_scroller_edje_object_get(wd->scr), "elm,state,busy,start", "elm"); - evas_object_smart_callback_call(obj, "load,detail", NULL); + evas_object_smart_callback_call(obj, SIG_LOAD_DETAIL, NULL); } } else if ((g->grid[tn].want) && (!visible)) @@ -411,7 +449,7 @@ grid_load(Evas_Object *obj, Grid *g) { edje_object_signal_emit(elm_smart_scroller_edje_object_get(wd->scr), "elm,state,busy,stop", "elm"); - evas_object_smart_callback_call(obj, "loaded,detail", NULL); + evas_object_smart_callback_call(obj, SIG_LOADED_DETAIL, NULL); } g->grid[tn].want = 0; evas_object_hide(g->grid[tn].img); @@ -525,13 +563,13 @@ _main_preloaded(void *data, Evas *e __UNUSED__, Evas_Object *o __UNUSED__, void } if (wd->calc_job) ecore_job_del(wd->calc_job); wd->calc_job = ecore_job_add(_calc_job, wd); - evas_object_smart_callback_call(data, "loaded", NULL); + evas_object_smart_callback_call(data, SIG_LOADED, NULL); wd->preload_num--; if (!wd->preload_num) { edje_object_signal_emit(elm_smart_scroller_edje_object_get(wd->scr), "elm,state,busy,stop", "elm"); - evas_object_smart_callback_call(obj, "loaded,detail", NULL); + evas_object_smart_callback_call(obj, SIG_LOADED_DETAIL, NULL); } } @@ -602,7 +640,7 @@ _zoom_anim(void *data) wd->nosmooth--; if (!wd->nosmooth) _smooth_update(data); wd->zoom_animator = NULL; - evas_object_smart_callback_call(obj, "zoom,stop", NULL); + evas_object_smart_callback_call(obj, SIG_ZOOM_STOP, NULL); } return go; } @@ -622,7 +660,7 @@ _long_press(void *data) if (!wd) return ECORE_CALLBACK_CANCEL; wd->long_timer = NULL; wd->longpressed = EINA_TRUE; - evas_object_smart_callback_call(data, "longpressed", NULL); + evas_object_smart_callback_call(data, SIG_LONGPRESSED, NULL); return ECORE_CALLBACK_CANCEL; } @@ -636,9 +674,9 @@ _mouse_down(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) wd->on_hold = EINA_TRUE; else wd->on_hold = EINA_FALSE; if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK) - evas_object_smart_callback_call(data, "clicked,double", NULL); + evas_object_smart_callback_call(data, SIG_CLICKED_DOUBLE, NULL); else - evas_object_smart_callback_call(data, "press", NULL); + evas_object_smart_callback_call(data, SIG_PRESS, NULL); wd->longpressed = EINA_FALSE; if (wd->long_timer) ecore_timer_del(wd->long_timer); wd->long_timer = ecore_timer_add(_elm_config->longpress_timeout, _long_press, data); @@ -659,7 +697,7 @@ _mouse_up(void *data, Evas *evas __UNUSED__, Evas_Object *obj __UNUSED__, void * wd->long_timer = NULL; } if (!wd->on_hold) - evas_object_smart_callback_call(data, "clicked", NULL); + evas_object_smart_callback_call(data, SIG_CLICKED, NULL); wd->on_hold = EINA_FALSE; } @@ -917,31 +955,31 @@ _freeze_off(void *data __UNUSED__, Evas_Object *obj, void *event_info __UNUSED__ static void _scr_anim_start(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - evas_object_smart_callback_call(data, "scroll,anim,start", NULL); + evas_object_smart_callback_call(data, SIG_SCROLL_ANIM_START, NULL); } static void _scr_anim_stop(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - evas_object_smart_callback_call(data, "scroll,anim,stop", NULL); + evas_object_smart_callback_call(data, SIG_SCROLL_ANIM_STOP, NULL); } static void _scr_drag_start(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - evas_object_smart_callback_call(data, "scroll,drag,start", NULL); + evas_object_smart_callback_call(data, SIG_SCROLL_DRAG_START, NULL); } static void _scr_drag_stop(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - evas_object_smart_callback_call(data, "scroll,drag,stop", NULL); + evas_object_smart_callback_call(data, SIG_SCROLL_DRAG_STOP, NULL); } static void _scr_scroll(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__) { - evas_object_smart_callback_call(data, "scroll", NULL); + evas_object_smart_callback_call(data, SIG_SCROLL, NULL); } static Eina_Bool @@ -1131,6 +1169,8 @@ elm_photocam_add(Evas_Object *parent) &minw, &minh); evas_object_size_hint_min_set(obj, minw, minh); + evas_object_smart_callbacks_descriptions_set(obj, _signals); + _sizing_eval(obj); return obj; } @@ -1185,13 +1225,13 @@ elm_photocam_file_set(Evas_Object *obj, const char *file) wd->main_load_pending = 1; if (wd->calc_job) ecore_job_del(wd->calc_job); wd->calc_job = ecore_job_add(_calc_job, wd); - evas_object_smart_callback_call(obj, "load", NULL); + evas_object_smart_callback_call(obj, SIG_LOAD, NULL); wd->preload_num++; if (wd->preload_num == 1) { edje_object_signal_emit(elm_smart_scroller_edje_object_get(wd->scr), "elm,state,busy,start", "elm"); - evas_object_smart_callback_call(obj, "load,detail", NULL); + evas_object_smart_callback_call(obj, SIG_LOAD_DETAIL, NULL); } { double tz = wd->zoom; @@ -1409,12 +1449,12 @@ done: if (!wd->paused) { if (started) - evas_object_smart_callback_call(obj, "zoom,start", NULL); + evas_object_smart_callback_call(obj, SIG_ZOOM_START, NULL); if (!an) - evas_object_smart_callback_call(obj, "zoom,stop", NULL); + evas_object_smart_callback_call(obj, SIG_ZOOM_STOP, NULL); } if (zoom_changed) - evas_object_smart_callback_call(obj, "zoom,change", NULL); + evas_object_smart_callback_call(obj, SIG_ZOOM_CHANGE, NULL); } /** @@ -1607,7 +1647,7 @@ elm_photocam_image_region_show(Evas_Object *obj, int x, int y, int w, int h __UN ecore_animator_del(wd->zoom_animator); wd->zoom_animator = NULL; zoom_do(obj, 1.0); - evas_object_smart_callback_call(obj, "zoom,stop", NULL); + evas_object_smart_callback_call(obj, SIG_ZOOM_STOP, NULL); } elm_smart_scroller_child_region_show(wd->scr, rx, ry, rw, rh); } @@ -1648,7 +1688,7 @@ elm_photocam_image_region_bring_in(Evas_Object *obj, int x, int y, int w, int h ecore_animator_del(wd->zoom_animator); wd->zoom_animator = NULL; zoom_do(obj, 1.0); - evas_object_smart_callback_call(obj, "zoom,stop", NULL); + evas_object_smart_callback_call(obj, SIG_ZOOM_STOP, NULL); } elm_smart_scroller_region_bring_in(wd->scr, rx, ry, rw, rh); } @@ -1680,7 +1720,7 @@ elm_photocam_paused_set(Evas_Object *obj, Eina_Bool paused) ecore_animator_del(wd->zoom_animator); wd->zoom_animator = NULL; zoom_do(obj, 1.0); - evas_object_smart_callback_call(obj, "zoom,stop", NULL); + evas_object_smart_callback_call(obj, SIG_ZOOM_STOP, NULL); } } } diff --git a/legacy/elementary/src/lib/elm_segment_control.c b/legacy/elementary/src/lib/elm_segment_control.c index 809b38d69d..9f7dc2979b 100644 --- a/legacy/elementary/src/lib/elm_segment_control.c +++ b/legacy/elementary/src/lib/elm_segment_control.c @@ -59,6 +59,13 @@ static Elm_Segment_Item * _item_find(const Evas_Object *obj, int index); static Elm_Segment_Item* _item_new(Evas_Object *obj, Evas_Object *icon, const char *label); +static const char SIG_CHANGED[] = "changed"; + +static const Evas_Smart_Cb_Description _signals[] = { + {SIG_CHANGED, ""}, + {NULL, NULL} +}; + static void _sizing_eval(Evas_Object *obj) { @@ -228,7 +235,7 @@ _segment_on(Elm_Segment_Item *it) edje_object_signal_emit(it->base.view, "elm,state,segment,selected", "elm"); wd->selected_item = it; - evas_object_smart_callback_call(wd->obj, "changed", (void*) it->seg_index); + evas_object_smart_callback_call(wd->obj, SIG_CHANGED, (void*) it->seg_index); } static void @@ -520,6 +527,9 @@ elm_segment_control_add(Evas_Object *parent) _on_move_resize, obj); evas_object_event_callback_add(obj, EVAS_CALLBACK_MOVE, _on_move_resize, obj); + + evas_object_smart_callbacks_descriptions_set(obj, _signals); + return obj; } diff --git a/legacy/elementary/src/lib/elm_slideshow.c b/legacy/elementary/src/lib/elm_slideshow.c index cd576ffc87..a571b48f96 100644 --- a/legacy/elementary/src/lib/elm_slideshow.c +++ b/legacy/elementary/src/lib/elm_slideshow.c @@ -65,6 +65,15 @@ static void _on_focus_hook(void *data, Evas_Object *obj); static Eina_Bool _event_hook(Evas_Object *obj, Evas_Object *src, Evas_Callback_Type type, void *event_info); +static const char SIG_CHANGED[] = "changed"; + +static const Evas_Smart_Cb_Description _signals[] = { + {SIG_CHANGED, ""}, + {NULL, NULL} +}; + + + static Eina_Bool _event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type type, void *event_info) { @@ -347,6 +356,8 @@ elm_slideshow_add(Evas_Object *parent) evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj); evas_object_event_callback_add(obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj); + evas_object_smart_callbacks_descriptions_set(obj, _signals); + _mirrored_set(obj, elm_widget_mirrored_get(obj)); _sizing_eval(obj); return obj; @@ -416,7 +427,7 @@ elm_slideshow_show(Elm_Slideshow_Item *item) edje_object_signal_emit(wd->slideshow, buf, "slideshow"); wd->previous = wd->current; wd->current = next; - evas_object_smart_callback_call(item->base.widget, "changed", wd->current); + evas_object_smart_callback_call(item->base.widget, SIG_CHANGED, wd->current); } /** @@ -457,7 +468,7 @@ elm_slideshow_next(Evas_Object *obj) wd->previous = wd->current; wd->current = next; - evas_object_smart_callback_call(obj, "changed", wd->current); + evas_object_smart_callback_call(obj, SIG_CHANGED, wd->current); } /** @@ -498,7 +509,7 @@ elm_slideshow_previous(Evas_Object *obj) wd->previous = wd->current; wd->current = prev; - evas_object_smart_callback_call(obj, "changed", wd->current); + evas_object_smart_callback_call(obj, SIG_CHANGED, wd->current); } /** diff --git a/legacy/elementary/src/lib/elm_spinner.c b/legacy/elementary/src/lib/elm_spinner.c index 598d978094..87d1ceae48 100644 --- a/legacy/elementary/src/lib/elm_spinner.c +++ b/legacy/elementary/src/lib/elm_spinner.c @@ -57,6 +57,15 @@ static Eina_Bool _event_hook(Evas_Object *obj, Evas_Object *src, static void _mirrored_set(Evas_Object *obj, Eina_Bool rtl); +static const char SIG_CHANGED[] = "changed"; +static const char SIG_DELAY_CHANGED[] = "delay,changed"; + +static const Evas_Smart_Cb_Description _signals[] = { + {SIG_CHANGED, ""}, + {SIG_DELAY_CHANGED, ""}, + {NULL, NULL} +}; + static void _del_hook(Evas_Object *obj) { @@ -165,7 +174,7 @@ _delay_change(void *data) Widget_Data *wd = elm_widget_data_get(data); if (!wd) return ECORE_CALLBACK_CANCEL; wd->delay = NULL; - evas_object_smart_callback_call(data, "delay,changed", NULL); + evas_object_smart_callback_call(data, SIG_DELAY_CHANGED, NULL); return ECORE_CALLBACK_CANCEL; } @@ -264,7 +273,7 @@ _value_set(Evas_Object *obj, double delta) if (new_val == wd->val) return EINA_FALSE; wd->val = new_val; - evas_object_smart_callback_call(obj, "changed", NULL); + evas_object_smart_callback_call(obj, SIG_CHANGED, NULL); if (wd->delay) ecore_timer_del(wd->delay); wd->delay = ecore_timer_add(0.2, _delay_change, obj); @@ -510,7 +519,7 @@ _entry_activated(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNU Widget_Data *wd = elm_widget_data_get(data); if (!wd) return; _apply_entry_value(data); - evas_object_smart_callback_call(data, "changed", NULL); + evas_object_smart_callback_call(data, SIG_CHANGED, NULL); if (wd->delay) ecore_timer_del(wd->delay); wd->delay = ecore_timer_add(0.2, _delay_change, data); } @@ -631,6 +640,8 @@ elm_spinner_add(Evas_Object *parent) edje_object_signal_callback_add(wd->spinner, "elm,action,entry,toggle", "*", _toggle_entry, obj); + evas_object_smart_callbacks_descriptions_set(obj, _signals); + _mirrored_set(obj, elm_widget_mirrored_get(obj)); _write_label(obj); _sizing_eval(obj); diff --git a/legacy/elementary/src/lib/elm_thumb.c b/legacy/elementary/src/lib/elm_thumb.c index a6de259913..eee274e229 100644 --- a/legacy/elementary/src/lib/elm_thumb.c +++ b/legacy/elementary/src/lib/elm_thumb.c @@ -46,13 +46,13 @@ struct _Widget_Data static const char *widtype = NULL; -#define SIG_CLICKED "clicked" -#define SIG_CLICKED_DOUBLE "clicked,double" -#define SIG_GENERATE_ERROR "generate,error" -#define SIG_GENERATE_START "generate,start" -#define SIG_GENERATE_STOP "generate,stop" -#define SIG_LOAD_ERROR "load,error" -#define SIG_PRESS "press" +static const char SIG_CLICKED[] = "clicked"; +static const char SIG_CLICKED_DOUBLE[] = "clicked,double"; +static const char SIG_GENERATE_ERROR[] = "generate,error"; +static const char SIG_GENERATE_START[] = "generate,start"; +static const char SIG_GENERATE_STOP[] = "generate,stop"; +static const char SIG_LOAD_ERROR[] = "load,error"; +static const char SIG_PRESS[] = "press"; static const Evas_Smart_Cb_Description _signals[] = { diff --git a/legacy/elementary/src/lib/elm_toolbar.c b/legacy/elementary/src/lib/elm_toolbar.c index 9588cb1427..b97d9ec114 100644 --- a/legacy/elementary/src/lib/elm_toolbar.c +++ b/legacy/elementary/src/lib/elm_toolbar.c @@ -81,6 +81,14 @@ static void _layout(Evas_Object *o, Evas_Object_Box_Data *priv, void *data); static void _elm_toolbar_item_icon_obj_set(Evas_Object *obj, Elm_Toolbar_Item *item, Evas_Object *icon_obj, const char *icon_str, double icon_size, const char *signal); static void _item_label_set(Elm_Toolbar_Item *item, const char *label, const char *signal); +static const char SIG_CLICKED[] = "clicked"; + +static const Evas_Smart_Cb_Description _signals[] = { + {SIG_CLICKED, ""}, + {NULL, NULL} +}; + + static Eina_Bool _item_icon_set(Evas_Object *icon_obj, const char *type, const char *icon) { @@ -166,7 +174,7 @@ _item_select(Elm_Toolbar_Item *it) _menu_move_resize(it, NULL, NULL, NULL); } if (it->func) it->func((void *)(it->base.data), it->base.widget, it); - evas_object_smart_callback_call(obj2, "clicked", it); + evas_object_smart_callback_call(obj2, SIG_CLICKED, it); } static void @@ -749,6 +757,8 @@ elm_toolbar_add(Evas_Object *parent) evas_object_event_callback_add(wd->bx, EVAS_CALLBACK_RESIZE, _resize, obj); elm_toolbar_icon_order_lookup_set(obj, ELM_ICON_LOOKUP_THEME_FDO); + evas_object_smart_callbacks_descriptions_set(obj, _signals); + _sizing_eval(obj); return obj; } diff --git a/legacy/elementary/src/lib/elm_win.c b/legacy/elementary/src/lib/elm_win.c index 8be96abde9..24bf39aa2b 100644 --- a/legacy/elementary/src/lib/elm_win.c +++ b/legacy/elementary/src/lib/elm_win.c @@ -81,6 +81,21 @@ static void _elm_win_focus_highlight_reconfigure_job_stop(Elm_Win *win); static void _elm_win_focus_highlight_anim_end(void *data, Evas_Object *obj, const char *emission, const char *source); static void _elm_win_focus_highlight_reconfigure(Elm_Win *win); +static const char SIG_DELETE_REQUEST[] = "delete,request"; +static const char SIG_FOCUS_OUT[] = "focus,in"; +static const char SIG_FOCUS_IN[] = "focus,out"; +static const char SIG_MOVED[] = "moved"; + +static const Evas_Smart_Cb_Description _signals[] = { + {SIG_DELETE_REQUEST, ""}, + {SIG_FOCUS_OUT, ""}, + {SIG_FOCUS_IN, ""}, + {SIG_MOVED, ""}, + {NULL, NULL} +}; + + + Eina_List *_elm_win_list = NULL; int _elm_win_deferred_free = 0; @@ -97,7 +112,7 @@ _elm_win_move(Ecore_Evas *ee) ecore_evas_geometry_get(ee, &x, &y, NULL, NULL); win->screen.x = x; win->screen.y = y; - evas_object_smart_callback_call(win->win_obj, "moved", NULL); + evas_object_smart_callback_call(win->win_obj, SIG_MOVED, NULL); } static void @@ -123,8 +138,8 @@ _elm_win_focus_in(Ecore_Evas *ee) win = elm_widget_data_get(obj); if (!win) return; /*NB: Why two different "focus signals" here ??? */ - evas_object_smart_callback_call(win->win_obj, "focus-in", NULL); // FIXME: remove me - evas_object_smart_callback_call(win->win_obj, "focus,in", NULL); + evas_object_smart_callback_call(win->win_obj, SIG_FOCUS_IN, NULL); // FIXME: remove me + evas_object_smart_callback_call(win->win_obj, SIG_FOCUS_IN, NULL); win->focus_highlight.cur.visible = EINA_TRUE; _elm_win_focus_highlight_reconfigure_job_start(win); if (win->frame_obj) @@ -145,8 +160,8 @@ _elm_win_focus_out(Ecore_Evas *ee) if (!obj) return; win = elm_widget_data_get(obj); if (!win) return; - evas_object_smart_callback_call(win->win_obj, "focus-out", NULL); // FIXME: remove me - evas_object_smart_callback_call(win->win_obj, "focus,out", NULL); + evas_object_smart_callback_call(win->win_obj, SIG_FOCUS_OUT, NULL); // FIXME: remove me + evas_object_smart_callback_call(win->win_obj, SIG_FOCUS_OUT, NULL); win->focus_highlight.cur.visible = EINA_FALSE; _elm_win_focus_highlight_reconfigure_job_start(win); if (win->frame_obj) @@ -349,7 +364,7 @@ _elm_win_obj_intercept_move(void *data, Evas_Object *obj, Evas_Coord x, Evas_Coo { win->screen.x = x; win->screen.y = y; - evas_object_smart_callback_call(win->win_obj, "moved", NULL); + evas_object_smart_callback_call(win->win_obj, SIG_MOVED, NULL); } } else @@ -388,7 +403,7 @@ _elm_win_obj_callback_move(void *data, Evas *e __UNUSED__, Evas_Object *obj, voi evas_object_geometry_get(obj, &x, &y, NULL, NULL); win->screen.x = x; win->screen.y = y; - evas_object_smart_callback_call(win->win_obj, "moved", NULL); + evas_object_smart_callback_call(win->win_obj, SIG_MOVED, NULL); } if (win->frame_obj) { @@ -434,8 +449,8 @@ _elm_win_delete_request(Ecore_Evas *ee) if (!win) return; int autodel = win->autodel; win->autodel_clear = &autodel; - evas_object_smart_callback_call(win->win_obj, "delete-request", NULL); // FIXME: remove me - evas_object_smart_callback_call(win->win_obj, "delete,request", NULL); + evas_object_smart_callback_call(win->win_obj, SIG_DELETE_REQUEST, NULL); // FIXME: remove me. + evas_object_smart_callback_call(win->win_obj, SIG_DELETE_REQUEST, NULL); // FIXME: if above callback deletes - then the below will be invalid if (autodel) evas_object_del(win->win_obj); else win->autodel_clear = NULL; @@ -1365,6 +1380,9 @@ elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type) EINA_TRUE); printf("Key F12 exclusive for dot tree generation. (%d)\n", ret); #endif + + evas_object_smart_callbacks_descriptions_set(win->win_obj, _signals); + return win->win_obj; }