summaryrefslogtreecommitdiff
path: root/src/bin/elementary
diff options
context:
space:
mode:
authorStefan Schmidt <s.schmidt@samsung.com>2019-11-28 15:39:43 +0100
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-12-03 10:32:55 +0100
commit9e5455619546473341aff4b2df8129b0c599ebbd (patch)
tree6d8fa2e20a3dc5f55f19d68607b49450d038b8e6 /src/bin/elementary
parentfc456d2b77b00b33f6904f882cae69763b59f192 (diff)
elementary_test: remove duplicated file
This file is identical with test_naviframe.c and has no reference in our build system. Found by the use of the Duplo duplicated code checker tool. Signed-off-by: Stefan Schmidt <s.schmidt@samsung.com> Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D10777
Diffstat (limited to 'src/bin/elementary')
-rw-r--r--src/bin/elementary/test_event_animation.c396
1 files changed, 0 insertions, 396 deletions
diff --git a/src/bin/elementary/test_event_animation.c b/src/bin/elementary/test_event_animation.c
deleted file mode 100644
index 8169614..0000000
--- a/src/bin/elementary/test_event_animation.c
+++ /dev/null
@@ -1,396 +0,0 @@
1#ifdef HAVE_CONFIG_H
2# include "elementary_config.h"
3#endif
4#include <Elementary.h>
5
6#define BUTTON_TEXT_SET(BT, TEXT) \
7 elm_object_text_set((BT), (TEXT)); \
8 elm_object_tooltip_text_set((BT), (TEXT)); \
9 elm_object_tooltip_window_mode_set((BT), EINA_TRUE)
10
11static char img1[PATH_MAX];
12static char img2[PATH_MAX];
13static char img3[PATH_MAX];
14static char img4[PATH_MAX];
15static char img5[PATH_MAX];
16static char img6[PATH_MAX];
17static char img7[PATH_MAX];
18
19Evas_Object *
20_content_new(Evas_Object *parent, const char *img)
21{
22 Evas_Object *photo = elm_photo_add(parent);
23 elm_photo_file_set(photo, img);
24 elm_photo_fill_inside_set(photo, EINA_TRUE);
25 elm_object_style_set(photo, "shadow");
26 return photo;
27}
28
29void
30_navi_pop(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
31{
32 elm_naviframe_item_pop(data);
33}
34
35void
36_navi_it_del(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
37{
38 elm_object_item_del(data);
39}
40
41void
42_title_clicked(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
43{
44 printf("Title Clicked!\n");
45}
46
47void
48_item_activated(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
49{
50 Elm_Object_Item *it = event_info;
51 printf("Item(%p) is activated! The Title is \"%s\"\n", it, elm_object_item_text_get(it));
52}
53
54void
55_title_visible(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
56{
57 elm_naviframe_item_title_enabled_set(data,
58 !elm_naviframe_item_title_enabled_get(data),
59 EINA_TRUE);
60}
61
62void
63_promote(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
64{
65 elm_naviframe_item_promote(data);
66}
67
68void
69_page8(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
70{
71 Evas_Object *bt, *bt2, *content, *nf = data;
72 Elm_Object_Item *it;
73
74 snprintf(img6, sizeof(img6), "%s/images/sky_02.jpg", elm_app_data_dir_get());
75 bt = elm_button_add(nf);
76 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
77 BUTTON_TEXT_SET(bt, "Page 7");
78
79 bt2 = elm_button_add(nf);
80 evas_object_size_hint_align_set(bt2, EVAS_HINT_FILL, EVAS_HINT_FILL);
81 BUTTON_TEXT_SET(bt2, "Page 1");
82 evas_object_smart_callback_add(bt2, "clicked", _promote,
83 evas_object_data_get(nf, "page1"));
84 content = _content_new(nf, img6);
85 it = elm_naviframe_item_push(nf, "Page 8", bt, bt2, content, NULL);
86 elm_object_item_part_text_set(it, "subtitle", "Overlap style!");
87
88 evas_object_smart_callback_add(bt, "clicked", _navi_pop, nf);
89}
90
91static void
92_page7_btn_down_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj,
93 void *event_info EINA_UNUSED)
94{
95 evas_object_color_set(obj, 100, 0, 0, 100);
96 _page8(data, NULL, NULL);
97}
98
99static void
100_page7_btn_up_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj,
101 void *event_info EINA_UNUSED)
102{
103 evas_object_color_set(obj, 255, 255, 255, 255);
104 printf("Page7 Button Mouse Up!\n");
105}
106
107Evas_Object *
108_page7_content_new(Evas_Object *nf)
109{
110 Evas_Object *bt;
111
112 bt = elm_button_add(nf);
113 elm_object_text_set(bt, "Page 8");
114 evas_object_event_callback_add(bt, EVAS_CALLBACK_MOUSE_DOWN,
115 _page7_btn_down_cb, nf);
116 evas_object_event_callback_add(bt, EVAS_CALLBACK_MOUSE_UP,
117 _page7_btn_up_cb, NULL);
118
119 return bt;
120}
121
122void
123_page7(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
124{
125 Evas_Object *bt, *bt2, *content, *nf = data;
126 Elm_Object_Item *it;
127
128 bt = elm_button_add(nf);
129 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
130 BUTTON_TEXT_SET(bt, "Page 6");
131
132 bt2 = elm_button_add(nf);
133 evas_object_size_hint_align_set(bt2, EVAS_HINT_FILL, EVAS_HINT_FILL);
134 BUTTON_TEXT_SET(bt2, "Page 8");
135 evas_object_smart_callback_add(bt2, "clicked", _page8, nf);
136 content = _page7_content_new(nf);
137 it = elm_naviframe_item_push(nf, "Page 7", bt, bt2, content, "overlap");
138 elm_object_item_part_text_set(it, "subtitle", "Overlap style!");
139
140 evas_object_smart_callback_add(bt, "clicked", _navi_pop, nf);
141}
142
143void
144_page6(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
145{
146 Evas_Object *bt, *bt2, *content, *nf = data;
147 Elm_Object_Item *it;
148
149 snprintf(img7, sizeof(img7), "%s/images/sky_03.jpg", elm_app_data_dir_get());
150 bt = elm_button_add(nf);
151 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
152 BUTTON_TEXT_SET(bt, "Page 5");
153
154 bt2 = elm_button_add(nf);
155 evas_object_size_hint_align_set(bt2, EVAS_HINT_FILL, EVAS_HINT_FILL);
156 BUTTON_TEXT_SET(bt2, "Page 7");
157 evas_object_smart_callback_add(bt2, "clicked", _page7, nf);
158
159 content = _content_new(nf, img7);
160 it = elm_naviframe_item_push(nf, "Page 6", bt, bt2, content, "overlap");
161 elm_object_item_part_text_set(it, "subtitle", "Overlap style!");
162
163 evas_object_smart_callback_add(bt, "clicked", _navi_pop, nf);
164}
165
166void
167_page5(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
168{
169 Evas_Object *bt, *bt2, *content, *nf = data;
170 Elm_Object_Item *it;
171
172 snprintf(img5, sizeof(img5), "%s/images/sky_01.jpg", elm_app_data_dir_get());
173 bt = elm_button_add(nf);
174 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
175 BUTTON_TEXT_SET(bt, "Page 4");
176
177 bt2 = elm_button_add(nf);
178 evas_object_size_hint_align_set(bt2, EVAS_HINT_FILL, EVAS_HINT_FILL);
179 BUTTON_TEXT_SET(bt2, "Page 6");
180 evas_object_smart_callback_add(bt2, "clicked", _page6, nf);
181
182 content = _content_new(nf, img5);
183 it = elm_naviframe_item_insert_after(nf,
184 elm_naviframe_top_item_get(nf),
185 "Page 5",
186 bt,
187 bt2,
188 content,
189 NULL);
190 elm_object_item_part_text_set(it, "subtitle", "This page is inserted after top item without transition");
191 evas_object_smart_callback_add(bt, "clicked", _navi_it_del, it);
192}
193
194void
195_page4(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
196{
197 Evas_Object *bt, *ic, *content, *nf = data;
198 char buf[PATH_MAX];
199 Elm_Object_Item *it;
200
201 snprintf(img4, sizeof(img4), "%s/images/rock_02.jpg", elm_app_data_dir_get());
202 ic = elm_icon_add(nf);
203 elm_icon_standard_set(ic, "go-right");
204
205 bt = elm_button_add(nf);
206 evas_object_smart_callback_add(bt, "clicked", _page5, nf);
207 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
208 elm_layout_content_set(bt, "icon", ic);
209
210 content = _content_new(nf, img4);
211
212 it = elm_naviframe_item_push(nf,
213 "Page 4",
214 NULL,
215 bt,
216 content,
217 NULL);
218 elm_object_item_part_text_set(it, "subtitle", "Title area visibility test");
219
220 ic = elm_icon_add(nf);
221 snprintf(buf, sizeof(buf), "%s/images/logo_small.png",
222 elm_app_data_dir_get());
223 elm_image_file_set(ic, buf, NULL);
224 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
225 elm_object_item_part_content_set(it, "icon", ic);
226 elm_naviframe_item_title_enabled_set(it, EINA_FALSE, EINA_FALSE);
227 evas_object_smart_callback_add(content, "clicked", _title_visible, it);
228}
229
230void
231_page3(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
232{
233 Evas_Object *bt2, *content, *nf = data;
234
235 snprintf(img3, sizeof(img3), "%s/images/rock_01.jpg", elm_app_data_dir_get());
236 bt2 = elm_button_add(nf);
237 evas_object_size_hint_align_set(bt2, EVAS_HINT_FILL, EVAS_HINT_FILL);
238 BUTTON_TEXT_SET(bt2, "Next");
239 evas_object_smart_callback_add(bt2, "clicked", _page4, nf);
240
241 content = _content_new(nf, img3);
242
243 elm_naviframe_item_push(nf,
244 "Page 3",
245 NULL,
246 bt2,
247 content,
248 NULL);
249}
250
251void
252_page2(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
253{
254 Evas_Object *bt, *content, *ic, *nf = data;
255 Elm_Object_Item *it;
256
257 snprintf(img2, sizeof(img2), "%s/images/plant_01.jpg", elm_app_data_dir_get());
258 bt = elm_button_add(nf);
259 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
260 evas_object_smart_callback_add(bt, "clicked", _page3, nf);
261
262 ic = elm_icon_add(nf);
263 elm_icon_standard_set(ic, "arrow_right");
264 evas_object_size_hint_aspect_set(ic, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
265 elm_layout_content_set(bt, "icon", ic);
266
267 content = _content_new(nf, img2);
268
269 it = elm_naviframe_item_push(nf, "Page 2 - Long Title Here",
270 NULL, bt, content, NULL);
271 elm_object_item_part_text_set(it, "subtitle", "Here is sub-title part!");
272}
273
274void
275test_naviframe(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
276{
277 Evas_Object *win, *nf, *btn, *content;
278 Elm_Object_Item *it;
279
280 snprintf(img1, sizeof(img1), "%s/images/logo.png", elm_app_data_dir_get());
281 win = elm_win_util_standard_add("naviframe", "Naviframe");
282 elm_win_focus_highlight_enabled_set(win, EINA_TRUE);
283 elm_win_autodel_set(win, EINA_TRUE);
284
285 nf = elm_naviframe_add(win);
286 evas_object_size_hint_weight_set(nf, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
287 elm_win_resize_object_add(win, nf);
288 evas_object_show(nf);
289 evas_object_smart_callback_add(nf, "title,clicked", _title_clicked, 0);
290 evas_object_smart_callback_add(nf, "item,activated", _item_activated, NULL);
291
292 btn = elm_button_add(nf);
293 evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
294 evas_object_smart_callback_add(btn, "clicked", _page2, nf);
295 BUTTON_TEXT_SET(btn, "Next");
296 evas_object_show(btn);
297
298 content = _content_new(nf, img1);
299 it = elm_naviframe_item_push(nf, "Page 1", NULL, btn, content, NULL);
300 evas_object_data_set(nf, "page1", it);
301
302 evas_object_resize(win, 400, 400);
303 evas_object_show(win);
304}
305
306void
307test_naviframe2(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
308{
309 Evas_Object *win, *nf, *sc, *btn, *ico, *content;
310 Elm_Object_Item *it;
311
312 snprintf(img1, sizeof(img1), "%s/images/logo.png", elm_app_data_dir_get());
313 win = elm_win_util_standard_add("naviframe", "Naviframe");
314 elm_win_focus_highlight_enabled_set(win, EINA_TRUE);
315 elm_win_autodel_set(win, EINA_TRUE);
316
317 nf = elm_naviframe_add(win);
318 evas_object_size_hint_weight_set(nf, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
319 elm_win_resize_object_add(win, nf);
320 evas_object_show(nf);
321
322 sc = elm_segment_control_add(nf);
323 elm_segment_control_item_add(sc, NULL, "Show All");
324 elm_segment_control_item_add(sc, NULL, "Just Filtered");
325
326 btn = elm_button_add(nf);
327 ico = elm_icon_add(btn);
328 elm_icon_standard_set(ico, "refresh");
329 elm_layout_content_set(btn, "icon", ico);
330
331 content = _content_new(nf, img1);
332 it = elm_naviframe_item_push(nf, NULL, NULL, btn, content, NULL);
333 evas_object_data_set(nf, "page1", it);
334
335 elm_object_item_part_content_set(it, "icon", sc);
336
337 evas_object_resize(win, 400, 400);
338 evas_object_show(win);
339}
340
341static void
342_bt_pop_all(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
343{
344 Elm_Object_Item *it = evas_object_data_get(obj, "root");
345
346 while (elm_naviframe_top_item_get(data) != it)
347 elm_naviframe_item_pop(data);
348}
349
350void
351test_naviframe3(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
352{
353 Evas_Object *win, *tb, *bxh, *nf, *btn, *content;
354 Elm_Object_Item *it;
355
356 snprintf(img1, sizeof(img1), "%s/images/logo.png", elm_app_data_dir_get());
357 win = elm_win_util_standard_add("naviframe", "Naviframe");
358 elm_win_focus_highlight_enabled_set(win, EINA_TRUE);
359 elm_win_autodel_set(win, EINA_TRUE);
360
361 bxh = elm_box_add(win);
362 evas_object_size_hint_weight_set(bxh, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
363 elm_box_horizontal_set(bxh, EINA_TRUE);
364 elm_win_resize_object_add(win, bxh);
365 evas_object_show(bxh);
366
367 tb = elm_toolbar_add(win);
368 evas_object_size_hint_weight_set(tb, 0.0, EVAS_HINT_EXPAND);
369 evas_object_size_hint_align_set(tb, EVAS_HINT_FILL, EVAS_HINT_FILL);
370 elm_toolbar_horizontal_set(tb, EINA_FALSE);
371 elm_toolbar_select_mode_set(tb, ELM_OBJECT_SELECT_MODE_ALWAYS);
372 elm_box_pack_end(bxh, tb);
373 evas_object_show(tb);
374
375 nf = elm_naviframe_add(win);
376 evas_object_size_hint_weight_set(nf, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
377 evas_object_size_hint_align_set(nf, EVAS_HINT_FILL, EVAS_HINT_FILL);
378 elm_box_pack_end(bxh, nf);
379 evas_object_show(nf);
380
381 btn = elm_button_add(nf);
382 evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
383 evas_object_smart_callback_add(btn, "clicked", _page2, nf);
384 BUTTON_TEXT_SET(btn, "Next");
385 evas_object_show(btn);
386
387 content = _content_new(nf, img1);
388 it = elm_naviframe_item_push(nf, "Page 1", NULL, btn, content, NULL);
389 evas_object_data_set(nf, "page1", it);
390
391 evas_object_data_set(tb, "root", it);
392 elm_toolbar_item_append(tb, NULL, "Pop all", _bt_pop_all, nf);
393
394 evas_object_resize(win, 400, 400);
395 evas_object_show(win);
396}