summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Juyung Seo <seojuyung2@gmailcom>2013-05-12 12:31:13 +0900
committerDaniel Juyung Seo <seojuyung2@gmailcom>2013-05-12 12:31:13 +0900
commit7ce52e5feae0442b3000b3aed7a2681129b24e15 (patch)
tree6030b5284cad1514ef946088434af1579bb3a336
parentaccc186e3efaa9738791a10200434ffd2808f21b (diff)
template: added a template
-rw-r--r--sample/template/01-win/Makefile4
-rw-r--r--sample/template/01-win/main.c30
-rw-r--r--sample/template/02-layout/Makefile4
-rw-r--r--sample/template/02-layout/main.c46
-rw-r--r--sample/template/03-top-contents/Makefile4
-rw-r--r--sample/template/03-top-contents/main.c97
-rw-r--r--sample/template/04-middle-contents/Makefile4
-rw-r--r--sample/template/04-middle-contents/main.c133
-rw-r--r--sample/template/05-arrow-btn/Makefile4
-rw-r--r--sample/template/05-arrow-btn/main.c149
-rw-r--r--sample/template/06-toolbar/Makefile4
-rw-r--r--sample/template/06-toolbar/main.c174
12 files changed, 653 insertions, 0 deletions
diff --git a/sample/template/01-win/Makefile b/sample/template/01-win/Makefile
new file mode 100644
index 0000000..deca0e5
--- /dev/null
+++ b/sample/template/01-win/Makefile
@@ -0,0 +1,4 @@
1all: sample
2
3sample: main.c
4 gcc main.c -o sample `pkg-config --cflags --libs elementary` -g -Wall
diff --git a/sample/template/01-win/main.c b/sample/template/01-win/main.c
new file mode 100644
index 0000000..96b8da0
--- /dev/null
+++ b/sample/template/01-win/main.c
@@ -0,0 +1,30 @@
1#include <Elementary.h>
2
3void
4init()
5{
6 Evas_Object *win, *layout;
7 char buf[PATH_MAX];
8
9 //Create a Window
10 win = elm_win_util_standard_add(elm_app_name_get(), elm_app_name_get());
11 elm_win_focus_highlight_enabled_set(win, EINA_TRUE);
12 elm_win_autodel_set(win, EINA_TRUE);
13 evas_object_resize(win, 720, 400);
14 evas_object_show(win);
15}
16
17EAPI_MAIN int
18elm_main(int argc, char **argv)
19{
20 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
21
22 init();
23
24 elm_run();
25
26 elm_shutdown();
27
28 return 0;
29}
30ELM_MAIN()
diff --git a/sample/template/02-layout/Makefile b/sample/template/02-layout/Makefile
new file mode 100644
index 0000000..deca0e5
--- /dev/null
+++ b/sample/template/02-layout/Makefile
@@ -0,0 +1,4 @@
1all: sample
2
3sample: main.c
4 gcc main.c -o sample `pkg-config --cflags --libs elementary` -g -Wall
diff --git a/sample/template/02-layout/main.c b/sample/template/02-layout/main.c
new file mode 100644
index 0000000..771026d
--- /dev/null
+++ b/sample/template/02-layout/main.c
@@ -0,0 +1,46 @@
1#include <Elementary.h>
2
3#define PACKAGE_BIN_DIR "/usr/local/bin"
4#define PACKAGE_DATA_DIR "/usr/local/share/sample"
5
6void
7init()
8{
9 Evas_Object *win, *layout;
10 char buf[PATH_MAX];
11
12 //Create a Window
13 win = elm_win_util_standard_add(elm_app_name_get(), elm_app_name_get());
14 elm_win_focus_highlight_enabled_set(win, EINA_TRUE);
15 elm_win_autodel_set(win, EINA_TRUE);
16 evas_object_resize(win, 720, 400);
17 evas_object_show(win);
18
19 //Create a Layout
20 layout = elm_layout_add(win);
21 snprintf(buf, sizeof(buf), "%s/edj/layout.edj", PACKAGE_DATA_DIR);
22 elm_layout_file_set(layout, buf, "main");
23 evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
24 elm_win_resize_object_add(win, layout);
25 evas_object_show(layout);
26}
27
28EAPI_MAIN int
29elm_main(int argc, char **argv)
30{
31 //Set App Directory
32 elm_app_compile_bin_dir_set(PACKAGE_BIN_DIR);
33 elm_app_compile_data_dir_set(PACKAGE_DATA_DIR);
34 elm_app_info_set(elm_main, "sample", "images/kakaotalk_icon_s.png");
35
36 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
37
38 init();
39
40 elm_run();
41
42 elm_shutdown();
43
44 return 0;
45}
46ELM_MAIN()
diff --git a/sample/template/03-top-contents/Makefile b/sample/template/03-top-contents/Makefile
new file mode 100644
index 0000000..deca0e5
--- /dev/null
+++ b/sample/template/03-top-contents/Makefile
@@ -0,0 +1,4 @@
1all: sample
2
3sample: main.c
4 gcc main.c -o sample `pkg-config --cflags --libs elementary` -g -Wall
diff --git a/sample/template/03-top-contents/main.c b/sample/template/03-top-contents/main.c
new file mode 100644
index 0000000..4009c53
--- /dev/null
+++ b/sample/template/03-top-contents/main.c
@@ -0,0 +1,97 @@
1#include <Elementary.h>
2
3#define PACKAGE_BIN_DIR "/usr/local/bin"
4#define PACKAGE_DATA_DIR "/usr/local/share/sample"
5
6Evas_Object *
7create_button(Evas_Object *parent)
8{
9 Evas_Object *btn;
10 btn = elm_button_add(parent);
11 evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
12 evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
13 evas_object_show(btn);
14
15 return btn;
16}
17
18Evas_Object *
19create_image(Evas_Object *parent, char *path, char *group)
20{
21 Evas_Object *img;
22 img = elm_image_add(parent);
23 elm_image_file_set(img, path, group);
24 evas_object_show(img);
25
26 return img;
27}
28
29void
30init()
31{
32 Evas_Object *win, *layout, *table, *btn, *img, *label;
33 char buf[PATH_MAX], buf2[256];
34 int i;
35
36 //Create a Window
37 win = elm_win_util_standard_add(elm_app_name_get(), elm_app_name_get());
38 elm_win_focus_highlight_enabled_set(win, EINA_TRUE);
39 elm_win_autodel_set(win, EINA_TRUE);
40 evas_object_resize(win, 720, 400);
41 evas_object_show(win);
42
43 //Create a Layout
44 layout = elm_layout_add(win);
45 snprintf(buf, sizeof(buf), "%s/edj/layout.edj", PACKAGE_DATA_DIR);
46 elm_layout_file_set(layout, buf, "main");
47 evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
48 elm_win_resize_object_add(win, layout);
49 evas_object_show(layout);
50
51 //Create Top Contents
52 table = elm_table_add(layout);
53
54 for (i = 0; i < 5; i++)
55 {
56 btn = create_button(table);
57
58 snprintf(buf, sizeof(buf), "%s/edj/layout.edj", PACKAGE_DATA_DIR);
59 snprintf(buf2, sizeof(buf2), "icon%d", i);
60 img = create_image(btn, buf, buf2);
61 elm_object_content_set(btn, img);
62
63 elm_table_pack(table, btn, i, 0, 1, 1);
64
65 label = elm_label_add(table);
66 snprintf(buf2, sizeof(buf2), "<color=#ffffff>item%d</color>", i);
67 elm_object_text_set(label, buf2);
68 evas_object_size_hint_weight_set(label, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
69 evas_object_size_hint_align_set(label, 0.5, 0.5);
70 evas_object_show(label);
71
72 elm_table_pack(table, label, i, 1, 1, 1);
73 }
74
75 elm_object_part_content_set(layout, "elm.swallow.top", table);
76 evas_object_show(table);
77}
78
79EAPI_MAIN int
80elm_main(int argc, char **argv)
81{
82 //Set App Directory
83 elm_app_compile_bin_dir_set(PACKAGE_BIN_DIR);
84 elm_app_compile_data_dir_set(PACKAGE_DATA_DIR);
85 elm_app_info_set(elm_main, "sample", "images/kakaotalk_icon_s.png");
86
87 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
88
89 init();
90
91 elm_run();
92
93 elm_shutdown();
94
95 return 0;
96}
97ELM_MAIN()
diff --git a/sample/template/04-middle-contents/Makefile b/sample/template/04-middle-contents/Makefile
new file mode 100644
index 0000000..deca0e5
--- /dev/null
+++ b/sample/template/04-middle-contents/Makefile
@@ -0,0 +1,4 @@
1all: sample
2
3sample: main.c
4 gcc main.c -o sample `pkg-config --cflags --libs elementary` -g -Wall
diff --git a/sample/template/04-middle-contents/main.c b/sample/template/04-middle-contents/main.c
new file mode 100644
index 0000000..d293418
--- /dev/null
+++ b/sample/template/04-middle-contents/main.c
@@ -0,0 +1,133 @@
1#include <Elementary.h>
2
3#define PACKAGE_BIN_DIR "/usr/local/bin"
4#define PACKAGE_DATA_DIR "/usr/local/share/sample"
5
6Evas_Object *
7create_button(Evas_Object *parent)
8{
9 Evas_Object *btn;
10 btn = elm_button_add(parent);
11 evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
12 evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
13 evas_object_show(btn);
14
15 return btn;
16}
17
18Evas_Object *
19create_image(Evas_Object *parent, char *path, char *group)
20{
21 Evas_Object *img;
22 img = elm_image_add(parent);
23 elm_image_file_set(img, path, group);
24 evas_object_show(img);
25
26 return img;
27}
28
29void
30btn_clicked(void *data, Evas_Object *obj, void *event_info)
31{
32 evas_object_raise(obj);
33
34 Elm_Transit *transit = elm_transit_add();
35 elm_transit_object_add(transit, obj);
36 elm_transit_duration_set(transit, 0.25);
37 elm_transit_auto_reverse_set(transit, EINA_TRUE);
38 elm_transit_effect_zoom_add(transit, 1.0, 1.25);
39 elm_transit_smooth_set(transit, EINA_FALSE);
40 elm_transit_go(transit);
41}
42
43void
44init()
45{
46 Evas_Object *win, *layout, *table, *btn, *img, *label;
47 char buf[PATH_MAX], buf2[256];
48 int i, j;
49 Evas_Coord padding_size;
50
51 //Create a Window
52 win = elm_win_util_standard_add(elm_app_name_get(), elm_app_name_get());
53 elm_win_focus_highlight_enabled_set(win, EINA_TRUE);
54 elm_win_autodel_set(win, EINA_TRUE);
55 evas_object_resize(win, 720, 400);
56 evas_object_show(win);
57
58 //Create a Layout
59 layout = elm_layout_add(win);
60 snprintf(buf, sizeof(buf), "%s/edj/layout.edj", PACKAGE_DATA_DIR);
61 elm_layout_file_set(layout, buf, "main");
62 evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
63 elm_win_resize_object_add(win, layout);
64 evas_object_show(layout);
65
66 //Create Top Contents
67 table = elm_table_add(layout);
68
69 for (i = 0; i < 5; i++)
70 {
71 btn = create_button(table);
72
73 snprintf(buf, sizeof(buf), "%s/edj/layout.edj", PACKAGE_DATA_DIR);
74 snprintf(buf2, sizeof(buf2), "icon%d", i);
75 img = create_image(btn, buf, buf2);
76 elm_object_content_set(btn, img);
77
78 elm_table_pack(table, btn, i, 0, 1, 1);
79
80 label = elm_label_add(table);
81 snprintf(buf2, sizeof(buf2), "<color=#ffffff>item%d</color>", i);
82 elm_object_text_set(label, buf2);
83 evas_object_size_hint_weight_set(label, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
84 evas_object_size_hint_align_set(label, 0.5, 0.5);
85 evas_object_show(label);
86
87 elm_table_pack(table, label, i, 1, 1, 1);
88 }
89
90 elm_object_part_content_set(layout, "elm.swallow.top", table);
91 evas_object_show(table);
92
93 //Create Middle Contents
94 table = elm_table_add(layout);
95 padding_size = 7 * elm_config_scale_get();
96 elm_table_padding_set(table, padding_size, padding_size);
97
98 for (i = 0; i < 3; i++)
99 {
100 for (j = 0; j < 6; j++)
101 {
102 btn = create_button(table);
103 evas_object_smart_callback_add(btn, "clicked", btn_clicked, NULL);
104 snprintf(buf, sizeof(buf), "%s/images/%d.jpg", PACKAGE_DATA_DIR, ((i * 6) + j));
105 img = create_image(btn, buf, NULL);
106 elm_object_content_set(btn, img);
107 elm_table_pack(table, btn, j, i, 1, 1);
108 }
109 }
110
111 elm_object_part_content_set(layout, "elm.swallow.middle", table);
112 evas_object_show(table);
113}
114
115EAPI_MAIN int
116elm_main(int argc, char **argv)
117{
118 //Set App Directory
119 elm_app_compile_bin_dir_set(PACKAGE_BIN_DIR);
120 elm_app_compile_data_dir_set(PACKAGE_DATA_DIR);
121 elm_app_info_set(elm_main, "sample", "images/kakaotalk_icon_s.png");
122
123 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
124
125 init();
126
127 elm_run();
128
129 elm_shutdown();
130
131 return 0;
132}
133ELM_MAIN()
diff --git a/sample/template/05-arrow-btn/Makefile b/sample/template/05-arrow-btn/Makefile
new file mode 100644
index 0000000..deca0e5
--- /dev/null
+++ b/sample/template/05-arrow-btn/Makefile
@@ -0,0 +1,4 @@
1all: sample
2
3sample: main.c
4 gcc main.c -o sample `pkg-config --cflags --libs elementary` -g -Wall
diff --git a/sample/template/05-arrow-btn/main.c b/sample/template/05-arrow-btn/main.c
new file mode 100644
index 0000000..b7cd301
--- /dev/null
+++ b/sample/template/05-arrow-btn/main.c
@@ -0,0 +1,149 @@
1#include <Elementary.h>
2
3#define PACKAGE_BIN_DIR "/usr/local/bin"
4#define PACKAGE_DATA_DIR "/usr/local/share/sample"
5
6Evas_Object *
7create_button(Evas_Object *parent)
8{
9 Evas_Object *btn;
10 btn = elm_button_add(parent);
11 evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
12 evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
13 evas_object_show(btn);
14
15 return btn;
16}
17
18Evas_Object *
19create_image(Evas_Object *parent, char *path, char *group)
20{
21 Evas_Object *img;
22 img = elm_image_add(parent);
23 elm_image_file_set(img, path, group);
24 evas_object_show(img);
25
26 return img;
27}
28
29void
30btn_clicked(void *data, Evas_Object *obj, void *event_info)
31{
32 evas_object_raise(obj);
33
34 Elm_Transit *transit = elm_transit_add();
35 elm_transit_object_add(transit, obj);
36 elm_transit_duration_set(transit, 0.25);
37 elm_transit_auto_reverse_set(transit, EINA_TRUE);
38 elm_transit_effect_zoom_add(transit, 1.0, 1.25);
39 elm_transit_smooth_set(transit, EINA_FALSE);
40 elm_transit_go(transit);
41}
42
43void
44init()
45{
46 Evas_Object *win, *layout, *table, *btn, *img, *label;
47 char buf[PATH_MAX], buf2[256];
48 int i, j;
49 Evas_Coord padding_size;
50
51 //Create a Window
52 win = elm_win_util_standard_add(elm_app_name_get(), elm_app_name_get());
53 elm_win_focus_highlight_enabled_set(win, EINA_TRUE);
54 elm_win_autodel_set(win, EINA_TRUE);
55 evas_object_resize(win, 720, 400);
56 evas_object_show(win);
57
58 //Create a Layout
59 layout = elm_layout_add(win);
60 snprintf(buf, sizeof(buf), "%s/edj/layout.edj", PACKAGE_DATA_DIR);
61 elm_layout_file_set(layout, buf, "main");
62 evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
63 elm_win_resize_object_add(win, layout);
64 evas_object_show(layout);
65
66 //Create Top Contents
67 table = elm_table_add(layout);
68
69 for (i = 0; i < 5; i++)
70 {
71 btn = create_button(table);
72
73 snprintf(buf, sizeof(buf), "%s/edj/layout.edj", PACKAGE_DATA_DIR);
74 snprintf(buf2, sizeof(buf2), "icon%d", i);
75 img = create_image(btn, buf, buf2);
76 elm_object_content_set(btn, img);
77
78 elm_table_pack(table, btn, i, 0, 1, 1);
79
80 label = elm_label_add(table);
81 snprintf(buf2, sizeof(buf2), "<color=#ffffff>item%d</color>", i);
82 elm_object_text_set(label, buf2);
83 evas_object_size_hint_weight_set(label, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
84 evas_object_size_hint_align_set(label, 0.5, 0.5);
85 evas_object_show(label);
86
87 elm_table_pack(table, label, i, 1, 1, 1);
88 }
89
90 elm_object_part_content_set(layout, "elm.swallow.top", table);
91 evas_object_show(table);
92
93 //Create Middle Contents
94 table = elm_table_add(layout);
95 padding_size = 7 * elm_config_scale_get();
96 elm_table_padding_set(table, padding_size, padding_size);
97
98 for (i = 0; i < 3; i++)
99 {
100 for (j = 0; j < 6; j++)
101 {
102 btn = create_button(table);
103 evas_object_smart_callback_add(btn, "clicked", btn_clicked, NULL);
104 snprintf(buf, sizeof(buf), "%s/images/%d.jpg", PACKAGE_DATA_DIR, ((i * 6) + j));
105 img = create_image(btn, buf, NULL);
106 elm_object_content_set(btn, img);
107 elm_table_pack(table, btn, j, i, 1, 1);
108 }
109 }
110
111 elm_object_part_content_set(layout, "elm.swallow.middle", table);
112 evas_object_show(table);
113
114 //Create a Left arrow
115 btn = create_button(table);
116 snprintf(buf, sizeof(buf), "%s/edj/layout.edj", PACKAGE_DATA_DIR);
117 img = create_image(btn, buf, "left_arrow");
118 elm_object_content_set(btn, img);
119 elm_object_part_content_set(layout, "elm.swallow.left_arrow", btn);
120 evas_object_show(btn);
121
122 //Create a Right arrow
123 btn = create_button(table);
124 snprintf(buf, sizeof(buf), "%s/edj/layout.edj", PACKAGE_DATA_DIR);
125 img = create_image(btn, buf, "right_arrow");
126 elm_object_content_set(btn, img);
127 elm_object_part_content_set(layout, "elm.swallow.right_arrow", btn);
128 evas_object_show(btn);
129}
130
131EAPI_MAIN int
132elm_main(int argc, char **argv)
133{
134 //Set App Directory
135 elm_app_compile_bin_dir_set(PACKAGE_BIN_DIR);
136 elm_app_compile_data_dir_set(PACKAGE_DATA_DIR);
137 elm_app_info_set(elm_main, "sample", "images/kakaotalk_icon_s.png");
138
139 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
140
141 init();
142
143 elm_run();
144
145 elm_shutdown();
146
147 return 0;
148}
149ELM_MAIN()
diff --git a/sample/template/06-toolbar/Makefile b/sample/template/06-toolbar/Makefile
new file mode 100644
index 0000000..deca0e5
--- /dev/null
+++ b/sample/template/06-toolbar/Makefile
@@ -0,0 +1,4 @@
1all: sample
2
3sample: main.c
4 gcc main.c -o sample `pkg-config --cflags --libs elementary` -g -Wall
diff --git a/sample/template/06-toolbar/main.c b/sample/template/06-toolbar/main.c
new file mode 100644
index 0000000..575bb8e
--- /dev/null
+++ b/sample/template/06-toolbar/main.c
@@ -0,0 +1,174 @@
1#include <Elementary.h>
2
3#define PACKAGE_BIN_DIR "/usr/local/bin"
4#define PACKAGE_DATA_DIR "/usr/local/share/sample"
5
6Evas_Object *
7create_button(Evas_Object *parent)
8{
9 Evas_Object *btn;
10 btn = elm_button_add(parent);
11 evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
12 evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
13 evas_object_show(btn);
14
15 return btn;
16}
17
18Evas_Object *
19create_image(Evas_Object *parent, char *path, char *group)
20{
21 Evas_Object *img;
22 img = elm_image_add(parent);
23 elm_image_file_set(img, path, group);
24 evas_object_show(img);
25
26 return img;
27}
28
29void
30btn_clicked(void *data, Evas_Object *obj, void *event_info)
31{
32 evas_object_raise(obj);
33
34 Elm_Transit *transit = elm_transit_add();
35 elm_transit_object_add(transit, obj);
36 elm_transit_duration_set(transit, 0.25);
37 elm_transit_auto_reverse_set(transit, EINA_TRUE);
38 elm_transit_effect_zoom_add(transit, 1.0, 1.25);
39 elm_transit_smooth_set(transit, EINA_FALSE);
40 elm_transit_go(transit);
41}
42
43void
44toolbar_it_cb(void *data, Evas_Object *obj, void *event_info)
45{
46 Elm_Object_Item *it = event_info;
47 printf("%s\n", elm_object_item_text_get(it));
48}
49
50void
51init()
52{
53 Evas_Object *win, *layout, *table, *toolbar, *btn, *img, *label;
54 char buf[PATH_MAX], buf2[256];
55 int i, j;
56 Evas_Coord padding_size;
57
58 //Create a Window
59 win = elm_win_util_standard_add(elm_app_name_get(), elm_app_name_get());
60 elm_win_focus_highlight_enabled_set(win, EINA_TRUE);
61 elm_win_autodel_set(win, EINA_TRUE);
62 evas_object_resize(win, 720, 400);
63 evas_object_show(win);
64
65 //Create a Layout
66 layout = elm_layout_add(win);
67 snprintf(buf, sizeof(buf), "%s/edj/layout.edj", PACKAGE_DATA_DIR);
68 elm_layout_file_set(layout, buf, "main");
69 evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
70 elm_win_resize_object_add(win, layout);
71 evas_object_show(layout);
72
73 //Create Top Contents
74 table = elm_table_add(layout);
75
76 for (i = 0; i < 5; i++)
77 {
78 btn = create_button(table);
79
80 snprintf(buf, sizeof(buf), "%s/edj/layout.edj", PACKAGE_DATA_DIR);
81 snprintf(buf2, sizeof(buf2), "icon%d", i);
82 img = create_image(btn, buf, buf2);
83 elm_object_content_set(btn, img);
84
85 elm_table_pack(table, btn, i, 0, 1, 1);
86
87 label = elm_label_add(table);
88 snprintf(buf2, sizeof(buf2), "<color=#ffffff>item%d</color>", i);
89 elm_object_text_set(label, buf2);
90 evas_object_size_hint_weight_set(label, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
91 evas_object_size_hint_align_set(label, 0.5, 0.5);
92 evas_object_show(label);
93
94 elm_table_pack(table, label, i, 1, 1, 1);
95 }
96
97 elm_object_part_content_set(layout, "elm.swallow.top", table);
98 evas_object_show(table);
99
100 //Create Middle Contents
101 table = elm_table_add(layout);
102 padding_size = 7 * elm_config_scale_get();
103 elm_table_padding_set(table, padding_size, padding_size);
104
105 for (i = 0; i < 3; i++)
106 {
107 for (j = 0; j < 6; j++)
108 {
109 btn = create_button(table);
110 evas_object_smart_callback_add(btn, "clicked", btn_clicked, NULL);
111 snprintf(buf, sizeof(buf), "%s/images/%d.jpg", PACKAGE_DATA_DIR, ((i * 6) + j));
112 img = create_image(btn, buf, NULL);
113 elm_object_content_set(btn, img);
114 elm_table_pack(table, btn, j, i, 1, 1);
115 }
116 }
117
118 elm_object_part_content_set(layout, "elm.swallow.middle", table);
119 evas_object_show(table);
120
121 //Create a Left arrow
122 btn = create_button(table);
123 snprintf(buf, sizeof(buf), "%s/edj/layout.edj", PACKAGE_DATA_DIR);
124 img = create_image(btn, buf, "left_arrow");
125 elm_object_content_set(btn, img);
126 elm_object_part_content_set(layout, "elm.swallow.left_arrow", btn);
127 evas_object_show(btn);
128
129 //Create a Right arrow
130 btn = create_button(table);
131 snprintf(buf, sizeof(buf), "%s/edj/layout.edj", PACKAGE_DATA_DIR);
132 img = create_image(btn, buf, "right_arrow");
133 elm_object_content_set(btn, img);
134 elm_object_part_content_set(layout, "elm.swallow.right_arrow", btn);
135 evas_object_show(btn);
136
137 //Create Bottom Contents
138 toolbar = elm_toolbar_add(layout);
139 elm_toolbar_select_mode_set(toolbar, ELM_OBJECT_SELECT_MODE_ALWAYS);
140 elm_toolbar_transverse_expanded_set(toolbar, EINA_TRUE);
141 elm_toolbar_homogeneous_set(toolbar, EINA_TRUE);
142 evas_object_size_hint_weight_set(toolbar, EVAS_HINT_EXPAND, 0);
143 evas_object_size_hint_align_set(toolbar, EVAS_HINT_FILL, 0);
144
145 elm_toolbar_item_append(toolbar, NULL, "Guide", toolbar_it_cb, NULL);
146 elm_toolbar_item_append(toolbar, NULL, "Time Line View", toolbar_it_cb, NULL);
147 elm_toolbar_item_append(toolbar, NULL, "Recorded TV", toolbar_it_cb, NULL);
148 elm_toolbar_item_append(toolbar, NULL, "Downloads", toolbar_it_cb, NULL);
149 elm_toolbar_item_append(toolbar, NULL, "Favorites", toolbar_it_cb, NULL);
150 elm_toolbar_item_append(toolbar, NULL, "YouTube", toolbar_it_cb, NULL);
151
152 elm_object_part_content_set(layout, "elm.swallow.bottom", toolbar);
153 evas_object_show(toolbar);
154}
155
156EAPI_MAIN int
157elm_main(int argc, char **argv)
158{
159 //Set App Directory
160 elm_app_compile_bin_dir_set(PACKAGE_BIN_DIR);
161 elm_app_compile_data_dir_set(PACKAGE_DATA_DIR);
162 elm_app_info_set(elm_main, "sample", "images/kakaotalk_icon_s.png");
163
164 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
165
166 init();
167
168 elm_run();
169
170 elm_shutdown();
171
172 return 0;
173}
174ELM_MAIN()