1fb5acaf8c85d5af9fa80dbcced3eb3345593291
[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_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_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_FOR_GENLIST(style_name, min_width, min_height) \
421    group { name: "elm/check/base/"style_name; \
422       images { \
423          image: "00_check_bg.png" COMP; \
424          image: "00_check_dim_bg.png" COMP; \
425          image: "00_check_dim.png" COMP; \
426          image: "00_check_Activated.png" COMP; \
427       } \
428       script { \
429          public check_state = CHECK_STATE_DEFAULT; \
430       } \
431       parts { \
432          part { name: "back_bg"; \
433             type: RECT; \
434             scale: 1; \
435             description { state: "default" 0.0; \
436                min: min_width min_height; \
437                fixed: 0 0; \
438                color: 0 0 0 0; \
439             } \
440          } \
441          part { name: "bg"; \
442             mouse_events: 0; \
443             scale: 1; \
444             description { state: "default" 0.0; \
445                min: CHECK_STYLE_DEFAULT_BG_NORMAL_MIN_MAX_INC; \
446                max: CHECK_STYLE_DEFAULT_BG_NORMAL_MIN_MAX_INC; \
447                fixed: 1 1; \
448                rel1.to: "back_bg"; \
449                rel2.to: "back_bg"; \
450                image.normal: "00_check_bg.png"; \
451                fill.smooth : 0; \
452             } \
453             description { state: "disabled" 0.0; \
454                inherit: "default" 0.0; \
455                image.normal: "00_check_dim_bg.png"; \
456             } \
457          } \
458          part { name: "check"; \
459             mouse_events: 0; \
460             scale: 1; \
461             description { state: "default" 0.0; \
462                rel1.to: "bg"; \
463                rel2.to: "bg"; \
464                visible: 0; \
465                image.normal: "00_check_Activated.png"; \
466             } \
467             description { state: "visible" 0.0; \
468                inherit: "default" 0.0; \
469                visible: 1; \
470             } \
471             description { state: "disabled_visible" 0.0; \
472                inherit: "default" 0.0; \
473                visible: 1; \
474                image.normal: "00_check_dim.png"; \
475             } \
476          } \
477          part { name: "elm.swallow.content"; \
478             type: SWALLOW; \
479             clip_to: "disclip"; \
480             description { state: "default" 0.0; \
481                fixed: 1 0; \
482                visible: 0; \
483                align: 0.0 0.5; \
484                rel1 { \
485                   to_x: "bg"; \
486                   relative: 1.0 0.0; \
487                   offset: 1 1; \
488                } \
489                rel2 { \
490                   to_x: "bg"; \
491                   relative: 1.0 1.0; \
492                   offset: 2 -2; \
493                } \
494             } \
495             description { state: "visible" 0.0; \
496                inherit: "default" 0.0; \
497                fixed: 1 1; \
498                visible: 1; \
499                aspect: 1.0 1.0; \
500                aspect_preference: VERTICAL; \
501             } \
502             description { state: "disabled" 0.0; \
503                inherit: "default" 0.0; \
504             } \
505             description { state: "disabled_visible" 0.0; \
506                inherit: "default" 0.0; \
507                fixed: 1 1; \
508                visible: 1; \
509                aspect: 1.0 1.0; \
510             } \
511          } \
512          part { name: "elm.text"; \
513             type: TEXTBLOCK; \
514             mouse_events: 0; \
515             clip_to: "disclip"; \
516             scale: 1; \
517             description { state: "default" 0.0; \
518                visible: 0; \
519                fixed: 0 1; \
520                rel1 { \
521                   relative: 1.0 0.5; \
522                   offset: 1 1; \
523                   to_x: "elm.swallow.content"; \
524                } \
525                rel2 { \
526                   relative: 1.0 0.5; \
527                   offset: -2 -2; \
528                } \
529                align: 0.0 0.5; \
530                text { \
531                   style: "check_label_textblock_style"; \
532                   min: 0 0; \
533                } \
534                color: CHECK_DEFAULT_TEXT_NORMAL_COLOR_INC; \
535             } \
536             description { state: "visible" 0.0; \
537                inherit: "default" 0.0; \
538                visible: 1; \
539                text.min: 1 1; \
540             } \
541             description { state: "disabled" 0.0; \
542                inherit: "default" 0.0; \
543             } \
544             description { state: "disabled_visible" 0.0; \
545                inherit: "default" 0.0; \
546                visible: 1; \
547                text.min: 1 1; \
548                color: CHECK_DEFAULT_TEXT_DISABLED_COLOR_INC; \
549             } \
550          } \
551          part { name: "events1"; \
552             type: RECT; \
553             ignore_flags: ON_HOLD; \
554             description { state: "default" 0.0; \
555                color: 0 0 0 0; \
556             } \
557          } \
558          part { name: "events2"; \
559             type: RECT; \
560             repeat_events: 1; \
561             description { state: "default" 0.0; \
562                color: 0 0 0 0; \
563             } \
564          } \
565          part { name: "disclip"; \
566             type: RECT; \
567             mouse_events: 0; \
568             description { state: "default" 0.0; \
569                color: CHECK_DISCLIP_NORMAL_COLOR_INC; \
570             } \
571             description { state: "disabled" 0.0; \
572                inherit: "default" 0.0; \
573                color: CHECK_DISCLIP_DISABLED_COLOR_INC; \
574             } \
575          } \
576          part { name: "disabler"; \
577             type: RECT; \
578             description { state: "default" 0.0; \
579                color: 0 0 0 0; \
580                visible: 0; \
581             } \
582             description { state: "disabled" 0.0; \
583                inherit: "default" 0.0; \
584                visible: 1; \
585             } \
586          } \
587       } \
588       programs { \
589          program { name: "click"; \
590             signal: "mouse,clicked,1"; \
591             source: "events1"; \
592             action: SIGNAL_EMIT "elm,action,check,toggle" ""; \
593             after: "touch_sound"; \
594          } \
595          program { name: "touch_sound"; \
596             action: PLAY_SAMPLE "touch_sound" 1.0; \
597          } \
598          program { name: "check_on"; \
599             signal: "elm,state,check,on"; \
600             source: "elm"; \
601             script { \
602                set_int(check_state, CHECK_STATE_VISIBLE); \
603                set_state(PART:"check", "visible", 0.0); \
604             } \
605          } \
606          program { name: "check_off"; \
607             signal: "elm,state,check,off"; \
608             source: "elm"; \
609             action: STATE_SET "default" 0.0; \
610             target: "check"; \
611             script { \
612                if (get_int(check_state) == CHECK_STATE_VISIBLE) \
613                  { \
614                     set_int(check_state, CHECK_STATE_DEFAULT); \
615                     set_state(PART:"check", "default", 0.0); \
616                  } \
617             } \
618          } \
619          program { name: "text_show"; \
620             signal: "elm,state,text,visible"; \
621             source: "elm"; \
622             action: STATE_SET "visible" 0.0; \
623             target: "elm.text"; \
624          } \
625          program { name: "text_hide"; \
626             signal: "elm,state,text,hidden"; \
627             source: "elm"; \
628             action: STATE_SET "default" 0.0; \
629             target: "elm.text"; \
630          } \
631          program { name: "icon_show"; \
632             signal: "elm,state,icon,visible"; \
633             source: "elm"; \
634             action: STATE_SET "visible" 0.0; \
635             target: "elm.swallow.content"; \
636          } \
637          program { name: "icon_hide"; \
638             signal: "elm,state,icon,hidden"; \
639             source: "elm"; \
640             action: STATE_SET "default" 0.0; \
641             target: "elm.swallow.content"; \
642          } \
643          program { name: "disable"; \
644             signal: "elm,state,disabled"; \
645             source: "elm"; \
646             action: STATE_SET "disabled" 0.0; \
647             target: "disabler"; \
648             target: "disclip"; \
649             target: "bg"; \
650             after: "disable_text"; \
651          } \
652          program { name: "disable_text"; \
653             script { \
654                new st[31]; \
655                new Float:vl; \
656                get_state(PART:"elm.text", st, 30, vl); \
657                if (!strcmp(st, "visible")) \
658                  set_state(PART:"elm.text", "disabled_visible", 0.0); \
659                else \
660                  set_state(PART:"elm.text", "disabled", 0.0); \
661                get_state(PART:"elm.swallow.content", st, 30, vl); \
662                if (!strcmp(st, "visible")) \
663                  set_state(PART:"elm.swallow.content", "disabled_visible", 0.0); \
664                else \
665                  set_state(PART:"elm.swallow.content", "disabled", 0.0); \
666                get_state(PART:"check", st, 30, vl); \
667                if (!strcmp(st, "visible")) \
668                  { \
669                     set_state(PART:"check", "disabled_visible", 0.0); \
670                     set_int(check_state, CHECK_STATE_DISABLED_VISIBLE); \
671                  } \
672             } \
673          } \
674          program { name: "enable"; \
675             signal: "elm,state,enabled"; \
676             source: "elm"; \
677             action: STATE_SET "default" 0.0; \
678             target: "disabler"; \
679             target: "disclip"; \
680             target: "bg"; \
681             after: "enable_text"; \
682          } \
683          program { name: "enable_text"; \
684             script { \
685                new st[31]; \
686                new Float:vl; \
687                get_state(PART:"elm.text", st, 30, vl); \
688                if (!strcmp(st, "disabled_visible")) \
689                  set_state(PART:"elm.text", "visible", 0.0); \
690                else \
691                  set_state(PART:"elm.text", "default", 0.0); \
692                get_state(PART:"elm.swallow.content", st, 30, vl); \
693                if (!strcmp(st, "visible")) \
694                  set_state(PART:"elm.swallow.content", "visible", 0.0); \
695                else \
696                  set_state(PART:"elm.swallow.content", "default", 0.0); \
697                get_state(PART:"check", st, 30, vl); \
698                if (!strcmp(st, "disabled_visible")) \
699                  { \
700                     set_state(PART:"check", "visible", 0.0); \
701                     set_int(check_state, CHECK_STATE_VISIBLE); \
702                  } \
703                else \
704                  set_int(check_state, CHECK_STATE_DEFAULT); \
705             } \
706          } \
707       } \
708    }
709 ////////////////////////////////////////////////////////////////////////////////
710 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)
711 ////////////////////////////////////////////////////////////////////////////////
712    styles {
713       style { name: "check_label_textblock_style";
714          base: "font=Tizen:style=Roman font_size="CHECK_DEFAULT_TEXT_FONT_SIZE_INC" color=#ffffff wrap=char text_class=tizen";
715          tag: "br" "\n";
716          tag: "ps" "ps";
717          tag: "hilight" "+ font=Tizen:style=Bold";
718          tag: "b" "+ font=Tizen:style=Bold";
719          tag: "whitecolor" "+ color=#ffffff";
720          tag: "tab" "\t";
721       }
722    }
723
724    group { name: "elm/check/base/on&off";
725       images {
726          image: "00_button_on.png" COMP;
727          image: "00_button_on_dim.png" COMP;
728          image: "00_button_off.png" COMP;
729          image: "00_button_off_dim.png" COMP;
730          image: "00_button_on_off_handler.png" COMP;
731          image: "00_button_on_off_handler_dim.png" COMP;
732       }
733       script {
734          public is_rtl = 0;
735          public is_drag = 0;
736          public was_drag = 0;
737          public check_on = 0;
738       }
739       parts {
740          part { name: "bg";
741             type: RECT;
742             mouse_events: 1;
743             scale: 1;
744             description { state: "default" 0.0;
745                min: CHECK_ONOFF_BG_NORMAL_MIN_MAX_INC;
746                max: CHECK_ONOFF_BG_NORMAL_MIN_MAX_INC;
747                rel2.relative: 0.0 1.0;
748                fixed: 1 1;
749                align: 0.0 0.5;
750                visible: 0;
751             }
752          }
753          part { name: "padding_left";
754             type: RECT;
755             scale: 1;
756             mouse_events: 0;
757             description { state: "default" 0.0;
758                align: 0.0 0.0;
759                rel1{ relative: 0.0 0.0; to: "bg"; }
760                rel2{ relative: 0.0 1.0; to: "bg"; }
761                min: 0 0;
762                fixed: 1 1;
763                color: 0 0 0 0;
764             }
765          }
766          part { name: "padding_right";
767             type: RECT;
768             scale: 1;
769             mouse_events: 0;
770             description { state: "default" 0.0;
771                align: 1.0 0.0;
772                rel1 {
773                   relative: 1.0 0.0;
774                   to: "bg";
775                }
776                rel2 {
777                   relative: 1.0 1.0;
778                   to: "bg";
779                }
780                min: 0 0;
781                fixed: 1 1;
782                color: 0 0 0 0;
783             }
784          }
785          part { name: "padding_top";
786             type: RECT;
787             scale: 1;
788             mouse_events: 0;
789             description { state: "default" 0.0;
790                align: 0.0 0.0;
791                rel1.to: "bg";
792                rel2 {
793                   relative: 1.0 0.0;
794                   to: "bg";
795                }
796                min: 0 0;
797                fixed: 1 1;
798                color: 0 0 0 0;
799             }
800          }
801          part { name: "padding_bottom";
802             type: RECT;
803             scale: 1;
804             mouse_events: 0;
805             description { state: "default" 0.0;
806                align: 1.0 1.0;
807                rel1 {
808                   relative: 0.0 1.0;
809                   to: "bg";
810                }
811                rel2 {
812                   relative: 1.0 1.0;
813                   to: "bg";
814                }
815                min: 0 0;
816                fixed: 0 1;
817                color: 0 0 0 0;
818             }
819          }
820          part { name: "bg_image";
821             mouse_events: 0;
822             scale: 1;
823             description { state: "default" 0.0;
824                align: 0.0 0.5;
825                rel1 {
826                   relative: 0.0 1.0;
827                   to_x: "bg";
828                   to_y: "padding_top";
829                }
830                rel2 {
831                   relative: 1.0 0.0;
832                   to_x: "bg";
833                   to_y: "padding_bottom";
834                }
835                image.normal: "00_button_off.png";
836             }
837             description { state: "visible" 0.0;
838                inherit: "default" 0.0;
839                image.normal: "00_button_on.png";
840             }
841             description { state: "pressed" 0.0;
842                inherit: "default" 0.0;
843                image.normal: "00_button_off.png";
844             }
845             description { state: "visible_pressed" 0.0;
846                inherit: "default" 0.0;
847                image.normal: "00_button_on.png";
848             }
849             description { state: "visible_disable" 0.0;
850                inherit: "default" 0.0;
851                image.normal: "00_button_on_dim.png";
852             }
853             description { state: "off_disable" 0.0;
854                inherit: "default" 0.0;
855                image.normal: "00_button_off_dim.png";
856             }
857          }
858          part { name: "drag_container";
859             type: RECT;
860             scale: 1;
861             mouse_events: 0;
862             description { state: "default" 0.0;
863                rel1 {
864                   relative: 1.0 0.0;
865                   to_x: "padding_left";
866                   to_y: "bg";
867                }
868                rel2 {
869                   relative: 0.0 1.0;
870                   to_x: "padding_right";
871                   to_y: "bg";
872                }
873                color: 0 0 0 0;
874             }
875          }
876          part { name: "clipper";
877             type: RECT;
878             mouse_events: 0;
879             description { state: "default" 0.0;
880                rel1.to: "bg";
881                rel2.to: "bg";
882                color: 255 255 255 255;
883             }
884          }
885          part { name: "clipper_inner";
886             type: RECT;
887             mouse_events: 0;
888             description { state: "default" 0.0;
889                rel1.to: "bg_image";
890                rel2.to: "bg_image";
891                color: 255 255 255 255;
892             }
893          }
894          part { name: "button";
895             scale: 1;
896             clip_to: "clipper";
897             mouse_events: 1;
898             dragable {
899                x: 1 1 0;
900                y: 0 0 0;
901                confine: "drag_container";
902             }
903             description { state: "default" 0.0;
904                min: CHECK_ONOFF_HANDLER_MIN_MAX_INC;
905                max: CHECK_ONOFF_HANDLER_MIN_MAX_INC;
906                rel1.to: "bg";
907                rel2.to: "bg";
908                align: 0.0 0.5;
909                fixed: 1 1;
910                image.normal: "00_button_on_off_handler.png";
911             }
912             description { state: "disabled" 0.0;
913                inherit: "default" 0.0;
914                image.normal: "00_button_on_off_handler_dim.png";
915             }
916          }
917          part { name: "button_events";
918             type: RECT;
919             dragable {
920                events: "button";
921             }
922             description { state: "default" 0.0;
923                rel1.to_x: "bg";
924                rel2.to_x: "bg";
925                color: 0 0 0 0;
926             }
927          }
928          part { name: "onrect";
929             type: RECT;
930             scale: 1;
931             clip_to: "clipper";
932             mouse_events: 0;
933             description { state: "default" 0.0;
934                rel1 {
935                   relative: -1.0 0.0;
936                   to: "button";
937                }
938                rel2 {
939                   relative: 0.0 1.0;
940                   to: "button";
941                }
942                align: 1.0 0.5;
943                color: 0 0 0 0;
944             }
945          }
946          part { name: "offrect";
947             type: RECT;
948             scale: 1;
949             clip_to: "clipper";
950             mouse_events: 0;
951             description { state: "default" 0.0;
952                rel1 {
953                   relative: 1.0 0.0;
954                   to: "button";
955                }
956                rel2 {
957                   relative: 2.0 1.0;
958                   to: "button";
959                }
960                color: 0 0 0 0;
961             }
962          }
963          part { name: "elm.offtext";
964             type: TEXT;
965             mouse_events: 0;
966             scale: 1;
967             clip_to: "clipper_inner";
968             description { state: "default" 0.0;
969                rel1.to: "offrect";
970                rel2.to: "offrect";
971                color: 255 255 255 255;
972                text {
973                   font: "Tizen:style=Medium";
974                   size: 20;
975                   min: 0 1;
976                   text_class: "tizen";
977                }
978             }
979             description { state: "disabled" 0.0;
980                inherit: "default" 0.0;
981                color: 128 128 128 128;
982             }
983          }
984          part { name: "elm.ontext";
985             type: TEXT;
986             mouse_events: 0;
987             scale: 1;
988             clip_to: "clipper_inner";
989             description { state: "default" 0.0;
990                rel1.to: "onrect";
991                rel2.to: "onrect";
992                color: 255 255 255 255;
993                text {
994                   font: "Tizen:style=Medium";
995                   size: 20;
996                   min: 0 1;
997                   text_class: "tizen";
998                }
999             }
1000             description { state: "disabled" 0.0;
1001                inherit: "default" 0.0;
1002                color: 128 128 128 128;
1003             }
1004          }
1005          part { name: "elm.swallow.content";
1006             type: SWALLOW;
1007             clip_to: "disclip";
1008             description { state: "default" 0.0;
1009                fixed: 1 0;
1010                visible: 0;
1011                align: 0.0 0.5;
1012                rel1 {
1013                   to_x: "bg";
1014                   relative: 1.0 0.0;
1015                }
1016                rel2 {
1017                   to_x: "bg";
1018                   relative: 1.0 1.0;
1019                }
1020             }
1021             description { state: "visible" 0.0;
1022                inherit: "default" 0.0;
1023                fixed: 1 1;
1024                visible: 1;
1025                aspect: 1.0 1.0;
1026                aspect_preference: VERTICAL;
1027             }
1028             description { state: "disabled" 0.0;
1029                inherit: "default" 0.0;
1030             }
1031             description { state: "disabled_visible" 0.0;
1032                inherit: "default" 0.0;
1033                fixed: 1 1;
1034                visible: 1;
1035                aspect: 1.0 1.0;
1036             }
1037          }
1038          part { name: "elm.text";
1039             type: TEXTBLOCK;
1040             mouse_events: 0;
1041             scale: 1;
1042             clip_to: "disclip";
1043             description { state: "default" 0.0;
1044                visible: 0;
1045                fixed: 0 1;
1046                rel1 {
1047                   relative: 1.0 0.5;
1048                   offset: 1 1;
1049                   to_x: "elm.swallow.content";
1050                }
1051                rel2 {
1052                   relative: 1.0 0.5;
1053                   offset: -2 -2;
1054                }
1055                align: 0.0 0.5;
1056                text {
1057                   style: "check_label_textblock_style";
1058                   min: 0 0;
1059                }
1060                color: CHECK_DEFAULT_TEXT_NORMAL_COLOR_INC;
1061             }
1062             description { state: "visible" 0.0;
1063                inherit: "default" 0.0;
1064                visible: 1;
1065                text.min: 1 1;
1066             }
1067             description { state: "disabled" 0.0;
1068                inherit: "default" 0.0;
1069             }
1070             description { state: "disabled_visible" 0.0;
1071                inherit: "default" 0.0;
1072                visible: 1;
1073                text.min: 1 1;
1074             }
1075          }
1076          part { name: "disclip";
1077             type: RECT;
1078             mouse_events: 0;
1079             description { state: "default" 0.0;
1080                color: CHECK_DISCLIP_NORMAL_COLOR_INC;
1081             }
1082             description { state: "disabled" 0.0;
1083                inherit: "default" 0.0;
1084                color: CHECK_DISCLIP_DISABLED_COLOR_INC;
1085             }
1086          }
1087          part { name: "disabler";
1088             type: RECT;
1089             description { state: "default" 0.0;
1090                color: 0 0 0 0;
1091                visible: 0;
1092             }
1093             description { state: "disabled" 0.0;
1094                inherit: "default" 0.0;
1095                visible: 1;
1096             }
1097          }
1098       }
1099       programs {
1100          program {
1101             signal: "mouse,clicked,1";
1102             source: "button";
1103             script {
1104                new Float:dx, Float:dy;
1105                get_drag(PART:"button", dx, dy);
1106                if (!get_int(was_drag)) {
1107                   if (dx > 0.5)
1108                     set_drag(PART:"button", 0.0, 0.0);
1109                   else
1110                     set_drag(PART:"button", 1.0, 0.0);
1111                   if (((get_int(is_rtl) == 1) && (dx <= 0.5)) ||
1112                       (get_int(is_rtl) == 0) && (dx > 0.5)) {
1113                      if (get_int(check_on)) {
1114                        emit("elm,action,check,off", "");
1115                        emit("elm,action,touch,sound", "");
1116                      }
1117                   }
1118                   else {
1119                      if (!get_int(check_on)) {
1120                        emit("elm,action,check,on", "");
1121                        emit("elm,action,touch,sound", "");
1122                      }
1123                   }
1124                }
1125             }
1126          }
1127          program { name: "touch_sound";
1128             signal: "elm,action,touch,sound";
1129             source: "";
1130             action: PLAY_SAMPLE "touch_sound" 1.0;
1131          }
1132          program {
1133             signal: "drag";
1134             source: "button";
1135             script {
1136                if (!get_int(is_drag)) emit("elm,action,check,drag,start", "");
1137                set_int(is_drag, 1);
1138             }
1139          }
1140          program {
1141             signal: "mouse,down,1";
1142             source: "button";
1143             script {
1144                set_int(was_drag, 0);
1145                set_int(is_drag, 0);
1146             }
1147          }
1148          program { name: "drag_end";
1149             signal: "mouse,up,1";
1150             source: "button";
1151             script {
1152                new Float:dx, Float:dy;
1153                get_drag(PART:"button", dx, dy);
1154                if (get_int(is_drag)) {
1155                   if (dx > 0.5)
1156                     set_drag(PART:"button", 1.0, 0.0);
1157                   else
1158                     set_drag(PART:"button", 0.0, 0.0);
1159                   if (((get_int(is_rtl) == 1) && (dx <= 0.5)) ||
1160                       (get_int(is_rtl) == 0) && (dx > 0.5)) {
1161                      if (!get_int(check_on)) {
1162                        emit("elm,action,check,on", "");
1163                        emit("elm,action,touch,sound", "");
1164                      }
1165                   }
1166                   else {
1167                      if (get_int(check_on)) {
1168                        emit("elm,action,check,off", "");
1169                        emit("elm,action,touch,sound", "");
1170                      }
1171                   }
1172                   set_int(was_drag, get_int(is_drag));
1173                   set_int(is_drag, 0);
1174                   emit("elm,action,check,drag,stop", "");
1175                }
1176             }
1177          }
1178          program { name: "check_on";
1179             signal: "elm,state,check,on";
1180             source: "elm";
1181             script {
1182                new Float:drag;
1183                if (get_int(is_rtl) == 0) {
1184                   drag = 100.0;
1185                }
1186                else {
1187                   drag = 0.0;
1188                }
1189                set_drag(PART:"button", drag, 0.0);
1190                set_state(PART:"bg_image", "visible", 0.0);
1191                set_int(check_on, 1);
1192             }
1193          }
1194          program { name: "check_off";
1195             signal: "elm,state,check,off";
1196             source: "elm";
1197             script {
1198                new Float:drag;
1199                if (get_int(is_rtl) == 0) {
1200                   drag = 0.0;
1201                }
1202                else {
1203                   drag = 100.0;
1204                }
1205                set_drag(PART:"button", drag, 0.0);
1206                set_state(PART:"bg_image", "default", 0.0);
1207                set_int(check_on, 0);
1208             }
1209          }
1210          program { name: "text_show";
1211             signal: "elm,state,text,visible";
1212             source: "elm";
1213             action:  STATE_SET "visible" 0.0;
1214             target: "elm.text";
1215          }
1216          program { name: "text_hide";
1217             signal: "elm,state,text,hidden";
1218             source: "elm";
1219             action:  STATE_SET "default" 0.0;
1220             target: "elm.text";
1221          }
1222          program { name: "icon_show";
1223             signal: "elm,state,icon,visible";
1224             source: "elm";
1225             action:  STATE_SET "visible" 0.0;
1226             target: "elm.swallow.content";
1227          }
1228          program { name: "icon_hide";
1229             signal: "elm,state,icon,hidden";
1230             source: "elm";
1231             action: STATE_SET "default" 0.0;
1232             target: "elm.swallow.content";
1233          }
1234          program { name: "disable";
1235             signal: "elm,state,disabled";
1236             source: "elm";
1237             action: STATE_SET "disabled" 0.0;
1238             target: "elm.offtext";
1239             target: "elm.ontext";
1240             target: "onrect";
1241             target: "offrect";
1242             target: "disabler";
1243             after: "disable_text";
1244          }
1245          program { name: "disable_text";
1246             script {
1247                new st[31];
1248                new Float:vl;
1249                get_state(PART:"elm.text", st, 30, vl);
1250                if (!strcmp(st, "visible"))
1251                  set_state(PART:"elm.text", "disabled_visible", 0.0);
1252                else
1253                  set_state(PART:"elm.text", "disabled", 0.0);
1254                get_state(PART:"bg_image", st, 30, vl);
1255                if (!strcmp(st, "visible"))
1256                  set_state(PART:"bg_image", "visible_disable", 0.0);
1257                else
1258                  set_state(PART:"bg_image", "off_disable", 0.0);
1259                get_state(PART:"elm.swallow.content", st, 30, vl);
1260                if (!strcmp(st, "visible"))
1261                  set_state(PART:"elm.swallow.content", "disabled_visible", 0.0);
1262                else
1263                  set_state(PART:"elm.swallow.content", "disabled", 0.0);
1264                set_state(PART:"button", "disabled", 0.0);
1265             }
1266          }
1267          program { name: "enable";
1268             signal: "elm,state,enabled";
1269             source: "elm";
1270             action: STATE_SET "default" 0.0;
1271             target: "disabler";
1272             target: "onrect";
1273             target: "offrect";
1274             after: "enable_text";
1275          }
1276          program { name: "enable_text";
1277             script {
1278                new st[31];
1279                new Float:vl;
1280                get_state(PART:"elm.text", st, 30, vl);
1281                if (!strcmp(st, "disabled_visible"))
1282                  set_state(PART:"elm.text", "visible", 0.0);
1283                else
1284                  set_state(PART:"elm.text", "default", 0.0);
1285                get_state(PART:"bg_image", st, 30, vl);
1286                if (!strcmp(st, "visible_disable"))
1287                  set_state(PART:"bg_image", "visible", 0.0);
1288                else
1289                  set_state(PART:"bg_image", "default", 0.0);
1290                get_state(PART:"elm.swallow.content", st, 30, vl);
1291                if (!strcmp(st, "visible"))
1292                  set_state(PART:"elm.swallow.content", "visible", 0.0);
1293                else
1294                  set_state(PART:"elm.swallow.content", "default", 0.0);
1295                set_state(PART:"button", "default", 0.0);
1296             }
1297          }
1298          program { name: "to_rtl";
1299             signal: "edje,state,rtl";
1300             source: "edje";
1301             script {
1302                set_int(is_rtl, 1);
1303             }
1304          }
1305          program { name: "to_ltr";
1306             signal: "edje,state,ltr";
1307             source: "edje";
1308             script {
1309                set_int(is_rtl, 0);
1310             }
1311          }
1312       }
1313    }
1314 ///////////////////////////////////////////////////////////////////////////////////////
1315
1316 #define CHECK_STYLE_FAVORITE(style_name, on_image, on_dim_image, off_image, off_dim_image, min_width, min_height) \
1317    group { name: "elm/check/base/"style_name; \
1318       images { \
1319          image: on_image COMP; \
1320          image: on_dim_image COMP; \
1321          image: off_image COMP; \
1322          image: off_dim_image COMP; \
1323       } \
1324       parts { \
1325          part { name: "back_bg"; \
1326             type: RECT; \
1327             scale: 1; \
1328             description { state: "default" 0.0; \
1329                visible: 0; \
1330                rel2.relative: 0.0 1.0; \
1331                align: 0 0.5; \
1332                min: min_width min_height; \
1333                fixed: 1 0; \
1334             } \
1335          } \
1336          part { name: "bg"; \
1337             type: RECT; \
1338             clip_to: "disclip"; \
1339             scale: 1; \
1340             description { state: "default" 0.0; \
1341                visible: 0; \
1342                rel1.to: "back_bg"; \
1343                rel2.to: "back_bg"; \
1344                min: min_width min_height; \
1345                max: min_width min_height; \
1346                fixed: 1 1; \
1347             } \
1348          } \
1349          part { name: "check"; \
1350             mouse_events: 0; \
1351             clip_to: "disclip"; \
1352             scale: 1; \
1353             description { state: "default" 0.0; \
1354                rel1.to: "bg"; \
1355                rel2.to: "bg"; \
1356                image.normal: off_image; \
1357             } \
1358             description { state: "visible" 0.0; \
1359                inherit: "default" 0.0; \
1360                image.normal: on_image; \
1361             } \
1362             description { state: "disabled" 0.0; \
1363                inherit: "default" 0.0; \
1364                image.normal: off_dim_image; \
1365             } \
1366             description { state: "disabled_visible" 0.0; \
1367                inherit: "default" 0.0; \
1368                image.normal: on_dim_image; \
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                   offset: 1 1; \
1382                } \
1383                rel2 { \
1384                   to_x: "bg"; \
1385                   relative: 1.0 1.0; \
1386                   offset: 2 -2; \
1387                } \
1388             } \
1389             description { state: "visible" 0.0; \
1390                inherit: "default" 0.0; \
1391                fixed: 1 1; \
1392                visible: 1; \
1393                aspect: 1.0 1.0; \
1394                aspect_preference: VERTICAL; \
1395             } \
1396             description { state: "disabled" 0.0; \
1397                inherit: "default" 0.0; \
1398             } \
1399             description { state: "disabled_visible" 0.0; \
1400                inherit: "default" 0.0; \
1401                fixed: 1 1; \
1402                visible: 1; \
1403                aspect: 1.0 1.0; \
1404             } \
1405          } \
1406          part { name: "elm.text"; \
1407             type: TEXTBLOCK; \
1408             clip_to: "disclip"; \
1409             mouse_events: 0; \
1410             scale: 1; \
1411             description { state: "default" 0.0; \
1412                visible: 0; \
1413                fixed: 0 1; \
1414                rel1 { \
1415                   relative: 1.0 0.5; \
1416                   offset: 1 1; \
1417                   to_x: "elm.swallow.content"; \
1418                } \
1419                rel2 { \
1420                   relative: 1.0 0.5; \
1421                   offset: -2 -2; \
1422                } \
1423                align: 0.0 0.5; \
1424                text { \
1425                  style: "check_label_textblock_style"; \
1426                  min: 0 0; \
1427                } \
1428                color: CHECK_DEFAULT_TEXT_NORMAL_COLOR_INC; \
1429             } \
1430             description { state: "visible" 0.0; \
1431                inherit: "default" 0.0; \
1432                visible: 1; \
1433                text.min: 1 1; \
1434             } \
1435             description { state: "disabled" 0.0; \
1436                inherit: "default" 0.0; \
1437             } \
1438             description { state: "disabled_visible" 0.0; \
1439                inherit: "default" 0.0; \
1440                visible: 1; \
1441                text.min: 1 1; \
1442                color: CHECK_DEFAULT_TEXT_DISABLED_COLOR_INC; \
1443             } \
1444          } \
1445          part { name: "disclip"; \
1446             type: RECT; \
1447             mouse_events: 0; \
1448             description { state: "default" 0.0; \
1449                color: CHECK_DISCLIP_NORMAL_COLOR_INC; \
1450             } \
1451          } \
1452          part { name: "events"; \
1453             type: RECT; \
1454             ignore_flags: ON_HOLD; \
1455             description { state: "default" 0.0; \
1456                color: 0 0 0 0; \
1457             } \
1458          } \
1459          part { name: "disabler"; \
1460             type: RECT; \
1461             description { state: "default" 0.0; \
1462                color: 0 0 0 0; \
1463                visible: 0; \
1464             } \
1465             description { state: "disabled" 0.0; \
1466                inherit: "default" 0.0; \
1467                visible: 1; \
1468             } \
1469          } \
1470       } \
1471       programs { \
1472          program { name: "click"; \
1473             signal: "mouse,clicked,1"; \
1474             source: "events"; \
1475             action: SIGNAL_EMIT "elm,action,check,toggle" ""; \
1476             after: "touch_sound"; \
1477          } \
1478          program { name: "touch_sound"; \
1479             action: PLAY_SAMPLE "touch_sound" 1.0; \
1480          } \
1481          program { name: "check_on"; \
1482             signal: "elm,state,check,on"; \
1483             source: "elm"; \
1484             action: STATE_SET "visible" 0.0; \
1485             target: "check"; \
1486          } \
1487          program { name: "check_off"; \
1488             signal: "elm,state,check,off"; \
1489             source: "elm"; \
1490             action: STATE_SET "default" 0.0; \
1491             target: "check"; \
1492          } \
1493          program { name: "text_show"; \
1494             signal: "elm,state,text,visible"; \
1495             source: "elm"; \
1496             action: STATE_SET "visible" 0.0; \
1497             target: "elm.text"; \
1498          } \
1499          program { name: "text_hide"; \
1500             signal: "elm,state,text,hidden"; \
1501             source: "elm"; \
1502             action: STATE_SET "default" 0.0; \
1503             target: "elm.text"; \
1504          } \
1505          program { name: "icon_show"; \
1506             signal: "elm,state,icon,visible"; \
1507             source: "elm"; \
1508             action: STATE_SET "visible" 0.0; \
1509             target: "elm.swallow.content"; \
1510          } \
1511          program { name: "icon_hide"; \
1512             signal: "elm,state,icon,hidden"; \
1513             source: "elm"; \
1514             action: STATE_SET "default" 0.0; \
1515             target: "elm.swallow.content"; \
1516          } \
1517          program { name: "disable"; \
1518             signal: "elm,state,disabled"; \
1519             source: "elm"; \
1520             action: STATE_SET "disabled" 0.0; \
1521             target: "disabler"; \
1522             after: "disable_text"; \
1523          } \
1524          program { name: "disable_text"; \
1525             script { \
1526                new st[31]; \
1527                new Float:vl; \
1528                get_state(PART:"elm.text", st, 30, vl); \
1529                if (!strcmp(st, "visible")) \
1530                  set_state(PART:"elm.text", "disabled_visible", 0.0); \
1531                else \
1532                  set_state(PART:"elm.text", "disabled", 0.0); \
1533                get_state(PART:"elm.swallow.content", st, 30, vl); \
1534                if (!strcmp(st, "visible")) \
1535                  set_state(PART:"elm.swallow.content", "disabled_visible", 0.0); \
1536                else \
1537                  set_state(PART:"elm.swallow.content", "disabled", 0.0); \
1538                get_state(PART:"check", st, 30, vl); \
1539                if (!strcmp(st, "visible")) \
1540                  set_state(PART:"check", "disabled_visible", 0.0); \
1541                else \
1542                  set_state(PART:"check", "disabled", 0.0); \
1543             } \
1544          } \
1545          program { name: "enable"; \
1546             signal: "elm,state,enabled"; \
1547             source: "elm"; \
1548             action: STATE_SET "default" 0.0; \
1549             target: "disabler"; \
1550             after: "enable_text"; \
1551          } \
1552          program { name: "enable_text"; \
1553             script { \
1554                new st[31]; \
1555                new Float:vl; \
1556                get_state(PART:"elm.text", st, 30, vl); \
1557                if (!strcmp(st, "disabled_visible")) \
1558                  set_state(PART:"elm.text", "visible", 0.0); \
1559                else \
1560                  set_state(PART:"elm.text", "default", 0.0); \
1561                get_state(PART:"elm.swallow.content", st, 30, vl); \
1562                if (!strcmp(st, "visible")) \
1563                  set_state(PART:"elm.swallow.content", "visible", 0.0); \
1564                else \
1565                  set_state(PART:"elm.swallow.content", "default", 0.0); \
1566                get_state(PART:"check", st, 30, vl); \
1567                if (!strcmp(st, "disabled_visible")) \
1568                  set_state(PART:"check", "visible", 0.0); \
1569                else \
1570                  set_state(PART:"check", "default", 0.0); \
1571             } \
1572          } \
1573       } \
1574    }
1575 ////////////////////////////////////////////////////////////////////////////////
1576 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)
1577 ////////////////////////////////////////////////////////////////////////////////
1578 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)
1579 ////////////////////////////////////////////////////////////////////////////////
1580 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)
1581 ////////////////////////////////////////////////////////////////////////////////
1582
1583    group { name: "elm/check/base/grid";
1584       images.image: "00_check_bg.png" COMP;
1585       images.image: "00_check_dim_bg.png" COMP;
1586       images.image: "00_check_dim.png" COMP;
1587       images.image: "00_check_Activated.png" COMP;
1588       script {
1589          public check_state = CHECK_STATE_DEFAULT;
1590          public check_visible = CHECK_HIDE;
1591       }
1592       parts {
1593          part { name: "bg";
1594             type: RECT;
1595             scale: 1;
1596             description { state: "default" 0.0;
1597                visible: 0;
1598             }
1599          }
1600          part { name: "top_left_padding";
1601             type: RECT;
1602             mouse_events: 0;
1603             scale: 1;
1604             description { state: "default" 0.0;
1605                visible: 0;
1606                min: GENGRID_ITEM_CHECK_TOP_RIGHT_PADDING_INC;
1607                align: 0.0 0.0;
1608                fixed: 1 1;
1609                rel1 {
1610                   relative: 0.0 0.0;
1611                   to: "bg";
1612                }
1613                rel2 {
1614                   relative: 0.0 0.0;
1615                   to: "bg";
1616                }
1617             }
1618          }
1619          part { name: "bg2";
1620             mouse_events: 0;
1621             scale: 1;
1622             description { state: "default" 0.0;
1623                min: GENGRID_EDIT_MODE_CHECK_SIZE_INC;
1624                align: 0.0 0.0;
1625                fixed: 1 1;
1626                rel1 {
1627                   relative: 1.0 1.0;
1628                   to: "top_left_padding";
1629                }
1630                rel2 {
1631                   relative: 1.0 1.0;
1632                   to: "top_left_padding";
1633                }
1634                image.normal: "00_check_bg.png";
1635             }
1636             description { state: "visible" 0.0;
1637                inherit: "default" 0.0;
1638             }
1639             description { state: "disabled" 0.0;
1640                inherit: "default" 0.0;
1641                image.normal: "00_check_dim_bg.png";
1642             }
1643          }
1644          part { name: "check";
1645             mouse_events: 0;
1646             clip_to: "sequence_clip";
1647             scale: 1;
1648             description { state: "default" 0.0;
1649                visible: 0;
1650                rel1.to: "bg2";
1651                rel2.to: "bg2";
1652                image.normal: "00_check_Activated.png";
1653                color: 255 255 255 0;
1654             }
1655             description { state: "visible" 0.0;
1656                inherit: "default" 0.0;
1657                visible: 1;
1658                color: 255 255 255 255;
1659             }
1660             description { state: "pressed" 0.0;
1661                inherit: "visible" 0.0;
1662             }
1663             description { state: "disabled_visible" 0.0;
1664                inherit: "default" 0.0;
1665                visible: 1;
1666                image.normal: "00_check_dim.png";
1667             }
1668          }
1669          part { name: "sequence_clip";
1670             type: RECT;
1671             mouse_events: 0;
1672             description { state: "default" 0.0;
1673                rel1.to: "bg2";
1674                rel2.to: "bg2";
1675                rel2.relative: 0.0 1.0;
1676                color: 255 255 255 255;
1677             }
1678             description { state: "visible" 0.0;
1679                inherit: "default" 0.0;
1680                rel2.relative: 1.0 1.0;
1681             }
1682          }
1683          part { name: "elm.swallow.content";
1684             type: SWALLOW;
1685             description {
1686                state: "default" 0.0;
1687                fixed: 1 0;
1688                visible: 0;
1689                color: 255 255 255 255;
1690                align: 0.0 0.5;
1691                rel1 {
1692                   to_x: "bg2";
1693                   relative: 1.0 0.0;
1694                   offset: 1 1;
1695                }
1696                rel2 {
1697                   to_x: "bg2";
1698                   relative: 1.0 1.0;
1699                   offset: 2 -2;
1700                }
1701             }
1702             description { state: "visible" 0.0;
1703                inherit: "default" 0.0;
1704                fixed: 1 1;
1705                visible: 1;
1706                aspect: 1.0 1.0;
1707                aspect_preference: VERTICAL;
1708             }
1709             description { state: "disabled" 0.0;
1710                inherit: "default" 0.0;
1711                color: 128 128 128 128;
1712             }
1713             description { state: "disabled_visible" 0.0;
1714                inherit: "default" 0.0;
1715                color: 128 128 128 128;
1716                fixed: 1 1;
1717                visible: 1;
1718                aspect: 1.0 1.0;
1719             }
1720          }
1721          part { name: "elm.text";
1722             type: TEXTBLOCK;
1723             mouse_events: 0;
1724             scale: 1;
1725             description { state: "default" 0.0;
1726                visible: 0;
1727                fixed: 0 1;
1728                rel1 {
1729                   relative: 1.0 0.5;
1730                   offset: 1 1;
1731                   to_x: "elm.swallow.content";
1732                }
1733                rel2 {
1734                   relative: 1.0 0.5;
1735                   offset: -2 -2;
1736                }
1737                color: 255 255 255 255;
1738                align: 0.0 0.5;
1739                text {
1740                   style: "check_label_textblock_style";
1741                   min: 0 0;
1742                }
1743                color: CHECK_DEFAULT_TEXT_NORMAL_COLOR_INC;
1744             }
1745             description { state: "visible" 0.0;
1746                inherit: "default" 0.0;
1747                visible: 1;
1748                text.min: 1 1;
1749             }
1750             description { state: "disabled" 0.0;
1751                inherit: "default" 0.0;
1752             }
1753             description { state: "disabled_visible" 0.0;
1754                inherit: "default" 0.0;
1755                visible: 1;
1756                text.min: 1 1;
1757                color: CHECK_DEFAULT_TEXT_DISABLED_COLOR_INC;
1758             }
1759          }
1760          part { name: "events";
1761             type: RECT;
1762             ignore_flags: ON_HOLD;
1763             description { state: "default" 0.0;
1764                color: 0 0 0 0;
1765             }
1766          }
1767          part { name: "disabler";
1768             type: RECT;
1769             description { state: "default" 0.0;
1770                color: 0 0 0 0;
1771                visible: 0;
1772             }
1773             description { state: "disabled" 0.0;
1774                inherit: "default" 0.0;
1775                visible: 1;
1776             }
1777          }
1778       }
1779       programs {
1780          program { name: "show";
1781             signal: "show";
1782             script {
1783                set_int(check_visible, CHECK_SHOW);
1784             }
1785          }
1786          program { name: "hide";
1787             signal: "hide";
1788             script {
1789                set_int(check_visible, CHECK_HIDE);
1790             }
1791          }
1792          program { name: "click";
1793             signal: "mouse,clicked,1";
1794             source: "events";
1795             action: SIGNAL_EMIT "elm,action,check,toggle" "";
1796             after: "bg_normal";
1797          }
1798          program { name: "bg_normal";
1799             script {
1800                set_state(PART:"bg2", "default", 0.0);
1801             }
1802          }
1803          program { name: "pressed";
1804             signal: "mouse,down,1";
1805             source: "events";
1806             script {
1807                new st[31];
1808                new Float:vl;
1809                get_state(PART:"check", st, 30, vl);
1810                if (!strcmp(st, "visible"))
1811                  {
1812                     set_state(PART:"check", "pressed", 0.0);
1813                     set_state(PART:"bg2", "visible", 0.0);
1814                  }
1815             }
1816          }
1817          program { name: "mouse,out";
1818             signal: "mouse,out";
1819             source: "events";
1820             script {
1821                if (get_int(check_state) == CHECK_STATE_VISIBLE)
1822                  {
1823                     set_state(PART:"check", "visible", 0.0);
1824                     set_state(PART:"sequence_clip", "visible", 0.0);
1825                     set_state(PART:"bg2", "visible", 0.0);
1826                  }
1827                else
1828                  {
1829                     set_state(PART:"check", "default", 0.0);
1830                     set_state(PART:"sequence_clip", "default", 0.0);
1831                     set_state(PART:"bg2", "default", 0.0);
1832                  }
1833             }
1834          }
1835          program { name: "check_on";
1836             signal: "elm,state,check,on";
1837             source: "elm";
1838             script {
1839                set_int(check_state, CHECK_STATE_VISIBLE);
1840                if (get_int(check_visible) == CHECK_SHOW)
1841                  {
1842                     run_program(PROGRAM:"check_show_effect");
1843                     run_program(PROGRAM:"check_draw_effect");
1844                  }
1845                else
1846                  {
1847                     set_state(PART:"check", "visible", 0.0);
1848                     set_state(PART:"sequence_clip", "visible", 0.0);
1849                  }
1850                set_state(PART:"bg2", "visible", 0.0);
1851             }
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             script {
1859                if (get_int(check_state) == CHECK_STATE_VISIBLE)
1860                  {
1861                     set_int(check_state, CHECK_STATE_DEFAULT);
1862                     set_state(PART:"check", "default", 0.0);
1863                     set_state(PART:"sequence_clip", "default", 0.0);
1864                  }
1865                set_state(PART:"bg2", "default", 0.0);
1866             }
1867          }
1868          program { name: "check_show_effect";
1869             action: STATE_SET "visible" 0.0;
1870             transition: LINEAR 0.233;
1871             target: "check";
1872          }
1873          program { name: "check_draw_effect";
1874             action: STATE_SET "visible" 0.0;
1875             transition: LINEAR 0.267;
1876             target: "sequence_clip";
1877          }
1878          program { name: "text_show";
1879             signal: "elm,state,text,visible";
1880             source: "elm";
1881             action: STATE_SET "visible" 0.0;
1882             target: "elm.text";
1883          }
1884          program { name: "text_hide";
1885             signal: "elm,state,text,hidden";
1886             source: "elm";
1887             action: STATE_SET "default" 0.0;
1888             target: "elm.text";
1889          }
1890          program { name: "icon_show";
1891             signal: "elm,state,icon,visible";
1892             source: "elm";
1893             action: STATE_SET "visible" 0.0;
1894             target: "elm.swallow.content";
1895          }
1896          program { name: "icon_hide";
1897             signal: "elm,state,icon,hidden";
1898             source: "elm";
1899             action: STATE_SET "default" 0.0;
1900             target: "elm.swallow.content";
1901          }
1902          program { name: "disable";
1903             signal: "elm,state,disabled";
1904             source: "elm";
1905             action: STATE_SET "disabled" 0.0;
1906             target: "disabler";
1907             target: "bg2";
1908             after: "disable_text";
1909          }
1910          program { name: "disable_text";
1911             script {
1912                new st[31];
1913                new Float:vl;
1914                get_state(PART:"elm.text", st, 30, vl);
1915                if (!strcmp(st, "visible"))
1916                  set_state(PART:"elm.text", "disabled_visible", 0.0);
1917                else
1918                  set_state(PART:"elm.text", "disabled", 0.0);
1919                get_state(PART:"elm.swallow.content", st, 30, vl);
1920                if (!strcmp(st, "visible"))
1921                  set_state(PART:"elm.swallow.content", "disabled_visible", 0.0);
1922                else
1923                  set_state(PART:"elm.swallow.content", "disabled", 0.0);
1924                get_state(PART:"check", st, 30, vl);
1925                if (!strcmp(st, "visible"))
1926                  {
1927                     set_state(PART:"check", "disabled_visible", 0.0);
1928                     set_int(check_state, CHECK_STATE_DISABLED_VISIBLE);
1929                  }
1930             }
1931          }
1932          program { name: "enable";
1933             signal: "elm,state,enabled";
1934             source: "elm";
1935             action: STATE_SET "default" 0.0;
1936             target: "disabler";
1937             target: "bg2";
1938             after: "enable_text";
1939          }
1940          program { name: "enable_text";
1941             script {
1942                new st[31];
1943                new Float:vl;
1944                get_state(PART:"elm.text", st, 30, vl);
1945                if (!strcmp(st, "disabled_visible"))
1946                  set_state(PART:"elm.text", "visible", 0.0);
1947                else
1948                  set_state(PART:"elm.text", "default", 0.0);
1949                get_state(PART:"elm.swallow.content", st, 30, vl);
1950                if (!strcmp(st, "visible"))
1951                  set_state(PART:"elm.swallow.content", "visible", 0.0);
1952                else
1953                  set_state(PART:"elm.swallow.content", "default", 0.0);
1954                get_state(PART:"check", st, 30, vl);
1955                if (!strcmp(st, "disabled_visible"))
1956                  {
1957                     set_state(PART:"check", "visible", 0.0);
1958                     set_state(PART:"sequence_clip", "visible", 0.0);
1959                     set_int(check_state, CHECK_STATE_VISIBLE);
1960                  }
1961                else
1962                  set_int(check_state, CHECK_STATE_DEFAULT);
1963             }
1964          }
1965       }
1966    }
1967
1968 #undef CHECK_STATE_DEFAULT
1969 #undef CHECK_STATE_VISIBLE
1970 #undef CHECK_STATE_DISABLED_VISIBLE
1971 #undef CHECK_STATE_DISABLED
1972
1973 #undef CHECK_HIDE
1974 #undef CHECK_SHOW