1 #include <Elementary.h>
3 # include "elementary_config.h"
5 #ifndef ELM_LIB_QUICKLAUNCH
7 typedef struct _Theme Theme;
8 typedef struct _Fonts_Data Fonts_Data;
9 typedef struct _Elm_Text_Class_Data Elm_Text_Class_Data;
10 typedef struct _Elm_Font_Size_Data Elm_Font_Size_Data;
17 Eina_Bool in_search_path;
20 static Theme *tsel = NULL;
21 static Eina_List *themes = NULL;
23 struct _Elm_Text_Class_Data
32 struct _Elm_Font_Size_Data
40 Eina_List *text_classes;
43 Eina_List *font_px_list;
44 Eina_List *font_scale_list;
47 const char *cur_style;
51 #define ELM_LIST_DISABLE(list) \
54 const Eina_List *l = elm_list_items_get(list); \
57 elm_list_item_show(eina_list_data_get(l)); \
58 elm_object_disabled_set(list, EINA_TRUE); \
63 #define ELM_LIST_ENABLE(list) \
66 elm_object_disabled_set(list, EINA_FALSE); \
70 #define LABEL_FRAME_ADD(label) \
73 pd = elm_frame_add(win); \
74 evas_object_size_hint_weight_set(pd, EVAS_HINT_EXPAND, 0.0); \
75 evas_object_size_hint_align_set(pd, EVAS_HINT_FILL, 0.5); \
76 elm_object_style_set(pd, "pad_medium"); \
77 elm_box_pack_end(bx, pd); \
78 evas_object_show(pd); \
80 lb = elm_label_add(win); \
81 evas_object_size_hint_weight_set(lb, EVAS_HINT_EXPAND, 0.0); \
82 evas_object_size_hint_align_set(lb, EVAS_HINT_FILL, 0.5); \
83 elm_object_text_set(lb, label); \
84 elm_frame_content_set(pd, lb); \
85 evas_object_show(lb); \
90 static int interactive = 1;
92 static const char *theme_set = NULL;
93 static const char *finger_size_set = NULL;
94 static const char *scale_set = NULL;
95 static Fonts_Data fdata = {NULL, NULL, NULL, NULL, NULL, NULL, 0.0};
98 _font_styles_list_sel(void *data __UNUSED__,
103 config_exit(void *data __UNUSED__,
104 Evas_Object *obj __UNUSED__,
105 void *event_info __UNUSED__)
107 Elm_Text_Class_Data *tc_data;
108 Elm_Font_Size_Data *sd;
110 EINA_LIST_FREE(fdata.text_classes, tc_data)
112 eina_stringshare_del(tc_data->name);
113 eina_stringshare_del(tc_data->desc);
114 eina_stringshare_del(tc_data->font);
115 eina_stringshare_del(tc_data->style);
119 elm_font_available_hash_del(fdata.font_hash);
120 fdata.font_hash = NULL;
122 EINA_LIST_FREE(fdata.font_px_list, sd)
124 eina_stringshare_del(sd->size_str);
128 EINA_LIST_FREE(fdata.font_scale_list, sd)
130 eina_stringshare_del(sd->size_str);
134 if (fdata.cur_font) eina_stringshare_del(fdata.cur_font);
135 fdata.cur_font = NULL;
137 if (fdata.cur_style) eina_stringshare_del(fdata.cur_style);
138 fdata.cur_style = NULL;
141 elm_exit(); /* exit the program's main loop that runs in elm_run() */
145 sb_change(void *data __UNUSED__,
147 void *event_info __UNUSED__)
149 Eina_Bool val = elm_check_state_get(obj);
150 Eina_Bool sb = elm_scroll_bounce_enabled_get();
152 if (val == sb) return;
153 elm_scroll_bounce_enabled_all_set(val);
155 /*TODO: enable/disable subordinate sliders (make 'em support it 1st)*/
159 bf_round(void *data __UNUSED__,
161 void *event_info __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 __UNUSED__,
173 void *event_info __UNUSED__)
175 double bf = elm_scroll_bounce_friction_get();
176 double val = elm_slider_value_get(obj);
178 if (bf == val) return;
179 elm_scroll_bounce_friction_all_set(val);
183 ps_round(void *data __UNUSED__,
185 void *event_info __UNUSED__)
187 double val = elm_slider_value_get(obj);
190 v = ((double)((int)(val * 10.0))) / 10.0;
191 if (v != val) elm_slider_value_set(obj, v);
195 ps_change(void *data __UNUSED__,
197 void *event_info __UNUSED__)
199 double ps = elm_scroll_page_scroll_friction_get();
200 double val = elm_slider_value_get(obj);
202 if (ps == val) return;
203 elm_scroll_page_scroll_friction_all_set(val);
207 bis_round(void *data __UNUSED__,
209 void *event_info __UNUSED__)
211 double val = elm_slider_value_get(obj);
214 v = ((double)((int)(val * 10.0))) / 10.0;
215 if (v != val) elm_slider_value_set(obj, v);
219 bis_change(void *data __UNUSED__,
221 void *event_info __UNUSED__)
223 double bis = elm_scroll_bring_in_scroll_friction_get();
224 double val = elm_slider_value_get(obj);
226 if (bis == val) return;
227 elm_scroll_bring_in_scroll_friction_all_set(val);
231 zf_round(void *data __UNUSED__,
233 void *event_info __UNUSED__)
235 double val = elm_slider_value_get(obj);
238 v = ((double)((int)(val * 10.0))) / 10.0;
239 if (v != val) elm_slider_value_set(obj, v);
243 zf_change(void *data __UNUSED__,
245 void *event_info __UNUSED__)
247 double zf = elm_scroll_zoom_friction_get();
248 double val = elm_slider_value_get(obj);
250 if (zf == val) return;
251 elm_scroll_zoom_friction_all_set(val);
255 ts_change(void *data __UNUSED__,
257 void *event_info __UNUSED__)
259 Eina_Bool val = elm_check_state_get(obj);
260 Eina_Bool sb = elm_scroll_thumbscroll_enabled_get();
262 if (val == sb) return;
263 elm_scroll_thumbscroll_enabled_all_set(val);
265 /*TODO: enable/disable subordinate sliders (make 'em support it 1st)*/
269 tst_round(void *data __UNUSED__,
271 void *event_info __UNUSED__)
273 double val = elm_slider_value_get(obj);
276 v = ((double)((int)(val * 10.0))) / 10.0;
277 if (v != val) elm_slider_value_set(obj, v);
281 tst_change(void *data __UNUSED__,
283 void *event_info __UNUSED__)
285 double tst = elm_scroll_thumbscroll_threshold_get();
286 double val = elm_slider_value_get(obj);
288 if (tst == val) return;
289 elm_scroll_thumbscroll_threshold_all_set(val);
293 tsmt_round(void *data __UNUSED__,
295 void *event_info __UNUSED__)
297 double val = elm_slider_value_get(obj);
300 v = ((double)((int)(val * 10.0))) / 10.0;
301 if (v != val) elm_slider_value_set(obj, v);
305 tsmt_change(void *data __UNUSED__,
307 void *event_info __UNUSED__)
309 double tsmt = elm_scroll_thumbscroll_momentum_threshold_get();
310 double val = elm_slider_value_get(obj);
312 if (tsmt == val) return;
313 elm_scroll_thumbscroll_momentum_threshold_all_set(val);
317 tsf_round(void *data __UNUSED__,
319 void *event_info __UNUSED__)
321 double val = elm_slider_value_get(obj);
324 v = ((double)((int)(val * 10.0))) / 10.0;
325 if (v != val) elm_slider_value_set(obj, v);
329 tsf_change(void *data __UNUSED__,
331 void *event_info __UNUSED__)
333 double tsf = elm_scroll_thumbscroll_friction_get();
334 double val = elm_slider_value_get(obj);
336 if (tsf == val) return;
337 elm_scroll_thumbscroll_friction_all_set(val);
341 tsbf_round(void *data __UNUSED__,
343 void *event_info __UNUSED__)
345 double val = elm_slider_value_get(obj);
348 v = ((double)((int)(val * 10.0))) / 10.0;
349 if (v != val) elm_slider_value_set(obj, v);
353 tsbf_change(void *data __UNUSED__,
355 void *event_info __UNUSED__)
357 double tsbf = elm_scroll_thumbscroll_border_friction_get();
358 double val = elm_slider_value_get(obj);
360 if (tsbf == val) return;
361 elm_scroll_thumbscroll_border_friction_all_set(val);
365 cf_enable(void *data,
367 void *event_info __UNUSED__)
369 Eina_Bool cf = elm_cache_flush_enabled_get();
370 Eina_Bool val = elm_check_state_get(obj);
372 if (cf == val) return;
373 elm_object_disabled_set((Evas_Object *)data, !val);
374 elm_cache_flush_enabled_all_set(val);
378 cf_round(void *data __UNUSED__,
380 void *event_info __UNUSED__)
382 double val = elm_slider_value_get(obj);
385 v = ((double)((int)(val * 5.0))) / 5.0;
386 if (v != val) elm_slider_value_set(obj, v);
390 cf_change(void *data __UNUSED__,
392 void *event_info __UNUSED__)
394 double cf = elm_cache_flush_interval_get();
395 double val = elm_slider_value_get(obj);
397 if (cf == val) return;
398 elm_cache_flush_interval_all_set(val);
402 fc_round(void *data __UNUSED__,
404 void *event_info __UNUSED__)
406 double val = elm_slider_value_get(obj);
409 v = ((double)((int)(val * 10.0))) / 10.0;
410 if (v != val) elm_slider_value_set(obj, v);
414 fc_change(void *data __UNUSED__,
416 void *event_info __UNUSED__)
418 double font_cache = elm_font_cache_get();
419 double val = elm_slider_value_get(obj);
421 if (font_cache == val) return;
422 elm_font_cache_all_set(val * 1024);
426 ic_round(void *data __UNUSED__,
428 void *event_info __UNUSED__)
430 double val = elm_slider_value_get(obj);
433 v = ((double)((int)(val * 10.0))) / 10.0;
434 if (v != val) elm_slider_value_set(obj, v);
438 ic_change(void *data __UNUSED__,
440 void *event_info __UNUSED__)
442 double image_cache = elm_image_cache_get();
443 double val = elm_slider_value_get(obj);
445 if (image_cache == val) return;
446 elm_image_cache_all_set(val * 1024);
450 sc_round(void *data __UNUSED__,
452 void *event_info __UNUSED__)
454 double val = elm_slider_value_get(obj);
457 v = ((double)((int)(val * 10.0))) / 10.0;
458 if (v != val) elm_slider_value_set(obj, v);
462 sc_change(void *data __UNUSED__,
464 void *event_info __UNUSED__)
466 double scale = elm_scale_get();
467 double val = elm_slider_value_get(obj);
469 if (scale == val) return;
470 elm_scale_all_set(val);
474 fs_round(void *data __UNUSED__,
476 void *event_info __UNUSED__)
478 double val = elm_slider_value_get(obj);
481 v = ((double)((int)(val * 5.0))) / 5.0;
482 if (v != val) elm_slider_value_set(obj, v);
486 fs_change(void *data __UNUSED__,
488 void *event_info __UNUSED__)
490 double fs = elm_finger_size_get();
491 double val = elm_slider_value_get(obj);
493 if (fs == val) return;
494 elm_finger_size_all_set(val);
498 efc_round(void *data __UNUSED__,
500 void *event_info __UNUSED__)
502 double val = elm_slider_value_get(obj);
505 v = ((double)((int)(val * 5.0))) / 5.0;
506 if (v != val) elm_slider_value_set(obj, v);
510 efc_change(void *data __UNUSED__,
512 void *event_info __UNUSED__)
514 double efc = elm_edje_file_cache_get();
515 double val = elm_slider_value_get(obj);
517 if (efc == val) return;
518 elm_edje_file_cache_all_set(val);
522 ecc_round(void *data __UNUSED__,
524 void *event_info __UNUSED__)
526 double val = elm_slider_value_get(obj);
529 v = ((double)((int)(val * 5.0))) / 5.0;
530 if (v != val) elm_slider_value_set(obj, v);
534 ecc_change(void *data __UNUSED__,
536 void *event_info __UNUSED__)
538 double ecc = elm_edje_collection_cache_get();
539 double val = elm_slider_value_get(obj);
541 if (ecc == val) return;
542 elm_edje_collection_cache_all_set(val);
546 _status_basic(Evas_Object *win,
549 Evas_Object *lb, *fr;
551 fr = elm_frame_add(win);
552 evas_object_size_hint_weight_set(fr, 1.0, 1.0);
553 elm_frame_label_set(fr, "Information");
554 elm_box_pack_end(bx0, fr);
555 evas_object_show(fr);
557 lb = elm_label_add(win);
558 elm_object_text_set(lb,
559 "Applying configuration change"
561 elm_frame_content_set(fr, lb);
562 evas_object_show(lb);
566 _status_config(Evas_Object *win,
569 Evas_Object *lb, *pd, *bx, *fr, *sl, *sp;
571 fr = elm_frame_add(win);
572 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
573 evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
574 elm_frame_label_set(fr, "Sizing");
575 elm_box_pack_end(bx0, fr);
576 evas_object_show(fr);
578 bx = elm_box_add(win);
579 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, 0.0);
580 evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, 0.5);
582 LABEL_FRAME_ADD("<hilight>Scale</>");
584 sl = elm_slider_add(win);
585 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
586 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
587 elm_slider_span_size_set(sl, 120);
588 elm_slider_unit_format_set(sl, "%1.2f");
589 elm_slider_indicator_format_set(sl, "%1.2f");
590 elm_slider_min_max_set(sl, 0.25, 5.0);
591 elm_slider_value_set(sl, elm_scale_get());
592 elm_box_pack_end(bx, sl);
593 evas_object_show(sl);
595 evas_object_smart_callback_add(sl, "changed", sc_round, NULL);
596 evas_object_smart_callback_add(sl, "delay,changed", sc_change, NULL);
598 sp = elm_separator_add(win);
599 elm_separator_horizontal_set(sp, 1);
600 evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, 0.0);
601 evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5);
602 elm_box_pack_end(bx, sp);
603 evas_object_show(sp);
605 LABEL_FRAME_ADD("<hilight>Finger Size</><br>");
607 sl = elm_slider_add(win);
608 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
609 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
610 elm_slider_span_size_set(sl, 120);
611 elm_slider_unit_format_set(sl, "%1.0f");
612 elm_slider_indicator_format_set(sl, "%1.0f");
613 elm_slider_min_max_set(sl, 5, 200);
614 elm_slider_value_set(sl, elm_finger_size_get());
615 elm_box_pack_end(bx, sl);
616 evas_object_show(sl);
618 evas_object_smart_callback_add(sl, "changed", fs_round, NULL);
619 evas_object_smart_callback_add(sl, "delay,changed", fs_change, NULL);
621 // FIXME: add theme selector (basic mode and advanced for fallbacks)
622 // FIXME: save config
623 // FIXME: profile selector / creator etc.
624 elm_frame_content_set(fr, bx);
625 evas_object_show(bx);
629 _flip_to(Evas_Object *win,
632 Evas_Object *wid, *pager;
633 wid = evas_object_data_get(win, name);
634 pager = evas_object_data_get(win, "pager");
635 elm_pager_content_promote(pager, wid);
639 _cf_sizing(void *data,
640 Evas_Object *obj __UNUSED__,
641 void *event_info __UNUSED__)
643 _flip_to(data, "sizing");
647 _cf_themes(void *data,
648 Evas_Object *obj __UNUSED__,
649 void *event_info __UNUSED__)
651 _flip_to(data, "themes");
655 _cf_fonts(void *data,
656 Evas_Object *obj __UNUSED__,
657 void *event_info __UNUSED__)
659 _flip_to(data, "fonts");
663 _cf_profiles(void *data,
664 Evas_Object *obj __UNUSED__,
665 void *event_info __UNUSED__)
667 _flip_to(data, "profiles");
671 _cf_scrolling(void *data,
672 Evas_Object *obj __UNUSED__,
673 void *event_info __UNUSED__)
675 _flip_to(data, "scrolling");
679 _cf_rendering(void *data,
680 Evas_Object *obj __UNUSED__,
681 void *event_info __UNUSED__)
683 _flip_to(data, "rendering");
687 _cf_caches(void *data,
688 Evas_Object *obj __UNUSED__,
689 void *event_info __UNUSED__)
691 _flip_to(data, "caches");
695 _elm_theme_current_get(const char *theme_search_order)
700 if (!theme_search_order)
703 for (p = theme_search_order;; p++)
705 if ((*p == ':') || (!*p))
707 if (p > theme_search_order)
709 char *n = malloc(p - theme_search_order + 1);
713 strncpy(n, theme_search_order, p - theme_search_order);
714 n[p - theme_search_order] = 0;
715 ret = eina_stringshare_add(n);
726 _font_overlay_set_all(void *data,
727 Evas_Object *obj __UNUSED__,
728 void *event_info __UNUSED__)
730 Evas_Object *win, *fclasses, *fnames, *fstyles, *fsizes;
731 Elm_Text_Class_Data *tc_data, *tc;
737 fclasses = evas_object_data_get(win, "font_classes_list");
738 it = elm_list_selected_item_get(fclasses);
740 tc_data = elm_list_item_data_get(it);
742 fnames = evas_object_data_get(win, "font_names_list");
743 fstyles = evas_object_data_get(win, "font_styles_list");
744 fsizes = evas_object_data_get(win, "font_sizes_list");
746 EINA_LIST_FOREACH(fdata.text_classes, l, tc)
748 eina_stringshare_replace(&tc->font, tc_data->font);
749 eina_stringshare_replace(&tc->style, tc_data->style);
750 tc->size = tc_data->size;
757 _font_overlay_reset(void *data,
758 Evas_Object *obj __UNUSED__,
759 void *event_info __UNUSED__)
761 Evas_Object *win, *fclasses, *fnames, *fstyles, *fsizes;
762 Elm_Text_Class_Data *tc_data;
767 fclasses = evas_object_data_get(win, "font_classes_list");
768 it = elm_list_selected_item_get(fclasses);
770 tc_data = elm_list_item_data_get(it);
772 fnames = evas_object_data_get(win, "font_names_list");
773 fstyles = evas_object_data_get(win, "font_styles_list");
774 fsizes = evas_object_data_get(win, "font_sizes_list");
776 elm_font_overlay_unset(tc_data->name);
778 eina_stringshare_replace(&fdata.cur_font, NULL);
779 eina_stringshare_replace(&tc_data->font, NULL);
780 eina_stringshare_replace(&fdata.cur_style, NULL);
781 eina_stringshare_replace(&tc_data->style, NULL);
782 fdata.cur_size = 0.0;
785 ELM_LIST_DISABLE(fnames);
786 ELM_LIST_DISABLE(fstyles);
787 ELM_LIST_DISABLE(fsizes);
793 _font_overlay_reset_all(void *data,
794 Evas_Object *obj __UNUSED__,
795 void *event_info __UNUSED__)
797 Evas_Object *win, *fclasses, *fnames, *fstyles, *fsizes;
798 Elm_Text_Class_Data *tc_data;
803 eina_stringshare_replace(&fdata.cur_font, NULL);
804 eina_stringshare_replace(&fdata.cur_style, NULL);
805 fdata.cur_size = 0.0;
807 EINA_LIST_FOREACH(fdata.text_classes, l, tc_data)
809 elm_font_overlay_unset(tc_data->name);
811 eina_stringshare_replace(&tc_data->font, NULL);
812 eina_stringshare_replace(&tc_data->style, NULL);
816 fclasses = evas_object_data_get(win, "font_classes_list");
817 fnames = evas_object_data_get(win, "font_names_list");
818 fstyles = evas_object_data_get(win, "font_styles_list");
819 fsizes = evas_object_data_get(win, "font_sizes_list");
821 it = elm_list_selected_item_get(fclasses);
822 if (it) elm_list_item_selected_set(it, EINA_FALSE);
824 ELM_LIST_DISABLE(fnames);
825 ELM_LIST_DISABLE(fstyles);
826 ELM_LIST_DISABLE(fsizes);
832 _font_overlay_change(void *data __UNUSED__,
833 Evas_Object *obj __UNUSED__,
834 void *event_info __UNUSED__)
836 Elm_Text_Class_Data *tc_data;
839 EINA_LIST_FOREACH(fdata.text_classes, l, tc_data)
845 name = elm_font_fontconfig_name_get(tc_data->font,
847 elm_font_overlay_set(tc_data->name, name,
848 tc_data->size ? tc_data->size : -100);
849 elm_font_fontconfig_name_free(name);
852 elm_font_overlay_unset(tc_data->name);
856 elm_font_overlay_all_apply();
858 /* TODO: apply hinting */
862 _profile_change_do(Evas_Object *win,
865 int flush_interval, font_c, image_c, edje_file_c, edje_col_c, ts_threshould;
866 double scale, s_bounce_friction, ts_momentum_threshold, ts_friction,
867 ts_border_friction, page_friction, bring_in_friction, zoom_friction;
868 const char *curr_theme, *curr_engine;
869 const Eina_List *l_items, *l;
870 Eina_Bool s_bounce, ts;
875 elm_profile_all_set(profile);
877 scale = elm_scale_get();
878 fs = elm_finger_size_get();
879 flush_interval = elm_cache_flush_interval_get();
880 font_c = elm_font_cache_get();
881 image_c = elm_image_cache_get();
882 edje_file_c = elm_edje_file_cache_get();
883 edje_col_c = elm_edje_collection_cache_get();
885 s_bounce = elm_scroll_bounce_enabled_get();
886 s_bounce_friction = elm_scroll_bounce_friction_get();
887 ts = elm_scroll_thumbscroll_enabled_get();
888 ts_threshould = elm_scroll_thumbscroll_threshold_get();
889 ts_momentum_threshold = elm_scroll_thumbscroll_momentum_threshold_get();
890 ts_friction = elm_scroll_thumbscroll_friction_get();
891 ts_border_friction = elm_scroll_thumbscroll_border_friction_get();
892 page_friction = elm_scroll_page_scroll_friction_get();
893 bring_in_friction = elm_scroll_bring_in_scroll_friction_get();
894 zoom_friction = elm_scroll_zoom_friction_get();
896 /* gotta update root windows' atoms */
897 elm_scale_all_set(scale);
898 elm_slider_value_set(evas_object_data_get(win, "scale_slider"), scale);
899 elm_finger_size_all_set(fs);
900 elm_slider_value_set(evas_object_data_get(win, "fs_slider"), fs);
902 elm_cache_flush_interval_all_set(flush_interval);
903 elm_slider_value_set(evas_object_data_get(win,
904 "cache_flush_interval_slider"),
906 elm_font_cache_all_set(font_c);
907 elm_slider_value_set(evas_object_data_get(win, "font_cache_slider"),
909 elm_image_cache_all_set(image_c);
910 elm_slider_value_set(evas_object_data_get(win, "image_cache_slider"),
912 elm_edje_file_cache_all_set(edje_file_c);
913 elm_slider_value_set(evas_object_data_get(win, "edje_file_cache_slider"),
915 elm_edje_collection_cache_all_set(edje_col_c);
916 elm_slider_value_set(evas_object_data_get(win,
917 "edje_collection_cache_slider"),
920 elm_scroll_bounce_enabled_all_set(s_bounce);
921 elm_check_state_set(evas_object_data_get(win, "scroll_bounce_check"),
923 elm_scroll_bounce_friction_all_set(s_bounce_friction);
924 elm_slider_value_set(evas_object_data_get(win, "bounce_friction_slider"),
926 elm_scroll_thumbscroll_enabled_all_set(ts);
927 elm_check_state_set(evas_object_data_get(win, "thumbscroll_check"), ts);
928 elm_scroll_thumbscroll_threshold_all_set(ts_threshould);
929 elm_slider_value_set(evas_object_data_get(win,
930 "thumbscroll_threshold_slider"),
932 elm_scroll_thumbscroll_momentum_threshold_all_set(ts_momentum_threshold);
933 elm_slider_value_set(evas_object_data_get(win,
934 "ts_momentum_threshold_slider"),
935 ts_momentum_threshold);
936 elm_scroll_thumbscroll_friction_all_set(ts_friction);
937 elm_slider_value_set(evas_object_data_get(win,
938 "thumbscroll_friction_slider"),
940 elm_scroll_thumbscroll_border_friction_all_set(ts_border_friction);
941 elm_slider_value_set(evas_object_data_get(win, "ts_border_friction_slider"),
943 elm_scroll_page_scroll_friction_all_set(page_friction);
944 elm_slider_value_set(evas_object_data_get(win,
945 "page_scroll_friction_slider"),
947 elm_scroll_bring_in_scroll_friction_all_set(bring_in_friction);
948 elm_slider_value_set(evas_object_data_get(win,
949 "bring_in_scroll_friction_slider"),
951 elm_scroll_zoom_friction_all_set(zoom_friction);
952 elm_slider_value_set(evas_object_data_get(win,
953 "zoom_scroll_friction_slider"),
956 curr_theme = _elm_theme_current_get(elm_theme_get(NULL));
957 elm_theme_all_set(curr_theme);
959 th = elm_theme_new();
960 elm_theme_set(th, curr_theme);
961 elm_object_theme_set(evas_object_data_get(win, "theme_preview"), th);
963 eina_stringshare_del(curr_theme);
965 curr_engine = elm_engine_current_get();
966 l_items = elm_list_items_get(evas_object_data_get(win, "engines_list"));
967 EINA_LIST_FOREACH(l_items, l, it)
969 if (!strcmp(elm_list_item_data_get(it), curr_engine))
971 elm_list_item_selected_set(it, EINA_TRUE);
978 _engine_use(void *data,
979 Evas_Object *obj __UNUSED__,
980 void *event_info __UNUSED__)
983 const char *selection;
986 selection = elm_list_item_data_get(elm_list_selected_item_get(li));
988 if (!strcmp(elm_engine_current_get(), selection))
991 elm_engine_set(selection);
992 elm_config_save(); /* make sure new engine has its data dir */
996 _profile_use(void *data,
997 Evas_Object *obj __UNUSED__,
998 void *event_info __UNUSED__)
1001 const char *selection;
1002 const char *profile;
1005 selection = elm_list_item_data_get(elm_list_selected_item_get(li));
1006 profile = elm_profile_current_get();
1010 fprintf(stderr, "No profile currently set!\n"); /* FIXME: log domain */
1014 if (!strcmp(profile, selection))
1017 elm_config_save(); /* dump config into old profile's data dir */
1018 elm_profile_set(selection); /* just here to update info for getters below */
1020 _profile_change_do(elm_object_top_widget_get(li), selection);
1021 elm_config_save(); /* make sure new profile has its data dir */
1025 _btn_todo(void *data __UNUSED__,
1026 Evas_Object *obj __UNUSED__,
1027 void *event_info __UNUSED__)
1029 printf("To be done!\n");
1033 _profile_reset(void *data,
1034 Evas_Object *obj __UNUSED__,
1035 void *event_info __UNUSED__)
1037 const char *selection, *curr;
1042 selection = elm_list_item_data_get(elm_list_selected_item_get(li));
1043 curr = elm_profile_current_get();
1045 elm_config_save(); /* dump config into old profile's data dir */
1047 pdir = elm_profile_dir_get(selection, EINA_TRUE);
1051 ecore_file_recursive_rm(pdir);
1052 elm_profile_dir_free(pdir);
1054 elm_config_reload();
1056 _profile_change_do(elm_object_top_widget_get(li), curr);
1057 elm_config_save(); /* make sure new profile has its data dir */
1061 _theme_use(void *data __UNUSED__,
1062 Evas_Object *obj __UNUSED__,
1063 void *event_info __UNUSED__)
1070 defth = elm_theme_get(NULL);
1071 newth = malloc(strlen(defth) + 1 + strlen(t->name) + 1);
1077 rest = strchr(defth, ':');
1079 strcpy(newth, t->name);
1082 strcpy(newth, t->name);
1083 strcat(newth, rest);
1085 elm_theme_all_set(newth);
1091 _theme_sel(void *data,
1093 void *event_info __UNUSED__)
1096 Evas_Object *win = elm_object_top_widget_get(obj);
1097 Evas_Object *sample = evas_object_data_get(win, "theme_preview");
1103 defth = elm_theme_get(NULL);
1104 newth = malloc(strlen(defth) + 1 + strlen(t->name) + 1);
1105 th = elm_theme_new();
1111 rest = strchr(defth, ':');
1113 strcpy(newth, t->name);
1116 strcpy(newth, t->name);
1117 strcat(newth, rest);
1119 elm_theme_set(th, newth);
1122 elm_object_theme_set(sample, th);
1127 _theme_browse(void *data, Evas_Object *obj, void *event_info)
1129 printf("not implemented\n");
1133 _status_config_sizing(Evas_Object *win,
1136 Evas_Object *lb, *pd, *bx, *sl, *sp;
1138 bx = elm_box_add(win);
1139 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, 0.0);
1140 evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, 0.5);
1142 LABEL_FRAME_ADD("<hilight>Scale</>");
1144 sl = elm_slider_add(win);
1145 evas_object_data_set(win, "scale_slider", sl);
1146 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
1147 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
1148 elm_slider_span_size_set(sl, 120);
1149 elm_slider_unit_format_set(sl, "%1.2f");
1150 elm_slider_indicator_format_set(sl, "%1.2f");
1151 elm_slider_min_max_set(sl, 0.25, 5.0);
1152 elm_slider_value_set(sl, elm_scale_get());
1153 elm_box_pack_end(bx, sl);
1154 evas_object_show(sl);
1156 evas_object_smart_callback_add(sl, "changed", sc_round, NULL);
1157 evas_object_smart_callback_add(sl, "delay,changed", sc_change, NULL);
1159 sp = elm_separator_add(win);
1160 elm_separator_horizontal_set(sp, 1);
1161 evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, 0.0);
1162 evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5);
1163 elm_box_pack_end(bx, sp);
1164 evas_object_show(sp);
1166 LABEL_FRAME_ADD("<hilight>Finger Size</><br>");
1168 sl = elm_slider_add(win);
1169 evas_object_data_set(win, "fs_slider", sl);
1170 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
1171 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
1172 elm_slider_span_size_set(sl, 120);
1173 elm_slider_unit_format_set(sl, "%1.0f");
1174 elm_slider_indicator_format_set(sl, "%1.0f");
1175 elm_slider_min_max_set(sl, 5, 200);
1176 elm_slider_value_set(sl, elm_finger_size_get());
1177 elm_box_pack_end(bx, sl);
1178 evas_object_show(sl);
1180 evas_object_smart_callback_add(sl, "changed", fs_round, NULL);
1181 evas_object_smart_callback_add(sl, "delay,changed", fs_change, NULL);
1183 evas_object_data_set(win, "sizing", bx);
1185 elm_pager_content_push(pager, bx);
1188 static Evas_Object *
1189 _sample_theme_new(Evas_Object *win)
1191 Evas_Object *base, *bg, *bt, *ck, *rd, *rdg, *sl, *fr, *li, *rc, *sp;
1193 base = elm_table_add(win);
1194 evas_object_size_hint_weight_set(base, 1.0, 1.0);
1195 evas_object_size_hint_align_set(base, EVAS_HINT_FILL, EVAS_HINT_FILL);
1197 bg = elm_bg_add(win);
1198 evas_object_size_hint_weight_set(bg, 1.0, 1.0);
1199 evas_object_size_hint_align_set(bg, EVAS_HINT_FILL, EVAS_HINT_FILL);
1200 elm_table_pack(base, bg, 0, 0, 2, 5);
1201 evas_object_show(bg);
1203 bt = elm_button_add(win);
1204 evas_object_size_hint_weight_set(bt, 1.0, 0.0);
1205 elm_button_label_set(bt, "Button");
1206 elm_table_pack(base, bt, 0, 0, 1, 1);
1207 evas_object_show(bt);
1209 ck = elm_check_add(win);
1210 evas_object_size_hint_weight_set(ck, 1.0, 0.0);
1211 elm_check_label_set(ck, "Check");
1212 elm_table_pack(base, ck, 0, 1, 1, 1);
1213 evas_object_show(ck);
1215 rd = elm_radio_add(win);
1216 evas_object_size_hint_weight_set(rd, 1.0, 0.0);
1217 elm_radio_state_value_set(rd, 0);
1218 elm_radio_label_set(rd, "Radio 1");
1219 elm_table_pack(base, rd, 1, 0, 1, 1);
1220 evas_object_show(rd);
1223 rd = elm_radio_add(win);
1224 evas_object_size_hint_weight_set(rd, 1.0, 0.0);
1225 elm_radio_state_value_set(rd, 1);
1226 elm_radio_label_set(rd, "Radio 2");
1227 elm_radio_group_add(rd, rdg);
1228 elm_table_pack(base, rd, 1, 1, 1, 1);
1229 evas_object_show(rd);
1231 sp = elm_separator_add(win);
1232 elm_separator_horizontal_set(sp, 1);
1233 evas_object_size_hint_weight_set(sp, 1.0, 0.0);
1234 evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5);
1235 elm_table_pack(base, sp, 0, 2, 2, 1);
1236 evas_object_show(sp);
1238 sl = elm_slider_add(win);
1239 elm_slider_label_set(sl, "Slider");
1240 elm_slider_span_size_set(sl, 120);
1241 elm_slider_min_max_set(sl, 1, 10);
1242 elm_slider_value_set(sl, 4);
1243 evas_object_size_hint_weight_set(sl, 1.0, 0.0);
1244 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, EVAS_HINT_FILL);
1245 elm_table_pack(base, sl, 0, 3, 2, 1);
1246 evas_object_show(sl);
1248 fr = elm_frame_add(win);
1249 elm_frame_label_set(fr, "Frame");
1250 elm_table_pack(base, fr, 0, 4, 2, 1);
1251 evas_object_size_hint_weight_set(fr, 1.0, 1.0);
1252 evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
1253 evas_object_show(fr);
1255 li = elm_list_add(win);
1256 evas_object_size_hint_weight_set(li, 1.0, 1.0);
1257 evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL);
1258 elm_frame_content_set(fr, li);
1259 evas_object_show(li);
1261 elm_list_item_append(li, "List Item 1", NULL, NULL, NULL, NULL);
1262 elm_list_item_append(li, "Second Item", NULL, NULL, NULL, NULL);
1263 elm_list_item_append(li, "Third Item", NULL, NULL, NULL, NULL);
1266 rc = evas_object_rectangle_add(evas_object_evas_get(win));
1267 evas_object_size_hint_weight_set(rc, 1.0, 1.0);
1268 evas_object_size_hint_min_set(rc, 160, 120);
1269 elm_table_pack(base, rc, 0, 4, 2, 1);
1275 _status_config_themes(Evas_Object *win,
1278 Evas_Object *tb, *rc, *sc, *sp, *li, *pd, *fr, *bt, *sample;
1279 Eina_List *list, *l;
1282 tb = elm_table_add(win);
1283 evas_object_size_hint_weight_set(tb, 1.0, 1.0);
1284 evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
1286 rc = evas_object_rectangle_add(evas_object_evas_get(win));
1287 evas_object_size_hint_weight_set(rc, 1.0, 1.0);
1288 evas_object_size_hint_min_set(rc, 0, 130);
1289 elm_table_pack(tb, rc, 0, 0, 1, 1);
1291 rc = evas_object_rectangle_add(evas_object_evas_get(win));
1292 evas_object_size_hint_weight_set(rc, 1.0, 1.0);
1293 evas_object_size_hint_min_set(rc, 0, 200);
1294 elm_table_pack(tb, rc, 0, 1, 1, 1);
1296 /////////////////////////////////////////////
1298 pd = elm_frame_add(win);
1299 elm_object_style_set(pd, "pad_medium");
1300 evas_object_size_hint_weight_set(pd, 1.0, 1.0);
1301 evas_object_size_hint_align_set(pd, EVAS_HINT_FILL, EVAS_HINT_FILL);
1302 elm_table_pack(tb, pd, 0, 0, 1, 1);
1303 evas_object_show(pd);
1305 li = elm_list_add(win);
1306 evas_object_size_hint_weight_set(li, 1.0, 1.0);
1307 evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL);
1308 elm_frame_content_set(pd, li);
1309 evas_object_show(li);
1311 list = elm_theme_name_available_list_new();
1312 EINA_LIST_FOREACH(list, l, th)
1316 t = calloc(1, sizeof(Theme));
1317 t->name = eina_stringshare_add(th);
1318 s = elm_theme_list_item_path_get(th, &(t->in_search_path));
1321 t->path = eina_stringshare_add(s);
1324 if (t->in_search_path)
1329 s[0] = toupper(s[0]);
1330 t->label = eina_stringshare_add(s);
1334 t->label = eina_stringshare_add(s);
1338 s = strdup(ecore_file_file_get(th));
1341 s[0] = toupper(s[0]);
1342 ext = strrchr(s, '.');
1344 t->label = eina_stringshare_add(s);
1348 t->label = eina_stringshare_add(s);
1350 themes = eina_list_append(themes, t);
1351 elm_list_item_append(li, t->label, NULL, NULL, _theme_sel, t);
1353 elm_theme_name_available_list_free(list);
1357 pd = elm_frame_add(win);
1358 elm_object_style_set(pd, "pad_medium");
1359 evas_object_size_hint_weight_set(pd, 1.0, 1.0);
1360 evas_object_size_hint_align_set(pd, 0.9, 0.9);
1361 elm_table_pack(tb, pd, 0, 0, 1, 1);
1362 evas_object_show(pd);
1364 /* FIXME: not implemented yet
1365 bt = elm_button_add(win);
1366 evas_object_smart_callback_add(bt, "clicked", _theme_browse, win);
1367 elm_button_label_set(bt, "Browse...");
1368 evas_object_size_hint_weight_set(bt, 1.0, 1.0);
1369 evas_object_size_hint_align_set(bt, 0.9, 0.9);
1370 elm_frame_content_set(pd, bt);
1371 evas_object_show(bt);
1373 pd = elm_frame_add(win);
1374 elm_object_style_set(pd, "pad_medium");
1375 evas_object_size_hint_weight_set(pd, 1.0, 0.0);
1376 evas_object_size_hint_align_set(pd, EVAS_HINT_FILL, EVAS_HINT_FILL);
1377 elm_table_pack(tb, pd, 0, 1, 1, 1);
1378 evas_object_show(pd);
1380 fr = elm_frame_add(win);
1381 elm_frame_label_set(fr, "Preview");
1382 evas_object_size_hint_weight_set(fr, 1.0, 1.0);
1383 evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
1384 elm_frame_content_set(pd, fr);
1385 evas_object_show(fr);
1387 sc = elm_scroller_add(win);
1388 elm_scroller_bounce_set(sc, 0, 0);
1389 evas_object_size_hint_weight_set(sc, 1.0, 1.0);
1390 evas_object_size_hint_align_set(sc, EVAS_HINT_FILL, EVAS_HINT_FILL);
1391 elm_frame_content_set(fr, sc);
1392 evas_object_show(sc);
1394 sample = _sample_theme_new(win);
1395 elm_scroller_content_set(sc, sample);
1396 evas_object_show(sample);
1397 evas_object_data_set(win, "theme_preview", sample);
1399 /////////////////////////////////////////////
1400 sp = elm_separator_add(win);
1401 elm_separator_horizontal_set(sp, 1);
1402 evas_object_size_hint_weight_set(sp, 1.0, 0.0);
1403 evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5);
1404 elm_table_pack(tb, sp, 0, 2, 1, 1);
1405 evas_object_show(sp);
1407 pd = elm_frame_add(win);
1408 elm_object_style_set(pd, "pad_medium");
1409 evas_object_size_hint_weight_set(pd, 1.0, 0.0);
1410 evas_object_size_hint_align_set(pd, 0.5, 0.5);
1411 elm_table_pack(tb, pd, 0, 3, 1, 1);
1412 evas_object_show(pd);
1414 bt = elm_button_add(win);
1415 evas_object_smart_callback_add(bt, "clicked", _theme_use, win);
1416 elm_button_label_set(bt, "Use Theme");
1417 evas_object_size_hint_weight_set(bt, 1.0, 0.0);
1418 evas_object_size_hint_align_set(bt, 0.5, 0.5);
1419 elm_frame_content_set(pd, bt);
1420 evas_object_show(bt);
1422 evas_object_data_set(win, "themes", tb);
1423 elm_pager_content_push(pager, tb);
1427 _font_preview_update(Evas_Object *win)
1432 if (!fdata.cur_font)
1435 name = elm_font_fontconfig_name_get(fdata.cur_font, fdata.cur_style);
1436 sz = fdata.cur_size;
1439 sz = (-sz * 10) / 100;
1443 edje_object_text_class_set(evas_object_data_get(win, "font_preview"),
1444 "font_preview", name, sz);
1446 elm_font_fontconfig_name_free(name);
1450 _font_classes_list_sel(void *data __UNUSED__,
1454 const Eina_List *f_names_items, *l;
1455 Elm_Text_Class_Data *tc_data;
1456 Evas_Object *f_names_list;
1459 tc_data = elm_list_item_data_get(event_info);
1461 f_names_list = evas_object_data_get(elm_object_top_widget_get(obj),
1463 ELM_LIST_ENABLE(f_names_list);
1465 f_names_items = elm_list_items_get(f_names_list);
1467 EINA_LIST_FOREACH(f_names_items, l, it)
1471 l = elm_list_item_label_get(it);
1473 if (tc_data->font && !strcmp(l, tc_data->font))
1475 elm_list_item_selected_set(it, EINA_TRUE);
1476 elm_list_item_show(it);
1483 _font_names_list_sel(void *data __UNUSED__,
1487 Evas_Object *style_list, *cls_list, *sizes_list, *win;
1488 const char *style, *sel_font;
1489 Elm_Text_Class_Data *tc_data;
1490 Elm_List_Item *it, *fc_it;
1491 Elm_Font_Properties *efp;
1495 sel_font = elm_list_item_label_get(it);
1497 win = elm_object_top_widget_get(obj);
1498 style_list = evas_object_data_get(win, "font_styles_list");
1499 cls_list = evas_object_data_get(win, "font_classes_list");
1500 sizes_list = evas_object_data_get(win, "font_sizes_list");
1502 fc_it = elm_list_selected_item_get(cls_list);
1503 if (!fc_it) return; /* should not happen, fonts list disabled in
1506 eina_stringshare_replace(&fdata.cur_font, sel_font);
1508 tc_data = elm_list_item_data_get(fc_it);
1509 if (tc_data->font) eina_stringshare_del(tc_data->font);
1510 if (fdata.cur_font) tc_data->font = eina_stringshare_ref(fdata.cur_font);
1512 /* load styles list */
1513 efp = eina_hash_find(fdata.font_hash, sel_font);
1515 ELM_LIST_ENABLE(style_list);
1516 elm_list_clear(style_list);
1518 evas_event_freeze(evas_object_evas_get(style_list));
1523 EINA_LIST_FOREACH(efp->styles, l, style)
1527 i = elm_list_item_append(style_list, style, NULL, NULL,
1528 _font_styles_list_sel, NULL);
1530 if (tc_data->style && (!strcmp(style, tc_data->style)))
1534 elm_list_go(style_list);
1537 evas_event_thaw(evas_object_evas_get(style_list));
1540 elm_list_item_selected_set(it, EINA_TRUE);
1542 _font_preview_update(win);
1546 _font_styles_list_sel(void *data __UNUSED__,
1550 Evas_Object *fc_list, *fs_list, *win;
1551 Elm_Text_Class_Data *tc_data;
1555 win = elm_object_top_widget_get(obj);
1556 fc_list = evas_object_data_get(win, "font_classes_list");
1557 fs_list = evas_object_data_get(win, "font_sizes_list");
1559 it = elm_list_selected_item_get(fc_list);
1560 if (!it) return; /* should not happen */
1562 eina_stringshare_replace(&fdata.cur_style,
1563 elm_list_item_label_get(event_info));
1564 ELM_LIST_ENABLE(fs_list);
1566 tc_data = elm_list_item_data_get(it);
1567 eina_stringshare_del(tc_data->style);
1568 tc_data->style = eina_stringshare_ref(fdata.cur_style);
1570 evas_event_freeze(evas_object_evas_get(fs_list));
1573 EINA_LIST_FOREACH(elm_list_items_get(fs_list), l, it)
1575 Elm_Font_Size_Data *sdata;
1577 sdata = elm_list_item_data_get(it);
1578 elm_list_item_selected_set(l->data, EINA_FALSE);
1580 if (tc_data->size == sdata->size)
1582 elm_list_item_selected_set(it, EINA_TRUE);
1583 elm_list_item_show(it);
1589 evas_event_thaw(evas_object_evas_get(fs_list));
1591 _font_preview_update(win);
1595 _font_sizes_list_sel(void *data __UNUSED__,
1596 Evas_Object *obj __UNUSED__,
1597 void *event_info __UNUSED__)
1599 Elm_Text_Class_Data *tc_data;
1600 Evas_Object *fc_list, *win;
1601 Elm_Font_Size_Data *sd;
1604 win = elm_object_top_widget_get(obj);
1605 fc_list = evas_object_data_get(win, "font_classes_list");
1607 it = elm_list_selected_item_get(fc_list);
1608 if (!it) return; /* should not happen */
1610 sd = elm_list_item_data_get(event_info);
1611 fdata.cur_size = sd->size;
1613 tc_data = elm_list_item_data_get(it);
1614 tc_data->size = fdata.cur_size;
1616 _font_preview_update(win);
1620 _fstyle_list_unselect_cb(void *data __UNUSED__,
1622 void *event_info __UNUSED__)
1624 Evas_Object *sizes_list, *win;
1626 if (elm_list_selected_item_get(obj)) return;
1628 win = elm_object_top_widget_get(obj);
1630 sizes_list = evas_object_data_get(win, "font_sizes_list");
1631 ELM_LIST_DISABLE(sizes_list);
1635 _fc_list_unselect_cb(void *data __UNUSED__,
1637 void *event_info __UNUSED__)
1639 Evas_Object *font_names_list, *styles_list, *sizes_list, *win;
1641 if (elm_list_selected_item_get(obj)) return;
1643 win = elm_object_top_widget_get(obj);
1645 font_names_list = evas_object_data_get(win, "font_names_list");
1646 ELM_LIST_DISABLE(font_names_list);
1648 styles_list = evas_object_data_get(win, "font_styles_list");
1649 ELM_LIST_DISABLE(styles_list);
1651 sizes_list = evas_object_data_get(win, "font_sizes_list");
1652 ELM_LIST_DISABLE(sizes_list);
1656 _font_classes_list_load(Evas_Object *li)
1658 Elm_Text_Class_Data *tc_data;
1662 evas = evas_object_evas_get(li);
1663 evas_event_freeze(evas);
1666 EINA_LIST_FOREACH(fdata.text_classes, l, tc_data)
1667 elm_list_item_append(li, tc_data->desc, NULL, NULL,
1668 _font_classes_list_sel, tc_data);
1670 evas_object_smart_callback_add(li, "unselected", _fc_list_unselect_cb,
1675 evas_event_thaw(evas);
1679 _fonts_data_fill(Evas *evas)
1681 const Eina_List *fo_list, *text_classes, *l;
1682 Elm_Text_Class_Data *tc_data;
1683 Elm_Font_Size_Data *sd;
1684 Elm_Font_Overlay *efo;
1685 Eina_List *evas_fonts;
1686 Elm_Text_Class *etc;
1689 evas_fonts = evas_font_available_list(evas);
1690 fdata.font_hash = elm_font_available_hash_add(evas_fonts);
1691 evas_font_available_list_free(evas, evas_fonts);
1693 text_classes = elm_text_classes_list_get();
1694 fo_list = elm_font_overlay_list_get();
1696 EINA_LIST_FOREACH(text_classes, l, etc)
1698 const Eina_List *ll;
1700 tc_data = calloc(1, sizeof(*tc_data));
1701 tc_data->name = eina_stringshare_add(etc->name);
1702 tc_data->desc = eina_stringshare_add(etc->desc);
1704 EINA_LIST_FOREACH(fo_list, ll, efo)
1706 if (strcmp(tc_data->name, efo->text_class))
1711 Elm_Font_Properties *efp;
1713 efp = elm_font_properties_get(efo->font);
1716 tc_data->font = eina_stringshare_add(efp->name);
1717 /* we're sure we recorded with only 1 style selected */
1718 tc_data->style = eina_stringshare_add(efp->styles->data);
1719 elm_font_properties_free(efp);
1722 tc_data->size = efo->size;
1725 fdata.text_classes = eina_list_append(fdata.text_classes, tc_data);
1728 elm_text_classes_list_free(text_classes);
1730 /* FIXME: hinting later */
1731 /* fdata.hinting = e_config->font_hinting; */
1733 sd = calloc(1, sizeof(Elm_Font_Size_Data));
1734 sd->size_str = eina_stringshare_add("Tiny");
1736 fdata.font_scale_list = eina_list_append(fdata.font_scale_list, sd);
1738 sd = calloc(1, sizeof(Elm_Font_Size_Data));
1739 sd->size_str = eina_stringshare_add("Small");
1741 fdata.font_scale_list = eina_list_append(fdata.font_scale_list, sd);
1743 sd = calloc(1, sizeof(Elm_Font_Size_Data));
1744 sd->size_str = eina_stringshare_add("Normal");
1746 fdata.font_scale_list = eina_list_append(fdata.font_scale_list, sd);
1748 sd = calloc(1, sizeof(Elm_Font_Size_Data));
1749 sd->size_str = eina_stringshare_add("Big");
1751 fdata.font_scale_list = eina_list_append(fdata.font_scale_list, sd);
1753 sd = calloc(1, sizeof(Elm_Font_Size_Data));
1754 sd->size_str = eina_stringshare_add("Really Big");
1756 fdata.font_scale_list = eina_list_append(fdata.font_scale_list, sd);
1758 sd = calloc(1, sizeof(Elm_Font_Size_Data));
1759 sd->size_str = eina_stringshare_add("Huge");
1761 fdata.font_scale_list = eina_list_append(fdata.font_scale_list, sd);
1763 for (i = 5; i < 51; i++)
1768 snprintf(str, sizeof(str), "%d pixels", i);
1770 sd = calloc(1, sizeof(Elm_Font_Size_Data));
1771 sd->size_str = eina_stringshare_add(str);
1773 fdata.font_px_list = eina_list_append(fdata.font_px_list, sd);
1778 _font_sort_cb(const void *data1,
1781 if (!data1) return 1;
1782 if (!data2) return -1;
1783 return strcmp(data1, data2);
1787 _font_sizes_list_load(Evas_Object *size_list)
1789 Elm_Font_Size_Data *size_data;
1793 evas = evas_object_evas_get(size_list);
1794 evas_event_freeze(evas);
1797 EINA_LIST_FOREACH(fdata.font_scale_list, l, size_data)
1798 elm_list_item_append(size_list, size_data->size_str, NULL, NULL,
1799 _font_sizes_list_sel, size_data);
1801 EINA_LIST_FOREACH(fdata.font_px_list, l, size_data)
1802 elm_list_item_append(size_list, size_data->size_str, NULL, NULL,
1803 _font_sizes_list_sel, size_data);
1805 elm_list_go(size_list);
1807 evas_event_thaw(evas);
1811 _fnames_list_unselect_cb(void *data __UNUSED__,
1813 void *event_info __UNUSED__)
1815 Evas_Object *styles_list, *sizes_list, *win;
1817 if (elm_list_selected_item_get(obj)) return;
1819 win = elm_object_top_widget_get(obj);
1821 styles_list = evas_object_data_get(win, "font_styles_list");
1822 ELM_LIST_DISABLE(styles_list);
1824 sizes_list = evas_object_data_get(win, "font_sizes_list");
1825 ELM_LIST_DISABLE(sizes_list);
1829 _font_list_fill(const Eina_Hash *hash __UNUSED__,
1830 const void *key __UNUSED__,
1834 Elm_Font_Properties *efp;
1840 *flist = eina_list_append(*flist, efp->name);
1846 _font_names_list_load(Evas_Object *flist)
1848 Eina_List *l, *names_list = NULL;
1852 evas = evas_object_evas_get(flist);
1853 evas_event_freeze(evas);
1856 eina_hash_foreach(fdata.font_hash, _font_list_fill, &names_list);
1857 names_list = eina_list_sort(names_list, eina_list_count(names_list),
1860 EINA_LIST_FOREACH(names_list, l, font)
1861 elm_list_item_append(flist, font, NULL, NULL, _font_names_list_sel, NULL);
1863 EINA_LIST_FREE(names_list, font) ;
1865 evas_object_smart_callback_add(flist, "unselected",
1866 _fnames_list_unselect_cb, NULL);
1871 evas_event_thaw(evas);
1875 _status_config_fonts(Evas_Object *win,
1878 Evas_Object *base, *fr, *li, *rc, *preview, *sp, *pd, *bt, *bx;
1881 _fonts_data_fill(evas_object_evas_get(win));
1883 base = elm_table_add(win);
1884 evas_object_size_hint_weight_set(base, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1885 evas_object_size_hint_align_set(base, EVAS_HINT_FILL, EVAS_HINT_FILL);
1887 /* yeah, dummy rectangles are ugly as hell, but no good way yet of
1889 rc = evas_object_rectangle_add(evas_object_evas_get(win));
1890 evas_object_size_hint_weight_set(rc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1891 evas_object_size_hint_align_set(rc, EVAS_HINT_FILL, EVAS_HINT_FILL);
1892 evas_object_size_hint_min_set(rc, 70, 170);
1893 elm_table_pack(base, rc, 1, 0, 1, 1);
1895 fr = elm_frame_add(win);
1896 elm_frame_label_set(fr, "Font Class");
1897 elm_table_pack(base, fr, 0, 0, 1, 2);
1898 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1899 evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
1900 evas_object_show(fr);
1902 /* FIXME: no multiselection for this list, for now */
1903 li = elm_list_add(win);
1904 evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1905 evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL);
1906 elm_frame_content_set(fr, li);
1907 evas_object_show(li);
1909 evas_object_data_set(win, "font_classes_list", li);
1910 _font_classes_list_load(li);
1912 fr = elm_frame_add(win);
1913 elm_frame_label_set(fr, "Font");
1914 elm_table_pack(base, fr, 1, 0, 1, 2);
1915 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1916 evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
1917 evas_object_show(fr);
1919 li = elm_list_add(win);
1920 evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1921 evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL);
1922 elm_frame_content_set(fr, li);
1923 evas_object_show(li);
1925 evas_object_data_set(win, "font_names_list", li);
1926 _font_names_list_load(li);
1927 ELM_LIST_DISABLE(li);
1929 rc = evas_object_rectangle_add(evas_object_evas_get(win));
1930 evas_object_size_hint_weight_set(rc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1931 evas_object_size_hint_align_set(rc, EVAS_HINT_FILL, EVAS_HINT_FILL);
1932 evas_object_size_hint_min_set(rc, 70, 130);
1933 elm_table_pack(base, rc, 1, 2, 1, 1);
1935 fr = elm_frame_add(win);
1936 elm_frame_label_set(fr, "Style");
1937 elm_table_pack(base, fr, 0, 2, 1, 1);
1938 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1939 evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
1940 evas_object_show(fr);
1941 ELM_LIST_DISABLE(li);
1943 li = elm_list_add(win);
1944 evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1945 evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL);
1946 elm_frame_content_set(fr, li);
1947 evas_object_show(li);
1949 evas_object_data_set(win, "font_styles_list", li);
1950 evas_object_smart_callback_add(li, "unselected", _fstyle_list_unselect_cb,
1953 fr = elm_frame_add(win);
1954 elm_frame_label_set(fr, "Size");
1955 elm_table_pack(base, fr, 1, 2, 1, 1);
1956 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1957 evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
1958 evas_object_show(fr);
1960 li = elm_list_add(win);
1961 evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1962 evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL);
1963 elm_frame_content_set(fr, li);
1964 evas_object_show(li);
1966 evas_object_data_set(win, "font_sizes_list", li);
1967 _font_sizes_list_load(li);
1968 ELM_LIST_DISABLE(li);
1970 bx = elm_box_add(win);
1971 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1972 evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
1973 elm_table_pack(base, bx, 0, 3, 2, 1);
1974 evas_object_show(bx);
1976 /* FIXME: what to do here? dedicated widget? some new entry API set? */
1977 snprintf(buf, sizeof(buf), "%s/objects/font_preview.edj", PACKAGE_DATA_DIR);
1978 preview = elm_layout_add(win);
1979 elm_layout_file_set(preview, buf, "font_preview");
1980 elm_layout_text_set(preview, "elm.text", "Preview Text — 我真的会写ä¸æ–‡");
1981 evas_object_size_hint_weight_set(preview, EVAS_HINT_EXPAND, 0.0);
1982 evas_object_size_hint_align_set(preview, EVAS_HINT_FILL, EVAS_HINT_FILL);
1983 evas_object_show(preview);
1985 elm_box_pack_end(bx, preview);
1986 evas_object_data_set(win, "font_preview", elm_layout_edje_get(preview));
1988 /////////////////////////////////////////////
1989 sp = elm_separator_add(win);
1990 elm_separator_horizontal_set(sp, EINA_TRUE);
1991 evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, 0.0);
1992 evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5);
1993 elm_table_pack(base, sp, 0, 4, 2, 1);
1994 evas_object_show(sp);
1996 pd = elm_frame_add(win);
1997 elm_object_style_set(pd, "pad_medium");
1998 evas_object_size_hint_weight_set(pd, EVAS_HINT_EXPAND, 0.0);
1999 evas_object_size_hint_align_set(pd, 0.5, 0.5);
2000 elm_table_pack(base, pd, 0, 5, 2, 1);
2001 evas_object_show(pd);
2003 bx = elm_box_add(win);
2004 elm_box_horizontal_set(bx, EINA_TRUE);
2005 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2006 evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
2007 evas_object_show(bx);
2009 bt = elm_button_add(win);
2010 evas_object_smart_callback_add(bt, "clicked", _font_overlay_set_all, win);
2011 elm_button_label_set(bt, "Set to All");
2012 evas_object_size_hint_weight_set(bt, 0.0, 0.0);
2013 evas_object_size_hint_align_set(bt, 0.5, 0.5);
2014 elm_box_pack_end(bx, bt);
2015 evas_object_show(bt);
2017 bt = elm_button_add(win);
2018 evas_object_smart_callback_add(bt, "clicked", _font_overlay_reset, win);
2019 elm_button_label_set(bt, "Reset");
2020 evas_object_size_hint_weight_set(bt, 0.0, 0.0);
2021 evas_object_size_hint_align_set(bt, 0.5, 0.5);
2022 elm_box_pack_end(bx, bt);
2023 evas_object_show(bt);
2025 bt = elm_button_add(win);
2026 evas_object_smart_callback_add(bt, "clicked", _font_overlay_reset_all, win);
2027 elm_button_label_set(bt, "Reset All");
2028 evas_object_size_hint_weight_set(bt, 0.0, 0.0);
2029 evas_object_size_hint_align_set(bt, 0.5, 0.5);
2030 elm_box_pack_end(bx, bt);
2031 evas_object_show(bt);
2033 bt = elm_button_add(win);
2034 evas_object_smart_callback_add(bt, "clicked", _font_overlay_change, win);
2035 elm_button_label_set(bt, "Apply");
2036 evas_object_size_hint_weight_set(bt, 0.0, 0.0);
2037 evas_object_size_hint_align_set(bt, 0.5, 0.5);
2038 elm_box_pack_end(bx, bt);
2039 evas_object_show(bt);
2041 elm_frame_content_set(pd, bx);
2043 evas_object_data_set(win, "fonts", base);
2045 elm_pager_content_push(pager, base);
2049 _engines_list_item_del_cb(void *data,
2050 Evas_Object *obj __UNUSED__,
2051 void *event_info __UNUSED__)
2057 _profiles_list_item_del_cb(void *data,
2058 Evas_Object *obj __UNUSED__,
2059 void *event_info __UNUSED__)
2065 _profiles_list_selected_cb(void *data,
2067 void *event_info __UNUSED__)
2069 const char *cur_profile = NULL;
2070 const char *sel_profile, *pdir;
2071 Eina_Bool cur_selected;
2072 const char *prof_name;
2076 Efreet_Desktop *desk = NULL;
2083 cur_profile = elm_profile_current_get();
2084 cur_selected = !strcmp(cur_profile, sel_profile);
2086 pdir = elm_profile_dir_get(sel_profile, EINA_FALSE);
2088 snprintf(buf, sizeof(buf), "%s/profile.desktop", pdir);
2089 desk = efreet_desktop_new(buf);
2090 if ((desk) && (desk->name)) prof_name = desk->name;
2093 prof_name = cur_profile;
2096 elm_object_disabled_set(evas_object_data_get(obj, "prof_reset_btn"),
2100 elm_object_disabled_set(evas_object_data_get(obj, "prof_del_btn"),
2102 elm_object_disabled_set(evas_object_data_get(obj, "prof_reset_btn"),
2104 elm_object_disabled_set(evas_object_data_get(obj, "prof_use_btn"),
2106 elm_profile_dir_free(pdir);
2109 snprintf(buf, sizeof(buf), "<hilight>Selected profile: %s</><br>",
2111 elm_object_text_set(evas_object_data_get(obj, "prof_name_lbl"), buf);
2113 en = evas_object_data_get(obj, "prof_desc_entry");
2115 if (desk) elm_entry_entry_set(en, desk->comment);
2118 elm_entry_entry_set(en, "Unknown");
2121 if (desk) efreet_desktop_free(desk);
2126 _profiles_list_fill(Evas_Object *l_widget,
2129 const char *cur_profile = NULL;
2130 const char *profile;
2131 void *sel_it = NULL;
2137 elm_list_clear(l_widget);
2139 cur_profile = elm_profile_current_get();
2141 EINA_LIST_FOREACH(p_names, l, profile)
2144 Efreet_Desktop *desk = NULL;
2146 const char *label, *ext, *pdir;
2151 pdir = elm_profile_dir_get(profile, EINA_FALSE);
2155 snprintf(buf, sizeof(buf), "%s/profile.desktop", pdir);
2156 desk = efreet_desktop_new(buf);
2157 if ((desk) && (desk->name)) label = desk->name;
2161 if (pdir) snprintf(buf, sizeof(buf), "%s/icon.edj", pdir);
2163 if ((desk) && (desk->icon) && (pdir))
2164 snprintf(buf, sizeof(buf), "%s/%s", pdir, desk->icon);
2166 ic = elm_icon_add(l_widget);
2167 ext = strrchr(buf, '.');
2170 if (!strcmp(ext, ".edj")) elm_icon_file_set(ic, buf, "icon");
2171 else elm_icon_file_set(ic, buf, NULL);
2174 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL,
2176 evas_object_show(ic);
2178 it = elm_list_item_append(l_widget, label, ic, NULL,
2179 _profiles_list_selected_cb, strdup(profile));
2180 elm_list_item_del_cb_set(it, _profiles_list_item_del_cb);
2181 if (cur_profile && !strcmp(profile, cur_profile))
2184 elm_profile_dir_free(pdir);
2187 if (desk) efreet_desktop_free(desk);
2191 if (sel_it) elm_list_item_selected_set(sel_it, EINA_TRUE);
2192 elm_list_go(l_widget);
2196 _profiles_list_unselect_cb(void *data __UNUSED__,
2198 void *event_info __UNUSED__)
2200 if (elm_list_selected_item_get(obj)) return;
2201 elm_object_disabled_set(evas_object_data_get(obj, "prof_del_btn"),
2203 elm_object_disabled_set(evas_object_data_get(obj, "prof_reset_btn"),
2205 elm_object_disabled_set(evas_object_data_get(obj, "prof_use_btn"),
2210 _status_config_profiles(Evas_Object *win,
2213 Evas_Object *li, *bx, *fr_bx1, *fr_bx2, *btn_bx, *fr, *lb, *en, *sp, *pd,
2218 bx = elm_box_add(win);
2219 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2220 evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
2222 fr_bx1 = elm_box_add(win);
2223 evas_object_size_hint_weight_set(fr_bx1, EVAS_HINT_EXPAND,
2225 evas_object_size_hint_align_set(fr_bx1, EVAS_HINT_FILL, EVAS_HINT_FILL);
2226 elm_box_homogeneous_set(fr_bx1, EINA_TRUE);
2227 evas_object_show(fr_bx1);
2229 fr_bx2 = elm_box_add(win);
2230 evas_object_size_hint_weight_set(fr_bx2, EVAS_HINT_EXPAND,
2232 evas_object_size_hint_align_set(fr_bx2, EVAS_HINT_FILL, EVAS_HINT_FILL);
2233 evas_object_show(fr_bx2);
2235 fr = elm_frame_add(win);
2236 elm_frame_label_set(fr, "Available Profiles");
2237 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2238 evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
2239 elm_frame_content_set(fr, fr_bx1);
2240 elm_box_pack_end(bx, fr);
2241 evas_object_show(fr);
2243 li = elm_list_add(win);
2244 evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2245 evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL);
2246 evas_object_smart_callback_add(li, "unselected", _profiles_list_unselect_cb,
2249 profs = elm_profile_list_get();
2251 evas_object_show(li);
2252 elm_box_pack_end(fr_bx2, li);
2254 lb = elm_label_add(win);
2255 evas_object_size_hint_weight_set(lb, EVAS_HINT_EXPAND, 0.0);
2256 evas_object_size_hint_align_set(lb, EVAS_HINT_FILL, 0.5);
2258 evas_object_show(lb);
2260 en = elm_entry_add(win);
2261 elm_entry_scrollable_set(en, EINA_TRUE);
2262 elm_entry_editable_set(en, EINA_FALSE);
2263 evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2264 evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
2265 evas_object_show(en);
2267 evas_object_data_set(li, "prof_name_lbl", lb);
2268 evas_object_data_set(li, "prof_desc_entry", en);
2270 elm_box_pack_end(fr_bx2, lb);
2271 elm_box_pack_end(fr_bx1, fr_bx2);
2272 elm_box_pack_end(fr_bx1, en);
2274 /////////////////////////////////////////////
2275 sp = elm_separator_add(win);
2276 elm_separator_horizontal_set(sp, EINA_TRUE);
2277 evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, 0.0);
2278 evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5);
2279 elm_box_pack_end(bx, sp);
2280 evas_object_show(sp);
2282 pd = elm_frame_add(win);
2283 elm_object_style_set(pd, "pad_medium");
2284 evas_object_size_hint_weight_set(pd, 0.0, 0.0);
2285 evas_object_size_hint_align_set(pd, 0.5, 0.5);
2286 elm_box_pack_end(bx, pd);
2287 evas_object_show(pd);
2289 btn_bx = elm_box_add(win);
2290 elm_box_horizontal_set(btn_bx, EINA_TRUE);
2291 evas_object_size_hint_weight_set(btn_bx, EVAS_HINT_EXPAND,
2293 evas_object_size_hint_align_set(btn_bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
2294 evas_object_show(btn_bx);
2296 bt = elm_button_add(win);
2297 evas_object_smart_callback_add(bt, "clicked", _profile_use, li);
2298 elm_button_label_set(bt, "Use");
2299 evas_object_size_hint_weight_set(bt, 0.0, 0.0);
2300 evas_object_size_hint_align_set(bt, 0.5, 0.5);
2301 elm_box_pack_end(btn_bx, bt);
2302 evas_object_show(bt);
2304 evas_object_data_set(li, "prof_use_btn", bt);
2306 bt = elm_button_add(win);
2307 evas_object_smart_callback_add(bt, "clicked", _btn_todo, NULL); /* TODO */
2308 elm_button_label_set(bt, "Delete");
2309 evas_object_size_hint_weight_set(bt, 0.0, 0.0);
2310 evas_object_size_hint_align_set(bt, 0.5, 0.5);
2311 elm_box_pack_end(btn_bx, bt);
2312 evas_object_show(bt);
2314 evas_object_data_set(li, "prof_del_btn", bt);
2316 bt = elm_button_add(win);
2317 evas_object_smart_callback_add(bt, "clicked", _profile_reset, li);
2318 elm_button_label_set(bt, "Reset");
2319 evas_object_size_hint_weight_set(bt, 0.0, 0.0);
2320 evas_object_size_hint_align_set(bt, 0.5, 0.5);
2321 elm_box_pack_end(btn_bx, bt);
2322 evas_object_show(bt);
2324 evas_object_data_set(li, "prof_reset_btn", bt);
2326 bt = elm_button_add(win);
2327 evas_object_smart_callback_add(bt, "clicked", _btn_todo, NULL); /* TODO */
2328 elm_button_label_set(bt, "Add new");
2329 evas_object_size_hint_weight_set(bt, 0.0, 0.0);
2330 evas_object_size_hint_align_set(bt, 0.5, 0.5);
2331 elm_box_pack_end(btn_bx, bt);
2332 evas_object_show(bt);
2334 elm_frame_content_set(pd, btn_bx);
2336 evas = evas_object_evas_get(li);
2337 evas_event_freeze(evas);
2340 _profiles_list_fill(li, profs);
2342 elm_profile_list_free(profs);
2345 evas_event_thaw(evas);
2347 evas_object_data_set(win, "profiles", bx);
2348 elm_pager_content_push(pager, bx);
2352 _status_config_scrolling(Evas_Object *win,
2355 Evas_Object *lb, *pd, *bx, *sl, *sp, *ck, *sc;
2357 bx = elm_box_add(win);
2358 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, 0.0);
2359 evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, 0.5);
2361 sc = elm_scroller_add(win);
2362 evas_object_size_hint_weight_set(sc, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2363 evas_object_size_hint_align_set(sc, EVAS_HINT_FILL, EVAS_HINT_FILL);
2364 elm_scroller_bounce_set(sc, EINA_FALSE, EINA_TRUE);
2365 evas_object_show(sc);
2366 elm_scroller_content_set(sc, bx);
2368 ck = elm_check_add(win);
2369 elm_object_tooltip_text_set(ck, "Set whether scrollers should bounce<br>"
2370 "when they reach their viewport's edge<br>"
2372 elm_check_label_set(ck, "Enable scroll bounce");
2373 evas_object_data_set(win, "scroll_bounce_check", ck);
2374 evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, 0.0);
2375 evas_object_size_hint_align_set(ck, EVAS_HINT_FILL, 0.5);
2376 elm_check_state_set(ck, elm_scroll_bounce_enabled_get());
2377 elm_box_pack_end(bx, ck);
2378 evas_object_show(ck);
2380 evas_object_smart_callback_add(ck, "changed", sb_change, NULL);
2382 LABEL_FRAME_ADD("<hilight>Scroll bounce friction</>");
2384 sl = elm_slider_add(win);
2385 elm_object_tooltip_text_set(sl, "This is the amount of inertia a <br>"
2386 "scroller will impose at bounce animations");
2387 evas_object_data_set(win, "bounce_friction_slider", sl);
2388 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
2389 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
2390 elm_slider_span_size_set(sl, 120);
2391 elm_slider_unit_format_set(sl, "%1.2f");
2392 elm_slider_indicator_format_set(sl, "%1.2f");
2393 elm_slider_min_max_set(sl, 0.0, 4.0);
2394 elm_slider_value_set(sl, elm_scroll_bounce_friction_get());
2395 elm_box_pack_end(bx, sl);
2396 evas_object_show(sl);
2398 evas_object_smart_callback_add(sl, "changed", bf_round, NULL);
2399 evas_object_smart_callback_add(sl, "delay,changed", bf_change, NULL);
2401 sp = elm_separator_add(win);
2402 elm_separator_horizontal_set(sp, EINA_TRUE);
2403 evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, 0.0);
2404 evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5);
2405 elm_box_pack_end(bx, sp);
2406 evas_object_show(sp);
2408 ck = elm_check_add(win);
2409 elm_object_tooltip_text_set(ck, "Set whether scrollers should be<br>"
2410 "draggable from any point in their views");
2411 elm_check_label_set(ck, "Enable thumb scroll");
2412 evas_object_data_set(win, "thumbscroll_check", ck);
2413 evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, 0.0);
2414 evas_object_size_hint_align_set(ck, EVAS_HINT_FILL, 0.5);
2415 elm_check_state_set(ck, elm_scroll_thumbscroll_enabled_get());
2416 elm_box_pack_end(bx, ck);
2417 evas_object_show(ck);
2419 evas_object_smart_callback_add(ck, "changed", ts_change, NULL);
2421 LABEL_FRAME_ADD("<hilight>Thumb scroll threshold</>");
2423 sl = elm_slider_add(win);
2424 elm_object_tooltip_text_set(sl, "This is the number of pixels one should<br>"
2425 "travel while dragging a scroller's view<br>"
2426 "to actually trigger scrolling");
2427 evas_object_data_set(win, "thumbscroll_threshold_slider", sl);
2428 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
2429 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
2430 elm_slider_span_size_set(sl, 120);
2431 elm_slider_unit_format_set(sl, "%1.0f pixels");
2432 elm_slider_indicator_format_set(sl, "%1.0f");
2433 elm_slider_min_max_set(sl, 8.0, 50.0);
2434 elm_slider_value_set(sl, elm_scroll_thumbscroll_threshold_get());
2435 elm_box_pack_end(bx, sl);
2436 evas_object_show(sl);
2438 evas_object_smart_callback_add(sl, "changed", tst_round, NULL);
2439 evas_object_smart_callback_add(sl, "delay,changed", tst_change, NULL);
2441 LABEL_FRAME_ADD("<hilight>Thumb scroll momentum threshold</>");
2443 sl = elm_slider_add(win);
2444 elm_object_tooltip_text_set(sl, "This is the minimum speed of mouse <br>"
2445 "cursor movement which will trigger<br>"
2446 "list self scrolling animation after a<br>"
2447 "mouse up event (pixels/second)");
2448 evas_object_data_set(win, "ts_momentum_threshold_slider", sl);
2449 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
2450 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
2451 elm_slider_span_size_set(sl, 120);
2452 elm_slider_unit_format_set(sl, "%1.0f pixels/s");
2453 elm_slider_indicator_format_set(sl, "%1.0f");
2454 elm_slider_min_max_set(sl, 10.0, 200.0);
2455 elm_slider_value_set(sl, elm_scroll_thumbscroll_momentum_threshold_get());
2456 elm_box_pack_end(bx, sl);
2457 evas_object_show(sl);
2459 evas_object_smart_callback_add(sl, "changed", tsmt_round, NULL);
2460 evas_object_smart_callback_add(sl, "delay,changed", tsmt_change,
2463 LABEL_FRAME_ADD("<hilight>Thumb scroll friction</>");
2465 sl = elm_slider_add(win);
2466 elm_object_tooltip_text_set(sl, "This is the amount of inertia a<br>"
2467 "scroller will impose at self scrolling<br>"
2469 evas_object_data_set(win, "thumbscroll_friction_slider", sl);
2470 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
2471 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
2472 elm_slider_span_size_set(sl, 120);
2473 elm_slider_unit_format_set(sl, "%1.1f");
2474 elm_slider_indicator_format_set(sl, "%1.1f");
2475 elm_slider_min_max_set(sl, 0.0, 15.0);
2476 elm_slider_value_set(sl, elm_scroll_thumbscroll_friction_get());
2477 elm_box_pack_end(bx, sl);
2478 evas_object_show(sl);
2480 evas_object_smart_callback_add(sl, "changed", tsf_round, NULL);
2481 evas_object_smart_callback_add(sl, "delay,changed", tsf_change, NULL);
2483 LABEL_FRAME_ADD("<hilight>Thumb scroll border friction</>");
2485 sl = elm_slider_add(win);
2486 elm_object_tooltip_text_set(sl, "This is the amount of lag between your<br>"
2487 "actual mouse cursor dragging movement<br>"
2488 "and a scroller's view movement itself,<br>"
2489 "while pushing it into bounce state<br>"
2491 evas_object_data_set(win, "ts_border_friction_slider", sl);
2492 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
2493 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
2494 elm_slider_span_size_set(sl, 120);
2495 elm_slider_unit_format_set(sl, "%1.2f");
2496 elm_slider_indicator_format_set(sl, "%1.2f");
2497 elm_slider_min_max_set(sl, 0.0, 1.0);
2498 elm_slider_value_set(sl, elm_scroll_thumbscroll_border_friction_get());
2499 elm_box_pack_end(bx, sl);
2500 evas_object_show(sl);
2502 evas_object_smart_callback_add(sl, "changed", tsbf_round, NULL);
2503 evas_object_smart_callback_add(sl, "delay,changed", tsbf_change, NULL);
2505 sp = elm_separator_add(win);
2506 elm_separator_horizontal_set(sp, EINA_TRUE);
2507 evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, 0.0);
2508 evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5);
2509 elm_box_pack_end(bx, sp);
2510 evas_object_show(sp);
2512 LABEL_FRAME_ADD("<hilight>Page scroll friction</>");
2514 sl = elm_slider_add(win);
2515 elm_object_tooltip_text_set(sl, "This is the amount of inertia a<br>"
2516 "paged scroller will impose at<br>"
2517 "page fitting animations");
2518 evas_object_data_set(win, "page_scroll_friction_slider", sl);
2519 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
2520 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
2521 elm_slider_span_size_set(sl, 120);
2522 elm_slider_unit_format_set(sl, "%1.1f");
2523 elm_slider_indicator_format_set(sl, "%1.1f");
2524 elm_slider_min_max_set(sl, 0.0, 5.0);
2525 elm_slider_value_set(sl, elm_scroll_page_scroll_friction_get());
2526 elm_box_pack_end(bx, sl);
2527 evas_object_show(sl);
2529 evas_object_smart_callback_add(sl, "changed", ps_round, NULL);
2530 evas_object_smart_callback_add(sl, "delay,changed", ps_change, NULL);
2532 LABEL_FRAME_ADD("<hilight>Bring in scroll friction</>");
2534 sl = elm_slider_add(win);
2535 elm_object_tooltip_text_set(sl, "This is the amount of inertia a<br>"
2536 "scroller will impose at region bring<br>"
2538 evas_object_data_set(win, "bring_in_scroll_friction_slider", sl);
2539 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
2540 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
2541 elm_slider_span_size_set(sl, 120);
2542 elm_slider_unit_format_set(sl, "%1.1f");
2543 elm_slider_indicator_format_set(sl, "%1.1f");
2544 elm_slider_min_max_set(sl, 0.0, 5.0);
2545 elm_slider_value_set(sl, elm_scroll_bring_in_scroll_friction_get());
2546 elm_box_pack_end(bx, sl);
2547 evas_object_show(sl);
2549 evas_object_smart_callback_add(sl, "changed", bis_round, NULL);
2550 evas_object_smart_callback_add(sl, "delay,changed", bis_change, NULL);
2552 LABEL_FRAME_ADD("<hilight>Zoom scroll friction</>");
2554 sl = elm_slider_add(win);
2555 elm_object_tooltip_text_set(sl, "This is the amount of inertia<br>"
2556 "scrollers will impose at animations<br>"
2557 "triggered by Elementary widgets'<br>"
2559 evas_object_data_set(win, "zoom_scroll_friction_slider", sl);
2560 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
2561 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
2562 elm_slider_span_size_set(sl, 120);
2563 elm_slider_unit_format_set(sl, "%1.1f");
2564 elm_slider_indicator_format_set(sl, "%1.1f");
2565 elm_slider_min_max_set(sl, 0.0, 5.0);
2566 elm_slider_value_set(sl, elm_scroll_zoom_friction_get());
2567 elm_box_pack_end(bx, sl);
2568 evas_object_show(sl);
2570 evas_object_smart_callback_add(sl, "changed", zf_round, NULL);
2571 evas_object_smart_callback_add(sl, "delay,changed", zf_change, NULL);
2573 evas_object_data_set(win, "scrolling", sc);
2575 elm_pager_content_push(pager, sc);
2579 _engine_name_prettify(const char *engine)
2583 ret = strdup(engine);
2586 while ((ptr = strpbrk(ret, "_")))
2594 /* FIXME! ideally, we would trim elm_config.c's _elm_engines list at
2595 build time, making a getter for is as in ecore-evas. */
2597 _elm_engine_supported(const char *engine)
2599 const char *engines[] = {
2608 "software_16_wince_gdi",
2617 for (i = 0; engines[i]; i++)
2619 #define ENGINE_COMPARE(name) (!strcmp(engines[i], name))
2620 if (ENGINE_COMPARE(engine))
2622 #undef ENGINE_COMPARE
2629 _engines_list_fill(Evas_Object *l_widget,
2632 const char *engine, *cur_engine;
2633 void *sel_it = NULL;
2639 cur_engine = elm_engine_current_get();
2641 EINA_LIST_FOREACH(e_names, l, engine)
2646 if (!_elm_engine_supported(engine))
2649 label = _engine_name_prettify(engine);
2651 it = elm_list_item_append(l_widget, label, NULL, NULL, NULL,
2653 elm_list_item_del_cb_set(it, _engines_list_item_del_cb);
2654 free((void *)label);
2656 if (!strcmp(cur_engine, engine))
2660 if (sel_it) elm_list_item_selected_set(sel_it, EINA_TRUE);
2661 elm_list_go(l_widget);
2665 _status_config_rendering(Evas_Object *win,
2668 Evas_Object *li, *bx, *fr, *sp, *pd, *bt;
2671 bx = elm_box_add(win);
2672 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2673 evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, EVAS_HINT_FILL);
2675 fr = elm_frame_add(win);
2676 elm_frame_label_set(fr, "Available Engines");
2677 evas_object_size_hint_weight_set(fr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2678 evas_object_size_hint_align_set(fr, EVAS_HINT_FILL, EVAS_HINT_FILL);
2679 elm_box_pack_end(bx, fr);
2680 evas_object_show(fr);
2682 li = elm_list_add(win);
2683 elm_frame_content_set(fr, li);
2684 evas_object_size_hint_weight_set(li, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2685 evas_object_size_hint_align_set(li, EVAS_HINT_FILL, EVAS_HINT_FILL);
2687 engines = ecore_evas_engines_get();
2688 _engines_list_fill(li, engines);
2689 ecore_evas_engines_free(engines);
2691 evas_object_show(li);
2692 evas_object_data_set(win, "engines_list", li);
2694 /////////////////////////////////////////////
2695 sp = elm_separator_add(win);
2696 elm_separator_horizontal_set(sp, EINA_TRUE);
2697 evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, 0.0);
2698 evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5);
2699 elm_box_pack_end(bx, sp);
2700 evas_object_show(sp);
2702 pd = elm_frame_add(win);
2703 elm_object_style_set(pd, "pad_medium");
2704 evas_object_size_hint_weight_set(pd, 0.0, 0.0);
2705 evas_object_size_hint_align_set(pd, 0.5, 0.5);
2706 elm_box_pack_end(bx, pd);
2707 evas_object_show(pd);
2709 bt = elm_button_add(win);
2710 evas_object_smart_callback_add(bt, "clicked", _engine_use, li);
2711 elm_button_label_set(bt, "Use Engine");
2712 evas_object_size_hint_weight_set(bt, 0.0, 0.0);
2713 evas_object_size_hint_align_set(bt, 0.5, 0.5);
2714 elm_frame_content_set(pd, bt);
2715 evas_object_show(bt);
2717 evas_object_data_set(win, "rendering", bx);
2718 elm_pager_content_push(pager, bx);
2722 _status_config_caches(Evas_Object *win,
2725 Evas_Object *lb, *pd, *bx, *sl, *sp, *ck;
2727 bx = elm_box_add(win);
2728 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, 0.0);
2729 evas_object_size_hint_align_set(bx, EVAS_HINT_FILL, 0.5);
2731 LABEL_FRAME_ADD("<hilight>Cache Flush Interval (8 ticks pre second)</>");
2733 sl = elm_slider_add(win);
2734 evas_object_data_set(win, "cache_flush_interval_slider", sl);
2735 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
2736 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
2737 elm_slider_span_size_set(sl, 120);
2738 elm_slider_unit_format_set(sl, "%1.0f ticks");
2739 elm_slider_indicator_format_set(sl, "%1.0f");
2740 elm_slider_min_max_set(sl, 8.0, 4096.0);
2741 elm_slider_value_set(sl, elm_cache_flush_interval_get());
2742 elm_object_disabled_set(sl, !elm_cache_flush_enabled_get());
2744 ck = elm_check_add(win);
2745 evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, 0.0);
2746 evas_object_size_hint_align_set(ck, EVAS_HINT_FILL, 0.5);
2747 elm_check_label_set(ck, "Enable Flushing");
2748 elm_check_state_set(ck, elm_cache_flush_enabled_get());
2749 evas_object_smart_callback_add(ck, "changed", cf_enable, sl);
2750 elm_box_pack_end(bx, ck);
2751 evas_object_show(ck);
2753 elm_box_pack_end(bx, sl);
2754 evas_object_show(sl);
2756 evas_object_smart_callback_add(sl, "changed", cf_round, NULL);
2757 evas_object_smart_callback_add(sl, "delay,changed", cf_change, NULL);
2759 sp = elm_separator_add(win);
2760 elm_separator_horizontal_set(sp, 1);
2761 evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, 0.0);
2762 evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5);
2763 elm_box_pack_end(bx, sp);
2764 evas_object_show(sp);
2766 LABEL_FRAME_ADD("<hilight>Font Cache Size</>");
2768 sl = elm_slider_add(win);
2769 evas_object_data_set(win, "font_cache_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.1f MB");
2774 elm_slider_indicator_format_set(sl, "%1.1f");
2775 elm_slider_min_max_set(sl, 0.0, 4.0);
2776 elm_slider_value_set(sl, (double)elm_font_cache_get() / 1024.0);
2777 elm_box_pack_end(bx, sl);
2778 evas_object_show(sl);
2780 evas_object_smart_callback_add(sl, "changed", fc_round, NULL);
2781 evas_object_smart_callback_add(sl, "delay,changed", fc_change, NULL);
2783 sp = elm_separator_add(win);
2784 elm_separator_horizontal_set(sp, 1);
2785 evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, 0.0);
2786 evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5);
2787 elm_box_pack_end(bx, sp);
2788 evas_object_show(sp);
2790 LABEL_FRAME_ADD("<hilight>Image Cache Size</>");
2792 sl = elm_slider_add(win);
2793 evas_object_data_set(win, "image_cache_slider", sl);
2794 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
2795 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
2796 elm_slider_span_size_set(sl, 120);
2797 elm_slider_unit_format_set(sl, "%1.0f MB");
2798 elm_slider_indicator_format_set(sl, "%1.0f");
2799 elm_slider_min_max_set(sl, 0, 32);
2800 elm_slider_value_set(sl, (double)elm_image_cache_get() / 1024.0);
2801 elm_box_pack_end(bx, sl);
2802 evas_object_show(sl);
2804 evas_object_smart_callback_add(sl, "changed", ic_round, NULL);
2805 evas_object_smart_callback_add(sl, "delay,changed", ic_change, NULL);
2807 sp = elm_separator_add(win);
2808 elm_separator_horizontal_set(sp, 1);
2809 evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, 0.0);
2810 evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5);
2811 elm_box_pack_end(bx, sp);
2812 evas_object_show(sp);
2814 LABEL_FRAME_ADD("<hilight>Number of Edje Files to Cache</>");
2816 sl = elm_slider_add(win);
2817 evas_object_data_set(win, "edje_file_cache_slider", sl);
2818 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
2819 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
2820 elm_slider_span_size_set(sl, 120);
2821 elm_slider_unit_format_set(sl, "%1.0f files");
2822 elm_slider_indicator_format_set(sl, "%1.0f");
2823 elm_slider_min_max_set(sl, 0, 32);
2824 elm_slider_value_set(sl, elm_edje_file_cache_get());
2825 elm_box_pack_end(bx, sl);
2826 evas_object_show(sl);
2828 evas_object_smart_callback_add(sl, "changed", efc_round, NULL);
2829 evas_object_smart_callback_add(sl, "delay,changed", efc_change, NULL);
2831 sp = elm_separator_add(win);
2832 elm_separator_horizontal_set(sp, 1);
2833 evas_object_size_hint_weight_set(sp, EVAS_HINT_EXPAND, 0.0);
2834 evas_object_size_hint_align_set(sp, EVAS_HINT_FILL, 0.5);
2835 elm_box_pack_end(bx, sp);
2836 evas_object_show(sp);
2838 LABEL_FRAME_ADD("<hilight>Number of Edje Collections to Cache</>");
2840 sl = elm_slider_add(win);
2841 evas_object_data_set(win, "edje_collection_cache_slider", sl);
2842 evas_object_size_hint_weight_set(sl, EVAS_HINT_EXPAND, 0.0);
2843 evas_object_size_hint_align_set(sl, EVAS_HINT_FILL, 0.5);
2844 elm_slider_span_size_set(sl, 120);
2845 elm_slider_unit_format_set(sl, "%1.0f collections");
2846 elm_slider_indicator_format_set(sl, "%1.0f");
2847 elm_slider_min_max_set(sl, 0, 128);
2848 elm_slider_value_set(sl, elm_edje_collection_cache_get());
2849 elm_box_pack_end(bx, sl);
2850 evas_object_show(sl);
2852 evas_object_smart_callback_add(sl, "changed", ecc_round, NULL);
2853 evas_object_smart_callback_add(sl, "delay,changed", ecc_change, NULL);
2855 evas_object_data_set(win, "caches", bx);
2857 elm_pager_content_push(pager, bx);
2861 _status_config_full(Evas_Object *win,
2864 Evas_Object *tb, *pager;
2865 Elm_Toolbar_Item *sizing, *it;
2867 tb = elm_toolbar_add(win);
2868 elm_toolbar_menu_parent_set(tb, win);
2869 elm_toolbar_homogeneous_set(tb, 0);
2870 evas_object_size_hint_weight_set(tb, 1.0, 0.0);
2871 evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
2873 sizing = elm_toolbar_item_append(tb, "zoom-fit-best", "Sizing",
2875 elm_toolbar_item_priority_set(sizing, 100);
2877 it = elm_toolbar_item_append(tb, "preferences-desktop-theme", "Theme",
2879 elm_toolbar_item_priority_set(it, 90);
2881 elm_toolbar_item_append(tb, "preferences-desktop-font", "Fonts",
2884 it = elm_toolbar_item_append(tb, "system-users", "Profiles",
2886 elm_toolbar_item_priority_set(it, 90);
2888 elm_toolbar_item_append(tb, "system-run", "Scrolling", _cf_scrolling, win);
2889 elm_toolbar_item_append(tb, "video-display", "Rendering",
2890 _cf_rendering, win);
2891 elm_toolbar_item_append(tb, "appointment-new", "Caches", _cf_caches, win);
2893 elm_box_pack_end(bx0, tb);
2894 evas_object_show(tb);
2896 pager = elm_pager_add(win);
2897 evas_object_size_hint_align_set(pager, EVAS_HINT_FILL, EVAS_HINT_FILL);
2898 evas_object_size_hint_weight_set(pager, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
2899 evas_object_data_set(win, "pager", pager);
2901 _status_config_themes(win, pager);
2902 _status_config_fonts(win, pager);
2903 _status_config_profiles(win, pager);
2904 _status_config_rendering(win, pager);
2905 _status_config_scrolling(win, pager);
2906 _status_config_caches(win, pager);
2907 _status_config_sizing(win, pager);
2909 // FIXME uncomment after flip style fix, please
2910 //elm_object_style_set(pager, "flip");
2911 elm_toolbar_item_selected_set(sizing, EINA_TRUE);
2912 elm_box_pack_end(bx0, pager);
2913 evas_object_show(pager);
2919 Evas_Object *win, *bg, *bx0;
2921 win = elm_win_add(NULL, "main", ELM_WIN_BASIC);
2922 elm_win_title_set(win, "Elementary Config");
2924 evas_object_smart_callback_add(win, "delete,request", config_exit, NULL);
2925 bg = elm_bg_add(win);
2926 evas_object_size_hint_weight_set(bg, 1.0, 1.0);
2927 elm_win_resize_object_add(win, bg);
2928 evas_object_show(bg);
2930 bx0 = elm_box_add(win);
2931 evas_object_size_hint_weight_set(bx0, 1.0, 1.0);
2932 elm_win_resize_object_add(win, bx0);
2933 evas_object_show(bx0);
2935 if (!interactive) _status_basic(win, bx0);
2937 _status_config(win, bx0);
2938 else _status_config_full(win, bx0);
2940 evas_object_resize(win, 320, 480);
2941 evas_object_show(win);
2945 _exit_timer(void *data __UNUSED__)
2948 return ECORE_CALLBACK_CANCEL;
2951 /* this is your elementary main function - it MUST be called IMMEDIATELY
2952 * after elm_init() and MUST be passed argc and argv, and MUST be called
2953 * elm_main and not be static - must be a visible symbol with EAPI infront */
2960 elm_app_info_set(elm_main, "elementary", "images/logo.png");
2961 elm_app_compile_bin_dir_set(PACKAGE_BIN_DIR);
2962 elm_app_compile_data_dir_set(PACKAGE_DATA_DIR);
2964 for (i = 1; i < argc; i++)
2966 if (!strcmp(argv[i], "-h"))
2970 " -q Quiet mode (dont show window)\n"
2971 " -t THEME Set theme to THEME (ELM_THEME spec)\n"
2972 " -f SIZE Set finger size to SIZE pixels\n"
2973 " -s SCALE Set scale factor to SCALE\n"
2976 else if (!strcmp(argv[i], "-q"))
2981 else if ((!strcmp(argv[i], "-t")) && (i < argc - 1))
2984 theme_set = argv[i];
2987 else if ((!strcmp(argv[i], "-f")) && (i < argc - 1))
2990 finger_size_set = argv[i];
2993 else if ((!strcmp(argv[i], "-s")) && (i < argc - 1))
2996 scale_set = argv[i];
3000 /* put here any init code specific to this app like parsing args, etc. */
3006 status_win(); /* create main window */
3008 ecore_timer_add(2.0, _exit_timer, NULL);
3014 elm_theme_all_set(theme_set);
3016 if (finger_size_set)
3018 elm_finger_size_all_set(atoi(finger_size_set));
3022 elm_scale_all_set(atof(scale_set));
3029 elm_run(); /* and run the program now and handle all events, etc. */
3030 /* if the mainloop that elm_run() runs exists, we exit the app */
3031 elm_shutdown(); /* clean up and shut down */
3037 /* All emelentary apps should use this. Put it right after elm_main() */