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