static void
_del_pre_hook(Evas_Object *obj)
{
- elm_hoversel_hover_end(obj);
- elm_hoversel_hover_parent_set(obj, NULL);
-}
-
-static void
-_del_hook(Evas_Object *obj)
-{
Elm_Hoversel_Item *it;
Widget_Data *wd = elm_widget_data_get(obj);
- if (!wd) return;
elm_hoversel_hover_end(obj);
+ elm_hoversel_hover_parent_set(obj, NULL);
EINA_LIST_FREE(wd->items, it)
{
if (it->del_cb) it->del_cb((void *)it->data, it->obj, it);
eina_stringshare_del(it->icon_group);
free(it);
}
+}
+
+static void
+_del_hook(Evas_Object *obj)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
free(wd);
}
evas_object_event_callback_del_full
(wd->box, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj);
+ evas_object_box_remove_all(wd->box, 0);
}
static void
_del_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
- evas_object_box_remove_all(wd->box, 0);
- evas_object_del(wd->box);
free(wd);
}
{
Widget_Data *wd = elm_widget_data_get(obj);
- elm_genlist_clear(obj);
- evas_object_del(wd->pan_smart);
- wd->pan_smart = NULL;
if (wd->calc_job) ecore_job_del(wd->calc_job);
if (wd->update_job) ecore_job_del(wd->update_job);
free(wd);
}
static void
+_del_pre_hook(Evas_Object *obj)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ evas_object_del(wd->pan_smart);
+ wd->pan_smart = NULL;
+ elm_genlist_clear(obj);
+}
+
+static void
_theme_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
elm_widget_sub_object_add(parent, obj);
elm_widget_data_set(obj, wd);
elm_widget_del_hook_set(obj, _del_hook);
+ elm_widget_del_pre_hook_set(obj, _del_pre_hook);
elm_widget_theme_hook_set(obj, _theme_hook);
wd->scr = elm_smart_scroller_add(e);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
- evas_object_del(wd->img);
free(wd);
}
static void
+_del_pre_hook(Evas_Object *obj)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+
+ if (!wd) return;
+ evas_object_del(wd->img);
+}
+
+static void
_theme_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
elm_widget_sub_object_add(parent, obj);
elm_widget_data_set(obj, wd);
elm_widget_del_hook_set(obj, _del_hook);
+ elm_widget_del_pre_hook_set(obj, _del_pre_hook);
elm_widget_theme_hook_set(obj, _theme_hook);
elm_widget_can_focus_set(obj, 0);
wd->on_hold = EINA_FALSE;
}
-static Evas_Smart_Class _pan_sc = {NULL};
+static Evas_Smart_Class _pan_sc = EVAS_SMART_CLASS_INIT_NULL;
- static void
+static void
_del_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
- Grid *g;
-
- grid_clearall(obj);
- evas_object_del(wd->pan_smart);
- evas_object_del(wd->rect);
- wd->pan_smart = NULL;
if (wd->calc_job) ecore_job_del(wd->calc_job);
if (wd->scr_timer) ecore_timer_del(wd->scr_timer);
if (wd->zoom_animator) ecore_animator_del(wd->zoom_animator);
free(wd);
}
+static void
+_del_pre_hook(Evas_Object *obj)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ grid_clearall(obj);
+ evas_object_del(wd->pan_smart);
+ wd->pan_smart = NULL;
+}
+
static void
_theme_hook(Evas_Object *obj)
{
elm_widget_sub_object_add(parent, obj);
elm_widget_data_set(obj, wd);
elm_widget_del_hook_set(obj, _del_hook);
+ elm_widget_del_pre_hook_set(obj, _del_pre_hook);
elm_widget_theme_hook_set(obj, _theme_hook);
wd->scr = elm_smart_scroller_add(e);
wd->on_hold = EINA_FALSE;
}
-static Evas_Smart_Class _pan_sc = {NULL};
+static Evas_Smart_Class _pan_sc = EVAS_SMART_CLASS_INIT_NULL;
static void
_del_hook(Evas_Object *obj)
else if (*w < 0) *w = 0;
}
}
+ else
+ {
+ if (x) *x = 0;
+ if (w) *w = 0;
+ }
+
if (wd->size.h > 0)
{
if (y)
else if (*h < 0) *h = 0;
}
}
- wd->size.w;
+ else
+ {
+ if (y) *y = 0;
+ if (h) *h = 0;
+ }
}
/**
evas_object_event_callback_del_full
(wd->tbl, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj);
+ evas_object_del(wd->tbl);
}
static void
_del_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
- evas_object_del(wd->tbl);
free(wd);
}
}
static void
+_menu_del(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+ // avoid hide being emitted during object deletion
+ evas_object_event_callback_del_full
+ (obj, EVAS_CALLBACK_HIDE, _menu_hide, data);
+}
+
+static void
_menu_move_resize(void *data, Evas *e, Evas_Object *obj, void *event_info)
{
Elm_Toolbar_Item *it = data;
if (!wd) return;
EINA_LIST_FREE(wd->items, it)
- elm_toolbar_item_menu_set(it, 0);
+ {
+ eina_stringshare_del(it->label);
+ if (it->icon) evas_object_del(it->icon);
+ if ((!wd->menu_parent) && (it->o_menu)) evas_object_del(it->o_menu);
+ evas_object_del(it->base);
+ free(it);
+ }
}
static void
_del_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
- Elm_Toolbar_Item *it;
if (!wd) return;
- EINA_LIST_FREE(wd->items, it)
- {
- eina_stringshare_del(it->label);
- if (it->icon) evas_object_del(it->icon);
- evas_object_del(it->base);
- free(it);
- elm_toolbar_item_menu_set(it, 0);
- }
free(wd);
}
elm_menu_parent_set(item->o_menu, wd->menu_parent);
evas_object_event_callback_add(item->o_menu, EVAS_CALLBACK_HIDE,
_menu_hide, item);
+ evas_object_event_callback_add(item->o_menu, EVAS_CALLBACK_DEL,
+ _menu_del, item);
}
else if (item->o_menu)
{
- evas_object_event_callback_del_full(item->o_menu, EVAS_CALLBACK_HIDE,
- _menu_hide, item);
evas_object_del(item->o_menu);
}
}