2 * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
22 //****************************************************************************//
23 // ***************** EDJE description have 24 patterns **********************//
24 //**************************************************************************//
28 #define DESC_FROM_L( PARAM ) \
29 description { state: "default" 0.0;\
32 rel2.relative: 0.0 1.0; \
39 #define DESC_FROM_R( PARAM ) \
40 description { state: "default" 0.0;\
52 #define DESC_FROM_T( PARAM ) \
53 description { state: "default" 0.0;\
56 rel2.relative: 1.0 0.0; \
65 #define DESC_FROM_B( PARAM ) \
66 description { state: "default" 0.0;\
68 rel1.relative: 0.0 1.0; \
76 #define DESC_TO( PART, PARAM ) \
77 description { state: "default" 0.0;\
90 // ---------------------
91 // LEFT | HERE | RIGHT
92 // ---------------------
94 #define DESC_LRTB( LEFT, RIGHT, TOP, BOTTOM, PARAM ) \
95 description { state: "default" 0.0;\
109 // ---------------------
111 // ---------------------
112 #define DESC_L( LEFT, PARAM ) \
113 description { state: "default" 0.0;\
127 // ---------------------
129 // ---------------------
130 #define DESC_R( RIGHT, PARAM ) \
131 description { state: "default" 0.0;\
145 // --------------------------
146 // LEFT |--> HERE <--| RIGHT
147 // --------------------------
148 #define DESC_LR( LEFT, RIGHT, PARAM ) \
149 description { state: "default" 0.0;\
166 #define DESC_RTB( RIGHT, TOP, BOTTOM, PARAM ) \
167 description { state: "default" 0.0;\
182 // LEFT | HERE | RIGHT
183 // ---------------------
185 #define DESC_LRB( LEFT, RIGHT, BOTTOM, PARAM ) \
186 description { state: "default" 0.0;\
202 // ---------------------
203 // LEFT | HERE | RIGHT
204 #define DESC_LRT( LEFT, RIGHT, TOP, PARAM ) \
205 description { state: "default" 0.0;\
221 // ---------------------
223 #define DESC_LT( LEFT, TOP, PARAM ) \
224 description { state: "default" 0.0;\
240 // ---------------------
242 #define DESC_LB( LEFT, BOTTOM, PARAM ) \
243 description { state: "default" 0.0;\
259 // ---------------------
261 // ---------------------
263 #define DESC_LTB( LEFT, TOP, BOTTOM, PARAM ) \
264 description { state: "default" 0.0;\
280 // ---------------------
282 #define DESC_RT( RIGHT, TOP, PARAM ) \
283 description { state: "default" 0.0;\
298 // | HERE <-- | RIGHT
299 // ---------------------
301 #define DESC_RB( RIGHT, BOTTOM, PARAM ) \
302 description { state: "default" 0.0;\
322 #define DESC_TB( TOP, BOTTOM, PARAM ) \
323 description { state: "default" 0.0;\
340 #define DESC_T( TOP, PARAM ) \
341 description { state: "default" 0.0;\
358 #define DESC_B( BOTTOM, PARAM ) \
359 description { state: "default" 0.0;\
372 //****************************************************************************//
373 //******************************* Part Macros ********************************//
374 //****************************************************************************//
375 #define PART(TYPE, NAME, DESCRIPION) \
382 //****************************************************************************//
383 //**************************** Genlist Macros ********************************//
384 //****************************************************************************//
386 #define PROLOG_LIST \
387 data.item: "treesize" 0; \
388 data.item: "flips" "elm.flip.icon elm.flip.content"; \
390 #define PART_LIST_BG \
391 PART(RECT, "bg_clip", \
393 description { state: "default" 0.0; } \
394 description { state: "decorate" 0.0; \
395 inherit: "default" 0.0; \
398 description { state: "reorder" 0.0; \
399 inherit: "default" 0.0; \
402 description { state: "decorate_reorder" 0.0; \
403 inherit: "default" 0.0; \
408 clip_to: "bg_clip"; \
409 description { state: "default" 0.0; \
412 description { state: "selected" 0.0; \
413 inherit: "default" 0.0; \
414 color: LIST_BG_PRESSED_COLOR; \
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; \
425 description { state: "decorate" 0.0; \
426 inherit: "default" 0.0; \
429 description { state: "reorder" 0.0; \
430 inherit: "default" 0.0; \
433 description { state: "decorate_reorder" 0.0; \
434 inherit: "default" 0.0; \
437 description { state: "flipped" 0.0; \
438 inherit: "default" 0.0; \
442 PART(RECT, "bottom_line", \
444 clip_to: "bottom_line_clip"; \
445 description { state: "default" 0.0; \
450 color: LIST_LINE_COLOR; \
451 rel1.offset: -1 -1; \
455 #define PART_LIST_BOTTOMLINE_OFF \
456 PART(RECT, "bottom_line_clip", \
457 description { state: "default" 0.0; \
460 description { state: "hide" 0.0; \
461 inherit: "default" 0.0; \
465 PART(RECT, "bottom_line", \
466 description { state: "default" 0.0; \
471 //**************************** Genlist PADDING *******************************//
472 #define DESC_LIST_PADDINGS \
473 description { state: "decorate" 0.0; \
474 inherit: "default" 0.0; \
478 description { state: "decorate_reorder" 0.0; \
479 inherit: "default" 0.0; \
483 description { state: "reorder" 0.0; \
484 inherit: "default" 0.0; \
489 #define PART_LIST_PADDINGS(LEFT_SIZE, RIGHT_SIZE, TOP_SIZE, BOTTOM_SIZE) \
490 PART(SWALLOW, "elm.swallow.pad", \
494 PART(SWALLOW, "elm.swallow.colorbar", \
496 DESC_L("elm.swallow.pad", ) \
498 PART(SPACER, "elm.padding.left", \
499 DESC_L("elm.swallow.pad", \
504 PART(SPACER, "elm.padding.right", \
507 max: RIGHT_SIZE -1; \
509 description { state: "decorate" 0.0; \
510 inherit: "default" 0.0; \
514 description { state: "decorate_reorder" 0.0; \
515 inherit: "default" 0.0; \
519 description { state: "reorder" 0.0; \
520 inherit: "default" 0.0; \
525 PART(SPACER, "elm.padding.top", \
531 PART(SPACER, "elm.padding.bottom", \
533 min: 0 BOTTOM_SIZE; \
534 max: -1 BOTTOM_SIZE; \
538 //*************************** Genlist Programs ****************************//
539 #define PROGRAM_LIST_DEFAULT( TARGET ) \
540 program { name: "default"; \
541 signal: "elm,state,default"; \
543 action: STATE_SET "default" 0.0; \
547 #define PROGRAM_LIST_DISABLE( TARGET ) \
548 program { name: "enabled"; \
549 signal: "elm,state,enabled"; \
551 action: STATE_SET "default" 0.0; \
554 program { name: "disabled"; \
555 signal: "elm,state,disabled"; \
557 action: STATE_SET "disabled" 0.0; \
561 #define PROGRAM_LIST_SELECT( TARGET ) \
562 program { name: "selected"; \
563 signal: "elm,state,selected"; \
565 action: STATE_SET "selected" 0.0; \
568 program { name: "unselected"; \
569 signal: "elm,state,unselected"; \
571 action: STATE_SET "default" 0.0; \
575 #define PROGRAM_LIST_SOUND \
576 program { name: "play_sound"; \
577 signal: "elm,state,clicked"; \
580 play_sample("touch_sound", 1.0); \
584 #define PROGRAM_LIST_FOCUS \
585 program { name: "focused"; \
586 signal: "elm,state,focused"; \
588 action: STATE_SET "focused" 0.0; \
589 target: "focus_part"; \
591 program { name: "unfocused"; \
592 signal: "elm,state,unfocused"; \
594 action: STATE_SET "default" 0.0; \
595 target: "focus_part"; \
598 #define PROGRAM_LIST_FLIP \
599 program { name: "flip_enabled"; \
600 signal: "elm,state,flip,enabled"; \
602 transition: DECELERATE 0.5; \
603 action: STATE_SET "flipped" 0.0; \
604 target: "elm.flip.content"; \
605 target: "elm.flip.icon"; \
607 program { name: "flip_disabled"; \
608 signal: "elm,state,flip,disabled"; \
610 transition: DECELERATE 0.5; \
611 action: STATE_SET "default" 0.0; \
612 target: "elm.flip.content"; \
613 target: "elm.flip.icon"; \
615 program { name: "flip_enabled_bg"; \
616 signal: "elm,state,flip,enabled"; \
618 action: STATE_SET "flipped" 0.0; \
619 target: "elm.flip.bg"; \
621 program { name: "flip_disabled_bg"; \
622 signal: "elm,state,flip,disabled"; \
624 action: STATE_SET "default" 0.0; \
625 target: "elm.flip.bg"; \
628 #define PROGRAM_LIST_DECORATE( TARGET ) \
629 program { name: "decorate_enabled_effect_ef"; \
630 signal: "elm,state,decorate,enabled,effect";\
632 action: STATE_SET "decorate" 0.0;\
635 program { name: "decorate_disabled_effect_ef";\
636 signal: "elm,state,decorate,disabled,effect";\
638 action: STATE_SET "default" 0.0;\
641 program { name: "decorate_enabled_ef";\
642 signal: "elm,state,decorate,enabled";\
644 action: STATE_SET "decorate" 0.0;\
647 program { name: "decorate_disabled_ef";\
648 signal: "elm,state,decorate,disabled";\
650 action: STATE_SET "default" 0.0;\
654 #define PROGRAM_LIST_DECORATE_FX( TARGET ) \
655 program { name: "decorate_enabled_effect_ef"; \
656 signal: "elm,state,decorate,enabled,effect";\
658 transition: DECELERATE 0.5;\
659 action: STATE_SET "decorate" 0.0;\
662 program { name: "decorate_disabled_effect_ef";\
663 signal: "elm,state,decorate,disabled,effect";\
665 transition: ACCELERATE 0.5;\
666 action: STATE_SET "default" 0.0;\
669 program { name: "decorate_enabled_ef";\
670 signal: "elm,state,decorate,enabled";\
672 action: STATE_SET "decorate" 0.0;\
675 program { name: "decorate_disabled_ef";\
676 signal: "elm,state,decorate,disabled";\
678 action: STATE_SET "default" 0.0;\
682 #define PROGRAM_LIST_BOTTOMLINE \
683 program { name : "hide_bottomline"; \
684 signal: "elm,state,bottomline,hide"; \
686 action: STATE_SET "hide" 0.0; \
687 target: "bottom_line_clip"; \
689 program { name : "show_bottomline"; \
690 signal: "elm,state,bottomline,show"; \
692 action: STATE_SET "default" 0.0; \
693 target: "bottom_line_clip"; \
697 #define PROGRAMS_LIST( TARGET ) \
699 PROGRAM_LIST_DEFAULT( TARGET \
702 target: "bottom_line"; \
703 target: "bottom_line_clip"; \
704 target: "elm.padding.left"; \
705 target: "elm.padding.right"; \
707 PROGRAM_LIST_DISABLE( TARGET \
710 PROGRAM_LIST_SELECT( TARGET \
714 PROGRAM_LIST_DECORATE( \
717 target: "bottom_line"; \
718 target: "bottom_line_clip"; \
719 target: "elm.padding.left"; \
720 target: "elm.padding.right"; \
722 PROGRAM_LIST_BOTTOMLINE \
725 //******************************* Genlist TEXT ********************************//
726 #define PARAM_TEXT(STYLE, PARAM) \
733 #define DESCRIPIONS_TEXT(DISABLED, SELECTED) \
734 description { state: "disabled" 0.0; \
735 inherit: "default" 0.0; \
736 text.style: DISABLED; \
738 description { state: "selected" 0.0; \
739 inherit: "default" 0.0; \
740 text.style: SELECTED; \
743 //******************************* Genlist SWIPE ********************************//
744 #define SWIPE_TRANSIT SIN_FAC 0.667 0.8
746 #define SWIPE_THRESH_X 120
747 #define SWIPE_THRESH_Y 30
749 #define SWIPE_OVERLAP_SIZE 216
750 #define SWIPE_BORDER_SIZE 215
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;
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 \
763 set_int(_state, 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); \
778 #define IMAGES_LIST_SWIPE \
779 image : "00_list_swipe_right.png" COMP; \
780 image : "00_list_swipe_left.png" COMP;
782 #define PARTS_LIST_SWIPE \
783 part { name: "drag_part"; \
791 description { state: "default" 0.0; \
793 rel1.offset: -SWIPE_OVERLAP_SIZE 0; \
794 rel2.offset: SWIPE_OVERLAP_SIZE 0; \
796 description { state: "disable" 0.0; \
797 inherit: "default" 0.0; \
800 description { state: "start_right" 0.0; \
801 inherit: "default" 0.0; \
802 color: SWIPE_COLOR_OTHER; \
804 description { state: "right_end" 0.0; \
805 inherit: "start_right"; \
806 rel1.relative: 1 0; \
808 description { state: "right_rollback" 0.0; \
809 inherit: "start_right" 0.0; \
810 rel1.relative: -1 0; \
813 description { state: "start_left" 0.0; \
814 inherit: "default" 0.0; \
815 color: SWIPE_COLOR_OTHER; \
817 description { state: "left_end" 0.0; \
818 inherit: "start_left" 0.0; \
819 rel2.relative: 0 1; \
821 description { state: "left_rollback" 0.0; \
822 inherit: "start_left" 0.0; \
823 rel2.relative: 2 1; \
827 part { name: "drag_part_left"; \
831 description { state: "default" 0.0; \
839 offset: SWIPE_OVERLAP_SIZE 0; \
842 normal: "00_list_swipe_left.png"; \
843 border: 0 SWIPE_BORDER_SIZE 53 53; \
847 description { state: "start_right" 0.0; \
848 inherit: "default"; \
849 color: SWIPE_COLOR_CALL; \
851 description { state: "start_left" 0.0; \
852 inherit: "default"; \
853 color: SWIPE_COLOR_CALL; \
856 part { name: "drag_part_right"; \
860 description { state: "default" 0.0; \
865 offset: -SWIPE_OVERLAP_SIZE 0; \
871 normal: "00_list_swipe_right.png"; \
872 border: SWIPE_BORDER_SIZE 0 53 53; \
876 description { state: "start_right" 0.0; \
877 inherit: "default"; \
878 color: SWIPE_COLOR_MESSAGE; \
880 description { state: "start_left" 0.0; \
881 inherit: "default"; \
882 color: SWIPE_COLOR_MESSAGE; \
885 part { name: "swipe_temp_disabler"; \
889 description { state: "default" 0.0; \
893 description { state: "enable" 0.0; \
894 inherit: "default"; \
898 part { name: "elm.icon.swipe.left"; \
902 description { state: "default" 0.0; \
905 to_x: "elm.padding.left"; \
909 to_x: "elm.padding.right"; \
917 description { state: "start_left" 0.0; \
918 inherit: "default" 0.0; \
920 color: 250 250 250 255; \
922 description { state: "start_right" 0.0; \
923 inherit: "default" 0.0; \
925 description { state: "right_rollback" 0.0; \
926 inherit: "default" 0.0; \
929 description { state: "left_rollback" 0.0; \
930 inherit: "default" 0.0; \
934 part { name: "elm.icon.swipe.right"; \
938 description { state: "default" 0.0; \
941 to_x: "elm.padding.right"; \
945 to_x: "elm.padding.right"; \
953 description { state: "start_right" 0.0; \
954 inherit: "default" 0.0; \
956 color: 250 250 250 255; \
958 description { state: "start_left" 0.0; \
959 inherit: "default" 0.0; \
961 description { state: "right_rollback" 0.0; \
962 inherit: "default" 0.0; \
965 description { state: "left_rollback" 0.0; \
966 inherit: "default" 0.0; \
970 part { name: "elm.text.swipe.left"; \
974 description { state: "default" 0.0; \
977 to_x: "elm.icon.swipe.left"; \
981 description { state: "start_left" 0.0; \
982 inherit: "default"; \
985 color: LIST_SWIPE_TEXT_COLOR; \
989 font: "Tizen:style=Regular"; \
990 size: LIST_SWIPE_TEXT_SIZE; \
991 text_class: "list_item"; \
994 description { state: "start_right" 0.0; \
995 inherit: "default" 0.0; \
998 part { name: "elm.text.swipe.right"; \
1002 description { state: "default" 0.0; \
1005 to_x: "elm.icon.swipe.right"; \
1009 description { state: "start_right" 0.0; \
1010 inherit: "default" 0.0; \
1013 color: LIST_SWIPE_TEXT_COLOR; \
1017 font: "Tizen:style=Regular"; \
1018 size: LIST_SWIPE_TEXT_SIZE; \
1019 text_class: "list_item"; \
1023 description { state: "start_left" 0.0; \
1024 inherit: "default" 0.0; \
1028 #define PARTS_LIST_SWIPE_RIGHT \
1029 part { name: "drag_part"; \
1037 description { state: "default" 0.0; \
1039 rel1.offset: -SWIPE_OVERLAP_SIZE 0; \
1040 rel2.offset: SWIPE_OVERLAP_SIZE 0; \
1042 description { state: "disable" 0.0; \
1043 inherit: "default" 0.0; \
1046 description { state: "start_right" 0.0; \
1047 inherit: "default" 0.0; \
1048 color: SWIPE_COLOR_OTHER; \
1050 description { state: "right_end" 0.0; \
1051 inherit: "start_right"; \
1052 rel1.relative: 1 0; \
1054 description { state: "right_rollback" 0.0; \
1055 inherit: "start_right" 0.0; \
1056 rel1.relative: -1 0; \
1060 part { name: "drag_part_left"; \
1064 description { state: "default" 0.0; \
1070 to_x: "drag_part"; \
1072 offset: SWIPE_OVERLAP_SIZE 0; \
1075 normal: "00_list_swipe_left.png"; \
1076 border: 0 SWIPE_BORDER_SIZE 53 53; \
1080 description { state: "start_right" 0.0; \
1081 inherit: "default"; \
1082 color: SWIPE_COLOR_CALL; \
1085 part { name: "drag_part_right"; \
1089 description { state: "default" 0.0; \
1092 to_x: "drag_part"; \
1094 offset: -SWIPE_OVERLAP_SIZE 0; \
1100 normal: "00_list_swipe_right.png"; \
1101 border: SWIPE_BORDER_SIZE 0 53 53; \
1105 description { state: "start_right" 0.0; \
1106 inherit: "default"; \
1107 color: SWIPE_COLOR_OTHER; \
1110 part { name: "swipe_temp_disabler"; \
1114 description { state: "default" 0.0; \
1118 description { state: "enable" 0.0; \
1119 inherit: "default"; \
1123 part { name: "elm.icon.swipe.right"; \
1127 description { state: "default" 0.0; \
1130 to_x: "elm.padding.right"; \
1134 to_x: "elm.padding.right"; \
1142 description { state: "start_right" 0.0; \
1143 inherit: "default" 0.0; \
1145 color: 250 250 250 255; \
1147 description { state: "right_rollback" 0.0; \
1148 inherit: "default" 0.0; \
1152 part { name: "elm.text.swipe.right"; \
1156 description { state: "default" 0.0; \
1159 to_x: "elm.icon.swipe.right"; \
1163 description { state: "start_right" 0.0; \
1164 inherit: "default" 0.0; \
1167 color: LIST_SWIPE_TEXT_COLOR; \
1171 font: "Tizen:style=Regular"; \
1172 size: LIST_SWIPE_TEXT_SIZE; \
1173 text_class: "list_item"; \
1179 #define PROGRAMS_LIST_SWIPE \
1180 program { name: "drag_up"; \
1181 signal: "mouse,up,1"; \
1182 source: "drag_part"; \
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"); \
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"); \
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"); \
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"); \
1215 program { name: "drag_down"; \
1216 signal: "mouse,down,1"; \
1217 source: "drag_part"; \
1221 set_int(_state, 0); \
1226 program { name: "drag"; \
1228 source: "drag_part"; \
1231 get_mouse(x2, y2); \
1232 if (((y2 - get_int(y1)) >= SWIPE_THRESH_Y) || \
1233 ((y2 - get_int(y1)) <= -SWIPE_THRESH_Y)) \
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"); \
1245 } else if (get_int(_state) == -1) { \
1246 if (x2 > get_int(x1)) { \
1247 set_int(_state, 1); \
1248 run_program(PROGRAM:"start_right"); \
1250 } else if (get_int(_state) == 1) { \
1251 if (x2 < get_int(x1)) { \
1252 set_int(_state, -1); \
1253 run_program(PROGRAM:"start_left"); \
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"; \
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"; \
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"; \
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"; \
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"; \
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"; \
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"; \
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"; \
1314 program { name: "right_ender"; \
1316 emit("elm,swipe,stop,right", ""); \
1320 program { name: "left_ender"; \
1322 emit("elm,swipe,stop,left", ""); \
1326 program { name: "rollback_ender"; \
1329 emit("elm,swipe,stop", ""); \
1333 program { name: "swipe_revert"; \
1334 signal: "elm,swipe,revert"; \
1337 if (get_int(_state) != 0) { \
1338 emit("elm,swipe,stop", ""); \
1343 program { name: "swipe_disable"; \
1344 signal: "elm,swipe,disabled"; \
1347 if (get_int(_state) != 0) { \
1348 emit("elm,swipe,stop", ""); \
1351 set_state(PART:"drag_part", "disable", 0.0); \
1354 program { name: "swipe_enable"; \
1355 signal: "elm,swipe,enabled"; \
1358 if (get_int(_state) != 0) { \
1359 emit("elm,swipe,stop", ""); \
1362 set_state(PART:"drag_part", "default", 0.0); \
1365 program { name: "swipe_default"; \
1366 signal: "elm,state,default"; \
1369 run_program(PROGRAM:"swipe_enable"); \
1372 program { name: "swipe_disable_state"; \
1373 signal: "elm,state,disabled"; \
1376 run_program(PROGRAM:"swipe_disable"); \
1380 #define PROGRAMS_LIST_SWIPE_RIGHT \
1381 program { name: "drag_up"; \
1382 signal: "mouse,up,1"; \
1383 source: "drag_part"; \
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"); \
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"); \
1404 program { name: "drag_down"; \
1405 signal: "mouse,down,1"; \
1406 source: "drag_part"; \
1410 set_int(_state, 0); \
1415 program { name: "drag"; \
1417 source: "drag_part"; \
1420 get_mouse(x2, y2); \
1421 if (((y2 - get_int(y1)) >= SWIPE_THRESH_Y) || \
1422 ((y2 - get_int(y1)) <= -SWIPE_THRESH_Y)) \
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"); \
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"; \
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"; \
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"; \
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"; \
1458 program { name: "right_ender"; \
1460 emit("elm,swipe,stop,right", ""); \
1464 program { name: "rollback_ender"; \
1467 emit("elm,swipe,stop", ""); \
1471 program { name: "swipe_revert"; \
1472 signal: "elm,swipe,revert"; \
1475 if (get_int(_state) != 0) { \
1476 emit("elm,swipe,stop", ""); \
1481 program { name: "swipe_disable"; \
1482 signal: "elm,swipe,disabled"; \
1485 if (get_int(_state) != 0) { \
1486 emit("elm,swipe,stop", ""); \
1489 set_state(PART:"drag_part", "disable", 0.0); \
1492 program { name: "swipe_enable"; \
1493 signal: "elm,swipe,enabled"; \
1496 if (get_int(_state) != 0) { \
1497 emit("elm,swipe,stop", ""); \
1500 set_state(PART:"drag_part", "default", 0.0); \
1503 program { name: "swipe_default"; \
1504 signal: "elm,state,default"; \
1507 run_program(PROGRAM:"swipe_enable"); \
1510 program { name: "swipe_disable_state"; \
1511 signal: "elm,state,disabled"; \
1514 run_program(PROGRAM:"swipe_disable"); \
1518 #define SCRIPTS_LIST_SWEEP \
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;\
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;\
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;\
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",)\
1552 description { state: "visible" 0.0;\
1553 inherit: "default" 0.0;\
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;\
1563 PART(SWALLOW, "elm.icon.sweep",\
1565 min: BUTTON_DIVIDER_BTN_SIZE 0;\
1566 max: BUTTON_DIVIDER_BTN_SIZE -1;\
1567 rel1.to: "bg.sweep";\
1568 rel2.to: "bg.sweep";\
1571 description { state: "visible" 0.0;\
1572 inherit: "default" 0.0;\
1576 PART(RECT, "elm.divider.sweep",\
1577 DESC_R("elm.icon.sweep",\
1580 min: 1 LIST_DIVIDER_HEIGHT;\
1581 max: 1 LIST_DIVIDER_HEIGHT;\
1582 color: LIST_DIVIDER_COLOR;\
1584 description { state: "visible" 0.0;\
1585 inherit: "default" 0.0;\
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", \
1595 description { state: "default" 0.0; } \
1596 description { state: "decorate" 0.0; \
1597 inherit: "default" 0.0; \
1600 description { state: "reorder" 0.0; \
1601 inherit: "default" 0.0; \
1604 description { state: "decorate_reorder" 0.0; \
1605 inherit: "default" 0.0; \
1610 clip_to: "bg_clip"; \
1611 description { state: "default" 0.0; \
1614 description { state: "selected" 0.0; \
1615 inherit: "default" 0.0; \
1617 description { state: "disabled" 0.0; \
1618 inherit: "default" 0.0; \
1622 #define PROGRAMS_LIST_SWEEP \
1623 program { name: "sweep_default"; \
1624 signal: "elm,state,default"; \
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";\
1632 program { name: "sweep_right_show";\
1633 signal: "elm,state,sweep,right";\
1636 set_int(dir_right, 1);\
1637 set_state(PART:"bg.sweep", "default", 0.0);\
1638 run_program(PROGRAM:"sweep_show");\
1641 program { name: "sweep_left_show";\
1642 signal: "elm,state,sweep,left";\
1645 set_int(dir_right, 0);\
1646 set_state(PART:"bg.sweep", "default_r", 0.0);\
1647 run_program(PROGRAM:"sweep_show");\
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";\
1658 program { name: "sweep_hide";\
1659 signal: "elm,state,sweep,hide";\
1662 if (get_int(dir_right)) {\
1663 run_program(PROGRAM:"sweep_left_hide");\
1665 run_program(PROGRAM:"sweep_right_hide");\
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";\
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";\