Adding Signal Hooks to Hoverlist
authorTiago Rezende Campos Falcao <developer@tiagofalcao.com>
Thu, 18 Nov 2010 12:55:28 +0000 (12:55 +0000)
committerTiago Rezende Campos Falcao <developer@tiagofalcao.com>
Thu, 18 Nov 2010 12:55:28 +0000 (12:55 +0000)
SVN revision: 54687

src/lib/elc_hoverlist.c

index b5ae8b95aabd5934c440228a56f1ec5ff5c216de..062827a8d2298b362abaea4d0159fe83dbcd53a2 100644 (file)
@@ -175,6 +175,32 @@ _theme_hook(Evas_Object* obj)
    elm_object_style_set(wd->hover, buf);
 }
 
+static void
+_signal_emit_hook(Evas_Object *obj, const char *emission, const char *source)
+{
+   Widget_Data *wd = elm_widget_data_get(obj);
+   if (!wd) return;
+   elm_object_signal_emit(wd->list, emission, source);
+   elm_object_signal_emit(wd->hover, emission, source);
+}
+
+static void
+_signal_callback_add_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;
+   elm_object_signal_callback_add(wd->list, emission, source, func_cb, data);
+   elm_object_signal_callback_add(wd->hover, emission, source, func_cb, data);
+}
+
+static void
+_signal_callback_del_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 __UNUSED__)
+{
+   Widget_Data *wd = elm_widget_data_get(obj);
+   elm_object_signal_callback_del(wd->list, emission, source, func_cb);
+   elm_object_signal_callback_del(wd->hover, emission, source, func_cb);
+}
+
 static void
 _item_func_cb(void *data, Evas_Object *obj __UNUSED__, void *event_info)
 {
@@ -293,6 +319,9 @@ elm_hoverlist_add(Evas_Object* parent)
    elm_widget_del_hook_set(obj, _del_hook);
    elm_widget_theme_hook_set(obj, _theme_hook);
    elm_widget_event_hook_set(obj, _event_hook);
+   elm_widget_signal_emit_hook_set(obj, _signal_emit_hook);
+   elm_widget_signal_callback_add_hook_set(obj, _signal_callback_add_hook);
+   elm_widget_signal_callback_del_hook_set(obj, _signal_callback_del_hook);
 
    wd->list = elm_list_add(obj);
    elm_widget_style_set(wd->list, "hoverlist");