tizen 2.3.1 release
[apps/home/b2-clocksetting.git] / data / 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: LIST_BG_PRESSED_COLOR; \
424       } \
425    )
426
427 #define PART_LIST_BOTTOMLINE \
428    PART(RECT, "bottom_line_clip", \
429       description { state: "default" 0.0; } \
430       description { state: "hide" 0.0; \
431          inherit: "default" 0.0; \
432          color: 0 0 0 0; \
433       } \
434       description { state: "decorate" 0.0; \
435          inherit: "default" 0.0; \
436          color: 0 0 0 0; \
437       } \
438       description { state: "reorder" 0.0; \
439          inherit: "default" 0.0; \
440          color: 0 0 0 0; \
441       } \
442       description { state: "decorate_reorder" 0.0; \
443          inherit: "default" 0.0; \
444          color: 0 0 0 0; \
445       } \
446       description { state: "flipped" 0.0; \
447          inherit: "default" 0.0; \
448          color: 0 0 0 0; \
449       } \
450    ) \
451    PART(RECT, "bottom_line", \
452       mouse_events: 0; \
453       clip_to: "bottom_line_clip"; \
454       description { state: "default" 0.0; \
455          min: 0 1; \
456          max: -1 1; \
457          fixed: 0 1; \
458          align: 0.5 1; \
459          color: LIST_LINE_COLOR; \
460          rel1.offset: -1 -1; \
461       } \
462    )
463
464 #define PART_LIST_BOTTOMLINE_OFF \
465    PART(RECT, "bottom_line_clip", \
466       description { state: "default" 0.0;  \
467          visible: 0; \
468       } \
469       description { state: "hide" 0.0; \
470          inherit: "default" 0.0; \
471          color: 0 0 0 0; \
472       } \
473    ) \
474    PART(RECT, "bottom_line", \
475       description { state: "default" 0.0; \
476          visible: 0; \
477       } \
478    )
479
480 //**************************** Genlist PADDING *******************************//
481 #define DESC_LIST_PADDINGS \
482    description { state: "decorate" 0.0; \
483       inherit: "default" 0.0; \
484       min: 0 0; \
485       max: 0 0; \
486    } \
487    description { state: "decorate_reorder" 0.0; \
488       inherit: "default" 0.0; \
489       min: 0 0; \
490       max: 0 0; \
491    } \
492    description { state: "reorder" 0.0; \
493       inherit: "default" 0.0; \
494       min: 32 0; \
495       max: 32 -1; \
496    }
497
498 #define PART_LIST_PADDINGS(LEFT_SIZE, RIGHT_SIZE, TOP_SIZE, BOTTOM_SIZE) \
499    PART(SWALLOW, "elm.swallow.pad", \
500       mouse_events: 0; \
501       DESC_FROM_L( ; ) \
502    ) \
503    PART(SWALLOW, "elm.swallow.colorbar", \
504       mouse_events: 0; \
505       DESC_L("elm.swallow.pad", ) \
506    ) \
507    PART(SPACER, "elm.padding.left", \
508       DESC_L("elm.swallow.pad", \
509          min: LEFT_SIZE 0; \
510          max: LEFT_SIZE -1; \
511       ) \
512    ) \
513    PART(SPACER, "elm.padding.right", \
514       DESC_FROM_R( \
515          min: RIGHT_SIZE 0; \
516          max: RIGHT_SIZE -1; \
517       ) \
518       description { state: "decorate" 0.0; \
519          inherit: "default" 0.0; \
520          min: 0 0; \
521          max: 0 0; \
522       } \
523       description { state: "decorate_reorder" 0.0; \
524          inherit: "default" 0.0; \
525          min: 0 0; \
526          max: 0 0; \
527       } \
528       description { state: "reorder" 0.0; \
529          inherit: "default" 0.0; \
530          min: 32 0; \
531          max: 32 -1; \
532       } \
533    ) \
534    PART(SPACER, "elm.padding.top", \
535       DESC_FROM_T( \
536          min: 0 TOP_SIZE; \
537          max: -1 TOP_SIZE; \
538       ) \
539    ) \
540    PART(SPACER, "elm.padding.bottom", \
541       DESC_FROM_B( \
542          min: 0 BOTTOM_SIZE; \
543          max: -1 BOTTOM_SIZE; \
544       ) \
545    )
546
547 //***************************  Genlist Programs ****************************//
548 #define PROGRAM_LIST_DEFAULT( TARGET ) \
549    program { name: "default"; \
550       signal: "elm,state,default"; \
551       source: "elm"; \
552       action: STATE_SET "default" 0.0; \
553       TARGET \
554    } \
555
556 #define PROGRAM_LIST_DISABLE( TARGET ) \
557    program { name: "enabled"; \
558       signal: "elm,state,enabled"; \
559       source: "elm"; \
560       action: STATE_SET "default" 0.0; \
561       TARGET \
562    } \
563    program { name: "disabled"; \
564       signal: "elm,state,disabled"; \
565       source: "elm"; \
566       action: STATE_SET "disabled" 0.0; \
567       TARGET \
568    }
569
570 #define PROGRAM_LIST_SELECT( TARGET ) \
571    program { name: "selected"; \
572       signal: "elm,state,selected"; \
573       source: "elm"; \
574       action: STATE_SET "selected" 0.0; \
575       TARGET \
576    } \
577    program { name: "unselected"; \
578       signal: "elm,state,unselected"; \
579       source: "elm"; \
580       action: STATE_SET "default" 0.0; \
581       TARGET \
582    }
583
584 #define PROGRAM_LIST_SOUND \
585    program { name: "play_sound"; \
586       signal: "elm,state,clicked"; \
587       source: "elm"; \
588       script { \
589          play_sample("touch_sound", 1.0); \
590       } \
591    }
592
593 #define PROGRAM_LIST_FOCUS \
594    program { name: "focused"; \
595       signal: "elm,state,focused"; \
596       source: "elm"; \
597       action: STATE_SET "focused" 0.0; \
598       target: "focus_part"; \
599    } \
600    program { name: "unfocused"; \
601       signal: "elm,state,unfocused"; \
602       source: "elm"; \
603       action: STATE_SET "default" 0.0; \
604       target: "focus_part"; \
605    }
606
607 #define PROGRAM_LIST_FLIP \
608    program { name: "flip_enabled"; \
609       signal:  "elm,state,flip,enabled"; \
610       source:  "elm"; \
611       transition: DECELERATE 0.5; \
612       action:  STATE_SET "flipped" 0.0; \
613       target: "elm.flip.content"; \
614       target: "elm.flip.icon"; \
615    } \
616    program { name: "flip_disabled"; \
617       signal:  "elm,state,flip,disabled"; \
618       source:  "elm"; \
619       transition: DECELERATE 0.5; \
620       action:  STATE_SET "default" 0.0; \
621       target: "elm.flip.content"; \
622       target: "elm.flip.icon"; \
623    } \
624    program { name: "flip_enabled_bg"; \
625       signal:  "elm,state,flip,enabled"; \
626       source:  "elm"; \
627       action:  STATE_SET "flipped" 0.0; \
628       target: "elm.flip.bg"; \
629    } \
630    program { name: "flip_disabled_bg"; \
631       signal:  "elm,state,flip,disabled"; \
632       source:  "elm"; \
633       action:  STATE_SET "default" 0.0; \
634       target: "elm.flip.bg"; \
635    }
636
637 #define PROGRAM_LIST_DECORATE( TARGET ) \
638    program { name: "decorate_enabled_effect_ef"; \
639       signal: "elm,state,decorate,enabled,effect";\
640       source: "elm";\
641       action:  STATE_SET "decorate" 0.0;\
642       TARGET \
643    }\
644    program { name: "decorate_disabled_effect_ef";\
645       signal: "elm,state,decorate,disabled,effect";\
646       source: "elm";\
647       action:  STATE_SET "default" 0.0;\
648       TARGET \
649    } \
650    program { name: "decorate_enabled_ef";\
651       signal: "elm,state,decorate,enabled";\
652       source: "elm";\
653       action:  STATE_SET "decorate" 0.0;\
654       TARGET \
655    }\
656    program { name: "decorate_disabled_ef";\
657       signal: "elm,state,decorate,disabled";\
658       source: "elm";\
659       action:  STATE_SET "default" 0.0;\
660       TARGET \
661    }
662
663 #define PROGRAM_LIST_DECORATE_FX( TARGET ) \
664    program { name: "decorate_enabled_effect_ef"; \
665       signal: "elm,state,decorate,enabled,effect";\
666       source: "elm";\
667       transition: DECELERATE 0.5;\
668       action:  STATE_SET "decorate" 0.0;\
669       TARGET \
670    }\
671    program { name: "decorate_disabled_effect_ef";\
672       signal: "elm,state,decorate,disabled,effect";\
673       source: "elm";\
674       transition: ACCELERATE 0.5;\
675       action:  STATE_SET "default" 0.0;\
676       TARGET \
677    } \
678    program { name: "decorate_enabled_ef";\
679       signal: "elm,state,decorate,enabled";\
680       source: "elm";\
681       action:  STATE_SET "decorate" 0.0;\
682       TARGET \
683    }\
684    program { name: "decorate_disabled_ef";\
685       signal: "elm,state,decorate,disabled";\
686       source: "elm";\
687       action:  STATE_SET "default" 0.0;\
688       TARGET \
689    }
690
691 #define PROGRAM_LIST_BOTTOMLINE \
692    program { name : "hide_bottomline"; \
693       signal: "elm,state,bottomline,hide"; \
694       source: ""; \
695       action: STATE_SET "hide" 0.0; \
696       target: "bottom_line_clip"; \
697    } \
698    program { name : "show_bottomline"; \
699       signal: "elm,state,bottomline,show"; \
700       source: ""; \
701       action: STATE_SET "default" 0.0; \
702       target: "bottom_line_clip"; \
703    } \
704
705
706 #define PROGRAMS_LIST( TARGET ) \
707    programs { \
708       PROGRAM_LIST_DEFAULT( TARGET \
709          target: "bg"; \
710          target: "bg_clip"; \
711          target: "bottom_line"; \
712          target: "bottom_line_clip"; \
713          target: "elm.padding.left"; \
714          target: "elm.padding.right"; \
715       ) \
716       PROGRAM_LIST_DISABLE( TARGET \
717          target: "bg"; \
718       ) \
719       PROGRAM_LIST_SELECT( TARGET \
720          target: "bg"; \
721       ) \
722       PROGRAM_LIST_SOUND \
723       PROGRAM_LIST_DECORATE( \
724          target: "bg"; \
725          target: "bg_clip"; \
726          target: "bottom_line"; \
727          target: "bottom_line_clip"; \
728          target: "elm.padding.left"; \
729          target: "elm.padding.right"; \
730       ) \
731       PROGRAM_LIST_BOTTOMLINE \
732    }
733
734 //******************************* Genlist TEXT ********************************//
735 #define PARAM_TEXT(STYLE, PARAM) \
736    text { \
737       min: 0 1; \
738       style: STYLE; \
739       PARAM \
740    }
741
742 #define DESCRIPIONS_TEXT(DISABLED, SELECTED) \
743    description { state: "disabled" 0.0; \
744       inherit: "default" 0.0; \
745       text.style: DISABLED; \
746    } \
747    description { state: "selected" 0.0; \
748       inherit: "default" 0.0; \
749       text.style: SELECTED; \
750    }
751
752 //******************************* Genlist SWIPE ********************************//
753 #define SWIPE_TRANSIT       SIN_FAC 0.667 0.8
754
755 #define SWIPE_THRESH_X      120
756 #define SWIPE_THRESH_Y      30
757
758 #define SWIPE_OVERLAP_SIZE  216
759 #define SWIPE_BORDER_SIZE   215
760
761 #define SWIPE_COLOR_OTHER   88 73 58 255
762 #define SWIPE_COLOR_CALL    90 165 21 255;
763 #define SWIPE_COLOR_MESSAGE 234 163 23 255;
764
765 // state: normal(0)->start,right( 1)->rollback,right ( 3), swipe,right ( 2)-> normal(0)
766 //                 ->start,left (-1)->rollback,right (-3), swipe,right (-2)->
767 #define SCRIPTS_LIST_SWIPE \
768    script { \
769       public _state; \
770       public x1, y1; \
771       public cleanup() { \
772          set_int(_state, 0); \
773          set_int(x1, 0); \
774          set_int(y1, 0); \
775          set_drag(PART:"drag_part", 0, 0); \
776          set_state(PART:"drag_part", "default", 0.0); \
777          set_state(PART:"drag_part_left", "default", 0.0); \
778          set_state(PART:"drag_part_right", "default", 0.0); \
779          set_state(PART:"elm.text.swipe.left", "default", 0.0); \
780          set_state(PART:"elm.text.swipe.right", "default", 0.0); \
781          set_state(PART:"elm.icon.swipe.left", "default", 0.0); \
782          set_state(PART:"elm.icon.swipe.right", "default", 0.0); \
783          set_state(PART:"swipe_temp_disabler", "default", 0.0); \
784       } \
785    }
786
787 #define IMAGES_LIST_SWIPE \
788       image : "00_list_swipe_right.png" COMP; \
789       image : "00_list_swipe_left.png" COMP;
790
791 #define PARTS_LIST_SWIPE \
792       part { name: "drag_part"; \
793          type: RECT; \
794          scale: 1; \
795          repeat_events: 1; \
796          dragable { \
797             x: 1 1 0; \
798             y: 0 0 0; \
799          } \
800          description { state: "default" 0.0; \
801             color: 0 0 0 0; \
802             rel1.offset: -SWIPE_OVERLAP_SIZE 0; \
803             rel2.offset: SWIPE_OVERLAP_SIZE 0; \
804          } \
805          description { state: "disable" 0.0; \
806             inherit: "default" 0.0; \
807             visible: 0; \
808          } \
809          description { state: "start_right" 0.0; \
810             inherit: "default" 0.0; \
811             color: SWIPE_COLOR_OTHER; \
812          } \
813          description { state: "right_end" 0.0; \
814             inherit: "start_right"; \
815             rel1.relative: 1 0; \
816          } \
817          description { state: "right_rollback" 0.0; \
818             inherit: "start_right" 0.0; \
819             rel1.relative: -1 0; \
820             color: 0 0 0 0; \
821          } \
822          description { state: "start_left" 0.0; \
823             inherit: "default" 0.0; \
824             color: SWIPE_COLOR_OTHER; \
825          } \
826          description { state: "left_end" 0.0; \
827             inherit: "start_left" 0.0; \
828             rel2.relative: 0 1; \
829          } \
830          description { state: "left_rollback" 0.0; \
831             inherit: "start_left" 0.0; \
832             rel2.relative: 2 1; \
833             color: 0 0 0 0; \
834          } \
835       } \
836       part { name: "drag_part_left"; \
837          type: IMAGE; \
838          scale: 1; \
839          mouse_events: 0; \
840          description { state: "default" 0.0; \
841             color: 0 0 0 0; \
842             rel1 { \
843                relative: -999 0; \
844             } \
845             rel2 { \
846                to_x: "drag_part"; \
847                relative: 0 1; \
848                offset: SWIPE_OVERLAP_SIZE 0; \
849             } \
850             image { \
851                normal: "00_list_swipe_left.png"; \
852                border: 0 SWIPE_BORDER_SIZE 53 53; \
853                border_scale: 1; \
854             } \
855          } \
856          description { state: "start_right" 0.0; \
857             inherit: "default"; \
858             color: SWIPE_COLOR_CALL; \
859          } \
860          description { state: "start_left" 0.0; \
861             inherit: "default"; \
862             color: SWIPE_COLOR_CALL; \
863          } \
864       } \
865       part { name: "drag_part_right"; \
866          type: IMAGE; \
867          scale: 1; \
868          mouse_events: 0; \
869          description { state: "default" 0.0; \
870             color: 0 0 0 0; \
871             rel1 { \
872                to_x: "drag_part"; \
873                relative: 1 0; \
874                offset: -SWIPE_OVERLAP_SIZE 0; \
875             } \
876             rel2 { \
877                relative: 999 1; \
878             } \
879             image { \
880                normal: "00_list_swipe_right.png"; \
881                border: SWIPE_BORDER_SIZE 0 53 53; \
882                border_scale: 1; \
883             } \
884          } \
885          description { state: "start_right" 0.0; \
886             inherit: "default"; \
887             color: SWIPE_COLOR_MESSAGE; \
888          } \
889          description { state: "start_left" 0.0; \
890             inherit: "default"; \
891             color: SWIPE_COLOR_MESSAGE; \
892          } \
893       } \
894       part { name: "swipe_temp_disabler"; \
895          type: RECT; \
896          scale:1; \
897          repeat_events: 0; \
898          description { state: "default" 0.0; \
899             visible: 0; \
900             color: 0 0 0 0; \
901          } \
902          description { state: "enable" 0.0; \
903             inherit: "default"; \
904             visible: 1; \
905          } \
906       } \
907       part { name: "elm.icon.swipe.left"; \
908          type: SWALLOW; \
909          scale: 1; \
910          mouse_events: 0; \
911          description { state: "default" 0.0; \
912             visible: 0; \
913             rel1 { \
914                to_x: "elm.padding.left"; \
915                relative: 1 0; \
916             } \
917             rel2 { \
918                to_x: "elm.padding.right"; \
919                relative: 1 1; \
920             } \
921             align: 0 0.5; \
922             fixed: 1 1; \
923             min: 64 90; \
924             max: 64 90; \
925          } \
926          description { state: "start_left" 0.0; \
927             inherit: "default" 0.0; \
928             visible: 1; \
929             color: 250 250 250 255; \
930          } \
931          description { state: "start_right" 0.0; \
932             inherit: "default" 0.0; \
933          } \
934          description { state: "right_rollback" 0.0; \
935             inherit: "default" 0.0; \
936             color: 0 0 0 0; \
937          } \
938          description { state: "left_rollback" 0.0; \
939             inherit: "default" 0.0; \
940             color: 0 0 0 0; \
941          } \
942       } \
943       part { name: "elm.icon.swipe.right"; \
944          type: SWALLOW; \
945          scale: 1; \
946          mouse_events: 0; \
947          description { state: "default" 0.0; \
948             visible: 0; \
949             rel1 { \
950                to_x: "elm.padding.right"; \
951                relative: 0 0; \
952             } \
953             rel2 { \
954                to_x: "elm.padding.right"; \
955                relative: 0 1; \
956             } \
957             align: 1 0.5; \
958             fixed: 1 1; \
959             min: 64 90; \
960             max: 64 90; \
961          } \
962          description { state: "start_right" 0.0; \
963             inherit: "default" 0.0; \
964             visible: 1; \
965             color: 250 250 250 255; \
966          } \
967          description { state: "start_left" 0.0; \
968             inherit: "default" 0.0; \
969          } \
970          description { state: "right_rollback" 0.0; \
971             inherit: "default" 0.0; \
972             color: 0 0 0 0; \
973          } \
974          description { state: "left_rollback" 0.0; \
975             inherit: "default" 0.0; \
976             color: 0 0 0 0; \
977          } \
978       } \
979       part { name: "elm.text.swipe.left"; \
980          type: TEXT; \
981          scale: 1; \
982          mouse_events: 0; \
983          description { state: "default" 0.0; \
984             rel1 { \
985                relative: 1 0; \
986                to_x: "elm.icon.swipe.left"; \
987             } \
988             visible: 0; \
989          } \
990          description { state: "start_left" 0.0; \
991             inherit: "default"; \
992             visible: 1; \
993             align: 0.5 0.5; \
994             color: LIST_SWIPE_TEXT_COLOR; \
995             text { \
996                align: 0.5 0.5; \
997                min: 0 1; \
998                font: "Tizen:style=Regular"; \
999                size: LIST_SWIPE_TEXT_SIZE; \
1000                text_class: "list_item"; \
1001             } \
1002          } \
1003          description { state: "start_right" 0.0; \
1004             inherit: "default" 0.0; \
1005          } \
1006       } \
1007       part { name: "elm.text.swipe.right"; \
1008          type: TEXT; \
1009          scale: 1; \
1010          mouse_events: 0; \
1011          description { state: "default" 0.0; \
1012             rel2 { \
1013                relative: 0 1; \
1014                to_x: "elm.icon.swipe.right"; \
1015             } \
1016             visible: 0; \
1017          } \
1018          description { state: "start_right" 0.0; \
1019             inherit: "default" 0.0; \
1020             visible: 1; \
1021             align: 0.5 0.5; \
1022             color: LIST_SWIPE_TEXT_COLOR; \
1023             text { \
1024                align: 0.5 0.5; \
1025                min: 0 1; \
1026                font: "Tizen:style=Regular"; \
1027                size: LIST_SWIPE_TEXT_SIZE; \
1028                text_class: "list_item"; \
1029                text: "Call"; \
1030             } \
1031          } \
1032          description { state: "start_left" 0.0; \
1033             inherit: "default" 0.0; \
1034          } \
1035       }
1036
1037 #define PARTS_LIST_SWIPE_RIGHT \
1038       part { name: "drag_part"; \
1039          type: RECT; \
1040          scale: 1; \
1041          repeat_events: 1; \
1042          dragable { \
1043             x: 1 1 0; \
1044             y: 0 0 0; \
1045          } \
1046          description { state: "default" 0.0; \
1047             color: 0 0 0 0; \
1048             rel1.offset: -SWIPE_OVERLAP_SIZE 0; \
1049             rel2.offset: SWIPE_OVERLAP_SIZE 0; \
1050          } \
1051          description { state: "disable" 0.0; \
1052             inherit: "default" 0.0; \
1053             visible: 0; \
1054          } \
1055          description { state: "start_right" 0.0; \
1056             inherit: "default" 0.0; \
1057             color: SWIPE_COLOR_OTHER; \
1058          } \
1059          description { state: "right_end" 0.0; \
1060             inherit: "start_right"; \
1061             rel1.relative: 1 0; \
1062          } \
1063          description { state: "right_rollback" 0.0; \
1064             inherit: "start_right" 0.0; \
1065             rel1.relative: -1 0; \
1066             color: 0 0 0 0; \
1067          } \
1068       } \
1069       part { name: "drag_part_left"; \
1070          type: IMAGE; \
1071          scale: 1; \
1072          mouse_events: 0; \
1073          description { state: "default" 0.0; \
1074             color: 0 0 0 0; \
1075             rel1 { \
1076                relative: -999 0; \
1077             } \
1078             rel2 { \
1079                to_x: "drag_part"; \
1080                relative: 0 1; \
1081                offset: SWIPE_OVERLAP_SIZE 0; \
1082             } \
1083             image { \
1084                normal: "00_list_swipe_left.png"; \
1085                border: 0 SWIPE_BORDER_SIZE 53 53; \
1086                border_scale: 1; \
1087             } \
1088          } \
1089          description { state: "start_right" 0.0; \
1090             inherit: "default"; \
1091             color: SWIPE_COLOR_CALL; \
1092          } \
1093       } \
1094       part { name: "drag_part_right"; \
1095          type: IMAGE; \
1096          scale: 1; \
1097          mouse_events: 0; \
1098          description { state: "default" 0.0; \
1099             color: 0 0 0 0; \
1100             rel1 { \
1101                to_x: "drag_part"; \
1102                relative: 1 0; \
1103                offset: -SWIPE_OVERLAP_SIZE 0; \
1104             } \
1105             rel2 { \
1106                relative: 999 1; \
1107             } \
1108             image { \
1109                normal: "00_list_swipe_right.png"; \
1110                border: SWIPE_BORDER_SIZE 0 53 53; \
1111                border_scale: 1; \
1112             } \
1113          } \
1114          description { state: "start_right" 0.0; \
1115             inherit: "default"; \
1116             color: SWIPE_COLOR_OTHER; \
1117          } \
1118       } \
1119       part { name: "swipe_temp_disabler"; \
1120          type: RECT; \
1121          scale:1; \
1122          repeat_events: 0; \
1123          description { state: "default" 0.0; \
1124             visible: 0; \
1125             color: 0 0 0 0; \
1126          } \
1127          description { state: "enable" 0.0; \
1128             inherit: "default"; \
1129             visible: 1; \
1130          } \
1131       } \
1132       part { name: "elm.icon.swipe.right"; \
1133          type: SWALLOW; \
1134          scale: 1; \
1135          mouse_events: 0; \
1136          description { state: "default" 0.0; \
1137             visible: 0; \
1138             rel1 { \
1139                to_x: "elm.padding.right"; \
1140                relative: 0 0; \
1141             } \
1142             rel2 { \
1143                to_x: "elm.padding.right"; \
1144                relative: 0 1; \
1145             } \
1146             align: 1 0.5; \
1147             fixed: 1 1; \
1148             min: 64 90; \
1149             max: 64 90; \
1150          } \
1151          description { state: "start_right" 0.0; \
1152             inherit: "default" 0.0; \
1153             visible: 1; \
1154             color: 250 250 250 255; \
1155          } \
1156          description { state: "right_rollback" 0.0; \
1157             inherit: "default" 0.0; \
1158             color: 0 0 0 0; \
1159          } \
1160       } \
1161       part { name: "elm.text.swipe.right"; \
1162          type: TEXT; \
1163          scale: 1; \
1164          mouse_events: 0; \
1165          description { state: "default" 0.0; \
1166             rel2 { \
1167                relative: 0 1; \
1168                to_x: "elm.icon.swipe.right"; \
1169             } \
1170             visible: 0; \
1171          } \
1172          description { state: "start_right" 0.0; \
1173             inherit: "default" 0.0; \
1174             visible: 1; \
1175             align: 0.5 0.5; \
1176             color: LIST_SWIPE_TEXT_COLOR; \
1177             text { \
1178                align: 0.5 0.5; \
1179                min: 0 1; \
1180                font: "Tizen:style=Regular"; \
1181                size: LIST_SWIPE_TEXT_SIZE; \
1182                text_class: "list_item"; \
1183                text: "Call"; \
1184             } \
1185          } \
1186       }
1187
1188 #define PROGRAMS_LIST_SWIPE \
1189    program { name: "drag_up"; \
1190       signal: "mouse,up,1"; \
1191       source: "drag_part"; \
1192       script { \
1193          new x, y, w, h, ww, hh; \
1194          get_geometry(PART:"bg", x, y, ww, hh); \
1195          get_geometry(PART:"drag_part", x, y, w, h); \
1196          x = x + SWIPE_OVERLAP_SIZE; \
1197          if (get_int(_state) == 1) { \
1198             if (x >= (ww/2)) { \
1199                set_int(_state, 3); \
1200                set_state(PART:"swipe_temp_disabler", "enable", 0.0); \
1201                run_program(PROGRAM:"end_move_right"); \
1202             } else { \
1203                set_int(_state, 2); \
1204                set_state(PART:"swipe_temp_disabler", "enable", 0.0); \
1205                set_state(PART:"elm.text.swipe.right", "default", 0.0); \
1206                set_state(PART:"elm.text.swipe.left", "default", 0.0); \
1207                run_program(PROGRAM:"end_rollback_right"); \
1208             } \
1209          } else if (get_int(_state) == -1) { \
1210             if (-x >= (ww/2)) { \
1211                set_int(_state, -3); \
1212                set_state(PART:"swipe_temp_disabler", "enable", 0.0); \
1213                run_program(PROGRAM:"end_move_left"); \
1214             } else { \
1215                set_int(_state, -2); \
1216                set_state(PART:"swipe_temp_disabler", "enable", 0.0); \
1217                set_state(PART:"elm.text.swipe.right", "default", 0.0); \
1218                set_state(PART:"elm.text.swipe.left", "default", 0.0); \
1219                run_program(PROGRAM:"end_rollback_left"); \
1220             } \
1221          } else cleanup(); \
1222       } \
1223    } \
1224    program { name: "drag_down"; \
1225       signal: "mouse,down,1"; \
1226       source: "drag_part"; \
1227       script { \
1228          new x, y; \
1229          get_mouse(x, y); \
1230          set_int(_state, 0); \
1231          set_int(x1, x); \
1232          set_int(y1, y); \
1233       } \
1234    } \
1235    program { name: "drag"; \
1236       signal: "drag"; \
1237       source: "drag_part"; \
1238       script { \
1239          new x2, y2; \
1240          get_mouse(x2, y2); \
1241          if (((y2 - get_int(y1)) >= SWIPE_THRESH_Y) || \
1242              ((y2 - get_int(y1)) <= -SWIPE_THRESH_Y)) \
1243                return; \
1244          if (get_int(_state) == 0) { \
1245             if ((x2 - get_int(x1)) >= SWIPE_THRESH_X) { \
1246                emit("elm,swipe,start", ""); \
1247                set_int(_state, 1); \
1248                run_program(PROGRAM:"start_right");  \
1249             } else if ((x2 - get_int(x1)) <= -SWIPE_THRESH_X) { \
1250                emit("elm,swipe,start", ""); \
1251                set_int(_state, -1); \
1252                run_program(PROGRAM:"start_left");  \
1253             } \
1254          } else if (get_int(_state) == -1) { \
1255             if (x2 > get_int(x1)) { \
1256                set_int(_state, 1); \
1257                run_program(PROGRAM:"start_right");  \
1258             }\
1259          } else if (get_int(_state) == 1) { \
1260             if (x2 < get_int(x1)) { \
1261                set_int(_state, -1); \
1262                run_program(PROGRAM:"start_left");  \
1263             } \
1264          } \
1265       } \
1266    } \
1267    program { name: "start_right"; \
1268       action:  STATE_SET "start_right" 0.0; \
1269       target: "elm.icon.swipe.right"; \
1270       target: "elm.icon.swipe.left"; \
1271       target: "elm.text.swipe.right"; \
1272       target: "elm.text.swipe.left"; \
1273       target: "drag_part"; \
1274       target: "drag_part_left"; \
1275       target: "drag_part_right"; \
1276    } \
1277    program { name: "start_left"; \
1278       action:  STATE_SET "start_left" 0.0; \
1279       target: "elm.icon.swipe.right"; \
1280       target: "elm.icon.swipe.left"; \
1281       target: "elm.text.swipe.right"; \
1282       target: "elm.text.swipe.left"; \
1283       target: "drag_part"; \
1284       target: "drag_part_left"; \
1285       target: "drag_part_right"; \
1286    } \
1287    program { name: "end_move_right"; \
1288       transition: SWIPE_TRANSIT; \
1289       action:  STATE_SET "right_end" 0.0; \
1290       target: "drag_part"; \
1291       after: "right_ender"; \
1292    } \
1293    program { name: "end_move_left"; \
1294       transition: SWIPE_TRANSIT; \
1295       action:  STATE_SET "left_end" 0.0; \
1296       target: "drag_part"; \
1297       after: "left_ender"; \
1298    } \
1299    program { name: "end_rollback_right"; \
1300       action:  STATE_SET "right_rollback" 0.0; \
1301       target: "elm.icon.swipe.right"; \
1302       target: "elm.icon.swipe.left"; \
1303       after: "end_rollback_right_transit"; \
1304    } \
1305    program { name: "end_rollback_right_transit"; \
1306       transition: SWIPE_TRANSIT; \
1307       action:  STATE_SET "right_rollback" 0.0; \
1308       target: "drag_part"; \
1309       after: "rollback_ender"; \
1310    } \
1311    program { name: "end_rollback_left"; \
1312       action:  STATE_SET "left_rollback" 0.0; \
1313       target: "elm.icon.swipe.right"; \
1314       target: "elm.icon.swipe.left"; \
1315       after: "end_rollback_left_transit"; \
1316    } \
1317    program { name: "end_rollback_left_transit"; \
1318       transition: SWIPE_TRANSIT; \
1319       action:  STATE_SET "left_rollback" 0.0; \
1320       target: "drag_part"; \
1321       after: "rollback_ender"; \
1322    } \
1323    program { name: "right_ender"; \
1324       script { \
1325          emit("elm,swipe,stop,right", ""); \
1326          cleanup(); \
1327       } \
1328    } \
1329    program { name: "left_ender"; \
1330       script { \
1331          emit("elm,swipe,stop,left", ""); \
1332          cleanup(); \
1333       } \
1334    } \
1335    program { name: "rollback_ender"; \
1336       source: ""; \
1337       script { \
1338          emit("elm,swipe,stop", ""); \
1339          cleanup(); \
1340       } \
1341    } \
1342    program { name: "swipe_revert"; \
1343       signal: "elm,swipe,revert"; \
1344       source: ""; \
1345       script { \
1346          if (get_int(_state) != 0) { \
1347             emit("elm,swipe,stop", ""); \
1348          }\
1349          cleanup(); \
1350       } \
1351    } \
1352    program { name: "swipe_disable"; \
1353       signal: "elm,swipe,disabled"; \
1354       source: ""; \
1355       script { \
1356          if (get_int(_state) != 0) { \
1357             emit("elm,swipe,stop", ""); \
1358             cleanup(); \
1359          }\
1360          set_state(PART:"drag_part", "disable", 0.0); \
1361       } \
1362    } \
1363    program { name: "swipe_enable"; \
1364       signal: "elm,swipe,enabled"; \
1365       source: ""; \
1366       script { \
1367          if (get_int(_state) != 0) { \
1368             emit("elm,swipe,stop", ""); \
1369             cleanup(); \
1370          }\
1371          set_state(PART:"drag_part", "default", 0.0); \
1372       } \
1373    } \
1374    program { name: "swipe_default"; \
1375       signal: "elm,state,default"; \
1376       source: "elm"; \
1377       script { \
1378          run_program(PROGRAM:"swipe_enable"); \
1379       } \
1380    } \
1381    program { name: "swipe_disable_state"; \
1382       signal: "elm,state,disabled"; \
1383       source: "elm"; \
1384       script { \
1385          run_program(PROGRAM:"swipe_disable"); \
1386       } \
1387    } \
1388
1389 #define PROGRAMS_LIST_SWIPE_RIGHT \
1390    program { name: "drag_up"; \
1391       signal: "mouse,up,1"; \
1392       source: "drag_part"; \
1393       script { \
1394          new x, y, w, h, ww, hh; \
1395          get_geometry(PART:"bg", x, y, ww, hh); \
1396          get_geometry(PART:"drag_part", x, y, w, h); \
1397          x = x + SWIPE_OVERLAP_SIZE; \
1398          if (get_int(_state) == 1) { \
1399             if (x >= (ww/2)) { \
1400                set_int(_state, 3); \
1401                set_state(PART:"swipe_temp_disabler", "enable", 0.0); \
1402                run_program(PROGRAM:"end_move_right"); \
1403             } else { \
1404                set_int(_state, 2); \
1405                set_state(PART:"swipe_temp_disabler", "enable", 0.0); \
1406                set_state(PART:"elm.text.swipe.right", "default", 0.0); \
1407                set_state(PART:"elm.text.swipe.left", "default", 0.0); \
1408                run_program(PROGRAM:"end_rollback_right"); \
1409             } \
1410          } else cleanup(); \
1411       } \
1412    } \
1413    program { name: "drag_down"; \
1414       signal: "mouse,down,1"; \
1415       source: "drag_part"; \
1416       script { \
1417          new x, y; \
1418          get_mouse(x, y); \
1419          set_int(_state, 0); \
1420          set_int(x1, x); \
1421          set_int(y1, y); \
1422       } \
1423    } \
1424    program { name: "drag"; \
1425       signal: "drag"; \
1426       source: "drag_part"; \
1427       script { \
1428          new x2, y2; \
1429          get_mouse(x2, y2); \
1430          if (((y2 - get_int(y1)) >= SWIPE_THRESH_Y) || \
1431              ((y2 - get_int(y1)) <= -SWIPE_THRESH_Y)) \
1432                return; \
1433          if (get_int(_state) == 0) { \
1434             if ((x2 - get_int(x1)) >= SWIPE_THRESH_X) { \
1435                emit("elm,swipe,start", ""); \
1436                set_int(_state, 1); \
1437                run_program(PROGRAM:"start_right");  \
1438             } \
1439          } \
1440       } \
1441    } \
1442    program { name: "start_right"; \
1443       action:  STATE_SET "start_right" 0.0; \
1444       target: "elm.icon.swipe.right"; \
1445       target: "elm.text.swipe.right"; \
1446       target: "drag_part"; \
1447       target: "drag_part_left"; \
1448       target: "drag_part_right"; \
1449    } \
1450    program { name: "end_move_right"; \
1451       transition: SWIPE_TRANSIT; \
1452       action:  STATE_SET "right_end" 0.0; \
1453       target: "drag_part"; \
1454       after: "right_ender"; \
1455    } \
1456    program { name: "end_rollback_right"; \
1457       action:  STATE_SET "right_rollback" 0.0; \
1458       target: "elm.icon.swipe.right"; \
1459       after: "end_rollback_right_transit"; \
1460    } \
1461    program { name: "end_rollback_right_transit"; \
1462       transition: SWIPE_TRANSIT; \
1463       action:  STATE_SET "right_rollback" 0.0; \
1464       target: "drag_part"; \
1465       after: "rollback_ender"; \
1466    } \
1467    program { name: "right_ender"; \
1468       script { \
1469          emit("elm,swipe,stop,right", ""); \
1470          cleanup(); \
1471       } \
1472    } \
1473    program { name: "rollback_ender"; \
1474       source: ""; \
1475       script { \
1476          emit("elm,swipe,stop", ""); \
1477          cleanup(); \
1478       } \
1479    } \
1480    program { name: "swipe_revert"; \
1481       signal: "elm,swipe,revert"; \
1482       source: ""; \
1483       script { \
1484          if (get_int(_state) != 0) { \
1485             emit("elm,swipe,stop", ""); \
1486          }\
1487          cleanup(); \
1488       } \
1489    } \
1490    program { name: "swipe_disable"; \
1491       signal: "elm,swipe,disabled"; \
1492       source: ""; \
1493       script { \
1494          if (get_int(_state) != 0) { \
1495             emit("elm,swipe,stop", ""); \
1496             cleanup(); \
1497          }\
1498          set_state(PART:"drag_part", "disable", 0.0); \
1499       } \
1500    } \
1501    program { name: "swipe_enable"; \
1502       signal: "elm,swipe,enabled"; \
1503       source: ""; \
1504       script { \
1505          if (get_int(_state) != 0) { \
1506             emit("elm,swipe,stop", ""); \
1507             cleanup(); \
1508          }\
1509          set_state(PART:"drag_part", "default", 0.0); \
1510       } \
1511    } \
1512    program { name: "swipe_default"; \
1513       signal: "elm,state,default"; \
1514       source: "elm"; \
1515       script { \
1516          run_program(PROGRAM:"swipe_enable"); \
1517       } \
1518    } \
1519    program { name: "swipe_disable_state"; \
1520       signal: "elm,state,disabled"; \
1521       source: "elm"; \
1522       script { \
1523          run_program(PROGRAM:"swipe_disable"); \
1524       } \
1525    } \
1526
1527 #define SCRIPTS_LIST_SWEEP \
1528    script { \
1529       public dir_right; \
1530    }
1531
1532 #define PARTS_LIST_SWEEP \
1533    PART(RECT, "bg.sweep",\
1534       description { state: "default" 0.0;\
1535          color: LIST_SWEEP_BG_NORMAL_COLOR;\
1536          rel1.relative: -1.0 0.0;\
1537          rel2.relative: 0.0 1.0;\
1538          visible: 0;\
1539       }\
1540       description { state: "default_r" 0.0;\
1541          inherit: "default" 0.0;\
1542          rel1.relative: 1.0 0.0;\
1543          rel2.relative: 2.0 1.0;\
1544          visible: 0;\
1545       }\
1546       description { state: "visible" 0.0;\
1547          inherit: "default" 0.0;\
1548          rel1.relative: 0.0 0.0;\
1549          rel2.relative: 1.0 1.0;\
1550          visible: 1;\
1551       }\
1552    )\
1553    PART(TEXTBLOCK, "elm.text.sweep",\
1554       description { state: "default" 0.0;\
1555          rel1.to_x: "bg.sweep";\
1556          rel2.to_x: "elm.divider.sweep.left.padding";\
1557          rel2.relative: 0.0 1.0;\
1558          PARAM_TEXT("list_sweep_style",)\
1559          visible: 0;\
1560       }\
1561       description { state: "visible" 0.0;\
1562          inherit: "default" 0.0;\
1563          visible: 1;\
1564       }\
1565    )\
1566    PART(SPACER, "elm.divider.sweep.left.padding",\
1567       DESC_R("elm.divider.sweep",\
1568          min: LIST_DIVIDER_PADDING_SIZE 0;\
1569          max: LIST_DIVIDER_PADDING_SIZE -1;\
1570       )\
1571    )\
1572    PART(SWALLOW, "elm.icon.sweep",\
1573       DESC_FROM_R(\
1574          min: BUTTON_DIVIDER_BTN_SIZE 0;\
1575          max: BUTTON_DIVIDER_BTN_SIZE -1;\
1576          rel1.to: "bg.sweep";\
1577          rel2.to: "bg.sweep";\
1578          visible: 0;\
1579       )\
1580       description { state: "visible" 0.0;\
1581          inherit: "default" 0.0;\
1582          visible: 1;\
1583       }\
1584    )\
1585    PART(RECT, "elm.divider.sweep",\
1586       DESC_R("elm.icon.sweep",\
1587          visible: 0;\
1588          align: 0.0 0.5;\
1589          min: 1 LIST_DIVIDER_HEIGHT;\
1590          max: 1 LIST_DIVIDER_HEIGHT;\
1591          color: LIST_DIVIDER_COLOR;\
1592       )\
1593       description { state: "visible" 0.0;\
1594          inherit: "default" 0.0;\
1595          visible: 1;\
1596       }\
1597    )
1598
1599 // Calendar
1600 // bg is made transparent so calendar app can set the provided bg image
1601 #define PART_LIST_BG_CALENDAR \
1602    PART(RECT, "bg_clip", \
1603       mouse_events: 0; \
1604       description { state: "default" 0.0; } \
1605       description { state: "decorate" 0.0; \
1606          inherit: "default" 0.0; \
1607          color: 0 0 0 0; \
1608       } \
1609       description { state: "reorder" 0.0; \
1610          inherit: "default" 0.0; \
1611          color: 0 0 0 0; \
1612       } \
1613       description { state: "decorate_reorder" 0.0; \
1614          inherit: "default" 0.0; \
1615          color: 0 0 0 0; \
1616       } \
1617    ) \
1618    PART(RECT, "bg",  \
1619       clip_to: "bg_clip"; \
1620       description { state: "default" 0.0; \
1621          color: 0 0 0 0; \
1622       } \
1623       description { state: "selected" 0.0; \
1624          inherit: "default" 0.0; \
1625       } \
1626       description { state: "disabled" 0.0; \
1627          inherit: "default" 0.0; \
1628       } \
1629    )
1630
1631 #define PROGRAMS_LIST_SWEEP \
1632    program { name: "sweep_default"; \
1633       signal: "elm,state,default"; \
1634       source: "elm"; \
1635       action: STATE_SET "default" 0.0;\
1636       target: "bg.sweep";\
1637       target: "elm.icon.sweep";\
1638       target: "elm.text.sweep";\
1639       target: "elm.divider.sweep";\
1640    } \
1641    program { name: "sweep_right_show";\
1642       signal: "elm,state,sweep,right";\
1643       source: "";\
1644       script {\
1645          set_int(dir_right, 1);\
1646          set_state(PART:"bg.sweep", "default", 0.0);\
1647          run_program(PROGRAM:"sweep_show");\
1648       }\
1649    }\
1650    program { name: "sweep_left_show";\
1651       signal: "elm,state,sweep,left";\
1652       source: "";\
1653       script {\
1654          set_int(dir_right, 0);\
1655          set_state(PART:"bg.sweep", "default_r", 0.0);\
1656          run_program(PROGRAM:"sweep_show");\
1657       }\
1658    }\
1659    program { name: "sweep_show";\
1660       action: STATE_SET "visible" 0.0;\
1661       transition: DECELERATE 0.5;\
1662       target: "bg.sweep";\
1663       target: "elm.icon.sweep";\
1664       target: "elm.text.sweep";\
1665       target: "elm.divider.sweep";\
1666    }\
1667    program { name: "sweep_hide";\
1668       signal: "elm,state,sweep,hide";\
1669       source: "";\
1670       script {\
1671          if (get_int(dir_right)) {\
1672             run_program(PROGRAM:"sweep_left_hide");\
1673          } else {\
1674             run_program(PROGRAM:"sweep_right_hide");\
1675          }\
1676       }\
1677    }\
1678    program { name: "sweep_left_hide"; \
1679       action: STATE_SET "default" 0.0;\
1680       transition: DECELERATE 0.5;\
1681       target: "bg.sweep";\
1682       target: "elm.icon.sweep";\
1683       target: "elm.text.sweep";\
1684       target: "elm.divider.sweep";\
1685    }\
1686    program { name: "sweep_right_hide"; \
1687       action: STATE_SET "default_r" 0.0;\
1688       transition: DECELERATE 0.5;\
1689       target: "bg.sweep";\
1690       target: "elm.icon.sweep";\
1691       target: "elm.text.sweep";\
1692       target: "elm.divider.sweep";\
1693    }