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