summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <m.blumenkran@samsung.com>2013-10-08 14:27:31 +0100
committerMike Blumenkrantz <m.blumenkran@samsung.com>2013-10-08 14:27:31 +0100
commite32afa32ee450026afa5176f1cecb722f2e2dda6 (patch)
tree6ba907a5dfb41e2a16316b49efcd55b5b934339e
parentaaf89823a19eac804631536aad0c488f34ea95fd (diff)
finish compositing demo
-rw-r--r--linuxcon-eu-2013/comp_demo/.gitignore1
-rw-r--r--linuxcon-eu-2013/comp_demo/compositing.c284
-rw-r--r--linuxcon-eu-2013/comp_demo/gimp1.pngbin0 -> 75004 bytes
-rw-r--r--linuxcon-eu-2013/comp_demo/gimp2.pngbin0 -> 17898 bytes
-rw-r--r--linuxcon-eu-2013/comp_demo/gimp3.pngbin0 -> 50749 bytes
-rw-r--r--linuxcon-eu-2013/comp_demo/gimp_focus.pngbin0 -> 80834 bytes
-rw-r--r--linuxcon-eu-2013/comp_demo/gimp_focus_client.pngbin0 -> 67914 bytes
-rw-r--r--linuxcon-eu-2013/comp_demo/gimp_focus_frame.pngbin0 -> 80721 bytes
-rw-r--r--linuxcon-eu-2013/comp_demo/shelf4.pngbin0 -> 34906 bytes
-rw-r--r--linuxcon-eu-2013/comp_demo/shelf5.pngbin0 -> 35034 bytes
-rw-r--r--linuxcon-eu-2013/comp_demo/terminology3.pngbin0 -> 29321 bytes
-rw-r--r--linuxcon-eu-2013/comp_demo/terminology4.pngbin0 -> 17396 bytes
12 files changed, 266 insertions, 19 deletions
diff --git a/linuxcon-eu-2013/comp_demo/.gitignore b/linuxcon-eu-2013/comp_demo/.gitignore
new file mode 100644
index 0000000..d9a5ce5
--- /dev/null
+++ b/linuxcon-eu-2013/comp_demo/.gitignore
@@ -0,0 +1 @@
compositing
diff --git a/linuxcon-eu-2013/comp_demo/compositing.c b/linuxcon-eu-2013/comp_demo/compositing.c
index f640e19..98e5bf0 100644
--- a/linuxcon-eu-2013/comp_demo/compositing.c
+++ b/linuxcon-eu-2013/comp_demo/compositing.c
@@ -1,7 +1,34 @@
1#include <Elementary.h> 1#include <Elementary.h>
2#include <Efx.h> 2#include <Efx.h>
3 3
4static unsigned int state = 0; 4typedef enum
5{
6 STATE_MENU_SHOW,
7 STATE_MENU_HIDE,
8 STATE_ICON1,
9 STATE_ICON2,
10 STATE_ICON3,
11 STATE_ICON_MOVE,
12 STATE_SHELF_MOVE1,
13 STATE_SHELF_MOVE2,
14 STATE_TERMINOLOGY_SHOW,
15 STATE_TERMINOLOGY_CODE,
16 STATE_FIREFOX_SHOW,
17 STATE_TERMINOLOGY_FADE1,
18 STATE_TERMINOLOGY_FADE2,
19 STATE_TERMINOLOGY_FADE3,
20 STATE_GIMP_SHELF,
21 STATE_GIMP_SHOW,
22 STATE_GIMP_ZOOM,
23 STATE_EXPOSE,
24 STATE_SHELF_RAISE,
25 STATE_ROTATE1,
26 STATE_ROTATE2,
27 STATE_ROTATE3,
28 STATE_ZOOM,
29} State;
30
31static State state = STATE_MENU_SHOW;
5 32
6static Evas_Object *win = NULL; 33static Evas_Object *win = NULL;
7 34
@@ -13,6 +40,9 @@ static Evas_Object *terminology[2] = {NULL};
13static Evas_Object *firefox = NULL; 40static Evas_Object *firefox = NULL;
14static Evas_Object *menu = NULL; 41static Evas_Object *menu = NULL;
15 42
43static Evas_Object *gimp[4] = {NULL};
44static Evas_Object *clip = NULL;
45
16static Evas_Object * 46static Evas_Object *
17image_add(const char *file, int *w, int *h) 47image_add(const char *file, int *w, int *h)
18{ 48{
@@ -46,7 +76,25 @@ zoom_end(void *data EINA_UNUSED, Efx_Map_Data *e EINA_UNUSED, Evas_Object *obj)
46} 76}
47 77
48static void 78static void
49fade_end(void *data EINA_UNUSED, Efx_Map_Data *e EINA_UNUSED, Evas_Object *obj) 79gimp_move_end(void *data EINA_UNUSED, Efx_Map_Data *e EINA_UNUSED, Evas_Object *obj)
80{
81 int x, y, w, h;
82
83 elm_image_file_set(obj, "gimp_focus_frame.png", NULL);
84
85 evas_object_geometry_get(obj, &x, &y, &w, &h);
86 clip = evas_object_rectangle_add(evas_object_evas_get(win));
87 evas_object_show(clip);
88
89 gimp[3] = image_add("gimp_focus_client.png", &w, &h);
90 evas_object_move(gimp[3], 0, 23);
91 evas_object_clip_set(gimp[3], clip);
92 evas_object_show(gimp[3]);
93 evas_object_geometry_set(clip, 0, 23, w, h);
94}
95
96static void
97fade_end(void *data EINA_UNUSED, Efx_Map_Data *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED)
50{ 98{
51 evas_object_hide(terminology[0]); 99 evas_object_hide(terminology[0]);
52} 100}
@@ -58,53 +106,128 @@ shelf_end(void *data EINA_UNUSED, Efx_Map_Data *e EINA_UNUSED, Evas_Object *obj)
58 efx_rotate_reset(obj); 106 efx_rotate_reset(obj);
59} 107}
60 108
109static void
110img_mouse_in(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
111{
112 int w, h;
113 efx_fade_stop(obj);
114 efx_resize_stop(obj);
115 elm_image_object_size_get(obj, &w, &h);
116 efx_resize(obj, EFX_EFFECT_SPEED_DECELERATE, NULL, w * .9, h * .9, 0.2, NULL, NULL);
117 efx_fade(obj, EFX_EFFECT_SPEED_LINEAR, EFX_COLOR(255, 255, 255), 255, 0.2, NULL, NULL);
118 evas_object_raise(obj);
119}
120
121static void
122img_mouse_out(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
123{
124 int w, h;
125 efx_fade_stop(obj);
126 efx_resize_stop(obj);
127 elm_image_object_size_get(obj, &w, &h);
128 efx_resize(obj, EFX_EFFECT_SPEED_DECELERATE, NULL, w * .66, h * .66, 0.2, NULL, NULL);
129 efx_fade(obj, EFX_EFFECT_SPEED_LINEAR, EFX_COLOR(200, 200, 200), 200, 0.2, NULL, NULL);
130}
131
132static void
133img_zoom_end(void *data EINA_UNUSED, Efx_Map_Data *e EINA_UNUSED, Evas_Object *obj)
134{
135 evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_IN, img_mouse_in, NULL);
136 evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_OUT, img_mouse_out, NULL);
137}
138
139static void
140reset_end(void *data EINA_UNUSED, Efx_Map_Data *e EINA_UNUSED, Evas_Object *obj)
141{
142 efx_spin_start(obj, 30, NULL);
143}
144
145static void
146rotate_mouse_in(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED)
147{
148 int ow, oh;
149 static int spin = 60;
150
151 evas_object_geometry_get(win, NULL, NULL, &ow, &oh);
152
153 if (spin == 60)
154 spin = -60;
155 else
156 spin = 60;
157 efx_spin_start(obj, spin, EFX_POINT(ow / 2, oh / 2));
158}
159
61static Eina_Bool 160static Eina_Bool
62mouse_down(void *data EINA_UNUSED, int t EINA_UNUSED, Ecore_Event_Mouse_Button *ev) 161mouse_down(void *data EINA_UNUSED, int t EINA_UNUSED, Ecore_Event_Mouse_Button *ev)
63{ 162{
64 Evas_Object *o; 163 Evas_Object *o;
65 int w, h, sw, sh; 164 int x, w, h, ow, oh, sw, sh;
66 165
67 switch (state) 166 switch (state)
68 { 167 {
69 case 0: 168 case STATE_MENU_SHOW:
70 menu = o = image_add("menu.png", &w, &h); 169 menu = o = image_add("menu.png", &w, &h);
71 evas_object_move(o, ev->x, ev->y); 170 evas_object_move(o, ev->x, ev->y);
72 efx_zoom(o, EFX_EFFECT_SPEED_DECELERATE, 0.8, 1.0, NULL, 0.2, zoom_end, NULL); 171 efx_zoom(o, EFX_EFFECT_SPEED_DECELERATE, 0.8, 1.0, NULL, 0.2, zoom_end, NULL);
73 evas_object_show(o); 172 evas_object_show(o);
74 break; 173 break;
75 case 1: 174 case STATE_MENU_HIDE:
76 efx_fade(menu, EFX_EFFECT_SPEED_DECELERATE, EFX_COLOR(0, 0, 0), 0, 0.2, NULL, NULL); 175 efx_fade(menu, EFX_EFFECT_SPEED_DECELERATE, EFX_COLOR(0, 0, 0), 0, 0.2, NULL, NULL);
77 efx_zoom(menu, EFX_EFFECT_SPEED_DECELERATE, 1.0, 0.8, NULL, 0.2, menu_del, NULL); 176 efx_zoom(menu, EFX_EFFECT_SPEED_DECELERATE, 1.0, 0.8, NULL, 0.2, menu_del, NULL);
78 menu = NULL; 177 menu = NULL;
79 break; 178 break;
80 case 5: 179 case STATE_ICON_MOVE:
81 efx_queue_run(imgs[1]); 180 efx_queue_run(imgs[1]);
82 efx_queue_run(imgs[2]); 181 efx_queue_run(imgs[2]);
83 break; 182 break;
84 case 6: 183 case STATE_SHELF_MOVE1:
85 evas_object_geometry_get(win, NULL, NULL, &sw, &sh); 184 evas_object_geometry_get(win, NULL, NULL, &sw, &sh);
86 shelf = o = image_add("shelf.png", &w, &h); 185 shelf = o = image_add("shelf.png", &w, &h);
87 evas_object_move(o, -w, sh - h); 186 evas_object_move(o, -w, sh - h);
88 evas_object_show(o); 187 evas_object_show(o);
89 188
90 efx_move(o, EFX_EFFECT_SPEED_DECELERATE, EFX_POINT(sw - (w / 2) - (h / 2), sh - h), 1.0, NULL, NULL); 189 efx_move(o, EFX_EFFECT_SPEED_DECELERATE, EFX_POINT(sw - (w / 2) - (h / 2) + 7, sh - h), 1.0, NULL, NULL);
91 efx_rotate(o, EFX_EFFECT_SPEED_DECELERATE, 810, NULL, 1.0, NULL, NULL); 190 efx_rotate(o, EFX_EFFECT_SPEED_DECELERATE, 810, NULL, 1.0, NULL, NULL);
92 break; 191 break;
93 case 7: 192 case STATE_SHELF_MOVE2:
94 evas_object_geometry_get(win, NULL, NULL, &sw, &sh); 193 evas_object_geometry_get(win, NULL, NULL, &sw, &sh);
95 elm_image_object_size_get(shelf, &w, &h); 194 elm_image_object_size_get(shelf, &w, &h);
96 efx_move(shelf, EFX_EFFECT_SPEED_DECELERATE, EFX_POINT((sw / 2) - (w / 2), sh - h), 0.5, NULL, NULL); 195 efx_move(shelf, EFX_EFFECT_SPEED_DECELERATE, EFX_POINT((sw / 2) - (w / 2), sh - h), 0.5, NULL, NULL);
97 efx_rotate(shelf, EFX_EFFECT_SPEED_DECELERATE, -90, NULL, 0.5, shelf_end, NULL); 196 efx_rotate(shelf, EFX_EFFECT_SPEED_DECELERATE, -90, NULL, 0.5, shelf_end, NULL);
98 break; 197 break;
99 case 10: 198 case STATE_TERMINOLOGY_FADE1:
100 efx_fade(terminology[1], EFX_EFFECT_SPEED_LINEAR, EFX_COLOR(0, 0, 0), 0, 2.0, NULL, NULL); 199 efx_fade(terminology[1], EFX_EFFECT_SPEED_LINEAR, EFX_COLOR(0, 0, 0), 0, 2.0, NULL, NULL);
101 break; 200 break;
102 case 11: 201 case STATE_TERMINOLOGY_FADE2:
103 efx_fade(terminology[1], EFX_EFFECT_SPEED_LINEAR, EFX_COLOR(180, 180, 180), 180, 3.5, NULL, NULL); 202 efx_fade(terminology[1], EFX_EFFECT_SPEED_LINEAR, EFX_COLOR(180, 180, 180), 180, 3.5, NULL, NULL);
104 break; 203 break;
105 case 12: 204 case STATE_TERMINOLOGY_FADE3:
106 efx_fade_reset(terminology[1]); 205 efx_fade_reset(terminology[1]);
107 break; 206 break;
207 case STATE_GIMP_SHOW:
208 elm_image_file_set(shelf, "shelf5.png", NULL);
209 evas_object_geometry_get(win, NULL, NULL, &sw, NULL);
210
211 efx_move(terminology[1], EFX_EFFECT_SPEED_DECELERATE, EFX_POINT(-sw, 0), 0.2, NULL, NULL);
212 evas_object_geometry_get(firefox, &x, NULL, NULL, NULL);
213 efx_move(firefox, EFX_EFFECT_SPEED_DECELERATE, EFX_POINT(x - sw, 0), 0.2, NULL, NULL);
214
215 gimp[0] = image_add("gimp_focus.png", &w, &h); // main
216 evas_object_show(gimp[0]);
217 ow = w, oh = h;
218 evas_object_move(gimp[0], sw, 0);
219 efx_move(gimp[0], EFX_EFFECT_SPEED_DECELERATE, EFX_POINT(-5, 0), 0.2, gimp_move_end, NULL);
220
221 gimp[1] = image_add("gimp2.png", &w, &h); // layers
222 evas_object_show(gimp[1]);
223 evas_object_move(gimp[1], sw + ow - w, oh + 2);
224 efx_move(gimp[1], EFX_EFFECT_SPEED_DECELERATE, EFX_POINT(ow - w, oh + 2), 0.2, NULL, NULL);
225
226 gimp[2] = image_add("gimp3.png", &w, &h); //toolbox
227 evas_object_show(gimp[2]);
228 evas_object_move(gimp[2], sw + ow + 5, 0);
229 efx_move(gimp[2], EFX_EFFECT_SPEED_DECELERATE, EFX_POINT(ow + (ow / 2), 0), 0.2, NULL, NULL);
230 break;
108 default: break; 231 default: break;
109 } 232 }
110 return ECORE_CALLBACK_RENEW; 233 return ECORE_CALLBACK_RENEW;
@@ -114,16 +237,16 @@ static Eina_Bool
114mouse_up(void *data EINA_UNUSED, int t EINA_UNUSED, Ecore_Event_Mouse_Button *ev EINA_UNUSED) 237mouse_up(void *data EINA_UNUSED, int t EINA_UNUSED, Ecore_Event_Mouse_Button *ev EINA_UNUSED)
115{ 238{
116 Evas_Object *o; 239 Evas_Object *o;
117 int x, y, w, h, ow, sh; 240 int x, y, w, h, ow, oh;
118 241
119 switch (state) 242 switch (state)
120 { 243 {
121 case 2: 244 case STATE_ICON1:
122 case 3: 245 case STATE_ICON2:
123 case 4: 246 case STATE_ICON3:
124 evas_object_show(imgs[state - 2]); 247 evas_object_show(imgs[state - 2]);
125 break; 248 break;
126 case 8: 249 case STATE_TERMINOLOGY_SHOW:
127 evas_object_geometry_get(imgs[0], NULL, NULL, &ow, NULL); 250 evas_object_geometry_get(imgs[0], NULL, NULL, &ow, NULL);
128 251
129 terminology[0] = o = image_add("terminology1.png", &w, &h); 252 terminology[0] = o = image_add("terminology1.png", &w, &h);
@@ -133,10 +256,13 @@ mouse_up(void *data EINA_UNUSED, int t EINA_UNUSED, Ecore_Event_Mouse_Button *ev
133 256
134 elm_image_file_set(shelf, "shelf2.png", NULL); 257 elm_image_file_set(shelf, "shelf2.png", NULL);
135 break; 258 break;
136 case 9: 259 case STATE_TERMINOLOGY_CODE:
260 elm_image_file_set(terminology[0], "terminology3.png", NULL);
261 break;
262 case STATE_FIREFOX_SHOW:
137 evas_object_geometry_get(terminology[0], &x, &y, &ow, NULL); 263 evas_object_geometry_get(terminology[0], &x, &y, &ow, NULL);
138 264
139 terminology[1] = o = image_add("terminology2.png", &w, &h); 265 terminology[1] = o = image_add("terminology4.png", &w, &h);
140 evas_object_move(o, x, y); 266 evas_object_move(o, x, y);
141 evas_object_stack_above(terminology[1], terminology[0]); 267 evas_object_stack_above(terminology[1], terminology[0]);
142 efx_fade(terminology[1], EFX_EFFECT_SPEED_DECELERATE, EFX_COLOR(0, 0, 0), 0, 0, NULL, NULL); 268 efx_fade(terminology[1], EFX_EFFECT_SPEED_DECELERATE, EFX_COLOR(0, 0, 0), 0, 0, NULL, NULL);
@@ -152,12 +278,131 @@ mouse_up(void *data EINA_UNUSED, int t EINA_UNUSED, Ecore_Event_Mouse_Button *ev
152 278
153 elm_image_file_set(shelf, "shelf3.png", NULL); 279 elm_image_file_set(shelf, "shelf3.png", NULL);
154 break; 280 break;
281 case STATE_GIMP_SHELF:
282 elm_image_file_set(shelf, "shelf4.png", NULL);
283 break;
284 case STATE_GIMP_ZOOM:
285 state++;
286 case STATE_EXPOSE:
287 elm_image_file_set(gimp[0], "gimp1.png", NULL);
288 evas_object_del(gimp[3]);
289
290 evas_object_geometry_get(win, NULL, NULL, &ow, &oh);
291
292 evas_object_geometry_set(clip, 0, 0, ow, oh);
293 evas_object_stack_above(clip, shelf);
294 efx_fade(clip, EFX_EFFECT_SPEED_LINEAR, EFX_COLOR(0, 0, 0), 0, 0.0, NULL, NULL);
295 efx_fade(clip, EFX_EFFECT_SPEED_LINEAR, EFX_COLOR(0, 0, 0), 192, 0.5, NULL, NULL);
296
297 //main
298 elm_image_object_size_get(gimp[0], &w, &h);
299 efx_resize(gimp[0], EFX_EFFECT_SPEED_DECELERATE, EFX_POINT(ow / 2, 10), w * .66, h * .66, 0.5, img_zoom_end, NULL);
300 evas_object_geometry_get(gimp[0], &x, &y, &w, &h);
301 {
302 int ww;
303
304 elm_image_object_size_get(gimp[1], &ww, &h);
305 //layers
306 efx_resize(gimp[1], EFX_EFFECT_SPEED_DECELERATE, EFX_POINT((ow / 2) + (w / 2) - ww, (oh / 2) + (h / 2)), ww * .66, h * .66, 0.5, img_zoom_end, NULL);
307 }
308 //toolbox
309 elm_image_object_size_get(gimp[2], &w, &h);
310 efx_resize(gimp[2], EFX_EFFECT_SPEED_DECELERATE, EFX_POINT(ow - (w * .9), 10), w * .66, h * .66, 0.5, img_zoom_end, NULL);
311
312 efx_fade(gimp[0], EFX_EFFECT_SPEED_LINEAR, EFX_COLOR(200, 200, 200), 200, 0.5, NULL, NULL);
313 efx_fade(gimp[1], EFX_EFFECT_SPEED_LINEAR, EFX_COLOR(200, 200, 200), 200, 0.5, NULL, NULL);
314 efx_fade(gimp[2], EFX_EFFECT_SPEED_LINEAR, EFX_COLOR(200, 200, 200), 200, 0.5, NULL, NULL);
315
316 elm_image_object_size_get(terminology[1], &w, &h);
317 efx_resize(terminology[1], EFX_EFFECT_SPEED_DECELERATE, EFX_POINT(10, (oh / 2) - (h * .66 / 2)), w * .66, h * .66, 0.5, img_zoom_end, NULL);
318 efx_fade(terminology[1], EFX_EFFECT_SPEED_LINEAR, EFX_COLOR(200, 200, 200), 200, 0.5, NULL, NULL);
319
320 elm_image_object_size_get(firefox, &w, &h);
321 efx_resize(firefox, EFX_EFFECT_SPEED_DECELERATE, EFX_POINT((ow / 2) - w, (oh / 2) - (h * .66 / 2)), w * .66, h * .66, 0.5, img_zoom_end, NULL);
322 efx_fade(firefox, EFX_EFFECT_SPEED_LINEAR, EFX_COLOR(200, 200, 200), 200, 0.5, NULL, NULL);
323 break;
324 case STATE_SHELF_RAISE:
325 evas_object_raise(shelf);
326 break;
327 case STATE_ROTATE1:
328 efx_fade(clip, EFX_EFFECT_SPEED_LINEAR, EFX_COLOR(0, 0, 0), 0, 0.5, NULL, NULL);
329
330 evas_object_event_callback_del(gimp[0], EVAS_CALLBACK_MOUSE_IN, img_mouse_in);
331 evas_object_event_callback_del(gimp[0], EVAS_CALLBACK_MOUSE_OUT, img_mouse_out);
332 evas_object_event_callback_del(gimp[1], EVAS_CALLBACK_MOUSE_IN, img_mouse_in);
333 evas_object_event_callback_del(gimp[1], EVAS_CALLBACK_MOUSE_OUT, img_mouse_out);
334 evas_object_event_callback_del(gimp[2], EVAS_CALLBACK_MOUSE_IN, img_mouse_in);
335 evas_object_event_callback_del(gimp[2], EVAS_CALLBACK_MOUSE_OUT, img_mouse_out);
336 evas_object_event_callback_del(terminology[1], EVAS_CALLBACK_MOUSE_IN, img_mouse_in);
337 evas_object_event_callback_del(terminology[1], EVAS_CALLBACK_MOUSE_OUT, img_mouse_out);
338 evas_object_event_callback_del(firefox, EVAS_CALLBACK_MOUSE_IN, img_mouse_in);
339 evas_object_event_callback_del(firefox, EVAS_CALLBACK_MOUSE_OUT, img_mouse_out);
340
341 evas_object_geometry_get(win, NULL, NULL, &ow, &oh);
342
343 efx_spin_start(gimp[0], 70, NULL);
344 efx_fade_reset(gimp[0]);
345 efx_move(gimp[0], EFX_EFFECT_SPEED_DECELERATE, EFX_POINT(2 * ow, 2 * oh), 0.5, NULL, NULL);
346 efx_spin_start(gimp[1], 70, NULL);
347 efx_fade_reset(gimp[1]);
348 efx_move(gimp[1], EFX_EFFECT_SPEED_DECELERATE, EFX_POINT(- ow, 2 * oh), 0.5, NULL, NULL);
349 efx_spin_start(gimp[2], 70, NULL);
350 efx_move(gimp[2], EFX_EFFECT_SPEED_DECELERATE, EFX_POINT(2 * ow, - oh), 0.5, NULL, NULL);
351 efx_fade_reset(gimp[2]);
352
353 elm_image_object_size_get(firefox, &w, &h);
354 efx_resize(firefox, EFX_EFFECT_SPEED_DECELERATE, EFX_POINT(ow - w, 0), w, h, 0.5, NULL, NULL);
355 efx_fade_reset(firefox);
356
357 evas_object_geometry_get(imgs[0], NULL, NULL, &w, NULL);
358 elm_image_object_size_get(terminology[1], &ow, &oh);
359 efx_resize(terminology[1], EFX_EFFECT_SPEED_DECELERATE, EFX_POINT(w + 2, 0), ow, oh, 0.5, reset_end, NULL);
360 efx_fade_reset(terminology[1]);
361 break;
362 case STATE_ROTATE2:
363 efx_spin_stop(terminology[1]);
364 efx_spin_start(firefox, -30, NULL);
365 break;
366 case STATE_ROTATE3:
367 evas_object_geometry_get(win, NULL, NULL, &ow, &oh);
368 efx_spin_reset(firefox);
369 efx_spin_reset(terminology[1]);
370 efx_spin_start(terminology[1], 60, EFX_POINT(ow / 2, oh / 2));
371 evas_object_event_callback_add(terminology[1], EVAS_CALLBACK_MOUSE_IN, rotate_mouse_in, NULL);
372 break;
373 case STATE_ZOOM:
374 efx_spin_reset(terminology[1]);
375 efx_zoom(shelf, EFX_EFFECT_SPEED_ACCELERATE, 1.0, 5.0, NULL, 1.5, NULL, NULL);
376 break;
155 default: break; 377 default: break;
156 } 378 }
157 state++; 379 state++;
158 return ECORE_CALLBACK_RENEW; 380 return ECORE_CALLBACK_RENEW;
159} 381}
160 382
383static Eina_Bool
384mouse_wheel(void *d EINA_UNUSED, int t EINA_UNUSED, Ecore_Event_Mouse_Wheel *ev)
385{
386 int dir = ev->z % 2;
387 switch (state)
388 {
389 static double zoom = 1.0;
390
391 case STATE_GIMP_ZOOM:
392 if (dir == 1)
393 zoom -= 0.05;
394 else if (dir == -1)
395 zoom += 0.05;
396 else break;
397 if (zoom < 0.05) //clamp
398 zoom = 0.05;
399 efx_zoom(gimp[3], EFX_EFFECT_SPEED_ACCELERATE, 0.0, zoom, EFX_POINT(ev->x, ev->y), 0.1, NULL, NULL);
400 break;
401 default: break;
402 }
403 return ECORE_CALLBACK_RENEW;
404}
405
161int 406int
162main(int argc, char *argv[]) 407main(int argc, char *argv[])
163{ 408{
@@ -170,6 +415,7 @@ main(int argc, char *argv[])
170 ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, (Ecore_Event_Handler_Cb)key_down, NULL); 415 ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, (Ecore_Event_Handler_Cb)key_down, NULL);
171 ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_UP, (Ecore_Event_Handler_Cb)mouse_up, NULL); 416 ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_UP, (Ecore_Event_Handler_Cb)mouse_up, NULL);
172 ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, (Ecore_Event_Handler_Cb)mouse_down, NULL); 417 ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, (Ecore_Event_Handler_Cb)mouse_down, NULL);
418 ecore_event_handler_add(ECORE_EVENT_MOUSE_WHEEL, (Ecore_Event_Handler_Cb)mouse_wheel, NULL);
173 419
174 win = elm_win_util_standard_add("desktop", "demo"); 420 win = elm_win_util_standard_add("desktop", "demo");
175 o = elm_bg_add(win); 421 o = elm_bg_add(win);
diff --git a/linuxcon-eu-2013/comp_demo/gimp1.png b/linuxcon-eu-2013/comp_demo/gimp1.png
new file mode 100644
index 0000000..7370b74
--- /dev/null
+++ b/linuxcon-eu-2013/comp_demo/gimp1.png
Binary files differ
diff --git a/linuxcon-eu-2013/comp_demo/gimp2.png b/linuxcon-eu-2013/comp_demo/gimp2.png
new file mode 100644
index 0000000..ad47a5d
--- /dev/null
+++ b/linuxcon-eu-2013/comp_demo/gimp2.png
Binary files differ
diff --git a/linuxcon-eu-2013/comp_demo/gimp3.png b/linuxcon-eu-2013/comp_demo/gimp3.png
new file mode 100644
index 0000000..fbb50b9
--- /dev/null
+++ b/linuxcon-eu-2013/comp_demo/gimp3.png
Binary files differ
diff --git a/linuxcon-eu-2013/comp_demo/gimp_focus.png b/linuxcon-eu-2013/comp_demo/gimp_focus.png
new file mode 100644
index 0000000..49bd00c
--- /dev/null
+++ b/linuxcon-eu-2013/comp_demo/gimp_focus.png
Binary files differ
diff --git a/linuxcon-eu-2013/comp_demo/gimp_focus_client.png b/linuxcon-eu-2013/comp_demo/gimp_focus_client.png
new file mode 100644
index 0000000..a75a090
--- /dev/null
+++ b/linuxcon-eu-2013/comp_demo/gimp_focus_client.png
Binary files differ
diff --git a/linuxcon-eu-2013/comp_demo/gimp_focus_frame.png b/linuxcon-eu-2013/comp_demo/gimp_focus_frame.png
new file mode 100644
index 0000000..d808c4e
--- /dev/null
+++ b/linuxcon-eu-2013/comp_demo/gimp_focus_frame.png
Binary files differ
diff --git a/linuxcon-eu-2013/comp_demo/shelf4.png b/linuxcon-eu-2013/comp_demo/shelf4.png
new file mode 100644
index 0000000..2ebcacf
--- /dev/null
+++ b/linuxcon-eu-2013/comp_demo/shelf4.png
Binary files differ
diff --git a/linuxcon-eu-2013/comp_demo/shelf5.png b/linuxcon-eu-2013/comp_demo/shelf5.png
new file mode 100644
index 0000000..7f286dd
--- /dev/null
+++ b/linuxcon-eu-2013/comp_demo/shelf5.png
Binary files differ
diff --git a/linuxcon-eu-2013/comp_demo/terminology3.png b/linuxcon-eu-2013/comp_demo/terminology3.png
new file mode 100644
index 0000000..851c8a7
--- /dev/null
+++ b/linuxcon-eu-2013/comp_demo/terminology3.png
Binary files differ
diff --git a/linuxcon-eu-2013/comp_demo/terminology4.png b/linuxcon-eu-2013/comp_demo/terminology4.png
new file mode 100644
index 0000000..a679e8b
--- /dev/null
+++ b/linuxcon-eu-2013/comp_demo/terminology4.png
Binary files differ