[naviframe] Fix title divider to support various screen resolution
[platform/core/uifw/efl-theme-tizen.git] / themes / widgets / check.edc
1 /*
2  * efl-theme-tizen
3  * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4  *
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
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
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.
16  */
17
18
19
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
24
25 #define CHECK_HIDE 0
26 #define CHECK_SHOW 1
27
28    styles {
29       style { name: "check_label_textblock_style";
30          base: "font=Tizen:style=Regular font_size="CHECK_DEFAULT_TEXT_FONT_SIZE_INC" color="CHECK_DEFAULT_TEXT_NORMAL_COLOR_INC" wrap=char text_class=tizen";
31          tag: "br" "\n";
32          tag: "ps" "ps";
33          tag: "hilight" "+ font=Tizen:style=Bold";
34          tag: "b" "+ font=Tizen:style=Bold";
35          tag: "whitecolor" "+ color=#ffffff";
36          tag: "tab" "\t";
37       }
38       style { name: "check_label_textblock_style_disable";
39          base: "font=Tizen:style=Regular font_size="CHECK_DEFAULT_TEXT_FONT_SIZE_INC" color="CHECK_DEFAULT_TEXT_DISABLED_COLOR_INC" wrap=char text_class=tizen";
40          tag: "br" "\n";
41          tag: "ps" "ps";
42          tag: "hilight" "+ font=Tizen:style=Bold";
43          tag: "b" "+ font=Tizen:style=Bold";
44          tag: "whitecolor" "+ color=#ffffff";
45          tag: "tab" "\t";
46       }
47    }
48
49 ////////////////////////////////////////////////////////////////////////////////
50 #define CHECK_STYLE_DEFAULT(style_name, min_width, min_height) \
51    group { name: "elm/check/base/"style_name; \
52       images { \
53          image: "00_check_bg.png" COMP; \
54          image: "00_check_dim_bg.png" COMP; \
55          image: "00_check_activated_dim.png" COMP; \
56          image: "00_check_activated_press.png" COMP; \
57          image: "00_check_activated.png" COMP; \
58          image: "00_check_press_bg.png" COMP; \
59          image: "00_check_focus.png" COMP; \
60       } \
61       script { \
62          public check_state = CHECK_STATE_DEFAULT; \
63          public check_visible = CHECK_HIDE; \
64       } \
65       parts { \
66          part { name: "back_bg"; \
67             type: RECT; \
68             scale: 1; \
69             description { state: "default" 0.0; \
70                rel2.relative: 0.0 1.0; \
71                align: 0 0.5; \
72                min: min_width min_height; \
73                fixed: 1 0; \
74                color: 0 0 0 0; \
75             } \
76          } \
77          part { name: "bg"; \
78             mouse_events: 0; \
79             scale: 1; \
80             description { state: "default" 0.0; \
81                min: CHECK_STYLE_DEFAULT_BG_NORMAL_MIN_MAX_INC; \
82                max: CHECK_STYLE_DEFAULT_BG_NORMAL_MIN_MAX_INC; \
83                fixed: 1 1; \
84                rel1.to: "back_bg"; \
85                rel2.to: "back_bg"; \
86                image.normal: "00_check_bg.png"; \
87                fill.smooth : 0; \
88             } \
89             description { state: "visible" 0.0; \
90                inherit: "default" 0.0; \
91             } \
92             description { state: "pressed" 0.0; \
93                inherit: "default" 0.0; \
94                image.normal: "00_check_press_bg.png"; \
95             } \
96             description { state: "disabled" 0.0; \
97                inherit: "default" 0.0; \
98                image.normal: "00_check_dim_bg.png"; \
99             } \
100          } \
101          part { name: "check"; \
102             clip_to: "sequence_clip"; \
103             mouse_events: 0; \
104             scale: 1; \
105             description { state: "default" 0.0; \
106                rel1.to: "bg"; \
107                rel2.to: "bg"; \
108                visible: 0; \
109                image.normal: "00_check_activated.png"; \
110                color: 255 255 255 0; \
111             } \
112             description { state: "visible" 0.0; \
113                inherit: "default" 0.0; \
114                visible: 1; \
115                color: 255 255 255 255; \
116             } \
117             description { state: "disabled_visible" 0.0; \
118                inherit: "default" 0.0; \
119                visible: 1; \
120                image.normal: "00_check_activated_dim.png"; \
121                color: 255 255 255 255; \
122             } \
123             description { state: "pressed" 0.0; \
124                inherit: "visible" 0.0; \
125                image.normal: "00_check_activated_press.png"; \
126             } \
127          } \
128          part { name: "sequence_clip"; \
129             type: RECT; \
130             mouse_events: 0; \
131             description { state: "default" 0.0; \
132                rel2.relative: 0.0 1.0; \
133                color: 255 255 255 255; \
134             } \
135             description { state: "visible" 0.0; \
136                inherit: "default" 0.0; \
137                rel2.relative: 1.0 1.0; \
138             } \
139          } \
140          part { name: "elm.swallow.content"; \
141             type: SWALLOW; \
142             clip_to: "disclip"; \
143             description { state: "default" 0.0; \
144                fixed: 1 0; \
145                visible: 0; \
146                align: 0.0 0.5; \
147                rel1 { \
148                   to_x: "bg"; \
149                   relative: 1.0 0.0; \
150                   offset: 1 1; \
151                } \
152                rel2 { \
153                   to_x: "bg"; \
154                   relative: 1.0 1.0; \
155                   offset: 2 -2; \
156                } \
157             } \
158             description { state: "visible" 0.0; \
159                inherit: "default" 0.0; \
160                fixed: 1 1; \
161                visible: 1; \
162                aspect: 1.0 1.0; \
163                aspect_preference: VERTICAL; \
164             } \
165             description { state: "disabled" 0.0; \
166                inherit: "default" 0.0; \
167             } \
168             description { state: "disabled_visible" 0.0; \
169                inherit: "default" 0.0; \
170                fixed: 1 1; \
171                visible: 1; \
172                aspect: 1.0 1.0; \
173             } \
174          } \
175          part { name: "elm.text"; \
176             type: TEXTBLOCK; \
177             mouse_events: 0; \
178             clip_to: "disclip"; \
179             scale: 1; \
180             description { state: "default" 0.0; \
181                visible: 0; \
182                fixed: 0 1; \
183                rel1 { \
184                   relative: 1.0 0.5; \
185                   offset: 1 1; \
186                   to_x: "elm.swallow.content"; \
187                } \
188                rel2 { \
189                   relative: 1.0 0.5; \
190                   offset: -2 -2; \
191                } \
192                align: 0.0 0.5; \
193                text { \
194                   style: "check_label_textblock_style"; \
195                   min: 0 0; \
196                } \
197             } \
198             description { state: "visible" 0.0; \
199                inherit: "default" 0.0; \
200                visible: 1; \
201                text.min: 1 1; \
202             } \
203             description { state: "disabled" 0.0; \
204                inherit: "default" 0.0; \
205             } \
206             description { state: "disabled_visible" 0.0; \
207                inherit: "default" 0.0; \
208                visible: 1; \
209                text { \
210                   style: "check_label_textblock_style_disable"; \
211                   min: 1 1; \
212                } \
213             } \
214          } \
215          part { name: "events1"; \
216             type: RECT; \
217             ignore_flags: ON_HOLD; \
218             description { state: "default" 0.0; \
219                color: 0 0 0 0; \
220             } \
221          } \
222          part { name: "events2"; \
223             type: RECT; \
224             repeat_events: 1; \
225             description { state: "default" 0.0; \
226                color: 0 0 0 0; \
227             } \
228          } \
229          part { name: "disclip"; \
230             type: RECT; \
231             mouse_events: 0; \
232             description { state: "default" 0.0; \
233                color: CHECK_DISCLIP_NORMAL_COLOR_INC; \
234             } \
235             description { state: "disabled" 0.0; \
236                inherit: "default" 0.0; \
237                color: CHECK_DISCLIP_DISABLED_COLOR_INC; \
238             } \
239          } \
240          part { name: "disabler"; \
241             type: RECT; \
242             description { state: "default" 0.0; \
243                color: 0 0 0 0; \
244                visible: 0; \
245             } \
246             description { state: "disabled" 0.0; \
247                inherit: "default" 0.0; \
248                visible: 1; \
249             } \
250          } \
251       } \
252       programs { \
253          program { name: "show"; \
254             signal: "show"; \
255             script { \
256                set_int(check_visible, CHECK_SHOW); \
257             } \
258          } \
259          program { name: "hide"; \
260             signal: "hide"; \
261             script { \
262                set_int(check_visible, CHECK_HIDE); \
263             } \
264          } \
265          program { name: "click"; \
266             signal: "mouse,clicked,1"; \
267             source: "events1"; \
268             action: SIGNAL_EMIT "elm,action,check,toggle" ""; \
269             after: "touch_sound"; \
270          } \
271          program { name: "touch_sound"; \
272             action: PLAY_SAMPLE "touch_sound" 1.0; \
273          } \
274          program { name: "bg_normal"; \
275             signal: "mouse,up,1"; \
276             source: "events2"; \
277             action: STATE_SET "default" 0.0; \
278             target: "bg"; \
279             target: "check"; \
280          } \
281          program { name: "pressed"; \
282             signal: "mouse,down,1"; \
283             source: "events2"; \
284             action: STATE_SET "pressed" 0.0; \
285             target: "bg"; \
286             target: "check"; \
287          } \
288          program { name: "mouse,out"; \
289             signal: "mouse,out"; \
290             source: "events2"; \
291             script { \
292                if (get_int(check_state) == CHECK_STATE_VISIBLE) \
293                  { \
294                     set_state(PART:"check", "visible", 0.0); \
295                     set_state(PART:"sequence_clip", "visible", 0.0); \
296                  } \
297                else \
298                  { \
299                     set_state(PART:"check", "default", 0.0); \
300                     set_state(PART:"sequence_clip", "default", 0.0); \
301                  } \
302             } \
303          } \
304          program { name: "check_on"; \
305             signal: "elm,state,check,on"; \
306             source: "elm"; \
307             script { \
308                set_int(check_state, CHECK_STATE_VISIBLE); \
309                if (get_int(check_visible) == CHECK_SHOW) \
310                  { \
311                     run_program(PROGRAM:"check_show_effect"); \
312                     run_program(PROGRAM:"check_draw_effect"); \
313                  } \
314                else \
315                  { \
316                     set_state(PART:"check", "visible", 0.0); \
317                     set_state(PART:"sequence_clip", "visible", 0.0); \
318                  } \
319             } \
320          } \
321          program { name: "check_off"; \
322             signal: "elm,state,check,off"; \
323             source: "elm"; \
324             action: STATE_SET "default" 0.0; \
325             target: "check"; \
326             script { \
327                if (get_int(check_state) == CHECK_STATE_VISIBLE) \
328                  { \
329                     set_int(check_state, CHECK_STATE_DEFAULT); \
330                     set_state(PART:"check", "default", 0.0); \
331                     set_state(PART:"sequence_clip", "default", 0.0); \
332                  } \
333             } \
334          } \
335          program { name: "check_show_effect"; \
336             action: STATE_SET "visible" 0.0; \
337             transition: LINEAR 0.233; \
338             target: "check"; \
339          } \
340          program { name: "check_draw_effect"; \
341             action: STATE_SET "visible" 0.0; \
342             transition: LINEAR 0.267; \
343             target: "sequence_clip"; \
344          } \
345          program { name: "text_show"; \
346             signal: "elm,state,text,visible"; \
347             source: "elm"; \
348             action: STATE_SET "visible" 0.0; \
349             target: "elm.text"; \
350          } \
351          program { name: "text_hide"; \
352             signal: "elm,state,text,hidden"; \
353             source: "elm"; \
354             action: STATE_SET "default" 0.0; \
355             target: "elm.text"; \
356          } \
357          program { name: "icon_show"; \
358             signal: "elm,state,icon,visible"; \
359             source: "elm"; \
360             action: STATE_SET "visible" 0.0; \
361             target: "elm.swallow.content"; \
362          } \
363          program { name: "icon_hide"; \
364             signal: "elm,state,icon,hidden"; \
365             source: "elm"; \
366             action: STATE_SET "default" 0.0; \
367             target: "elm.swallow.content"; \
368          } \
369          program { name: "disable"; \
370             signal: "elm,state,disabled"; \
371             source: "elm"; \
372             action: STATE_SET "disabled" 0.0; \
373             target: "disabler"; \
374             target: "disclip"; \
375             target: "bg"; \
376             after: "disable_text"; \
377          } \
378          program { name: "disable_text"; \
379             script { \
380                new st[31]; \
381                new Float:vl; \
382                get_state(PART:"elm.text", st, 30, vl); \
383                if (!strcmp(st, "visible")) \
384                  set_state(PART:"elm.text", "disabled_visible", 0.0); \
385                else \
386                  set_state(PART:"elm.text", "disabled", 0.0); \
387                get_state(PART:"elm.swallow.content", st, 30, vl); \
388                if (!strcmp(st, "visible")) \
389                  set_state(PART:"elm.swallow.content", "disabled_visible", 0.0); \
390                else \
391                  set_state(PART:"elm.swallow.content", "disabled", 0.0); \
392                get_state(PART:"check", st, 30, vl); \
393                if (!strcmp(st, "visible")) \
394                  { \
395                     set_state(PART:"check", "disabled_visible", 0.0); \
396                     set_int(check_state, CHECK_STATE_DISABLED_VISIBLE); \
397                  } \
398             } \
399          } \
400          program { name: "enable"; \
401             signal: "elm,state,enabled"; \
402             source: "elm"; \
403             action: STATE_SET "default" 0.0; \
404             target: "disabler"; \
405             target: "disclip"; \
406             target: "bg"; \
407             after: "enable_text"; \
408          } \
409          program { name: "enable_text"; \
410             script { \
411                new st[31]; \
412                new Float:vl; \
413                get_state(PART:"elm.text", st, 30, vl); \
414                if (!strcmp(st, "disabled_visible")) \
415                  set_state(PART:"elm.text", "visible", 0.0); \
416                else \
417                  set_state(PART:"elm.text", "default", 0.0); \
418                get_state(PART:"elm.swallow.content", st, 30, vl); \
419                if (!strcmp(st, "visible")) \
420                  set_state(PART:"elm.swallow.content", "visible", 0.0); \
421                else \
422                  set_state(PART:"elm.swallow.content", "default", 0.0); \
423                get_state(PART:"check", st, 30, vl); \
424                if (!strcmp(st, "disabled_visible")) \
425                  { \
426                     set_state(PART:"check", "visible", 0.0); \
427                     set_state(PART:"sequence_clip", "visible", 0.0); \
428                     set_int(check_state, CHECK_STATE_VISIBLE); \
429                  } \
430                else \
431                  set_int(check_state, CHECK_STATE_DEFAULT); \
432             } \
433          } \
434       } \
435    }
436 ////////////////////////////////////////////////////////////////////////////////
437 CHECK_STYLE_DEFAULT("default", CHECK_STYLE_DEFAULT_DEFAULT_BG_IMAGE_MIN_WIDTH_INC, CHECK_STYLE_DEFAULT_DEFAULT_BG_IMAGE_MIN_HEIGHT_INC)
438 ////////////////////////////////////////////////////////////////////////////////
439 CHECK_STYLE_DEFAULT("default/extended", CHECK_STYLE_DEFAULT_EXTENDED_BG_IMAGE_MIN_WIDTH_INC, CHECK_STYLE_DEFAULT_EXTENDED_BG_IMAGE_MIN_HEIGHT_INC)
440 ////////////////////////////////////////////////////////////////////////////////
441
442 #define CHECK_STYLE_DEFAULT_GENLIST(style_name, min_width, min_height) \
443    group { name: "elm/check/base/"style_name; \
444       images { \
445          image: "00_check_bg.png" COMP; \
446          image: "00_check_dim_bg.png" COMP; \
447          image: "00_check_activated_dim.png" COMP; \
448          image: "00_check_activated_press.png" COMP; \
449          image: "00_check_activated.png" COMP; \
450          image: "00_check_press_bg.png" COMP; \
451          image: "00_check_focus.png" COMP; \
452       } \
453       script { \
454          public check_state = CHECK_STATE_DEFAULT; \
455          public check_visible = CHECK_HIDE; \
456       } \
457       parts { \
458          part { name: "back_bg"; \
459             type: RECT; \
460             scale: 1; \
461             description { state: "default" 0.0; \
462                rel2.relative: 0.0 1.0; \
463                align: 0 0.5; \
464                min: min_width min_height; \
465                fixed: 1 0; \
466                color: 0 0 0 0; \
467             } \
468          } \
469          part { name: "bg"; \
470             mouse_events: 0; \
471             scale: 1; \
472             description { state: "default" 0.0; \
473                min: CHECK_STYLE_DEFAULT_BG_NORMAL_MIN_MAX_INC; \
474                max: CHECK_STYLE_DEFAULT_BG_NORMAL_MIN_MAX_INC; \
475                fixed: 1 1; \
476                rel1.to: "back_bg"; \
477                rel2.to: "back_bg"; \
478                image.normal: "00_check_bg.png"; \
479                fill.smooth : 0; \
480             } \
481             description { state: "visible" 0.0; \
482                inherit: "default" 0.0; \
483             } \
484             description { state: "pressed" 0.0; \
485                inherit: "default" 0.0; \
486                image.normal: "00_check_press_bg.png"; \
487             } \
488             description { state: "disabled" 0.0; \
489                inherit: "default" 0.0; \
490                image.normal: "00_check_dim_bg.png"; \
491             } \
492          } \
493          part { name: "check"; \
494             clip_to: "sequence_clip"; \
495             mouse_events: 0; \
496             scale: 1; \
497             description { state: "default" 0.0; \
498                rel1.to: "bg"; \
499                rel2.to: "bg"; \
500                visible: 0; \
501                image.normal: "00_check_activated.png"; \
502                color: 255 255 255 0; \
503             } \
504             description { state: "visible" 0.0; \
505                inherit: "default" 0.0; \
506                visible: 1; \
507                color: 255 255 255 255; \
508             } \
509             description { state: "disabled_visible" 0.0; \
510                inherit: "default" 0.0; \
511                visible: 1; \
512                image.normal: "00_check_activated_dim.png"; \
513                color: 255 255 255 255; \
514             } \
515             description { state: "pressed" 0.0; \
516                inherit: "visible" 0.0; \
517                image.normal: "00_check_activated_press.png"; \
518             } \
519          } \
520          part { name: "sequence_clip"; \
521             type: RECT; \
522             mouse_events: 0; \
523             description { state: "default" 0.0; \
524                rel2.relative: 0.0 1.0; \
525                color: 255 255 255 255; \
526             } \
527             description { state: "visible" 0.0; \
528                inherit: "default" 0.0; \
529                rel2.relative: 1.0 1.0; \
530             } \
531          } \
532          part { name: "elm.swallow.content"; \
533             type: SWALLOW; \
534             clip_to: "disclip"; \
535             description { state: "default" 0.0; \
536                fixed: 1 0; \
537                visible: 0; \
538                align: 0.0 0.5; \
539                rel1 { \
540                   to_x: "bg"; \
541                   relative: 1.0 0.0; \
542                   offset: 1 1; \
543                } \
544                rel2 { \
545                   to_x: "bg"; \
546                   relative: 1.0 1.0; \
547                   offset: 2 -2; \
548                } \
549             } \
550             description { state: "visible" 0.0; \
551                inherit: "default" 0.0; \
552                fixed: 1 1; \
553                visible: 1; \
554                aspect: 1.0 1.0; \
555                aspect_preference: VERTICAL; \
556             } \
557             description { state: "disabled" 0.0; \
558                inherit: "default" 0.0; \
559             } \
560             description { state: "disabled_visible" 0.0; \
561                inherit: "default" 0.0; \
562                fixed: 1 1; \
563                visible: 1; \
564                aspect: 1.0 1.0; \
565             } \
566          } \
567          part { name: "elm.text"; \
568             type: TEXTBLOCK; \
569             mouse_events: 0; \
570             clip_to: "disclip"; \
571             scale: 1; \
572             description { state: "default" 0.0; \
573                visible: 0; \
574                fixed: 0 1; \
575                rel1 { \
576                   relative: 1.0 0.5; \
577                   offset: 1 1; \
578                   to_x: "elm.swallow.content"; \
579                } \
580                rel2 { \
581                   relative: 1.0 0.5; \
582                   offset: -2 -2; \
583                } \
584                align: 0.0 0.5; \
585                text { \
586                   style: "check_label_textblock_style"; \
587                   min: 0 0; \
588                } \
589             } \
590             description { state: "visible" 0.0; \
591                inherit: "default" 0.0; \
592                visible: 1; \
593                text.min: 1 1; \
594             } \
595             description { state: "disabled" 0.0; \
596                inherit: "default" 0.0; \
597             } \
598             description { state: "disabled_visible" 0.0; \
599                inherit: "default" 0.0; \
600                visible: 1; \
601                text { \
602                   style: "check_label_textblock_style_disable"; \
603                   min: 1 1; \
604                } \
605             } \
606          } \
607          part { name: "disclip"; \
608             type: RECT; \
609             mouse_events: 0; \
610             description { state: "default" 0.0; \
611                color: CHECK_DISCLIP_NORMAL_COLOR_INC; \
612             } \
613             description { state: "disabled" 0.0; \
614                inherit: "default" 0.0; \
615                color: CHECK_DISCLIP_DISABLED_COLOR_INC; \
616             } \
617          } \
618          part { name: "disabler"; \
619             type: RECT; \
620             description { state: "default" 0.0; \
621                color: 0 0 0 0; \
622                visible: 0; \
623             } \
624             description { state: "disabled" 0.0; \
625                inherit: "default" 0.0; \
626                visible: 1; \
627             } \
628          } \
629       } \
630       programs { \
631          program { name: "show"; \
632             signal: "show"; \
633             script { \
634                set_int(check_visible, CHECK_SHOW); \
635             } \
636          } \
637          program { name: "hide"; \
638             signal: "hide"; \
639             script { \
640                set_int(check_visible, CHECK_HIDE); \
641             } \
642          } \
643          program { name: "bg_normal"; \
644             signal: "elm,state,mouse,up"; \
645             source: "elm"; \
646             script { \
647                if (CHECK_SHOW == get_int(check_visible)) \
648                  { \
649                     set_state(PART:"check", "visible", 0.0); \
650                  } \
651                else \
652                  { \
653                     set_state(PART:"check", "default", 0.0); \
654                  } \
655                set_state(PART:"bg", "default", 0.0); \
656             } \
657          } \
658          program { name: "pressed"; \
659             signal: "elm,state,mouse,down"; \
660             source: "elm"; \
661             action: STATE_SET "pressed" 0.0; \
662             script { \
663                if (CHECK_SHOW == get_int(check_visible)) \
664                  { \
665                     set_state(PART:"check", "pressed", 0.0); \
666                  } \
667                set_state(PART:"bg", "pressed", 0.0); \
668             } \
669          } \
670          program { name: "mouse,out"; \
671             signal: "mouse,out"; \
672             source: "events2"; \
673             script { \
674                if (get_int(check_state) == CHECK_STATE_VISIBLE) \
675                  { \
676                     set_state(PART:"check", "visible", 0.0); \
677                     set_state(PART:"sequence_clip", "visible", 0.0); \
678                  } \
679                else \
680                  { \
681                     set_state(PART:"check", "default", 0.0); \
682                     set_state(PART:"sequence_clip", "default", 0.0); \
683                  } \
684             } \
685          } \
686          program { name: "check_on"; \
687             signal: "elm,state,check,on"; \
688             source: "elm"; \
689             script { \
690                set_int(check_state, CHECK_STATE_VISIBLE); \
691                if (get_int(check_visible) == CHECK_SHOW) \
692                  { \
693                     run_program(PROGRAM:"check_show_effect"); \
694                     run_program(PROGRAM:"check_draw_effect"); \
695                  } \
696                else \
697                  { \
698                     set_state(PART:"check", "visible", 0.0); \
699                     set_state(PART:"sequence_clip", "visible", 0.0); \
700                  } \
701             } \
702          } \
703          program { name: "check_off"; \
704             signal: "elm,state,check,off"; \
705             source: "elm"; \
706             action: STATE_SET "default" 0.0; \
707             target: "check"; \
708             script { \
709                if (get_int(check_state) == CHECK_STATE_VISIBLE) \
710                  { \
711                     set_int(check_state, CHECK_STATE_DEFAULT); \
712                     set_state(PART:"check", "default", 0.0); \
713                     set_state(PART:"sequence_clip", "default", 0.0); \
714                  } \
715             } \
716          } \
717          program { name: "check_show_effect"; \
718             action: STATE_SET "visible" 0.0; \
719             transition: LINEAR 0.233; \
720             target: "check"; \
721          } \
722          program { name: "check_draw_effect"; \
723             action: STATE_SET "visible" 0.0; \
724             transition: LINEAR 0.267; \
725             target: "sequence_clip"; \
726          } \
727          program { name: "text_show"; \
728             signal: "elm,state,text,visible"; \
729             source: "elm"; \
730             action: STATE_SET "visible" 0.0; \
731             target: "elm.text"; \
732          } \
733          program { name: "text_hide"; \
734             signal: "elm,state,text,hidden"; \
735             source: "elm"; \
736             action: STATE_SET "default" 0.0; \
737             target: "elm.text"; \
738          } \
739          program { name: "icon_show"; \
740             signal: "elm,state,icon,visible"; \
741             source: "elm"; \
742             action: STATE_SET "visible" 0.0; \
743             target: "elm.swallow.content"; \
744          } \
745          program { name: "icon_hide"; \
746             signal: "elm,state,icon,hidden"; \
747             source: "elm"; \
748             action: STATE_SET "default" 0.0; \
749             target: "elm.swallow.content"; \
750          } \
751          program { name: "disable"; \
752             signal: "elm,state,disabled"; \
753             source: "elm"; \
754             action: STATE_SET "disabled" 0.0; \
755             target: "disabler"; \
756             target: "disclip"; \
757             target: "bg"; \
758             after: "disable_text"; \
759          } \
760          program { name: "disable_text"; \
761             script { \
762                new st[31]; \
763                new Float:vl; \
764                get_state(PART:"elm.text", st, 30, vl); \
765                if (!strcmp(st, "visible")) \
766                  set_state(PART:"elm.text", "disabled_visible", 0.0); \
767                else \
768                  set_state(PART:"elm.text", "disabled", 0.0); \
769                get_state(PART:"elm.swallow.content", st, 30, vl); \
770                if (!strcmp(st, "visible")) \
771                  set_state(PART:"elm.swallow.content", "disabled_visible", 0.0); \
772                else \
773                  set_state(PART:"elm.swallow.content", "disabled", 0.0); \
774                get_state(PART:"check", st, 30, vl); \
775                if (!strcmp(st, "visible")) \
776                  { \
777                     set_state(PART:"check", "disabled_visible", 0.0); \
778                     set_int(check_state, CHECK_STATE_DISABLED_VISIBLE); \
779                  } \
780             } \
781          } \
782          program { name: "enable"; \
783             signal: "elm,state,enabled"; \
784             source: "elm"; \
785             action: STATE_SET "default" 0.0; \
786             target: "disabler"; \
787             target: "disclip"; \
788             target: "bg"; \
789             after: "enable_text"; \
790          } \
791          program { name: "enable_text"; \
792             script { \
793                new st[31]; \
794                new Float:vl; \
795                get_state(PART:"elm.text", st, 30, vl); \
796                if (!strcmp(st, "disabled_visible")) \
797                  set_state(PART:"elm.text", "visible", 0.0); \
798                else \
799                  set_state(PART:"elm.text", "default", 0.0); \
800                get_state(PART:"elm.swallow.content", st, 30, vl); \
801                if (!strcmp(st, "visible")) \
802                  set_state(PART:"elm.swallow.content", "visible", 0.0); \
803                else \
804                  set_state(PART:"elm.swallow.content", "default", 0.0); \
805                get_state(PART:"check", st, 30, vl); \
806                if (!strcmp(st, "disabled_visible")) \
807                  { \
808                     set_state(PART:"check", "visible", 0.0); \
809                     set_state(PART:"sequence_clip", "visible", 0.0); \
810                     set_int(check_state, CHECK_STATE_VISIBLE); \
811                  } \
812                else \
813                  set_int(check_state, CHECK_STATE_DEFAULT); \
814             } \
815          } \
816       } \
817    }
818 ////////////////////////////////////////////////////////////////////////////////
819 CHECK_STYLE_DEFAULT_GENLIST("default/genlist_editmode", CHECK_STYLE_DEFAULT_DEFAULT_BG_IMAGE_MIN_WIDTH_INC, CHECK_STYLE_DEFAULT_DEFAULT_BG_IMAGE_MIN_HEIGHT_INC)
820 CHECK_STYLE_DEFAULT_GENLIST("default/genlist", CHECK_STYLE_DEFAULT_DEFAULT_BG_IMAGE_MIN_WIDTH_INC, CHECK_STYLE_DEFAULT_DEFAULT_BG_IMAGE_MIN_HEIGHT_INC)
821 ////////////////////////////////////////////////////////////////////////////////
822
823 #define CHECK_STYLE_FOR_GENLIST(style_name, min_width, min_height) \
824    group { name: "elm/check/base/"style_name; \
825       images { \
826          image: "00_check_bg.png" COMP; \
827          image: "00_check_dim_bg.png" COMP; \
828          image: "00_check_activated_dim.png" COMP; \
829          image: "00_check_activated.png" COMP; \
830       } \
831       script { \
832          public check_state = CHECK_STATE_DEFAULT; \
833       } \
834       parts { \
835          part { name: "back_bg"; \
836             type: RECT; \
837             scale: 1; \
838             description { state: "default" 0.0; \
839                min: min_width min_height; \
840                fixed: 0 0; \
841                color: 0 0 0 0; \
842             } \
843          } \
844          part { name: "bg"; \
845             mouse_events: 0; \
846             scale: 1; \
847             description { state: "default" 0.0; \
848                min: CHECK_STYLE_DEFAULT_BG_NORMAL_MIN_MAX_INC; \
849                max: CHECK_STYLE_DEFAULT_BG_NORMAL_MIN_MAX_INC; \
850                fixed: 1 1; \
851                rel1.to: "back_bg"; \
852                rel2.to: "back_bg"; \
853                image.normal: "00_check_bg.png"; \
854                fill.smooth : 0; \
855             } \
856             description { state: "disabled" 0.0; \
857                inherit: "default" 0.0; \
858                image.normal: "00_check_dim_bg.png"; \
859             } \
860          } \
861          part { name: "check"; \
862             mouse_events: 0; \
863             scale: 1; \
864             description { state: "default" 0.0; \
865                rel1.to: "bg"; \
866                rel2.to: "bg"; \
867                visible: 0; \
868                image.normal: "00_check_activated.png"; \
869             } \
870             description { state: "visible" 0.0; \
871                inherit: "default" 0.0; \
872                visible: 1; \
873             } \
874             description { state: "disabled_visible" 0.0; \
875                inherit: "default" 0.0; \
876                visible: 1; \
877                image.normal: "00_check_activated_dim.png"; \
878             } \
879          } \
880          part { name: "elm.swallow.content"; \
881             type: SWALLOW; \
882             clip_to: "disclip"; \
883             description { state: "default" 0.0; \
884                fixed: 1 0; \
885                visible: 0; \
886                align: 0.0 0.5; \
887                rel1 { \
888                   to_x: "bg"; \
889                   relative: 1.0 0.0; \
890                   offset: 1 1; \
891                } \
892                rel2 { \
893                   to_x: "bg"; \
894                   relative: 1.0 1.0; \
895                   offset: 2 -2; \
896                } \
897             } \
898             description { state: "visible" 0.0; \
899                inherit: "default" 0.0; \
900                fixed: 1 1; \
901                visible: 1; \
902                aspect: 1.0 1.0; \
903                aspect_preference: VERTICAL; \
904             } \
905             description { state: "disabled" 0.0; \
906                inherit: "default" 0.0; \
907             } \
908             description { state: "disabled_visible" 0.0; \
909                inherit: "default" 0.0; \
910                fixed: 1 1; \
911                visible: 1; \
912                aspect: 1.0 1.0; \
913             } \
914          } \
915          part { name: "elm.text"; \
916             type: TEXTBLOCK; \
917             mouse_events: 0; \
918             clip_to: "disclip"; \
919             scale: 1; \
920             description { state: "default" 0.0; \
921                visible: 0; \
922                fixed: 0 1; \
923                rel1 { \
924                   relative: 1.0 0.5; \
925                   offset: 1 1; \
926                   to_x: "elm.swallow.content"; \
927                } \
928                rel2 { \
929                   relative: 1.0 0.5; \
930                   offset: -2 -2; \
931                } \
932                align: 0.0 0.5; \
933                text { \
934                   style: "check_label_textblock_style"; \
935                   min: 0 0; \
936                } \
937             } \
938             description { state: "visible" 0.0; \
939                inherit: "default" 0.0; \
940                visible: 1; \
941                text.min: 1 1; \
942             } \
943             description { state: "disabled" 0.0; \
944                inherit: "default" 0.0; \
945             } \
946             description { state: "disabled_visible" 0.0; \
947                inherit: "default" 0.0; \
948                visible: 1; \
949                text { \
950                   style: "check_label_textblock_style_disable"; \
951                   min: 1 1; \
952                } \
953             } \
954          } \
955          part { name: "events1"; \
956             type: RECT; \
957             ignore_flags: ON_HOLD; \
958             description { state: "default" 0.0; \
959                color: 0 0 0 0; \
960             } \
961          } \
962          part { name: "events2"; \
963             type: RECT; \
964             repeat_events: 1; \
965             description { state: "default" 0.0; \
966                color: 0 0 0 0; \
967             } \
968          } \
969          part { name: "disclip"; \
970             type: RECT; \
971             mouse_events: 0; \
972             description { state: "default" 0.0; \
973                color: CHECK_DISCLIP_NORMAL_COLOR_INC; \
974             } \
975             description { state: "disabled" 0.0; \
976                inherit: "default" 0.0; \
977                color: CHECK_DISCLIP_DISABLED_COLOR_INC; \
978             } \
979          } \
980          part { name: "disabler"; \
981             type: RECT; \
982             description { state: "default" 0.0; \
983                color: 0 0 0 0; \
984                visible: 0; \
985             } \
986             description { state: "disabled" 0.0; \
987                inherit: "default" 0.0; \
988                visible: 1; \
989             } \
990          } \
991       } \
992       programs { \
993          program { name: "click"; \
994             signal: "mouse,clicked,1"; \
995             source: "events1"; \
996             action: SIGNAL_EMIT "elm,action,check,toggle" ""; \
997             after: "touch_sound"; \
998          } \
999          program { name: "touch_sound"; \
1000             action: PLAY_SAMPLE "touch_sound" 1.0; \
1001          } \
1002          program { name: "check_on"; \
1003             signal: "elm,state,check,on"; \
1004             source: "elm"; \
1005             script { \
1006                set_int(check_state, CHECK_STATE_VISIBLE); \
1007                set_state(PART:"check", "visible", 0.0); \
1008             } \
1009          } \
1010          program { name: "check_off"; \
1011             signal: "elm,state,check,off"; \
1012             source: "elm"; \
1013             action: STATE_SET "default" 0.0; \
1014             target: "check"; \
1015             script { \
1016                if (get_int(check_state) == CHECK_STATE_VISIBLE) \
1017                  { \
1018                     set_int(check_state, CHECK_STATE_DEFAULT); \
1019                     set_state(PART:"check", "default", 0.0); \
1020                  } \
1021             } \
1022          } \
1023          program { name: "text_show"; \
1024             signal: "elm,state,text,visible"; \
1025             source: "elm"; \
1026             action: STATE_SET "visible" 0.0; \
1027             target: "elm.text"; \
1028          } \
1029          program { name: "text_hide"; \
1030             signal: "elm,state,text,hidden"; \
1031             source: "elm"; \
1032             action: STATE_SET "default" 0.0; \
1033             target: "elm.text"; \
1034          } \
1035          program { name: "icon_show"; \
1036             signal: "elm,state,icon,visible"; \
1037             source: "elm"; \
1038             action: STATE_SET "visible" 0.0; \
1039             target: "elm.swallow.content"; \
1040          } \
1041          program { name: "icon_hide"; \
1042             signal: "elm,state,icon,hidden"; \
1043             source: "elm"; \
1044             action: STATE_SET "default" 0.0; \
1045             target: "elm.swallow.content"; \
1046          } \
1047          program { name: "disable"; \
1048             signal: "elm,state,disabled"; \
1049             source: "elm"; \
1050             action: STATE_SET "disabled" 0.0; \
1051             target: "disabler"; \
1052             target: "disclip"; \
1053             target: "bg"; \
1054             after: "disable_text"; \
1055          } \
1056          program { name: "disable_text"; \
1057             script { \
1058                new st[31]; \
1059                new Float:vl; \
1060                get_state(PART:"elm.text", st, 30, vl); \
1061                if (!strcmp(st, "visible")) \
1062                  set_state(PART:"elm.text", "disabled_visible", 0.0); \
1063                else \
1064                  set_state(PART:"elm.text", "disabled", 0.0); \
1065                get_state(PART:"elm.swallow.content", st, 30, vl); \
1066                if (!strcmp(st, "visible")) \
1067                  set_state(PART:"elm.swallow.content", "disabled_visible", 0.0); \
1068                else \
1069                  set_state(PART:"elm.swallow.content", "disabled", 0.0); \
1070                get_state(PART:"check", st, 30, vl); \
1071                if (!strcmp(st, "visible")) \
1072                  { \
1073                     set_state(PART:"check", "disabled_visible", 0.0); \
1074                     set_int(check_state, CHECK_STATE_DISABLED_VISIBLE); \
1075                  } \
1076             } \
1077          } \
1078          program { name: "enable"; \
1079             signal: "elm,state,enabled"; \
1080             source: "elm"; \
1081             action: STATE_SET "default" 0.0; \
1082             target: "disabler"; \
1083             target: "disclip"; \
1084             target: "bg"; \
1085             after: "enable_text"; \
1086          } \
1087          program { name: "enable_text"; \
1088             script { \
1089                new st[31]; \
1090                new Float:vl; \
1091                get_state(PART:"elm.text", st, 30, vl); \
1092                if (!strcmp(st, "disabled_visible")) \
1093                  set_state(PART:"elm.text", "visible", 0.0); \
1094                else \
1095                  set_state(PART:"elm.text", "default", 0.0); \
1096                get_state(PART:"elm.swallow.content", st, 30, vl); \
1097                if (!strcmp(st, "visible")) \
1098                  set_state(PART:"elm.swallow.content", "visible", 0.0); \
1099                else \
1100                  set_state(PART:"elm.swallow.content", "default", 0.0); \
1101                get_state(PART:"check", st, 30, vl); \
1102                if (!strcmp(st, "disabled_visible")) \
1103                  { \
1104                     set_state(PART:"check", "visible", 0.0); \
1105                     set_int(check_state, CHECK_STATE_VISIBLE); \
1106                  } \
1107                else \
1108                  set_int(check_state, CHECK_STATE_DEFAULT); \
1109             } \
1110          } \
1111       } \
1112    }
1113 ////////////////////////////////////////////////////////////////////////////////
1114 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)
1115 ////////////////////////////////////////////////////////////////////////////////
1116    group { name: "elm/check/base/on&off";
1117       images {
1118          image: "00_button_on_handler.png" COMP;
1119          image: "00_button_on_handler_dim.png" COMP;
1120          image: "00_button_off_handler.png" COMP;
1121          image: "00_button_off_handler_dim.png" COMP;
1122          image: "00_button_on_off_bg.png" COMP;
1123          image: "00_button_on_off_bg_dim.png" COMP;
1124          image: "00_button_handler_focus.png" COMP;
1125       }
1126       script {
1127          public is_rtl = 0;
1128          public is_drag = 0;
1129          public was_drag = 0;
1130          public check_on = 0;
1131       }
1132       parts {
1133          part { name: "bg";
1134             type: RECT;
1135             mouse_events: 1;
1136             scale: 1;
1137             description { state: "default" 0.0;
1138                min: CHECK_ONOFF_BG_NORMAL_MIN_MAX_INC;
1139                max: CHECK_ONOFF_BG_NORMAL_MIN_MAX_INC;
1140                rel2.relative: 0.0 1.0;
1141                fixed: 1 1;
1142                align: 0.0 0.5;
1143                visible: 0;
1144             }
1145          }
1146          part { name: "padding_left";
1147             type: RECT;
1148             scale: 1;
1149             mouse_events: 0;
1150             description { state: "default" 0.0;
1151                align: 0.0 0.0;
1152                rel1{ relative: 0.0 0.0; to: "bg"; }
1153                rel2{ relative: 0.0 1.0; to: "bg"; }
1154                min: 0 0;
1155                fixed: 1 1;
1156                color: 0 0 0 0;
1157             }
1158          }
1159          part { name: "padding_right";
1160             type: RECT;
1161             scale: 1;
1162             mouse_events: 0;
1163             description { state: "default" 0.0;
1164                align: 1.0 0.0;
1165                rel1 {
1166                   relative: 1.0 0.0;
1167                   to: "bg";
1168                }
1169                rel2 {
1170                   relative: 1.0 1.0;
1171                   to: "bg";
1172                }
1173                min: 0 0;
1174                fixed: 1 1;
1175                color: 0 0 0 0;
1176             }
1177          }
1178          part { name: "padding_top";
1179             type: RECT;
1180             scale: 1;
1181             mouse_events: 0;
1182             description { state: "default" 0.0;
1183                align: 0.0 0.0;
1184                rel1.to: "bg";
1185                rel2 {
1186                   relative: 1.0 0.0;
1187                   to: "bg";
1188                }
1189                min: 0 0;
1190                fixed: 1 1;
1191                color: 0 0 0 0;
1192             }
1193          }
1194          part { name: "padding_bottom";
1195             type: RECT;
1196             scale: 1;
1197             mouse_events: 0;
1198             description { state: "default" 0.0;
1199                align: 1.0 1.0;
1200                rel1 {
1201                   relative: 0.0 1.0;
1202                   to: "bg";
1203                }
1204                rel2 {
1205                   relative: 1.0 1.0;
1206                   to: "bg";
1207                }
1208                min: 0 0;
1209                fixed: 0 1;
1210                color: 0 0 0 0;
1211             }
1212          }
1213          part { name: "bg_image";
1214             mouse_events: 0;
1215             scale: 1;
1216             description { state: "default" 0.0;
1217                align: 0.0 0.5;
1218                rel1 {
1219                   relative: 0.0 1.0;
1220                   to_x: "bg";
1221                   to_y: "padding_top";
1222                }
1223                rel2 {
1224                   relative: 1.0 0.0;
1225                   to_x: "bg";
1226                   to_y: "padding_bottom";
1227                }
1228                image.normal: "00_button_on_off_bg.png";
1229             }
1230             description { state: "visible" 0.0;
1231                inherit: "default" 0.0;
1232                image.normal: "00_button_on_off_bg.png";
1233             }
1234             description { state: "pressed" 0.0;
1235                inherit: "default" 0.0;
1236                image.normal: "00_button_on_off_bg.png";
1237             }
1238             description { state: "visible_pressed" 0.0;
1239                inherit: "default" 0.0;
1240                image.normal: "00_button_on_off_bg.png";
1241             }
1242             description { state: "visible_disable" 0.0;
1243                inherit: "default" 0.0;
1244                image.normal: "00_button_on_off_bg_dim.png";
1245             }
1246             description { state: "off_disable" 0.0;
1247                inherit: "default" 0.0;
1248                image.normal: "00_button_on_off_bg_dim.png";
1249             }
1250          }
1251          part { name: "drag_container";
1252             type: RECT;
1253             scale: 1;
1254             mouse_events: 0;
1255             description { state: "default" 0.0;
1256                rel1 {
1257                   relative: 1.0 0.0;
1258                   to_x: "padding_left";
1259                   to_y: "bg";
1260                }
1261                rel2 {
1262                   relative: 0.0 1.0;
1263                   to_x: "padding_right";
1264                   to_y: "bg";
1265                }
1266                color: 0 0 0 0;
1267             }
1268          }
1269          part { name: "clipper";
1270             type: RECT;
1271             mouse_events: 0;
1272             description { state: "default" 0.0;
1273                rel1.to: "bg";
1274                rel2.to: "bg";
1275                color: 255 255 255 255;
1276             }
1277          }
1278          part { name: "clipper_inner";
1279             type: RECT;
1280             mouse_events: 0;
1281             description { state: "default" 0.0;
1282                rel1.to: "bg_image";
1283                rel2.to: "bg_image";
1284                color: 255 255 255 255;
1285             }
1286          }
1287          part { name: "button";
1288             scale: 1;
1289             clip_to: "clipper";
1290             mouse_events: 1;
1291             dragable {
1292                x: 1 1 0;
1293                y: 0 0 0;
1294                confine: "drag_container";
1295             }
1296             description { state: "default" 0.0;
1297                min: CHECK_ONOFF_HANDLER_MIN_MAX_INC;
1298                max: CHECK_ONOFF_HANDLER_MIN_MAX_INC;
1299                rel1.to: "bg";
1300                rel2.to: "bg";
1301                align: 0.0 0.5;
1302                fixed: 1 1;
1303                image.normal: "00_button_off_handler.png";
1304             }
1305             description { state: "on" 0.0;
1306                inherit: "default" 0.0;
1307                image.normal: "00_button_on_handler.png";
1308             }
1309             description { state: "on_disabled" 0.0;
1310                inherit: "default" 0.0;
1311                image.normal: "00_button_on_handler_dim.png";
1312             }
1313             description { state: "off_disabled" 0.0;
1314                inherit: "default" 0.0;
1315                image.normal: "00_button_off_handler_dim.png";
1316             }
1317          }
1318          part { name: "button_events";
1319             type: RECT;
1320             dragable {
1321                events: "button";
1322             }
1323             description { state: "default" 0.0;
1324                rel1.to_x: "bg";
1325                rel2.to_x: "bg";
1326                color: 0 0 0 0;
1327             }
1328          }
1329          part { name: "onrect";
1330             type: RECT;
1331             scale: 1;
1332             clip_to: "clipper";
1333             mouse_events: 0;
1334             description { state: "default" 0.0;
1335                rel1 {
1336                   relative: -1.0 0.0;
1337                   to: "button";
1338                }
1339                rel2 {
1340                   relative: 0.0 1.0;
1341                   to: "button";
1342                }
1343                align: 1.0 0.5;
1344                color: 0 0 0 0;
1345             }
1346          }
1347          part { name: "offrect";
1348             type: RECT;
1349             scale: 1;
1350             clip_to: "clipper";
1351             mouse_events: 0;
1352             description { state: "default" 0.0;
1353                rel1 {
1354                   relative: 1.0 0.0;
1355                   to: "button";
1356                }
1357                rel2 {
1358                   relative: 2.0 1.0;
1359                   to: "button";
1360                }
1361                color: 0 0 0 0;
1362             }
1363          }
1364          part { name: "elm.offtext";
1365             type: TEXT;
1366             mouse_events: 0;
1367             scale: 1;
1368             clip_to: "clipper_inner";
1369             description { state: "default" 0.0;
1370                rel1.to: "offrect";
1371                rel2.to: "offrect";
1372                color: 255 255 255 255;
1373                text {
1374                   font: "Tizen:style=Medium";
1375                   size: 20;
1376                   min: 0 1;
1377                   text_class: "tizen";
1378                }
1379             }
1380             description { state: "disabled" 0.0;
1381                inherit: "default" 0.0;
1382                color: 128 128 128 128;
1383             }
1384          }
1385          part { name: "elm.ontext";
1386             type: TEXT;
1387             mouse_events: 0;
1388             scale: 1;
1389             clip_to: "clipper_inner";
1390             description { state: "default" 0.0;
1391                rel1.to: "onrect";
1392                rel2.to: "onrect";
1393                color: 255 255 255 255;
1394                text {
1395                   font: "Tizen:style=Medium";
1396                   size: 20;
1397                   min: 0 1;
1398                   text_class: "tizen";
1399                }
1400             }
1401             description { state: "disabled" 0.0;
1402                inherit: "default" 0.0;
1403                color: 128 128 128 128;
1404             }
1405          }
1406          part { name: "elm.swallow.content";
1407             type: SWALLOW;
1408             clip_to: "disclip";
1409             description { state: "default" 0.0;
1410                fixed: 1 0;
1411                visible: 0;
1412                align: 0.0 0.5;
1413                rel1 {
1414                   to_x: "bg";
1415                   relative: 1.0 0.0;
1416                }
1417                rel2 {
1418                   to_x: "bg";
1419                   relative: 1.0 1.0;
1420                }
1421             }
1422             description { state: "visible" 0.0;
1423                inherit: "default" 0.0;
1424                fixed: 1 1;
1425                visible: 1;
1426                aspect: 1.0 1.0;
1427                aspect_preference: VERTICAL;
1428             }
1429             description { state: "disabled" 0.0;
1430                inherit: "default" 0.0;
1431             }
1432             description { state: "disabled_visible" 0.0;
1433                inherit: "default" 0.0;
1434                fixed: 1 1;
1435                visible: 1;
1436                aspect: 1.0 1.0;
1437             }
1438          }
1439          part { name: "elm.text";
1440             type: TEXTBLOCK;
1441             mouse_events: 0;
1442             scale: 1;
1443             clip_to: "disclip";
1444             description { state: "default" 0.0;
1445                visible: 0;
1446                fixed: 0 1;
1447                rel1 {
1448                   relative: 1.0 0.5;
1449                   offset: 1 1;
1450                   to_x: "elm.swallow.content";
1451                }
1452                rel2 {
1453                   relative: 1.0 0.5;
1454                   offset: -2 -2;
1455                }
1456                align: 0.0 0.5;
1457                text {
1458                   style: "check_label_textblock_style";
1459                   min: 0 0;
1460                }
1461             }
1462             description { state: "visible" 0.0;
1463                inherit: "default" 0.0;
1464                visible: 1;
1465                text.min: 1 1;
1466             }
1467             description { state: "disabled" 0.0;
1468                inherit: "default" 0.0;
1469             }
1470             description { state: "disabled_visible" 0.0;
1471                inherit: "default" 0.0;
1472                visible: 1;
1473                text {
1474                   style: "check_label_textblock_style_disable";
1475                   min: 1 1;
1476                }
1477             }
1478          }
1479          part { name: "disclip";
1480             type: RECT;
1481             mouse_events: 0;
1482             description { state: "default" 0.0;
1483                color: CHECK_DISCLIP_NORMAL_COLOR_INC;
1484             }
1485             description { state: "disabled" 0.0;
1486                inherit: "default" 0.0;
1487                color: CHECK_DISCLIP_DISABLED_COLOR_INC;
1488             }
1489          }
1490          part { name: "disabler";
1491             type: RECT;
1492             description { state: "default" 0.0;
1493                color: 0 0 0 0;
1494                visible: 0;
1495             }
1496             description { state: "disabled" 0.0;
1497                inherit: "default" 0.0;
1498                visible: 1;
1499             }
1500          }
1501       }
1502       programs {
1503          program {
1504             signal: "mouse,clicked,1";
1505             source: "button";
1506             script {
1507                new Float:dx, Float:dy;
1508                get_drag(PART:"button", dx, dy);
1509                if (!get_int(was_drag)) {
1510                   if (dx > 0.5)
1511                     set_drag(PART:"button", 0.0, 0.0);
1512                   else
1513                     set_drag(PART:"button", 1.0, 0.0);
1514                   if (((get_int(is_rtl) == 1) && (dx <= 0.5)) ||
1515                       (get_int(is_rtl) == 0) && (dx > 0.5)) {
1516                      if (get_int(check_on)) {
1517                        emit("elm,action,check,off", "");
1518                        emit("elm,action,touch,sound", "");
1519                      }
1520                   }
1521                   else {
1522                      if (!get_int(check_on)) {
1523                        emit("elm,action,check,on", "");
1524                        emit("elm,action,touch,sound", "");
1525                      }
1526                   }
1527                }
1528             }
1529          }
1530          program { name: "touch_sound";
1531             signal: "elm,action,touch,sound";
1532             source: "";
1533             action: PLAY_SAMPLE "touch_sound" 1.0;
1534          }
1535          program {
1536             signal: "drag";
1537             source: "button";
1538             script {
1539                if (!get_int(is_drag)) emit("elm,action,check,drag,start", "");
1540                set_int(is_drag, 1);
1541             }
1542          }
1543          program {
1544             signal: "mouse,down,1";
1545             source: "button";
1546             script {
1547                set_int(was_drag, 0);
1548                set_int(is_drag, 0);
1549             }
1550          }
1551          program { name: "drag_end";
1552             signal: "mouse,up,1";
1553             source: "button";
1554             script {
1555                new Float:dx, Float:dy;
1556                get_drag(PART:"button", dx, dy);
1557                if (get_int(is_drag)) {
1558                   if (dx > 0.5)
1559                     set_drag(PART:"button", 1.0, 0.0);
1560                   else
1561                     set_drag(PART:"button", 0.0, 0.0);
1562                   if (((get_int(is_rtl) == 1) && (dx <= 0.5)) ||
1563                       (get_int(is_rtl) == 0) && (dx > 0.5)) {
1564                      if (!get_int(check_on)) {
1565                        emit("elm,action,check,on", "");
1566                        emit("elm,action,touch,sound", "");
1567                      }
1568                   }
1569                   else {
1570                      if (get_int(check_on)) {
1571                        emit("elm,action,check,off", "");
1572                        emit("elm,action,touch,sound", "");
1573                      }
1574                   }
1575                   set_int(was_drag, get_int(is_drag));
1576                   set_int(is_drag, 0);
1577                   emit("elm,action,check,drag,stop", "");
1578                }
1579             }
1580          }
1581          program { name: "check_on";
1582             signal: "elm,state,check,on";
1583             source: "elm";
1584             script {
1585                new Float:drag;
1586                if (get_int(is_rtl) == 0) {
1587                   drag = 100.0;
1588                }
1589                else {
1590                   drag = 0.0;
1591                }
1592                set_drag(PART:"button", drag, 0.0);
1593                set_state(PART:"bg_image", "visible", 0.0);
1594                set_state(PART:"button", "on", 0.0);
1595                set_int(check_on, 1);
1596             }
1597          }
1598          program { name: "check_off";
1599             signal: "elm,state,check,off";
1600             source: "elm";
1601             script {
1602                new Float:drag;
1603                if (get_int(is_rtl) == 0) {
1604                   drag = 0.0;
1605                }
1606                else {
1607                   drag = 100.0;
1608                }
1609                set_drag(PART:"button", drag, 0.0);
1610                set_state(PART:"bg_image", "default", 0.0);
1611                set_state(PART:"button", "default", 0.0);
1612                set_int(check_on, 0);
1613             }
1614          }
1615          program { name: "text_show";
1616             signal: "elm,state,text,visible";
1617             source: "elm";
1618             action:  STATE_SET "visible" 0.0;
1619             target: "elm.text";
1620          }
1621          program { name: "text_hide";
1622             signal: "elm,state,text,hidden";
1623             source: "elm";
1624             action:  STATE_SET "default" 0.0;
1625             target: "elm.text";
1626          }
1627          program { name: "icon_show";
1628             signal: "elm,state,icon,visible";
1629             source: "elm";
1630             action:  STATE_SET "visible" 0.0;
1631             target: "elm.swallow.content";
1632          }
1633          program { name: "icon_hide";
1634             signal: "elm,state,icon,hidden";
1635             source: "elm";
1636             action: STATE_SET "default" 0.0;
1637             target: "elm.swallow.content";
1638          }
1639          program { name: "disable";
1640             signal: "elm,state,disabled";
1641             source: "elm";
1642             action: STATE_SET "disabled" 0.0;
1643             target: "elm.offtext";
1644             target: "elm.ontext";
1645             target: "onrect";
1646             target: "offrect";
1647             target: "disabler";
1648             after: "disable_text";
1649          }
1650          program { name: "disable_text";
1651             script {
1652                new st[31];
1653                new Float:vl;
1654                get_state(PART:"elm.text", st, 30, vl);
1655                if (!strcmp(st, "visible"))
1656                  set_state(PART:"elm.text", "disabled_visible", 0.0);
1657                else
1658                  set_state(PART:"elm.text", "disabled", 0.0);
1659                get_state(PART:"bg_image", st, 30, vl);
1660                if (!strcmp(st, "visible")) {
1661                  set_state(PART:"bg_image", "visible_disable", 0.0);
1662                  set_state(PART:"button", "on_disabled", 0.0);
1663                } else {
1664                  set_state(PART:"bg_image", "off_disable", 0.0);
1665                  set_state(PART:"button", "off_disabled", 0.0);
1666                }
1667                get_state(PART:"elm.swallow.content", st, 30, vl);
1668                if (!strcmp(st, "visible"))
1669                  set_state(PART:"elm.swallow.content", "disabled_visible", 0.0);
1670                else
1671                  set_state(PART:"elm.swallow.content", "disabled", 0.0);
1672             }
1673          }
1674          program { name: "enable";
1675             signal: "elm,state,enabled";
1676             source: "elm";
1677             action: STATE_SET "default" 0.0;
1678             target: "disabler";
1679             target: "onrect";
1680             target: "offrect";
1681             after: "enable_text";
1682          }
1683          program { name: "enable_text";
1684             script {
1685                new st[31];
1686                new Float:vl;
1687                get_state(PART:"elm.text", st, 30, vl);
1688                if (!strcmp(st, "disabled_visible"))
1689                  set_state(PART:"elm.text", "visible", 0.0);
1690                else
1691                  set_state(PART:"elm.text", "default", 0.0);
1692                get_state(PART:"bg_image", st, 30, vl);
1693                if (!strcmp(st, "visible_disable")) {
1694                  set_state(PART:"bg_image", "visible", 0.0);
1695                  set_state(PART:"button", "on", 0.0);
1696                } else {
1697                  set_state(PART:"bg_image", "default", 0.0);
1698                  set_state(PART:"button", "default", 0.0);
1699                }
1700                get_state(PART:"elm.swallow.content", st, 30, vl);
1701                if (!strcmp(st, "visible"))
1702                  set_state(PART:"elm.swallow.content", "visible", 0.0);
1703                else
1704                  set_state(PART:"elm.swallow.content", "default", 0.0);
1705             }
1706          }
1707          program { name: "to_rtl";
1708             signal: "edje,state,rtl";
1709             source: "edje";
1710             script {
1711                set_int(is_rtl, 1);
1712             }
1713          }
1714          program { name: "to_ltr";
1715             signal: "edje,state,ltr";
1716             source: "edje";
1717             script {
1718                set_int(is_rtl, 0);
1719             }
1720          }
1721       }
1722    }
1723 ///////////////////////////////////////////////////////////////////////////////////////
1724
1725 #define CHECK_STYLE_FAVORITE(style_name, on_image, on_dim_image, off_image, off_dim_image, min_width, min_height) \
1726    group { name: "elm/check/base/"style_name; \
1727       images { \
1728          image: on_image COMP; \
1729          image: on_dim_image COMP; \
1730          image: off_image COMP; \
1731          image: off_dim_image COMP; \
1732       } \
1733       parts { \
1734          part { name: "back_bg"; \
1735             type: RECT; \
1736             scale: 1; \
1737             description { state: "default" 0.0; \
1738                visible: 0; \
1739                rel2.relative: 0.0 1.0; \
1740                align: 0 0.5; \
1741                min: min_width min_height; \
1742                fixed: 1 0; \
1743             } \
1744          } \
1745          part { name: "bg"; \
1746             type: RECT; \
1747             clip_to: "disclip"; \
1748             scale: 1; \
1749             description { state: "default" 0.0; \
1750                visible: 0; \
1751                rel1.to: "back_bg"; \
1752                rel2.to: "back_bg"; \
1753                min: min_width min_height; \
1754                max: min_width min_height; \
1755                fixed: 1 1; \
1756             } \
1757          } \
1758          part { name: "check"; \
1759             mouse_events: 0; \
1760             clip_to: "disclip"; \
1761             scale: 1; \
1762             description { state: "default" 0.0; \
1763                rel1.to: "bg"; \
1764                rel2.to: "bg"; \
1765                image.normal: off_image; \
1766             } \
1767             description { state: "visible" 0.0; \
1768                inherit: "default" 0.0; \
1769                image.normal: on_image; \
1770             } \
1771             description { state: "disabled" 0.0; \
1772                inherit: "default" 0.0; \
1773                image.normal: off_dim_image; \
1774             } \
1775             description { state: "disabled_visible" 0.0; \
1776                inherit: "default" 0.0; \
1777                image.normal: on_dim_image; \
1778             } \
1779          } \
1780          part { name: "elm.swallow.content"; \
1781             type: SWALLOW; \
1782             clip_to: "disclip"; \
1783             description { state: "default" 0.0; \
1784                fixed: 1 0; \
1785                visible: 0; \
1786                align: 0.0 0.5; \
1787                rel1 { \
1788                   to_x: "bg"; \
1789                   relative: 1.0 0.0; \
1790                   offset: 1 1; \
1791                } \
1792                rel2 { \
1793                   to_x: "bg"; \
1794                   relative: 1.0 1.0; \
1795                   offset: 2 -2; \
1796                } \
1797             } \
1798             description { state: "visible" 0.0; \
1799                inherit: "default" 0.0; \
1800                fixed: 1 1; \
1801                visible: 1; \
1802                aspect: 1.0 1.0; \
1803                aspect_preference: VERTICAL; \
1804             } \
1805             description { state: "disabled" 0.0; \
1806                inherit: "default" 0.0; \
1807             } \
1808             description { state: "disabled_visible" 0.0; \
1809                inherit: "default" 0.0; \
1810                fixed: 1 1; \
1811                visible: 1; \
1812                aspect: 1.0 1.0; \
1813             } \
1814          } \
1815          part { name: "elm.text"; \
1816             type: TEXTBLOCK; \
1817             clip_to: "disclip"; \
1818             mouse_events: 0; \
1819             scale: 1; \
1820             description { state: "default" 0.0; \
1821                visible: 0; \
1822                fixed: 0 1; \
1823                rel1 { \
1824                   relative: 1.0 0.5; \
1825                   offset: 1 1; \
1826                   to_x: "elm.swallow.content"; \
1827                } \
1828                rel2 { \
1829                   relative: 1.0 0.5; \
1830                   offset: -2 -2; \
1831                } \
1832                align: 0.0 0.5; \
1833                text { \
1834                  style: "check_label_textblock_style"; \
1835                  min: 0 0; \
1836                } \
1837             } \
1838             description { state: "visible" 0.0; \
1839                inherit: "default" 0.0; \
1840                visible: 1; \
1841                text.min: 1 1; \
1842             } \
1843             description { state: "disabled" 0.0; \
1844                inherit: "default" 0.0; \
1845             } \
1846             description { state: "disabled_visible" 0.0; \
1847                inherit: "default" 0.0; \
1848                visible: 1; \
1849                text { \
1850                  style: "check_label_textblock_style_disable"; \
1851                  min: 1 1; \
1852                } \
1853             } \
1854          } \
1855          part { name: "disclip"; \
1856             type: RECT; \
1857             mouse_events: 0; \
1858             description { state: "default" 0.0; \
1859                color: CHECK_DISCLIP_NORMAL_COLOR_INC; \
1860             } \
1861          } \
1862          part { name: "events"; \
1863             type: RECT; \
1864             ignore_flags: ON_HOLD; \
1865             description { state: "default" 0.0; \
1866                color: 0 0 0 0; \
1867             } \
1868          } \
1869          part { name: "disabler"; \
1870             type: RECT; \
1871             description { state: "default" 0.0; \
1872                color: 0 0 0 0; \
1873                visible: 0; \
1874             } \
1875             description { state: "disabled" 0.0; \
1876                inherit: "default" 0.0; \
1877                visible: 1; \
1878             } \
1879          } \
1880       } \
1881       programs { \
1882          program { name: "click"; \
1883             signal: "mouse,clicked,1"; \
1884             source: "events"; \
1885             action: SIGNAL_EMIT "elm,action,check,toggle" ""; \
1886             after: "touch_sound"; \
1887          } \
1888          program { name: "touch_sound"; \
1889             action: PLAY_SAMPLE "touch_sound" 1.0; \
1890          } \
1891          program { name: "check_on"; \
1892             signal: "elm,state,check,on"; \
1893             source: "elm"; \
1894             action: STATE_SET "visible" 0.0; \
1895             target: "check"; \
1896          } \
1897          program { name: "check_off"; \
1898             signal: "elm,state,check,off"; \
1899             source: "elm"; \
1900             action: STATE_SET "default" 0.0; \
1901             target: "check"; \
1902          } \
1903          program { name: "text_show"; \
1904             signal: "elm,state,text,visible"; \
1905             source: "elm"; \
1906             action: STATE_SET "visible" 0.0; \
1907             target: "elm.text"; \
1908          } \
1909          program { name: "text_hide"; \
1910             signal: "elm,state,text,hidden"; \
1911             source: "elm"; \
1912             action: STATE_SET "default" 0.0; \
1913             target: "elm.text"; \
1914          } \
1915          program { name: "icon_show"; \
1916             signal: "elm,state,icon,visible"; \
1917             source: "elm"; \
1918             action: STATE_SET "visible" 0.0; \
1919             target: "elm.swallow.content"; \
1920          } \
1921          program { name: "icon_hide"; \
1922             signal: "elm,state,icon,hidden"; \
1923             source: "elm"; \
1924             action: STATE_SET "default" 0.0; \
1925             target: "elm.swallow.content"; \
1926          } \
1927          program { name: "disable"; \
1928             signal: "elm,state,disabled"; \
1929             source: "elm"; \
1930             action: STATE_SET "disabled" 0.0; \
1931             target: "disabler"; \
1932             after: "disable_text"; \
1933          } \
1934          program { name: "disable_text"; \
1935             script { \
1936                new st[31]; \
1937                new Float:vl; \
1938                get_state(PART:"elm.text", st, 30, vl); \
1939                if (!strcmp(st, "visible")) \
1940                  set_state(PART:"elm.text", "disabled_visible", 0.0); \
1941                else \
1942                  set_state(PART:"elm.text", "disabled", 0.0); \
1943                get_state(PART:"elm.swallow.content", st, 30, vl); \
1944                if (!strcmp(st, "visible")) \
1945                  set_state(PART:"elm.swallow.content", "disabled_visible", 0.0); \
1946                else \
1947                  set_state(PART:"elm.swallow.content", "disabled", 0.0); \
1948                get_state(PART:"check", st, 30, vl); \
1949                if (!strcmp(st, "visible")) \
1950                  set_state(PART:"check", "disabled_visible", 0.0); \
1951                else \
1952                  set_state(PART:"check", "disabled", 0.0); \
1953             } \
1954          } \
1955          program { name: "enable"; \
1956             signal: "elm,state,enabled"; \
1957             source: "elm"; \
1958             action: STATE_SET "default" 0.0; \
1959             target: "disabler"; \
1960             after: "enable_text"; \
1961          } \
1962          program { name: "enable_text"; \
1963             script { \
1964                new st[31]; \
1965                new Float:vl; \
1966                get_state(PART:"elm.text", st, 30, vl); \
1967                if (!strcmp(st, "disabled_visible")) \
1968                  set_state(PART:"elm.text", "visible", 0.0); \
1969                else \
1970                  set_state(PART:"elm.text", "default", 0.0); \
1971                get_state(PART:"elm.swallow.content", st, 30, vl); \
1972                if (!strcmp(st, "visible")) \
1973                  set_state(PART:"elm.swallow.content", "visible", 0.0); \
1974                else \
1975                  set_state(PART:"elm.swallow.content", "default", 0.0); \
1976                get_state(PART:"check", st, 30, vl); \
1977                if (!strcmp(st, "disabled_visible")) \
1978                  set_state(PART:"check", "visible", 0.0); \
1979                else \
1980                  set_state(PART:"check", "default", 0.0); \
1981             } \
1982          } \
1983       } \
1984    }
1985 ////////////////////////////////////////////////////////////////////////////////
1986 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)
1987 ////////////////////////////////////////////////////////////////////////////////
1988 CHECK_STYLE_FAVORITE("favorite_small", "00_icon_favorite_on_45x45.png", "00_icon_favorite_on_45x45_dim.png", "00_icon_favorite_off_45x45.png", "00_icon_favorite_off_45x45_dim.png", CHECK_STYLE_FAVORITE_SMALL_DEFAULT_BG_IMAGE_MIN_WIDTH_INC, CHECK_STYLE_FAVORITE_SMALL_DEFAULT_BG_IMAGE_MIN_HEIGHT_INC)
1989 ////////////////////////////////////////////////////////////////////////////////
1990 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)
1991 ////////////////////////////////////////////////////////////////////////////////
1992
1993    group { name: "elm/check/base/grid";
1994       images {
1995          image: "00_check_bg.png" COMP;
1996          image: "00_check_dim_bg.png" COMP;
1997          image: "00_check_activated_dim.png" COMP;
1998          image: "00_check_activated_press.png" COMP;
1999          image: "00_check_activated.png" COMP;
2000          image: "00_check_press_bg.png" COMP;
2001          image: "00_check_focus.png" COMP;
2002       }
2003       script {
2004          public check_state = CHECK_STATE_DEFAULT;
2005          public check_visible = CHECK_HIDE;
2006       }
2007       parts {
2008          part { name: "bg";
2009             type: RECT;
2010             scale: 1;
2011             description { state: "default" 0.0;
2012                visible: 0;
2013             }
2014          }
2015          part { name: "top_left_padding";
2016             type: RECT;
2017             mouse_events: 0;
2018             scale: 1;
2019             description { state: "default" 0.0;
2020                visible: 0;
2021                min: GENGRID_ITEM_CHECK_TOP_RIGHT_PADDING_INC;
2022                align: 0.0 0.0;
2023                fixed: 1 1;
2024                rel1 {
2025                   relative: 0.0 0.0;
2026                   to: "bg";
2027                }
2028                rel2 {
2029                   relative: 0.0 0.0;
2030                   to: "bg";
2031                }
2032             }
2033          }
2034          part { name: "bg2";
2035             mouse_events: 0;
2036             scale: 1;
2037             description { state: "default" 0.0;
2038                min: GENGRID_EDIT_MODE_CHECK_SIZE_INC;
2039                align: 0.0 0.0;
2040                fixed: 1 1;
2041                rel1 {
2042                   relative: 1.0 1.0;
2043                   to: "top_left_padding";
2044                }
2045                rel2 {
2046                   relative: 1.0 1.0;
2047                   to: "top_left_padding";
2048                }
2049                image.normal: "00_check_bg.png";
2050             }
2051             description { state: "visible" 0.0;
2052                inherit: "default" 0.0;
2053             }
2054             description { state: "pressed" 0.0;
2055                inherit: "default" 0.0;
2056                image.normal: "00_check_press_bg.png";
2057             }
2058             description { state: "disabled" 0.0;
2059                inherit: "default" 0.0;
2060                image.normal: "00_check_dim_bg.png";
2061             }
2062          }
2063          part { name: "check";
2064             mouse_events: 0;
2065             clip_to: "sequence_clip";
2066             scale: 1;
2067             description { state: "default" 0.0;
2068                visible: 0;
2069                rel1.to: "bg2";
2070                rel2.to: "bg2";
2071                image.normal: "00_check_activated.png";
2072                color: 255 255 255 0;
2073             }
2074             description { state: "visible" 0.0;
2075                inherit: "default" 0.0;
2076                visible: 1;
2077                color: 255 255 255 255;
2078             }
2079             description { state: "pressed" 0.0;
2080                inherit: "visible" 0.0;
2081                image.normal: "00_check_activated_press.png";
2082             }
2083             description { state: "disabled_visible" 0.0;
2084                inherit: "default" 0.0;
2085                visible: 1;
2086                image.normal: "00_check_activated_dim.png";
2087             }
2088          }
2089          part { name: "sequence_clip";
2090             type: RECT;
2091             mouse_events: 0;
2092             description { state: "default" 0.0;
2093                rel1.to: "bg2";
2094                rel2.to: "bg2";
2095                rel2.relative: 0.0 1.0;
2096                color: 255 255 255 255;
2097             }
2098             description { state: "visible" 0.0;
2099                inherit: "default" 0.0;
2100                rel2.relative: 1.0 1.0;
2101             }
2102          }
2103          part { name: "elm.swallow.content";
2104             type: SWALLOW;
2105             description {
2106                state: "default" 0.0;
2107                fixed: 1 0;
2108                visible: 0;
2109                color: 255 255 255 255;
2110                align: 0.0 0.5;
2111                rel1 {
2112                   to_x: "bg2";
2113                   relative: 1.0 0.0;
2114                   offset: 1 1;
2115                }
2116                rel2 {
2117                   to_x: "bg2";
2118                   relative: 1.0 1.0;
2119                   offset: 2 -2;
2120                }
2121             }
2122             description { state: "visible" 0.0;
2123                inherit: "default" 0.0;
2124                fixed: 1 1;
2125                visible: 1;
2126                aspect: 1.0 1.0;
2127                aspect_preference: VERTICAL;
2128             }
2129             description { state: "disabled" 0.0;
2130                inherit: "default" 0.0;
2131                color: 128 128 128 128;
2132             }
2133             description { state: "disabled_visible" 0.0;
2134                inherit: "default" 0.0;
2135                color: 128 128 128 128;
2136                fixed: 1 1;
2137                visible: 1;
2138                aspect: 1.0 1.0;
2139             }
2140          }
2141          part { name: "elm.text";
2142             type: TEXTBLOCK;
2143             mouse_events: 0;
2144             scale: 1;
2145             description { state: "default" 0.0;
2146                visible: 0;
2147                fixed: 0 1;
2148                rel1 {
2149                   relative: 1.0 0.5;
2150                   offset: 1 1;
2151                   to_x: "elm.swallow.content";
2152                }
2153                rel2 {
2154                   relative: 1.0 0.5;
2155                   offset: -2 -2;
2156                }
2157                color: 255 255 255 255;
2158                align: 0.0 0.5;
2159                text {
2160                   style: "check_label_textblock_style";
2161                   min: 0 0;
2162                }
2163             }
2164             description { state: "visible" 0.0;
2165                inherit: "default" 0.0;
2166                visible: 1;
2167                text.min: 1 1;
2168             }
2169             description { state: "disabled" 0.0;
2170                inherit: "default" 0.0;
2171             }
2172             description { state: "disabled_visible" 0.0;
2173                inherit: "default" 0.0;
2174                visible: 1;
2175                text {
2176                   style: "check_label_textblock_style_disable";
2177                   min: 1 1;
2178                }
2179             }
2180          }
2181          part { name: "events";
2182             type: RECT;
2183             ignore_flags: ON_HOLD;
2184             description { state: "default" 0.0;
2185                color: 0 0 0 0;
2186             }
2187          }
2188          part { name: "disabler";
2189             type: RECT;
2190             description { state: "default" 0.0;
2191                color: 0 0 0 0;
2192                visible: 0;
2193             }
2194             description { state: "disabled" 0.0;
2195                inherit: "default" 0.0;
2196                visible: 1;
2197             }
2198          }
2199       }
2200       programs {
2201          program { name: "show";
2202             signal: "show";
2203             script {
2204                set_int(check_visible, CHECK_SHOW);
2205             }
2206          }
2207          program { name: "hide";
2208             signal: "hide";
2209             script {
2210                set_int(check_visible, CHECK_HIDE);
2211             }
2212          }
2213          program { name: "click";
2214             signal: "mouse,clicked,1";
2215             source: "events";
2216             action: SIGNAL_EMIT "elm,action,check,toggle" "";
2217             after: "bg_normal";
2218          }
2219          program { name: "bg_normal";
2220             script {
2221                set_state(PART:"bg2", "default", 0.0);
2222             }
2223          }
2224          program { name: "unpress";
2225             signal: "mouse,up,1";
2226             source: "events";
2227             action: STATE_SET "default" 0.0;
2228             target: "bg2";
2229          }
2230          program { name: "pressed";
2231             signal: "mouse,down,1";
2232             source: "events";
2233             script {
2234                new st[31];
2235                new Float:vl;
2236                get_state(PART:"check", st, 30, vl);
2237                if (!strcmp(st, "visible"))
2238                  {
2239                     set_state(PART:"check", "pressed", 0.0);
2240                  }
2241                set_state(PART:"bg2", "pressed", 0.0);
2242             }
2243          }
2244          program { name: "mouse,out";
2245             signal: "mouse,out";
2246             source: "events";
2247             script {
2248                if (get_int(check_state) == CHECK_STATE_VISIBLE)
2249                  {
2250                     set_state(PART:"check", "visible", 0.0);
2251                     set_state(PART:"sequence_clip", "visible", 0.0);
2252                     set_state(PART:"bg2", "visible", 0.0);
2253                  }
2254                else
2255                  {
2256                     set_state(PART:"check", "default", 0.0);
2257                     set_state(PART:"sequence_clip", "default", 0.0);
2258                     set_state(PART:"bg2", "default", 0.0);
2259                  }
2260             }
2261          }
2262          program { name: "check_on";
2263             signal: "elm,state,check,on";
2264             source: "elm";
2265             script {
2266                set_int(check_state, CHECK_STATE_VISIBLE);
2267                if (get_int(check_visible) == CHECK_SHOW)
2268                  {
2269                     run_program(PROGRAM:"check_show_effect");
2270                     run_program(PROGRAM:"check_draw_effect");
2271                  }
2272                else
2273                  {
2274                     set_state(PART:"check", "visible", 0.0);
2275                     set_state(PART:"sequence_clip", "visible", 0.0);
2276                  }
2277                set_state(PART:"bg2", "visible", 0.0);
2278             }
2279          }
2280          program { name: "check_off";
2281             signal: "elm,state,check,off";
2282             source: "elm";
2283             action: STATE_SET "default" 0.0;
2284             target: "check";
2285             script {
2286                if (get_int(check_state) == CHECK_STATE_VISIBLE)
2287                  {
2288                     set_int(check_state, CHECK_STATE_DEFAULT);
2289                     set_state(PART:"check", "default", 0.0);
2290                     set_state(PART:"sequence_clip", "default", 0.0);
2291                  }
2292                set_state(PART:"bg2", "default", 0.0);
2293             }
2294          }
2295          program { name: "check_show_effect";
2296             action: STATE_SET "visible" 0.0;
2297             transition: LINEAR 0.233;
2298             target: "check";
2299          }
2300          program { name: "check_draw_effect";
2301             action: STATE_SET "visible" 0.0;
2302             transition: LINEAR 0.267;
2303             target: "sequence_clip";
2304          }
2305          program { name: "text_show";
2306             signal: "elm,state,text,visible";
2307             source: "elm";
2308             action: STATE_SET "visible" 0.0;
2309             target: "elm.text";
2310          }
2311          program { name: "text_hide";
2312             signal: "elm,state,text,hidden";
2313             source: "elm";
2314             action: STATE_SET "default" 0.0;
2315             target: "elm.text";
2316          }
2317          program { name: "icon_show";
2318             signal: "elm,state,icon,visible";
2319             source: "elm";
2320             action: STATE_SET "visible" 0.0;
2321             target: "elm.swallow.content";
2322          }
2323          program { name: "icon_hide";
2324             signal: "elm,state,icon,hidden";
2325             source: "elm";
2326             action: STATE_SET "default" 0.0;
2327             target: "elm.swallow.content";
2328          }
2329          program { name: "disable";
2330             signal: "elm,state,disabled";
2331             source: "elm";
2332             action: STATE_SET "disabled" 0.0;
2333             target: "disabler";
2334             target: "bg2";
2335             after: "disable_text";
2336          }
2337          program { name: "disable_text";
2338             script {
2339                new st[31];
2340                new Float:vl;
2341                get_state(PART:"elm.text", st, 30, vl);
2342                if (!strcmp(st, "visible"))
2343                  set_state(PART:"elm.text", "disabled_visible", 0.0);
2344                else
2345                  set_state(PART:"elm.text", "disabled", 0.0);
2346                get_state(PART:"elm.swallow.content", st, 30, vl);
2347                if (!strcmp(st, "visible"))
2348                  set_state(PART:"elm.swallow.content", "disabled_visible", 0.0);
2349                else
2350                  set_state(PART:"elm.swallow.content", "disabled", 0.0);
2351                get_state(PART:"check", st, 30, vl);
2352                if (!strcmp(st, "visible"))
2353                  {
2354                     set_state(PART:"check", "disabled_visible", 0.0);
2355                     set_int(check_state, CHECK_STATE_DISABLED_VISIBLE);
2356                  }
2357             }
2358          }
2359          program { name: "enable";
2360             signal: "elm,state,enabled";
2361             source: "elm";
2362             action: STATE_SET "default" 0.0;
2363             target: "disabler";
2364             target: "bg2";
2365             after: "enable_text";
2366          }
2367          program { name: "enable_text";
2368             script {
2369                new st[31];
2370                new Float:vl;
2371                get_state(PART:"elm.text", st, 30, vl);
2372                if (!strcmp(st, "disabled_visible"))
2373                  set_state(PART:"elm.text", "visible", 0.0);
2374                else
2375                  set_state(PART:"elm.text", "default", 0.0);
2376                get_state(PART:"elm.swallow.content", st, 30, vl);
2377                if (!strcmp(st, "visible"))
2378                  set_state(PART:"elm.swallow.content", "visible", 0.0);
2379                else
2380                  set_state(PART:"elm.swallow.content", "default", 0.0);
2381                get_state(PART:"check", st, 30, vl);
2382                if (!strcmp(st, "disabled_visible"))
2383                  {
2384                     set_state(PART:"check", "visible", 0.0);
2385                     set_state(PART:"sequence_clip", "visible", 0.0);
2386                     set_int(check_state, CHECK_STATE_VISIBLE);
2387                  }
2388                else
2389                  set_int(check_state, CHECK_STATE_DEFAULT);
2390             }
2391          }
2392       }
2393    }
2394
2395 #undef CHECK_STATE_DEFAULT
2396 #undef CHECK_STATE_VISIBLE
2397 #undef CHECK_STATE_DISABLED_VISIBLE
2398 #undef CHECK_STATE_DISABLED
2399
2400 #undef CHECK_HIDE
2401 #undef CHECK_SHOW