Set hooks for elm object signal listen and unlisten for elm spinner
authorBruno Dilly <bdilly@profusion.mobi>
Fri, 25 Jun 2010 22:40:42 +0000 (22:40 +0000)
committerBruno Dilly <bdilly@profusion.mobi>
Fri, 25 Jun 2010 22:40:42 +0000 (22:40 +0000)
SVN revision: 49870

src/lib/elm_spinner.c

index 95b78c7f298aa8237f73cf55dc475091b1276f16..1471a180c59925a73179bdc9cbb2741425f410cb 100644 (file)
@@ -89,6 +89,24 @@ _signal_emit_hook(Evas_Object *obj, const char *emission, const char *source)
    edje_object_signal_emit(wd->spinner, emission, source);
 }
 
+static void
+_signal_listen_hook(Evas_Object *obj, const char *emission, const char *source, void (*func_cb) (void *data, Evas_Object *o, const char *emission, const char *source), void *data)
+{
+   Widget_Data *wd = elm_widget_data_get(obj);
+   if (!wd) return;
+   edje_object_signal_callback_add(wd->spinner, emission,
+        source, func_cb, data);
+}
+
+static void *
+_signal_unlisten_hook(Evas_Object *obj, const char *emission, const char *source, void (*func_cb) (void *data, Evas_Object *o, const char *emission, const char *source))
+{
+   Widget_Data *wd = elm_widget_data_get(obj);
+   if (!wd) return NULL;
+   return edje_object_signal_callback_del(wd->spinner, emission, source,
+        func_cb);
+}
+
 static void
 _theme_hook(Evas_Object *obj)
 {
@@ -517,6 +535,8 @@ elm_spinner_add(Evas_Object *parent)
    elm_widget_theme_hook_set(obj, _theme_hook);
    elm_widget_disable_hook_set(obj, _disable_hook);
    elm_widget_signal_emit_hook_set(obj, _signal_emit_hook);
+   elm_widget_signal_listen_hook_set(obj, _signal_listen_hook);
+   elm_widget_signal_unlisten_hook_set(obj, _signal_unlisten_hook);
 
    wd->val = 0.0;
    wd->val_min = 0.0;