EAPI Evas_Object *elm_win_inwin_add(Evas_Object *obj);
EAPI void elm_win_inwin_activate(Evas_Object *obj);
EAPI void elm_win_inwin_content_set(Evas_Object *obj, Evas_Object *content);
+ EAPI Evas_Object *elm_win_inwin_content_unset(Evas_Object *obj);
/* available styles:
* default
* minimal
EAPI Evas_Object *elm_scroller_add(Evas_Object *parent);
EAPI void elm_scroller_content_set(Evas_Object *obj, Evas_Object *child);
+ EAPI Evas_Object *elm_scroller_content_unset(Evas_Object *obj);
EAPI void elm_scroller_custom_widget_base_theme_set(Evas_Object *obj, const char *widget, const char *base);
EAPI void elm_scroller_content_min_limit(Evas_Object *obj, Eina_Bool w, Eina_Bool h);
EAPI void elm_scroller_region_show(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h);
EAPI void elm_frame_label_set(Evas_Object *obj, const char *label);
EAPI const char *elm_frame_label_get(const Evas_Object *obj);
EAPI void elm_frame_content_set(Evas_Object *obj, Evas_Object *content);
+ EAPI Evas_Object *elm_frame_content_unset(Evas_Object *obj);
/* available styles:
* default
* pad_small
EAPI Eina_Bool elm_layout_file_set(Evas_Object *obj, const char *file, const char *group);
EAPI Eina_Bool elm_layout_theme_set(Evas_Object *obj, const char *clas, const char *group, const char *style);
EAPI void elm_layout_content_set(Evas_Object *obj, const char *swallow, Evas_Object *content);
+ EAPI Evas_Object *elm_layout_content_unset(Evas_Object *obj, const char *swallow);
EAPI Evas_Object *elm_layout_edje_get(const Evas_Object *obj);
EAPI void elm_layout_sizing_eval(Evas_Object *obj);
/* smart callbacks called:
} Elm_Notify_Orient;
EAPI Evas_Object *elm_notify_add(Evas_Object *parent);
EAPI void elm_notify_content_set(Evas_Object *obj, Evas_Object *content);
+ EAPI Evas_Object *elm_notify_content_unset(Evas_Object *obj);
EAPI void elm_notify_parent_set(Evas_Object *obj, Evas_Object *parent);
EAPI void elm_notify_orient_set(Evas_Object *obj, Elm_Notify_Orient orient);
EAPI void elm_notify_timeout_set(Evas_Object *obj, int timeout);
EAPI void elm_hover_parent_set(Evas_Object *obj, Evas_Object *parent);
EAPI Evas_Object *elm_hover_parent_get(Evas_Object *obj);
EAPI void elm_hover_content_set(Evas_Object *obj, const char *swallow, Evas_Object *content);
+ EAPI Evas_Object *elm_hover_content_unset(Evas_Object *obj, const char *swallow);
EAPI const char *elm_hover_best_content_location_get(const Evas_Object *obj, Elm_Hover_Axis pref_axis);
/* available styles:
* default
EAPI const char *elm_bubble_info_get(const Evas_Object *obj);
EAPI void elm_bubble_content_set(Evas_Object *obj, Evas_Object *content);
+ EAPI Evas_Object *elm_bubble_content_unset(Evas_Object *obj);
EAPI void elm_bubble_icon_set(Evas_Object *obj, Evas_Object *icon);
EAPI Evas_Object *elm_bubble_icon_get(const Evas_Object *obj);
EAPI void elm_bubble_corner_set(Evas_Object *obj, const char *corner);
EAPI void elm_panel_orient_set(Evas_Object *obj, Elm_Panel_Orient orient);
EAPI Elm_Panel_Orient elm_panel_orient_get(Evas_Object *obj);
EAPI void elm_panel_content_set(Evas_Object *obj, Evas_Object *content);
+ EAPI Evas_Object *elm_panel_content_unset(Evas_Object *obj);
EAPI void elm_panel_hidden_set(Evas_Object *obj, Eina_Bool hidden);
EAPI Eina_Bool elm_panel_hidden_get(Evas_Object *obj);
EAPI void elm_panel_toggle(Evas_Object *obj);
EAPI Evas_Object *elm_conformant_add(Evas_Object *parent);
EAPI void elm_conformant_content_set(Evas_Object *obj, Evas_Object *content);
+ EAPI Evas_Object *elm_conformant_content_unset(Evas_Object *obj);
+
EAPI Evas_Object *elm_mapbuf_add(Evas_Object *parent);
EAPI void elm_mapbuf_content_set(Evas_Object *obj, Evas_Object *content);
+ EAPI Evas_Object *elm_mapbuf_content_unset(Evas_Object *obj);
EAPI void elm_mapbuf_enabled_set(Evas_Object *obj, Eina_Bool enabled);
EAPI Eina_Bool elm_mapbuf_enabled_get(const Evas_Object *obj);
EAPI void elm_mapbuf_smooth_set(Evas_Object *obj, Eina_Bool smooth);
/**
* Set the icon used for the button
*
+ * Once the icon object is set, a previously set one will be deleted.
+ *
* @param obj The button object
* @param icon The image for the button
*
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
- if ((wd->icon != icon) && (wd->icon))
- elm_widget_sub_object_del(obj, wd->icon);
- if ((icon) && (wd->icon != icon))
+ if (wd->icon == icon) return;
+ if (wd->icon) evas_object_del(wd->icon);
+ wd->icon = icon;
+ if (icon)
{
- wd->icon = icon;
elm_widget_sub_object_add(obj, icon);
evas_object_event_callback_add(icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_changed_size_hints, obj);
edje_object_part_swallow(wd->btn, "elm.swallow.content", icon);
edje_object_signal_emit(wd->btn, "elm,state,icon,visible", "elm");
edje_object_message_signal_process(wd->btn);
- _sizing_eval(obj);
}
- else
- wd->icon = icon;
+ _sizing_eval(obj);
}
/**
}
/**
- * Set the text to be showed in the bubble
+ * Set the content to be shown in the bubble
+ *
+ * Once the content object is set, a previously set one will be deleted.
+ * If you want to keep the old content object, use the
+ * elm_bubble_content_unset() function.
*
* @param obj The bubble object
- * @param content The given info about the bubble
+ * @param content The given content of the bubble
*
- * This function sets the text shown on the top right of bubble. In
- * the Anchorblock example of the Elementary tests application it
+ * This function sets the content shown on the middle of the bubble.
+ * In the Anchorblock example of the Elementary tests application it
* shows time.
*
* @ingroup Bubble
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
- if ((wd->content != content) && (wd->content))
- elm_widget_sub_object_del(obj, wd->content);
+ if (wd->content == content) return;
+ if (wd->content) evas_object_del(wd->content);
wd->content = content;
if (content)
{
elm_widget_sub_object_add(obj, content);
- evas_object_event_callback_add(content,
- EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+ evas_object_event_callback_add(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_changed_size_hints, obj);
edje_object_part_swallow(wd->bbl, "elm.swallow.content", content);
}
_sizing_eval(obj);
}
+/**
+ * Unset the content shown in the bubble
+ *
+ * Unparent and return the content object which was set for this widget.
+ *
+ * @param obj The bubble object
+ * @return The content that was being used
+ *
+ * @ingroup Bubble
+ */
+EAPI Evas_Object *
+elm_bubble_content_unset(Evas_Object *obj)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype) NULL;
+ Widget_Data *wd = elm_widget_data_get(obj);
+ Evas_Object *content;
+ if (!wd) return NULL;
+ if (!wd->content) return NULL;
+ content = wd->content;
+ elm_widget_sub_object_del(obj, wd->content);
+ edje_object_part_unswallow(wd->bbl, wd->content);
+ wd->content = NULL;
+ return content;
+}
+
/**
* Set the icon of the bubble
*
+ * Once the icon object is set, a previously set one will be deleted.
+ *
* @param obj The bubble object
* @param icon The given icon for the bubble
*
- * This function sets the icon shown on the top left of bubble.
- *
* @ingroup Bubble
*/
EAPI void
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
- if ((wd->icon != icon) && (wd->icon))
- elm_widget_sub_object_del(obj, wd->icon);
+ if (wd->icon == icon) return;
+ if (wd->icon) evas_object_del(wd->icon);
wd->icon = icon;
if (icon)
{
_changed_size_hints, obj);
edje_object_signal_emit(wd->bbl, "elm,state,icon,visible", "elm");
edje_object_message_signal_process(wd->bbl);
- _sizing_eval(obj);
}
+ _sizing_eval(obj);
}
/**
{
Evas_Object *btn, *icon;
const char *label;
-
Eina_Bool autorepeat;
Eina_Bool repeating;
double ar_threshold;
/**
* Set the icon used for the button
*
+ * Once the icon object is set, a previously set one will be deleted
+ *
* @param obj The button object
- * @param icon The image for the button
+ * @param icon The image for the button
*
* @ingroup Button
*/
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
- if ((wd->icon != icon) && (wd->icon))
- elm_widget_sub_object_del(obj, wd->icon);
- if ((icon) && (wd->icon != icon))
+ if (wd->icon == icon) return;
+ if (wd->icon) evas_object_del(wd->icon);
+ wd->icon = icon;
+ if (icon)
{
- wd->icon = icon;
elm_widget_sub_object_add(obj, icon);
evas_object_event_callback_add(icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_changed_size_hints, obj);
edje_object_part_swallow(wd->btn, "elm.swallow.content", icon);
edje_object_signal_emit(wd->btn, "elm,state,icon,visible", "elm");
edje_object_message_signal_process(wd->btn);
- _sizing_eval(obj);
}
- else
- wd->icon = icon;
+ _sizing_eval(obj);
}
/**
_changed_size_hints, obj);
wd->icon = NULL;
_sizing_eval(obj);
+ edje_object_message_signal_process(wd->chk);
}
}
/**
* Set the icon object of the check object
*
- * Once the icon object is set, it will become a child of the check object and
- * be deleted when the check object is deleted. If another icon object is set
- * then the previous one becomes orophaned and will no longer be deleted along
- * with the check.
+ * Once the icon object is set, a previously set one will be deleted.
*
* @param obj The check object
* @param icon The icon object
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
- if ((wd->icon != icon) && (wd->icon))
- elm_widget_sub_object_del(obj, wd->icon);
+ if (wd->icon == icon) return;
+ if (wd->icon) evas_object_del(wd->icon);
wd->icon = icon;
if (icon)
{
_changed_size_hints, obj);
edje_object_part_swallow(wd->chk, "elm.swallow.content", icon);
edje_object_signal_emit(wd->chk, "elm,state,icon,visible", "elm");
- _sizing_eval(obj);
+ edje_object_message_signal_process(wd->chk);
}
+ _sizing_eval(obj);
}
/**
/**
* Set the content of the conformant widget
- *
+ *
+ * Once the content object is set, a previously set one will be deleted.
+ * If you want to keep that old content object, use the
+ * elm_conformat_content_unset() function.
+ *
* @param obj The conformant object
- * @param content The content that will be used inside this conformant object
- *
+ * @return The content that was being used
+ *
* @ingroup Conformant
*/
-EAPI void
-elm_conformant_content_set(Evas_Object *obj, Evas_Object *content)
+EAPI void
+elm_conformant_content_set(Evas_Object *obj, Evas_Object *content)
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
- if ((wd->content != content) && (wd->content))
- elm_widget_sub_object_del(obj, wd->content);
+ if (wd->content == content) return;
+ if (wd->content) evas_object_del(wd->content);
wd->content = content;
- if (content)
+ if (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->base, "elm.swallow.content", content);
- _sizing_eval(obj);
+ 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->base, "elm.swallow.content", content);
}
+ _sizing_eval(obj);
+}
+
+/**
+ * Unset the content of the conformant widget
+ *
+ * Unparent and return the content object which was set for this widget;
+ *
+ * @param obj The conformant object
+ * @return The content that was being used
+ *
+ * @ingroup Conformant
+ */
+EAPI Evas_Object *
+elm_conformant_content_unset(Evas_Object *obj)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype) NULL;
+ Widget_Data *wd = elm_widget_data_get(obj);
+ Evas_Object *content;
+ if (!wd) return NULL;
+ if (!wd->content) return NULL;
+ content = wd->content;
+ elm_widget_sub_object_del(obj, wd->content);
+ edje_object_part_unswallow(wd->base, wd->content);
+ wd->content = NULL;
+ return content;
}
}
/**
- * Set the frame content
+ * Set the content of the frame widget
+ *
+ * Once the content object is set, a previously set one will be deleted.
+ * If you want to keep that old content object, use the
+ * elm_frame_content_unset() function.
*
* @param obj The frame object
* @param content The content will be filled in this frame object
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
- if ((wd->content != content) && (wd->content))
- elm_widget_sub_object_del(obj, wd->content);
+ if (wd->content == content) return;
+ if (wd->content) evas_object_del(wd->content);
wd->content = content;
if (content)
{
elm_widget_sub_object_add(obj, content);
- evas_object_event_callback_add(content,
- EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+ evas_object_event_callback_add(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_changed_size_hints, obj);
edje_object_part_swallow(wd->frm, "elm.swallow.content", content);
- _sizing_eval(obj);
}
+ _sizing_eval(obj);
+}
+
+/**
+ * Unset the content of the frame widget
+ *
+ * Unparent and return the content object which was set for this widget
+ *
+ * @param obj The frame object
+ * @return The content that was being used
+ *
+ * @ingroup Frame
+ */
+EAPI Evas_Object *
+elm_frame_content_unset(Evas_Object *obj)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype) NULL;
+ Widget_Data *wd = elm_widget_data_get(obj);
+ Evas_Object *content;
+ if (!wd) return NULL;
+ if (!wd->content) NULL;
+ content = wd->content;
+ elm_widget_sub_object_del(obj, wd->content);
+ edje_object_part_unswallow(wd->frm, wd->content);
+ wd->content = NULL;
+ return content;
}
* Sets the content of the hover object and the direction in which
* it will pop out.
*
+ * Once the content object is set, a previously set one will be deleted.
+ * If you want to keep that old content object, use the
+ * elm_hover_content_unset() function.
+ *
* @param obj The hover object
* @param swallow The direction that the object will display in. Multiple
* objects can have the same swallow location. Objects placed in the same
if (!strcmp(buf, si->swallow))
{
if (content == si->obj) return;
- elm_widget_sub_object_del(obj, si->obj);
+ evas_object_del(si->obj);
+ si->obj = NULL;
break;
}
}
si->swallow = eina_stringshare_add(buf);
si->obj = content;
wd->subs = eina_list_append(wd->subs, si);
- _sizing_eval(obj);
}
+ _sizing_eval(obj);
+}
+
+/**
+ * Unset the content of the hover object
+ *
+ * Unparent and return the content object which was set for this widget
+ *
+ * @param obj The hover object
+ * @param swallow The direction that the object will display in. Multiple
+ * objects can have the same swallow location. Objects placed in the same
+ * swallow will be placed starting at the middle of the hover and ending
+ * farther from the middle.
+ * Accepted values are "left" "right" "top" "bottom" "middle"
+ * @return The content that was being used
+ *
+ * @ingroup Hover
+ */
+EAPI Evas_Object *
+elm_hover_content_unset(Evas_Object *obj, const char *swallow)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype);
+ Widget_Data *wd = elm_widget_data_get(obj);
+ Subinfo *si;
+ Evas_Object *content;
+ const Eina_List *l;
+ char buf[1024];
+ if (!wd) return NULL;
+ snprintf(buf, sizeof(buf), "elm.swallow.slot.%s", swallow);
+ EINA_LIST_FOREACH(wd->subs, l, si)
+ {
+ if (!strcmp(buf, si->swallow))
+ {
+ if (!si->obj) return NULL;
+ content = si->obj;
+ elm_widget_sub_object_del(obj, si->obj);
+ edje_object_part_unswallow(wd->cov, si->obj);
+ si->obj = NULL;
+ break;
+ }
+ }
+ return content;
}
/**
/**
* Set the layout content
*
+ * Once the content object is set, a previously set one will be deleted.
+ * If you want to keep that old content object, use the
+ * elm_layout_content_unset() function.
+ *
* @param obj The layout object
* @param swallow The swallow group name in the edje file
* @param content The content will be filled in this layout object
if (!strcmp(swallow, si->swallow))
{
if (content == si->obj) return;
- elm_widget_sub_object_del(obj, si->obj);
+ evas_object_del(si->obj);
+ si->obj = NULL;
break;
}
}
si->swallow = eina_stringshare_add(swallow);
si->obj = content;
wd->subs = eina_list_append(wd->subs, si);
- _request_sizing_eval(obj);
}
+ _request_sizing_eval(obj);
+}
+
+/**
+ * Unset the layout content
+ *
+ * Unparent and return the content object which was set for this widget
+ *
+ * @param obj The layout object
+ * @param swallow The swallow group name in the edje file
+ * @return The content that was being used
+ *
+ * @ingroup Layout
+ */
+EAPI Evas_Object *
+elm_layout_content_unset(Evas_Object *obj, const char *swallow)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype) NULL;
+ Widget_Data *wd = elm_widget_data_get(obj);
+ Subinfo *si;
+ Evas_Object *content;
+ const Eina_List *l;
+ if (!wd) return NULL;
+ EINA_LIST_FOREACH(wd->subs, l, si)
+ {
+ if (!strcmp(swallow, si->swallow))
+ {
+ if (!si->obj) return NULL;
+ content == si->obj;
+ elm_widget_sub_object_del(obj, si->obj);
+ edje_object_part_unswallow(wd->lay, si->obj);
+ si->obj = NULL;
+ break;
+ }
+ }
+ return content;
}
/**
/**
* Sets the left side icon associated with the item.
*
+ * Once the icon object is set, a previously set one will be deleted.
+ * You probably don't want, then, to have the <b>same</b> icon object set
+ * for more than one item of the list.
+ *
* @param it The list item
* @param icon The left side icon object to associate with @p it
*
ELM_LIST_ITEM_CHECK_DELETED_RETURN(it);
if (it->icon == icon) return;
if (it->dummy_icon && !icon) return;
- if (it->dummy_icon) evas_object_del(it->icon);
+ if (it->dummy_icon)
+ {
+ evas_object_del(it->icon);
+ it->dummy_icon = EINA_FALSE;
+ }
if (!icon)
{
icon = evas_object_rectangle_add(evas_object_evas_get(it->obj));
evas_object_color_set(icon, 0, 0, 0, 0);
it->dummy_icon = EINA_TRUE;
}
+ if (it->icon)
+ {
+ evas_object_del(it->icon);
+ it->icon = NULL;
+ }
it->icon = icon;
if (it->base)
edje_object_part_swallow(it->base, "elm.swallow.icon", icon);
}
/**
- * Gets the right side icon associated with the item.
+ * Sets the right side icon associated with the item.
+ *
+ * Once the icon object is set, a previously set one will be deleted.
+ * You probably don't want, then, to have the <b>same</b> icon object set
+ * for more than one item of the list.
*
* @param it The list item
* @param icon The right side icon object to associate with @p it
ELM_LIST_ITEM_CHECK_DELETED_RETURN(it);
if (it->end == end) return;
if (it->dummy_end && !end) return;
- if (it->dummy_end) evas_object_del(it->end);
+ if (it->dummy_end)
+ {
+ evas_object_del(it->end);
+ it->dummy_icon = EINA_FALSE;
+ }
if (!end)
{
end = evas_object_rectangle_add(evas_object_evas_get(it->obj));
evas_object_color_set(end, 0, 0, 0, 0);
it->dummy_end = EINA_TRUE;
}
+ if (it->end)
+ {
+ evas_object_del(it->end);
+ it->end = NULL;
+ }
it->end = end;
if (it->base)
edje_object_part_swallow(it->base, "elm.swallow.end", end);
/**
* Set the mapbuf front content
*
+ * Once the content object is set, a previously set one will be deleted.
+ * If you want to keep that old content object, use the
+ * elm_mapbuf_content_unset() function.
+ *
* @param obj The mapbuf object
* @param content The content will be filled in this mapbuf object
*
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
if (wd->content == content) return;
- if ((wd->content != content) && (wd->content))
- {
- elm_widget_sub_object_del(obj, wd->content);
- evas_object_smart_member_del(wd->content);
- }
+ if (wd->content) evas_object_del(wd->content);
wd->content = content;
if (content)
{
elm_widget_sub_object_add(content, obj);
- evas_object_smart_member_add(content, obj);
- evas_object_event_callback_add(content,
- EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+ evas_object_smart_member_add(content, obj);
+ evas_object_event_callback_add(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_changed_size_hints, obj);
- _sizing_eval(obj);
}
+ _sizing_eval(obj);
_configure(obj);
}
+/**
+ * Unset the mapbuf front content
+ *
+ * Unparent and return the content object which was set for this widget.
+ *
+ * @param obj The mapbuf object
+ * @return The content that was being used
+ *
+ * @ingroup Mapbuf
+ */
+EAPI Evas_Object *
+elm_mapbuf_content_unset(Evas_Object *obj)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype) NULL;
+ Widget_Data *wd = elm_widget_data_get(obj);
+ Evas_Object *content;
+ if (!wd) return NULL;
+ if (!wd->content) return NULL;
+ content = wd->content;
+ elm_widget_sub_object_del(obj, wd->content);
+ evas_object_smart_member_del(wd->content);
+ wd->content = NULL;
+ return content;
+}
+
/**
* Set the mapbuf enabled state
*
ll = eina_list_append(ll, item->items);
if (item->del_cb) item->del_cb((void*)item->data, item->o, item);
if (item->label) eina_stringshare_del(item->label);
- if (item->icon) evas_object_del(item->icon);
if (item->hv) evas_object_del(item->hv);
if (item->location) evas_object_del(item->location);
free(item);
/**
* Set the icon of a menu item
*
+ * Once the icon object is set, a previously set one will be deleted.
+ *
* @param it The menu item object.
* @param icon The icon object to set for @p item
*
EAPI void
elm_menu_item_icon_set(Elm_Menu_Item *item, Evas_Object *icon)
{
- if ((item->icon != icon) && (item->icon))
- elm_widget_sub_object_del(item->menu, item->icon);
- if ((icon) && (item->icon != icon))
+ if(item->icon == icon) return;
+ if (item->icon) evas_object_del(item->icon);
+ item->icon = icon;
+ if (icon)
{
- item->icon = icon;
elm_widget_sub_object_add(item->menu, icon);
evas_object_event_callback_add(icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
- _changed_size_hints, item->menu);
+ _changed_size_hints, item->menu);
edje_object_part_swallow(item->o, "elm.swallow.content", icon);
edje_object_signal_emit(item->o, "elm,state,icon,visible", "elm");
edje_object_message_signal_process(item->o);
- _sizing_eval(item->menu);
}
- else
- item->icon = icon;
+ _sizing_eval(item->menu);
}
-
/**
* Set the disabled state of @p item.
*
{
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
- elm_notify_content_set(obj, NULL);
elm_notify_parent_set(obj, NULL);
elm_notify_repeat_events_set(obj, EINA_TRUE);
if (wd->timer)
_sub_del(void *data __UNUSED__, Evas_Object *obj, void *event_info)
{
Widget_Data *wd = elm_widget_data_get(obj);
+ Evas_Object *sub = event_info;
if (!wd) return;
- if (event_info == wd->content) wd->content = NULL;
+ if (sub == wd->content)
+ {
+ evas_object_event_callback_del_full(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+ _changed_size_hints, obj);
+ evas_object_event_callback_del_full(sub, EVAS_CALLBACK_RESIZE,
+ _content_resize, obj);
+ wd->content = NULL;
+ }
}
static void
}
/**
- * Set the notify content
+ * Set the content of the notify widget
+ *
+ * Once the content object is set, a previously set one will be deleted.
+ * If you want to keep that old content object, use the
+ * elm_notify_content_unset() function.
*
* @param obj The notify object
* @param content The content will be filled in this notify object
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
- if (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);
- evas_object_del(wd->content);
- wd->content = NULL;
- }
-
+ if (wd->content == content) return;
+ if (wd->content) evas_object_del(wd->content);
+ wd->content = content;
if (content)
{
elm_widget_sub_object_add(obj, content);
- wd->content = content;
- evas_object_event_callback_add(content,
- EVAS_CALLBACK_CHANGED_SIZE_HINTS,
- _changed_size_hints, obj);
+ evas_object_event_callback_add(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+ _changed_size_hints, obj);
evas_object_event_callback_add(content, EVAS_CALLBACK_RESIZE,
- _content_resize, obj);
+ _content_resize, obj);
edje_object_part_swallow(wd->notify, "elm.swallow.content", content);
-
- _sizing_eval(obj);
}
+ _sizing_eval(obj);
_calc(obj);
}
+/**
+ * Unset the content of the notify widget
+ *
+ * Unparent and return the content object which was set for this widget
+ *
+ * @param obj The notify object
+ * @return The content that was being used
+ *
+ * @ingroup Notify
+ */
+EAPI Evas_Object *
+elm_notify_content_unset(Evas_Object *obj)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype) NULL;
+ Widget_Data *wd = elm_widget_data_get(obj);
+ Evas_Object *content;
+ if (!wd) return NULL;
+ if (!wd->content) return NULL;
+ content = wd->content;
+ elm_widget_sub_object_del(obj, wd->content);
+ edje_object_part_unswallow(wd->notify, wd->content);
+ wd->content = NULL;
+ return content;
+}
+
/**
* Set the notify parent
*
typedef struct _Widget_Data Widget_Data;
struct _Widget_Data
{
- Evas_Object *scr, *bx;
+ Evas_Object *scr, *bx, *content;
Elm_Panel_Orient orient;
Eina_Bool hidden : 1;
};
/**
* Set the content of the panel.
*
+ * Once the content object is set, a previously set one will be deleted.
+ * If you want to keep that old content object, use the
+ * elm_panel_content_unset() function.
+ *
* @param obj The panel object
* @param content The panel content
*
* @ingroup Panel
*/
-EAPI void
-elm_panel_content_set(Evas_Object *obj, Evas_Object *content)
+EAPI void
+elm_panel_content_set(Evas_Object *obj, Evas_Object *content)
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
- evas_object_box_remove_all(wd->bx, EINA_TRUE);
- if (!content) return;
- evas_object_box_append(wd->bx, content);
- evas_object_show(content);
+ if (wd->content == content) return;
+ if (wd->content)
+ evas_object_box_remove_all(wd->bx, EINA_TRUE);
+ wd->content = content;
+ if (content)
+ {
+ evas_object_box_append(wd->bx, wd->content);
+ evas_object_show(wd->content);
+ }
_sizing_eval(obj);
}
+/**
+ * Unset the content of the panel.
+ *
+ * Unparent and return the content object which was set for this widget.
+ *
+ * @param obj The panel object
+ * @return The content that was being used
+ *
+ * @ingroup Panel
+ */
+EAPI Evas_Object *
+elm_panel_content_unset(Evas_Object *obj)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype) NULL;
+ Widget_Data *wd = elm_widget_data_get(obj);
+ Evas_Object *content;
+ if (!wd) return NULL;
+ if (!wd->content) return NULL;
+ content = wd->content;
+ evas_object_box_remove_all(wd->bx, EINA_FALSE);
+ wd->content = NULL;
+ return content;
+}
+
/**
* Set the state of the panel.
*
evas_object_event_callback_del_full
(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj);
wd->icon = NULL;
+ edje_object_message_signal_process(wd->progressbar);
_sizing_eval(obj);
}
}
/**
* Set the icon object of the progressbar object
*
- * Once the icon object is set, it will become a child of the progressbar object and
- * be deleted when the progressbar object is deleted. If another icon object is set
- * then the previous one becomes orophaned and will no longer be deleted along
- * with the progressbar.
+ * Once the icon object is set, a previously set one will be deleted.
*
* @param obj The progressbar object
* @param icon The icon object
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
- if ((wd->icon != icon) && (wd->icon))
- elm_widget_sub_object_del(obj, wd->icon);
+ if (wd->icon == icon) return;
+ if (wd->icon) evas_object_del(wd->icon);
wd->icon = icon;
if (icon)
{
_changed_size_hints, obj);
edje_object_part_swallow(wd->progressbar, "elm.swallow.content", icon);
edje_object_signal_emit(wd->progressbar, "elm,state,icon,visible", "elm");
- _sizing_eval(obj);
+ edje_object_message_signal_process(wd->progressbar);
}
+ _sizing_eval(obj);
}
/**
/**
* Set the icon object of the radio object
*
- * Once the icon object is set, it will become a child of the radio object and
- * be deleted when the radio object is deleted. If another icon object is set
- * then the previous one becomes orophaned and will no longer be deleted along
- * with the radio.
+ * Once the icon object is set, a previously set one will be deleted.
*
* @param obj The radio object
* @param icon The icon object
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
- if ((wd->icon != icon) && (wd->icon))
- elm_widget_sub_object_del(obj, wd->icon);
+ if (wd->icon == icon) return;
+ if (wd->icon) evas_object_del(wd->icon);
wd->icon = icon;
if (icon)
{
_changed_size_hints, obj);
edje_object_part_swallow(wd->radio, "elm.swallow.content", icon);
edje_object_signal_emit(wd->radio, "elm,state,icon,visible", "elm");
- _sizing_eval(obj);
+ edje_object_message_signal_process(wd->radio);
}
+ _sizing_eval(obj);
}
/**
static void
_del_hook(Evas_Object *obj)
{
-
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
free(wd);
/**
- * Set the content object
+ * Set the content of the scroller widget (the object to be scrolled around).
*
- * Sets the content of the scroller (the object to be scrolled around)
+ * Once the content object is set, a previously set one will be deleted.
+ * If you want to keep that old content object, use the
+ * elm_scroller_content_unset() function.
*
* @param obj The scroller object
* @param content The new content object
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
- if ((wd->content != content) && (wd->content))
- elm_widget_sub_object_del(obj, wd->content);
+ if (wd->content == content) return;
+ if (wd->content) evas_object_del(wd->content);
wd->content = content;
if (content)
{
elm_smart_scroller_child_set(wd->scr, content);
evas_object_event_callback_add(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_changed_size_hints, obj);
- _sizing_eval(obj);
}
+ _sizing_eval(obj);
+}
+
+/**
+ * Unset the content of the scroller widget
+ *
+ * Unparent and return the content object which was set for this widget
+ *
+ * @param obj The slider objecet
+ * @return The content that was being used
+ *
+ * @ingroup Scroller
+ */
+EAPI Evas_Object *
+elm_scroller_content_unset(Evas_Object *obj)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype) NULL;
+ Widget_Data *wd = elm_widget_data_get(obj);
+ Evas_Object *content;
+ if (!wd) return NULL;
+ if (!wd->content) return NULL;
+ content = wd->content;
+ elm_widget_sub_object_del(obj, wd->content);
+ edje_object_part_unswallow(wd->scr, wd->content);
+ wd->content = NULL;
+ return content;
}
/**
* @param obj The scroller object
* @param widget The widget name to use (default is "scroller")
* @param base The base name to use (default is "base")
+ *
+ * @ingroup Scroller
*/
EAPI void
elm_scroller_custom_widget_base_theme_set(Evas_Object *obj, const char *widget, const char *base)
evas_object_event_callback_del_full
(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj);
wd->icon = NULL;
+ edje_object_message_signal_process(wd->slider);
_sizing_eval(obj);
}
}
/**
* Set the icon object of the slider object
*
- * Once the icon object is set, it will become a child of the slider object and
- * be deleted when the slider object is deleted. If another icon object is set
- * then the previous one becomes orophaned and will no longer be deleted along
- * with the slider.
+ * Once the icon object is set, a previously set one will be deleted.
*
* @param obj The slider object
* @param icon The icon object
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
- if ((wd->icon != icon) && (wd->icon))
- elm_widget_sub_object_del(obj, wd->icon);
+ if (wd->icon == icon) return;
+ if (wd->icon) evas_object_del(wd->icon);
wd->icon = icon;
if (icon)
{
_changed_size_hints, obj);
edje_object_part_swallow(wd->slider, "elm.swallow.content", icon);
edje_object_signal_emit(wd->slider, "elm,state,icon,visible", "elm");
- _sizing_eval(obj);
+ edje_object_message_signal_process(wd->slider);
}
+ _sizing_eval(obj);
}
/**
evas_object_event_callback_del_full
(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj);
wd->icon = NULL;
+ edje_object_message_signal_process(wd->tgl);
_sizing_eval(obj);
}
}
/**
* Sets the icon to be displayed with the toggle.
*
+ * Once the icon object is set, a previously set one will be deleted.
+ *
* @param obj The toggle object
* @param icon The icon object to be displayed
*
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
- if ((wd->icon != icon) && (wd->icon))
- elm_widget_sub_object_del(obj, wd->icon);
+ if (wd->icon == icon) return;
+ if (wd->icon) evas_object_del(wd->icon);
wd->icon = icon;
- if (!icon) return;
- elm_widget_sub_object_add(obj, icon);
- evas_object_event_callback_add(icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
- _changed_size_hints, obj);
- edje_object_part_swallow(wd->tgl, "elm.swallow.content", icon);
- edje_object_signal_emit(wd->tgl, "elm,state,icon,visible", "elm");
+ if (icon)
+ {
+ elm_widget_sub_object_add(obj, icon);
+ evas_object_event_callback_add(icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+ _changed_size_hints, obj);
+ edje_object_part_swallow(wd->tgl, "elm.swallow.content", icon);
+ edje_object_signal_emit(wd->tgl, "elm,state,icon,visible", "elm");
+ edje_object_message_signal_process(wd->tgl);
+ }
_sizing_eval(obj);
}
_del_hook(Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
free(wd);
}
/**
* Set the content of an inwin object.
*
+ * Once the content object is set, a previously set one will be deleted.
+ * If you want to keep that old content object, use the
+ * elm_win_inwin_content_unset() function.
+ *
* @param obj The inwin object
* @param content The object to set as content
*
ELM_CHECK_WIDTYPE(obj, widtype2);
Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return;
- if ((wd->content) && (wd->content != content))
- elm_widget_sub_object_del(obj, wd->content);
+ if (wd->content == content) return;
+ if (wd->content) evas_object_del(wd->content);
wd->content = content;
if (content)
{
evas_object_event_callback_add(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_changed_size_hints, obj);
edje_object_part_swallow(wd->frm, "elm.swallow.content", content);
- _sizing_eval(obj);
}
+ _sizing_eval(obj);
+}
+
+/**
+ * Unset the content of an inwin object.
+ *
+ * Unparent and return the content object which was set for this widget.
+ *
+ * @param obj The inwin object
+ * @return The content that was being used
+ *
+ * @ingroup Inwin
+ */
+EAPI Evas_Object *
+elm_win_inwin_content_unset(Evas_Object *obj)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype2) NULL;
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return NULL;
+ if (!wd->content) return NULL;
+ Evas_Object *content = wd->content;
+ elm_widget_sub_object_del(obj, wd->content);
+ edje_object_part_unswallow(wd->frm, wd->content);
+ wd->content = NULL;
+ return content;
}
/* windowing spcific calls - shall we do this differently? */