summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaehwan Kim <jae.hwan.kim@samsung.com>2014-10-25 20:34:18 +0900
committerJaehwan Kim <jae.hwan.kim@samsung.com>2014-10-25 20:34:18 +0900
commite6b8b9ffe9575253ce2ee9f95c6dc804f1cc0ea0 (patch)
tree59a86aa64cddb0be007f62a964fc10f77528f6a7
parentb7bd36210e481a39d8f5f591e7ba53aeffff064c (diff)
semina data.
-rw-r--r--Different_sccreen_support.pptxbin0 -> 6259021 bytes
-rw-r--r--multi_screen.c138
-rw-r--r--multi_screen.edc334
3 files changed, 472 insertions, 0 deletions
diff --git a/Different_sccreen_support.pptx b/Different_sccreen_support.pptx
new file mode 100644
index 0000000..ded2d69
--- /dev/null
+++ b/Different_sccreen_support.pptx
Binary files differ
diff --git a/multi_screen.c b/multi_screen.c
new file mode 100644
index 0000000..a1ad7c9
--- /dev/null
+++ b/multi_screen.c
@@ -0,0 +1,138 @@
1//Compile with:
2//gcc -g multi_screen.c -o multi_screen `pkg-config --cflags --libs elementary`
3
4#include <Elementary.h>
5
6#define TABLE "example/table"
7#define BOX "example/box"
8#define TITLE "example/title"
9#define SWALLOW "example/custom"
10
11static int _box_buttons = 0;
12
13static void
14_tbl_btn_cb(void *data, Evas_Object *btn, void *event_info)
15{
16 Evas_Object *layout = data;
17
18 elm_layout_table_unpack(layout, TABLE, btn);
19 evas_object_del(btn);
20}
21
22static void
23_box_btn_cb(void *data, Evas_Object *btn, void *event_info)
24{
25 Evas_Object *layout = data;
26 Evas_Object *item;
27 char buf[30];
28
29 snprintf(buf, sizeof(buf), "Button %02d", _box_buttons++);
30
31 item = elm_button_add(elm_object_parent_widget_get(layout));
32 elm_object_text_set(item, buf);
33 evas_object_size_hint_weight_set(item, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
34 evas_object_size_hint_align_set(item, EVAS_HINT_FILL, EVAS_HINT_FILL);
35 elm_layout_box_insert_before(layout, BOX, item, btn);
36 evas_object_smart_callback_add(item, "clicked", _box_btn_cb, layout);
37 evas_object_show(item);
38}
39
40static void
41_swallow_btn_cb(void *data, Evas_Object *btn, void *event_info)
42{
43 Evas_Object *layout = data;
44 Evas_Object *item;
45
46 elm_layout_table_clear(layout, TABLE, EINA_TRUE);
47 elm_layout_box_remove_all(layout, BOX, EINA_TRUE);
48 item = elm_object_part_content_unset(layout, SWALLOW);
49 evas_object_del(item);
50}
51
52EAPI_MAIN int
53elm_main(int argc, char **argv)
54{
55 Evas_Object *win, *icon, *icon2, *bt, *bt2, *layout;
56 Evas_Object *clk;
57 Evas_Object *item;
58
59 elm_app_info_set(elm_main, "elementary", "multi_screen.edj");
60 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
61
62 win = elm_win_util_standard_add("layout", "Layout");
63 elm_win_autodel_set(win, EINA_TRUE);
64
65 // Adding layout and filling it with widgets
66 layout = elm_layout_add(win);
67 evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
68 elm_win_resize_object_add(win, layout);
69 elm_layout_file_set(layout, "multi_screen.edj", "example/mylayout");
70 evas_object_show(layout);
71
72 // Setting title
73 const char *title = elm_layout_data_get(layout, "title");
74 if (title)
75 {
76 elm_win_title_set(win, title);
77 elm_object_part_text_set(layout, TITLE, title);
78 }
79#if 0
80 // Add icon, clock and button to the table
81 icon = elm_icon_add(win);
82 elm_icon_standard_set(icon, "home");
83 evas_object_size_hint_weight_set(icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
84 evas_object_size_hint_align_set(icon, EVAS_HINT_FILL, EVAS_HINT_FILL);
85 elm_layout_table_pack(layout, TABLE, icon, 0, 0, 1, 1);
86 evas_object_show(icon);
87
88 icon2 = elm_icon_add(win);
89 elm_icon_standard_set(icon2, "close");
90 evas_object_size_hint_weight_set(icon2, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
91 evas_object_size_hint_align_set(icon2, EVAS_HINT_FILL, EVAS_HINT_FILL);
92 elm_layout_table_pack(layout, TABLE, icon2, 1, 0, 1, 1);
93 evas_object_show(icon2);
94
95 clk = elm_clock_add(win);
96 evas_object_size_hint_weight_set(clk, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
97 evas_object_size_hint_align_set(clk, EVAS_HINT_FILL, EVAS_HINT_FILL);
98 elm_layout_table_pack(layout, TABLE, clk, 2, 0, 1, 1);
99 evas_object_show(clk);
100
101 bt = elm_button_add(win);
102 elm_object_text_set(bt, "Click me!");
103 evas_object_size_hint_weight_set(bt, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
104 evas_object_size_hint_align_set(bt, EVAS_HINT_FILL, EVAS_HINT_FILL);
105 elm_layout_table_pack(layout, TABLE, bt, 0, 1, 3, 1);
106 evas_object_smart_callback_add(bt, "clicked", _tbl_btn_cb, layout);
107 evas_object_show(bt);
108
109 item = elm_button_add(win);
110 elm_object_text_set(item, "Position 0");
111 evas_object_size_hint_weight_set(item, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
112 evas_object_size_hint_align_set(item, EVAS_HINT_FILL, EVAS_HINT_FILL);
113 elm_layout_box_insert_at(layout, BOX, item, 0);
114 evas_object_smart_callback_add(item, "clicked", _box_btn_cb, layout);
115 evas_object_show(item);
116
117 item = elm_button_add(win);
118 elm_object_text_set(item, "Prepended");
119 evas_object_size_hint_weight_set(item, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
120 evas_object_size_hint_align_set(item, EVAS_HINT_FILL, EVAS_HINT_FILL);
121 elm_layout_box_prepend(layout, BOX, item);
122 evas_object_smart_callback_add(item, "clicked", _box_btn_cb, layout);
123 evas_object_show(item);
124
125 bt2 = elm_button_add(win);
126 elm_object_text_set(bt2, "Delete All");
127 elm_object_part_content_set(layout, SWALLOW, bt2);
128 evas_object_smart_callback_add(bt2, "clicked", _swallow_btn_cb, layout);
129#endif
130 evas_object_resize(win, 300, 300);
131 evas_object_show(win);
132
133 elm_run();
134 elm_shutdown();
135
136 return 0;
137}
138ELM_MAIN()
diff --git a/multi_screen.edc b/multi_screen.edc
new file mode 100644
index 0000000..e7fc8e1
--- /dev/null
+++ b/multi_screen.edc
@@ -0,0 +1,334 @@
1collections {
2
3 group {
4 name: "example/mylayout";
5
6 data {
7 item: "title" "Different screen support";
8 }
9
10 parts {
11 part {
12 name: "example/title";
13 type: TEXT;
14
15 description {
16 state: "default" 0.0;
17 color: 255 255 255 255;
18 rel1 {
19 relative: 0.0 0.0;
20 offset: 0 0;
21 }
22 rel2 {
23 relative: 1.0 0.2;
24 offset: -1 -1;
25 }
26 text {
27 text: "bla";
28 size: 16;
29 font: "sans";
30 min: 1 1;
31 ellipsis: -1;
32 }
33 }
34 }
35
36 part {
37 name: "header1";
38 type: RECT;
39
40 scale: 1;
41 description {
42 state: "default" 0.0;
43 min: 90 40;
44 fixed: 1 1;
45 align: 0.0 0.0;
46 rel1.relative: 0.0 1.0;
47 rel1.to: "example/title";
48 rel2.relative: 0.0 1.0;
49 rel2.to: "example/title";
50 color: 255 0 0 255;
51 }
52 }
53
54 part {
55 name: "header2";
56 type: RECT;
57
58 scale: 1;
59 description {
60 state: "default" 0.0;
61 min: 0 40;
62 fixed: 1 1;
63 align: 0.5 0.0;
64 rel1.relative: 1.0 1.0;
65 rel1.to_x: "header1";
66 rel1.to_y: "example/title";
67 rel2.relative: 0.0 1.0;
68 rel2.to_x: "header3";
69 rel2.to_y: "example/title";
70 color: 255 255 0 255;
71 }
72 }
73
74 part {
75 name: "header3";
76 type: RECT;
77
78 scale: 1;
79 description {
80 state: "default" 0.0;
81 min: 60 40;
82 fixed: 1 1;
83 align: 1.0 0.0;
84 rel1.relative: 1.0 1.0;
85 rel1.to: "example/title";
86 rel2.relative: 1.0 1.0;
87 rel2.to: "example/title";
88 color: 0 0 255 255;
89 }
90 }
91
92 part {
93 name: "center";
94 type: RECT;
95
96 scale: 1;
97 description {
98 state: "default" 0.0;
99 rel1.relative: 0.0 1.0;
100 rel1.to: "header1";
101 rel2.relative: 1.0 0.0;
102 rel2.to: "footer3";
103 color: 0 255 0 255;
104 }
105 }
106
107 part {
108 name: "footer1";
109 type: RECT;
110
111 scale: 1;
112 description {
113 state: "default" 0.0;
114 min: 0 40;
115 fixed: 1 1;
116 align: 0.5 1.0;
117 rel1.relative: 0.0 1.0;
118 rel2.relative: 0.3 1.0;
119 color: 255 0 0 255;
120 }
121 }
122
123 part {
124 name: "footer2";
125 type: RECT;
126
127 scale: 1;
128 description {
129 state: "default" 0.0;
130 min: 0 40;
131 fixed: 1 1;
132 align: 0.5 1.0;
133 rel1.relative: 0.3 1.0;
134 rel2.relative: 0.8 1.0;
135 color: 255 255 0 255;
136 }
137 }
138
139 part {
140 name: "footer3";
141 type: RECT;
142
143 scale: 1;
144 description {
145 state: "default" 0.0;
146 min: 0 40;
147 fixed: 1 1;
148 align: 0.5 1.0;
149 rel1.relative: 0.8 1.0;
150 rel2.relative: 1.0 1.0;
151 color: 0 0 255 255;
152 }
153 }
154 }
155 }
156
157 group {
158 name: "example/mylayout2";
159
160 data {
161 item: "title" "Layout Example 01";
162 }
163
164 parts {
165 part {
166 name: "example/title";
167 type: TEXT;
168
169 description {
170 state: "default" 0.0;
171 color: 0 0 0 255;
172 rel1 {
173 relative: 0.0 0.0;
174 offset: 0 0;
175 }
176 rel2 {
177 relative: 1.0 0.2;
178 offset: -1 -1;
179 }
180 text {
181 text: "bla";
182 size: 16;
183 font: "sans";
184 min: 1 1;
185 ellipsis: -1;
186 }
187 }
188 }
189
190 part {
191 name: "example/custom";
192 type: SWALLOW;
193
194 description {
195 state: "default" 0.0;
196 fixed: 1 1;
197
198 rel1 {
199 relative: 0.25 0.8;
200 offset: 0 0;
201 }
202 rel2 {
203 relative: 0.75 0.9;
204 offset: -1 -1;
205 }
206 }
207 } // example/custom
208
209 part {
210 name: "example/box";
211 type: BOX;
212
213 description {
214 state: "default" 0.0;
215
216 box {
217 layout: "horizontal_flow";
218 padding: 2 2;
219 align: 0.5 0.5;
220 min: 1 1;
221 }
222 rel1 {
223 relative: 0.0 0.2;
224 offset: 0 0;
225 }
226 rel2 {
227 relative: 1.0 0.5;
228 offset: -1 -1;
229 }
230 }
231 } // example/box
232
233 part {
234 name: "example/table";
235 type: TABLE;
236
237 description {
238 state: "default" 0.0;
239
240 table {
241 homogeneous: NONE;
242 padding: 2 2;
243 align: 0.5 0.5;
244 min: 1 1;
245 }
246 rel1 {
247 relative: 0.0 0.5;
248 offset: 0 0;
249 }
250 rel2 {
251 relative: 1.0 0.7;
252 offset: -1 -1;
253 }
254 }
255 } // example/table
256 }
257 }
258
259 group {
260 name: "example/mylayout3";
261
262 data {
263 item: "title" "Layout Example 03";
264 }
265
266 parts {
267 part {
268 name: "example/title";
269 type: TEXT;
270
271 description {
272 state: "default" 0.0;
273 color: 0 0 0 255;
274 rel1 {
275 relative: 0.0 0.0;
276 offset: 0 0;
277 }
278 rel2 {
279 relative: 1.0 0.2;
280 offset: -1 -1;
281 }
282 text {
283 text: "bla";
284 size: 16;
285 font: "sans";
286 min: 1 1;
287 ellipsis: -1;
288 }
289 }
290 }
291
292 part {
293 name: "example/custom";
294 type: SWALLOW;
295
296 description {
297 state: "default" 0.0;
298 min: 160 50;
299 max: 160 50;
300 align: 0.5 1.0;
301 }
302 description {
303 state: "big" 0.0;
304 inherit: "default" 0.0;
305 min: 320 100;
306 max: 320 100;
307 }
308 } // example/custom
309
310 programs {
311 program {
312 name: "swallow,grow";
313 signal: "button,enlarge";
314 action: STATE_SET "big" 0.0;
315 transition: LINEAR 0.5;
316 target: "example/custom";
317 after: "emit,changed";
318 }
319 program {
320 name: "swallow,shrink";
321 signal: "button,reduce";
322 action: STATE_SET "default" 0.0;
323 transition: LINEAR 0.5;
324 target: "example/custom";
325 after: "emit,changed";
326 }
327 program {
328 name: "emit,changed";
329 action: SIGNAL_EMIT "size,changed" "";
330 }
331 }
332 }
333 }
334}