2 # include "elementary_config.h"
9 #include <Elementary.h>
12 Elm_Config *_elm_config = NULL;
13 char *_elm_profile = NULL;
14 static Eet_Data_Descriptor *_config_edd = NULL;
15 static Eet_Data_Descriptor *_config_font_overlay_edd = NULL;
17 static Ecore_Poller *_elm_cache_flush_poller = NULL;
19 const char *_elm_engines[] = {
28 "software_16_wince_gdi",
35 /* whenever you want to add a new text class support into Elementary,
36 declare it both here and in the (default) theme */
37 static const Elm_Text_Class _elm_text_classes[] = {
38 {"button", "Button Labels"},
39 {"label", "Text Labels"},
40 {"entry", "Text Entries"},
41 {"title_bar", "Title Bar"},
42 {"list_item", "List Items"},
43 {"grid_item", "Grid Items"},
44 {"toolbar_item", "Toolbar Items"},
45 {"menu_item", "Menu Items"},
49 static void _desc_init(void);
50 static void _desc_shutdown(void);
51 static void _profile_fetch_from_conf(void);
52 static void _config_free(void);
53 static void _config_apply(void);
54 static Elm_Config *_config_user_load(void);
55 static Elm_Config *_config_system_load(void);
56 static void _config_load(void);
57 static void _config_update(void);
58 static void _env_get(void);
59 static size_t _elm_data_dir_snprintf(char *dst,
63 static size_t _elm_user_dir_snprintf(char *dst,
68 #define ELM_CONFIG_VAL(edd, type, member, dtype) \
69 EET_DATA_DESCRIPTOR_ADD_BASIC(edd, type, #member, member, dtype)
70 #define ELM_CONFIG_LIST(edd, type, member, eddtype) \
71 EET_DATA_DESCRIPTOR_ADD_LIST(edd, type, #member, member, eddtype)
73 #ifdef HAVE_ELEMENTARY_X
74 static Ecore_Event_Handler *_prop_change_handler = NULL;
75 static Ecore_X_Window _root_1st = 0;
77 static Ecore_X_Atom _atom[ATOM_COUNT];
78 static Ecore_X_Atom _atom_config = 0;
79 static const char *_atom_names[ATOM_COUNT] =
81 "ENLIGHTENMENT_SCALE",
82 "ENLIGHTENMENT_FINGER_SIZE",
83 "ENLIGHTENMENT_THEME",
84 "ENLIGHTENMENT_PROFILE",
85 "ENLIGHTENMENT_FONT_OVERLAY",
86 "ENLIGHTENMENT_CACHE_FLUSH_INTERVAL",
87 "ENLIGHTENMENT_CACHE_FLUSH_ENABLE",
88 "ENLIGHTENMENT_FONT_CACHE",
89 "ENLIGHTENMENT_IMAGE_CACHE",
90 "ENLIGHTENMENT_EDJE_FILE_CACHE",
91 "ENLIGHTENMENT_EDJE_COLLECTION_CACHE",
92 "ENLIGHTENMENT_THUMBSCROLL_BOUNCE_ENABLE",
93 "ENLIGHTENMENT_THUMBSCROLL_BOUNCE_FRICTION",
94 "ENLIGHTENMENT_THUMBSCROLL_ENABLE",
95 "ENLIGHTENMENT_THUMBSCROLL_THRESHOLD",
96 "ENLIGHTENMENT_THUMBSCROLL_MOMENTUM_THRESHOLD",
97 "ENLIGHTENMENT_THUMBSCROLL_FRICTION",
98 "ENLIGHTENMENT_THUMBSCROLL_BORDER_FRICTION",
99 "ENLIGHTENMENT_THUMBSCROLL_PAGE_SCROLL_FRICTION",
100 "ENLIGHTENMENT_THUMBSCROLL_BRING_IN_SCROLL_FRICTION",
101 "ENLIGHTENMENT_THUMBSCROLL_ZOOM_FRICTION",
102 "ENLIGHTENMENT_INPUT_PANEL",
103 "ENLIGHTENMENT_AUTOCAPITAL_ALLOW",
104 "ENLIGHTENMENT_AUTOPERIOD_ALLOW",
105 "ENLIGHTENMENT_CONFIG"
107 #define ATOM_E_SCALE 0
108 #define ATOM_E_FINGER_SIZE 1
109 #define ATOM_E_THEME 2
110 #define ATOM_E_PROFILE 3
111 #define ATOM_E_FONT_OVERLAY 4
112 #define ATOM_E_CACHE_FLUSH_INTERVAL 5
113 #define ATOM_E_CACHE_FLUSH_ENABLE 6
114 #define ATOM_E_FONT_CACHE 7
115 #define ATOM_E_IMAGE_CACHE 8
116 #define ATOM_E_EDJE_FILE_CACHE 9
117 #define ATOM_E_EDJE_COLLECTION_CACHE 10
118 #define ATOM_E_THUMBSCROLL_BOUNCE_ENABLE 11
119 #define ATOM_E_THUMBSCROLL_BOUNCE_FRICTION 12
120 #define ATOM_E_THUMBSCROLL_ENABLE 13
121 #define ATOM_E_THUMBSCROLL_THRESHOLD 14
122 #define ATOM_E_THUMBSCROLL_MOMENTUM_THRESHOLD 15
123 #define ATOM_E_THUMBSCROLL_FRICTION 16
124 #define ATOM_E_THUMBSCROLL_BORDER_FRICTION 17
125 #define ATOM_E_THUMBSCROLL_PAGE_SCROLL_FRICTION 18
126 #define ATOM_E_THUMBSCROLL_BRING_IN_SCROLL_FRICTION 19
127 #define ATOM_E_THUMBSCROLL_ZOOM_FRICTION 20
128 #define ATOM_E_INPUT_PANEL 21
129 #define ATOM_E_AUTOCAPITAL_ALLOW 22
130 #define ATOM_E_AUTOPERIOD_ALLOW 23
131 #define ATOM_E_CONFIG 24
133 static Eina_Bool _prop_config_get(void);
134 static Eina_Bool _prop_change(void *data __UNUSED__,
135 int ev_type __UNUSED__,
139 _prop_config_get(void)
144 unsigned char *data = NULL;
145 Elm_Config *config_data;
147 snprintf(buf, sizeof(buf), "ENLIGHTENMENT_CONFIG_%s", _elm_profile);
148 atom = ecore_x_atom_get(buf);
150 if (!ecore_x_window_prop_property_get(_root_1st,
151 atom, _atom[ATOM_E_CONFIG],
154 if (!ecore_x_window_prop_property_get(_root_1st,
155 _atom[ATOM_E_CONFIG],
156 _atom[ATOM_E_CONFIG],
160 _atom_config = _atom[ATOM_E_CONFIG];
169 config_data = eet_data_descriptor_decode(_config_edd, data, size);
171 if (!config_data) return EINA_FALSE;
173 /* What do we do on version mismatch when someone changes the
174 * config in the rootwindow? */
175 /* Most obvious case, new version and we are still linked to
176 * whatever was there before, we just ignore until user restarts us */
177 if (config_data->config_version > ELM_CONFIG_VERSION)
179 /* What in the case the version is older? Do we even support those
180 * cases or we only check for equality above? */
183 _elm_config = config_data;
185 _elm_config_font_overlay_apply();
192 _prop_change(void *data __UNUSED__,
193 int ev_type __UNUSED__,
196 Ecore_X_Event_Window_Property *event = ev;
198 if (event->win == _root_1st)
200 if (event->atom == _atom[ATOM_E_SCALE])
202 unsigned int val = 1000;
204 if (ecore_x_window_prop_card32_get(event->win,
210 pscale = _elm_config->scale;
211 if (val > 0) _elm_config->scale = (double)val / 1000.0;
212 if (pscale != _elm_config->scale)
219 else if (event->atom == _atom[ATOM_E_FINGER_SIZE])
221 unsigned int val = 1000;
223 if (ecore_x_window_prop_card32_get(event->win,
229 pfinger_size = _elm_config->finger_size;
230 _elm_config->finger_size = val;
231 if (pfinger_size != _elm_config->finger_size)
238 else if (event->atom == _atom[ATOM_E_THEME])
242 val = ecore_x_window_prop_string_get(event->win,
244 eina_stringshare_replace(&_elm_config->theme, val);
247 _elm_theme_parse(NULL, val);
253 else if (event->atom == _atom[ATOM_E_PROFILE])
257 val = ecore_x_window_prop_string_get(event->win,
265 if (strcmp(_elm_profile, val)) changed = 1;
271 if (!_prop_config_get())
276 _elm_config_font_overlay_apply();
282 else if (event->atom == _atom[ATOM_E_FONT_OVERLAY])
284 unsigned int val = 1000;
286 if (ecore_x_window_prop_card32_get(event->win,
293 _elm_config_font_overlay_apply();
297 else if (event->atom == _atom[ATOM_E_CACHE_FLUSH_INTERVAL])
299 unsigned int val = 1000;
301 if (ecore_x_window_prop_card32_get(event->win,
305 int cache_flush_interval;
307 cache_flush_interval = _elm_config->cache_flush_poll_interval;
308 _elm_config->cache_flush_poll_interval = val;
309 if (cache_flush_interval !=
310 _elm_config->cache_flush_poll_interval)
314 else if (event->atom == _atom[ATOM_E_CACHE_FLUSH_ENABLE])
316 unsigned int val = 1000;
318 if (ecore_x_window_prop_card32_get(event->win,
322 _elm_config->cache_flush_enable = !!val;
326 else if (event->atom == _atom[ATOM_E_FONT_CACHE])
328 unsigned int val = 1000;
330 if (ecore_x_window_prop_card32_get(event->win,
336 font_cache = _elm_config->font_cache;
337 _elm_config->font_cache = val;
338 if (font_cache != _elm_config->font_cache)
342 else if (event->atom == _atom[ATOM_E_IMAGE_CACHE])
344 unsigned int val = 1000;
346 if (ecore_x_window_prop_card32_get(event->win,
352 image_cache = _elm_config->image_cache;
353 _elm_config->image_cache = val;
354 if (image_cache != _elm_config->image_cache)
358 else if (event->atom == _atom[ATOM_E_EDJE_FILE_CACHE])
360 unsigned int val = 1000;
362 if (ecore_x_window_prop_card32_get(event->win,
368 edje_file_cache = _elm_config->edje_cache;
369 _elm_config->edje_cache = val;
370 if (edje_file_cache != _elm_config->edje_cache)
374 else if (event->atom == _atom[ATOM_E_EDJE_COLLECTION_CACHE])
376 unsigned int val = 1000;
378 if (ecore_x_window_prop_card32_get(event->win,
382 int edje_collection_cache;
384 edje_collection_cache = _elm_config->edje_collection_cache;
385 _elm_config->edje_collection_cache = val;
386 if (edje_collection_cache !=
387 _elm_config->edje_collection_cache)
391 else if (event->atom == _atom[ATOM_E_THUMBSCROLL_BOUNCE_ENABLE])
393 unsigned int val = 1000;
395 if (ecore_x_window_prop_card32_get(event->win,
399 _elm_config->thumbscroll_bounce_enable = !!val;
402 else if (event->atom == _atom[ATOM_E_THUMBSCROLL_BOUNCE_FRICTION])
404 unsigned int val = 1000;
406 if (ecore_x_window_prop_card32_get(event->win,
411 _elm_config->thumbscroll_bounce_friction =
412 (double)val / 1000.0;
415 else if (event->atom == _atom[ATOM_E_THUMBSCROLL_ENABLE])
417 unsigned int val = 1000;
419 if (ecore_x_window_prop_card32_get(event->win,
423 _elm_config->thumbscroll_enable = !!val;
426 else if (event->atom == _atom[ATOM_E_THUMBSCROLL_THRESHOLD])
428 unsigned int val = 1000;
430 if (ecore_x_window_prop_card32_get(event->win,
434 if (val > 0) _elm_config->thumbscroll_threshold = val;
437 else if (event->atom == _atom[ATOM_E_THUMBSCROLL_MOMENTUM_THRESHOLD])
439 unsigned int val = 1000;
441 if (ecore_x_window_prop_card32_get(event->win,
446 _elm_config->thumbscroll_momentum_threshold =
447 (double)val / 1000.0;
450 else if (event->atom == _atom[ATOM_E_THUMBSCROLL_FRICTION])
452 unsigned int val = 1000;
454 if (ecore_x_window_prop_card32_get(event->win,
459 _elm_config->thumbscroll_friction = (double)val / 1000.0;
462 else if (event->atom == _atom[ATOM_E_THUMBSCROLL_BORDER_FRICTION])
464 unsigned int val = 1000;
466 if (ecore_x_window_prop_card32_get(event->win,
471 _elm_config->thumbscroll_border_friction =
472 (double)val / 1000.0;
475 else if (event->atom == _atom[ATOM_E_THUMBSCROLL_PAGE_SCROLL_FRICTION])
477 unsigned int val = 1000;
479 if (ecore_x_window_prop_card32_get(event->win,
484 _elm_config->page_scroll_friction =
485 (double)val / 1000.0;
488 else if (event->atom ==
489 _atom[ATOM_E_THUMBSCROLL_BRING_IN_SCROLL_FRICTION])
491 unsigned int val = 1000;
493 if (ecore_x_window_prop_card32_get(event->win,
498 _elm_config->bring_in_scroll_friction =
499 (double)val / 1000.0;
502 else if (event->atom ==
503 _atom[ATOM_E_THUMBSCROLL_ZOOM_FRICTION])
505 unsigned int val = 1000;
507 if (ecore_x_window_prop_card32_get(event->win,
512 _elm_config->zoom_friction = (double)val / 1000.0;
515 else if (event->atom == _atom[ATOM_E_INPUT_PANEL])
517 unsigned int val = 0;
519 if (ecore_x_window_prop_card32_get(event->win,
523 int input_panel_enable;
525 input_panel_enable = _elm_config->input_panel_enable;
526 _elm_config->input_panel_enable = val;
527 if (input_panel_enable != _elm_config->input_panel_enable)
529 edje_input_panel_enabled_set(_elm_config->input_panel_enable);
533 else if (event->atom == _atom[ATOM_E_AUTOCAPITAL_ALLOW])
535 unsigned int val = 0;
537 if (ecore_x_window_prop_card32_get(event->win,
541 int autocapital_allow;
543 autocapital_allow = _elm_config->autocapital_allow;
544 _elm_config->autocapital_allow = val;
545 if (autocapital_allow != _elm_config->autocapital_allow)
547 edje_autocapitalization_allow_set(_elm_config->autocapital_allow);
551 else if (event->atom == _atom[ATOM_E_AUTOPERIOD_ALLOW])
553 unsigned int val = 0;
555 if (ecore_x_window_prop_card32_get(event->win,
559 int autoperiod_allow;
561 autoperiod_allow = _elm_config->autoperiod_allow;
562 _elm_config->autoperiod_allow = val;
563 if (autoperiod_allow != _elm_config->autoperiod_allow)
565 edje_autoperiod_allow_set(_elm_config->autoperiod_allow);
569 else if (((_atom_config > 0) && (event->atom == _atom_config)) ||
570 (event->atom == _atom[ATOM_E_CONFIG]))
575 return ECORE_CALLBACK_PASS_ON;
583 Eet_Data_Descriptor_Class eddc;
585 EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Elm_Config);
586 eddc.func.str_direct_alloc = NULL;
587 eddc.func.str_direct_free = NULL;
589 _config_edd = eet_data_descriptor_file_new(&eddc);
592 printf("EEEK! eet_data_descriptor_file_new() failed\n");
596 memset(&eddc, 0, sizeof(eddc)); /* just in case... */
597 EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, Elm_Font_Overlay);
598 eddc.func.str_direct_alloc = NULL;
599 eddc.func.str_direct_free = NULL;
601 _config_font_overlay_edd = eet_data_descriptor_stream_new(&eddc);
602 if (!_config_font_overlay_edd)
604 printf("EEEK! eet_data_descriptor_stream_new() failed\n");
605 eet_data_descriptor_free(_config_edd);
608 #define T_INT EET_T_INT
609 #define T_DOUBLE EET_T_DOUBLE
610 #define T_STRING EET_T_STRING
611 #define T_UCHAR EET_T_UCHAR
613 #define T Elm_Font_Overlay
614 #define D _config_font_overlay_edd
615 ELM_CONFIG_VAL(D, T, text_class, EET_T_STRING);
616 ELM_CONFIG_VAL(D, T, font, EET_T_STRING);
617 ELM_CONFIG_VAL(D, T, size, EET_T_INT);
622 #define D _config_edd
623 ELM_CONFIG_VAL(D, T, config_version, T_INT);
624 ELM_CONFIG_VAL(D, T, engine, T_STRING);
625 ELM_CONFIG_VAL(D, T, thumbscroll_enable, T_UCHAR);
626 ELM_CONFIG_VAL(D, T, thumbscroll_threshold, T_INT);
627 ELM_CONFIG_VAL(D, T, thumbscroll_momentum_threshold, T_DOUBLE);
628 ELM_CONFIG_VAL(D, T, thumbscroll_friction, T_DOUBLE);
629 ELM_CONFIG_VAL(D, T, thumbscroll_bounce_friction, T_DOUBLE);
630 ELM_CONFIG_VAL(D, T, thumbscroll_border_friction, T_DOUBLE);
631 ELM_CONFIG_VAL(D, T, page_scroll_friction, T_DOUBLE);
632 ELM_CONFIG_VAL(D, T, bring_in_scroll_friction, T_DOUBLE);
633 ELM_CONFIG_VAL(D, T, zoom_friction, T_DOUBLE);
634 ELM_CONFIG_VAL(D, T, thumbscroll_bounce_enable, T_UCHAR);
635 ELM_CONFIG_VAL(D, T, scale, T_DOUBLE);
636 ELM_CONFIG_VAL(D, T, bgpixmap, T_INT);
637 ELM_CONFIG_VAL(D, T, compositing, T_INT);
638 /* EET_DATA_DESCRIPTOR_ADD_LIST(D, T, "font_dirs", font_dirs, sub_edd); */
639 ELM_CONFIG_LIST(D, T, font_overlays, _config_font_overlay_edd);
640 ELM_CONFIG_VAL(D, T, font_hinting, T_INT);
641 ELM_CONFIG_VAL(D, T, cache_flush_poll_interval, T_INT);
642 ELM_CONFIG_VAL(D, T, cache_flush_enable, T_UCHAR);
643 ELM_CONFIG_VAL(D, T, image_cache, T_INT);
644 ELM_CONFIG_VAL(D, T, font_cache, T_INT);
645 ELM_CONFIG_VAL(D, T, edje_cache, T_INT);
646 ELM_CONFIG_VAL(D, T, edje_collection_cache, T_INT);
647 ELM_CONFIG_VAL(D, T, finger_size, T_INT);
648 ELM_CONFIG_VAL(D, T, fps, T_DOUBLE);
649 ELM_CONFIG_VAL(D, T, theme, T_STRING);
650 ELM_CONFIG_VAL(D, T, modules, T_STRING);
651 ELM_CONFIG_VAL(D, T, tooltip_delay, T_DOUBLE);
652 ELM_CONFIG_VAL(D, T, cursor_engine_only, T_UCHAR);
653 ELM_CONFIG_VAL(D, T, focus_highlight_enable, T_UCHAR);
654 ELM_CONFIG_VAL(D, T, focus_highlight_animate, T_UCHAR);
655 ELM_CONFIG_VAL(D, T, toolbar_shrink_mode, T_INT);
656 ELM_CONFIG_VAL(D, T, fileselector_expand_enable, T_UCHAR);
657 ELM_CONFIG_VAL(D, T, inwin_dialogs_enable, T_UCHAR);
658 ELM_CONFIG_VAL(D, T, icon_size, T_INT);
659 ELM_CONFIG_VAL(D, T, longpress_timeout, T_DOUBLE);
660 ELM_CONFIG_VAL(D, T, password_show_last_character, T_UCHAR);
661 ELM_CONFIG_VAL(D, T, input_panel_enable, T_INT);
675 eet_data_descriptor_free(_config_edd);
679 if (_config_font_overlay_edd)
681 eet_data_descriptor_free(_config_font_overlay_edd);
682 _config_font_overlay_edd = NULL;
687 _sort_files_cb(const void *f1,
690 return strcmp(f1, f2);
694 _elm_config_current_profile_get(void)
700 _elm_data_dir_snprintf(char *dst,
705 size_t data_dir_len, off;
708 data_dir_len = eina_strlcpy(dst, _elm_data_dir, size);
710 off = data_dir_len + 1;
715 dst[data_dir_len] = '/';
717 off = off + vsnprintf(dst + off, size - off, fmt, ap);
725 _elm_user_dir_snprintf(char *dst,
731 size_t user_dir_len, off;
734 home = getenv("HOME");
738 user_dir_len = eina_str_join_len(dst, size, '/', home, strlen(home),
739 ".elementary", sizeof(".elementary") - 1);
741 off = user_dir_len + 1;
746 dst[user_dir_len] = '/';
748 off = off + vsnprintf(dst + off, size - off, fmt, ap);
756 _elm_config_profile_dir_get(const char *prof,
764 _elm_user_dir_snprintf(buf, sizeof(buf), "config/%s", prof);
766 if (ecore_file_is_dir(buf))
772 snprintf(buf, sizeof(buf), "%s/config/%s", _elm_data_dir, prof);
774 if (ecore_file_is_dir(buf))
781 _elm_config_font_overlays_list(void)
783 return _elm_config->font_overlays;
787 _elm_config_font_overlay_set(const char *text_class,
791 Elm_Font_Overlay *efd;
794 EINA_LIST_FOREACH(_elm_config->font_overlays, l, efd)
796 if (strcmp(efd->text_class, text_class))
799 if (efd->font) eina_stringshare_del(efd->font);
800 efd->font = eina_stringshare_add(font);
802 _elm_config->font_overlays =
803 eina_list_promote_list(_elm_config->font_overlays, l);
807 /* the text class doesn't exist */
808 efd = calloc(1, sizeof(Elm_Font_Overlay));
809 efd->text_class = eina_stringshare_add(text_class);
810 efd->font = eina_stringshare_add(font);
813 _elm_config->font_overlays = eina_list_prepend(_elm_config->font_overlays,
818 _elm_config_font_overlay_remove(const char *text_class)
820 Elm_Font_Overlay *efd;
823 EINA_LIST_FOREACH(_elm_config->font_overlays, l, efd)
825 if (strcmp(efd->text_class, text_class))
828 _elm_config->font_overlays =
829 eina_list_remove_list(_elm_config->font_overlays, l);
830 if (efd->text_class) eina_stringshare_del(efd->text_class);
831 if (efd->font) eina_stringshare_del(efd->font);
839 _elm_config_font_overlay_apply(void)
841 Elm_Font_Overlay *efd;
845 for (i = 0; _elm_text_classes[i].desc; i++)
846 edje_text_class_del(_elm_text_classes[i].name);
848 EINA_LIST_FOREACH(_elm_config->font_overlays, l, efd)
849 edje_text_class_set(efd->text_class, efd->font, efd->size);
853 _elm_config_text_classes_get(void)
855 Eina_List *ret = NULL;
858 for (i = 0; _elm_text_classes[i].desc; i++)
861 tc = malloc(sizeof(*tc));
863 *tc = _elm_text_classes[i];
865 ret = eina_list_append(ret, tc);
872 _elm_config_text_classes_free(Eina_List *l)
876 EINA_LIST_FREE(l, tc)
881 _elm_config_profiles_list(void)
883 const Eina_File_Direct_Info *info;
884 Eina_List *flist = NULL;
885 Eina_Iterator *file_it;
890 len = _elm_user_dir_snprintf(buf, sizeof(buf), "config");
892 file_it = eina_file_direct_ls(buf);
899 len = sizeof(buf) - len;
901 EINA_ITERATOR_FOREACH(file_it, info)
903 if (info->name_length >= len)
906 if (info->type == EINA_FILE_DIR)
909 eina_list_sorted_insert(flist, _sort_files_cb,
910 eina_stringshare_add(info->path +
915 eina_iterator_free(file_it);
918 len = eina_str_join_len(buf, sizeof(buf), '/', _elm_data_dir,
919 strlen(_elm_data_dir), "config",
920 sizeof("config") - 1);
922 file_it = eina_file_direct_ls(buf);
929 len = sizeof(buf) - len;
930 EINA_ITERATOR_FOREACH(file_it, info)
932 if (info->name_length >= len)
942 EINA_LIST_FOREACH(flist, l, tmp)
943 if (!strcmp(info->path + info->name_start, tmp))
948 eina_list_sorted_insert(flist, _sort_files_cb,
949 eina_stringshare_add(info->path +
960 eina_iterator_free(file_it);
963 EINA_LIST_FREE(flist, dir)
964 eina_stringshare_del(dir);
970 _profile_fetch_from_conf(void)
972 char buf[PATH_MAX], *p, *s;
976 _elm_profile = strdup("default");
978 // if env var - use profile without question
979 s = getenv("ELM_PROFILE");
983 _elm_profile = strdup(s);
988 _elm_user_dir_snprintf(buf, sizeof(buf), "config/profile.cfg");
989 ef = eet_open(buf, EET_FILE_MODE_READ);
992 p = eet_read(ef, "config", &len);
996 _elm_profile = malloc(len + 1);
997 memcpy(_elm_profile, p, len);
998 _elm_profile[len] = 0;
1007 _elm_data_dir_snprintf(buf, sizeof(buf), "config/profile.cfg");
1008 ef = eet_open(buf, EET_FILE_MODE_READ);
1011 p = eet_read(ef, "config", &len);
1015 _elm_profile = malloc(len + 1);
1016 memcpy(_elm_profile, p, len);
1017 _elm_profile[len] = 0;
1027 Elm_Font_Overlay *fo;
1028 const char *fontdir;
1030 if (!_elm_config) return;
1031 EINA_LIST_FREE(_elm_config->font_dirs, fontdir)
1033 eina_stringshare_del(fontdir);
1035 if (_elm_config->engine) eina_stringshare_del(_elm_config->engine);
1036 EINA_LIST_FREE(_elm_config->font_overlays, fo)
1038 if (fo->text_class) eina_stringshare_del(fo->text_class);
1039 if (fo->font) eina_stringshare_del(fo->font);
1042 if (_elm_config->theme) eina_stringshare_del(_elm_config->theme);
1043 if (_elm_config->modules) eina_stringshare_del(_elm_config->modules);
1051 _elm_theme_parse(NULL, _elm_config->theme);
1052 ecore_animator_frametime_set(1.0 / _elm_config->fps);
1056 _config_sub_apply(void)
1058 edje_frametime_set(1.0 / _elm_config->fps);
1059 edje_scale_set(_elm_config->scale);
1060 if (_elm_config->modules) _elm_module_parse(_elm_config->modules);
1061 edje_input_panel_enabled_set(_elm_config->input_panel_enable);
1062 edje_autocapitalization_allow_set(_elm_config->autocapital_allow);
1063 edje_autoperiod_allow_set(_elm_config->autoperiod_allow);
1067 _elm_cache_flush_cb(void *data __UNUSED__)
1070 return ECORE_CALLBACK_RENEW;
1073 /* kind of abusing this call right now -- shared between all of those
1074 * properties -- but they are not meant to be called that periodically
1084 EINA_LIST_FOREACH(_elm_win_list, l, win)
1086 Evas *e = evas_object_evas_get(win);
1087 evas_image_cache_set(e, _elm_config->image_cache);
1088 evas_font_cache_set(e, _elm_config->font_cache);
1090 edje_file_cache_set(_elm_config->edje_cache);
1091 edje_collection_cache_set(_elm_config->edje_collection_cache);
1093 if (_elm_cache_flush_poller)
1095 ecore_poller_del(_elm_cache_flush_poller);
1096 _elm_cache_flush_poller = NULL;
1098 if (_elm_config->cache_flush_poll_interval > 0)
1100 _elm_cache_flush_poller =
1101 ecore_poller_add(ECORE_POLLER_CORE,
1102 _elm_config->cache_flush_poll_interval,
1103 _elm_cache_flush_cb, NULL);
1108 _config_user_load(void)
1110 Elm_Config *cfg = NULL;
1114 _elm_user_dir_snprintf(buf, sizeof(buf), "config/%s/base.cfg",
1117 ef = eet_open(buf, EET_FILE_MODE_READ);
1120 cfg = eet_data_read(ef, _config_edd, "config");
1127 _config_system_load(void)
1129 Elm_Config *cfg = NULL;
1133 _elm_data_dir_snprintf(buf, sizeof(buf), "config/%s/base.cfg",
1136 ef = eet_open(buf, EET_FILE_MODE_READ);
1139 cfg = eet_data_read(ef, _config_edd, "config");
1148 _elm_config = _config_user_load();
1151 if (_elm_config->config_version < ELM_CONFIG_VERSION)
1156 /* no user config, fallback for system. No need to check version for
1157 * this one, if it's not the right one, someone screwed up at the time
1158 * of installing it */
1159 _elm_config = _config_system_load();
1160 if (_elm_config) return;
1161 /* FIXME: config load could have failed because of a non-existent
1162 * profile. Fallback to default before moving on */
1164 // config load fail - defaults
1165 /* XXX: do these make sense? Only if it's valid to install the lib
1166 * without the config, but do we want that? */
1167 _elm_config = ELM_NEW(Elm_Config);
1168 _elm_config->config_version = ELM_CONFIG_VERSION;
1169 _elm_config->engine = eina_stringshare_add("software_x11");
1170 _elm_config->thumbscroll_enable = EINA_TRUE;
1171 _elm_config->thumbscroll_threshold = 24;
1172 _elm_config->thumbscroll_momentum_threshold = 100.0;
1173 _elm_config->thumbscroll_friction = 1.0;
1174 _elm_config->thumbscroll_bounce_friction = 0.5;
1175 _elm_config->thumbscroll_bounce_enable = EINA_TRUE;
1176 _elm_config->page_scroll_friction = 0.5;
1177 _elm_config->bring_in_scroll_friction = 0.5;
1178 _elm_config->zoom_friction = 0.5;
1179 _elm_config->thumbscroll_border_friction = 0.5;
1180 _elm_config->scale = 1.0;
1181 _elm_config->bgpixmap = 0;
1182 _elm_config->compositing = 1;
1183 _elm_config->font_hinting = 2;
1184 _elm_config->cache_flush_poll_interval = 512;
1185 _elm_config->cache_flush_enable = EINA_TRUE;
1186 _elm_config->font_dirs = NULL;
1187 _elm_config->image_cache = 4096;
1188 _elm_config->font_cache = 512;
1189 _elm_config->edje_cache = 32;
1190 _elm_config->edje_collection_cache = 64;
1191 _elm_config->finger_size = 40;
1192 _elm_config->fps = 60.0;
1193 _elm_config->theme = eina_stringshare_add("default");
1194 _elm_config->modules = NULL;
1195 _elm_config->tooltip_delay = 1.0;
1196 _elm_config->cursor_engine_only = EINA_TRUE;
1197 _elm_config->focus_highlight_enable = EINA_FALSE;
1198 _elm_config->focus_highlight_animate = EINA_TRUE;
1199 _elm_config->toolbar_shrink_mode = 2;
1200 _elm_config->fileselector_expand_enable = EINA_FALSE;
1201 _elm_config->inwin_dialogs_enable = EINA_FALSE;
1202 _elm_config->icon_size = 32;
1203 _elm_config->longpress_timeout = 1.0;
1204 _elm_config->password_show_last_character = EINA_FALSE;
1208 _elm_config_eet_close_error_get(Eet_File *ef,
1212 const char *erstr = NULL;
1214 err = eet_close(ef);
1217 case EET_ERROR_WRITE_ERROR:
1218 erstr = "An error occurred while saving Elementary's "
1219 "settings to disk. The error could not be "
1220 "deterimined. The file where the error occurred was: "
1221 "%s. This file has been deleted to avoid corrupt data.";
1224 case EET_ERROR_WRITE_ERROR_FILE_TOO_BIG:
1225 erstr = "Elementary's settings files are too big "
1226 "for the file system they are being saved to. "
1227 "This error is very strange as the files should "
1228 "be extremely small. Please check the settings "
1229 "for your home directory. "
1230 "The file where the error occurred was: %s ."
1231 "This file has been deleted to avoid corrupt data.";
1234 case EET_ERROR_WRITE_ERROR_IO_ERROR:
1235 erstr = "An output error occurred when writing the settings "
1236 "files for Elementary. Your disk is having troubles "
1237 "and possibly needs replacement. "
1238 "The file where the error occurred was: %s ."
1239 "This file has been deleted to avoid corrupt data.";
1242 case EET_ERROR_WRITE_ERROR_OUT_OF_SPACE:
1243 erstr = "Elementary cannot write its settings file "
1244 "because it ran out of space to write the file. "
1245 "You have either run out of disk space or have "
1246 "gone over your quota limit. "
1247 "The file where the error occurred was: %s ."
1248 "This file has been deleted to avoid corrupt data.";
1251 case EET_ERROR_WRITE_ERROR_FILE_CLOSED:
1252 erstr = "Elementary unexpectedly had the settings file "
1253 "it was writing closed on it. This is very unusual. "
1254 "The file where the error occurred was: %s "
1255 "This file has been deleted to avoid corrupt data.";
1263 /* delete any partially-written file */
1264 ecore_file_unlink(file);
1265 return strdup(erstr);
1272 _elm_config_profile_save(void)
1274 char buf[4096], buf2[4096];
1280 len = _elm_user_dir_snprintf(buf, sizeof(buf), "config/profile.cfg");
1281 if (len + 1 >= sizeof(buf))
1284 len = _elm_user_dir_snprintf(buf2, sizeof(buf2), "config/profile.cfg.tmp");
1285 if (len + 1 >= sizeof(buf2))
1288 ef = eet_open(buf2, EET_FILE_MODE_WRITE);
1292 ok = eet_write(ef, "config", _elm_profile, strlen(_elm_profile), 0);
1296 err = _elm_config_eet_close_error_get(ef, buf2);
1304 ret = ecore_file_mv(buf2, buf);
1307 ERR("Error saving Elementary's configuration file");
1311 ecore_file_unlink(buf2);
1315 ecore_file_unlink(buf2);
1320 _elm_config_save(void)
1322 char buf[4096], buf2[4096];
1328 len = _elm_user_dir_snprintf(buf, sizeof(buf), "config/%s", _elm_profile);
1329 if (len + 1 >= sizeof(buf))
1332 ok = ecore_file_mkpath(buf);
1335 ERR("Problem acessing Elementary's user configuration directory: %s",
1340 if (!_elm_config_profile_save())
1346 if (len + sizeof("base.cfg") >= sizeof(buf) - len)
1349 memcpy(buf + len, "base.cfg", sizeof("base.cfg"));
1350 len += sizeof("base.cfg") - 1;
1352 if (len + sizeof(".tmp") >= sizeof(buf))
1355 memcpy(buf2, buf, len);
1356 memcpy(buf2 + len, ".tmp", sizeof(".tmp"));
1358 ef = eet_open(buf2, EET_FILE_MODE_WRITE);
1362 ok = eet_data_write(ef, _config_edd, "config", _elm_config, 1);
1366 err = _elm_config_eet_close_error_get(ef, buf2);
1374 ret = ecore_file_mv(buf2, buf);
1377 ERR("Error saving Elementary's configuration file");
1381 ecore_file_unlink(buf2);
1385 ecore_file_unlink(buf2);
1390 _config_update(void)
1394 tcfg = _config_system_load();
1397 /* weird profile or something? We should probably fill
1398 * with hardcoded defaults, or get from default previx */
1401 #define IFCFG(v) if ((_elm_config->config_version & 0xffff) < (v)) {
1402 #define IFCFGELSE } else {
1404 #define COPYVAL(x) do {_elm_config->x = tcfg->x; } while(0)
1405 #define COPYPTR(x) do {_elm_config->x = tcfg->x; tcfg->x = NULL; } while(0)
1406 #define COPYSTR(x) COPYPTR(x)
1408 /* we also need to update for property changes in the root window
1409 * if needed, but that will be dependent on new properties added
1410 * with each version */
1413 COPYVAL(longpress_timeout);
1423 /* after updating user config, we must save */
1432 s = getenv("ELM_ENGINE");
1435 if ((!strcasecmp(s, "x11")) ||
1436 (!strcasecmp(s, "x")) ||
1437 (!strcasecmp(s, "software-x11")) ||
1438 (!strcasecmp(s, "software_x11")))
1439 eina_stringshare_replace(&_elm_config->engine, ELM_SOFTWARE_X11);
1440 else if ((!strcasecmp(s, "opengl")) ||
1441 (!strcasecmp(s, "gl")) ||
1442 (!strcasecmp(s, "opengl-x11")) ||
1443 (!strcasecmp(s, "opengl_x11")))
1444 eina_stringshare_replace(&_elm_config->engine, ELM_OPENGL_X11);
1445 else if ((!strcasecmp(s, "x11-8")) ||
1446 (!strcasecmp(s, "x18")) ||
1447 (!strcasecmp(s, "software-8-x11")) ||
1448 (!strcasecmp(s, "software_8_x11")))
1449 eina_stringshare_replace(&_elm_config->engine, ELM_SOFTWARE_8_X11);
1450 else if ((!strcasecmp(s, "x11-16")) ||
1451 (!strcasecmp(s, "x16")) ||
1452 (!strcasecmp(s, "software-16-x11")) ||
1453 (!strcasecmp(s, "software_16_x11")))
1454 eina_stringshare_replace(&_elm_config->engine, ELM_SOFTWARE_16_X11);
1455 else if ((!strcasecmp(s, "xrender")) ||
1456 (!strcasecmp(s, "xr")) ||
1457 (!strcasecmp(s, "xrender-x11")) ||
1458 (!strcasecmp(s, "xrender_x11")))
1459 eina_stringshare_replace(&_elm_config->engine, ELM_XRENDER_X11);
1460 else if ((!strcasecmp(s, "fb")) ||
1461 (!strcasecmp(s, "software-fb")) ||
1462 (!strcasecmp(s, "software_fb")))
1463 eina_stringshare_replace(&_elm_config->engine, ELM_SOFTWARE_FB);
1464 else if ((!strcasecmp(s, "directfb")) ||
1465 (!strcasecmp(s, "dfb")))
1466 eina_stringshare_replace(&_elm_config->engine, ELM_SOFTWARE_DIRECTFB);
1467 else if ((!strcasecmp(s, "sdl")) ||
1468 (!strcasecmp(s, "software-sdl")) ||
1469 (!strcasecmp(s, "software_sdl")))
1470 eina_stringshare_replace(&_elm_config->engine, ELM_SOFTWARE_SDL);
1471 else if ((!strcasecmp(s, "sdl-16")) ||
1472 (!strcasecmp(s, "software-16-sdl")) ||
1473 (!strcasecmp(s, "software_16_sdl")))
1474 eina_stringshare_replace(&_elm_config->engine, ELM_SOFTWARE_16_SDL);
1475 else if ((!strcasecmp(s, "opengl-sdl")) ||
1476 (!strcasecmp(s, "opengl_sdl")) ||
1477 (!strcasecmp(s, "gl-sdl")) ||
1478 (!strcasecmp(s, "gl_sdl")))
1479 eina_stringshare_replace(&_elm_config->engine, ELM_OPENGL_SDL);
1480 else if ((!strcasecmp(s, "gdi")) ||
1481 (!strcasecmp(s, "software-gdi")) ||
1482 (!strcasecmp(s, "software_gdi")))
1483 eina_stringshare_replace(&_elm_config->engine, ELM_SOFTWARE_WIN32);
1484 else if ((!strcasecmp(s, "wince-gdi")) ||
1485 (!strcasecmp(s, "software-16-wince-gdi")) ||
1486 (!strcasecmp(s, "software_16_wince_gdi")))
1487 eina_stringshare_replace(&_elm_config->engine, ELM_SOFTWARE_16_WINCE);
1490 s = getenv("ELM_THUMBSCROLL_ENABLE");
1491 if (s) _elm_config->thumbscroll_enable = !!atoi(s);
1492 s = getenv("ELM_THUMBSCROLL_THRESHOLD");
1493 if (s) _elm_config->thumbscroll_threshold = atoi(s);
1494 // FIXME: floatformat locale issues here 1.0 vs 1,0 - should just be 1.0
1495 s = getenv("ELM_THUMBSCROLL_MOMENTUM_THRESHOLD");
1496 if (s) _elm_config->thumbscroll_momentum_threshold = atof(s);
1497 s = getenv("ELM_THUMBSCROLL_FRICTION");
1498 if (s) _elm_config->thumbscroll_friction = atof(s);
1499 s = getenv("ELM_THUMBSCROLL_BOUNCE_ENABLE");
1500 if (s) _elm_config->thumbscroll_bounce_enable = !!atoi(s);
1501 s = getenv("ELM_THUMBSCROLL_BOUNCE_FRICTION");
1502 if (s) _elm_config->thumbscroll_bounce_friction = atof(s);
1503 s = getenv("ELM_PAGE_SCROLL_FRICTION");
1504 if (s) _elm_config->page_scroll_friction = atof(s);
1505 s = getenv("ELM_BRING_IN_SCROLL_FRICTION");
1506 if (s) _elm_config->bring_in_scroll_friction = atof(s);
1507 s = getenv("ELM_ZOOM_FRICTION");
1508 if (s) _elm_config->zoom_friction = atof(s);
1509 s = getenv("ELM_THUMBSCROLL_BORDER_FRICTION");
1519 _elm_config->thumbscroll_border_friction = friction;
1521 s = getenv("ELM_THEME");
1522 if (s) eina_stringshare_replace(&_elm_config->theme, s);
1524 s = getenv("ELM_FONT_HINTING");
1527 if (!strcasecmp(s, "none")) _elm_config->font_hinting = 0;
1528 else if (!strcasecmp(s, "auto"))
1529 _elm_config->font_hinting = 1;
1530 else if (!strcasecmp(s, "bytecode"))
1531 _elm_config->font_hinting = 2;
1534 s = getenv("ELM_FONT_PATH");
1540 EINA_LIST_FREE(_elm_config->font_dirs, p)
1542 eina_stringshare_del(p);
1545 buf2 = alloca(strlen(s) + 1);
1550 if ((*p == ':') || (*p == 0))
1555 strncpy(buf2, pp, len);
1557 _elm_config->font_dirs =
1558 eina_list_append(_elm_config->font_dirs,
1559 eina_stringshare_add(buf2));
1572 s = getenv("ELM_IMAGE_CACHE");
1573 if (s) _elm_config->image_cache = atoi(s);
1575 s = getenv("ELM_FONT_CACHE");
1576 if (s) _elm_config->font_cache = atoi(s);
1578 s = getenv("ELM_SCALE");
1579 if (s) _elm_config->scale = atof(s);
1581 _elm_config->finger_size =
1582 (double)_elm_config->finger_size * _elm_config->scale;
1583 s = getenv("ELM_FINGER_SIZE");
1584 if (s) _elm_config->finger_size = atoi(s);
1586 s = getenv("ELM_PASSWORD_SHOW_LAST_CHARACTER");
1587 if (s) _elm_config->password_show_last_character = !!atoi(s);
1589 s = getenv("ELM_FPS");
1590 if (s) _elm_config->fps = atof(s);
1591 if (_elm_config->fps < 1.0) _elm_config->fps = 1.0;
1593 s = getenv("ELM_MODULES");
1594 if (s) eina_stringshare_replace(&_elm_config->modules, s);
1596 s = getenv("ELM_TOOLTIP_DELAY");
1599 double delay = atof(s);
1601 _elm_config->tooltip_delay = delay;
1604 s = getenv("ELM_CURSOR_ENGINE_ONLY");
1605 if (s) _elm_config->cursor_engine_only = !!atoi(s);
1607 s = getenv("ELM_FOCUS_HIGHLIGHT_ENABLE");
1608 if (s) _elm_config->focus_highlight_enable = !!atoi(s);
1610 s = getenv("ELM_FOCUS_HIGHLIGHT_ANIMATE");
1611 if (s) _elm_config->focus_highlight_animate = !!atoi(s);
1613 s = getenv("ELM_TOOLBAR_SHRINK_MODE");
1614 if (s) _elm_config->toolbar_shrink_mode = atoi(s);
1616 s = getenv("ELM_FILESELECTOR_EXPAND_ENABLE");
1617 if (s) _elm_config->fileselector_expand_enable = !!atoi(s);
1619 s = getenv("ELM_INWIN_DIALOGS_ENABLE");
1620 if (s) _elm_config->inwin_dialogs_enable = !!atoi(s);
1622 s = getenv("ELM_ICON_SIZE");
1623 if (s) _elm_config->icon_size = atoi(s);
1625 s = getenv("ELM_INPUT_PANEL");
1626 if (s) _elm_config->input_panel_enable = atoi(s);
1628 s = getenv("ELM_LONGPRESS_TIMEOUT");
1629 if (s) _elm_config->longpress_timeout = atof(s);
1630 if (_elm_config->longpress_timeout < 0.0)
1631 _elm_config->longpress_timeout = 0.0;
1635 _elm_config_init(void)
1638 _profile_fetch_from_conf();
1642 // _elm_config_font_overlay_apply();
1647 _elm_config_sub_init(void)
1651 _elm_config_font_overlay_apply();
1654 #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
1655 if (ENGINE_COMPARE(ELM_SOFTWARE_X11) ||
1656 ENGINE_COMPARE(ELM_SOFTWARE_16_X11) ||
1657 ENGINE_COMPARE(ELM_XRENDER_X11) ||
1658 ENGINE_COMPARE(ELM_OPENGL_X11))
1659 #undef ENGINE_COMPARE
1661 #ifdef HAVE_ELEMENTARY_X
1662 unsigned int val = 1000;
1664 if (!ecore_x_init(NULL))
1666 ERR("Cannot connect to X11 display. check $DISPLAY variable");
1669 _root_1st = ecore_x_window_root_first_get();
1671 if (!ecore_x_screen_is_composited(0))
1672 _elm_config->compositing = 0;
1674 ecore_x_atoms_get(_atom_names, ATOM_COUNT, _atom);
1675 ecore_x_event_mask_set(_root_1st,
1676 ECORE_X_EVENT_MASK_WINDOW_PROPERTY);
1677 _prop_change_handler = ecore_event_handler_add
1678 (ECORE_X_EVENT_WINDOW_PROPERTY, _prop_change, NULL);
1679 if (!getenv("ELM_SCALE"))
1681 if (ecore_x_window_prop_card32_get(_root_1st,
1682 _atom[ATOM_E_SCALE],
1687 _elm_config->scale = (double)val / 1000.0;
1688 // FIXME: hack until e export finger size too
1689 if (!getenv("ELM_FINGER_SIZE"))
1691 _elm_config->finger_size = 40.0 * _elm_config->scale;
1693 edje_scale_set(_elm_config->scale);
1697 if (!getenv("ELM_FINGER_SIZE"))
1699 if (ecore_x_window_prop_card32_get(_root_1st,
1700 _atom[ATOM_E_FINGER_SIZE],
1705 _elm_config->finger_size = val;
1709 if (!getenv("ELM_THEME"))
1713 s = ecore_x_window_prop_string_get(_root_1st,
1714 _atom[ATOM_E_THEME]);
1717 eina_stringshare_replace(&_elm_config->theme, s);
1718 _elm_theme_parse(NULL, s);
1722 if (!getenv("ELM_PROFILE"))
1726 s = ecore_x_window_prop_string_get(_root_1st,
1727 _atom[ATOM_E_PROFILE]);
1734 if (strcmp(_elm_profile, s)) changed = 1;
1738 if (changed) _prop_config_get();
1741 if (!getenv("ELM_INPUT_PANEL"))
1743 if (ecore_x_window_prop_card32_get(_root_1st,
1744 _atom[ATOM_E_INPUT_PANEL],
1749 _elm_config->input_panel_enable = val;
1750 edje_input_panel_enabled_set(_elm_config->input_panel_enable);
1754 if (ecore_x_window_prop_card32_get(_root_1st,
1755 _atom[ATOM_E_AUTOCAPITAL_ALLOW],
1760 _elm_config->autocapital_allow = val;
1761 edje_autocapitalization_allow_set(_elm_config->autocapital_allow);
1764 if (ecore_x_window_prop_card32_get(_root_1st,
1765 _atom[ATOM_E_AUTOPERIOD_ALLOW],
1770 _elm_config->autoperiod_allow = val;
1771 edje_autoperiod_allow_set(_elm_config->autoperiod_allow);
1776 _config_sub_apply();
1780 _elm_config_reload(void)
1785 _elm_config_font_overlay_apply();
1791 _elm_config_engine_set(const char *engine)
1793 if (_elm_config->engine && strcmp(_elm_config->engine, engine))
1794 eina_stringshare_del(_elm_config->engine);
1796 _elm_config->engine = eina_stringshare_add(engine);
1800 _elm_config_profile_set(const char *profile)
1802 Eina_Bool changed = EINA_FALSE;
1806 if (strcmp(_elm_profile, profile))
1811 _elm_profile = strdup(profile);
1818 _elm_config_font_overlay_apply();
1825 _elm_config_shutdown(void)
1827 #define ENGINE_COMPARE(name) (!strcmp(_elm_config->engine, name))
1828 if (ENGINE_COMPARE(ELM_SOFTWARE_X11) ||
1829 ENGINE_COMPARE(ELM_SOFTWARE_16_X11) ||
1830 ENGINE_COMPARE(ELM_XRENDER_X11) ||
1831 ENGINE_COMPARE(ELM_OPENGL_X11))
1832 #undef ENGINE_COMPARE
1834 #ifdef HAVE_ELEMENTARY_X
1835 ecore_event_handler_del(_prop_change_handler);
1836 _prop_change_handler = NULL;
1843 _elm_profile = NULL;