Evas_Object *o2 = elm_icon_add(win);
elm_icon_standard_set(o2, "home");
-elm_bubble_icon_set(o, o2);
+elm_object_content_part_set(o, ELM_BUBBLE_CONTENT_ICON, o2);
evas_object_show(o2);
#include "widget_preview_tmpl_foot.c"
Evas_Object *o2 = elm_icon_add(win);
elm_icon_standard_set(o2, "home");
-elm_bubble_icon_set(o, o2);
+elm_object_content_part_set(o, ELM_BUBBLE_CONTENT_ICON, o2);
evas_object_show(o2);
#include "widget_preview_tmpl_foot.c"
bb = elm_bubble_add(win);
elm_object_text_set(bb, "Message 3");
elm_object_text_part_set(bb, "info", "10:32 4/11/2008");
- elm_bubble_icon_set(bb, ic);
+ elm_object_content_part_set(bb, ELM_BUBBLE_CONTENT_ICON, ic);
evas_object_smart_callback_add(bb, "clicked", _print_clicked, NULL);
evas_object_show(ic);
evas_object_size_hint_weight_set(bb, EVAS_HINT_EXPAND, 0.0);
bb = elm_bubble_add(win);
elm_object_text_set(bb, "Message 2");
elm_object_text_part_set(bb, "info", "7:16 27/10/2008");
- elm_bubble_icon_set(bb, ic);
+ elm_object_content_part_set(bb, ELM_BUBBLE_CONTENT_ICON, ic);
evas_object_smart_callback_add(bb, "clicked", _print_clicked, NULL);
evas_object_show(ic);
evas_object_size_hint_weight_set(bb, EVAS_HINT_EXPAND, 0.0);
bb = elm_bubble_add(win);
elm_object_text_set(bb, "Message 1");
elm_object_text_part_set(bb, "info", "20:47 18/6/2008");
- elm_bubble_icon_set(bb, ic);
+ elm_object_content_part_set(bb, ELM_BUBBLE_CONTENT_ICON, ic);
evas_object_smart_callback_add(bb, "clicked", _print_clicked, NULL);
evas_object_show(ic);
evas_object_size_hint_weight_set(bb, EVAS_HINT_EXPAND, 0.0);
bb = elm_bubble_add(win);
elm_object_text_set(bb, "Message 1");
elm_object_text_part_set(bb, "info", "Corner: bottom_right");
- elm_bubble_icon_set(bb, ic);
+ elm_object_content_part_set(bb, ELM_BUBBLE_CONTENT_ICON, ic);
elm_bubble_corner_set(bb, "bottom_right");
evas_object_smart_callback_add(bb, "clicked", _print_clicked, NULL);
evas_object_show(ic);
elm_flip_content_back_set(fl, ly);
evas_object_show(ly);
- bt = elm_button_add(win);
+ bt = elm_button_add(ly);
elm_object_text_set(bt, "Button 1");
elm_object_content_part_set(ly, "element1", bt);
- evas_object_show(bt);
- bt = elm_button_add(win);
+ bt = elm_button_add(ly);
elm_object_text_set(bt, "Button 2");
elm_object_content_part_set(ly, "element2", bt);
- evas_object_show(bt);
- bt = elm_button_add(win);
+ bt = elm_button_add(ly);
elm_object_text_set(bt, "Button 3");
elm_object_content_part_set(ly, "element3", bt);
- evas_object_show(bt);
evas_object_show(fl);
bb = elm_bubble_add(win);
elm_object_text_set(bb, "Message 3");
elm_object_text_part_set(bb, "info", "10:32 4/11/2008");
- elm_bubble_icon_set(bb, ic);
+ elm_object_content_part_set(bb, ELM_BUBBLE_CONTENT_ICON, ic);
evas_object_show(ic);
evas_object_size_hint_weight_set(bb, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_align_set(bb, EVAS_HINT_FILL, EVAS_HINT_FILL);
bb = elm_bubble_add(win);
elm_object_text_set(bb, "Message 2");
elm_object_text_part_set(bb, "info", "7:16 27/10/2008");
- elm_bubble_icon_set(bb, ic);
+ elm_object_content_part_set(bb, ELM_BUBBLE_CONTENT_ICON, ic);
evas_object_show(ic);
evas_object_size_hint_weight_set(bb, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_align_set(bb, EVAS_HINT_FILL, EVAS_HINT_FILL);
bb = elm_bubble_add(win);
elm_object_text_set(bb, "Message 1");
elm_object_text_part_set(bb, "info", "20:47 18/6/2008");
- elm_bubble_icon_set(bb, ic);
+ elm_object_content_part_set(bb, ELM_BUBBLE_CONTENT_ICON, ic);
evas_object_show(ic);
evas_object_size_hint_weight_set(bb, EVAS_HINT_EXPAND, 0.0);
evas_object_size_hint_align_set(bb, EVAS_HINT_FILL, EVAS_HINT_FILL);
else return;
if (p->label) elm_object_text_set(obj, p->label);
- if (p->icon) elm_bubble_icon_set(obj, p->icon);
+ if (p->icon)
+ elm_object_content_part_set(obj, ELM_BUBBLE_CONTENT_ICON, p->icon);
if (p->info) elm_object_text_part_set(obj, "info", p->info);
if (p->content) elm_object_content_set(obj, p->content);
}
{
Evas_Object *icon = external_common_param_icon_get(obj, param);
if ((strcmp(param->s, "")) && (!icon)) return EINA_FALSE;
- elm_bubble_icon_set(obj, icon);
- return EINA_TRUE;
+ elm_object_content_part_set(obj, ELM_BUBBLE_CONTENT_ICON,
+ icon);
+ return EINA_TRUE;
}
}
else if (!strcmp(param->name, "info"))
evas_object_show(icon);
bubble = elm_bubble_add(win);
- elm_bubble_icon_set(bubble, icon);
+ elm_object_content_part_set(bubble, ELM_BUBBLE_CONTENT_ICON, icon);
elm_bubble_info_set(bubble, "INFO");
elm_object_text_set(bubble, "LABEL");
elm_bubble_content_set(bubble, label);
*
* @{
*/
+
+#define ELM_BUBBLE_CONTENT_ICON "elm.swallow.icon"
+
/**
* Add a new bubble to the parent
*
*
* @param obj The bubble object
* @param icon The given icon for the bubble
+ *
+ * @deprecated use elm_object_content_part_set() instead
+ *
*/
- EAPI void elm_bubble_icon_set(Evas_Object *obj, Evas_Object *icon) EINA_ARG_NONNULL(1);
+ EINA_DEPRECATED EAPI void elm_bubble_icon_set(Evas_Object *obj, Evas_Object *icon) EINA_ARG_NONNULL(1);
/**
* Get the icon of the bubble
*
* @return The icon for the bubble
*
* This function gets the icon shown on the top left of bubble.
+ *
+ * @deprecated use elm_object_content_part_get() instead
+ *
*/
- EAPI Evas_Object *elm_bubble_icon_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
+ EINA_DEPRECATED EAPI Evas_Object *elm_bubble_icon_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
/**
* Unset the icon of the bubble
*
*
* @param obj The bubble object
* @return The icon that was being used
+ *
+ * @deprecated use elm_object_content_part_unset() instead
+ *
*/
- EAPI Evas_Object *elm_bubble_icon_unset(Evas_Object *obj) EINA_ARG_NONNULL(1);
+ EINA_DEPRECATED EAPI Evas_Object *elm_bubble_icon_unset(Evas_Object *obj) EINA_ARG_NONNULL(1);
/**
* Set the corner of the bubble
*
}
static void
-_content_set_hook(Evas_Object *obj, const char *part __UNUSED__, Evas_Object *content)
+_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) return;
if (wd->content) evas_object_del(wd->content);
wd->content = content;
}
static Evas_Object *
-_content_get_hook(const Evas_Object *obj, const char *part __UNUSED__)
+_content_unset(Evas_Object *obj)
{
- ELM_CHECK_WIDTYPE(obj, widtype) NULL;
- Widget_Data *wd = elm_widget_data_get(obj);
- if (!wd) return NULL;
- return wd->content;
-}
-
-static Evas_Object *
-_content_unset_hook(Evas_Object *obj, const char *part __UNUSED__)
-{
- 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, content);
- evas_object_event_callback_del_full(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+ 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;
}
+static void
+_icon_set(Evas_Object *obj, Evas_Object* icon)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+ if (wd->icon == icon) return;
+ if (wd->icon) evas_object_del(wd->icon);
+ wd->icon = icon;
+ if (icon)
+ {
+ elm_widget_sub_object_add(obj, icon);
+ edje_object_part_swallow(wd->bbl, "elm.swallow.icon", icon);
+ evas_object_event_callback_add(icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
+ _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);
+}
+
+static Evas_Object *
+_icon_unset(Evas_Object *obj)
+{
+ Widget_Data *wd = elm_widget_data_get(obj);
+ Evas_Object *icon;
+ if (!wd) return NULL;
+ 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;
+}
+
+static void
+_content_set_hook(Evas_Object *obj, const char *part, Evas_Object *content)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype);
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return;
+
+ if ((!part) || !strcmp(part, "elm.swallow.content"))
+ _content_set(obj, content);
+ else if(!strcmp(part, "elm.swallow.icon"))
+ _icon_set(obj, content);
+}
+
+static Evas_Object *
+_content_get_hook(const Evas_Object *obj, const char *part)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype) NULL;
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return NULL;
+ if ((!part) || !strcmp(part, "elm.swallow.content"))
+ return wd->content;
+ else if(!strcmp(part, "elm.swallow.icon"))
+ return wd->icon;
+ return NULL;
+}
+
+static Evas_Object *
+_content_unset_hook(Evas_Object *obj, const char *part)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype) NULL;
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (!wd) return NULL;
+ if ((!part) || !strcmp(part, "elm.swallow.content"))
+ return _content_unset(obj);
+ else if(!strcmp(part, "elm.swallow.icon"))
+ return _icon_unset(obj);
+ return NULL;
+}
+
static Eina_Bool
_elm_bubble_focus_next_hook(const Evas_Object *obj, Elm_Focus_Direction dir, Evas_Object **next)
{
EAPI void
elm_bubble_icon_set(Evas_Object *obj, Evas_Object *icon)
{
- ELM_CHECK_WIDTYPE(obj, widtype);
- Widget_Data *wd = elm_widget_data_get(obj);
- if (!wd) return;
- if (wd->icon == icon) return;
- if (wd->icon) evas_object_del(wd->icon);
- wd->icon = icon;
- if (icon)
- {
- elm_widget_sub_object_add(obj, icon);
- edje_object_part_swallow(wd->bbl, "elm.swallow.icon", icon);
- evas_object_event_callback_add(icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
- _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);
+ _content_set_hook(obj, "elm.swallow.icon", icon);
}
EAPI Evas_Object *
elm_bubble_icon_get(const Evas_Object *obj)
{
- ELM_CHECK_WIDTYPE(obj, widtype) NULL;
- Widget_Data *wd = elm_widget_data_get(obj);
- if (!wd) return NULL;
- return wd->icon;
+ return _content_get_hook(obj, "elm.swallow.icon");
}
EAPI Evas_Object *
elm_bubble_icon_unset(Evas_Object *obj)
{
- ELM_CHECK_WIDTYPE(obj, widtype) NULL;
- Widget_Data *wd = elm_widget_data_get(obj);
- Evas_Object *icon;
- if (!wd) return NULL;
- 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;
+ return _content_unset_hook(obj, "elm.swallow.icon");
}
EAPI void