2 * Copyright (c) 2010 Samsung Electronics Co., Ltd All Rights Reserved
4 * BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are met:
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.
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.
31 //****************************************************************************//
32 // ***************** EDJE description have 24 patterns **********************//
33 //**************************************************************************//
37 #define DESC_FROM_L( PARAM ) \
38 description { state: "default" 0.0;\
41 rel2.relative: 0.0 1.0; \
48 #define DESC_FROM_R( PARAM ) \
49 description { state: "default" 0.0;\
61 #define DESC_FROM_T( PARAM ) \
62 description { state: "default" 0.0;\
65 rel2.relative: 1.0 0.0; \
74 #define DESC_FROM_B( PARAM ) \
75 description { state: "default" 0.0;\
77 rel1.relative: 0.0 1.0; \
85 #define DESC_TO( PART, PARAM ) \
86 description { state: "default" 0.0;\
99 // ---------------------
100 // LEFT | HERE | RIGHT
101 // ---------------------
103 #define DESC_LRTB( LEFT, RIGHT, TOP, BOTTOM, PARAM ) \
104 description { state: "default" 0.0;\
118 // ---------------------
120 // ---------------------
121 #define DESC_L( LEFT, PARAM ) \
122 description { state: "default" 0.0;\
136 // ---------------------
138 // ---------------------
139 #define DESC_R( RIGHT, PARAM ) \
140 description { state: "default" 0.0;\
154 // --------------------------
155 // LEFT |--> HERE <--| RIGHT
156 // --------------------------
157 #define DESC_LR( LEFT, RIGHT, PARAM ) \
158 description { state: "default" 0.0;\
175 #define DESC_RTB( RIGHT, TOP, BOTTOM, PARAM ) \
176 description { state: "default" 0.0;\
191 // LEFT | HERE | RIGHT
192 // ---------------------
194 #define DESC_LRB( LEFT, RIGHT, BOTTOM, PARAM ) \
195 description { state: "default" 0.0;\
211 // ---------------------
212 // LEFT | HERE | RIGHT
213 #define DESC_LRT( LEFT, RIGHT, TOP, PARAM ) \
214 description { state: "default" 0.0;\
230 // ---------------------
232 #define DESC_LT( LEFT, TOP, PARAM ) \
233 description { state: "default" 0.0;\
249 // ---------------------
251 #define DESC_LB( LEFT, BOTTOM, PARAM ) \
252 description { state: "default" 0.0;\
268 // ---------------------
270 // ---------------------
272 #define DESC_LTB( LEFT, TOP, BOTTOM, PARAM ) \
273 description { state: "default" 0.0;\
289 // ---------------------
291 #define DESC_RT( RIGHT, TOP, PARAM ) \
292 description { state: "default" 0.0;\
307 // | HERE <-- | RIGHT
308 // ---------------------
310 #define DESC_RB( RIGHT, BOTTOM, PARAM ) \
311 description { state: "default" 0.0;\
331 #define DESC_TB( TOP, BOTTOM, PARAM ) \
332 description { state: "default" 0.0;\
349 #define DESC_T( TOP, PARAM ) \
350 description { state: "default" 0.0;\
367 #define DESC_B( BOTTOM, PARAM ) \
368 description { state: "default" 0.0;\
381 //****************************************************************************//
382 //******************************* Part Macros ********************************//
383 //****************************************************************************//
384 #define PART(TYPE, NAME, DESCRIPION) \
391 //****************************************************************************//
392 //**************************** Genlist Macros ********************************//
393 //****************************************************************************//
395 #define PROLOG_LIST \
396 data.item: "treesize" 0; \
397 data.item: "flips" "elm.flip.icon elm.flip.content"; \
399 #define PART_LIST_BG \
400 PART(RECT, "bg_clip", \
402 description { state: "default" 0.0; } \
403 description { state: "decorate" 0.0; \
404 inherit: "default" 0.0; \
407 description { state: "reorder" 0.0; \
408 inherit: "default" 0.0; \
411 description { state: "decorate_reorder" 0.0; \
412 inherit: "default" 0.0; \
417 clip_to: "bg_clip"; \
418 description { state: "default" 0.0; \
421 description { state: "selected" 0.0; \
422 inherit: "default" 0.0; \
423 color: LIST_BG_PRESSED_COLOR; \
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; \
434 description { state: "decorate" 0.0; \
435 inherit: "default" 0.0; \
438 description { state: "reorder" 0.0; \
439 inherit: "default" 0.0; \
442 description { state: "decorate_reorder" 0.0; \
443 inherit: "default" 0.0; \
446 description { state: "flipped" 0.0; \
447 inherit: "default" 0.0; \
451 PART(RECT, "bottom_line", \
453 clip_to: "bottom_line_clip"; \
454 description { state: "default" 0.0; \
459 color: LIST_LINE_COLOR; \
460 rel1.offset: -1 -1; \
464 #define PART_LIST_BOTTOMLINE_OFF \
465 PART(RECT, "bottom_line_clip", \
466 description { state: "default" 0.0; \
469 description { state: "hide" 0.0; \
470 inherit: "default" 0.0; \
474 PART(RECT, "bottom_line", \
475 description { state: "default" 0.0; \
480 //**************************** Genlist PADDING *******************************//
481 #define DESC_LIST_PADDINGS \
482 description { state: "decorate" 0.0; \
483 inherit: "default" 0.0; \
487 description { state: "decorate_reorder" 0.0; \
488 inherit: "default" 0.0; \
492 description { state: "reorder" 0.0; \
493 inherit: "default" 0.0; \
498 #define PART_LIST_PADDINGS(LEFT_SIZE, RIGHT_SIZE, TOP_SIZE, BOTTOM_SIZE) \
499 PART(SWALLOW, "elm.swallow.pad", \
503 PART(SWALLOW, "elm.swallow.colorbar", \
505 DESC_L("elm.swallow.pad", ) \
507 PART(SPACER, "elm.padding.left", \
508 DESC_L("elm.swallow.pad", \
513 PART(SPACER, "elm.padding.right", \
516 max: RIGHT_SIZE -1; \
518 description { state: "decorate" 0.0; \
519 inherit: "default" 0.0; \
523 description { state: "decorate_reorder" 0.0; \
524 inherit: "default" 0.0; \
528 description { state: "reorder" 0.0; \
529 inherit: "default" 0.0; \
534 PART(SPACER, "elm.padding.top", \
540 PART(SPACER, "elm.padding.bottom", \
542 min: 0 BOTTOM_SIZE; \
543 max: -1 BOTTOM_SIZE; \
547 //*************************** Genlist Programs ****************************//
548 #define PROGRAM_LIST_DEFAULT( TARGET ) \
549 program { name: "default"; \
550 signal: "elm,state,default"; \
552 action: STATE_SET "default" 0.0; \
556 #define PROGRAM_LIST_DISABLE( TARGET ) \
557 program { name: "enabled"; \
558 signal: "elm,state,enabled"; \
560 action: STATE_SET "default" 0.0; \
563 program { name: "disabled"; \
564 signal: "elm,state,disabled"; \
566 action: STATE_SET "disabled" 0.0; \
570 #define PROGRAM_LIST_SELECT( TARGET ) \
571 program { name: "selected"; \
572 signal: "elm,state,selected"; \
574 action: STATE_SET "selected" 0.0; \
577 program { name: "unselected"; \
578 signal: "elm,state,unselected"; \
580 action: STATE_SET "default" 0.0; \
584 #define PROGRAM_LIST_SOUND \
585 program { name: "play_sound"; \
586 signal: "elm,state,clicked"; \
589 play_sample("touch_sound", 1.0); \
593 #define PROGRAM_LIST_FOCUS \
594 program { name: "focused"; \
595 signal: "elm,state,focused"; \
597 action: STATE_SET "focused" 0.0; \
598 target: "focus_part"; \
600 program { name: "unfocused"; \
601 signal: "elm,state,unfocused"; \
603 action: STATE_SET "default" 0.0; \
604 target: "focus_part"; \
607 #define PROGRAM_LIST_FLIP \
608 program { name: "flip_enabled"; \
609 signal: "elm,state,flip,enabled"; \
611 transition: DECELERATE 0.5; \
612 action: STATE_SET "flipped" 0.0; \
613 target: "elm.flip.content"; \
614 target: "elm.flip.icon"; \
616 program { name: "flip_disabled"; \
617 signal: "elm,state,flip,disabled"; \
619 transition: DECELERATE 0.5; \
620 action: STATE_SET "default" 0.0; \
621 target: "elm.flip.content"; \
622 target: "elm.flip.icon"; \
624 program { name: "flip_enabled_bg"; \
625 signal: "elm,state,flip,enabled"; \
627 action: STATE_SET "flipped" 0.0; \
628 target: "elm.flip.bg"; \
630 program { name: "flip_disabled_bg"; \
631 signal: "elm,state,flip,disabled"; \
633 action: STATE_SET "default" 0.0; \
634 target: "elm.flip.bg"; \
637 #define PROGRAM_LIST_DECORATE( TARGET ) \
638 program { name: "decorate_enabled_effect_ef"; \
639 signal: "elm,state,decorate,enabled,effect";\
641 action: STATE_SET "decorate" 0.0;\
644 program { name: "decorate_disabled_effect_ef";\
645 signal: "elm,state,decorate,disabled,effect";\
647 action: STATE_SET "default" 0.0;\
650 program { name: "decorate_enabled_ef";\
651 signal: "elm,state,decorate,enabled";\
653 action: STATE_SET "decorate" 0.0;\
656 program { name: "decorate_disabled_ef";\
657 signal: "elm,state,decorate,disabled";\
659 action: STATE_SET "default" 0.0;\
663 #define PROGRAM_LIST_DECORATE_FX( TARGET ) \
664 program { name: "decorate_enabled_effect_ef"; \
665 signal: "elm,state,decorate,enabled,effect";\
667 transition: DECELERATE 0.5;\
668 action: STATE_SET "decorate" 0.0;\
671 program { name: "decorate_disabled_effect_ef";\
672 signal: "elm,state,decorate,disabled,effect";\
674 transition: ACCELERATE 0.5;\
675 action: STATE_SET "default" 0.0;\
678 program { name: "decorate_enabled_ef";\
679 signal: "elm,state,decorate,enabled";\
681 action: STATE_SET "decorate" 0.0;\
684 program { name: "decorate_disabled_ef";\
685 signal: "elm,state,decorate,disabled";\
687 action: STATE_SET "default" 0.0;\
691 #define PROGRAM_LIST_BOTTOMLINE \
692 program { name : "hide_bottomline"; \
693 signal: "elm,state,bottomline,hide"; \
695 action: STATE_SET "hide" 0.0; \
696 target: "bottom_line_clip"; \
698 program { name : "show_bottomline"; \
699 signal: "elm,state,bottomline,show"; \
701 action: STATE_SET "default" 0.0; \
702 target: "bottom_line_clip"; \
706 #define PROGRAMS_LIST( TARGET ) \
708 PROGRAM_LIST_DEFAULT( TARGET \
711 target: "bottom_line"; \
712 target: "bottom_line_clip"; \
713 target: "elm.padding.left"; \
714 target: "elm.padding.right"; \
716 PROGRAM_LIST_DISABLE( TARGET \
719 PROGRAM_LIST_SELECT( TARGET \
723 PROGRAM_LIST_DECORATE( \
726 target: "bottom_line"; \
727 target: "bottom_line_clip"; \
728 target: "elm.padding.left"; \
729 target: "elm.padding.right"; \
731 PROGRAM_LIST_BOTTOMLINE \
734 //******************************* Genlist TEXT ********************************//
735 #define PARAM_TEXT(STYLE, PARAM) \
742 #define DESCRIPIONS_TEXT(DISABLED, SELECTED) \
743 description { state: "disabled" 0.0; \
744 inherit: "default" 0.0; \
745 text.style: DISABLED; \
747 description { state: "selected" 0.0; \
748 inherit: "default" 0.0; \
749 text.style: SELECTED; \
752 //******************************* Genlist SWIPE ********************************//
753 #define SWIPE_TRANSIT SIN_FAC 0.667 0.8
755 #define SWIPE_THRESH_X 120
756 #define SWIPE_THRESH_Y 30
758 #define SWIPE_OVERLAP_SIZE 216
759 #define SWIPE_BORDER_SIZE 215
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;
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 \
772 set_int(_state, 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); \
787 #define IMAGES_LIST_SWIPE \
788 image : "00_list_swipe_right.png" COMP; \
789 image : "00_list_swipe_left.png" COMP;
791 #define PARTS_LIST_SWIPE \
792 part { name: "drag_part"; \
800 description { state: "default" 0.0; \
802 rel1.offset: -SWIPE_OVERLAP_SIZE 0; \
803 rel2.offset: SWIPE_OVERLAP_SIZE 0; \
805 description { state: "disable" 0.0; \
806 inherit: "default" 0.0; \
809 description { state: "start_right" 0.0; \
810 inherit: "default" 0.0; \
811 color: SWIPE_COLOR_OTHER; \
813 description { state: "right_end" 0.0; \
814 inherit: "start_right"; \
815 rel1.relative: 1 0; \
817 description { state: "right_rollback" 0.0; \
818 inherit: "start_right" 0.0; \
819 rel1.relative: -1 0; \
822 description { state: "start_left" 0.0; \
823 inherit: "default" 0.0; \
824 color: SWIPE_COLOR_OTHER; \
826 description { state: "left_end" 0.0; \
827 inherit: "start_left" 0.0; \
828 rel2.relative: 0 1; \
830 description { state: "left_rollback" 0.0; \
831 inherit: "start_left" 0.0; \
832 rel2.relative: 2 1; \
836 part { name: "drag_part_left"; \
840 description { state: "default" 0.0; \
848 offset: SWIPE_OVERLAP_SIZE 0; \
851 normal: "00_list_swipe_left.png"; \
852 border: 0 SWIPE_BORDER_SIZE 53 53; \
856 description { state: "start_right" 0.0; \
857 inherit: "default"; \
858 color: SWIPE_COLOR_CALL; \
860 description { state: "start_left" 0.0; \
861 inherit: "default"; \
862 color: SWIPE_COLOR_CALL; \
865 part { name: "drag_part_right"; \
869 description { state: "default" 0.0; \
874 offset: -SWIPE_OVERLAP_SIZE 0; \
880 normal: "00_list_swipe_right.png"; \
881 border: SWIPE_BORDER_SIZE 0 53 53; \
885 description { state: "start_right" 0.0; \
886 inherit: "default"; \
887 color: SWIPE_COLOR_MESSAGE; \
889 description { state: "start_left" 0.0; \
890 inherit: "default"; \
891 color: SWIPE_COLOR_MESSAGE; \
894 part { name: "swipe_temp_disabler"; \
898 description { state: "default" 0.0; \
902 description { state: "enable" 0.0; \
903 inherit: "default"; \
907 part { name: "elm.icon.swipe.left"; \
911 description { state: "default" 0.0; \
914 to_x: "elm.padding.left"; \
918 to_x: "elm.padding.right"; \
926 description { state: "start_left" 0.0; \
927 inherit: "default" 0.0; \
929 color: 250 250 250 255; \
931 description { state: "start_right" 0.0; \
932 inherit: "default" 0.0; \
934 description { state: "right_rollback" 0.0; \
935 inherit: "default" 0.0; \
938 description { state: "left_rollback" 0.0; \
939 inherit: "default" 0.0; \
943 part { name: "elm.icon.swipe.right"; \
947 description { state: "default" 0.0; \
950 to_x: "elm.padding.right"; \
954 to_x: "elm.padding.right"; \
962 description { state: "start_right" 0.0; \
963 inherit: "default" 0.0; \
965 color: 250 250 250 255; \
967 description { state: "start_left" 0.0; \
968 inherit: "default" 0.0; \
970 description { state: "right_rollback" 0.0; \
971 inherit: "default" 0.0; \
974 description { state: "left_rollback" 0.0; \
975 inherit: "default" 0.0; \
979 part { name: "elm.text.swipe.left"; \
983 description { state: "default" 0.0; \
986 to_x: "elm.icon.swipe.left"; \
990 description { state: "start_left" 0.0; \
991 inherit: "default"; \
994 color: LIST_SWIPE_TEXT_COLOR; \
998 font: "Tizen:style=Regular"; \
999 size: LIST_SWIPE_TEXT_SIZE; \
1000 text_class: "list_item"; \
1003 description { state: "start_right" 0.0; \
1004 inherit: "default" 0.0; \
1007 part { name: "elm.text.swipe.right"; \
1011 description { state: "default" 0.0; \
1014 to_x: "elm.icon.swipe.right"; \
1018 description { state: "start_right" 0.0; \
1019 inherit: "default" 0.0; \
1022 color: LIST_SWIPE_TEXT_COLOR; \
1026 font: "Tizen:style=Regular"; \
1027 size: LIST_SWIPE_TEXT_SIZE; \
1028 text_class: "list_item"; \
1032 description { state: "start_left" 0.0; \
1033 inherit: "default" 0.0; \
1037 #define PARTS_LIST_SWIPE_RIGHT \
1038 part { name: "drag_part"; \
1046 description { state: "default" 0.0; \
1048 rel1.offset: -SWIPE_OVERLAP_SIZE 0; \
1049 rel2.offset: SWIPE_OVERLAP_SIZE 0; \
1051 description { state: "disable" 0.0; \
1052 inherit: "default" 0.0; \
1055 description { state: "start_right" 0.0; \
1056 inherit: "default" 0.0; \
1057 color: SWIPE_COLOR_OTHER; \
1059 description { state: "right_end" 0.0; \
1060 inherit: "start_right"; \
1061 rel1.relative: 1 0; \
1063 description { state: "right_rollback" 0.0; \
1064 inherit: "start_right" 0.0; \
1065 rel1.relative: -1 0; \
1069 part { name: "drag_part_left"; \
1073 description { state: "default" 0.0; \
1079 to_x: "drag_part"; \
1081 offset: SWIPE_OVERLAP_SIZE 0; \
1084 normal: "00_list_swipe_left.png"; \
1085 border: 0 SWIPE_BORDER_SIZE 53 53; \
1089 description { state: "start_right" 0.0; \
1090 inherit: "default"; \
1091 color: SWIPE_COLOR_CALL; \
1094 part { name: "drag_part_right"; \
1098 description { state: "default" 0.0; \
1101 to_x: "drag_part"; \
1103 offset: -SWIPE_OVERLAP_SIZE 0; \
1109 normal: "00_list_swipe_right.png"; \
1110 border: SWIPE_BORDER_SIZE 0 53 53; \
1114 description { state: "start_right" 0.0; \
1115 inherit: "default"; \
1116 color: SWIPE_COLOR_OTHER; \
1119 part { name: "swipe_temp_disabler"; \
1123 description { state: "default" 0.0; \
1127 description { state: "enable" 0.0; \
1128 inherit: "default"; \
1132 part { name: "elm.icon.swipe.right"; \
1136 description { state: "default" 0.0; \
1139 to_x: "elm.padding.right"; \
1143 to_x: "elm.padding.right"; \
1151 description { state: "start_right" 0.0; \
1152 inherit: "default" 0.0; \
1154 color: 250 250 250 255; \
1156 description { state: "right_rollback" 0.0; \
1157 inherit: "default" 0.0; \
1161 part { name: "elm.text.swipe.right"; \
1165 description { state: "default" 0.0; \
1168 to_x: "elm.icon.swipe.right"; \
1172 description { state: "start_right" 0.0; \
1173 inherit: "default" 0.0; \
1176 color: LIST_SWIPE_TEXT_COLOR; \
1180 font: "Tizen:style=Regular"; \
1181 size: LIST_SWIPE_TEXT_SIZE; \
1182 text_class: "list_item"; \
1188 #define PROGRAMS_LIST_SWIPE \
1189 program { name: "drag_up"; \
1190 signal: "mouse,up,1"; \
1191 source: "drag_part"; \
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"); \
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"); \
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"); \
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"); \
1224 program { name: "drag_down"; \
1225 signal: "mouse,down,1"; \
1226 source: "drag_part"; \
1230 set_int(_state, 0); \
1235 program { name: "drag"; \
1237 source: "drag_part"; \
1240 get_mouse(x2, y2); \
1241 if (((y2 - get_int(y1)) >= SWIPE_THRESH_Y) || \
1242 ((y2 - get_int(y1)) <= -SWIPE_THRESH_Y)) \
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"); \
1254 } else if (get_int(_state) == -1) { \
1255 if (x2 > get_int(x1)) { \
1256 set_int(_state, 1); \
1257 run_program(PROGRAM:"start_right"); \
1259 } else if (get_int(_state) == 1) { \
1260 if (x2 < get_int(x1)) { \
1261 set_int(_state, -1); \
1262 run_program(PROGRAM:"start_left"); \
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"; \
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"; \
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"; \
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"; \
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"; \
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"; \
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"; \
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"; \
1323 program { name: "right_ender"; \
1325 emit("elm,swipe,stop,right", ""); \
1329 program { name: "left_ender"; \
1331 emit("elm,swipe,stop,left", ""); \
1335 program { name: "rollback_ender"; \
1338 emit("elm,swipe,stop", ""); \
1342 program { name: "swipe_revert"; \
1343 signal: "elm,swipe,revert"; \
1346 if (get_int(_state) != 0) { \
1347 emit("elm,swipe,stop", ""); \
1352 program { name: "swipe_disable"; \
1353 signal: "elm,swipe,disabled"; \
1356 if (get_int(_state) != 0) { \
1357 emit("elm,swipe,stop", ""); \
1360 set_state(PART:"drag_part", "disable", 0.0); \
1363 program { name: "swipe_enable"; \
1364 signal: "elm,swipe,enabled"; \
1367 if (get_int(_state) != 0) { \
1368 emit("elm,swipe,stop", ""); \
1371 set_state(PART:"drag_part", "default", 0.0); \
1374 program { name: "swipe_default"; \
1375 signal: "elm,state,default"; \
1378 run_program(PROGRAM:"swipe_enable"); \
1381 program { name: "swipe_disable_state"; \
1382 signal: "elm,state,disabled"; \
1385 run_program(PROGRAM:"swipe_disable"); \
1389 #define PROGRAMS_LIST_SWIPE_RIGHT \
1390 program { name: "drag_up"; \
1391 signal: "mouse,up,1"; \
1392 source: "drag_part"; \
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"); \
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"); \
1413 program { name: "drag_down"; \
1414 signal: "mouse,down,1"; \
1415 source: "drag_part"; \
1419 set_int(_state, 0); \
1424 program { name: "drag"; \
1426 source: "drag_part"; \
1429 get_mouse(x2, y2); \
1430 if (((y2 - get_int(y1)) >= SWIPE_THRESH_Y) || \
1431 ((y2 - get_int(y1)) <= -SWIPE_THRESH_Y)) \
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"); \
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"; \
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"; \
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"; \
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"; \
1467 program { name: "right_ender"; \
1469 emit("elm,swipe,stop,right", ""); \
1473 program { name: "rollback_ender"; \
1476 emit("elm,swipe,stop", ""); \
1480 program { name: "swipe_revert"; \
1481 signal: "elm,swipe,revert"; \
1484 if (get_int(_state) != 0) { \
1485 emit("elm,swipe,stop", ""); \
1490 program { name: "swipe_disable"; \
1491 signal: "elm,swipe,disabled"; \
1494 if (get_int(_state) != 0) { \
1495 emit("elm,swipe,stop", ""); \
1498 set_state(PART:"drag_part", "disable", 0.0); \
1501 program { name: "swipe_enable"; \
1502 signal: "elm,swipe,enabled"; \
1505 if (get_int(_state) != 0) { \
1506 emit("elm,swipe,stop", ""); \
1509 set_state(PART:"drag_part", "default", 0.0); \
1512 program { name: "swipe_default"; \
1513 signal: "elm,state,default"; \
1516 run_program(PROGRAM:"swipe_enable"); \
1519 program { name: "swipe_disable_state"; \
1520 signal: "elm,state,disabled"; \
1523 run_program(PROGRAM:"swipe_disable"); \
1527 #define SCRIPTS_LIST_SWEEP \
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;\
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;\
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;\
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",)\
1561 description { state: "visible" 0.0;\
1562 inherit: "default" 0.0;\
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;\
1572 PART(SWALLOW, "elm.icon.sweep",\
1574 min: BUTTON_DIVIDER_BTN_SIZE 0;\
1575 max: BUTTON_DIVIDER_BTN_SIZE -1;\
1576 rel1.to: "bg.sweep";\
1577 rel2.to: "bg.sweep";\
1580 description { state: "visible" 0.0;\
1581 inherit: "default" 0.0;\
1585 PART(RECT, "elm.divider.sweep",\
1586 DESC_R("elm.icon.sweep",\
1589 min: 1 LIST_DIVIDER_HEIGHT;\
1590 max: 1 LIST_DIVIDER_HEIGHT;\
1591 color: LIST_DIVIDER_COLOR;\
1593 description { state: "visible" 0.0;\
1594 inherit: "default" 0.0;\
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", \
1604 description { state: "default" 0.0; } \
1605 description { state: "decorate" 0.0; \
1606 inherit: "default" 0.0; \
1609 description { state: "reorder" 0.0; \
1610 inherit: "default" 0.0; \
1613 description { state: "decorate_reorder" 0.0; \
1614 inherit: "default" 0.0; \
1619 clip_to: "bg_clip"; \
1620 description { state: "default" 0.0; \
1623 description { state: "selected" 0.0; \
1624 inherit: "default" 0.0; \
1626 description { state: "disabled" 0.0; \
1627 inherit: "default" 0.0; \
1631 #define PROGRAMS_LIST_SWEEP \
1632 program { name: "sweep_default"; \
1633 signal: "elm,state,default"; \
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";\
1641 program { name: "sweep_right_show";\
1642 signal: "elm,state,sweep,right";\
1645 set_int(dir_right, 1);\
1646 set_state(PART:"bg.sweep", "default", 0.0);\
1647 run_program(PROGRAM:"sweep_show");\
1650 program { name: "sweep_left_show";\
1651 signal: "elm,state,sweep,left";\
1654 set_int(dir_right, 0);\
1655 set_state(PART:"bg.sweep", "default_r", 0.0);\
1656 run_program(PROGRAM:"sweep_show");\
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";\
1667 program { name: "sweep_hide";\
1668 signal: "elm,state,sweep,hide";\
1671 if (get_int(dir_right)) {\
1672 run_program(PROGRAM:"sweep_left_hide");\
1674 run_program(PROGRAM:"sweep_right_hide");\
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";\
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";\