2 # include "elementary_config.h"
4 #include <Elementary.h>
6 typedef struct _Theme Theme;
7 typedef struct _Fonts_Data Fonts_Data;
8 typedef struct _Elm_Text_Class_Data Elm_Text_Class_Data;
9 typedef struct _Elm_Font_Size_Data Elm_Font_Size_Data;
16 Eina_Bool in_search_path;
19 static const Eina_List *tsel = NULL;
20 static Eina_List *themes = NULL;
22 struct _Elm_Text_Class_Data
31 struct _Elm_Font_Size_Data
39 Eina_List *text_classes;
42 Eina_List *font_px_list;
43 Eina_List *font_scale_list;
46 const char *cur_style;
50 #define ELM_LIST_DISABLE(list) \
53 const Eina_List *_l = elm_list_items_get(list); \
56 elm_list_item_show(eina_list_data_get(_l));\
57 elm_object_disabled_set(list, EINA_TRUE); \
62 #define ELM_LIST_ENABLE(list) \
65 elm_object_disabled_set(list, EINA_FALSE); \
69 #define LABEL_FRAME_ADD(label) \
72 pd = elm_frame_add(win); \
73 evas_object_size_hint_weight_set(pd, EVAS_HINT_EXPAND, 0.0); \
74 evas_object_size_hint_align_set(pd, EVAS_HINT_FILL, 0.5); \
75 elm_object_style_set(pd, "pad_medium"); \
76 elm_box_pack_end(bx, pd); \
77 evas_object_show(pd); \
79 lb = elm_label_add(win); \
80 evas_object_size_hint_weight_set(lb, EVAS_HINT_EXPAND, 0.0); \
81 evas_object_size_hint_align_set(lb, EVAS_HINT_FILL, 0.5); \
82 elm_object_text_set(lb, label); \
83 elm_object_content_set(pd, lb); \
84 evas_object_show(lb); \
89 static int interactive = 1;
91 static const char *theme_set = NULL;
92 static const char *finger_size_set = NULL;
93 static const char *scale_set = NULL;
94 static Fonts_Data fndata = {NULL, NULL, NULL, NULL, NULL, NULL, 0.0};
97 _font_styles_list_sel(void *data EINA_UNUSED,
102 config_exit(void *data EINA_UNUSED,
103 Evas_Object *obj EINA_UNUSED,
104 void *event_info EINA_UNUSED)
106 Elm_Text_Class_Data *tc_data;
107 Elm_Font_Size_Data *sd;
109 EINA_LIST_FREE(fndata.text_classes, tc_data)
111 eina_stringshare_del(tc_data->name);
112 eina_stringshare_del(tc_data->desc);
113 eina_stringshare_del(tc_data->font);
114 eina_stringshare_del(tc_data->style);
118 elm_font_available_hash_del(fndata.font_hash);
119 fndata.font_hash = NULL;
121 EINA_LIST_FREE(fndata.font_px_list, sd)
123 eina_stringshare_del(sd->size_str);
127 EINA_LIST_FREE(fndata.font_scale_list, sd)
129 eina_stringshare_del(sd->size_str);
133 if (fndata.cur_font) eina_stringshare_del(fndata.cur_font);
134 fndata.cur_font = NULL;
136 if (fndata.cur_style) eina_stringshare_del(fndata.cur_style);
137 fndata.cur_style = NULL;
140 elm_exit(); /* exit the program's main loop that runs in elm_run() */
144 sb_change(void *data EINA_UNUSED,
146 void *event_info EINA_UNUSED)
148 Eina_Bool val = elm_check_state_get(obj);
149 Eina_Bool sb = elm_config_scroll_bounce_enabled_get();
151 if (val == sb) return;
152 elm_config_scroll_bounce_enabled_set(val);
153 elm_config_all_flush();
155 /*TODO: enable/disable subordinate sliders (make 'em support it 1st)*/
159 bf_round(void *data EINA_UNUSED,
161 void *event_info EINA_UNUSED)
163 double val = elm_slider_value_get(obj);
166 v = ((double)((int)(val * 10.0))) / 10.0;
167 if (v != val) elm_slider_value_set(obj, v);
171 bf_change(void *data EINA_UNUSED,
173 void *event_info EINA_UNUSED)
175 double bf = elm_config_scroll_bounce_friction_get();
176 double val = elm_slider_value_get(obj);
178 if (bf == val) return;
179 elm_config_scroll_bounce_friction_set(val);
180 elm_config_all_flush();
184 ps_round(void *data EINA_UNUSED,
186 void *event_info EINA_UNUSED)
188 double val = elm_slider_value_get(obj);
191 v = ((double)((int)(val * 10.0))) / 10.0;
192 if (v != val) elm_slider_value_set(obj, v);
196 ps_change(void *data EINA_UNUSED,
198 void *event_info EINA_UNUSED)
200 double ps = elm_config_scroll_page_scroll_friction_get();
201 double val = elm_slider_value_get(obj);
203 if (ps == val) return;
204 elm_config_scroll_page_scroll_friction_set(val);
205 elm_config_all_flush();
209 bis_round(void *data EINA_UNUSED,
211 void *event_info EINA_UNUSED)
213 double val = elm_slider_value_get(obj);
216 v = ((double)((int)(val * 10.0))) / 10.0;
217 if (v != val) elm_slider_value_set(obj, v);
221 bis_change(void *data EINA_UNUSED,
223 void *event_info EINA_UNUSED)
225 double bis = elm_config_scroll_bring_in_scroll_friction_get();
226 double val = elm_slider_value_get(obj);
228 if (bis == val) return;
229 elm_config_scroll_bring_in_scroll_friction_set(val);
230 elm_config_all_flush();
234 zf_round(void *data EINA_UNUSED,
236 void *event_info EINA_UNUSED)
238 double val = elm_slider_value_get(obj);
241 v = ((double)((int)(val * 10.0))) / 10.0;
242 if (v != val) elm_slider_value_set(obj, v);
246 zf_change(void *data EINA_UNUSED,
248 void *event_info EINA_UNUSED)
250 double zf = elm_config_scroll_zoom_friction_get();
251 double val = elm_slider_value_get(obj);
253 if (zf == val) return;
254 elm_config_scroll_zoom_friction_set(val);
255 elm_config_all_flush();
259 ts_change(void *data EINA_UNUSED,
261 void *event_info EINA_UNUSED)
263 Eina_Bool val = elm_check_state_get(obj);
264 Eina_Bool sb = elm_config_scroll_thumbscroll_enabled_get();
266 if (val == sb) return;
267 elm_config_scroll_thumbscroll_enabled_set(val);
268 elm_config_all_flush();
270 /*TODO: enable/disable subordinate sliders (make 'em support it 1st)*/
274 tst_round(void *data EINA_UNUSED,
276 void *event_info EINA_UNUSED)
278 double val = elm_slider_value_get(obj);
281 v = ((double)((int)(val * 10.0))) / 10.0;
282 if (v != val) elm_slider_value_set(obj, v);
286 tst_change(void *data EINA_UNUSED,
288 void *event_info EINA_UNUSED)
290 double tst = elm_config_scroll_thumbscroll_threshold_get();
291 double val = elm_slider_value_get(obj);
293 if (tst == val) return;
294 elm_config_scroll_thumbscroll_threshold_set(val);
295 elm_config_all_flush();
299 tsht_round(void *data EINA_UNUSED,
301 void *event_info EINA_UNUSED)
303 double val = elm_slider_value_get(obj);
306 v = ((double)((int)(val * 10.0))) / 10.0;
307 if (v != val) elm_slider_value_set(obj, v);
311 tsht_change(void *data EINA_UNUSED,
313 void *event_info EINA_UNUSED)
315 double tst = elm_config_scroll_thumbscroll_hold_threshold_get();
316 double val = elm_slider_value_get(obj);
318 if (tst == val) return;
319 elm_config_scroll_thumbscroll_hold_threshold_set(val);
320 elm_config_all_flush();
324 tsmt_round(void *data EINA_UNUSED,
326 void *event_info EINA_UNUSED)
328 double val = elm_slider_value_get(obj);
331 v = ((double)((int)(val * 10.0))) / 10.0;
332 if (v != val) elm_slider_value_set(obj, v);
336 tsmt_change(void *data EINA_UNUSED,
338 void *event_info EINA_UNUSED)
340 double tsmt = elm_config_scroll_thumbscroll_momentum_threshold_get();
341 double val = elm_slider_value_get(obj);
343 if (tsmt == val) return;
344 elm_config_scroll_thumbscroll_momentum_threshold_set(val);
345 elm_config_all_flush();
349 tsfdt_round(void *data EINA_UNUSED,
351 void *event_info EINA_UNUSED)
353 double val = elm_slider_value_get(obj);
356 v = ((double)((int)(val * 10.0))) / 10.0;
357 if (v != val) elm_slider_value_set(obj, v);
361 tsfdt_change(void *data EINA_UNUSED,
363 void *event_info EINA_UNUSED)
365 double tsfdt = elm_config_scroll_thumbscroll_flick_distance_tolerance_get();
366 double val = elm_slider_value_get(obj);
368 if (tsfdt == val) return;
369 elm_config_scroll_thumbscroll_flick_distance_tolerance_set(val);
370 elm_config_all_flush();
374 tsf_round(void *data EINA_UNUSED,
376 void *event_info EINA_UNUSED)
378 double val = elm_slider_value_get(obj);
381 v = ((double)((int)(val * 10.0))) / 10.0;
382 if (v != val) elm_slider_value_set(obj, v);
386 tsf_change(void *data EINA_UNUSED,
388 void *event_info EINA_UNUSED)
390 double tsf = elm_config_scroll_thumbscroll_friction_get();
391 double val = elm_slider_value_get(obj);
393 if (tsf == val) return;
394 elm_config_scroll_thumbscroll_friction_set(val);
395 elm_config_all_flush();
399 tsmf_round(void *data EINA_UNUSED,
401 void *event_info EINA_UNUSED)
403 double val = elm_slider_value_get(obj);
406 v = ((double)((int)(val * 10.0))) / 10.0;
407 if (v != val) elm_slider_value_set(obj, v);
411 tsmf_change(void *data EINA_UNUSED,
413 void *event_info EINA_UNUSED)
415 double tsmf = elm_config_scroll_thumbscroll_min_friction_get();
416 double val = elm_slider_value_get(obj);
418 if (tsmf == val) return;
419 elm_config_scroll_thumbscroll_min_friction_set(val);
420 elm_config_all_flush();
424 tsfs_round(void *data EINA_UNUSED,
426 void *event_info EINA_UNUSED)
428 double val = elm_slider_value_get(obj);
431 v = ((double)((int)(val * 10.0))) / 10.0;
432 if (v != val) elm_slider_value_set(obj, v);
436 tsfs_change(void *data EINA_UNUSED,
438 void *event_info EINA_UNUSED)
440 double tsfs = elm_config_scroll_thumbscroll_friction_standard_get();
441 double val = elm_slider_value_get(obj);
443 if (tsfs == val) return;
444 elm_config_scroll_thumbscroll_friction_standard_set(val);
445 elm_config_all_flush();
449 tsbf_round(void *data EINA_UNUSED,
451 void *event_info EINA_UNUSED)
453 double val = elm_slider_value_get(obj);
456 v = ((double)((int)(val * 10.0))) / 10.0;
457 if (v != val) elm_slider_value_set(obj, v);
461 tsbf_change(void *data EINA_UNUSED,
463 void *event_info EINA_UNUSED)
465 double tsbf = elm_config_scroll_thumbscroll_border_friction_get();
466 double val = elm_slider_value_get(obj);
468 if (tsbf == val) return;
469 elm_config_scroll_thumbscroll_border_friction_set(val);
470 elm_config_all_flush();
474 tssf_round(void *data EINA_UNUSED,
476 void *event_info EINA_UNUSED)
478 double val = elm_slider_value_get(obj);
481 v = ((double)((int)(val * 20.0))) / 20.0;
482 if (v != val) elm_slider_value_set(obj, v);
486 tssf_change(void *data EINA_UNUSED,
488 void *event_info EINA_UNUSED)
490 double tssf = elm_config_scroll_thumbscroll_sensitivity_friction_get();
491 double val = elm_slider_value_get(obj);
493 if (tssf == val) return;
494 elm_config_scroll_thumbscroll_sensitivity_friction_set(val);
495 elm_config_all_flush();
499 tsat_round(void *data EINA_UNUSED,
501 void *event_info EINA_UNUSED)
503 double val = elm_slider_value_get(obj);
506 v = ((double)((int)(val * 10.0))) / 10.0;
507 if (v != val) elm_slider_value_set(obj, v);
511 tsat_change(void *data EINA_UNUSED,
513 void *event_info EINA_UNUSED)
515 double tsat = elm_config_scroll_thumbscroll_acceleration_threshold_get();
516 double val = elm_slider_value_get(obj);
518 if (tsat == val) return;
519 elm_config_scroll_thumbscroll_acceleration_threshold_set(val);
520 elm_config_all_flush();
524 tsatl_round(void *data EINA_UNUSED,
526 void *event_info EINA_UNUSED)
528 double val = elm_slider_value_get(obj);
531 v = ((double)((int)(val * 10.0))) / 10.0;
532 if (v != val) elm_slider_value_set(obj, v);
536 tsatl_change(void *data EINA_UNUSED,
538 void *event_info EINA_UNUSED)
540 double tsatl = elm_config_scroll_thumbscroll_acceleration_time_limit_get();
541 double val = elm_slider_value_get(obj);
543 if (tsatl == val) return;
544 elm_config_scroll_thumbscroll_acceleration_time_limit_set(val);
545 elm_config_all_flush();
549 tsaw_round(void *data EINA_UNUSED,
551 void *event_info EINA_UNUSED)
553 double val = elm_slider_value_get(obj);
556 v = ((double)((int)(val * 10.0))) / 10.0;
557 if (v != val) elm_slider_value_set(obj, v);
561 tsaw_change(void *data EINA_UNUSED,
563 void *event_info EINA_UNUSED)
565 double tsaw = elm_config_scroll_thumbscroll_acceleration_weight_get();
566 double val = elm_slider_value_get(obj);
568 if (tsaw == val) return;
569 elm_config_scroll_thumbscroll_acceleration_weight_set(val);
570 elm_config_all_flush();
574 cf_enable(void *data,
576 void *event_info EINA_UNUSED)
578 Eina_Bool cf = elm_config_cache_flush_enabled_get();
579 Eina_Bool val = elm_check_state_get(obj);
581 if (cf == val) return;
582 elm_object_disabled_set((Evas_Object *)data, !val);
583 elm_config_cache_flush_enabled_set(val);
584 elm_config_all_flush();
588 cf_round(void *data EINA_UNUSED,
590 void *event_info EINA_UNUSED)
592 double val = elm_slider_value_get(obj);
595 v = ((double)((int)(val * 5.0))) / 5.0;
596 if (v != val) elm_slider_value_set(obj, v);
600 cf_change(void *data EINA_UNUSED,
602 void *event_info EINA_UNUSED)
604 double cf = elm_config_cache_flush_interval_get();
605 double val = elm_slider_value_get(obj);
607 if (cf == val) return;
608 elm_config_cache_flush_interval_set(val);
609 elm_config_all_flush();
613 fc_round(void *data EINA_UNUSED,
615 void *event_info EINA_UNUSED)
617 double val = elm_slider_value_get(obj);
620 v = ((double)((int)(val * 10.0))) / 10.0;
621 if (v != val) elm_slider_value_set(obj, v);
625 fc_change(void *data EINA_UNUSED,
627 void *event_info EINA_UNUSED)
629 double font_cache = elm_config_cache_font_cache_size_get();
630 double val = elm_slider_value_get(obj);
632 if (font_cache == val) return;
633 elm_config_cache_font_cache_size_set(val * 1024);
634 elm_config_all_flush();
638 ic_round(void *data EINA_UNUSED,
640 void *event_info EINA_UNUSED)
642 double val = elm_slider_value_get(obj);
645 v = ((double)((int)(val * 10.0))) / 10.0;
646 if (v != val) elm_slider_value_set(obj, v);
650 ic_change(void *data EINA_UNUSED,
652 void *event_info EINA_UNUSED)
654 double image_cache = elm_config_cache_image_cache_size_get();
655 double val = elm_slider_value_get(obj);
657 if (image_cache == val) return;
658 elm_config_cache_image_cache_size_set(val * 1024);
659 elm_config_all_flush();
663 sc_round(void *data EINA_UNUSED,
665 void *event_info EINA_UNUSED)
667 double val = elm_slider_value_get(obj);
670 v = ((double)((int)(val * 10.0))) / 10.0;
671 if (v != val) elm_slider_value_set(obj, v);
675 sc_change(void *data EINA_UNUSED,
677 void *event_info EINA_UNUSED)
679 double scale = elm_config_scale_get();
680 double val = elm_slider_value_get(obj);
682 if (scale == val) return;
683 elm_config_scale_set(val);
684 elm_config_all_flush();
688 fs_round(void *data EINA_UNUSED,
690 void *event_info EINA_UNUSED)
692 double val = elm_slider_value_get(obj);
695 v = ((double)((int)(val * 5.0))) / 5.0;
696 if (v != val) elm_slider_value_set(obj, v);
700 fs_change(void *data EINA_UNUSED,
702 void *event_info EINA_UNUSED)
704 double fs = elm_config_finger_size_get();
705 double val = elm_slider_value_get(obj);
707 if (fs == val) return;
708 elm_config_finger_size_set(val);
709 elm_config_all_flush();
713 efc_round(void *data EINA_UNUSED,
715 void *event_info EINA_UNUSED)
717 double val = elm_slider_value_get(obj);
720 v = ((double)((int)(val * 5.0))) / 5.0;
721 if (v != val) elm_slider_value_set(obj, v);
725 efc_change(void *data EINA_UNUSED,
727 void *event_info EINA_UNUSED)
729 double efc = elm_config_cache_edje_file_cache_size_get();
730 double val = elm_slider_value_get(obj);
732 if (efc == val) return;
733 elm_config_cache_edje_file_cache_size_set(val);
734 elm_config_all_flush();
738 ecc_round(void *data EINA_UNUSED,
740 void *event_info EINA_UNUSED)
742 double val = elm_slider_value_get(obj);
745 v = ((double)((int)(val * 5.0))) / 5.0;
746 if (v != val) elm_slider_value_set(obj, v);
750 ecc_change(void *data EINA_UNUSED,
752 void *event_info EINA_UNUSED)
754 double ecc = elm_config_cache_edje_collection_cache_size_get();
755 double val = elm_slider_value_get(obj);
757 if (ecc == val) return;
758 elm_config_cache_edje_collection_cache_size_set(val);
759 elm_config_all_flush();
763 ac_change(void *data EINA_UNUSED,
765 void *event_info EINA_UNUSED)
767 Eina_Bool val = elm_check_state_get(obj);
768 Eina_Bool ac = elm_config_access_get();
770 if (val == ac) return;
771 elm_config_access_set(val);
772 elm_config_all_flush();
776 sel_change(void *data EINA_UNUSED,
778 void *event_info EINA_UNUSED)
780 Eina_Bool val = elm_check_state_get(obj);
781 Eina_Bool sel = elm_config_selection_unfocused_clear_get();
783 if (val == sel) return;
784 elm_config_selection_unfocused_clear_set(val);
785 elm_config_all_flush();
790 dbg_change(void *data EINA_UNUSED,
792 void *event_info EINA_UNUSED)
794 Eina_Bool val = elm_check_state_get(obj);
795 Eina_Bool sel = elm_config_clouseau_enabled_get();
797 if (val == sel) return;
798 elm_config_clouseau_enabled_set(val);
799 elm_config_all_flush();
804 _status_basic(Evas_Object *win,
807 Evas_Object *lb, *fr;
809 fr = elm_frame_add(win);
810 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
811 elm_object_text_set(fr, "Information");
812 elm_box_pack_end(bx0, fr);
813 evas_object_show(fr);
815 lb = elm_label_add(win);
816 elm_object_text_set(lb,
817 "Applying configuration change"
819 elm_object_content_set(fr, lb);
820 evas_object_show(lb);
824 _status_config(Evas_Object *win,
827 Evas_Object *lb, *pd, *bx, *fr, *sl, *sp;
829 fr = elm_frame_add(win);
830 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
831 evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
832 elm_object_text_set(fr, "Sizing");
833 elm_box_pack_end(bx0, fr);
834 evas_object_show(fr);
836 bx = elm_box_add(win);
837 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, 0.0);
838 evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, 0.5);
840 LABEL_FRAME_ADD("<hilight>Scale</>");
842 sl = elm_slider_add(win);
843 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
844 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
845 elm_slider_span_size_set(sl, 120);
846 elm_slider_unit_format_set(sl, "%1.2f");
847 elm_slider_indicator_format_set(sl, "%1.2f");
848 elm_slider_min_max_set(sl, 0.25, 5.0);
849 elm_slider_value_set(sl, elm_config_scale_get());
850 elm_box_pack_end(bx, sl);
851 evas_object_show(sl);
853 evas_object_smart_callback_add(sl, "changed", sc_round, NULL);
854 evas_object_smart_callback_add(sl, "delay,changed", sc_change, NULL);
856 sp = elm_separator_add(win);
857 elm_separator_horizontal_set(sp, EINA_TRUE);
858 evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, 0.0);
859 evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5);
860 elm_box_pack_end(bx, sp);
861 evas_object_show(sp);
863 LABEL_FRAME_ADD("<hilight>Finger Size</><br/>");
865 sl = elm_slider_add(win);
866 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
867 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
868 elm_slider_span_size_set(sl, 120);
869 elm_slider_unit_format_set(sl, "%1.0f");
870 elm_slider_indicator_format_set(sl, "%1.0f");
871 elm_slider_min_max_set(sl, 5, 200);
872 elm_slider_value_set(sl, elm_config_finger_size_get());
873 elm_box_pack_end(bx, sl);
874 evas_object_show(sl);
876 evas_object_smart_callback_add(sl, "changed", fs_round, NULL);
877 evas_object_smart_callback_add(sl, "delay,changed", fs_change, NULL);
879 // FIXME: add theme selector (basic mode and advanced for fallbacks)
880 // FIXME: save config
881 // FIXME: profile selector / creator etc.
882 elm_object_content_set(fr, bx);
883 evas_object_show(bx);
887 _flip_to(Evas_Object *win,
890 Evas_Object *wid, *naviframe;
891 wid = evas_object_data_get(win, name);
892 naviframe = evas_object_data_get(win, "naviframe");
893 if (!naviframe) return;
894 elm_naviframe_item_simple_promote(naviframe, wid);
898 _cf_sizing(void *data,
899 Evas_Object *obj EINA_UNUSED,
900 void *event_info EINA_UNUSED)
902 _flip_to(data, "sizing");
906 _cf_themes(void *data,
907 Evas_Object *obj EINA_UNUSED,
908 void *event_info EINA_UNUSED)
910 _flip_to(data, "themes");
914 _cf_fonts(void *data,
915 Evas_Object *obj EINA_UNUSED,
916 void *event_info EINA_UNUSED)
918 _flip_to(data, "fonts");
922 _cf_profiles(void *data,
923 Evas_Object *obj EINA_UNUSED,
924 void *event_info EINA_UNUSED)
926 _flip_to(data, "profiles");
930 _cf_scrolling(void *data,
931 Evas_Object *obj EINA_UNUSED,
932 void *event_info EINA_UNUSED)
934 _flip_to(data, "scrolling");
938 _cf_rendering(void *data,
939 Evas_Object *obj EINA_UNUSED,
940 void *event_info EINA_UNUSED)
942 _flip_to(data, "rendering");
946 _cf_caches(void *data,
947 Evas_Object *obj EINA_UNUSED,
948 void *event_info EINA_UNUSED)
950 _flip_to(data, "caches");
955 Evas_Object *obj EINA_UNUSED,
956 void *event_info EINA_UNUSED)
958 _flip_to(data,"etc");
962 _elm_theme_current_get(const char *theme_search_order)
967 if (!theme_search_order)
970 for (p = theme_search_order;; p++)
972 if ((*p == ':') || (!*p))
974 if (p > theme_search_order)
976 char *n = malloc(p - theme_search_order + 1);
980 strncpy(n, theme_search_order, p - theme_search_order);
981 n[p - theme_search_order] = 0;
982 ret = eina_stringshare_add(n);
993 _font_overlay_set_all(void *data,
994 Evas_Object *obj EINA_UNUSED,
995 void *event_info EINA_UNUSED)
997 Evas_Object *win, *fclasses;
998 Elm_Text_Class_Data *tc_data, *tc;
999 Elm_Object_Item *list_it;
1004 fclasses = evas_object_data_get(win, "font_classes_list");
1005 list_it = elm_list_selected_item_get(fclasses);
1006 if (!list_it) return;
1007 tc_data = elm_object_item_data_get(list_it);
1009 EINA_LIST_FOREACH(fndata.text_classes, l, tc)
1011 eina_stringshare_replace(&tc->font, tc_data->font);
1012 eina_stringshare_replace(&tc->style, tc_data->style);
1013 tc->size = tc_data->size;
1016 elm_config_all_flush();
1021 _font_overlay_reset(void *data,
1022 Evas_Object *obj EINA_UNUSED,
1023 void *event_info EINA_UNUSED)
1025 Evas_Object *win, *fclasses, *fnames, *fstyles, *fsizes;
1026 Elm_Text_Class_Data *tc_data;
1027 Elm_Object_Item *list_it;
1031 fclasses = evas_object_data_get(win, "font_classes_list");
1032 list_it = elm_list_selected_item_get(fclasses);
1033 if (!list_it) return;
1034 tc_data = elm_object_item_data_get(list_it);
1036 fnames = evas_object_data_get(win, "font_names_list");
1037 fstyles = evas_object_data_get(win, "font_styles_list");
1038 fsizes = evas_object_data_get(win, "font_sizes_list");
1040 elm_config_font_overlay_unset(tc_data->name);
1042 eina_stringshare_replace(&fndata.cur_font, NULL);
1043 eina_stringshare_replace(&tc_data->font, NULL);
1044 eina_stringshare_replace(&fndata.cur_style, NULL);
1045 eina_stringshare_replace(&tc_data->style, NULL);
1046 fndata.cur_size = 0.0;
1047 tc_data->size = 0.0;
1049 ELM_LIST_DISABLE(fnames);
1050 ELM_LIST_DISABLE(fstyles);
1051 ELM_LIST_DISABLE(fsizes);
1053 elm_config_all_flush();
1058 _font_overlay_reset_all(void *data,
1059 Evas_Object *obj EINA_UNUSED,
1060 void *event_info EINA_UNUSED)
1062 Evas_Object *win, *fclasses, *fnames, *fstyles, *fsizes;
1063 Elm_Text_Class_Data *tc_data;
1064 Elm_Object_Item *list_it;
1068 eina_stringshare_replace(&fndata.cur_font, NULL);
1069 eina_stringshare_replace(&fndata.cur_style, NULL);
1070 fndata.cur_size = 0.0;
1072 EINA_LIST_FOREACH(fndata.text_classes, l, tc_data)
1074 elm_config_font_overlay_unset(tc_data->name);
1076 eina_stringshare_replace(&tc_data->font, NULL);
1077 eina_stringshare_replace(&tc_data->style, NULL);
1078 tc_data->size = 0.0;
1081 fclasses = evas_object_data_get(win, "font_classes_list");
1082 fnames = evas_object_data_get(win, "font_names_list");
1083 fstyles = evas_object_data_get(win, "font_styles_list");
1084 fsizes = evas_object_data_get(win, "font_sizes_list");
1086 list_it = elm_list_selected_item_get(fclasses);
1087 if (list_it) elm_list_item_selected_set(list_it, EINA_FALSE);
1089 ELM_LIST_DISABLE(fnames);
1090 ELM_LIST_DISABLE(fstyles);
1091 ELM_LIST_DISABLE(fsizes);
1093 elm_config_all_flush();
1098 _font_overlay_change(void *data EINA_UNUSED,
1099 Evas_Object *obj EINA_UNUSED,
1100 void *event_info EINA_UNUSED)
1102 Elm_Text_Class_Data *tc_data;
1105 EINA_LIST_FOREACH(fndata.text_classes, l, tc_data)
1111 name = elm_font_fontconfig_name_get(tc_data->font,
1113 elm_config_font_overlay_set(tc_data->name, name,
1114 tc_data->size ? tc_data->size : -100);
1115 elm_font_fontconfig_name_free(name);
1118 elm_config_font_overlay_unset(tc_data->name);
1121 elm_config_font_overlay_apply();
1122 elm_config_all_flush();
1125 /* TODO: apply hinting */
1129 _config_display_update(Evas_Object *win)
1131 int flush_interval, font_c, image_c, edje_file_c, edje_col_c, ts_threshould,
1133 double scale, s_bounce_friction, ts_momentum_threshold,
1134 ts_flick_distance_tolerance, ts_friction,
1135 ts_min_friction, ts_friction_standard, ts_border_friction,
1136 ts_sensitivity_friction, ts_acceleration_threshold,
1137 ts_acceleration_time_limit, ts_acceleration_weight, page_friction,
1138 bring_in_friction, zoom_friction;
1139 const char *curr_theme, *curr_engine;
1140 const Eina_List *l_items, *l;
1141 Eina_Bool s_bounce, ts;
1142 Elm_Object_Item *list_it;
1146 scale = elm_config_scale_get();
1147 fs = elm_config_finger_size_get();
1148 flush_interval = elm_config_cache_flush_interval_get();
1149 font_c = elm_config_cache_font_cache_size_get();
1150 image_c = elm_config_cache_image_cache_size_get();
1151 edje_file_c = elm_config_cache_edje_file_cache_size_get();
1152 edje_col_c = elm_config_cache_edje_collection_cache_size_get();
1154 s_bounce = elm_config_scroll_bounce_enabled_get();
1155 s_bounce_friction = elm_config_scroll_bounce_friction_get();
1156 ts = elm_config_scroll_thumbscroll_enabled_get();
1157 ts_threshould = elm_config_scroll_thumbscroll_threshold_get();
1158 ts_hold_threshold = elm_config_scroll_thumbscroll_hold_threshold_get();
1159 ts_momentum_threshold = elm_config_scroll_thumbscroll_momentum_threshold_get();
1160 ts_flick_distance_tolerance = elm_config_scroll_thumbscroll_flick_distance_tolerance_get();
1161 ts_friction = elm_config_scroll_thumbscroll_friction_get();
1162 ts_min_friction = elm_config_scroll_thumbscroll_min_friction_get();
1163 ts_friction_standard = elm_config_scroll_thumbscroll_friction_standard_get();
1164 ts_border_friction = elm_config_scroll_thumbscroll_border_friction_get();
1165 ts_sensitivity_friction = elm_config_scroll_thumbscroll_sensitivity_friction_get();
1166 ts_acceleration_threshold = elm_config_scroll_thumbscroll_acceleration_threshold_get();
1167 ts_acceleration_time_limit = elm_config_scroll_thumbscroll_acceleration_time_limit_get();
1168 ts_acceleration_weight = elm_config_scroll_thumbscroll_acceleration_weight_get();
1169 page_friction = elm_config_scroll_page_scroll_friction_get();
1170 bring_in_friction = elm_config_scroll_bring_in_scroll_friction_get();
1171 zoom_friction = elm_config_scroll_zoom_friction_get();
1173 /* gotta update root windows' atoms */
1174 elm_slider_value_set(evas_object_data_get(win, "scale_slider"), scale);
1175 elm_slider_value_set(evas_object_data_get(win, "fs_slider"), fs);
1177 elm_slider_value_set(evas_object_data_get(win,
1178 "cache_flush_interval_slider"),
1180 elm_slider_value_set(evas_object_data_get(win, "font_cache_slider"),
1182 elm_slider_value_set(evas_object_data_get(win, "image_cache_slider"),
1184 elm_slider_value_set(evas_object_data_get(win, "edje_file_cache_slider"),
1186 elm_slider_value_set(evas_object_data_get(win,
1187 "edje_collection_cache_slider"),
1190 elm_check_state_set(evas_object_data_get(win, "scroll_bounce_check"),
1192 elm_slider_value_set(evas_object_data_get(win, "bounce_friction_slider"),
1194 elm_check_state_set(evas_object_data_get(win, "thumbscroll_check"), ts);
1195 elm_slider_value_set(evas_object_data_get(win,
1196 "ts_threshold_slider"),
1198 elm_slider_value_set(evas_object_data_get(win,
1199 "ts_hold_threshold_slider"),
1201 elm_slider_value_set(evas_object_data_get(win,
1202 "ts_momentum_threshold_slider"),
1203 ts_momentum_threshold);
1204 elm_slider_value_set(evas_object_data_get(win,
1205 "ts_flick_distance_tolerance_slider"),
1206 ts_flick_distance_tolerance);
1207 elm_slider_value_set(evas_object_data_get(win,
1208 "ts_friction_slider"),
1210 elm_slider_value_set(evas_object_data_get(win,
1211 "ts_min_friction_slider"),
1213 elm_slider_value_set(evas_object_data_get(win,
1214 "ts_friction_standard_slider"),
1215 ts_friction_standard);
1216 elm_slider_value_set(evas_object_data_get(win, "ts_border_friction_slider"),
1217 ts_border_friction);
1218 elm_slider_value_set(evas_object_data_get(win, "ts_sensitivity_friction_slider"),
1219 ts_sensitivity_friction);
1220 elm_slider_value_set(evas_object_data_get(win, "ts_acceleration_threshold_slider"),
1221 ts_acceleration_threshold);
1222 elm_slider_value_set(evas_object_data_get(win, "ts_acceleration_time_limit_slider"),
1223 ts_acceleration_time_limit);
1224 elm_slider_value_set(evas_object_data_get(win, "ts_acceleration_weight_slider"),
1225 ts_acceleration_weight);
1226 elm_slider_value_set(evas_object_data_get(win,
1227 "page_scroll_friction_slider"),
1229 elm_slider_value_set(evas_object_data_get(win,
1230 "bring_in_scroll_friction_slider"),
1232 elm_slider_value_set(evas_object_data_get(win,
1233 "zoom_scroll_friction_slider"),
1236 curr_theme = _elm_theme_current_get(elm_theme_get(NULL));
1238 th = elm_theme_new();
1239 elm_theme_set(th, curr_theme);
1240 elm_object_theme_set(evas_object_data_get(win, "theme_preview"), th);
1242 eina_stringshare_del(curr_theme);
1244 curr_engine = elm_config_engine_get();
1245 l_items = elm_list_items_get(evas_object_data_get(win, "engines_list"));
1246 EINA_LIST_FOREACH(l_items, l, list_it)
1248 if (!strcmp(elm_object_item_data_get(list_it), curr_engine))
1250 elm_list_item_selected_set(list_it, EINA_TRUE);
1257 _config_all_changed(void *data,
1258 int ev_type EINA_UNUSED,
1259 void *ev EINA_UNUSED)
1261 Evas_Object *win = data;
1262 _config_display_update(win);
1263 return ECORE_CALLBACK_PASS_ON;
1267 _engine_use(void *data,
1268 Evas_Object *obj EINA_UNUSED,
1269 void *event_info EINA_UNUSED)
1272 const char *selection;
1275 selection = elm_object_item_data_get(elm_list_selected_item_get(li));
1277 if (!strcmp(elm_config_engine_get(), selection))
1280 elm_config_engine_set(selection);
1281 elm_config_all_flush();
1282 elm_config_save(); /* make sure new engine has its data dir */
1286 _profile_use(void *data,
1287 Evas_Object *obj EINA_UNUSED,
1288 void *event_info EINA_UNUSED)
1291 const char *selection;
1292 const char *profile;
1295 selection = elm_object_item_data_get(elm_list_selected_item_get(li));
1296 profile = elm_config_profile_get();
1300 fprintf(stderr, "No profile currently set!\n"); /* FIXME: log domain */
1304 if (!strcmp(profile, selection))
1307 elm_config_profile_set(selection); /* just here to update info for getters below */
1309 _config_display_update(elm_object_top_widget_get(li));
1310 elm_config_all_flush();
1311 elm_config_save(); /* make sure new profile has its data dir */
1315 _btn_todo(void *data EINA_UNUSED,
1316 Evas_Object *obj EINA_UNUSED,
1317 void *event_info EINA_UNUSED)
1319 printf("To be done!\n");
1323 _profile_reset(void *data,
1324 Evas_Object *obj EINA_UNUSED,
1325 void *event_info EINA_UNUSED)
1327 const char *selection;
1332 selection = elm_object_item_data_get(elm_list_selected_item_get(li));
1334 elm_config_all_flush();
1335 elm_config_save(); /* dump config into old profile's data dir */
1337 pdir = elm_config_profile_dir_get(selection, EINA_TRUE);
1341 ecore_file_recursive_rm(pdir);
1342 elm_config_profile_dir_free(pdir);
1344 elm_config_reload();
1346 elm_config_all_flush();
1347 _config_display_update(elm_object_top_widget_get(li));
1348 elm_config_save(); /* make sure new profile has its data dir */
1352 _theme_use(void *data EINA_UNUSED,
1353 Evas_Object *obj EINA_UNUSED,
1354 void *event_info EINA_UNUSED)
1358 Evas_Object *win = elm_object_top_widget_get(obj);
1359 Evas_Object *sample = evas_object_data_get(win, "theme_preview");
1361 th = elm_object_theme_get(sample);
1362 defth = elm_theme_get(th);
1363 elm_theme_set(NULL, defth);
1364 elm_config_all_flush();
1369 _theme_sel(void *data EINA_UNUSED,
1371 void *event_info EINA_UNUSED)
1373 Evas_Object *win = elm_object_top_widget_get(obj);
1374 Evas_Object *sample = evas_object_data_get(win, "theme_preview");
1376 Elm_Object_Item *list_it;
1380 if (!sample) return;
1381 tsel = elm_list_selected_items_get(obj);
1382 newth = eina_strbuf_new();
1383 EINA_SAFETY_ON_NULL_RETURN(newth);
1384 th = elm_theme_new();
1387 eina_strbuf_free(newth);
1390 EINA_LIST_REVERSE_FOREACH((Eina_List*)tsel, l, list_it)
1392 Theme *t = elm_object_item_data_get(list_it);
1393 eina_strbuf_append_printf(newth, "%s:", t->name);
1394 if ((!l->prev) && strcmp(t->name, "default"))
1395 /* ensure default theme is always there for fallback */
1396 eina_strbuf_append(newth, "default");
1398 elm_theme_set(th, eina_strbuf_string_get(newth));
1399 eina_strbuf_free(newth);
1400 elm_object_theme_set(sample, th);
1405 _theme_browse(void *data, Evas_Object *obj, void *event_info)
1407 printf("not implemented\n");
1411 _status_config_sizing(Evas_Object *win,
1412 Evas_Object *naviframe)
1414 Evas_Object *lb, *pd, *bx, *sl, *sp;
1416 bx = elm_box_add(win);
1417 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, 0.0);
1418 evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, 0.5);
1420 LABEL_FRAME_ADD("<hilight>Scale</>");
1422 sl = elm_slider_add(win);
1423 evas_object_data_set(win, "scale_slider", sl);
1424 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
1425 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
1426 elm_slider_span_size_set(sl, 120);
1427 elm_slider_unit_format_set(sl, "%1.2f");
1428 elm_slider_indicator_format_set(sl, "%1.2f");
1429 elm_slider_min_max_set(sl, 0.25, 5.0);
1430 elm_slider_value_set(sl, elm_config_scale_get());
1431 elm_box_pack_end(bx, sl);
1432 evas_object_show(sl);
1434 evas_object_smart_callback_add(sl, "changed", sc_round, NULL);
1435 evas_object_smart_callback_add(sl, "delay,changed", sc_change, NULL);
1437 sp = elm_separator_add(win);
1438 elm_separator_horizontal_set(sp, EINA_TRUE);
1439 evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, 0.0);
1440 evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5);
1441 elm_box_pack_end(bx, sp);
1442 evas_object_show(sp);
1444 LABEL_FRAME_ADD("<hilight>Finger Size</><br/>");
1446 sl = elm_slider_add(win);
1447 evas_object_data_set(win, "fs_slider", sl);
1448 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
1449 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
1450 elm_slider_span_size_set(sl, 120);
1451 elm_slider_unit_format_set(sl, "%1.0f");
1452 elm_slider_indicator_format_set(sl, "%1.0f");
1453 elm_slider_min_max_set(sl, 5, 200);
1454 elm_slider_value_set(sl, elm_config_finger_size_get());
1455 elm_box_pack_end(bx, sl);
1456 evas_object_show(sl);
1458 evas_object_smart_callback_add(sl, "changed", fs_round, NULL);
1459 evas_object_smart_callback_add(sl, "delay,changed", fs_change, NULL);
1461 evas_object_data_set(win, "sizing", bx);
1463 elm_naviframe_item_simple_push(naviframe, bx);
1467 _status_config_etc(Evas_Object *win,
1468 Evas_Object *naviframe)
1470 Evas_Object *bx, *ck;
1472 bx = elm_box_add(win);
1473 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, 0.0);
1474 evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, 0.5);
1477 ck = elm_check_add(win);
1478 elm_object_tooltip_text_set(ck, "Set access mode");
1479 elm_object_text_set(ck, "Enable Access Mode");
1480 evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, 0.0);
1481 evas_object_size_hint_align_set(ck, EVAS_HINT_FILL, 0.5);
1482 elm_check_state_set(ck, elm_config_access_get());
1483 elm_box_pack_end(bx, ck);
1484 evas_object_show(ck);
1486 evas_object_smart_callback_add(ck, "changed", ac_change, NULL);
1489 ck = elm_check_add(win);
1490 elm_object_tooltip_text_set(ck, "Set selection mode");
1491 elm_object_text_set(ck, "Enable clear selection when unfocus");
1492 evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, 0.0);
1493 evas_object_size_hint_align_set(ck, EVAS_HINT_FILL, 0.5);
1494 elm_check_state_set(ck, elm_config_selection_unfocused_clear_get());
1495 elm_box_pack_end(bx, ck);
1496 evas_object_show(ck);
1498 evas_object_smart_callback_add(ck, "changed", sel_change, NULL);
1501 ck = elm_check_add(win);
1502 elm_object_tooltip_text_set(ck, "Set clouseau mode");
1503 elm_object_text_set(ck, "Enable clouseau");
1504 evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, 0.0);
1505 evas_object_size_hint_align_set(ck, EVAS_HINT_FILL, 0.5);
1506 elm_check_state_set(ck, elm_config_clouseau_enabled_get());
1507 elm_box_pack_end(bx, ck);
1508 evas_object_show(ck);
1510 evas_object_smart_callback_add(ck, "changed", dbg_change, NULL);
1512 evas_object_data_set(win, "etc", bx);
1514 elm_naviframe_item_simple_push(naviframe, bx);
1517 static Evas_Object *
1518 _sample_theme_new(Evas_Object *win)
1520 Evas_Object *base, *bg, *bt, *ck, *rd, *rdg, *sl, *fr, *li, *rc, *sp;
1522 base = elm_table_add(win);
1523 evas_object_size_hint_weight_set(base, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1524 evas_object_size_hint_align_set(base, EVAS_HINT_FILL, EVAS_HINT_FILL);
1526 bg = elm_bg_add(win);
1527 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1528 evas_object_size_hint_align_set(bg, EVAS_HINT_FILL, EVAS_HINT_FILL);
1529 elm_table_pack(base, bg, 0, 0, 2, 5);
1530 evas_object_show(bg);
1532 bt = elm_button_add(win);
1533 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1534 elm_object_text_set(bt, "Button");
1535 elm_table_pack(base, bt, 0, 0, 1, 1);
1536 evas_object_show(bt);
1538 ck = elm_check_add(win);
1539 evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, 0.0);
1540 elm_object_text_set(ck, "Check");
1541 elm_table_pack(base, ck, 0, 1, 1, 1);
1542 evas_object_show(ck);
1544 rd = elm_radio_add(win);
1545 evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, 0.0);
1546 elm_radio_state_value_set(rd, 0);
1547 elm_object_text_set(rd, "Radio 1");
1548 elm_table_pack(base, rd, 1, 0, 1, 1);
1549 evas_object_show(rd);
1552 rd = elm_radio_add(win);
1553 evas_object_size_hint_weight_set(rd, EVAS_HINT_EXPAND, 0.0);
1554 elm_radio_state_value_set(rd, 1);
1555 elm_object_text_set(rd, "Radio 2");
1556 elm_radio_group_add(rd, rdg);
1557 elm_table_pack(base, rd, 1, 1, 1, 1);
1558 evas_object_show(rd);
1560 sp = elm_separator_add(win);
1561 elm_separator_horizontal_set(sp, EINA_TRUE);
1562 evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, 0.0);
1563 evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5);
1564 elm_table_pack(base, sp, 0, 2, 2, 1);
1565 evas_object_show(sp);
1567 sl = elm_slider_add(win);
1568 elm_object_text_set(sl, "Slider");
1569 elm_slider_span_size_set(sl, 120);
1570 elm_slider_min_max_set(sl, 1, 10);
1571 elm_slider_value_set(sl, 4);
1572 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
1573 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, EVAS_HINT_FILL);
1574 elm_table_pack(base, sl, 0, 3, 2, 1);
1575 evas_object_show(sl);
1577 fr = elm_frame_add(win);
1578 elm_object_text_set(fr, "Frame");
1579 elm_table_pack(base, fr, 0, 4, 2, 1);
1580 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1581 evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
1582 evas_object_show(fr);
1584 li = elm_list_add(win);
1585 evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1586 evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL);
1587 elm_object_content_set(fr, li);
1588 evas_object_show(li);
1590 elm_list_item_append(li, "List Item 1", NULL, NULL, NULL, NULL);
1591 elm_list_item_append(li, "Second Item", NULL, NULL, NULL, NULL);
1592 elm_list_item_append(li, "Third Item", NULL, NULL, NULL, NULL);
1595 rc = evas_object_rectangle_add(evas_object_evas_get(win));
1596 evas_object_size_hint_weight_set(rc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1597 evas_object_size_hint_min_set(rc, 160, 120);
1598 elm_table_pack(base, rc, 0, 4, 2, 1);
1604 _status_config_themes(Evas_Object *win,
1605 Evas_Object *naviframe)
1607 Evas_Object *tb, *rc, *sc, *sp, *li, *pd, *fr, *bt, *sample;
1608 Eina_List *list, *l;
1611 Elm_Object_Item *list_it, *def_it = NULL;
1612 const char *theme_name, *sep[20];
1615 tb = elm_table_add(win);
1616 evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1617 evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
1619 rc = evas_object_rectangle_add(evas_object_evas_get(win));
1620 evas_object_size_hint_weight_set(rc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1621 evas_object_size_hint_min_set(rc, 0, 130);
1622 elm_table_pack(tb, rc, 0, 0, 1, 1);
1624 rc = evas_object_rectangle_add(evas_object_evas_get(win));
1625 evas_object_size_hint_weight_set(rc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1626 evas_object_size_hint_min_set(rc, 0, 200);
1627 elm_table_pack(tb, rc, 0, 1, 1, 1);
1629 /////////////////////////////////////////////
1631 pd = elm_frame_add(win);
1632 elm_object_style_set(pd, "pad_medium");
1633 evas_object_size_hint_weight_set(pd, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1634 evas_object_size_hint_align_set(pd, EVAS_HINT_FILL, EVAS_HINT_FILL);
1635 elm_table_pack(tb, pd, 0, 0, 1, 1);
1636 evas_object_show(pd);
1638 li = elm_list_add(win);
1639 elm_list_multi_select_set(li, EINA_TRUE);
1640 evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1641 evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL);
1642 elm_object_content_set(pd, li);
1643 evas_object_show(li);
1645 list = elm_theme_name_available_list_new();
1646 d = elm_theme_default_get();
1647 theme_name = elm_theme_get(d);
1648 for (x = 1, sep[0] = theme_name; x < sizeof(sep) / sizeof(sep[0]); x++)
1650 sep[x] = strchr(sep[x - 1] + 1, ':');
1653 EINA_LIST_FOREACH(list, l, th)
1658 t = calloc(1, sizeof(Theme));
1659 t->name = eina_stringshare_add(th);
1660 s = elm_theme_list_item_path_get(th, &(t->in_search_path));
1663 t->path = eina_stringshare_add(s);
1666 if (t->in_search_path)
1671 s[0] = toupper(s[0]);
1672 t->label = eina_stringshare_add(s);
1676 t->label = eina_stringshare_add(s);
1680 s = strdup(ecore_file_file_get(th));
1683 s[0] = toupper(s[0]);
1684 ext = strrchr(s, '.');
1686 t->label = eina_stringshare_add(s);
1690 t->label = eina_stringshare_add(s);
1692 themes = eina_list_append(themes, t);
1693 list_it = elm_list_item_append(li, t->label, NULL, NULL, NULL, t);
1694 if (!strcmp(t->name, "default")) def_it = list_it;
1695 for (y = x - 1 /* ignore default e theme */; y > 0; y--)
1697 const char *start = (sep[y - 1][0] == ':') ? sep[y - 1] + 1 : sep[y - 1];
1698 unsigned int len = (unsigned int)(sep[y] - start);
1699 if (strncmp(start , t->name, len) || (strlen(t->name) != len)) continue;
1701 if (!elm_list_item_selected_get(list_it))
1702 elm_list_item_selected_set(list_it, EINA_TRUE);
1706 if (!elm_list_selected_items_get(li))
1707 elm_list_item_selected_set(def_it, EINA_TRUE);
1708 evas_object_smart_callback_add(li, "selected", _theme_sel, NULL);
1709 evas_object_smart_callback_add(li, "unselected", _theme_sel, NULL);
1710 elm_theme_name_available_list_free(list);
1714 pd = elm_frame_add(win);
1715 elm_object_style_set(pd, "pad_medium");
1716 evas_object_size_hint_weight_set(pd, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1717 evas_object_size_hint_align_set(pd, 0.9, 0.9);
1718 elm_table_pack(tb, pd, 0, 0, 1, 1);
1719 evas_object_show(pd);
1721 /* FIXME: not implemented yet
1722 bt = elm_button_add(win);
1723 evas_object_smart_callback_add(bt, "clicked", _theme_browse, win);
1724 elm_object_text_set(bt, "Browse...");
1725 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1726 evas_object_size_hint_align_set(bt, 0.9, 0.9);
1727 elm_object_content_set(pd, bt);
1728 evas_object_show(bt);
1730 pd = elm_frame_add(win);
1731 elm_object_style_set(pd, "pad_medium");
1732 evas_object_size_hint_weight_set(pd, EVAS_HINT_EXPAND, 0.0);
1733 evas_object_size_hint_align_set(pd, EVAS_HINT_FILL, EVAS_HINT_FILL);
1734 elm_table_pack(tb, pd, 0, 1, 1, 1);
1735 evas_object_show(pd);
1737 fr = elm_frame_add(win);
1738 elm_object_text_set(fr, "Preview");
1739 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1740 evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
1741 elm_object_content_set(pd, fr);
1742 evas_object_show(fr);
1744 sc = elm_scroller_add(win);
1745 elm_scroller_bounce_set(sc, EINA_FALSE, EINA_FALSE);
1746 evas_object_size_hint_weight_set(sc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1747 evas_object_size_hint_align_set(sc, EVAS_HINT_FILL, EVAS_HINT_FILL);
1748 elm_object_content_set(fr, sc);
1749 evas_object_show(sc);
1751 sample = _sample_theme_new(win);
1752 elm_object_content_set(sc, sample);
1753 evas_object_show(sample);
1754 evas_object_data_set(win, "theme_preview", sample);
1756 /////////////////////////////////////////////
1757 sp = elm_separator_add(win);
1758 elm_separator_horizontal_set(sp, EINA_TRUE);
1759 evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, 0.0);
1760 evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5);
1761 elm_table_pack(tb, sp, 0, 2, 1, 1);
1762 evas_object_show(sp);
1764 pd = elm_frame_add(win);
1765 elm_object_style_set(pd, "pad_medium");
1766 evas_object_size_hint_weight_set(pd, EVAS_HINT_EXPAND, 0.0);
1767 evas_object_size_hint_align_set(pd, 0.5, 0.5);
1768 elm_table_pack(tb, pd, 0, 3, 1, 1);
1769 evas_object_show(pd);
1771 bt = elm_button_add(win);
1772 evas_object_smart_callback_add(bt, "clicked", _theme_use, win);
1773 elm_object_text_set(bt, "Use Theme");
1774 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, 0.0);
1775 evas_object_size_hint_align_set(bt, 0.5, 0.5);
1776 elm_object_content_set(pd, bt);
1777 evas_object_show(bt);
1779 evas_object_data_set(win, "themes", tb);
1780 elm_naviframe_item_simple_push(naviframe, tb);
1784 _font_preview_update(Evas_Object *win)
1789 if (!fndata.cur_font)
1792 name = elm_font_fontconfig_name_get(fndata.cur_font, fndata.cur_style);
1793 sz = fndata.cur_size;
1796 sz = (-sz * 10) / 100;
1800 edje_object_text_class_set(evas_object_data_get(win, "font_preview"),
1801 "font_preview", name, sz);
1803 elm_font_fontconfig_name_free(name);
1807 _font_classes_list_sel(void *data EINA_UNUSED,
1811 const Eina_List *f_names_items, *l;
1812 Elm_Text_Class_Data *tc_data;
1813 Evas_Object *f_names_list;
1814 Elm_Object_Item *list_it;
1816 tc_data = elm_object_item_data_get(event_info);
1818 f_names_list = evas_object_data_get(elm_object_top_widget_get(obj),
1820 ELM_LIST_ENABLE(f_names_list);
1822 f_names_items = elm_list_items_get(f_names_list);
1824 EINA_LIST_FOREACH(f_names_items, l, list_it)
1828 s = elm_object_item_text_get(list_it);
1830 if (tc_data->font && !strcmp(s, tc_data->font))
1832 elm_list_item_selected_set(list_it, EINA_TRUE);
1833 elm_list_item_show(list_it);
1840 _font_names_list_sel(void *data EINA_UNUSED,
1844 Evas_Object *style_list, *cls_list, *win;
1845 const char *style, *sel_font;
1846 Elm_Text_Class_Data *tc_data;
1847 Elm_Object_Item *list_it, *fc_list_it;
1848 Elm_Font_Properties *efp;
1851 list_it = event_info;
1852 sel_font = elm_object_item_text_get(list_it);
1854 win = elm_object_top_widget_get(obj);
1855 style_list = evas_object_data_get(win, "font_styles_list");
1856 cls_list = evas_object_data_get(win, "font_classes_list");
1858 fc_list_it = elm_list_selected_item_get(cls_list);
1859 if (!fc_list_it) return; /* should not happen, fonts list disabled in
1862 eina_stringshare_replace(&fndata.cur_font, sel_font);
1864 tc_data = elm_object_item_data_get(fc_list_it);
1865 if (tc_data->font) eina_stringshare_del(tc_data->font);
1866 if (fndata.cur_font) tc_data->font = eina_stringshare_ref(fndata.cur_font);
1868 /* load styles list */
1869 efp = eina_hash_find(fndata.font_hash, sel_font);
1871 ELM_LIST_ENABLE(style_list);
1872 elm_list_clear(style_list);
1874 evas_event_freeze(evas_object_evas_get(style_list));
1879 EINA_LIST_FOREACH(efp->styles, l, style)
1883 i = elm_list_item_append(style_list, style, NULL, NULL,
1884 _font_styles_list_sel, NULL);
1886 if (tc_data->style && (!strcmp(style, tc_data->style)))
1890 elm_list_go(style_list);
1893 evas_event_thaw(evas_object_evas_get(style_list));
1896 elm_list_item_selected_set(list_it, EINA_TRUE);
1898 _font_preview_update(win);
1902 _font_styles_list_sel(void *data EINA_UNUSED,
1906 Evas_Object *fc_list, *fs_list, *win;
1907 Elm_Text_Class_Data *tc_data;
1909 Elm_Object_Item *list_it;
1911 win = elm_object_top_widget_get(obj);
1912 fc_list = evas_object_data_get(win, "font_classes_list");
1913 fs_list = evas_object_data_get(win, "font_sizes_list");
1915 list_it = elm_list_selected_item_get(fc_list);
1916 if (!list_it) return; /* should not happen */
1918 eina_stringshare_replace(&fndata.cur_style,
1919 elm_object_item_text_get(event_info));
1920 ELM_LIST_ENABLE(fs_list);
1922 tc_data = elm_object_item_data_get(list_it);
1923 eina_stringshare_del(tc_data->style);
1924 tc_data->style = eina_stringshare_ref(fndata.cur_style);
1926 evas_event_freeze(evas_object_evas_get(fs_list));
1929 EINA_LIST_FOREACH(elm_list_items_get(fs_list), l, list_it)
1931 Elm_Font_Size_Data *sdata;
1933 sdata = elm_object_item_data_get(list_it);
1934 elm_list_item_selected_set(l->data, EINA_FALSE);
1936 if (tc_data->size == sdata->size)
1938 elm_list_item_selected_set(list_it, EINA_TRUE);
1939 elm_list_item_show(list_it);
1945 evas_event_thaw(evas_object_evas_get(fs_list));
1947 _font_preview_update(win);
1951 _font_sizes_list_sel(void *data EINA_UNUSED,
1952 Evas_Object *obj EINA_UNUSED,
1953 void *event_info EINA_UNUSED)
1955 Elm_Text_Class_Data *tc_data;
1956 Evas_Object *fc_list, *win;
1957 Elm_Font_Size_Data *sd;
1958 Elm_Object_Item *list_it;
1960 win = elm_object_top_widget_get(obj);
1961 fc_list = evas_object_data_get(win, "font_classes_list");
1963 list_it = elm_list_selected_item_get(fc_list);
1964 if (!list_it) return; /* should not happen */
1966 sd = elm_object_item_data_get(event_info);
1967 fndata.cur_size = sd->size;
1969 tc_data = elm_object_item_data_get(list_it);
1970 tc_data->size = fndata.cur_size;
1972 _font_preview_update(win);
1976 _fstyle_list_unselect_cb(void *data EINA_UNUSED,
1978 void *event_info EINA_UNUSED)
1980 Evas_Object *sizes_list, *win;
1982 if (elm_list_selected_item_get(obj)) return;
1984 win = elm_object_top_widget_get(obj);
1986 sizes_list = evas_object_data_get(win, "font_sizes_list");
1987 ELM_LIST_DISABLE(sizes_list);
1991 _fc_list_unselect_cb(void *data EINA_UNUSED,
1993 void *event_info EINA_UNUSED)
1995 Evas_Object *font_names_list, *styles_list, *sizes_list, *win;
1997 if (elm_list_selected_item_get(obj)) return;
1999 win = elm_object_top_widget_get(obj);
2001 font_names_list = evas_object_data_get(win, "font_names_list");
2002 ELM_LIST_DISABLE(font_names_list);
2004 styles_list = evas_object_data_get(win, "font_styles_list");
2005 ELM_LIST_DISABLE(styles_list);
2007 sizes_list = evas_object_data_get(win, "font_sizes_list");
2008 ELM_LIST_DISABLE(sizes_list);
2012 _font_classes_list_load(Evas_Object *li)
2014 Elm_Text_Class_Data *tc_data;
2018 evas = evas_object_evas_get(li);
2019 evas_event_freeze(evas);
2022 EINA_LIST_FOREACH(fndata.text_classes, l, tc_data)
2023 elm_list_item_append(li, tc_data->desc, NULL, NULL,
2024 _font_classes_list_sel, tc_data);
2026 evas_object_smart_callback_add(li, "unselected", _fc_list_unselect_cb,
2031 evas_event_thaw(evas);
2035 _fonts_data_fill(Evas *evas)
2037 const Eina_List *fo_list, *l;
2038 Eina_List *text_classes;
2039 Elm_Text_Class_Data *tc_data;
2040 Elm_Font_Size_Data *sd;
2041 Elm_Font_Overlay *efo;
2042 Eina_List *evas_fonts;
2043 Elm_Text_Class *etc;
2046 evas_fonts = evas_font_available_list(evas);
2047 fndata.font_hash = elm_font_available_hash_add(evas_fonts);
2048 evas_font_available_list_free(evas, evas_fonts);
2050 text_classes = elm_config_text_classes_list_get();
2051 fo_list = elm_config_font_overlay_list_get();
2053 EINA_LIST_FOREACH(text_classes, l, etc)
2055 const Eina_List *ll;
2057 tc_data = calloc(1, sizeof(*tc_data));
2058 if (!tc_data) continue;
2060 tc_data->name = eina_stringshare_add(etc->name);
2061 tc_data->desc = eina_stringshare_add(etc->desc);
2063 EINA_LIST_FOREACH(fo_list, ll, efo)
2065 if (strcmp(tc_data->name, efo->text_class))
2070 Elm_Font_Properties *efp;
2072 efp = elm_font_properties_get(efo->font);
2075 tc_data->font = eina_stringshare_add(efp->name);
2076 /* we're sure we recorded with only 1 style selected */
2077 tc_data->style = eina_stringshare_add(efp->styles->data);
2078 elm_font_properties_free(efp);
2081 tc_data->size = efo->size;
2084 fndata.text_classes = eina_list_append(fndata.text_classes, tc_data);
2087 elm_config_text_classes_list_free(text_classes);
2089 /* FIXME: hinting later */
2090 /* fndata.hinting = e_config->font_hinting; */
2092 sd = calloc(1, sizeof(Elm_Font_Size_Data));
2093 sd->size_str = eina_stringshare_add("Tiny");
2095 fndata.font_scale_list = eina_list_append(fndata.font_scale_list, sd);
2097 sd = calloc(1, sizeof(Elm_Font_Size_Data));
2098 sd->size_str = eina_stringshare_add("Small");
2100 fndata.font_scale_list = eina_list_append(fndata.font_scale_list, sd);
2102 sd = calloc(1, sizeof(Elm_Font_Size_Data));
2103 sd->size_str = eina_stringshare_add("Normal");
2105 fndata.font_scale_list = eina_list_append(fndata.font_scale_list, sd);
2107 sd = calloc(1, sizeof(Elm_Font_Size_Data));
2108 sd->size_str = eina_stringshare_add("Big");
2110 fndata.font_scale_list = eina_list_append(fndata.font_scale_list, sd);
2112 sd = calloc(1, sizeof(Elm_Font_Size_Data));
2113 sd->size_str = eina_stringshare_add("Really Big");
2115 fndata.font_scale_list = eina_list_append(fndata.font_scale_list, sd);
2117 sd = calloc(1, sizeof(Elm_Font_Size_Data));
2118 sd->size_str = eina_stringshare_add("Huge");
2120 fndata.font_scale_list = eina_list_append(fndata.font_scale_list, sd);
2122 for (i = 5; i < 51; i++)
2127 snprintf(str, sizeof(str), "%d pixels", i);
2129 sd = calloc(1, sizeof(Elm_Font_Size_Data));
2130 sd->size_str = eina_stringshare_add(str);
2132 fndata.font_px_list = eina_list_append(fndata.font_px_list, sd);
2137 _font_sort_cb(const void *data1,
2140 if (!data1) return 1;
2141 if (!data2) return -1;
2142 return strcmp(data1, data2);
2146 _font_sizes_list_load(Evas_Object *size_list)
2148 Elm_Font_Size_Data *size_data;
2152 evas = evas_object_evas_get(size_list);
2153 evas_event_freeze(evas);
2156 EINA_LIST_FOREACH(fndata.font_scale_list, l, size_data)
2157 elm_list_item_append(size_list, size_data->size_str, NULL, NULL,
2158 _font_sizes_list_sel, size_data);
2160 EINA_LIST_FOREACH(fndata.font_px_list, l, size_data)
2161 elm_list_item_append(size_list, size_data->size_str, NULL, NULL,
2162 _font_sizes_list_sel, size_data);
2164 elm_list_go(size_list);
2166 evas_event_thaw(evas);
2170 _fnames_list_unselect_cb(void *data EINA_UNUSED,
2172 void *event_info EINA_UNUSED)
2174 Evas_Object *styles_list, *sizes_list, *win;
2176 if (elm_list_selected_item_get(obj)) return;
2178 win = elm_object_top_widget_get(obj);
2180 styles_list = evas_object_data_get(win, "font_styles_list");
2181 ELM_LIST_DISABLE(styles_list);
2183 sizes_list = evas_object_data_get(win, "font_sizes_list");
2184 ELM_LIST_DISABLE(sizes_list);
2188 _font_list_fill(const Eina_Hash *hash EINA_UNUSED,
2189 const void *key EINA_UNUSED,
2193 Elm_Font_Properties *efp;
2199 *flist = eina_list_append(*flist, efp->name);
2205 _font_names_list_load(Evas_Object *flist)
2207 Eina_List *l, *names_list = NULL;
2211 evas = evas_object_evas_get(flist);
2212 evas_event_freeze(evas);
2215 eina_hash_foreach(fndata.font_hash, _font_list_fill, &names_list);
2216 names_list = eina_list_sort(names_list, eina_list_count(names_list),
2219 EINA_LIST_FOREACH(names_list, l, font)
2220 elm_list_item_append(flist, font, NULL, NULL, _font_names_list_sel, NULL);
2222 eina_list_free(names_list);
2224 evas_object_smart_callback_add(flist, "unselected",
2225 _fnames_list_unselect_cb, NULL);
2230 evas_event_thaw(evas);
2234 _status_config_fonts(Evas_Object *win,
2235 Evas_Object *naviframe)
2237 Evas_Object *base, *fr, *li, *rc, *preview, *sp, *pd, *bt, *bx;
2240 _fonts_data_fill(evas_object_evas_get(win));
2242 base = elm_table_add(win);
2243 evas_object_size_hint_weight_set(base, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2244 evas_object_size_hint_align_set(base, EVAS_HINT_FILL, EVAS_HINT_FILL);
2246 /* yeah, dummy rectangles are ugly as hell, but no good way yet of
2248 rc = evas_object_rectangle_add(evas_object_evas_get(win));
2249 evas_object_size_hint_weight_set(rc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2250 evas_object_size_hint_align_set(rc, EVAS_HINT_FILL, EVAS_HINT_FILL);
2251 evas_object_size_hint_min_set(rc, 70, 170);
2252 elm_table_pack(base, rc, 1, 0, 1, 1);
2254 fr = elm_frame_add(win);
2255 elm_object_text_set(fr, "Font Class");
2256 elm_table_pack(base, fr, 0, 0, 1, 2);
2257 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2258 evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
2259 evas_object_show(fr);
2261 /* FIXME: no multiselection for this list, for now */
2262 li = elm_list_add(win);
2263 evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2264 evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL);
2265 elm_object_content_set(fr, li);
2266 evas_object_show(li);
2268 evas_object_data_set(win, "font_classes_list", li);
2269 _font_classes_list_load(li);
2271 fr = elm_frame_add(win);
2272 elm_object_text_set(fr, "Font");
2273 elm_table_pack(base, fr, 1, 0, 1, 2);
2274 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2275 evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
2276 evas_object_show(fr);
2278 li = elm_list_add(win);
2279 evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2280 evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL);
2281 elm_object_content_set(fr, li);
2282 evas_object_show(li);
2284 evas_object_data_set(win, "font_names_list", li);
2285 _font_names_list_load(li);
2286 ELM_LIST_DISABLE(li);
2288 rc = evas_object_rectangle_add(evas_object_evas_get(win));
2289 evas_object_size_hint_weight_set(rc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2290 evas_object_size_hint_align_set(rc, EVAS_HINT_FILL, EVAS_HINT_FILL);
2291 evas_object_size_hint_min_set(rc, 70, 130);
2292 elm_table_pack(base, rc, 1, 2, 1, 1);
2294 fr = elm_frame_add(win);
2295 elm_object_text_set(fr, "Style");
2296 elm_table_pack(base, fr, 0, 2, 1, 1);
2297 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2298 evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
2299 evas_object_show(fr);
2300 ELM_LIST_DISABLE(li);
2302 li = elm_list_add(win);
2303 evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2304 evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL);
2305 elm_object_content_set(fr, li);
2306 evas_object_show(li);
2308 evas_object_data_set(win, "font_styles_list", li);
2309 evas_object_smart_callback_add(li, "unselected", _fstyle_list_unselect_cb,
2312 fr = elm_frame_add(win);
2313 elm_object_text_set(fr, "Size");
2314 elm_table_pack(base, fr, 1, 2, 1, 1);
2315 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2316 evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
2317 evas_object_show(fr);
2319 li = elm_list_add(win);
2320 evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2321 evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL);
2322 elm_object_content_set(fr, li);
2323 evas_object_show(li);
2325 evas_object_data_set(win, "font_sizes_list", li);
2326 _font_sizes_list_load(li);
2327 ELM_LIST_DISABLE(li);
2329 bx = elm_box_add(win);
2330 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2331 evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
2332 elm_table_pack(base, bx, 0, 3, 2, 1);
2333 evas_object_show(bx);
2335 /* FIXME: what to do here? dedicated widget? some new entry API set? */
2336 snprintf(buf, sizeof(buf), "%s/objects/font_preview.edj", elm_app_data_dir_get());
2337 preview = elm_layout_add(win);
2338 elm_layout_file_set(preview, buf, "font_preview");
2339 elm_object_part_text_set(preview, "elm.text", "Preview Text — 我真的会写ä¸æ–‡");
2340 evas_object_size_hint_weight_set(preview, EVAS_HINT_EXPAND, 0.0);
2341 evas_object_size_hint_align_set(preview, EVAS_HINT_FILL, EVAS_HINT_FILL);
2342 evas_object_show(preview);
2344 elm_box_pack_end(bx, preview);
2345 evas_object_data_set(win, "font_preview", elm_layout_edje_get(preview));
2347 /////////////////////////////////////////////
2348 sp = elm_separator_add(win);
2349 elm_separator_horizontal_set(sp, EINA_TRUE);
2350 evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, 0.0);
2351 evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5);
2352 elm_table_pack(base, sp, 0, 4, 2, 1);
2353 evas_object_show(sp);
2355 pd = elm_frame_add(win);
2356 elm_object_style_set(pd, "pad_medium");
2357 evas_object_size_hint_weight_set(pd, EVAS_HINT_EXPAND, 0.0);
2358 evas_object_size_hint_align_set(pd, 0.5, 0.5);
2359 elm_table_pack(base, pd, 0, 5, 2, 1);
2360 evas_object_show(pd);
2362 bx = elm_box_add(win);
2363 elm_box_horizontal_set(bx, EINA_TRUE);
2364 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2365 evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
2366 evas_object_show(bx);
2368 bt = elm_button_add(win);
2369 evas_object_smart_callback_add(bt, "clicked", _font_overlay_set_all, win);
2370 elm_object_text_set(bt, "Set to All");
2371 evas_object_size_hint_weight_set(bt, 0.0, 0.0);
2372 evas_object_size_hint_align_set(bt, 0.5, 0.5);
2373 elm_box_pack_end(bx, bt);
2374 evas_object_show(bt);
2376 bt = elm_button_add(win);
2377 evas_object_smart_callback_add(bt, "clicked", _font_overlay_reset, win);
2378 elm_object_text_set(bt, "Reset");
2379 evas_object_size_hint_weight_set(bt, 0.0, 0.0);
2380 evas_object_size_hint_align_set(bt, 0.5, 0.5);
2381 elm_box_pack_end(bx, bt);
2382 evas_object_show(bt);
2384 bt = elm_button_add(win);
2385 evas_object_smart_callback_add(bt, "clicked", _font_overlay_reset_all, win);
2386 elm_object_text_set(bt, "Reset All");
2387 evas_object_size_hint_weight_set(bt, 0.0, 0.0);
2388 evas_object_size_hint_align_set(bt, 0.5, 0.5);
2389 elm_box_pack_end(bx, bt);
2390 evas_object_show(bt);
2392 bt = elm_button_add(win);
2393 evas_object_smart_callback_add(bt, "clicked", _font_overlay_change, win);
2394 elm_object_text_set(bt, "Apply");
2395 evas_object_size_hint_weight_set(bt, 0.0, 0.0);
2396 evas_object_size_hint_align_set(bt, 0.5, 0.5);
2397 elm_box_pack_end(bx, bt);
2398 evas_object_show(bt);
2400 elm_object_content_set(pd, bx);
2402 evas_object_data_set(win, "fonts", base);
2404 elm_naviframe_item_simple_push(naviframe, base);
2408 _engines_list_item_del_cb(void *data,
2409 Evas_Object *obj EINA_UNUSED,
2410 void *event_info EINA_UNUSED)
2416 _profiles_list_item_del_cb(void *data,
2417 Evas_Object *obj EINA_UNUSED,
2418 void *event_info EINA_UNUSED)
2424 _profiles_list_selected_cb(void *data,
2426 void *event_info EINA_UNUSED)
2428 const char *cur_profile = NULL;
2429 const char *sel_profile, *pdir;
2430 const char *prof_name;
2434 Efreet_Desktop *desk = NULL;
2441 cur_profile = elm_config_profile_get();
2443 pdir = elm_config_profile_dir_get(sel_profile, EINA_TRUE);
2444 if (!pdir) pdir = elm_config_profile_dir_get(sel_profile, EINA_FALSE);
2446 snprintf(buf, sizeof(buf), "%s/profile.desktop", pdir);
2447 desk = efreet_desktop_new(buf);
2448 if ((desk) && (desk->name)) prof_name = desk->name;
2451 if (desk) efreet_desktop_free(desk);
2452 if (pdir) elm_config_profile_dir_free(pdir);
2454 pdir = elm_config_profile_dir_get(sel_profile, EINA_FALSE);
2455 snprintf(buf, sizeof(buf), "%s/profile.desktop", pdir);
2456 desk = efreet_desktop_new(buf);
2457 if ((desk) && (desk->name)) prof_name = desk->name;
2458 else prof_name = cur_profile;
2461 prof_name = cur_profile;
2464 elm_object_disabled_set(evas_object_data_get(obj, "prof_reset_btn"),
2468 elm_object_disabled_set(evas_object_data_get(obj, "prof_del_btn"),
2470 elm_object_disabled_set(evas_object_data_get(obj, "prof_reset_btn"),
2472 elm_object_disabled_set(evas_object_data_get(obj, "prof_use_btn"),
2474 elm_config_profile_dir_free(pdir);
2477 snprintf(buf, sizeof(buf), "<hilight>Selected profile: %s</><br/>",
2479 elm_object_text_set(evas_object_data_get(obj, "prof_name_lbl"), buf);
2481 en = evas_object_data_get(obj, "prof_desc_entry");
2483 if (desk) elm_object_text_set(en, desk->comment);
2486 elm_object_text_set(en, "Unknown");
2489 if (desk) efreet_desktop_free(desk);
2494 _profiles_list_fill(Evas_Object *l_widget,
2497 const char *cur_profile = NULL;
2498 const char *profile;
2499 void *sel_it = NULL;
2505 elm_list_clear(l_widget);
2507 cur_profile = elm_config_profile_get();
2509 EINA_LIST_FOREACH(p_names, l, profile)
2512 Efreet_Desktop *desk = NULL;
2514 const char *label, *ext, *pdir;
2516 Elm_Object_Item *list_it;
2519 pdir = elm_config_profile_dir_get(profile, EINA_TRUE);
2520 if (!pdir) pdir = elm_config_profile_dir_get(profile, EINA_FALSE);
2524 snprintf(buf, sizeof(buf), "%s/profile.desktop", pdir);
2525 desk = efreet_desktop_new(buf);
2526 if ((desk) && (desk->name)) label = desk->name;
2529 if (desk) efreet_desktop_free(desk);
2530 if (pdir) elm_config_profile_dir_free(pdir);
2532 pdir = elm_config_profile_dir_get(profile, EINA_FALSE);
2533 snprintf(buf, sizeof(buf), "%s/profile.desktop", pdir);
2534 desk = efreet_desktop_new(buf);
2535 if ((desk) && (desk->name)) label = desk->name;
2536 else label = profile;
2541 if (pdir) snprintf(buf, sizeof(buf), "%s/icon.edj", pdir);
2543 if ((desk) && (desk->icon) && (pdir))
2544 snprintf(buf, sizeof(buf), "%s/%s", pdir, desk->icon);
2546 ic = elm_icon_add(l_widget);
2547 ext = strrchr(buf, '.');
2550 if (!strcmp(ext, ".edj")) elm_image_file_set(ic, buf, "icon");
2551 else elm_image_file_set(ic, buf, NULL);
2554 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL,
2556 evas_object_show(ic);
2558 list_it = elm_list_item_append(l_widget, label, ic, NULL,
2559 _profiles_list_selected_cb,
2561 elm_object_item_del_cb_set(list_it, _profiles_list_item_del_cb);
2562 if (cur_profile && !strcmp(profile, cur_profile))
2565 elm_config_profile_dir_free(pdir);
2568 if (desk) efreet_desktop_free(desk);
2572 if (sel_it) elm_list_item_selected_set(sel_it, EINA_TRUE);
2573 elm_list_go(l_widget);
2577 _profiles_list_unselect_cb(void *data EINA_UNUSED,
2579 void *event_info EINA_UNUSED)
2581 if (elm_list_selected_item_get(obj)) return;
2582 elm_object_disabled_set(evas_object_data_get(obj, "prof_del_btn"),
2584 elm_object_disabled_set(evas_object_data_get(obj, "prof_reset_btn"),
2586 elm_object_disabled_set(evas_object_data_get(obj, "prof_use_btn"),
2591 _status_config_profiles(Evas_Object *win,
2592 Evas_Object *naviframe)
2594 Evas_Object *li, *bx, *fr_bx1, *fr_bx2, *btn_bx, *fr, *lb, *en, *sp, *pd,
2599 bx = elm_box_add(win);
2600 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2601 evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
2603 fr_bx1 = elm_box_add(win);
2604 evas_object_size_hint_weight_set(fr_bx1, EVAS_HINT_EXPAND,
2606 evas_object_size_hint_align_set(fr_bx1, EVAS_HINT_FILL, EVAS_HINT_FILL);
2607 elm_box_homogeneous_set(fr_bx1, EINA_TRUE);
2608 evas_object_show(fr_bx1);
2610 fr_bx2 = elm_box_add(win);
2611 evas_object_size_hint_weight_set(fr_bx2, EVAS_HINT_EXPAND,
2613 evas_object_size_hint_align_set(fr_bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
2614 evas_object_show(fr_bx2);
2616 fr = elm_frame_add(win);
2617 elm_object_text_set(fr, "Available Profiles");
2618 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2619 evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
2620 elm_object_content_set(fr, fr_bx1);
2621 elm_box_pack_end(bx, fr);
2622 evas_object_show(fr);
2624 li = elm_list_add(win);
2625 evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2626 evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL);
2627 evas_object_smart_callback_add(li, "unselected", _profiles_list_unselect_cb,
2630 profs = elm_config_profile_list_get();
2632 evas_object_show(li);
2633 elm_box_pack_end(fr_bx2, li);
2635 lb = elm_label_add(win);
2636 evas_object_size_hint_weight_set(lb, EVAS_HINT_EXPAND, 0.0);
2637 evas_object_size_hint_align_set(lb, EVAS_HINT_FILL, 0.5);
2639 evas_object_show(lb);
2641 en = elm_entry_add(win);
2642 elm_entry_scrollable_set(en, EINA_TRUE);
2643 elm_entry_editable_set(en, EINA_FALSE);
2644 evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2645 evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
2646 evas_object_show(en);
2648 evas_object_data_set(li, "prof_name_lbl", lb);
2649 evas_object_data_set(li, "prof_desc_entry", en);
2651 elm_box_pack_end(fr_bx2, lb);
2652 elm_box_pack_end(fr_bx1, fr_bx2);
2653 elm_box_pack_end(fr_bx1, en);
2655 /////////////////////////////////////////////
2656 sp = elm_separator_add(win);
2657 elm_separator_horizontal_set(sp, EINA_TRUE);
2658 evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, 0.0);
2659 evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5);
2660 elm_box_pack_end(bx, sp);
2661 evas_object_show(sp);
2663 pd = elm_frame_add(win);
2664 elm_object_style_set(pd, "pad_medium");
2665 evas_object_size_hint_weight_set(pd, 0.0, 0.0);
2666 evas_object_size_hint_align_set(pd, 0.5, 0.5);
2667 elm_box_pack_end(bx, pd);
2668 evas_object_show(pd);
2670 btn_bx = elm_box_add(win);
2671 elm_box_horizontal_set(btn_bx, EINA_TRUE);
2672 evas_object_size_hint_weight_set(btn_bx, EVAS_HINT_EXPAND,
2674 evas_object_size_hint_align_set(btn_bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
2675 evas_object_show(btn_bx);
2677 bt = elm_button_add(win);
2678 evas_object_smart_callback_add(bt, "clicked", _profile_use, li);
2679 elm_object_text_set(bt, "Use");
2680 evas_object_size_hint_weight_set(bt, 0.0, 0.0);
2681 evas_object_size_hint_align_set(bt, 0.5, 0.5);
2682 elm_box_pack_end(btn_bx, bt);
2683 evas_object_show(bt);
2685 evas_object_data_set(li, "prof_use_btn", bt);
2687 bt = elm_button_add(win);
2688 evas_object_smart_callback_add(bt, "clicked", _btn_todo, NULL); /* TODO */
2689 elm_object_text_set(bt, "Delete");
2690 evas_object_size_hint_weight_set(bt, 0.0, 0.0);
2691 evas_object_size_hint_align_set(bt, 0.5, 0.5);
2692 elm_box_pack_end(btn_bx, bt);
2693 evas_object_show(bt);
2695 evas_object_data_set(li, "prof_del_btn", bt);
2697 bt = elm_button_add(win);
2698 evas_object_smart_callback_add(bt, "clicked", _profile_reset, li);
2699 elm_object_text_set(bt, "Reset");
2700 evas_object_size_hint_weight_set(bt, 0.0, 0.0);
2701 evas_object_size_hint_align_set(bt, 0.5, 0.5);
2702 elm_box_pack_end(btn_bx, bt);
2703 evas_object_show(bt);
2705 evas_object_data_set(li, "prof_reset_btn", bt);
2707 bt = elm_button_add(win);
2708 evas_object_smart_callback_add(bt, "clicked", _btn_todo, NULL); /* TODO */
2709 elm_object_text_set(bt, "Add new");
2710 evas_object_size_hint_weight_set(bt, 0.0, 0.0);
2711 evas_object_size_hint_align_set(bt, 0.5, 0.5);
2712 elm_box_pack_end(btn_bx, bt);
2713 evas_object_show(bt);
2715 elm_object_content_set(pd, btn_bx);
2717 evas = evas_object_evas_get(li);
2718 evas_event_freeze(evas);
2721 _profiles_list_fill(li, profs);
2723 elm_config_profile_list_free(profs);
2726 evas_event_thaw(evas);
2728 evas_object_data_set(win, "profiles", bx);
2729 elm_naviframe_item_simple_push(naviframe, bx);
2733 _status_config_scrolling_bounce(Evas_Object *win, Evas_Object *box)
2735 Evas_Object *fr, *bx, *ck, *pd, *lb, *sl;
2737 fr = elm_frame_add(box);
2738 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, 0.0);
2739 evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
2740 elm_object_text_set(fr, "Bounce");
2741 elm_box_pack_end(box, fr);
2742 evas_object_show(fr);
2744 bx = elm_box_add(fr);
2745 elm_object_content_set(fr, bx);
2746 evas_object_show(bx);
2748 /* Enable Scroll Bounce */
2749 ck = elm_check_add(bx);
2750 elm_object_tooltip_text_set(ck, "Set whether scrollers should bounce<br/>"
2751 "when they reach their viewport's edge<br/>"
2753 elm_object_text_set(ck, "Enable scroll bounce");
2754 evas_object_data_set(win, "scroll_bounce_check", ck);
2755 evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, 0.0);
2756 evas_object_size_hint_align_set(ck, EVAS_HINT_FILL, 0.5);
2757 elm_check_state_set(ck, elm_config_scroll_bounce_enabled_get());
2758 elm_box_pack_end(bx, ck);
2759 evas_object_show(ck);
2761 evas_object_smart_callback_add(ck, "changed", sb_change, NULL);
2763 /* Scroll bounce friction */
2764 LABEL_FRAME_ADD("<hilight>Scroll bounce friction</>");
2766 sl = elm_slider_add(bx);
2767 elm_object_tooltip_text_set(sl, "This is the amount of inertia a <br/>"
2768 "scroller will impose at bounce animations");
2769 evas_object_data_set(win, "bounce_friction_slider", sl);
2770 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
2771 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
2772 elm_slider_span_size_set(sl, 120);
2773 elm_slider_unit_format_set(sl, "%1.2f");
2774 elm_slider_indicator_format_set(sl, "%1.2f");
2775 elm_slider_min_max_set(sl, 0.0, 4.0);
2776 elm_slider_value_set(sl, elm_config_scroll_bounce_friction_get());
2777 elm_box_pack_end(bx, sl);
2778 evas_object_show(sl);
2780 evas_object_smart_callback_add(sl, "changed", bf_round, NULL);
2781 evas_object_smart_callback_add(sl, "delay,changed", bf_change, NULL);
2785 _status_config_scrolling_acceleration(Evas_Object *win, Evas_Object *box)
2787 Evas_Object *fr, *bx, *sl, *pd, *lb;
2789 fr = elm_frame_add(box);
2790 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, 0.0);
2791 evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
2792 elm_object_text_set(fr, "Acceleration");
2793 elm_box_pack_end(box, fr);
2794 evas_object_show(fr);
2796 bx = elm_box_add(fr);
2797 elm_object_content_set(fr, bx);
2798 evas_object_show(bx);
2800 /* Thumb scroll acceleration threshold */
2801 LABEL_FRAME_ADD("<hilight>Thumb scroll acceleration threshold</>");
2803 sl = elm_slider_add(bx);
2804 elm_object_tooltip_text_set(sl, "This is the minimum speed of mouse <br/>"
2805 "cursor movement which will accelerate<br/>"
2806 "scrolling velocity after a<br/>"
2807 "mouse up event (pixels/second)");
2808 evas_object_data_set(win, "ts_acceleration_threshold_slider", sl);
2809 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
2810 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
2811 elm_slider_span_size_set(sl, 120);
2812 elm_slider_unit_format_set(sl, "%1.0f pixels/s");
2813 elm_slider_indicator_format_set(sl, "%1.0f");
2814 elm_slider_min_max_set(sl, 10.0, 5000.0);
2815 elm_slider_value_set(sl, elm_config_scroll_thumbscroll_acceleration_threshold_get());
2816 elm_box_pack_end(bx, sl);
2817 evas_object_show(sl);
2819 evas_object_smart_callback_add(sl, "changed", tsat_round, NULL);
2820 evas_object_smart_callback_add(sl, "delay,changed", tsat_change, NULL);
2822 /* Thumb scroll acceleration time limit */
2823 LABEL_FRAME_ADD("<hilight>Thumb scroll acceleration time limit</>");
2825 sl = elm_slider_add(bx);
2826 elm_object_tooltip_text_set(sl, "This is the time limit for<br/>"
2827 "accelerating velocity<br/>");
2828 evas_object_data_set(win, "ts_acceleration_time_limit_slider", sl);
2829 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
2830 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
2831 elm_slider_span_size_set(sl, 120);
2832 elm_slider_unit_format_set(sl, "%1.1f");
2833 elm_slider_indicator_format_set(sl, "%1.1f");
2834 elm_slider_min_max_set(sl, 0.0, 15.0);
2835 elm_slider_value_set(sl, elm_config_scroll_thumbscroll_acceleration_time_limit_get());
2836 elm_box_pack_end(bx, sl);
2837 evas_object_show(sl);
2839 evas_object_smart_callback_add(sl, "changed", tsatl_round, NULL);
2840 evas_object_smart_callback_add(sl, "delay,changed", tsatl_change, NULL);
2842 /* Thumb scroll acceleration weight */
2843 LABEL_FRAME_ADD("<hilight>Thumb scroll acceleration weight</>");
2845 sl = elm_slider_add(bx);
2846 elm_object_tooltip_text_set(sl, "This is the weight for acceleration");
2847 evas_object_data_set(win, "ts_acceleration_weight_slider", sl);
2848 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
2849 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
2850 elm_slider_span_size_set(sl, 120);
2851 elm_slider_unit_format_set(sl, "%1.1f");
2852 elm_slider_indicator_format_set(sl, "%1.1f");
2853 elm_slider_min_max_set(sl, 1.0, 10.0);
2854 elm_slider_value_set(sl, elm_config_scroll_thumbscroll_acceleration_weight_get());
2855 elm_box_pack_end(bx, sl);
2856 evas_object_show(sl);
2858 evas_object_smart_callback_add(sl, "changed", tsaw_round, NULL);
2859 evas_object_smart_callback_add(sl, "delay,changed", tsaw_change, NULL);
2863 _status_config_scrolling(Evas_Object *win,
2864 Evas_Object *naviframe)
2866 Evas_Object *lb, *pd, *bx, *sl, *sp, *ck, *sc;
2868 bx = elm_box_add(win);
2869 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, 0.0);
2870 evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, 0.5);
2872 sc = elm_scroller_add(win);
2873 evas_object_size_hint_weight_set(sc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2874 evas_object_size_hint_align_set(sc, EVAS_HINT_FILL, EVAS_HINT_FILL);
2875 elm_scroller_bounce_set(sc, EINA_FALSE, EINA_TRUE);
2876 evas_object_show(sc);
2877 elm_object_content_set(sc, bx);
2880 _status_config_scrolling_bounce(win, bx);
2883 _status_config_scrolling_acceleration(win, bx);
2885 /* Enable thumb scroll */
2886 ck = elm_check_add(win);
2887 elm_object_tooltip_text_set(ck, "Set whether scrollers should be<br/>"
2888 "draggable from any point in their views");
2889 elm_object_text_set(ck, "Enable thumb scroll");
2890 evas_object_data_set(win, "thumbscroll_check", ck);
2891 evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, 0.0);
2892 evas_object_size_hint_align_set(ck, EVAS_HINT_FILL, 0.5);
2893 elm_check_state_set(ck, elm_config_scroll_thumbscroll_enabled_get());
2894 elm_box_pack_end(bx, ck);
2895 evas_object_show(ck);
2897 evas_object_smart_callback_add(ck, "changed", ts_change, NULL);
2899 /* Thumb scroll threadhold */
2900 LABEL_FRAME_ADD("<hilight>Thumb scroll threshold</>");
2902 sl = elm_slider_add(win);
2903 elm_object_tooltip_text_set(sl, "This is the number of pixels one should<br/>"
2904 "travel while dragging a scroller's view<br/>"
2905 "to actually trigger scrolling");
2906 evas_object_data_set(win, "ts_threshold_slider", sl);
2907 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
2908 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
2909 elm_slider_span_size_set(sl, 120);
2910 elm_slider_unit_format_set(sl, "%1.0f pixels");
2911 elm_slider_indicator_format_set(sl, "%1.0f");
2912 elm_slider_min_max_set(sl, 8.0, 50.0);
2913 elm_slider_value_set(sl, elm_config_scroll_thumbscroll_threshold_get());
2914 elm_box_pack_end(bx, sl);
2915 evas_object_show(sl);
2917 evas_object_smart_callback_add(sl, "changed", tst_round, NULL);
2918 evas_object_smart_callback_add(sl, "delay,changed", tst_change, NULL);
2920 /* Thumb scroll hold threashold */
2921 LABEL_FRAME_ADD("<hilight>Thumb scroll hold threshold</>");
2923 sl = elm_slider_add(win);
2924 elm_object_tooltip_text_set(sl, "This is the number of pixels the range<br/>"
2925 "which can be scrolled, while the scroller<br/>"
2927 evas_object_data_set(win, "ts_hold_threshold_slider", sl);
2928 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
2929 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
2930 elm_slider_span_size_set(sl, 120);
2931 elm_slider_unit_format_set(sl, "%1.0f pixels");
2932 elm_slider_indicator_format_set(sl, "%1.0f");
2933 elm_slider_min_max_set(sl, 4.0, 500.0);
2934 elm_slider_value_set(sl, elm_config_scroll_thumbscroll_hold_threshold_get());
2935 elm_box_pack_end(bx, sl);
2936 evas_object_show(sl);
2938 evas_object_smart_callback_add(sl, "changed", tsht_round, NULL);
2939 evas_object_smart_callback_add(sl, "delay,changed", tsht_change, NULL);
2941 /* Thumb scroll momentum threshold */
2942 LABEL_FRAME_ADD("<hilight>Thumb scroll momentum threshold</>");
2944 sl = elm_slider_add(win);
2945 elm_object_tooltip_text_set(sl, "This is the minimum speed of mouse <br/>"
2946 "cursor movement which will trigger<br/>"
2947 "list self scrolling animation after a<br/>"
2948 "mouse up event (pixels/second)");
2949 evas_object_data_set(win, "ts_momentum_threshold_slider", sl);
2950 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
2951 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
2952 elm_slider_span_size_set(sl, 120);
2953 elm_slider_unit_format_set(sl, "%1.0f pixels/s");
2954 elm_slider_indicator_format_set(sl, "%1.0f");
2955 elm_slider_min_max_set(sl, 10.0, 200.0);
2956 elm_slider_value_set(sl, elm_config_scroll_thumbscroll_momentum_threshold_get());
2957 elm_box_pack_end(bx, sl);
2958 evas_object_show(sl);
2960 evas_object_smart_callback_add(sl, "changed", tsmt_round, NULL);
2961 evas_object_smart_callback_add(sl, "delay,changed", tsmt_change,
2964 /* Thumb scroll flick distance tolerance */
2965 LABEL_FRAME_ADD("<hilight>Thumb scroll flick distance tolerance</>");
2967 sl = elm_slider_add(win);
2968 elm_object_tooltip_text_set(sl, "This is the number of pixels the maximum<br/>"
2969 "distance which can be flicked. If it is<br/>"
2970 "flicked more than this, the flick distance<br/>"
2971 "is same with maximum distance");
2972 evas_object_data_set(win, "ts_flick_distance_tolerance_slider", sl);
2973 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
2974 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
2975 elm_slider_span_size_set(sl, 120);
2976 elm_slider_unit_format_set(sl, "%1.0f pixels");
2977 elm_slider_indicator_format_set(sl, "%1.0f");
2978 elm_slider_min_max_set(sl, 100.0, 3000.0);
2979 elm_slider_value_set(sl, elm_config_scroll_thumbscroll_flick_distance_tolerance_get());
2980 elm_box_pack_end(bx, sl);
2981 evas_object_show(sl);
2983 evas_object_smart_callback_add(sl, "changed", tsfdt_round, NULL);
2984 evas_object_smart_callback_add(sl, "delay,changed", tsfdt_change, NULL);
2986 /* Thumb scroll friction */
2987 LABEL_FRAME_ADD("<hilight>Thumb scroll friction</>");
2989 sl = elm_slider_add(win);
2990 elm_object_tooltip_text_set(sl, "This is the amount of inertia a<br/>"
2991 "scroller will impose at self scrolling<br/>"
2993 evas_object_data_set(win, "ts_friction_slider", sl);
2994 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
2995 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
2996 elm_slider_span_size_set(sl, 120);
2997 elm_slider_unit_format_set(sl, "%1.1f");
2998 elm_slider_indicator_format_set(sl, "%1.1f");
2999 elm_slider_min_max_set(sl, 0.1, 10.0);
3000 elm_slider_value_set(sl, elm_config_scroll_thumbscroll_friction_get());
3001 elm_box_pack_end(bx, sl);
3002 evas_object_show(sl);
3004 evas_object_smart_callback_add(sl, "changed", tsf_round, NULL);
3005 evas_object_smart_callback_add(sl, "delay,changed", tsf_change, NULL);
3007 /* Thumb scroll min friction */
3008 LABEL_FRAME_ADD("<hilight>Thumb scroll min friction</>");
3010 sl = elm_slider_add(win);
3011 elm_object_tooltip_text_set(sl, "This is the min amount of inertia a<br/>"
3012 "scroller will impose at self scrolling<br/>"
3014 evas_object_data_set(win, "ts_min_friction_slider", sl);
3015 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
3016 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
3017 elm_slider_span_size_set(sl, 120);
3018 elm_slider_unit_format_set(sl, "%1.1f");
3019 elm_slider_indicator_format_set(sl, "%1.1f");
3020 elm_slider_min_max_set(sl, 0.1, 10.0);
3021 elm_slider_value_set(sl, elm_config_scroll_thumbscroll_min_friction_get());
3022 elm_box_pack_end(bx, sl);
3023 evas_object_show(sl);
3025 evas_object_smart_callback_add(sl, "changed", tsmf_round, NULL);
3026 evas_object_smart_callback_add(sl, "delay,changed", tsmf_change, NULL);
3028 /* Thumb scroll friction standard */
3029 LABEL_FRAME_ADD("<hilight>Thumb scroll friction standard</>");
3031 sl = elm_slider_add(win);
3032 elm_object_tooltip_text_set(sl, "This is the standard velocity of the scroller."
3033 "<br/>The scroll animation time is same<br/>"
3034 "with thumbscroll friction, if the velocity"
3035 "<br/>is same with standard velocity.");
3036 evas_object_data_set(win, "ts_friction_standard_slider", sl);
3037 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
3038 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
3039 elm_slider_span_size_set(sl, 120);
3040 elm_slider_unit_format_set(sl, "%1.0f pixel/s");
3041 elm_slider_indicator_format_set(sl, "%1.0f");
3042 elm_slider_min_max_set(sl, 10.0, 5000.0);
3043 elm_slider_value_set(sl, elm_config_scroll_thumbscroll_friction_standard_get());
3044 elm_box_pack_end(bx, sl);
3045 evas_object_show(sl);
3047 evas_object_smart_callback_add(sl, "changed", tsfs_round, NULL);
3048 evas_object_smart_callback_add(sl, "delay,changed", tsfs_change, NULL);
3050 /* Thumb scroll border friction */
3051 LABEL_FRAME_ADD("<hilight>Thumb scroll border friction</>");
3053 sl = elm_slider_add(win);
3054 elm_object_tooltip_text_set(sl, "This is the amount of lag between your<br/>"
3055 "actual mouse cursor dragging movement<br/>"
3056 "and a scroller's view movement itself,<br/>"
3057 "while pushing it into bounce state<br/>"
3059 evas_object_data_set(win, "ts_border_friction_slider", sl);
3060 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
3061 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
3062 elm_slider_span_size_set(sl, 120);
3063 elm_slider_unit_format_set(sl, "%1.2f");
3064 elm_slider_indicator_format_set(sl, "%1.2f");
3065 elm_slider_min_max_set(sl, 0.0, 1.0);
3066 elm_slider_value_set(sl, elm_config_scroll_thumbscroll_border_friction_get());
3067 elm_box_pack_end(bx, sl);
3068 evas_object_show(sl);
3070 evas_object_smart_callback_add(sl, "changed", tsbf_round, NULL);
3071 evas_object_smart_callback_add(sl, "delay,changed", tsbf_change, NULL);
3073 /* Thumb scroll sensitivity friction */
3074 LABEL_FRAME_ADD("<hilight>Thumb scroll sensitivity friction</>");
3076 sl = elm_slider_add(win);
3077 elm_object_tooltip_text_set(sl, "This is the sensitivity amount which<br/>"
3078 "is be multiplied by the length of mouse<br/>"
3080 evas_object_data_set(win, "ts_sensitivity_friction_slider", sl);
3081 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
3082 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
3083 elm_slider_span_size_set(sl, 120);
3084 elm_slider_unit_format_set(sl, "%1.2f");
3085 elm_slider_indicator_format_set(sl, "%1.2f");
3086 elm_slider_min_max_set(sl, 0.1, 1.0);
3087 elm_slider_value_set(sl, elm_config_scroll_thumbscroll_sensitivity_friction_get());
3088 elm_box_pack_end(bx, sl);
3089 evas_object_show(sl);
3091 evas_object_smart_callback_add(sl, "changed", tssf_round, NULL);
3092 evas_object_smart_callback_add(sl, "delay,changed", tssf_change, NULL);
3094 sp = elm_separator_add(win);
3095 elm_separator_horizontal_set(sp, EINA_TRUE);
3096 evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, 0.0);
3097 evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5);
3098 elm_box_pack_end(bx, sp);
3099 evas_object_show(sp);
3101 /* Page scroll friction */
3102 LABEL_FRAME_ADD("<hilight>Page scroll friction</>");
3104 sl = elm_slider_add(win);
3105 elm_object_tooltip_text_set(sl, "This is the amount of inertia a<br/>"
3106 "paged scroller will impose at<br/>"
3107 "page fitting animations");
3108 evas_object_data_set(win, "page_scroll_friction_slider", sl);
3109 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
3110 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
3111 elm_slider_span_size_set(sl, 120);
3112 elm_slider_unit_format_set(sl, "%1.1f");
3113 elm_slider_indicator_format_set(sl, "%1.1f");
3114 elm_slider_min_max_set(sl, 0.0, 5.0);
3115 elm_slider_value_set(sl, elm_config_scroll_page_scroll_friction_get());
3116 elm_box_pack_end(bx, sl);
3117 evas_object_show(sl);
3119 evas_object_smart_callback_add(sl, "changed", ps_round, NULL);
3120 evas_object_smart_callback_add(sl, "delay,changed", ps_change, NULL);
3122 /* Bring in scroll friction */
3123 LABEL_FRAME_ADD("<hilight>Bring in scroll friction</>");
3125 sl = elm_slider_add(win);
3126 elm_object_tooltip_text_set(sl, "This is the amount of inertia a<br/>"
3127 "scroller will impose at region bring<br/>"
3129 evas_object_data_set(win, "bring_in_scroll_friction_slider", sl);
3130 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
3131 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
3132 elm_slider_span_size_set(sl, 120);
3133 elm_slider_unit_format_set(sl, "%1.1f");
3134 elm_slider_indicator_format_set(sl, "%1.1f");
3135 elm_slider_min_max_set(sl, 0.0, 5.0);
3136 elm_slider_value_set(sl, elm_config_scroll_bring_in_scroll_friction_get());
3137 elm_box_pack_end(bx, sl);
3138 evas_object_show(sl);
3140 evas_object_smart_callback_add(sl, "changed", bis_round, NULL);
3141 evas_object_smart_callback_add(sl, "delay,changed", bis_change, NULL);
3143 /* Zoom scroll friction */
3144 LABEL_FRAME_ADD("<hilight>Zoom scroll friction</>");
3146 sl = elm_slider_add(win);
3147 elm_object_tooltip_text_set(sl, "This is the amount of inertia<br/>"
3148 "scrollers will impose at animations<br/>"
3149 "triggered by Elementary widgets'<br/>"
3151 evas_object_data_set(win, "zoom_scroll_friction_slider", sl);
3152 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
3153 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
3154 elm_slider_span_size_set(sl, 120);
3155 elm_slider_unit_format_set(sl, "%1.1f");
3156 elm_slider_indicator_format_set(sl, "%1.1f");
3157 elm_slider_min_max_set(sl, 0.0, 5.0);
3158 elm_slider_value_set(sl, elm_config_scroll_zoom_friction_get());
3159 elm_box_pack_end(bx, sl);
3160 evas_object_show(sl);
3162 evas_object_smart_callback_add(sl, "changed", zf_round, NULL);
3163 evas_object_smart_callback_add(sl, "delay,changed", zf_change, NULL);
3165 evas_object_data_set(win, "scrolling", sc);
3167 elm_naviframe_item_simple_push(naviframe, sc);
3171 _engine_name_prettify(const char *engine)
3175 ret = strdup(engine);
3178 while ((ptr = strpbrk(ret, "_")))
3186 /* FIXME! ideally, we would trim elm_config.c's _elm_engines list at
3187 build time, making a getter for is as in ecore-evas. */
3189 _elm_engine_supported(const char *engine)
3191 const char *engines[] = {
3200 "software_16_wince_gdi",
3214 for (i = 0; engines[i]; i++)
3216 #define ENGINE_COMPARE(name) (!strcmp(engines[i], name))
3217 if (ENGINE_COMPARE(engine))
3219 #undef ENGINE_COMPARE
3226 _engines_list_fill(Evas_Object *l_widget,
3229 const char *engine, *cur_engine;
3230 void *sel_it = NULL;
3236 cur_engine = elm_config_engine_get();
3238 EINA_LIST_FOREACH(e_names, l, engine)
3241 Elm_Object_Item *list_it;
3243 if (!_elm_engine_supported(engine))
3246 label = _engine_name_prettify(engine);
3248 list_it = elm_list_item_append(l_widget, label, NULL, NULL, NULL,
3250 elm_object_item_del_cb_set(list_it, _engines_list_item_del_cb);
3251 free((void *)label);
3253 if (!strcmp(cur_engine, engine))
3257 if (sel_it) elm_list_item_selected_set(sel_it, EINA_TRUE);
3258 elm_list_go(l_widget);
3262 _status_config_rendering(Evas_Object *win,
3263 Evas_Object *naviframe)
3265 Evas_Object *li, *bx, *fr, *sp, *pd, *bt;
3268 bx = elm_box_add(win);
3269 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
3270 evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
3272 fr = elm_frame_add(win);
3273 elm_object_text_set(fr, "Available Engines");
3274 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
3275 evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
3276 elm_box_pack_end(bx, fr);
3277 evas_object_show(fr);
3279 li = elm_list_add(win);
3280 elm_object_content_set(fr, li);
3281 evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
3282 evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL);
3284 engines = ecore_evas_engines_get();
3285 _engines_list_fill(li, engines);
3286 ecore_evas_engines_free(engines);
3288 evas_object_show(li);
3289 evas_object_data_set(win, "engines_list", li);
3291 /////////////////////////////////////////////
3292 sp = elm_separator_add(win);
3293 elm_separator_horizontal_set(sp, EINA_TRUE);
3294 evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, 0.0);
3295 evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5);
3296 elm_box_pack_end(bx, sp);
3297 evas_object_show(sp);
3299 pd = elm_frame_add(win);
3300 elm_object_style_set(pd, "pad_medium");
3301 evas_object_size_hint_weight_set(pd, 0.0, 0.0);
3302 evas_object_size_hint_align_set(pd, 0.5, 0.5);
3303 elm_box_pack_end(bx, pd);
3304 evas_object_show(pd);
3306 bt = elm_button_add(win);
3307 evas_object_smart_callback_add(bt, "clicked", _engine_use, li);
3308 elm_object_text_set(bt, "Use Engine");
3309 evas_object_size_hint_weight_set(bt, 0.0, 0.0);
3310 evas_object_size_hint_align_set(bt, 0.5, 0.5);
3311 elm_object_content_set(pd, bt);
3312 evas_object_show(bt);
3314 evas_object_data_set(win, "rendering", bx);
3315 elm_naviframe_item_simple_push(naviframe, bx);
3319 _status_config_caches(Evas_Object *win,
3320 Evas_Object *naviframe)
3322 Evas_Object *lb, *pd, *bx, *sl, *sp, *ck;
3324 bx = elm_box_add(win);
3325 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, 0.0);
3326 evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, 0.5);
3328 LABEL_FRAME_ADD("<hilight>Cache Flush Interval (8 ticks per second)</>");
3330 sl = elm_slider_add(win);
3331 evas_object_data_set(win, "cache_flush_interval_slider", sl);
3332 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
3333 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
3334 elm_slider_span_size_set(sl, 120);
3335 elm_slider_unit_format_set(sl, "%1.0f ticks");
3336 elm_slider_indicator_format_set(sl, "%1.0f");
3337 elm_slider_min_max_set(sl, 8.0, 4096.0);
3338 elm_slider_value_set(sl, elm_config_cache_flush_interval_get());
3339 elm_object_disabled_set(sl, !elm_config_cache_flush_enabled_get());
3341 ck = elm_check_add(win);
3342 evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, 0.0);
3343 evas_object_size_hint_align_set(ck, EVAS_HINT_FILL, 0.5);
3344 elm_object_text_set(ck, "Enable Flushing");
3345 elm_check_state_set(ck, elm_config_cache_flush_enabled_get());
3346 evas_object_smart_callback_add(ck, "changed", cf_enable, sl);
3347 elm_box_pack_end(bx, ck);
3348 evas_object_show(ck);
3350 elm_box_pack_end(bx, sl);
3351 evas_object_show(sl);
3353 evas_object_smart_callback_add(sl, "changed", cf_round, NULL);
3354 evas_object_smart_callback_add(sl, "delay,changed", cf_change, NULL);
3356 sp = elm_separator_add(win);
3357 elm_separator_horizontal_set(sp, EINA_TRUE);
3358 evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, 0.0);
3359 evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5);
3360 elm_box_pack_end(bx, sp);
3361 evas_object_show(sp);
3363 LABEL_FRAME_ADD("<hilight>Font Cache Size</>");
3365 sl = elm_slider_add(win);
3366 evas_object_data_set(win, "font_cache_slider", sl);
3367 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
3368 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
3369 elm_slider_span_size_set(sl, 120);
3370 elm_slider_unit_format_set(sl, "%1.1f MB");
3371 elm_slider_indicator_format_set(sl, "%1.1f");
3372 elm_slider_min_max_set(sl, 0.0, 4.0);
3373 elm_slider_value_set(sl, (double)elm_config_cache_font_cache_size_get() / 1024.0);
3374 elm_box_pack_end(bx, sl);
3375 evas_object_show(sl);
3377 evas_object_smart_callback_add(sl, "changed", fc_round, NULL);
3378 evas_object_smart_callback_add(sl, "delay,changed", fc_change, NULL);
3380 sp = elm_separator_add(win);
3381 elm_separator_horizontal_set(sp, EINA_TRUE);
3382 evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, 0.0);
3383 evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5);
3384 elm_box_pack_end(bx, sp);
3385 evas_object_show(sp);
3387 LABEL_FRAME_ADD("<hilight>Image Cache Size</>");
3389 sl = elm_slider_add(win);
3390 evas_object_data_set(win, "image_cache_slider", sl);
3391 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
3392 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
3393 elm_slider_span_size_set(sl, 120);
3394 elm_slider_unit_format_set(sl, "%1.0f MB");
3395 elm_slider_indicator_format_set(sl, "%1.0f");
3396 elm_slider_min_max_set(sl, 0, 32);
3397 elm_slider_value_set(sl, (double)elm_config_cache_image_cache_size_get() / 1024.0);
3398 elm_box_pack_end(bx, sl);
3399 evas_object_show(sl);
3401 evas_object_smart_callback_add(sl, "changed", ic_round, NULL);
3402 evas_object_smart_callback_add(sl, "delay,changed", ic_change, NULL);
3404 sp = elm_separator_add(win);
3405 elm_separator_horizontal_set(sp, EINA_TRUE);
3406 evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, 0.0);
3407 evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5);
3408 elm_box_pack_end(bx, sp);
3409 evas_object_show(sp);
3411 LABEL_FRAME_ADD("<hilight>Number of Edje Files to Cache</>");
3413 sl = elm_slider_add(win);
3414 evas_object_data_set(win, "edje_file_cache_slider", sl);
3415 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
3416 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
3417 elm_slider_span_size_set(sl, 120);
3418 elm_slider_unit_format_set(sl, "%1.0f files");
3419 elm_slider_indicator_format_set(sl, "%1.0f");
3420 elm_slider_min_max_set(sl, 0, 32);
3421 elm_slider_value_set(sl, elm_config_cache_edje_file_cache_size_get());
3422 elm_box_pack_end(bx, sl);
3423 evas_object_show(sl);
3425 evas_object_smart_callback_add(sl, "changed", efc_round, NULL);
3426 evas_object_smart_callback_add(sl, "delay,changed", efc_change, NULL);
3428 sp = elm_separator_add(win);
3429 elm_separator_horizontal_set(sp, EINA_TRUE);
3430 evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, 0.0);
3431 evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5);
3432 elm_box_pack_end(bx, sp);
3433 evas_object_show(sp);
3435 LABEL_FRAME_ADD("<hilight>Number of Edje Collections to Cache</>");
3437 sl = elm_slider_add(win);
3438 evas_object_data_set(win, "edje_collection_cache_slider", sl);
3439 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
3440 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
3441 elm_slider_span_size_set(sl, 120);
3442 elm_slider_unit_format_set(sl, "%1.0f collections");
3443 elm_slider_indicator_format_set(sl, "%1.0f");
3444 elm_slider_min_max_set(sl, 0, 128);
3445 elm_slider_value_set(sl, elm_config_cache_edje_collection_cache_size_get());
3446 elm_box_pack_end(bx, sl);
3447 evas_object_show(sl);
3449 evas_object_smart_callback_add(sl, "changed", ecc_round, NULL);
3450 evas_object_smart_callback_add(sl, "delay,changed", ecc_change, NULL);
3452 evas_object_data_set(win, "caches", bx);
3454 elm_naviframe_item_simple_push(naviframe, bx);
3458 _status_config_full(Evas_Object *win,
3461 Evas_Object *tb, *naviframe;
3462 Elm_Object_Item *tb_sizing, *tb_it;
3464 tb = elm_toolbar_add(win);
3465 elm_toolbar_select_mode_set(tb, ELM_OBJECT_SELECT_MODE_ALWAYS);
3466 elm_toolbar_menu_parent_set(tb, win);
3467 elm_toolbar_homogeneous_set(tb, EINA_FALSE);
3468 evas_object_size_hint_weight_set(tb, EVAS_HINT_EXPAND, 0.0);
3469 evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
3471 tb_sizing = elm_toolbar_item_append(tb, "zoom-fit-best", "Sizing",
3473 elm_toolbar_item_priority_set(tb_sizing, 100);
3475 tb_it = elm_toolbar_item_append(tb, "preferences-desktop-theme", "Theme",
3477 elm_toolbar_item_priority_set(tb_it, 90);
3479 elm_toolbar_item_append(tb, "preferences-desktop-font", "Fonts",
3482 tb_it = elm_toolbar_item_append(tb, "system-users", "Profiles",
3484 elm_toolbar_item_priority_set(tb_it, 90);
3486 elm_toolbar_item_append(tb, "system-run", "Scrolling", _cf_scrolling, win);
3487 elm_toolbar_item_append(tb, "video-display", "Rendering",
3488 _cf_rendering, win);
3489 elm_toolbar_item_append(tb, "appointment-new", "Caches", _cf_caches, win);
3490 elm_toolbar_item_append(tb, NULL, "Etc", _cf_etc, win);
3492 elm_box_pack_end(bx0, tb);
3493 evas_object_show(tb);
3495 naviframe = elm_naviframe_add(win);
3496 evas_object_size_hint_align_set(naviframe, EVAS_HINT_FILL, EVAS_HINT_FILL);
3497 evas_object_size_hint_weight_set(naviframe, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
3498 evas_object_data_set(win, "naviframe", naviframe);
3500 _status_config_themes(win, naviframe);
3501 _status_config_fonts(win, naviframe);
3502 _status_config_profiles(win, naviframe);
3503 _status_config_rendering(win, naviframe);
3504 _status_config_scrolling(win, naviframe);
3505 _status_config_caches(win, naviframe);
3506 _status_config_etc(win, naviframe);
3507 _status_config_sizing(win, naviframe); // Note: call this at the end.
3509 // FIXME uncomment after flip style fix, please
3510 //elm_object_style_set(naviframe, "flip");
3511 elm_toolbar_item_selected_set(tb_sizing, EINA_TRUE);
3512 elm_box_pack_end(bx0, naviframe);
3513 evas_object_show(naviframe);
3519 Evas_Object *win, *bx0;
3521 win = elm_win_util_standard_add("main", "Elementary Config");
3523 ecore_event_handler_add(ELM_EVENT_CONFIG_ALL_CHANGED, _config_all_changed,
3525 evas_object_smart_callback_add(win, "delete,request", config_exit, NULL);
3527 bx0 = elm_box_add(win);
3528 evas_object_size_hint_weight_set(bx0, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
3529 elm_win_resize_object_add(win, bx0);
3530 evas_object_show(bx0);
3532 if (!interactive) _status_basic(win, bx0);
3534 _status_config(win, bx0);
3535 else _status_config_full(win, bx0);
3537 evas_object_resize(win, 320, 480);
3538 evas_object_show(win);
3542 _exit_timer(void *data EINA_UNUSED)
3545 return ECORE_CALLBACK_CANCEL;
3548 /* this is your elementary main function - it MUST be called IMMEDIATELY
3549 * after elm_init() and MUST be passed argc and argv, and MUST be called
3550 * elm_main and not be static - must be a visible symbol with EAPI infront */
3557 elm_app_info_set(elm_main, "elementary", "images/logo.png");
3558 elm_app_compile_bin_dir_set(PACKAGE_BIN_DIR);
3559 elm_app_compile_data_dir_set(PACKAGE_DATA_DIR);
3561 for (i = 1; i < argc; i++)
3563 if (!strcmp(argv[i], "-h"))
3567 " -q Quiet mode (dont show window)\n"
3568 " -t THEME Set theme to THEME (ELM_THEME spec)\n"
3569 " -f SIZE Set finger size to SIZE pixels\n"
3570 " -s SCALE Set scale factor to SCALE\n"
3573 else if (!strcmp(argv[i], "-q"))
3578 else if ((!strcmp(argv[i], "-t")) && (i < argc - 1))
3581 theme_set = argv[i];
3584 else if ((!strcmp(argv[i], "-f")) && (i < argc - 1))
3587 finger_size_set = argv[i];
3590 else if ((!strcmp(argv[i], "-s")) && (i < argc - 1))
3593 scale_set = argv[i];
3597 /* put here any init code specific to this app like parsing args, etc. */
3603 win_create(); /* create main window */
3605 ecore_timer_add(2.0, _exit_timer, NULL);
3609 if (theme_set) elm_theme_set(NULL, theme_set);
3610 if (finger_size_set) elm_config_finger_size_set(atoi(finger_size_set));
3611 if (scale_set) elm_config_scale_set(atof(scale_set));
3613 elm_config_all_flush();
3615 if (quiet) elm_exit();
3617 elm_run(); /* and run the program now and handle all events, etc. */
3618 /* if the mainloop that elm_run() runs exists, we exit the app */
3619 elm_shutdown(); /* clean up and shut down */
3623 /* All elementary apps should use this. Put it right after elm_main() */