elementary/layout - deprecated elm_layout_content_set/get_unset

SVN revision: 64403
This commit is contained in:
ChunEon Park 2011-10-26 00:46:16 +00:00
parent d3d411f43f
commit dc180b67ce
18 changed files with 137 additions and 115 deletions

View File

@ -3133,8 +3133,8 @@
* Finally, we have an area in this layout theme, in the bottom part of it,
* reserved for adding an specific widget. Differently from the 2 parts
* described until now, this one can only receive one widget with the call
* elm_layout_content_set(). If there was already an item on this specific part,
* it will be deleted (one can use elm_layout_content_unset() in order to remove
* elm_object_content_part_set() for the layout. If there was already an item on this specific part,
* it will be deleted (one can use elm_object_content_part_unset() in order to remove
* it without deleting). An example of removing it without deleting, but
* manually deleting this widget just after that, can be seen on the callback
* for this button. Actually, the callback defined for this button will clean
@ -3146,7 +3146,7 @@
* Also notice that, for this last added button, we don't have to call
* evas_object_show() on it. This is a particularity of the theme for layouts,
* that will have total control over the properties like size, position,
* visibility and clipping of a widget added with elm_layout_content_set().
* visibility and clipping of a widget added with elm_object_content_part_set().
* Again, read the Edje documentation to understand this better.
*
* Now we just put the code for the different callbacks specified for each kind

View File

@ -13,7 +13,7 @@ evas_object_size_hint_align_set(icon, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_size_hint_min_set(icon, 200, 140);
evas_object_show(icon);
elm_layout_content_set(layout, "elm.swallow.content", icon);
elm_object_content_part_set(layout, "elm.swallow.content", icon);
elm_object_text_part_set(layout, "elm.text.title", "Layout");
#include "widget_preview_tmpl_foot.c"

View File

@ -60,7 +60,7 @@ test_colorselector(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *eve
re = evas_object_rectangle_add(evas_object_evas_get(win));
evas_object_show(re);
elm_layout_content_set(ly, "ColorPreview", re);
elm_object_content_part_set(ly, "ColorPreview", re);
fr = elm_frame_add(win);
evas_object_size_hint_weight_set(fr, 1.0, 0);

View File

@ -1305,7 +1305,7 @@ test_entry4(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
elm_entry_scrollbar_policy_set(en, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
elm_entry_entry_set(en, "This is a single line");
elm_entry_single_line_set(en, 1);
elm_layout_content_set(ly, "element1", en);
elm_object_content_part_set(ly, "element1", en);
evas_object_show(en);
en = elm_entry_add(win);
@ -1318,7 +1318,7 @@ test_entry4(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
"use it more flexibly.");
evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_layout_content_set(ly, "element2", en);
elm_object_content_part_set(ly, "element2", en);
evas_object_show(en);
en = elm_entry_add(win);
@ -1339,7 +1339,7 @@ test_entry4(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
"good testing to see if entry widgets work as advertised."
);
evas_object_smart_callback_add(en, "anchor,clicked", scrolled_anchor_test, en);
elm_layout_content_set(ly, "element3", en);
elm_object_content_part_set(ly, "element3", en);
evas_object_show(en);
evas_object_show(win);

View File

@ -104,17 +104,17 @@ test_flip(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info _
bt = elm_button_add(win);
elm_object_text_set(bt, "Button 1");
elm_layout_content_set(ly, "element1", bt);
elm_object_content_part_set(ly, "element1", bt);
evas_object_show(bt);
bt = elm_button_add(win);
elm_object_text_set(bt, "Button 2");
elm_layout_content_set(ly, "element2", bt);
elm_object_content_part_set(ly, "element2", bt);
evas_object_show(bt);
bt = elm_button_add(win);
elm_object_text_set(bt, "Button 3");
elm_layout_content_set(ly, "element3", bt);
elm_object_content_part_set(ly, "element3", bt);
evas_object_show(bt);
evas_object_show(fl);

View File

@ -262,7 +262,7 @@ test_focus(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL,
EVAS_HINT_FILL);
evas_object_size_hint_weight_set(bx2, 0.0, 0.0);
elm_layout_content_set(ly, "element1", bx2);
elm_object_content_part_set(ly, "element1", bx2);
my_show(bx2);
for (i = 3; i; i--)
@ -284,7 +284,7 @@ test_focus(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
evas_object_size_hint_align_set(bx2, EVAS_HINT_FILL,
EVAS_HINT_FILL);
evas_object_size_hint_weight_set(bx2, 0.0, 0.0);
elm_layout_content_set(ly, "element2", bx2);
elm_object_content_part_set(ly, "element2", bx2);
my_show(bx2);
{

View File

@ -102,7 +102,7 @@ test_focus2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
bt1 = bt = elm_button_add(ly);
elm_object_text_set(bt, "Button 1");
elm_layout_content_set(ly, "element1", bt);
elm_object_content_part_set(ly, "element1", bt);
en = elm_entry_add(ly);
elm_entry_scrollable_set(en, EINA_TRUE);
@ -111,11 +111,11 @@ test_focus2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
elm_entry_scrollbar_policy_set(en, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
elm_entry_entry_set(en, "Scrolled Entry that should get focus");
elm_entry_single_line_set(en, 1);
elm_layout_content_set(ly, "element2", en);
elm_object_content_part_set(ly, "element2", en);
bt = elm_button_add(ly);
elm_object_text_set(bt, "Button 2");
elm_layout_content_set(ly, "element3", bt);
elm_object_content_part_set(ly, "element3", bt);
bt = elm_button_add(PARENT);
elm_object_text_set(bt, "Give focus to layout");

View File

@ -353,7 +353,7 @@ test_gesture_layer(void *data __UNUSED__, Evas_Object *obj __UNUSED__,
Evas_Object *postit = elm_layout_add(win);
snprintf(buf, sizeof(buf), "%s/objects/postit_ent.edj", elm_app_data_dir_get());
elm_layout_file_set(postit, buf, "main");
elm_layout_content_set(postit, "ent", en);
elm_object_content_part_set(postit, "ent", en);
photo_array[ind++] = photo_object_add(win, postit, NULL, 50, 50, 382, 400, 355);

View File

@ -408,17 +408,17 @@ test_launcher2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_i
bt = elm_button_add(win);
elm_object_text_set(bt, "Button 1");
elm_layout_content_set(ly, "element1", bt);
elm_object_content_part_set(ly, "element1", bt);
evas_object_show(bt);
bt = elm_button_add(win);
elm_object_text_set(bt, "Button 2");
elm_layout_content_set(ly, "element2", bt);
elm_object_content_part_set(ly, "element2", bt);
evas_object_show(bt);
bt = elm_button_add(win);
elm_object_text_set(bt, "Button 3");
elm_layout_content_set(ly, "element3", bt);
elm_object_content_part_set(ly, "element3", bt);
evas_object_show(bt);
mb = elm_mapbuf_add(win);
@ -595,7 +595,7 @@ l3_tim_cb(void *data)
slx = (int)(long)evas_object_data_get(data, "slx");
sly = (int)(long)evas_object_data_get(data, "sly");
snprintf(buf, sizeof(buf), "slot.%i.%i", slx, sly);
elm_layout_content_unset(ly, buf);
elm_object_content_part_unset(ly, buf);
edje_object_signal_emit(elm_layout_edje_get(ly2), "drag", "app");
return EINA_FALSE;
}
@ -671,7 +671,7 @@ l3_ic_up_cb(void *data __UNUSED__, Evas *e __UNUSED__, Evas_Object *obj, void *e
slx = (int)(long)evas_object_data_get(obj, "slx");
sly = (int)(long)evas_object_data_get(obj, "sly");
snprintf(buf, sizeof(buf), "slot.%i.%i", slx, sly);
elm_layout_content_set(ly, buf, ly2);
elm_object_content_part_set(ly, buf, ly2);
list = (Eina_List *)evas_object_data_get
(elm_object_top_widget_get(obj), "mbs");
EINA_LIST_FOREACH(list, l, mb)
@ -812,7 +812,7 @@ test_launcher3(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_i
elm_icon_scale_set(ic, 0, 0);
evas_object_size_hint_weight_set(ic, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(ic, 0.5, 0.5);
elm_layout_content_set(ly2, "slot", ic);
elm_object_content_part_set(ly2, "slot", ic);
evas_object_show(ic);
evas_object_event_callback_add(ic, EVAS_CALLBACK_DEL, l3_ic_del_cb, ic);
@ -830,7 +830,7 @@ test_launcher3(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_i
evas_object_data_set(ic, "sly", (void *)(long)(j));
snprintf(buf, sizeof(buf), "slot.%i.%i", i, j);
elm_layout_content_set(ly, buf, ly2);
elm_object_content_part_set(ly, buf, ly2);
evas_object_show(ly2);
n++; if (n > 23) n = 0;

View File

@ -60,19 +60,19 @@ test_layout(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
bt = elm_button_add(win);
elm_object_text_set(bt, "Button 1");
elm_layout_content_set(ly, "element1", bt);
elm_object_content_part_set(ly, "element1", bt);
evas_object_smart_callback_add(bt, "clicked", _clicked_cb, ly);
evas_object_show(bt);
bt = elm_button_add(win);
elm_object_text_set(bt, "Button 2");
elm_layout_content_set(ly, "element2", bt);
elm_object_content_part_set(ly, "element2", bt);
evas_object_smart_callback_add(bt, "clicked", _clicked_cb, ly);
evas_object_show(bt);
bt = elm_button_add(win);
elm_object_text_set(bt, "Button 3");
elm_layout_content_set(ly, "element3", bt);
elm_object_content_part_set(ly, "element3", bt);
evas_object_smart_callback_add(bt, "clicked", _clicked_cb, ly);
evas_object_show(bt);

View File

@ -221,16 +221,16 @@ test_pager(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
bt = elm_button_add(win);
elm_object_text_set(bt, "Flip to 1");
evas_object_smart_callback_add(bt, "clicked", my_pager_4, &info);
elm_layout_content_set(ly2, "element1", bt);
elm_object_content_part_set(ly2, "element1", bt);
evas_object_show(bt);
bt = elm_button_add(win);
elm_object_text_set(bt, "Popme");
evas_object_smart_callback_add(bt, "clicked", my_pager_pop, &info);
evas_object_show(bt);
elm_layout_content_set(ly2, "element2", bt);
elm_object_content_part_set(ly2, "element2", bt);
elm_layout_content_set(ly, "swallow", ly2);
elm_object_content_part_set(ly, "swallow", ly2);
evas_object_show(ly);
elm_pager_content_push(pg, ly);

View File

@ -93,10 +93,10 @@ test_segment_control(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *e
elm_segment_control_item_add(segment4, NULL, "Disabled");
elm_object_disabled_set(segment4, EINA_TRUE);
elm_layout_content_set(in_layout, "segment1", segment1);
elm_layout_content_set(in_layout, "segment2", segment2);
elm_layout_content_set(in_layout, "segment3", segment3);
elm_layout_content_set(in_layout, "segment4", segment4);
elm_object_content_part_set(in_layout, "segment1", segment1);
elm_object_content_part_set(in_layout, "segment2", segment2);
elm_object_content_part_set(in_layout, "segment3", segment3);
elm_object_content_part_set(in_layout, "segment4", segment4);
evas_object_show(in_layout);

View File

@ -52,7 +52,7 @@ _swallow_btn_cb(void *data, Evas_Object *btn __UNUSED__, void *event_info __UNUS
elm_layout_table_clear(layout, TABLE, EINA_TRUE);
elm_layout_box_remove_all(layout, BOX, EINA_TRUE);
item = elm_layout_content_unset(layout, SWALLOW);
item = elm_object_content_part_unset(layout, SWALLOW);
evas_object_del(item);
}
@ -139,7 +139,7 @@ elm_main(int argc __UNUSED__, char **argv __UNUSED__)
bt2 = elm_button_add(win);
elm_object_text_set(bt2, "Delete All");
elm_layout_content_set(layout, SWALLOW, bt2);
elm_object_content_part_set(layout, SWALLOW, bt2);
evas_object_smart_callback_add(bt2, "clicked", _swallow_btn_cb, layout);
evas_object_size_hint_min_set(bg, 160, 160);

View File

@ -23,7 +23,7 @@ static void
_signal_cb(void *data, Evas_Object *o, const char *emission, const char *source __UNUSED__)
{
struct _App *app = data;
Evas_Object *icon = elm_layout_content_get(o, "elm.swallow.content");
Evas_Object *icon = elm_object_content_part_get(o, "elm.swallow.content");
printf("signal received\n");
@ -70,7 +70,7 @@ elm_main(int argc __UNUSED__, char **argv __UNUSED__)
icon = elm_icon_add(win);
elm_icon_standard_set(icon, images[app.current]);
evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_layout_content_set(layout, "elm.swallow.content", icon);
elm_object_content_part_set(layout, "elm.swallow.content", icon);
elm_object_signal_callback_add(layout, "elm,action,back", "", _signal_cb, &app);
elm_object_signal_callback_add(layout, "elm,action,next", "", _signal_cb, &app);

View File

@ -83,7 +83,7 @@ elm_main(int argc __UNUSED__, char **argv __UNUSED__)
elm_object_text_set(btn, "Enlarge me!");
evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_layout_content_set(layout, SWALLOW, btn);
elm_object_content_part_set(layout, SWALLOW, btn);
evas_object_smart_callback_add(btn, "clicked", _swallow_btn_cb, layout);
evas_object_size_hint_min_set(bg, 160, 160);

View File

@ -9783,7 +9783,7 @@ extern "C" {
* column or row span if necessary.
*
* Again, we could have this design by adding a @ref Table widget to the @c
* SWALLOW part using elm_layout_content_set(). The same difference happens
* SWALLOW part using elm_object_content_part_set(). The same difference happens
* here when choosing to use the Layout Table (a @c TABLE part) instead of
* the @ref Table plus @c SWALLOW part. It's just a matter of convenience.
*
@ -9879,7 +9879,7 @@ extern "C" {
*
* 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.
* elm_object_content_part_unset() function.
*
* @note In an Edje theme, the part used as a content container is called @c
* SWALLOW. This is why the parameter name is called @p swallow, but it is
@ -9887,13 +9887,13 @@ extern "C" {
* elm_layout_box_append().
*
* @see elm_layout_box_append()
* @see elm_layout_content_get()
* @see elm_layout_content_unset()
* @see elm_object_content_part_get()
* @see elm_object_content_part_unset()
* @see @ref secBox
*
* @ingroup Layout
*/
EAPI void elm_layout_content_set(Evas_Object *obj, const char *swallow, Evas_Object *content) EINA_ARG_NONNULL(1);
EINA_DEPRECATED EAPI void elm_layout_content_set(Evas_Object *obj, const char *swallow, Evas_Object *content) EINA_ARG_NONNULL(1);
/**
* Get the child object in the given content part.
*
@ -9902,11 +9902,11 @@ extern "C" {
*
* @return The swallowed object or NULL if none or an error occurred
*
* @see elm_layout_content_set()
* @see elm_object_content_part_set()
*
* @ingroup Layout
*/
EAPI Evas_Object *elm_layout_content_get(const Evas_Object *obj, const char *swallow) EINA_ARG_NONNULL(1);
EINA_DEPRECATED EAPI Evas_Object *elm_layout_content_get(const Evas_Object *obj, const char *swallow) EINA_ARG_NONNULL(1);
/**
* Unset the layout content.
*
@ -9916,11 +9916,11 @@ extern "C" {
*
* Unparent and return the content object which was set for this part.
*
* @see elm_layout_content_set()
* @see elm_object_content_part_set()
*
* @ingroup Layout
*/
EAPI Evas_Object *elm_layout_content_unset(Evas_Object *obj, const char *swallow) EINA_ARG_NONNULL(1);
EINA_DEPRECATED EAPI Evas_Object *elm_layout_content_unset(Evas_Object *obj, const char *swallow) EINA_ARG_NONNULL(1);
/**
* Set the text of the given part
*
@ -10036,7 +10036,7 @@ extern "C" {
*
* The object will be removed from the box part and its lifetime will
* not be handled by the layout anymore. This is equivalent to
* elm_layout_content_unset() for box.
* elm_object_content_part_unset() for box.
*
* @see elm_layout_box_append()
* @see elm_layout_box_remove_all()
@ -10107,7 +10107,7 @@ extern "C" {
*
* The object will be unpacked from the table part and its lifetime
* will not be handled by the layout anymore. This is equivalent to
* elm_layout_content_unset() for table.
* elm_object_content_part_unset() for table.
*
* @see elm_layout_table_pack()
* @see elm_layout_table_clear()
@ -10144,7 +10144,7 @@ extern "C" {
*
* This returns the edje object. It is not expected to be used to then
* swallow objects via edje_object_part_swallow() for example. Use
* elm_layout_content_set() instead so child object handling and sizing is
* elm_object_content_part_set() instead so child object handling and sizing is
* done properly.
*
* @note This function should only be used if you really need to call some
@ -10155,7 +10155,7 @@ extern "C" {
* @see elm_object_signal_callback_add()
* @see elm_object_signal_emit()
* @see elm_object_text_part_set()
* @see elm_layout_content_set()
* @see elm_object_content_part_set()
* @see elm_layout_box_append()
* @see elm_layout_table_pack()
* @see elm_layout_data_get()
@ -10320,7 +10320,7 @@ extern "C" {
#define elm_layout_icon_set(_ly, _obj) \
do { \
const char *sig; \
elm_layout_content_set((_ly), "elm.swallow.icon", (_obj)); \
elm_object_content_part_set((_ly), "elm.swallow.icon", (_obj)); \
if ((_obj)) sig = "elm,state,icon,visible"; \
else sig = "elm,state,icon,hidden"; \
elm_object_signal_emit((_ly), sig, "elm"); \
@ -10334,7 +10334,7 @@ extern "C" {
* @ingroup Layout
*/
#define elm_layout_icon_get(_ly) \
elm_layout_content_get((_ly), "elm.swallow.icon")
elm_object_content_part_get((_ly), "elm.swallow.icon")
/**
* @def elm_layout_end_set
@ -10346,7 +10346,7 @@ extern "C" {
#define elm_layout_end_set(_ly, _obj) \
do { \
const char *sig; \
elm_layout_content_set((_ly), "elm.swallow.end", (_obj)); \
elm_object_content_part_set((_ly), "elm.swallow.end", (_obj)); \
if ((_obj)) sig = "elm,state,end,visible"; \
else sig = "elm,state,end,hidden"; \
elm_object_signal_emit((_ly), sig, "elm"); \
@ -10360,7 +10360,7 @@ extern "C" {
* @ingroup Layout
*/
#define elm_layout_end_get(_ly) \
elm_layout_content_get((_ly), "elm.swallow.end")
elm_object_content_part_get((_ly), "elm.swallow.end")
/**
* @def elm_layout_label_set

View File

@ -358,6 +358,79 @@ _elm_layout_label_get(const Evas_Object *obj, const char *part)
return edje_object_part_text_get(wd->lay, part);
}
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);
Subinfo *si;
const Eina_List *l;
if (!wd) return;
EINA_LIST_FOREACH(wd->subs, l, si)
{
if ((si->type == SWALLOW) && (!strcmp(part, si->part)))
{
if (content == si->obj) return;
evas_object_del(si->obj);
break;
}
}
if (content)
{
elm_widget_sub_object_add(obj, content);
evas_object_event_callback_add(content,
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_changed_size_hints, wd);
if (!edje_object_part_swallow(wd->lay, part, content))
WRN("could not swallow %p into part '%s'", content, part);
si = ELM_NEW(Subinfo);
si->type = SWALLOW;
si->part = eina_stringshare_add(part);
si->obj = content;
wd->subs = eina_list_append(wd->subs, si);
}
_request_sizing_eval(wd);
}
static Evas_Object *
_content_get_hook(const Evas_Object *obj, const char *part)
{
Widget_Data *wd = elm_widget_data_get(obj);
const Eina_List *l;
Subinfo *si;
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
EINA_LIST_FOREACH(wd->subs, l, si)
{
if ((si->type == SWALLOW) && !strcmp(part, si->part))
return si->obj;
}
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);
Subinfo *si;
const Eina_List *l;
if (!wd) return NULL;
EINA_LIST_FOREACH(wd->subs, l, si)
{
if ((si->type == SWALLOW) && (!strcmp(part, si->part)))
{
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;
}
EAPI Evas_Object *
elm_layout_add(Evas_Object *parent)
{
@ -381,6 +454,9 @@ elm_layout_add(Evas_Object *parent)
elm_widget_signal_callback_del_hook_set(obj, _signal_callback_del_hook);
elm_widget_text_set_hook_set(obj, _elm_layout_label_set);
elm_widget_text_get_hook_set(obj, _elm_layout_label_get);
elm_widget_content_set_hook_set(obj, _content_set_hook);
elm_widget_content_get_hook_set(obj, _content_get_hook);
elm_widget_content_unset_hook_set(obj, _content_unset_hook);
wd->obj = obj;
wd->lay = edje_object_add(e);
@ -437,74 +513,20 @@ elm_layout_theme_set(Evas_Object *obj, const char *clas, const char *group, cons
EAPI void
elm_layout_content_set(Evas_Object *obj, const char *swallow, Evas_Object *content)
{
ELM_CHECK_WIDTYPE(obj, widtype);
Widget_Data *wd = elm_widget_data_get(obj);
Subinfo *si;
const Eina_List *l;
if (!wd) return;
EINA_LIST_FOREACH(wd->subs, l, si)
{
if ((si->type == SWALLOW) && (!strcmp(swallow, si->part)))
{
if (content == si->obj) return;
evas_object_del(si->obj);
break;
}
}
if (content)
{
elm_widget_sub_object_add(obj, content);
evas_object_event_callback_add(content,
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_changed_size_hints, wd);
if (!edje_object_part_swallow(wd->lay, swallow, content))
WRN("could not swallow %p into part '%s'", content, swallow);
si = ELM_NEW(Subinfo);
si->type = SWALLOW;
si->part = eina_stringshare_add(swallow);
si->obj = content;
wd->subs = eina_list_append(wd->subs, si);
}
_request_sizing_eval(wd);
_content_set_hook(obj, swallow, content);
}
EAPI Evas_Object *
elm_layout_content_get(const Evas_Object *obj, const char *swallow)
{
Widget_Data *wd = elm_widget_data_get(obj);
const Eina_List *l;
Subinfo *si;
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
EINA_LIST_FOREACH(wd->subs, l, si)
{
if ((si->type == SWALLOW) && !strcmp(swallow, si->part))
return si->obj;
}
return NULL;
return _content_get_hook(obj, swallow);
}
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;
const Eina_List *l;
if (!wd) return NULL;
EINA_LIST_FOREACH(wd->subs, l, si)
{
if ((si->type == SWALLOW) && (!strcmp(swallow, si->part)))
{
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;
return _content_unset_hook(obj, swallow);
}
EAPI void

View File

@ -2429,7 +2429,7 @@ _group_object_create(Marker_Group *group)
group->obj = elm_layout_add(group->wd->obj);
elm_layout_theme_set(group->obj, "map/marker", style, elm_widget_style_get(group->wd->obj));
if (icon) elm_layout_content_set(group->obj, "elm.icon", icon);
if (icon) elm_object_content_part_set(group->obj, "elm.icon", icon);
evas_object_smart_member_add(group->obj, group->wd->pan_smart);
elm_widget_sub_object_add(group->wd->obj, group->obj);