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