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