summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordiscomfitor <michael.blumenkrantz@gmail.com>2013-10-20 16:06:19 +0100
committerdiscomfitor <michael.blumenkrantz@gmail.com>2013-10-20 16:06:19 +0100
commitb68a721afe4ae524536d3953ec67a3fdc4c54382 (patch)
tree74e0dc1f9d08434d86b11b78fed6d582b88d8bd4
parent131419bfbf8a1d7512af58ec3cb4e32680aad9ec (diff)
don't create dm_show unless needed
-rw-r--r--src/desksanity.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/desksanity.c b/src/desksanity.c
index d353017..44b0d9d 100644
--- a/src/desksanity.c
+++ b/src/desksanity.c
@@ -97,9 +97,7 @@ _ds_show(E_Desk *desk, int dx, int dy)
97 evas_object_show(ec->frame); 97 evas_object_show(ec->frame);
98 } 98 }
99 desk_show = desk; 99 desk_show = desk;
100 /* create mirror for current desk */ 100
101 dm_show = dm_add(desk);
102 evas_object_name_set(dm_show, "dm_show");
103 e_comp_shape_queue_block(e_comp_get(desk), 1); 101 e_comp_shape_queue_block(e_comp_get(desk), 1);
104 /* guarantee that the user gets to see each flip 102 /* guarantee that the user gets to see each flip
105 * at least once 103 * at least once
@@ -145,30 +143,30 @@ _ds_show(E_Desk *desk, int dx, int dy)
145 hy = desk->zone->y - desk->zone->h; 143 hy = desk->zone->y - desk->zone->h;
146 break; 144 break;
147 } 145 }
146 dm_show = dm_add(desk);
148 evas_object_move(dm_show, x, y); 147 evas_object_move(dm_show, x, y);
149 efx_move(dm_hide, EFX_EFFECT_SPEED_DECELERATE, EFX_POINT(hx, hy), 0.2, NULL, NULL); 148 efx_move(dm_hide, EFX_EFFECT_SPEED_DECELERATE, EFX_POINT(hx, hy), 0.2, NULL, NULL);
150 efx_move(dm_show, EFX_EFFECT_SPEED_DECELERATE, EFX_POINT(desk->zone->x, desk->zone->y), 0.2, _ds_end, NULL); 149 efx_move(dm_show, EFX_EFFECT_SPEED_DECELERATE, EFX_POINT(desk->zone->x, desk->zone->y), 0.2, _ds_end, NULL);
151 break; 150 break;
152 case DS_FADE_OUT: 151 case DS_FADE_OUT:
153 E_FREE_FUNC(dm_show, evas_object_del);
154 efx_fade(dm_hide, EFX_EFFECT_SPEED_LINEAR, EFX_COLOR(0, 0, 0), 0, 0.25, _ds_end, NULL); 152 efx_fade(dm_hide, EFX_EFFECT_SPEED_LINEAR, EFX_COLOR(0, 0, 0), 0, 0.25, _ds_end, NULL);
155 break; 153 break;
156 case DS_FADE_IN: 154 case DS_FADE_IN:
157 E_FREE_FUNC(dm_hide, evas_object_del); 155 E_FREE_FUNC(dm_hide, evas_object_del);
156 dm_show = dm_add(desk);
158 efx_fade(dm_show, EFX_EFFECT_SPEED_LINEAR, EFX_COLOR(0, 0, 0), 0, 0.0, NULL, NULL); 157 efx_fade(dm_show, EFX_EFFECT_SPEED_LINEAR, EFX_COLOR(0, 0, 0), 0, 0.0, NULL, NULL);
159 efx_fade(dm_show, EFX_EFFECT_SPEED_LINEAR, EFX_COLOR(255, 255, 255), 255, 0.25, _ds_end, NULL); 158 efx_fade(dm_show, EFX_EFFECT_SPEED_LINEAR, EFX_COLOR(255, 255, 255), 255, 0.25, _ds_end, NULL);
160 break; 159 break;
161 case DS_BATMAN: 160 case DS_BATMAN:
162 E_FREE_FUNC(dm_show, evas_object_del);
163 evas_object_raise(dm_hide); 161 evas_object_raise(dm_hide);
164 efx_spin_start(dm_hide, 1080.0, NULL); 162 efx_spin_start(dm_hide, 1080.0, NULL);
165 efx_zoom(dm_hide, EFX_EFFECT_SPEED_LINEAR, 1.0, 0.00001, NULL, 0.4, _ds_end, NULL); 163 efx_zoom(dm_hide, EFX_EFFECT_SPEED_LINEAR, 1.0, 0.00001, NULL, 0.4, _ds_end, NULL);
166 break; 164 break;
167 case DS_ZOOM_IN: 165 case DS_ZOOM_IN:
166 dm_show = dm_add(desk);
168 efx_zoom(dm_show, EFX_EFFECT_SPEED_LINEAR, 0.000001, 1.0, NULL, 0.4, _ds_end, NULL); 167 efx_zoom(dm_show, EFX_EFFECT_SPEED_LINEAR, 0.000001, 1.0, NULL, 0.4, _ds_end, NULL);
169 break; 168 break;
170 case DS_ZOOM_OUT: 169 case DS_ZOOM_OUT:
171 E_FREE_FUNC(dm_show, evas_object_del);
172 evas_object_raise(dm_hide); 170 evas_object_raise(dm_hide);
173 efx_zoom(dm_hide, EFX_EFFECT_SPEED_LINEAR, 1.0, 0.0000001, NULL, 0.4, _ds_end, NULL); 171 efx_zoom(dm_hide, EFX_EFFECT_SPEED_LINEAR, 1.0, 0.0000001, NULL, 0.4, _ds_end, NULL);
174 break; 172 break;
@@ -185,6 +183,7 @@ _ds_show(E_Desk *desk, int dx, int dy)
185 y = desk->zone->y + desk->zone->h; 183 y = desk->zone->y + desk->zone->h;
186 else if (!dy) 184 else if (!dy)
187 h = desk->zone->h; 185 h = desk->zone->h;
186 dm_show = dm_add(desk);
188 o = evas_object_rectangle_add(e_comp_get(desk)->evas); 187 o = evas_object_rectangle_add(e_comp_get(desk)->evas);
189 evas_object_geometry_set(o, x, y, w, h); 188 evas_object_geometry_set(o, x, y, w, h);
190 evas_object_clip_set(dm_show, o); 189 evas_object_clip_set(dm_show, o);
@@ -193,12 +192,12 @@ _ds_show(E_Desk *desk, int dx, int dy)
193 efx_resize(o, EFX_EFFECT_SPEED_LINEAR, EFX_POINT(hx, hy), desk->zone->w, desk->zone->h, 0.4, _ds_end, NULL); 192 efx_resize(o, EFX_EFFECT_SPEED_LINEAR, EFX_POINT(hx, hy), desk->zone->w, desk->zone->h, 0.4, _ds_end, NULL);
194 break; 193 break;
195 case DS_ROTATE_OUT: 194 case DS_ROTATE_OUT:
196 E_FREE_FUNC(dm_show, evas_object_del);
197 efx_move_circle(dm_hide, EFX_EFFECT_SPEED_LINEAR, EFX_POINT(desk->zone->x + (desk->zone->w / 2), desk->zone->y + (desk->zone->h / 2)), 195 efx_move_circle(dm_hide, EFX_EFFECT_SPEED_LINEAR, EFX_POINT(desk->zone->x + (desk->zone->w / 2), desk->zone->y + (desk->zone->h / 2)),
198 720, 0.4, NULL, NULL); 196 720, 0.4, NULL, NULL);
199 efx_resize(dm_hide, EFX_EFFECT_SPEED_LINEAR, NULL, 1, 1, 0.4, _ds_end, NULL); 197 efx_resize(dm_hide, EFX_EFFECT_SPEED_LINEAR, NULL, 1, 1, 0.4, _ds_end, NULL);
200 break; 198 break;
201 case DS_ROTATE_IN: 199 case DS_ROTATE_IN:
200 dm_show = dm_add(desk);
202 evas_object_resize(dm_show, 1, 1); 201 evas_object_resize(dm_show, 1, 1);
203 efx_move_circle(dm_show, EFX_EFFECT_SPEED_LINEAR, EFX_POINT(desk->zone->x + (desk->zone->w / 2), desk->zone->y + (desk->zone->h / 2)), 202 efx_move_circle(dm_show, EFX_EFFECT_SPEED_LINEAR, EFX_POINT(desk->zone->x + (desk->zone->w / 2), desk->zone->y + (desk->zone->h / 2)),
204 720, 0.4, NULL, NULL); 203 720, 0.4, NULL, NULL);
@@ -210,7 +209,6 @@ _ds_show(E_Desk *desk, int dx, int dy)
210 Evas_Point exy; 209 Evas_Point exy;
211 unsigned int i, num; 210 unsigned int i, num;
212 211
213 E_FREE_FUNC(dm_show, evas_object_del);
214 num = (rand() % 4) + 2; 212 num = (rand() % 4) + 2;
215 213
216 dmh = dm_hide; 214 dmh = dm_hide;
@@ -277,7 +275,6 @@ _ds_show(E_Desk *desk, int dx, int dy)
277 {desk->zone->x + (desk->zone->w * 2), desk->zone->y + (desk->zone->h * 2)} 275 {desk->zone->x + (desk->zone->w * 2), desk->zone->y + (desk->zone->h * 2)}
278 }; 276 };
279 277
280 E_FREE_FUNC(dm_show, evas_object_del);
281 dmh[0] = dm_hide; 278 dmh[0] = dm_hide;
282 for (i = 0; i < 4; i++) 279 for (i = 0; i < 4; i++)
283 { 280 {
@@ -312,7 +309,6 @@ _ds_show(E_Desk *desk, int dx, int dy)
312 {desk->zone->x + (desk->zone->w / 2), desk->zone->y + (desk->zone->h / 2)} 309 {desk->zone->x + (desk->zone->w / 2), desk->zone->y + (desk->zone->h / 2)}
313 }; 310 };
314 311
315 E_FREE_FUNC(dm_show, evas_object_del);
316 dmh[0] = dm_hide; 312 dmh[0] = dm_hide;
317 for (i = 0; i < 4; i++) 313 for (i = 0; i < 4; i++)
318 { 314 {
@@ -340,7 +336,6 @@ _ds_show(E_Desk *desk, int dx, int dy)
340 { 336 {
341 Evas_Object *clip; 337 Evas_Object *clip;
342 338
343 E_FREE_FUNC(dm_show, evas_object_del);
344 clip = evas_object_rectangle_add(e_comp_get(desk)->evas); 339 clip = evas_object_rectangle_add(e_comp_get(desk)->evas);
345 /* fit clipper to zone */ 340 /* fit clipper to zone */
346 evas_object_geometry_set(clip, desk->zone->x, desk->zone->y, desk->zone->w, desk->zone->h); 341 evas_object_geometry_set(clip, desk->zone->x, desk->zone->y, desk->zone->w, desk->zone->h);
@@ -356,7 +351,6 @@ _ds_show(E_Desk *desk, int dx, int dy)
356 { 351 {
357 Evas_Object *clip; 352 Evas_Object *clip;
358 353
359 E_FREE_FUNC(dm_show, evas_object_del);
360 clip = evas_object_rectangle_add(e_comp_get(desk)->evas); 354 clip = evas_object_rectangle_add(e_comp_get(desk)->evas);
361 /* fit clipper to zone */ 355 /* fit clipper to zone */
362 evas_object_geometry_set(clip, desk->zone->x, desk->zone->y, desk->zone->w, desk->zone->h); 356 evas_object_geometry_set(clip, desk->zone->x, desk->zone->y, desk->zone->w, desk->zone->h);
@@ -371,6 +365,7 @@ _ds_show(E_Desk *desk, int dx, int dy)
371 break; 365 break;
372 default: break; 366 default: break;
373 } 367 }
368 if (dm_show) evas_object_name_set(dm_show, "dm_show");
374} 369}
375 370
376static void 371static void