summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSungtaek Hong <sth253.hong@samsung.com>2017-11-14 20:38:49 +0900
committerSungtaek Hong <sth253.hong@samsung.com>2017-12-08 15:57:26 +0900
commitf80ab519af3eaf049cfece5fce21dce52f6065a4 (patch)
tree91c41207ecf39621d460e96ecbcaabe8728c6580 /src
parentdd4467505ea29d6120e5e7d467d76836a6630ff4 (diff)
efl_ui_widget: use elm_widget_element_update to set subobj edc
affected widget list: efl_ui_clock: test, ampm efl_ui_multibuttonentry: guidetext, label, closedbutton efl_ui_slider: popup(indicator) efl_ui_text: scroller, handler, magnifier, cursor, selection, anchor
Diffstat (limited to 'src')
-rw-r--r--src/lib/elementary/efl_ui_clock.c2
-rw-r--r--src/lib/elementary/efl_ui_clock_private.h9
-rw-r--r--src/lib/elementary/efl_ui_layout.c11
-rw-r--r--src/lib/elementary/efl_ui_layout.eo1
-rw-r--r--src/lib/elementary/efl_ui_multibuttonentry.c34
-rw-r--r--src/lib/elementary/efl_ui_progressbar.c68
-rw-r--r--src/lib/elementary/efl_ui_slider.c178
-rw-r--r--src/lib/elementary/efl_ui_slider_interval.c1
-rw-r--r--src/lib/elementary/efl_ui_text.c79
-rw-r--r--src/lib/elementary/efl_ui_win.c1
10 files changed, 247 insertions, 137 deletions
diff --git a/src/lib/elementary/efl_ui_clock.c b/src/lib/elementary/efl_ui_clock.c
index 969cfd9e41..b205c93991 100644
--- a/src/lib/elementary/efl_ui_clock.c
+++ b/src/lib/elementary/efl_ui_clock.c
@@ -517,6 +517,8 @@ _efl_ui_clock_elm_widget_theme_apply(Eo *obj, Efl_Ui_Clock_Data *sd)
517 for (idx = 0; idx < EFL_UI_CLOCK_TYPE_COUNT; idx++) 517 for (idx = 0; idx < EFL_UI_CLOCK_TYPE_COUNT; idx++)
518 { 518 {
519 field = sd->field_list + idx; 519 field = sd->field_list + idx;
520 // TODO: Different group name for each field_obj may be needed.
521 elm_widget_element_update(obj, field->item_obj, PART_NAME_ARRAY[idx]);
520 if (field->fmt_exist && field->visible) 522 if (field->fmt_exist && field->visible)
521 { 523 {
522 snprintf(buf, sizeof(buf), EDC_PART_FIELD_ENABLE_SIG_STR, 524 snprintf(buf, sizeof(buf), EDC_PART_FIELD_ENABLE_SIG_STR,
diff --git a/src/lib/elementary/efl_ui_clock_private.h b/src/lib/elementary/efl_ui_clock_private.h
index 94c9d702e7..e37a8ceff3 100644
--- a/src/lib/elementary/efl_ui_clock_private.h
+++ b/src/lib/elementary/efl_ui_clock_private.h
@@ -33,6 +33,15 @@ typedef struct _Format_Map Format_Map;
33#define EFL_UI_CLOCK_MAX_FORMAT_LEN 64 33#define EFL_UI_CLOCK_MAX_FORMAT_LEN 64
34#define EFL_UI_CLOCK_MAX_FIELD_FORMAT_LEN 3 34#define EFL_UI_CLOCK_MAX_FIELD_FORMAT_LEN 3
35 35
36const char *PART_NAME_ARRAY[EFL_UI_CLOCK_TYPE_COUNT] = { "text",
37 "text",
38 "text",
39 "text",
40 "text",
41 "text",
42 "text",
43 "ampm"};
44
36struct _Efl_Ui_Clock_Module_Data 45struct _Efl_Ui_Clock_Module_Data
37{ 46{
38 Evas_Object *base; 47 Evas_Object *base;
diff --git a/src/lib/elementary/efl_ui_layout.c b/src/lib/elementary/efl_ui_layout.c
index 37ae263d69..24fb83fd6c 100644
--- a/src/lib/elementary/efl_ui_layout.c
+++ b/src/lib/elementary/efl_ui_layout.c
@@ -2071,6 +2071,17 @@ EOLIAN static void _efl_ui_layout_class_constructor(Efl_Class *klass)
2071 evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass); 2071 evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
2072} 2072}
2073 2073
2074EOLIAN static Efl_Object*
2075_efl_ui_layout_efl_object_finalize(Eo *obj, Efl_Ui_Layout_Data *pd EINA_UNUSED)
2076{
2077 Eo *eo;
2078
2079 eo = efl_finalize(efl_super(obj, MY_CLASS));
2080 efl_ui_widget_theme_apply(eo);
2081
2082 return eo;
2083}
2084
2074EOLIAN static void 2085EOLIAN static void
2075_efl_ui_layout_efl_layout_signal_message_send(Eo *obj, Efl_Ui_Layout_Data *pd EINA_UNUSED, int id, const Eina_Value msg) 2086_efl_ui_layout_efl_layout_signal_message_send(Eo *obj, Efl_Ui_Layout_Data *pd EINA_UNUSED, int id, const Eina_Value msg)
2076{ 2087{
diff --git a/src/lib/elementary/efl_ui_layout.eo b/src/lib/elementary/efl_ui_layout.eo
index b4f4bdf9f5..987e205ade 100644
--- a/src/lib/elementary/efl_ui_layout.eo
+++ b/src/lib/elementary/efl_ui_layout.eo
@@ -45,6 +45,7 @@ class Efl.Ui.Layout (Elm.Widget, Efl.Part, Efl.Container, Efl.File,
45 implements { 45 implements {
46 class.constructor; 46 class.constructor;
47 Efl.Object.constructor; 47 Efl.Object.constructor;
48 Efl.Object.finalize;
48 Efl.File.file { get; set; } 49 Efl.File.file { get; set; }
49 Efl.File.mmap { get; set; } 50 Efl.File.mmap { get; set; }
50 Efl.Canvas.Group.group_calculate; 51 Efl.Canvas.Group.group_calculate;
diff --git a/src/lib/elementary/efl_ui_multibuttonentry.c b/src/lib/elementary/efl_ui_multibuttonentry.c
index 0eaa681a8a..03334a6457 100644
--- a/src/lib/elementary/efl_ui_multibuttonentry.c
+++ b/src/lib/elementary/efl_ui_multibuttonentry.c
@@ -35,6 +35,11 @@ static const char SIG_UNFOCUSED[] = "unfocused";
35static const char SIG_EXPANDED[] = "expanded"; 35static const char SIG_EXPANDED[] = "expanded";
36static const char SIG_CONTRACTED[] = "contracted"; 36static const char SIG_CONTRACTED[] = "contracted";
37static const char SIG_EXPAND_STATE_CHANGED[] = "expand,state,changed"; 37static const char SIG_EXPAND_STATE_CHANGED[] = "expand,state,changed";
38
39static const char PART_NAME_BUTTON[] = "btn";
40static const char PART_NAME_GUIDE_TEXT[] = "guidetext";
41static const char PART_NAME_LABEL[] = "label";
42static const char PART_NAME_CLOSED_BUTTON[] = "closedbutton";
38static const Evas_Smart_Cb_Description _smart_callbacks[] = { 43static const Evas_Smart_Cb_Description _smart_callbacks[] = {
39 {SIG_ITEM_SELECTED, ""}, 44 {SIG_ITEM_SELECTED, ""},
40 {SIG_ITEM_ADDED, ""}, 45 {SIG_ITEM_ADDED, ""},
@@ -117,20 +122,13 @@ _efl_ui_multibuttonentry_elm_widget_theme_apply(Eo *obj, Efl_Ui_Multibuttonentry
117 { 122 {
118 ELM_MULTIBUTTONENTRY_ITEM_DATA_GET(eo_item, item); 123 ELM_MULTIBUTTONENTRY_ITEM_DATA_GET(eo_item, item);
119 if (VIEW(item)) 124 if (VIEW(item))
120 if (!elm_layout_theme_set 125 if (!elm_widget_element_update(obj, VIEW(item), PART_NAME_BUTTON))
121 (VIEW(item), "multibuttonentry", "btn", elm_widget_style_get(obj)))
122 CRI("Failed to set layout!"); 126 CRI("Failed to set layout!");
123 } 127 }
124 128
125 elm_widget_theme_object_set 129 elm_widget_element_update(obj, sd->label, PART_NAME_LABEL);
126 (obj, sd->label, "multibuttonentry", "label", 130 elm_widget_element_update(obj, sd->end, PART_NAME_CLOSED_BUTTON);
127 elm_widget_style_get(obj)); 131 elm_widget_element_update(obj, sd->guide_text, PART_NAME_GUIDE_TEXT);
128 elm_widget_theme_object_set
129 (obj, sd->end, "multibuttonentry", "closedbutton",
130 elm_widget_style_get(obj));
131 elm_widget_theme_object_set
132 (obj,sd->guide_text, "multibuttonentry", "guidetext",
133 elm_widget_style_get(obj));
134 132
135 elm_layout_sizing_eval(obj); 133 elm_layout_sizing_eval(obj);
136 134
@@ -764,8 +762,7 @@ _item_new(Efl_Ui_Multibuttonentry_Data *sd,
764 762
765 efl_access_type_set(VIEW(item), EFL_ACCESS_TYPE_DISABLED); 763 efl_access_type_set(VIEW(item), EFL_ACCESS_TYPE_DISABLED);
766 764
767 if (!elm_layout_theme_set 765 if (!elm_widget_element_update(obj, VIEW(item), PART_NAME_BUTTON))
768 (VIEW(item), "multibuttonentry", "btn", elm_widget_style_get(obj)))
769 CRI("Failed to set layout!"); 766 CRI("Failed to set layout!");
770 767
771 elm_object_part_text_set(VIEW(item), "elm.btn.text", str); 768 elm_object_part_text_set(VIEW(item), "elm.btn.text", str);
@@ -1246,8 +1243,7 @@ _guide_text_set(Evas_Object *obj,
1246 1243
1247 if (sd->guide_text) 1244 if (sd->guide_text)
1248 { 1245 {
1249 elm_widget_theme_object_set(obj, sd->guide_text, "multibuttonentry", 1246 elm_widget_element_update(obj, sd->guide_text, PART_NAME_GUIDE_TEXT);
1250 "guidetext", elm_widget_style_get(obj));
1251 evas_object_size_hint_weight_set 1247 evas_object_size_hint_weight_set
1252 (sd->guide_text, 0.0, EVAS_HINT_EXPAND); 1248 (sd->guide_text, 0.0, EVAS_HINT_EXPAND);
1253 evas_object_size_hint_align_set 1249 evas_object_size_hint_align_set
@@ -1447,9 +1443,7 @@ _view_init(Evas_Object *obj, Efl_Ui_Multibuttonentry_Data *sd)
1447 1443
1448 sd->label = edje_object_add(evas_object_evas_get(obj)); 1444 sd->label = edje_object_add(evas_object_evas_get(obj));
1449 if (!sd->label) return; 1445 if (!sd->label) return;
1450 elm_widget_theme_object_set 1446 elm_widget_element_update(obj, sd->label, PART_NAME_LABEL);
1451 (obj, sd->label, "multibuttonentry", "label",
1452 elm_widget_style_get(obj));
1453 1447
1454 // ACCESS 1448 // ACCESS
1455 if (_elm_config->access_mode == ELM_ACCESS_MODE_ON) 1449 if (_elm_config->access_mode == ELM_ACCESS_MODE_ON)
@@ -1477,9 +1471,7 @@ _view_init(Evas_Object *obj, Efl_Ui_Multibuttonentry_Data *sd)
1477 1471
1478 sd->end = edje_object_add(evas_object_evas_get(obj)); 1472 sd->end = edje_object_add(evas_object_evas_get(obj));
1479 if (!sd->end) return; 1473 if (!sd->end) return;
1480 elm_widget_theme_object_set 1474 elm_widget_element_update(obj, sd->end, PART_NAME_CLOSED_BUTTON);
1481 (obj, sd->end, "multibuttonentry", "closedbutton",
1482 elm_widget_style_get(obj));
1483 1475
1484 edje_object_size_min_calc(sd->end, &button_min_width, &button_min_height); 1476 edje_object_size_min_calc(sd->end, &button_min_width, &button_min_height);
1485 elm_coords_finger_size_adjust(1, &button_min_width, 1, &button_min_height); 1477 elm_coords_finger_size_adjust(1, &button_min_width, 1, &button_min_height);
diff --git a/src/lib/elementary/efl_ui_progressbar.c b/src/lib/elementary/efl_ui_progressbar.c
index 697c727d6e..9764f12748 100644
--- a/src/lib/elementary/efl_ui_progressbar.c
+++ b/src/lib/elementary/efl_ui_progressbar.c
@@ -198,15 +198,77 @@ _efl_ui_progressbar_elm_widget_widget_sub_object_add(Eo *obj, Efl_Ui_Progressbar
198 return EINA_TRUE; 198 return EINA_TRUE;
199} 199}
200 200
201//TODO: efl_ui_slider also use this.
202static const char *
203_theme_group_modify_pos_get(const char *cur_group, const char *search, size_t len, Eina_Bool is_legacy)
204{
205 const char *pos = NULL;
206 const char *temp_str = NULL;
207
208 if (is_legacy)
209 return cur_group;
210
211 temp_str = cur_group + len - strlen(search);
212 if (temp_str >= cur_group)
213 {
214 if (!strcmp(temp_str, search))
215 pos = temp_str;
216 }
217
218 return pos;
219}
220
221static char *
222_efl_ui_progressbar_theme_group_get(Evas_Object *obj, Efl_Ui_Progressbar_Data *sd)
223{
224 const char *pos = NULL;
225 const char *cur_group = elm_widget_theme_element_get(obj);
226 Eina_Strbuf *new_group = eina_strbuf_new();
227 Eina_Bool is_legacy = elm_widget_is_legacy(obj);
228 size_t len = 0;
229
230 if (cur_group)
231 {
232 len = strlen(cur_group);
233 pos = _theme_group_modify_pos_get(cur_group, "horizontal", len, is_legacy);
234 if (!pos)
235 pos = _theme_group_modify_pos_get(cur_group, "vertical", len, is_legacy);
236
237
238 // TODO: change separator when it is decided.
239 // can skip when prev_group == cur_group
240 if (!pos)
241 {
242 eina_strbuf_append(new_group, cur_group);
243 eina_strbuf_append(new_group, "/");
244 }
245 else
246 {
247 eina_strbuf_append_length(new_group, cur_group, pos - cur_group);
248 }
249 }
250
251 if (_is_horizontal(sd->dir))
252 eina_strbuf_append(new_group, "horizontal");
253 else
254 eina_strbuf_append(new_group, "vertical");
255
256 return eina_strbuf_release(new_group);
257}
258
201EOLIAN static Efl_Ui_Theme_Apply 259EOLIAN static Efl_Ui_Theme_Apply
202_efl_ui_progressbar_elm_widget_theme_apply(Eo *obj, Efl_Ui_Progressbar_Data *sd) 260_efl_ui_progressbar_elm_widget_theme_apply(Eo *obj, Efl_Ui_Progressbar_Data *sd)
203{ 261{
204 Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED; 262 Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
205 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_FAILED); 263 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_FAILED);
264 char *group;
206 265
207 if (_is_horizontal(sd->dir)) 266 group = _efl_ui_progressbar_theme_group_get(obj, sd);
208 elm_widget_theme_element_set(obj, "horizontal"); 267 if (group)
209 else elm_widget_theme_element_set(obj, "vertical"); 268 {
269 elm_widget_theme_element_set(obj, group);
270 free(group);
271 }
210 272
211 int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); 273 int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
212 if (!int_ret) return EFL_UI_THEME_APPLY_FAILED; 274 if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
diff --git a/src/lib/elementary/efl_ui_slider.c b/src/lib/elementary/efl_ui_slider.c
index 9ec6cb2e2b..2a02116d5d 100644
--- a/src/lib/elementary/efl_ui_slider.c
+++ b/src/lib/elementary/efl_ui_slider.c
@@ -39,6 +39,8 @@ static const char SIG_CHANGED[] = "changed";
39static const char SIG_DELAY_CHANGED[] = "delay,changed"; 39static const char SIG_DELAY_CHANGED[] = "delay,changed";
40static const char SIG_DRAG_START[] = "slider,drag,start"; 40static const char SIG_DRAG_START[] = "slider,drag,start";
41static const char SIG_DRAG_STOP[] = "slider,drag,stop"; 41static const char SIG_DRAG_STOP[] = "slider,drag,stop";
42
43static const char PART_NAME_POPUP[] = "popup";
42static const Evas_Smart_Cb_Description _smart_callbacks[] = { 44static const Evas_Smart_Cb_Description _smart_callbacks[] = {
43 {SIG_CHANGED, ""}, 45 {SIG_CHANGED, ""},
44 {SIG_DELAY_CHANGED, ""}, 46 {SIG_DELAY_CHANGED, ""},
@@ -648,6 +650,32 @@ _track2_resize_cb(void *data,
648} 650}
649 651
650static void 652static void
653_popup_update(Evas_Object *obj, Efl_Ui_Slider_Data *sd, Evas_Object *popup)
654{
655 if (elm_widget_is_legacy(obj))
656 {
657 if (_is_horizontal(sd->dir))
658 efl_ui_widget_theme_object_set(obj, popup, "slider", "horizontal/popup", elm_widget_style_get(obj));
659 else
660 efl_ui_widget_theme_object_set(obj, popup, "slider", "vertical/popup", elm_widget_style_get(obj));
661 }
662 else
663 elm_widget_element_update(obj, popup, PART_NAME_POPUP);
664 edje_object_scale_set(popup, efl_gfx_scale_get(obj) *
665 elm_config_scale_get());
666
667 if (!_is_inverted(sd->dir))
668 edje_object_signal_emit(popup, "elm,state,inverted,off", "elm");
669 else
670 edje_object_signal_emit(popup, "elm,state,inverted,on", "elm");
671
672 if (sd->indicator_show)
673 edje_object_signal_emit(popup, "elm,state,val,show", "elm");
674 else
675 edje_object_signal_emit(popup, "elm,state,val,hide", "elm");
676}
677
678static void
651_popup_add(Efl_Ui_Slider_Data *sd, Eo *obj, Evas_Object **popup, 679_popup_add(Efl_Ui_Slider_Data *sd, Eo *obj, Evas_Object **popup,
652 Evas_Object **track, Eina_Bool is_range) 680 Evas_Object **track, Eina_Bool is_range)
653{ 681{
@@ -662,17 +690,13 @@ _popup_add(Efl_Ui_Slider_Data *sd, Eo *obj, Evas_Object **popup,
662 // XXX popup needs to adapt to theme etc. 690 // XXX popup needs to adapt to theme etc.
663 *popup = edje_object_add(evas_object_evas_get(obj)); 691 *popup = edje_object_add(evas_object_evas_get(obj));
664 evas_object_smart_member_add(*popup, obj); 692 evas_object_smart_member_add(*popup, obj);
665 if (_is_horizontal(sd->dir))
666 efl_ui_widget_theme_object_set(obj, *popup, "slider", "horizontal/popup", elm_widget_style_get(obj));
667 else
668 efl_ui_widget_theme_object_set(obj, *popup, "slider", "vertical/popup", elm_widget_style_get(obj));
669 edje_object_scale_set(*popup, efl_gfx_scale_get(obj) *
670 elm_config_scale_get());
671 edje_object_signal_callback_add(*popup, "popup,hide,done", "elm", // XXX: for compat 693 edje_object_signal_callback_add(*popup, "popup,hide,done", "elm", // XXX: for compat
672 _popup_hide_done, obj); 694 _popup_hide_done, obj);
673 edje_object_signal_callback_add(*popup, "elm,popup,hide,done", "elm", 695 edje_object_signal_callback_add(*popup, "elm,popup,hide,done", "elm",
674 _popup_hide_done, obj); 696 _popup_hide_done, obj);
675 697
698 _popup_update(obj, sd, *popup);
699
676 /* create a rectangle to track position+size of the dragable */ 700 /* create a rectangle to track position+size of the dragable */
677 *track = evas_object_rectangle_add(evas_object_evas_get(obj)); 701 *track = evas_object_rectangle_add(evas_object_evas_get(obj));
678 evas_object_color_set(*track, 0, 0, 0, 0); 702 evas_object_color_set(*track, 0, 0, 0, 0);
@@ -695,64 +719,82 @@ _popup_add(Efl_Ui_Slider_Data *sd, Eo *obj, Evas_Object **popup,
695 } 719 }
696} 720}
697 721
698EOLIAN static Efl_Ui_Theme_Apply 722static const char *
699_efl_ui_slider_elm_widget_theme_apply(Eo *obj, Efl_Ui_Slider_Data *sd) 723_theme_group_modify_pos_get(const char *cur_group, const char *search, size_t len, Eina_Bool is_legacy)
700{ 724{
701 Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED; 725 const char *pos = NULL;
702 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_FAILED); 726 const char *temp_str = NULL;
703 727
704 if (_is_horizontal(sd->dir)) 728 if (is_legacy)
729 return cur_group;
730
731 temp_str = cur_group + len - strlen(search);
732 if (temp_str >= cur_group)
705 { 733 {
706 if (!sd->intvl_enable) 734 if (!strcmp(temp_str, search))
707 elm_widget_theme_element_set(obj, "horizontal"); 735 pos = temp_str;
708 else
709 elm_widget_theme_element_set(obj, "range/horizontal");
710 if (sd->popup)
711 efl_ui_widget_theme_object_set(obj, sd->popup,
712 "slider", "horizontal/popup",
713 elm_widget_style_get(obj));
714 if (sd->popup2)
715 efl_ui_widget_theme_object_set(obj, sd->popup2,
716 "slider", "horizontal/popup",
717 elm_widget_style_get(obj));
718 } 736 }
719 else
720 {
721 if (!sd->intvl_enable)
722 elm_widget_theme_element_set(obj, "vertical");
723 else
724 elm_widget_theme_element_set(obj, "range/vertical");
725 737
726 if (sd->popup) 738 return pos;
727 efl_ui_widget_theme_object_set(obj, sd->popup, 739}
728 "slider", "vertical/popup",
729 elm_widget_style_get(obj));
730 if (sd->popup2)
731 efl_ui_widget_theme_object_set(obj, sd->popup2,
732 "slider", "vertical/popup",
733 elm_widget_style_get(obj));
734 }
735 740
736 int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); 741static char *
737 if (!int_ret) return EFL_UI_THEME_APPLY_FAILED; 742_efl_ui_slider_theme_group_get(Evas_Object *obj, Efl_Ui_Slider_Data *sd)
743{
744 const char *pos = NULL;
745 const char *cur_group = elm_widget_theme_element_get(obj);
746 Eina_Strbuf *new_group = eina_strbuf_new();
747 Eina_Bool is_legacy = elm_widget_is_legacy(obj);
748 size_t len = 0;
738 749
739 if (sd->popup) 750 if (cur_group)
740 { 751 {
741 edje_object_scale_set(sd->popup, efl_gfx_scale_get(obj) * 752 len = strlen(cur_group);
742 elm_config_scale_get()); 753 pos = _theme_group_modify_pos_get(cur_group, "horizontal", len, is_legacy);
743 if (sd->intvl_enable && sd->popup2) 754 if (!pos)
744 edje_object_scale_set(sd->popup2, efl_gfx_scale_get(obj) * 755 pos = _theme_group_modify_pos_get(cur_group, "vertical", len, is_legacy);
745 elm_config_scale_get()); 756
746 else if (sd->intvl_enable && !sd->popup2) 757
747 _popup_add(sd, obj, &sd->popup2, &sd->track2, EINA_TRUE); 758 // TODO: change separator when it is decided.
759 // can skip when prev_group == cur_group
760 if (!pos)
761 {
762 eina_strbuf_append(new_group, cur_group);
763 eina_strbuf_append(new_group, "/");
764 }
765 else
766 {
767 eina_strbuf_append_length(new_group, cur_group, pos - cur_group);
768 }
748 } 769 }
770
771 if (is_legacy && sd->intvl_enable)
772 eina_strbuf_append(new_group, "range/");
773 if (_is_horizontal(sd->dir))
774 eina_strbuf_append(new_group, "horizontal");
749 else 775 else
776 eina_strbuf_append(new_group, "vertical");
777
778 return eina_strbuf_release(new_group);
779}
780
781EOLIAN static Efl_Ui_Theme_Apply
782_efl_ui_slider_elm_widget_theme_apply(Eo *obj, Efl_Ui_Slider_Data *sd)
783{
784 Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
785 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EFL_UI_THEME_APPLY_FAILED);
786 char *group;
787
788 group = _efl_ui_slider_theme_group_get(obj, sd);
789 if (group)
750 { 790 {
751 _popup_add(sd, obj, &sd->popup, &sd->track, EINA_FALSE); 791 elm_widget_theme_element_set(obj, group);
752 if (sd->intvl_enable && !sd->popup2) 792 free(group);
753 _popup_add(sd, obj, &sd->popup2, &sd->track2, EINA_TRUE);
754 } 793 }
755 794
795 int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
796 if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
797
756 if (_is_horizontal(sd->dir)) 798 if (_is_horizontal(sd->dir))
757 evas_object_size_hint_min_set 799 evas_object_size_hint_min_set
758 (sd->spacer, (double)sd->size * efl_gfx_scale_get(obj) * 800 (sd->spacer, (double)sd->size * efl_gfx_scale_get(obj) *
@@ -768,27 +810,27 @@ _efl_ui_slider_elm_widget_theme_apply(Eo *obj, Efl_Ui_Slider_Data *sd)
768 elm_layout_signal_emit(obj, "elm,slider,range,disable", "elm"); 810 elm_layout_signal_emit(obj, "elm,slider,range,disable", "elm");
769 811
770 if (_is_inverted(sd->dir)) 812 if (_is_inverted(sd->dir))
771 { 813 elm_layout_signal_emit(obj, "elm,state,inverted,on", "elm");
772 elm_layout_signal_emit(obj, "elm,state,inverted,on", "elm");
773 if (sd->popup)
774 edje_object_signal_emit(sd->popup, "elm,state,inverted,on", "elm");
775 if (sd->popup2)
776 edje_object_signal_emit(sd->popup2, "elm,state,inverted,on", "elm");
777 }
778 else 814 else
779 { 815 elm_layout_signal_emit(obj, "elm,state,inverted,off", "elm");
780 elm_layout_signal_emit(obj, "elm,state,inverted,off", "elm");
781 if (sd->popup)
782 edje_object_signal_emit(sd->popup, "elm,state,inverted,off", "elm");
783 }
784 816
785 if (sd->indicator_show) 817 if (sd->indicator_show)
818 elm_layout_signal_emit(obj, "elm,state,val,show", "elm");
819 else
820 elm_layout_signal_emit(obj, "elm,state,val,hide", "elm");
821
822
823 if (!sd->popup)
824 _popup_add(sd, obj, &sd->popup, &sd->track, sd->intvl_enable);
825 else
826 _popup_update(obj, sd, sd->popup);
827
828 if (sd->intvl_enable)
786 { 829 {
787 elm_layout_signal_emit(obj, "elm,state,val,show", "elm"); 830 if (!sd->popup2)
788 if (sd->popup) 831 _popup_add(sd, obj, &sd->popup2, &sd->track2, EINA_TRUE);
789 edje_object_signal_emit(sd->popup, "elm,state,val,show", "elm"); 832 else
790 if (sd->popup2) 833 _popup_update(obj, sd, sd->popup2);
791 edje_object_signal_emit(sd->popup2, "elm,state,val,show", "elm");
792 } 834 }
793 835
794 _min_max_set(obj); 836 _min_max_set(obj);
diff --git a/src/lib/elementary/efl_ui_slider_interval.c b/src/lib/elementary/efl_ui_slider_interval.c
index 6ce977eccb..17b86c2409 100644
--- a/src/lib/elementary/efl_ui_slider_interval.c
+++ b/src/lib/elementary/efl_ui_slider_interval.c
@@ -107,6 +107,7 @@ _efl_ui_slider_interval_efl_object_finalize(Eo *obj, void *sd EINA_UNUSED)
107 107
108 pd->intvl_enable = EINA_TRUE; 108 pd->intvl_enable = EINA_TRUE;
109 109
110 elm_widget_theme_klass_set(obj, "slider_interval");
110 efl_ui_widget_theme_apply(obj); 111 efl_ui_widget_theme_apply(obj);
111 112
112 elm_layout_signal_emit(obj, "elm,slider,range,enable", "elm"); 113 elm_layout_signal_emit(obj, "elm,slider,range,enable", "elm");
diff --git a/src/lib/elementary/efl_ui_text.c b/src/lib/elementary/efl_ui_text.c
index 44f546d31e..ce02cd139a 100644
--- a/src/lib/elementary/efl_ui_text.c
+++ b/src/lib/elementary/efl_ui_text.c
@@ -256,7 +256,15 @@ struct _Mod_Api
256 void (*obj_longpress)(Evas_Object *obj); 256 void (*obj_longpress)(Evas_Object *obj);
257}; 257};
258 258
259static void _create_selection_handlers(Evas_Object *obj, Efl_Ui_Text_Data *sd, const char *file); 259static const char PART_NAME_SCROLLER[] = "scroller";
260static const char PART_NAME_HANDLER_START[] = "handler/start";
261static const char PART_NAME_HANDLER_END[] = "handler/end";
262static const char PART_NAME_MAGNIFIER[] = "magnifier";
263static const char PART_NAME_CURSOR[] = "cursor";
264static const char PART_NAME_SELECTION[] = "selection";
265static const char PART_NAME_ANCHOR[] = "anchor";
266
267static void _create_selection_handlers(Evas_Object *obj, Efl_Ui_Text_Data *sd);
260static void _magnifier_move(void *data); 268static void _magnifier_move(void *data);
261static void _update_decorations(Eo *obj); 269static void _update_decorations(Eo *obj);
262static void _create_text_cursors(Eo *obj, Efl_Ui_Text_Data *sd); 270static void _create_text_cursors(Eo *obj, Efl_Ui_Text_Data *sd);
@@ -270,7 +278,7 @@ static void _efl_ui_text_anchor_hover_parent_set(Eo *obj, Efl_Ui_Text_Data *sd,
270static const char* _efl_ui_text_selection_get(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd); 278static const char* _efl_ui_text_selection_get(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd);
271static void _edje_signal_emit(Efl_Ui_Text_Data *obj, const char *sig, const char *src); 279static void _edje_signal_emit(Efl_Ui_Text_Data *obj, const char *sig, const char *src);
272static void _decoration_defer_all(Eo *obj); 280static void _decoration_defer_all(Eo *obj);
273static inline Eo * _decoration_create(Efl_Ui_Text_Data *sd, const char *file, const char *source, Eina_Bool above); 281static inline Eo * _decoration_create(Eo *obj, Efl_Ui_Text_Data *sd, const char *source, Eina_Bool above);
274static void _decoration_defer(Eo *obj); 282static void _decoration_defer(Eo *obj);
275static void _anchors_clear_all(Evas_Object *o EINA_UNUSED, Efl_Ui_Text_Data *sd); 283static void _anchors_clear_all(Evas_Object *o EINA_UNUSED, Efl_Ui_Text_Data *sd);
276static void _unused_item_objs_free(Efl_Ui_Text_Data *sd); 284static void _unused_item_objs_free(Efl_Ui_Text_Data *sd);
@@ -573,11 +581,7 @@ _update_selection_handler(Eo *obj)
573 efl_ui_text_interactive_selection_cursors_get(obj, &sel_start, &sel_end); 581 efl_ui_text_interactive_selection_cursors_get(obj, &sel_start, &sel_end);
574 582
575 if (!sd->start_handler) 583 if (!sd->start_handler)
576 { 584 _create_selection_handlers(obj, sd);
577 const char *file;
578 efl_file_get(sd->entry_edje, &file, NULL);
579 _create_selection_handlers(obj, sd, file);
580 }
581 585
582 rect = _viewport_region_get(obj); 586 rect = _viewport_region_get(obj);
583 587
@@ -896,7 +900,6 @@ EOLIAN static Efl_Ui_Theme_Apply
896_efl_ui_text_elm_widget_theme_apply(Eo *obj, Efl_Ui_Text_Data *sd) 900_efl_ui_text_elm_widget_theme_apply(Eo *obj, Efl_Ui_Text_Data *sd)
897{ 901{
898 const char *str; 902 const char *str;
899 const char *style = elm_widget_style_get(obj);
900 Efl_Ui_Theme_Apply theme_apply; 903 Efl_Ui_Theme_Apply theme_apply;
901 904
902 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE); 905 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
@@ -917,8 +920,8 @@ _efl_ui_text_elm_widget_theme_apply(Eo *obj, Efl_Ui_Text_Data *sd)
917 920
918 _mirrored_set(obj, efl_ui_mirrored_get(obj)); 921 _mirrored_set(obj, efl_ui_mirrored_get(obj));
919 922
920 elm_widget_theme_object_set 923 elm_widget_element_update(obj, sd->entry_edje,
921 (obj, sd->entry_edje, "text", _efl_ui_text_theme_group_get(obj), style); 924 _efl_ui_text_theme_group_get(obj));
922 925
923 if (elm_widget_disabled_get(obj)) 926 if (elm_widget_disabled_get(obj))
924 edje_object_signal_emit(sd->entry_edje, "elm,state,disabled", "elm"); 927 edje_object_signal_emit(sd->entry_edje, "elm,state,disabled", "elm");
@@ -964,16 +967,10 @@ _efl_ui_text_elm_widget_theme_apply(Eo *obj, Efl_Ui_Text_Data *sd)
964 967
965 if (sd->scroll) 968 if (sd->scroll)
966 { 969 {
967 Efl_Ui_Theme_Apply ok = EFL_UI_THEME_APPLY_FAILED;
968
969 elm_interface_scrollable_mirrored_set(obj, efl_ui_mirrored_get(obj)); 970 elm_interface_scrollable_mirrored_set(obj, efl_ui_mirrored_get(obj));
970 971
971 if (sd->single_line) 972 if (sd->single_line)
972 ok = elm_widget_theme_object_set 973 elm_widget_element_update(obj, sd->scr_edje, PART_NAME_SCROLLER);
973 (obj, sd->scr_edje, "scroller", "entry_single", style);
974 if (!ok)
975 elm_widget_theme_object_set
976 (obj, sd->scr_edje, "scroller", "entry", style);
977 974
978 _efl_ui_text_background_switch(sd->entry_edje, sd->scr_edje); 975 _efl_ui_text_background_switch(sd->entry_edje, sd->scr_edje);
979 976
@@ -993,10 +990,8 @@ _efl_ui_text_elm_widget_theme_apply(Eo *obj, Efl_Ui_Text_Data *sd)
993 990
994 if (sd->start_handler) 991 if (sd->start_handler)
995 { 992 {
996 elm_widget_theme_object_set(obj, sd->start_handler, 993 elm_widget_element_update(obj, sd->start_handler, PART_NAME_HANDLER_START);
997 "text", "handler/start", style); 994 elm_widget_element_update(obj, sd->end_handler, PART_NAME_HANDLER_END);
998 elm_widget_theme_object_set(obj, sd->end_handler,
999 "text", "handler/end", style);
1000 } 995 }
1001 996
1002 sd->changed = EINA_TRUE; 997 sd->changed = EINA_TRUE;
@@ -1740,7 +1735,7 @@ _magnifier_create(void *data)
1740 1735
1741 //Bg 1736 //Bg
1742 sd->mgf_bg = edje_object_add(e); 1737 sd->mgf_bg = edje_object_add(e);
1743 elm_widget_theme_object_set(data, sd->mgf_bg, "text", "magnifier", "default"); 1738 elm_widget_element_update(data, sd->mgf_bg, PART_NAME_MAGNIFIER);
1744 evas_object_show(sd->mgf_bg); 1739 evas_object_show(sd->mgf_bg);
1745 1740
1746 //Proxy 1741 //Proxy
@@ -3014,7 +3009,12 @@ _efl_ui_text_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Text_Data *priv)
3014 _dnd_pos_cb, NULL, 3009 _dnd_pos_cb, NULL,
3015 _dnd_drop_cb, NULL); 3010 _dnd_drop_cb, NULL);
3016 3011
3017 if (!elm_layout_theme_set(obj, "text", "base", elm_widget_style_get(obj))) 3012 if (!elm_widget_theme_klass_get(obj))
3013 elm_widget_theme_klass_set(obj, "text");
3014 if (!efl_ui_widget_theme_object_set(obj, wd->resize_obj,
3015 elm_widget_theme_klass_get(obj),
3016 _efl_ui_text_theme_group_get(obj),
3017 elm_widget_theme_style_get(obj)))
3018 CRI("Failed to set layout!"); 3018 CRI("Failed to set layout!");
3019 3019
3020 edje_object_part_swallow(priv->entry_edje, "elm.text", text_obj); 3020 edje_object_part_swallow(priv->entry_edje, "elm.text", text_obj);
@@ -3171,12 +3171,11 @@ _efl_ui_text_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Text_Data *priv)
3171} 3171}
3172 3172
3173static void 3173static void
3174_create_selection_handlers(Evas_Object *obj, Efl_Ui_Text_Data *sd, 3174_create_selection_handlers(Evas_Object *obj, Efl_Ui_Text_Data *sd)
3175 const char *file)
3176{ 3175{
3177 Evas_Object *handle; 3176 Evas_Object *handle;
3178 3177
3179 handle = _decoration_create(sd, file, "text/handler/start", EINA_TRUE); 3178 handle = _decoration_create(obj, sd, PART_NAME_HANDLER_START, EINA_TRUE);
3180 evas_object_pass_events_set(handle, EINA_FALSE); 3179 evas_object_pass_events_set(handle, EINA_FALSE);
3181 sd->start_handler = handle; 3180 sd->start_handler = handle;
3182 evas_object_event_callback_add(handle, EVAS_CALLBACK_MOUSE_DOWN, 3181 evas_object_event_callback_add(handle, EVAS_CALLBACK_MOUSE_DOWN,
@@ -3187,7 +3186,7 @@ _create_selection_handlers(Evas_Object *obj, Efl_Ui_Text_Data *sd,
3187 _start_handler_mouse_up_cb, obj); 3186 _start_handler_mouse_up_cb, obj);
3188 evas_object_show(handle); 3187 evas_object_show(handle);
3189 3188
3190 handle = _decoration_create(sd, file, "text/handler/end", EINA_TRUE); 3189 handle = _decoration_create(obj, sd, PART_NAME_HANDLER_END, EINA_TRUE);
3191 evas_object_pass_events_set(handle, EINA_FALSE); 3190 evas_object_pass_events_set(handle, EINA_FALSE);
3192 sd->end_handler = handle; 3191 sd->end_handler = handle;
3193 evas_object_event_callback_add(handle, EVAS_CALLBACK_MOUSE_DOWN, 3192 evas_object_event_callback_add(handle, EVAS_CALLBACK_MOUSE_DOWN,
@@ -3740,9 +3739,7 @@ _efl_ui_text_scrollable_set(Eo *obj, Efl_Ui_Text_Data *sd, Eina_Bool scroll)
3740 { 3739 {
3741 sd->scr_edje = edje_object_add(evas_object_evas_get(obj)); 3740 sd->scr_edje = edje_object_add(evas_object_evas_get(obj));
3742 3741
3743 elm_widget_theme_object_set 3742 elm_widget_element_update(obj, sd->scr_edje, PART_NAME_SCROLLER);
3744 (obj, sd->scr_edje, "scroller", "entry",
3745 elm_widget_style_get(obj));
3746 3743
3747 evas_object_size_hint_weight_set 3744 evas_object_size_hint_weight_set
3748 (sd->scr_edje, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 3745 (sd->scr_edje, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
@@ -4626,12 +4623,12 @@ _edje_signal_emit(Efl_Ui_Text_Data *sd, const char *sig, const char *src)
4626} 4623}
4627 4624
4628static inline Eo * 4625static inline Eo *
4629_decoration_create(Efl_Ui_Text_Data *sd, const char *file, 4626_decoration_create(Eo *obj, Efl_Ui_Text_Data *sd,
4630 const char *source, Eina_Bool above) 4627 const char *group_name, Eina_Bool above)
4631{ 4628{
4632 Eo *ret = efl_add(EFL_CANVAS_LAYOUT_CLASS, sd->entry_edje); 4629 Eo *ret = efl_add(EFL_CANVAS_LAYOUT_CLASS, sd->entry_edje);
4633 Eo *text_obj = edje_object_part_swallow_get(sd->entry_edje, "elm.text"); 4630 Eo *text_obj = edje_object_part_swallow_get(sd->entry_edje, "elm.text");
4634 edje_object_file_set(ret, file, source); 4631 elm_widget_element_update(obj, ret, group_name);
4635 evas_object_smart_member_add(ret, sd->entry_edje); 4632 evas_object_smart_member_add(ret, sd->entry_edje);
4636 if (above) 4633 if (above)
4637 { 4634 {
@@ -4653,10 +4650,8 @@ _decoration_create(Efl_Ui_Text_Data *sd, const char *file,
4653static void 4650static void
4654_create_text_cursors(Eo *obj, Efl_Ui_Text_Data *sd) 4651_create_text_cursors(Eo *obj, Efl_Ui_Text_Data *sd)
4655{ 4652{
4656 const char *file; 4653 sd->cursor = _decoration_create(obj, sd, PART_NAME_CURSOR, EINA_TRUE);
4657 efl_file_get(sd->entry_edje, &file, NULL); 4654 sd->cursor_bidi = _decoration_create(obj, sd, PART_NAME_CURSOR, EINA_TRUE);
4658 sd->cursor = _decoration_create(sd, file, "elm/entry/cursor/default", EINA_TRUE);
4659 sd->cursor_bidi = _decoration_create(sd, file, "elm/entry/cursor/default", EINA_TRUE);
4660 4655
4661 if (!efl_ui_text_interactive_editable_get(obj)) 4656 if (!efl_ui_text_interactive_editable_get(obj))
4662 { 4657 {
@@ -4745,7 +4740,6 @@ _update_text_selection(Eo *obj, Eo *text_obj)
4745 Eina_Iterator *range; 4740 Eina_Iterator *range;
4746 Efl_Ui_Text_Rectangle *rect; 4741 Efl_Ui_Text_Rectangle *rect;
4747 Eina_Rectangle *r; 4742 Eina_Rectangle *r;
4748 const char *file;
4749 4743
4750 EFL_UI_TEXT_DATA_GET(obj, sd); 4744 EFL_UI_TEXT_DATA_GET(obj, sd);
4751 4745
@@ -4754,8 +4748,6 @@ _update_text_selection(Eo *obj, Eo *text_obj)
4754 4748
4755 _decoration_calc_offset(sd, &x, &y); 4749 _decoration_calc_offset(sd, &x, &y);
4756 4750
4757 efl_file_get(sd->entry_edje, &file, NULL);
4758
4759 efl_ui_text_interactive_selection_cursors_get(text_obj, &sel_start, &sel_end); 4751 efl_ui_text_interactive_selection_cursors_get(text_obj, &sel_start, &sel_end);
4760 4752
4761 range = efl_canvas_text_range_simple_geometry_get(text_obj, 4753 range = efl_canvas_text_range_simple_geometry_get(text_obj,
@@ -4770,7 +4762,7 @@ _update_text_selection(Eo *obj, Eo *text_obj)
4770 rect = calloc(1, sizeof(Efl_Ui_Text_Rectangle)); 4762 rect = calloc(1, sizeof(Efl_Ui_Text_Rectangle));
4771 sd->sel = eina_list_append(sd->sel, rect); 4763 sd->sel = eina_list_append(sd->sel, rect);
4772 4764
4773 rect->obj_bg = _decoration_create(sd, file, "elm/entry/selection/default", EINA_FALSE); 4765 rect->obj_bg = _decoration_create(obj, sd, PART_NAME_SELECTION, EINA_FALSE);
4774 evas_object_show(rect->obj_bg); 4766 evas_object_show(rect->obj_bg);
4775 } 4767 }
4776 else 4768 else
@@ -5084,13 +5076,10 @@ _anchors_update(Eo *o, Efl_Ui_Text_Data *sd)
5084 Evas_Object *smart, *clip; 5076 Evas_Object *smart, *clip;
5085 Efl_Ui_Text_Rectangle *rect; 5077 Efl_Ui_Text_Rectangle *rect;
5086 Anchor *an; 5078 Anchor *an;
5087 const char *file;
5088 Eo *sw; 5079 Eo *sw;
5089 5080
5090 sw = edje_object_part_swallow_get(sd->entry_edje, "elm.text"); 5081 sw = edje_object_part_swallow_get(sd->entry_edje, "elm.text");
5091 5082
5092 efl_file_get(sd->entry_edje, &file, NULL);
5093
5094 if (!sd->deferred_decoration_anchor) return; 5083 if (!sd->deferred_decoration_anchor) return;
5095 sd->deferred_decoration_anchor = EINA_FALSE; 5084 sd->deferred_decoration_anchor = EINA_FALSE;
5096 5085
@@ -5198,7 +5187,7 @@ _anchors_update(Eo *o, Efl_Ui_Text_Data *sd)
5198 rect = calloc(1, sizeof(Efl_Ui_Text_Rectangle)); 5187 rect = calloc(1, sizeof(Efl_Ui_Text_Rectangle));
5199 an->sel = eina_list_append(an->sel, rect); 5188 an->sel = eina_list_append(an->sel, rect);
5200 5189
5201 ob = _decoration_create(sd, file, "elm/entry/anchor/default", EINA_TRUE); 5190 ob = _decoration_create(o, sd, PART_NAME_ANCHOR, EINA_TRUE);
5202 rect->obj_fg = ob; 5191 rect->obj_fg = ob;
5203 5192
5204 /* Create hit rectangle to catch events */ 5193 /* Create hit rectangle to catch events */
diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index 457d65db01..0c9ce584df 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -4570,6 +4570,7 @@ _efl_ui_win_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Win_Data *_pd EINA_UNUSED
4570{ 4570{
4571 efl_canvas_group_add(efl_super(obj, MY_CLASS)); 4571 efl_canvas_group_add(efl_super(obj, MY_CLASS));
4572 4572
4573 elm_widget_theme_klass_set(obj, "win");
4573 elm_widget_can_focus_set(obj, EINA_TRUE); 4574 elm_widget_can_focus_set(obj, EINA_TRUE);
4574 4575
4575 elm_widget_highlight_ignore_set(obj, EINA_TRUE); 4576 elm_widget_highlight_ignore_set(obj, EINA_TRUE);