summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Juyung Seo <juyung.seo@samsung.com>2013-06-24 21:15:48 +0900
committerDaniel Juyung Seo <juyung.seo@samsung.com>2013-06-24 21:15:48 +0900
commit72d22639308953111116c33c0afa69a88f532551 (patch)
treed055ebbfb90a8ca59ca4291db957a8ac61747868
parent92bfd88d3bd229210a257a353bde2b7de698bc7d (diff)
source/3-final: updated effect parts.
-rw-r--r--source/3-final/data/edc/Makefile16
-rw-r--r--source/3-final/data/edc/layout.edc50
-rw-r--r--source/3-final/data/edc/theme_ext.edc359
-rw-r--r--source/3-final/data/images/bt_base1.pngbin0 -> 952 bytes
-rw-r--r--source/3-final/data/images/bt_base2.pngbin0 -> 981 bytes
-rw-r--r--source/3-final/data/images/bt_dis_base.pngbin0 -> 1101 bytes
-rw-r--r--source/3-final/data/images/bt_dis_hilight.pngbin0 -> 230 bytes
-rw-r--r--source/3-final/data/images/bt_glow.pngbin0 -> 1028 bytes
-rw-r--r--source/3-final/data/images/bt_hilight.pngbin0 -> 343 bytes
-rw-r--r--source/3-final/data/images/bt_shine.pngbin0 -> 305 bytes
-rw-r--r--source/3-final/src/main.c9
11 files changed, 428 insertions, 6 deletions
diff --git a/source/3-final/data/edc/Makefile b/source/3-final/data/edc/Makefile
index ff604b3..ac64a91 100644
--- a/source/3-final/data/edc/Makefile
+++ b/source/3-final/data/edc/Makefile
@@ -1,17 +1,23 @@
1PREFIX=/usr/local 1PREFIX=/usr/local
2DATADIR=$(PREFIX)/share/sample 2DATADIR=$(PREFIX)/share/sample
3 3
4EDJ=layout.edj 4EDJS=layout.edj theme_ext.edj
5EDJE_CC = edje_cc 5EDJE_CC = edje_cc
6EDJE_FLAGS = -id ../images 6EDJE_FLAGS = -id ../images
7 7
8$(EDJ): layout.edc 8edj: $(EDJS)
9
10layout.edj: layout.edc
11 @echo " Compilation of $(@D)/$(<F)"
12 @$(EDJE_CC) $(EDJE_FLAGS) layout.edc
13
14theme_ext.edj: theme_ext.edc
9 @echo " Compilation of $(@D)/$(<F)" 15 @echo " Compilation of $(@D)/$(<F)"
10 @$(EDJE_CC) $(EDJE_FLAGS) layout.edc $(EDJS) 16 @$(EDJE_CC) $(EDJE_FLAGS) theme_ext.edc
11 17
12install: $(EDJ) 18install: edj
13 @mkdir -p $(DATADIR)/edj 19 @mkdir -p $(DATADIR)/edj
14 @install $(EDJ) $(DATADIR)/edj 20 @install $(EDJS) $(DATADIR)/edj
15 21
16clean: 22clean:
17 @rm -f *.edj 23 @rm -f *.edj
diff --git a/source/3-final/data/edc/layout.edc b/source/3-final/data/edc/layout.edc
index 1a10add..24292b1 100644
--- a/source/3-final/data/edc/layout.edc
+++ b/source/3-final/data/edc/layout.edc
@@ -44,6 +44,21 @@ collections {
44 description { state: "default" 0.0; 44 description { state: "default" 0.0;
45 rel1.relative: 0.06 0.17; 45 rel1.relative: 0.06 0.17;
46 rel2.relative: 0.94 0.85; 46 rel2.relative: 0.94 0.85;
47 map {
48 on: 1;
49 perspective: "persp";
50 rotation.x: 0;
51 rotation.center: "persp";
52 }
53 }
54 description { state: "zoomout" 0.0;
55 inherit: "default" 0.0;
56 map {
57 on: 1;
58 perspective: "persp";
59 rotation.y: 180;
60 rotation.center: "persp";
61 }
47 } 62 }
48 } 63 }
49 part { name: "elm.swallow.bottom"; 64 part { name: "elm.swallow.bottom";
@@ -68,6 +83,25 @@ collections {
68 visible: 0; 83 visible: 0;
69 } 84 }
70 } 85 }
86 part { name: "persp";
87 type: RECT;
88 description { state: "default" 0.0;
89 visible: 0;
90 rel1.relative: 0.06 0.17;
91 rel2.relative: 0.94 0.85;
92 perspective {
93 zplane: 0;
94 focal: 1500;
95 }
96 }
97 description { state: "zoomout" 0.0;
98 inherit: "default" 0.0;
99 perspective {
100 zplane: -200;
101 focal: 250;
102 }
103 }
104 }
71 part { name: "elm.swallow.right_arrow"; 105 part { name: "elm.swallow.right_arrow";
72 type: SWALLOW; 106 type: SWALLOW;
73 scale: 1; 107 scale: 1;
@@ -93,6 +127,22 @@ collections {
93 action: STATE_SET "default" 0.0; 127 action: STATE_SET "default" 0.0;
94 target: "elm.swallow.left_arrow"; 128 target: "elm.swallow.left_arrow";
95 } 129 }
130 program { name: "zoomout";
131 signal: "mouse,down,1";
132 source: "elm.swallow.right_arrow";
133 action: STATE_SET "zoomout" 0.0;
134 target: "persp";
135 target: "elm.swallow.middle";
136 transition: LINEAR 0.5;
137 }
138 program { name: "zoomin";
139 signal: "mouse,up,1";
140 source: "elm.swallow.right_arrow";
141 action: STATE_SET "default" 0.0;
142 target: "persp";
143 target: "elm.swallow.middle";
144 transition: LINEAR 0.5;
145 }
96 } 146 }
97 } 147 }
98 group { name:"left_arrow"; 148 group { name:"left_arrow";
diff --git a/source/3-final/data/edc/theme_ext.edc b/source/3-final/data/edc/theme_ext.edc
new file mode 100644
index 0000000..a76d450
--- /dev/null
+++ b/source/3-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/source/3-final/data/images/bt_base1.png b/source/3-final/data/images/bt_base1.png
new file mode 100644
index 0000000..2d1f179
--- /dev/null
+++ b/source/3-final/data/images/bt_base1.png
Binary files differ
diff --git a/source/3-final/data/images/bt_base2.png b/source/3-final/data/images/bt_base2.png
new file mode 100644
index 0000000..dd3e3ce
--- /dev/null
+++ b/source/3-final/data/images/bt_base2.png
Binary files differ
diff --git a/source/3-final/data/images/bt_dis_base.png b/source/3-final/data/images/bt_dis_base.png
new file mode 100644
index 0000000..06f3dd5
--- /dev/null
+++ b/source/3-final/data/images/bt_dis_base.png
Binary files differ
diff --git a/source/3-final/data/images/bt_dis_hilight.png b/source/3-final/data/images/bt_dis_hilight.png
new file mode 100644
index 0000000..e5cf7d3
--- /dev/null
+++ b/source/3-final/data/images/bt_dis_hilight.png
Binary files differ
diff --git a/source/3-final/data/images/bt_glow.png b/source/3-final/data/images/bt_glow.png
new file mode 100644
index 0000000..e995ff1
--- /dev/null
+++ b/source/3-final/data/images/bt_glow.png
Binary files differ
diff --git a/source/3-final/data/images/bt_hilight.png b/source/3-final/data/images/bt_hilight.png
new file mode 100644
index 0000000..3b7fe5b
--- /dev/null
+++ b/source/3-final/data/images/bt_hilight.png
Binary files differ
diff --git a/source/3-final/data/images/bt_shine.png b/source/3-final/data/images/bt_shine.png
new file mode 100644
index 0000000..a58bdee
--- /dev/null
+++ b/source/3-final/data/images/bt_shine.png
Binary files differ
diff --git a/source/3-final/src/main.c b/source/3-final/src/main.c
index 6b12c7e..2d4c8af 100644
--- a/source/3-final/src/main.c
+++ b/source/3-final/src/main.c
@@ -130,6 +130,7 @@ create_arrows(Evas_Object *layout)
130 130
131 //Create a Left arrow 131 //Create a Left arrow
132 btn = create_button(layout); 132 btn = create_button(layout);
133 elm_object_style_set(btn, "sample");
133 snprintf(buf, sizeof(buf), "%s/edj/layout.edj", elm_app_data_dir_get()); 134 snprintf(buf, sizeof(buf), "%s/edj/layout.edj", elm_app_data_dir_get());
134 // TODO 5 135 // TODO 5
135 img = create_image(btn, buf, "left_arrow"); 136 img = create_image(btn, buf, "left_arrow");
@@ -142,6 +143,7 @@ create_arrows(Evas_Object *layout)
142 143
143 //Create a Right arrow 144 //Create a Right arrow
144 btn = create_button(layout); 145 btn = create_button(layout);
146 elm_object_style_set(btn, "sample");
145 snprintf(buf, sizeof(buf), "%s/edj/layout.edj", elm_app_data_dir_get()); 147 snprintf(buf, sizeof(buf), "%s/edj/layout.edj", elm_app_data_dir_get());
146 // TODO 5 148 // TODO 5
147 img = create_image(btn, buf, "right_arrow"); 149 img = create_image(btn, buf, "right_arrow");
@@ -150,7 +152,7 @@ create_arrows(Evas_Object *layout)
150 elm_layout_content_set(layout, "elm.swallow.right_arrow", btn); 152 elm_layout_content_set(layout, "elm.swallow.right_arrow", btn);
151 evas_object_show(btn); 153 evas_object_show(btn);
152 // TODO 10 154 // TODO 10
153 evas_object_smart_callback_add(btn, "clicked", _right_arrow_clicked_cb, layout); 155 //evas_object_smart_callback_add(btn, "clicked", _right_arrow_clicked_cb, layout);
154} 156}
155 157
156void 158void
@@ -314,6 +316,11 @@ elm_main(int argc, char **argv)
314 316
315 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); 317 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
316 318
319 //Theme extension
320 char buf[PATH_MAX];
321 snprintf(buf, sizeof(buf), "%s/edj/theme_ext.edj", elm_app_data_dir_get());
322 elm_theme_extension_add(NULL, buf);
323
317 init(); 324 init();
318 325
319 elm_run(); 326 elm_run();