summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2013-01-03 14:47:21 +0000
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>2013-01-03 14:47:21 +0000
commit9e207e6f9275b1d6e34d90f435508fa523441f79 (patch)
tree3af2cfa40d8e6e01a085ee61406d0c99e486ec72
parent5cd9d5a35a64847fc4e510582839799900e172dc (diff)
conf2
SVN revision: 82078
-rw-r--r--.gitignore1
-rw-r--r--ChangeLog6
-rw-r--r--NEWS11
-rw-r--r--configure.ac2
-rw-r--r--src/bin/Makefile.am2
-rw-r--r--src/bin/e_config.c4
-rw-r--r--src/bin/e_config.h5
-rw-r--r--src/bin/e_configure_option.c2687
-rw-r--r--src/bin/e_configure_option.h172
-rw-r--r--src/bin/e_includes.h1
-rw-r--r--src/bin/e_main.c5
-rw-r--r--src/bin/e_module.c2
-rw-r--r--src/bin/e_remember.c3
-rw-r--r--src/bin/e_win.c10
-rw-r--r--src/bin/e_win.h1
-rw-r--r--src/modules/Makefile.am4
-rw-r--r--src/modules/Makefile_conf2.am74
-rw-r--r--src/modules/conf2/e-module-conf2.edc2192
-rw-r--r--src/modules/conf2/e_conf2.c1326
-rw-r--r--src/modules/conf2/e_mod_main.c381
-rw-r--r--src/modules/conf2/e_mod_main.h30
-rw-r--r--src/modules/conf2/images/volume_knob.pngbin0 -> 16375 bytes
-rw-r--r--src/modules/conf2/images/volume_knob_ledsoff.pngbin0 -> 4066 bytes
-rw-r--r--src/modules/conf2/images/volume_knob_move.pngbin0 -> 28115 bytes
-rw-r--r--src/modules/conf2/images/volume_led_01.pngbin0 -> 761 bytes
-rw-r--r--src/modules/conf2/images/volume_led_02.pngbin0 -> 757 bytes
-rw-r--r--src/modules/conf2/images/volume_led_03.pngbin0 -> 738 bytes
-rw-r--r--src/modules/conf2/images/volume_led_04.pngbin0 -> 742 bytes
-rw-r--r--src/modules/conf2/images/volume_led_05.pngbin0 -> 700 bytes
-rw-r--r--src/modules/conf2/images/volume_led_06.pngbin0 -> 710 bytes
-rw-r--r--src/modules/conf2/images/volume_led_07.pngbin0 -> 665 bytes
-rw-r--r--src/modules/conf2/images/volume_led_08.pngbin0 -> 585 bytes
-rw-r--r--src/modules/conf2/images/volume_led_09.pngbin0 -> 655 bytes
-rw-r--r--src/modules/conf2/images/volume_led_10.pngbin0 -> 705 bytes
-rw-r--r--src/modules/conf2/images/volume_led_11.pngbin0 -> 743 bytes
-rw-r--r--src/modules/conf2/images/volume_led_12.pngbin0 -> 738 bytes
-rw-r--r--src/modules/conf2/images/volume_led_13.pngbin0 -> 755 bytes
-rw-r--r--src/modules/conf2/images/volume_led_14.pngbin0 -> 755 bytes
-rw-r--r--src/modules/conf2/images/volume_led_15.pngbin0 -> 745 bytes
-rw-r--r--src/modules/conf2/images/volume_led_16.pngbin0 -> 716 bytes
-rw-r--r--src/modules/conf2/images/volume_led_17.pngbin0 -> 753 bytes
-rw-r--r--src/modules/conf2/images/volume_led_18.pngbin0 -> 752 bytes
-rw-r--r--src/modules/conf2/images/volume_led_19.pngbin0 -> 733 bytes
-rw-r--r--src/modules/conf2/images/volume_led_20.pngbin0 -> 716 bytes
-rw-r--r--src/modules/conf2/images/volume_led_21.pngbin0 -> 709 bytes
-rw-r--r--src/modules/conf2/images/volume_led_22.pngbin0 -> 681 bytes
-rw-r--r--src/modules/conf2/images/volume_led_23.pngbin0 -> 605 bytes
-rw-r--r--src/modules/conf2/images/volume_led_24.pngbin0 -> 692 bytes
-rw-r--r--src/modules/conf2/images/volume_led_25.pngbin0 -> 726 bytes
-rw-r--r--src/modules/conf2/images/volume_led_26.pngbin0 -> 699 bytes
-rw-r--r--src/modules/conf2/images/volume_led_27.pngbin0 -> 721 bytes
-rw-r--r--src/modules/conf2/images/volume_led_28.pngbin0 -> 748 bytes
-rw-r--r--src/modules/conf2/images/volume_led_29.pngbin0 -> 764 bytes
-rw-r--r--src/modules/conf2/images/volume_led_30.pngbin0 -> 740 bytes
-rw-r--r--src/modules/conf2/images/volume_led_31.pngbin0 -> 751 bytes
-rw-r--r--src/modules/conf2/images/volume_led_32.pngbin0 -> 761 bytes
-rw-r--r--src/modules/conf2/images/volume_led_33.pngbin0 -> 752 bytes
-rw-r--r--src/modules/conf2/images/volume_led_34.pngbin0 -> 723 bytes
-rw-r--r--src/modules/conf2/images/volume_led_35.pngbin0 -> 715 bytes
-rw-r--r--src/modules/conf2/images/volume_led_36.pngbin0 -> 694 bytes
-rw-r--r--src/modules/conf2/images/volume_led_37.pngbin0 -> 694 bytes
-rw-r--r--src/modules/conf2/images/volume_led_38.pngbin0 -> 600 bytes
-rw-r--r--src/modules/conf2/images/volume_led_39.pngbin0 -> 673 bytes
-rw-r--r--src/modules/conf2/images/volume_led_40.pngbin0 -> 695 bytes
-rw-r--r--src/modules/conf2/images/volume_led_41.pngbin0 -> 702 bytes
-rw-r--r--src/modules/conf2/images/volume_led_42.pngbin0 -> 730 bytes
-rw-r--r--src/modules/conf2/images/volume_led_43.pngbin0 -> 746 bytes
-rw-r--r--src/modules/conf2/images/volume_led_44.pngbin0 -> 751 bytes
-rw-r--r--src/modules/conf2/images/volume_led_45.pngbin0 -> 719 bytes
-rw-r--r--src/modules/conf2/module.desktop.in6
70 files changed, 6919 insertions, 6 deletions
diff --git a/.gitignore b/.gitignore
index 60b00be13..7b8f94223 100644
--- a/.gitignore
+++ b/.gitignore
@@ -118,6 +118,7 @@ src/modules/battery/module.desktop
118src/modules/clock/module.desktop 118src/modules/clock/module.desktop
119src/modules/comp/module.desktop 119src/modules/comp/module.desktop
120src/modules/conf/module.desktop 120src/modules/conf/module.desktop
121src/modules/conf2/e-module-conf2.edj
121src/modules/conf_applications/module.desktop 122src/modules/conf_applications/module.desktop
122src/modules/conf_dialogs/module.desktop 123src/modules/conf_dialogs/module.desktop
123src/modules/conf_display/module.desktop 124src/modules/conf_display/module.desktop
diff --git a/ChangeLog b/ChangeLog
index 2b606dbe4..e00fbdbaf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
12013-01-03 Mike Blumenkrantz
2
3 * Added e_win_elm_available()
4 * Added conf2 module
5 * Added e_configure_option API
6
12013-01-03 Carsten Haitzler 72013-01-03 Carsten Haitzler
2 8
3 * Fix translation of evrything strigns to include many more 9 * Fix translation of evrything strigns to include many more
diff --git a/NEWS b/NEWS
index 6670bb60f..4f7d3bee7 100644
--- a/NEWS
+++ b/NEWS
@@ -2,9 +2,14 @@ Changes since 0.17.0:
2--------------------- 2---------------------
3 3
4Additions: 4Additions:
5 * Added action to reset filemanager 5 Modules:
6 * Added function to hide all active menus 6 * conf2
7 * Added enum for deskflip animation mode 7 API:
8 * Added action to reset filemanager
9 * Added function to hide all active menus
10 * Added enum for deskflip animation mode
11 * Added e_win_elm_available()
12 * Added e_configure_option API
8 13
9Deprecations: 14Deprecations:
10 * 15 *
diff --git a/configure.ac b/configure.ac
index c6f1d4428..e016e65c5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -841,6 +841,7 @@ AC_E_OPTIONAL_MODULE([fileman], true)
841AC_E_OPTIONAL_MODULE([fileman_opinfo], true) 841AC_E_OPTIONAL_MODULE([fileman_opinfo], true)
842AC_E_OPTIONAL_MODULE([wizard], true) 842AC_E_OPTIONAL_MODULE([wizard], true)
843AC_E_OPTIONAL_MODULE([conf], true) 843AC_E_OPTIONAL_MODULE([conf], true)
844AC_E_OPTIONAL_MODULE([conf2], $have_elementary)
844AC_E_OPTIONAL_MODULE([conf_wallpaper2], true) 845AC_E_OPTIONAL_MODULE([conf_wallpaper2], true)
845AC_E_OPTIONAL_MODULE([conf_theme], true, true) 846AC_E_OPTIONAL_MODULE([conf_theme], true, true)
846AC_E_OPTIONAL_MODULE([conf_intl], true) 847AC_E_OPTIONAL_MODULE([conf_intl], true)
@@ -938,6 +939,7 @@ src/modules/winlist/module.desktop
938src/modules/fileman/module.desktop 939src/modules/fileman/module.desktop
939src/modules/fileman_opinfo/module.desktop 940src/modules/fileman_opinfo/module.desktop
940src/modules/conf/module.desktop 941src/modules/conf/module.desktop
942src/modules/conf2/module.desktop
941src/modules/conf_wallpaper2/module.desktop 943src/modules/conf_wallpaper2/module.desktop
942src/modules/conf_theme/module.desktop 944src/modules/conf_theme/module.desktop
943src/modules/conf_intl/module.desktop 945src/modules/conf_intl/module.desktop
diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am
index 8867f9513..0e6065a81 100644
--- a/src/bin/Makefile.am
+++ b/src/bin/Makefile.am
@@ -59,6 +59,7 @@ e_config_data.h \
59e_config_dialog.h \ 59e_config_dialog.h \
60e_config.h \ 60e_config.h \
61e_configure.h \ 61e_configure.h \
62e_configure_option.h \
62e_confirm_dialog.h \ 63e_confirm_dialog.h \
63e_container.h \ 64e_container.h \
64e_datastore.h \ 65e_datastore.h \
@@ -216,6 +217,7 @@ e_config.c \
216e_config_data.c \ 217e_config_data.c \
217e_config_dialog.c \ 218e_config_dialog.c \
218e_configure.c \ 219e_configure.c \
220e_configure_option.c \
219e_confirm_dialog.c \ 221e_confirm_dialog.c \
220e_container.c \ 222e_container.c \
221e_datastore.c \ 223e_datastore.c \
diff --git a/src/bin/e_config.c b/src/bin/e_config.c
index 082b06959..f9b46bbee 100644
--- a/src/bin/e_config.c
+++ b/src/bin/e_config.c
@@ -744,6 +744,7 @@ e_config_init(void)
744 E_CONFIG_VAL(D, T, transition_change, STR); /**/ 744 E_CONFIG_VAL(D, T, transition_change, STR); /**/
745 E_CONFIG_LIST(D, T, remembers, _e_config_remember_edd); 745 E_CONFIG_LIST(D, T, remembers, _e_config_remember_edd);
746 E_CONFIG_VAL(D, T, remember_internal_windows, INT); 746 E_CONFIG_VAL(D, T, remember_internal_windows, INT);
747 E_CONFIG_VAL(D, T, remember_internal_fm_windows, UCHAR);
747 E_CONFIG_VAL(D, T, move_info_follows, INT); /**/ 748 E_CONFIG_VAL(D, T, move_info_follows, INT); /**/
748 E_CONFIG_VAL(D, T, resize_info_follows, INT); /**/ 749 E_CONFIG_VAL(D, T, resize_info_follows, INT); /**/
749 E_CONFIG_VAL(D, T, move_info_visible, INT); /**/ 750 E_CONFIG_VAL(D, T, move_info_visible, INT); /**/
@@ -1080,6 +1081,8 @@ e_config_load(void)
1080 e_sys_action_do(E_SYS_RESTART, NULL); 1081 e_sys_action_do(E_SYS_RESTART, NULL);
1081 } 1082 }
1082 } 1083 }
1084 if (!e_config->remember_internal_fm_windows)
1085 e_config->remember_internal_fm_windows = !!(e_config->remember_internal_windows & E_REMEMBER_INTERNAL_FM_WINS);
1083 1086
1084 e_config->config_version = E_CONFIG_FILE_VERSION; 1087 e_config->config_version = E_CONFIG_FILE_VERSION;
1085 1088
@@ -1181,6 +1184,7 @@ e_config_load(void)
1181 E_CONFIG_LIMIT(e_config->fullscreen_flip, 0, 1); 1184 E_CONFIG_LIMIT(e_config->fullscreen_flip, 0, 1);
1182 E_CONFIG_LIMIT(e_config->icon_theme_overrides, 0, 1); 1185 E_CONFIG_LIMIT(e_config->icon_theme_overrides, 0, 1);
1183 E_CONFIG_LIMIT(e_config->remember_internal_windows, 0, 3); 1186 E_CONFIG_LIMIT(e_config->remember_internal_windows, 0, 3);
1187 E_CONFIG_LIMIT(e_config->remember_internal_fm_windows, 0, 1);
1184 E_CONFIG_LIMIT(e_config->desk_auto_switch, 0, 1); 1188 E_CONFIG_LIMIT(e_config->desk_auto_switch, 0, 1);
1185 1189
1186 E_CONFIG_LIMIT(e_config->screen_limits, 0, 2); 1190 E_CONFIG_LIMIT(e_config->screen_limits, 0, 2);
diff --git a/src/bin/e_config.h b/src/bin/e_config.h
index e97a1a42b..9956ce7f7 100644
--- a/src/bin/e_config.h
+++ b/src/bin/e_config.h
@@ -38,7 +38,7 @@ typedef struct _E_Event_Config_Icon_Theme E_Event_Config_Icon_Theme;
38/* increment this whenever a new set of config values are added but the users 38/* increment this whenever a new set of config values are added but the users
39 * config doesn't need to be wiped - simply new values need to be put in 39 * config doesn't need to be wiped - simply new values need to be put in
40 */ 40 */
41#define E_CONFIG_FILE_GENERATION 0 41#define E_CONFIG_FILE_GENERATION 1
42#define E_CONFIG_FILE_VERSION ((E_CONFIG_FILE_EPOCH * 1000000) + E_CONFIG_FILE_GENERATION) 42#define E_CONFIG_FILE_VERSION ((E_CONFIG_FILE_EPOCH * 1000000) + E_CONFIG_FILE_GENERATION)
43 43
44struct _E_Config 44struct _E_Config
@@ -144,6 +144,7 @@ struct _E_Config
144 const char *transition_change; // GUI 144 const char *transition_change; // GUI
145 Eina_List *remembers; // GUI 145 Eina_List *remembers; // GUI
146 int remember_internal_windows; // GUI 146 int remember_internal_windows; // GUI
147 Eina_Bool remember_internal_fm_windows; // GUI
147 int move_info_follows; // GUI 148 int move_info_follows; // GUI
148 int resize_info_follows; // GUI 149 int resize_info_follows; // GUI
149 int move_info_visible; // GUI 150 int move_info_visible; // GUI
@@ -378,7 +379,7 @@ struct _E_Config
378 const char *xft_rgba; 379 const char *xft_rgba;
379 const char *net_theme_name; // GUI 380 const char *net_theme_name; // GUI
380 const char *net_theme_name_detected; // not saved 381 const char *net_theme_name_detected; // not saved
381 const char *net_icon_theme_name; // GUI 382 const char *net_icon_theme_name;
382 const char *gtk_font_name; 383 const char *gtk_font_name;
383 } xsettings; 384 } xsettings;
384 385
diff --git a/src/bin/e_configure_option.c b/src/bin/e_configure_option.c
new file mode 100644
index 000000000..8f6938208
--- /dev/null
+++ b/src/bin/e_configure_option.c
@@ -0,0 +1,2687 @@
1#include "e.h"
2#include "e_fm_device.h"
3
4EAPI int E_EVENT_CONFIGURE_OPTION_CHANGED = -1;
5EAPI int E_EVENT_CONFIGURE_OPTION_ADD = -1;
6EAPI int E_EVENT_CONFIGURE_OPTION_DEL = -1;
7EAPI int E_EVENT_CONFIGURE_OPTION_CATEGORY_ADD = -1;
8EAPI int E_EVENT_CONFIGURE_OPTION_CATEGORY_DEL = -1;
9EAPI int E_EVENT_CONFIGURE_OPTION_TAG_ADD = -1;
10EAPI int E_EVENT_CONFIGURE_OPTION_TAG_DEL = -1;
11
12static Eio_File *theme_ls[2] = {NULL, NULL};
13static Eio_Monitor *theme_mon[2] = {NULL, NULL};
14static Eio_File *gtk_theme_ls = NULL;
15static Eina_List *gtk_theme_dirs = NULL; //Eio_File
16static Eio_Monitor *gtk_theme_mon = NULL;
17static Eina_List *gtk_theme_mons = NULL; //Eio_Monitor
18static Eio_File *bg_ls[2] = {NULL, NULL};
19static Eio_Monitor *bg_mon[2] = {NULL, NULL};
20static Eina_Inlist *opts_list = NULL;
21static Eina_Hash *tags_hash = NULL;/* tag:item */
22static Eina_List *tags_list = NULL;/* Eina_Stringshare */
23static Eina_List *opts_changed_list = NULL; //co->changed
24static Eina_List *handlers = NULL;
25static Eina_List *bgs = NULL;
26static Eina_List *sbgs = NULL;
27static Eina_List *themes = NULL;
28static Eina_List *sthemes = NULL;
29static Eina_List *gtk_themes = NULL;
30static Eina_Bool event_block = EINA_TRUE;
31static Eina_List *categories = NULL;
32static Eina_Hash *category_hash = NULL;
33static Eina_Hash *category_icon_hash = NULL;
34
35static void
36_e_configure_option_event_str_end(void *d EINA_UNUSED, E_Event_Configure_Option_Category_Add *ev)
37{
38 eina_stringshare_del(ev->category);
39 free(ev);
40}
41
42static void
43_e_configure_option_event_category_add_del(Eina_Stringshare *cat, Eina_Bool del)
44{
45 E_Event_Configure_Option_Category_Add *ev;
46
47 if (event_block)
48 {
49 if (del) eina_stringshare_del(cat);
50 return;
51 }
52 ev = E_NEW(E_Event_Configure_Option_Category_Add, 1);
53 ev->category = cat;
54 if (del)
55 ecore_event_add(E_EVENT_CONFIGURE_OPTION_CATEGORY_DEL, ev, (Ecore_End_Cb)_e_configure_option_event_str_end, NULL);
56 else
57 ecore_event_add(E_EVENT_CONFIGURE_OPTION_CATEGORY_ADD, ev, NULL, NULL);
58}
59
60static void
61_e_configure_option_event_tag_add_del(Eina_Stringshare *tag, Eina_Bool del)
62{
63 E_Event_Configure_Option_Tag_Add *ev;
64
65 if (event_block)
66 {
67 if (del) eina_stringshare_del(tag);
68 return;
69 }
70 ev = E_NEW(E_Event_Configure_Option_Tag_Add, 1);
71 ev->tag = tag;
72 if (del)
73 ecore_event_add(E_EVENT_CONFIGURE_OPTION_TAG_DEL, ev, (Ecore_End_Cb)_e_configure_option_event_str_end, NULL);
74 else
75 ecore_event_add(E_EVENT_CONFIGURE_OPTION_TAG_ADD, ev, NULL, NULL);
76}
77
78static void
79_e_configure_option_tag_remove(E_Configure_Option *co, Eina_Stringshare *tag)
80{
81 Eina_List *items;
82
83 items = eina_hash_find(tags_hash, tag);
84 if (!items) return;
85 items = eina_list_remove(items, co);
86 co->tags = eina_list_remove(co->tags, tag);
87 if (!items)
88 {
89 /* this seems dumb... */
90 tags_list = eina_list_remove(tags_list, tag);
91 _e_configure_option_event_tag_add_del(tag, EINA_TRUE);
92 }
93 eina_hash_set(tags_hash, tag, items);
94}
95
96
97static void
98_e_configure_option_free(E_Configure_Option *co)
99{
100 if (!co->private)
101 opts_list = eina_inlist_remove(opts_list, EINA_INLIST_GET(co));
102 if (co->changed)
103 {
104 eina_value_flush(&co->val);
105 if (opts_changed_list)
106 opts_changed_list = eina_list_remove(opts_changed_list, co);
107 }
108 if (co->data)
109 eina_stringshare_del(eina_hash_find(co->data, "icon"));
110 eina_hash_free(co->data);
111 E_FREE_LIST(co->tags, eina_stringshare_del);
112 eina_stringshare_del(co->name);
113 eina_stringshare_del(co->desc);
114 eina_stringshare_del(co->info);
115 eina_stringshare_del(co->changed_action);
116 free(co);
117}
118
119static void
120_e_configure_option_event_del_end(void *d EINA_UNUSED, E_Event_Configure_Option_Del *ev)
121{
122 Eina_List *l, *ll;
123 Eina_Stringshare *tag;
124
125 EINA_LIST_FOREACH_SAFE(ev->co->tags, l, ll, tag)
126 _e_configure_option_tag_remove(ev->co, tag);
127 _e_configure_option_free(ev->co);
128 free(ev);
129}
130
131static void
132_e_configure_option_event_del(E_Configure_Option *co)
133{
134 E_Event_Configure_Option_Del *ev;
135
136 if (event_block) return;
137 ev = E_NEW(E_Event_Configure_Option_Del, 1);
138 ev->co = co;
139 ecore_event_add(E_EVENT_CONFIGURE_OPTION_CHANGED, ev, (Ecore_End_Cb)_e_configure_option_event_del_end, NULL);
140}
141
142static void
143_e_configure_option_event_changed(E_Configure_Option *co)
144{
145 E_Event_Configure_Option_Changed *ev;
146
147 if (event_block) return;
148 ev = E_NEW(E_Event_Configure_Option_Changed, 1);
149 ev->co = co;
150 ecore_event_add(E_EVENT_CONFIGURE_OPTION_CHANGED, ev, NULL, NULL);
151}
152
153static void
154_e_configure_option_tag_append(E_Configure_Option *co, const char *tag)
155{
156 Eina_List *items;
157
158 items = eina_hash_find(tags_hash, tag);
159 if (!items)
160 {
161 Eina_Stringshare *t;
162
163 t = eina_stringshare_add(tag);
164 tags_list = eina_list_sorted_insert(tags_list, (Eina_Compare_Cb)strcmp, t);
165 _e_configure_option_event_tag_add_del(t, EINA_FALSE);
166 }
167 eina_hash_set(tags_hash, tag, eina_list_append(items, co));
168 co->tags = eina_list_append(co->tags, eina_stringshare_add(tag));
169}
170
171static Eina_List *
172_e_configure_option_ctx_list_prune(Eina_Stringshare *tag, Eina_List *opts, Eina_List *tags)
173{
174 Eina_List *l, *ll, *lll, *topts;
175 E_Configure_Option *co;
176 Eina_Stringshare *t;
177
178 EINA_LIST_FOREACH_SAFE(opts, l, ll, co)
179 {
180 Eina_Bool found = EINA_FALSE;
181
182 EINA_LIST_FOREACH(tags, lll, t)
183 {
184 if (t == tag) continue;
185 topts = eina_hash_find(tags_hash, t);
186 if (!topts) continue;
187 if (eina_list_data_find(topts, co))
188 found = EINA_TRUE;
189 }
190 if (!found)
191 opts = eina_list_remove_list(opts, l);
192 }
193
194 return opts;
195}
196
197static void
198_e_configure_option_value_reset(E_Configure_Option *co)
199{
200 if (co->type == E_CONFIGURE_OPTION_TYPE_CUSTOM) return;
201 if (co->changed) eina_value_flush(&co->val);
202 switch (co->type)
203 {
204 case E_CONFIGURE_OPTION_TYPE_BOOL:
205 eina_value_setup(&co->val, EINA_VALUE_TYPE_UCHAR);
206 break;
207 case E_CONFIGURE_OPTION_TYPE_INT:
208 case E_CONFIGURE_OPTION_TYPE_ENUM:
209 eina_value_setup(&co->val, EINA_VALUE_TYPE_INT);
210 break;
211 case E_CONFIGURE_OPTION_TYPE_UINT:
212 eina_value_setup(&co->val, EINA_VALUE_TYPE_UINT);
213 break;
214 case E_CONFIGURE_OPTION_TYPE_DOUBLE_UCHAR:
215 case E_CONFIGURE_OPTION_TYPE_DOUBLE_INT:
216 case E_CONFIGURE_OPTION_TYPE_DOUBLE_UINT:
217 case E_CONFIGURE_OPTION_TYPE_DOUBLE:
218 eina_value_setup(&co->val, EINA_VALUE_TYPE_DOUBLE);
219 break;
220 case E_CONFIGURE_OPTION_TYPE_STR:
221 eina_value_setup(&co->val, EINA_VALUE_TYPE_STRINGSHARE);
222 break;
223 case E_CONFIGURE_OPTION_TYPE_CUSTOM:
224 break;
225 }
226}
227
228static Eina_Bool
229_e_configure_option_apply(E_Configure_Option *co, Eina_List **events, Eina_List **funcs, Eina_List **acts)
230{
231 E_Action *act;
232 void (*none)(void) = NULL;
233
234 if (!co->changed) return EINA_FALSE;
235 if ((co->type == E_CONFIGURE_OPTION_TYPE_DOUBLE_INT) || (co->type == E_CONFIGURE_OPTION_TYPE_DOUBLE_UINT))
236 {
237 double dbl;
238 long x;
239
240 eina_value_get(&co->val, &dbl);
241 x = lround(dbl);
242 if (co->type == E_CONFIGURE_OPTION_TYPE_DOUBLE_INT)
243 *(int*)co->valptr = x;
244 else
245 *(unsigned int*)co->valptr = MAX(x, 0);
246 }
247 else if (co->type == E_CONFIGURE_OPTION_TYPE_STR)
248 {
249 eina_stringshare_replace(co->valptr, NULL);
250 eina_value_get(&co->val, co->valptr);
251 eina_stringshare_ref(co->valptr);
252 }
253 else if (co->type != E_CONFIGURE_OPTION_TYPE_CUSTOM)
254 eina_value_get(&co->val, co->valptr);
255 _e_configure_option_value_reset(co);
256
257 if (co->changed_action)
258 {
259 act = e_action_find(co->changed_action);
260 while (act && act->func.go)
261 {
262 if (!acts)
263 {
264 act->func.go((E_Object*)e_util_container_current_get(), NULL);
265 break;
266 }
267 if (*acts && eina_list_data_find(*acts, act)) break;
268 *acts = eina_list_append(*acts, act);
269 break;
270 }
271 }
272 while (co->event_type)
273 {
274 if (!events)
275 {
276 ecore_event_add(co->event_type, NULL, NULL, NULL);
277 break;
278 }
279 if (*events && eina_list_data_find(*events, (intptr_t*)(long)co->event_type)) break;
280 *events = eina_list_append(*events, (intptr_t*)(long)co->event_type);
281 break;
282 }
283 if (co->type == E_CONFIGURE_OPTION_TYPE_BOOL)
284 none = co->funcs[*(Eina_Bool*)co->valptr].none;
285 else if (co->funcs[0].none)
286 none = co->funcs[0].none;
287 while (none)
288 {
289 if (!funcs)
290 {
291 none();
292 break;
293 }
294 if (*funcs && eina_list_data_find(*funcs, none)) break;
295 *funcs = eina_list_append(*funcs, none);
296 break;
297 }
298 if (co->funcs[0].one)
299 {
300 switch (co->type)
301 {
302 case E_CONFIGURE_OPTION_TYPE_BOOL:
303 co->funcs[0].one(*(Eina_Bool*)co->valptr);
304 break;
305 case E_CONFIGURE_OPTION_TYPE_DOUBLE_UCHAR:
306 co->funcs[0].one(*(unsigned char*)co->valptr);
307 break;
308 case E_CONFIGURE_OPTION_TYPE_DOUBLE_INT: //lround(double)
309 case E_CONFIGURE_OPTION_TYPE_INT:
310 case E_CONFIGURE_OPTION_TYPE_ENUM:
311 co->funcs[0].one(*(int*)co->valptr);
312 break;
313 case E_CONFIGURE_OPTION_TYPE_DOUBLE_UINT: //lround(double)
314 case E_CONFIGURE_OPTION_TYPE_UINT:
315 co->funcs[0].one(*(unsigned int*)co->valptr);
316 break;
317 case E_CONFIGURE_OPTION_TYPE_DOUBLE:
318 co->funcs[0].one(*(double*)co->valptr);
319 break;
320 case E_CONFIGURE_OPTION_TYPE_STR:
321 co->funcs[0].one(*(Eina_Stringshare**)co->valptr);
322 break;
323 case E_CONFIGURE_OPTION_TYPE_CUSTOM:
324 break;
325 }
326 }
327 co->changed = EINA_FALSE;
328
329 return co->requires_restart;
330}
331
332/********************************************************
333 * CHANGE CALLBACKS
334 */
335
336static void
337_e_configure_screensaver_changed(void)
338{
339 if ((e_config->backlight.idle_dim) &&
340 (e_config->backlight.timer > (e_config->screensaver_timeout)))
341 {
342 e_config->screensaver_timeout = e_config->backlight.timer;
343 e_config->dpms_standby_timeout = e_config->screensaver_timeout;
344 e_config->dpms_suspend_timeout = e_config->screensaver_timeout;
345 e_config->dpms_off_timeout = e_config->screensaver_timeout;
346 }
347 e_screensaver_update();
348 e_dpms_update();
349}
350
351static void
352_e_configure_dpms_changed(void)
353{
354 e_backlight_mode_set(NULL, E_BACKLIGHT_MODE_NORMAL);
355 e_backlight_level_set(NULL, e_config->backlight.normal, -1.0);
356
357 _e_configure_screensaver_changed();
358 e_backlight_update();
359}
360
361static void
362_e_configure_pointer_changed(void)
363{
364 const Eina_List *l;
365 E_Manager *man;
366
367 EINA_LIST_FOREACH(e_manager_list(), l, man)
368 {
369 if (man->pointer && !e_config->show_cursor)
370 {
371 e_pointer_hide(man->pointer);
372 continue;
373 }
374 if (man->pointer) e_object_del(E_OBJECT(man->pointer));
375 man->pointer = e_pointer_window_new(man->root, 1);
376 }
377}
378
379static void
380_e_configure_framerate_changed(void)
381{
382 edje_frametime_set(1.0 / e_config->framerate);
383 e_canvas_recache();
384}
385
386static void
387_e_configure_zone_desks_count_changed(void)
388{
389 const Eina_List *l, *ll, *lll;
390 E_Manager *man;
391 E_Container *con;
392 E_Zone *zone;
393
394 EINA_LIST_FOREACH(e_manager_list(), l, man)
395 EINA_LIST_FOREACH(man->containers, ll, con)
396 EINA_LIST_FOREACH(con->zones, lll, zone)
397 e_zone_desk_count_set(zone, e_config->zone_desks_x_count, e_config->zone_desks_x_count);
398}
399
400
401/********************************************************
402 * THUMB CALLBACKS
403 */
404
405static Eina_Bool
406_e_configure_transition_timer_cb(void *obj)
407{
408 Eina_Stringshare *file, *key;
409 Evas_Object *o, *oo;
410
411 evas_object_data_del(obj, "conf_timer");
412 o = edje_object_part_swallow_get(obj, "e.swallow.bg.new");
413 edje_object_part_unswallow(obj, o);
414 oo = edje_object_part_swallow_get(obj, "e.swallow.bg.old");
415 edje_object_part_unswallow(obj, oo);
416 edje_object_file_get(obj, &file, &key);
417 eina_stringshare_ref(file);
418 eina_stringshare_ref(key);
419 edje_object_file_set(obj, NULL, NULL);
420 edje_object_file_set(obj, file, key);
421 eina_stringshare_del(file);
422 eina_stringshare_del(key);
423 edje_object_part_swallow(obj, "e.swallow.bg.new", o);
424 edje_object_part_swallow(obj, "e.swallow.bg.old", oo);
425 edje_object_signal_emit(obj, "e,action,start", "e");
426 return EINA_FALSE;
427}
428
429static void
430_e_configure_transition_done_cb(void *d EINA_UNUSED, Evas_Object *obj, const char *s EINA_UNUSED, const char *so EINA_UNUSED)
431{
432 Ecore_Timer *timer;
433
434 timer = evas_object_data_get(obj, "conf_timer");
435 if (timer) ecore_timer_reset(timer);
436 else evas_object_data_set(obj, "conf_timer", ecore_timer_add(1.0, _e_configure_transition_timer_cb, obj));
437}
438
439static void
440_e_configure_transition_del_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
441{
442 Ecore_Timer *timer;
443
444 timer = evas_object_data_del(obj, "conf_timer");
445 if (timer) ecore_timer_del(timer);
446}
447
448static Evas_Object *
449_e_configure_transition_thumb_cb(E_Configure_Option_Info *oi, Evas *evas)
450{
451 Evas_Object *oj, *obj, *o, *oa;
452 Evas *e;
453 E_Zone *zone;
454
455 zone = e_util_zone_current_get(e_manager_current_get());
456
457 oa = e_widget_aspect_add(evas, 150, (200 * zone->h) / zone->w);
458 obj = e_widget_preview_add(evas, 150, (200 * zone->h) / zone->w);
459 e_widget_aspect_child_set(oa, obj);
460
461 e = e_widget_preview_evas_get(obj);
462
463 if (oi->thumb_key)
464 {
465 oj = edje_object_add(e);
466 edje_object_file_set(oj, oi->thumb_file, oi->thumb_key);
467 edje_object_signal_callback_add(oj, "e,state,done", "*", _e_configure_transition_done_cb, NULL);
468 evas_object_event_callback_add(oj, EVAS_CALLBACK_DEL, _e_configure_transition_del_cb, NULL);
469 e_widget_preview_extern_object_set(obj, oj);
470
471 o = edje_object_add(e);
472 edje_object_file_set(o, oi->thumb_file, "e/transpreview/0");
473 edje_object_part_swallow(oj, "e.swallow.bg.new", o);
474 }
475
476 o = edje_object_add(e);
477 edje_object_file_set(o, oi->thumb_file, "e/transpreview/1");
478
479 if (oi->thumb_key)
480 {
481 edje_object_part_swallow(oj, "e.swallow.bg.old", o);
482 edje_object_signal_emit(oj, "e,action,start", "e");
483 }
484 else
485 e_widget_preview_extern_object_set(obj, o);
486
487 return oa;
488}
489
490static Evas_Object *
491_e_configure_border_style_thumb_cb(E_Configure_Option_Info *oi, Evas *evas)
492{
493 Evas_Object *ob, *oj, *orect;
494
495 ob = e_livethumb_add(evas);
496 e_livethumb_vsize_set(ob, 150, 150);
497 if (oi->thumb_key)
498 {
499 oj = edje_object_add(e_livethumb_evas_get(ob));
500 edje_object_file_set(oj, oi->thumb_file, oi->thumb_key);
501 e_livethumb_thumb_set(ob, oj);
502 }
503 orect = evas_object_rectangle_add(e_livethumb_evas_get(ob));
504 evas_object_color_set(orect, 0, 0, 0, 128);
505 evas_object_show(orect);
506 if (oi->thumb_key)
507 edje_object_part_swallow(oj, "e.swallow.client", orect);
508 else
509 e_livethumb_thumb_set(ob, orect);
510 return ob;
511}
512
513
514static Evas_Object *
515_e_configure_icon_theme_thumb_cb(E_Configure_Option_Info *oi, Evas *evas)
516{
517 Evas_Object *of, *o;
518 unsigned int x, y;
519 const char **example_icon, *example_icons[] =
520 {
521 NULL,
522 "folder",
523 "user-home",
524 "text-x-generic",
525 "system-run",
526 "preferences-system",
527 NULL,
528 };
529 if (oi->thumb_file)
530 {
531 example_icons[0] = oi->thumb_file;
532 example_icon = example_icons;
533 }
534 else
535 example_icon = example_icons + 1;
536
537 of = e_widget_frametable_add(evas, _("Preview"), 1);
538 for (x = y = 0; (*example_icon); example_icon++)
539 {
540 const char *path;
541
542 path = efreet_icon_path_find(oi->value, *example_icon, 48);
543 if (!path) continue;
544 o = e_icon_add(evas);
545 if (e_icon_file_set(o, path))
546 e_icon_fill_inside_set(o, 1);
547 else
548 {
549 evas_object_del(o);
550 continue;
551 }
552 e_widget_frametable_object_append_full(of, o, x++, y, 1, 1, 1, 1, 0, 0,
553 0.5, 0.5, 48, 48, 64, 64);
554 x %= 3;
555 if (!x) y++;
556 }
557 return of;
558}
559
560static Evas_Object *
561_e_configure_netwm_theme_thumb_cb(E_Configure_Option_Info *oi EINA_UNUSED, Evas *evas)
562{
563 Evas_Object *o;
564
565/* FIXME: uhhhhhhhhhhhhhhhhhhhhhh */
566 //o = e_widget_label_add(evas, oi->name);
567 o = e_box_add(evas);
568 return o;
569}
570
571/********************************************************
572 * INFO CALLBACKS
573 */
574
575
576/* FIXME
577static Eina_List *
578_e_configure_language_info_cb(E_Configure_Option *co)
579{
580 Eina_List *l, *ret = NULL;
581 E_Configure_Option_Info *oi;
582 char *lang;
583
584 l = e_intl_language_list();
585 EINA_LIST_FREE(l, lang)
586 {
587
588 //oi = e_configure_option_info_new(co,
589 free(lang);
590 }
591
592 return ret;
593}
594*/
595
596static Eina_List *
597_e_configure_border_shade_transition_info_cb(E_Configure_Option *co)
598{
599 Eina_List *ret = NULL;
600 E_Configure_Option_Info *oi;
601 int x;
602 const char *name[] =
603 {
604 "Linear",
605 "Accelerate, then decelerate",
606 "Accelerate",
607 "Decelerate",
608 "Pronounced accelerate",
609 "Pronounced decelerate",
610 "Pronounced accelerate, then decelerate",
611 "Bounce",
612 "Bounce more"
613 };
614
615 for (x = 0; x <= E_TRANSITION_BOUNCE_LOTS; x++)
616 {
617 oi = e_configure_option_info_new(co, _(name[x]), (intptr_t*)(long)x);
618 oi->current = (*(int*)co->valptr == x);
619 ret = eina_list_append(ret, oi);
620 }
621 return ret;
622}
623
624static Eina_List *
625_e_configure_window_placement_policy_info_cb(E_Configure_Option *co)
626{
627 Eina_List *ret = NULL;
628 E_Configure_Option_Info *oi;
629 int x;
630 const char *name[] =
631 {
632 "Try not to cover other windows",
633 "Try not to cover gadgets",
634 "Place at mouse pointer (automatic)",
635 "Place at mouse pointer (interactive)"
636 };
637
638 for (x = 0; x <= E_WINDOW_PLACEMENT_MANUAL; x++)
639 {
640 oi = e_configure_option_info_new(co, _(name[x]), (intptr_t*)(long)x);
641 oi->current = (*(int*)co->valptr == x);
642 ret = eina_list_append(ret, oi);
643 }
644 return ret;
645}
646
647static Eina_List *
648_e_configure_focus_policy_info_cb(E_Configure_Option *co)
649{
650 Eina_List *ret = NULL;
651 E_Configure_Option_Info *oi;
652 int x;
653 const char *name[] =
654 {
655 "Click",
656 "Pointer",
657 "Sloppy"
658 };
659
660 for (x = 0; x <= E_FOCUS_SLOPPY; x++)
661 {
662 oi = e_configure_option_info_new(co, _(name[x]), (intptr_t*)(long)x);
663 oi->current = (*(int*)co->valptr == x);
664 ret = eina_list_append(ret, oi);
665 }
666 return ret;
667}
668
669static Eina_List *
670_e_configure_focus_setting_info_cb(E_Configure_Option *co)
671{
672 Eina_List *ret = NULL;
673 E_Configure_Option_Info *oi;
674 int x;
675 const char *name[] =
676 {
677 "Don't set focus on new windows",
678 "Set focus on all new windows",
679 "Set focus only on all new dialog windows",
680 "Set focus only on new dialog windows if dialog's parent window has focus"
681 };
682
683 for (x = 0; x <= E_FOCUS_NEW_DIALOG_IF_OWNER_FOCUSED; x++)
684 {
685 oi = e_configure_option_info_new(co, _(name[x]), (intptr_t*)(long)x);
686 oi->current = (*(int*)co->valptr == x);
687 ret = eina_list_append(ret, oi);
688 }
689 return ret;
690}
691
692static Eina_List *
693_e_configure_window_activehint_policy_info_cb(E_Configure_Option *co)
694{
695 Eina_List *ret = NULL;
696 E_Configure_Option_Info *oi;
697 int x;
698 const char *name[] =
699 {
700 "Ignore application",
701 "Animate application window",
702 "Raise and set focus to application window"
703 };
704
705 for (x = 0; x <= E_ACTIVEHINT_POLICY_ACTIVATE; x++)
706 {
707 oi = e_configure_option_info_new(co, _(name[x]), (intptr_t*)(long)x);
708 oi->current = (*(int*)co->valptr == x);
709 ret = eina_list_append(ret, oi);
710 }
711 return ret;
712}
713
714static Eina_List *
715_e_configure_fullscreen_policy_info_cb(E_Configure_Option *co)
716{
717 Eina_List *ret = NULL;
718 E_Configure_Option_Info *oi;
719 int x;
720 const char *name[] =
721 {
722 "Resize window, do not resize screen",
723 "Resize window and screen"
724 };
725
726 for (x = 0; x <= E_FULLSCREEN_ZOOM; x++)
727 {
728 oi = e_configure_option_info_new(co, _(name[x]), (intptr_t*)(long)x);
729 oi->current = (*(int*)co->valptr == x);
730 ret = eina_list_append(ret, oi);
731 }
732 return ret;
733}
734
735static Eina_List *
736_e_configure_maximize_policy_info_cb(E_Configure_Option *co)
737{
738 Eina_List *ret = NULL;
739 E_Configure_Option_Info *oi;
740 int x;
741 const char *name[] =
742 {
743 "Fullscreen", /* 1 */
744 "Expand to maximum size without covering shelves", /* 2 */
745 NULL,
746 "Expand to maximum size ignoring shelves" /* 4 */
747 };
748
749 for (x = E_MAXIMIZE_FULLSCREEN; x <= E_MAXIMIZE_FILL; x++)
750 {
751 if (!name[x]) continue;
752 oi = e_configure_option_info_new(co, _(name[x - 1]), (intptr_t*)(long)x);
753 oi->current = (*(int*)co->valptr == x);
754 ret = eina_list_append(ret, oi);
755 }
756 return ret;
757}
758
759static Eina_List *
760_e_configure_font_hinting_info_cb(E_Configure_Option *co)
761{
762 Eina_List *ret = NULL;
763 E_Configure_Option_Info *oi;
764 int x;
765 const char *name[] =
766 {
767 "No hinting",
768 "Automatic hinting",
769 "Bytecode hinting"
770 };
771
772 for (x = 0; x <= EVAS_FONT_HINTING_BYTECODE; x++)
773 {
774 oi = e_configure_option_info_new(co, _(name[x]), (intptr_t*)(long)x);
775 oi->current = (*(int*)co->valptr == x);
776 ret = eina_list_append(ret, oi);
777 }
778 return ret;
779}
780
781static Eina_List *
782_e_configure_desklock_login_box_zone_info_cb(E_Configure_Option *co)
783{
784 Eina_List *ret = NULL;
785 E_Configure_Option_Info *oi;
786 int x;
787 int num = 0;
788 E_Manager *m;
789 Eina_List *ml;
790 const char *name[] =
791 {
792 "Show on all screens",
793 "Show on screen of pointer",
794 "Show on screen %d"
795 };
796
797 EINA_LIST_FOREACH(e_manager_list(), ml, m)
798 {
799 Eina_List *cl;
800 E_Container *con;
801
802 EINA_LIST_FOREACH(m->containers, cl, con)
803 num += eina_list_count(con->zones);
804 }
805
806 for (x = -2; x < num; x++)
807 {
808 char buf[128];
809
810 if (x < 0)
811 oi = e_configure_option_info_new(co, _(name[x + 2]), (intptr_t*)(long)x);
812 else
813 {
814 snprintf(buf, sizeof(buf), _(name[2]), x);
815 oi = e_configure_option_info_new(co, buf, (intptr_t*)(long)x);
816 }
817 oi->current = (*(int*)co->valptr == x);
818 ret = eina_list_append(ret, oi);
819 }
820 return ret;
821}
822
823static Eina_List *
824_e_configure_clientlist_group_by_info_cb(E_Configure_Option *co)
825{
826 Eina_List *ret = NULL;
827 E_Configure_Option_Info *oi;
828 int x;
829 const char *name[] =
830 {
831 "No grouping",
832 "Virtual desktop",
833 "Window class"
834 };
835
836 for (x = 0; x <= E_CLIENTLIST_GROUP_CLASS; x++)
837 {
838 oi = e_configure_option_info_new(co, _(name[x]), (intptr_t*)(long)x);
839 oi->current = (*(int*)co->valptr == x);
840 ret = eina_list_append(ret, oi);
841 }
842 return ret;
843}
844
845static Eina_List *
846_e_configure_clientlist_separate_with_info_cb(E_Configure_Option *co)
847{
848 Eina_List *ret = NULL;
849 E_Configure_Option_Info *oi;
850 int x;
851 const char *name[] =
852 {
853 "No separation",
854 "Separator bars",
855 "Separate menus"
856 };
857
858 for (x = 0; x <= E_CLIENTLIST_GROUP_SEP_MENU; x++)
859 {
860 oi = e_configure_option_info_new(co, _(name[x]), (intptr_t*)(long)x);
861 oi->current = (*(int*)co->valptr == x);
862 ret = eina_list_append(ret, oi);
863 }
864 return ret;
865}
866
867static Eina_List *
868_e_configure_clientlist_sort_by_info_cb(E_Configure_Option *co)
869{
870 Eina_List *ret = NULL;
871 E_Configure_Option_Info *oi;
872 int x;
873 const char *name[] =
874 {
875 "No sorting",
876 "Alphabetical order",
877 "Window stacking layer",
878 "Recently used windows first"
879 };
880
881 for (x = 0; x <= E_CLIENTLIST_SORT_MOST_RECENT; x++)
882 {
883 oi = e_configure_option_info_new(co, _(name[x]), (intptr_t*)(long)x);
884 oi->current = (*(int*)co->valptr == x);
885 ret = eina_list_append(ret, oi);
886 }
887 return ret;
888}
889
890static Eina_List *
891_e_configure_clientlist_separate_iconified_apps_info_cb(E_Configure_Option *co)
892{
893 Eina_List *ret = NULL;
894 E_Configure_Option_Info *oi;
895 int x;
896 const char *name[] =
897 {
898 "Group by owner virtual desktop",
899 "Group by current virtual desktop",
900 "Separate group"
901 };
902
903 for (x = 0; x <= E_CLIENTLIST_GROUPICONS_SEP; x++)
904 {
905 oi = e_configure_option_info_new(co, _(name[x]), (intptr_t*)(long)x);
906 oi->current = (*(int*)co->valptr == x);
907 ret = eina_list_append(ret, oi);
908 }
909 return ret;
910}
911
912static Eina_List *
913_e_configure_desk_flip_animate_mode_info_cb(E_Configure_Option *co)
914{
915 Eina_List *ret = NULL;
916 E_Configure_Option_Info *oi;
917 int x;
918 const char *name[] =
919 {
920 "No animation",
921 "Pane",
922 "Zoom"
923 };
924
925 for (x = 0; x <= E_DESKFLIP_ANIMATION_MODE_ZOOM; x++)
926 {
927 oi = e_configure_option_info_new(co, _(name[x]), (intptr_t*)(long)x);
928 oi->current = (*(int*)co->valptr == x);
929 ret = eina_list_append(ret, oi);
930 }
931 return ret;
932}
933
934static Eina_List *
935_e_configure_screen_limits_info_cb(E_Configure_Option *co)
936{
937 Eina_List *ret = NULL;
938 E_Configure_Option_Info *oi;
939 int x;
940 const char *name[] =
941 {
942 "Allow windows partly out of the screen limits",
943 "Allow windows completely out of the screen limits",
944 "Keep windows completely within the screen limits"
945 };
946
947 for (x = 0; x <= E_SCREEN_LIMITS_WITHIN; x++)
948 {
949 oi = e_configure_option_info_new(co, _(name[x]), (intptr_t*)(long)x);
950 oi->current = (*(int*)co->valptr == x);
951 ret = eina_list_append(ret, oi);
952 }
953 return ret;
954}
955
956static int
957_e_configure_icon_theme_info_sort_cb(const void *data1, const void *data2)
958{
959 const Efreet_Icon_Theme *m1 = data1, *m2 = data2;
960
961 if (!data2) return -1;
962 if (!m1->name.name) return 1;
963 if (!m2->name.name) return -1;
964
965 return strcmp(m1->name.name, m2->name.name);
966}
967
968static Eina_List *
969_e_configure_icon_theme_info_cb(E_Configure_Option *co)
970{
971 Eina_List *l, *ret = NULL;
972 Efreet_Icon_Theme *theme;
973 E_Configure_Option_Info *oi;
974
975 l = efreet_icon_theme_list_get();
976 if (!l) return NULL;
977 l = eina_list_sort(l, 0, _e_configure_icon_theme_info_sort_cb);
978 EINA_LIST_FREE(l, theme)
979 {
980 if (!theme->directories) continue; //invalid
981 if (!e_util_strcasecmp(theme->name.internal, "hicolor")) continue; //default
982 oi = e_configure_option_info_new(co, theme->name.name, eina_stringshare_add(theme->name.internal));
983 oi->current = !e_util_strcmp(e_config->icon_theme, theme->name.internal);
984 oi->thumb_file = eina_stringshare_add(theme->example_icon);
985 ret = eina_list_append(ret, oi);
986 }
987 return ret;
988}
989
990static Eina_List *
991_e_configure_netwm_theme_info_cb(E_Configure_Option *co)
992{
993 Eina_List *l, *ret = NULL;
994 E_Configure_Option_Info *oi;
995 Eina_Stringshare *dir;
996 Eina_Bool gtk2, gtk3;
997
998 EINA_LIST_FOREACH(gtk_themes, l, dir)
999 {
1000 char buf[PATH_MAX];
1001 const char *name;
1002
1003 snprintf(buf, sizeof(buf), "%s/gtk-2.0", dir);
1004 gtk2 = ecore_file_is_dir(buf);
1005 snprintf(buf, sizeof(buf), "%s/gtk-3.0", dir);
1006 gtk3 = ecore_file_is_dir(buf);
1007 if ((!gtk2) && (!gtk3)) continue;
1008 name = ecore_file_file_get(dir);
1009 snprintf(buf, sizeof(buf), "%s (%s)%s%s%s", name, gtk2 ? "gtk2" : "gtk3",
1010 (gtk2 && gtk3) ? " (" : "", (gtk2 && gtk3) ? "gtk3" : "", (gtk2 && gtk3) ? ")" : "");
1011 oi = e_configure_option_info_new(co, buf, eina_stringshare_add(name));
1012 oi->current = (e_config->xsettings.net_theme_name == oi->value);
1013 ret = eina_list_append(ret, oi);
1014 }
1015 return ret;
1016}
1017
1018static Eina_List *
1019_e_configure_transition_info_cb(E_Configure_Option *co)
1020{
1021 Eina_Stringshare *style;
1022 Eina_List *l, *ret = NULL;
1023 Eina_Stringshare *cur, *file;
1024 char buf[4096];
1025 const char *key;
1026 E_Configure_Option_Info *oi;
1027
1028 file = e_theme_edje_file_get("base/theme/widgets", "e/transpreview/0");
1029 key = "e/transitions/%s";
1030 cur = *(Eina_Stringshare**)co->valptr;
1031
1032 oi = e_configure_option_info_new(co, _("None"), NULL);
1033 oi->thumb_file = eina_stringshare_ref(file);
1034 oi->current = (!cur);
1035 ret = eina_list_append(ret, oi);
1036
1037 l = e_theme_transition_list();
1038 EINA_LIST_FREE(l, style)
1039 {
1040 oi = e_configure_option_info_new(co, style, style);
1041 ret = eina_list_append(ret, oi);
1042 oi->thumb_file = eina_stringshare_ref(file);
1043 snprintf(buf, sizeof(buf), key, style);
1044 oi->thumb_key = eina_stringshare_add(buf);
1045 oi->current = (style == cur);
1046 }
1047 return ret;
1048}
1049
1050static Eina_List *
1051_e_configure_border_style_info_cb(E_Configure_Option *co)
1052{
1053 Eina_Stringshare *style;
1054 Eina_List *l, *ret = NULL;
1055 Eina_Stringshare *file;
1056 char buf[4096];
1057 const char *key;
1058 E_Configure_Option_Info *oi;
1059
1060 file = e_theme_edje_file_get("base/theme/borders", "e/widgets/border/default/border");
1061 oi = e_configure_option_info_new(co, "borderless", eina_stringshare_add("borderless"));
1062 ret = eina_list_append(ret, oi);
1063 oi->thumb_file = eina_stringshare_ref(file);
1064 oi->thumb_key = eina_stringshare_add("e/widgets/border/borderless/border");
1065 oi->current = !e_util_strcmp(e_config->theme_default_border_style, "borderless");
1066 key = "e/widgets/border/%s/border";
1067
1068 l = e_theme_border_list();
1069 EINA_LIST_FREE(l, style)
1070 {
1071 oi = e_configure_option_info_new(co, style, style);
1072 ret = eina_list_append(ret, oi);
1073 oi->thumb_file = eina_stringshare_ref(file);
1074 snprintf(buf, sizeof(buf), key, style);
1075 oi->thumb_key = eina_stringshare_add(buf);
1076 if (e_config->theme_default_border_style)
1077 oi->current = (style == e_config->theme_default_border_style);
1078 else if (!strcmp(style, "default"))
1079 oi->current = EINA_TRUE;
1080 }
1081 return ret;
1082}
1083
1084static Eina_List *
1085_e_configure_init_default_theme_info_cb(E_Configure_Option *co)
1086{
1087 Eina_List *l, *ret = NULL;
1088 Eina_Stringshare *file;
1089 char buf[PATH_MAX], *p;
1090 E_Configure_Option_Info *oi;
1091 Eina_Stringshare *key;
1092
1093 key = eina_stringshare_add("e/init/splash");
1094 EINA_LIST_FOREACH(themes, l, file)
1095 {
1096 if (!edje_file_group_exists(file, key)) continue;
1097 p = strrchr(file, '.');
1098 strncpy(buf, ecore_file_file_get(file), p - file);
1099 oi = e_configure_option_info_new(co, buf, eina_stringshare_add(buf));
1100 oi->thumb_file = eina_stringshare_ref(file);
1101 oi->thumb_key = eina_stringshare_ref(key);
1102 ret = eina_list_append(ret, oi);
1103 oi->current = (oi->name == *(Eina_Stringshare**)co->valptr);
1104 }
1105 if (ret && sthemes)
1106 ret = eina_list_append(ret, e_configure_option_info_new(co, NULL, NULL));
1107 EINA_LIST_FOREACH(sthemes, l, file)
1108 {
1109 if (!edje_file_group_exists(file, key)) continue;
1110 p = strrchr(file, '.');
1111 strncpy(buf, ecore_file_file_get(file), p - file);
1112 oi = e_configure_option_info_new(co, buf, eina_stringshare_add(buf));
1113 ret = eina_list_append(ret, oi);
1114 oi->thumb_file = eina_stringshare_ref(file);
1115 oi->thumb_key = eina_stringshare_ref(key);
1116 oi->current = (oi->name == *(Eina_Stringshare**)co->valptr);
1117 }
1118 eina_stringshare_del(key);
1119 return ret;
1120}
1121
1122static Eina_List *
1123_e_configure_background_info_cb(E_Configure_Option *co)
1124{
1125 Eina_List *l, *ret = NULL;
1126 Eina_Stringshare *file;
1127 const char *f;
1128 Eina_Stringshare *cur;
1129 char buf[PATH_MAX], *p;
1130 E_Configure_Option_Info *oi;
1131 Eina_Stringshare *key;
1132
1133 key = eina_stringshare_add("e/desktop/background");
1134 cur = *(Eina_Stringshare**)co->valptr;
1135 if (!cur)
1136 {
1137 E_Config_Theme *ct;
1138 ct = e_theme_config_get("theme");
1139 cur = ct->file;
1140 }
1141 EINA_LIST_FOREACH(themes, l, file)
1142 {
1143 if (!edje_file_group_exists(file, key)) continue;
1144 p = strrchr(file, '.');
1145 f = ecore_file_file_get(file);
1146 memcpy(buf, f, p - f);
1147 buf[p - f] = 0;
1148 oi = e_configure_option_info_new(co, buf, eina_stringshare_ref(file));
1149 oi->thumb_file = eina_stringshare_ref(file);
1150 oi->thumb_key = eina_stringshare_ref(key);
1151 ret = eina_list_append(ret, oi);
1152 oi->current = ((file == cur) || (!e_util_strcmp(f, cur)));
1153
1154 }
1155 EINA_LIST_FOREACH(sthemes, l, file)
1156 {
1157 if (!edje_file_group_exists(file, key)) continue;
1158 p = strrchr(file, '.');
1159 f = ecore_file_file_get(file);
1160 memcpy(buf, f, p - f);
1161 buf[p - f] = 0;
1162 oi = e_configure_option_info_new(co, buf, eina_stringshare_ref(file));
1163 oi->thumb_file = eina_stringshare_ref(file);
1164 oi->thumb_key = eina_stringshare_ref(key);
1165 ret = eina_list_append(ret, oi);
1166 oi->current = ((file == cur) || (!e_util_strcmp(f, cur)));
1167 }
1168 EINA_LIST_FOREACH(bgs, l, file)
1169 {
1170 if (!edje_file_group_exists(file, key)) continue;
1171 p = strrchr(file, '.');
1172 f = ecore_file_file_get(file);
1173 memcpy(buf, f, p - f);
1174 buf[p - f] = 0;
1175 oi = e_configure_option_info_new(co, buf, eina_stringshare_ref(file));
1176 oi->thumb_file = eina_stringshare_ref(file);
1177 oi->thumb_key = eina_stringshare_ref(key);
1178 ret = eina_list_append(ret, oi);
1179 oi->current = ((file == cur) || (!e_util_strcmp(f, cur)));
1180 }
1181 if (ret && sthemes)
1182 ret = eina_list_append(ret, e_configure_option_info_new(co, NULL, NULL));
1183 EINA_LIST_FOREACH(sbgs, l, file)
1184 {
1185 if (!edje_file_group_exists(file, key)) continue;
1186 p = strrchr(file, '.');
1187 f = ecore_file_file_get(file);
1188 memcpy(buf, f, p - f);
1189 buf[p - f] = 0;
1190 oi = e_configure_option_info_new(co, buf, eina_stringshare_ref(file));
1191 ret = eina_list_append(ret, oi);
1192 oi->thumb_file = eina_stringshare_ref(file);
1193 oi->thumb_key = eina_stringshare_ref(key);
1194 oi->current = ((file == cur) || (!e_util_strcmp(f, cur)));
1195 }
1196 eina_stringshare_del(key);
1197 return ret;
1198}
1199
1200static int
1201_sort_cb(const char *a, const char *b)
1202{
1203 const char *f1, *f2;
1204
1205 f1 = ecore_file_file_get(a);
1206 f2 = ecore_file_file_get(b);
1207 return e_util_strcasecmp(f1, f2);
1208}
1209
1210static Eina_Bool
1211_gtk_theme_check(const char *file)
1212{
1213 Eina_Stringshare *dir;
1214 Eina_List *l;
1215
1216 EINA_LIST_FOREACH(gtk_themes, l, dir)
1217 if (!strcasecmp(ecore_file_file_get(dir), ecore_file_file_get(file))) return EINA_FALSE;
1218 return EINA_TRUE;
1219}
1220
1221static void
1222_init_main_cb(void *data __UNUSED__, Eio_File *handler, const char *file)
1223{
1224 if (handler == theme_ls[0])
1225 themes = eina_list_sorted_insert(themes, (Eina_Compare_Cb)_sort_cb, eina_stringshare_add(file));
1226 else if (handler == theme_ls[1])
1227 sthemes = eina_list_sorted_insert(sthemes, (Eina_Compare_Cb)_sort_cb, eina_stringshare_add(file));
1228 else if (handler == bg_ls[0])
1229 bgs = eina_list_sorted_insert(bgs, (Eina_Compare_Cb)_sort_cb, eina_stringshare_add(file));
1230 else if (handler == bg_ls[1])
1231 sbgs = eina_list_sorted_insert(sbgs, (Eina_Compare_Cb)_sort_cb, eina_stringshare_add(file));
1232 else if (_gtk_theme_check(file))
1233 gtk_themes = eina_list_sorted_insert(gtk_themes, (Eina_Compare_Cb)_sort_cb, eina_stringshare_add(file));
1234}
1235
1236static void
1237_init_error_cb(void *data __UNUSED__, Eio_File *handler, int error __UNUSED__)
1238{
1239 if ((!theme_ls[0]) && (!theme_ls[1]) && (!bg_ls[0]) && (!bg_ls[1]) &&
1240 (!gtk_theme_ls) && (!gtk_theme_dirs)) goto out;
1241 if (theme_ls[0] == handler)
1242 {
1243 theme_ls[0] = NULL;
1244 E_FREE_LIST(themes, eina_stringshare_del);
1245 }
1246 else if (theme_ls[1] == handler)
1247 {
1248 theme_ls[1] = NULL;
1249 E_FREE_LIST(sthemes, eina_stringshare_del);
1250 }
1251 else if (bg_ls[0] == handler)
1252 {
1253 bg_ls[0] = NULL;
1254 E_FREE_LIST(bgs, eina_stringshare_del);
1255 }
1256 else if (bg_ls[1] == handler)
1257 {
1258 bg_ls[1] = NULL;
1259 E_FREE_LIST(sbgs, eina_stringshare_del);
1260 }
1261 else if (gtk_theme_ls == handler)
1262 gtk_theme_ls = NULL;
1263 else
1264 gtk_theme_dirs = eina_list_remove(gtk_theme_dirs, handler);
1265 return;
1266out:
1267 E_FREE_LIST(themes, eina_stringshare_del);
1268 E_FREE_LIST(sthemes, eina_stringshare_del);
1269 E_FREE_LIST(bgs, eina_stringshare_del);
1270 E_FREE_LIST(sbgs, eina_stringshare_del);
1271 E_FREE_LIST(gtk_themes, eina_stringshare_del);
1272}
1273
1274static void
1275_init_done_cb(void *data __UNUSED__, Eio_File *handler)
1276{
1277 if ((!theme_ls[0]) && (!theme_ls[1]) && (!bg_ls[0]) && (!bg_ls[1]) &&
1278 (!gtk_theme_ls) && (!gtk_theme_dirs)) goto out;
1279 if (theme_ls[0] == handler)
1280 theme_ls[0] = NULL;
1281 else if (theme_ls[1] == handler)
1282 theme_ls[1] = NULL;
1283 else if (bg_ls[0] == handler)
1284 bg_ls[0] = NULL;
1285 else if (bg_ls[1] == handler)
1286 bg_ls[1] = NULL;
1287 else if (gtk_theme_ls == handler)
1288 gtk_theme_ls = NULL;
1289 else
1290 gtk_theme_dirs = eina_list_remove(gtk_theme_dirs, handler);
1291
1292 return;
1293out:
1294 E_FREE_LIST(themes, eina_stringshare_del);
1295 E_FREE_LIST(sthemes, eina_stringshare_del);
1296 E_FREE_LIST(bgs, eina_stringshare_del);
1297 E_FREE_LIST(sbgs, eina_stringshare_del);
1298 E_FREE_LIST(gtk_themes, eina_stringshare_del);
1299}
1300
1301static Eina_Bool
1302_gtk_filter_cb(void *data __UNUSED__, Eio_File *handler __UNUSED__, const char *file)
1303{
1304 return ecore_file_is_dir(file);
1305}
1306
1307static Eina_Bool
1308_edj_filter_cb(void *data __UNUSED__, Eio_File *handler __UNUSED__, const char *file)
1309{
1310 return eina_str_has_extension(file, ".edj");
1311}
1312
1313static Eina_Bool
1314_monitor_theme_rescan(void *d __UNUSED__, int type __UNUSED__, Eio_Monitor_Event *ev)
1315{
1316 char buf[PATH_MAX];
1317
1318 if (theme_mon[0] == ev->monitor)
1319 {
1320 if (theme_ls[0]) return ECORE_CALLBACK_RENEW;
1321 E_FREE_LIST(themes, eina_stringshare_del);
1322 e_user_dir_concat_static(buf, "themes");
1323 theme_ls[0] = eio_file_ls(buf, _edj_filter_cb, _init_main_cb, _init_done_cb, _init_error_cb, NULL);
1324 }
1325 else if (theme_mon[1] == ev->monitor)
1326 {
1327 if (theme_ls[1]) return ECORE_CALLBACK_RENEW;
1328 E_FREE_LIST(sthemes, eina_stringshare_del);
1329 e_prefix_data_concat_static(buf, "data/themes");
1330 theme_ls[1] = eio_file_ls(buf, _edj_filter_cb, _init_main_cb, _init_done_cb, _init_error_cb, NULL);
1331 }
1332 else if (bg_mon[0] == ev->monitor)
1333 {
1334 if (bg_ls[0]) return ECORE_CALLBACK_RENEW;
1335 E_FREE_LIST(bgs, eina_stringshare_del);
1336 e_user_dir_concat_static(buf, "backgrounds");
1337 bg_ls[0] = eio_file_ls(buf, _edj_filter_cb, _init_main_cb, _init_done_cb, _init_error_cb, NULL);
1338 }
1339 else if (bg_mon[1] == ev->monitor)
1340 {
1341 if (bg_ls[1]) return ECORE_CALLBACK_RENEW;
1342 E_FREE_LIST(sbgs, eina_stringshare_del);
1343 e_prefix_data_concat_static(buf, "data/backgrounds");
1344 bg_ls[1] = eio_file_ls(buf, _edj_filter_cb, _init_main_cb, _init_done_cb, _init_error_cb, NULL);
1345 }
1346 else
1347 {
1348 const char *dir;
1349 Eina_List *l;
1350
1351 if (gtk_theme_ls && (gtk_theme_mon == ev->monitor)) return ECORE_CALLBACK_RENEW;
1352 if (gtk_theme_ls) eio_file_cancel(gtk_theme_ls);
1353 E_FREE_LIST(gtk_themes, eina_stringshare_del);
1354 E_FREE_LIST(gtk_theme_dirs, eio_file_cancel);
1355 e_user_homedir_concat_static(buf, ".themes");
1356 gtk_theme_ls = eio_file_ls(buf, _gtk_filter_cb, _init_main_cb, _init_done_cb, _init_error_cb, NULL);
1357 EINA_LIST_FOREACH(efreet_data_dirs_get(), l, dir)
1358 {
1359 Eio_File *ls;
1360
1361 snprintf(buf, sizeof(buf), "%s/themes", dir);
1362 ls = eio_file_ls(buf, _gtk_filter_cb, _init_main_cb, _init_done_cb, _init_error_cb, NULL);
1363 if (!ls) continue;
1364 gtk_theme_dirs = eina_list_append(gtk_theme_dirs, ls);
1365 }
1366 }
1367
1368 return ECORE_CALLBACK_RENEW;
1369}
1370
1371static Eina_Bool
1372_monitor_error(void *d __UNUSED__, int type __UNUSED__, Eio_Monitor_Event *ev)
1373{
1374 if (theme_mon[0] == ev->monitor)
1375 theme_mon[0] = NULL;
1376 else if (theme_mon[1] == ev->monitor)
1377 theme_mon[1] = NULL;
1378 else if (bg_mon[0] == ev->monitor)
1379 bg_mon[0] = NULL;
1380 else if (bg_mon[1] == ev->monitor)
1381 bg_mon[1] = NULL;
1382 else if (gtk_theme_mon == ev->monitor)
1383 gtk_theme_mon = NULL;
1384 else
1385 gtk_theme_mons = eina_list_remove(gtk_theme_mons, ev->monitor);
1386 return ECORE_CALLBACK_RENEW;
1387}
1388
1389EINTERN int
1390e_configure_option_init(void)
1391{
1392 E_Configure_Option *co;
1393 char buf[PATH_MAX];
1394
1395 E_EVENT_CONFIGURE_OPTION_CHANGED = ecore_event_type_new();
1396 E_EVENT_CONFIGURE_OPTION_ADD = ecore_event_type_new();
1397 E_EVENT_CONFIGURE_OPTION_DEL = ecore_event_type_new();
1398 E_EVENT_CONFIGURE_OPTION_CATEGORY_ADD = ecore_event_type_new();
1399 E_EVENT_CONFIGURE_OPTION_CATEGORY_DEL = ecore_event_type_new();
1400 E_EVENT_CONFIGURE_OPTION_TAG_ADD = ecore_event_type_new();
1401 E_EVENT_CONFIGURE_OPTION_TAG_DEL = ecore_event_type_new();
1402
1403 tags_hash = eina_hash_string_superfast_new(NULL);
1404#define OPT_ADD(TYPE, NAME, DESC, ...) \
1405 co = e_configure_option_add(E_CONFIGURE_OPTION_TYPE_##TYPE, DESC, #NAME, EINA_FALSE, &e_config->NAME, NULL);\
1406 e_configure_option_tags_set(co, (const char*[]){__VA_ARGS__, NULL}, 0)
1407#define OPT_HELP(STR) \
1408 co->help = eina_stringshare_add(_(STR))
1409#define OPT_MINMAX_STEP_FMT(MIN, MAX, STEP, FMT) \
1410 co->minmax[0] = (MIN), co->minmax[1] = (MAX), co->step = (STEP),\
1411 co->info = eina_stringshare_add(_(FMT))
1412#define OPT_ICON(ICON) \
1413 e_configure_option_data_set(co, "icon", eina_stringshare_add(ICON))
1414
1415 OPT_ADD(BOOL, show_splash, _("Show splash screen on startup"), _("splash"), _("startup"));
1416 OPT_ADD(STR, init_default_theme, _("Startup splash theme"), _("splash"), _("startup"), _("theme"), _("animate"));
1417 co->info_cb = _e_configure_init_default_theme_info_cb;
1418 OPT_ICON("preferences-startup");
1419
1420 OPT_ADD(STR, transition_start, _("Startup transition effect"), _("transition"), _("startup"), _("theme"), _("animate"));
1421 co->info_cb = _e_configure_transition_info_cb;
1422 co->thumb_cb = _e_configure_transition_thumb_cb;
1423 OPT_ICON("preferences-transitions");
1424 OPT_ADD(STR, transition_desk, _("Desk change transition effect"), _("transition"), _("vdesk"), _("theme"), _("animate"));
1425 co->info_cb = _e_configure_transition_info_cb;
1426 co->thumb_cb = _e_configure_transition_thumb_cb;
1427 OPT_ICON("preferences-transitions");
1428 OPT_ADD(STR, transition_change, _("Wallpaper change transition effect"), _("transition"), _("wallpaper"), _("theme"), _("animate"));
1429 co->info_cb = _e_configure_transition_info_cb;
1430 co->thumb_cb = _e_configure_transition_thumb_cb;
1431 OPT_ICON("preferences-transitions");
1432
1433 OPT_ADD(CUSTOM, themes, _("Enlightenment theme settings"), _("theme"));
1434 co->info = eina_stringshare_add("appearance/theme");
1435 OPT_ICON("preferences-desktop-theme");
1436 OPT_ADD(CUSTOM, desktop_backgrounds, _("Desktop wallpaper settings"), _("wallpaper"));
1437 co->info = eina_stringshare_add("appearance/wallpaper");
1438 OPT_ICON("preferences-desktop-wallpaper");
1439 OPT_ADD(STR, desktop_default_background, _("Default desktop wallpaper"), _("wallpaper"));
1440 co->info_cb = _e_configure_background_info_cb;
1441 co->funcs[0].none = co->funcs[1].none = e_bg_update;
1442 OPT_ICON("preferences-desktop-wallpaper");
1443 OPT_ADD(CUSTOM, color_classes, _("Enlightenment color settings"), _("theme"), _("color"));
1444 co->info = eina_stringshare_add("appearance/colors");
1445 OPT_ICON("preferences-desktop-color");
1446 OPT_ADD(STR, desktop_default_name, _("Default desktop name"), _("desktop"), _("name"));
1447 OPT_HELP("Used in Pager displays");
1448 OPT_ICON("preferences-desktop");
1449 //OPT_ADD(STR, desktop_default_window_profile;
1450
1451 OPT_ADD(DOUBLE, menus_scroll_speed, _("Menu scroll speed"), _("menu"), _("scroll"), _("speed"));
1452 OPT_MINMAX_STEP_FMT(1.0, 20000.0, 100, "%5.0f pixels/s");
1453 OPT_HELP("Speed at which the menus move onto screen if offscreen");
1454 OPT_ADD(DOUBLE, menus_fast_mouse_move_threshhold, _("Menu fast move threshold"), _("menu"), _("move"), _("speed"));
1455 OPT_MINMAX_STEP_FMT(1.0, 2000.0, 10, "%4.0f pixels/s");
1456 OPT_HELP("Moving the mouse faster than this speed over a menu causes menu items to not be selected");
1457 OPT_ADD(DOUBLE, menus_click_drag_timeout, _("Menu mouse deactivate delay"), _("menu"), _("drag"), _("delay"));
1458 OPT_MINMAX_STEP_FMT(0.0, 10.0, 0.25, "%2.2f seconds");
1459 OPT_HELP("The minimum time before a menu can be closed by clicking the mouse outside the menu");
1460 OPT_ADD(DOUBLE_INT, menu_autoscroll_margin, _("Menu autoscroll margin"), _("menu"), _("scroll"));
1461 OPT_MINMAX_STEP_FMT(0, 50, 1, "%2.0f pixels");
1462 OPT_HELP("The distance from the edge of the screen before menus begin to move away from the edge");
1463 OPT_ADD(DOUBLE_INT, menu_autoscroll_cursor_margin, _("Menu autoscroll cursor margin"), _("menu"), _("scroll"), _("mouse"), _("pointer"));
1464 OPT_MINMAX_STEP_FMT(0, 50, 1, "%2.0f pixels");
1465 OPT_HELP("The distance of the mouse pointer from the edge of the screen before menus begin to move away from the edge");
1466
1467 OPT_ADD(BOOL, border_shade_animate, _("Enable window shading animation"), _("border"), _("shade"), _("animate"));
1468 OPT_ADD(ENUM, border_shade_transition, _("Window shade animation type"), _("border"), _("shade"), _("animate")); //enum
1469 co->info_cb = _e_configure_border_shade_transition_info_cb;
1470 OPT_ICON("preferences-system-windows");
1471 OPT_ADD(DOUBLE, border_shade_speed, _("Window shade animation speed"), _("border"), _("shade"), _("animate"), _("speed"));
1472 OPT_MINMAX_STEP_FMT(100, 9900, 100, "%4.0f pixels/s");
1473
1474 /* advanced */
1475 OPT_ADD(DOUBLE, framerate, _("Framerate"), _("speed"), _("animate"));
1476 OPT_MINMAX_STEP_FMT(5.0, 200.0, 1, "%1.0f frames/second");
1477 OPT_HELP("The framerate at which animations in Enlightenment occur");
1478 co->funcs[0].none = _e_configure_framerate_changed;
1479 OPT_ADD(DOUBLE_INT, priority, _("Application exec priority"), _("application"), _("exec"), _("priority"));
1480 OPT_MINMAX_STEP_FMT(0, 19, 1, "%1.0f");
1481 co->funcs[0].one = ecore_exe_run_priority_set;
1482 OPT_ADD(DOUBLE_INT, image_cache, _("Image cache size"), _("cache"), _("image"), _("size"));
1483 OPT_MINMAX_STEP_FMT(0, 32 * 1024, 1024, "%4.0f KiB");
1484 co->funcs[0].none = _e_configure_framerate_changed;
1485 OPT_ADD(DOUBLE_INT, font_cache, _("Font cache size"), _("cache"), _("font"), _("size"));
1486 OPT_MINMAX_STEP_FMT(0, 4 * 1024, 128, "%3.0f KiB");
1487 co->funcs[0].none = _e_configure_framerate_changed;
1488 OPT_ADD(DOUBLE_INT, edje_cache, _("Edje cache size"), _("cache"), _("edje"), _("size"));
1489 OPT_MINMAX_STEP_FMT(0, 256, 1, "%1.0f files");
1490 co->funcs[0].none = _e_configure_framerate_changed;
1491 OPT_ADD(DOUBLE_INT, edje_collection_cache, _("Edje collection cache size"), _("cache"), _("edje"), _("size"));
1492 OPT_MINMAX_STEP_FMT(0, 512, 2, "%1.0f collections");
1493 co->funcs[0].none = _e_configure_framerate_changed;
1494 OPT_ADD(DOUBLE_INT, cache_flush_poll_interval, _("Cache flushing interval"), _("cache"), _("delay")); //slider
1495 OPT_MINMAX_STEP_FMT(8, 4096, 8, "%1.0f ticks");
1496 co->funcs[0].none = _e_configure_framerate_changed;
1497
1498 OPT_ADD(CUSTOM, path_append_data, _("Search directory settings"), _("environment"));
1499 co->info = eina_stringshare_add("advanced/search_directories");
1500 OPT_ICON("preferences-directories");
1501 OPT_ADD(CUSTOM, path_append_data, _("Environment variable settings"), _("environment"));
1502 co->info = eina_stringshare_add("advanced/environment_variables");
1503 OPT_ICON("preferences-variables");
1504
1505 OPT_ADD(CUSTOM, randr_serialized_setup, _("Screen resolution and orientation settings"), _("screen"), _("size"));
1506 co->info = eina_stringshare_add("screen/screen_setup");
1507 OPT_ICON("preferences-system-screen-resolution");
1508
1509 OPT_ADD(DOUBLE_INT, zone_desks_x_count, _("Horizontal virtual desktop count"), _("vdesk"), _("desktop"), _("screen"));
1510 co->funcs[0].none = _e_configure_zone_desks_count_changed;
1511 OPT_ADD(DOUBLE_INT, zone_desks_y_count, _("Vertical virtual desktop count"), _("vdesk"), _("desktop"), _("screen"));
1512 co->funcs[0].none = _e_configure_zone_desks_count_changed;
1513 OPT_ADD(BOOL, edge_flip_dragging, _("Edge flip while dragging"), _("edge"), _("flip"), _("drag"), _("binding"));
1514 OPT_HELP("Enable edge binding functionality while dragging objects to screen edge");
1515 OPT_ADD(BOOL, use_composite, _("Use ARGB instead of shaped windows"), _("border"));
1516
1517 OPT_ADD(CUSTOM, modules, _("Module settings"), _("module"));
1518 co->info = eina_stringshare_add("extensions/modules");
1519 OPT_ICON("preferences-plugin");
1520 OPT_ADD(BOOL, no_module_delay, _("Disable module delay"), _("module"), _("delay"));
1521 OPT_HELP("If enabled, this causes E to load all modules at once during startup "
1522 "instead of loading them incrementally");
1523
1524 /* FIXME */
1525 OPT_ADD(CUSTOM, language, _("Language"), _("language"));
1526 co->info = eina_stringshare_add("language/language_settings");
1527 OPT_ICON("preferences-desktop-locale");
1528 //co->requires_restart = 1;
1529 //co->funcs[0].one = e_intl_language_set;
1530 OPT_ADD(CUSTOM, desklock_language, _("Desklock language"), _("desklock"), _("language"));
1531 co->info = eina_stringshare_add("language/desklock_language_settings");
1532 OPT_ICON("preferences-desklock-locale");
1533
1534 OPT_ADD(ENUM, window_placement_policy, _("Window placement policy"), _("border"), _("placement")); //enum
1535 co->info_cb = _e_configure_window_placement_policy_info_cb;
1536 OPT_ICON("preferences-system-windows");
1537 OPT_HELP("Determines where and how new windows are placed when created");
1538 OPT_ADD(BOOL, window_grouping, _("Group new windows from same application"), _("border"), _("placement"));
1539 OPT_ADD(BOOL, desk_auto_switch, _("Switch to desk of new window"), _("border"), _("placement"), _("vdesk"));
1540
1541 OPT_ADD(ENUM, focus_policy, _("Window focus policy"), _("focus"), _("border")); //enum
1542 co->info_cb = _e_configure_focus_policy_info_cb;
1543 OPT_ICON("preferences-focus");
1544 OPT_ADD(ENUM, focus_setting, _("New window focus policy"), _("focus"), _("border")); //enum
1545 co->info_cb = _e_configure_focus_setting_info_cb;
1546 OPT_ICON("preferences-focus");
1547 OPT_ADD(BOOL, pass_click_on, _("Pass click to unfocused windows"), _("focus"), _("border"), _("click"));
1548 OPT_HELP("When clicking an unfocused window, the click is not passed through to the application");
1549 OPT_ADD(ENUM, window_activehint_policy, _("Policy when applications request focus"), _("focus"), _("border")); //enum
1550 co->info_cb = _e_configure_window_activehint_policy_info_cb;
1551 OPT_ICON("preferences-focus");
1552 OPT_ADD(BOOL, always_click_to_raise, _("Always raise window when clicked"), _("focus"), _("border"), _("click"), _("raise"));
1553 OPT_ADD(BOOL, always_click_to_focus, _("Always focus window when clicked"), _("focus"), _("border"), _("click"));
1554 OPT_ADD(BOOL, use_auto_raise, _("Enable window autoraise"), _("focus"), _("border"), _("raise"));
1555 OPT_ADD(DOUBLE, auto_raise_delay, _("Window autoraise delay"), _("focus"), _("border"), _("raise"), _("delay"));
1556 OPT_MINMAX_STEP_FMT(0.0, 9.9, 0.1, "%1.1f seconds");
1557 OPT_ADD(BOOL, focus_last_focused_per_desktop, _("Revert window focus on desk switch"), _("border"), _("focus"), _("vdesk"));
1558 OPT_ADD(BOOL, focus_revert_on_hide_or_close, _("Revert window focus on window hide or close"), _("border"), _("focus"));
1559 OPT_ADD(BOOL, pointer_slide, _("Warp pointer to new windows and away from closed windows"), _("border"), _("focus"), _("warp"), _("pointer"));
1560 OPT_ADD(BOOL, border_raise_on_mouse_action, _("Windows raise on mouse move/resize"), _("border"), _("raise"), _("focus"), _("mouse"), _("pointer"), _("move"), _("resize"));
1561 OPT_ADD(BOOL, border_raise_on_focus, _("Windows raise when focused"), _("border"), _("raise"), _("focus"), _("mouse"));
1562
1563 OPT_ADD(DOUBLE_INT, drag_resist, _("Shelf gadget resistance"), _("gadget"), _("resist"), _("drag"), _("shelf"));
1564 OPT_MINMAX_STEP_FMT(0, 100, 2, "%2.0f pixels");
1565 OPT_ADD(CUSTOM, shelves, _("Shelf settings"), _("shelf"), _("desktop"));
1566 co->info = eina_stringshare_add("extensions/shelves");
1567 OPT_ICON("preferences-desktop-shelf");
1568
1569 OPT_ADD(BOOL, use_resist, _("Enable resistance when dragging windows"), _("border"), _("resist"), _("drag"));
1570 OPT_ADD(DOUBLE_INT, desk_resist, _("Window resistance against screen edges"), _("border"), _("resist"), _("vdesk"), _("screen"), _("drag"));
1571 OPT_MINMAX_STEP_FMT(0, 100, 2, "%2.0f pixels");
1572 OPT_ADD(DOUBLE_INT, window_resist, _("Window resistance against other windows"), _("border"), _("resist"), _("drag"));
1573 OPT_MINMAX_STEP_FMT(0, 100, 2, "%2.0f pixels");
1574 OPT_ADD(DOUBLE_INT, gadget_resist, _("Window resistance against desktop gadgets"), _("gadget"), _("resist"), _("desktop"), _("drag"));
1575 OPT_MINMAX_STEP_FMT(0, 100, 2, "%2.0f pixels");
1576
1577 OPT_ADD(BOOL, geometry_auto_move, _("Move window after autoresizing"), _("border"), _("placement"));
1578 OPT_ADD(BOOL, geometry_auto_resize_limit, _("Limit window autoresizing to useful geometry"), _("border"), _("placement"), _("resize"));
1579 OPT_HELP("Useful geometry is calculated as the screen size minus the geometry of any shelves which do not allow windows to overlap them");
1580
1581 OPT_ADD(BOOL, winlist_warp_while_selecting, _("Winlist moves pointer to currently selected window while selecting"), _("border"), _("winlist"), _("focus"), _("warp"), _("pointer"));
1582 OPT_ADD(BOOL, winlist_warp_at_end, _("Winlist moves pointer to currently selected window after winlist closes"), _("border"), _("winlist"), _("focus"), _("warp"), _("pointer"));
1583 OPT_ADD(DOUBLE, winlist_warp_speed, _("Winlist pointer warp speed while selecting"), _("border"), _("winlist"), _("focus"), _("warp"), _("pointer"), _("speed"));
1584 OPT_MINMAX_STEP_FMT(0.0, 1.0, 0.01, "%1.2f");
1585 OPT_ADD(BOOL, winlist_scroll_animate, _("Enable winlist scroll animation"), _("border"), _("winlist"), _("animate"));
1586 OPT_ADD(DOUBLE, winlist_scroll_speed, _("Winlist scroll speed"), _("border"), _("winlist"), _("animate"), _("speed"));
1587 OPT_MINMAX_STEP_FMT(0.0, 1.0, 0.01, "%1.2f");
1588 OPT_ADD(BOOL, winlist_list_show_iconified, _("Winlist shows iconified windows"), _("border"), _("winlist"), _("iconif"));
1589 OPT_ADD(BOOL, winlist_list_show_other_desk_iconified, _("Winlist shows iconified windows from other desks"), _("border"), _("winlist"), _("iconif"), _("vdesk"));
1590 OPT_ADD(BOOL, winlist_list_show_other_screen_iconified, _("Winlist shows iconified windows from other screens"), _("border"), _("winlist"), _("iconif"), _("screen"));
1591 OPT_ADD(BOOL, winlist_list_show_other_desk_windows, _("Winlist shows windows from other desks"), _("border"), _("winlist"), _("vdesk"));
1592 OPT_ADD(BOOL, winlist_list_show_other_screen_windows, _("Winlist shows windows from other screens"), _("border"), _("winlist"), _("screen"));
1593 OPT_ADD(BOOL, winlist_list_uncover_while_selecting, _("Winlist uniconifies and unshades windows while selecting"), _("border"), _("winlist"), _("raise"));
1594 OPT_ADD(BOOL, winlist_list_jump_desk_while_selecting, _("Winlist switches desks while selecting"), _("border"), _("winlist"), _("vdesk"));
1595 OPT_ADD(BOOL, winlist_list_focus_while_selecting, _("Winlist focuses windows while selecting"), _("border"), _("winlist"), _("focus"));
1596 OPT_ADD(BOOL, winlist_list_raise_while_selecting, _("Winlist raises windows while selecting"), _("border"), _("winlist"), _("raise"), _("focus"));
1597 OPT_ADD(DOUBLE, winlist_pos_align_x, _("Winlist horizontal alignment"), _("border"), _("winlist"), _("placement"));
1598 OPT_MINMAX_STEP_FMT(0.0, 1.0, 0.01, "%1.2f");
1599 OPT_ADD(DOUBLE, winlist_pos_align_y, _("Winlist vertical alignment"), _("border"), _("winlist"), _("placement"));
1600 OPT_MINMAX_STEP_FMT(0.0, 1.0, 0.01, "%1.2f");
1601 OPT_ADD(DOUBLE, winlist_pos_size_w, _("Winlist width"), _("border"), _("winlist"), _("placement"));
1602 OPT_MINMAX_STEP_FMT(0.0, 1.0, 0.01, "%1.2f");
1603 OPT_ADD(DOUBLE, winlist_pos_size_h, _("Winlist height"), _("border"), _("winlist"), _("placement"));
1604 OPT_MINMAX_STEP_FMT(0.0, 1.0, 0.01, "%1.2f");
1605 OPT_ADD(DOUBLE_INT, winlist_pos_min_w, _("Winlist minimum width"), _("border"), _("winlist"), _("placement"));
1606 OPT_MINMAX_STEP_FMT(0, 4000, 10, "%4.0f pixels");
1607 OPT_ADD(DOUBLE_INT, winlist_pos_min_h, _("Winlist minimum height"), _("border"), _("winlist"), _("placement"));
1608 OPT_MINMAX_STEP_FMT(0, 4000, 10, "%4.0f pixels");
1609 OPT_ADD(DOUBLE_INT, winlist_pos_max_w, _("Winlist maximum width"), _("border"), _("winlist"), _("placement"));
1610 OPT_MINMAX_STEP_FMT(0, 4000, 10, "%4.0f pixels");
1611 OPT_ADD(DOUBLE_INT, winlist_pos_max_h, _("Winlist maximum height"), _("border"), _("winlist"), _("placement"));
1612 OPT_MINMAX_STEP_FMT(0, 4000, 10, "%4.0f pixels");
1613
1614 OPT_ADD(ENUM, fullscreen_policy, _("Fullscreen window policy"), _("fullscreen")); //enum
1615 co->info_cb = _e_configure_fullscreen_policy_info_cb;
1616 OPT_ICON("preferences-window-geometry");
1617 OPT_ADD(ENUM, maximize_policy, _("Window maximize policy"), _("border"), _("maximize")); //enum
1618 co->info_cb = _e_configure_maximize_policy_info_cb;
1619 OPT_ICON("preferences-window-geometry");
1620 OPT_ADD(BOOL, allow_manip, _("Allow moving of maximized windows"), _("border"), _("maximize"));
1621 OPT_ADD(BOOL, border_fix_on_shelf_toggle, _("Adjust windows on shelf toggle"), _("border"), _("shelf"), _("placement"));
1622 OPT_HELP("When using an autohiding shelf, this option causes maximized windows to expand and contract to fill the space that the shelf occupies when it hides");
1623 OPT_ADD(BOOL, allow_above_fullscreen, _("Allow windows above fullscreen windows"), _("border"), _("focus"), _("placement"), _("fullscreen"));
1624
1625 OPT_ADD(BOOL, kill_if_close_not_possible, _("Kill window if process not responding to close"), _("border"), _("kill"));
1626 OPT_ADD(BOOL, kill_process, _("Kill process instead of client"), _("border"), _("kill"));
1627 OPT_ADD(DOUBLE, kill_timer_wait, _("Window kill delay"), _("border"), _("kill"), _("delay"));
1628 OPT_MINMAX_STEP_FMT(1, 30, 1, "%1.0f seconds");
1629 OPT_ADD(BOOL, ping_clients, _("Enable window client pinging"), _("border"), _("delay"));
1630 OPT_ADD(DOUBLE_INT, ping_clients_interval, _("Window client ping interval (CPU ticks)"), _("border"), _("delay")); //slider
1631 OPT_MINMAX_STEP_FMT(1, 256, 1, "%1.0f seconds");
1632
1633 /* FIXME */
1634 OPT_ADD(CUSTOM, remembers, _("Window remember settings"), _("border"), _("remember"));
1635 co->info = eina_stringshare_add("windows/window_remembers");
1636 OPT_ICON("preferences-desktop-window-remember");
1637 OPT_ADD(BOOL, remember_internal_windows, _("Remember internal window geometry"), _("border"), _("remember"));
1638 OPT_HELP("This option causes E to remember the geometry of its internal dialogs and windows, NOT including filemanager windows");
1639 OPT_ADD(BOOL, remember_internal_fm_windows, _("Remember internal filemanager window geometry"), _("border"), _("remember"), _("files"));
1640 OPT_HELP("This option causes E to remember the geometry of its internal filemanager windows, NOT including dialog windows");
1641
1642 OPT_ADD(BOOL, move_info_follows, _("Window position info follows window when moving"), _("border"), _("placement"), _("move"));
1643 OPT_ADD(BOOL, resize_info_follows, _("Window geometry info follows window when resizing"), _("border"), _("placement"), _("resize"));
1644 OPT_ADD(BOOL, move_info_visible, _("Window position info visible when moving"), _("border"), _("placement"), _("move"));
1645 OPT_ADD(BOOL, resize_info_visible, _("Window geometry info visible when moving"), _("border"), _("placement"), _("resize"));
1646
1647 OPT_ADD(CUSTOM, key_bindings, _("Key bindings"), _("input"), _("key"), _("binding"));
1648 co->info = eina_stringshare_add("keyboard_and_mouse/key_bindings");
1649 OPT_ICON("preferences-desktop-keyboard-shortcuts");
1650 OPT_ADD(CUSTOM, mouse_bindings, _("Mouse bindings"), _("input"), _("mouse"), _("binding"));
1651 co->info = eina_stringshare_add("keyboard_and_mouse/mouse_bindings");
1652 OPT_ICON("preferences-desktop-mouse");
1653 OPT_ADD(CUSTOM, acpi_bindings, _("ACPI bindings"), _("input"), _("acpi"), _("binding"));
1654 co->info = eina_stringshare_add("keyboard_and_mouse/acpi_bindings");
1655 OPT_ICON("preferences-system-power-management");
1656 OPT_ADD(CUSTOM, edge_bindings, _("Screen edge bindings"), _("input"), _("edge"), _("screen"), _("binding"));
1657 co->info = eina_stringshare_add("keyboard_and_mouse/edge_bindings");
1658 OPT_ICON("preferences-desktop-edge-bindings");
1659 OPT_ADD(CUSTOM, signal_bindings, _("Edje signal bindings"), _("input"), _("edje"), _("mouse"), _("binding"));
1660 co->info = eina_stringshare_add("advanced/signal_bindings");
1661 OPT_ICON("preferences-desktop-signal-bindings");
1662 OPT_ADD(CUSTOM, xkb.used_layouts, _("Keyboard layout settings"), _("input"), _("key"), _("language"));
1663 co->info = eina_stringshare_add("keyboard_and_mouse/xkbswitch");
1664 OPT_ICON("preferences-desktop-keyboard");
1665
1666 /* FIXME */
1667 OPT_ADD(CUSTOM, input_method, _("Input method"), _("input"), _("language"));
1668 co->info = eina_stringshare_add("language/input_method_settings");
1669 OPT_ICON("preferences-imc");
1670 //co->funcs[0].one = e_intl_input_method_set;
1671
1672 OPT_ADD(BOOL, transient.move, _("Transient windows follow movement of their child"), _("border"), _("transient"), _("move"), _("placement"));
1673 OPT_ADD(BOOL, transient.resize, _("Transient windows follow resize of their child"), _("border"), _("transient"), _("placement"), _("resize"));
1674 OPT_ADD(BOOL, transient.raise, _("Transient windows follow raise of their child"), _("border"), _("transient"), _("raise"), _("placement"));
1675 OPT_ADD(BOOL, transient.lower, _("Transient windows follow lower of their child"), _("border"), _("transient"), _("placement"), _("raise"));
1676 OPT_ADD(BOOL, transient.layer, _("Transient windows follow layer change of their child"), _("border"), _("transient"), _("placement"));
1677 OPT_ADD(BOOL, transient.desktop, _("Transient windows follow desk change of their child"), _("border"), _("transient"), _("placement"), _("vdesk"));
1678 OPT_ADD(BOOL, transient.iconify, _("Transient windows follow iconification of their child"), _("border"), _("transient"), _("iconif"));
1679
1680 OPT_ADD(BOOL, menu_eap_name_show, _("Application menus shows Name field"), _("menu"));
1681 OPT_HELP("This information is taken from the related .desktop file");
1682 OPT_ADD(BOOL, menu_eap_generic_show, _("Application menus shows Generic field"), _("menu"));
1683 OPT_HELP("This information is taken from the related .desktop file");
1684 OPT_ADD(BOOL, menu_eap_comment_show, _("Application menus shows Comment field"), _("menu"));
1685 OPT_HELP("This information is taken from the related .desktop file");
1686
1687 OPT_ADD(CUSTOM, path_append_data, _("Create a new application launcher"), _("application"), _("exec"));
1688 co->info = eina_stringshare_add("applications/new_application");
1689 OPT_ICON("preferences-applications-add");
1690 OPT_ADD(CUSTOM, path_append_data, _("Application launchers"), _("application"), _("exec"));
1691 co->info = eina_stringshare_add("applications/personal_applications");
1692 OPT_ICON("preferences-applications-personal");
1693 OPT_ADD(CUSTOM, path_append_data, _("Favorite applications"), _("application"), _("exec"));
1694 co->info = eina_stringshare_add("applications/favorite_applications");
1695 OPT_ICON("user-bookmarks");
1696 OPT_ADD(CUSTOM, path_append_data, _("Ibar applications"), _("application"), _("exec"));
1697 co->info = eina_stringshare_add("applications/ibar_applications");
1698 OPT_ICON("preferences-applications-ibar");
1699 OPT_ADD(CUSTOM, path_append_data, _("Desk lock applications"), _("application"), _("exec"), _("desklock"));
1700 co->info = eina_stringshare_add("applications/screen_lock_applications");
1701 OPT_ICON("preferences-applications-screen-lock");
1702 OPT_ADD(CUSTOM, path_append_data, _("Desk unlock applications"), _("application"), _("exec"), _("desklock"));
1703 co->info = eina_stringshare_add("applications/screen_unlock_applications");
1704 OPT_ICON("preferences-applications-screen-unlock");
1705 OPT_ADD(CUSTOM, path_append_data, _("Enlightenment restart applications"), _("application"), _("exec"));
1706 co->info = eina_stringshare_add("applications/restart_applications");
1707 OPT_ICON("preferences-applications-restart");
1708 OPT_ADD(CUSTOM, path_append_data, _("Enlightenment start applications"), _("application"), _("exec"), _("startup"));
1709 co->info = eina_stringshare_add("applications/startup_applications");
1710 OPT_ICON("preferences-applications-startup");
1711 OPT_ADD(CUSTOM, path_append_data, _("Enlightenment default applications"), _("application"), _("exec"));
1712 co->info = eina_stringshare_add("applications/default_applications");
1713 OPT_ICON("preferences-desktop-default-applications");
1714 OPT_ADD(BOOL, menu_favorites_show, _("Show Favorite Applications in the main menu"), _("menu"), _("application"));
1715 OPT_ADD(BOOL, menu_apps_show, _("Show Applications in the main menu"), _("menu"), _("application"));
1716
1717 OPT_ADD(BOOL, menu_gadcon_client_toplevel, _("Show gadget settings in top-level gadget menu"), _("menu"), _("gadget"));
1718
1719 OPT_ADD(STR, exebuf_term_cmd, _("Launch commands with this command"), _("exec"));
1720 OPT_ICON("modules-launcher");
1721 OPT_HELP("Command used to launch files and applications");
1722
1723 OPT_ADD(BOOL, use_app_icon, _("Window borders use application icon"), _("border"), _("image"));
1724 OPT_HELP("Applications provide their own icons. If this option is not set, E will use internal theme icons instead of the application-provided icon");
1725
1726 OPT_ADD(CUSTOM, path_append_data, _("Enlightenment profile settings"), _("profile"));
1727 co->info = eina_stringshare_add("settings/profiles");
1728 OPT_ICON("preferences-profiles");
1729
1730 OPT_ADD(BOOL, cnfmdlg_disabled, _("Disable confirmation dialogs"), _("confirm"), _("dialog"));
1731 OPT_HELP("This option suppresses all confirmation dialogs and assumes that the user has clicked the confirm option");
1732 OPT_ADD(BOOL, cfgdlg_auto_apply, _("Configuration dialogs automatically apply their changes"), _("dialog"), _("settings"));
1733 OPT_HELP("This option causes any configuration options to be applied immediately when changed instead of requiring the 'Apply' button to be clicked");
1734 OPT_ADD(BOOL, cfgdlg_default_mode, _("Configuration dialogs show advanced view by default"), _("dialog"), _("border"), _("settings"));
1735 OPT_HELP("Configurations dialogs can have basic and advanced views; this option causes all configuration dialogs to show the advanced view by default");
1736 OPT_ADD(BOOL, cfgdlg_normal_wins, _("Configuration dialog windows are normal windows"), _("dialog"), _("border"));
1737 OPT_HELP("This option causes configuration dialogs to be normal windows instead of dialog windows");
1738
1739 OPT_ADD(CUSTOM, font_defaults, _("Enlightenment font settings"), _("font"));
1740 co->info = eina_stringshare_add("appearance/fonts");
1741 OPT_ICON("preferences-desktop-font");
1742 OPT_ADD(ENUM, font_hinting, _("Set font hinting mode"), _("font"), _("hinting")); //enum
1743 co->info_cb = _e_configure_font_hinting_info_cb;
1744 OPT_ICON("preferences-desktop-font");
1745
1746/* seems to be disabled ?
1747 OPT_ADD(STR, desklock_personal_passwd, _("Desklock custom password"), _("desklock")); //passwd
1748 OPT_HELP("This option causes desklock to use a custom-provided password instead of the user's password");
1749*/
1750 OPT_ADD(BOOL, desklock_auth_method, _("Use custom command for desklock"), _("desklock"), _("exec"));
1751 OPT_HELP("This option allows an external application to manage desklock");
1752 OPT_ADD(STR, desklock_custom_desklock_cmd, _("Custom desklock command"), _("desklock"), _("exec"));
1753 OPT_ICON("preferences-system-lock-screen");
1754 OPT_ADD(ENUM, desklock_login_box_zone, _("Desklock login box shows on which screen?"), _("desklock"), _("screen")); //enum+slider
1755 co->info_cb = _e_configure_desklock_login_box_zone_info_cb;
1756 OPT_ICON("preferences-system-lock-screen");
1757 OPT_ADD(BOOL, desklock_start_locked, _("Desklock activates on login"), _("desklock"));
1758 OPT_ADD(BOOL, desklock_on_suspend, _("Desklock activates on resume from suspend"), _("desklock"));
1759 OPT_ADD(BOOL, desklock_autolock_screensaver, _("Desklock activates during screensaver"), _("desklock"), _("delay"), _("screensaver"));
1760 OPT_ADD(DOUBLE, desklock_post_screensaver_time, _("Desklock activates X seconds after screensaver activates"), _("desklock"), _("delay"), _("screensaver"));
1761 OPT_MINMAX_STEP_FMT(0.0, 300.0, 10, "%2.0f seconds");
1762 OPT_ADD(BOOL, desklock_autolock_idle, _("Desklock activates when idle"), _("desklock"), _("delay"));
1763 OPT_ADD(DOUBLE, desklock_autolock_idle_timeout, _("Desklock activates when idle for X seconds"), _("desklock"), _("delay"));
1764 OPT_MINMAX_STEP_FMT(30, 5400.0, 60, "%2.0f seconds");
1765 OPT_ADD(BOOL, desklock_use_custom_desklock, _("Use custom desklock wallpaper"), _("desklock"), _("wallpaper"));
1766 OPT_ADD(BOOL, desklock_ask_presentation, _("Prompt for desklock timer delay if deactivated quickly"), _("desklock"), _("delay"));
1767 OPT_ADD(DOUBLE, desklock_ask_presentation_timeout, _("Desklock quick deactivation timer delay"), _("desklock"), _("delay"));
1768 OPT_MINMAX_STEP_FMT(1.0, 300.0, 10, "%2.0f seconds");
1769
1770 OPT_ADD(BOOL, screensaver_enable, _("Enable screensaver"), _("screensaver"));
1771 OPT_ADD(DOUBLE_INT, screensaver_timeout, _("Screensaver activates when idle for X seconds"), _("screensaver"), _("delay")); //slider
1772 OPT_MINMAX_STEP_FMT(30, 5400, 60, "%2.0f seconds");
1773
1774 //OPT_ADD(INT, screensaver_interval, _("screensaver"), _("delay")); NOT USED?
1775 //OPT_ADD(INT, screensaver_blanking, _("screensaver"), _("delay")); NOT USED?
1776 //OPT_ADD(INT, screensaver_expose, _("screensaver"), _("delay")); NOT USED?
1777 OPT_ADD(BOOL, screensaver_ask_presentation, _("Prompt for screensaver timer delay if deactivated quickly"), _("screensaver"));
1778 co->funcs[0].none = co->funcs[1].none = _e_configure_screensaver_changed;
1779 OPT_ADD(DOUBLE, screensaver_ask_presentation_timeout, _("Screensaver quick deactivation timer delay"), _("screensaver"), _("delay")); //slider
1780 OPT_MINMAX_STEP_FMT(1.0, 300.0, 10, "%2.0f seconds");
1781 co->funcs[0].none = co->funcs[1].none = _e_configure_screensaver_changed;
1782 OPT_ADD(BOOL, screensaver_suspend, _("Suspend when screensaver activates"), _("screensaver"));
1783 co->funcs[0].none = co->funcs[1].none = _e_configure_screensaver_changed;
1784 OPT_ADD(BOOL, screensaver_suspend_on_ac, _("Suspend when screensaver activates even if on AC"), _("screensaver"));
1785 co->funcs[0].none = co->funcs[1].none = _e_configure_screensaver_changed;
1786 OPT_ADD(DOUBLE, screensaver_suspend_delay, _("Screensaver suspend delay"), _("screensaver"), _("delay")); //slider
1787 OPT_MINMAX_STEP_FMT(1.0, 20.0, 1, "%1.0f seconds");
1788 co->funcs[0].none = co->funcs[1].none = _e_configure_screensaver_changed;
1789
1790/* appears to use screensaver values
1791 OPT_ADD(BOOL, dpms_enable, _("Enable DPMS"), _("dpms"));
1792 OPT_ADD(BOOL, dpms_standby_enable, _("dpms"));
1793 OPT_ADD(DOUBLE_INT, dpms_standby_timeout, _("dpms"), _("delay"));
1794 OPT_MINMAX_STEP_FMT(30, 5400);
1795 OPT_ADD(BOOL, dpms_suspend_enable, _("dpms"));
1796 OPT_ADD(DOUBLE_INT, dpms_suspend_timeout, _("dpms"), _("delay"));
1797 OPT_MINMAX_STEP_FMT(30, 5400);
1798 OPT_ADD(BOOL, dpms_off_enable, _("dpms"));
1799 OPT_ADD(DOUBLE_INT, dpms_off_timeout, _("dpms"), _("delay"));
1800 OPT_MINMAX_STEP_FMT(30, 5400);
1801*/
1802 OPT_ADD(ENUM, clientlist_group_by, _("Window list menu grouping policy"), _("menu"), _("border")); //enum
1803 co->info_cb = _e_configure_clientlist_group_by_info_cb;
1804 OPT_ICON("preferences-winlist");
1805 OPT_ADD(BOOL, clientlist_include_all_zones, _("Window list menu includes windows from all screens"), _("menu"), _("border"), _("screen"));
1806 OPT_ADD(ENUM, clientlist_separate_with, _("Window list menu separator policy"), _("menu"), _("border")); //enum
1807 co->info_cb = _e_configure_clientlist_separate_with_info_cb;
1808 OPT_ICON("preferences-winlist");
1809 OPT_ADD(ENUM, clientlist_sort_by, _("Window list menu sort policy"), _("menu"), _("border")); //enum
1810 co->info_cb = _e_configure_clientlist_sort_by_info_cb;
1811 OPT_ICON("preferences-winlist");
1812 OPT_ADD(ENUM, clientlist_separate_iconified_apps, _("Window list menu iconified window grouping policy"), _("menu"), _("border"), _("iconif")); //enum
1813 co->info_cb = _e_configure_clientlist_separate_iconified_apps_info_cb;
1814 OPT_ICON("preferences-winlist");
1815 OPT_ADD(BOOL, clientlist_warp_to_iconified_desktop, _("Window list menu warps to desktop of selected iconified window"), _("menu"), _("border"), _("warp"), _("vdesk"));
1816 OPT_ADD(BOOL, clientlist_limit_caption_len, _("Enable window list menu length limit"), _("menu"), _("border"), _("size"));
1817 OPT_ADD(DOUBLE_INT, clientlist_max_caption_len, _("Window list menu length limit (characters)"), _("menu"), _("border"), _("size")); //slider
1818 OPT_MINMAX_STEP_FMT(2, E_CLIENTLIST_MAX_CAPTION_LEN, 2, "%1.0f characters");
1819
1820 OPT_ADD(BOOL, use_e_cursor, _("Use Enlightenment theme cursor"), _("pointer"), _("theme"));
1821 co->funcs[0].none = co->funcs[1].none = _e_configure_pointer_changed;
1822 OPT_ADD(DOUBLE_INT, cursor_size, _("Mouse cursor size"), _("pointer"), _("size"), _("theme"));
1823 OPT_MINMAX_STEP_FMT(8, 128, 4, "%1.0f pixels");
1824 co->funcs[0].none = co->funcs[1].none = _e_configure_pointer_changed;
1825 OPT_ADD(BOOL, show_cursor, _("Show mouse cursor"), _("pointer"));
1826 co->funcs[0].none = co->funcs[1].none = _e_configure_pointer_changed;
1827 OPT_ADD(BOOL, idle_cursor, _("Enable idle effects for mouse cursor"), _("pointer"), _("animate"));
1828 co->funcs[0].none = co->funcs[1].none = _e_configure_pointer_changed;
1829 OPT_ADD(BOOL, mouse_hand, _("Enable left-handed mouse"), _("mouse"));
1830 co->funcs[0].none = co->funcs[1].none = _e_configure_pointer_changed;
1831 /* FIXME: need to group these two
1832 OPT_ADD(DOUBLE_INT, mouse_accel_numerator, _("mouse"), _("speed")); //slider
1833 OPT_MINMAX_STEP_FMT(1, 10);
1834 OPT_ADD(DOUBLE_INT, mouse_accel_denominator, _("mouse"), _("speed")); //also slider
1835 OPT_MINMAX_STEP_FMT(1, 10);
1836 */
1837 OPT_ADD(DOUBLE_INT, mouse_accel_threshold, _("Mouse acceleration threshold"), _("mouse"), _("speed"));
1838 OPT_MINMAX_STEP_FMT(1, 10, 1, "%1.0f");
1839 co->funcs[0].none = co->funcs[1].none = _e_configure_pointer_changed;
1840
1841 OPT_ADD(BOOL, desk_flip_wrap, _("Enable desk flip between last and first desks"), _("vdesk"), _("flip"), _("edge"));
1842 OPT_ADD(BOOL, fullscreen_flip, _("Enable desk flipping with fullscreen windows"), _("vdesk"), _("flip"), _("edge"), _("fullscreen"));
1843 OPT_ADD(BOOL, multiscreen_flip, _("Enable desk flipping with multiple monitors (DANGEROUS)"), _("vdesk"), _("flip"), _("edge"), _("screen"));
1844
1845 OPT_ADD(ENUM, desk_flip_animate_mode, _("Desk flip animation type"), _("vdesk"), _("animate"), _("flip")); //enum
1846 co->info_cb = _e_configure_desk_flip_animate_mode_info_cb;
1847 OPT_ICON("preferences-desktop");
1848 //OPT_ADD(INT, desk_flip_animate_interpolation, _("vdesk"), _("animate"), _("flip")); //NOT USED?
1849 OPT_ADD(DOUBLE, desk_flip_animate_time, _("Desk flip animation length"), _("vdesk"), _("animate"), _("flip"), _("speed"));
1850 OPT_MINMAX_STEP_FMT(0, 5, 0.05, "%1.2f seconds");
1851
1852 OPT_ADD(STR, theme_default_border_style, _("Default window border style"), _("border"), _("theme"));
1853 co->info_cb = _e_configure_border_style_info_cb;
1854 co->thumb_cb = _e_configure_border_style_thumb_cb;
1855 OPT_ICON("preferences-system-windows");
1856
1857 OPT_ADD(ENUM, screen_limits, _("Window screen limit policy"), _("screen"), _("size"), _("border"), _("placement")); //enum
1858 co->info_cb = _e_configure_screen_limits_info_cb;
1859 OPT_ICON("preferences-system-windows");
1860
1861 OPT_ADD(DOUBLE_INT, thumb_nice, _("Thumbnailing process priority"), _("priority"), _("image")); //enum
1862 OPT_MINMAX_STEP_FMT(0, 19, 1, "%1.0f");
1863 OPT_HELP("Enlightenment runs its own thumbnailing daemon in the background. This option configures the priority of that process");
1864
1865 OPT_ADD(BOOL, thumbscroll_enable, _("Enable click-to-drag scrolling (thumbscrolling)"), _("scroll"));
1866 OPT_ADD(DOUBLE_INT, thumbscroll_threshhold, _("Thumbscroll threshold"), _("scroll"), _("speed")); //slider
1867 OPT_MINMAX_STEP_FMT(0, 64, 4, "%1.0f pixels");
1868 OPT_ADD(DOUBLE, thumbscroll_momentum_threshhold, _("Thumbscroll momentum threshold"), _("scroll"), _("speed")); //slider
1869 OPT_MINMAX_STEP_FMT(0, 2000, 20, "%1.0f pixels/second");
1870 OPT_ADD(DOUBLE, thumbscroll_friction, _("Thumbscroll resistance"), _("scroll"), _("resist")); //slider
1871 OPT_MINMAX_STEP_FMT(0, 5.0, 0.1, "%1.0f");
1872
1873 OPT_ADD(BOOL, show_desktop_icons, _("Show files on desktop"), _("desktop"), _("files"));
1874 co->changed_action = eina_stringshare_add("fileman_reset");
1875 OPT_ADD(BOOL, filemanager_single_click, _("Filemanager uses single click to activate"), _("click"), _("files"));
1876 co->changed_action = eina_stringshare_add("fileman_reset");
1877 OPT_ADD(BOOL, device_desktop, _("Filemanager shows removable devices on desktop"), _("desktop"), _("files"));
1878 co->funcs[0].none = e_fm2_device_hide_desktop_icons;
1879 co->funcs[1].none = e_fm2_device_show_desktop_icons;
1880 OPT_ADD(BOOL, device_auto_mount, _("Filemanager automatically mounts removable devices when attached"), _("files"));
1881 OPT_ADD(BOOL, device_auto_open, _("Filemanager automatically opens removable devices when attached"), _("files"));
1882 OPT_ADD(BOOL, filemanager_copy, _("Filemanager always performs `cp+rm` instead of `mv`"), _("files"));
1883 OPT_ADD(BOOL, filemanager_secure_rm, _("Filemanager deletes files securely"), _("files"));
1884
1885 OPT_ADD(DOUBLE, border_keyboard.timeout, _("Window change timeout when moving or resizing using keyboard"), _("border"), _("placement"), _("delay"), _("key")); //slider
1886 OPT_MINMAX_STEP_FMT(1, 10, 1, "%1.0f seconds");
1887 OPT_ADD(DOUBLE_UCHAR, border_keyboard.move.dx, _("Window horizontal movement speed when using keyboard"), _("border"), _("placement"), _("move"), _("key")); //slider
1888 OPT_MINMAX_STEP_FMT(1, 255, 1, "%1.0f pixels");
1889 OPT_ADD(DOUBLE_UCHAR, border_keyboard.move.dy, _("Window vertical movement speed when using keyboard"), _("border"), _("placement"), _("move"), _("key")); //slider
1890 OPT_MINMAX_STEP_FMT(1, 255, 1, "%1.0f pixels");
1891 OPT_ADD(DOUBLE_UCHAR, border_keyboard.resize.dx, _("Window horizontal resize speed when using keyboard"), _("border"), _("placement"), _("resize"), _("key")); //slider
1892 OPT_MINMAX_STEP_FMT(1, 255, 1, "%1.0f pixels");
1893 OPT_ADD(DOUBLE_UCHAR, border_keyboard.resize.dy, _("Window vertical movement speed when using keyboard"), _("border"), _("placement"), _("resize"), _("key")); //slider
1894 OPT_MINMAX_STEP_FMT(1, 255, 1, "%1.0f pixels");
1895
1896 //OPT_ADD(DOUBLE, scale.min, _("Minimum scaling"), _("scale"), _("size"));
1897 //co->requires_restart = 1;
1898 //OPT_ADD(DOUBLE, scale.max, _("Maximum scaling"), _("scale"), _("size"));
1899 //co->requires_restart = 1;
1900 OPT_ADD(DOUBLE, scale.factor, _("Overall scaling factor"), _("scale"), _("size"));
1901 OPT_MINMAX_STEP_FMT(0.25, 8.0, 0.25, "%1.2f pixels");
1902 co->requires_restart = 1;
1903 OPT_ADD(BOOL, scale.use_dpi, _("Use screen DPI for scaling"), _("scale"), _("size"));
1904 co->requires_restart = 1;
1905 OPT_ADD(BOOL, scale.use_custom, _("Use custom DPI for scaling"), _("scale"), _("size"));
1906 co->requires_restart = 1;
1907 OPT_ADD(DOUBLE_INT, scale.base_dpi, _("Custom DPI to use when scaling"), _("scale"), _("size"));
1908 OPT_MINMAX_STEP_FMT(30, 800, 1, "%1.0f DPI");
1909 co->requires_restart = 1;
1910
1911 OPT_ADD(DOUBLE_INT, syscon.main.icon_size, _("System Console primary action icon size"), _("syscon"), _("size"), _("image"));
1912 OPT_MINMAX_STEP_FMT(16, 256, 4, "%1.0f pixels");
1913 OPT_ADD(DOUBLE_INT, syscon.secondary.icon_size, _("System Console secondary action icon size"), _("syscon"), _("size"), _("image"));
1914 OPT_MINMAX_STEP_FMT(16, 256, 4, "%1.0f pixels");
1915 OPT_ADD(DOUBLE_INT, syscon.extra.icon_size, _("System Console extra action icon size"), _("syscon"), _("size"), _("image"));
1916 OPT_MINMAX_STEP_FMT(16, 256, 4, "%1.0f pixels");
1917 OPT_ADD(DOUBLE, syscon.timeout, _("System Console idle timeout"), _("syscon"), _("delay")); //slider
1918 OPT_MINMAX_STEP_FMT(0, 60, 1, "%1.0f seconds");
1919 OPT_ADD(BOOL, syscon.do_input, _("System Console performs default action after idle timeout"), _("syscon"), _("input"));
1920 //Eina_List *actions
1921
1922 OPT_ADD(DOUBLE, backlight.normal, _("Backlight \"normal\" brightness"), _("backlight")); //slider
1923 OPT_MINMAX_STEP_FMT(0, 1.0, 0.01, "%1.2f");
1924 co->funcs[0].none = _e_configure_dpms_changed;
1925 OPT_ADD(DOUBLE, backlight.dim, _("Backlight \"dim\" brightness"), _("backlight")); //slider
1926 OPT_MINMAX_STEP_FMT(0, 1.0, 0.01, "%1.2f");
1927 co->funcs[0].none = _e_configure_dpms_changed;
1928 OPT_ADD(DOUBLE, backlight.transition, _("Backlight transition length"), _("backlight"), _("animate"), _("speed")); //slider
1929 OPT_MINMAX_STEP_FMT(0, 5.0, 0.1, "%1.1f seconds");
1930 co->funcs[0].none = _e_configure_dpms_changed;
1931 OPT_ADD(BOOL, backlight.idle_dim, _("Backlight dims after idle"), _("backlight"));
1932 co->funcs[0].none = co->funcs[1].none = _e_configure_dpms_changed;
1933 OPT_ADD(DOUBLE, backlight.timer, _("Backlight idle delay"), _("backlight"), _("delay")); //slider
1934 OPT_MINMAX_STEP_FMT(5, 300, 1, "%1.0f seconds");
1935 co->funcs[0].none = _e_configure_dpms_changed;
1936
1937 /* FIXME
1938 OPT_ADD(DOUBLE, powersave.none, _("powersave"));
1939 OPT_MINMAX_STEP_FMT(0.01, 5400.00);
1940 OPT_ADD(DOUBLE, powersave.low, _("powersave"));
1941 OPT_MINMAX_STEP_FMT(0.01, 5400.00);
1942 OPT_ADD(DOUBLE, powersave.medium, _("powersave"));
1943 OPT_MINMAX_STEP_FMT(0.01, 5400.00);
1944 OPT_ADD(DOUBLE, powersave.high, _("powersave"));
1945 OPT_MINMAX_STEP_FMT(0.01, 5400.00);
1946 OPT_ADD(DOUBLE, powersave.extreme, _("powersave"));
1947 OPT_MINMAX_STEP_FMT(0.01, 5400.00);
1948 OPT_ADD(DOUBLE_UINT, powersave.min, _("powersave"));
1949 OPT_MINMAX_STEP_FMT(E_POWERSAVE_MODE_NONE, E_POWERSAVE_MODE_EXTREME);
1950 OPT_ADD(DOUBLE_UINT, powersave.max, _("powersave"));
1951 OPT_MINMAX_STEP_FMT(E_POWERSAVE_MODE_NONE, E_POWERSAVE_MODE_EXTREME);
1952 */
1953 OPT_ADD(BOOL, deskenv.load_xrdb, _("Load ~/.xrdb on startup"), _("environment"));
1954 OPT_ADD(BOOL, deskenv.load_xmodmap, _("Load ~/.Xmodmap"), _("environment"));
1955 OPT_ADD(BOOL, deskenv.load_gnome, _("Run gnome-settings-daemon"), _("environment"));
1956 OPT_ADD(BOOL, deskenv.load_kde, _("Run kdeinit"), _("environment"));
1957
1958 OPT_ADD(BOOL, xsettings.enabled, _("Enable GTK application settings"), _("environment"), _("theme"), _("xsettings"));
1959 co->funcs[1].none = co->funcs[0].none = e_xsettings_config_update;
1960 OPT_ADD(BOOL, xsettings.match_e17_theme, _("Try setting GTK theme to match E17 theme"), _("environment"), _("theme"), _("xsettings"));
1961 co->funcs[1].none = co->funcs[0].none = e_xsettings_config_update;
1962 OPT_ADD(STR, xsettings.net_theme_name, _("GTK theme name"), _("environment"), _("theme"), _("name"), _("xsettings"));
1963 co->funcs[0].none = e_xsettings_config_update;
1964 co->info_cb = _e_configure_netwm_theme_info_cb;
1965 co->thumb_cb = _e_configure_netwm_theme_thumb_cb;
1966 OPT_ICON("preferences-desktop-theme");
1967
1968 OPT_ADD(BOOL, xsettings.match_e17_icon_theme, _("Enable use of icon theme for applications"), _("environment"), _("theme"), _("image"), _("xsettings"));
1969 co->funcs[0].none = e_xsettings_config_update;
1970 OPT_ADD(STR, icon_theme, _("Icon theme"), _("environment"), _("image"), _("theme"), _("xsettings")); //enum
1971 co->funcs[0].none = e_xsettings_config_update;
1972 co->info_cb = _e_configure_icon_theme_info_cb;
1973 co->thumb_cb = _e_configure_icon_theme_thumb_cb;
1974 co->event_type = E_EVENT_CONFIG_ICON_THEME;
1975 OPT_ICON("preferences-desktop-theme");
1976 OPT_ADD(BOOL, icon_theme_overrides, _("Icon theme overrides E17 internal theme icons"), _("environment"), _("image"), _("theme"), _("xsettings")); //
1977 co->funcs[1].none = co->funcs[0].none = e_xsettings_config_update;
1978
1979 OPT_ADD(BOOL, exe_always_single_instance, _("Always launch applications as single-instance"), _("exec"));
1980 //OPT_ADD(INT, use_desktop_window_profile,
1981
1982
1983 e_user_dir_concat_static(buf, "themes");
1984 theme_ls[0] = eio_file_ls(buf, _edj_filter_cb, _init_main_cb, _init_done_cb, _init_error_cb, NULL);
1985 theme_mon[0] = eio_monitor_add(buf);
1986 e_prefix_data_concat_static(buf, "data/themes");
1987 theme_ls[1] = eio_file_ls(buf, _edj_filter_cb, _init_main_cb, _init_done_cb, _init_error_cb, NULL);
1988 theme_mon[1] = eio_monitor_add(buf);
1989
1990 e_user_homedir_concat_static(buf, ".themes");
1991 gtk_theme_ls = eio_file_ls(buf, _gtk_filter_cb, _init_main_cb, _init_done_cb, _init_error_cb, NULL);
1992 gtk_theme_mon = eio_monitor_add(buf);
1993 {
1994 const char *dir;
1995 const Eina_List *l;
1996
1997 EINA_LIST_FOREACH(efreet_data_dirs_get(), l, dir)
1998 {
1999 Eio_File *ls;
2000
2001 snprintf(buf, sizeof(buf), "%s/themes", dir);
2002 ls = eio_file_ls(buf, _gtk_filter_cb, _init_main_cb, _init_done_cb, _init_error_cb, NULL);
2003 if (!ls) continue;
2004 gtk_theme_dirs = eina_list_append(gtk_theme_dirs, ls);
2005 gtk_theme_mons = eina_list_append(gtk_theme_mons, eio_monitor_add(buf));
2006 }
2007 }
2008
2009 e_user_dir_concat_static(buf, "backgrounds");
2010 bg_ls[0] = eio_file_ls(buf, _edj_filter_cb, _init_main_cb, _init_done_cb, _init_error_cb, NULL);
2011 bg_mon[0] = eio_monitor_add(buf);
2012 e_prefix_data_concat_static(buf, "data/backgrounds");
2013 bg_ls[1] = eio_file_ls(buf, _edj_filter_cb, _init_main_cb, _init_done_cb, _init_error_cb, NULL);
2014 bg_mon[1] = eio_monitor_add(buf);
2015
2016 E_LIST_HANDLER_APPEND(handlers, EIO_MONITOR_SELF_DELETED, _monitor_error, NULL);
2017 E_LIST_HANDLER_APPEND(handlers, EIO_MONITOR_FILE_CREATED, _monitor_theme_rescan, NULL);
2018 E_LIST_HANDLER_APPEND(handlers, EIO_MONITOR_FILE_DELETED, _monitor_theme_rescan, NULL);
2019 E_LIST_HANDLER_APPEND(handlers, EIO_MONITOR_ERROR, _monitor_error, NULL);
2020
2021 category_hash = eina_hash_string_superfast_new((Eina_Free_Cb)eina_list_free);
2022 category_icon_hash = eina_hash_string_superfast_new((Eina_Free_Cb)eina_stringshare_del);
2023
2024 e_configure_option_category_tag_add(_("appearance"), _("wallpaper"));
2025 e_configure_option_category_tag_add(_("appearance"), _("splash"));
2026 e_configure_option_category_tag_add(_("appearance"), _("font"));
2027 e_configure_option_category_tag_add(_("appearance"), _("border"));
2028 e_configure_option_category_tag_add(_("appearance"), _("transition"));
2029 e_configure_option_category_tag_add(_("appearance"), _("scale"));
2030 e_configure_option_category_tag_add(_("appearance"), _("xsettings"));
2031 e_configure_option_category_icon_set(_("appearance"), "preferences-look");
2032
2033 e_configure_option_category_tag_add(_("applications"), _("application"));
2034 e_configure_option_category_tag_add(_("applications"), _("files"));
2035 e_configure_option_category_tag_add(_("applications"), _("xsettings"));
2036 e_configure_option_category_icon_set(_("applications"), "preferences-applications");
2037
2038 e_configure_option_category_tag_add(_("screen"), _("desklock"));
2039 e_configure_option_category_tag_add(_("screen"), _("screen"));
2040 e_configure_option_category_tag_add(_("screen"), _("vdesk"));
2041 e_configure_option_category_tag_add(_("screen"), _("desktop"));
2042 e_configure_option_category_tag_add(_("screen"), _("shelf"));
2043 e_configure_option_category_icon_set(_("screen"), "preferences-desktop-display");
2044
2045 e_configure_option_category_tag_add(_("windows"), _("border"));
2046 e_configure_option_category_tag_add(_("windows"), _("focus"));
2047 e_configure_option_category_tag_add(_("windows"), _("winlist"));
2048 e_configure_option_category_tag_add(_("windows"), _("placement"));
2049 e_configure_option_category_tag_add(_("windows"), _("resist"));
2050 e_configure_option_category_tag_add(_("windows"), _("remember"));
2051 e_configure_option_category_tag_add(_("windows"), _("iconif"));
2052 e_configure_option_category_tag_add(_("windows"), _("kill"));
2053 e_configure_option_category_tag_add(_("windows"), _("transient"));
2054 e_configure_option_category_tag_add(_("windows"), _("move"));
2055 e_configure_option_category_tag_add(_("windows"), _("resize"));
2056 e_configure_option_category_icon_set(_("windows"), "preferences-system-windows");
2057
2058 e_configure_option_category_tag_add(_("menus"), _("menu"));
2059 e_configure_option_category_icon_set(_("menus"), "preferences-menus");
2060
2061 e_configure_option_category_tag_add(_("input"), _("mouse"));
2062 e_configure_option_category_tag_add(_("input"), _("pointer"));
2063 e_configure_option_category_tag_add(_("input"), _("key"));
2064 e_configure_option_category_tag_add(_("input"), _("binding"));
2065 e_configure_option_category_icon_set(_("input"), "preferences-behavior");
2066
2067 e_configure_option_category_tag_add(_("advanced"), _("framerate"));
2068 e_configure_option_category_tag_add(_("advanced"), _("cache"));
2069 e_configure_option_category_tag_add(_("advanced"), _("priority"));
2070 e_configure_option_category_icon_set(_("advanced"), "preferences-advanced");
2071
2072 e_configure_option_category_tag_add(_("settings"), _("dialog"));
2073 e_configure_option_category_tag_add(_("settings"), _("profile"));
2074 e_configure_option_category_tag_add(_("settings"), _("module"));
2075 e_configure_option_category_icon_set(_("settings"), "preferences-preferences");
2076
2077 event_block = EINA_FALSE;
2078
2079 return 1;
2080}
2081
2082EINTERN int
2083e_configure_option_shutdown(void)
2084{
2085 Eina_Stringshare *tag;
2086
2087 opts_changed_list = eina_list_free(opts_changed_list);
2088 event_block = EINA_TRUE;
2089 EINA_LIST_FREE(tags_list, tag)
2090 {
2091 eina_hash_del_by_key(tags_hash, tag);
2092 eina_stringshare_del(tag);
2093 }
2094 while (opts_list)
2095 _e_configure_option_free((E_Configure_Option*)opts_list);
2096 E_FN_DEL(eina_hash_free, tags_hash);
2097 E_FN_DEL(eio_monitor_del, theme_mon[0]);
2098 E_FN_DEL(eio_monitor_del, theme_mon[1]);
2099 E_FN_DEL(eio_file_cancel, theme_ls[0]);
2100 E_FN_DEL(eio_file_cancel, theme_ls[1]);
2101 E_FN_DEL(eio_file_cancel, gtk_theme_ls);
2102 E_FREE_LIST(gtk_theme_dirs, eio_file_cancel);
2103 E_FN_DEL(eio_monitor_del, gtk_theme_mon);
2104 E_FREE_LIST(gtk_theme_mons, eio_monitor_del);
2105 E_FREE_LIST(gtk_themes, eina_stringshare_del);
2106 E_FREE_LIST(themes, eina_stringshare_del);
2107 E_FREE_LIST(sthemes, eina_stringshare_del);
2108 E_FN_DEL(eio_monitor_del, bg_mon[0]);
2109 E_FN_DEL(eio_monitor_del, bg_mon[1]);
2110 E_FN_DEL(eio_file_cancel, bg_ls[0]);
2111 E_FN_DEL(eio_file_cancel, bg_ls[1]);
2112 E_FREE_LIST(bgs, eina_stringshare_del);
2113 E_FREE_LIST(sbgs, eina_stringshare_del);
2114 E_FREE_LIST(handlers, ecore_event_handler_del);
2115 E_FN_DEL(eina_hash_free, category_hash);
2116 E_FN_DEL(eina_hash_free, category_icon_hash);
2117 categories = eina_list_free(categories);
2118 return 1;
2119}
2120
2121EAPI E_Configure_Option *
2122e_configure_option_add(E_Configure_Option_Type type, const char *desc, const char *name, Eina_Bool private_scope, void *valptr, const void *data)
2123{
2124 E_Configure_Option *co;
2125
2126 co = E_NEW(E_Configure_Option, 1);
2127 if (!private_scope)
2128 opts_list = eina_inlist_append(opts_list, EINA_INLIST_GET(co));
2129 co->type = type;
2130 _e_configure_option_value_reset(co);
2131 co->name = eina_stringshare_add(name);
2132 co->desc = eina_stringshare_add(desc);
2133 co->valptr = valptr;
2134 co->data = (void*)data;
2135 co->private = !!private_scope;
2136 _e_configure_option_event_changed(co);
2137 return co;
2138}
2139
2140EAPI void
2141e_configure_option_tags_set(E_Configure_Option *co, const char **const tags, unsigned int num_tags)
2142{
2143 Eina_List *l, *ll;
2144 Eina_Stringshare *tag;
2145 unsigned int x;
2146 const char **t;
2147
2148 EINA_SAFETY_ON_NULL_RETURN(co);
2149 EINA_LIST_FOREACH_SAFE(co->tags, l, ll, tag)
2150 _e_configure_option_tag_remove(co, tag);
2151 if (!tags) return;
2152 if (num_tags)
2153 {
2154 for (x = 0; x < num_tags; x++)
2155 _e_configure_option_tag_append(co, tags[x]);
2156
2157 }
2158 else
2159 {
2160 for (t = tags; t && *t; t++)
2161 _e_configure_option_tag_append(co, *t);
2162 }
2163}
2164
2165EAPI E_Configure_Option_Info *
2166e_configure_option_info_new(E_Configure_Option *co, const char *name, const void *value)
2167{
2168 E_Configure_Option_Info *oi;
2169
2170 oi = E_NEW(E_Configure_Option_Info, 1);
2171 oi->co = co;
2172 oi->name = eina_stringshare_add(name);
2173 oi->value = (void*)value;
2174 return oi;
2175}
2176
2177EAPI void
2178e_configure_option_info_free(E_Configure_Option_Info *oi)
2179{
2180 if (!oi) return;
2181 eina_stringshare_del(oi->name);
2182 eina_stringshare_del(oi->thumb_file);
2183 eina_stringshare_del(oi->thumb_key);
2184 free(oi);
2185}
2186
2187EAPI Eina_List *
2188e_configure_option_info_get(E_Configure_Option *co)
2189{
2190 EINA_SAFETY_ON_NULL_RETURN_VAL(co, NULL);
2191 if (!co->info_cb) return NULL;
2192 return co->info_cb(co);
2193}
2194
2195EAPI Evas_Object *
2196e_configure_option_info_thumb_get(E_Configure_Option_Info *oi, Evas *evas)
2197{
2198 EINA_SAFETY_ON_NULL_RETURN_VAL(oi, NULL);
2199 EINA_SAFETY_ON_NULL_RETURN_VAL(evas, NULL);
2200 if (!oi->co->thumb_cb) return NULL;
2201 return oi->co->thumb_cb(oi, evas);
2202}
2203
2204EAPI void
2205e_configure_option_del(E_Configure_Option *co)
2206{
2207 Eina_List *l, *ll;
2208 Eina_Stringshare *tag;
2209
2210 if (!co) return;
2211 if (!event_block)
2212 {
2213 _e_configure_option_event_del(co);
2214 return;
2215 }
2216 EINA_LIST_FOREACH_SAFE(co->tags, l, ll, tag)
2217 _e_configure_option_tag_remove(co, tag);
2218 _e_configure_option_free(co);
2219}
2220
2221EAPI void *
2222e_configure_option_data_set(E_Configure_Option *co, const char *key, const void *data)
2223{
2224 EINA_SAFETY_ON_NULL_RETURN_VAL(co, NULL);
2225 EINA_SAFETY_ON_NULL_RETURN_VAL(key, NULL);
2226 if ((!co->data) && (!data)) return NULL;
2227 if (!co->data) co->data = eina_hash_string_small_new(NULL);
2228 return eina_hash_set(co->data, key, data);
2229}
2230
2231EAPI void *
2232e_configure_option_data_get(E_Configure_Option *co, const char *key)
2233{
2234 EINA_SAFETY_ON_NULL_RETURN_VAL(co, NULL);
2235 EINA_SAFETY_ON_NULL_RETURN_VAL(key, NULL);
2236 if (!co->data) return NULL;
2237 return eina_hash_find(co->data, key);
2238}
2239
2240EAPI void
2241e_configure_option_changed(E_Configure_Option *co)
2242{
2243 Eina_Bool e_restart;
2244 unsigned char u;
2245 int i;
2246 unsigned int ui;
2247 double d;
2248 long long int l;
2249 Eina_Stringshare *s;
2250 Eina_Bool changed;
2251
2252 EINA_SAFETY_ON_NULL_RETURN(co);
2253 changed = co->changed;
2254 co->changed = EINA_TRUE;
2255 if (!e_config->cfgdlg_auto_apply)
2256 {
2257 switch (co->type)
2258 {
2259 case E_CONFIGURE_OPTION_TYPE_BOOL:
2260 eina_value_get(&co->val, &u);
2261 if (*(unsigned char*)co->valptr != u) break;
2262 co->changed = EINA_FALSE;
2263 break;
2264 case E_CONFIGURE_OPTION_TYPE_DOUBLE_UCHAR:
2265 eina_value_get(&co->val, &d);
2266 l = lround(d);
2267 u = MAX(0, l);
2268 if (*(unsigned char*)co->valptr != u) break;
2269 co->changed = EINA_FALSE;
2270 break;
2271 case E_CONFIGURE_OPTION_TYPE_DOUBLE_INT: //lround(double)
2272 eina_value_get(&co->val, &d);
2273 if (*(int*)co->valptr != lround(d)) break;
2274 co->changed = EINA_FALSE;
2275 break;
2276 case E_CONFIGURE_OPTION_TYPE_INT:
2277 case E_CONFIGURE_OPTION_TYPE_ENUM:
2278 eina_value_get(&co->val, &i);
2279 if (*(int*)co->valptr != i) break;
2280 co->changed = EINA_FALSE;
2281 break;
2282 case E_CONFIGURE_OPTION_TYPE_DOUBLE_UINT: //lround(double)
2283 eina_value_get(&co->val, &d);
2284 l = lround(d);
2285 ui = MAX(0, l);
2286 if (*(unsigned int*)co->valptr != ui) break;
2287 co->changed = EINA_FALSE;
2288 break;
2289 case E_CONFIGURE_OPTION_TYPE_UINT:
2290 eina_value_get(&co->val, &ui);
2291 if (*(unsigned int*)co->valptr != ui) break;
2292 co->changed = EINA_FALSE;
2293 break;
2294 case E_CONFIGURE_OPTION_TYPE_DOUBLE:
2295 eina_value_get(&co->val, &d);
2296 if (fabs(*(double*)co->valptr - d) > DBL_EPSILON) break;
2297 co->changed = EINA_FALSE;
2298 break;
2299 case E_CONFIGURE_OPTION_TYPE_STR:
2300 eina_value_get(&co->val, &s);
2301 if (*(Eina_Stringshare**)co->valptr != s) break;
2302 co->changed = EINA_FALSE;
2303 break;
2304 case E_CONFIGURE_OPTION_TYPE_CUSTOM:
2305 break;
2306 }
2307 if (changed && (!co->changed))
2308 {
2309 _e_configure_option_value_reset(co);
2310 opts_changed_list = eina_list_remove(opts_changed_list, co);
2311 }
2312 else if ((!changed) && (co->changed))
2313 opts_changed_list = eina_list_append(opts_changed_list, co);
2314 }
2315 else
2316 {
2317 e_restart = _e_configure_option_apply(co, NULL, NULL, NULL);
2318 e_config_save_queue();
2319 if (e_restart) e_sys_action_do(E_SYS_RESTART, NULL);
2320 }
2321 _e_configure_option_event_changed(co);
2322}
2323
2324EAPI void
2325e_configure_option_reset(E_Configure_Option *co)
2326{
2327 EINA_SAFETY_ON_NULL_RETURN(co);
2328
2329 if (!co->changed) return;
2330 _e_configure_option_value_reset(co);
2331 opts_changed_list = eina_list_remove(opts_changed_list, co);
2332 co->changed = EINA_FALSE;
2333 _e_configure_option_event_changed(co);
2334}
2335
2336EAPI void
2337e_configure_option_reset_all(void)
2338{
2339 E_Configure_Option *co;
2340
2341 EINA_LIST_FREE(opts_changed_list, co)
2342 {
2343 _e_configure_option_value_reset(co);
2344 co->changed = EINA_FALSE;
2345 _e_configure_option_event_changed(co);
2346 }
2347}
2348
2349EAPI void
2350e_configure_option_apply(E_Configure_Option *co)
2351{
2352 Eina_Bool e_restart;
2353
2354 EINA_SAFETY_ON_NULL_RETURN(co);
2355
2356 if (!co->changed) return;
2357
2358 if (opts_changed_list)
2359 opts_changed_list = eina_list_remove(opts_changed_list, co);
2360 e_restart = _e_configure_option_apply(co, NULL, NULL, NULL);
2361 e_config_save_queue();
2362 if (e_restart) e_sys_action_do(E_SYS_RESTART, NULL);
2363}
2364
2365EAPI void
2366e_configure_option_apply_all(void)
2367{
2368 E_Configure_Option *co;
2369 Eina_Bool e_restart = EINA_FALSE;
2370 Eina_List *events = NULL, *funcs = NULL, *acts = NULL;
2371 E_Action *act;
2372 void (*none)(void);
2373 intptr_t *event;
2374
2375 EINA_LIST_FREE(opts_changed_list, co)
2376 e_restart |= _e_configure_option_apply(co, &events, &funcs, &acts);
2377 EINA_LIST_FREE(events, event)
2378 ecore_event_add((long)event, NULL, NULL, NULL);
2379 EINA_LIST_FREE(funcs, none)
2380 none();
2381 EINA_LIST_FREE(acts, act)
2382 act->func.go((E_Object*)e_util_container_current_get(), NULL);
2383 e_config_save_queue();
2384 if (e_restart) e_sys_action_do(E_SYS_RESTART, NULL);
2385}
2386
2387EAPI const void *
2388e_configure_option_value_get(E_Configure_Option *co)
2389{
2390 static unsigned char u;
2391 static double d;
2392 static long l;
2393 static unsigned int i;
2394 static Eina_Stringshare *s;
2395
2396 EINA_SAFETY_ON_NULL_RETURN_VAL(co, NULL);
2397 if (e_config->cfgdlg_auto_apply || (!co->changed)) return co->valptr;
2398 switch (co->type)
2399 {
2400 case E_CONFIGURE_OPTION_TYPE_BOOL:
2401 eina_value_get(&co->val, &u);
2402 return &u;
2403 case E_CONFIGURE_OPTION_TYPE_DOUBLE_UCHAR:
2404 case E_CONFIGURE_OPTION_TYPE_DOUBLE_INT: //lround(double)
2405 case E_CONFIGURE_OPTION_TYPE_DOUBLE_UINT: //lround(double)
2406 case E_CONFIGURE_OPTION_TYPE_ENUM: //lround(double)
2407 case E_CONFIGURE_OPTION_TYPE_DOUBLE:
2408 eina_value_get(&co->val, &d);
2409 return &d;
2410 case E_CONFIGURE_OPTION_TYPE_INT:
2411 eina_value_get(&co->val, &l);
2412 return &l;
2413 case E_CONFIGURE_OPTION_TYPE_UINT:
2414 eina_value_get(&co->val, &i);
2415 return &i;
2416 case E_CONFIGURE_OPTION_TYPE_STR:
2417 eina_value_get(&co->val, &s);
2418 return &s;
2419 case E_CONFIGURE_OPTION_TYPE_CUSTOM:
2420 break;
2421 }
2422 return NULL;
2423}
2424
2425EAPI const Eina_List *
2426e_configure_option_tags_list(void)
2427{
2428 return tags_list;
2429}
2430
2431EAPI const Eina_List *
2432e_configure_option_changed_list(void)
2433{
2434 return opts_changed_list;
2435}
2436
2437EAPI const Eina_List *
2438e_configure_option_tag_list_options(const char *tag)
2439{
2440 if (!tags_hash) return NULL;
2441 return eina_hash_find(tags_hash, tag);
2442}
2443
2444EAPI const Eina_List *
2445e_configure_option_category_list_tags(const char *cat)
2446{
2447 if (!categories) return NULL;
2448 return eina_hash_find(category_hash, cat);
2449}
2450
2451EAPI const Eina_List *
2452e_configure_option_category_list(void)
2453{
2454 return categories;
2455}
2456
2457EAPI void
2458e_configure_option_category_tag_add(const char *cat, const char *tag)
2459{
2460 Eina_List *l;
2461 Eina_Stringshare *t, *c;
2462
2463 EINA_SAFETY_ON_NULL_RETURN(cat);
2464 EINA_SAFETY_ON_NULL_RETURN(tag);
2465 t = eina_stringshare_add(tag);
2466 if (!eina_list_data_find(tags_list, t))
2467 {
2468 eina_stringshare_del(t);
2469 return;
2470 }
2471 if (!categories)
2472 {
2473 c = eina_stringshare_add(cat);
2474 eina_hash_add(category_hash, cat, eina_list_append(NULL, t));
2475 categories = eina_list_append(categories, c);
2476 _e_configure_option_event_category_add_del(c, EINA_FALSE);
2477 eina_stringshare_del(t);
2478 return;
2479 }
2480 l = eina_hash_find(category_hash, cat);
2481 if (l)
2482 {
2483 if (!eina_list_data_find(l, t))
2484 eina_hash_set(category_hash, cat, eina_list_append(l, t));
2485 }
2486 else
2487 {
2488 c = eina_stringshare_add(cat);
2489 categories = eina_list_append(categories, c);
2490 eina_hash_add(category_hash, cat, eina_list_append(NULL, t));
2491 _e_configure_option_event_category_add_del(c, EINA_FALSE);
2492 }
2493 eina_stringshare_del(t);
2494}
2495
2496EAPI void
2497e_configure_option_category_tag_del(const char *cat, const char *tag)
2498{
2499 Eina_List *l;
2500 Eina_Stringshare *t, *c;
2501
2502 if (!cat) return;
2503 if (!tag) return;
2504 if (!categories) return;
2505 if (!tags_list) return;
2506
2507 l = eina_hash_find(category_hash, cat);
2508 if (!l) return;
2509 t = eina_stringshare_add(tag);
2510 l = eina_list_remove(l, t);
2511 eina_hash_set(category_hash, cat, l);
2512 if (!l)
2513 {
2514 c = eina_stringshare_add(cat);
2515 categories = eina_list_remove(categories, c);
2516 _e_configure_option_event_category_add_del(c, EINA_TRUE);
2517 eina_stringshare_del(c);
2518 }
2519 eina_stringshare_del(t);
2520}
2521
2522EAPI Eina_Stringshare *
2523e_configure_option_category_icon_get(const char *cat)
2524{
2525 EINA_SAFETY_ON_NULL_RETURN_VAL(cat, NULL);
2526 return eina_hash_find(category_icon_hash, cat);
2527}
2528
2529EAPI void
2530e_configure_option_category_icon_set(const char *cat, const char *icon)
2531{
2532 EINA_SAFETY_ON_NULL_RETURN(cat);
2533 eina_stringshare_del(eina_hash_set(category_icon_hash, cat, eina_stringshare_add(icon)));
2534}
2535
2536EAPI E_Configure_Option_Ctx *
2537e_configure_option_ctx_new(void)
2538{
2539 return E_NEW(E_Configure_Option_Ctx, 1);
2540}
2541
2542EAPI Eina_Bool
2543e_configure_option_ctx_update(E_Configure_Option_Ctx *ctx, const char *str)
2544{
2545 Eina_List *l, *ll, *tlist, *clist = NULL;
2546 Eina_Stringshare *tag;
2547 char *s, *e;
2548
2549 if ((!str) || (!str[0]))
2550 {
2551 if ((!ctx->tags) && (ctx->opts)) return EINA_FALSE;
2552 ctx->tags = eina_list_free(ctx->tags);
2553 ctx->opts = eina_list_free(ctx->opts);
2554 return ctx->changed = EINA_TRUE;
2555 }
2556 tlist = eina_list_clone(tags_list);
2557 for (s = e = strdupa(str); e[0]; e++)
2558 {
2559 if (isalnum(e[0])) continue;
2560 e[0] = 0;
2561 if (e - s > 1)
2562 {
2563 EINA_LIST_FOREACH_SAFE(tlist, l, ll, tag)
2564 {
2565 if ((!strcasestr(s, tag)) && (!strcasestr(tag, s))) continue;
2566 if (eina_list_data_find(clist, tag)) continue;
2567 clist = eina_list_append(clist, tag);
2568 tlist = eina_list_remove(tlist, l);
2569 }
2570 }
2571 s = e + 1;
2572 }
2573 if (e - s > 1)
2574 {
2575 EINA_LIST_FOREACH_SAFE(tlist, l, ll, tag)
2576 {
2577 if ((!strcasestr(s, tag)) && (!strcasestr(tag, s))) continue;
2578 if (eina_list_data_find(clist, tag)) continue;
2579 clist = eina_list_append(clist, tag);
2580 tlist = eina_list_remove(tlist, l);
2581 }
2582 }
2583 eina_list_free(tlist);
2584 if (eina_list_count(clist) != eina_list_count(ctx->tags))
2585 goto update;
2586 for (l = ctx->tags, ll = clist; l && ll; l = eina_list_next(l), ll = eina_list_next(ll))
2587 if (l->data != ll->data) goto update;
2588
2589 eina_list_free(clist);
2590 return EINA_FALSE;
2591update:
2592 eina_list_free(ctx->tags);
2593 ctx->tags = clist;
2594 return ctx->changed = EINA_TRUE;
2595}
2596
2597EAPI Eina_Bool
2598e_configure_option_ctx_tag_add(E_Configure_Option_Ctx *ctx, Eina_Stringshare *tag)
2599{
2600 EINA_SAFETY_ON_NULL_RETURN_VAL(ctx, EINA_FALSE);
2601 EINA_SAFETY_ON_NULL_RETURN_VAL(tag, EINA_FALSE);
2602
2603 if (ctx->tags && eina_list_data_find(ctx->tags, tag)) return EINA_FALSE;
2604 ctx->tags = eina_list_append(ctx->tags, tag);
2605 return ctx->changed = EINA_TRUE;
2606}
2607
2608EAPI Eina_Bool
2609e_configure_option_ctx_tag_pop(E_Configure_Option_Ctx *ctx)
2610{
2611 EINA_SAFETY_ON_NULL_RETURN_VAL(ctx, EINA_FALSE);
2612 if (!ctx->tags) return EINA_FALSE;
2613 ctx->tags = eina_list_remove_list(ctx->tags, eina_list_last(ctx->tags));
2614 return ctx->changed = EINA_TRUE;
2615}
2616
2617EAPI const Eina_List *
2618e_configure_option_ctx_match_tag_list(E_Configure_Option_Ctx *ctx)
2619{
2620 const Eina_List *l;
2621 E_Configure_Option *co;
2622
2623 EINA_SAFETY_ON_NULL_RETURN_VAL(ctx, NULL);
2624
2625 ctx->match_tags = eina_list_free(ctx->match_tags);
2626 e_configure_option_ctx_option_list(ctx);
2627 if (eina_list_count(ctx->opts) < 2) return NULL;
2628 EINA_LIST_FOREACH(e_configure_option_ctx_option_list(ctx), l, co)
2629 {
2630 Eina_List *ll;
2631 Eina_Stringshare *tag;
2632
2633 EINA_LIST_FOREACH(co->tags, ll, tag)
2634 {
2635 if ((!ctx->match_tags) || (!eina_list_data_find(ctx->match_tags, tag)))
2636 ctx->match_tags = eina_list_append(ctx->match_tags, tag);
2637 }
2638 }
2639 return ctx->match_tags;
2640}
2641
2642EAPI const Eina_List *
2643e_configure_option_ctx_option_list(E_Configure_Option_Ctx *ctx)
2644{
2645 Eina_List *l;
2646 E_Configure_Option *co;
2647 Eina_Stringshare *tag;
2648
2649 EINA_SAFETY_ON_NULL_RETURN_VAL(ctx, NULL);
2650
2651 if ((!ctx->changed) && (ctx->opts)) return ctx->opts;
2652 ctx->opts = eina_list_free(ctx->opts);
2653 EINA_LIST_FOREACH(ctx->tags, l, tag)
2654 {
2655 Eina_List *ll, *lll, *opts = NULL;
2656
2657 ll = eina_hash_find(tags_hash, tag);
2658 if (!ll) continue;
2659 opts = eina_list_clone(ll);
2660 if (ctx->opts)
2661 {
2662 /* prune duplicates */
2663 EINA_LIST_FOREACH_SAFE(opts, ll, lll, co)
2664 {
2665 if (eina_list_data_find_list(ctx->opts, co))
2666 opts = eina_list_remove_list(opts, ll);
2667 }
2668 }
2669 if (eina_list_count(ctx->tags) > 1)
2670 /* reduce to matches */
2671 opts = _e_configure_option_ctx_list_prune(tag, opts, ctx->tags);
2672 if (opts)
2673 ctx->opts = eina_list_merge(ctx->opts, opts);
2674 }
2675 ctx->changed = EINA_FALSE;
2676 return ctx->opts;
2677}
2678
2679EAPI void
2680e_configure_option_ctx_free(E_Configure_Option_Ctx *ctx)
2681{
2682 if (!ctx) return;
2683 eina_list_free(ctx->tags);
2684 eina_list_free(ctx->opts);
2685 eina_list_free(ctx->match_tags);
2686 free(ctx);
2687}
diff --git a/src/bin/e_configure_option.h b/src/bin/e_configure_option.h
new file mode 100644
index 000000000..8e43fadba
--- /dev/null
+++ b/src/bin/e_configure_option.h
@@ -0,0 +1,172 @@
1#ifdef E_TYPEDEFS
2
3typedef struct E_Event_Configure_Option E_Event_Configure_Option_Changed;
4typedef struct E_Event_Configure_Option E_Event_Configure_Option_Add;
5typedef struct E_Event_Configure_Option E_Event_Configure_Option_Del;
6typedef struct E_Event_Configure_Category E_Event_Configure_Option_Category_Add;
7typedef struct E_Event_Configure_Category E_Event_Configure_Option_Category_Del;
8typedef struct E_Event_Configure_Tag E_Event_Configure_Option_Tag_Add;
9typedef struct E_Event_Configure_Tag E_Event_Configure_Option_Tag_Del;
10typedef struct E_Configure_Option_Info E_Configure_Option_Info;
11typedef struct E_Configure_Option E_Configure_Option;
12typedef struct E_Configure_Option_Ctx E_Configure_Option_Ctx;
13typedef void (*E_Configure_Option_Set_Cb)();
14typedef Eina_List *(*E_Configure_Option_Info_Cb)(E_Configure_Option *);
15typedef Evas_Object *(*E_Configure_Option_Info_Thumb_Cb)(E_Configure_Option_Info *, Evas *);
16
17#else
18# ifndef E_CONFIGURE_OPTION_H
19# define E_CONFIGURE_OPTION_H
20
21#define E_CONFIGURE_OPTION_TAG_LENGTH 128
22
23#define E_CONFIGURE_OPTION_ADD(OPT, TYPE, NAME, CFGPTR, DESC, ...) \
24 OPT = e_configure_option_add(E_CONFIGURE_OPTION_TYPE_##TYPE, DESC, #NAME, EINA_TRUE, &CFGPTR->NAME, NULL);\
25 e_configure_option_tags_set(OPT, (const char*[]){__VA_ARGS__, NULL}, 0)
26#define E_CONFIGURE_OPTION_HELP(OPT, STR) \
27 OPT->help = eina_stringshare_add(_(STR))
28#define E_CONFIGURE_OPTION_MINMAX_STEP_FMT(OPT, MIN, MAX, STEP, FMT) \
29 OPT->minmax[0] = (MIN), OPT->minmax[1] = (MAX), OPT->step = (STEP),\
30 OPT->info = eina_stringshare_add(_(FMT))
31#define E_CONFIGURE_OPTION_ICON(OPT, ICON) \
32 e_configure_option_data_set(OPT, "icon", eina_stringshare_add(ICON))
33#define E_CONFIGURE_OPTION_LIST_CLEAR(LIST) do {\
34 while (LIST) \
35 { \
36 E_Configure_Option *co; \
37\
38 co = (E_Configure_Option*)LIST; \
39 LIST = eina_inlist_remove(LIST, EINA_INLIST_GET(co)); \
40 e_configure_option_del(co); \
41 }\
42} while (0)
43
44
45EAPI extern int E_EVENT_CONFIGURE_OPTION_CHANGED;
46EAPI extern int E_EVENT_CONFIGURE_OPTION_ADD;
47EAPI extern int E_EVENT_CONFIGURE_OPTION_DEL;
48EAPI extern int E_EVENT_CONFIGURE_OPTION_CATEGORY_ADD;
49EAPI extern int E_EVENT_CONFIGURE_OPTION_CATEGORY_DEL;
50EAPI extern int E_EVENT_CONFIGURE_OPTION_TAG_ADD;
51EAPI extern int E_EVENT_CONFIGURE_OPTION_TAG_DEL;
52
53typedef enum
54{
55 E_CONFIGURE_OPTION_TYPE_BOOL,
56 E_CONFIGURE_OPTION_TYPE_INT,
57 E_CONFIGURE_OPTION_TYPE_UINT,
58 E_CONFIGURE_OPTION_TYPE_ENUM,
59 E_CONFIGURE_OPTION_TYPE_DOUBLE,
60 E_CONFIGURE_OPTION_TYPE_DOUBLE_UCHAR, //lround(double)
61 E_CONFIGURE_OPTION_TYPE_DOUBLE_INT, //lround(double)
62 E_CONFIGURE_OPTION_TYPE_DOUBLE_UINT, //lround(double)
63 E_CONFIGURE_OPTION_TYPE_STR,
64 E_CONFIGURE_OPTION_TYPE_CUSTOM,
65} E_Configure_Option_Type;
66
67struct E_Configure_Option
68{
69 EINA_INLIST;
70 Eina_Value val;
71 E_Configure_Option_Type type;
72 void *valptr;
73 Eina_Hash *data;
74
75 double minmax[2]; //for sliders
76 double step; //for sliders
77 Eina_Stringshare *info; //for sliders, custom
78 E_Configure_Option_Info_Cb info_cb; //for enums
79 E_Configure_Option_Info_Thumb_Cb thumb_cb; //for custom thumbs
80
81 Eina_Stringshare *name;
82 Eina_Stringshare *desc;
83 Eina_Stringshare *help;
84 Eina_List *tags; //Eina_Stringshare
85
86 int event_type; //event to emit if changed
87 Eina_Stringshare *changed_action; //action to call if changed
88 struct
89 {
90 void (*none)(void);
91 void (*one)();
92 void (*two)();
93 } funcs[2]; //disable, enable
94 Eina_Bool private : 1;
95 Eina_Bool requires_restart : 1;
96 Eina_Bool changed : 1;
97};
98
99struct E_Configure_Option_Info
100{
101 E_Configure_Option *co;
102 Eina_Stringshare *name;
103 void *value;
104 Eina_Stringshare *thumb_file;
105 Eina_Stringshare *thumb_key;
106 Eina_Bool current : 1;
107};
108
109struct E_Event_Configure_Option
110{
111 E_Configure_Option *co;
112};
113
114struct E_Event_Configure_Category
115{
116 Eina_Stringshare *category;
117};
118
119struct E_Event_Configure_Tag
120{
121 Eina_Stringshare *tag;
122};
123
124struct E_Configure_Option_Ctx
125{
126 Eina_List *tags; // Eina_Stringshare
127 Eina_List *match_tags; // Eina_Stringshare
128 Eina_List *opts; // E_Configure_Option
129 Eina_Stringshare *category;
130 Eina_Bool changed : 1;
131};
132
133EAPI const Eina_List *e_configure_option_tags_list(void);
134EAPI const Eina_List *e_configure_option_changed_list(void);
135EAPI void e_configure_option_apply_all(void);
136EAPI void e_configure_option_reset_all(void);
137
138EAPI E_Configure_Option *e_configure_option_add(E_Configure_Option_Type type, const char *desc, const char *name, Eina_Bool private_scope, void *valptr, const void *data);
139EAPI void e_configure_option_tags_set(E_Configure_Option *co, const char const **tags, unsigned int num_tags);
140EAPI void e_configure_option_del(E_Configure_Option *eci);
141EAPI const Eina_List *e_configure_option_tag_list_options(const char *tag);
142EAPI void e_configure_option_changed(E_Configure_Option *co);
143EAPI void e_configure_option_apply(E_Configure_Option *co);
144EAPI void e_configure_option_reset(E_Configure_Option *co);
145EAPI void *e_configure_option_data_set(E_Configure_Option *co, const char *key, const void *data);
146EAPI void *e_configure_option_data_get(E_Configure_Option *co, const char *key);
147EAPI const void *e_configure_option_value_get(E_Configure_Option *co);
148
149EAPI E_Configure_Option_Info *e_configure_option_info_new(E_Configure_Option *co, const char *name, const void *value);
150EAPI void e_configure_option_info_free(E_Configure_Option_Info *oi);
151EAPI Eina_List *e_configure_option_info_get(E_Configure_Option *co);
152EAPI Evas_Object *e_configure_option_info_thumb_get(E_Configure_Option_Info *oi, Evas *evas);
153
154EAPI const Eina_List *e_configure_option_category_list(void);
155EAPI const Eina_List *e_configure_option_category_list_tags(const char *cat);
156EAPI void e_configure_option_category_tag_add(const char *cat, const char *tag);
157EAPI void e_configure_option_category_tag_del(const char *cat, const char *tag);
158EAPI Eina_Stringshare *e_configure_option_category_icon_get(const char *cat);
159EAPI void e_configure_option_category_icon_set(const char *cat, const char *icon);
160
161EAPI E_Configure_Option_Ctx *e_configure_option_ctx_new(void);
162EAPI void e_configure_option_ctx_free(E_Configure_Option_Ctx *ctx);
163EAPI Eina_Bool e_configure_option_ctx_update(E_Configure_Option_Ctx *ctx, const char *str);
164EAPI const Eina_List *e_configure_option_ctx_option_list(E_Configure_Option_Ctx *ctx);
165EAPI const Eina_List *e_configure_option_ctx_match_tag_list(E_Configure_Option_Ctx *ctx);
166EAPI Eina_Bool e_configure_option_ctx_tag_add(E_Configure_Option_Ctx *ctx, Eina_Stringshare *tag);
167EAPI Eina_Bool e_configure_option_ctx_tag_pop(E_Configure_Option_Ctx *ctx);
168
169EINTERN int e_configure_option_init(void);
170EINTERN int e_configure_option_shutdown(void);
171# endif
172#endif
diff --git a/src/bin/e_includes.h b/src/bin/e_includes.h
index 1faabbf96..40a48a66e 100644
--- a/src/bin/e_includes.h
+++ b/src/bin/e_includes.h
@@ -57,6 +57,7 @@
57#include "e_pan.h" 57#include "e_pan.h"
58#include "e_dialog.h" 58#include "e_dialog.h"
59#include "e_configure.h" 59#include "e_configure.h"
60#include "e_configure_option.h"
60#include "e_about.h" 61#include "e_about.h"
61#include "e_theme_about.h" 62#include "e_theme_about.h"
62#include "e_widget.h" 63#include "e_widget.h"
diff --git a/src/bin/e_main.c b/src/bin/e_main.c
index ee8fd8ab0..0917e2d98 100644
--- a/src/bin/e_main.c
+++ b/src/bin/e_main.c
@@ -508,6 +508,11 @@ main(int argc, char **argv)
508 TS("E_Config Init Done"); 508 TS("E_Config Init Done");
509 _e_main_shutdown_push(e_config_shutdown); 509 _e_main_shutdown_push(e_config_shutdown);
510 510
511 TS("E_Configure Option Init");
512 e_configure_option_init();
513 TS("E_Configure Option Init Done");
514 _e_main_shutdown_push(e_configure_option_shutdown);
515
511 _xdg_data_dirs_augment(); 516 _xdg_data_dirs_augment();
512 517
513 _fix_user_default_edj(); 518 _fix_user_default_edj();
diff --git a/src/bin/e_module.c b/src/bin/e_module.c
index 936d12cce..e354bb43a 100644
--- a/src/bin/e_module.c
+++ b/src/bin/e_module.c
@@ -706,6 +706,8 @@ _e_module_whitelist_check(void)
706 "xkbswitch", 706 "xkbswitch",
707 "echievements", 707 "echievements",
708 "music-control", 708 "music-control",
709 "conf2",
710
709 NULL // end marker 711 NULL // end marker
710 }; 712 };
711 713
diff --git a/src/bin/e_remember.c b/src/bin/e_remember.c
index 321a634a9..61f89dea0 100644
--- a/src/bin/e_remember.c
+++ b/src/bin/e_remember.c
@@ -602,7 +602,8 @@ _e_remember_cb_hook_eval_post_new_border(void *data __UNUSED__, void *border)
602 602
603 if (!strncmp(bd->client.icccm.class, "e_fwin", 6)) 603 if (!strncmp(bd->client.icccm.class, "e_fwin", 6))
604 { 604 {
605 if (!(e_config->remember_internal_windows & E_REMEMBER_INTERNAL_FM_WINS)) 605 if (!(e_config->remember_internal_windows & E_REMEMBER_INTERNAL_FM_WINS) &&
606 (!e_config->remember_internal_fm_windows))
606 return; 607 return;
607 } 608 }
608 else 609 else
diff --git a/src/bin/e_win.c b/src/bin/e_win.c
index 17982fe99..549e5f412 100644
--- a/src/bin/e_win.c
+++ b/src/bin/e_win.c
@@ -229,6 +229,16 @@ e_win_shutdown(void)
229 return 1; 229 return 1;
230} 230}
231 231
232EAPI Eina_Bool
233e_win_elm_available(void)
234{
235#ifdef HAVE_ELEMENTARY
236 return EINA_TRUE;
237#else
238 return EINA_FALSE;
239#endif
240}
241
232EAPI E_Win * 242EAPI E_Win *
233e_win_new(E_Container *con) 243e_win_new(E_Container *con)
234{ 244{
diff --git a/src/bin/e_win.h b/src/bin/e_win.h
index e67fbba48..4845d5c1f 100644
--- a/src/bin/e_win.h
+++ b/src/bin/e_win.h
@@ -46,6 +46,7 @@ struct _E_Win
46 46
47EINTERN int e_win_init (void); 47EINTERN int e_win_init (void);
48EINTERN int e_win_shutdown (void); 48EINTERN int e_win_shutdown (void);
49EAPI Eina_Bool e_win_elm_available(void);
49EAPI E_Win *e_win_new (E_Container *con); 50EAPI E_Win *e_win_new (E_Container *con);
50EAPI void e_win_show (E_Win *win); 51EAPI void e_win_show (E_Win *win);
51EAPI void e_win_hide (E_Win *win); 52EAPI void e_win_hide (E_Win *win);
diff --git a/src/modules/Makefile.am b/src/modules/Makefile.am
index 63d3ba1ca..3f7209d85 100644
--- a/src/modules/Makefile.am
+++ b/src/modules/Makefile.am
@@ -90,6 +90,10 @@ if USE_MODULE_CONF
90include Makefile_conf.am 90include Makefile_conf.am
91endif 91endif
92 92
93if USE_MODULE_CONF2
94include Makefile_conf2.am
95endif
96
93if USE_MODULE_CONF_WALLPAPER2 97if USE_MODULE_CONF_WALLPAPER2
94include Makefile_conf_wallpaper2.am 98include Makefile_conf_wallpaper2.am
95endif 99endif
diff --git a/src/modules/Makefile_conf2.am b/src/modules/Makefile_conf2.am
new file mode 100644
index 000000000..db6b684a2
--- /dev/null
+++ b/src/modules/Makefile_conf2.am
@@ -0,0 +1,74 @@
1conf2dir = $(MDIR)/conf2
2conf2_DATA = conf2/e-module-conf2.edj \
3 conf2/module.desktop
4
5EXTRA_DIST += $(conf2_DATA) $(conf2dir)/e-module-conf2.edc
6EXTRA_DIST += \
7images/volume_knob_ledsoff.png \
8images/volume_knob_move.png \
9images/volume_knob.png \
10images/volume_led_01.png \
11images/volume_led_02.png \
12images/volume_led_03.png \
13images/volume_led_04.png \
14images/volume_led_05.png \
15images/volume_led_06.png \
16images/volume_led_07.png \
17images/volume_led_08.png \
18images/volume_led_09.png \
19images/volume_led_10.png \
20images/volume_led_11.png \
21images/volume_led_12.png \
22images/volume_led_13.png \
23images/volume_led_14.png \
24images/volume_led_15.png \
25images/volume_led_16.png \
26images/volume_led_17.png \
27images/volume_led_18.png \
28images/volume_led_19.png \
29images/volume_led_20.png \
30images/volume_led_21.png \
31images/volume_led_22.png \
32images/volume_led_23.png \
33images/volume_led_24.png \
34images/volume_led_25.png \
35images/volume_led_26.png \
36images/volume_led_27.png \
37images/volume_led_28.png \
38images/volume_led_29.png \
39images/volume_led_30.png \
40images/volume_led_31.png \
41images/volume_led_32.png \
42images/volume_led_33.png \
43images/volume_led_34.png \
44images/volume_led_35.png \
45images/volume_led_36.png \
46images/volume_led_37.png \
47images/volume_led_38.png \
48images/volume_led_39.png \
49images/volume_led_40.png \
50images/volume_led_41.png \
51images/volume_led_42.png \
52images/volume_led_43.png \
53images/volume_led_44.png \
54images/volume_led_45.png
55
56conf2pkgdir = $(MDIR)/conf2/$(MODULE_ARCH)
57conf2pkg_LTLIBRARIES = conf2/module.la
58
59conf2_module_la_SOURCES = conf2/e_mod_main.c \
60 conf2/e_mod_main.h \
61 conf2/e_conf2.c
62
63conf2_module_la_CFLAGS = $(AM_CFLAGS) @ELM_CFLAGS@
64conf2_module_la_LIBADD = @ELM_LIBS@
65
66CONF2_EDJE_FLAGS = $(EDJE_FLAGS) -id $(srcdir)/conf2/images -id $(top_srcdir)/data/themes/img
67
68conf2/%.edj: conf2/%.edc Makefile
69 $(EDJE_CC) $(CONF2_EDJE_FLAGS) $< $@
70
71.PHONY: conf2 install-conf2
72conf2: $(conf2pkg_LTLIBRARIES) $(conf2_DATA)
73install-conf2: install-conf2DATA install-conf2pkgLTLIBRARIES
74
diff --git a/src/modules/conf2/e-module-conf2.edc b/src/modules/conf2/e-module-conf2.edc
new file mode 100644
index 000000000..3c93fb746
--- /dev/null
+++ b/src/modules/conf2/e-module-conf2.edc
@@ -0,0 +1,2192 @@
1#define ASPECT_FILL(_ASPECT) \
2 aspect: _ASPECT _ASPECT; aspect_preference: NONE;
3#define TILED_PATTERN(_WIDTH, _HEIGHT) \
4 fill { size { relative: 0.0 0.0; offset: _WIDTH _HEIGHT; } }
5#define TILED_HORIZ(_WIDTH) \
6 fill { size { relative: 0.0 1.0; offset: _WIDTH 0; } }
7#define FIXED_SIZE(_WIDTH, _HEIGHT) \
8 min: _WIDTH _HEIGHT; max: _WIDTH _HEIGHT; fixed: 1 1;
9
10collections {
11 group {
12 name: "elm/conf2/option/overlay";
13 images.image: "vgrad_med_curved.png" COMP;
14 parts {
15 part { name: "base";
16 mouse_events: 0;
17 description { state: "default" 0.0;
18 image.normal: "vgrad_med_curved.png";
19 fill {
20 smooth: 0;
21 size {
22 relative: 0.0 1.0;
23 offset: 64 0;
24 }
25 }
26 }
27 description { state: "hide" 0.0;
28 inherit: "default";
29 visible: 0;
30 }
31 }
32 part {
33 name: "e.text.label";
34 type: TEXT;
35 mouse_events: 0;
36 scale: 1;
37 description { state: "default";
38 fixed: 0 1;
39 rel1.offset: 2 -30;
40 rel2.offset: -3 -15;
41 rel2.to_y: "e.swallow.content";
42 rel2.relative: 1 0;
43 color: 51 153 255 255;
44 color2: 51 153 255 24;
45 color3: 51 153 255 18;
46 text { font: "Sans"; size: 10;
47 min: 1 1;
48 ellipsis: 0.8;
49 align: 0.5 0.5;
50 text_class: "ilist_item";
51 }
52 }
53 }
54 part {
55 name: "e.swallow.content";
56 type: SWALLOW;
57 scale: 1;
58 description {
59 state: "default";
60 min: 170 170;
61 rel1.offset: 2 3;
62 rel2.offset: -3 -3;
63 }
64 }
65 part {
66 name: "e.text.value";
67 type: TEXT;
68 mouse_events: 0;
69 scale: 1;
70 description { state: "default";
71 fixed: 0 1;
72 rel1.relative: 0 1;
73 rel1.offset: 2 5;
74 rel2.offset: -3 25;
75 color: 51 153 255 255;
76 color2: 51 153 255 24;
77 color3: 51 153 255 18;
78 text { font: "Sans"; size: 10;
79 min: 1 1;
80 ellipsis: 0.8;
81 align: 0.5 0.5;
82 text_class: "ilist_item";
83 }
84 }
85 }
86 }
87 programs {
88 program {
89 signal: "e,state,bg_hide";
90 source: "e";
91 action: STATE_SET "hide" 0;
92 target: "base";
93 }
94 }
95 }
96
97 group {
98 name: "elm/conf2/tag/list";
99 parts {
100 part {
101 name: "e.swallow.options";
102 type: SWALLOW;
103 repeat_events: 1;
104 scale: 1;
105 clip_to: "clip";
106 description {
107 state: "default";
108 rel2.relative: 1 0;
109 minmul: 1 0;
110 }
111 description {
112 state: "show";
113 rel2.relative: 1 0.5;
114 }
115 }
116 part {
117 name: "e.swallow.tags";
118 type: SWALLOW;
119 repeat_events: 1;
120 scale: 1;
121 clip_to: "clip";
122 description {
123 state: "default";
124 rel1.to_y: "e.swallow.options";
125 rel1.relative: 0 1;
126 }
127 }
128 part {
129 name: "clip";
130 type: RECT;
131 scale: 1;
132 mouse_events: 0;
133 description {
134 state: "default";
135 rel1.to: "e.swallow.options";
136 rel2.to: "e.swallow.tags";
137 color: 255 255 255 255;
138 }
139 description {
140 state: "show";
141 color: 0 0 0 222;
142 }
143 }
144 part {
145 name: "clip_events";
146 type: RECT;
147 scale: 1;
148 mouse_events: 1;
149 description {
150 state: "default";
151 color: 0 0 0 0;
152 visible: 0;
153 }
154 description {
155 state: "show";
156 color: 0 0 0 0;
157 visible: 1;
158 }
159 }
160 part {
161 name: "e.swallow.discard";
162 type: SWALLOW;
163 scale: 1;
164 description {
165 state: "default";
166 fixed: 1 1;
167 max: 60 30;
168 rel1.to_y: "e.swallow.tags";
169 rel1.relative: 1 0;
170 rel1.offset: -180 30;
171 }
172 description {
173 state: "hidden";
174 inherit: "default";
175 rel1.to_x: "e.swallow.tags";
176 rel1.offset: 150 30;
177 }
178 }
179 part {
180 name: "e.swallow.apply";
181 type: SWALLOW;
182 scale: 1;
183 description {
184 state: "default";
185 fixed: 1 1;
186 max: 60 30;
187 rel1.to_y: "e.swallow.discard";
188 rel1.relative: 1 1;
189 rel1.offset: -180 20;
190 }
191 description {
192 state: "hidden";
193 inherit: "default";
194 rel1.to_x: "e.swallow.tags";
195 rel1.offset: 150 20;
196 }
197 }
198 part {
199 name: "e.swallow.overlay";
200 type: SWALLOW;
201 scale: 1;
202 description {
203 state: "default";
204 rel1.relative: 0.25 0.25;
205 rel2.relative: 0.75 0.75;
206 visible: 0;
207 }
208 description {
209 state: "show";
210 inherit: "default";
211 visible: 1;
212 }
213 }
214 }
215 programs {
216 program { name: "collapse";
217 signal: "e,action,collapse";
218 source: "e";
219 action: STATE_SET "default" 0.0;
220 target: "e.swallow.options";
221 transition: DECELERATE 0.3;
222 }
223 program { name: "expand";
224 signal: "e,action,expand";
225 source: "e";
226 action: STATE_SET "show" 0.0;
227 target: "e.swallow.options";
228 transition: DECELERATE 0.3;
229 }
230 program { name: "apply_show";
231 signal: "e,action,apply_show";
232 source: "e";
233 action: STATE_SET "default" 0.0;
234 target: "e.swallow.apply";
235 transition: DECELERATE 0.3;
236 }
237 program { name: "apply_hide";
238 signal: "e,action,apply_hide";
239 source: "e";
240 action: STATE_SET "hidden" 0.0;
241 target: "e.swallow.apply";
242 transition: DECELERATE 0.3;
243 }
244 program { name: "discard_show";
245 signal: "e,action,discard_show";
246 source: "e";
247 action: STATE_SET "default" 0.0;
248 target: "e.swallow.discard";
249 transition: DECELERATE 0.3;
250 }
251 program { name: "discard_hide";
252 signal: "e,action,discard_hide";
253 source: "e";
254 action: STATE_SET "hidden" 0.0;
255 target: "e.swallow.discard";
256 transition: DECELERATE 0.3;
257 }
258 program { name: "overlay_show";
259 signal: "e,action,overlay_show";
260 source: "e";
261 action: STATE_SET "show" 0.0;
262 target: "e.swallow.overlay";
263 target: "clip";
264 target: "clip_events";
265 transition: DECELERATE 0.3;
266 }
267 program { name: "overlay_hide";
268 signal: "e,action,overlay_hide";
269 source: "e";
270 action: STATE_SET "default" 0.0;
271 target: "e.swallow.overlay";
272 target: "clip";
273 target: "clip_events";
274 transition: DECELERATE 0.3;
275 }
276 program { name: "overlay_dismiss";
277 signal: "mouse,up,1";
278 source: "clip_events";
279 action: SIGNAL_EMIT "e,action,overlay_dismiss" "e";
280 }
281 }
282 }
283
284 group { name: "elm/label/base/conf2";
285 parts {
286 part { name: "elm.text"; type: TEXT;
287 effect: SHADOW BOTTOM;
288 scale: 1;
289 description { state: "default" 0.0;
290 rel1.offset: 2 2;
291 rel2.offset: -3 -3;
292 color: 255 255 255 255;
293 color3: 0 0 0 128;
294 color_class: "label_text";
295 text { font: "Sans"; size: 10;
296 min: 1 1;
297 align: 0.0 0.5;
298 text_class: "label";
299 }
300 }
301 description { state: "disabled" 0.0;
302 inherit: "default" 0.0;
303 color: 21 21 21 255;
304 color3: 255 255 255 25;
305 }
306 }
307 }
308 }
309
310 group { name: "elm/entry/base-single/conf2";
311 styles
312 {
313 style { name: "entry_textblock_style";
314 base: "font=Sans font_size=10 color=#ffffff wrap=none style=shadow,bottom shadow_color=#00000080 text_class=entry color_class=entry_text";
315 }
316 style { name: "entry_textblock_disabled_style";
317 base: "font=Sans font_size=10 color=#151515 wrap=none style=shadow,bottom shadow_color=#ffffff19 text_class=entry color_class=entry_text_disabled";
318 }
319 /* FIXME */
320 style { name: "entry_textblock_guide_style";
321 base: "font=Sans font_size=10 color=#00000080 wrap=none text_class=entry left_margin=2 right_margin=2 ellipsis=0.0";
322 tag: "em" "+ font_style=Oblique";
323 tag: "hilight" "+ font_weight=Bold";
324 }
325 }
326 parts {
327 part { name: "elm.guide";
328 type: TEXTBLOCK;
329 mouse_events: 0;
330 scale: 1;
331 description { state: "default" 0.0;
332 rel1.to: "elm.text";
333 rel2.to: "elm.text";
334 text {
335 style: "entry_textblock_guide_style";
336 min: 0 1;
337 align: 0.0 0.0;
338 }
339 }
340 description { state: "hidden" 0.0;
341 inherit: "default" 0.0;
342 visible: 0;
343 }
344 }
345 part { name: "elm.text";
346 type: TEXTBLOCK;
347 mouse_events: 1;
348 scale: 1;
349 entry_mode: EDITABLE;
350 select_mode: DEFAULT;
351 cursor_mode: BEFORE;
352 multiline: 0;
353 source: "elm/entry/selection/conf2"; // selection under
354 // source2: "X"; // selection over
355 // source3: "X"; // cursor under
356 source4: "elm/entry/cursor/conf2"; // cursorover
357 //source5: "elm/entry/anchor/conf2"; // anchor under
358 // source6: "X"; // anchor over
359 description { state: "default" 0.0;
360 /* we gotta use 0 0 here, because of scrolled entries */
361 fixed: 0 0;
362 text {
363 style: "entry_textblock_style";
364 min: 1 1;
365 max: 0 0;
366 align: 0.0 0.5;
367 }
368 }
369 description { state: "disabled" 0.0;
370 inherit: "default" 0.0;
371 text {
372 style: "entry_textblock_disabled_style";
373 min: 0 1;
374 }
375 }
376 }
377 }
378 programs {
379 program { name: "focus";
380 signal: "load";
381 source: "";
382 action: FOCUS_SET;
383 target: "elm.text";
384 }
385 program { name: "disable";
386 signal: "elm,state,disabled";
387 source: "elm";
388 action: STATE_SET "disabled" 0.0;
389 target: "elm.text";
390 }
391 program { name: "enable";
392 signal: "elm,state,enabled";
393 source: "elm";
394 action: STATE_SET "default" 0.0;
395 target: "elm.text";
396 }
397 program { name: "gdisable";
398 signal: "elm,guide,disabled";
399 source: "elm";
400 action: STATE_SET "hidden" 0.0;
401 target: "elm.guide";
402 }
403 program { name: "genable";
404 signal: "elm,guide,enabled";
405 source: "elm";
406 action: STATE_SET "default" 0.0;
407 target: "elm.guide";
408 }
409 }
410 }
411
412
413 group { name: "elm/entry/cursor/conf2";
414 min: 1 0;
415 images.image: "white_bar_vert_glow.png" COMP;
416 parts {
417 part { name: "cursor"; mouse_events: 0;
418 description { state: "default" 0.0;
419 rel1.offset: -4 -4;
420 rel2.offset: 3 3;
421 image.normal: "white_bar_vert_glow.png";
422 image.border: 4 4 4 4;
423 fill.smooth: 0;
424 color: 255 255 255 0;
425 min: 9 10;
426 }
427 description { state: "visible" 0.0;
428 inherit: "default" 0.0;
429 color: 255 255 255 255;
430 }
431 }
432 }
433 programs {
434 program {
435 signal: "elm,action,focus"; source: "elm";
436 action: ACTION_STOP;
437 target: "cursor_show";
438 target: "cursor_hide";
439 target: "cursor_show_timer";
440 target: "cursor_hide_timer";
441 after: "cursor_show";
442 }
443 program {
444 name: "on_cursor_hide";
445 signal: "elm,action,unfocus"; source: "elm";
446 action: ACTION_STOP;
447 target: "cursor_show";
448 target: "cursor_hide";
449 target: "cursor_show_timer";
450 target: "cursor_hide_timer";
451 after: "cursor_hide_stop";
452 }
453 program {
454 name: "cursor_hide_stop";
455 action: STATE_SET "default" 0.0;
456 target: "cursor";
457 }
458 program { name: "cursor_show";
459 action: STATE_SET "visible" 0.0;
460 target: "cursor";
461 after: "cursor_show_timer";
462 }
463 program { name: "cursor_hide";
464 action: STATE_SET "default" 0.0;
465 target: "cursor";
466 transition: SINUSOIDAL 0.2;
467 after: "cursor_hide_timer";
468 }
469 program { name: "cursor_show_timer";
470 in: 0.5 0.0;
471 after: "cursor_hide";
472 }
473 program { name: "cursor_hide_timer";
474 in: 0.2 0.0;
475 after: "cursor_show";
476 }
477 }
478 }
479
480
481
482 group { name: "elm/entry/selection/conf2";
483 parts {
484 part { name: "selection"; type: RECT; mouse_events: 0;
485 description { state: "default" 0.0;
486 color: 51 153 255 255;
487 }
488 }
489 }
490 }
491
492 group { name: "elm/button/base/conf2";
493 images.image: "button_normal.png" COMP;
494 images.image: "button_clicked.png" COMP;
495 parts {
496 part { name: "base";
497 description { state: "default" 0.0;
498 image.normal: "button_normal.png";
499 image.border: 4 4 3 5;
500 image.middle: SOLID;
501 rel1.offset: -1 0;
502 rel2.offset: 0 1;
503 fill.smooth: 0;
504 }
505 description { state: "clicked" 0.0;
506 inherit: "default" 0.0;
507 image.normal: "button_clicked.png";
508 image.border: 5 5 4 6;
509 }
510 }
511 part { name: "icon_clip"; type: RECT;
512 description { state: "default" 0.0;
513 }
514 description { state: "disabled" 0.0;
515 inherit: "default" 0.0;
516 color: 255 255 255 64;
517 }
518 }
519 part { name: "elm.swallow.content"; type: SWALLOW; mouse_events: 0;
520 clip_to: "icon_clip";
521 description { state: "default" 0.0;
522 min: 17 17;
523 align: 0.0 0.5;
524 fixed: 1 0;
525 rel1.offset: 6 5;
526 rel1.to: "base";
527 rel2.offset: 6 -8;
528 rel2.relative: 0 1;
529 rel2.to: "base";
530 }
531 description { state: "icon" 0.0;
532 inherit: "default" 0.0;
533 fixed: 0 0;
534 align: 0.5 0.5;
535 rel2.relative: 1.0 1.0;
536 rel2.offset: -7 -8;
537 }
538 }
539 part { name: "label_clip"; type: RECT;
540 description { state: "default" 0.0;
541 }
542 description { state: "disabled" 0.0;
543 inherit: "default" 0.0;
544 visible: 0;
545 }
546 }
547 part { name: "elm.text"; type: TEXT; mouse_events: 0;
548 effect: SHADOW BOTTOM;
549 scale: 1;
550 clip_to: "label_clip";
551 description { state: "default" 0.0;
552 rel1.offset: 2 5;
553 rel1.to_x: "elm.swallow.content";
554 rel1.relative: 1 0;
555 rel1.to_y: "base";
556 rel2.offset: -7 -9;
557 rel2.to: "base";
558 color: 255 255 255 255;
559 color3: 0 0 0 128;
560 color_class: "button_text";
561 text { font: "Sans"; size: 10;
562 min: 1 1;
563 align: 0.5 0.5;
564 text_class: "button";
565 }
566 }
567 description { state: "disabled" 0.0;
568 inherit: "default" 0.0;
569 color: 21 21 21 255;
570 color3: 255 255 255 25;
571 color_class: "button_text_disabled";
572 }
573 description { state: "icon" 0.0;
574 inherit: "default" 0.0;
575 visible: 0;
576 minmul: 0 1;
577 }
578 }
579 part { name: "label2"; type: TEXT; mouse_events: 0;