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
29 int texture_from_pixmap;
37 const char *shadow_style;
48 Evas_Object *popups_il;
49 Evas_Object *borders_il;
50 Evas_Object *overrides_il;
51 Evas_Object *menus_il;
56 int max_unmapped_pixels;
57 int max_unmapped_time;
58 int min_unmapped_time;
65 int fps_average_range;
66 double first_draw_delay;
70 static void *_create_data(E_Config_Dialog *cfd);
71 static void _free_data(E_Config_Dialog *cfd,
72 E_Config_Dialog_Data *cfdata);
73 static Evas_Object *_basic_create_widgets(E_Config_Dialog *cfd,
75 E_Config_Dialog_Data *cfdata);
76 static int _basic_apply_data(E_Config_Dialog *cfd,
77 E_Config_Dialog_Data *cfdata);
78 static Evas_Object *_advanced_create_widgets(E_Config_Dialog *cfd,
80 E_Config_Dialog_Data *cfdata);
81 static int _advanced_apply_data(E_Config_Dialog *cfd,
82 E_Config_Dialog_Data *cfdata);
85 e_int_config_comp_module(E_Container *con,
86 const char *params __UNUSED__)
89 E_Config_Dialog_View *v;
93 if (e_config_dialog_find("E", "appearance/comp")) return NULL;
94 v = E_NEW(E_Config_Dialog_View, 1);
96 v->create_cfdata = _create_data;
97 v->free_cfdata = _free_data;
98 v->basic.apply_cfdata = _basic_apply_data;
99 v->basic.create_widgets = _basic_create_widgets;
100 v->advanced.apply_cfdata = _advanced_apply_data;
101 v->advanced.create_widgets = _advanced_create_widgets;
103 snprintf(buf, sizeof(buf), "%s/e-module-comp.edj",
104 e_module_dir_get(mod->module));
105 cfd = e_config_dialog_new(con, _("Composite Settings"),
106 "E", "appearance/comp", buf, 0, v, mod);
107 mod->config_dialog = cfd;
116 if (m2->match.title) m2->match.title = eina_stringshare_add(m2->match.title);
117 if (m2->match.name) m2->match.name = eina_stringshare_add(m2->match.name);
118 if (m2->match.clas) m2->match.clas = eina_stringshare_add(m2->match.clas);
119 if (m2->match.role) m2->match.role = eina_stringshare_add(m2->match.role);
120 if (m2->match.shadow_style) m2->match.shadow_style = eina_stringshare_add(m2->match.shadow_style);
124 _create_data(E_Config_Dialog *cfd)
126 E_Config_Dialog_Data *cfdata;
131 cfdata = E_NEW(E_Config_Dialog_Data, 1);
133 cfdata->engine = _comp_mod->conf->engine;
134 if ((cfdata->engine != ENGINE_SW) &&
135 (cfdata->engine != ENGINE_GL))
136 cfdata->engine = ENGINE_SW;
137 cfdata->indirect = _comp_mod->conf->indirect;
138 cfdata->texture_from_pixmap = _comp_mod->conf->texture_from_pixmap;
139 cfdata->smooth_windows = _comp_mod->conf->smooth_windows;
140 cfdata->lock_fps = _comp_mod->conf->lock_fps;
141 cfdata->efl_sync = _comp_mod->conf->efl_sync;
142 cfdata->loose_sync = _comp_mod->conf->loose_sync;
143 cfdata->grab = _comp_mod->conf->grab;
144 cfdata->vsync = _comp_mod->conf->vsync;
145 if (_comp_mod->conf->shadow_style)
146 cfdata->shadow_style = eina_stringshare_add(_comp_mod->conf->shadow_style);
148 cfdata->keep_unmapped = _comp_mod->conf->keep_unmapped;
149 cfdata->max_unmapped_pixels = _comp_mod->conf->max_unmapped_pixels;
150 cfdata->max_unmapped_time = _comp_mod->conf->max_unmapped_time;
151 cfdata->min_unmapped_time = _comp_mod->conf->min_unmapped_time;
152 cfdata->send_flush = _comp_mod->conf->send_flush;
153 cfdata->send_dump = _comp_mod->conf->send_dump;
154 cfdata->nocomp_fs = _comp_mod->conf->nocomp_fs;
156 cfdata->fps_show = _comp_mod->conf->fps_show;
157 cfdata->fps_corner = _comp_mod->conf->fps_corner;
158 cfdata->fps_average_range = _comp_mod->conf->fps_average_range;
159 if (cfdata->fps_average_range < 1) cfdata->fps_average_range = 12;
160 else if (cfdata->fps_average_range > 120)
161 cfdata->fps_average_range = 120;
162 cfdata->first_draw_delay = _comp_mod->conf->first_draw_delay;
164 EINA_LIST_FOREACH(_comp_mod->conf->match.popups, l, m)
166 m2 = E_NEW(Match_Config, 1);
169 cfdata->match.popups = eina_list_append(cfdata->match.popups, m2);
172 EINA_LIST_FOREACH(_comp_mod->conf->match.borders, l, m)
174 m2 = E_NEW(Match_Config, 1);
177 cfdata->match.borders = eina_list_append(cfdata->match.borders, m2);
180 EINA_LIST_FOREACH(_comp_mod->conf->match.overrides, l, m)
182 m2 = E_NEW(Match_Config, 1);
185 cfdata->match.overrides = eina_list_append(cfdata->match.overrides, m2);
188 EINA_LIST_FOREACH(_comp_mod->conf->match.menus, l, m)
190 m2 = E_NEW(Match_Config, 1);
193 cfdata->match.menus = eina_list_append(cfdata->match.menus, m2);
200 _match_free(Match_Config *m)
202 if (m->match.title) eina_stringshare_del(m->match.title);
203 if (m->match.name) eina_stringshare_del(m->match.name);
204 if (m->match.clas) eina_stringshare_del(m->match.clas);
205 if (m->match.role) eina_stringshare_del(m->match.role);
206 if (m->match.shadow_style) eina_stringshare_del(m->match.shadow_style);
207 if (m->title) free(m->title);
208 if (m->name) free(m->name);
209 if (m->clas) free(m->clas);
210 if (m->role) free(m->role);
215 _free_data(E_Config_Dialog *cfd __UNUSED__,
216 E_Config_Dialog_Data *cfdata)
220 _comp_mod->config_dialog = NULL;
221 if (cfdata->shadow_style) eina_stringshare_del(cfdata->shadow_style);
222 EINA_LIST_FREE(cfdata->match.popups, m)
226 EINA_LIST_FREE(cfdata->match.borders, m)
230 EINA_LIST_FREE(cfdata->match.overrides, m)
234 EINA_LIST_FREE(cfdata->match.menus, m)
242 _style_demo(void *data)
244 Eina_List *style_shadows, *l;
246 const E_Demo_Style_Item *it;
248 demo_state = (long)evas_object_data_get(data, "style_demo_state");
249 demo_state = (demo_state + 1) % 4;
250 evas_object_data_set(data, "style_demo_state", (void *)(long)demo_state);
252 style_shadows = evas_object_data_get(data, "style_shadows");
253 EINA_LIST_FOREACH(style_shadows, l, it)
255 Evas_Object *ob = it->preview;
256 Evas_Object *of = it->frame;
261 edje_object_signal_emit(ob, "e,state,visible,on", "e");
262 edje_object_signal_emit(ob, "e,state,focus,on", "e");
263 edje_object_part_text_set(of, "e.text.label", _("Visible"));
267 edje_object_signal_emit(ob, "e,state,focus,off", "e");
268 edje_object_part_text_set(of, "e.text.label", _("Focus-Out"));
272 edje_object_signal_emit(ob, "e,state,focus,on", "e");
273 edje_object_part_text_set(of, "e.text.label", _("Focus-In"));
277 edje_object_signal_emit(ob, "e,state,visible,off", "e");
278 edje_object_part_text_set(of, "e.text.label", _("Hidden"));
285 return ECORE_CALLBACK_RENEW;
289 _style_selector_del(void *data __UNUSED__,
292 void *event_info __UNUSED__)
294 Eina_List *style_shadows, *style_list;
298 orec0 = evas_object_name_find(e, "style_shadows");
299 style_list = evas_object_data_get(orec0, "list");
301 style_shadows = evas_object_data_get(o, "style_shadows");
304 E_Demo_Style_Item *ds_it;
306 EINA_LIST_FREE(style_shadows, ds_it)
308 style_list = eina_list_remove(style_list, ds_it);
310 evas_object_del(ds_it->client);
311 evas_object_del(ds_it->border);
312 evas_object_del(ds_it->frame);
313 evas_object_del(ds_it->preview);
314 evas_object_del(ds_it->layout);
315 evas_object_del(ds_it->livethumb);
318 evas_object_data_set(o, "style_shadows", NULL);
321 timer = evas_object_data_get(o, "style_timer");
324 ecore_timer_del(timer);
325 evas_object_data_set(o, "style_timer", NULL);
328 evas_object_data_set(orec0, "list", style_list);
332 _style_selector(Evas *evas,
335 Evas_Object *oi, *ob, *oo, *obd, *orec, *oly, *orec0;
336 Eina_List *styles, *l, *style_shadows = NULL, *style_list;
343 orec0 = evas_object_name_find(evas, "style_shadows");
344 style_list = evas_object_data_get(orec0, "list");
345 oi = e_widget_ilist_add(evas, 80, 80, source);
346 evas_object_event_callback_add(oi, EVAS_CALLBACK_DEL,
347 _style_selector_del, oi);
349 styles = e_theme_comp_list();
351 EINA_LIST_FOREACH(styles, l, style)
353 E_Demo_Style_Item *ds_it;
356 ds_it = malloc(sizeof(E_Demo_Style_Item));
358 ob = e_livethumb_add(evas);
359 ds_it->livethumb = ob;
360 e_livethumb_vsize_set(ob, 240, 240);
362 oly = e_layout_add(e_livethumb_evas_get(ob));
364 e_layout_virtual_size_set(oly, 240, 240);
365 e_livethumb_thumb_set(ob, oly);
366 evas_object_show(oly);
368 oo = edje_object_add(e_livethumb_evas_get(ob));
370 snprintf(buf, sizeof(buf), "e/comp/%s", style);
371 e_theme_edje_object_set(oo, "base/theme/borders", buf);
372 e_layout_pack(oly, oo);
373 e_layout_child_move(oo, 39, 39);
374 e_layout_child_resize(oo, 162, 162);
375 edje_object_signal_emit(oo, "e,state,shadow,on", "e");
376 edje_object_signal_emit(oo, "e,state,visible,on", "e");
377 evas_object_show(oo);
379 ds_it->frame = edje_object_add(evas);
380 e_theme_edje_object_set
381 (ds_it->frame, "base/theme/modules/comp", "e/modules/comp/preview");
382 edje_object_part_swallow(ds_it->frame, "e.swallow.preview", ob);
383 evas_object_show(ds_it->frame);
384 style_shadows = eina_list_append(style_shadows, ds_it);
386 obd = edje_object_add(e_livethumb_evas_get(ob));
388 e_theme_edje_object_set(obd, "base/theme/borders",
389 "e/widgets/border/default/border");
390 edje_object_part_text_set(obd, "e.text.title", _("Title"));
391 edje_object_signal_emit(obd, "e,state,focused", "e");
392 edje_object_part_swallow(oo, "e.swallow.content", obd);
393 evas_object_show(obd);
395 orec = evas_object_rectangle_add(e_livethumb_evas_get(ob));
396 ds_it->client = orec;
397 evas_object_color_set(orec, 255, 255, 255, 255);
398 edje_object_part_swallow(obd, "e.swallow.client", orec);
399 evas_object_show(orec);
401 e_widget_ilist_append(oi, ds_it->frame, style, NULL, NULL, style);
402 evas_object_show(ob);
405 if (!strcmp(*source, style)) sel = n;
409 style_list = eina_list_append(style_list, ds_it);
411 evas_object_data_set(orec0, "list", style_list);
412 evas_object_data_set(oi, "style_shadows", style_shadows);
413 timer = ecore_timer_add(3.0, _style_demo, oi);
414 evas_object_data_set(oi, "style_timer", timer);
415 evas_object_data_set(oi, "style_demo_state", (void *)1);
416 e_widget_size_min_get(oi, &wmw, &wmh);
417 e_widget_size_min_set(oi, 160, 100);
418 e_widget_ilist_selected_set(oi, sel);
419 e_widget_ilist_go(oi);
421 EINA_LIST_FREE(styles, str)
422 eina_stringshare_del(str);
428 _match_sel(void *data __UNUSED__)
430 // Match_Config *m = data;
431 // E_Config_Dialog *cfd = m->cfd;
435 _match_type_label_get(int type)
437 if (ECORE_X_WINDOW_TYPE_UNKNOWN == type)
439 if (ECORE_X_WINDOW_TYPE_COMBO == type)
441 if (ECORE_X_WINDOW_TYPE_DESKTOP == type)
443 if (ECORE_X_WINDOW_TYPE_DIALOG == type)
445 if (ECORE_X_WINDOW_TYPE_DOCK == type)
447 if (ECORE_X_WINDOW_TYPE_DND == type)
448 return _("Drag and Drop");
449 if (ECORE_X_WINDOW_TYPE_MENU == type)
451 if (ECORE_X_WINDOW_TYPE_DROPDOWN_MENU == type)
452 return _("Menu (Dropdown)");
453 if (ECORE_X_WINDOW_TYPE_POPUP_MENU == type)
454 return _("Menu (Popup)");
455 if (ECORE_X_WINDOW_TYPE_NORMAL == type)
457 if (ECORE_X_WINDOW_TYPE_NOTIFICATION == type)
458 return _("Notification");
459 if (ECORE_X_WINDOW_TYPE_SPLASH == type)
461 if (ECORE_X_WINDOW_TYPE_TOOLBAR == type)
463 if (ECORE_X_WINDOW_TYPE_TOOLTIP == type)
465 if (ECORE_X_WINDOW_TYPE_UTILITY == type)
472 _match_label_get(Match_Config *m)
475 Eina_Strbuf *buf = eina_strbuf_new();
479 eina_strbuf_append(buf, _("Title:"));
480 eina_strbuf_append(buf, m->match.title);
481 eina_strbuf_append(buf, _(" / "));
483 if (m->match.primary_type)
485 eina_strbuf_append(buf, _("Type:"));
486 eina_strbuf_append(buf, _match_type_label_get(m->match.primary_type));
487 eina_strbuf_append(buf, _(" / "));
491 eina_strbuf_append(buf, _("Name:"));
492 eina_strbuf_append(buf, m->match.name);
493 eina_strbuf_append(buf, _(" / "));
497 eina_strbuf_append(buf, _("Class:"));
498 eina_strbuf_append(buf, m->match.clas);
499 eina_strbuf_append(buf, _(" / "));
503 eina_strbuf_append(buf, _("Role:"));
504 eina_strbuf_append(buf, m->match.role);
505 eina_strbuf_append(buf, _(" / "));
507 if (m->match.shadow_style)
509 eina_strbuf_append(buf, _("Style:"));
510 eina_strbuf_append(buf, m->match.shadow_style);
513 if (!eina_strbuf_length_get(buf))
516 label = strdup(eina_strbuf_string_get(buf));
517 eina_strbuf_free(buf);
523 _match_ilist_append(Evas_Object *il,
528 char *name = _match_label_get(m);
531 e_widget_ilist_append(il, NULL, name, _match_sel, m, NULL);
535 e_widget_ilist_prepend_relative(il, NULL, name, _match_sel, m, NULL, pos);
537 e_widget_ilist_append_relative(il, NULL, name, _match_sel, m, NULL, pos);
543 _match_list_up(Eina_List **list,
548 l = eina_list_data_find_list(*list, m);
551 *list = eina_list_remove_list(*list, l);
552 if (lp) *list = eina_list_prepend_relative_list(*list, m, lp);
553 else *list = eina_list_prepend(*list, m);
557 _match_list_down(Eina_List **list,
562 l = eina_list_data_find_list(*list, m);
565 *list = eina_list_remove_list(*list, l);
566 if (lp) *list = eina_list_append_relative_list(*list, m, lp);
567 else *list = eina_list_append(*list, m);
571 _match_list_del(Eina_List **list,
576 l = eina_list_data_find_list(*list, m);
579 *list = eina_list_remove_list(*list, l);
584 _cb_dialog_resize(void *data,
587 void *event_info __UNUSED__)
589 Evas_Object *bg, *of;
593 bg = evas_object_data_get(of, "bg");
594 evas_object_geometry_get(obj, &x, &y, &w, &h);
596 evas_object_move(bg, x, y);
597 evas_object_resize(bg, w, h);
598 evas_object_move(of, x, y);
599 evas_object_resize(of, w, h);
606 Match_Config *m = d1;
607 Evas_Object *dia, *bg, *of = d2;
612 if (m->match.title) eina_stringshare_del(m->match.title);
613 m->match.title = NULL;
616 if (m->title[0]) m->match.title = eina_stringshare_add(m->title);
620 if (m->match.name) eina_stringshare_del(m->match.name);
621 m->match.name = NULL;
624 if (m->name[0]) m->match.name = eina_stringshare_add(m->name);
628 if (m->match.clas) eina_stringshare_del(m->match.clas);
629 m->match.clas = NULL;
632 if (m->clas[0]) m->match.clas = eina_stringshare_add(m->clas);
636 if (m->match.role) eina_stringshare_del(m->match.role);
637 m->match.role = NULL;
640 if (m->role[0]) m->match.role = eina_stringshare_add(m->role);
644 m->match.borderless = m->borderless;
645 m->match.dialog = m->dialog;
646 m->match.accepts_focus = m->accepts_focus;
647 m->match.vkbd = m->vkbd;
648 m->match.quickpanel = m->quickpanel;
649 m->match.argb = m->argb;
650 m->match.fullscreen = m->fullscreen;
651 m->match.modal = m->modal;
653 il = m->cfd->cfdata->edit_il;
654 n = e_widget_ilist_selected_get(il);
655 label = _match_label_get(m);
656 e_widget_ilist_nth_label_set(il, n, label);
658 bg = evas_object_data_get(of, "bg");
659 dia = evas_object_data_get(of, "dia");
661 evas_object_event_callback_del(dia, EVAS_CALLBACK_RESIZE, _cb_dialog_resize);
667 _create_edit_frame(E_Config_Dialog *cfd,
669 E_Config_Dialog_Data *cfdata,
672 Evas_Object *of, *oi, *lb, *en, *bt, *tb, *tab2, *o, *sf, *li;
677 o = edje_object_add(evas);
678 e_theme_edje_object_set(o, "base/theme/dialog", "e/widgets/dialog/main");
679 evas_object_geometry_get(cfd->dia->bg_object, &x, &y, &w, &h);
680 evas_object_move(o, x, y);
681 evas_object_resize(o, w, h);
684 of = e_widget_frametable_add(evas, _("Edit Match"), 0);
685 evas_object_data_set(of, "bg", o);
686 evas_object_data_set(of, "dia", cfd->dia->bg_object);
687 evas_object_move(of, x, y);
688 evas_object_resize(of, w, h);
689 evas_object_show(of);
691 evas_object_event_callback_add(cfd->dia->bg_object, EVAS_CALLBACK_RESIZE,
692 _cb_dialog_resize, of);
694 tb = e_widget_toolbook_add(evas, 48 * e_scale, 48 * e_scale);
696 tab2 = e_widget_table_add(evas, 0);
697 if (cfdata->edit_il == cfdata->borders_il)
699 if (m->match.title) m->title = strdup(m->match.title);
700 else m->title = NULL;
701 lb = e_widget_label_add(evas, _("Title"));
702 e_widget_table_object_append(tab2, lb, 0, 0, 1, 1, 1, 0, 0, 0);
703 en = e_widget_entry_add(evas, &(m->title), NULL, NULL, NULL);
704 e_widget_table_object_append(tab2, en, 1, 0, 1, 1, 1, 0, 1, 0);
706 if ((cfdata->edit_il == cfdata->borders_il) ||
707 (cfdata->edit_il == cfdata->overrides_il) ||
708 (cfdata->edit_il == cfdata->popups_il))
710 if (m->match.name) m->name = strdup(m->match.name);
712 lb = e_widget_label_add(evas, _("Name"));
713 e_widget_table_object_append(tab2, lb, 0, 1, 1, 1, 1, 0, 0, 0);
714 en = e_widget_entry_add(evas, &(m->name), NULL, NULL, NULL);
715 e_widget_table_object_append(tab2, en, 1, 1, 1, 1, 1, 0, 1, 0);
717 if ((cfdata->edit_il == cfdata->borders_il) ||
718 (cfdata->edit_il == cfdata->overrides_il))
720 if (m->match.clas) m->clas = strdup(m->match.clas);
722 lb = e_widget_label_add(evas, _("Class"));
723 e_widget_table_object_append(tab2, lb, 0, 2, 1, 1, 1, 0, 0, 0);
724 en = e_widget_entry_add(evas, &(m->clas), NULL, NULL, NULL);
725 e_widget_table_object_append(tab2, en, 1, 2, 1, 1, 1, 0, 1, 0);
727 if (cfdata->edit_il == cfdata->borders_il)
729 if (m->match.role) m->role = strdup(m->match.role);
731 lb = e_widget_label_add(evas, _("Role"));
732 e_widget_table_object_append(tab2, lb, 0, 3, 1, 1, 1, 0, 0, 0);
733 en = e_widget_entry_add(evas, &(m->role), NULL, NULL, NULL);
734 e_widget_table_object_append(tab2, en, 1, 3, 1, 1, 1, 0, 1, 0);
736 e_widget_toolbook_page_append(tb, NULL, _("Names"), tab2, 1, 1, 1, 1, 0.5, 0.0);
738 if ((cfdata->edit_il == cfdata->borders_il) ||
739 (cfdata->edit_il == cfdata->overrides_il))
743 rg = e_widget_radio_group_new(&m->match.primary_type);
745 li = e_widget_list_add(evas, 1, 0);
747 o = e_widget_radio_add(evas, _("Unused"), ECORE_X_WINDOW_TYPE_UNKNOWN, rg);
748 e_widget_list_object_append(li, o, 1, 0, 0.0);
750 o = e_widget_radio_add(evas, _("Combo"), ECORE_X_WINDOW_TYPE_COMBO, rg);
751 e_widget_list_object_append(li, o, 1, 0, 0.0);
752 o = e_widget_radio_add(evas, _("Desktop"), ECORE_X_WINDOW_TYPE_DESKTOP, rg);
753 e_widget_list_object_append(li, o, 1, 0, 0.0);
754 o = e_widget_radio_add(evas, _("Dialog"), ECORE_X_WINDOW_TYPE_DIALOG, rg);
755 e_widget_list_object_append(li, o, 1, 0, 0.0);
756 o = e_widget_radio_add(evas, _("Dock"), ECORE_X_WINDOW_TYPE_DOCK, rg);
757 e_widget_list_object_append(li, o, 1, 0, 0.0);
758 o = e_widget_radio_add(evas, _("Drag and Drop"), ECORE_X_WINDOW_TYPE_DND, rg);
759 e_widget_list_object_append(li, o, 1, 0, 0.0);
760 o = e_widget_radio_add(evas, _("Menu"), ECORE_X_WINDOW_TYPE_MENU, rg);
761 e_widget_list_object_append(li, o, 1, 0, 0.0);
762 o = e_widget_radio_add(evas, _("Menu (Dropdown)"), ECORE_X_WINDOW_TYPE_DROPDOWN_MENU, rg);
763 e_widget_list_object_append(li, o, 1, 0, 0.0);
764 o = e_widget_radio_add(evas, _("Menu (Popup)"), ECORE_X_WINDOW_TYPE_POPUP_MENU, rg);
765 e_widget_list_object_append(li, o, 1, 0, 0.0);
766 o = e_widget_radio_add(evas, _("Normal"), ECORE_X_WINDOW_TYPE_NORMAL, rg);
767 e_widget_list_object_append(li, o, 1, 0, 0.0);
768 o = e_widget_radio_add(evas, _("Notification"), ECORE_X_WINDOW_TYPE_NOTIFICATION, rg);
769 e_widget_list_object_append(li, o, 1, 0, 0.0);
770 o = e_widget_radio_add(evas, _("Splash"), ECORE_X_WINDOW_TYPE_SPLASH, rg);
771 e_widget_list_object_append(li, o, 1, 0, 0.0);
772 o = e_widget_radio_add(evas, _("Toolbar"), ECORE_X_WINDOW_TYPE_TOOLBAR, rg);
773 e_widget_list_object_append(li, o, 1, 0, 0.0);
774 o = e_widget_radio_add(evas, _("Tooltip"), ECORE_X_WINDOW_TYPE_TOOLTIP, rg);
775 e_widget_list_object_append(li, o, 1, 0, 0.0);
776 o = e_widget_radio_add(evas, _("Utility"), ECORE_X_WINDOW_TYPE_UTILITY, rg);
777 e_widget_list_object_append(li, o, 1, 0, 0.0);
779 e_widget_size_min_get(li, &mw, &mh);
780 evas_object_resize(li, mw, mh);
782 sf = e_widget_scrollframe_simple_add(evas, li);
783 e_widget_toolbook_page_append(tb, NULL, _("Types"), sf,
784 1, 1, 1, 1, 0.5, 0.0);
787 m->borderless = m->match.borderless;
788 m->dialog = m->match.dialog;
789 m->accepts_focus = m->match.accepts_focus;
790 m->vkbd = m->match.vkbd;
791 m->quickpanel = m->match.quickpanel;
792 m->argb = m->match.argb;
793 m->fullscreen = m->match.fullscreen;
794 m->modal = m->match.modal;
797 tab2 = e_widget_table_add(evas, 0);
798 lb = e_widget_label_add(evas, _("Unused"));
799 e_widget_table_object_append(tab2, lb, 1, row, 1, 1, 0, 0, 0, 0);
800 lb = e_widget_label_add(evas, _("On"));
801 e_widget_table_object_append(tab2, lb, 2, row, 1, 1, 0, 0, 0, 0);
802 lb = e_widget_label_add(evas, _("Off"));
803 e_widget_table_object_append(tab2, lb, 3, row, 1, 1, 0, 0, 0, 0);
806 if (cfdata->edit_il == cfdata->borders_il)
808 lb = e_widget_label_add(evas, _("Borderless"));
809 e_widget_table_object_append(tab2, lb, 0, row, 1, 1, 1, 0, 1, 0);
810 rg = e_widget_radio_group_new(&m->borderless);
811 o = e_widget_radio_add(evas, NULL, 0, rg);
812 e_widget_table_object_append(tab2, o, 1, row, 1, 1, 0, 0, 0, 0);
813 o = e_widget_radio_add(evas, NULL, 1, rg);
814 e_widget_table_object_append(tab2, o, 2, row, 1, 1, 0, 0, 0, 0);
815 o = e_widget_radio_add(evas, NULL, -1, rg);
816 e_widget_table_object_append(tab2, o, 3, row, 1, 1, 0, 0, 0, 0);
819 if (cfdata->edit_il == cfdata->borders_il)
821 lb = e_widget_label_add(evas, _("Dialog"));
822 e_widget_table_object_append(tab2, lb, 0, row, 1, 1, 1, 0, 1, 0);
823 rg = e_widget_radio_group_new(&m->dialog);
824 o = e_widget_radio_add(evas, NULL, 0, rg);
825 e_widget_table_object_append(tab2, o, 1, row, 1, 1, 0, 0, 0, 0);
826 o = e_widget_radio_add(evas, NULL, 1, rg);
827 e_widget_table_object_append(tab2, o, 2, row, 1, 1, 0, 0, 0, 0);
828 o = e_widget_radio_add(evas, NULL, -1, rg);
829 e_widget_table_object_append(tab2, o, 3, row, 1, 1, 0, 0, 0, 0);
832 if (cfdata->edit_il == cfdata->borders_il)
834 lb = e_widget_label_add(evas, _("Accepts Focus"));
835 e_widget_table_object_append(tab2, lb, 0, row, 1, 1, 1, 0, 1, 0);
836 rg = e_widget_radio_group_new(&m->accepts_focus);
837 o = e_widget_radio_add(evas, NULL, 0, rg);
838 e_widget_table_object_append(tab2, o, 1, row, 1, 1, 0, 0, 0, 0);
839 o = e_widget_radio_add(evas, NULL, 1, rg);
840 e_widget_table_object_append(tab2, o, 2, row, 1, 1, 0, 0, 0, 0);
841 o = e_widget_radio_add(evas, NULL, -1, rg);
842 e_widget_table_object_append(tab2, o, 3, row, 1, 1, 0, 0, 0, 0);
845 if (cfdata->edit_il == cfdata->borders_il)
847 lb = e_widget_label_add(evas, _("Virtual Keyboard"));
848 e_widget_table_object_append(tab2, lb, 0, row, 1, 1, 1, 0, 1, 0);
849 rg = e_widget_radio_group_new(&m->vkbd);
850 o = e_widget_radio_add(evas, NULL, 0, rg);
851 e_widget_table_object_append(tab2, o, 1, row, 1, 1, 0, 0, 0, 0);
852 o = e_widget_radio_add(evas, NULL, 1, rg);
853 e_widget_table_object_append(tab2, o, 2, row, 1, 1, 0, 0, 0, 0);
854 o = e_widget_radio_add(evas, NULL, -1, rg);
855 e_widget_table_object_append(tab2, o, 3, row, 1, 1, 0, 0, 0, 0);
858 if (cfdata->edit_il == cfdata->borders_il)
860 lb = e_widget_label_add(evas, _("Quick Panel"));
861 e_widget_table_object_append(tab2, lb, 0, row, 1, 1, 1, 0, 1, 0);
862 rg = e_widget_radio_group_new(&m->quickpanel);
863 o = e_widget_radio_add(evas, NULL, 0, rg);
864 e_widget_table_object_append(tab2, o, 1, row, 1, 1, 0, 0, 0, 0);
865 o = e_widget_radio_add(evas, NULL, 1, rg);
866 e_widget_table_object_append(tab2, o, 2, row, 1, 1, 0, 0, 0, 0);
867 o = e_widget_radio_add(evas, NULL, -1, rg);
868 e_widget_table_object_append(tab2, o, 3, row, 1, 1, 0, 0, 0, 0);
871 lb = e_widget_label_add(evas, _("ARGB"));
872 e_widget_table_object_append(tab2, lb, 0, row, 1, 1, 1, 0, 1, 0);
873 rg = e_widget_radio_group_new(&m->argb);
874 o = e_widget_radio_add(evas, NULL, 0, rg);
875 e_widget_table_object_append(tab2, o, 1, row, 1, 1, 0, 0, 0, 0);
876 o = e_widget_radio_add(evas, NULL, 1, rg);
877 e_widget_table_object_append(tab2, o, 2, row, 1, 1, 0, 0, 0, 0);
878 o = e_widget_radio_add(evas, NULL, -1, rg);
879 e_widget_table_object_append(tab2, o, 3, row, 1, 1, 0, 0, 0, 0);
881 if (cfdata->edit_il == cfdata->borders_il)
883 lb = e_widget_label_add(evas, _("Fullscreen"));
884 e_widget_table_object_append(tab2, lb, 0, row, 1, 1, 1, 0, 1, 0);
885 rg = e_widget_radio_group_new(&m->fullscreen);
886 o = e_widget_radio_add(evas, NULL, 0, rg);
887 e_widget_table_object_append(tab2, o, 1, row, 1, 1, 0, 0, 0, 0);
888 o = e_widget_radio_add(evas, NULL, 1, rg);
889 e_widget_table_object_append(tab2, o, 2, row, 1, 1, 0, 0, 0, 0);
890 o = e_widget_radio_add(evas, NULL, -1, rg);
891 e_widget_table_object_append(tab2, o, 3, row, 1, 1, 0, 0, 0, 0);
894 if (cfdata->edit_il == cfdata->borders_il)
896 lb = e_widget_label_add(evas, _("Modal"));
897 e_widget_table_object_append(tab2, lb, 0, row, 1, 1, 1, 0, 1, 0);
898 rg = e_widget_radio_group_new(&m->modal);
899 o = e_widget_radio_add(evas, NULL, 0, rg);
900 e_widget_table_object_append(tab2, o, 1, row, 1, 1, 0, 0, 0, 0);
901 o = e_widget_radio_add(evas, NULL, 1, rg);
902 e_widget_table_object_append(tab2, o, 2, row, 1, 1, 0, 0, 0, 0);
903 o = e_widget_radio_add(evas, NULL, -1, rg);
904 e_widget_table_object_append(tab2, o, 3, row, 1, 1, 0, 0, 0, 0);
907 e_widget_toolbook_page_append(tb, NULL, _("Flags"), tab2,
908 1, 1, 1, 1, 0.5, 0.0);
910 oi = _style_selector(evas, &(m->match.shadow_style));
911 e_widget_toolbook_page_append(tb, NULL, _("Style"), oi,
912 1, 1, 1, 1, 0.5, 0.0);
914 e_widget_frametable_object_append(of, tb, 0, 0, 1, 1, 1, 1, 1, 1);
915 e_widget_toolbook_page_show(tb, 0);
917 bt = e_widget_button_add(evas, _("OK"), NULL, _edit_ok, m, of);
918 e_widget_frametable_object_append(of, bt, 0, 1, 1, 1, 0, 0, 0, 0);
925 E_Config_Dialog *cfd = d1;
926 Evas_Object *il = d2;
930 e_widget_ilist_freeze(il);
931 n = e_widget_ilist_selected_get(il);
933 m = e_widget_ilist_nth_data_get(il, n);
936 e_widget_ilist_thaw(il);
939 e_widget_ilist_remove_num(il, n);
941 _match_ilist_append(il, m, n, 1);
942 e_widget_ilist_nth_show(il, n, 0);
943 e_widget_ilist_selected_set(il, n);
944 e_widget_ilist_thaw(il);
945 e_widget_ilist_go(il);
946 _match_list_up(&(cfd->cfdata->match.popups), m);
947 _match_list_up(&(cfd->cfdata->match.borders), m);
948 _match_list_up(&(cfd->cfdata->match.overrides), m);
949 _match_list_up(&(cfd->cfdata->match.menus), m);
950 cfd->cfdata->match.changed = 1;
957 E_Config_Dialog *cfd = d1;
958 Evas_Object *il = d2;
962 e_widget_ilist_freeze(il);
963 n = e_widget_ilist_selected_get(il);
964 if (n >= (e_widget_ilist_count(il) - 1)) return;
965 m = e_widget_ilist_nth_data_get(il, n);
968 e_widget_ilist_thaw(il);
971 e_widget_ilist_remove_num(il, n);
972 _match_ilist_append(il, m, n, 0);
973 e_widget_ilist_nth_show(il, n + 1, 0);
974 e_widget_ilist_selected_set(il, n + 1);
975 e_widget_ilist_thaw(il);
976 e_widget_ilist_go(il);
977 _match_list_down(&(cfd->cfdata->match.popups), m);
978 _match_list_down(&(cfd->cfdata->match.borders), m);
979 _match_list_down(&(cfd->cfdata->match.overrides), m);
980 _match_list_down(&(cfd->cfdata->match.menus), m);
981 cfd->cfdata->match.changed = 1;
988 E_Config_Dialog *cfd = d1;
989 Evas_Object *il = d2;
993 m = E_NEW(Match_Config, 1);
995 m->match.title = NULL;
996 m->match.name = NULL;
997 m->match.clas = NULL;
998 m->match.role = NULL;
999 m->match.shadow_style = eina_stringshare_add("default");
1001 if (il == cfd->cfdata->popups_il)
1002 cfd->cfdata->match.popups = eina_list_append(cfd->cfdata->match.popups, m);
1003 else if (il == cfd->cfdata->borders_il)
1004 cfd->cfdata->match.borders = eina_list_append(cfd->cfdata->match.borders, m);
1005 else if (il == cfd->cfdata->overrides_il)
1006 cfd->cfdata->match.overrides = eina_list_append(cfd->cfdata->match.overrides, m);
1007 else if (il == cfd->cfdata->menus_il)
1008 cfd->cfdata->match.menus = eina_list_append(cfd->cfdata->match.menus, m);
1009 e_widget_ilist_freeze(il);
1010 _match_ilist_append(il, m, -1, 0);
1011 e_widget_ilist_thaw(il);
1012 e_widget_ilist_go(il);
1013 n = e_widget_ilist_count(il);
1014 e_widget_ilist_nth_show(il, n - 1, 0);
1015 e_widget_ilist_selected_set(il, n - 1);
1017 cfd->cfdata->edit_il = il;
1018 _create_edit_frame(cfd, evas_object_evas_get(il), cfd->cfdata, m);
1019 cfd->cfdata->match.changed = 1;
1026 E_Config_Dialog *cfd = d1;
1027 Evas_Object *il = d2;
1031 e_widget_ilist_freeze(il);
1032 n = e_widget_ilist_selected_get(il);
1033 m = e_widget_ilist_nth_data_get(il, n);
1036 e_widget_ilist_thaw(il);
1039 e_widget_ilist_remove_num(il, n);
1040 e_widget_ilist_thaw(il);
1041 e_widget_ilist_go(il);
1042 _match_list_del(&(cfd->cfdata->match.popups), m);
1043 _match_list_del(&(cfd->cfdata->match.borders), m);
1044 _match_list_del(&(cfd->cfdata->match.overrides), m);
1045 _match_list_del(&(cfd->cfdata->match.menus), m);
1046 cfd->cfdata->match.changed = 1;
1053 E_Config_Dialog *cfd = d1;
1054 Evas_Object *il = d2;
1058 n = e_widget_ilist_selected_get(il);
1059 m = e_widget_ilist_nth_data_get(il, n);
1062 cfd->cfdata->edit_il = il;
1063 _create_edit_frame(cfd, evas_object_evas_get(il), cfd->cfdata, m);
1064 cfd->cfdata->match.changed = 1;
1067 static Evas_Object *
1068 _create_match_editor(E_Config_Dialog *cfd,
1070 E_Config_Dialog_Data *cfdata __UNUSED__,
1071 Eina_List **matches,
1072 Evas_Object **il_ret)
1074 Evas_Object *tab, *il, *bt;
1078 tab = e_widget_table_add(evas, 0);
1080 il = e_widget_ilist_add(evas, 16, 16, NULL);
1081 e_widget_size_min_set(il, 160, 100);
1083 EINA_LIST_FOREACH(*matches, l, m)
1085 _match_ilist_append(il, m, -1, 0);
1088 e_widget_ilist_go(il);
1089 e_widget_table_object_append(tab, il, 0, 0, 1, 5, 1, 1, 1, 1);
1091 bt = e_widget_button_add(evas, _("Up"), NULL, _but_up, cfd, il);
1092 e_widget_table_object_append(tab, bt, 1, 0, 1, 1, 1, 1, 0, 0);
1093 bt = e_widget_button_add(evas, _("Down"), NULL, _but_down, cfd, il);
1094 e_widget_table_object_append(tab, bt, 1, 1, 1, 1, 1, 1, 0, 0);
1095 bt = e_widget_button_add(evas, _("Add"), NULL, _but_add, cfd, il);
1096 e_widget_table_object_append(tab, bt, 1, 2, 1, 1, 1, 1, 0, 0);
1097 bt = e_widget_button_add(evas, _("Del"), NULL, _but_del, cfd, il);
1098 e_widget_table_object_append(tab, bt, 1, 3, 1, 1, 1, 1, 0, 0);
1099 bt = e_widget_button_add(evas, _("Edit"), NULL, _but_edit, cfd, il);
1100 e_widget_table_object_append(tab, bt, 1, 4, 1, 1, 1, 1, 0, 0);
1107 static Evas_Object *
1108 _create_styles_toolbook(E_Config_Dialog *cfd,
1110 E_Config_Dialog_Data *cfdata)
1112 Evas_Object *tb, *oi, *il;
1114 tb = e_widget_toolbook_add(evas, 48 * e_scale, 48 * e_scale);
1116 oi = _style_selector(evas, &(cfdata->shadow_style));
1117 e_widget_toolbook_page_append(tb, NULL, _("Default"), oi, 1, 1, 1, 1, 0.5, 0.0);
1119 oi = _create_match_editor(cfd, evas, cfdata, &(cfdata->match.borders), &il);
1120 cfdata->borders_il = il;
1121 e_widget_toolbook_page_append(tb, NULL, _("Apps"), oi, 1, 1, 1, 1, 0.5, 0.0);
1123 oi = _create_match_editor(cfd, evas, cfdata, &(cfdata->match.popups), &il);
1124 cfdata->popups_il = il;
1125 e_widget_toolbook_page_append(tb, NULL, _("E"), oi, 1, 1, 1, 1, 0.5, 0.0);
1127 oi = _create_match_editor(cfd, evas, cfdata, &(cfdata->match.overrides), &il);
1128 cfdata->overrides_il = il;
1129 e_widget_toolbook_page_append(tb, NULL, _("Over"), oi, 1, 1, 1, 1, 0.5, 0.0);
1131 oi = _create_match_editor(cfd, evas, cfdata, &(cfdata->match.menus), &il);
1132 cfdata->menus_il = il;
1133 e_widget_toolbook_page_append(tb, NULL, _("Menus"), oi, 1, 1, 1, 1, 0.5, 0.0);
1135 e_widget_toolbook_page_show(tb, 0);
1140 static Evas_Object *
1141 _advanced_create_widgets(E_Config_Dialog *cfd,
1143 E_Config_Dialog_Data *cfdata)
1145 Evas_Object *ob,*ol, *ol2, *of, *otb, *oi, *orec0, *tab;
1148 orec0 = evas_object_rectangle_add(evas);
1149 evas_object_name_set(orec0, "style_shadows");
1151 tab = e_widget_table_add(evas, 0);
1152 evas_object_name_set(tab, "dia_table");
1154 otb = e_widget_toolbook_add(evas, 48 * e_scale, 48 * e_scale);
1156 ///////////////////////////////////////////
1157 ol = e_widget_list_add(evas, 0, 0);
1158 ob = e_widget_check_add(evas, _("Limit framerate"), &(cfdata->lock_fps));
1159 e_widget_list_object_append(ol, ob, 1, 0, 0.5);
1160 ob = e_widget_check_add(evas, _("Smooth scaling"), &(cfdata->smooth_windows));
1161 e_widget_list_object_append(ol, ob, 1, 0, 0.5);
1163 of = e_widget_frametable_add(evas, _("Styles"), 0);
1164 e_widget_frametable_content_align_set(of, 0.5, 0.5);
1165 oi = _create_styles_toolbook(cfd, evas, cfdata);
1166 e_widget_frametable_object_append(of, oi, 0, 0, 1, 1, 1, 1, 1, 1);
1167 e_widget_list_object_append(ol, of, 1, 1, 0.5);
1169 e_widget_toolbook_page_append(otb, NULL, _("Effects"), ol, 1, 1, 1, 1, 0.5, 0.0);
1171 ///////////////////////////////////////////
1172 ol = e_widget_list_add(evas, 0, 0);
1173 ob = e_widget_check_add(evas, _("Tear-free updates (VSynced)"), &(cfdata->vsync));
1174 e_widget_list_object_append(ol, ob, 1, 1, 0.5);
1175 ob = e_widget_check_add(evas, _("Sync windows"), &(cfdata->efl_sync));
1176 e_widget_list_object_append(ol, ob, 1, 1, 0.5);
1177 ob = e_widget_check_add(evas, _("Loose sync"), &(cfdata->loose_sync));
1178 e_widget_list_object_append(ol, ob, 1, 1, 0.5);
1179 ob = e_widget_check_add(evas, _("Grab Server during draw"), &(cfdata->grab));
1180 e_widget_list_object_append(ol, ob, 1, 1, 0.5);
1181 ob = e_widget_label_add(evas, _("Initial draw timeout for newly mapped windows"));
1182 e_widget_list_object_append(ol, ob, 1, 1, 0.5);
1183 ob = e_widget_slider_add(evas, 1, 0, _("%1.2f Seconds"), 0.01, 0.5, 0.01, 0, &(cfdata->first_draw_delay), NULL, 150);
1184 e_widget_list_object_append(ol, ob, 1, 1, 0.5);
1185 e_widget_toolbook_page_append(otb, NULL, _("Sync"), ol, 0, 0, 0, 0, 0.5, 0.0);
1187 ///////////////////////////////////////////
1188 ol = e_widget_list_add(evas, 0, 0);
1189 rg = e_widget_radio_group_new(&(cfdata->engine));
1190 ob = e_widget_radio_add(evas, _("Software"), ENGINE_SW, rg);
1191 e_widget_list_object_append(ol, ob, 1, 1, 0.5);
1192 if (!getenv("ECORE_X_NO_XLIB"))
1194 if (ecore_evas_engine_type_supported_get(ECORE_EVAS_ENGINE_OPENGL_X11))
1196 ob = e_widget_radio_add(evas, _("OpenGL"), ENGINE_GL, rg);
1197 e_widget_list_object_append(ol, ob, 1, 1, 0.5);
1199 of = e_widget_framelist_add(evas, _("OpenGL options"), 0);
1200 e_widget_framelist_content_align_set(of, 0.5, 0.0);
1201 ob = e_widget_check_add(evas, _("Texture from pixmap"), &(cfdata->texture_from_pixmap));
1202 e_widget_framelist_object_append(of, ob);
1203 ob = e_widget_check_add(evas, _("Indirect OpenGL (EXPERIMENTAL)"), &(cfdata->indirect));
1204 e_widget_framelist_object_append(of, ob);
1205 e_widget_list_object_append(ol, of, 1, 1, 0.5);
1208 e_widget_toolbook_page_append(otb, NULL, _("Engine"), ol, 0, 0, 0, 0, 0.5, 0.0);
1210 ///////////////////////////////////////////
1211 ol = e_widget_list_add(evas, 0, 0);
1212 ob = e_widget_check_add(evas, _("Send flush"), &(cfdata->send_flush));
1213 e_widget_list_object_append(ol, ob, 1, 1, 0.5);
1214 ob = e_widget_check_add(evas, _("Send dump"), &(cfdata->send_dump));
1215 e_widget_list_object_append(ol, ob, 1, 1, 0.5);
1216 ob = e_widget_check_add(evas, _("Don't composite fullscreen windows"), &(cfdata->nocomp_fs));
1217 e_widget_list_object_append(ol, ob, 1, 1, 0.5);
1218 ob = e_widget_check_add(evas, _("Keep hidden windows"), &(cfdata->keep_unmapped));
1219 e_widget_list_object_append(ol, ob, 1, 1, 0.5);
1220 of = e_widget_frametable_add(evas, _("Maximum hidden pixels"), 0);
1221 e_widget_frametable_content_align_set(of, 0.5, 0.5);
1222 rg = e_widget_radio_group_new(&(cfdata->max_unmapped_pixels));
1223 ob = e_widget_radio_add(evas, _("1M"), 1 * 1024, rg);
1224 e_widget_frametable_object_append(of, ob, 0, 0, 1, 1, 1, 1, 0, 0);
1225 ob = e_widget_radio_add(evas, _("2M"), 2 * 1024, rg);
1226 e_widget_frametable_object_append(of, ob, 0, 1, 1, 1, 1, 1, 0, 0);
1227 ob = e_widget_radio_add(evas, _("4M"), 4 * 1024, rg);
1228 e_widget_frametable_object_append(of, ob, 0, 2, 1, 1, 1, 1, 0, 0);
1229 ob = e_widget_radio_add(evas, _("8M"), 8 * 1024, rg);
1230 e_widget_frametable_object_append(of, ob, 1, 0, 1, 1, 1, 1, 0, 0);
1231 ob = e_widget_radio_add(evas, _("16M"), 16 * 1024, rg);
1232 e_widget_frametable_object_append(of, ob, 1, 1, 1, 1, 1, 1, 0, 0);
1233 ob = e_widget_radio_add(evas, _("32M"), 32 * 1024, rg);
1234 e_widget_frametable_object_append(of, ob, 1, 2, 1, 1, 1, 1, 0, 0);
1235 ob = e_widget_radio_add(evas, _("64M"), 64 * 1024, rg);
1236 e_widget_frametable_object_append(of, ob, 2, 0, 1, 1, 1, 1, 0, 0);
1237 ob = e_widget_radio_add(evas, _("128M"), 128 * 1024, rg);
1238 e_widget_frametable_object_append(of, ob, 2, 1, 1, 1, 1, 1, 0, 0);
1239 ob = e_widget_radio_add(evas, _("256M"), 256 * 1024, rg);
1240 e_widget_frametable_object_append(of, ob, 2, 2, 1, 1, 1, 1, 0, 0);
1241 e_widget_list_object_append(ol, of, 1, 1, 0.5);
1242 e_widget_toolbook_page_append(otb, NULL, _("Memory"), ol, 0, 0, 0, 0, 0.5, 0.0);
1244 ///////////////////////////////////////////
1245 ol = e_widget_list_add(evas, 0, 0);
1246 ol2 = e_widget_list_add(evas, 1, 1);
1247 of = e_widget_framelist_add(evas, _("Min hidden"), 0);
1248 e_widget_framelist_content_align_set(of, 0.5, 0.0);
1249 rg = e_widget_radio_group_new(&(cfdata->min_unmapped_time));
1250 ob = e_widget_radio_add(evas, _("30 Seconds"), 30, rg);
1251 e_widget_framelist_object_append(of, ob);
1252 ob = e_widget_radio_add(evas, _("1 Minute"), 60, rg);
1253 e_widget_framelist_object_append(of, ob);
1254 ob = e_widget_radio_add(evas, _("5 Minutes"), 5 * 60, rg);
1255 e_widget_framelist_object_append(of, ob);
1256 ob = e_widget_radio_add(evas, _("30 Minutes"), 30 * 60, rg);
1257 e_widget_framelist_object_append(of, ob);
1258 ob = e_widget_radio_add(evas, _("2 Hours"), 2 * 3600, rg);
1259 e_widget_framelist_object_append(of, ob);
1260 ob = e_widget_radio_add(evas, _("10 Hours"), 10 * 3600, rg);
1261 e_widget_framelist_object_append(of, ob);
1262 ob = e_widget_radio_add(evas, _("Forever"), 0, rg);
1263 e_widget_framelist_object_append(of, ob);
1264 e_widget_list_object_append(ol2, of, 1, 1, 0.5);
1265 of = e_widget_framelist_add(evas, _("Max hidden"), 0);
1266 e_widget_framelist_content_align_set(of, 0.5, 0.0);
1267 rg = e_widget_radio_group_new(&(cfdata->max_unmapped_time));
1268 ob = e_widget_radio_add(evas, _("30 Seconds"), 30, rg);
1269 e_widget_framelist_object_append(of, ob);
1270 ob = e_widget_radio_add(evas, _("1 Minute"), 60, rg);
1271 e_widget_framelist_object_append(of, ob);
1272 ob = e_widget_radio_add(evas, _("5 Minutes"), 5 * 60, rg);
1273 e_widget_framelist_object_append(of, ob);
1274 ob = e_widget_radio_add(evas, _("30 Minutes"), 30 * 60, rg);
1275 e_widget_framelist_object_append(of, ob);
1276 ob = e_widget_radio_add(evas, _("2 Hours"), 2 * 3600, rg);
1277 e_widget_framelist_object_append(of, ob);
1278 ob = e_widget_radio_add(evas, _("10 Hours"), 10 * 3600, rg);
1279 e_widget_framelist_object_append(of, ob);
1280 ob = e_widget_radio_add(evas, _("Forever"), 0, rg);
1281 e_widget_framelist_object_append(of, ob);
1282 e_widget_list_object_append(ol2, of, 1, 1, 0.5);
1283 e_widget_list_object_append(ol, ol2, 1, 1, 0.5);
1284 e_widget_toolbook_page_append(otb, NULL, _("Timeouts"), ol, 0, 0, 0, 0, 0.5, 0.0);
1286 ///////////////////////////////////////////
1287 ol = e_widget_list_add(evas, 0, 0);
1289 ob = e_widget_check_add(evas, _("Show Framerate"), &(cfdata->fps_show));
1290 e_widget_list_object_append(ol, ob, 1, 1, 0.5);
1291 ob = e_widget_label_add(evas, _("Rolling average frame count"));
1292 e_widget_list_object_append(ol, ob, 1, 1, 0.5);
1293 ob = e_widget_slider_add(evas, 1, 0, _("%1.0f Frames"), 1, 120, 1, 0,
1294 NULL, &(cfdata->fps_average_range), 240);
1295 e_widget_list_object_append(ol, ob, 1, 1, 0.5);
1297 of = e_widget_frametable_add(evas, _("Corner"), 0);
1298 e_widget_frametable_content_align_set(of, 0.5, 0.5);
1299 rg = e_widget_radio_group_new(&(cfdata->fps_corner));
1300 ob = e_widget_radio_icon_add(evas, "Top Left", "preferences-position-top-left",
1302 e_widget_frametable_object_append(of, ob, 0, 0, 1, 1, 1, 1, 1, 1);
1303 ob = e_widget_radio_icon_add(evas, "Top Right", "preferences-position-top-right",
1305 e_widget_frametable_object_append(of, ob, 1, 0, 1, 1, 1, 1, 1, 1);
1306 ob = e_widget_radio_icon_add(evas, "Bottom Left", "preferences-position-bottom-left",
1308 e_widget_frametable_object_append(of, ob, 0, 1, 1, 1, 1, 1, 1, 1);
1309 ob = e_widget_radio_icon_add(evas, "Bottom Right", "preferences-position-bottom-right",
1311 e_widget_frametable_object_append(of, ob, 1, 1, 1, 1, 1, 1, 1, 1);
1312 e_widget_list_object_append(ol, of, 1, 1, 0.5);
1314 e_widget_toolbook_page_append(otb, NULL, _("Debug"), ol, 0, 0, 0, 0, 0.5, 0.0);
1316 e_widget_toolbook_page_show(otb, 0);
1318 e_dialog_resizable_set(cfd->dia, 1);
1320 e_widget_table_object_append(tab, otb, 0, 0, 1, 1, 1, 1, 1, 1);
1325 _match_list_free(Eina_List *list)
1329 EINA_LIST_FREE(list, m)
1331 if (m->title) eina_stringshare_del(m->title);
1332 if (m->name) eina_stringshare_del(m->name);
1333 if (m->clas) eina_stringshare_del(m->clas);
1334 if (m->role) eina_stringshare_del(m->role);
1335 if (m->shadow_style) eina_stringshare_del(m->shadow_style);
1341 _match_dup2(Match_Config *m2,
1345 if (m->title) m->title = eina_stringshare_add(m->title);
1346 if (m->name) m->name = eina_stringshare_add(m->name);
1347 if (m->clas) m->clas = eina_stringshare_add(m->clas);
1348 if (m->role) m->role = eina_stringshare_add(m->role);
1349 if (m->shadow_style) m->shadow_style = eina_stringshare_add(m->shadow_style);
1353 _advanced_apply_data(E_Config_Dialog *cfd __UNUSED__,
1354 E_Config_Dialog_Data *cfdata)
1356 if ((cfdata->lock_fps != _comp_mod->conf->lock_fps) ||
1357 (cfdata->smooth_windows != _comp_mod->conf->smooth_windows) ||
1358 (cfdata->grab != _comp_mod->conf->grab) ||
1359 (cfdata->keep_unmapped != _comp_mod->conf->keep_unmapped) ||
1360 (cfdata->nocomp_fs != _comp_mod->conf->nocomp_fs) ||
1361 (cfdata->shadow_style != _comp_mod->conf->shadow_style) ||
1362 (cfdata->max_unmapped_pixels != _comp_mod->conf->max_unmapped_pixels) ||
1363 (cfdata->max_unmapped_time != _comp_mod->conf->max_unmapped_time) ||
1364 (cfdata->min_unmapped_time != _comp_mod->conf->min_unmapped_time) ||
1365 (cfdata->send_flush != _comp_mod->conf->send_flush) ||
1366 (cfdata->send_dump != _comp_mod->conf->send_dump) ||
1367 (cfdata->fps_show != _comp_mod->conf->fps_show) ||
1368 (cfdata->fps_corner != _comp_mod->conf->fps_corner) ||
1369 (cfdata->fps_average_range != _comp_mod->conf->fps_average_range) ||
1370 (cfdata->first_draw_delay != _comp_mod->conf->first_draw_delay) ||
1371 (cfdata->match.changed)
1374 if (cfdata->match.changed)
1380 _match_list_free(_comp_mod->conf->match.popups);
1381 _match_list_free(_comp_mod->conf->match.borders);
1382 _match_list_free(_comp_mod->conf->match.overrides);
1383 _match_list_free(_comp_mod->conf->match.menus);
1385 _comp_mod->conf->match.popups = NULL;
1386 _comp_mod->conf->match.borders = NULL;
1387 _comp_mod->conf->match.overrides = NULL;
1388 _comp_mod->conf->match.menus = NULL;
1390 EINA_LIST_FOREACH(cfdata->match.popups, l, m2)
1392 m = E_NEW(Match, 1);
1394 _comp_mod->conf->match.popups =
1395 eina_list_append(_comp_mod->conf->match.popups, m);
1397 EINA_LIST_FOREACH(cfdata->match.borders, l, m2)
1399 m = E_NEW(Match, 1);
1401 _comp_mod->conf->match.borders =
1402 eina_list_append(_comp_mod->conf->match.borders, m);
1404 EINA_LIST_FOREACH(cfdata->match.overrides, l, m2)
1406 m = E_NEW(Match, 1);
1408 _comp_mod->conf->match.overrides =
1409 eina_list_append(_comp_mod->conf->match.overrides, m);
1411 EINA_LIST_FOREACH(cfdata->match.menus, l, m2)
1413 m = E_NEW(Match, 1);
1415 _comp_mod->conf->match.menus =
1416 eina_list_append(_comp_mod->conf->match.menus, m);
1418 cfdata->match.changed = 0;
1420 _comp_mod->conf->lock_fps = cfdata->lock_fps;
1421 _comp_mod->conf->smooth_windows = cfdata->smooth_windows;
1422 _comp_mod->conf->grab = cfdata->grab;
1423 _comp_mod->conf->keep_unmapped = cfdata->keep_unmapped;
1424 _comp_mod->conf->nocomp_fs = cfdata->nocomp_fs;
1425 _comp_mod->conf->max_unmapped_pixels = cfdata->max_unmapped_pixels;
1426 _comp_mod->conf->max_unmapped_time = cfdata->max_unmapped_time;
1427 _comp_mod->conf->min_unmapped_time = cfdata->min_unmapped_time;
1428 _comp_mod->conf->send_flush = cfdata->send_flush;
1429 _comp_mod->conf->send_dump = cfdata->send_dump;
1430 _comp_mod->conf->fps_show = cfdata->fps_show;
1431 _comp_mod->conf->fps_corner = cfdata->fps_corner;
1432 _comp_mod->conf->fps_average_range = cfdata->fps_average_range;
1433 _comp_mod->conf->first_draw_delay = cfdata->first_draw_delay;
1434 if (_comp_mod->conf->shadow_style)
1435 eina_stringshare_del(_comp_mod->conf->shadow_style);
1436 _comp_mod->conf->shadow_style = NULL;
1437 if (cfdata->shadow_style)
1438 _comp_mod->conf->shadow_style = eina_stringshare_add(cfdata->shadow_style);
1439 e_mod_comp_shadow_set();
1441 if ((cfdata->engine != _comp_mod->conf->engine) ||
1442 (cfdata->indirect != _comp_mod->conf->indirect) ||
1443 (cfdata->texture_from_pixmap != _comp_mod->conf->texture_from_pixmap) ||
1444 (cfdata->efl_sync != _comp_mod->conf->efl_sync) ||
1445 (cfdata->loose_sync != _comp_mod->conf->loose_sync) ||
1446 (cfdata->vsync != _comp_mod->conf->vsync))
1450 _comp_mod->conf->engine = cfdata->engine;
1451 _comp_mod->conf->indirect = cfdata->indirect;
1452 _comp_mod->conf->texture_from_pixmap = cfdata->texture_from_pixmap;
1453 _comp_mod->conf->efl_sync = cfdata->efl_sync;
1454 _comp_mod->conf->loose_sync = cfdata->loose_sync;
1455 _comp_mod->conf->vsync = cfdata->vsync;
1457 a = e_action_find("restart");
1458 if ((a) && (a->func.go)) a->func.go(NULL, NULL);
1459 // e_mod_comp_shutdown();
1460 // e_mod_comp_init();
1462 e_config_save_queue();
1466 static Evas_Object *
1467 _basic_create_widgets(E_Config_Dialog *cfd,
1469 E_Config_Dialog_Data *cfdata)
1471 Evas_Object *ob,*ol, *of, *otb, *oi, *orec0, *tab;
1474 orec0 = evas_object_rectangle_add(evas);
1475 evas_object_name_set(orec0, "style_shadows");
1477 tab = e_widget_table_add(evas, 0);
1478 evas_object_name_set(tab, "dia_table");
1480 otb = e_widget_toolbook_add(evas, 48 * e_scale, 48 * e_scale);
1482 ///////////////////////////////////////////
1483 ol = e_widget_list_add(evas, 0, 0);
1485 ob = e_widget_check_add(evas, _("Tear-free updates (VSynced)"), &(cfdata->vsync));
1486 e_widget_list_object_append(ol, ob, 1, 0, 0.5);
1488 ob = e_widget_check_add(evas, _("Smooth scaling of window content"), &(cfdata->smooth_windows));
1489 e_widget_list_object_append(ol, ob, 1, 0, 0.5);
1491 ob = e_widget_check_add(evas, _("Don't composite fullscreen windows"), &(cfdata->nocomp_fs));
1492 e_widget_list_object_append(ol, ob, 1, 0, 0.5);
1494 of = e_widget_frametable_add(evas, _("Select default style"), 0);
1495 e_widget_frametable_content_align_set(of, 0.5, 0.5);
1496 oi = _style_selector(evas, &(cfdata->shadow_style));
1497 e_widget_frametable_object_append(of, oi, 0, 0, 1, 1, 1, 1, 1, 1);
1498 e_widget_list_object_append(ol, of, 1, 1, 0.5);
1500 e_widget_toolbook_page_append(otb, NULL, _("General"), ol, 1, 1, 1, 1, 0.5, 0.0);
1502 ///////////////////////////////////////////
1503 ol = e_widget_list_add(evas, 0, 0);
1504 rg = e_widget_radio_group_new(&(cfdata->engine));
1505 ob = e_widget_radio_add(evas, _("Software"), ENGINE_SW, rg);
1506 e_widget_list_object_append(ol, ob, 1, 1, 0.5);
1507 if (!getenv("ECORE_X_NO_XLIB"))
1509 if (ecore_evas_engine_type_supported_get(ECORE_EVAS_ENGINE_OPENGL_X11))
1511 ob = e_widget_radio_add(evas, _("OpenGL"), ENGINE_GL, rg);
1512 e_widget_list_object_append(ol, ob, 1, 1, 0.5);
1515 ob = e_widget_label_add(evas, _("To reset compositor:"));
1516 e_widget_list_object_append(ol, ob, 1, 1, 0.5);
1517 ob = e_widget_label_add(evas, _("Ctrl+Alt+Shift+Home"));
1518 e_widget_list_object_append(ol, ob, 1, 1, 0.5);
1520 e_widget_toolbook_page_append(otb, NULL, _("Rendering"), ol, 0, 0, 0, 0, 0.5, 0.0);
1522 e_widget_toolbook_page_show(otb, 0);
1524 e_dialog_resizable_set(cfd->dia, 1);
1526 e_widget_table_object_append(tab, otb, 0, 0, 1, 1, 1, 1, 1, 1);
1531 _basic_apply_data(E_Config_Dialog *cfd __UNUSED__,
1532 E_Config_Dialog_Data *cfdata)
1534 if ((cfdata->lock_fps != _comp_mod->conf->lock_fps) ||
1535 (cfdata->smooth_windows != _comp_mod->conf->smooth_windows) ||
1536 (cfdata->grab != _comp_mod->conf->grab) ||
1537 (cfdata->keep_unmapped != _comp_mod->conf->keep_unmapped) ||
1538 (cfdata->nocomp_fs != _comp_mod->conf->nocomp_fs) ||
1539 (cfdata->shadow_style != _comp_mod->conf->shadow_style) ||
1540 (cfdata->max_unmapped_pixels != _comp_mod->conf->max_unmapped_pixels) ||
1541 (cfdata->max_unmapped_time != _comp_mod->conf->max_unmapped_time) ||
1542 (cfdata->min_unmapped_time != _comp_mod->conf->min_unmapped_time) ||
1543 (cfdata->send_flush != _comp_mod->conf->send_flush) ||
1544 (cfdata->send_dump != _comp_mod->conf->send_dump) ||
1545 (cfdata->fps_show != _comp_mod->conf->fps_show) ||
1546 (cfdata->fps_corner != _comp_mod->conf->fps_corner) ||
1547 (cfdata->fps_average_range != _comp_mod->conf->fps_average_range) ||
1548 (cfdata->first_draw_delay != _comp_mod->conf->first_draw_delay) ||
1549 (cfdata->match.changed)
1552 if (cfdata->match.changed)
1558 _match_list_free(_comp_mod->conf->match.popups);
1559 _match_list_free(_comp_mod->conf->match.borders);
1560 _match_list_free(_comp_mod->conf->match.overrides);
1561 _match_list_free(_comp_mod->conf->match.menus);
1563 _comp_mod->conf->match.popups = NULL;
1564 _comp_mod->conf->match.borders = NULL;
1565 _comp_mod->conf->match.overrides = NULL;
1566 _comp_mod->conf->match.menus = NULL;
1568 EINA_LIST_FOREACH(cfdata->match.popups, l, m2)
1570 m = E_NEW(Match, 1);
1572 _comp_mod->conf->match.popups =
1573 eina_list_append(_comp_mod->conf->match.popups, m);
1575 EINA_LIST_FOREACH(cfdata->match.borders, l, m2)
1577 m = E_NEW(Match, 1);
1579 _comp_mod->conf->match.borders =
1580 eina_list_append(_comp_mod->conf->match.borders, m);
1582 EINA_LIST_FOREACH(cfdata->match.overrides, l, m2)
1584 m = E_NEW(Match, 1);
1586 _comp_mod->conf->match.overrides =
1587 eina_list_append(_comp_mod->conf->match.overrides, m);
1589 EINA_LIST_FOREACH(cfdata->match.menus, l, m2)
1591 m = E_NEW(Match, 1);
1593 _comp_mod->conf->match.menus =
1594 eina_list_append(_comp_mod->conf->match.menus, m);
1596 cfdata->match.changed = 0;
1598 _comp_mod->conf->lock_fps = cfdata->lock_fps;
1599 _comp_mod->conf->smooth_windows = cfdata->smooth_windows;
1600 _comp_mod->conf->grab = cfdata->grab;
1601 _comp_mod->conf->keep_unmapped = cfdata->keep_unmapped;
1602 _comp_mod->conf->nocomp_fs = cfdata->nocomp_fs;
1603 _comp_mod->conf->max_unmapped_pixels = cfdata->max_unmapped_pixels;
1604 _comp_mod->conf->max_unmapped_time = cfdata->max_unmapped_time;
1605 _comp_mod->conf->min_unmapped_time = cfdata->min_unmapped_time;
1606 _comp_mod->conf->send_flush = cfdata->send_flush;
1607 _comp_mod->conf->send_dump = cfdata->send_dump;
1608 _comp_mod->conf->fps_show = cfdata->fps_show;
1609 _comp_mod->conf->fps_corner = cfdata->fps_corner;
1610 _comp_mod->conf->fps_average_range = cfdata->fps_average_range;
1611 _comp_mod->conf->first_draw_delay = cfdata->first_draw_delay;
1612 if (_comp_mod->conf->shadow_style)
1613 eina_stringshare_del(_comp_mod->conf->shadow_style);
1614 _comp_mod->conf->shadow_style = NULL;
1615 if (cfdata->shadow_style)
1616 _comp_mod->conf->shadow_style = eina_stringshare_add(cfdata->shadow_style);
1617 e_mod_comp_shadow_set();
1619 if ((cfdata->engine != _comp_mod->conf->engine) ||
1620 (cfdata->indirect != _comp_mod->conf->indirect) ||
1621 (cfdata->texture_from_pixmap != _comp_mod->conf->texture_from_pixmap) ||
1622 (cfdata->efl_sync != _comp_mod->conf->efl_sync) ||
1623 (cfdata->loose_sync != _comp_mod->conf->loose_sync) ||
1624 (cfdata->vsync != _comp_mod->conf->vsync))
1628 _comp_mod->conf->engine = cfdata->engine;
1629 _comp_mod->conf->indirect = cfdata->indirect;
1630 _comp_mod->conf->texture_from_pixmap = cfdata->texture_from_pixmap;
1631 _comp_mod->conf->efl_sync = cfdata->efl_sync;
1632 _comp_mod->conf->loose_sync = cfdata->loose_sync;
1633 _comp_mod->conf->vsync = cfdata->vsync;
1635 a = e_action_find("restart");
1636 if ((a) && (a->func.go)) a->func.go(NULL, NULL);
1637 // e_mod_comp_shutdown();
1638 // e_mod_comp_init();
1640 e_config_save_queue();