3 * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 * Licensed under the Apache License, Version 2.0 (the License);
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an AS IS BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
20 #define CHECK_STATE_DEFAULT 0
21 #define CHECK_STATE_VISIBLE 1
22 #define CHECK_STATE_DISABLED_VISIBLE 2
23 #define CHECK_STATE_DISABLED 3
27 ////////////////////////////////////////////////////////////////////////////////
28 #define CHECK_STYLE_DEFAULT(style_name, min_width, min_height) \
29 group { name: "elm/check/base/"style_name; \
31 image: "00_check_bg.png" COMP; \
32 image: "00_check_dim_bg.png" COMP; \
33 image: "00_check_dim.png" COMP; \
34 image: "00_check_Activated.png" COMP; \
35 image: "00_check_press_bg.png" COMP; \
36 image: "00_check_press.png" COMP; \
39 public check_state = CHECK_STATE_DEFAULT; \
40 public check_visible = CHECK_HIDE; \
43 part { name: "back_bg"; \
46 description { state: "default" 0.0; \
47 rel2.relative: 0.0 1.0; \
49 min: min_width min_height; \
57 description { state: "default" 0.0; \
58 min: CHECK_STYLE_DEFAULT_BG_NORMAL_MIN_MAX_INC; \
59 max: CHECK_STYLE_DEFAULT_BG_NORMAL_MIN_MAX_INC; \
63 image.normal: "00_check_bg.png"; \
66 description { state: "visible" 0.0; \
67 inherit: "default" 0.0; \
69 description { state: "pressed" 0.0; \
70 inherit: "default" 0.0; \
71 image.normal: "00_check_press_bg.png"; \
73 description { state: "disabled" 0.0; \
74 inherit: "default" 0.0; \
75 image.normal: "00_check_dim_bg.png"; \
78 part { name: "check"; \
79 clip_to: "sequence_clip"; \
82 description { state: "default" 0.0; \
86 image.normal: "00_check_Activated.png"; \
87 color: 255 255 255 0; \
89 description { state: "visible" 0.0; \
90 inherit: "default" 0.0; \
92 color: 255 255 255 255; \
94 description { state: "disabled_visible" 0.0; \
95 inherit: "default" 0.0; \
97 image.normal: "00_check_dim.png"; \
98 color: 255 255 255 255; \
100 description { state: "pressed" 0.0; \
101 inherit: "default" 0.0; \
103 image.normal: "00_check_press.png"; \
104 color: 255 255 255 255; \
107 part { name: "sequence_clip"; \
110 description { state: "default" 0.0; \
111 rel2.relative: 0.0 1.0; \
112 color: 255 255 255 255; \
114 description { state: "visible" 0.0; \
115 inherit: "default" 0.0; \
116 rel2.relative: 1.0 1.0; \
119 part { name: "elm.swallow.content"; \
121 clip_to: "disclip"; \
122 description { state: "default" 0.0; \
137 description { state: "visible" 0.0; \
138 inherit: "default" 0.0; \
142 aspect_preference: VERTICAL; \
144 description { state: "disabled" 0.0; \
145 inherit: "default" 0.0; \
147 description { state: "disabled_visible" 0.0; \
148 inherit: "default" 0.0; \
154 part { name: "elm.text"; \
157 clip_to: "disclip"; \
159 description { state: "default" 0.0; \
165 to_x: "elm.swallow.content"; \
173 style: "check_label_textblock_style"; \
176 color: CHECK_DEFAULT_TEXT_NORMAL_COLOR_INC; \
178 description { state: "visible" 0.0; \
179 inherit: "default" 0.0; \
183 description { state: "disabled" 0.0; \
184 inherit: "default" 0.0; \
186 description { state: "disabled_visible" 0.0; \
187 inherit: "default" 0.0; \
190 color: CHECK_DEFAULT_TEXT_DISABLED_COLOR_INC; \
193 part { name: "events1"; \
195 ignore_flags: ON_HOLD; \
196 description { state: "default" 0.0; \
200 part { name: "events2"; \
203 description { state: "default" 0.0; \
207 part { name: "disclip"; \
210 description { state: "default" 0.0; \
211 color: CHECK_DISCLIP_NORMAL_COLOR_INC; \
213 description { state: "disabled" 0.0; \
214 inherit: "default" 0.0; \
215 color: CHECK_DISCLIP_DISABLED_COLOR_INC; \
218 part { name: "disabler"; \
220 description { state: "default" 0.0; \
224 description { state: "disabled" 0.0; \
225 inherit: "default" 0.0; \
231 program { name: "show"; \
234 set_int(check_visible, CHECK_SHOW); \
237 program { name: "hide"; \
240 set_int(check_visible, CHECK_HIDE); \
243 program { name: "click"; \
244 signal: "mouse,clicked,1"; \
246 action: SIGNAL_EMIT "elm,action,check,toggle" ""; \
247 after: "touch_sound"; \
249 program { name: "touch_sound"; \
250 action: PLAY_SAMPLE "touch_sound" 1.0; \
252 program { name: "bg_normal"; \
253 signal: "mouse,up,1"; \
255 action: STATE_SET "default" 0.0; \
259 program { name: "pressed"; \
260 signal: "mouse,down,1"; \
262 action: STATE_SET "pressed" 0.0; \
266 program { name: "mouse,out"; \
267 signal: "mouse,out"; \
270 if (get_int(check_state) == CHECK_STATE_VISIBLE) \
272 set_state(PART:"check", "visible", 0.0); \
273 set_state(PART:"sequence_clip", "visible", 0.0); \
277 set_state(PART:"check", "default", 0.0); \
278 set_state(PART:"sequence_clip", "default", 0.0); \
282 program { name: "check_on"; \
283 signal: "elm,state,check,on"; \
286 set_int(check_state, CHECK_STATE_VISIBLE); \
287 if (get_int(check_visible) == CHECK_SHOW) \
289 run_program(PROGRAM:"check_show_effect"); \
290 run_program(PROGRAM:"check_draw_effect"); \
294 set_state(PART:"check", "visible", 0.0); \
295 set_state(PART:"sequence_clip", "visible", 0.0); \
299 program { name: "check_off"; \
300 signal: "elm,state,check,off"; \
302 action: STATE_SET "default" 0.0; \
305 if (get_int(check_state) == CHECK_STATE_VISIBLE) \
307 set_int(check_state, CHECK_STATE_DEFAULT); \
308 set_state(PART:"check", "default", 0.0); \
309 set_state(PART:"sequence_clip", "default", 0.0); \
313 program { name: "check_show_effect"; \
314 action: STATE_SET "visible" 0.0; \
315 transition: LINEAR 0.233; \
318 program { name: "check_draw_effect"; \
319 action: STATE_SET "visible" 0.0; \
320 transition: LINEAR 0.267; \
321 target: "sequence_clip"; \
323 program { name: "text_show"; \
324 signal: "elm,state,text,visible"; \
326 action: STATE_SET "visible" 0.0; \
327 target: "elm.text"; \
329 program { name: "text_hide"; \
330 signal: "elm,state,text,hidden"; \
332 action: STATE_SET "default" 0.0; \
333 target: "elm.text"; \
335 program { name: "icon_show"; \
336 signal: "elm,state,icon,visible"; \
338 action: STATE_SET "visible" 0.0; \
339 target: "elm.swallow.content"; \
341 program { name: "icon_hide"; \
342 signal: "elm,state,icon,hidden"; \
344 action: STATE_SET "default" 0.0; \
345 target: "elm.swallow.content"; \
347 program { name: "disable"; \
348 signal: "elm,state,disabled"; \
350 action: STATE_SET "disabled" 0.0; \
351 target: "disabler"; \
354 after: "disable_text"; \
356 program { name: "disable_text"; \
360 get_state(PART:"elm.text", st, 30, vl); \
361 if (!strcmp(st, "visible")) \
362 set_state(PART:"elm.text", "disabled_visible", 0.0); \
364 set_state(PART:"elm.text", "disabled", 0.0); \
365 get_state(PART:"elm.swallow.content", st, 30, vl); \
366 if (!strcmp(st, "visible")) \
367 set_state(PART:"elm.swallow.content", "disabled_visible", 0.0); \
369 set_state(PART:"elm.swallow.content", "disabled", 0.0); \
370 get_state(PART:"check", st, 30, vl); \
371 if (!strcmp(st, "visible")) \
373 set_state(PART:"check", "disabled_visible", 0.0); \
374 set_int(check_state, CHECK_STATE_DISABLED_VISIBLE); \
378 program { name: "enable"; \
379 signal: "elm,state,enabled"; \
381 action: STATE_SET "default" 0.0; \
382 target: "disabler"; \
385 after: "enable_text"; \
387 program { name: "enable_text"; \
391 get_state(PART:"elm.text", st, 30, vl); \
392 if (!strcmp(st, "disabled_visible")) \
393 set_state(PART:"elm.text", "visible", 0.0); \
395 set_state(PART:"elm.text", "default", 0.0); \
396 get_state(PART:"elm.swallow.content", st, 30, vl); \
397 if (!strcmp(st, "visible")) \
398 set_state(PART:"elm.swallow.content", "visible", 0.0); \
400 set_state(PART:"elm.swallow.content", "default", 0.0); \
401 get_state(PART:"check", st, 30, vl); \
402 if (!strcmp(st, "disabled_visible")) \
404 set_state(PART:"check", "visible", 0.0); \
405 set_state(PART:"sequence_clip", "visible", 0.0); \
406 set_int(check_state, CHECK_STATE_VISIBLE); \
409 set_int(check_state, CHECK_STATE_DEFAULT); \
414 ////////////////////////////////////////////////////////////////////////////////
415 CHECK_STYLE_DEFAULT("default", CHECK_STYLE_DEFAULT_DEFAULT_BG_IMAGE_MIN_WIDTH_INC, CHECK_STYLE_DEFAULT_DEFAULT_BG_IMAGE_MIN_HEIGHT_INC)
416 ////////////////////////////////////////////////////////////////////////////////
417 CHECK_STYLE_DEFAULT("default/extended", CHECK_STYLE_DEFAULT_EXTENDED_BG_IMAGE_MIN_WIDTH_INC, CHECK_STYLE_DEFAULT_EXTENDED_BG_IMAGE_MIN_HEIGHT_INC)
418 ////////////////////////////////////////////////////////////////////////////////
420 #define CHECK_STYLE_FOR_GENLIST(style_name, min_width, min_height) \
421 group { name: "elm/check/base/"style_name; \
423 image: "00_check_bg.png" COMP; \
424 image: "00_check_dim_bg.png" COMP; \
425 image: "00_check_dim.png" COMP; \
426 image: "00_check_Activated.png" COMP; \
429 public check_state = CHECK_STATE_DEFAULT; \
432 part { name: "back_bg"; \
435 description { state: "default" 0.0; \
436 min: min_width min_height; \
444 description { state: "default" 0.0; \
445 min: CHECK_STYLE_DEFAULT_BG_NORMAL_MIN_MAX_INC; \
446 max: CHECK_STYLE_DEFAULT_BG_NORMAL_MIN_MAX_INC; \
448 rel1.to: "back_bg"; \
449 rel2.to: "back_bg"; \
450 image.normal: "00_check_bg.png"; \
453 description { state: "disabled" 0.0; \
454 inherit: "default" 0.0; \
455 image.normal: "00_check_dim_bg.png"; \
458 part { name: "check"; \
461 description { state: "default" 0.0; \
465 image.normal: "00_check_Activated.png"; \
467 description { state: "visible" 0.0; \
468 inherit: "default" 0.0; \
471 description { state: "disabled_visible" 0.0; \
472 inherit: "default" 0.0; \
474 image.normal: "00_check_dim.png"; \
477 part { name: "elm.swallow.content"; \
479 clip_to: "disclip"; \
480 description { state: "default" 0.0; \
495 description { state: "visible" 0.0; \
496 inherit: "default" 0.0; \
500 aspect_preference: VERTICAL; \
502 description { state: "disabled" 0.0; \
503 inherit: "default" 0.0; \
505 description { state: "disabled_visible" 0.0; \
506 inherit: "default" 0.0; \
512 part { name: "elm.text"; \
515 clip_to: "disclip"; \
517 description { state: "default" 0.0; \
523 to_x: "elm.swallow.content"; \
531 style: "check_label_textblock_style"; \
534 color: CHECK_DEFAULT_TEXT_NORMAL_COLOR_INC; \
536 description { state: "visible" 0.0; \
537 inherit: "default" 0.0; \
541 description { state: "disabled" 0.0; \
542 inherit: "default" 0.0; \
544 description { state: "disabled_visible" 0.0; \
545 inherit: "default" 0.0; \
548 color: CHECK_DEFAULT_TEXT_DISABLED_COLOR_INC; \
551 part { name: "events1"; \
553 ignore_flags: ON_HOLD; \
554 description { state: "default" 0.0; \
558 part { name: "events2"; \
561 description { state: "default" 0.0; \
565 part { name: "disclip"; \
568 description { state: "default" 0.0; \
569 color: CHECK_DISCLIP_NORMAL_COLOR_INC; \
571 description { state: "disabled" 0.0; \
572 inherit: "default" 0.0; \
573 color: CHECK_DISCLIP_DISABLED_COLOR_INC; \
576 part { name: "disabler"; \
578 description { state: "default" 0.0; \
582 description { state: "disabled" 0.0; \
583 inherit: "default" 0.0; \
589 program { name: "click"; \
590 signal: "mouse,clicked,1"; \
592 action: SIGNAL_EMIT "elm,action,check,toggle" ""; \
593 after: "touch_sound"; \
595 program { name: "touch_sound"; \
596 action: PLAY_SAMPLE "touch_sound" 1.0; \
598 program { name: "check_on"; \
599 signal: "elm,state,check,on"; \
602 set_int(check_state, CHECK_STATE_VISIBLE); \
603 set_state(PART:"check", "visible", 0.0); \
606 program { name: "check_off"; \
607 signal: "elm,state,check,off"; \
609 action: STATE_SET "default" 0.0; \
612 if (get_int(check_state) == CHECK_STATE_VISIBLE) \
614 set_int(check_state, CHECK_STATE_DEFAULT); \
615 set_state(PART:"check", "default", 0.0); \
619 program { name: "text_show"; \
620 signal: "elm,state,text,visible"; \
622 action: STATE_SET "visible" 0.0; \
623 target: "elm.text"; \
625 program { name: "text_hide"; \
626 signal: "elm,state,text,hidden"; \
628 action: STATE_SET "default" 0.0; \
629 target: "elm.text"; \
631 program { name: "icon_show"; \
632 signal: "elm,state,icon,visible"; \
634 action: STATE_SET "visible" 0.0; \
635 target: "elm.swallow.content"; \
637 program { name: "icon_hide"; \
638 signal: "elm,state,icon,hidden"; \
640 action: STATE_SET "default" 0.0; \
641 target: "elm.swallow.content"; \
643 program { name: "disable"; \
644 signal: "elm,state,disabled"; \
646 action: STATE_SET "disabled" 0.0; \
647 target: "disabler"; \
650 after: "disable_text"; \
652 program { name: "disable_text"; \
656 get_state(PART:"elm.text", st, 30, vl); \
657 if (!strcmp(st, "visible")) \
658 set_state(PART:"elm.text", "disabled_visible", 0.0); \
660 set_state(PART:"elm.text", "disabled", 0.0); \
661 get_state(PART:"elm.swallow.content", st, 30, vl); \
662 if (!strcmp(st, "visible")) \
663 set_state(PART:"elm.swallow.content", "disabled_visible", 0.0); \
665 set_state(PART:"elm.swallow.content", "disabled", 0.0); \
666 get_state(PART:"check", st, 30, vl); \
667 if (!strcmp(st, "visible")) \
669 set_state(PART:"check", "disabled_visible", 0.0); \
670 set_int(check_state, CHECK_STATE_DISABLED_VISIBLE); \
674 program { name: "enable"; \
675 signal: "elm,state,enabled"; \
677 action: STATE_SET "default" 0.0; \
678 target: "disabler"; \
681 after: "enable_text"; \
683 program { name: "enable_text"; \
687 get_state(PART:"elm.text", st, 30, vl); \
688 if (!strcmp(st, "disabled_visible")) \
689 set_state(PART:"elm.text", "visible", 0.0); \
691 set_state(PART:"elm.text", "default", 0.0); \
692 get_state(PART:"elm.swallow.content", st, 30, vl); \
693 if (!strcmp(st, "visible")) \
694 set_state(PART:"elm.swallow.content", "visible", 0.0); \
696 set_state(PART:"elm.swallow.content", "default", 0.0); \
697 get_state(PART:"check", st, 30, vl); \
698 if (!strcmp(st, "disabled_visible")) \
700 set_state(PART:"check", "visible", 0.0); \
701 set_int(check_state, CHECK_STATE_VISIBLE); \
704 set_int(check_state, CHECK_STATE_DEFAULT); \
709 ////////////////////////////////////////////////////////////////////////////////
710 CHECK_STYLE_FOR_GENLIST("default/genlist_edit", CHECK_STYLE_FAVORITE_DEFAULT_BG_IMAGE_MIN_WIDTH_INC, CHECK_STYLE_FAVORITE_DEFAULT_BG_IMAGE_MIN_HEIGHT_INC)
711 ////////////////////////////////////////////////////////////////////////////////
713 style { name: "check_label_textblock_style";
714 base: "font=Tizen:style=Roman font_size="CHECK_DEFAULT_TEXT_FONT_SIZE_INC" color=#ffffff wrap=char text_class=tizen";
717 tag: "hilight" "+ font=Tizen:style=Bold";
718 tag: "b" "+ font=Tizen:style=Bold";
719 tag: "whitecolor" "+ color=#ffffff";
724 group { name: "elm/check/base/on&off";
726 image: "00_button_on.png" COMP;
727 image: "00_button_on_dim.png" COMP;
728 image: "00_button_off.png" COMP;
729 image: "00_button_off_dim.png" COMP;
730 image: "00_button_on_off_handler.png" COMP;
731 image: "00_button_on_off_handler_dim.png" COMP;
744 description { state: "default" 0.0;
745 min: CHECK_ONOFF_BG_NORMAL_MIN_MAX_INC;
746 max: CHECK_ONOFF_BG_NORMAL_MIN_MAX_INC;
747 rel2.relative: 0.0 1.0;
753 part { name: "padding_left";
757 description { state: "default" 0.0;
759 rel1{ relative: 0.0 0.0; to: "bg"; }
760 rel2{ relative: 0.0 1.0; to: "bg"; }
766 part { name: "padding_right";
770 description { state: "default" 0.0;
785 part { name: "padding_top";
789 description { state: "default" 0.0;
801 part { name: "padding_bottom";
805 description { state: "default" 0.0;
820 part { name: "bg_image";
823 description { state: "default" 0.0;
833 to_y: "padding_bottom";
835 image.normal: "00_button_off.png";
837 description { state: "visible" 0.0;
838 inherit: "default" 0.0;
839 image.normal: "00_button_on.png";
841 description { state: "pressed" 0.0;
842 inherit: "default" 0.0;
843 image.normal: "00_button_off.png";
845 description { state: "visible_pressed" 0.0;
846 inherit: "default" 0.0;
847 image.normal: "00_button_on.png";
849 description { state: "visible_disable" 0.0;
850 inherit: "default" 0.0;
851 image.normal: "00_button_on_dim.png";
853 description { state: "off_disable" 0.0;
854 inherit: "default" 0.0;
855 image.normal: "00_button_off_dim.png";
858 part { name: "drag_container";
862 description { state: "default" 0.0;
865 to_x: "padding_left";
870 to_x: "padding_right";
876 part { name: "clipper";
879 description { state: "default" 0.0;
882 color: 255 255 255 255;
885 part { name: "clipper_inner";
888 description { state: "default" 0.0;
891 color: 255 255 255 255;
894 part { name: "button";
901 confine: "drag_container";
903 description { state: "default" 0.0;
904 min: CHECK_ONOFF_HANDLER_MIN_MAX_INC;
905 max: CHECK_ONOFF_HANDLER_MIN_MAX_INC;
910 image.normal: "00_button_on_off_handler.png";
912 description { state: "disabled" 0.0;
913 inherit: "default" 0.0;
914 image.normal: "00_button_on_off_handler_dim.png";
917 part { name: "button_events";
922 description { state: "default" 0.0;
928 part { name: "onrect";
933 description { state: "default" 0.0;
946 part { name: "offrect";
951 description { state: "default" 0.0;
963 part { name: "elm.offtext";
967 clip_to: "clipper_inner";
968 description { state: "default" 0.0;
971 color: 255 255 255 255;
973 font: "Tizen:style=Medium";
979 description { state: "disabled" 0.0;
980 inherit: "default" 0.0;
981 color: 128 128 128 128;
984 part { name: "elm.ontext";
988 clip_to: "clipper_inner";
989 description { state: "default" 0.0;
992 color: 255 255 255 255;
994 font: "Tizen:style=Medium";
1000 description { state: "disabled" 0.0;
1001 inherit: "default" 0.0;
1002 color: 128 128 128 128;
1005 part { name: "elm.swallow.content";
1008 description { state: "default" 0.0;
1021 description { state: "visible" 0.0;
1022 inherit: "default" 0.0;
1026 aspect_preference: VERTICAL;
1028 description { state: "disabled" 0.0;
1029 inherit: "default" 0.0;
1031 description { state: "disabled_visible" 0.0;
1032 inherit: "default" 0.0;
1038 part { name: "elm.text";
1043 description { state: "default" 0.0;
1049 to_x: "elm.swallow.content";
1057 style: "check_label_textblock_style";
1060 color: CHECK_DEFAULT_TEXT_NORMAL_COLOR_INC;
1062 description { state: "visible" 0.0;
1063 inherit: "default" 0.0;
1067 description { state: "disabled" 0.0;
1068 inherit: "default" 0.0;
1070 description { state: "disabled_visible" 0.0;
1071 inherit: "default" 0.0;
1076 part { name: "disclip";
1079 description { state: "default" 0.0;
1080 color: CHECK_DISCLIP_NORMAL_COLOR_INC;
1082 description { state: "disabled" 0.0;
1083 inherit: "default" 0.0;
1084 color: CHECK_DISCLIP_DISABLED_COLOR_INC;
1087 part { name: "disabler";
1089 description { state: "default" 0.0;
1093 description { state: "disabled" 0.0;
1094 inherit: "default" 0.0;
1101 signal: "mouse,clicked,1";
1104 new Float:dx, Float:dy;
1105 get_drag(PART:"button", dx, dy);
1106 if (!get_int(was_drag)) {
1108 set_drag(PART:"button", 0.0, 0.0);
1110 set_drag(PART:"button", 1.0, 0.0);
1111 if (((get_int(is_rtl) == 1) && (dx <= 0.5)) ||
1112 (get_int(is_rtl) == 0) && (dx > 0.5)) {
1113 if (get_int(check_on)) {
1114 emit("elm,action,check,off", "");
1115 emit("elm,action,touch,sound", "");
1119 if (!get_int(check_on)) {
1120 emit("elm,action,check,on", "");
1121 emit("elm,action,touch,sound", "");
1127 program { name: "touch_sound";
1128 signal: "elm,action,touch,sound";
1130 action: PLAY_SAMPLE "touch_sound" 1.0;
1136 if (!get_int(is_drag)) emit("elm,action,check,drag,start", "");
1137 set_int(is_drag, 1);
1141 signal: "mouse,down,1";
1144 set_int(was_drag, 0);
1145 set_int(is_drag, 0);
1148 program { name: "drag_end";
1149 signal: "mouse,up,1";
1152 new Float:dx, Float:dy;
1153 get_drag(PART:"button", dx, dy);
1154 if (get_int(is_drag)) {
1156 set_drag(PART:"button", 1.0, 0.0);
1158 set_drag(PART:"button", 0.0, 0.0);
1159 if (((get_int(is_rtl) == 1) && (dx <= 0.5)) ||
1160 (get_int(is_rtl) == 0) && (dx > 0.5)) {
1161 if (!get_int(check_on)) {
1162 emit("elm,action,check,on", "");
1163 emit("elm,action,touch,sound", "");
1167 if (get_int(check_on)) {
1168 emit("elm,action,check,off", "");
1169 emit("elm,action,touch,sound", "");
1172 set_int(was_drag, get_int(is_drag));
1173 set_int(is_drag, 0);
1174 emit("elm,action,check,drag,stop", "");
1178 program { name: "check_on";
1179 signal: "elm,state,check,on";
1183 if (get_int(is_rtl) == 0) {
1189 set_drag(PART:"button", drag, 0.0);
1190 set_state(PART:"bg_image", "visible", 0.0);
1191 set_int(check_on, 1);
1194 program { name: "check_off";
1195 signal: "elm,state,check,off";
1199 if (get_int(is_rtl) == 0) {
1205 set_drag(PART:"button", drag, 0.0);
1206 set_state(PART:"bg_image", "default", 0.0);
1207 set_int(check_on, 0);
1210 program { name: "text_show";
1211 signal: "elm,state,text,visible";
1213 action: STATE_SET "visible" 0.0;
1216 program { name: "text_hide";
1217 signal: "elm,state,text,hidden";
1219 action: STATE_SET "default" 0.0;
1222 program { name: "icon_show";
1223 signal: "elm,state,icon,visible";
1225 action: STATE_SET "visible" 0.0;
1226 target: "elm.swallow.content";
1228 program { name: "icon_hide";
1229 signal: "elm,state,icon,hidden";
1231 action: STATE_SET "default" 0.0;
1232 target: "elm.swallow.content";
1234 program { name: "disable";
1235 signal: "elm,state,disabled";
1237 action: STATE_SET "disabled" 0.0;
1238 target: "elm.offtext";
1239 target: "elm.ontext";
1243 after: "disable_text";
1245 program { name: "disable_text";
1249 get_state(PART:"elm.text", st, 30, vl);
1250 if (!strcmp(st, "visible"))
1251 set_state(PART:"elm.text", "disabled_visible", 0.0);
1253 set_state(PART:"elm.text", "disabled", 0.0);
1254 get_state(PART:"bg_image", st, 30, vl);
1255 if (!strcmp(st, "visible"))
1256 set_state(PART:"bg_image", "visible_disable", 0.0);
1258 set_state(PART:"bg_image", "off_disable", 0.0);
1259 get_state(PART:"elm.swallow.content", st, 30, vl);
1260 if (!strcmp(st, "visible"))
1261 set_state(PART:"elm.swallow.content", "disabled_visible", 0.0);
1263 set_state(PART:"elm.swallow.content", "disabled", 0.0);
1264 set_state(PART:"button", "disabled", 0.0);
1267 program { name: "enable";
1268 signal: "elm,state,enabled";
1270 action: STATE_SET "default" 0.0;
1274 after: "enable_text";
1276 program { name: "enable_text";
1280 get_state(PART:"elm.text", st, 30, vl);
1281 if (!strcmp(st, "disabled_visible"))
1282 set_state(PART:"elm.text", "visible", 0.0);
1284 set_state(PART:"elm.text", "default", 0.0);
1285 get_state(PART:"bg_image", st, 30, vl);
1286 if (!strcmp(st, "visible_disable"))
1287 set_state(PART:"bg_image", "visible", 0.0);
1289 set_state(PART:"bg_image", "default", 0.0);
1290 get_state(PART:"elm.swallow.content", st, 30, vl);
1291 if (!strcmp(st, "visible"))
1292 set_state(PART:"elm.swallow.content", "visible", 0.0);
1294 set_state(PART:"elm.swallow.content", "default", 0.0);
1295 set_state(PART:"button", "default", 0.0);
1298 program { name: "to_rtl";
1299 signal: "edje,state,rtl";
1305 program { name: "to_ltr";
1306 signal: "edje,state,ltr";
1314 ///////////////////////////////////////////////////////////////////////////////////////
1316 #define CHECK_STYLE_FAVORITE(style_name, on_image, on_dim_image, off_image, off_dim_image, min_width, min_height) \
1317 group { name: "elm/check/base/"style_name; \
1319 image: on_image COMP; \
1320 image: on_dim_image COMP; \
1321 image: off_image COMP; \
1322 image: off_dim_image COMP; \
1325 part { name: "back_bg"; \
1328 description { state: "default" 0.0; \
1330 rel2.relative: 0.0 1.0; \
1332 min: min_width min_height; \
1336 part { name: "bg"; \
1338 clip_to: "disclip"; \
1340 description { state: "default" 0.0; \
1342 rel1.to: "back_bg"; \
1343 rel2.to: "back_bg"; \
1344 min: min_width min_height; \
1345 max: min_width min_height; \
1349 part { name: "check"; \
1351 clip_to: "disclip"; \
1353 description { state: "default" 0.0; \
1356 image.normal: off_image; \
1358 description { state: "visible" 0.0; \
1359 inherit: "default" 0.0; \
1360 image.normal: on_image; \
1362 description { state: "disabled" 0.0; \
1363 inherit: "default" 0.0; \
1364 image.normal: off_dim_image; \
1366 description { state: "disabled_visible" 0.0; \
1367 inherit: "default" 0.0; \
1368 image.normal: on_dim_image; \
1371 part { name: "elm.swallow.content"; \
1373 clip_to: "disclip"; \
1374 description { state: "default" 0.0; \
1380 relative: 1.0 0.0; \
1385 relative: 1.0 1.0; \
1389 description { state: "visible" 0.0; \
1390 inherit: "default" 0.0; \
1394 aspect_preference: VERTICAL; \
1396 description { state: "disabled" 0.0; \
1397 inherit: "default" 0.0; \
1399 description { state: "disabled_visible" 0.0; \
1400 inherit: "default" 0.0; \
1406 part { name: "elm.text"; \
1408 clip_to: "disclip"; \
1411 description { state: "default" 0.0; \
1415 relative: 1.0 0.5; \
1417 to_x: "elm.swallow.content"; \
1420 relative: 1.0 0.5; \
1425 style: "check_label_textblock_style"; \
1428 color: CHECK_DEFAULT_TEXT_NORMAL_COLOR_INC; \
1430 description { state: "visible" 0.0; \
1431 inherit: "default" 0.0; \
1435 description { state: "disabled" 0.0; \
1436 inherit: "default" 0.0; \
1438 description { state: "disabled_visible" 0.0; \
1439 inherit: "default" 0.0; \
1442 color: CHECK_DEFAULT_TEXT_DISABLED_COLOR_INC; \
1445 part { name: "disclip"; \
1448 description { state: "default" 0.0; \
1449 color: CHECK_DISCLIP_NORMAL_COLOR_INC; \
1452 part { name: "events"; \
1454 ignore_flags: ON_HOLD; \
1455 description { state: "default" 0.0; \
1459 part { name: "disabler"; \
1461 description { state: "default" 0.0; \
1465 description { state: "disabled" 0.0; \
1466 inherit: "default" 0.0; \
1472 program { name: "click"; \
1473 signal: "mouse,clicked,1"; \
1475 action: SIGNAL_EMIT "elm,action,check,toggle" ""; \
1476 after: "touch_sound"; \
1478 program { name: "touch_sound"; \
1479 action: PLAY_SAMPLE "touch_sound" 1.0; \
1481 program { name: "check_on"; \
1482 signal: "elm,state,check,on"; \
1484 action: STATE_SET "visible" 0.0; \
1487 program { name: "check_off"; \
1488 signal: "elm,state,check,off"; \
1490 action: STATE_SET "default" 0.0; \
1493 program { name: "text_show"; \
1494 signal: "elm,state,text,visible"; \
1496 action: STATE_SET "visible" 0.0; \
1497 target: "elm.text"; \
1499 program { name: "text_hide"; \
1500 signal: "elm,state,text,hidden"; \
1502 action: STATE_SET "default" 0.0; \
1503 target: "elm.text"; \
1505 program { name: "icon_show"; \
1506 signal: "elm,state,icon,visible"; \
1508 action: STATE_SET "visible" 0.0; \
1509 target: "elm.swallow.content"; \
1511 program { name: "icon_hide"; \
1512 signal: "elm,state,icon,hidden"; \
1514 action: STATE_SET "default" 0.0; \
1515 target: "elm.swallow.content"; \
1517 program { name: "disable"; \
1518 signal: "elm,state,disabled"; \
1520 action: STATE_SET "disabled" 0.0; \
1521 target: "disabler"; \
1522 after: "disable_text"; \
1524 program { name: "disable_text"; \
1528 get_state(PART:"elm.text", st, 30, vl); \
1529 if (!strcmp(st, "visible")) \
1530 set_state(PART:"elm.text", "disabled_visible", 0.0); \
1532 set_state(PART:"elm.text", "disabled", 0.0); \
1533 get_state(PART:"elm.swallow.content", st, 30, vl); \
1534 if (!strcmp(st, "visible")) \
1535 set_state(PART:"elm.swallow.content", "disabled_visible", 0.0); \
1537 set_state(PART:"elm.swallow.content", "disabled", 0.0); \
1538 get_state(PART:"check", st, 30, vl); \
1539 if (!strcmp(st, "visible")) \
1540 set_state(PART:"check", "disabled_visible", 0.0); \
1542 set_state(PART:"check", "disabled", 0.0); \
1545 program { name: "enable"; \
1546 signal: "elm,state,enabled"; \
1548 action: STATE_SET "default" 0.0; \
1549 target: "disabler"; \
1550 after: "enable_text"; \
1552 program { name: "enable_text"; \
1556 get_state(PART:"elm.text", st, 30, vl); \
1557 if (!strcmp(st, "disabled_visible")) \
1558 set_state(PART:"elm.text", "visible", 0.0); \
1560 set_state(PART:"elm.text", "default", 0.0); \
1561 get_state(PART:"elm.swallow.content", st, 30, vl); \
1562 if (!strcmp(st, "visible")) \
1563 set_state(PART:"elm.swallow.content", "visible", 0.0); \
1565 set_state(PART:"elm.swallow.content", "default", 0.0); \
1566 get_state(PART:"check", st, 30, vl); \
1567 if (!strcmp(st, "disabled_visible")) \
1568 set_state(PART:"check", "visible", 0.0); \
1570 set_state(PART:"check", "default", 0.0); \
1575 ////////////////////////////////////////////////////////////////////////////////
1576 CHECK_STYLE_FAVORITE("favorite", "00_icon_favorite_on_72x72.png", "00_icon_favorite_on_72x72_dim.png", "00_icon_favorite_off_72x72.png", "00_icon_favorite_off_72x72_dim.png", CHECK_STYLE_FAVORITE_DEFAULT_BG_IMAGE_MIN_WIDTH_INC, CHECK_STYLE_FAVORITE_DEFAULT_BG_IMAGE_MIN_HEIGHT_INC)
1577 ////////////////////////////////////////////////////////////////////////////////
1578 CHECK_STYLE_FAVORITE("favorite_small", "00_icon_favorite_on_45x45.png", "00_icon_favorite_on_45x45.png", "00_icon_favorite_off_45x45.png", "00_icon_favorite_off_45x45.png", CHECK_STYLE_FAVORITE_SMALL_DEFAULT_BG_IMAGE_MIN_WIDTH_INC, CHECK_STYLE_FAVORITE_SMALL_DEFAULT_BG_IMAGE_MIN_HEIGHT_INC)
1579 ////////////////////////////////////////////////////////////////////////////////
1580 CHECK_STYLE_FAVORITE("favorite/extended", "00_icon_favorite_on_72x72.png", "00_icon_favorite_on_72x72_dim.png", "00_icon_favorite_off_72x72.png", "00_icon_favorite_off_72x72_dim.png", CHECK_STYLE_FAVORITE_EXTENDED_BG_IMAGE_MIN_WIDTH_INC, CHECK_STYLE_FAVORITE_EXTENDED_BG_IMAGE_MIN_HEIGHT_INC)
1581 ////////////////////////////////////////////////////////////////////////////////
1583 group { name: "elm/check/base/grid";
1584 images.image: "00_check_bg.png" COMP;
1585 images.image: "00_check_dim_bg.png" COMP;
1586 images.image: "00_check_dim.png" COMP;
1587 images.image: "00_check_Activated.png" COMP;
1589 public check_state = CHECK_STATE_DEFAULT;
1590 public check_visible = CHECK_HIDE;
1596 description { state: "default" 0.0;
1600 part { name: "top_left_padding";
1604 description { state: "default" 0.0;
1606 min: GENGRID_ITEM_CHECK_TOP_RIGHT_PADDING_INC;
1622 description { state: "default" 0.0;
1623 min: GENGRID_EDIT_MODE_CHECK_SIZE_INC;
1628 to: "top_left_padding";
1632 to: "top_left_padding";
1634 image.normal: "00_check_bg.png";
1636 description { state: "visible" 0.0;
1637 inherit: "default" 0.0;
1639 description { state: "disabled" 0.0;
1640 inherit: "default" 0.0;
1641 image.normal: "00_check_dim_bg.png";
1644 part { name: "check";
1646 clip_to: "sequence_clip";
1648 description { state: "default" 0.0;
1652 image.normal: "00_check_Activated.png";
1653 color: 255 255 255 0;
1655 description { state: "visible" 0.0;
1656 inherit: "default" 0.0;
1658 color: 255 255 255 255;
1660 description { state: "pressed" 0.0;
1661 inherit: "visible" 0.0;
1663 description { state: "disabled_visible" 0.0;
1664 inherit: "default" 0.0;
1666 image.normal: "00_check_dim.png";
1669 part { name: "sequence_clip";
1672 description { state: "default" 0.0;
1675 rel2.relative: 0.0 1.0;
1676 color: 255 255 255 255;
1678 description { state: "visible" 0.0;
1679 inherit: "default" 0.0;
1680 rel2.relative: 1.0 1.0;
1683 part { name: "elm.swallow.content";
1686 state: "default" 0.0;
1689 color: 255 255 255 255;
1702 description { state: "visible" 0.0;
1703 inherit: "default" 0.0;
1707 aspect_preference: VERTICAL;
1709 description { state: "disabled" 0.0;
1710 inherit: "default" 0.0;
1711 color: 128 128 128 128;
1713 description { state: "disabled_visible" 0.0;
1714 inherit: "default" 0.0;
1715 color: 128 128 128 128;
1721 part { name: "elm.text";
1725 description { state: "default" 0.0;
1731 to_x: "elm.swallow.content";
1737 color: 255 255 255 255;
1740 style: "check_label_textblock_style";
1743 color: CHECK_DEFAULT_TEXT_NORMAL_COLOR_INC;
1745 description { state: "visible" 0.0;
1746 inherit: "default" 0.0;
1750 description { state: "disabled" 0.0;
1751 inherit: "default" 0.0;
1753 description { state: "disabled_visible" 0.0;
1754 inherit: "default" 0.0;
1757 color: CHECK_DEFAULT_TEXT_DISABLED_COLOR_INC;
1760 part { name: "events";
1762 ignore_flags: ON_HOLD;
1763 description { state: "default" 0.0;
1767 part { name: "disabler";
1769 description { state: "default" 0.0;
1773 description { state: "disabled" 0.0;
1774 inherit: "default" 0.0;
1780 program { name: "show";
1783 set_int(check_visible, CHECK_SHOW);
1786 program { name: "hide";
1789 set_int(check_visible, CHECK_HIDE);
1792 program { name: "click";
1793 signal: "mouse,clicked,1";
1795 action: SIGNAL_EMIT "elm,action,check,toggle" "";
1798 program { name: "bg_normal";
1800 set_state(PART:"bg2", "default", 0.0);
1803 program { name: "pressed";
1804 signal: "mouse,down,1";
1809 get_state(PART:"check", st, 30, vl);
1810 if (!strcmp(st, "visible"))
1812 set_state(PART:"check", "pressed", 0.0);
1813 set_state(PART:"bg2", "visible", 0.0);
1817 program { name: "mouse,out";
1818 signal: "mouse,out";
1821 if (get_int(check_state) == CHECK_STATE_VISIBLE)
1823 set_state(PART:"check", "visible", 0.0);
1824 set_state(PART:"sequence_clip", "visible", 0.0);
1825 set_state(PART:"bg2", "visible", 0.0);
1829 set_state(PART:"check", "default", 0.0);
1830 set_state(PART:"sequence_clip", "default", 0.0);
1831 set_state(PART:"bg2", "default", 0.0);
1835 program { name: "check_on";
1836 signal: "elm,state,check,on";
1839 set_int(check_state, CHECK_STATE_VISIBLE);
1840 if (get_int(check_visible) == CHECK_SHOW)
1842 run_program(PROGRAM:"check_show_effect");
1843 run_program(PROGRAM:"check_draw_effect");
1847 set_state(PART:"check", "visible", 0.0);
1848 set_state(PART:"sequence_clip", "visible", 0.0);
1850 set_state(PART:"bg2", "visible", 0.0);
1853 program { name: "check_off";
1854 signal: "elm,state,check,off";
1856 action: STATE_SET "default" 0.0;
1859 if (get_int(check_state) == CHECK_STATE_VISIBLE)
1861 set_int(check_state, CHECK_STATE_DEFAULT);
1862 set_state(PART:"check", "default", 0.0);
1863 set_state(PART:"sequence_clip", "default", 0.0);
1865 set_state(PART:"bg2", "default", 0.0);
1868 program { name: "check_show_effect";
1869 action: STATE_SET "visible" 0.0;
1870 transition: LINEAR 0.233;
1873 program { name: "check_draw_effect";
1874 action: STATE_SET "visible" 0.0;
1875 transition: LINEAR 0.267;
1876 target: "sequence_clip";
1878 program { name: "text_show";
1879 signal: "elm,state,text,visible";
1881 action: STATE_SET "visible" 0.0;
1884 program { name: "text_hide";
1885 signal: "elm,state,text,hidden";
1887 action: STATE_SET "default" 0.0;
1890 program { name: "icon_show";
1891 signal: "elm,state,icon,visible";
1893 action: STATE_SET "visible" 0.0;
1894 target: "elm.swallow.content";
1896 program { name: "icon_hide";
1897 signal: "elm,state,icon,hidden";
1899 action: STATE_SET "default" 0.0;
1900 target: "elm.swallow.content";
1902 program { name: "disable";
1903 signal: "elm,state,disabled";
1905 action: STATE_SET "disabled" 0.0;
1908 after: "disable_text";
1910 program { name: "disable_text";
1914 get_state(PART:"elm.text", st, 30, vl);
1915 if (!strcmp(st, "visible"))
1916 set_state(PART:"elm.text", "disabled_visible", 0.0);
1918 set_state(PART:"elm.text", "disabled", 0.0);
1919 get_state(PART:"elm.swallow.content", st, 30, vl);
1920 if (!strcmp(st, "visible"))
1921 set_state(PART:"elm.swallow.content", "disabled_visible", 0.0);
1923 set_state(PART:"elm.swallow.content", "disabled", 0.0);
1924 get_state(PART:"check", st, 30, vl);
1925 if (!strcmp(st, "visible"))
1927 set_state(PART:"check", "disabled_visible", 0.0);
1928 set_int(check_state, CHECK_STATE_DISABLED_VISIBLE);
1932 program { name: "enable";
1933 signal: "elm,state,enabled";
1935 action: STATE_SET "default" 0.0;
1938 after: "enable_text";
1940 program { name: "enable_text";
1944 get_state(PART:"elm.text", st, 30, vl);
1945 if (!strcmp(st, "disabled_visible"))
1946 set_state(PART:"elm.text", "visible", 0.0);
1948 set_state(PART:"elm.text", "default", 0.0);
1949 get_state(PART:"elm.swallow.content", st, 30, vl);
1950 if (!strcmp(st, "visible"))
1951 set_state(PART:"elm.swallow.content", "visible", 0.0);
1953 set_state(PART:"elm.swallow.content", "default", 0.0);
1954 get_state(PART:"check", st, 30, vl);
1955 if (!strcmp(st, "disabled_visible"))
1957 set_state(PART:"check", "visible", 0.0);
1958 set_state(PART:"sequence_clip", "visible", 0.0);
1959 set_int(check_state, CHECK_STATE_VISIBLE);
1962 set_int(check_state, CHECK_STATE_DEFAULT);
1968 #undef CHECK_STATE_DEFAULT
1969 #undef CHECK_STATE_VISIBLE
1970 #undef CHECK_STATE_DISABLED_VISIBLE
1971 #undef CHECK_STATE_DISABLED