elementary / actionslider, calendar, colorselector, bubble, hoversel, clock
authorhermet <hermet@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 15 Apr 2011 17:01:39 +0000 (17:01 +0000)
committerhermet <hermet@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Fri, 15 Apr 2011 17:01:39 +0000 (17:01 +0000)
- updated them for using common signal callback table.

git-svn-id: https://svn.enlightenment.org/svn/e/trunk/elementary@58692 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/elc_hoversel.c
src/lib/elm_actionslider.c
src/lib/elm_bubble.c
src/lib/elm_calendar.c
src/lib/elm_clock.c
src/lib/elm_colorselector.c

index 4f61fed..f006365 100644 (file)
@@ -14,7 +14,6 @@
  *
  * "clicked" - the user clicked the hoversel button and popped up the sel
  * "selected" - an item in the hoversel list is selected. event_info is the item
- * "selected" - Elm_Hoversel_Item
  * "dismissed" - the hover is dismissed
  */
 typedef struct _Widget_Data Widget_Data;
@@ -48,6 +47,17 @@ static void _sizing_eval(Evas_Object *obj);
 static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info);
 static void _parent_del(void *data, Evas *e, Evas_Object *obj, void *event_info);
 
+static const char SIG_CLICKED[] = "clicked";
+static const char SIG_SELECTED[] = "selected";
+static const char SIG_DISMISSED[] = "dismissed";
+
+static const Evas_Smart_Cb_Description _signals[] = {
+   {SIG_CLICKED, ""},
+   {SIG_SELECTED, ""},
+   {SIG_DISMISSED, ""},
+   {NULL, NULL}
+};
+
 static void
 _del_pre_hook(Evas_Object *obj)
 {
@@ -150,7 +160,7 @@ _item_clicked(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED
 
    elm_hoversel_hover_end(obj2);
    if (item->func) item->func((void *)item->base.data, obj2, item);
-   evas_object_smart_callback_call(obj2, "selected", item);
+   evas_object_smart_callback_call(obj2, SIG_SELECTED, item);
 }
 
 static void
@@ -232,7 +242,7 @@ _activate(Evas_Object *obj)
    evas_object_show(bx);
 
    evas_object_show(wd->hover);
-   evas_object_smart_callback_call(obj, "clicked", NULL);
+   evas_object_smart_callback_call(obj, SIG_CLICKED, NULL);
 
    //   if (wd->horizontal) evas_object_hide(wd->btn);
 }
@@ -293,10 +303,13 @@ elm_hoversel_add(Evas_Object *parent)
    evas_object_event_callback_add(wd->btn, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
                                   _changed_size_hints, obj);
    evas_object_smart_callback_add(wd->btn, "clicked", _button_clicked, obj);
+   evas_object_smart_callbacks_descriptions_set(obj, _signals);
+
    elm_widget_sub_object_add(obj, wd->btn);
 
    elm_hoversel_hover_parent_set(obj, parent);
    _theme_hook(obj);
+
    return obj;
 }
 
@@ -517,7 +530,7 @@ elm_hoversel_hover_end(Evas_Object *obj)
    wd->expanded = EINA_FALSE;
    evas_object_del(wd->hover);
    wd->hover = NULL;
-   evas_object_smart_callback_call(obj, "dismissed", NULL);
+   evas_object_smart_callback_call(obj, SIG_DISMISSED, NULL);
 }
 
 /**
index a0b1f7e..dd78924 100644 (file)
@@ -33,8 +33,8 @@ struct _Widget_Data
 
 static const char *widtype = NULL;
 
-#define SIG_CHANGED "pos_changed"
-#define SIG_SELECTED "selected"
+static const char SIG_CHANGED[] = "pos_changed";
+static const char SIG_SELECTED[] = "selected";
 
 static const Evas_Smart_Cb_Description _signals[] =
 {
index 70ae12d..2ee7a2e 100644 (file)
@@ -29,7 +29,8 @@ static void _sizing_eval(Evas_Object *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);
 
-#define SIG_CLICKED "clicked"
+static const char SIG_CLICKED[] = "clicked";
+
 static const Evas_Smart_Cb_Description _signals[] =
 {
      {SIG_CLICKED, ""},
index 7ea872b..294e1b3 100644 (file)
@@ -62,6 +62,14 @@ static const char *widtype = NULL;
 static void _on_focus_hook(void *data, Evas_Object *obj);
 static void _mirrored_set(Evas_Object *obj, Eina_Bool rtl);
 
+static const char SIG_CHANGED[] = "changed";
+
+static const Evas_Smart_Cb_Description _signals[] = {
+   {SIG_CHANGED, ""},
+   {NULL, NULL}
+};
+
+
 /* Should not be translated, it's used if we failed
  * getting from locale. */
 static const char *_days_abbrev[] =
@@ -536,7 +544,7 @@ _update_month(Evas_Object *obj, int delta)
      wd->selected_time.tm_mday = maxdays;
 
    _fix_selected_time(wd);
-   evas_object_smart_callback_call(obj, "changed", NULL);
+   evas_object_smart_callback_call(obj, SIG_CHANGED, NULL);
 
    return EINA_TRUE;
 }
@@ -618,7 +626,7 @@ _update_sel_it(Evas_Object *obj, int sel_it)
    wd->selected_time.tm_mday = day;
    _select(wd, wd->selected_it);
    _fix_selected_time(wd);
-   evas_object_smart_callback_call(obj, "changed", NULL);
+   evas_object_smart_callback_call(obj, SIG_CHANGED, NULL);
 }
 
 static void
@@ -766,6 +774,8 @@ elm_calendar_add(Evas_Object *parent)
    edje_object_signal_callback_add(wd->calendar, "elm,action,selected",
                                    "*", _day_selected, obj);
 
+   evas_object_smart_callbacks_descriptions_set(obj, _signals);
+
    for (i = 0; i < 7; i++)
      {
         /* FIXME: I'm not aware of a known max, so if it fails,
index d17853d..f2abe28 100644 (file)
@@ -47,6 +47,14 @@ static Eina_Bool _signal_clock_val_up(void *data);
 static Eina_Bool _signal_clock_val_down(void *data);
 static void _time_update(Evas_Object *obj);
 
+static const char SIG_CHANGED[] = "changed";
+
+static const Evas_Smart_Cb_Description _signals[] = {
+   {SIG_CHANGED, ""},
+   {NULL, NULL}
+};
+
+
 static void
 _del_hook(Evas_Object *obj)
 {
@@ -223,7 +231,7 @@ _signal_clock_val_up(void *data)
    wd->interval = wd->interval / 1.05;
    ecore_timer_interval_set(wd->spin, wd->interval);
    _time_update(data);
-   evas_object_smart_callback_call(data, "changed", NULL);
+   evas_object_smart_callback_call(data, SIG_CHANGED, NULL);
    return ECORE_CALLBACK_RENEW;
 clock_val_up_cancel:
    wd->spin = NULL;
@@ -276,7 +284,7 @@ _signal_clock_val_down(void *data)
    wd->interval = wd->interval / 1.05;
    ecore_timer_interval_set(wd->spin, wd->interval);
    _time_update(data);
-   evas_object_smart_callback_call(data, "changed", NULL);
+   evas_object_smart_callback_call(data, SIG_CHANGED, NULL);
    return ECORE_CALLBACK_RENEW;
 clock_val_down_cancel:
    wd->spin = NULL;
@@ -561,6 +569,8 @@ elm_clock_add(Evas_Object *parent)
    _time_update(obj);
    _ticker(obj);
 
+   evas_object_smart_callbacks_descriptions_set(obj, _signals);
+
    return obj;
 }
 
index e29b950..4bd89a6 100644 (file)
@@ -84,7 +84,7 @@ static void _right_button_up_cb(void *data, Evas *e, Evas_Object *obj, void *eve
 static void _add_colorbar(Evas_Object *obj);
 static void _set_color(Evas_Object *obj, int r, int g, int b, int a);
 
-#define SIG_CHANGED "changed"
+static const char SIG_CHANGED[] = "changed";
 
 static const Evas_Smart_Cb_Description _signals[] =
 {