summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaehyun Cho <jae_hyun.cho@samsung.com>2018-04-20 11:48:19 +0900
committerJaehyun Cho <jae_hyun.cho@samsung.com>2018-04-20 14:07:35 +0900
commit0bebd097b57f09fdc090533f4e946697ecbe8646 (patch)
treef941961a6876cd9314c502e473ab639f7728dd43
parentfd85423ae3eb2b9925daf84f164d1bf903ebfed7 (diff)
elc_multibuttonentry: Fix to make multibuttonentry to be legacy only
To make multibuttonentry to be legacy only, inappropriate efl ui interface usages are removed in multibuttonentry.
Diffstat (limited to '')
-rw-r--r--data/elementary/themes/Makefile.am1
-rw-r--r--data/elementary/themes/default.edc1
-rw-r--r--data/elementary/themes/edc/efl/multibuttonentry.edc341
-rw-r--r--src/lib/elementary/Efl_Ui.h7
-rw-r--r--src/lib/elementary/efl_ui_multibuttonentry_legacy.eo9
-rw-r--r--src/lib/elementary/elc_multibuttonentry.c39
-rw-r--r--src/lib/elementary/elm_multibuttonentry.eo2
7 files changed, 28 insertions, 372 deletions
diff --git a/data/elementary/themes/Makefile.am b/data/elementary/themes/Makefile.am
index 565e050..fc285c6 100644
--- a/data/elementary/themes/Makefile.am
+++ b/data/elementary/themes/Makefile.am
@@ -1024,7 +1024,6 @@ elementary/themes/edc/efl/focus.edc \
1024elementary/themes/edc/efl/frame.edc \ 1024elementary/themes/edc/efl/frame.edc \
1025elementary/themes/edc/efl/navigation_bar.edc \ 1025elementary/themes/edc/efl/navigation_bar.edc \
1026elementary/themes/edc/efl/navigation_layout.edc \ 1026elementary/themes/edc/efl/navigation_layout.edc \
1027elementary/themes/edc/efl/multibuttonentry.edc \
1028elementary/themes/edc/efl/nstate.edc \ 1027elementary/themes/edc/efl/nstate.edc \
1029elementary/themes/edc/efl/panes.edc \ 1028elementary/themes/edc/efl/panes.edc \
1030elementary/themes/edc/efl/photocam.edc \ 1029elementary/themes/edc/efl/photocam.edc \
diff --git a/data/elementary/themes/default.edc b/data/elementary/themes/default.edc
index a677be4..d7c823e 100644
--- a/data/elementary/themes/default.edc
+++ b/data/elementary/themes/default.edc
@@ -184,7 +184,6 @@ collections {
184#include "edc/efl/popup.edc" 184#include "edc/efl/popup.edc"
185#include "edc/efl/video.edc" 185#include "edc/efl/video.edc"
186#include "edc/efl/focus.edc" 186#include "edc/efl/focus.edc"
187#include "edc/efl/multibuttonentry.edc"
188#include "edc/efl/tooltip.edc" 187#include "edc/efl/tooltip.edc"
189#include "edc/efl/photocam.edc" 188#include "edc/efl/photocam.edc"
190#include "edc/efl/progress.edc" 189#include "edc/efl/progress.edc"
diff --git a/data/elementary/themes/edc/efl/multibuttonentry.edc b/data/elementary/themes/edc/efl/multibuttonentry.edc
deleted file mode 100644
index 5996a6c..0000000
--- a/data/elementary/themes/edc/efl/multibuttonentry.edc
+++ /dev/null
@@ -1,341 +0,0 @@
1group { "efl/multibuttonentry";
2 data.item: "horizontal_pad" 0;
3 data.item: "vertical_pad" 0;
4 data.item: "closed_height" 0;
5 parts {
6 rect { "bg";
7 scale;
8 desc { "default";
9 color_class: "multibuttonentry_bg";
10 }
11 }
12 swallow { "elm.swallow.background";
13 scale;
14 desc { "default";
15 rel.to: "bg";
16 }
17 }
18 swallow { "box.swallow";
19 desc { "default";
20 rel.to: "bg";
21 }
22 }
23 }
24}
25
26group { "efl/multibuttonentry/label";
27 parts {
28 text { "elm.text";
29 nomouse;
30 effect: GLOW;
31 scale;
32 desc { "default";
33 color: FN_COL_HIGHLIGHT;
34 color_class: "multibuttonentry_label";
35 text { font: FNBD; size: 10;
36 min: 1 1;
37 ellipsis: -1;
38 align: 0.5 0.5;
39 text_class: "multibuttonentry_label";
40 }
41 rel1.offset: 2 2;
42 rel2.offset: -5 -5;
43 }
44 }
45 }
46}
47
48group { "efl/multibuttonentry/guidetext";
49 parts {
50 text { "elm.text";
51 scale;
52 effect: SHADOW BOTTOM;
53 desc { "default";
54 rel1.offset: 2 2;
55 rel2.offset: -4 -4;
56 color: FN_COL_DISABLE;
57 text { font: FNBD; size: 10;
58 min: 0 1;
59 align: 0.0 0.5;
60 }
61 }
62 }
63 }
64}
65
66group { "efl/multibuttonentry/btn";
67 images.image: "button_normal.png" COMP;
68 images.image: "button_clicked.png" COMP;
69 images.image: "sym_close_dark_normal.png" COMP;
70 images.image: "sym_close_dark_selected.png" COMP;
71 images.image: "win_glow.png" COMP;
72 styles {
73 style { name: "efl_multibuttonentry_textblock_style";
74 base: "font="FN" align=0.5 font_size=10 color=#ffffffff style=shadow,bottom shadow_color=#00000080 text_class=multibuttonentry_item ellipsis=1.0";
75 tag: "br" "\n";
76 tag: "ps" "ps";
77 tag: "hilight" "+ font="FNBD;
78 tag: "b" "+ font="FNBD;
79 tag: "tab" "\t";
80 }
81 }
82
83 script {
84 public disabled = 0;
85 }
86
87 parts {
88 rect { "bg";
89 desc { "default";
90 color_class: "multibuttonentry_item_bg";
91 }
92 desc { "pressed";
93 color_class: "multibuttonentry_item_bg_selected";
94 }
95 }
96 image { "base";
97 desc { "default";
98 image.normal: "button_normal.png";
99 image.border: 4 4 3 5;
100 image.middle: SOLID;
101 rel1.offset: -1 0;
102 rel2.offset: 0 1;
103 fill.smooth: 0;
104 }
105 desc { "pressed";
106 inherit: "default";
107 image.normal: "button_clicked.png";
108 image.border: 5 5 4 6;
109 }
110 }
111 image { "glow";
112 nomouse;
113 desc { "default";
114 image.normal: "win_glow.png";
115 image.border: 9 9 9 9;
116 image.middle: 0;
117 rel1.offset: -2 -3;
118 rel1.to: "base";
119 rel2.offset: 1 0;
120 rel2.to: "base";
121 fill.smooth: 0;
122 color: 255 255 255 0;
123 hid;
124 }
125 desc { "focused";
126 inherit: "default";
127 color: 255 255 255 255;
128 vis;
129 }
130 desc { "unfocused";
131 inherit: "default";
132 }
133 }
134 image { "close";
135 nomouse;
136 desc { "default";
137 image.normal: "sym_close_dark_normal.png";
138 rel1.to: "del";
139 rel2.to: "del";
140 min: 15 15;
141 max: 15 15;
142 fixed: 1 1;
143 }
144 desc { "clicked";
145 inherit: "default";
146 image.normal: "sym_close_dark_selected.png";
147 }
148 }
149 rect { "del";
150 scale;
151 desc { "default";
152 fixed: 1 0;
153 min: 4 4;
154 align: 1.0 0.5;
155 aspect: 1.0 1.0; aspect_preference: VERTICAL;
156 rel1.relative: 1.0 0.0;
157 rel1.to: "base";
158 rel1.offset: -6 5;
159 rel2.offset: -6 -7;
160 rel2.to: "base";
161 color: 0 0 0 0;
162 }
163 }
164 textblock { "elm.btn.text";
165 nomouse;
166 scale;
167 desc { "default";
168 color_class: "multibuttonentry_item_text";
169 text { style: "efl_multibuttonentry_textblock_style";
170 min: 1 1;
171 ellipsis: -1;
172 text_class: "multibuttonentry_item_text";
173 }
174 hid;
175 rel1.offset: 5 5;
176 rel1.to: "base";
177 rel2.to_x: "del";
178 rel2.to_y: "base";
179 rel2.relative: 0.0 1.0;
180 rel2.offset: -3 -7;
181 }
182 }
183 textblock { "text";
184 nomouse;
185 scale;
186 desc { "default";
187 color_class: "multibuttonentry_item_text";
188 text { style: "efl_multibuttonentry_textblock_style";
189 text_source: "elm.btn.text";
190 min: 0 1;
191 align: 0.0 0.5;
192 text_class: "multibuttonentry_item_text";
193 }
194 align: 0.0 0.5;
195 rel1.offset: 5 5;
196 rel1.to: "base";
197 rel2.to_x: "del";
198 rel2.to_y: "base";
199 rel2.relative: 0.0 1.0;
200 rel2.offset: -3 -7;
201 }
202 desc { "pressed";
203 inherit: "default";
204 color_class: "multibuttonentry_item_text_pressed";
205 text {
206 text_class: "multibuttonentry_item_text_pressed";
207 }
208 }
209 desc { "disabled";
210 inherit: "default";
211 color_class: "multibuttonentry_item_text_disabled";
212 text {
213 text_class: "multibuttonentry_item_text_disabled";
214 }
215 }
216 }
217 }
218 programs {
219 program {
220 signal: "mouse,clicked,1";
221 source: "base";
222 script {
223 if (get_int(disabled) == 0) {
224 emit("clicked", "");
225 }
226 }
227 }
228 program {
229 signal: "elm,state,default";
230 source: "elm";
231 action: STATE_SET "default";
232 target: "glow";
233 }
234 program {
235 signal: "elm,state,focused";
236 source: "elm";
237 action: STATE_SET "focused";
238 target: "glow";
239 }
240 program {
241 signal: "elm,state,enabled";
242 source: "elm";
243 script {
244 set_state(PART:"text", "default", 0.0);
245 set_int(disabled , 0);
246 }
247 }
248 program {
249 signal: "elm,state,disabled";
250 source: "elm";
251 script {
252 new st[31];
253 new Float: vl;
254 get_state(PART:"glow", st, 30, vl);
255 if (!strcmp(st, "focused"))
256 set_state(PART:"glow", "default", 0.0);
257 set_state(PART:"text", "disabled", 0.0);
258 set_int(disabled , 1);
259 }
260 }
261 program {
262 signal: "elm,state,unfocused";
263 source: "elm";
264 action: STATE_SET "unfocused";
265 target: "glow";
266 }
267 program {
268 signal: "mouse,down,1";
269 source: "base";
270 script {
271 if (get_int(disabled) == 0) {
272 set_state(PART:"base", "pressed", 0.0);
273 set_state(PART:"bg", "pressed", 0.0);
274 set_state(PART:"text", "pressed", 0.0);
275 }
276 }
277 }
278 program {
279 signal: "mouse,up,1";
280 source: "base";
281 script {
282 if (get_int(disabled) == 0) {
283 set_state(PART:"base", "default", 0.0);
284 set_state(PART:"bg", "default", 0.0);
285 set_state(PART:"text", "default", 0.0);
286 }
287 }
288 }
289 program {
290 signal: "mouse,clicked,1";
291 source: "del";
292 action: SIGNAL_EMIT "elm,deleted" "elm";
293 }
294 program {
295 signal: "mouse,down,1";
296 source: "del";
297 action: STATE_SET "clicked";
298 target: "close";
299 }
300 program {
301 signal: "mouse,up,1";
302 source: "del";
303 action: STATE_SET "default";
304 target: "close";
305 }
306 }
307}
308
309group { "efl/multibuttonentry/closedbutton";
310 styles {
311 style { name: "textblock_style_efl_multibuttonentry_default";
312 base: "font="FNBD" font_size=10 text_class=multibuttonentry_closed style=glow color=#3399ffff glow_color=#3399ff18 align=center glow2_color=#3399ff12 wrap=char";
313 tag: "br" "\n";
314 tag: "ps" "ps";
315 tag: "hilight" "+ font="FNBD;
316 tag: "b" "+ font="FNBD;
317 tag: "tab" "\t";
318 }
319 }
320 parts {
321 rect { "bg";
322 desc { "default";
323 color: 0 0 0 0;
324 }
325 }
326 textblock { "elm.text";
327 nomouse;
328 scale;
329 desc { "default";
330 rel1.offset: 2 2;
331 rel1.to: "bg";
332 rel2.offset: -3 -3;
333 rel2.to: "bg";
334 text { style: "textblock_style_multibuttonentry_default";
335 min: 1 1;
336 ellipsis: -1;
337 }
338 }
339 }
340 }
341}
diff --git a/src/lib/elementary/Efl_Ui.h b/src/lib/elementary/Efl_Ui.h
index 0202af9..f232a3b 100644
--- a/src/lib/elementary/Efl_Ui.h
+++ b/src/lib/elementary/Efl_Ui.h
@@ -206,13 +206,6 @@ typedef Eo Efl_Ui_Focus_Manager;
206# include <efl_ui_nstate.h> 206# include <efl_ui_nstate.h>
207# include <efl_ui_calendar.h> 207# include <efl_ui_calendar.h>
208# include <efl_ui_button_eo.h> 208# include <efl_ui_button_eo.h>
209
210/* FIXME: Multibuttonentry must not use elm_widget_item */
211# warning Efl.Ui.Multibutton is not available yet without Elementary.h
212# if 0
213# include <efl_ui_multibuttonentry.h>
214# endif
215
216# include <efl_ui_slider_eo.h> 209# include <efl_ui_slider_eo.h>
217# include <efl_ui_flip_eo.h> 210# include <efl_ui_flip_eo.h>
218# include <efl_ui_frame_eo.h> 211# include <efl_ui_frame_eo.h>
diff --git a/src/lib/elementary/efl_ui_multibuttonentry_legacy.eo b/src/lib/elementary/efl_ui_multibuttonentry_legacy.eo
deleted file mode 100644
index e649ed6..0000000
--- a/src/lib/elementary/efl_ui_multibuttonentry_legacy.eo
+++ /dev/null
@@ -1,9 +0,0 @@
1class Efl.Ui.Multibuttonentry_Legacy (Efl.Ui.Multibuttonentry, Efl.Ui.Legacy)
2{
3 [[Elementary multibuttonentry class]]
4 data: null;
5 implements {
6 class.constructor;
7 Efl.Object.constructor;
8 }
9}
diff --git a/src/lib/elementary/elc_multibuttonentry.c b/src/lib/elementary/elc_multibuttonentry.c
index 25cf782..e30578e 100644
--- a/src/lib/elementary/elc_multibuttonentry.c
+++ b/src/lib/elementary/elc_multibuttonentry.c
@@ -115,13 +115,20 @@ _elm_multibuttonentry_efl_ui_widget_theme_apply(Eo *obj, Elm_Multibuttonentry_Da
115 { 115 {
116 ELM_MULTIBUTTONENTRY_ITEM_DATA_GET(eo_item, item); 116 ELM_MULTIBUTTONENTRY_ITEM_DATA_GET(eo_item, item);
117 if (VIEW(item)) 117 if (VIEW(item))
118 if (!elm_widget_element_update(obj, VIEW(item), PART_NAME_BUTTON)) 118 if (!elm_layout_theme_set(VIEW(item), "multibuttonentry",
119 PART_NAME_BUTTON, elm_widget_style_get(obj)))
119 CRI("Failed to set layout!"); 120 CRI("Failed to set layout!");
120 } 121 }
121 122
122 elm_widget_element_update(obj, sd->label, PART_NAME_LABEL); 123 elm_widget_theme_object_set
123 elm_widget_element_update(obj, sd->end, PART_NAME_CLOSED_BUTTON); 124 (obj, sd->label, "multibuttonentry", PART_NAME_LABEL,
124 elm_widget_element_update(obj, sd->guide_text, PART_NAME_GUIDE_TEXT); 125 elm_widget_style_get(obj));
126 elm_widget_theme_object_set
127 (obj, sd->end, "multibuttonentry", PART_NAME_CLOSED_BUTTON,
128 elm_widget_style_get(obj));
129 elm_widget_theme_object_set
130 (obj,sd->guide_text, "multibuttonentry", PART_NAME_GUIDE_TEXT,
131 elm_widget_style_get(obj));
125 132
126 elm_layout_sizing_eval(obj); 133 elm_layout_sizing_eval(obj);
127 134
@@ -748,13 +755,14 @@ _item_new(Elm_Multibuttonentry_Data *sd,
748 755
749 efl_access_type_set(VIEW(item), EFL_ACCESS_TYPE_DISABLED); 756 efl_access_type_set(VIEW(item), EFL_ACCESS_TYPE_DISABLED);
750 757
751 if (!elm_widget_element_update(obj, VIEW(item), PART_NAME_BUTTON)) 758 if (!elm_layout_theme_set(VIEW(item), "multibuttonentry", PART_NAME_BUTTON,
759 elm_widget_style_get(obj)))
752 CRI("Failed to set layout!"); 760 CRI("Failed to set layout!");
753 761
754 elm_object_part_text_set(VIEW(item), "elm.btn.text", str); 762 elm_object_part_text_set(VIEW(item), "elm.btn.text", str);
755 763
756 //entry is cleared when text is made to button 764 //entry is cleared when text is made to button
757 efl_text_set(sd->entry, ""); 765 elm_object_text_set(sd->entry, "");
758 766
759 elm_layout_signal_callback_add 767 elm_layout_signal_callback_add
760 (VIEW(item), "mouse,clicked,1", "*", _on_item_clicked, EO_OBJ(item)); 768 (VIEW(item), "mouse,clicked,1", "*", _on_item_clicked, EO_OBJ(item));
@@ -1055,7 +1063,7 @@ _entry_focus_changed_cb(void *data, const Efl_Event *event)
1055 { 1063 {
1056 const char *str; 1064 const char *str;
1057 1065
1058 str = efl_text_get(sd->entry); 1066 str = elm_object_text_get(sd->entry);
1059 if (str && str[0]) 1067 if (str && str[0])
1060 _item_new(sd, str, MULTIBUTTONENTRY_POS_END, NULL, NULL, NULL); 1068 _item_new(sd, str, MULTIBUTTONENTRY_POS_END, NULL, NULL, NULL);
1061 } 1069 }
@@ -1228,7 +1236,9 @@ _guide_text_set(Evas_Object *obj,
1228 1236
1229 if (sd->guide_text) 1237 if (sd->guide_text)
1230 { 1238 {
1231 elm_widget_element_update(obj, sd->guide_text, PART_NAME_GUIDE_TEXT); 1239 elm_widget_theme_object_set(obj, sd->guide_text, "multibuttonentry",
1240 PART_NAME_GUIDE_TEXT,
1241 elm_widget_style_get(obj));
1232 evas_object_size_hint_weight_set 1242 evas_object_size_hint_weight_set
1233 (sd->guide_text, 0.0, EVAS_HINT_EXPAND); 1243 (sd->guide_text, 0.0, EVAS_HINT_EXPAND);
1234 evas_object_size_hint_align_set 1244 evas_object_size_hint_align_set
@@ -1425,7 +1435,9 @@ _view_init(Evas_Object *obj, Elm_Multibuttonentry_Data *sd)
1425 1435
1426 sd->label = edje_object_add(evas_object_evas_get(obj)); 1436 sd->label = edje_object_add(evas_object_evas_get(obj));
1427 if (!sd->label) return; 1437 if (!sd->label) return;
1428 elm_widget_element_update(obj, sd->label, PART_NAME_LABEL); 1438 elm_widget_theme_object_set
1439 (obj, sd->label, "multibuttonentry", PART_NAME_LABEL,
1440 elm_widget_style_get(obj));
1429 1441
1430 // ACCESS 1442 // ACCESS
1431 if (_elm_config->access_mode == ELM_ACCESS_MODE_ON) 1443 if (_elm_config->access_mode == ELM_ACCESS_MODE_ON)
@@ -1451,7 +1463,9 @@ _view_init(Evas_Object *obj, Elm_Multibuttonentry_Data *sd)
1451 1463
1452 sd->end = edje_object_add(evas_object_evas_get(obj)); 1464 sd->end = edje_object_add(evas_object_evas_get(obj));
1453 if (!sd->end) return; 1465 if (!sd->end) return;
1454 elm_widget_element_update(obj, sd->end, PART_NAME_CLOSED_BUTTON); 1466 elm_widget_theme_object_set
1467 (obj, sd->end, "multibuttonentry", PART_NAME_CLOSED_BUTTON,
1468 elm_widget_style_get(obj));
1455 1469
1456 edje_object_size_min_calc(sd->end, &button_min_width, &button_min_height); 1470 edje_object_size_min_calc(sd->end, &button_min_width, &button_min_height);
1457 elm_coords_finger_size_adjust(1, &button_min_width, 1, &button_min_height); 1471 elm_coords_finger_size_adjust(1, &button_min_width, 1, &button_min_height);
@@ -1472,7 +1486,7 @@ _elm_multibuttonentry_text_set(Eo *obj, Elm_Multibuttonentry_Data *sd EINA_UNUSE
1472 if (label) _guide_text_set(obj, label); 1486 if (label) _guide_text_set(obj, label);
1473 } 1487 }
1474 else 1488 else
1475 efl_text_set(efl_part(efl_super(obj, MY_CLASS), part), label); 1489 elm_object_part_text_set(obj, part, label);
1476} 1490}
1477 1491
1478EOLIAN static const char* 1492EOLIAN static const char*
@@ -1489,7 +1503,7 @@ _elm_multibuttonentry_text_get(Eo *obj, Elm_Multibuttonentry_Data *sd, const cha
1489 text = sd->guide_text_str; 1503 text = sd->guide_text_str;
1490 } 1504 }
1491 else 1505 else
1492 text = efl_text_get(efl_part(efl_super(obj, MY_CLASS), part)); 1506 text = elm_object_part_text_get(obj, part);
1493 1507
1494 return text; 1508 return text;
1495} 1509}
@@ -1667,6 +1681,7 @@ EOLIAN static Eo *
1667_elm_multibuttonentry_efl_object_constructor(Eo *obj, Elm_Multibuttonentry_Data *sd EINA_UNUSED) 1681_elm_multibuttonentry_efl_object_constructor(Eo *obj, Elm_Multibuttonentry_Data *sd EINA_UNUSED)
1668{ 1682{
1669 obj = efl_constructor(efl_super(obj, MY_CLASS)); 1683 obj = efl_constructor(efl_super(obj, MY_CLASS));
1684 efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY);
1670 evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks); 1685 evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
1671 efl_access_role_set(obj, EFL_ACCESS_ROLE_PANEL); 1686 efl_access_role_set(obj, EFL_ACCESS_ROLE_PANEL);
1672 1687
diff --git a/src/lib/elementary/elm_multibuttonentry.eo b/src/lib/elementary/elm_multibuttonentry.eo
index 1385c19..edde230 100644
--- a/src/lib/elementary/elm_multibuttonentry.eo
+++ b/src/lib/elementary/elm_multibuttonentry.eo
@@ -1,7 +1,7 @@
1type Elm_Multibuttonentry_Item_Filter_Cb: __undefined_type; [[Elementary multibuttonentry item filter callback type]] 1type Elm_Multibuttonentry_Item_Filter_Cb: __undefined_type; [[Elementary multibuttonentry item filter callback type]]
2type Elm_Multibuttonentry_Format_Cb: __undefined_type; [[Elementary multibuttonentry format callback type]] 2type Elm_Multibuttonentry_Format_Cb: __undefined_type; [[Elementary multibuttonentry format callback type]]
3 3
4class Elm.Multibuttonentry (Efl.Ui.Layout, Efl.Ui.Clickable) 4class Elm.Multibuttonentry (Efl.Ui.Layout, Efl.Ui.Clickable, Efl.Ui.Legacy)
5{ 5{
6 [[Elementary multibuttonentry class]] 6 [[Elementary multibuttonentry class]]
7 legacy_prefix: elm_multibuttonentry; 7 legacy_prefix: elm_multibuttonentry;