tizen 2.3 release
[apps/home/b2-clocksetting.git] / data / changeable / groups / genlist_macro.edc
1 /*
2  * Copyright (c) 2010 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions are met:
8  *
9  *   1. Redistributions of source code must retain the above copyright notice, this
10  *      list of conditions and the following disclaimer.
11  *   2. Redistributions in binary form must reproduce the above copyright notice,
12  *      this list of conditions and the following disclaimer in the documentation
13  *      and/or other materials provided with the distribution.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
19  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25  */
26
27 /*
28  * vim:ts=3
29 */
30
31 //****************************************************************************//
32 // *****************  EDJE description have 24 patterns **********************//
33  //**************************************************************************//
34 // ------------------
35 // | --> HERE
36 // ------------------
37  #define DESC_FROM_L( PARAM ) \
38    description { state: "default" 0.0;\
39       fixed: 1 0; \
40       align: 0.0 0.5; \
41       rel2.relative: 0.0 1.0; \
42       PARAM\
43    }
44
45 // ------------------
46 //         HERE <-- |
47 // ------------------
48  #define DESC_FROM_R( PARAM ) \
49    description { state: "default" 0.0;\
50       fixed: 1 0; \
51       align: 1.0 0.5; \
52       rel1.relative: 1 0; \
53       PARAM\
54    }
55
56 // ----------
57 // |  HERE  |
58 // ----------
59 // |        |
60 // ----------
61  #define DESC_FROM_T( PARAM ) \
62    description { state: "default" 0.0;\
63       fixed: 0 1; \
64       align: 0.5 0.0; \
65       rel2.relative: 1.0 0.0; \
66       PARAM\
67    }
68
69 // ----------
70 // |  HERE  |
71 // ----------
72 // |        |
73 // ----------
74  #define DESC_FROM_B( PARAM ) \
75    description { state: "default" 0.0;\
76       fixed: 0 1; \
77       rel1.relative: 0.0 1.0; \
78       align: 0.5 1.0; \
79       PARAM\
80    }
81
82 // ------------------
83 // |  PART == HERE  |
84 // ------------------
85  #define DESC_TO( PART, PARAM ) \
86    description { state: "default" 0.0;\
87       rel1 { \
88          relative: 0 0; \
89          to: PART; \
90       }\
91       rel2 {\
92          relative: 1 1;\
93          to: PART; \
94       }\
95       PARAM\
96    }
97
98 //      |   TOP  |
99 // ---------------------
100 // LEFT |  HERE  | RIGHT
101 // ---------------------
102 //      | BOTTOM |
103 #define DESC_LRTB( LEFT, RIGHT, TOP, BOTTOM, PARAM ) \
104    description { state: "default" 0.0;\
105       rel1 { \
106          relative: 1 1; \
107          to_x: LEFT; \
108          to_y: TOP; \
109       }\
110       rel2 {\
111          relative: 0 0;\
112          to_x: RIGHT;\
113          to_y: BOTTOM;\
114       }\
115       PARAM\
116    }
117
118 // ---------------------
119 // LEFT |--> HERE
120 // ---------------------
121 #define DESC_L( LEFT, PARAM ) \
122    description { state: "default" 0.0;\
123       align: 0 0.5; \
124       fixed: 1 0; \
125       rel1 { \
126          relative: 1 0; \
127          to_x: LEFT; \
128       }\
129       rel2 { \
130          relative: 1 1;\
131          to_x: LEFT; \
132       }\
133       PARAM\
134    }
135
136 // ---------------------
137 //   HERE  <--| RIGHT
138 // ---------------------
139 #define DESC_R( RIGHT, PARAM ) \
140    description { state: "default" 0.0;\
141       align: 1 0.5; \
142       fixed: 1 0; \
143       rel1 { \
144          relative: 0 0; \
145          to_x: RIGHT; \
146       }\
147       rel2 {\
148          relative: 0 1;\
149          to_x: RIGHT; \
150       }\
151       PARAM\
152    }
153
154 // --------------------------
155 // LEFT |--> HERE  <--| RIGHT
156 // --------------------------
157 #define DESC_LR( LEFT, RIGHT, PARAM ) \
158    description { state: "default" 0.0;\
159       rel1 { \
160          relative: 1 0; \
161          to_x: LEFT; \
162       }\
163       rel2 {\
164          relative: 0 1;\
165          to_x: RIGHT;\
166       }\
167       PARAM\
168    }
169
170 //   |  TOP     |
171 // -----------------
172 //  |  HERE  <--| RIGHT
173 // -----------------
174 //  | BOTTOM   |
175 #define DESC_RTB( RIGHT, TOP, BOTTOM, PARAM ) \
176    description { state: "default" 0.0;\
177       align: 1 0.5;\
178       rel1 { \
179          relative: 0 1; \
180          to_x: RIGHT; \
181          to_y: TOP; \
182       }\
183       rel2 {\
184          relative: 0 0;\
185          to_x: RIGHT;\
186          to_y: BOTTOM;\
187       }\
188       PARAM\
189    }
190
191 // LEFT |  HERE  | RIGHT
192 // ---------------------
193 //      | BOTTOM |
194 #define DESC_LRB( LEFT, RIGHT, BOTTOM, PARAM ) \
195    description { state: "default" 0.0;\
196       align: 0.5 1;\
197       rel1 { \
198          relative: 1 0; \
199          to_x: LEFT; \
200          to_y: BOTTOM; \
201       }\
202       rel2 {\
203          relative: 0 0;\
204          to_x: RIGHT;\
205          to_y: BOTTOM;\
206       }\
207       PARAM\
208    }
209
210 //      |   TOP  |
211 // ---------------------
212 // LEFT |  HERE  | RIGHT
213 #define DESC_LRT( LEFT, RIGHT, TOP, PARAM ) \
214    description { state: "default" 0.0;\
215       align: 0.5 0;\
216       rel1 { \
217          relative: 1 1; \
218          to_x: LEFT; \
219          to_y: TOP; \
220       }\
221       rel2 {\
222          relative: 0 1;\
223          to_x: RIGHT;\
224          to_y: TOP;\
225       }\
226       PARAM\
227    }
228
229 //      |       TOP  |
230 // ---------------------
231 // LEFT | -->  HERE  |
232 #define DESC_LT( LEFT, TOP, PARAM ) \
233    description { state: "default" 0.0;\
234       align: 0 0;\
235       rel1 { \
236          relative: 1 1; \
237          to_x: LEFT; \
238          to_y: TOP; \
239       }\
240       rel2 {\
241          relative: 1 1;\
242          to_x: LEFT;\
243          to_y: TOP;\
244       }\
245       PARAM\
246    }
247
248 // LEFT |  --> HERE  |
249 // ---------------------
250 //      |     BOTTOM |
251 #define DESC_LB( LEFT, BOTTOM, PARAM ) \
252    description { state: "default" 0.0;\
253       align: 0 1;\
254       rel1 { \
255          relative: 1 0; \
256          to_x: LEFT; \
257          to_y: BOTTOM; \
258       }\
259       rel2 {\
260          relative: 1 0;\
261          to_x: LEFT;\
262          to_y: BOTTOM;\
263       }\
264       PARAM\
265    }
266
267 //      |     TOP  |
268 // ---------------------
269 // LEFT |--> HERE  |
270 // ---------------------
271 //      |   BOTTOM |
272 #define DESC_LTB( LEFT, TOP, BOTTOM, PARAM ) \
273    description { state: "default" 0.0;\
274       align: 0 0.5;\
275       rel1 { \
276          relative: 1 1; \
277          to_x: LEFT; \
278          to_y: TOP; \
279       }\
280       rel2 {\
281          relative: 1 0;\
282          to_x: LEFT;\
283          to_y: BOTTOM;\
284       }\
285       PARAM\
286    }
287
288 //      |   TOP  |
289 // ---------------------
290 //     |  HERE <--| RIGHT
291 #define DESC_RT( RIGHT, TOP, PARAM ) \
292    description { state: "default" 0.0;\
293       align: 1 0;\
294       rel1 { \
295          relative: 0 1; \
296          to_x: RIGHT; \
297          to_y: TOP; \
298       }\
299       rel2 {\
300          relative: 0 1;\
301          to_x: RIGHT;\
302          to_y: TOP;\
303       }\
304       PARAM\
305    }
306
307 //  | HERE <-- | RIGHT
308 // ---------------------
309 //  |  BOTTOM  |
310 #define DESC_RB( RIGHT, BOTTOM, PARAM ) \
311    description { state: "default" 0.0;\
312       align: 1 1;\
313       rel1 { \
314          relative: 0 0; \
315          to_x: RIGHT; \
316          to_y: BOTTOM; \
317       }\
318       rel2 {\
319          relative: 0 0;\
320          to_x: RIGHT;\
321          to_y: BOTTOM;\
322       }\
323       PARAM\
324    }
325
326 // |   TOP  |
327 // ----------
328 // |  HERE  |
329 // ----------
330 // | BOTTOM |
331 #define DESC_TB( TOP, BOTTOM, PARAM ) \
332    description { state: "default" 0.0;\
333       align: 0.5 0.5;\
334       rel1 { \
335          relative: 0 1; \
336          to_y: TOP; \
337       }\
338       rel2 {\
339          relative: 1 0;\
340          to_y: BOTTOM;\
341       }\
342       PARAM\
343    }
344
345 // |   TOP  |
346 // ----------
347 // |  HERE  |
348 // ----------
349 #define DESC_T( TOP, PARAM ) \
350    description { state: "default" 0.0;\
351       align: 0.5 0.0;\
352       rel1 { \
353          relative: 0 1; \
354          to_y: TOP; \
355       }\
356       rel2 {\
357          relative: 1 1;\
358          to_y: TOP;\
359       }\
360       PARAM\
361    }
362
363 // ----------
364 // |  HERE  |
365 // ----------
366 // | BOTTOM |
367 #define DESC_B( BOTTOM, PARAM ) \
368    description { state: "default" 0.0;\
369       align: 0.5 1.0;\
370       rel1 { \
371          relative: 0 0; \
372          to_y: BOTTOM; \
373       }\
374       rel2 {\
375          relative: 1 0;\
376          to_y: BOTTOM;\
377       }\
378       PARAM\
379    }
380
381 //****************************************************************************//
382 //******************************* Part Macros ********************************//
383 //****************************************************************************//
384 #define PART(TYPE, NAME, DESCRIPION) \
385    part { name: NAME; \
386       scale: 1; \
387       type: TYPE; \
388       DESCRIPION \
389    }
390
391 //****************************************************************************//
392 //**************************** Genlist Macros ********************************//
393 //****************************************************************************//
394
395 #define PROLOG_LIST \
396    data.item: "treesize" 0; \
397    data.item: "flips" "elm.flip.icon elm.flip.content"; \
398
399 #define PART_LIST_BG \
400    PART(RECT, "bg_clip", \
401       mouse_events: 0; \
402       description { state: "default" 0.0; } \
403       description { state: "decorate" 0.0; \
404          inherit: "default" 0.0; \
405          color: 0 0 0 0; \
406       } \
407       description { state: "reorder" 0.0; \
408          inherit: "default" 0.0; \
409          color: 0 0 0 0; \
410       } \
411       description { state: "decorate_reorder" 0.0; \
412          inherit: "default" 0.0; \
413          color: 0 0 0 0; \
414       } \
415    ) \
416    PART(RECT, "bg",  \
417       clip_to: "bg_clip"; \
418       description { state: "default" 0.0; \
419          color: 0 0 0 0; \
420       } \
421       description { state: "selected" 0.0; \
422          inherit: "default" 0.0; \
423          color: 255 255 255 255; \
424          color_class: "B041P"; \
425       } \
426       description { state: "disabled" 0.0; \
427          inherit: "default" 0.0; \
428          color: 255 255 255 255; \
429          color_class: "B0211D"; \
430       } \
431    )
432
433 #define PART_LIST_BOTTOMLINE \
434    PART(RECT, "bottom_line_clip", \
435       description { state: "default" 0.0; } \
436       description { state: "hide" 0.0; \
437          inherit: "default" 0.0; \
438          color: 0 0 0 0; \
439       } \
440       description { state: "decorate" 0.0; \
441          inherit: "default" 0.0; \
442          color: 0 0 0 0; \
443       } \
444       description { state: "reorder" 0.0; \
445          inherit: "default" 0.0; \
446          color: 0 0 0 0; \
447       } \
448       description { state: "decorate_reorder" 0.0; \
449          inherit: "default" 0.0; \
450          color: 0 0 0 0; \
451       } \
452       description { state: "flipped" 0.0; \
453          inherit: "default" 0.0; \
454          color: 0 0 0 0; \
455       } \
456    ) \
457    PART(RECT, "bottom_line", \
458       mouse_events: 0; \
459       clip_to: "bottom_line_clip"; \
460       description { state: "default" 0.0; \
461          min: 0 1; \
462          max: -1 1; \
463          fixed: 0 1; \
464          align: 0.5 1; \
465          color_class: "B0222"; \
466          rel1.offset: -1 -1; \
467       } \
468    )
469
470 #define PART_LIST_BOTTOMLINE_OFF \
471    PART(RECT, "bottom_line_clip", \
472       description { state: "default" 0.0;  \
473          visible: 0; \
474       } \
475       description { state: "hide" 0.0; \
476          inherit: "default" 0.0; \
477          color: 0 0 0 0; \
478       } \
479    ) \
480    PART(RECT, "bottom_line", \
481       description { state: "default" 0.0; \
482          visible: 0; \
483       } \
484    )
485
486 //**************************** Genlist PADDING *******************************//
487 #define DESC_LIST_PADDINGS \
488    description { state: "decorate" 0.0; \
489       inherit: "default" 0.0; \
490       min: 0 0; \
491       max: 0 0; \
492    } \
493    description { state: "decorate_reorder" 0.0; \
494       inherit: "default" 0.0; \
495       min: 0 0; \
496       max: 0 0; \
497    } \
498    description { state: "reorder" 0.0; \
499       inherit: "default" 0.0; \
500       min: 32 0; \
501       max: 32 -1; \
502    }
503
504 #define PART_LIST_PADDINGS(LEFT_SIZE, RIGHT_SIZE, TOP_SIZE, BOTTOM_SIZE) \
505    PART(SWALLOW, "elm.swallow.pad", \
506       mouse_events: 0; \
507       DESC_FROM_L( ; ) \
508    ) \
509    PART(SWALLOW, "elm.swallow.colorbar", \
510       mouse_events: 0; \
511       DESC_L("elm.swallow.pad", ) \
512    ) \
513    PART(SPACER, "elm.padding.left", \
514       DESC_L("elm.swallow.pad", \
515          min: LEFT_SIZE 0; \
516          max: LEFT_SIZE -1; \
517       ) \
518    ) \
519    PART(SPACER, "elm.padding.right", \
520       DESC_FROM_R( \
521          min: RIGHT_SIZE 0; \
522          max: RIGHT_SIZE -1; \
523       ) \
524       description { state: "decorate" 0.0; \
525          inherit: "default" 0.0; \
526          min: 0 0; \
527          max: 0 0; \
528       } \
529       description { state: "decorate_reorder" 0.0; \
530          inherit: "default" 0.0; \
531          min: 0 0; \
532          max: 0 0; \
533       } \
534       description { state: "reorder" 0.0; \
535          inherit: "default" 0.0; \
536          min: 32 0; \
537          max: 32 -1; \
538       } \
539    ) \
540    PART(SPACER, "elm.padding.top", \
541       DESC_FROM_T( \
542          min: 0 TOP_SIZE; \
543          max: -1 TOP_SIZE; \
544       ) \
545    ) \
546    PART(SPACER, "elm.padding.bottom", \
547       DESC_FROM_B( \
548          min: 0 BOTTOM_SIZE; \
549          max: -1 BOTTOM_SIZE; \
550       ) \
551    )
552
553 //***************************  Genlist Programs ****************************//
554 #define PROGRAM_LIST_DEFAULT( TARGET ) \
555    program { name: "default"; \
556       signal: "elm,state,default"; \
557       source: "elm"; \
558       action: STATE_SET "default" 0.0; \
559       TARGET \
560    } \
561
562 #define PROGRAM_LIST_DISABLE( TARGET ) \
563    program { name: "enabled"; \
564       signal: "elm,state,enabled"; \
565       source: "elm"; \
566       action: STATE_SET "default" 0.0; \
567       TARGET \
568    } \
569    program { name: "disabled"; \
570       signal: "elm,state,disabled"; \
571       source: "elm"; \
572       action: STATE_SET "disabled" 0.0; \
573       TARGET \
574    }
575
576 #define PROGRAM_LIST_SELECT( TARGET ) \
577    program { name: "selected"; \
578       signal: "elm,state,selected"; \
579       source: "elm"; \
580       action: STATE_SET "selected" 0.0; \
581       TARGET \
582    } \
583    program { name: "unselected"; \
584       signal: "elm,state,unselected"; \
585       source: "elm"; \
586       action: STATE_SET "default" 0.0; \
587       TARGET \
588    }
589
590 #define PROGRAM_LIST_SOUND \
591    program { name: "play_sound"; \
592       signal: "elm,state,clicked"; \
593       source: "elm"; \
594       script { \
595          run_program(PROGRAM:"play_sample"); \
596       } \
597    } \
598    program { \
599       name: "play_sample"; \
600       action: RUN_PLUGIN "touch_sound"; \
601    }
602
603 #define PROGRAM_LIST_FOCUS \
604    program { name: "focused"; \
605       signal: "elm,state,focused"; \
606       source: "elm"; \
607       action: STATE_SET "focused" 0.0; \
608       target: "focus_part"; \
609    } \
610    program { name: "unfocused"; \
611       signal: "elm,state,unfocused"; \
612       source: "elm"; \
613       action: STATE_SET "default" 0.0; \
614       target: "focus_part"; \
615    }
616
617 #define PROGRAM_LIST_FLIP \
618    program { name: "flip_enabled"; \
619       signal:  "elm,state,flip,enabled"; \
620       source:  "elm"; \
621       transition: DECELERATE 0.5; \
622       action:  STATE_SET "flipped" 0.0; \
623       target: "elm.flip.content"; \
624       target: "elm.flip.icon"; \
625    } \
626    program { name: "flip_disabled"; \
627       signal:  "elm,state,flip,disabled"; \
628       source:  "elm"; \
629       transition: DECELERATE 0.5; \
630       action:  STATE_SET "default" 0.0; \
631       target: "elm.flip.content"; \
632       target: "elm.flip.icon"; \
633    } \
634    program { name: "flip_enabled_bg"; \
635       signal:  "elm,state,flip,enabled"; \
636       source:  "elm"; \
637       action:  STATE_SET "flipped" 0.0; \
638       target: "elm.flip.bg"; \
639    } \
640    program { name: "flip_disabled_bg"; \
641       signal:  "elm,state,flip,disabled"; \
642       source:  "elm"; \
643       action:  STATE_SET "default" 0.0; \
644       target: "elm.flip.bg"; \
645    }
646
647 #define PROGRAM_LIST_DECORATE( TARGET ) \
648    program { name: "decorate_enabled_effect_ef"; \
649       signal: "elm,state,decorate,enabled,effect";\
650       source: "elm";\
651       action:  STATE_SET "decorate" 0.0;\
652       TARGET \
653    }\
654    program { name: "decorate_disabled_effect_ef";\
655       signal: "elm,state,decorate,disabled,effect";\
656       source: "elm";\
657       action:  STATE_SET "default" 0.0;\
658       TARGET \
659    } \
660    program { name: "decorate_enabled_ef";\
661       signal: "elm,state,decorate,enabled";\
662       source: "elm";\
663       action:  STATE_SET "decorate" 0.0;\
664       TARGET \
665    }\
666    program { name: "decorate_disabled_ef";\
667       signal: "elm,state,decorate,disabled";\
668       source: "elm";\
669       action:  STATE_SET "default" 0.0;\
670       TARGET \
671    }
672
673 #define PROGRAM_LIST_DECORATE_FX( TARGET ) \
674    program { name: "decorate_enabled_effect_ef"; \
675       signal: "elm,state,decorate,enabled,effect";\
676       source: "elm";\
677       transition: DECELERATE 0.5;\
678       action:  STATE_SET "decorate" 0.0;\
679       TARGET \
680    }\
681    program { name: "decorate_disabled_effect_ef";\
682       signal: "elm,state,decorate,disabled,effect";\
683       source: "elm";\
684       transition: ACCELERATE 0.5;\
685       action:  STATE_SET "default" 0.0;\
686       TARGET \
687    } \
688    program { name: "decorate_enabled_ef";\
689       signal: "elm,state,decorate,enabled";\
690       source: "elm";\
691       action:  STATE_SET "decorate" 0.0;\
692       TARGET \
693    }\
694    program { name: "decorate_disabled_ef";\
695       signal: "elm,state,decorate,disabled";\
696       source: "elm";\
697       action:  STATE_SET "default" 0.0;\
698       TARGET \
699    }
700
701 #define PROGRAM_LIST_BOTTOMLINE \
702    program { name : "hide_bottomline"; \
703       signal: "elm,state,bottomline,hide"; \
704       source: ""; \
705       action: STATE_SET "hide" 0.0; \
706       target: "bottom_line_clip"; \
707    } \
708    program { name : "show_bottomline"; \
709       signal: "elm,state,bottomline,show"; \
710       source: ""; \
711       action: STATE_SET "default" 0.0; \
712       target: "bottom_line_clip"; \
713    } \
714
715
716 #define PROGRAMS_LIST( TARGET ) \
717    programs { \
718       PROGRAM_LIST_DEFAULT( TARGET \
719          target: "bg"; \
720          target: "bg_clip"; \
721          target: "bottom_line"; \
722          target: "bottom_line_clip"; \
723          target: "elm.padding.left"; \
724          target: "elm.padding.right"; \
725       ) \
726       PROGRAM_LIST_DISABLE( TARGET \
727          target: "bg"; \
728       ) \
729       PROGRAM_LIST_SELECT( TARGET \
730          target: "bg"; \
731       ) \
732       PROGRAM_LIST_SOUND \
733       PROGRAM_LIST_DECORATE( \
734          target: "bg"; \
735          target: "bg_clip"; \
736          target: "bottom_line"; \
737          target: "bottom_line_clip"; \
738          target: "elm.padding.left"; \
739          target: "elm.padding.right"; \
740       ) \
741       PROGRAM_LIST_BOTTOMLINE \
742    }
743
744 //******************************* Genlist TEXT ********************************//
745 #define PARAM_TEXT(STYLE, PARAM) \
746    text { \
747       min: 0 1; \
748       style: STYLE; \
749       PARAM \
750    }
751
752 #define DESCRIPIONS_TEXT(DISABLED, SELECTED) \
753    description { state: "disabled" 0.0; \
754       inherit: "default" 0.0; \
755       text.style: DISABLED; \
756    } \
757    description { state: "selected" 0.0; \
758       inherit: "default" 0.0; \
759       text.style: SELECTED; \
760    }
761
762 //******************************* Genlist SWIPE ********************************//
763 #define SWIPE_TRANSIT       SIN_FAC 0.667 0.8
764
765 #define SWIPE_THRESH_X      60
766 #define SWIPE_THRESH_Y      30
767
768 #define SWIPE_OVERLAP_SIZE  100
769 #define SWIPE_ICON_SIZE     64 100
770
771 // state: normal(0)->start,right( 1)->rollback,right ( 3), swipe,right ( 2)-> normal(0)
772 //                 ->start,left (-1)->rollback,right (-3), swipe,right (-2)->
773 #define SCRIPTS_LIST_SWIPE \
774    script { \
775       public _state; \
776       public x1, y1; \
777       public cleanup() { \
778          set_int(_state, 0); \
779          set_int(x1, 0); \
780          set_int(y1, 0); \
781          set_drag(PART:"drag_part", 0, 0); \
782          set_state(PART:"drag_part", "default", 0.0); \
783          set_state(PART:"drag_part_left", "default", 0.0); \
784          set_state(PART:"drag_part_right", "default", 0.0); \
785          set_state(PART:"elm.text.swipe.left", "default", 0.0); \
786          set_state(PART:"elm.text.swipe.right", "default", 0.0); \
787          set_state(PART:"elm.icon.swipe.left", "default", 0.0); \
788          set_state(PART:"elm.icon.swipe.right", "default", 0.0); \
789          set_state(PART:"swipe_temp_disabler", "default", 0.0); \
790       } \
791    }
792
793 #define IMAGES_LIST_SWIPE \
794       image : "b_list_swipe_right.#.png" COMP; \
795       image : "b_list_swipe_left.#.png" COMP;
796
797 #define PARTS_LIST_SWIPE \
798       part { name: "drag_part"; \
799          type: RECT; \
800          scale: 1; \
801          repeat_events: 1; \
802          dragable { \
803             x: 1 1 0; \
804             y: 0 0 0; \
805          } \
806          description { state: "default" 0.0; \
807             color: 0 0 0 0; \
808             rel1.offset: -SWIPE_OVERLAP_SIZE 0; \
809             rel2.offset: SWIPE_OVERLAP_SIZE 0; \
810          } \
811          description { state: "disable" 0.0; \
812             inherit: "default" 0.0; \
813             color: 255 255 255 255; \
814             visible: 0; \
815          } \
816          description { state: "start_right" 0.0; \
817             inherit: "default" 0.0; \
818             color: 255 255 255 255; \
819             color_class: "B041P"; \
820          } \
821          description { state: "right_end" 0.0; \
822             inherit: "start_right"; \
823             rel1.relative: 1 0; \
824          } \
825          description { state: "right_rollback" 0.0; \
826             inherit: "start_right" 0.0; \
827             rel1.relative: -1 0; \
828             color: 0 0 0 0; \
829          } \
830          description { state: "start_left" 0.0; \
831             inherit: "default" 0.0; \
832             color: 255 255 255 255; \
833             color_class: "B041P"; \
834          } \
835          description { state: "left_end" 0.0; \
836             inherit: "start_left" 0.0; \
837             rel2.relative: 0 1; \
838          } \
839          description { state: "left_rollback" 0.0; \
840             inherit: "start_left" 0.0; \
841             rel2.relative: 2 1; \
842             color: 0 0 0 0; \
843          } \
844       } \
845       part { name: "drag_part_left"; \
846          type: IMAGE; \
847          scale: 1; \
848          mouse_events: 0; \
849          description { state: "default" 0.0; \
850             color: 0 0 0 0; \
851             rel1 { \
852                relative: -999 0; \
853             } \
854             rel2 { \
855                to_x: "drag_part"; \
856                relative: 0 1; \
857                offset: SWIPE_OVERLAP_SIZE 0; \
858             } \
859             image { \
860                normal: "b_list_swipe_left.#.png"; \
861             } \
862          } \
863          description { state: "start_right" 0.0; \
864             inherit: "default" 0.0; \
865             color: 255 255 255 255; \
866             color_class: "B0242"; \
867          } \
868          description { state: "start_left" 0.0; \
869             inherit: "default" 0.0; \
870             color: 255 255 255 255; \
871             color_class: "B0242"; \
872          } \
873       } \
874       part { name: "drag_part_right"; \
875          type: IMAGE; \
876          scale: 1; \
877          mouse_events: 0; \
878          description { state: "default" 0.0; \
879             color: 0 0 0 0; \
880             rel1 { \
881                to_x: "drag_part"; \
882                relative: 1 0; \
883                offset: -SWIPE_OVERLAP_SIZE 0; \
884             } \
885             rel2 { \
886                relative: 999 1; \
887             } \
888             image { \
889                normal: "b_list_swipe_right.#.png"; \
890             } \
891          } \
892          description { state: "start_right" 0.0; \
893             inherit: "default" 0.0; \
894             color: 255 255 255 255; \
895             color_class: "B0241"; \
896          } \
897          description { state: "start_left" 0.0; \
898             inherit: "default" 0.0; \
899             color: 255 255 255 255; \
900             color_class: "B0241"; \
901          } \
902       } \
903       part { name: "swipe_temp_disabler"; \
904          type: RECT; \
905          scale:1; \
906          repeat_events: 0; \
907          description { state: "default" 0.0; \
908             visible: 0; \
909             color: 0 0 0 0; \
910          } \
911          description { state: "enable" 0.0; \
912             inherit: "default"; \
913             visible: 1; \
914          } \
915       } \
916       part { name: "elm.icon.swipe.left"; \
917          type: SWALLOW; \
918          clip_to: "elm.icon.swipe.clip"; \
919          scale: 1; \
920          mouse_events: 0; \
921          description { state: "default" 0.0; \
922             visible: 0; \
923             rel1 { \
924                to_x: "elm.padding.left"; \
925                relative: 1 0; \
926             } \
927             rel2 { \
928                to_x: "elm.padding.right"; \
929                relative: 1 1; \
930             } \
931             align: 0 0.5; \
932             fixed: 1 1; \
933             min: SWIPE_ICON_SIZE; \
934             max: SWIPE_ICON_SIZE; \
935          } \
936          description { state: "start_left" 0.0; \
937             inherit: "default" 0.0; \
938             visible: 1; \
939             color: 250 250 250 255; \
940          } \
941          description { state: "start_right" 0.0; \
942             inherit: "default" 0.0; \
943          } \
944          description { state: "right_rollback" 0.0; \
945             inherit: "default" 0.0; \
946             color: 0 0 0 0; \
947          } \
948          description { state: "left_rollback" 0.0; \
949             inherit: "default" 0.0; \
950             color: 0 0 0 0; \
951          } \
952       } \
953       part { name: "elm.icon.swipe.right"; \
954          type: SWALLOW; \
955          clip_to: "elm.icon.swipe.clip"; \
956          scale: 1; \
957          mouse_events: 0; \
958          description { state: "default" 0.0; \
959             visible: 0; \
960             rel1 { \
961                to_x: "elm.padding.right"; \
962                relative: 0 0; \
963             } \
964             rel2 { \
965                to_x: "elm.padding.right"; \
966                relative: 0 1; \
967             } \
968             align: 1 0.5; \
969             fixed: 1 1; \
970             min: SWIPE_ICON_SIZE; \
971             max: SWIPE_ICON_SIZE; \
972          } \
973          description { state: "start_right" 0.0; \
974             inherit: "default" 0.0; \
975             visible: 1; \
976             color: 250 250 250 255; \
977          } \
978          description { state: "start_left" 0.0; \
979             inherit: "default" 0.0; \
980          } \
981          description { state: "right_rollback" 0.0; \
982             inherit: "default" 0.0; \
983             color: 0 0 0 0; \
984          } \
985          description { state: "left_rollback" 0.0; \
986             inherit: "default" 0.0; \
987             color: 0 0 0 0; \
988          } \
989       } \
990       part { name: "elm.icon.swipe.clip"; \
991          type: RECT; \
992          scale: 1; \
993          description { state: "default" 0.0; \
994             color_class: "F071"; \
995          } \
996       } \
997       part { name: "elm.text.swipe.left"; \
998          type: TEXT; \
999          scale: 1; \
1000          mouse_events: 0; \
1001          description { state: "default" 0.0; \
1002             rel1 { \
1003                relative: 1 0; \
1004                to_x: "elm.icon.swipe.left"; \
1005             } \
1006             visible: 0; \
1007          } \
1008          description { state: "start_left" 0.0; \
1009             inherit: "default"; \
1010             visible: 1; \
1011             align: 0.5 0.5; \
1012             color_class: "T025"; \
1013             text { \
1014                align: 0.5 0.5; \
1015                min: 0 1; \
1016                text_class: "T025"; \
1017             } \
1018          } \
1019          description { state: "start_right" 0.0; \
1020             inherit: "default" 0.0; \
1021          } \
1022       } \
1023       part { name: "elm.text.swipe.right"; \
1024          type: TEXT; \
1025          scale: 1; \
1026          mouse_events: 0; \
1027          description { state: "default" 0.0; \
1028             rel2 { \
1029                relative: 0 1; \
1030                to_x: "elm.icon.swipe.right"; \
1031             } \
1032             visible: 0; \
1033          } \
1034          description { state: "start_right" 0.0; \
1035             inherit: "default" 0.0; \
1036             visible: 1; \
1037             align: 0.5 0.5; \
1038             color_class: "T025"; \
1039             text { \
1040                align: 0.5 0.5; \
1041                min: 0 1; \
1042                text_class: "T025"; \
1043                text: "Call"; \
1044             } \
1045          } \
1046          description { state: "start_left" 0.0; \
1047             inherit: "default" 0.0; \
1048          } \
1049       }
1050
1051 #define PARTS_LIST_SWIPE_RIGHT \
1052       part { name: "drag_part"; \
1053          type: RECT; \
1054          scale: 1; \
1055          repeat_events: 1; \
1056          dragable { \
1057             x: 1 1 0; \
1058             y: 0 0 0; \
1059          } \
1060          description { state: "default" 0.0; \
1061             color: 0 0 0 0; \
1062             rel1.offset: -SWIPE_OVERLAP_SIZE 0; \
1063             rel2.offset: SWIPE_OVERLAP_SIZE 0; \
1064          } \
1065          description { state: "disable" 0.0; \
1066             inherit: "default" 0.0; \
1067             visible: 0; \
1068          } \
1069          description { state: "start_right" 0.0; \
1070             inherit: "default" 0.0; \
1071             color: 255 255 255 255; \
1072             color_class: "B041P"; \
1073          } \
1074          description { state: "right_end" 0.0; \
1075             inherit: "start_right"; \
1076             rel1.relative: 1 0; \
1077          } \
1078          description { state: "right_rollback" 0.0; \
1079             inherit: "start_right" 0.0; \
1080             rel1.relative: -1 0; \
1081             color: 0 0 0 0; \
1082          } \
1083       } \
1084       part { name: "drag_part_left"; \
1085          type: IMAGE; \
1086          scale: 1; \
1087          mouse_events: 0; \
1088          description { state: "default" 0.0; \
1089             color: 0 0 0 0; \
1090             rel1 { \
1091                relative: -999 0; \
1092             } \
1093             rel2 { \
1094                to_x: "drag_part"; \
1095                relative: 0 1; \
1096                offset: SWIPE_OVERLAP_SIZE 0; \
1097             } \
1098             image { \
1099                normal: "b_list_swipe_left.#.png"; \
1100             } \
1101          } \
1102          description { state: "start_right" 0.0; \
1103             inherit: "default" 0.0; \
1104             color: 255 255 255 255; \
1105             color_class: "B0242"; \
1106          } \
1107       } \
1108       part { name: "drag_part_right"; \
1109          type: IMAGE; \
1110          scale: 1; \
1111          mouse_events: 0; \
1112          description { state: "default" 0.0; \
1113             color: 0 0 0 0; \
1114             rel1 { \
1115                to_x: "drag_part"; \
1116                relative: 1 0; \
1117                offset: -SWIPE_OVERLAP_SIZE 0; \
1118             } \
1119             rel2 { \
1120                relative: 999 1; \
1121             } \
1122             image { \
1123                normal: "b_list_swipe_right.#.png"; \
1124             } \
1125          } \
1126          description { state: "start_right" 0.0; \
1127             inherit: "default" 0.0; \
1128             color: 255 255 255 255; \
1129             color_class: "B041P"; \
1130          } \
1131       } \
1132       part { name: "swipe_temp_disabler"; \
1133          type: RECT; \
1134          scale:1; \
1135          repeat_events: 0; \
1136          description { state: "default" 0.0; \
1137             visible: 0; \
1138             color: 0 0 0 0; \
1139          } \
1140          description { state: "enable" 0.0; \
1141             inherit: "default"; \
1142             visible: 1; \
1143          } \
1144       } \
1145       part { name: "elm.icon.swipe.right"; \
1146          type: SWALLOW; \
1147          clip_to: "elm.icon.swipe.clip"; \
1148          scale: 1; \
1149          mouse_events: 0; \
1150          description { state: "default" 0.0; \
1151             visible: 0; \
1152             rel1 { \
1153                to_x: "elm.padding.right"; \
1154                relative: 0 0; \
1155             } \
1156             rel2 { \
1157                to_x: "elm.padding.right"; \
1158                relative: 0 1; \
1159             } \
1160             align: 1 0.5; \
1161             fixed: 1 1; \
1162             min: SWIPE_ICON_SIZE; \
1163             max: SWIPE_ICON_SIZE; \
1164          } \
1165          description { state: "start_right" 0.0; \
1166             inherit: "default" 0.0; \
1167             visible: 1; \
1168             color: 250 250 250 255; \
1169          } \
1170          description { state: "right_rollback" 0.0; \
1171             inherit: "default" 0.0; \
1172             color: 0 0 0 0; \
1173          } \
1174       } \
1175       part { name: "elm.icon.swipe.clip"; \
1176          type: RECT; \
1177          scale: 1; \
1178          description { state: "default" 0.0; \
1179             color_class: "F071"; \
1180          } \
1181       } \
1182       part { name: "elm.text.swipe.right"; \
1183          type: TEXT; \
1184          scale: 1; \
1185          mouse_events: 0; \
1186          description { state: "default" 0.0; \
1187             rel2 { \
1188                relative: 0 1; \
1189                to_x: "elm.icon.swipe.right"; \
1190             } \
1191             visible: 0; \
1192          } \
1193          description { state: "start_right" 0.0; \
1194             inherit: "default" 0.0; \
1195             visible: 1; \
1196             align: 0.5 0.5; \
1197             color_class: "T025"; \
1198             text { \
1199                align: 0.5 0.5; \
1200                min: 0 1; \
1201                text_class: "T025"; \
1202                text: "Call"; \
1203             } \
1204          } \
1205       }
1206
1207 #define PARTS_LIST_SWIPE_LEFT \
1208       part { name: "drag_part"; \
1209          type: RECT; \
1210          scale: 1; \
1211          repeat_events: 1; \
1212          dragable { \
1213             x: 1 1 0; \
1214             y: 0 0 0; \
1215          } \
1216          description { state: "default" 0.0; \
1217             color: 0 0 0 0; \
1218             rel1.offset: -SWIPE_OVERLAP_SIZE 0; \
1219             rel2.offset: SWIPE_OVERLAP_SIZE 0; \
1220          } \
1221          description { state: "disable" 0.0; \
1222             inherit: "default" 0.0; \
1223             visible: 0; \
1224          } \
1225          description { state: "start_left" 0.0; \
1226             inherit: "default" 0.0; \
1227             color: 255 255 255 255; \
1228             color_class: "B041P"; \
1229          } \
1230          description { state: "left_end" 0.0; \
1231             inherit: "start_left" 0.0; \
1232             rel2.relative: 0 1; \
1233          } \
1234          description { state: "left_rollback" 0.0; \
1235             inherit: "start_left" 0.0; \
1236             rel2.relative: 2 1; \
1237             color: 0 0 0 0; \
1238          } \
1239       } \
1240       part { name: "drag_part_left"; \
1241          type: IMAGE; \
1242          scale: 1; \
1243          mouse_events: 0; \
1244          description { state: "default" 0.0; \
1245             color: 0 0 0 0; \
1246             rel1 { \
1247                relative: -999 0; \
1248             } \
1249             rel2 { \
1250                to_x: "drag_part"; \
1251                relative: 0 1; \
1252                offset: SWIPE_OVERLAP_SIZE 0; \
1253             } \
1254             image { \
1255                normal: "b_list_swipe_left.#.png"; \
1256             } \
1257          } \
1258          description { state: "start_left" 0.0; \
1259             inherit: "default" 0.0; \
1260             color: 255 255 255 255; \
1261             color_class: "B041P"; \
1262          } \
1263       } \
1264       part { name: "drag_part_right"; \
1265          type: IMAGE; \
1266          scale: 1; \
1267          mouse_events: 0; \
1268          description { state: "default" 0.0; \
1269             color: 0 0 0 0; \
1270             rel1 { \
1271                to_x: "drag_part"; \
1272                relative: 1 0; \
1273                offset: -SWIPE_OVERLAP_SIZE 0; \
1274             } \
1275             rel2 { \
1276                relative: 999 1; \
1277             } \
1278             image { \
1279                normal: "b_list_swipe_right.#.png"; \
1280             } \
1281          } \
1282          description { state: "start_left" 0.0; \
1283             inherit: "default" 0.0; \
1284             color: 255 255 255 255; \
1285             color_class: "B0241"; \
1286          } \
1287       } \
1288       part { name: "swipe_temp_disabler"; \
1289          type: RECT; \
1290          scale:1; \
1291          repeat_events: 0; \
1292          description { state: "default" 0.0; \
1293             visible: 0; \
1294             color: 0 0 0 0; \
1295          } \
1296          description { state: "enable" 0.0; \
1297             inherit: "default"; \
1298             visible: 1; \
1299          } \
1300       } \
1301       part { name: "elm.icon.swipe.left"; \
1302          type: SWALLOW; \
1303          clip_to: "elm.icon.swipe.clip"; \
1304          scale: 1; \
1305          mouse_events: 0; \
1306          description { state: "default" 0.0; \
1307             visible: 0; \
1308             rel1 { \
1309                to_x: "elm.padding.left"; \
1310                relative: 1 0; \
1311             } \
1312             rel2 { \
1313                to_x: "elm.padding.right"; \
1314                relative: 1 1; \
1315             } \
1316             align: 0 0.5; \
1317             fixed: 1 1; \
1318             min: SWIPE_ICON_SIZE; \
1319             max: SWIPE_ICON_SIZE; \
1320          } \
1321          description { state: "start_left" 0.0; \
1322             inherit: "default" 0.0; \
1323             visible: 1; \
1324             color: 250 250 250 255; \
1325          } \
1326          description { state: "left_rollback" 0.0; \
1327             inherit: "default" 0.0; \
1328             color: 0 0 0 0; \
1329          } \
1330       } \
1331       part { name: "elm.icon.swipe.clip"; \
1332          type: RECT; \
1333          scale: 1; \
1334          description { state: "default" 0.0; \
1335             color_class: "F071"; \
1336          } \
1337       } \
1338       part { name: "elm.text.swipe.left"; \
1339          type: TEXT; \
1340          scale: 1; \
1341          mouse_events: 0; \
1342          description { state: "default" 0.0; \
1343             rel1 { \
1344                relative: 1 0; \
1345                to_x: "elm.icon.swipe.left"; \
1346             } \
1347             visible: 0; \
1348          } \
1349          description { state: "start_left" 0.0; \
1350             inherit: "default"; \
1351             visible: 1; \
1352             align: 0.5 0.5; \
1353             color_class: "T025"; \
1354             text { \
1355                align: 0.5 0.5; \
1356                min: 0 1; \
1357                text_class: "T025"; \
1358             } \
1359          } \
1360       } \
1361
1362 #define PROGRAMS_LIST_SWIPE \
1363    program { name: "drag_up"; \
1364       signal: "mouse,up,1"; \
1365       source: "drag_part"; \
1366       script { \
1367          new x, y, w, h, ww, hh; \
1368          get_geometry(PART:"bg", x, y, ww, hh); \
1369          get_geometry(PART:"drag_part", x, y, w, h); \
1370          x = x + SWIPE_OVERLAP_SIZE; \
1371          if (get_int(_state) == 1) { \
1372             if (x >= (ww/2)) { \
1373                set_int(_state, 3); \
1374                set_state(PART:"swipe_temp_disabler", "enable", 0.0); \
1375                run_program(PROGRAM:"end_move_right"); \
1376             } else { \
1377                set_int(_state, 2); \
1378                set_state(PART:"swipe_temp_disabler", "enable", 0.0); \
1379                set_state(PART:"elm.text.swipe.right", "default", 0.0); \
1380                set_state(PART:"elm.text.swipe.left", "default", 0.0); \
1381                run_program(PROGRAM:"end_rollback_right"); \
1382             } \
1383          } else if (get_int(_state) == -1) { \
1384             if (-x >= (ww/2)) { \
1385                set_int(_state, -3); \
1386                set_state(PART:"swipe_temp_disabler", "enable", 0.0); \
1387                run_program(PROGRAM:"end_move_left"); \
1388             } else { \
1389                set_int(_state, -2); \
1390                set_state(PART:"swipe_temp_disabler", "enable", 0.0); \
1391                set_state(PART:"elm.text.swipe.right", "default", 0.0); \
1392                set_state(PART:"elm.text.swipe.left", "default", 0.0); \
1393                run_program(PROGRAM:"end_rollback_left"); \
1394             } \
1395          } else cleanup(); \
1396       } \
1397    } \
1398    program { name: "drag_down"; \
1399       signal: "mouse,down,1"; \
1400       source: "drag_part"; \
1401       script { \
1402          new x, y; \
1403          get_mouse(x, y); \
1404          set_int(_state, 0); \
1405          set_int(x1, x); \
1406          set_int(y1, y); \
1407       } \
1408    } \
1409    program { name: "drag"; \
1410       signal: "drag"; \
1411       source: "drag_part"; \
1412       script { \
1413          new x2, y2; \
1414          get_mouse(x2, y2); \
1415          if (((y2 - get_int(y1)) >= SWIPE_THRESH_Y) || \
1416              ((y2 - get_int(y1)) <= -SWIPE_THRESH_Y)) \
1417                return; \
1418          if (get_int(_state) == 0) { \
1419             if ((x2 - get_int(x1)) >= SWIPE_THRESH_X) { \
1420                emit("elm,swipe,start", ""); \
1421                set_int(_state, 1); \
1422                run_program(PROGRAM:"start_right");  \
1423             } else if ((x2 - get_int(x1)) <= -SWIPE_THRESH_X) { \
1424                emit("elm,swipe,start", ""); \
1425                set_int(_state, -1); \
1426                run_program(PROGRAM:"start_left");  \
1427             } \
1428          } else if (get_int(_state) == -1) { \
1429             if (x2 > get_int(x1)) { \
1430                set_int(_state, 1); \
1431                run_program(PROGRAM:"start_right");  \
1432             }\
1433          } else if (get_int(_state) == 1) { \
1434             if (x2 < get_int(x1)) { \
1435                set_int(_state, -1); \
1436                run_program(PROGRAM:"start_left");  \
1437             } \
1438          } \
1439       } \
1440    } \
1441    program { name: "start_right"; \
1442       action:  STATE_SET "start_right" 0.0; \
1443       target: "elm.icon.swipe.right"; \
1444       target: "elm.icon.swipe.left"; \
1445       target: "elm.text.swipe.right"; \
1446       target: "elm.text.swipe.left"; \
1447       target: "drag_part"; \
1448       target: "drag_part_left"; \
1449       target: "drag_part_right"; \
1450    } \
1451    program { name: "start_left"; \
1452       action:  STATE_SET "start_left" 0.0; \
1453       target: "elm.icon.swipe.right"; \
1454       target: "elm.icon.swipe.left"; \
1455       target: "elm.text.swipe.right"; \
1456       target: "elm.text.swipe.left"; \
1457       target: "drag_part"; \
1458       target: "drag_part_left"; \
1459       target: "drag_part_right"; \
1460    } \
1461    program { name: "end_move_right"; \
1462       transition: SWIPE_TRANSIT; \
1463       action:  STATE_SET "right_end" 0.0; \
1464       target: "drag_part"; \
1465       after: "right_ender"; \
1466    } \
1467    program { name: "end_move_left"; \
1468       transition: SWIPE_TRANSIT; \
1469       action:  STATE_SET "left_end" 0.0; \
1470       target: "drag_part"; \
1471       after: "left_ender"; \
1472    } \
1473    program { name: "end_rollback_right"; \
1474       action:  STATE_SET "right_rollback" 0.0; \
1475       target: "elm.icon.swipe.right"; \
1476       target: "elm.icon.swipe.left"; \
1477       after: "end_rollback_right_transit"; \
1478    } \
1479    program { name: "end_rollback_right_transit"; \
1480       transition: SWIPE_TRANSIT; \
1481       action:  STATE_SET "right_rollback" 0.0; \
1482       target: "drag_part"; \
1483       after: "rollback_ender"; \
1484    } \
1485    program { name: "end_rollback_left"; \
1486       action:  STATE_SET "left_rollback" 0.0; \
1487       target: "elm.icon.swipe.right"; \
1488       target: "elm.icon.swipe.left"; \
1489       after: "end_rollback_left_transit"; \
1490    } \
1491    program { name: "end_rollback_left_transit"; \
1492       transition: SWIPE_TRANSIT; \
1493       action:  STATE_SET "left_rollback" 0.0; \
1494       target: "drag_part"; \
1495       after: "rollback_ender"; \
1496    } \
1497    program { name: "right_ender"; \
1498       script { \
1499          emit("elm,swipe,stop,right", ""); \
1500          cleanup(); \
1501       } \
1502    } \
1503    program { name: "left_ender"; \
1504       script { \
1505          emit("elm,swipe,stop,left", ""); \
1506          cleanup(); \
1507       } \
1508    } \
1509    program { name: "rollback_ender"; \
1510       source: ""; \
1511       script { \
1512          emit("elm,swipe,stop", ""); \
1513          cleanup(); \
1514       } \
1515    } \
1516    program { name: "swipe_revert"; \
1517       signal: "elm,swipe,revert"; \
1518       source: ""; \
1519       script { \
1520          if (get_int(_state) != 0) { \
1521             emit("elm,swipe,stop", ""); \
1522          }\
1523          cleanup(); \
1524       } \
1525    } \
1526    program { name: "swipe_disable"; \
1527       signal: "elm,swipe,disabled"; \
1528       source: ""; \
1529       script { \
1530          if (get_int(_state) != 0) { \
1531             emit("elm,swipe,stop", ""); \
1532             cleanup(); \
1533          }\
1534          set_state(PART:"drag_part", "disable", 0.0); \
1535       } \
1536    } \
1537    program { name: "swipe_enable"; \
1538       signal: "elm,swipe,enabled"; \
1539       source: ""; \
1540       script { \
1541          if (get_int(_state) != 0) { \
1542             emit("elm,swipe,stop", ""); \
1543             cleanup(); \
1544          }\
1545          set_state(PART:"drag_part", "default", 0.0); \
1546       } \
1547    } \
1548    program { name: "swipe_default"; \
1549       signal: "elm,state,default"; \
1550       source: "elm"; \
1551       script { \
1552          run_program(PROGRAM:"swipe_enable"); \
1553       } \
1554    } \
1555    program { name: "swipe_disable_state"; \
1556       signal: "elm,state,disabled"; \
1557       source: "elm"; \
1558       script { \
1559          run_program(PROGRAM:"swipe_disable"); \
1560       } \
1561    } \
1562
1563 #define PROGRAMS_LIST_SWIPE_RIGHT \
1564    program { name: "drag_up"; \
1565       signal: "mouse,up,1"; \
1566       source: "drag_part"; \
1567       script { \
1568          new x, y, w, h, ww, hh; \
1569          get_geometry(PART:"bg", x, y, ww, hh); \
1570          get_geometry(PART:"drag_part", x, y, w, h); \
1571          x = x + SWIPE_OVERLAP_SIZE; \
1572          if (get_int(_state) == 1) { \
1573             if (x >= (ww/2)) { \
1574                set_int(_state, 3); \
1575                set_state(PART:"swipe_temp_disabler", "enable", 0.0); \
1576                run_program(PROGRAM:"end_move_right"); \
1577             } else { \
1578                set_int(_state, 2); \
1579                set_state(PART:"swipe_temp_disabler", "enable", 0.0); \
1580                set_state(PART:"elm.text.swipe.right", "default", 0.0); \
1581                set_state(PART:"elm.text.swipe.left", "default", 0.0); \
1582                run_program(PROGRAM:"end_rollback_right"); \
1583             } \
1584          } else cleanup(); \
1585       } \
1586    } \
1587    program { name: "drag_down"; \
1588       signal: "mouse,down,1"; \
1589       source: "drag_part"; \
1590       script { \
1591          new x, y; \
1592          get_mouse(x, y); \
1593          set_int(_state, 0); \
1594          set_int(x1, x); \
1595          set_int(y1, y); \
1596       } \
1597    } \
1598    program { name: "drag"; \
1599       signal: "drag"; \
1600       source: "drag_part"; \
1601       script { \
1602          new x2, y2; \
1603          get_mouse(x2, y2); \
1604          if (((y2 - get_int(y1)) >= SWIPE_THRESH_Y) || \
1605              ((y2 - get_int(y1)) <= -SWIPE_THRESH_Y)) \
1606                return; \
1607          if (get_int(_state) == 0) { \
1608             if ((x2 - get_int(x1)) >= SWIPE_THRESH_X) { \
1609                emit("elm,swipe,start", ""); \
1610                set_int(_state, 1); \
1611                run_program(PROGRAM:"start_right");  \
1612             } \
1613          } \
1614       } \
1615    } \
1616    program { name: "start_right"; \
1617       action:  STATE_SET "start_right" 0.0; \
1618       target: "elm.icon.swipe.right"; \
1619       target: "elm.text.swipe.right"; \
1620       target: "drag_part"; \
1621       target: "drag_part_left"; \
1622       target: "drag_part_right"; \
1623    } \
1624    program { name: "end_move_right"; \
1625       transition: SWIPE_TRANSIT; \
1626       action:  STATE_SET "right_end" 0.0; \
1627       target: "drag_part"; \
1628       after: "right_ender"; \
1629    } \
1630    program { name: "end_rollback_right"; \
1631       action:  STATE_SET "right_rollback" 0.0; \
1632       target: "elm.icon.swipe.right"; \
1633       after: "end_rollback_right_transit"; \
1634    } \
1635    program { name: "end_rollback_right_transit"; \
1636       transition: SWIPE_TRANSIT; \
1637       action:  STATE_SET "right_rollback" 0.0; \
1638       target: "drag_part"; \
1639       after: "rollback_ender"; \
1640    } \
1641    program { name: "right_ender"; \
1642       script { \
1643          emit("elm,swipe,stop,right", ""); \
1644          cleanup(); \
1645       } \
1646    } \
1647    program { name: "rollback_ender"; \
1648       source: ""; \
1649       script { \
1650          emit("elm,swipe,stop", ""); \
1651          cleanup(); \
1652       } \
1653    } \
1654    program { name: "swipe_revert"; \
1655       signal: "elm,swipe,revert"; \
1656       source: ""; \
1657       script { \
1658          if (get_int(_state) != 0) { \
1659             emit("elm,swipe,stop", ""); \
1660          }\
1661          cleanup(); \
1662       } \
1663    } \
1664    program { name: "swipe_disable"; \
1665       signal: "elm,swipe,disabled"; \
1666       source: ""; \
1667       script { \
1668          if (get_int(_state) != 0) { \
1669             emit("elm,swipe,stop", ""); \
1670             cleanup(); \
1671          }\
1672          set_state(PART:"drag_part", "disable", 0.0); \
1673       } \
1674    } \
1675    program { name: "swipe_enable"; \
1676       signal: "elm,swipe,enabled"; \
1677       source: ""; \
1678       script { \
1679          if (get_int(_state) != 0) { \
1680             emit("elm,swipe,stop", ""); \
1681             cleanup(); \
1682          }\
1683          set_state(PART:"drag_part", "default", 0.0); \
1684       } \
1685    } \
1686    program { name: "swipe_default"; \
1687       signal: "elm,state,default"; \
1688       source: "elm"; \
1689       script { \
1690          run_program(PROGRAM:"swipe_enable"); \
1691       } \
1692    } \
1693    program { name: "swipe_disable_state"; \
1694       signal: "elm,state,disabled"; \
1695       source: "elm"; \
1696       script { \
1697          run_program(PROGRAM:"swipe_disable"); \
1698       } \
1699    } \
1700
1701 #define PROGRAMS_LIST_SWIPE_LEFT \
1702    program { name: "drag_up"; \
1703       signal: "mouse,up,1"; \
1704       source: "drag_part"; \
1705       script { \
1706          new x, y, w, h, ww, hh; \
1707          get_geometry(PART:"bg", x, y, ww, hh); \
1708          get_geometry(PART:"drag_part", x, y, w, h); \
1709          x = x + SWIPE_OVERLAP_SIZE; \
1710          if (get_int(_state) == -1) { \
1711             if (-x >= (ww/2)) { \
1712                set_int(_state, -3); \
1713                set_state(PART:"swipe_temp_disabler", "enable", 0.0); \
1714                run_program(PROGRAM:"end_move_left"); \
1715             } else { \
1716                set_int(_state, -2); \
1717                set_state(PART:"swipe_temp_disabler", "enable", 0.0); \
1718                set_state(PART:"elm.text.swipe.left", "default", 0.0); \
1719                run_program(PROGRAM:"end_rollback_left"); \
1720             } \
1721          } else cleanup(); \
1722       } \
1723    } \
1724    program { name: "drag_down"; \
1725       signal: "mouse,down,1"; \
1726       source: "drag_part"; \
1727       script { \
1728          new x, y; \
1729          get_mouse(x, y); \
1730          set_int(_state, 0); \
1731          set_int(x1, x); \
1732          set_int(y1, y); \
1733       } \
1734    } \
1735    program { name: "drag"; \
1736       signal: "drag"; \
1737       source: "drag_part"; \
1738       script { \
1739          new x2, y2; \
1740          get_mouse(x2, y2); \
1741          if (((y2 - get_int(y1)) >= SWIPE_THRESH_Y) || \
1742              ((y2 - get_int(y1)) <= -SWIPE_THRESH_Y)) \
1743                return; \
1744          if (get_int(_state) == 0) { \
1745             if ((x2 - get_int(x1)) <= -SWIPE_THRESH_X) { \
1746                emit("elm,swipe,start", ""); \
1747                set_int(_state, -1); \
1748                run_program(PROGRAM:"start_left");  \
1749             } \
1750          } \
1751       } \
1752    } \
1753    program { name: "start_left"; \
1754       action:  STATE_SET "start_left" 0.0; \
1755       target: "elm.icon.swipe.left"; \
1756       target: "elm.text.swipe.left"; \
1757       target: "drag_part"; \
1758       target: "drag_part_left"; \
1759    } \
1760    program { name: "end_move_left"; \
1761       transition: SWIPE_TRANSIT; \
1762       action:  STATE_SET "left_end" 0.0; \
1763       target: "drag_part"; \
1764       after: "left_ender"; \
1765    } \
1766    program { name: "end_rollback_left"; \
1767       action:  STATE_SET "left_rollback" 0.0; \
1768       target: "elm.icon.swipe.left"; \
1769       after: "end_rollback_left_transit"; \
1770    } \
1771    program { name: "end_rollback_left_transit"; \
1772       transition: SWIPE_TRANSIT; \
1773       action:  STATE_SET "left_rollback" 0.0; \
1774       target: "drag_part"; \
1775       after: "rollback_ender"; \
1776    } \
1777    program { name: "left_ender"; \
1778       script { \
1779          emit("elm,swipe,stop,left", ""); \
1780          cleanup(); \
1781       } \
1782    } \
1783    program { name: "rollback_ender"; \
1784       source: ""; \
1785       script { \
1786          emit("elm,swipe,stop", ""); \
1787          cleanup(); \
1788       } \
1789    } \
1790    program { name: "swipe_revert"; \
1791       signal: "elm,swipe,revert"; \
1792       source: ""; \
1793       script { \
1794          if (get_int(_state) != 0) { \
1795             emit("elm,swipe,stop", ""); \
1796          }\
1797          cleanup(); \
1798       } \
1799    } \
1800    program { name: "swipe_disable"; \
1801       signal: "elm,swipe,disabled"; \
1802       source: ""; \
1803       script { \
1804          if (get_int(_state) != 0) { \
1805             emit("elm,swipe,stop", ""); \
1806             cleanup(); \
1807          }\
1808          set_state(PART:"drag_part", "disable", 0.0); \
1809       } \
1810    } \
1811    program { name: "swipe_enable"; \
1812       signal: "elm,swipe,enabled"; \
1813       source: ""; \
1814       script { \
1815          if (get_int(_state) != 0) { \
1816             emit("elm,swipe,stop", ""); \
1817             cleanup(); \
1818          }\
1819          set_state(PART:"drag_part", "default", 0.0); \
1820       } \
1821    } \
1822    program { name: "swipe_default"; \
1823       signal: "elm,state,default"; \
1824       source: "elm"; \
1825       script { \
1826          run_program(PROGRAM:"swipe_enable"); \
1827       } \
1828    } \
1829    program { name: "swipe_disable_state"; \
1830       signal: "elm,state,disabled"; \
1831       source: "elm"; \
1832       script { \
1833          run_program(PROGRAM:"swipe_disable"); \
1834       } \
1835    } \
1836
1837
1838
1839 #define SCRIPTS_LIST_SWEEP \
1840    script { \
1841       public dir_right; \
1842    }
1843
1844 #define PARTS_LIST_SWEEP \
1845    PART(RECT, "bg.sweep",\
1846       description { state: "default" 0.0;\
1847          color_class: "B0232";\
1848          rel1.relative: -1.0 0.0;\
1849          rel2.relative: 0.0 1.0;\
1850          visible: 0;\
1851       }\
1852       description { state: "default_r" 0.0;\
1853          inherit: "default" 0.0;\
1854          rel1.relative: 1.0 0.0;\
1855          rel2.relative: 2.0 1.0;\
1856          visible: 0;\
1857       }\
1858       description { state: "visible" 0.0;\
1859          inherit: "default" 0.0;\
1860          rel1.relative: 0.0 0.0;\
1861          rel2.relative: 1.0 1.0;\
1862          visible: 1;\
1863       }\
1864    )\
1865    PART(TEXTBLOCK, "elm.text.sweep",\
1866       description { state: "default" 0.0;\
1867          rel1.to_x: "bg.sweep";\
1868          rel2.to_x: "elm.divider.sweep.left.padding";\
1869          rel2.relative: 0.0 1.0;\
1870          PARAM_TEXT("list_sweep_style",)\
1871          visible: 0;\
1872       }\
1873       description { state: "visible" 0.0;\
1874          inherit: "default" 0.0;\
1875          visible: 1;\
1876       }\
1877    )\
1878    PART(SPACER, "elm.divider.sweep.left.padding",\
1879       DESC_R("elm.divider.sweep",\
1880          min: LIST_DIVIDER_PADDING_SIZE 0;\
1881          max: LIST_DIVIDER_PADDING_SIZE -1;\
1882       )\
1883    )\
1884    PART(SWALLOW, "elm.icon.sweep",\
1885       DESC_FROM_R(\
1886          min: BUTTON_DIVIDER_BTN_SIZE 0;\
1887          max: BUTTON_DIVIDER_BTN_SIZE -1;\
1888          rel1.to: "bg.sweep";\
1889          rel2.to: "bg.sweep";\
1890          visible: 0;\
1891       )\
1892       description { state: "visible" 0.0;\
1893          inherit: "default" 0.0;\
1894          visible: 1;\
1895       }\
1896    )\
1897    PART(RECT, "elm.divider.sweep",\
1898       DESC_R("elm.icon.sweep",\
1899          visible: 0;\
1900          align: 0.0 0.5;\
1901          min: 2 LIST_DIVIDER_HEIGHT;\
1902          max: 2 LIST_DIVIDER_HEIGHT;\
1903          color: 0 0 0 0; \
1904       )\
1905       description { state: "visible" 0.0;\
1906          inherit: "default" 0.0;\
1907          visible: 1;\
1908       }\
1909    )
1910
1911 #define PROGRAMS_LIST_SWEEP \
1912    program { name: "sweep_default"; \
1913       signal: "elm,state,default"; \
1914       source: "elm"; \
1915       action: STATE_SET "default" 0.0;\
1916       target: "bg.sweep";\
1917       target: "elm.icon.sweep";\
1918       target: "elm.text.sweep";\
1919       target: "elm.divider.sweep";\
1920    } \
1921    program { name: "sweep_right_show";\
1922       signal: "elm,state,sweep,right";\
1923       source: "";\
1924       script {\
1925          set_int(dir_right, 1);\
1926          set_state(PART:"bg.sweep", "default", 0.0);\
1927          run_program(PROGRAM:"sweep_show");\
1928       }\
1929    }\
1930    program { name: "sweep_left_show";\
1931       signal: "elm,state,sweep,left";\
1932       source: "";\
1933       script {\
1934          set_int(dir_right, 0);\
1935          set_state(PART:"bg.sweep", "default_r", 0.0);\
1936          run_program(PROGRAM:"sweep_show");\
1937       }\
1938    }\
1939    program { name: "sweep_show";\
1940       action: STATE_SET "visible" 0.0;\
1941       transition: DECELERATE 0.5;\
1942       target: "bg.sweep";\
1943       target: "elm.icon.sweep";\
1944       target: "elm.text.sweep";\
1945       target: "elm.divider.sweep";\
1946    }\
1947    program { name: "sweep_hide";\
1948       signal: "elm,state,sweep,hide";\
1949       source: "";\
1950       script {\
1951          if (get_int(dir_right)) {\
1952             run_program(PROGRAM:"sweep_left_hide");\
1953          } else {\
1954             run_program(PROGRAM:"sweep_right_hide");\
1955          }\
1956       }\
1957    }\
1958    program { name: "sweep_left_hide"; \
1959       action: STATE_SET "default" 0.0;\
1960       transition: DECELERATE 0.5;\
1961       target: "bg.sweep";\
1962       target: "elm.icon.sweep";\
1963       target: "elm.text.sweep";\
1964       target: "elm.divider.sweep";\
1965    }\
1966    program { name: "sweep_right_hide"; \
1967       action: STATE_SET "default_r" 0.0;\
1968       transition: DECELERATE 0.5;\
1969       target: "bg.sweep";\
1970       target: "elm.icon.sweep";\
1971       target: "elm.text.sweep";\
1972       target: "elm.divider.sweep";\
1973    }