static void _theme_hook(Evas_Object *obj);
static void _sizing_eval(Evas_Object *obj);
static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _show_hook(void *data, Evas *e, Evas_Object *obj, void *event_info);
+static void _hide_hook(void *data, Evas *e, Evas_Object *obj, void *event_info);
static void _sub_del(void *data, Evas_Object *obj, void *event_info);
static void
if (!wd) return;
EINA_LIST_FREE(wd->subs, si)
{
- eina_stringshare_del(si->swallow);
- free(si);
+ eina_stringshare_del(si->swallow);
+ free(si);
}
free(wd);
}
if (!wd) return;
if (wd->needs_size_calc)
{
- _sizing_eval(obj);
- wd->needs_size_calc = 0;
+ _sizing_eval(obj);
+ wd->needs_size_calc = 0;
+ }
+}
+
+static void
+_show_hook(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ Eina_List *l;
+ Subinfo *si;
+ if (!wd) return;
+ EINA_LIST_FOREACH(wd->subs, l, si)
+ {
+ evas_object_show(si->obj);
+ }
+}
+
+static void
+_hide_hook(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ Eina_List *l;
+ Subinfo *si;
+ if (!wd) return;
+ EINA_LIST_FOREACH(wd->subs, l, si)
+ {
+ evas_object_hide(si->obj);
}
}
if (!wd) return;
EINA_LIST_FOREACH(wd->subs, l, si)
{
- if (si->obj == sub)
- {
- evas_object_event_callback_del_full(sub,
+ if (si->obj == sub)
+ {
+ evas_object_event_callback_del_full(sub,
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_changed_size_hints,
obj);
- wd->subs = eina_list_remove_list(wd->subs, l);
- eina_stringshare_del(si->swallow);
- free(si);
- break;
- }
+ wd->subs = eina_list_remove_list(wd->subs, l);
+ eina_stringshare_del(si->swallow);
+ free(si);
+ break;
+ }
}
}
elm_widget_resize_object_set(obj, wd->lay);
edje_object_signal_callback_add(wd->lay, "size,eval", "elm",
_signal_size_eval, obj);
-
evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
+ evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _hide_hook, obj);
+ evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _show_hook, obj);
_request_sizing_eval(obj);
return obj;
if (!wd) return;
EINA_LIST_FOREACH(wd->subs, l, si)
{
- if (!strcmp(swallow, si->swallow))
- {
- if (content == si->obj) return;
- elm_widget_sub_object_del(obj, si->obj);
- break;
- }
+ if (!strcmp(swallow, si->swallow))
+ {
+ if (content == si->obj) return;
+ elm_widget_sub_object_del(obj, si->obj);
+ break;
+ }
}
if (content)
{
- elm_widget_sub_object_add(obj, content);
- evas_object_event_callback_add(content,
+ elm_widget_sub_object_add(obj, content);
+ evas_object_event_callback_add(content,
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
- _changed_size_hints, obj);
- edje_object_part_swallow(wd->lay, swallow, content);
- si = ELM_NEW(Subinfo);
- si->swallow = eina_stringshare_add(swallow);
- si->obj = content;
- wd->subs = eina_list_append(wd->subs, si);
- _request_sizing_eval(obj);
+ _changed_size_hints, obj);
+ edje_object_part_swallow(wd->lay, swallow, content);
+ si = ELM_NEW(Subinfo);
+ si->swallow = eina_stringshare_add(swallow);
+ si->obj = content;
+ wd->subs = eina_list_append(wd->subs, si);
+ _request_sizing_eval(obj);
}
}
if (!wd) return NULL;
EINA_LIST_FOREACH(wd->subs, l, si)
{
- if (!strcmp(swallow, si->swallow))
- {
- Evas_Object *content;
- 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);
- edje_object_part_unswallow(wd->lay, content);
- return content;
- }
+ if (!strcmp(swallow, si->swallow))
+ {
+ Evas_Object *content;
+ 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);
+ edje_object_part_unswallow(wd->lay, content);
+ return content;
+ }
}
return NULL;
}