forked from enlightenment/efl
elementary - slider, scroller, progressbar, radio
applied elm_object_content_set/get/unset APIs. SVN revision: 64542
This commit is contained in:
parent
8e5a6ce75f
commit
f856c0e9fe
|
@ -15,7 +15,7 @@ evas_object_show(ic);
|
|||
pb = elm_progressbar_add(win);
|
||||
elm_object_text_set(pb, "Label");
|
||||
elm_progressbar_span_size_set(pb, 100);
|
||||
elm_progressbar_icon_set(pb, ic);
|
||||
elm_object_content_set(pb, ic);
|
||||
elm_progressbar_unit_format_set(pb, "%1.1f units");
|
||||
evas_object_size_hint_align_set(pb, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
evas_object_size_hint_weight_set(pb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
|
|
|
@ -9,6 +9,6 @@ evas_object_show(o);
|
|||
Evas_Object *o2 = elm_label_add(win);
|
||||
elm_object_text_set(o2, "This is the content of the scroller");
|
||||
evas_object_show(o2);
|
||||
elm_scroller_content_set(o, o2);
|
||||
elm_object_content_set(o, o2);
|
||||
|
||||
#include "widget_preview_tmpl_foot.c"
|
||||
|
|
|
@ -1453,7 +1453,7 @@ _status_config_themes(Evas_Object *win,
|
|||
evas_object_show(sc);
|
||||
|
||||
sample = _sample_theme_new(win);
|
||||
elm_scroller_content_set(sc, sample);
|
||||
elm_object_content_set(sc, sample);
|
||||
evas_object_show(sample);
|
||||
evas_object_data_set(win, "theme_preview", sample);
|
||||
|
||||
|
@ -2443,7 +2443,7 @@ _status_config_scrolling(Evas_Object *win,
|
|||
evas_object_size_hint_align_set(sc, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
elm_scroller_bounce_set(sc, EINA_FALSE, EINA_TRUE);
|
||||
evas_object_show(sc);
|
||||
elm_scroller_content_set(sc, bx);
|
||||
elm_object_content_set(sc, bx);
|
||||
|
||||
ck = elm_check_add(win);
|
||||
elm_object_tooltip_text_set(ck, "Set whether scrollers should bounce<br>"
|
||||
|
|
|
@ -230,7 +230,7 @@ test_anchorblock(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event
|
|||
elm_box_pack_end(bx, bb);
|
||||
evas_object_show(bb);
|
||||
|
||||
elm_scroller_content_set(sc, bx);
|
||||
elm_object_content_set(sc, bx);
|
||||
evas_object_show(bx);
|
||||
|
||||
evas_object_show(sc);
|
||||
|
|
|
@ -55,7 +55,7 @@ test_button(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
|
|||
|
||||
bx = elm_box_add(win);
|
||||
evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
elm_scroller_content_set(scr, bx);
|
||||
elm_object_content_set(scr, bx);
|
||||
evas_object_show(bx);
|
||||
|
||||
ic = elm_icon_add(win);
|
||||
|
|
|
@ -188,7 +188,7 @@ _list_item_cb5(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_i
|
|||
elm_object_text_set(btn, "Enlightenment");
|
||||
evas_object_size_hint_min_set(btn, 140, 140);
|
||||
|
||||
elm_scroller_content_set(sc, btn);
|
||||
elm_object_content_set(sc, btn);
|
||||
|
||||
elm_box_pack_end(bx, sc);
|
||||
|
||||
|
|
|
@ -178,7 +178,7 @@ test_factory(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_inf
|
|||
evas_object_size_hint_weight_set(sc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
elm_win_resize_object_add(win, sc);
|
||||
|
||||
elm_scroller_content_set(sc, bx);
|
||||
elm_object_content_set(sc, bx);
|
||||
evas_object_show(bx);
|
||||
|
||||
evas_object_show(sc);
|
||||
|
|
|
@ -162,7 +162,7 @@ test_focus(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
|
|||
EVAS_HINT_FILL);
|
||||
evas_object_size_hint_weight_set(bt, 0.0, 0.0);
|
||||
elm_object_event_callback_add(bt, _event, NULL);
|
||||
elm_scroller_content_set(sc, bt);
|
||||
elm_object_content_set(sc, bt);
|
||||
my_show(bt);
|
||||
elm_object_event_callback_del(bt, _event, NULL);
|
||||
}
|
||||
|
@ -228,7 +228,7 @@ test_focus(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
|
|||
evas_object_size_hint_align_set(bx3, EVAS_HINT_FILL,
|
||||
EVAS_HINT_FILL);
|
||||
evas_object_size_hint_weight_set(bx3, 0.0, 0.0);
|
||||
elm_scroller_content_set(sc, bx3);
|
||||
elm_object_content_set(sc, bx3);
|
||||
my_show(bx3);
|
||||
|
||||
for (i = 5; i; i--)
|
||||
|
|
|
@ -313,7 +313,7 @@ test_launcher(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_in
|
|||
elm_win_resize_object_add(win, bx2);
|
||||
evas_object_show(bx2);
|
||||
|
||||
elm_scroller_content_set(sc, bx);
|
||||
elm_object_content_set(sc, bx);
|
||||
evas_object_show(bx);
|
||||
|
||||
elm_scroller_page_relative_set(sc, 1.0, 1.0);
|
||||
|
@ -440,7 +440,7 @@ test_launcher2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_i
|
|||
evas_object_size_hint_weight_set(sc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
elm_win_resize_object_add(win, sc);
|
||||
|
||||
elm_scroller_content_set(sc, bx);
|
||||
elm_object_content_set(sc, bx);
|
||||
evas_object_show(bx);
|
||||
|
||||
elm_scroller_page_relative_set(sc, 1.0, 1.0);
|
||||
|
@ -848,7 +848,7 @@ test_launcher3(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_i
|
|||
elm_win_resize_object_add(win, bx2);
|
||||
evas_object_show(bx2);
|
||||
|
||||
elm_scroller_content_set(sc, bx);
|
||||
elm_object_content_set(sc, bx);
|
||||
evas_object_show(bx);
|
||||
|
||||
elm_scroller_page_relative_set(sc, 1.0, 1.0);
|
||||
|
|
|
@ -82,7 +82,7 @@ test_photo(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
|
|||
evas_object_size_hint_weight_set(sc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
elm_win_resize_object_add(win, sc);
|
||||
|
||||
elm_scroller_content_set(sc, tb);
|
||||
elm_object_content_set(sc, tb);
|
||||
evas_object_show(tb);
|
||||
evas_object_show(sc);
|
||||
|
||||
|
|
|
@ -115,7 +115,7 @@ test_progressbar(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event
|
|||
|
||||
pb = elm_progressbar_add(win);
|
||||
elm_object_text_set(pb, "Label");
|
||||
elm_progressbar_icon_set(pb, ic1);
|
||||
elm_object_content_set(pb, ic1);
|
||||
elm_progressbar_inverted_set(pb, 1);
|
||||
elm_progressbar_unit_format_set(pb, "%1.1f units");
|
||||
elm_progressbar_span_size_set(pb, 200);
|
||||
|
@ -162,7 +162,7 @@ test_progressbar(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event
|
|||
pb = elm_progressbar_add(win);
|
||||
elm_progressbar_horizontal_set(pb, EINA_FALSE);
|
||||
elm_object_text_set(pb, "Label");
|
||||
elm_progressbar_icon_set(pb, ic2);
|
||||
elm_object_content_set(pb, ic2);
|
||||
elm_progressbar_inverted_set(pb, 1);
|
||||
elm_progressbar_unit_format_set(pb, "%1.2f%%");
|
||||
elm_progressbar_span_size_set(pb, 200);
|
||||
|
|
|
@ -33,7 +33,7 @@ test_radio(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
|
|||
evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(rd, EVAS_HINT_FILL, 0.5);
|
||||
elm_object_text_set(rd, "Icon sized to radio");
|
||||
elm_radio_icon_set(rd, ic);
|
||||
elm_object_content_set(rd, ic);
|
||||
elm_box_pack_end(bx, rd);
|
||||
evas_object_show(rd);
|
||||
evas_object_show(ic);
|
||||
|
@ -48,7 +48,7 @@ test_radio(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
|
|||
elm_radio_state_value_set(rd, 1);
|
||||
elm_radio_group_add(rd, rdg);
|
||||
elm_object_text_set(rd, "Icon no scale");
|
||||
elm_radio_icon_set(rd, ic);
|
||||
elm_object_content_set(rd, ic);
|
||||
elm_box_pack_end(bx, rd);
|
||||
evas_object_show(rd);
|
||||
evas_object_show(ic);
|
||||
|
@ -76,7 +76,7 @@ test_radio(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
|
|||
rd = elm_radio_add(win);
|
||||
elm_radio_state_value_set(rd, 4);
|
||||
elm_radio_group_add(rd, rdg);
|
||||
elm_radio_icon_set(rd, ic);
|
||||
elm_object_content_set(rd, ic);
|
||||
elm_box_pack_end(bx, rd);
|
||||
evas_object_show(rd);
|
||||
evas_object_show(ic);
|
||||
|
@ -89,7 +89,7 @@ test_radio(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
|
|||
rd = elm_radio_add(win);
|
||||
elm_radio_state_value_set(rd, 5);
|
||||
elm_radio_group_add(rd, rdg);
|
||||
elm_radio_icon_set(rd, ic);
|
||||
elm_object_content_set(rd, ic);
|
||||
elm_object_disabled_set(rd, 1);
|
||||
elm_box_pack_end(bx, rd);
|
||||
evas_object_show(rd);
|
||||
|
|
|
@ -81,11 +81,10 @@ test_scroller(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_in
|
|||
evas_object_size_hint_weight_set(sc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
elm_win_resize_object_add(win, sc);
|
||||
|
||||
elm_scroller_content_set(sc, tb);
|
||||
elm_object_content_set(sc, tb);
|
||||
evas_object_show(tb);
|
||||
|
||||
elm_scroller_page_relative_set(sc, 1.0, 1.0);
|
||||
// elm_scroller_page_size_set(sc, 200, 200);
|
||||
evas_object_show(sc);
|
||||
|
||||
tb2 = elm_table_add(win);
|
||||
|
@ -189,7 +188,7 @@ test_scroller2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_i
|
|||
evas_object_show(bt);
|
||||
}
|
||||
|
||||
elm_scroller_content_set(sc, bx2);
|
||||
elm_object_content_set(sc, bx2);
|
||||
evas_object_show(bx2);
|
||||
/* } */
|
||||
|
||||
|
@ -237,7 +236,7 @@ test_scroller2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_i
|
|||
}
|
||||
}
|
||||
|
||||
elm_scroller_content_set(sc, tb2);
|
||||
elm_object_content_set(sc, tb2);
|
||||
evas_object_show(tb2);
|
||||
/* } */
|
||||
|
||||
|
@ -256,7 +255,7 @@ test_scroller2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_i
|
|||
evas_object_size_hint_weight_set(sc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
elm_scroller_bounce_set(sc, 0, 1);
|
||||
elm_win_resize_object_add(win, sc);
|
||||
elm_scroller_content_set(sc, bx);
|
||||
elm_object_content_set(sc, bx);
|
||||
evas_object_show(bx);
|
||||
evas_object_show(sc);
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ test_slider(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
|
|||
sl = elm_slider_add(win);
|
||||
sl1 = sl;
|
||||
elm_object_text_set(sl, "Horizontal");
|
||||
elm_slider_icon_set(sl, ic);
|
||||
elm_object_content_part_set(sl, ELM_SLIDER_CONTENT_ICON, ic);
|
||||
elm_slider_unit_format_set(sl, "%1.1f units");
|
||||
elm_slider_span_size_set(sl, 120);
|
||||
evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
|
||||
|
@ -56,7 +56,7 @@ test_slider(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
|
|||
|
||||
sl = elm_slider_add(win);
|
||||
elm_object_text_set(sl, "Disabled");
|
||||
elm_slider_icon_set(sl, ic);
|
||||
elm_object_content_part_set(sl, ELM_SLIDER_CONTENT_ICON, ic);
|
||||
elm_slider_unit_format_set(sl, "%1.1f units");
|
||||
elm_slider_span_size_set(sl, 120);
|
||||
elm_slider_min_max_set(sl, 50, 150);
|
||||
|
@ -75,7 +75,7 @@ test_slider(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
|
|||
|
||||
sl = elm_slider_add(win);
|
||||
elm_object_text_set(sl, "Horizontal inverted");
|
||||
elm_slider_end_set(sl, ic);
|
||||
elm_object_content_part_set(sl, ELM_SLIDER_CONTENT_END, ic);
|
||||
elm_slider_span_size_set(sl, 80);
|
||||
evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
|
||||
evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
|
@ -97,7 +97,7 @@ test_slider(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
|
|||
|
||||
sl = elm_slider_add(win);
|
||||
elm_object_text_set(sl, "Disabled inverted");
|
||||
elm_slider_end_set(sl, ic);
|
||||
elm_object_content_part_set(sl, ELM_SLIDER_CONTENT_END, ic);
|
||||
elm_slider_span_size_set(sl, 80);
|
||||
evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
|
||||
evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
|
@ -140,7 +140,7 @@ test_slider(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
|
|||
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_HORIZONTAL, 1, 1);
|
||||
|
||||
sl = elm_slider_add(win);
|
||||
elm_slider_icon_set(sl, ic);
|
||||
elm_object_content_part_set(sl, ELM_SLIDER_CONTENT_ICON, ic);
|
||||
elm_object_text_set(sl, "Vertical inverted");
|
||||
elm_slider_inverted_set(sl, EINA_TRUE);
|
||||
elm_slider_unit_format_set(sl, "units");
|
||||
|
@ -178,7 +178,7 @@ test_slider(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
|
|||
evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_HORIZONTAL, 1, 1);
|
||||
|
||||
sl = elm_slider_add(win);
|
||||
elm_slider_icon_set(sl, ic);
|
||||
elm_object_content_part_set(sl, ELM_SLIDER_CONTENT_ICON, ic);
|
||||
elm_object_text_set(sl, "Disabled vertical");
|
||||
elm_slider_inverted_set(sl, EINA_TRUE);
|
||||
elm_slider_unit_format_set(sl, "units");
|
||||
|
|
|
@ -62,7 +62,7 @@ test_thumb(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info
|
|||
evas_object_size_hint_weight_set(sc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
elm_win_resize_object_add(win, sc);
|
||||
|
||||
elm_scroller_content_set(sc, tb);
|
||||
elm_object_content_set(sc, tb);
|
||||
evas_object_show(tb);
|
||||
evas_object_show(sc);
|
||||
|
||||
|
|
|
@ -128,7 +128,7 @@ fill(Evas_Object *win, Eina_Bool do_bg)
|
|||
elm_box_pack_end(bx, bb);
|
||||
evas_object_show(bb);
|
||||
|
||||
elm_scroller_content_set(sc, bx);
|
||||
elm_object_content_set(sc, bx);
|
||||
evas_object_show(bx);
|
||||
|
||||
evas_object_show(sc);
|
||||
|
|
|
@ -28,7 +28,7 @@ external_progressbar_state_set(void *data __UNUSED__, Evas_Object *obj, const vo
|
|||
if (p->label)
|
||||
elm_object_text_set(obj, p->label);
|
||||
if (p->icon)
|
||||
elm_progressbar_icon_set(obj, p->icon);
|
||||
elm_object_content_set(obj, p->icon);
|
||||
if (p->span_exists)
|
||||
elm_progressbar_span_size_set(obj, p->span);
|
||||
if (p->value_exists)
|
||||
|
@ -58,7 +58,7 @@ external_progressbar_param_set(void *data __UNUSED__, Evas_Object *obj, const Ed
|
|||
{
|
||||
Evas_Object *icon = external_common_param_icon_get(obj, param);
|
||||
if ((strcmp(param->s, "")) && (!icon)) return EINA_FALSE;
|
||||
elm_progressbar_icon_set(obj, icon);
|
||||
elm_object_content_set(obj, icon);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ external_radio_state_set(void *data __UNUSED__, Evas_Object *obj, const void *fr
|
|||
if (p->label)
|
||||
elm_object_text_set(obj, p->label);
|
||||
if (p->icon)
|
||||
elm_radio_icon_set(obj, p->icon);
|
||||
elm_object_content_set(obj, p->icon);
|
||||
if (p->value_exists)
|
||||
elm_radio_state_value_set(obj, p->value);
|
||||
if (p->group_name)
|
||||
|
@ -50,7 +50,7 @@ external_radio_param_set(void *data __UNUSED__, Evas_Object *obj, const Edje_Ext
|
|||
{
|
||||
Evas_Object *icon = external_common_param_icon_get(obj, param);
|
||||
if ((strcmp(param->s, "")) && (!icon)) return EINA_FALSE;
|
||||
elm_radio_icon_set(obj, icon);
|
||||
elm_object_content_set(obj, icon);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ static void external_scroller_state_set(void *data __UNUSED__,
|
|||
else return;
|
||||
|
||||
if (p->content) {
|
||||
elm_scroller_content_set(obj, p->content);
|
||||
elm_object_content_set(obj, p->content);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@ static Eina_Bool external_scroller_param_set(void *data __UNUSED__,
|
|||
Evas_Object *content = external_common_param_edje_object_get(obj, param);
|
||||
if ((strcmp(param->s, "")) && (!content))
|
||||
return EINA_FALSE;
|
||||
elm_scroller_content_set(obj, content);
|
||||
elm_object_content_set(obj, content);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
|
@ -83,7 +83,7 @@ static Evas_Object *external_scroller_content_get(void *data __UNUSED__,
|
|||
const Evas_Object *obj, const char *content)
|
||||
{
|
||||
if (!strcmp(content, "content"))
|
||||
return elm_scroller_content_get(obj);
|
||||
return elm_object_content_get(obj);
|
||||
|
||||
ERR("unknown content '%s'", content);
|
||||
return NULL;
|
||||
|
|
|
@ -30,7 +30,7 @@ external_slider_state_set(void *data __UNUSED__, Evas_Object *obj, const void *f
|
|||
if (p->label)
|
||||
elm_object_text_set(obj, p->label);
|
||||
if (p->icon)
|
||||
elm_slider_icon_set(obj, p->icon);
|
||||
elm_object_content_part_set(obj, ELM_SLIDER_CONTENT_ICON, p->icon);
|
||||
if (p->span_exists)
|
||||
elm_slider_span_size_set(obj, p->span);
|
||||
if ((p->min_exists) && (p->max_exists))
|
||||
|
@ -73,7 +73,7 @@ external_slider_param_set(void *data __UNUSED__, Evas_Object *obj, const Edje_Ex
|
|||
{
|
||||
Evas_Object *icon = external_common_param_icon_get(obj, param);
|
||||
if ((strcmp(param->s, "")) && (!icon)) return EINA_FALSE;
|
||||
elm_slider_icon_set(obj, icon);
|
||||
elm_object_content_part_set(obj, ELM_SLIDER_CONTENT_ICON, icon);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -143,7 +143,7 @@ elm_main(int argc __UNUSED__,
|
|||
/* pb with label, icon, custom unit label and span size set */
|
||||
pb = elm_progressbar_add(win);
|
||||
elm_object_text_set(pb, "Label");
|
||||
elm_progressbar_icon_set(pb, ic1);
|
||||
elm_object_content_set(pb, ic1);
|
||||
elm_progressbar_inverted_set(pb, EINA_TRUE);
|
||||
elm_progressbar_unit_format_set(pb, "%1.1f units");
|
||||
elm_progressbar_span_size_set(pb, 200);
|
||||
|
@ -192,7 +192,7 @@ elm_main(int argc __UNUSED__,
|
|||
pb = elm_progressbar_add(win);
|
||||
elm_progressbar_horizontal_set(pb, EINA_FALSE);
|
||||
elm_object_text_set(pb, "Label");
|
||||
elm_progressbar_icon_set(pb, ic2);
|
||||
elm_object_content_set(pb, ic2);
|
||||
elm_progressbar_inverted_set(pb, EINA_TRUE);
|
||||
elm_progressbar_unit_format_set(pb, "%1.2f%%");
|
||||
elm_progressbar_span_size_set(pb, 200);
|
||||
|
|
|
@ -37,7 +37,7 @@ elm_main(int argc, char **argv)
|
|||
elm_radio_value_pointer_set(radio, &val);
|
||||
ic = elm_icon_add(win);
|
||||
elm_icon_standard_set(ic, "home");
|
||||
elm_radio_icon_set(radio, ic);
|
||||
elm_object_content_set(radio, ic);
|
||||
elm_box_pack_end(bx, radio);
|
||||
evas_object_size_hint_weight_set(radio, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(radio, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
|
@ -51,7 +51,7 @@ elm_main(int argc, char **argv)
|
|||
elm_radio_group_add(radio, group);
|
||||
ic = elm_icon_add(win);
|
||||
elm_icon_standard_set(ic, "file");
|
||||
elm_radio_icon_set(radio, ic);
|
||||
elm_object_content_set(radio, ic);
|
||||
elm_box_pack_end(bx, radio);
|
||||
evas_object_size_hint_weight_set(radio, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(radio, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
|
|
|
@ -127,7 +127,7 @@ elm_main(int argc, char **argv)
|
|||
scroller = elm_scroller_add(win);
|
||||
elm_win_resize_object_add(win, scroller);
|
||||
evas_object_show(scroller);
|
||||
elm_scroller_content_set(scroller, label);
|
||||
elm_object_content_set(scroller, label);
|
||||
elm_scroller_bounce_set(scroller, EINA_TRUE, EINA_FALSE);
|
||||
elm_scroller_policy_set(scroller, ELM_SCROLLER_POLICY_ON, ELM_SCROLLER_POLICY_ON);
|
||||
elm_scroller_propagate_events_set(scroller, EINA_TRUE);
|
||||
|
|
|
@ -85,12 +85,12 @@ elm_main(int argc __UNUSED__, char **argv __UNUSED__)
|
|||
ic = elm_icon_add(win);
|
||||
elm_icon_standard_set(ic, "home");
|
||||
elm_icon_scale_set(ic, EINA_FALSE, EINA_FALSE);
|
||||
elm_slider_icon_set(sl, ic);
|
||||
elm_object_content_part_set(sl, ELM_SLIDER_CONTENT_ICON, ic);
|
||||
|
||||
ic = elm_icon_add(win);
|
||||
elm_icon_standard_set(ic, "folder");
|
||||
elm_icon_scale_set(ic, EINA_FALSE, EINA_FALSE);
|
||||
elm_slider_end_set(sl, ic);
|
||||
elm_object_content_part_set(sl, ELM_SLIDER_CONTENT_END, ic);
|
||||
|
||||
evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
|
||||
evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
|
|
|
@ -7017,6 +7017,9 @@ extern "C" {
|
|||
* @note When Elementary is in desktop mode the thumbscroll(a.k.a.
|
||||
* fingerscroll) won't work.
|
||||
*
|
||||
* Default contents parts of the scroller widget that you can use for are:
|
||||
* @li "elm.swallow.content" - A content of the scroller
|
||||
*
|
||||
* In @ref tutorial_scroller you'll find an example of how to use most of
|
||||
* this API.
|
||||
* @{
|
||||
|
@ -7050,7 +7053,7 @@ extern "C" {
|
|||
* If you want to keep that old content object, use the
|
||||
* elm_scroller_content_unset() function.
|
||||
*/
|
||||
EAPI void elm_scroller_content_set(Evas_Object *obj, Evas_Object *child) EINA_ARG_NONNULL(1);
|
||||
EINA_DEPRECATED EAPI void elm_scroller_content_set(Evas_Object *obj, Evas_Object *child) EINA_ARG_NONNULL(1);
|
||||
/**
|
||||
* @brief Get the content of the scroller widget
|
||||
*
|
||||
|
@ -7061,7 +7064,7 @@ extern "C" {
|
|||
*
|
||||
* @see elm_scroller_content_set()
|
||||
*/
|
||||
EAPI Evas_Object *elm_scroller_content_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||
EINA_DEPRECATED EAPI Evas_Object *elm_scroller_content_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||
/**
|
||||
* @brief Unset the content of the scroller widget
|
||||
*
|
||||
|
@ -7072,7 +7075,7 @@ extern "C" {
|
|||
*
|
||||
* @see elm_scroller_content_set()
|
||||
*/
|
||||
EAPI Evas_Object *elm_scroller_content_unset(Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||
EINA_DEPRECATED EAPI Evas_Object *elm_scroller_content_unset(Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||
/**
|
||||
* @brief Set custom theme elements for the scroller
|
||||
*
|
||||
|
@ -7334,7 +7337,6 @@ extern "C" {
|
|||
* @see elm_scroller_propagate_events_set()
|
||||
*/
|
||||
EAPI Eina_Bool elm_scroller_propagate_events_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||
|
||||
/**
|
||||
* @brief Set scrolling gravity on a scroller
|
||||
*
|
||||
|
@ -17280,10 +17282,17 @@ extern "C" {
|
|||
* Available styles for it:
|
||||
* - @c "default"
|
||||
*
|
||||
* Default contents parts of the slider widget that you can use for are:
|
||||
* @li "elm.swallow.icon" - A icon of the slider
|
||||
* @li "elm.swallow.end" - A end part content of the slider
|
||||
*
|
||||
* Here is an example on its usage:
|
||||
* @li @ref slider_example
|
||||
*/
|
||||
|
||||
#define ELM_SLIDER_CONTENT_ICON "elm.swallow.icon"
|
||||
#define ELM_SLIDER_CONTENT_END "elm.swallow.end"
|
||||
|
||||
/**
|
||||
* @addtogroup Slider
|
||||
* @{
|
||||
|
@ -17342,7 +17351,7 @@ extern "C" {
|
|||
*
|
||||
* @ingroup Slider
|
||||
*/
|
||||
EAPI void elm_slider_icon_set(Evas_Object *obj, Evas_Object *icon) EINA_ARG_NONNULL(1);
|
||||
EINA_DEPRECATED EAPI void elm_slider_icon_set(Evas_Object *obj, Evas_Object *icon) EINA_ARG_NONNULL(1);
|
||||
|
||||
/**
|
||||
* Unset an icon set on a given slider widget.
|
||||
|
@ -17362,7 +17371,7 @@ extern "C" {
|
|||
*
|
||||
* @ingroup Slider
|
||||
*/
|
||||
EAPI Evas_Object *elm_slider_icon_unset(Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||
EINA_DEPRECATED EAPI Evas_Object *elm_slider_icon_unset(Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||
|
||||
/**
|
||||
* Retrieve the icon object set for a given slider widget.
|
||||
|
@ -17379,7 +17388,7 @@ extern "C" {
|
|||
*
|
||||
* @ingroup Slider
|
||||
*/
|
||||
EAPI Evas_Object *elm_slider_icon_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||
EINA_DEPRECATED EAPI Evas_Object *elm_slider_icon_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||
|
||||
/**
|
||||
* Set the end object of the slider object.
|
||||
|
@ -17399,7 +17408,7 @@ extern "C" {
|
|||
*
|
||||
* @ingroup Slider
|
||||
*/
|
||||
EAPI void elm_slider_end_set(Evas_Object *obj, Evas_Object *end) EINA_ARG_NONNULL(1);
|
||||
EINA_DEPRECATED EAPI void elm_slider_end_set(Evas_Object *obj, Evas_Object *end) EINA_ARG_NONNULL(1);
|
||||
|
||||
/**
|
||||
* Unset an end object set on a given slider widget.
|
||||
|
@ -17419,7 +17428,7 @@ extern "C" {
|
|||
*
|
||||
* @ingroup Slider
|
||||
*/
|
||||
EAPI Evas_Object *elm_slider_end_unset(Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||
EINA_DEPRECATED EAPI Evas_Object *elm_slider_end_unset(Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||
|
||||
/**
|
||||
* Retrieve the end object set for a given slider widget.
|
||||
|
@ -17436,7 +17445,7 @@ extern "C" {
|
|||
*
|
||||
* @ingroup Slider
|
||||
*/
|
||||
EAPI Evas_Object *elm_slider_end_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||
EINA_DEPRECATED EAPI Evas_Object *elm_slider_end_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||
|
||||
/**
|
||||
* Set the (exact) length of the bar region of a given slider widget.
|
||||
|
@ -19805,6 +19814,9 @@ extern "C" {
|
|||
* @li changed - This is called whenever the user changes the state of one of
|
||||
* the radio objects within the group of radio objects that work together.
|
||||
*
|
||||
* Default contents parts of the radio widget that you can use for are:
|
||||
* @li "elm.swallow.content" - A icon of the radio
|
||||
*
|
||||
* @ref tutorial_radio show most of this API in action.
|
||||
* @{
|
||||
*/
|
||||
|
@ -19843,7 +19855,7 @@ extern "C" {
|
|||
* want to keep that old content object, use the elm_radio_icon_unset()
|
||||
* function.
|
||||
*/
|
||||
EAPI void elm_radio_icon_set(Evas_Object *obj, Evas_Object *icon) EINA_ARG_NONNULL(1);
|
||||
EINA_DEPRECATED EAPI void elm_radio_icon_set(Evas_Object *obj, Evas_Object *icon) EINA_ARG_NONNULL(1);
|
||||
/**
|
||||
* @brief Get the icon object of the radio object
|
||||
*
|
||||
|
@ -19852,7 +19864,7 @@ extern "C" {
|
|||
*
|
||||
* @see elm_radio_icon_set()
|
||||
*/
|
||||
EAPI Evas_Object *elm_radio_icon_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||
EINA_DEPRECATED EAPI Evas_Object *elm_radio_icon_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||
/**
|
||||
* @brief Unset the icon used for the radio object
|
||||
*
|
||||
|
@ -19863,7 +19875,7 @@ extern "C" {
|
|||
*
|
||||
* @see elm_radio_icon_set()
|
||||
*/
|
||||
EAPI Evas_Object *elm_radio_icon_unset(Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||
EINA_DEPRECATED EAPI Evas_Object *elm_radio_icon_unset(Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||
/**
|
||||
* @brief Add this radio to a group of other radio objects
|
||||
*
|
||||
|
@ -20944,6 +20956,9 @@ extern "C" {
|
|||
* - @c "wheel" (simple style, no text, no progression, only
|
||||
* "pulse" effect is available)
|
||||
*
|
||||
* Default contents parts of the progressbar widget that you can use for are:
|
||||
* @li "elm.swallow.content" - A icon of the progressbar
|
||||
*
|
||||
* Here is an example on its usage:
|
||||
* @li @ref progressbar_example
|
||||
*/
|
||||
|
@ -21083,7 +21098,7 @@ extern "C" {
|
|||
*
|
||||
* @ingroup Progressbar
|
||||
*/
|
||||
EAPI void elm_progressbar_icon_set(Evas_Object *obj, Evas_Object *icon) EINA_ARG_NONNULL(1);
|
||||
EINA_DEPRECATED EAPI void elm_progressbar_icon_set(Evas_Object *obj, Evas_Object *icon) EINA_ARG_NONNULL(1);
|
||||
|
||||
/**
|
||||
* Retrieve the icon object set for a given progress bar widget
|
||||
|
@ -21096,7 +21111,7 @@ extern "C" {
|
|||
*
|
||||
* @ingroup Progressbar
|
||||
*/
|
||||
EAPI Evas_Object *elm_progressbar_icon_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||
EINA_DEPRECATED EAPI Evas_Object *elm_progressbar_icon_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||
|
||||
/**
|
||||
* Unset an icon set on a given progress bar widget
|
||||
|
@ -21112,7 +21127,7 @@ extern "C" {
|
|||
*
|
||||
* @ingroup Progressbar
|
||||
*/
|
||||
EAPI Evas_Object *elm_progressbar_icon_unset(Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||
EINA_DEPRECATED EAPI Evas_Object *elm_progressbar_icon_unset(Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||
|
||||
/**
|
||||
* Set the (exact) length of the bar region of a given progress bar
|
||||
|
|
|
@ -227,7 +227,7 @@ elm_anchorview_add(Evas_Object *parent)
|
|||
elm_entry_editable_set(wd->entry, 0);
|
||||
evas_object_size_hint_weight_set(wd->entry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(wd->entry, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
elm_scroller_content_set(wd->scroller, wd->entry);
|
||||
elm_object_content_set(wd->scroller, wd->entry);
|
||||
evas_object_show(wd->entry);
|
||||
|
||||
evas_object_event_callback_add(wd->entry, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
|
|
|
@ -1051,7 +1051,7 @@ _list_new(Evas_Object *obj)
|
|||
evas_object_size_hint_weight_set(wd->box, EVAS_HINT_EXPAND,
|
||||
EVAS_HINT_EXPAND);
|
||||
|
||||
elm_scroller_content_set(wd->scr, wd->box);
|
||||
elm_object_content_set(wd->scr, wd->box);
|
||||
elm_ctxpopup_horizontal_set(obj, wd->horizontal);
|
||||
}
|
||||
|
||||
|
|
|
@ -2554,7 +2554,7 @@ _group_bubble_content_update(Marker_Group *group)
|
|||
elm_box_horizontal_set(group->bx, EINA_TRUE);
|
||||
evas_object_show(group->bx);
|
||||
|
||||
elm_scroller_content_set(group->sc, group->bx);
|
||||
elm_object_content_set(group->sc, group->bx);
|
||||
|
||||
evas_object_event_callback_add(group->sc, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_bubble_sc_hints_changed_cb, group);
|
||||
|
|
|
@ -197,6 +197,54 @@ _elm_progressbar_label_get(const Evas_Object *obj, const char *item)
|
|||
return wd->label;
|
||||
}
|
||||
|
||||
static void
|
||||
_content_set_hook(Evas_Object *obj, const char *part __UNUSED__, Evas_Object *content)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return;
|
||||
if (wd->icon == content) return;
|
||||
if (wd->icon) evas_object_del(wd->icon);
|
||||
wd->icon = 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->progressbar, "elm.swallow.content", content);
|
||||
edje_object_signal_emit(wd->progressbar, "elm,state,icon,visible", "elm");
|
||||
edje_object_message_signal_process(wd->progressbar);
|
||||
}
|
||||
_sizing_eval(obj);
|
||||
}
|
||||
|
||||
static Evas_Object *
|
||||
_content_get_hook(const Evas_Object *obj, const char *part __UNUSED__)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return NULL;
|
||||
return wd->icon;
|
||||
}
|
||||
|
||||
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);
|
||||
if (!wd) return NULL;
|
||||
if (!wd->icon) return NULL;
|
||||
Evas_Object *icon = wd->icon;
|
||||
elm_widget_sub_object_del(obj, wd->icon);
|
||||
evas_object_event_callback_add(icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints, obj);
|
||||
edje_object_part_unswallow(wd->progressbar, wd->icon);
|
||||
wd->icon = NULL;
|
||||
return icon;
|
||||
}
|
||||
|
||||
|
||||
EAPI Evas_Object *
|
||||
elm_progressbar_add(Evas_Object *parent)
|
||||
{
|
||||
|
@ -215,6 +263,9 @@ elm_progressbar_add(Evas_Object *parent)
|
|||
elm_widget_can_focus_set(obj, EINA_FALSE);
|
||||
elm_widget_text_set_hook_set(obj, _elm_progressbar_label_set);
|
||||
elm_widget_text_get_hook_set(obj, _elm_progressbar_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->horizontal = EINA_TRUE;
|
||||
wd->inverted = EINA_FALSE;
|
||||
|
@ -315,47 +366,19 @@ elm_progressbar_label_get(const Evas_Object *obj)
|
|||
EAPI void
|
||||
elm_progressbar_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);
|
||||
evas_object_event_callback_add(icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_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");
|
||||
edje_object_message_signal_process(wd->progressbar);
|
||||
}
|
||||
_sizing_eval(obj);
|
||||
_content_set_hook(obj, NULL, icon);
|
||||
}
|
||||
|
||||
EAPI Evas_Object *
|
||||
elm_progressbar_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, NULL);
|
||||
}
|
||||
|
||||
EAPI Evas_Object *
|
||||
elm_progressbar_icon_unset(Evas_Object *obj)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return NULL;
|
||||
if (!wd->icon) return NULL;
|
||||
Evas_Object *icon = wd->icon;
|
||||
elm_widget_sub_object_del(obj, wd->icon);
|
||||
evas_object_event_callback_del_full(wd->icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints, obj);
|
||||
edje_object_part_unswallow(wd->progressbar, wd->icon);
|
||||
wd->icon = NULL;
|
||||
return icon;
|
||||
return _content_unset_hook(obj, NULL);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
|
|
|
@ -298,6 +298,53 @@ _access_state_cb(void *data __UNUSED__, Evas_Object *obj, Elm_Widget_Item *item
|
|||
return strdup(E_("State: Off"));
|
||||
}
|
||||
|
||||
static void
|
||||
_content_set_hook(Evas_Object *obj, const char *part __UNUSED__, Evas_Object *content)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return;
|
||||
if (wd->icon == content) return;
|
||||
if (wd->icon) evas_object_del(wd->icon);
|
||||
wd->icon = 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->radio, "elm.swallow.content", content);
|
||||
edje_object_signal_emit(wd->radio, "elm,state,icon,visible", "elm");
|
||||
edje_object_message_signal_process(wd->radio);
|
||||
}
|
||||
_sizing_eval(obj);
|
||||
}
|
||||
|
||||
static Evas_Object *
|
||||
_content_get_hook(const Evas_Object *obj, const char *part __UNUSED__)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return NULL;
|
||||
return wd->icon;
|
||||
}
|
||||
|
||||
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);
|
||||
if (!wd) return NULL;
|
||||
if (!wd->icon) return NULL;
|
||||
Evas_Object *icon = wd->icon;
|
||||
elm_widget_sub_object_del(obj, wd->icon);
|
||||
evas_object_event_callback_del_full(wd->icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints, obj);
|
||||
edje_object_part_unswallow(wd->radio, wd->icon);
|
||||
wd->icon = NULL;
|
||||
return icon;
|
||||
}
|
||||
|
||||
EAPI Evas_Object *
|
||||
elm_radio_add(Evas_Object *parent)
|
||||
{
|
||||
|
@ -320,6 +367,9 @@ elm_radio_add(Evas_Object *parent)
|
|||
elm_widget_event_hook_set(obj, _event_hook);
|
||||
elm_widget_text_set_hook_set(obj, _elm_radio_label_set);
|
||||
elm_widget_text_get_hook_set(obj, _elm_radio_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->radio = edje_object_add(e);
|
||||
_elm_theme_object_set(obj, wd->radio, "radio", "base", "default");
|
||||
|
@ -366,47 +416,19 @@ elm_radio_label_get(const Evas_Object *obj)
|
|||
EAPI void
|
||||
elm_radio_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);
|
||||
evas_object_event_callback_add(icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_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");
|
||||
edje_object_message_signal_process(wd->radio);
|
||||
}
|
||||
_sizing_eval(obj);
|
||||
_content_set_hook(obj, NULL, icon);
|
||||
}
|
||||
|
||||
EAPI Evas_Object *
|
||||
elm_radio_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, NULL);
|
||||
}
|
||||
|
||||
EAPI Evas_Object *
|
||||
elm_radio_icon_unset(Evas_Object *obj)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return NULL;
|
||||
if (!wd->icon) return NULL;
|
||||
Evas_Object *icon = wd->icon;
|
||||
elm_widget_sub_object_del(obj, wd->icon);
|
||||
evas_object_event_callback_del_full(wd->icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints, obj);
|
||||
edje_object_part_unswallow(wd->radio, wd->icon);
|
||||
wd->icon = NULL;
|
||||
return icon;
|
||||
return _content_unset_hook(obj, NULL);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
|
|
|
@ -413,6 +413,65 @@ _scroll_drag_stop(void *data, Evas_Object *obj __UNUSED__, void *event_info __UN
|
|||
evas_object_smart_callback_call(data, SIG_SCROLL_DRAG_STOP, NULL);
|
||||
}
|
||||
|
||||
Evas_Object *
|
||||
_elm_scroller_edje_object_get(Evas_Object *obj)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return NULL;
|
||||
return elm_smart_scroller_edje_object_get(wd->scr);
|
||||
}
|
||||
|
||||
static void
|
||||
_content_set_hook(Evas_Object *obj, const char *part __UNUSED__, 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;
|
||||
if (content)
|
||||
{
|
||||
elm_widget_on_show_region_hook_set(content, _show_region_hook, obj);
|
||||
elm_widget_sub_object_add(obj, content);
|
||||
if (wd->scr)
|
||||
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);
|
||||
}
|
||||
|
||||
static Evas_Object *
|
||||
_content_get_hook(const Evas_Object *obj, const char *part __UNUSED__)
|
||||
{
|
||||
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, wd->content);
|
||||
evas_object_event_callback_del_full(wd->content,
|
||||
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints, obj);
|
||||
edje_object_part_unswallow(elm_smart_scroller_edje_object_get(wd->scr),
|
||||
wd->content);
|
||||
wd->content = NULL;
|
||||
return content;
|
||||
}
|
||||
|
||||
EAPI Evas_Object *
|
||||
elm_scroller_add(Evas_Object *parent)
|
||||
{
|
||||
|
@ -437,6 +496,9 @@ elm_scroller_add(Evas_Object *parent)
|
|||
elm_widget_can_focus_set(obj, EINA_TRUE);
|
||||
elm_widget_event_hook_set(obj, _event_hook);
|
||||
elm_widget_focus_region_hook_set(obj, _focus_region_hook);
|
||||
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->widget_name = eina_stringshare_add("scroller");
|
||||
wd->widget_base = eina_stringshare_add("base");
|
||||
|
@ -477,61 +539,22 @@ elm_scroller_add(Evas_Object *parent)
|
|||
return obj;
|
||||
}
|
||||
|
||||
Evas_Object *
|
||||
_elm_scroller_edje_object_get(Evas_Object *obj)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return NULL;
|
||||
return elm_smart_scroller_edje_object_get(wd->scr);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
elm_scroller_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;
|
||||
if (content)
|
||||
{
|
||||
elm_widget_on_show_region_hook_set(content, _show_region_hook, obj);
|
||||
elm_widget_sub_object_add(obj, content);
|
||||
if (wd->scr)
|
||||
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);
|
||||
_content_set_hook(obj, NULL, content);
|
||||
}
|
||||
|
||||
EAPI Evas_Object *
|
||||
elm_scroller_content_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->content;
|
||||
return _content_get_hook(obj, NULL);
|
||||
}
|
||||
|
||||
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);
|
||||
evas_object_event_callback_del_full(wd->content,
|
||||
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints, obj);
|
||||
edje_object_part_unswallow(elm_smart_scroller_edje_object_get(wd->scr), wd->content);
|
||||
wd->content = NULL;
|
||||
return content;
|
||||
return _content_unset_hook(obj, NULL);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
|
|
|
@ -494,6 +494,122 @@ _elm_slider_label_get(const Evas_Object *obj, const char *item)
|
|||
return wd->label;
|
||||
}
|
||||
|
||||
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);
|
||||
evas_object_event_callback_add(icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints, obj);
|
||||
edje_object_part_swallow(wd->slider, "elm.swallow.icon", icon);
|
||||
edje_object_signal_emit(wd->slider, "elm,state,icon,visible", "elm");
|
||||
edje_object_message_signal_process(wd->slider);
|
||||
}
|
||||
_sizing_eval(obj);
|
||||
}
|
||||
|
||||
static Evas_Object *
|
||||
_icon_unset(Evas_Object *obj)
|
||||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
Evas_Object *ret = NULL;
|
||||
if (!wd) return NULL;
|
||||
if (wd->icon)
|
||||
{
|
||||
elm_widget_sub_object_del(obj, wd->icon);
|
||||
evas_object_event_callback_del_full(wd->icon,
|
||||
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints, obj);
|
||||
ret = wd->icon;
|
||||
edje_object_part_unswallow(wd->slider, wd->icon);
|
||||
edje_object_signal_emit(wd->slider, "elm,state,icon,hidden", "elm");
|
||||
wd->icon = NULL;
|
||||
_sizing_eval(obj);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
_end_set(Evas_Object *obj, Evas_Object *end)
|
||||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return;
|
||||
if (wd->end == end) return;
|
||||
if (wd->end) evas_object_del(wd->end);
|
||||
wd->end = end;
|
||||
if (end)
|
||||
{
|
||||
elm_widget_sub_object_add(obj, end);
|
||||
evas_object_event_callback_add(end, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints, obj);
|
||||
edje_object_part_swallow(wd->slider, "elm.swallow.end", end);
|
||||
edje_object_signal_emit(wd->slider, "elm,state,end,visible", "elm");
|
||||
edje_object_message_signal_process(wd->slider);
|
||||
}
|
||||
_sizing_eval(obj);
|
||||
}
|
||||
|
||||
static Evas_Object *
|
||||
_end_unset(Evas_Object *obj)
|
||||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
Evas_Object *ret = NULL;
|
||||
if (!wd) return NULL;
|
||||
if (wd->end)
|
||||
{
|
||||
elm_widget_sub_object_del(obj, wd->end);
|
||||
evas_object_event_callback_del_full(wd->end,
|
||||
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints, obj);
|
||||
ret = wd->end;
|
||||
edje_object_part_unswallow(wd->slider, wd->end);
|
||||
edje_object_signal_emit(wd->slider, "elm,state,end,hidden", "elm");
|
||||
wd->end = NULL;
|
||||
_sizing_eval(obj);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
_content_set_hook(Evas_Object *obj, const char *part, Evas_Object *content)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
if ((!part) || (!strcmp(part, "elm.swallow.icon")))
|
||||
_icon_set(obj, content);
|
||||
else if (!strcmp(part, "elm.swallow.end"))
|
||||
_end_set(obj, content);
|
||||
}
|
||||
|
||||
static Evas_Object *
|
||||
_content_get_hook(const Evas_Object *obj, const char *part __UNUSED__)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return NULL;
|
||||
if ((!part) || (!strcmp(part, "elm.swallow.icon")))
|
||||
return wd->icon;
|
||||
else if (!strcmp(part, "elm.swallow.end"))
|
||||
return wd->end;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static Evas_Object *
|
||||
_content_unset_hook(Evas_Object *obj, const char *part __UNUSED__)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
|
||||
if ((!part) || (!strcmp(part, "elm.swallow.icon")))
|
||||
return _icon_unset(obj);
|
||||
else if (!strcmp(part, "elm.swallow.end"))
|
||||
return _end_unset(obj);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
EAPI Evas_Object *
|
||||
elm_slider_add(Evas_Object *parent)
|
||||
{
|
||||
|
@ -515,6 +631,9 @@ elm_slider_add(Evas_Object *parent)
|
|||
elm_widget_event_hook_set(obj, _event_hook);
|
||||
elm_widget_text_set_hook_set(obj, _elm_slider_label_set);
|
||||
elm_widget_text_get_hook_set(obj, _elm_slider_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->horizontal = EINA_TRUE;
|
||||
wd->indicator_show = EINA_TRUE;
|
||||
|
@ -565,53 +684,19 @@ elm_slider_label_get(const Evas_Object *obj)
|
|||
EAPI void
|
||||
elm_slider_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);
|
||||
evas_object_event_callback_add(icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints, obj);
|
||||
edje_object_part_swallow(wd->slider, "elm.swallow.icon", icon);
|
||||
edje_object_signal_emit(wd->slider, "elm,state,icon,visible", "elm");
|
||||
edje_object_message_signal_process(wd->slider);
|
||||
}
|
||||
_sizing_eval(obj);
|
||||
_content_set_hook(obj, NULL, icon);
|
||||
}
|
||||
|
||||
EAPI Evas_Object *
|
||||
elm_slider_icon_unset(Evas_Object *obj)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
Evas_Object *ret = NULL;
|
||||
if (!wd) return NULL;
|
||||
if (wd->icon)
|
||||
{
|
||||
elm_widget_sub_object_del(obj, wd->icon);
|
||||
evas_object_event_callback_del_full(wd->icon,
|
||||
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints, obj);
|
||||
ret = wd->icon;
|
||||
edje_object_part_unswallow(wd->slider, wd->icon);
|
||||
edje_object_signal_emit(wd->slider, "elm,state,icon,hidden", "elm");
|
||||
wd->icon = NULL;
|
||||
_sizing_eval(obj);
|
||||
}
|
||||
return ret;
|
||||
return _content_unset_hook(obj, NULL);
|
||||
}
|
||||
|
||||
EAPI Evas_Object *
|
||||
elm_slider_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, NULL);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
|
@ -818,53 +903,19 @@ elm_slider_units_format_function_set(Evas_Object *obj, const char *(*func)(doubl
|
|||
EAPI void
|
||||
elm_slider_end_set(Evas_Object *obj, Evas_Object *end)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype);
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (!wd) return;
|
||||
if (wd->end == end) return;
|
||||
if (wd->end) evas_object_del(wd->end);
|
||||
wd->end = end;
|
||||
if (end)
|
||||
{
|
||||
elm_widget_sub_object_add(obj, end);
|
||||
evas_object_event_callback_add(end, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints, obj);
|
||||
edje_object_part_swallow(wd->slider, "elm.swallow.end", end);
|
||||
edje_object_signal_emit(wd->slider, "elm,state,end,visible", "elm");
|
||||
edje_object_message_signal_process(wd->slider);
|
||||
}
|
||||
_sizing_eval(obj);
|
||||
_content_set_hook(obj, "elm.swallow.end", end);
|
||||
}
|
||||
|
||||
EAPI Evas_Object *
|
||||
elm_slider_end_unset(Evas_Object *obj)
|
||||
{
|
||||
ELM_CHECK_WIDTYPE(obj, widtype) NULL;
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
Evas_Object *ret = NULL;
|
||||
if (!wd) return NULL;
|
||||
if (wd->end)
|
||||
{
|
||||
elm_widget_sub_object_del(obj, wd->end);
|
||||
evas_object_event_callback_del_full(wd->end,
|
||||
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints, obj);
|
||||
ret = wd->end;
|
||||
edje_object_part_unswallow(wd->slider, wd->end);
|
||||
edje_object_signal_emit(wd->slider, "elm,state,end,hidden", "elm");
|
||||
wd->end = NULL;
|
||||
_sizing_eval(obj);
|
||||
}
|
||||
return ret;
|
||||
return _content_unset_hook(obj, "elm.swallow.end");
|
||||
}
|
||||
|
||||
EAPI Evas_Object *
|
||||
elm_slider_end_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->end;
|
||||
return _content_get_hook(obj, "elm.swallow.end");
|
||||
}
|
||||
|
||||
EAPI void
|
||||
|
|
Loading…
Reference in New Issue