2 #include "e_mod_main.h"
3 #include "e_mod_config.h"
4 #include "e_mod_comp.h"
6 typedef struct _E_Demo_Style_Item
10 Evas_Object *livethumb;
16 typedef struct _Match_Config
20 char *title, *name, *clas, *role;
21 int borderless, dialog, accepts_focus, vkbd;
22 int quickpanel, argb, fullscreen, modal;
25 struct _E_Config_Dialog_Data
30 int texture_from_pixmap;
33 int fake_image_launch;
39 const char *shadow_style;
50 Evas_Object *popups_il;
51 Evas_Object *borders_il;
52 Evas_Object *overrides_il;
53 Evas_Object *menus_il;
58 int max_unmapped_pixels;
59 int max_unmapped_time;
60 int min_unmapped_time;
68 int fps_average_range;
69 double first_draw_delay;
75 int debug_type_nocomp;
77 int debug_type_effect;
78 int use_efl_native_surface;
82 static void *_create_data(E_Config_Dialog *cfd);
83 static void _free_data(E_Config_Dialog *cfd,
84 E_Config_Dialog_Data *cfdata);
85 static Evas_Object *_basic_create_widgets(E_Config_Dialog *cfd,
87 E_Config_Dialog_Data *cfdata);
88 static int _basic_apply_data(E_Config_Dialog *cfd,
89 E_Config_Dialog_Data *cfdata);
92 e_int_config_comp_module(E_Container *con,
93 const char *params __UNUSED__)
96 E_Config_Dialog_View *v;
100 if (e_config_dialog_find("E", "appearance/comp")) return NULL;
101 v = E_NEW(E_Config_Dialog_View, 1);
104 v->create_cfdata = _create_data;
105 v->free_cfdata = _free_data;
106 v->basic.apply_cfdata = _basic_apply_data;
107 #ifndef _F_DISABLE_E_WIDGET
108 v->basic.create_widgets = _basic_create_widgets;
111 snprintf(buf, sizeof(buf), "%s/e17-mod-tizen-comp.edj",
112 e_module_dir_get(mod->module));
113 cfd = e_config_dialog_new(con, _("Composite Settings"),
114 "E", "appearance/comp", buf, 0, v, mod);
115 mod->config_dialog = cfd;
125 if (m2->match.title) m2->match.title = eina_stringshare_add(m2->match.title);
126 if (m2->match.name) m2->match.name = eina_stringshare_add(m2->match.name);
127 if (m2->match.clas) m2->match.clas = eina_stringshare_add(m2->match.clas);
128 if (m2->match.role) m2->match.role = eina_stringshare_add(m2->match.role);
129 if (m2->match.shadow_style) m2->match.shadow_style = eina_stringshare_add(m2->match.shadow_style);
133 _create_data(E_Config_Dialog *cfd)
135 E_Config_Dialog_Data *cfdata;
140 cfdata = E_NEW(E_Config_Dialog_Data, 1);
142 cfdata->use_shadow = _comp_mod->conf->use_shadow;
143 cfdata->engine = _comp_mod->conf->engine;
144 if ((cfdata->engine != ENGINE_SW) &&
145 (cfdata->engine != ENGINE_GL))
146 cfdata->engine = ENGINE_SW;
147 cfdata->indirect = _comp_mod->conf->indirect;
148 cfdata->texture_from_pixmap = _comp_mod->conf->texture_from_pixmap;
149 cfdata->smooth_windows = _comp_mod->conf->smooth_windows;
150 cfdata->lock_fps = _comp_mod->conf->lock_fps;
151 cfdata->fake_image_launch = _comp_mod->conf->fake_image_launch;
152 cfdata->efl_sync = _comp_mod->conf->efl_sync;
153 cfdata->loose_sync = _comp_mod->conf->loose_sync;
154 cfdata->grab = _comp_mod->conf->grab;
155 cfdata->vsync = _comp_mod->conf->vsync;
156 if (_comp_mod->conf->shadow_style)
157 cfdata->shadow_style = eina_stringshare_add(_comp_mod->conf->shadow_style);
159 cfdata->keep_unmapped = _comp_mod->conf->keep_unmapped;
160 cfdata->max_unmapped_pixels = _comp_mod->conf->max_unmapped_pixels;
161 cfdata->max_unmapped_time = _comp_mod->conf->max_unmapped_time;
162 cfdata->min_unmapped_time = _comp_mod->conf->min_unmapped_time;
163 cfdata->send_flush = _comp_mod->conf->send_flush;
164 cfdata->send_dump = _comp_mod->conf->send_dump;
165 cfdata->nocomp_fs = _comp_mod->conf->nocomp_fs;
166 cfdata->use_hwc = _comp_mod->conf->use_hwc;
168 cfdata->fps_show = _comp_mod->conf->fps_show;
169 cfdata->fps_corner = _comp_mod->conf->fps_corner;
170 cfdata->fps_average_range = _comp_mod->conf->fps_average_range;
171 if (cfdata->fps_average_range < 1) cfdata->fps_average_range = 12;
172 else if (cfdata->fps_average_range > 120)
173 cfdata->fps_average_range = 120;
174 cfdata->first_draw_delay = _comp_mod->conf->first_draw_delay;
176 cfdata->canvas_per_zone = _comp_mod->conf->canvas_per_zone;
177 cfdata->use_hw_ov = _comp_mod->conf->use_hw_ov;
178 cfdata->debug_info_show = _comp_mod->conf->debug_info_show;
179 cfdata->max_debug_msgs = _comp_mod->conf->max_debug_msgs;
180 cfdata->debug_type_nocomp = _comp_mod->conf->debug_type_nocomp;
181 cfdata->debug_type_swap = _comp_mod->conf->debug_type_swap;
182 cfdata->debug_type_effect = _comp_mod->conf->debug_type_effect;
183 cfdata->use_efl_native_surface = _comp_mod->conf->use_efl_native_surface;
185 EINA_LIST_FOREACH(_comp_mod->conf->match.popups, l, m)
187 m2 = E_NEW(Match_Config, 1);
190 cfdata->match.popups = eina_list_append(cfdata->match.popups, m2);
193 EINA_LIST_FOREACH(_comp_mod->conf->match.borders, l, m)
195 m2 = E_NEW(Match_Config, 1);
198 cfdata->match.borders = eina_list_append(cfdata->match.borders, m2);
201 EINA_LIST_FOREACH(_comp_mod->conf->match.overrides, l, m)
203 m2 = E_NEW(Match_Config, 1);
206 cfdata->match.overrides = eina_list_append(cfdata->match.overrides, m2);
209 EINA_LIST_FOREACH(_comp_mod->conf->match.menus, l, m)
211 m2 = E_NEW(Match_Config, 1);
214 cfdata->match.menus = eina_list_append(cfdata->match.menus, m2);
221 _match_free(Match_Config *m)
223 if (m->match.title) eina_stringshare_del(m->match.title);
224 if (m->match.name) eina_stringshare_del(m->match.name);
225 if (m->match.clas) eina_stringshare_del(m->match.clas);
226 if (m->match.role) eina_stringshare_del(m->match.role);
227 if (m->match.shadow_style) eina_stringshare_del(m->match.shadow_style);
228 if (m->title) free(m->title);
229 if (m->name) free(m->name);
230 if (m->clas) free(m->clas);
231 if (m->role) free(m->role);
236 _free_data(E_Config_Dialog *cfd __UNUSED__,
237 E_Config_Dialog_Data *cfdata)
241 _comp_mod->config_dialog = NULL;
242 if (cfdata->shadow_style) eina_stringshare_del(cfdata->shadow_style);
243 EINA_LIST_FREE(cfdata->match.popups, m)
247 EINA_LIST_FREE(cfdata->match.borders, m)
251 EINA_LIST_FREE(cfdata->match.overrides, m)
255 EINA_LIST_FREE(cfdata->match.menus, m)
263 _shadow_changed(void *data,
265 void *event_info __UNUSED__)
267 E_Config_Dialog_Data *cfdata = data;
269 Eina_List *style_list;
270 const E_Demo_Style_Item *it;
273 orec0 = evas_object_name_find(evas_object_evas_get(obj), "style_shadows");
274 style_list = evas_object_data_get(orec0, "list");
275 EINA_LIST_FOREACH(style_list, l, it)
278 if (cfdata->use_shadow)
279 edje_object_signal_emit(it->preview, "e,state,shadow,on", "e");
281 edje_object_signal_emit(it->preview, "e,state,shadow,off", "e");
286 _style_demo(void *data)
288 Eina_List *style_shadows, *l;
290 const E_Demo_Style_Item *it;
292 demo_state = (long)evas_object_data_get(data, "style_demo_state");
293 demo_state = (demo_state + 1) % 4;
294 evas_object_data_set(data, "style_demo_state", (void *)(long)demo_state);
296 style_shadows = evas_object_data_get(data, "style_shadows");
297 EINA_LIST_FOREACH(style_shadows, l, it)
301 Evas_Object *ob = it->preview;
302 Evas_Object *of = it->frame;
307 edje_object_signal_emit(ob, "e,state,visible,on", "e");
308 edje_object_signal_emit(ob, "e,state,focus,on", "e");
309 edje_object_part_text_set(of, "e.text.label", _("Visible"));
313 edje_object_signal_emit(ob, "e,state,focus,off", "e");
314 edje_object_part_text_set(of, "e.text.label", _("Focus-Out"));
318 edje_object_signal_emit(ob, "e,state,focus,on", "e");
319 edje_object_part_text_set(of, "e.text.label", _("Focus-In"));
323 edje_object_signal_emit(ob, "e,state,visible,off", "e");
324 edje_object_part_text_set(of, "e.text.label", _("Hidden"));
331 return ECORE_CALLBACK_RENEW;
335 _style_selector_del(void *data __UNUSED__,
338 void *event_info __UNUSED__)
340 Eina_List *style_shadows, *style_list;
344 orec0 = evas_object_name_find(e, "style_shadows");
345 style_list = evas_object_data_get(orec0, "list");
347 style_shadows = evas_object_data_get(o, "style_shadows");
350 E_Demo_Style_Item *ds_it;
352 EINA_LIST_FREE(style_shadows, ds_it)
354 style_list = eina_list_remove(style_list, ds_it);
356 evas_object_del(ds_it->client);
357 evas_object_del(ds_it->border);
358 evas_object_del(ds_it->frame);
359 evas_object_del(ds_it->preview);
360 evas_object_del(ds_it->layout);
361 evas_object_del(ds_it->livethumb);
364 evas_object_data_set(o, "style_shadows", NULL);
367 timer = evas_object_data_get(o, "style_timer");
370 ecore_timer_del(timer);
371 evas_object_data_set(o, "style_timer", NULL);
374 evas_object_data_set(orec0, "list", style_list);
378 _style_selector(Evas *evas,
382 Evas_Object *oi, *ob, *oo, *obd, *orec, *oly, *orec0;
383 Eina_List *styles, *l, *style_shadows = NULL, *style_list;
390 orec0 = evas_object_name_find(evas, "style_shadows");
391 style_list = evas_object_data_get(orec0, "list");
392 oi = e_widget_ilist_add(evas, 80, 80, source);
393 evas_object_event_callback_add(oi, EVAS_CALLBACK_DEL,
394 _style_selector_del, oi);
396 styles = e_theme_comp_list();
398 EINA_LIST_FOREACH(styles, l, style)
400 E_Demo_Style_Item *ds_it;
403 ds_it = malloc(sizeof(E_Demo_Style_Item));
404 if (!ds_it) continue;
405 #ifndef _F_DISABLE_E_LIVETHUMB
406 ob = e_livethumb_add(evas);
407 ds_it->livethumb = ob;
408 e_livethumb_vsize_set(ob, 240, 240);
410 oly = e_layout_add(e_livethumb_evas_get(ob));
412 e_layout_virtual_size_set(oly, 240, 240);
413 e_livethumb_thumb_set(ob, oly);
414 evas_object_show(oly);
416 oo = edje_object_add(e_livethumb_evas_get(ob));
418 snprintf(buf, sizeof(buf), "e/comp/%s", style);
419 e_theme_edje_object_set(oo, "base/theme/borders", buf);
420 e_layout_pack(oly, oo);
421 e_layout_child_move(oo, 39, 39);
422 e_layout_child_resize(oo, 162, 162);
423 if (use_shadow) edje_object_signal_emit(oo, "e,state,shadow,on", "e");
424 edje_object_signal_emit(oo, "e,state,visible,on", "e");
425 evas_object_show(oo);
428 ds_it->frame = edje_object_add(evas);
429 e_theme_edje_object_set
430 (ds_it->frame, "base/theme/modules/comp", "e/modules/comp/preview");
431 edje_object_part_swallow(ds_it->frame, "e.swallow.preview", ob);
432 evas_object_show(ds_it->frame);
433 style_shadows = eina_list_append(style_shadows, ds_it);
435 #ifndef _F_DISABLE_E_LIVETHUMB
437 obd = edje_object_add(e_livethumb_evas_get(ob));
439 e_theme_edje_object_set(obd, "base/theme/borders",
440 "e/widgets/border/default/border");
441 edje_object_part_text_set(obd, "e.text.title", _("Title"));
442 edje_object_signal_emit(obd, "e,state,focused", "e");
443 edje_object_part_swallow(oo, "e.swallow.content", obd);
444 evas_object_show(obd);
446 orec = evas_object_rectangle_add(e_livethumb_evas_get(ob));
447 ds_it->client = orec;
448 evas_object_color_set(orec, 255, 255, 255, 255);
449 edje_object_part_swallow(obd, "e.swallow.client", orec);
450 evas_object_show(orec);
452 e_widget_ilist_append(oi, ds_it->frame, style, NULL, NULL, style);
453 evas_object_show(ob);
457 if (!strcmp(*source, style)) sel = n;
461 style_list = eina_list_append(style_list, ds_it);
463 evas_object_data_set(orec0, "list", style_list);
464 evas_object_data_set(oi, "style_shadows", style_shadows);
465 timer = ecore_timer_add(3.0, _style_demo, oi);
466 evas_object_data_set(oi, "style_timer", timer);
467 evas_object_data_set(oi, "style_demo_state", (void *)1);
468 e_widget_size_min_get(oi, &wmw, &wmh);
469 e_widget_size_min_set(oi, 160, 100);
470 e_widget_ilist_selected_set(oi, sel);
471 e_widget_ilist_go(oi);
473 EINA_LIST_FREE(styles, str)
474 eina_stringshare_del(str);
480 _match_sel(void *data __UNUSED__)
482 // Match_Config *m = data;
483 // E_Config_Dialog *cfd = m->cfd;
487 _match_type_label_get(int type)
489 if (ECORE_X_WINDOW_TYPE_UNKNOWN == type)
491 if (ECORE_X_WINDOW_TYPE_COMBO == type)
493 if (ECORE_X_WINDOW_TYPE_DESKTOP == type)
495 if (ECORE_X_WINDOW_TYPE_DIALOG == type)
497 if (ECORE_X_WINDOW_TYPE_DOCK == type)
499 if (ECORE_X_WINDOW_TYPE_DND == type)
500 return _("Drag and Drop");
501 if (ECORE_X_WINDOW_TYPE_MENU == type)
503 if (ECORE_X_WINDOW_TYPE_DROPDOWN_MENU == type)
504 return _("Menu (Dropdown)");
505 if (ECORE_X_WINDOW_TYPE_POPUP_MENU == type)
506 return _("Menu (Popup)");
507 if (ECORE_X_WINDOW_TYPE_NORMAL == type)
509 if (ECORE_X_WINDOW_TYPE_NOTIFICATION == type)
510 return _("Notification");
511 if (ECORE_X_WINDOW_TYPE_SPLASH == type)
513 if (ECORE_X_WINDOW_TYPE_TOOLBAR == type)
515 if (ECORE_X_WINDOW_TYPE_TOOLTIP == type)
517 if (ECORE_X_WINDOW_TYPE_UTILITY == type)
524 _match_label_get(Match_Config *m)
527 Eina_Strbuf *buf = eina_strbuf_new();
531 eina_strbuf_append(buf, _("Title:"));
532 eina_strbuf_append(buf, m->match.title);
533 eina_strbuf_append(buf, _(" / "));
535 if (m->match.primary_type)
537 eina_strbuf_append(buf, _("Type:"));
538 eina_strbuf_append(buf, _match_type_label_get(m->match.primary_type));
539 eina_strbuf_append(buf, _(" / "));
543 eina_strbuf_append(buf, _("Name:"));
544 eina_strbuf_append(buf, m->match.name);
545 eina_strbuf_append(buf, _(" / "));
549 eina_strbuf_append(buf, _("Class:"));
550 eina_strbuf_append(buf, m->match.clas);
551 eina_strbuf_append(buf, _(" / "));
555 eina_strbuf_append(buf, _("Role:"));
556 eina_strbuf_append(buf, m->match.role);
557 eina_strbuf_append(buf, _(" / "));
559 if (m->match.shadow_style)
561 eina_strbuf_append(buf, _("Style:"));
562 eina_strbuf_append(buf, m->match.shadow_style);
565 if (!eina_strbuf_length_get(buf))
567 eina_strbuf_free(buf);
571 label = strdup(eina_strbuf_string_get(buf));
572 eina_strbuf_free(buf);
578 _match_ilist_append(Evas_Object *il,
583 char *name = _match_label_get(m);
586 e_widget_ilist_append(il, NULL, name, _match_sel, m, NULL);
590 e_widget_ilist_prepend_relative(il, NULL, name, _match_sel, m, NULL, pos);
592 e_widget_ilist_append_relative(il, NULL, name, _match_sel, m, NULL, pos);
598 _match_list_up(Eina_List **list,
603 l = eina_list_data_find_list(*list, m);
606 *list = eina_list_remove_list(*list, l);
607 if (lp) *list = eina_list_prepend_relative_list(*list, m, lp);
608 else *list = eina_list_prepend(*list, m);
612 _match_list_down(Eina_List **list,
617 l = eina_list_data_find_list(*list, m);
620 *list = eina_list_remove_list(*list, l);
621 if (lp) *list = eina_list_append_relative_list(*list, m, lp);
622 else *list = eina_list_append(*list, m);
626 _match_list_del(Eina_List **list,
631 if (!m) return EINA_FALSE;
632 l = eina_list_data_find_list(*list, m);
633 if (!l) return EINA_FALSE;
635 *list = eina_list_remove_list(*list, l);
641 _cb_dialog_resize(void *data,
644 void *event_info __UNUSED__)
646 Evas_Object *bg, *of;
650 bg = evas_object_data_get(of, "bg");
651 evas_object_geometry_get(obj, &x, &y, &w, &h);
653 evas_object_move(bg, x, y);
654 evas_object_resize(bg, w, h);
655 evas_object_move(of, x, y);
656 evas_object_resize(of, w, h);
663 Match_Config *m = d1;
664 Evas_Object *dia, *bg, *of = d2;
669 if (m->match.title) eina_stringshare_del(m->match.title);
670 m->match.title = NULL;
673 if (m->title[0]) m->match.title = eina_stringshare_add(m->title);
677 if (m->match.name) eina_stringshare_del(m->match.name);
678 m->match.name = NULL;
681 if (m->name[0]) m->match.name = eina_stringshare_add(m->name);
685 if (m->match.clas) eina_stringshare_del(m->match.clas);
686 m->match.clas = NULL;
689 if (m->clas[0]) m->match.clas = eina_stringshare_add(m->clas);
693 if (m->match.role) eina_stringshare_del(m->match.role);
694 m->match.role = NULL;
697 if (m->role[0]) m->match.role = eina_stringshare_add(m->role);
701 m->match.borderless = m->borderless;
702 m->match.dialog = m->dialog;
703 m->match.accepts_focus = m->accepts_focus;
704 m->match.vkbd = m->vkbd;
705 m->match.quickpanel = m->quickpanel;
706 m->match.argb = m->argb;
707 m->match.fullscreen = m->fullscreen;
708 m->match.modal = m->modal;
710 il = m->cfd->cfdata->edit_il;
711 n = e_widget_ilist_selected_get(il);
712 label = _match_label_get(m);
713 e_widget_ilist_nth_label_set(il, n, label);
715 bg = evas_object_data_get(of, "bg");
716 dia = evas_object_data_get(of, "dia");
718 evas_object_event_callback_del(dia, EVAS_CALLBACK_RESIZE, _cb_dialog_resize);
724 _create_edit_frame(E_Config_Dialog *cfd,
726 E_Config_Dialog_Data *cfdata,
729 Evas_Object *of, *oi, *lb, *en, *bt, *tb, *tab2, *o, *sf, *li;
734 o = edje_object_add(evas);
735 e_theme_edje_object_set(o, "base/theme/dialog", "e/widgets/dialog/main");
736 evas_object_geometry_get(cfd->dia->bg_object, &x, &y, &w, &h);
737 evas_object_move(o, x, y);
738 evas_object_resize(o, w, h);
741 of = e_widget_frametable_add(evas, _("Edit Match"), 0);
742 evas_object_data_set(of, "bg", o);
743 evas_object_data_set(of, "dia", cfd->dia->bg_object);
744 evas_object_move(of, x, y);
745 evas_object_resize(of, w, h);
746 evas_object_show(of);
748 evas_object_event_callback_add(cfd->dia->bg_object, EVAS_CALLBACK_RESIZE,
749 _cb_dialog_resize, of);
751 tb = e_widget_toolbook_add(evas, 48 * e_scale, 48 * e_scale);
753 tab2 = e_widget_table_add(evas, 0);
754 if (cfdata->edit_il == cfdata->borders_il)
756 if (m->match.title) m->title = strdup(m->match.title);
757 else m->title = NULL;
758 lb = e_widget_label_add(evas, _("Title"));
759 e_widget_table_object_append(tab2, lb, 0, 0, 1, 1, 1, 0, 0, 0);
760 en = e_widget_entry_add(evas, &(m->title), NULL, NULL, NULL);
761 e_widget_table_object_append(tab2, en, 1, 0, 1, 1, 1, 0, 1, 0);
763 if ((cfdata->edit_il == cfdata->borders_il) ||
764 (cfdata->edit_il == cfdata->overrides_il) ||
765 (cfdata->edit_il == cfdata->popups_il))
767 if (m->match.name) m->name = strdup(m->match.name);
769 lb = e_widget_label_add(evas, _("Name"));
770 e_widget_table_object_append(tab2, lb, 0, 1, 1, 1, 1, 0, 0, 0);
771 en = e_widget_entry_add(evas, &(m->name), NULL, NULL, NULL);
772 e_widget_table_object_append(tab2, en, 1, 1, 1, 1, 1, 0, 1, 0);
774 if ((cfdata->edit_il == cfdata->borders_il) ||
775 (cfdata->edit_il == cfdata->overrides_il))
777 if (m->match.clas) m->clas = strdup(m->match.clas);
779 lb = e_widget_label_add(evas, _("Class"));
780 e_widget_table_object_append(tab2, lb, 0, 2, 1, 1, 1, 0, 0, 0);
781 en = e_widget_entry_add(evas, &(m->clas), NULL, NULL, NULL);
782 e_widget_table_object_append(tab2, en, 1, 2, 1, 1, 1, 0, 1, 0);
784 if (cfdata->edit_il == cfdata->borders_il)
786 if (m->match.role) m->role = strdup(m->match.role);
788 lb = e_widget_label_add(evas, _("Role"));
789 e_widget_table_object_append(tab2, lb, 0, 3, 1, 1, 1, 0, 0, 0);
790 en = e_widget_entry_add(evas, &(m->role), NULL, NULL, NULL);
791 e_widget_table_object_append(tab2, en, 1, 3, 1, 1, 1, 0, 1, 0);
793 e_widget_toolbook_page_append(tb, NULL, _("Names"), tab2, 1, 1, 1, 1, 0.5, 0.0);
795 if ((cfdata->edit_il == cfdata->borders_il) ||
796 (cfdata->edit_il == cfdata->overrides_il))
800 rg = e_widget_radio_group_new(&m->match.primary_type);
802 li = e_widget_list_add(evas, 1, 0);
804 o = e_widget_radio_add(evas, _("Unused"), ECORE_X_WINDOW_TYPE_UNKNOWN, rg);
805 e_widget_list_object_append(li, o, 1, 0, 0.0);
807 o = e_widget_radio_add(evas, _("Combo"), ECORE_X_WINDOW_TYPE_COMBO, rg);
808 e_widget_list_object_append(li, o, 1, 0, 0.0);
809 o = e_widget_radio_add(evas, _("Desktop"), ECORE_X_WINDOW_TYPE_DESKTOP, rg);
810 e_widget_list_object_append(li, o, 1, 0, 0.0);
811 o = e_widget_radio_add(evas, _("Dialog"), ECORE_X_WINDOW_TYPE_DIALOG, rg);
812 e_widget_list_object_append(li, o, 1, 0, 0.0);
813 o = e_widget_radio_add(evas, _("Dock"), ECORE_X_WINDOW_TYPE_DOCK, rg);
814 e_widget_list_object_append(li, o, 1, 0, 0.0);
815 o = e_widget_radio_add(evas, _("Drag and Drop"), ECORE_X_WINDOW_TYPE_DND, rg);
816 e_widget_list_object_append(li, o, 1, 0, 0.0);
817 o = e_widget_radio_add(evas, _("Menu"), ECORE_X_WINDOW_TYPE_MENU, rg);
818 e_widget_list_object_append(li, o, 1, 0, 0.0);
819 o = e_widget_radio_add(evas, _("Menu (Dropdown)"), ECORE_X_WINDOW_TYPE_DROPDOWN_MENU, rg);
820 e_widget_list_object_append(li, o, 1, 0, 0.0);
821 o = e_widget_radio_add(evas, _("Menu (Popup)"), ECORE_X_WINDOW_TYPE_POPUP_MENU, rg);
822 e_widget_list_object_append(li, o, 1, 0, 0.0);
823 o = e_widget_radio_add(evas, _("Normal"), ECORE_X_WINDOW_TYPE_NORMAL, rg);
824 e_widget_list_object_append(li, o, 1, 0, 0.0);
825 o = e_widget_radio_add(evas, _("Notification"), ECORE_X_WINDOW_TYPE_NOTIFICATION, rg);
826 e_widget_list_object_append(li, o, 1, 0, 0.0);
827 o = e_widget_radio_add(evas, _("Splash"), ECORE_X_WINDOW_TYPE_SPLASH, rg);
828 e_widget_list_object_append(li, o, 1, 0, 0.0);
829 o = e_widget_radio_add(evas, _("Toolbar"), ECORE_X_WINDOW_TYPE_TOOLBAR, rg);
830 e_widget_list_object_append(li, o, 1, 0, 0.0);
831 o = e_widget_radio_add(evas, _("Tooltip"), ECORE_X_WINDOW_TYPE_TOOLTIP, rg);
832 e_widget_list_object_append(li, o, 1, 0, 0.0);
833 o = e_widget_radio_add(evas, _("Utility"), ECORE_X_WINDOW_TYPE_UTILITY, rg);
834 e_widget_list_object_append(li, o, 1, 0, 0.0);
836 e_widget_size_min_get(li, &mw, &mh);
837 evas_object_resize(li, mw, mh);
839 sf = e_widget_scrollframe_simple_add(evas, li);
840 e_widget_toolbook_page_append(tb, NULL, _("Types"), sf,
841 1, 1, 1, 1, 0.5, 0.0);
844 m->borderless = m->match.borderless;
845 m->dialog = m->match.dialog;
846 m->accepts_focus = m->match.accepts_focus;
847 m->vkbd = m->match.vkbd;
848 m->quickpanel = m->match.quickpanel;
849 m->argb = m->match.argb;
850 m->fullscreen = m->match.fullscreen;
851 m->modal = m->match.modal;
854 tab2 = e_widget_table_add(evas, 0);
855 lb = e_widget_label_add(evas, _("Unused"));
856 e_widget_table_object_append(tab2, lb, 1, row, 1, 1, 0, 0, 0, 0);
857 lb = e_widget_label_add(evas, _("On"));
858 e_widget_table_object_append(tab2, lb, 2, row, 1, 1, 0, 0, 0, 0);
859 lb = e_widget_label_add(evas, _("Off"));
860 e_widget_table_object_append(tab2, lb, 3, row, 1, 1, 0, 0, 0, 0);
863 if (cfdata->edit_il == cfdata->borders_il)
865 lb = e_widget_label_add(evas, _("Borderless"));
866 e_widget_table_object_append(tab2, lb, 0, row, 1, 1, 1, 0, 1, 0);
867 rg = e_widget_radio_group_new(&m->borderless);
868 o = e_widget_radio_add(evas, NULL, 0, rg);
869 e_widget_table_object_append(tab2, o, 1, row, 1, 1, 0, 0, 0, 0);
870 o = e_widget_radio_add(evas, NULL, 1, rg);
871 e_widget_table_object_append(tab2, o, 2, row, 1, 1, 0, 0, 0, 0);
872 o = e_widget_radio_add(evas, NULL, -1, rg);
873 e_widget_table_object_append(tab2, o, 3, row, 1, 1, 0, 0, 0, 0);
876 if (cfdata->edit_il == cfdata->borders_il)
878 lb = e_widget_label_add(evas, _("Dialog"));
879 e_widget_table_object_append(tab2, lb, 0, row, 1, 1, 1, 0, 1, 0);
880 rg = e_widget_radio_group_new(&m->dialog);
881 o = e_widget_radio_add(evas, NULL, 0, rg);
882 e_widget_table_object_append(tab2, o, 1, row, 1, 1, 0, 0, 0, 0);
883 o = e_widget_radio_add(evas, NULL, 1, rg);
884 e_widget_table_object_append(tab2, o, 2, row, 1, 1, 0, 0, 0, 0);
885 o = e_widget_radio_add(evas, NULL, -1, rg);
886 e_widget_table_object_append(tab2, o, 3, row, 1, 1, 0, 0, 0, 0);
889 if (cfdata->edit_il == cfdata->borders_il)
891 lb = e_widget_label_add(evas, _("Accepts Focus"));
892 e_widget_table_object_append(tab2, lb, 0, row, 1, 1, 1, 0, 1, 0);
893 rg = e_widget_radio_group_new(&m->accepts_focus);
894 o = e_widget_radio_add(evas, NULL, 0, rg);
895 e_widget_table_object_append(tab2, o, 1, row, 1, 1, 0, 0, 0, 0);
896 o = e_widget_radio_add(evas, NULL, 1, rg);
897 e_widget_table_object_append(tab2, o, 2, row, 1, 1, 0, 0, 0, 0);
898 o = e_widget_radio_add(evas, NULL, -1, rg);
899 e_widget_table_object_append(tab2, o, 3, row, 1, 1, 0, 0, 0, 0);
902 if (cfdata->edit_il == cfdata->borders_il)
904 lb = e_widget_label_add(evas, _("Virtual Keyboard"));
905 e_widget_table_object_append(tab2, lb, 0, row, 1, 1, 1, 0, 1, 0);
906 rg = e_widget_radio_group_new(&m->vkbd);
907 o = e_widget_radio_add(evas, NULL, 0, rg);
908 e_widget_table_object_append(tab2, o, 1, row, 1, 1, 0, 0, 0, 0);
909 o = e_widget_radio_add(evas, NULL, 1, rg);
910 e_widget_table_object_append(tab2, o, 2, row, 1, 1, 0, 0, 0, 0);
911 o = e_widget_radio_add(evas, NULL, -1, rg);
912 e_widget_table_object_append(tab2, o, 3, row, 1, 1, 0, 0, 0, 0);
915 if (cfdata->edit_il == cfdata->borders_il)
917 lb = e_widget_label_add(evas, _("Quick Panel"));
918 e_widget_table_object_append(tab2, lb, 0, row, 1, 1, 1, 0, 1, 0);
919 rg = e_widget_radio_group_new(&m->quickpanel);
920 o = e_widget_radio_add(evas, NULL, 0, rg);
921 e_widget_table_object_append(tab2, o, 1, row, 1, 1, 0, 0, 0, 0);
922 o = e_widget_radio_add(evas, NULL, 1, rg);
923 e_widget_table_object_append(tab2, o, 2, row, 1, 1, 0, 0, 0, 0);
924 o = e_widget_radio_add(evas, NULL, -1, rg);
925 e_widget_table_object_append(tab2, o, 3, row, 1, 1, 0, 0, 0, 0);
928 lb = e_widget_label_add(evas, _("ARGB"));
929 e_widget_table_object_append(tab2, lb, 0, row, 1, 1, 1, 0, 1, 0);
930 rg = e_widget_radio_group_new(&m->argb);
931 o = e_widget_radio_add(evas, NULL, 0, rg);
932 e_widget_table_object_append(tab2, o, 1, row, 1, 1, 0, 0, 0, 0);
933 o = e_widget_radio_add(evas, NULL, 1, rg);
934 e_widget_table_object_append(tab2, o, 2, row, 1, 1, 0, 0, 0, 0);
935 o = e_widget_radio_add(evas, NULL, -1, rg);
936 e_widget_table_object_append(tab2, o, 3, row, 1, 1, 0, 0, 0, 0);
938 if (cfdata->edit_il == cfdata->borders_il)
940 lb = e_widget_label_add(evas, _("Fullscreen"));
941 e_widget_table_object_append(tab2, lb, 0, row, 1, 1, 1, 0, 1, 0);
942 rg = e_widget_radio_group_new(&m->fullscreen);
943 o = e_widget_radio_add(evas, NULL, 0, rg);
944 e_widget_table_object_append(tab2, o, 1, row, 1, 1, 0, 0, 0, 0);
945 o = e_widget_radio_add(evas, NULL, 1, rg);
946 e_widget_table_object_append(tab2, o, 2, row, 1, 1, 0, 0, 0, 0);
947 o = e_widget_radio_add(evas, NULL, -1, rg);
948 e_widget_table_object_append(tab2, o, 3, row, 1, 1, 0, 0, 0, 0);
951 if (cfdata->edit_il == cfdata->borders_il)
953 lb = e_widget_label_add(evas, _("Modal"));
954 e_widget_table_object_append(tab2, lb, 0, row, 1, 1, 1, 0, 1, 0);
955 rg = e_widget_radio_group_new(&m->modal);
956 o = e_widget_radio_add(evas, NULL, 0, rg);
957 e_widget_table_object_append(tab2, o, 1, row, 1, 1, 0, 0, 0, 0);
958 o = e_widget_radio_add(evas, NULL, 1, rg);
959 e_widget_table_object_append(tab2, o, 2, row, 1, 1, 0, 0, 0, 0);
960 o = e_widget_radio_add(evas, NULL, -1, rg);
961 e_widget_table_object_append(tab2, o, 3, row, 1, 1, 0, 0, 0, 0);
964 e_widget_toolbook_page_append(tb, NULL, _("Flags"), tab2,
965 1, 1, 1, 1, 0.5, 0.0);
967 oi = _style_selector(evas, cfdata->use_shadow, &(m->match.shadow_style));
968 e_widget_toolbook_page_append(tb, NULL, _("Style"), oi,
969 1, 1, 1, 1, 0.5, 0.0);
971 e_widget_frametable_object_append(of, tb, 0, 0, 1, 1, 1, 1, 1, 1);
972 e_widget_toolbook_page_show(tb, 0);
974 bt = e_widget_button_add(evas, _("OK"), NULL, _edit_ok, m, of);
975 e_widget_frametable_object_append(of, bt, 0, 1, 1, 1, 0, 0, 0, 0);
982 E_Config_Dialog *cfd = d1;
983 Evas_Object *il = d2;
987 e_widget_ilist_freeze(il);
988 n = e_widget_ilist_selected_get(il);
990 m = e_widget_ilist_nth_data_get(il, n);
993 e_widget_ilist_thaw(il);
996 e_widget_ilist_remove_num(il, n);
998 _match_ilist_append(il, m, n, 1);
999 e_widget_ilist_nth_show(il, n, 0);
1000 e_widget_ilist_selected_set(il, n);
1001 e_widget_ilist_thaw(il);
1002 e_widget_ilist_go(il);
1003 _match_list_up(&(cfd->cfdata->match.popups), m);
1004 _match_list_up(&(cfd->cfdata->match.borders), m);
1005 _match_list_up(&(cfd->cfdata->match.overrides), m);
1006 _match_list_up(&(cfd->cfdata->match.menus), m);
1007 cfd->cfdata->match.changed = 1;
1014 E_Config_Dialog *cfd = d1;
1015 Evas_Object *il = d2;
1019 e_widget_ilist_freeze(il);
1020 n = e_widget_ilist_selected_get(il);
1021 if (n >= (e_widget_ilist_count(il) - 1)) return;
1022 m = e_widget_ilist_nth_data_get(il, n);
1025 e_widget_ilist_thaw(il);
1028 e_widget_ilist_remove_num(il, n);
1029 _match_ilist_append(il, m, n, 0);
1030 e_widget_ilist_nth_show(il, n + 1, 0);
1031 e_widget_ilist_selected_set(il, n + 1);
1032 e_widget_ilist_thaw(il);
1033 e_widget_ilist_go(il);
1034 _match_list_down(&(cfd->cfdata->match.popups), m);
1035 _match_list_down(&(cfd->cfdata->match.borders), m);
1036 _match_list_down(&(cfd->cfdata->match.overrides), m);
1037 _match_list_down(&(cfd->cfdata->match.menus), m);
1038 cfd->cfdata->match.changed = 1;
1045 E_Config_Dialog *cfd = d1;
1046 Evas_Object *il = d2;
1050 m = E_NEW(Match_Config, 1);
1054 m->match.title = NULL;
1055 m->match.name = NULL;
1056 m->match.clas = NULL;
1057 m->match.role = NULL;
1058 m->match.shadow_style = eina_stringshare_add("default");
1060 if (il == cfd->cfdata->popups_il)
1061 cfd->cfdata->match.popups = eina_list_append(cfd->cfdata->match.popups, m);
1062 else if (il == cfd->cfdata->borders_il)
1063 cfd->cfdata->match.borders = eina_list_append(cfd->cfdata->match.borders, m);
1064 else if (il == cfd->cfdata->overrides_il)
1065 cfd->cfdata->match.overrides = eina_list_append(cfd->cfdata->match.overrides, m);
1066 else if (il == cfd->cfdata->menus_il)
1067 cfd->cfdata->match.menus = eina_list_append(cfd->cfdata->match.menus, m);
1070 e_widget_ilist_freeze(il);
1073 _match_ilist_append(il, m, -1, 0);
1074 e_widget_ilist_thaw(il);
1075 e_widget_ilist_go(il);
1076 n = e_widget_ilist_count(il);
1077 e_widget_ilist_nth_show(il, n - 1, 0);
1078 e_widget_ilist_selected_set(il, n - 1);
1080 cfd->cfdata->edit_il = il;
1082 _create_edit_frame(cfd, evas_object_evas_get(il), cfd->cfdata, m);
1083 cfd->cfdata->match.changed = 1;
1090 E_Config_Dialog *cfd = d1;
1091 Evas_Object *il = d2;
1095 e_widget_ilist_freeze(il);
1096 n = e_widget_ilist_selected_get(il);
1097 m = e_widget_ilist_nth_data_get(il, n);
1100 e_widget_ilist_thaw(il);
1103 e_widget_ilist_remove_num(il, n);
1104 e_widget_ilist_thaw(il);
1105 e_widget_ilist_go(il);
1106 if(_match_list_del(&(cfd->cfdata->match.popups), m)) m = NULL;
1107 if(_match_list_del(&(cfd->cfdata->match.borders), m)) m = NULL;
1108 if(_match_list_del(&(cfd->cfdata->match.overrides), m)) m = NULL;
1109 if(_match_list_del(&(cfd->cfdata->match.menus), m)) m = NULL;
1110 cfd->cfdata->match.changed = 1;
1117 E_Config_Dialog *cfd = d1;
1118 Evas_Object *il = d2;
1122 n = e_widget_ilist_selected_get(il);
1123 m = e_widget_ilist_nth_data_get(il, n);
1126 cfd->cfdata->edit_il = il;
1127 _create_edit_frame(cfd, evas_object_evas_get(il), cfd->cfdata, m);
1128 cfd->cfdata->match.changed = 1;
1131 static Evas_Object *
1132 _create_match_editor(E_Config_Dialog *cfd,
1134 E_Config_Dialog_Data *cfdata __UNUSED__,
1135 Eina_List **matches,
1136 Evas_Object **il_ret)
1138 Evas_Object *tab, *il, *bt;
1142 tab = e_widget_table_add(evas, 0);
1144 il = e_widget_ilist_add(evas, 16, 16, NULL);
1145 e_widget_size_min_set(il, 160, 100);
1147 EINA_LIST_FOREACH(*matches, l, m)
1149 _match_ilist_append(il, m, -1, 0);
1152 e_widget_ilist_go(il);
1153 e_widget_table_object_append(tab, il, 0, 0, 1, 5, 1, 1, 1, 1);
1155 bt = e_widget_button_add(evas, _("Up"), NULL, _but_up, cfd, il);
1156 e_widget_table_object_append(tab, bt, 1, 0, 1, 1, 1, 1, 0, 0);
1157 bt = e_widget_button_add(evas, _("Down"), NULL, _but_down, cfd, il);
1158 e_widget_table_object_append(tab, bt, 1, 1, 1, 1, 1, 1, 0, 0);
1159 bt = e_widget_button_add(evas, _("Add"), NULL, _but_add, cfd, il);
1160 e_widget_table_object_append(tab, bt, 1, 2, 1, 1, 1, 1, 0, 0);
1161 bt = e_widget_button_add(evas, _("Del"), NULL, _but_del, cfd, il);
1162 e_widget_table_object_append(tab, bt, 1, 3, 1, 1, 1, 1, 0, 0);
1163 bt = e_widget_button_add(evas, _("Edit"), NULL, _but_edit, cfd, il);
1164 e_widget_table_object_append(tab, bt, 1, 4, 1, 1, 1, 1, 0, 0);
1171 static Evas_Object *
1172 _create_styles_toolbook(E_Config_Dialog *cfd,
1174 E_Config_Dialog_Data *cfdata)
1176 Evas_Object *tb, *oi, *il;
1178 tb = e_widget_toolbook_add(evas, 48 * e_scale, 48 * e_scale);
1180 oi = _style_selector(evas, cfdata->use_shadow, &(cfdata->shadow_style));
1181 e_widget_toolbook_page_append(tb, NULL, _("Default"), oi, 1, 1, 1, 1, 0.5, 0.0);
1183 oi = _create_match_editor(cfd, evas, cfdata, &(cfdata->match.borders), &il);
1184 cfdata->borders_il = il;
1185 e_widget_toolbook_page_append(tb, NULL, _("Apps"), oi, 1, 1, 1, 1, 0.5, 0.0);
1187 oi = _create_match_editor(cfd, evas, cfdata, &(cfdata->match.popups), &il);
1188 cfdata->popups_il = il;
1189 e_widget_toolbook_page_append(tb, NULL, _("E"), oi, 1, 1, 1, 1, 0.5, 0.0);
1191 oi = _create_match_editor(cfd, evas, cfdata, &(cfdata->match.overrides), &il);
1192 cfdata->overrides_il = il;
1193 e_widget_toolbook_page_append(tb, NULL, _("Over"), oi, 1, 1, 1, 1, 0.5, 0.0);
1195 oi = _create_match_editor(cfd, evas, cfdata, &(cfdata->match.menus), &il);
1196 cfdata->menus_il = il;
1197 e_widget_toolbook_page_append(tb, NULL, _("Menus"), oi, 1, 1, 1, 1, 0.5, 0.0);
1199 e_widget_toolbook_page_show(tb, 0);
1204 static Evas_Object *
1205 _basic_create_widgets(E_Config_Dialog *cfd,
1207 E_Config_Dialog_Data *cfdata)
1209 Evas_Object *ob, *ol, *ol2, *of, *otb, *oi, *orec0, *tab;
1212 orec0 = evas_object_rectangle_add(evas);
1213 evas_object_name_set(orec0, "style_shadows");
1215 tab = e_widget_table_add(evas, 0);
1216 evas_object_name_set(tab, "dia_table");
1218 otb = e_widget_toolbook_add(evas, 48 * e_scale, 48 * e_scale);
1219 #ifndef _F_DISABLE_E_WIDGET
1220 ol = e_widget_list_add(evas, 0, 0);
1221 ob = e_widget_check_add(evas, _("Shadows"), &(cfdata->use_shadow));
1222 evas_object_smart_callback_add(ob, "changed", _shadow_changed, cfdata);
1223 e_widget_list_object_append(ol, ob, 1, 0, 0.5);
1224 ob = e_widget_check_add(evas, _("Limit framerate"), &(cfdata->lock_fps));
1225 e_widget_list_object_append(ol, ob, 1, 0, 0.5);
1226 ob = e_widget_check_add(evas, _("Smooth scaling"), &(cfdata->smooth_windows));
1227 e_widget_list_object_append(ol, ob, 1, 0, 0.5);
1228 ob = e_widget_check_add(evas, _("Fake image launch"), &(cfdata->fake_image_launch));
1229 e_widget_list_object_append(ol, ob, 1, 0, 0.5);
1231 of = e_widget_frametable_add(evas, _("Styles"), 0);
1232 e_widget_frametable_content_align_set(of, 0.5, 0.5);
1233 oi = _create_styles_toolbook(cfd, evas, cfdata);
1234 e_widget_frametable_object_append(of, oi, 0, 0, 1, 1, 1, 1, 1, 1);
1235 e_widget_list_object_append(ol, of, 1, 1, 0.5);
1237 e_widget_toolbook_page_append(otb, NULL, _("Effects"), ol, 1, 1, 1, 1, 0.5, 0.0);
1239 ///////////////////////////////////////////
1240 ol = e_widget_list_add(evas, 0, 0);
1241 ob = e_widget_check_add(evas, _("Sync screen (VBlank)"), &(cfdata->vsync));
1242 e_widget_list_object_append(ol, ob, 1, 1, 0.5);
1243 ob = e_widget_check_add(evas, _("Sync windows"), &(cfdata->efl_sync));
1244 e_widget_list_object_append(ol, ob, 1, 1, 0.5);
1245 ob = e_widget_check_add(evas, _("Loose sync"), &(cfdata->loose_sync));
1246 e_widget_list_object_append(ol, ob, 1, 1, 0.5);
1247 ob = e_widget_check_add(evas, _("Grab Server during draw"), &(cfdata->grab));
1248 e_widget_list_object_append(ol, ob, 1, 1, 0.5);
1249 ob = e_widget_label_add(evas, _("Initial draw timeout for newly mapped windows"));
1250 e_widget_list_object_append(ol, ob, 1, 1, 0.5);
1251 ob = e_widget_slider_add(evas, 1, 0, _("%1.2f Seconds"), 0.01, 0.5, 0.01, 0, &(cfdata->first_draw_delay), NULL, 150);
1252 e_widget_list_object_append(ol, ob, 1, 1, 0.5);
1253 e_widget_toolbook_page_append(otb, NULL, _("Sync"), ol, 0, 0, 0, 0, 0.5, 0.0);
1255 ///////////////////////////////////////////
1256 ol = e_widget_list_add(evas, 0, 0);
1257 rg = e_widget_radio_group_new(&(cfdata->engine));
1258 ob = e_widget_radio_add(evas, _("Software"), ENGINE_SW, rg);
1259 e_widget_list_object_append(ol, ob, 1, 1, 0.5);
1260 if (!getenv("ECORE_X_NO_XLIB"))
1262 if (ecore_evas_engine_type_supported_get(ECORE_EVAS_ENGINE_OPENGL_X11))
1264 ob = e_widget_radio_add(evas, _("OpenGL"), ENGINE_GL, rg);
1265 e_widget_list_object_append(ol, ob, 1, 1, 0.5);
1267 of = e_widget_framelist_add(evas, _("OpenGL options"), 0);
1268 e_widget_framelist_content_align_set(of, 0.5, 0.0);
1269 ob = e_widget_check_add(evas, _("Texture from pixmap"), &(cfdata->texture_from_pixmap));
1270 e_widget_framelist_object_append(of, ob);
1271 ob = e_widget_label_add(evas, _("Ctrl+Alt+Shift+Home resets compositor"));
1272 e_widget_framelist_object_append(of, ob);
1273 ob = e_widget_check_add(evas, _("Indirect OpenGL (EXPERIMENTAL)"), &(cfdata->indirect));
1274 e_widget_framelist_object_append(of, ob);
1275 e_widget_list_object_append(ol, of, 1, 1, 0.5);
1278 e_widget_toolbook_page_append(otb, NULL, _("Engine"), ol, 0, 0, 0, 0, 0.5, 0.0);
1280 ///////////////////////////////////////////
1281 ol = e_widget_list_add(evas, 0, 0);
1282 ob = e_widget_check_add(evas, _("Send flush"), &(cfdata->send_flush));
1283 e_widget_list_object_append(ol, ob, 1, 1, 0.5);
1284 ob = e_widget_check_add(evas, _("Send dump"), &(cfdata->send_dump));
1285 e_widget_list_object_append(ol, ob, 1, 1, 0.5);
1286 ob = e_widget_check_add(evas, _("Don't composite fullscreen"), &(cfdata->nocomp_fs));
1287 e_widget_list_object_append(ol, ob, 1, 1, 0.5);
1288 ob = e_widget_check_add(evas, _("Keep hidden windows"), &(cfdata->keep_unmapped));
1289 e_widget_list_object_append(ol, ob, 1, 1, 0.5);
1290 of = e_widget_frametable_add(evas, _("Maximum hidden pixels"), 0);
1291 e_widget_frametable_content_align_set(of, 0.5, 0.5);
1292 rg = e_widget_radio_group_new(&(cfdata->max_unmapped_pixels));
1293 ob = e_widget_radio_add(evas, _("1M"), 1 * 1024, rg);
1294 e_widget_frametable_object_append(of, ob, 0, 0, 1, 1, 1, 1, 0, 0);
1295 ob = e_widget_radio_add(evas, _("2M"), 2 * 1024, rg);
1296 e_widget_frametable_object_append(of, ob, 0, 1, 1, 1, 1, 1, 0, 0);
1297 ob = e_widget_radio_add(evas, _("4M"), 4 * 1024, rg);
1298 e_widget_frametable_object_append(of, ob, 0, 2, 1, 1, 1, 1, 0, 0);
1299 ob = e_widget_radio_add(evas, _("8M"), 8 * 1024, rg);
1300 e_widget_frametable_object_append(of, ob, 1, 0, 1, 1, 1, 1, 0, 0);
1301 ob = e_widget_radio_add(evas, _("16M"), 16 * 1024, rg);
1302 e_widget_frametable_object_append(of, ob, 1, 1, 1, 1, 1, 1, 0, 0);
1303 ob = e_widget_radio_add(evas, _("32M"), 32 * 1024, rg);
1304 e_widget_frametable_object_append(of, ob, 1, 2, 1, 1, 1, 1, 0, 0);
1305 ob = e_widget_radio_add(evas, _("64M"), 64 * 1024, rg);
1306 e_widget_frametable_object_append(of, ob, 2, 0, 1, 1, 1, 1, 0, 0);
1307 ob = e_widget_radio_add(evas, _("128M"), 128 * 1024, rg);
1308 e_widget_frametable_object_append(of, ob, 2, 1, 1, 1, 1, 1, 0, 0);
1309 ob = e_widget_radio_add(evas, _("256M"), 256 * 1024, rg);
1310 e_widget_frametable_object_append(of, ob, 2, 2, 1, 1, 1, 1, 0, 0);
1311 e_widget_list_object_append(ol, of, 1, 1, 0.5);
1312 e_widget_toolbook_page_append(otb, NULL, _("Memory"), ol, 0, 0, 0, 0, 0.5, 0.0);
1314 ///////////////////////////////////////////
1315 ol = e_widget_list_add(evas, 0, 0);
1316 ol2 = e_widget_list_add(evas, 1, 1);
1317 of = e_widget_framelist_add(evas, _("Min hidden"), 0);
1318 e_widget_framelist_content_align_set(of, 0.5, 0.0);
1319 rg = e_widget_radio_group_new(&(cfdata->min_unmapped_time));
1320 ob = e_widget_radio_add(evas, _("30 Seconds"), 30, rg);
1321 e_widget_framelist_object_append(of, ob);
1322 ob = e_widget_radio_add(evas, _("1 Minute"), 60, rg);
1323 e_widget_framelist_object_append(of, ob);
1324 ob = e_widget_radio_add(evas, _("5 Minutes"), 5 * 60, rg);
1325 e_widget_framelist_object_append(of, ob);
1326 ob = e_widget_radio_add(evas, _("30 Minutes"), 30 * 60, rg);
1327 e_widget_framelist_object_append(of, ob);
1328 ob = e_widget_radio_add(evas, _("2 Hours"), 2 * 3600, rg);
1329 e_widget_framelist_object_append(of, ob);
1330 ob = e_widget_radio_add(evas, _("10 Hours"), 10 * 3600, rg);
1331 e_widget_framelist_object_append(of, ob);
1332 ob = e_widget_radio_add(evas, _("Forever"), 0, rg);
1333 e_widget_framelist_object_append(of, ob);
1334 e_widget_list_object_append(ol2, of, 1, 1, 0.5);
1335 of = e_widget_framelist_add(evas, _("Max hidden"), 0);
1336 e_widget_framelist_content_align_set(of, 0.5, 0.0);
1337 rg = e_widget_radio_group_new(&(cfdata->max_unmapped_time));
1338 ob = e_widget_radio_add(evas, _("30 Seconds"), 30, rg);
1339 e_widget_framelist_object_append(of, ob);
1340 ob = e_widget_radio_add(evas, _("1 Minute"), 60, rg);
1341 e_widget_framelist_object_append(of, ob);
1342 ob = e_widget_radio_add(evas, _("5 Minutes"), 5 * 60, rg);
1343 e_widget_framelist_object_append(of, ob);
1344 ob = e_widget_radio_add(evas, _("30 Minutes"), 30 * 60, rg);
1345 e_widget_framelist_object_append(of, ob);
1346 ob = e_widget_radio_add(evas, _("2 Hours"), 2 * 3600, rg);
1347 e_widget_framelist_object_append(of, ob);
1348 ob = e_widget_radio_add(evas, _("10 Hours"), 10 * 3600, rg);
1349 e_widget_framelist_object_append(of, ob);
1350 ob = e_widget_radio_add(evas, _("Forever"), 0, rg);
1351 e_widget_framelist_object_append(of, ob);
1352 e_widget_list_object_append(ol2, of, 1, 1, 0.5);
1353 e_widget_list_object_append(ol, ol2, 1, 1, 0.5);
1354 e_widget_toolbook_page_append(otb, NULL, _("Timeouts"), ol, 0, 0, 0, 0, 0.5, 0.0);
1356 ///////////////////////////////////////////
1357 ol = e_widget_list_add(evas, 0, 0);
1359 ob = e_widget_check_add(evas, _("Show Framerate"), &(cfdata->fps_show));
1360 e_widget_list_object_append(ol, ob, 1, 1, 0.5);
1361 ob = e_widget_label_add(evas, _("Rolling average frame count"));
1362 e_widget_list_object_append(ol, ob, 1, 1, 0.5);
1363 ob = e_widget_slider_add(evas, 1, 0, _("%1.0f Frames"), 1, 120, 1, 0,
1364 NULL, &(cfdata->fps_average_range), 240);
1365 e_widget_list_object_append(ol, ob, 1, 1, 0.5);
1367 of = e_widget_frametable_add(evas, _("Corner"), 0);
1368 e_widget_frametable_content_align_set(of, 0.5, 0.5);
1369 rg = e_widget_radio_group_new(&(cfdata->fps_corner));
1370 ob = e_widget_radio_icon_add(evas, "Top Left", "preferences-position-top-left",
1372 e_widget_frametable_object_append(of, ob, 0, 0, 1, 1, 1, 1, 1, 1);
1373 ob = e_widget_radio_icon_add(evas, "Top Right", "preferences-position-top-right",
1375 e_widget_frametable_object_append(of, ob, 1, 0, 1, 1, 1, 1, 1, 1);
1376 ob = e_widget_radio_icon_add(evas, "Bottom Left", "preferences-position-bottom-left",
1378 e_widget_frametable_object_append(of, ob, 0, 1, 1, 1, 1, 1, 1, 1);
1379 ob = e_widget_radio_icon_add(evas, "Bottom Right", "preferences-position-bottom-right",
1381 e_widget_frametable_object_append(of, ob, 1, 1, 1, 1, 1, 1, 1, 1);
1382 e_widget_list_object_append(ol, of, 1, 1, 0.5);
1384 e_widget_toolbook_page_append(otb, NULL, _("Debug"), ol, 0, 0, 0, 0, 0.5, 0.0);
1386 ///////////////////////////////////////////
1387 ol = e_widget_list_add(evas, 0, 0);
1388 ob = e_widget_check_add(evas, _("Evas canvas per zone"), &(cfdata->canvas_per_zone));
1389 e_widget_list_object_append(ol, ob, 1, 1, 0.5);
1391 ob = e_widget_check_add(evas, _("H/W overlay window"), &(cfdata->use_hw_ov));
1392 e_widget_list_object_append(ol, ob, 1, 1, 0.5);
1394 ob = e_widget_check_add(evas, _("Enable hardware composite"), &(cfdata->use_hwc));
1395 e_widget_list_object_append(ol, ob, 1, 1, 0.5);
1397 ob = e_widget_check_add(evas, _("Show Log"), &(cfdata->debug_info_show));
1398 e_widget_list_object_append(ol, ob, 1, 1, 0.5);
1399 ob = e_widget_label_add(evas, _("Maximum number of log messages"));
1400 e_widget_list_object_append(ol, ob, 1, 1, 0.5);
1401 ob = e_widget_slider_add(evas, 1, 0, _("%1.0f Messages"), 1, 30, 1, 0,
1402 NULL, &(cfdata->max_debug_msgs), 240);
1403 e_widget_list_object_append(ol, ob, 1, 1, 0.5);
1404 ob = e_widget_label_add(evas, _("Log Type"));
1405 e_widget_list_object_append(ol, ob, 1, 1, 0.5);
1406 ob = e_widget_check_add(evas, _("COMP <-> NOCOMP"), &(cfdata->debug_type_nocomp));
1407 e_widget_list_object_append(ol, ob, 1, 1, 0.5);
1408 ob = e_widget_check_add(evas, _("SWAP"), &(cfdata->debug_type_swap));
1409 e_widget_list_object_append(ol, ob, 1, 1, 0.5);
1410 ob = e_widget_check_add(evas, _("EFFECT"), &(cfdata->debug_type_effect));
1411 e_widget_list_object_append(ol, ob, 1, 1, 0.5);
1412 ob = e_widget_check_add(evas, _("NATIVE SURFACE"), &(cfdata->use_efl_native_surface));
1413 e_widget_list_object_append(ol, ob, 1, 1, 0.5);
1415 e_widget_toolbook_page_append(otb, NULL, _("Mobile"), ol, 0, 0, 0, 0, 0.5, 0.0);
1417 ///////////////////////////////////////////
1418 e_widget_toolbook_page_show(otb, 0);
1420 e_dialog_resizable_set(cfd->dia, 1);
1422 e_widget_table_object_append(tab, otb, 0, 0, 1, 1, 1, 1, 1, 1);
1427 _match_list_free(Eina_List *list)
1431 EINA_LIST_FREE(list, m)
1433 if (m->title) eina_stringshare_del(m->title);
1434 if (m->name) eina_stringshare_del(m->name);
1435 if (m->clas) eina_stringshare_del(m->clas);
1436 if (m->role) eina_stringshare_del(m->role);
1437 if (m->shadow_style) eina_stringshare_del(m->shadow_style);
1443 _match_dup2(Match_Config *m2,
1447 if (m->title) m->title = eina_stringshare_add(m->title);
1448 if (m->name) m->name = eina_stringshare_add(m->name);
1449 if (m->clas) m->clas = eina_stringshare_add(m->clas);
1450 if (m->role) m->role = eina_stringshare_add(m->role);
1451 if (m->shadow_style) m->shadow_style = eina_stringshare_add(m->shadow_style);
1455 _basic_apply_data(E_Config_Dialog *cfd __UNUSED__,
1456 E_Config_Dialog_Data *cfdata)
1458 if ((cfdata->use_shadow != _comp_mod->conf->use_shadow) ||
1459 (cfdata->lock_fps != _comp_mod->conf->lock_fps) ||
1460 (cfdata->smooth_windows != _comp_mod->conf->smooth_windows) ||
1461 (cfdata->fake_image_launch != _comp_mod->conf->fake_image_launch) ||
1462 (cfdata->grab != _comp_mod->conf->grab) ||
1463 (cfdata->keep_unmapped != _comp_mod->conf->keep_unmapped) ||
1464 (cfdata->nocomp_fs != _comp_mod->conf->nocomp_fs) ||
1465 (cfdata->use_hwc != _comp_mod->conf->use_hwc) ||
1466 (cfdata->shadow_style != _comp_mod->conf->shadow_style) ||
1467 (cfdata->max_unmapped_pixels != _comp_mod->conf->max_unmapped_pixels) ||
1468 (cfdata->max_unmapped_time != _comp_mod->conf->max_unmapped_time) ||
1469 (cfdata->min_unmapped_time != _comp_mod->conf->min_unmapped_time) ||
1470 (cfdata->send_flush != _comp_mod->conf->send_flush) ||
1471 (cfdata->send_dump != _comp_mod->conf->send_dump) ||
1472 (cfdata->fps_show != _comp_mod->conf->fps_show) ||
1473 (cfdata->fps_corner != _comp_mod->conf->fps_corner) ||
1474 (cfdata->fps_average_range != _comp_mod->conf->fps_average_range) ||
1475 (cfdata->first_draw_delay != _comp_mod->conf->first_draw_delay) ||
1476 (cfdata->canvas_per_zone != _comp_mod->conf->canvas_per_zone) ||
1477 (cfdata->use_hw_ov != _comp_mod->conf->use_hw_ov) ||
1478 (cfdata->debug_info_show != _comp_mod->conf->debug_info_show) ||
1479 (cfdata->max_debug_msgs != _comp_mod->conf->max_debug_msgs) ||
1480 (cfdata->debug_type_nocomp != _comp_mod->conf->debug_type_nocomp) ||
1481 (cfdata->debug_type_swap != _comp_mod->conf->debug_type_swap) ||
1482 (cfdata->debug_type_effect != _comp_mod->conf->debug_type_effect) ||
1483 (cfdata->use_efl_native_surface != _comp_mod->conf->use_efl_native_surface) ||
1484 (cfdata->match.changed)
1487 if (cfdata->match.changed)
1493 _match_list_free(_comp_mod->conf->match.popups);
1494 _match_list_free(_comp_mod->conf->match.borders);
1495 _match_list_free(_comp_mod->conf->match.overrides);
1496 _match_list_free(_comp_mod->conf->match.menus);
1498 _comp_mod->conf->match.popups = NULL;
1499 _comp_mod->conf->match.borders = NULL;
1500 _comp_mod->conf->match.overrides = NULL;
1501 _comp_mod->conf->match.menus = NULL;
1503 EINA_LIST_FOREACH(cfdata->match.popups, l, m2)
1505 m = E_NEW(Match, 1);
1507 _comp_mod->conf->match.popups =
1508 eina_list_append(_comp_mod->conf->match.popups, m);
1510 EINA_LIST_FOREACH(cfdata->match.borders, l, m2)
1512 m = E_NEW(Match, 1);
1514 _comp_mod->conf->match.borders =
1515 eina_list_append(_comp_mod->conf->match.borders, m);
1517 EINA_LIST_FOREACH(cfdata->match.overrides, l, m2)
1519 m = E_NEW(Match, 1);
1521 _comp_mod->conf->match.overrides =
1522 eina_list_append(_comp_mod->conf->match.overrides, m);
1524 EINA_LIST_FOREACH(cfdata->match.menus, l, m2)
1526 m = E_NEW(Match, 1);
1528 _comp_mod->conf->match.menus =
1529 eina_list_append(_comp_mod->conf->match.menus, m);
1531 cfdata->match.changed = 0;
1533 _comp_mod->conf->use_shadow = cfdata->use_shadow;
1534 _comp_mod->conf->lock_fps = cfdata->lock_fps;
1535 _comp_mod->conf->smooth_windows = cfdata->smooth_windows;
1536 _comp_mod->conf->fake_image_launch = cfdata->fake_image_launch;
1537 _comp_mod->conf->grab = cfdata->grab;
1538 _comp_mod->conf->keep_unmapped = cfdata->keep_unmapped;
1539 _comp_mod->conf->nocomp_fs = cfdata->nocomp_fs;
1540 _comp_mod->conf->use_hwc = cfdata->use_hwc;
1541 _comp_mod->conf->max_unmapped_pixels = cfdata->max_unmapped_pixels;
1542 _comp_mod->conf->max_unmapped_time = cfdata->max_unmapped_time;
1543 _comp_mod->conf->min_unmapped_time = cfdata->min_unmapped_time;
1544 _comp_mod->conf->send_flush = cfdata->send_flush;
1545 _comp_mod->conf->send_dump = cfdata->send_dump;
1546 _comp_mod->conf->fps_show = cfdata->fps_show;
1547 _comp_mod->conf->fps_corner = cfdata->fps_corner;
1548 _comp_mod->conf->fps_average_range = cfdata->fps_average_range;
1549 _comp_mod->conf->first_draw_delay = cfdata->first_draw_delay;
1550 _comp_mod->conf->canvas_per_zone = cfdata->canvas_per_zone;
1551 _comp_mod->conf->use_hw_ov = cfdata->use_hw_ov;
1552 _comp_mod->conf->debug_info_show = cfdata->debug_info_show;
1553 _comp_mod->conf->max_debug_msgs = cfdata->max_debug_msgs;
1554 _comp_mod->conf->debug_type_nocomp = cfdata->debug_type_nocomp;
1555 _comp_mod->conf->debug_type_swap = cfdata->debug_type_swap;
1556 _comp_mod->conf->debug_type_effect = cfdata->debug_type_effect;
1557 _comp_mod->conf->use_efl_native_surface = cfdata->use_efl_native_surface;
1558 if (_comp_mod->conf->shadow_style)
1559 eina_stringshare_del(_comp_mod->conf->shadow_style);
1560 _comp_mod->conf->shadow_style = NULL;
1561 if (cfdata->shadow_style)
1562 _comp_mod->conf->shadow_style = eina_stringshare_add(cfdata->shadow_style);
1563 e_mod_comp_shadow_set();
1564 e_mod_comp_hw_ov_win_msg_config_update();
1566 if ((cfdata->engine != _comp_mod->conf->engine) ||
1567 (cfdata->indirect != _comp_mod->conf->indirect) ||
1568 (cfdata->texture_from_pixmap != _comp_mod->conf->texture_from_pixmap) ||
1569 (cfdata->efl_sync != _comp_mod->conf->efl_sync) ||
1570 (cfdata->loose_sync != _comp_mod->conf->loose_sync) ||
1571 (cfdata->vsync != _comp_mod->conf->vsync))
1575 _comp_mod->conf->engine = cfdata->engine;
1576 _comp_mod->conf->indirect = cfdata->indirect;
1577 _comp_mod->conf->texture_from_pixmap = cfdata->texture_from_pixmap;
1578 _comp_mod->conf->efl_sync = cfdata->efl_sync;
1579 _comp_mod->conf->loose_sync = cfdata->loose_sync;
1580 _comp_mod->conf->vsync = cfdata->vsync;
1582 a = e_action_find("restart");
1583 if ((a) && (a->func.go)) a->func.go(NULL, NULL);
1585 e_config_save_queue();