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