summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzmike <michael.blumenkrantz@gmail.com>2014-05-03 12:11:44 -0400
committerzmike <michael.blumenkrantz@gmail.com>2014-05-03 12:19:13 -0400
commit3d81272e68f6bc50b521432ba6391092c8a4a3c1 (patch)
treeeb9610e7f5f5ae6a7eb3da39e1e28ffdeec11686
parentc809ecf895cf5f98cf0daf3129fa155850e05285 (diff)
redo widget callback creation to use an array, fix all warningsdevs/discomfitor/carsten
this still needs more work and simplifying
-rw-r--r--src/bin/gui.c2
-rw-r--r--src/bin/gui_mobile.c4
-rw-r--r--src/bin/widget.c383
3 files changed, 194 insertions, 195 deletions
diff --git a/src/bin/gui.c b/src/bin/gui.c
index 81c7c89..c867bf1 100644
--- a/src/bin/gui.c
+++ b/src/bin/gui.c
@@ -294,7 +294,7 @@ _toolbar_exit_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
294} 294}
295 295
296static void 296static void
297_toolbar_view_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info) 297_toolbar_view_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
298{ 298{
299 const char *sig[] = 299 const char *sig[] =
300 { 300 {
diff --git a/src/bin/gui_mobile.c b/src/bin/gui_mobile.c
index cfacf9c..3cf5517 100644
--- a/src/bin/gui_mobile.c
+++ b/src/bin/gui_mobile.c
@@ -88,7 +88,7 @@ _toolbar_item_clicked_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
88} 88}
89 89
90static void 90static void
91_mobile_option_create(ETV_Data *ed, Evas_Object *parent) 91_mobile_option_create(Evas_Object *parent)
92{ 92{
93 Evas_Object *tb; 93 Evas_Object *tb;
94 94
@@ -174,7 +174,7 @@ gui_mobile_create(const char *edje_file)
174 // widget_list 174 // widget_list
175 elm_object_part_content_set(o, PANES_BOTTOM, gui_widget_menu_create(gd->win)); 175 elm_object_part_content_set(o, PANES_BOTTOM, gui_widget_menu_create(gd->win));
176 176
177 _mobile_option_create(ed, gd->win); 177 _mobile_option_create(gd->win);
178} 178}
179 179
180void 180void
diff --git a/src/bin/widget.c b/src/bin/widget.c
index 84fe0a1..5f7a9ad 100644
--- a/src/bin/widget.c
+++ b/src/bin/widget.c
@@ -5,6 +5,8 @@ extern Gui_Data *gd;
5extern Widget_Option_Data *wod; 5extern Widget_Option_Data *wod;
6Ecore_Timer *widget_timer = NULL; 6Ecore_Timer *widget_timer = NULL;
7 7
8typedef Evas_Object *(*Widget_Create_Cb)(Evas_Object*, const char *orig_style, const char *style, const char *processed);
9
8Widget widgets[WIDGET_COUNT] = { 10Widget widgets[WIDGET_COUNT] = {
9 { "none", ETV_ID_NONE, NULL }, 11 { "none", ETV_ID_NONE, NULL },
10 { "access", ETV_ID_ACCESS, NULL }, 12 { "access", ETV_ID_ACCESS, NULL },
@@ -82,13 +84,19 @@ static const char *lbl[] = {
82 * arrow_left/default -> arrow_left (icon) 84 * arrow_left/default -> arrow_left (icon)
83 * separator/default -> separator (menu) 85 * separator/default -> separator (menu)
84 */ 86 */
85static void 87static const char *
86_trim_end_default(const char *orig_style, char *style) 88_trim_end_default(const char *orig_style)
87{ 89{
88 if (!orig_style) return; 90 const char *p;
89 strncpy(style, orig_style, strlen(orig_style)); 91 static char buf[4096];
90 style[strlen(orig_style) - strlen("/default")] = '\0'; 92
91 //INF("%s %s", style, orig_style); 93 if (!orig_style) return NULL;
94 p = strrchr(orig_style, '/');
95 if (!p) return NULL;
96 strncpy(buf, orig_style, p - orig_style);
97 buf[p - orig_style] = 0;
98 //INF("%s %s", buf, orig_style);
99 return buf;
92} 100}
93 101
94// widget not implemented 102// widget not implemented
@@ -111,7 +119,7 @@ _widget_not_implemented_create(Evas_Object *parent, Widget_Type widget)
111 119
112// actionslider 120// actionslider
113static Evas_Object * 121static Evas_Object *
114_widget_actionslider_create(Evas_Object *parent, const char *style) 122_widget_actionslider_create(Evas_Object *parent, const char *orig_style EINA_UNUSED, const char *style, const char *processed EINA_UNUSED)
115{ 123{
116 Evas_Object *as; 124 Evas_Object *as;
117 125
@@ -145,7 +153,7 @@ _widget_actionslider_create(Evas_Object *parent, const char *style)
145 153
146// access 154// access
147static Evas_Object * 155static Evas_Object *
148_widget_access_create(Evas_Object *parent, const char *style) 156_widget_access_create(Evas_Object *parent, const char *orig_style EINA_UNUSED, const char *style, const char *processed EINA_UNUSED)
149{ 157{
150 Evas_Object *o; 158 Evas_Object *o;
151 159
@@ -163,7 +171,7 @@ _widget_access_create(Evas_Object *parent, const char *style)
163 171
164// bg 172// bg
165static Evas_Object * 173static Evas_Object *
166_widget_bg_create(Evas_Object *parent, const char *style) 174_widget_bg_create(Evas_Object *parent, const char *orig_style EINA_UNUSED, const char *style, const char *processed EINA_UNUSED)
167{ 175{
168 Evas_Object *bg; 176 Evas_Object *bg;
169 bg = elm_bg_add(parent); 177 bg = elm_bg_add(parent);
@@ -175,7 +183,7 @@ _widget_bg_create(Evas_Object *parent, const char *style)
175 183
176// border 184// border
177static Evas_Object * 185static Evas_Object *
178_widget_border_create(Evas_Object *parent, const char *style) 186_widget_border_create(Evas_Object *parent, const char *orig_style EINA_UNUSED, const char *style, const char *processed EINA_UNUSED)
179{ 187{
180 Evas_Object *o, *table; 188 Evas_Object *o, *table;
181 189
@@ -192,36 +200,34 @@ _widget_border_create(Evas_Object *parent, const char *style)
192 200
193// bubble 201// bubble
194static Evas_Object * 202static Evas_Object *
195_widget_bubble_create(Evas_Object *parent, const char *orig_style) 203_widget_bubble_create(Evas_Object *parent, const char *orig_style EINA_UNUSED, const char *style EINA_UNUSED, const char *processed)
196{ 204{
197 char buf[PATH_MAX]; 205 char buf[PATH_MAX];
198 char style[PATH_MAX] = {0, }; 206 Evas_Object *o, *ic, *l;
199 Evas_Object *o, *ic, *lbl;
200 207
201 ic = elm_icon_add(parent); 208 ic = elm_icon_add(parent);
202 snprintf(buf, sizeof(buf), "%s/images/sky_01.jpg", elm_app_data_dir_get()); 209 snprintf(buf, sizeof(buf), "%s/images/sky_01.jpg", elm_app_data_dir_get());
203 elm_image_file_set(ic, buf, NULL); 210 elm_image_file_set(ic, buf, NULL);
204 evas_object_show(ic); 211 evas_object_show(ic);
205 212
206 lbl = elm_label_add(parent); 213 l = elm_label_add(parent);
207 elm_object_text_set(lbl, "This is a bubble widget preview."); 214 elm_object_text_set(l, "This is a bubble widget preview.");
208 evas_object_show(lbl); 215 evas_object_show(l);
209 216
210 o = elm_bubble_add(parent); 217 o = elm_bubble_add(parent);
211 elm_object_text_set(o, "Title"); 218 elm_object_text_set(o, "Title");
212 elm_object_part_text_set(o, "info", "Information"); 219 elm_object_part_text_set(o, "info", "Information");
213 elm_object_content_set(o, lbl); 220 elm_object_content_set(o, l);
214 elm_object_part_content_set(o, "icon", ic); 221 elm_object_part_content_set(o, "icon", ic);
215 evas_object_show(o); 222 evas_object_show(o);
216 223
217 _trim_end_default(orig_style, style); 224 if (!strcmp("bottom_left", processed))
218 if (!strcmp("bottom_left", style))
219 elm_bubble_pos_set(o, ELM_BUBBLE_POS_BOTTOM_LEFT); 225 elm_bubble_pos_set(o, ELM_BUBBLE_POS_BOTTOM_LEFT);
220 else if (!strcmp("bottom_right", style)) 226 else if (!strcmp("bottom_right", processed))
221 elm_bubble_pos_set(o, ELM_BUBBLE_POS_BOTTOM_RIGHT); 227 elm_bubble_pos_set(o, ELM_BUBBLE_POS_BOTTOM_RIGHT);
222 else if (!strcmp("top_left", style)) 228 else if (!strcmp("top_left", processed))
223 elm_bubble_pos_set(o, ELM_BUBBLE_POS_TOP_LEFT); 229 elm_bubble_pos_set(o, ELM_BUBBLE_POS_TOP_LEFT);
224 else if (!strcmp("top_right", style)) 230 else if (!strcmp("top_right", processed))
225 elm_bubble_pos_set(o, ELM_BUBBLE_POS_TOP_RIGHT); 231 elm_bubble_pos_set(o, ELM_BUBBLE_POS_TOP_RIGHT);
226 232
227 return o; 233 return o;
@@ -229,7 +235,7 @@ _widget_bubble_create(Evas_Object *parent, const char *orig_style)
229 235
230// button 236// button
231static Evas_Object * 237static Evas_Object *
232_widget_button_create(Evas_Object *parent, const char* style) 238_widget_button_create(Evas_Object *parent, const char *orig_style EINA_UNUSED, const char *style, const char *processed EINA_UNUSED)
233{ 239{
234 Evas_Object *o = NULL; 240 Evas_Object *o = NULL;
235 o = elm_button_add(parent); 241 o = elm_button_add(parent);
@@ -267,7 +273,7 @@ _widget_button_create(Evas_Object *parent, const char* style)
267 273
268// clock 274// clock
269static Evas_Object * 275static Evas_Object *
270_widget_clock_create(Evas_Object *parent, const char* style) 276_widget_clock_create(Evas_Object *parent, const char *orig_style EINA_UNUSED, const char *style, const char *processed EINA_UNUSED)
271{ 277{
272 Evas_Object *o; 278 Evas_Object *o;
273 o = elm_clock_add(parent); 279 o = elm_clock_add(parent);
@@ -280,7 +286,7 @@ _widget_clock_create(Evas_Object *parent, const char* style)
280 286
281// check 287// check
282static Evas_Object * 288static Evas_Object *
283_widget_check_create(Evas_Object *parent, const char *style) 289_widget_check_create(Evas_Object *parent, const char *orig_style EINA_UNUSED, const char *style, const char *processed EINA_UNUSED)
284{ 290{
285 Evas_Object *o; 291 Evas_Object *o;
286 o = elm_check_add(parent); 292 o = elm_check_add(parent);
@@ -318,7 +324,7 @@ _widget_check_create(Evas_Object *parent, const char *style)
318 324
319// colorselector 325// colorselector
320static Evas_Object * 326static Evas_Object *
321_widget_colorselector_create(Evas_Object *parent, const char *style) 327_widget_colorselector_create(Evas_Object *parent, const char *orig_style EINA_UNUSED, const char *style, const char *processed EINA_UNUSED)
322{ 328{
323 Evas_Object *o; 329 Evas_Object *o;
324 330
@@ -347,7 +353,7 @@ _widget_colorselector_create(Evas_Object *parent, const char *style)
347 353
348// entry 354// entry
349static Evas_Object * 355static Evas_Object *
350_widget_entry_create(Evas_Object *parent, const char *orig_style, const char* style) 356_widget_entry_create(Evas_Object *parent, const char *orig_style, const char *style, const char *processed)
351{ 357{
352 char buf[PATH_MAX]; 358 char buf[PATH_MAX];
353 char type[PATH_MAX]; 359 char type[PATH_MAX];
@@ -359,11 +365,7 @@ _widget_entry_create(Evas_Object *parent, const char *orig_style, const char* st
359 EXPAND(o); FILL(o); 365 EXPAND(o); FILL(o);
360 366
361 if (!strcmp("emoticon", type)) 367 if (!strcmp("emoticon", type))
362 { 368 snprintf(buf, sizeof(buf), "<item size=64x64 href=emoticon/%s></item>", processed);
363 const char *emoticon_style = NULL;
364 emoticon_style = _style_split_2(orig_style);
365 snprintf(buf, sizeof(buf), "<item size=64x64 href=emoticon/%s></item>", emoticon_style);
366 }
367 else 369 else
368 { 370 {
369 elm_object_style_set(o, style); 371 elm_object_style_set(o, style);
@@ -454,18 +456,18 @@ _widget_entry_create(Evas_Object *parent, const char *orig_style, const char* st
454 456
455// ews 457// ews
456static Evas_Object * 458static Evas_Object *
457_widget_ews_create(Evas_Object *parent, const char *orig_style) 459_widget_ews_create(Evas_Object *parent, const char *orig_style, const char *style EINA_UNUSED, const char *processed EINA_UNUSED)
458{ 460{
459 Evas_Object *o, *table, *edje; 461 Evas_Object *o, *table, *edje;
460 const char *group = NULL, *style = NULL; 462 const char *group = NULL, *style2 = NULL;
461 char buf[PATH_MAX] = {0, }; 463 char buf[PATH_MAX] = {0, };
462 464
463 strncpy(buf, orig_style, sizeof(buf) - 1); 465 strncpy(buf, orig_style, sizeof(buf) - 1);
464 group = strtok(buf, "/"); 466 group = strtok(buf, "/");
465 style = strtok(NULL, "/"); 467 style2 = strtok(NULL, "/");
466 468
467 o = elm_layout_add(parent); 469 o = elm_layout_add(parent);
468 elm_layout_theme_set(o, "ews", group, style); 470 elm_layout_theme_set(o, "ews", group, style2);
469 evas_object_show(o); 471 evas_object_show(o);
470 472
471 edje = elm_layout_edje_get(o); 473 edje = elm_layout_edje_get(o);
@@ -480,9 +482,9 @@ _widget_ews_create(Evas_Object *parent, const char *orig_style)
480 482
481// frame 483// frame
482static Evas_Object * 484static Evas_Object *
483_widget_frame_create(Evas_Object *parent, const char *style) 485_widget_frame_create(Evas_Object *parent, const char *orig_style EINA_UNUSED, const char *style, const char *processed EINA_UNUSED)
484{ 486{
485 Evas_Object *o, *lbl; 487 Evas_Object *o, *l;
486 char buf[PATH_MAX]; 488 char buf[PATH_MAX];
487 489
488 o = elm_frame_add(parent); 490 o = elm_frame_add(parent);
@@ -491,12 +493,12 @@ _widget_frame_create(Evas_Object *parent, const char *style)
491 elm_object_text_set(o, "Frame Styles"); 493 elm_object_text_set(o, "Frame Styles");
492 evas_object_show(o); 494 evas_object_show(o);
493 495
494 lbl = elm_label_add(parent); 496 l = elm_label_add(parent);
495 sprintf(buf, "This is a %s style frame.", style); 497 sprintf(buf, "This is a %s style frame.", style);
496 elm_label_line_wrap_set(lbl, ELM_WRAP_MIXED); 498 elm_label_line_wrap_set(l, ELM_WRAP_MIXED);
497 elm_object_text_set(lbl, buf); 499 elm_object_text_set(l, buf);
498 elm_object_content_set(o, lbl); 500 elm_object_content_set(o, l);
499 evas_object_show(lbl); 501 evas_object_show(l);
500 502
501 return o; 503 return o;
502} 504}
@@ -629,7 +631,7 @@ typedef enum {
629} Gengrid_Style_Type; 631} Gengrid_Style_Type;
630 632
631static Evas_Object * 633static Evas_Object *
632_widget_gengrid_create(Evas_Object *parent, const char *orig_style, const char *style) 634_widget_gengrid_create(Evas_Object *parent, const char *orig_style, const char *style, const char *processed EINA_UNUSED)
633{ 635{
634 Evas_Object *o; 636 Evas_Object *o;
635 Elm_Genlist_Item_Class *ic = NULL, *group_ic = NULL; 637 Elm_Genlist_Item_Class *ic = NULL, *group_ic = NULL;
@@ -807,7 +809,7 @@ _widget_genlist_content_get(void *data EINA_UNUSED, Evas_Object *obj,
807} 809}
808 810
809static Evas_Object * 811static Evas_Object *
810_widget_genlist_create(Evas_Object *parent, const char *orig_style, const char *style) 812_widget_genlist_create(Evas_Object *parent, const char *orig_style, const char *style, const char *processed EINA_UNUSED)
811{ 813{
812 Evas_Object *o; 814 Evas_Object *o;
813 Elm_Genlist_Item_Class *ic; 815 Elm_Genlist_Item_Class *ic;
@@ -857,7 +859,7 @@ _widget_genlist_create(Evas_Object *parent, const char *orig_style, const char *
857 859
858// fileselector 860// fileselector
859static Evas_Object * 861static Evas_Object *
860_widget_fileselector_create(Evas_Object *parent, const char *style) 862_widget_fileselector_create(Evas_Object *parent, const char *orig_style EINA_UNUSED, const char *style, const char *processed EINA_UNUSED)
861{ 863{
862 Evas_Object *o; 864 Evas_Object *o;
863 char buf[40]; 865 char buf[40];
@@ -877,7 +879,7 @@ _widget_fileselector_create(Evas_Object *parent, const char *style)
877 879
878// fileselector entry 880// fileselector entry
879static Evas_Object * 881static Evas_Object *
880_widget_fileselector_entry_create(Evas_Object *parent, const char *style) 882_widget_fileselector_entry_create(Evas_Object *parent, const char *orig_style EINA_UNUSED, const char *style, const char *processed EINA_UNUSED)
881{ 883{
882 Evas_Object *o, *ic; 884 Evas_Object *o, *ic;
883 885
@@ -899,7 +901,7 @@ _widget_fileselector_entry_create(Evas_Object *parent, const char *style)
899 901
900// flipselector 902// flipselector
901static Evas_Object * 903static Evas_Object *
902_widget_flipselector_create(Evas_Object *parent, const char *style) 904_widget_flipselector_create(Evas_Object *parent, const char *orig_style EINA_UNUSED, const char *style, const char *processed EINA_UNUSED)
903{ 905{
904 Evas_Object *o; 906 Evas_Object *o;
905 unsigned int i = 0; 907 unsigned int i = 0;
@@ -927,7 +929,7 @@ _widget_focus_highlight_win_create(void *data, Evas_Object *obj EINA_UNUSED,
927 fwin = elm_win_util_standard_add("focus-window", "Focus Window"); 929 fwin = elm_win_util_standard_add("focus-window", "Focus Window");
928 elm_win_autodel_set(fwin, EINA_TRUE); 930 elm_win_autodel_set(fwin, EINA_TRUE);
929 931
930 strncpy(style, data + 4, strlen(data) - 3); // "top/" 932 strncpy(style, (char*)data + 4, strlen(data) - 3); // "top/"
931 elm_win_focus_highlight_enabled_set(fwin, EINA_TRUE); 933 elm_win_focus_highlight_enabled_set(fwin, EINA_TRUE);
932 934
933 box0 = o = elm_box_add(fwin); 935 box0 = o = elm_box_add(fwin);
@@ -958,7 +960,7 @@ _widget_focus_highlight_win_create(void *data, Evas_Object *obj EINA_UNUSED,
958} 960}
959 961
960static Evas_Object * 962static Evas_Object *
961_widget_focus_highlight_create(Evas_Object *parent, const char *orig_style) 963_widget_focus_highlight_create(Evas_Object *parent, const char *orig_style, const char *style EINA_UNUSED, const char *processed EINA_UNUSED)
962{ 964{
963 Evas_Object *o = NULL; 965 Evas_Object *o = NULL;
964 o = elm_button_add(parent); 966 o = elm_button_add(parent);
@@ -981,7 +983,7 @@ _hover_bt_cb(void *data, Evas_Object *obj EINA_UNUSED,
981 983
982// hover 984// hover
983static Evas_Object * 985static Evas_Object *
984_widget_hover_create(Evas_Object *parent, const char* style) 986_widget_hover_create(Evas_Object *parent, const char *orig_style EINA_UNUSED, const char *style, const char *processed EINA_UNUSED)
985{ 987{
986 Evas_Object *hv, *bt, *bt2; 988 Evas_Object *hv, *bt, *bt2;
987 989
@@ -1006,7 +1008,7 @@ _widget_hover_create(Evas_Object *parent, const char* style)
1006 1008
1007// index 1009// index
1008static Evas_Object * 1010static Evas_Object *
1009_widget_index_create(Evas_Object *parent, const char *style) 1011_widget_index_create(Evas_Object *parent, const char *orig_style EINA_UNUSED, const char *style, const char *processed EINA_UNUSED)
1010{ 1012{
1011 Evas_Object *o; 1013 Evas_Object *o;
1012 char buf[2] = {0, }; 1014 char buf[2] = {0, };
@@ -1032,16 +1034,13 @@ _widget_index_create(Evas_Object *parent, const char *style)
1032 1034
1033// icon 1035// icon
1034static Evas_Object * 1036static Evas_Object *
1035_widget_icon_create(Evas_Object *parent, const char *orig_style) 1037_widget_icon_create(Evas_Object *parent, const char *orig_style EINA_UNUSED, const char *style EINA_UNUSED, const char *processed)
1036{ 1038{
1037 Evas_Object *o; 1039 Evas_Object *o;
1038 char style[PATH_MAX] = {0, };
1039
1040 _trim_end_default(orig_style, style);
1041 1040
1042 o = elm_icon_add(parent); 1041 o = elm_icon_add(parent);
1043 EXPAND(o); 1042 EXPAND(o);
1044 elm_icon_standard_set(o, style); 1043 elm_icon_standard_set(o, processed);
1045 evas_object_size_hint_min_set(o, 100, 100); 1044 evas_object_size_hint_min_set(o, 100, 100);
1046 evas_object_show(o); 1045 evas_object_show(o);
1047 1046
@@ -1050,7 +1049,7 @@ _widget_icon_create(Evas_Object *parent, const char *orig_style)
1050 1049
1051// label 1050// label
1052static Evas_Object * 1051static Evas_Object *
1053_widget_label_create(Evas_Object *parent, const char *style) 1052_widget_label_create(Evas_Object *parent, const char *orig_style EINA_UNUSED, const char *style, const char *processed EINA_UNUSED)
1054{ 1053{
1055 Evas_Object *o; 1054 Evas_Object *o;
1056 char buf[PATH_MAX] = {0, }; 1055 char buf[PATH_MAX] = {0, };
@@ -1069,7 +1068,7 @@ _widget_label_create(Evas_Object *parent, const char *style)
1069static Evas_Object * 1068static Evas_Object *
1070_widget_layout_content_create(Evas_Object *layout) 1069_widget_layout_content_create(Evas_Object *layout)
1071{ 1070{
1072 Evas_Object *table, *bg, *lbl; 1071 Evas_Object *table, *bg, *l;
1073 1072
1074 table = elm_table_add(layout); 1073 table = elm_table_add(layout);
1075 EXPAND(table); FILL(table); 1074 EXPAND(table); FILL(table);
@@ -1081,12 +1080,12 @@ _widget_layout_content_create(Evas_Object *layout)
1081 elm_table_pack(table, bg, 0, 0, 1, 1); 1080 elm_table_pack(table, bg, 0, 0, 1, 1);
1082 evas_object_show(bg); 1081 evas_object_show(bg);
1083 1082
1084 lbl = elm_label_add(table); 1083 l = elm_label_add(table);
1085 EXPAND(lbl); FILL(lbl); 1084 EXPAND(l); FILL(l);
1086 elm_label_line_wrap_set(lbl, ELM_WRAP_MIXED); 1085 elm_label_line_wrap_set(l, ELM_WRAP_MIXED);
1087 elm_object_text_set(lbl, "This dark area is a content area."); 1086 elm_object_text_set(l, "This dark area is a content area.");
1088 elm_table_pack(table, lbl, 0, 0, 1, 1); 1087 elm_table_pack(table, l, 0, 0, 1, 1);
1089 evas_object_show(lbl); 1088 evas_object_show(l);
1090 1089
1091 return table; 1090 return table;
1092} 1091}
@@ -1114,9 +1113,9 @@ _widget_layout_end_create(Evas_Object *layout)
1114} 1113}
1115 1114
1116static Evas_Object * 1115static Evas_Object *
1117_widget_layout_create(Evas_Object *parent, const char *style) 1116_widget_layout_create(Evas_Object *parent, const char *orig_style EINA_UNUSED, const char *style, const char *processed EINA_UNUSED)
1118{ 1117{
1119 Evas_Object *o, *lbl, *content; 1118 Evas_Object *o, *l, *content;
1120 1119
1121 o = elm_layout_add(parent); 1120 o = elm_layout_add(parent);
1122 elm_layout_theme_set(o, "layout", "application", style); 1121 elm_layout_theme_set(o, "layout", "application", style);
@@ -1168,19 +1167,19 @@ _widget_layout_create(Evas_Object *parent, const char *style)
1168 content = _widget_layout_content_create(o); 1167 content = _widget_layout_content_create(o);
1169 elm_layout_table_pack(o, "elm.table.content", content, 0, 0, 1, 1); 1168 elm_layout_table_pack(o, "elm.table.content", content, 0, 0, 1, 1);
1170 1169
1171 lbl = elm_label_add(parent); 1170 l = elm_label_add(parent);
1172 elm_label_line_wrap_set(lbl, ELM_WRAP_MIXED); 1171 elm_label_line_wrap_set(l, ELM_WRAP_MIXED);
1173 elm_object_text_set(lbl, "This area is also a content area which packed into a table."); 1172 elm_object_text_set(l, "This area is also a content area which packed into a table.");
1174 EXPAND(lbl); FILL(lbl); 1173 EXPAND(l); FILL(l);
1175 evas_object_show(lbl); 1174 evas_object_show(l);
1176 elm_layout_table_pack(o, "elm.table.content", lbl, 0, 1, 1, 1); 1175 elm_layout_table_pack(o, "elm.table.content", l, 0, 1, 1, 1);
1177 1176
1178 lbl = elm_label_add(parent); 1177 l = elm_label_add(parent);
1179 elm_label_line_wrap_set(lbl, ELM_WRAP_MIXED); 1178 elm_label_line_wrap_set(l, ELM_WRAP_MIXED);
1180 elm_object_text_set(lbl, "This area is also a content area which packed into a table."); 1179 elm_object_text_set(l, "This area is also a content area which packed into a table.");
1181 EXPAND(lbl); FILL(lbl); 1180 EXPAND(l); FILL(l);
1182 evas_object_show(lbl); 1181 evas_object_show(l);
1183 elm_layout_table_pack(o, "elm.table.content", lbl, 1, 0, 1, 1); 1182 elm_layout_table_pack(o, "elm.table.content", l, 1, 0, 1, 1);
1184 1183
1185 content = _widget_layout_content_create(o); 1184 content = _widget_layout_content_create(o);
1186 elm_layout_table_pack(o, "elm.table.content", content, 1, 1, 1, 1); 1185 elm_layout_table_pack(o, "elm.table.content", content, 1, 1, 1, 1);
@@ -1190,12 +1189,12 @@ _widget_layout_create(Evas_Object *parent, const char *style)
1190 content = _widget_layout_content_create(o); 1189 content = _widget_layout_content_create(o);
1191 elm_layout_box_append(o, "elm.box.content", content); 1190 elm_layout_box_append(o, "elm.box.content", content);
1192 1191
1193 lbl = elm_label_add(parent); 1192 l = elm_label_add(parent);
1194 elm_label_line_wrap_set(lbl, ELM_WRAP_MIXED); 1193 elm_label_line_wrap_set(l, ELM_WRAP_MIXED);
1195 elm_object_text_set(lbl, "This area is also a content area which packed into a box."); 1194 elm_object_text_set(l, "This area is also a content area which packed into a box.");
1196 EXPAND(lbl); FILL(lbl); 1195 EXPAND(l); FILL(l);
1197 evas_object_show(lbl); 1196 evas_object_show(l);
1198 elm_layout_box_append(o, "elm.box.content", lbl); 1197 elm_layout_box_append(o, "elm.box.content", l);
1199 } 1198 }
1200 1199
1201 return o; 1200 return o;
@@ -1203,7 +1202,7 @@ _widget_layout_create(Evas_Object *parent, const char *style)
1203 1202
1204// list 1203// list
1205static Evas_Object * 1204static Evas_Object *
1206_widget_list_create(Evas_Object *parent, const char *orig_style, const char *style) 1205_widget_list_create(Evas_Object *parent, const char *orig_style, const char *style, const char *processed EINA_UNUSED)
1207{ 1206{
1208 Evas_Object *o = NULL, *icon = NULL; 1207 Evas_Object *o = NULL, *icon = NULL;
1209 int i = 0; 1208 int i = 0;
@@ -1260,13 +1259,10 @@ _widget_menu_show(void *data, Evas *e EINA_UNUSED,
1260} 1259}
1261 1260
1262static Evas_Object * 1261static Evas_Object *
1263_widget_menu_create(Evas_Object *parent, const char *orig_style) 1262_widget_menu_create(Evas_Object *parent, const char *orig_style EINA_UNUSED, const char *style EINA_UNUSED, const char *processed)
1264{ 1263{
1265 Evas_Object *o, *bg, *table, *lbl; 1264 Evas_Object *o, *bg, *table, *l;
1266 Elm_Object_Item *menu_it; 1265 Elm_Object_Item *menu_it;
1267 char style[PATH_MAX] = {0, };
1268
1269 _trim_end_default(orig_style, style);
1270 1266
1271 table = elm_table_add(parent); 1267 table = elm_table_add(parent);
1272 EXPAND(table); FILL(table); 1268 EXPAND(table); FILL(table);
@@ -1278,29 +1274,29 @@ _widget_menu_create(Evas_Object *parent, const char *orig_style)
1278 elm_table_pack(table, bg, 0, 0, 1, 1); 1274 elm_table_pack(table, bg, 0, 0, 1, 1);
1279 evas_object_show(bg); 1275 evas_object_show(bg);
1280 1276
1281 lbl = elm_label_add(table); 1277 l = elm_label_add(table);
1282 elm_label_line_wrap_set(lbl, ELM_WRAP_MIXED); 1278 elm_label_line_wrap_set(l, ELM_WRAP_MIXED);
1283 EXPAND(lbl); FILL(lbl); 1279 EXPAND(l); FILL(l);
1284 elm_object_text_set(lbl, "Click this dark area."); 1280 elm_object_text_set(l, "Click this dark area.");
1285 elm_table_pack(table, lbl, 0, 0, 1, 1); 1281 elm_table_pack(table, l, 0, 0, 1, 1);
1286 evas_object_repeat_events_set(lbl, EINA_TRUE); 1282 evas_object_repeat_events_set(l, EINA_TRUE);
1287 evas_object_show(lbl); 1283 evas_object_show(l);
1288 1284
1289 o = elm_menu_add(parent); 1285 o = elm_menu_add(parent);
1290 if (!strcmp("item", style)) 1286 if (!strcmp("item", processed))
1291 { 1287 {
1292 elm_menu_item_add(o, NULL, NULL, "first item", NULL, NULL); 1288 elm_menu_item_add(o, NULL, NULL, "first item", NULL, NULL);
1293 elm_menu_item_add(o, NULL, "mail-reply-all", "second item", NULL, NULL); 1289 elm_menu_item_add(o, NULL, "mail-reply-all", "second item", NULL, NULL);
1294 elm_menu_item_add(o, NULL, "window-new", "third item", NULL, NULL); 1290 elm_menu_item_add(o, NULL, "window-new", "third item", NULL, NULL);
1295 } 1291 }
1296 else if (!strcmp("item_with_submenu", style)) 1292 else if (!strcmp("item_with_submenu", processed))
1297 { 1293 {
1298 elm_menu_item_add(o, NULL, NULL, "first item", NULL, NULL); 1294 elm_menu_item_add(o, NULL, NULL, "first item", NULL, NULL);
1299 menu_it = elm_menu_item_add(o, NULL, "mail-reply-all", "second item", NULL, NULL); 1295 menu_it = elm_menu_item_add(o, NULL, "mail-reply-all", "second item", NULL, NULL);
1300 elm_menu_item_add(o, menu_it, NULL, "first sub menu", NULL, NULL); 1296 elm_menu_item_add(o, menu_it, NULL, "first sub menu", NULL, NULL);
1301 elm_menu_item_add(o, menu_it, "mail-reply-all", "second sub menu", NULL, NULL); 1297 elm_menu_item_add(o, menu_it, "mail-reply-all", "second sub menu", NULL, NULL);
1302 } 1298 }
1303 else if (!strcmp("separator", style)) 1299 else if (!strcmp("separator", processed))
1304 { 1300 {
1305 elm_menu_item_add(o, NULL, NULL, "between separator", NULL, NULL); 1301 elm_menu_item_add(o, NULL, NULL, "between separator", NULL, NULL);
1306 elm_menu_item_separator_add(o, NULL); 1302 elm_menu_item_separator_add(o, NULL);
@@ -1319,7 +1315,7 @@ _widget_menu_create(Evas_Object *parent, const char *orig_style)
1319 1315
1320// multibuttonentry 1316// multibuttonentry
1321static Evas_Object * 1317static Evas_Object *
1322_widget_multibuttonentry_create(Evas_Object *parent, const char *style) 1318_widget_multibuttonentry_create(Evas_Object *parent, const char *orig_style EINA_UNUSED, const char *style, const char *processed EINA_UNUSED)
1323{ 1319{
1324 Evas_Object *o = NULL; 1320 Evas_Object *o = NULL;
1325 1321
@@ -1388,7 +1384,7 @@ _naviframe_next_btn_cb(void *data, Evas_Object *obj EINA_UNUSED,
1388 1384
1389// naviframe 1385// naviframe
1390static Evas_Object * 1386static Evas_Object *
1391_widget_naviframe_create(Evas_Object *parent, const char *style) 1387_widget_naviframe_create(Evas_Object *parent, const char *orig_style EINA_UNUSED, const char *style, const char *processed EINA_UNUSED)
1392{ 1388{
1393 Evas_Object *o = NULL; 1389 Evas_Object *o = NULL;
1394 1390
@@ -1405,39 +1401,37 @@ _widget_naviframe_create(Evas_Object *parent, const char *style)
1405 1401
1406// panel 1402// panel
1407static Evas_Object * 1403static Evas_Object *
1408_widget_panel_create(Evas_Object *parent, const char *orig_style) 1404_widget_panel_create(Evas_Object *parent, const char *orig_style EINA_UNUSED, const char *style EINA_UNUSED, const char *processed)
1409{ 1405{
1410 Evas_Object *o, *lbl; 1406 Evas_Object *o, *l;
1411 char style[PATH_MAX] = {0, };
1412 1407
1413 lbl = elm_label_add(parent); 1408 l = elm_label_add(parent);
1414 elm_label_line_wrap_set(lbl, ELM_WRAP_MIXED); 1409 elm_label_line_wrap_set(l, ELM_WRAP_MIXED);
1415 elm_object_text_set(lbl, "This is a panel.<br>" 1410 elm_object_text_set(l, "This is a panel.<br>"
1416 "Panel has four orientation:<br>" 1411 "Panel has four orientation:<br>"
1417 "TOP, BOTTOM, LEFT, RIGHT"); 1412 "TOP, BOTTOM, LEFT, RIGHT");
1418 evas_object_show(lbl); 1413 evas_object_show(l);
1419 1414
1420 o = elm_panel_add(parent); 1415 o = elm_panel_add(parent);
1421 elm_object_content_set(o, lbl); 1416 elm_object_content_set(o, l);
1422 evas_object_show(o); 1417 evas_object_show(o);
1423 1418
1424 _trim_end_default(orig_style, style); 1419 if (!strcmp(processed, "bottom"))
1425 if (!strcmp(style, "bottom"))
1426 { 1420 {
1427 EXPAND(o); ALIGN(o, EVAS_HINT_FILL, 1.0); 1421 EXPAND(o); ALIGN(o, EVAS_HINT_FILL, 1.0);
1428 elm_panel_orient_set(o, ELM_PANEL_ORIENT_BOTTOM); 1422 elm_panel_orient_set(o, ELM_PANEL_ORIENT_BOTTOM);
1429 } 1423 }
1430 else if (!strcmp(style, "top")) 1424 else if (!strcmp(processed, "top"))
1431 { 1425 {
1432 EXPAND(o); ALIGN(o, EVAS_HINT_FILL, 0); 1426 EXPAND(o); ALIGN(o, EVAS_HINT_FILL, 0);
1433 elm_panel_orient_set(o, ELM_PANEL_ORIENT_TOP); 1427 elm_panel_orient_set(o, ELM_PANEL_ORIENT_TOP);
1434 } 1428 }
1435 else if (!strcmp(style, "left")) 1429 else if (!strcmp(processed, "left"))
1436 { 1430 {
1437 EXPAND(o); ALIGN(o, 0.0, EVAS_HINT_FILL); 1431 EXPAND(o); ALIGN(o, 0.0, EVAS_HINT_FILL);
1438 elm_panel_orient_set(o, ELM_PANEL_ORIENT_LEFT); 1432 elm_panel_orient_set(o, ELM_PANEL_ORIENT_LEFT);
1439 } 1433 }
1440 else if (!strcmp(style, "right")) 1434 else if (!strcmp(processed, "right"))
1441 { 1435 {
1442 EXPAND(o); ALIGN(o, 1.0, EVAS_HINT_FILL); 1436 EXPAND(o); ALIGN(o, 1.0, EVAS_HINT_FILL);
1443 elm_panel_orient_set(o, ELM_PANEL_ORIENT_RIGHT); 1437 elm_panel_orient_set(o, ELM_PANEL_ORIENT_RIGHT);
@@ -1448,7 +1442,7 @@ _widget_panel_create(Evas_Object *parent, const char *orig_style)
1448 1442
1449// photo 1443// photo
1450static Evas_Object * 1444static Evas_Object *
1451_widget_photo_create(Evas_Object *parent, const char *style) 1445_widget_photo_create(Evas_Object *parent, const char *orig_style EINA_UNUSED, const char *style, const char *processed EINA_UNUSED)
1452{ 1446{
1453 char buf[PATH_MAX]; 1447 char buf[PATH_MAX];
1454 Evas_Object *o; 1448 Evas_Object *o;
@@ -1467,7 +1461,7 @@ _widget_photo_create(Evas_Object *parent, const char *style)
1467 1461
1468// player 1462// player
1469static Evas_Object * 1463static Evas_Object *
1470_widget_player_create(Evas_Object *parent, const char *style EINA_UNUSED) 1464_widget_player_create(Evas_Object *parent, const char *orig_style EINA_UNUSED, const char *style EINA_UNUSED, const char *processed EINA_UNUSED)
1471{ 1465{
1472 Evas_Object *o = NULL; 1466 Evas_Object *o = NULL;
1473 1467
@@ -1479,7 +1473,7 @@ _widget_player_create(Evas_Object *parent, const char *style EINA_UNUSED)
1479 1473
1480// pointer 1474// pointer
1481static Evas_Object * 1475static Evas_Object *
1482_widget_pointer_create(Evas_Object *parent, const char *style) 1476_widget_pointer_create(Evas_Object *parent, const char *orig_style EINA_UNUSED, const char *style, const char *processed EINA_UNUSED)
1483{ 1477{
1484 Evas_Object *o; 1478 Evas_Object *o;
1485 1479
@@ -1607,7 +1601,7 @@ _widget_popup_launch(void *data, Evas_Object *obj EINA_UNUSED,
1607#undef WIDGET_POPUP_BUTTON_CREATE 1601#undef WIDGET_POPUP_BUTTON_CREATE
1608 1602
1609static Evas_Object * 1603static Evas_Object *
1610_widget_popup_create(Evas_Object *parent, const char *style) 1604_widget_popup_create(Evas_Object *parent, const char *orig_style EINA_UNUSED, const char *style, const char *processed EINA_UNUSED)
1611{ 1605{
1612 Evas_Object *o = NULL; 1606 Evas_Object *o = NULL;
1613 o = elm_button_add(parent); 1607 o = elm_button_add(parent);
@@ -1641,24 +1635,24 @@ _progressbar_value_set(void *data)
1641 1635
1642// progressbar 1636// progressbar
1643static Evas_Object * 1637static Evas_Object *
1644_widget_progressbar_create(Evas_Object *parent, const char *style2) 1638_widget_progressbar_create(Evas_Object *parent, const char *orig_style EINA_UNUSED, const char *style, const char *processed EINA_UNUSED)
1645{ 1639{
1646 char buf[PATH_MAX] = {0, }; 1640 char buf[PATH_MAX] = {0, };
1647 const char *style; 1641 const char *style2;
1648 Evas_Object *o; 1642 Evas_Object *o;
1649 1643
1650 o = elm_progressbar_add(parent); 1644 o = elm_progressbar_add(parent);
1651 EXPAND(o); FILL(o); 1645 EXPAND(o); FILL(o);
1652 evas_object_show(o); 1646 evas_object_show(o);
1653 1647
1654 strncpy(buf, style2, sizeof(buf) - 1); 1648 strncpy(buf, style, sizeof(buf) - 1);
1655 style = strtok(buf, "/"); 1649 style2 = strtok(buf, "/");
1656 if (!strcmp("vertical", style)) 1650 if (!strcmp("vertical", style2))
1657 elm_progressbar_horizontal_set(o, EINA_FALSE); 1651 elm_progressbar_horizontal_set(o, EINA_FALSE);
1658 style = strtok(NULL, "/"); 1652 style2 = strtok(NULL, "/");
1659 1653
1660 elm_object_style_set(o, style); 1654 elm_object_style_set(o, style2);
1661 elm_object_text_set(o, style); 1655 elm_object_text_set(o, style2);
1662 1656
1663 if (wod) 1657 if (wod)
1664 { 1658 {
@@ -1726,7 +1720,7 @@ _widget_radio_radio_object_create(Evas_Object *box, int value, const char *str,
1726} 1720}
1727 1721
1728static Evas_Object * 1722static Evas_Object *
1729_widget_radio_create(Evas_Object *parent, const char *style) 1723_widget_radio_create(Evas_Object *parent, const char *orig_style EINA_UNUSED, const char *style, const char *processed EINA_UNUSED)
1730{ 1724{
1731 Evas_Object *box, *o; 1725 Evas_Object *box, *o;
1732 1726
@@ -1743,7 +1737,7 @@ _widget_radio_create(Evas_Object *parent, const char *style)
1743 1737
1744// separator 1738// separator
1745static Evas_Object * 1739static Evas_Object *
1746_widget_separator_create(Evas_Object *parent, const char *orig_style) 1740_widget_separator_create(Evas_Object *parent, const char *orig_style, const char *style EINA_UNUSED, const char *processed EINA_UNUSED)
1747{ 1741{
1748 Evas_Object *o; 1742 Evas_Object *o;
1749 1743
@@ -1769,7 +1763,7 @@ _widget_separator_create(Evas_Object *parent, const char *orig_style)
1769 1763
1770// slider 1764// slider
1771static Evas_Object * 1765static Evas_Object *
1772_widget_slider_create(Evas_Object *parent, const char *orig_style, const char *style) 1766_widget_slider_create(Evas_Object *parent, const char *orig_style, const char *style, const char *processed EINA_UNUSED)
1773{ 1767{
1774 Evas_Object *o; 1768 Evas_Object *o;
1775 1769
@@ -1820,7 +1814,7 @@ _widget_slider_create(Evas_Object *parent, const char *orig_style, const char *s
1820 1814
1821// spinner 1815// spinner
1822static Evas_Object * 1816static Evas_Object *
1823_widget_spinner_create(Evas_Object *parent, const char *style) 1817_widget_spinner_create(Evas_Object *parent, const char *orig_style EINA_UNUSED, const char *style, const char *processed EINA_UNUSED)
1824{ 1818{
1825 Evas_Object *o; 1819 Evas_Object *o;
1826 1820
@@ -1843,7 +1837,7 @@ _widget_spinner_create(Evas_Object *parent, const char *style)
1843 1837
1844// thumb 1838// thumb
1845static Evas_Object * 1839static Evas_Object *
1846_widget_thumb_create(Evas_Object *parent, const char *style) 1840_widget_thumb_create(Evas_Object *parent, const char *orig_style EINA_UNUSED, const char *style, const char *processed EINA_UNUSED)
1847{ 1841{
1848 char buf[PATH_MAX]; 1842 char buf[PATH_MAX];
1849 Evas_Object *o; 1843 Evas_Object *o;
@@ -1862,25 +1856,22 @@ _widget_thumb_create(Evas_Object *parent, const char *style)
1862 1856
1863// toolbar 1857// toolbar
1864static Evas_Object * 1858static Evas_Object *
1865_widget_toolbar_create(Evas_Object *parent, const char *orig_style, const char *style) 1859_widget_toolbar_create(Evas_Object *parent, const char *orig_style EINA_UNUSED, const char *style, const char *processed EINA_UNUSED)
1866{ 1860{
1867 Evas_Object *o; 1861 Evas_Object *o;
1868 char style2[PATH_MAX] = {0, };
1869
1870 _trim_end_default(orig_style, style2);
1871 1862
1872 o = elm_toolbar_add(parent); 1863 o = elm_toolbar_add(parent);
1873 EXPAND(o); ALIGN(o, EVAS_HINT_FILL, 0.0); 1864 EXPAND(o); ALIGN(o, EVAS_HINT_FILL, 0.0);
1874 1865
1875 if (!strcmp("item_centered", style)) 1866 if (!strcmp("item/item_centered", style))
1876 elm_object_style_set(o, "item_centered"); 1867 elm_object_style_set(o, "item_centered");
1877 else if (!strcmp("item_horizontal", style)) 1868 else if (!strcmp("item/item_horizontal", style))
1878 elm_object_style_set(o, "item_horizontal"); 1869 elm_object_style_set(o, "item_horizontal");
1879 1870
1880 elm_toolbar_item_append(o, "document-print", "Item 1", NULL, NULL); 1871 elm_toolbar_item_append(o, "document-print", "Item 1", NULL, NULL);
1881 elm_toolbar_item_append(o, "folder-new", "Item 2", NULL, NULL); 1872 elm_toolbar_item_append(o, "folder-new", "Item 2", NULL, NULL);
1882 1873
1883 if (!strcmp("separator", style2)) 1874 if (!strcmp("separator", processed))
1884 { 1875 {
1885 elm_toolbar_item_separator_set(elm_toolbar_item_append(o, NULL, NULL, NULL, NULL), 1876 elm_toolbar_item_separator_set(elm_toolbar_item_append(o, NULL, NULL, NULL, NULL),
1886 EINA_TRUE); 1877 EINA_TRUE);
@@ -1888,7 +1879,7 @@ _widget_toolbar_create(Evas_Object *parent, const char *orig_style, const char *
1888 elm_toolbar_item_append(o, "object-rotate-right", "Item 3", NULL, NULL); 1879 elm_toolbar_item_append(o, "object-rotate-right", "Item 3", NULL, NULL);
1889 elm_toolbar_item_append(o, "clock", "Item 4", NULL, NULL); 1880 elm_toolbar_item_append(o, "clock", "Item 4", NULL, NULL);
1890 1881
1891 if (!strcmp("separator", style2)) 1882 if (!strcmp("separator", processed))
1892 { 1883 {
1893 elm_toolbar_item_separator_set(elm_toolbar_item_append(o, NULL, NULL, NULL, NULL), 1884 elm_toolbar_item_separator_set(elm_toolbar_item_append(o, NULL, NULL, NULL, NULL),
1894 EINA_TRUE); 1885 EINA_TRUE);
@@ -1926,7 +1917,7 @@ _tooltip_content_cb(void *data EINA_UNUSED,
1926 1917
1927// tooltip 1918// tooltip
1928static Evas_Object * 1919static Evas_Object *
1929_widget_tooltip_create(Evas_Object *parent, const char *style) 1920_widget_tooltip_create(Evas_Object *parent, const char *orig_style EINA_UNUSED, const char *style, const char *processed EINA_UNUSED)
1930{ 1921{
1931 Evas_Object *o, *box; 1922 Evas_Object *o, *box;
1932 1923
@@ -2006,7 +1997,7 @@ _widget_win_launch(void *data, Evas_Object *obj EINA_UNUSED,
2006} 1997}
2007 1998
2008static Evas_Object * 1999static Evas_Object *
2009_widget_win_create(Evas_Object *parent EINA_UNUSED, const char *style) 2000_widget_win_create(Evas_Object *parent, const char *orig_style EINA_UNUSED, const char *style, const char *processed EINA_UNUSED)
2010{ 2001{
2011 Evas_Object *o = NULL; 2002 Evas_Object *o = NULL;
2012 o = elm_button_add(parent); 2003 o = elm_button_add(parent);
@@ -2043,6 +2034,56 @@ widget_resize(Evas_Object *o)
2043 } 2034 }
2044} 2035}
2045 2036
2037static struct
2038{
2039 Widget_Create_Cb cb;
2040 const char *(*process_cb)(const char *);
2041
2042} widget_create_cbs[ETV_ID_LAST] =
2043{
2044 [ETV_ID_ACTIONSLIDER] = { .cb = _widget_actionslider_create },
2045 [ETV_ID_ACCESS] = { .cb = _widget_access_create},
2046 [ETV_ID_BG] = { .cb = _widget_bg_create},
2047 [ETV_ID_BORDER] = { .cb = _widget_border_create},
2048 [ETV_ID_BUBBLE] = { .cb = _widget_bubble_create, .process_cb = _trim_end_default},
2049 [ETV_ID_BUTTON] = { .cb = _widget_button_create},
2050 [ETV_ID_CHECK] = { .cb = _widget_check_create},
2051 [ETV_ID_CLOCK] = { .cb = _widget_clock_create},
2052 [ETV_ID_COLORSELECTOR] = { .cb = _widget_colorselector_create},
2053 [ETV_ID_ENTRY] = { .cb = _widget_entry_create, .process_cb = _style_split_2},
2054 [ETV_ID_EWS] = { .cb = _widget_ews_create},
2055 [ETV_ID_FILESELECTOR] = { .cb = _widget_fileselector_create},
2056 [ETV_ID_FILESELECTOR_ENTRY] = { .cb = _widget_fileselector_entry_create},
2057 [ETV_ID_FLIPSELECTOR] = { .cb = _widget_flipselector_create},
2058 [ETV_ID_FOCUS_HIGHLIGHT] = { .cb = _widget_focus_highlight_create},
2059 [ETV_ID_FRAME] = { .cb = _widget_frame_create},
2060 [ETV_ID_GENGRID] = { .cb = _widget_gengrid_create},
2061 [ETV_ID_GENLIST] = { .cb = _widget_genlist_create},
2062 [ETV_ID_HOVER] = { .cb = _widget_hover_create},
2063 [ETV_ID_INDEX] = { .cb = _widget_index_create},
2064 [ETV_ID_ICON] = { .cb = _widget_icon_create, .process_cb = _trim_end_default},
2065 [ETV_ID_LABEL] = { .cb = _widget_label_create},
2066 [ETV_ID_LAYOUT] = { .cb = _widget_layout_create},
2067 [ETV_ID_LIST] = { .cb = _widget_list_create},
2068 [ETV_ID_MENU] = { .cb = _widget_menu_create, .process_cb = _trim_end_default},
2069 [ETV_ID_MULTIBUTTONENTRY] = { .cb = _widget_multibuttonentry_create},
2070 [ETV_ID_NAVIFRAME] = { .cb = _widget_naviframe_create},
2071 [ETV_ID_PANEL] = { .cb = _widget_panel_create, .process_cb = _trim_end_default},
2072 [ETV_ID_PHOTO] = { .cb = _widget_photo_create},
2073 [ETV_ID_PLAYER] = { .cb = _widget_player_create},
2074 [ETV_ID_POINTER] = { .cb = _widget_pointer_create},
2075 [ETV_ID_POPUP] = { .cb = _widget_popup_create},
2076 [ETV_ID_PROGRESSBAR] = { .cb = _widget_progressbar_create},
2077 [ETV_ID_RADIO] = { .cb = _widget_radio_create},
2078 [ETV_ID_SEPARATOR] = { .cb = _widget_separator_create},
2079 [ETV_ID_SLIDER] = { .cb = _widget_slider_create},
2080 [ETV_ID_SPINNER] = { .cb = _widget_spinner_create},
2081 [ETV_ID_THUMB] = { .cb = _widget_thumb_create},
2082 [ETV_ID_TOOLBAR] = { .cb = _widget_toolbar_create, .process_cb = _trim_end_default},
2083 [ETV_ID_TOOLTIP] = { .cb = _widget_tooltip_create},
2084 [ETV_ID_WIN] = { .cb = _widget_win_create},
2085};
2086
2046Evas_Object * 2087Evas_Object *
2047widget_create(Evas_Object *parent, Widget_Type widget, const char *orig_style) 2088widget_create(Evas_Object *parent, Widget_Type widget, const char *orig_style)
2048{ 2089{
@@ -2055,55 +2096,13 @@ widget_create(Evas_Object *parent, Widget_Type widget, const char *orig_style)
2055 if (!style) 2096 if (!style)
2056 style = eina_stringshare_add("default"); 2097 style = eina_stringshare_add("default");
2057 2098
2058#define ADD_WIDGET(name__, id__, style__) \ 2099 if (widget_create_cbs[widget].cb)
2059 else if (widget == id__) \ 2100 {
2060 o = _widget_##name__##_create(parent, style__) 2101 if (widget_create_cbs[widget].process_cb)
2061#define ADD_WIDGET2(name__, id__, style1__, style2__) \ 2102 o = widget_create_cbs[widget].cb(parent, orig_style, orig_style ?: style, widget_create_cbs[widget].process_cb(orig_style ?: style));
2062 else if (widget == id__) \ 2103 else
2063 o = _widget_##name__##_create(parent, style1__, style2__) 2104 o = widget_create_cbs[widget].cb(parent, orig_style, orig_style ?: style, NULL);
2064 2105 }
2065 if (widget == ETV_ID_ACTIONSLIDER)
2066 o = _widget_actionslider_create(parent, style);
2067 ADD_WIDGET(access, ETV_ID_ACCESS, style);
2068 ADD_WIDGET(bg, ETV_ID_BG, style);
2069 ADD_WIDGET(border, ETV_ID_BORDER, style);
2070 ADD_WIDGET(bubble, ETV_ID_BUBBLE, orig_style);
2071 ADD_WIDGET(button, ETV_ID_BUTTON, orig_style);
2072 ADD_WIDGET(check, ETV_ID_CHECK, style);
2073 ADD_WIDGET(clock, ETV_ID_CLOCK, style);
2074 ADD_WIDGET(colorselector, ETV_ID_COLORSELECTOR, style);
2075 ADD_WIDGET2(entry, ETV_ID_ENTRY, orig_style, style);
2076 ADD_WIDGET(ews, ETV_ID_EWS, orig_style);
2077 ADD_WIDGET(fileselector, ETV_ID_FILESELECTOR, style);
2078 ADD_WIDGET(fileselector_entry, ETV_ID_FILESELECTOR_ENTRY, style);
2079 ADD_WIDGET(flipselector, ETV_ID_FLIPSELECTOR, style);
2080 ADD_WIDGET(focus_highlight, ETV_ID_FOCUS_HIGHLIGHT, orig_style);
2081 ADD_WIDGET(frame, ETV_ID_FRAME, style);
2082 ADD_WIDGET2(gengrid, ETV_ID_GENGRID, orig_style, style);
2083 ADD_WIDGET2(genlist, ETV_ID_GENLIST, orig_style, style);
2084 ADD_WIDGET(hover, ETV_ID_HOVER, style);
2085 ADD_WIDGET(index, ETV_ID_INDEX, style);
2086 ADD_WIDGET(icon, ETV_ID_ICON, orig_style);
2087 ADD_WIDGET(label, ETV_ID_LABEL, style);
2088 ADD_WIDGET(layout, ETV_ID_LAYOUT, style);
2089 ADD_WIDGET2(list, ETV_ID_LIST, orig_style, style);
2090 ADD_WIDGET(menu, ETV_ID_MENU, orig_style);
2091 ADD_WIDGET(multibuttonentry, ETV_ID_MULTIBUTTONENTRY, style);
2092 ADD_WIDGET(naviframe, ETV_ID_NAVIFRAME, style);
2093 ADD_WIDGET(panel, ETV_ID_PANEL, orig_style);
2094 ADD_WIDGET(photo, ETV_ID_PHOTO, style);
2095 ADD_WIDGET(player, ETV_ID_PLAYER, style);
2096 ADD_WIDGET(pointer, ETV_ID_POINTER, style);
2097 ADD_WIDGET(popup, ETV_ID_POPUP, style);
2098 ADD_WIDGET(progressbar, ETV_ID_PROGRESSBAR, orig_style);
2099 ADD_WIDGET(radio, ETV_ID_RADIO, style);
2100 ADD_WIDGET(separator, ETV_ID_SEPARATOR, orig_style);
2101 ADD_WIDGET2(slider, ETV_ID_SLIDER, orig_style, style);
2102 ADD_WIDGET(spinner, ETV_ID_SPINNER, style);
2103 ADD_WIDGET(thumb, ETV_ID_THUMB, style);
2104 ADD_WIDGET2(toolbar, ETV_ID_TOOLBAR, orig_style, style);
2105 ADD_WIDGET(tooltip, ETV_ID_TOOLTIP, style);
2106 ADD_WIDGET(win, ETV_ID_WIN, style);
2107 else 2106 else
2108 o = _widget_not_implemented_create(parent, widget); 2107 o = _widget_not_implemented_create(parent, widget);
2109 2108