2 # include "elementary_config.h"
4 #include <Elementary.h>
5 #ifndef ELM_LIB_QUICKLAUNCH
8 aspect_fixed_cb(void *data, Evas_Object *obj, void *event_info __UNUSED__)
10 Evas_Object *ic = (Evas_Object *)data;
11 elm_icon_aspect_fixed_set(ic, elm_check_state_get(obj));
15 fill_outside_cb(void *data, Evas_Object *obj, void *event_info __UNUSED__)
17 Evas_Object *ic = (Evas_Object *)data;
18 elm_icon_fill_outside_set(ic, elm_check_state_get(obj));
22 smooth_cb(void *data, Evas_Object *obj, void *event_info __UNUSED__)
24 Evas_Object *ic = (Evas_Object *)data;
25 elm_icon_smooth_set(ic, elm_check_state_get(obj));
29 bt_clicked(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
31 Evas_Object *win, *ic;
34 win = elm_win_util_standard_add("preload-prescale", "Preload & Prescale");
35 elm_win_autodel_set(win, EINA_TRUE);
37 ic = elm_icon_add(win);
38 elm_win_resize_object_add(win, ic);
39 snprintf(buf, sizeof(buf), "%s/images/insanely_huge_test_image.jpg",
40 elm_app_data_dir_get());
41 elm_icon_file_set(ic, buf, NULL);
43 evas_object_size_hint_weight_set(ic, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
44 evas_object_size_hint_align_set(ic, EVAS_HINT_FILL, EVAS_HINT_FILL);
45 elm_icon_resizable_set(ic, EINA_TRUE, EINA_TRUE);
46 elm_icon_aspect_fixed_set(ic, EINA_FALSE);
47 elm_icon_preload_disabled_set(ic, EINA_TRUE);
48 elm_icon_prescale_set(ic, EINA_TRUE);
51 evas_object_resize(win, 350, 350);
52 evas_object_show(win);
56 test_icon(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
58 Evas_Object *win, *box, *content_box, *hbox, *tg, *bt;
59 win = elm_win_util_standard_add("icon test", "Icon Test");
60 elm_win_autodel_set(win, EINA_TRUE);
62 box = elm_box_add(win);
63 elm_win_resize_object_add(win, box);
64 evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
65 evas_object_show(box);
67 content_box = elm_box_add(win);
68 elm_win_resize_object_add(win, content_box);
69 evas_object_size_hint_weight_set(content_box, EVAS_HINT_EXPAND,
71 evas_object_size_hint_align_set(content_box, EVAS_HINT_FILL,
73 elm_box_pack_end(box, content_box);
74 evas_object_show(content_box);
76 Evas_Object *ic = elm_icon_add(win);
78 snprintf(buf, sizeof(buf), "%s/images/logo.png", elm_app_data_dir_get());
79 elm_icon_file_set(ic, buf, NULL);
80 elm_icon_resizable_set(ic, EINA_TRUE, EINA_TRUE);
81 evas_object_size_hint_weight_set(ic, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
82 evas_object_size_hint_align_set(ic, EVAS_HINT_FILL, EVAS_HINT_FILL);
84 elm_box_pack_end(content_box, ic);
87 hbox = elm_box_add(win);
88 elm_box_horizontal_set(hbox, EINA_TRUE);
89 evas_object_size_hint_weight_set(content_box, EVAS_HINT_EXPAND,
91 elm_box_pack_end(box, hbox);
92 evas_object_show(hbox);
94 /* Test Aspect Fixed */
95 tg = elm_check_add(win);
96 elm_object_text_set(tg, "Aspect Fixed");
97 elm_check_state_set(tg, EINA_TRUE);
98 evas_object_smart_callback_add(tg, "changed", aspect_fixed_cb, ic);
99 elm_box_pack_end(hbox, tg);
100 evas_object_show(tg);
102 /* Test Fill Outside */
103 tg = elm_check_add(win);
104 elm_object_text_set(tg, "Fill Outside");
105 evas_object_smart_callback_add(tg, "changed", fill_outside_cb, ic);
106 elm_box_pack_end(hbox, tg);
107 evas_object_show(tg);
110 tg = elm_check_add(win);
111 elm_object_text_set(tg, "Smooth");
112 elm_check_state_set(tg, EINA_TRUE);
113 evas_object_smart_callback_add(tg, "changed", smooth_cb, ic);
114 elm_box_pack_end(hbox, tg);
115 evas_object_show(tg);
117 /* Test Preload, Prescale */
118 bt = elm_button_add(win);
119 elm_object_text_set(bt, "Preload & Prescale");
120 evas_object_smart_callback_add(bt, "clicked", bt_clicked, NULL);
121 elm_box_pack_end(hbox, bt);
122 evas_object_show(bt);
124 evas_object_resize(win, 400, 400);
125 evas_object_show(win);
129 icon_clicked(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
131 printf("clicked!\n");
135 test_icon_transparent(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
137 Evas_Object *win, *ic;
140 win = elm_win_add(NULL, "icon-transparent", ELM_WIN_BASIC);
141 elm_win_title_set(win, "Icon Transparent");
142 elm_win_autodel_set(win, EINA_TRUE);
143 elm_win_alpha_set(win, EINA_TRUE);
145 ic = elm_icon_add(win);
146 snprintf(buf, sizeof(buf), "%s/images/logo.png", elm_app_data_dir_get());
147 elm_icon_file_set(ic, buf, NULL);
148 elm_icon_resizable_set(ic, 0, 0);
149 elm_icon_no_scale_set(ic, 1);
150 evas_object_size_hint_weight_set(ic, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
151 evas_object_size_hint_fill_set(ic, 0.5, 0.5);
152 elm_win_resize_object_add(win, ic);
153 evas_object_show(ic);
155 evas_object_smart_callback_add(ic, "clicked", icon_clicked, NULL);
157 evas_object_show(win);