2 # include "elementary_config.h"
9 #include <Elementary.h>
13 Elm_Config *_elm_config = NULL;
14 char *_elm_profile = NULL;
15 static Eet_Data_Descriptor *_config_edd = NULL;
16 static Eet_Data_Descriptor *_config_font_overlay_edd = NULL;
18 static Ecore_Poller *_elm_cache_flush_poller = NULL;
20 const char *_elm_engines[] = {
29 "software_16_wince_gdi",
36 /* whenever you want to add a new text class support into Elementary,
37 declare it both here and in the (default) theme */
38 static const Elm_Text_Class _elm_text_classes[] = {
39 {"button", "Button Labels"},
40 {"label", "Text Labels"},
41 {"entry", "Text Entries"},
42 {"title_bar", "Title Bar"},
43 {"list_item", "List Items"},
44 {"grid_item", "Grid Items"},
45 {"toolbar_item", "Toolbar Items"},
46 {"menu_item", "Menu Items"},
50 static void _desc_init(void);
51 static void _desc_shutdown(void);
52 static void _profile_fetch_from_conf(void);
53 static void _config_free(void);
54 static void _config_apply(void);
55 static Elm_Config *_config_user_load(void);
56 static Elm_Config *_config_system_load(void);
57 static void _config_load(void);
58 static void _config_update(void);
59 static void _env_get(void);
60 static size_t _elm_data_dir_snprintf(char *dst,
64 static size_t _elm_user_dir_snprintf(char *dst,
69 #define ELM_CONFIG_VAL(edd, type, member, dtype) \
70 EET_DATA_DESCRIPTOR_ADD_BASIC(edd, type, #member, member, dtype)
71 #define ELM_CONFIG_LIST(edd, type, member, eddtype) \
72 EET_DATA_DESCRIPTOR_ADD_LIST(edd, type, #member, member, eddtype)
74 #ifdef HAVE_ELEMENTARY_X
75 static Ecore_Event_Handler *_prop_change_handler = NULL;
76 static Ecore_X_Window _root_1st = 0;
78 static Ecore_X_Atom _atom[ATOM_COUNT];
79 static Ecore_X_Atom _atom_config = 0;
80 static const char *_atom_names[ATOM_COUNT] =
82 "ENLIGHTENMENT_SCALE",
83 "ENLIGHTENMENT_FINGER_SIZE",
84 "ENLIGHTENMENT_THEME",
85 "ENLIGHTENMENT_PROFILE",
86 "ENLIGHTENMENT_FONT_OVERLAY",
87 "ENLIGHTENMENT_CACHE_FLUSH_INTERVAL",
88 "ENLIGHTENMENT_CACHE_FLUSH_ENABLE",
89 "ENLIGHTENMENT_FONT_CACHE",
90 "ENLIGHTENMENT_IMAGE_CACHE",
91 "ENLIGHTENMENT_EDJE_FILE_CACHE",
92 "ENLIGHTENMENT_EDJE_COLLECTION_CACHE",
93 "ENLIGHTENMENT_THUMBSCROLL_BOUNCE_ENABLE",
94 "ENLIGHTENMENT_THUMBSCROLL_BOUNCE_FRICTION",
95 "ENLIGHTENMENT_THUMBSCROLL_ENABLE",
96 "ENLIGHTENMENT_THUMBSCROLL_THRESHOLD",
97 "ENLIGHTENMENT_THUMBSCROLL_MOMENTUM_THRESHOLD",
98 "ENLIGHTENMENT_THUMBSCROLL_FRICTION",
99 "ENLIGHTENMENT_THUMBSCROLL_BORDER_FRICTION",
100 "ENLIGHTENMENT_THUMBSCROLL_PAGE_SCROLL_FRICTION",
101 "ENLIGHTENMENT_THUMBSCROLL_BRING_IN_SCROLL_FRICTION",
102 "ENLIGHTENMENT_THUMBSCROLL_ZOOM_FRICTION",
103 "ENLIGHTENMENT_CONFIG"
105 #define ATOM_E_SCALE 0
106 #define ATOM_E_FINGER_SIZE 1
107 #define ATOM_E_THEME 2
108 #define ATOM_E_PROFILE 3
109 #define ATOM_E_FONT_OVERLAY 4
110 #define ATOM_E_CACHE_FLUSH_INTERVAL 5
111 #define ATOM_E_CACHE_FLUSH_ENABLE 6
112 #define ATOM_E_FONT_CACHE 7
113 #define ATOM_E_IMAGE_CACHE 8
114 #define ATOM_E_EDJE_FILE_CACHE 9
115 #define ATOM_E_EDJE_COLLECTION_CACHE 10
116 #define ATOM_E_THUMBSCROLL_BOUNCE_ENABLE 11
117 #define ATOM_E_THUMBSCROLL_BOUNCE_FRICTION 12
118 #define ATOM_E_THUMBSCROLL_ENABLE 13
119 #define ATOM_E_THUMBSCROLL_THRESHOLD 14
120 #define ATOM_E_THUMBSCROLL_MOMENTUM_THRESHOLD 15
121 #define ATOM_E_THUMBSCROLL_FRICTION 16
122 #define ATOM_E_THUMBSCROLL_BORDER_FRICTION 17
123 #define ATOM_E_THUMBSCROLL_PAGE_SCROLL_FRICTION 18
124 #define ATOM_E_THUMBSCROLL_BRING_IN_SCROLL_FRICTION 19
125 #define ATOM_E_THUMBSCROLL_ZOOM_FRICTION 20
126 #define ATOM_E_CONFIG 21
128 static Eina_Bool _prop_config_get(void);
129 static Eina_Bool _prop_change(void *data __UNUSED__,
130 int ev_type __UNUSED__,
134 _prop_config_get(void)
139 unsigned char *data = NULL;
140 Elm_Config *config_data;
142 snprintf(buf, sizeof(buf), "ENLIGHTENMENT_CONFIG_%s", _elm_profile);
143 atom = ecore_x_atom_get(buf);
145 if (!ecore_x_window_prop_property_get(_root_1st,
146 atom, _atom[ATOM_E_CONFIG],
149 if (!ecore_x_window_prop_property_get(_root_1st,
150 _atom[ATOM_E_CONFIG],
151 _atom[ATOM_E_CONFIG],
155 _atom_config = _atom[ATOM_E_CONFIG];
164 config_data = eet_data_descriptor_decode(_config_edd, data, size);
166 if (!config_data) return EINA_FALSE;
168 /* What do we do on version mismatch when someone changes the
169 * config in the rootwindow? */
170 /* Most obvious case, new version and we are still linked to
171 * whatever was there before, we just ignore until user restarts us */
172 if (config_data->config_version > ELM_CONFIG_VERSION)
174 /* What in the case the version is older? Do we even support those
175 * cases or we only check for equality above? */
178 _elm_config = config_data;
180 _elm_config_font_overlay_apply();
187 _prop_change(void *data __UNUSED__,
188 int ev_type __UNUSED__,
191 Ecore_X_Event_Window_Property *event = ev;
193 if (event->win == _root_1st)
195 if (event->atom == _atom[ATOM_E_SCALE])
197 unsigned int val = 1000;
199 if (ecore_x_window_prop_card32_get(event->win,
205 pscale = _elm_config->scale;
206 if (val > 0) _elm_config->scale = (double)val / 1000.0;
207 if (pscale != _elm_config->scale)
214 else if (event->atom == _atom[ATOM_E_FINGER_SIZE])
216 unsigned int val = 1000;
218 if (ecore_x_window_prop_card32_get(event->win,
224 pfinger_size = _elm_config->finger_size;
225 _elm_config->finger_size = val;
226 if (pfinger_size != _elm_config->finger_size)
233 else if (event->atom == _atom[ATOM_E_THEME])
237 val = ecore_x_window_prop_string_get(event->win,
239 eina_stringshare_replace(&_elm_config->theme, val);
242 _elm_theme_parse(NULL, val);
248 else if (event->atom == _atom[ATOM_E_PROFILE])
252 val = ecore_x_window_prop_string_get(event->win,
260 if (strcmp(_elm_profile, val)) changed = 1;
266 if (!_prop_config_get())
271 _elm_config_font_overlay_apply();
277 else if (event->atom == _atom[ATOM_E_FONT_OVERLAY])
279 unsigned int val = 1000;
281 if (ecore_x_window_prop_card32_get(event->win,
288 _elm_config_font_overlay_apply();
292 else if (event->atom == _atom[ATOM_E_CACHE_FLUSH_INTERVAL])
294 unsigned int val = 1000;
296 if (ecore_x_window_prop_card32_get(event->win,
300 int cache_flush_interval;
302 cache_flush_interval = _elm_config->cache_flush_poll_interval;
303 _elm_config->cache_flush_poll_interval = val;
304 if (cache_flush_interval !=
305 _elm_config->cache_flush_poll_interval)
309 else if (event->atom == _atom[ATOM_E_CACHE_FLUSH_ENABLE])
311 unsigned int val = 1000;
313 if (ecore_x_window_prop_card32_get(event->win,
317 _elm_config->cache_flush_enable = !!val;
321 else if (event->atom == _atom[ATOM_E_FONT_CACHE])
323 unsigned int val = 1000;
325 if (ecore_x_window_prop_card32_get(event->win,
331 font_cache = _elm_config->font_cache;
332 _elm_config->font_cache = val;
333 if (font_cache != _elm_config->font_cache)
337 else if (event->atom == _atom[ATOM_E_IMAGE_CACHE])
339 unsigned int val = 1000;
341 if (ecore_x_window_prop_card32_get(event->win,
347 image_cache = _elm_config->image_cache;
348 _elm_config->image_cache = val;
349 if (image_cache != _elm_config->image_cache)
353 else if (event->atom == _atom[ATOM_E_EDJE_FILE_CACHE])
355 unsigned int val = 1000;
357 if (ecore_x_window_prop_card32_get(event->win,
363 edje_file_cache = _elm_config->edje_cache;
364 _elm_config->edje_cache = val;
365 if (edje_file_cache != _elm_config->edje_cache)
369 else if (event->atom == _atom[ATOM_E_EDJE_COLLECTION_CACHE])
371 unsigned int val = 1000;
373 if (ecore_x_window_prop_card32_get(event->win,
377 int edje_collection_cache;
379 edje_collection_cache = _elm_config->edje_collection_cache;
380 _elm_config->edje_collection_cache = val;
381 if (edje_collection_cache !=
382 _elm_config->edje_collection_cache)
386 else if (event->atom == _atom[ATOM_E_THUMBSCROLL_BOUNCE_ENABLE])
388 unsigned int val = 1000;
390 if (ecore_x_window_prop_card32_get(event->win,
394 _elm_config->thumbscroll_bounce_enable = !!val;
397 else if (event->atom == _atom[ATOM_E_THUMBSCROLL_BOUNCE_FRICTION])
399 unsigned int val = 1000;
401 if (ecore_x_window_prop_card32_get(event->win,
406 _elm_config->thumbscroll_bounce_friction =
407 (double)val / 1000.0;
410 else if (event->atom == _atom[ATOM_E_THUMBSCROLL_ENABLE])
412 unsigned int val = 1000;
414 if (ecore_x_window_prop_card32_get(event->win,
418 _elm_config->thumbscroll_enable = !!val;
421 else if (event->atom == _atom[ATOM_E_THUMBSCROLL_THRESHOLD])
423 unsigned int val = 1000;
425 if (ecore_x_window_prop_card32_get(event->win,
429 if (val > 0) _elm_config->thumbscroll_threshold = val;
432 else if (event->atom == _atom[ATOM_E_THUMBSCROLL_MOMENTUM_THRESHOLD])
434 unsigned int val = 1000;
436 if (ecore_x_window_prop_card32_get(event->win,
440 _elm_config->thumbscroll_momentum_threshold =
441 (double)val / 1000.0;
444 else if (event->atom == _atom[ATOM_E_THUMBSCROLL_FRICTION])
446 unsigned int val = 1000;
448 if (ecore_x_window_prop_card32_get(event->win,
452 _elm_config->thumbscroll_friction = (double)val / 1000.0;
455 else if (event->atom == _atom[ATOM_E_THUMBSCROLL_BORDER_FRICTION])
457 unsigned int val = 1000;
459 if (ecore_x_window_prop_card32_get(event->win,
463 _elm_config->thumbscroll_border_friction =
464 (double)val / 1000.0;
467 else if (event->atom == _atom[ATOM_E_THUMBSCROLL_PAGE_SCROLL_FRICTION])
469 unsigned int val = 1000;
471 if (ecore_x_window_prop_card32_get(event->win,
475 _elm_config->page_scroll_friction =
476 (double)val / 1000.0;
479 else if (event->atom ==
480 _atom[ATOM_E_THUMBSCROLL_BRING_IN_SCROLL_FRICTION])
482 unsigned int val = 1000;
484 if (ecore_x_window_prop_card32_get(event->win,
488 _elm_config->bring_in_scroll_friction =
489 (double)val / 1000.0;
492 else if (event->atom ==
493 _atom[ATOM_E_THUMBSCROLL_ZOOM_FRICTION])
495 unsigned int val = 1000;
497 if (ecore_x_window_prop_card32_get(event->win,
501 _elm_config->zoom_friction = (double)val / 1000.0;
504 else if (((_atom_config > 0) && (event->atom == _atom_config)) ||
505 (event->atom == _atom[ATOM_E_CONFIG]))
510 return ECORE_CALLBACK_PASS_ON;
518 Eet_Data_Descriptor_Class eddc;
520 EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Elm_Config);
521 eddc.func.str_direct_alloc = NULL;
522 eddc.func.str_direct_free = NULL;
524 _config_edd = eet_data_descriptor_file_new(&eddc);
527 printf("EEEK! eet_data_descriptor_file_new() failed\n");
531 memset(&eddc, 0, sizeof(eddc)); /* just in case... */
532 EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, Elm_Font_Overlay);
533 eddc.func.str_direct_alloc = NULL;
534 eddc.func.str_direct_free = NULL;
536 _config_font_overlay_edd = eet_data_descriptor_stream_new(&eddc);
537 if (!_config_font_overlay_edd)
539 printf("EEEK! eet_data_descriptor_stream_new() failed\n");
540 eet_data_descriptor_free(_config_edd);
543 #define T_INT EET_T_INT
544 #define T_DOUBLE EET_T_DOUBLE
545 #define T_STRING EET_T_STRING
546 #define T_UCHAR EET_T_UCHAR
548 #define T Elm_Font_Overlay
549 #define D _config_font_overlay_edd
550 ELM_CONFIG_VAL(D, T, text_class, EET_T_STRING);
551 ELM_CONFIG_VAL(D, T, font, EET_T_STRING);
552 ELM_CONFIG_VAL(D, T, size, EET_T_INT);
557 #define D _config_edd
558 ELM_CONFIG_VAL(D, T, config_version, T_INT);
559 ELM_CONFIG_VAL(D, T, engine, T_STRING);
560 ELM_CONFIG_VAL(D, T, vsync, T_UCHAR);
561 ELM_CONFIG_VAL(D, T, thumbscroll_enable, T_UCHAR);
562 ELM_CONFIG_VAL(D, T, thumbscroll_threshold, T_INT);
563 ELM_CONFIG_VAL(D, T, thumbscroll_momentum_threshold, T_DOUBLE);
564 ELM_CONFIG_VAL(D, T, thumbscroll_friction, T_DOUBLE);
565 ELM_CONFIG_VAL(D, T, thumbscroll_bounce_friction, T_DOUBLE);
566 ELM_CONFIG_VAL(D, T, thumbscroll_border_friction, T_DOUBLE);
567 ELM_CONFIG_VAL(D, T, page_scroll_friction, T_DOUBLE);
568 ELM_CONFIG_VAL(D, T, bring_in_scroll_friction, T_DOUBLE);
569 ELM_CONFIG_VAL(D, T, zoom_friction, T_DOUBLE);
570 ELM_CONFIG_VAL(D, T, thumbscroll_bounce_enable, T_UCHAR);
571 ELM_CONFIG_VAL(D, T, scroll_smooth_time_interval, T_DOUBLE);
572 ELM_CONFIG_VAL(D, T, scroll_smooth_amount, T_DOUBLE);
573 ELM_CONFIG_VAL(D, T, scroll_smooth_history_weight, T_DOUBLE);
574 ELM_CONFIG_VAL(D, T, scroll_smooth_future_time, T_DOUBLE);
575 ELM_CONFIG_VAL(D, T, scroll_smooth_time_window, T_DOUBLE);
576 ELM_CONFIG_VAL(D, T, scale, T_DOUBLE);
577 ELM_CONFIG_VAL(D, T, bgpixmap, T_INT);
578 ELM_CONFIG_VAL(D, T, compositing, T_INT);
579 /* EET_DATA_DESCRIPTOR_ADD_LIST(D, T, "font_dirs", font_dirs, sub_edd); */
580 ELM_CONFIG_LIST(D, T, font_overlays, _config_font_overlay_edd);
581 ELM_CONFIG_VAL(D, T, font_hinting, T_INT);
582 ELM_CONFIG_VAL(D, T, cache_flush_poll_interval, T_INT);
583 ELM_CONFIG_VAL(D, T, cache_flush_enable, T_UCHAR);
584 ELM_CONFIG_VAL(D, T, image_cache, T_INT);
585 ELM_CONFIG_VAL(D, T, font_cache, T_INT);
586 ELM_CONFIG_VAL(D, T, edje_cache, T_INT);
587 ELM_CONFIG_VAL(D, T, edje_collection_cache, T_INT);
588 ELM_CONFIG_VAL(D, T, finger_size, T_INT);
589 ELM_CONFIG_VAL(D, T, fps, T_DOUBLE);
590 ELM_CONFIG_VAL(D, T, theme, T_STRING);
591 ELM_CONFIG_VAL(D, T, modules, T_STRING);
592 ELM_CONFIG_VAL(D, T, tooltip_delay, T_DOUBLE);
593 ELM_CONFIG_VAL(D, T, cursor_engine_only, T_UCHAR);
594 ELM_CONFIG_VAL(D, T, focus_highlight_enable, T_UCHAR);
595 ELM_CONFIG_VAL(D, T, focus_highlight_animate, T_UCHAR);
596 ELM_CONFIG_VAL(D, T, toolbar_shrink_mode, T_INT);
597 ELM_CONFIG_VAL(D, T, fileselector_expand_enable, T_UCHAR);
598 ELM_CONFIG_VAL(D, T, inwin_dialogs_enable, T_UCHAR);
599 ELM_CONFIG_VAL(D, T, icon_size, T_INT);
600 ELM_CONFIG_VAL(D, T, longpress_timeout, T_DOUBLE);
601 ELM_CONFIG_VAL(D, T, effect_enable, T_UCHAR);
602 ELM_CONFIG_VAL(D, T, desktop_entry, T_UCHAR);
603 ELM_CONFIG_VAL(D, T, password_show_last, T_UCHAR);
604 ELM_CONFIG_VAL(D, T, password_show_last_timeout, T_DOUBLE);
618 eet_data_descriptor_free(_config_edd);
622 if (_config_font_overlay_edd)
624 eet_data_descriptor_free(_config_font_overlay_edd);
625 _config_font_overlay_edd = NULL;
630 _sort_files_cb(const void *f1,
633 return strcmp(f1, f2);
637 _elm_config_current_profile_get(void)
643 _elm_data_dir_snprintf(char *dst,
648 size_t data_dir_len, off;
651 data_dir_len = eina_strlcpy(dst, _elm_data_dir, size);
653 off = data_dir_len + 1;
658 dst[data_dir_len] = '/';
660 off = off + vsnprintf(dst + off, size - off, fmt, ap);
668 _elm_user_dir_snprintf(char *dst,
674 size_t user_dir_len, off;
678 home = evil_homedir_get();
680 home = getenv("HOME");
685 user_dir_len = eina_str_join_len(dst, size, '/', home, strlen(home),
686 ".elementary", sizeof(".elementary") - 1);
688 off = user_dir_len + 1;
693 dst[user_dir_len] = '/';
695 off = off + vsnprintf(dst + off, size - off, fmt, ap);
703 _elm_config_profile_dir_get(const char *prof,
711 _elm_user_dir_snprintf(buf, sizeof(buf), "config/%s", prof);
713 if (ecore_file_is_dir(buf))
719 snprintf(buf, sizeof(buf), "%s/config/%s", _elm_data_dir, prof);
721 if (ecore_file_is_dir(buf))
728 _elm_config_font_overlays_list(void)
730 return _elm_config->font_overlays;
734 _elm_config_font_overlay_set(const char *text_class,
738 Elm_Font_Overlay *efd;
741 EINA_LIST_FOREACH(_elm_config->font_overlays, l, efd)
743 if (strcmp(efd->text_class, text_class))
746 if (efd->font) eina_stringshare_del(efd->font);
747 efd->font = eina_stringshare_add(font);
749 _elm_config->font_overlays =
750 eina_list_promote_list(_elm_config->font_overlays, l);
754 /* the text class doesn't exist */
755 efd = calloc(1, sizeof(Elm_Font_Overlay));
756 efd->text_class = eina_stringshare_add(text_class);
757 efd->font = eina_stringshare_add(font);
760 _elm_config->font_overlays = eina_list_prepend(_elm_config->font_overlays,
765 _elm_config_font_overlay_remove(const char *text_class)
767 Elm_Font_Overlay *efd;
770 EINA_LIST_FOREACH(_elm_config->font_overlays, l, efd)
772 if (strcmp(efd->text_class, text_class))
775 _elm_config->font_overlays =
776 eina_list_remove_list(_elm_config->font_overlays, l);
777 if (efd->text_class) eina_stringshare_del(efd->text_class);
778 if (efd->font) eina_stringshare_del(efd->font);
786 _elm_config_font_overlay_apply(void)
788 Elm_Font_Overlay *efd;
792 for (i = 0; _elm_text_classes[i].desc; i++)
793 edje_text_class_del(_elm_text_classes[i].name);
795 EINA_LIST_FOREACH(_elm_config->font_overlays, l, efd)
796 edje_text_class_set(efd->text_class, efd->font, efd->size);
800 _elm_config_text_classes_get(void)
802 Eina_List *ret = NULL;
805 for (i = 0; _elm_text_classes[i].desc; i++)
808 tc = malloc(sizeof(*tc));
810 *tc = _elm_text_classes[i];
812 ret = eina_list_append(ret, tc);
819 _elm_config_text_classes_free(Eina_List *l)
823 EINA_LIST_FREE(l, tc)
828 _elm_config_profiles_list(void)
830 const Eina_File_Direct_Info *info;
831 Eina_List *flist = NULL;
832 Eina_Iterator *file_it;
837 len = _elm_user_dir_snprintf(buf, sizeof(buf), "config");
839 file_it = eina_file_direct_ls(buf);
846 len = sizeof(buf) - len;
848 EINA_ITERATOR_FOREACH(file_it, info)
850 if (info->name_length >= len)
853 if (info->type == EINA_FILE_DIR)
856 eina_list_sorted_insert(flist, _sort_files_cb,
857 eina_stringshare_add(info->path +
862 eina_iterator_free(file_it);
865 len = eina_str_join_len(buf, sizeof(buf), '/', _elm_data_dir,
866 strlen(_elm_data_dir), "config",
867 sizeof("config") - 1);
869 file_it = eina_file_direct_ls(buf);
876 len = sizeof(buf) - len;
877 EINA_ITERATOR_FOREACH(file_it, info)
879 if (info->name_length >= len)
889 EINA_LIST_FOREACH(flist, l, tmp)
890 if (!strcmp(info->path + info->name_start, tmp))
895 eina_list_sorted_insert(flist, _sort_files_cb,
896 eina_stringshare_add(info->path +
905 eina_iterator_free(file_it);
909 EINA_LIST_FREE(flist, dir)
910 eina_stringshare_del(dir);
916 _profile_fetch_from_conf(void)
918 char buf[PATH_MAX], *p, *s;
922 _elm_profile = strdup("default");
924 // if env var - use profile without question
925 s = getenv("ELM_PROFILE");
929 _elm_profile = strdup(s);
934 _elm_user_dir_snprintf(buf, sizeof(buf), "config/profile.cfg");
935 ef = eet_open(buf, EET_FILE_MODE_READ);
938 p = eet_read(ef, "config", &len);
942 _elm_profile = malloc(len + 1);
943 memcpy(_elm_profile, p, len);
944 _elm_profile[len] = 0;
953 _elm_data_dir_snprintf(buf, sizeof(buf), "config/profile.cfg");
954 ef = eet_open(buf, EET_FILE_MODE_READ);
957 p = eet_read(ef, "config", &len);
961 _elm_profile = malloc(len + 1);
962 memcpy(_elm_profile, p, len);
963 _elm_profile[len] = 0;
973 Elm_Font_Overlay *fo;
976 if (!_elm_config) return;
977 EINA_LIST_FREE(_elm_config->font_dirs, fontdir)
979 eina_stringshare_del(fontdir);
981 if (_elm_config->engine) eina_stringshare_del(_elm_config->engine);
982 EINA_LIST_FREE(_elm_config->font_overlays, fo)
984 if (fo->text_class) eina_stringshare_del(fo->text_class);
985 if (fo->font) eina_stringshare_del(fo->font);
988 if (_elm_config->theme) eina_stringshare_del(_elm_config->theme);
989 if (_elm_config->modules) eina_stringshare_del(_elm_config->modules);
997 _elm_theme_parse(NULL, _elm_config->theme);
998 ecore_animator_frametime_set(1.0 / _elm_config->fps);
1002 _config_sub_apply(void)
1004 edje_frametime_set(1.0 / _elm_config->fps);
1005 edje_scale_set(_elm_config->scale);
1006 edje_password_show_last_set(_elm_config->password_show_last);
1007 edje_password_show_last_timeout_set(_elm_config->password_show_last_timeout);
1008 if (_elm_config->modules) _elm_module_parse(_elm_config->modules);
1012 _elm_cache_flush_cb(void *data __UNUSED__)
1015 return ECORE_CALLBACK_RENEW;
1018 /* kind of abusing this call right now -- shared between all of those
1019 * properties -- but they are not meant to be called that periodically
1029 EINA_LIST_FOREACH(_elm_win_list, l, win)
1031 Evas *e = evas_object_evas_get(win);
1032 evas_image_cache_set(e, _elm_config->image_cache * 1024);
1033 evas_font_cache_set(e, _elm_config->font_cache * 1024);
1035 edje_file_cache_set(_elm_config->edje_cache);
1036 edje_collection_cache_set(_elm_config->edje_collection_cache);
1038 if (_elm_cache_flush_poller)
1040 ecore_poller_del(_elm_cache_flush_poller);
1041 _elm_cache_flush_poller = NULL;
1043 if (_elm_config->cache_flush_enable)
1045 if (_elm_config->cache_flush_poll_interval > 0)
1047 _elm_cache_flush_poller =
1048 ecore_poller_add(ECORE_POLLER_CORE,
1049 _elm_config->cache_flush_poll_interval,
1050 _elm_cache_flush_cb, NULL);
1056 _config_user_load(void)
1058 Elm_Config *cfg = NULL;
1062 _elm_user_dir_snprintf(buf, sizeof(buf), "config/%s/base.cfg",
1065 ef = eet_open(buf, EET_FILE_MODE_READ);
1068 cfg = eet_data_read(ef, _config_edd, "config");
1075 _config_system_load(void)
1077 Elm_Config *cfg = NULL;
1081 _elm_data_dir_snprintf(buf, sizeof(buf), "config/%s/base.cfg",
1084 ef = eet_open(buf, EET_FILE_MODE_READ);
1087 cfg = eet_data_read(ef, _config_edd, "config");
1096 _elm_config = _config_user_load();
1099 if (_elm_config->config_version < ELM_CONFIG_VERSION)
1104 /* no user config, fallback for system. No need to check version for
1105 * this one, if it's not the right one, someone screwed up at the time
1106 * of installing it */
1107 _elm_config = _config_system_load();
1108 if (_elm_config) return;
1109 /* FIXME: config load could have failed because of a non-existent
1110 * profile. Fallback to default before moving on */
1112 // config load fail - defaults
1113 /* XXX: do these make sense? Only if it's valid to install the lib
1114 * without the config, but do we want that? */
1115 _elm_config = ELM_NEW(Elm_Config);
1116 _elm_config->config_version = ELM_CONFIG_VERSION;
1117 _elm_config->engine = eina_stringshare_add("software_x11");
1118 _elm_config->vsync = 0;
1119 _elm_config->thumbscroll_enable = EINA_TRUE;
1120 _elm_config->thumbscroll_threshold = 24;
1121 _elm_config->thumbscroll_momentum_threshold = 100.0;
1122 _elm_config->thumbscroll_friction = 1.0;
1123 _elm_config->thumbscroll_bounce_friction = 0.5;
1124 _elm_config->thumbscroll_bounce_enable = EINA_TRUE;
1125 _elm_config->page_scroll_friction = 0.5;
1126 _elm_config->bring_in_scroll_friction = 0.5;
1127 _elm_config->zoom_friction = 0.5;
1128 _elm_config->thumbscroll_border_friction = 0.5;
1129 _elm_config->scroll_smooth_time_interval = 0.008;
1130 _elm_config->scroll_smooth_amount = 1.0;
1131 _elm_config->scroll_smooth_history_weight = 0.3;
1132 _elm_config->scroll_smooth_future_time = 0.0;
1133 _elm_config->scroll_smooth_time_window = 0.2;
1134 _elm_config->scale = 1.0;
1135 _elm_config->bgpixmap = 0;
1136 _elm_config->compositing = 1;
1137 _elm_config->font_hinting = 2;
1138 _elm_config->cache_flush_poll_interval = 512;
1139 _elm_config->cache_flush_enable = EINA_TRUE;
1140 _elm_config->font_dirs = NULL;
1141 _elm_config->image_cache = 4096;
1142 _elm_config->font_cache = 512;
1143 _elm_config->edje_cache = 32;
1144 _elm_config->edje_collection_cache = 64;
1145 _elm_config->finger_size = 40;
1146 _elm_config->fps = 60.0;
1147 _elm_config->theme = eina_stringshare_add("default");
1148 _elm_config->modules = NULL;
1149 _elm_config->tooltip_delay = 1.0;
1150 _elm_config->cursor_engine_only = EINA_TRUE;
1151 _elm_config->focus_highlight_enable = EINA_FALSE;
1152 _elm_config->focus_highlight_animate = EINA_TRUE;
1153 _elm_config->toolbar_shrink_mode = 2;
1154 _elm_config->fileselector_expand_enable = EINA_FALSE;
1155 _elm_config->inwin_dialogs_enable = EINA_FALSE;
1156 _elm_config->icon_size = 32;
1157 _elm_config->longpress_timeout = 1.0;
1158 _elm_config->effect_enable = EINA_TRUE;
1159 _elm_config->desktop_entry = EINA_FALSE;
1160 _elm_config->is_mirrored = EINA_FALSE; /* Read sys value in env_get() */
1161 _elm_config->password_show_last = EINA_FALSE;
1162 _elm_config->password_show_last_timeout = 2.0;
1166 _elm_config_eet_close_error_get(Eet_File *ef,
1170 const char *erstr = NULL;
1172 err = eet_close(ef);
1175 case EET_ERROR_WRITE_ERROR:
1176 erstr = "An error occurred while saving Elementary's "
1177 "settings to disk. The error could not be "
1178 "deterimined. The file where the error occurred was: "
1179 "%s. This file has been deleted to avoid corrupt data.";
1182 case EET_ERROR_WRITE_ERROR_FILE_TOO_BIG:
1183 erstr = "Elementary's settings files are too big "
1184 "for the file system they are being saved to. "
1185 "This error is very strange as the files should "
1186 "be extremely small. Please check the settings "
1187 "for your home directory. "
1188 "The file where the error occurred was: %s ."
1189 "This file has been deleted to avoid corrupt data.";
1192 case EET_ERROR_WRITE_ERROR_IO_ERROR:
1193 erstr = "An output error occurred when writing the settings "
1194 "files for Elementary. Your disk is having troubles "
1195 "and possibly needs replacement. "
1196 "The file where the error occurred was: %s ."
1197 "This file has been deleted to avoid corrupt data.";
1200 case EET_ERROR_WRITE_ERROR_OUT_OF_SPACE:
1201 erstr = "Elementary cannot write its settings file "
1202 "because it ran out of space to write the file. "
1203 "You have either run out of disk space or have "
1204 "gone over your quota limit. "
1205 "The file where the error occurred was: %s ."
1206 "This file has been deleted to avoid corrupt data.";
1209 case EET_ERROR_WRITE_ERROR_FILE_CLOSED:
1210 erstr = "Elementary unexpectedly had the settings file "
1211 "it was writing closed on it. This is very unusual. "
1212 "The file where the error occurred was: %s "
1213 "This file has been deleted to avoid corrupt data.";
1221 /* delete any partially-written file */
1222 ecore_file_unlink(file);
1223 return strdup(erstr);
1230 _elm_config_profile_save(void)
1232 char buf[4096], buf2[4096];
1238 len = _elm_user_dir_snprintf(buf, sizeof(buf), "config/profile.cfg");
1239 if (len + 1 >= sizeof(buf))
1242 len = _elm_user_dir_snprintf(buf2, sizeof(buf2), "config/profile.cfg.tmp");
1243 if (len + 1 >= sizeof(buf2))
1246 ef = eet_open(buf2, EET_FILE_MODE_WRITE);
1250 ok = eet_write(ef, "config", _elm_profile, strlen(_elm_profile), 0);
1254 err = _elm_config_eet_close_error_get(ef, buf2);
1262 ret = ecore_file_mv(buf2, buf);
1265 ERR("Error saving Elementary's configuration file");
1269 ecore_file_unlink(buf2);
1273 ecore_file_unlink(buf2);
1278 _elm_config_save(void)
1280 char buf[4096], buf2[4096];
1286 len = _elm_user_dir_snprintf(buf, sizeof(buf), "config/%s", _elm_profile);
1287 if (len + 1 >= sizeof(buf))
1290 ok = ecore_file_mkpath(buf);
1293 ERR("Problem acessing Elementary's user configuration directory: %s",
1298 if (!_elm_config_profile_save())
1304 if (len + sizeof("base.cfg") >= sizeof(buf) - len)
1307 memcpy(buf + len, "base.cfg", sizeof("base.cfg"));
1308 len += sizeof("base.cfg") - 1;
1310 if (len + sizeof(".tmp") >= sizeof(buf))
1313 memcpy(buf2, buf, len);
1314 memcpy(buf2 + len, ".tmp", sizeof(".tmp"));
1316 ef = eet_open(buf2, EET_FILE_MODE_WRITE);
1320 ok = eet_data_write(ef, _config_edd, "config", _elm_config, 1);
1324 err = _elm_config_eet_close_error_get(ef, buf2);
1332 ret = ecore_file_mv(buf2, buf);
1335 ERR("Error saving Elementary's configuration file");
1339 ecore_file_unlink(buf2);
1343 ecore_file_unlink(buf2);
1348 _config_update(void)
1352 tcfg = _config_system_load();
1355 /* weird profile or something? We should probably fill
1356 * with hardcoded defaults, or get from default previx */
1359 #define IFCFG(v) if ((_elm_config->config_version & 0xffff) < (v)) {
1360 #define IFCFGELSE } else {
1362 #define COPYVAL(x) do {_elm_config->x = tcfg->x; } while(0)
1363 #define COPYPTR(x) do {_elm_config->x = tcfg->x; tcfg->x = NULL; } while(0)
1364 #define COPYSTR(x) COPYPTR(x)
1366 /* we also need to update for property changes in the root window
1367 * if needed, but that will be dependent on new properties added
1368 * with each version */
1371 COPYVAL(longpress_timeout);
1381 /* after updating user config, we must save */
1390 s = getenv("ELM_ENGINE");
1393 if ((!strcasecmp(s, "x11")) ||
1394 (!strcasecmp(s, "x")) ||
1395 (!strcasecmp(s, "software-x11")) ||
1396 (!strcasecmp(s, "software_x11")))
1397 eina_stringshare_replace(&_elm_config->engine, ELM_SOFTWARE_X11);
1398 else if ((!strcasecmp(s, "opengl")) ||
1399 (!strcasecmp(s, "gl")) ||
1400 (!strcasecmp(s, "opengl-x11")) ||
1401 (!strcasecmp(s, "opengl_x11")))
1402 eina_stringshare_replace(&_elm_config->engine, ELM_OPENGL_X11);
1403 else if ((!strcasecmp(s, "x11-8")) ||
1404 (!strcasecmp(s, "x8")) ||
1405 (!strcasecmp(s, "software-8-x11")) ||
1406 (!strcasecmp(s, "software_8_x11")))
1407 eina_stringshare_replace(&_elm_config->engine, ELM_SOFTWARE_8_X11);
1408 else if ((!strcasecmp(s, "x11-16")) ||
1409 (!strcasecmp(s, "x16")) ||
1410 (!strcasecmp(s, "software-16-x11")) ||
1411 (!strcasecmp(s, "software_16_x11")))
1412 eina_stringshare_replace(&_elm_config->engine, ELM_SOFTWARE_16_X11);
1414 else if ((!strcasecmp(s, "xrender")) ||
1415 (!strcasecmp(s, "xr")) ||
1416 (!strcasecmp(s, "xrender-x11")) ||
1417 (!strcasecmp(s, "xrender_x11")))
1418 eina_stringshare_replace(&_elm_config->engine, ELM_XRENDER_X11);
1420 else if ((!strcasecmp(s, "fb")) ||
1421 (!strcasecmp(s, "software-fb")) ||
1422 (!strcasecmp(s, "software_fb")))
1423 eina_stringshare_replace(&_elm_config->engine, ELM_SOFTWARE_FB);
1424 else if ((!strcasecmp(s, "directfb")) ||
1425 (!strcasecmp(s, "dfb")))
1426 eina_stringshare_replace(&_elm_config->engine, ELM_SOFTWARE_DIRECTFB);
1427 else if ((!strcasecmp(s, "sdl")) ||
1428 (!strcasecmp(s, "software-sdl")) ||
1429 (!strcasecmp(s, "software_sdl")))
1430 eina_stringshare_replace(&_elm_config->engine, ELM_SOFTWARE_SDL);
1431 else if ((!strcasecmp(s, "sdl-16")) ||
1432 (!strcasecmp(s, "software-16-sdl")) ||
1433 (!strcasecmp(s, "software_16_sdl")))
1434 eina_stringshare_replace(&_elm_config->engine, ELM_SOFTWARE_16_SDL);
1435 else if ((!strcasecmp(s, "opengl-sdl")) ||
1436 (!strcasecmp(s, "opengl_sdl")) ||
1437 (!strcasecmp(s, "gl-sdl")) ||
1438 (!strcasecmp(s, "gl_sdl")))
1439 eina_stringshare_replace(&_elm_config->engine, ELM_OPENGL_SDL);
1440 else if ((!strcasecmp(s, "gdi")) ||
1441 (!strcasecmp(s, "software-gdi")) ||
1442 (!strcasecmp(s, "software_gdi")))
1443 eina_stringshare_replace(&_elm_config->engine, ELM_SOFTWARE_WIN32);
1444 else if ((!strcasecmp(s, "wince-gdi")) ||
1445 (!strcasecmp(s, "software-16-wince-gdi")) ||
1446 (!strcasecmp(s, "software_16_wince_gdi")))
1447 eina_stringshare_replace(&_elm_config->engine, ELM_SOFTWARE_16_WINCE);
1448 else if ((!strncmp(s, "shot:", 5)))
1449 eina_stringshare_replace(&_elm_config->engine, s);
1452 s = getenv("ELM_VSYNC");
1453 if (s) _elm_config->vsync = !!atoi(s);
1455 s = getenv("ELM_THUMBSCROLL_ENABLE");
1456 if (s) _elm_config->thumbscroll_enable = !!atoi(s);
1457 s = getenv("ELM_THUMBSCROLL_THRESHOLD");
1458 if (s) _elm_config->thumbscroll_threshold = atoi(s);
1459 // FIXME: floatformat locale issues here 1.0 vs 1,0 - should just be 1.0
1460 s = getenv("ELM_THUMBSCROLL_MOMENTUM_THRESHOLD");
1461 if (s) _elm_config->thumbscroll_momentum_threshold = atof(s);
1462 s = getenv("ELM_THUMBSCROLL_FRICTION");
1463 if (s) _elm_config->thumbscroll_friction = atof(s);
1464 s = getenv("ELM_THUMBSCROLL_BOUNCE_ENABLE");
1465 if (s) _elm_config->thumbscroll_bounce_enable = !!atoi(s);
1466 s = getenv("ELM_THUMBSCROLL_BOUNCE_FRICTION");
1467 if (s) _elm_config->thumbscroll_bounce_friction = atof(s);
1468 s = getenv("ELM_PAGE_SCROLL_FRICTION");
1469 if (s) _elm_config->page_scroll_friction = atof(s);
1470 s = getenv("ELM_BRING_IN_SCROLL_FRICTION");
1471 if (s) _elm_config->bring_in_scroll_friction = atof(s);
1472 s = getenv("ELM_ZOOM_FRICTION");
1473 if (s) _elm_config->zoom_friction = atof(s);
1474 s = getenv("ELM_THUMBSCROLL_BORDER_FRICTION");
1484 _elm_config->thumbscroll_border_friction = friction;
1486 s = getenv("ELM_SCROLL_SMOOTH_TIME_INTERVAL");
1487 if (s) _elm_config->scroll_smooth_time_interval = atof(s);
1488 s = getenv("ELM_SCROLL_SMOOTH_AMOUNT");
1489 if (s) _elm_config->scroll_smooth_amount = atof(s);
1490 s = getenv("ELM_SCROLL_SMOOTH_HISTORY_WEIGHT");
1491 if (s) _elm_config->scroll_smooth_history_weight = atof(s);
1492 s = getenv("ELM_SCROLL_SMOOTH_FUTURE_TIME");
1493 if (s) _elm_config->scroll_smooth_future_time = atof(s);
1494 s = getenv("ELM_SCROLL_SMOOTH_TIME_WINDOW");
1495 if (s) _elm_config->scroll_smooth_time_window = atof(s);
1496 s = getenv("ELM_THEME");
1497 if (s) eina_stringshare_replace(&_elm_config->theme, s);
1499 s = getenv("ELM_FONT_HINTING");
1502 if (!strcasecmp(s, "none")) _elm_config->font_hinting = 0;
1503 else if (!strcasecmp(s, "auto"))
1504 _elm_config->font_hinting = 1;
1505 else if (!strcasecmp(s, "bytecode"))
1506 _elm_config->font_hinting = 2;
1509 s = getenv("ELM_FONT_PATH");
1515 EINA_LIST_FREE(_elm_config->font_dirs, p)
1517 eina_stringshare_del(p);
1520 buf2 = alloca(strlen(s) + 1);
1525 if ((*p == ':') || (*p == 0))
1530 strncpy(buf2, pp, len);
1532 _elm_config->font_dirs =
1533 eina_list_append(_elm_config->font_dirs,
1534 eina_stringshare_add(buf2));
1547 s = getenv("ELM_IMAGE_CACHE");
1548 if (s) _elm_config->image_cache = atoi(s);
1550 s = getenv("ELM_FONT_CACHE");
1551 if (s) _elm_config->font_cache = atoi(s);
1553 s = getenv("ELM_SCALE");
1554 if (s) _elm_config->scale = atof(s);
1556 _elm_config->finger_size =
1557 (double)_elm_config->finger_size * _elm_config->scale;
1558 s = getenv("ELM_FINGER_SIZE");
1559 if (s) _elm_config->finger_size = atoi(s);
1561 s = getenv("ELM_PASSWORD_SHOW_LAST");
1562 if (s) _elm_config->password_show_last = !!atoi(s);
1564 s = getenv("ELM_PASSWORD_SHOW_LAST_TIMEOUT");
1567 double pw_show_last_timeout = atof(s);
1568 if (pw_show_last_timeout >= 0.0)
1569 _elm_config->password_show_last_timeout = pw_show_last_timeout;
1572 s = getenv("ELM_FPS");
1573 if (s) _elm_config->fps = atof(s);
1574 if (_elm_config->fps < 1.0) _elm_config->fps = 1.0;
1576 s = getenv("ELM_MODULES");
1577 if (s) eina_stringshare_replace(&_elm_config->modules, s);
1579 /* Get RTL orientation from system */
1580 setlocale(LC_ALL, "");
1581 bindtextdomain(PACKAGE, LOCALE_DIR);
1582 _elm_config->is_mirrored = !strcmp(E_("default:LTR"), "default:RTL");
1584 s = getenv("ELM_TOOLTIP_DELAY");
1587 double delay = atof(s);
1589 _elm_config->tooltip_delay = delay;
1592 s = getenv("ELM_CURSOR_ENGINE_ONLY");
1593 if (s) _elm_config->cursor_engine_only = !!atoi(s);
1595 s = getenv("ELM_FOCUS_HIGHLIGHT_ENABLE");
1596 if (s) _elm_config->focus_highlight_enable = !!atoi(s);
1598 s = getenv("ELM_FOCUS_HIGHLIGHT_ANIMATE");
1599 if (s) _elm_config->focus_highlight_animate = !!atoi(s);
1601 s = getenv("ELM_TOOLBAR_SHRINK_MODE");
1602 if (s) _elm_config->toolbar_shrink_mode = atoi(s);
1604 s = getenv("ELM_FILESELECTOR_EXPAND_ENABLE");
1605 if (s) _elm_config->fileselector_expand_enable = !!atoi(s);
1607 s = getenv("ELM_INWIN_DIALOGS_ENABLE");
1608 if (s) _elm_config->inwin_dialogs_enable = !!atoi(s);
1610 s = getenv("ELM_ICON_SIZE");
1611 if (s) _elm_config->icon_size = atoi(s);
1613 s = getenv("ELM_LONGPRESS_TIMEOUT");
1614 if (s) _elm_config->longpress_timeout = atof(s);
1615 if (_elm_config->longpress_timeout < 0.0)
1616 _elm_config->longpress_timeout = 0.0;
1618 s = getenv("ELM_EFFECT_ENABLE");
1619 if (s) _elm_config->effect_enable = !!atoi(s);
1621 s = getenv("ELM_DESKTOP_ENTRY");
1622 if (s) _elm_config->desktop_entry = !!atoi(s);
1626 * Get the system mirrored mode. This determines the default mirrored mode
1629 * @return EINA_TRUE if mirrored is set, EINA_FALSE otherwise
1632 elm_mirrored_get(void)
1634 return _elm_config->is_mirrored;
1638 * Set the system mirrored mode. This determines the default mirrored mode
1641 * @param mirrored EINA_TRUE to set mirrored mode, EINA_FALSE to unset it.
1644 elm_mirrored_set(Eina_Bool mirrored)
1646 _elm_config->is_mirrored = mirrored;
1651 _elm_config_init(void)
1654 _profile_fetch_from_conf();
1656 // NOTE: Do not merge upstream code. Just leave it.
1659 // _elm_config_font_overlay_apply();
1664 _elm_config_sub_init(void)
1666 // NOTE: Do not merge upstream code. Just leave it.
1669 _elm_config_font_overlay_apply();
1672 #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
1673 if (ENGINE_COMPARE(ELM_SOFTWARE_X11) ||
1674 ENGINE_COMPARE(ELM_SOFTWARE_16_X11) ||
1675 ENGINE_COMPARE(ELM_XRENDER_X11) ||
1676 ENGINE_COMPARE(ELM_OPENGL_X11))
1677 #undef ENGINE_COMPARE
1679 #ifdef HAVE_ELEMENTARY_X
1680 unsigned int val = 1000;
1682 if (!ecore_x_init(NULL))
1684 ERR("Cannot connect to X11 display. check $DISPLAY variable");
1687 _root_1st = ecore_x_window_root_first_get();
1689 if (!ecore_x_screen_is_composited(0))
1690 _elm_config->compositing = 0;
1692 ecore_x_atoms_get(_atom_names, ATOM_COUNT, _atom);
1693 ecore_x_event_mask_set(_root_1st,
1694 ECORE_X_EVENT_MASK_WINDOW_PROPERTY);
1695 _prop_change_handler = ecore_event_handler_add
1696 (ECORE_X_EVENT_WINDOW_PROPERTY, _prop_change, NULL);
1697 if (!getenv("ELM_SCALE"))
1699 if (ecore_x_window_prop_card32_get(_root_1st,
1700 _atom[ATOM_E_SCALE],
1705 _elm_config->scale = (double)val / 1000.0;
1706 // FIXME: hack until e export finger size too
1707 if (!getenv("ELM_FINGER_SIZE"))
1709 _elm_config->finger_size = 40.0 * _elm_config->scale;
1711 edje_scale_set(_elm_config->scale);
1715 if (!getenv("ELM_FINGER_SIZE"))
1717 if (ecore_x_window_prop_card32_get(_root_1st,
1718 _atom[ATOM_E_FINGER_SIZE],
1723 _elm_config->finger_size = val;
1727 if (!getenv("ELM_THEME"))
1731 s = ecore_x_window_prop_string_get(_root_1st,
1732 _atom[ATOM_E_THEME]);
1735 eina_stringshare_replace(&_elm_config->theme, s);
1736 _elm_theme_parse(NULL, s);
1740 if (!getenv("ELM_PROFILE"))
1744 s = ecore_x_window_prop_string_get(_root_1st,
1745 _atom[ATOM_E_PROFILE]);
1752 if (strcmp(_elm_profile, s)) changed = 1;
1756 if (changed) _prop_config_get();
1761 _config_sub_apply();
1765 _elm_config_reload(void)
1770 _elm_config_font_overlay_apply();
1776 _elm_config_engine_set(const char *engine)
1778 if (_elm_config->engine && strcmp(_elm_config->engine, engine))
1779 eina_stringshare_del(_elm_config->engine);
1781 _elm_config->engine = eina_stringshare_add(engine);
1785 _elm_config_profile_set(const char *profile)
1787 Eina_Bool changed = EINA_FALSE;
1791 if (strcmp(_elm_profile, profile))
1796 _elm_profile = strdup(profile);
1803 _elm_config_font_overlay_apply();
1810 _elm_config_shutdown(void)
1812 #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
1813 if (ENGINE_COMPARE(ELM_SOFTWARE_X11) ||
1814 ENGINE_COMPARE(ELM_SOFTWARE_16_X11) ||
1815 ENGINE_COMPARE(ELM_XRENDER_X11) ||
1816 ENGINE_COMPARE(ELM_OPENGL_X11))
1817 #undef ENGINE_COMPARE
1819 #ifdef HAVE_ELEMENTARY_X
1820 ecore_event_handler_del(_prop_change_handler);
1821 _prop_change_handler = NULL;
1828 _elm_profile = NULL;