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