elm: Use appropriate add/del_full for evas event callbacks.
authorDaniel Juyung Seo <seojuyung2@gmail.com>
Mon, 31 Oct 2011 00:13:32 +0000 (00:13 +0000)
committerDaniel Juyung Seo <seojuyung2@gmail.com>
Mon, 31 Oct 2011 00:13:32 +0000 (00:13 +0000)
SVN revision: 64536

20 files changed:
TODO
src/lib/elc_fileselector_button.c
src/lib/elc_fileselector_entry.c
src/lib/elc_hoversel.c
src/lib/elm_bubble.c
src/lib/elm_button.c
src/lib/elm_check.c
src/lib/elm_conform.c
src/lib/elm_flip.c
src/lib/elm_frame.c
src/lib/elm_layout.c
src/lib/elm_map.c
src/lib/elm_mapbuf.c
src/lib/elm_notify.c
src/lib/elm_progressbar.c
src/lib/elm_radio.c
src/lib/elm_scroller.c
src/lib/elm_slider.c
src/lib/elm_slideshow.c
src/lib/elm_win.c

diff --git a/TODO b/TODO
index 37adb5f..11d1c99 100644 (file)
--- a/TODO
+++ b/TODO
@@ -9,3 +9,6 @@ Things That Just Need To Be Rewritten (tm):
 
 "Features"
   elm_object_icon_s/get() should be implemented for most widgets to reduce api
+
+callbacks add/del
+  pager, panes
index c5197f6..d104736 100644 (file)
@@ -22,6 +22,7 @@ struct _Widget_Data
 
 static const char *widtype = NULL;
 
+static void _del_pre_hook(Evas_Object *obj);
 static void _del_hook(Evas_Object *obj);
 static void _theme_hook(Evas_Object *obj);
 static void _disable_hook(Evas_Object *obj);
@@ -30,6 +31,9 @@ static void _changed_size_hints(void        *data,
                                 Evas        *e,
                                 Evas_Object *obj,
                                 void        *event_info);
+static void _button_clicked(void        *data,
+                            Evas_Object *obj,
+                            void        *event_info);
 static void _on_focus_hook(void        *data,
                            Evas_Object *obj);
 static void _selection_done(void        *data,
@@ -44,6 +48,16 @@ static const Evas_Smart_Cb_Description _signals[] = {
 };
 
 static void
+_del_pre_hook(Evas_Object *obj)
+{
+   Widget_Data *wd = elm_widget_data_get(obj);
+   if (!wd) return;
+   evas_object_event_callback_del_full(wd->btn, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+                                       _changed_size_hints, obj);
+   evas_object_smart_callback_del(wd->btn, "clicked", _button_clicked);
+}
+
+static void
 _del_hook(Evas_Object *obj)
 {
    Evas_Object *win;
@@ -274,6 +288,7 @@ elm_fileselector_button_add(Evas_Object *parent)
    elm_widget_sub_object_add(parent, obj);
    elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL);
    elm_widget_data_set(obj, wd);
+   elm_widget_del_pre_hook_set(obj, _del_pre_hook);
    elm_widget_del_hook_set(obj, _del_hook);
    elm_widget_theme_hook_set(obj, _theme_hook);
    elm_widget_disable_hook_set(obj, _disable_hook);
index 653ee49..bad2caf 100644 (file)
@@ -62,6 +62,8 @@ SIG_FWD(SELECTION_CUT)
 SIG_FWD(UNPRESSED)
 #undef SIG_FWD
 
+static void _del_pre_hook(Evas_Object *obj);
+static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info);
 static void _mirrored_set(Evas_Object *obj, Eina_Bool rtl);
 
 static void
@@ -83,6 +85,17 @@ _ACTIVATED_fwd(void *data, Evas_Object *obj __UNUSED__, void *event_info)
 }
 
 static void
+_del_pre_hook(Evas_Object *obj)
+{
+   Widget_Data *wd = elm_widget_data_get(obj);
+   if (!wd) return;
+   evas_object_event_callback_del_full
+      (wd->button, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj);
+   evas_object_event_callback_del_full
+      (wd->entry, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj);
+}
+
+static void
 _del_hook(Evas_Object *obj)
 {
    Widget_Data *wd = elm_widget_data_get(obj);
@@ -233,6 +246,7 @@ elm_fileselector_entry_add(Evas_Object *parent)
    elm_widget_type_set(obj, "fileselector_entry");
    elm_widget_sub_object_add(parent, obj);
    elm_widget_data_set(obj, wd);
+   elm_widget_del_pre_hook_set(obj, _del_pre_hook);
    elm_widget_del_hook_set(obj, _del_hook);
    elm_widget_disable_hook_set(obj, _disable_hook);
    elm_widget_focus_next_hook_set(obj, _elm_fileselector_entry_focus_next_hook);
index e0b983c..6cb93e2 100644 (file)
@@ -49,6 +49,8 @@ _del_pre_hook(Evas_Object *obj)
    Elm_Hoversel_Item *item;
    Widget_Data *wd = elm_widget_data_get(obj);
    if (!wd) return;
+   evas_object_event_callback_del_full(wd->btn, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+                                       _changed_size_hints, obj);
    elm_hoversel_hover_end(obj);
    elm_hoversel_hover_parent_set(obj, NULL);
    EINA_LIST_FREE(wd->items, item)
index 5c8c5d9..1dfdceb 100644 (file)
@@ -281,6 +281,8 @@ elm_bubble_content_unset(Evas_Object *obj)
    if (!wd->content) return NULL;
    content = wd->content;
    elm_widget_sub_object_del(obj, content);
+   evas_object_event_callback_del_full(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+                                       _changed_size_hints, obj);
    edje_object_part_unswallow(wd->bbl, content);
    wd->content = NULL;
    return content;
@@ -326,6 +328,8 @@ elm_bubble_icon_unset(Evas_Object *obj)
    if (!wd->icon) return NULL;
    icon = wd->icon;
    elm_widget_sub_object_del(obj, icon);
+   evas_object_event_callback_del_full(icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+                                       _changed_size_hints, obj);
    edje_object_part_unswallow(wd->bbl, icon);
    wd->icon = NULL;
    return icon;
index cafc17e..7e2ff28 100644 (file)
@@ -215,6 +215,8 @@ _content_unset_hook(Evas_Object *obj, const char *part __UNUSED__)
    if (!wd->icon) return NULL;
    Evas_Object *icon = wd->icon;
    elm_widget_sub_object_del(obj, wd->icon);
+   evas_object_event_callback_del_full(wd->icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+                                       _changed_size_hints, obj);
    edje_object_part_unswallow(wd->btn, wd->icon);
    wd->icon = NULL;
    return icon;
index 7038c71..c4e57c8 100644 (file)
@@ -246,6 +246,9 @@ _content_unset_hook(Evas_Object *obj, const char *part __UNUSED__)
    if (!wd->icon) return NULL;
    Evas_Object *icon = wd->icon;
    elm_widget_sub_object_del(obj, wd->icon);
+   evas_object_event_callback_del_full(wd->icon,
+                                       EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+                                       _changed_size_hints, obj);
    edje_object_part_unswallow(wd->chk, wd->icon);
    wd->icon = NULL;
    return icon;
index 620b79e..1ccacac 100644 (file)
@@ -160,6 +160,9 @@ _content_unset_hook(Evas_Object *obj, const char *part __UNUSED__)
    if ((!wd) || (!wd->content)) return NULL;
    content = wd->content;
    elm_widget_sub_object_del(obj, wd->content);
+   evas_object_event_callback_del_full(wd->content,
+                                       EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+                                       _changed_size_hints, obj);
    edje_object_part_unswallow(wd->base, wd->content);
    wd->content = NULL;
    return content;
index e311b7d..2f3d5cb 100644 (file)
@@ -1721,6 +1721,9 @@ elm_flip_content_front_unset(Evas_Object *obj)
    Evas_Object *content = wd->front.content;
    evas_object_clip_unset(content);
    elm_widget_sub_object_del(obj, content);
+   evas_object_event_callback_del_full(content,
+                                       EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+                                       _changed_size_hints, obj);
    evas_object_smart_member_del(content);
    wd->front.content = NULL;
    return content;
@@ -1736,6 +1739,9 @@ elm_flip_content_back_unset(Evas_Object *obj)
    Evas_Object *content = wd->back.content;
    evas_object_clip_unset(content);
    elm_widget_sub_object_del(obj, content);
+   evas_object_event_callback_del_full(content,
+                                       EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+                                       _changed_size_hints, obj);
    evas_object_smart_member_del(content);
    wd->back.content = NULL;
    return content;
index fb1019c..7dae02b 100644 (file)
@@ -162,6 +162,9 @@ _content_unset_hook(Evas_Object *obj, const char *part __UNUSED__)
    if (!wd->content) return NULL;
    content = wd->content;
    elm_widget_sub_object_del(obj, wd->content);
+   evas_object_event_callback_del_full(wd->content,
+                                       EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+                                       _changed_size_hints, obj);
    edje_object_part_unswallow(wd->frm, wd->content);
    wd->content = NULL;
    return content;
index 461f976..3338270 100644 (file)
@@ -424,6 +424,9 @@ _content_unset_hook(Evas_Object *obj, const char *part)
              if (!si->obj) return NULL;
              content = si->obj; /* si will die in _sub_del due elm_widget_sub_object_del() */
              elm_widget_sub_object_del(obj, content);
+             evas_object_event_callback_del_full(content,
+                                                 EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+                                                 _changed_size_hints, wd);
              edje_object_part_unswallow(wd->lay, content);
              return content;
           }
index 0d2d40c..7142d51 100644 (file)
@@ -2556,7 +2556,7 @@ _group_bubble_content_update(Marker_Group *group)
 
         elm_scroller_content_set(group->sc, group->bx);
 
-        evas_object_event_callback_add(group->sc, EVAS_CALLBACK_RESIZE,
+        evas_object_event_callback_add(group->sc, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
                                        _bubble_sc_hits_changed_cb, group);
      }
 
index ab6f152..9e01249 100644 (file)
@@ -191,6 +191,9 @@ _content_unset_hook(Evas_Object *obj, const char *part __UNUSED__)
    if (!wd->content) return NULL;
    content = wd->content;
    elm_widget_sub_object_del(obj, content);
+   evas_object_event_callback_add(content,
+                                  EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+                                  _changed_size_hints, obj);
    evas_object_smart_member_del(content);
    evas_object_color_set(wd->clip, 0, 0, 0, 0);
    evas_object_clip_unset(content);
index 116d475..3b2de35 100644 (file)
@@ -456,6 +456,11 @@ _content_unset_hook(Evas_Object *obj, const char *part __UNUSED__)
    if (!wd->content) return NULL;
    content = wd->content;
    elm_widget_sub_object_del(obj, wd->content);
+   evas_object_event_callback_del_full(wd->content,
+                                       EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+                                       _changed_size_hints, obj);
+   evas_object_event_callback_del_full(wd->content, EVAS_CALLBACK_RESIZE,
+                                       _content_resize, obj);
    edje_object_part_unswallow(wd->notify, wd->content);
    wd->content = NULL;
    return content;
index 3ee3b0c..e601662 100644 (file)
@@ -351,6 +351,8 @@ elm_progressbar_icon_unset(Evas_Object *obj)
    if (!wd->icon) return NULL;
    Evas_Object *icon = wd->icon;
    elm_widget_sub_object_del(obj, wd->icon);
+   evas_object_event_callback_del_full(wd->icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+                                       _changed_size_hints, obj);
    edje_object_part_unswallow(wd->progressbar, wd->icon);
    wd->icon = NULL;
    return icon;
index 99f1ab3..83e2e74 100644 (file)
@@ -402,6 +402,8 @@ elm_radio_icon_unset(Evas_Object *obj)
    if (!wd->icon) return NULL;
    Evas_Object *icon = wd->icon;
    elm_widget_sub_object_del(obj, wd->icon);
+   evas_object_event_callback_del_full(wd->icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+                                       _changed_size_hints, obj);
    edje_object_part_unswallow(wd->radio, wd->icon);
    wd->icon = NULL;
    return icon;
index d4487c4..8392e96 100644 (file)
@@ -526,6 +526,9 @@ elm_scroller_content_unset(Evas_Object *obj)
    if (!wd->content) return NULL;
    content = wd->content;
    elm_widget_sub_object_del(obj, wd->content);
+   evas_object_event_callback_del_full(wd->content,
+                                       EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+                                       _changed_size_hints, obj);
    edje_object_part_unswallow(elm_smart_scroller_edje_object_get(wd->scr), wd->content);
    wd->content = NULL;
    return content;
index 044ce93..cc634ca 100644 (file)
@@ -593,6 +593,9 @@ elm_slider_icon_unset(Evas_Object *obj)
    if (wd->icon)
      {
         elm_widget_sub_object_del(obj, wd->icon);
+        evas_object_event_callback_del_full(wd->icon,
+                                            EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+                                            _changed_size_hints, obj);
         ret = wd->icon;
         edje_object_part_unswallow(wd->slider, wd->icon);
         edje_object_signal_emit(wd->slider, "elm,state,icon,hidden", "elm");
@@ -843,6 +846,9 @@ elm_slider_end_unset(Evas_Object *obj)
    if (wd->end)
      {
         elm_widget_sub_object_del(obj, wd->end);
+        evas_object_event_callback_del_full(wd->end,
+                                            EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+                                            _changed_size_hints, obj);
         ret = wd->end;
         edje_object_part_unswallow(wd->slider, wd->end);
         edje_object_signal_emit(wd->slider, "elm,state,end,hidden", "elm");
index 69690c2..71876d6 100644 (file)
@@ -39,6 +39,7 @@ struct _Widget_Data
 };
 
 static const char *widtype = NULL;
+static void _del_pre_hook(Evas_Object *obj);
 static void _del_hook(Evas_Object *obj);
 static void _mirrored_set(Evas_Object *obj, Eina_Bool rtl);
 static void _theme_hook(Evas_Object *obj);
@@ -98,6 +99,15 @@ _event_hook(Evas_Object *obj, Evas_Object *src __UNUSED__, Evas_Callback_Type ty
 }
 
 static void
+_del_pre_hook(Evas_Object *obj)
+{
+   Widget_Data *wd = elm_widget_data_get(obj);
+   if (!wd) return;
+   evas_object_event_callback_del_full(obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+                                       _changed_size_hints, obj);
+}
+
+static void
 _del_hook(Evas_Object *obj)
 {
    const char *layout;
@@ -346,6 +356,7 @@ elm_slideshow_add(Evas_Object *parent)
    elm_widget_sub_object_add(parent, obj);
    elm_widget_on_focus_hook_set(obj, _on_focus_hook, NULL);
    elm_widget_data_set(obj, wd);
+   elm_widget_del_pre_hook_set(obj, _del_pre_hook);
    elm_widget_del_hook_set(obj, _del_hook);
    elm_widget_theme_hook_set(obj, _theme_hook);
    elm_widget_can_focus_set(obj, EINA_TRUE);
index 2d3237b..62f9392 100644 (file)
@@ -2612,6 +2612,9 @@ elm_win_inwin_content_unset(Evas_Object *obj)
    if (!wd->content) return NULL;
    Evas_Object *content = wd->content;
    elm_widget_sub_object_del(obj, wd->content);
+   evas_object_event_callback_del_full(wd->content,
+                                       EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+                                       _changed_size_hints, obj);
    edje_object_part_unswallow(wd->frm, wd->content);
    wd->content = NULL;
    return content;