summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaeun Choi <jaeun12.choi@samsung.com>2017-08-04 16:25:38 +0900
committerJaeun Choi <jaeun12.choi@samsung.com>2017-10-25 14:12:47 +0900
commit0013385698cae3c9780185b0896fd82c840dd360 (patch)
tree0a318b43882870a2e292da071c6a935f9f1030af
parent88359e73f39b568e96c3aebd51687a20b0bcf414 (diff)
Add a demo: Efl.Ui.Pagescroller + Efl.Ui.Pageindicator
-rwxr-xr-xsrc/examples/elementary/pagecontrol.c72
-rw-r--r--src/examples/elementary/pagecontrol.edc21
2 files changed, 93 insertions, 0 deletions
diff --git a/src/examples/elementary/pagecontrol.c b/src/examples/elementary/pagecontrol.c
new file mode 100755
index 0000000000..050528bee7
--- /dev/null
+++ b/src/examples/elementary/pagecontrol.c
@@ -0,0 +1,72 @@
1//Compile with:
2//edje_cc pagecontrol.edc
3//gcc -g -o pagecontrol pagecontrol.c `pkg-config --cflags --libs elementary`
4
5
6#define EFL_BETA_API_SUPPORT
7#define EFL_EO_API_SUPPORT
8
9#include <Elementary.h>
10
11#define WIN_WIDTH 300
12#define WIN_HEIGHT 400
13
14
15EAPI_MAIN int
16elm_main(int argc,
17 char **argv)
18{
19 Eo *win, *layout, *obj, *ind, *rect;
20 Efl_Page_Transition *tran;
21
22 // Window
23 win = efl_add(efl_ui_win_class_get(), NULL, "test", ELM_WIN_BASIC);
24 efl_gfx_size_set(win, WIN_WIDTH, WIN_HEIGHT);
25 efl_gfx_visible_set(win, EINA_TRUE);
26
27 // Layout
28 layout = efl_add(ELM_LAYOUT_CLASS, win);
29 efl_gfx_size_hint_weight_set(layout, 1, 1);
30 efl_file_set(layout, "pagecontrol.edj", "pagecontrol_example");
31 efl_content_set(win, layout);
32
33 // Pagescroller
34 //obj = efl_add(EFL_UI_PAGECONTROL_CLASS, win);
35 obj = efl_add(EFL_UI_PAGESCROLLER_CLASS, win);
36 efl_content_set(efl_part(layout, "pagecontrol"), obj);
37
38 // Pagescroller Transition Effect
39 tran = efl_add(EFL_PAGE_TRANSITION_SCROLL_CLASS, NULL);
40 //tran = efl_add(EFL_PAGE_TRANSITION_CUBE_CLASS, NULL);
41 //tran = efl_add(EFL_PAGE_TRANSITION_ROTATE_CLASS, NULL);
42 efl_ui_pagescroller_transition_set(obj, tran);
43
44 // Pages
45 rect = efl_add(EFL_CANVAS_RECTANGLE_CLASS,
46 efl_provider_find(obj, EVAS_CANVAS_CLASS));
47 efl_gfx_visible_set(rect, EINA_TRUE);
48 efl_gfx_color_set(rect, 255, 0, 0, 255);
49 efl_pack_end(obj, rect);
50
51 rect = efl_add(EFL_CANVAS_RECTANGLE_CLASS,
52 efl_provider_find(obj, EVAS_CANVAS_CLASS));
53 efl_gfx_visible_set(rect, EINA_TRUE);
54 efl_gfx_color_set(rect, 0, 255, 0, 255);
55 efl_pack_end(obj, rect);
56
57 rect = efl_add(EFL_CANVAS_RECTANGLE_CLASS,
58 efl_provider_find(obj, EVAS_CANVAS_CLASS));
59 efl_gfx_visible_set(rect, EINA_TRUE);
60 efl_gfx_color_set(rect, 0, 0, 255, 255);
61 efl_pack_end(obj, rect);
62
63 // Page Indicator
64 ind = efl_add(EFL_UI_PAGEINDICATOR_CLASS, layout);
65 efl_content_set(efl_part(layout, "pageindicator"), ind);
66 efl_ui_pageindicator_bind(ind, obj);
67
68 elm_run();
69
70 return 0;
71}
72ELM_MAIN()
diff --git a/src/examples/elementary/pagecontrol.edc b/src/examples/elementary/pagecontrol.edc
new file mode 100644
index 0000000000..f89f262d7c
--- /dev/null
+++ b/src/examples/elementary/pagecontrol.edc
@@ -0,0 +1,21 @@
1collections {
2 group {
3 name: "pagecontrol_example";
4 parts {
5 rect { "bg";
6 desc { "default";
7 color: 0 0 0 255;
8 }
9 }
10 swallow { "pagecontrol";
11 desc { "default";
12 }
13 }
14 swallow { "pageindicator";
15 desc { "default";
16 rel2.relative: 1.0 0.1;
17 }
18 }
19 }
20 }
21}