summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChunEon Park <chuneon.park@samsung.com>2013-06-19 01:05:53 +0900
committerChunEon Park <chuneon.park@samsung.com>2013-06-19 01:05:53 +0900
commit92bfd88d3bd229210a257a353bde2b7de698bc7d (patch)
tree07aa427e2f70491d7d381fb91e166d914de49eb2
parentc2cfbbcffa45a280c9742e7cc253d0c68d39d298 (diff)
sample - updated effects
-rw-r--r--sample/2-final/Makefile9
-rw-r--r--sample/2-final/data/edc/layout.edc51
-rw-r--r--sample/2-final/data/edc/theme_ext.edc359
-rw-r--r--sample/2-final/data/images/bt_base1.pngbin0 -> 952 bytes
-rw-r--r--sample/2-final/data/images/bt_base2.pngbin0 -> 981 bytes
-rw-r--r--sample/2-final/data/images/bt_dis_base.pngbin0 -> 1101 bytes
-rw-r--r--sample/2-final/data/images/bt_dis_hilight.pngbin0 -> 230 bytes
-rw-r--r--sample/2-final/data/images/bt_glow.pngbin0 -> 1028 bytes
-rw-r--r--sample/2-final/data/images/bt_hilight.pngbin0 -> 343 bytes
-rw-r--r--sample/2-final/data/images/bt_shine.pngbin0 -> 305 bytes
-rw-r--r--sample/2-final/src/main.c21
11 files changed, 438 insertions, 2 deletions
diff --git a/sample/2-final/Makefile b/sample/2-final/Makefile
index 818bbb9..af2deb5 100644
--- a/sample/2-final/Makefile
+++ b/sample/2-final/Makefile
@@ -1,7 +1,7 @@
1SRCDIR=src 1SRCDIR=src
2EDJDIR=data/edc 2EDJDIR=data/edc
3OBJECTS=$(SRCDIR)/main.o 3OBJECTS=$(SRCDIR)/main.o
4EDJS=$(EDJDIR)/layout.edj 4EDJS=$(EDJDIR)/layout.edj $(EDJDIR)/theme_ext.edj
5BINARY=sample 5BINARY=sample
6DIRNAME=sample 6DIRNAME=sample
7 7
@@ -32,13 +32,18 @@ $(EDJDIR)/layout.edj: $(EDJDIR)/layout.edc
32 @echo " Compilation of $(@D)/$(<F)" 32 @echo " Compilation of $(@D)/$(<F)"
33 @$(EDJE_CC) $(EDJE_FLAGS) $(EDJDIR)/layout.edc $(EDJDIR)/layout.edj 33 @$(EDJE_CC) $(EDJE_FLAGS) $(EDJDIR)/layout.edc $(EDJDIR)/layout.edj
34 34
35install: $(BINARY) $(EDJDIR)/layout.edj 35$(EDJDIR)/theme_ext.edj: $(EDJDIR)/theme_ext.edc
36 @echo " Compilation of $(@D)/$(<F)"
37 @$(EDJE_CC) $(EDJE_FLAGS) $(EDJDIR)/theme_ext.edc $(EDJDIR)/theme_ext.edj
38
39install: $(BINARY) $(EDJDIR)/layout.edj $(EDJDIR)/theme_ext.edj
36 @echo "installation of executables" 40 @echo "installation of executables"
37 @mkdir -p $(BINDIR) 41 @mkdir -p $(BINDIR)
38 @install -m 0755 $(BINARY) $(BINDIR) 42 @install -m 0755 $(BINARY) $(BINDIR)
39 @echo "installation of data" 43 @echo "installation of data"
40 @mkdir -p $(DATADIR)/edj 44 @mkdir -p $(DATADIR)/edj
41 @install $(EDJDIR)/layout.edj $(DATADIR)/edj 45 @install $(EDJDIR)/layout.edj $(DATADIR)/edj
46 @install $(EDJDIR)/theme_ext.edj $(DATADIR)/edj
42 @mkdir -p $(DATADIR)/images 47 @mkdir -p $(DATADIR)/images
43 @install data/images/* $(DATADIR)/images 48 @install data/images/* $(DATADIR)/images
44 49
diff --git a/sample/2-final/data/edc/layout.edc b/sample/2-final/data/edc/layout.edc
index 1a10add..c9eaa26 100644
--- a/sample/2-final/data/edc/layout.edc
+++ b/sample/2-final/data/edc/layout.edc
@@ -41,9 +41,25 @@ collections {
41 } 41 }
42 part { name: "elm.swallow.middle"; 42 part { name: "elm.swallow.middle";
43 type: SWALLOW; 43 type: SWALLOW;
44 mouse_events: 1;
44 description { state: "default" 0.0; 45 description { state: "default" 0.0;
45 rel1.relative: 0.06 0.17; 46 rel1.relative: 0.06 0.17;
46 rel2.relative: 0.94 0.85; 47 rel2.relative: 0.94 0.85;
48 map {
49 on: 1;
50 perspective: "persp";
51 rotation.x: 0;
52 rotation.center: "persp";
53 }
54 }
55 description { state: "zoomout" 0.0;
56 inherit: "default" 0.0;
57 map {
58 on: 1;
59 perspective: "persp";
60 rotation.y: 180;
61 rotation.center: "persp";
62 }
47 } 63 }
48 } 64 }
49 part { name: "elm.swallow.bottom"; 65 part { name: "elm.swallow.bottom";
@@ -68,6 +84,25 @@ collections {
68 visible: 0; 84 visible: 0;
69 } 85 }
70 } 86 }
87 part { name: "persp";
88 type: RECT;
89 description { state: "default" 0.0;
90 visible: 0;
91 rel1.relative: 0.06 0.17;
92 rel2.relative: 0.94 0.85;
93 perspective {
94 zplane: 0;
95 focal: 1500;
96 }
97 }
98 description { state: "zoomout" 0.0;
99 inherit: "default" 0.0;
100 perspective {
101 zplane: -200;
102 focal: 250;
103 }
104 }
105 }
71 part { name: "elm.swallow.right_arrow"; 106 part { name: "elm.swallow.right_arrow";
72 type: SWALLOW; 107 type: SWALLOW;
73 scale: 1; 108 scale: 1;
@@ -93,6 +128,22 @@ collections {
93 action: STATE_SET "default" 0.0; 128 action: STATE_SET "default" 0.0;
94 target: "elm.swallow.left_arrow"; 129 target: "elm.swallow.left_arrow";
95 } 130 }
131 program { name: "zoomout";
132 signal: "mouse,down,1";
133 source: "elm.swallow.right_arrow";
134 action: STATE_SET "zoomout" 0.0;
135 target: "persp";
136 target: "elm.swallow.middle";
137 transition: LINEAR 0.5;
138 }
139 program { name: "zoomin";
140 signal: "mouse,up,1";
141 source: "elm.swallow.right_arrow";
142 action: STATE_SET "default" 0.0;
143 target: "persp";
144 target: "elm.swallow.middle";
145 transition: LINEAR 0.5;
146 }
96 } 147 }
97 } 148 }
98 group { name:"left_arrow"; 149 group { name:"left_arrow";
diff --git a/sample/2-final/data/edc/theme_ext.edc b/sample/2-final/data/edc/theme_ext.edc
new file mode 100644
index 0000000..a76d450
--- /dev/null
+++ b/sample/2-final/data/edc/theme_ext.edc
@@ -0,0 +1,359 @@
1collections {
2
3group { name: "elm/button/base/sample";
4 images {
5 image: "bt_base1.png" COMP;
6 image: "bt_base2.png" COMP;
7 image: "bt_hilight.png" COMP;
8 image: "bt_shine.png" COMP;
9 image: "bt_glow.png" COMP;
10 image: "bt_dis_base.png" COMP;
11 image: "bt_dis_hilight.png" COMP;
12 }
13 parts {
14 part { name: "button_image";
15 mouse_events: 1;
16 description { state: "default" 0.0;
17 min: 12 12;
18 image {
19 normal: "bt_base2.png";
20 border: 7 7 7 7;
21 }
22 image.middle: SOLID;
23 visible: 0;
24 }
25 description { state: "clicked" 0.0;
26 inherit: "default" 0.0;
27 image.normal: "bt_base1.png";
28 }
29 description { state: "disabled" 0.0;
30 inherit: "default" 0.0;
31 image {
32 normal: "bt_dis_base.png";
33 border: 4 4 4 4;
34 }
35 }
36 }
37 part { name: "elm.swallow.content";
38 type: SWALLOW;
39 description { state: "default" 0.0;
40 fixed: 1 0;
41 visible: 0;
42 align: 0.0 0.5;
43 rel1.offset: 2 2;
44 rel2.offset: 1 -3;
45 rel2.relative: 0.0 1.0;
46 }
47 description { state: "visible" 0.0;
48 inherit: "default" 0.0;
49 fixed: 1 0;
50 visible: 1;
51 aspect: 1.0 1.0;
52 // aspect_preference: VERTICAL;
53 rel2.offset: 2 -3;
54 }
55 description { state: "icononly" 0.0;
56 inherit: "default" 0.0;
57 fixed: 0 0;
58 visible: 1;
59 align: 0.5 0.5;
60 // aspect: 1.0 1.0;
61 rel2.offset: -3 -3;
62 rel2.relative: 1.0 1.0;
63 // aspect_preference: VERTICAL;
64 }
65 }
66 part {
67 name: "elm.text";
68 type: TEXT;
69 effect: SOFT_SHADOW;
70 mouse_events: 0;
71 scale: 1;
72 description { state: "default" 0.0;
73 visible: 0;
74 rel1.to_x: "elm.swallow.content";
75 rel1.relative: 1.0 0.0;
76 rel1.offset: 0 2;
77 rel2.offset: -3 -3;
78 color: 224 224 224 255;
79 color3: 0 0 0 64;
80 text {
81 font: "Sans,Edje-Vera";
82 size: 10;
83 min: 0 0;
84 align: 0.5 0.5;
85 text_class: "button";
86 }
87 }
88 description { state: "visible" 0.0;
89 inherit: "default" 0.0;
90 visible: 1;
91 text.min: 1 1;
92 }
93 description { state: "disabled" 0.0;
94 inherit: "default" 0.0;
95 }
96 description { state: "disabled_visible" 0.0;
97 inherit: "default" 0.0;
98 color: 0 0 0 128;
99 color3: 0 0 0 0;
100 visible: 1;
101 text.min: 1 1;
102 }
103 }
104 part { name: "over1";
105 mouse_events: 0;
106 description { state: "default" 0.0;
107 rel2.relative: 1.0 0.5;
108 visible: 1;
109 image {
110 normal: "bt_hilight.png";
111 border: 7 7 7 0;
112 }
113 }
114 description { state: "disabled" 0.0;
115 inherit: "default" 0.0;
116 image {
117 normal: "bt_dis_hilight.png";
118 border: 4 4 4 0;
119 }
120 }
121 }
122 part { name: "over2";
123 mouse_events: 1;
124 repeat_events: 1;
125 ignore_flags: ON_HOLD;
126 description { state: "default" 0.0;
127 visible: 1;
128 image {
129 normal: "bt_shine.png";
130 border: 7 7 7 7;
131 }
132 }
133 description { state: "disabled" 0.0;
134 inherit: "default" 0.0;
135 }
136 }
137 part { name: "over3";
138 mouse_events: 1;
139 repeat_events: 1;
140 description { state: "default" 0.0;
141 color: 255 255 255 0;
142 visible: 0;
143 image {
144 normal: "bt_glow.png";
145 border: 12 12 12 12;
146 }
147 fill.smooth : 0;
148 }
149 description { state: "clicked" 0.0;
150 inherit: "default" 0.0;
151 color: 255 255 255 255;
152 }
153 }
154 part { name: "disabler";
155 type: RECT;
156 description { state: "default" 0.0;
157 color: 0 0 0 0;
158 visible: 0;
159 }
160 description { state: "disabled" 0.0;
161 inherit: "default" 0.0;
162 visible: 1;
163 }
164 }
165 // used to force sizing of icon to follow label sizing nearby
166 part { name: "sizer.content"; type: TEXT;
167 mouse_events: 0;
168 scale: 1;
169 description { state: "default" 0.0;
170 visible: 0;
171 text {
172 font: "Sans,Edje-Vera";
173 size: 10;
174 min: 0 0;
175 text_class: "button";
176 }
177 }
178 description { state: "visible" 0.0;
179 inherit: "default" 0.0;
180 rel1.to: "elm.swallow.content";
181 rel2.to: "elm.swallow.content";
182 text {
183 min: 1 1;
184 text: "M";
185 }
186 }
187 description { state: "icononly" 0.0;
188 inherit: "default" 0.0;
189 rel1.to: "elm.swallow.content";
190 rel2.to: "elm.swallow.content";
191 text {
192 min: 1 1;
193 text: "M";
194 }
195 }
196 }
197 // end sizer
198 }
199 programs {
200 program {
201 name: "button_click";
202 signal: "mouse,down,1";
203 source: "over2";
204 action: SIGNAL_EMIT "elm,action,press" "";
205 after: "button_click_anim";
206 }
207 program {
208 name: "button_click_anim";
209 action: STATE_SET "clicked" 0.0;
210 target: "button_image";
211 }
212 program {
213 name: "button_unclick";
214 signal: "mouse,up,1";
215 source: "over3";
216 action: SIGNAL_EMIT "elm,action,unpress" "";
217 after: "button_unclick_anim";
218 }
219 program {
220 name: "button_pressed_anim";
221 signal: "elm,anim,activate";
222 source: "elm";
223 action: STATE_SET "clicked" 0.0;
224 target: "button_image";
225 target: "over3";
226 after: "button_unpressed_anim";
227 }
228 program {
229 name: "button_unpressed_anim";
230 action: STATE_SET "default" 0.0;
231 transition: DECELERATE 0.5;
232 target: "button_image";
233 target: "over3";
234 }
235 program {
236 name: "button_unclick_anim";
237 action: STATE_SET "default" 0.0;
238 target: "button_image";
239 }
240 program {
241 name: "button_click2";
242 signal: "mouse,down,1";
243 source: "over3";
244 action: STATE_SET "clicked" 0.0;
245 target: "over3";
246 }
247 program {
248 name: "button_unclick2";
249 signal: "mouse,up,1";
250 source: "over3";
251 action: STATE_SET "default" 0.0;
252 transition: DECELERATE 0.5;
253 target: "over3";
254 }
255 program {
256 name: "button_unclick3";
257 signal: "mouse,clicked,1";
258 source: "over2";
259 action: SIGNAL_EMIT "elm,action,click" "";
260 }
261 program { name: "text_show";
262 signal: "elm,state,text,visible";
263 source: "elm";
264 script {
265 new st[31];
266 new Float:vl;
267 get_state(PART:"elm.swallow.content", st, 30, vl);
268 if (!strcmp(st, "icononly")) {
269 set_state(PART:"elm.swallow.content", "visible", 0.0);
270 set_state(PART:"sizer.content", "visible", 0.0);
271 }
272 get_state(PART:"elm.text", st, 30, vl);
273 if (!strcmp(st, "disabled") || (!strcmp(st, "disabled_visible")))
274 set_state(PART:"elm.text", "disabled_visible", 0.0);
275 else
276 set_state(PART:"elm.text", "visible", 0.0);
277 }
278 }
279 program { name: "text_hide";
280 signal: "elm,state,text,hidden";
281 source: "elm";
282 script {
283 new st[31];
284 new Float:vl;
285 get_state(PART:"elm.swallow.content", st, 30, vl);
286 if (!strcmp(st, "visible")) {
287 set_state(PART:"elm.swallow.content", "icononly", 0.0);
288 set_state(PART:"sizer.content", "icononly", 0.0);
289 }
290 set_state(PART:"elm.text", "default", 0.0);
291 get_state(PART:"elm.text", st, 30, vl);
292 if (!strcmp(st, "default") || (!strcmp(st, "visible")))
293 set_state(PART:"elm.text", "default", 0.0);
294 else
295 set_state(PART:"elm.text", "disabled", 0.0);
296 }
297 }
298 program { name: "icon_show";
299 signal: "elm,state,icon,visible";
300 source: "elm";
301 script {
302 new st[31];
303 new Float:vl;
304 get_state(PART:"elm.text", st, 30, vl);
305 if (!strcmp(st, "visible")) {
306 set_state(PART:"elm.swallow.content", "visible", 0.0);
307 set_state(PART:"sizer.content", "visible", 0.0);
308 }
309 else {
310 set_state(PART:"elm.swallow.content", "icononly", 0.0);
311 set_state(PART:"sizer.content", "icononly", 0.0);
312 }
313 }
314 }
315 program { name: "icon_hide";
316 signal: "elm,state,icon,hidden";
317 source: "elm";
318 action: STATE_SET "default" 0.0;
319 target: "elm.swallow.content";
320 target: "sizer.content";
321 }
322 program { name: "disable";
323 signal: "elm,state,disabled";
324 source: "elm";
325 script {
326 new st[31];
327 new Float:vl;
328 set_state(PART:"button_image", "disabled", 0.0);
329 set_state(PART:"over1", "disabled", 0.0);
330 set_state(PART:"over2", "disabled", 0.0);
331 set_state(PART:"disabler", "disabled", 0.0);
332 get_state(PART:"elm.text", st, 30, vl);
333 if (!strcmp(st, "visible") || !strcmp(st, "disabled_visible"))
334 set_state(PART:"elm.text", "disabled_visible", 0.0);
335 else
336 set_state(PART:"elm.text", "disabled", 0.0);
337 }
338 }
339 program { name: "enable";
340 signal: "elm,state,enabled";
341 source: "elm";
342 script {
343 new st[31];
344 new Float:vl;
345 set_state(PART:"button_image", "visible", 0.0);
346 set_state(PART:"over1", "visible", 0.0);
347 set_state(PART:"over2", "visible", 0.0);
348 set_state(PART:"disabler", "visible", 0.0);
349 get_state(PART:"elm.text", st, 30, vl);
350 if (!strcmp(st, "visible") || !strcmp(st, "disabled_visible"))
351 set_state(PART:"elm.text", "visible", 0.0);
352 else
353 set_state(PART:"elm.text", "default", 0.0);
354 }
355 }
356 }
357}
358
359}
diff --git a/sample/2-final/data/images/bt_base1.png b/sample/2-final/data/images/bt_base1.png
new file mode 100644
index 0000000..2d1f179
--- /dev/null
+++ b/sample/2-final/data/images/bt_base1.png
Binary files differ
diff --git a/sample/2-final/data/images/bt_base2.png b/sample/2-final/data/images/bt_base2.png
new file mode 100644
index 0000000..dd3e3ce
--- /dev/null
+++ b/sample/2-final/data/images/bt_base2.png
Binary files differ
diff --git a/sample/2-final/data/images/bt_dis_base.png b/sample/2-final/data/images/bt_dis_base.png
new file mode 100644
index 0000000..06f3dd5
--- /dev/null
+++ b/sample/2-final/data/images/bt_dis_base.png
Binary files differ
diff --git a/sample/2-final/data/images/bt_dis_hilight.png b/sample/2-final/data/images/bt_dis_hilight.png
new file mode 100644
index 0000000..e5cf7d3
--- /dev/null
+++ b/sample/2-final/data/images/bt_dis_hilight.png
Binary files differ
diff --git a/sample/2-final/data/images/bt_glow.png b/sample/2-final/data/images/bt_glow.png
new file mode 100644
index 0000000..e995ff1
--- /dev/null
+++ b/sample/2-final/data/images/bt_glow.png
Binary files differ
diff --git a/sample/2-final/data/images/bt_hilight.png b/sample/2-final/data/images/bt_hilight.png
new file mode 100644
index 0000000..3b7fe5b
--- /dev/null
+++ b/sample/2-final/data/images/bt_hilight.png
Binary files differ
diff --git a/sample/2-final/data/images/bt_shine.png b/sample/2-final/data/images/bt_shine.png
new file mode 100644
index 0000000..a58bdee
--- /dev/null
+++ b/sample/2-final/data/images/bt_shine.png
Binary files differ
diff --git a/sample/2-final/src/main.c b/sample/2-final/src/main.c
index 74f00fa..b618127 100644
--- a/sample/2-final/src/main.c
+++ b/sample/2-final/src/main.c
@@ -79,6 +79,19 @@ _right_arrow_clicked_cb(void *data, Evas_Object *obj, void *info)
79} 79}
80 80
81void 81void
82_btn_cb(void *data, Evas_Object *obj, void *event_info)
83{
84 Evas_Object *table = data;
85 Elm_Transit *transit = elm_transit_add();
86 elm_transit_object_add(transit, table);
87 elm_transit_effect_wipe_add(transit, ELM_TRANSIT_EFFECT_WIPE_TYPE_HIDE,
88 ELM_TRANSIT_EFFECT_WIPE_DIR_RIGHT);
89 elm_transit_effect_color_add(transit, 255, 255, 255, 255, 0, 0, 0, 0);
90 elm_transit_duration_set(transit, 1);
91 elm_transit_go(transit);
92}
93
94void
82init() 95init()
83{ 96{
84 Evas_Object *win, *layout, *table, *toolbar, *btn, *img, *label; 97 Evas_Object *win, *layout, *table, *toolbar, *btn, *img, *label;
@@ -108,6 +121,7 @@ init()
108 for (i = 0; i < 5; i++) 121 for (i = 0; i < 5; i++)
109 { 122 {
110 btn = create_button(table); 123 btn = create_button(table);
124 evas_object_smart_callback_add(btn, "clicked", _btn_cb, table);
111 snprintf(buf, sizeof(buf), "%s/edj/layout.edj", elm_app_data_dir_get()); 125 snprintf(buf, sizeof(buf), "%s/edj/layout.edj", elm_app_data_dir_get());
112 snprintf(buf2, sizeof(buf2), "icon%d", i); 126 snprintf(buf2, sizeof(buf2), "icon%d", i);
113 img = create_image(btn, buf, buf2); 127 img = create_image(btn, buf, buf2);
@@ -156,6 +170,7 @@ init()
156 170
157 //Create a Left arrow 171 //Create a Left arrow
158 btn = create_button(table); 172 btn = create_button(table);
173 elm_object_style_set(btn, "sample");
159 snprintf(buf, sizeof(buf), "%s/edj/layout.edj", elm_app_data_dir_get()); 174 snprintf(buf, sizeof(buf), "%s/edj/layout.edj", elm_app_data_dir_get());
160 img = create_image(btn, buf, "left_arrow"); 175 img = create_image(btn, buf, "left_arrow");
161 elm_object_content_set(btn, img); 176 elm_object_content_set(btn, img);
@@ -165,6 +180,7 @@ init()
165 180
166 //Create a Right arrow 181 //Create a Right arrow
167 btn = create_button(table); 182 btn = create_button(table);
183 elm_object_style_set(btn, "sample");
168 snprintf(buf, sizeof(buf), "%s/edj/layout.edj", elm_app_data_dir_get()); 184 snprintf(buf, sizeof(buf), "%s/edj/layout.edj", elm_app_data_dir_get());
169 img = create_image(btn, buf, "right_arrow"); 185 img = create_image(btn, buf, "right_arrow");
170 elm_object_content_set(btn, img); 186 elm_object_content_set(btn, img);
@@ -199,6 +215,11 @@ elm_main(int argc, char **argv)
199 215
200 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); 216 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
201 217
218 //Theme extension
219 char buf[PATH_MAX];
220 snprintf(buf, sizeof(buf), "%s/edj/theme_ext.edj", elm_app_data_dir_get());
221 elm_theme_extension_add(NULL, buf);
222
202 init(); 223 init();
203 224
204 elm_run(); 225 elm_run();