[check] Removed unused styles and images.
[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       } \
36       script { \
37          public check_state = CHECK_STATE_DEFAULT; \
38          public check_visible = CHECK_HIDE; \
39       } \
40       parts { \
41          part { name: "back_bg"; \
42             type: RECT; \
43             scale: 1; \
44             description { state: "default" 0.0; \
45                rel2.relative: 0.0 1.0; \
46                align: 0 0.5; \
47                min: min_width min_height; \
48                fixed: 1 0; \
49                color: 0 0 0 0; \
50             } \
51          } \
52          part { name: "bg"; \
53             mouse_events: 0; \
54             scale: 1; \
55             description { state: "default" 0.0; \
56                min: CHECK_STYLE_DEFAULT_BG_NORMAL_MIN_MAX_INC; \
57                max: CHECK_STYLE_DEFAULT_BG_NORMAL_MIN_MAX_INC; \
58                fixed: 1 1; \
59                rel1.to: "back_bg"; \
60                rel2.to: "back_bg"; \
61                image.normal: "00_check_bg.png"; \
62                fill.smooth : 0; \
63             } \
64             description { state: "visible" 0.0; \
65                inherit: "default" 0.0; \
66             } \
67             description { state: "disabled" 0.0; \
68                inherit: "default" 0.0; \
69                image.normal: "00_check_dim_bg.png"; \
70             } \
71          } \
72          part { name: "check"; \
73             clip_to: "sequence_clip"; \
74             mouse_events: 0; \
75             scale: 1; \
76             description { state: "default" 0.0; \
77                rel1.to: "bg"; \
78                rel2.to: "bg"; \
79                visible: 0; \
80                image.normal: "00_check_Activated.png"; \
81                color: 255 255 255 0; \
82             } \
83             description { state: "visible" 0.0; \
84                inherit: "default" 0.0; \
85                visible: 1; \
86                color: 255 255 255 255; \
87             } \
88             description { state: "disabled_visible" 0.0; \
89                inherit: "default" 0.0; \
90                visible: 1; \
91                image.normal: "00_check_dim.png"; \
92                color: 255 255 255 255; \
93             } \
94          } \
95          part { name: "sequence_clip"; \
96             type: RECT; \
97             mouse_events: 0; \
98             description { state: "default" 0.0; \
99                rel2.relative: 0.0 1.0; \
100                color: 255 255 255 255; \
101             } \
102             description { state: "visible" 0.0; \
103                inherit: "default" 0.0; \
104                rel2.relative: 1.0 1.0; \
105             } \
106          } \
107          part { name: "elm.swallow.content"; \
108             type: SWALLOW; \
109             clip_to: "disclip"; \
110             description { state: "default" 0.0; \
111                fixed: 1 0; \
112                visible: 0; \
113                align: 0.0 0.5; \
114                rel1 { \
115                   to_x: "bg"; \
116                   relative: 1.0 0.0; \
117                   offset: 1 1; \
118                } \
119                rel2 { \
120                   to_x: "bg"; \
121                   relative: 1.0 1.0; \
122                   offset: 2 -2; \
123                } \
124             } \
125             description { state: "visible" 0.0; \
126                inherit: "default" 0.0; \
127                fixed: 1 1; \
128                visible: 1; \
129                aspect: 1.0 1.0; \
130                aspect_preference: VERTICAL; \
131             } \
132             description { state: "disabled" 0.0; \
133                inherit: "default" 0.0; \
134             } \
135             description { state: "disabled_visible" 0.0; \
136                inherit: "default" 0.0; \
137                fixed: 1 1; \
138                visible: 1; \
139                aspect: 1.0 1.0; \
140             } \
141          } \
142          part { name: "elm.text"; \
143             type: TEXTBLOCK; \
144             mouse_events: 0; \
145             clip_to: "disclip"; \
146             scale: 1; \
147             description { state: "default" 0.0; \
148                visible: 0; \
149                fixed: 0 1; \
150                rel1 { \
151                   relative: 1.0 0.5; \
152                   offset: 1 1; \
153                   to_x: "elm.swallow.content"; \
154                } \
155                rel2 { \
156                   relative: 1.0 0.5; \
157                   offset: -2 -2; \
158                } \
159                align: 0.0 0.5; \
160                text { \
161                   style: "check_label_textblock_style"; \
162                   min: 0 0; \
163                } \
164                color: CHECK_DEFAULT_TEXT_NORMAL_COLOR_INC; \
165             } \
166             description { state: "visible" 0.0; \
167                inherit: "default" 0.0; \
168                visible: 1; \
169                text.min: 1 1; \
170             } \
171             description { state: "disabled" 0.0; \
172                inherit: "default" 0.0; \
173             } \
174             description { state: "disabled_visible" 0.0; \
175                inherit: "default" 0.0; \
176                visible: 1; \
177                text.min: 1 1; \
178                color: CHECK_DEFAULT_TEXT_DISABLED_COLOR_INC; \
179             } \
180          } \
181          part { name: "events1"; \
182             type: RECT; \
183             ignore_flags: ON_HOLD; \
184             description { state: "default" 0.0; \
185                color: 0 0 0 0; \
186             } \
187          } \
188          part { name: "events2"; \
189             type: RECT; \
190             repeat_events: 1; \
191             description { state: "default" 0.0; \
192                color: 0 0 0 0; \
193             } \
194          } \
195          part { name: "disclip"; \
196             type: RECT; \
197             mouse_events: 0; \
198             description { state: "default" 0.0; \
199                color: CHECK_DISCLIP_NORMAL_COLOR_INC; \
200             } \
201             description { state: "disabled" 0.0; \
202                inherit: "default" 0.0; \
203                color: CHECK_DISCLIP_DISABLED_COLOR_INC; \
204             } \
205          } \
206          part { name: "disabler"; \
207             type: RECT; \
208             description { state: "default" 0.0; \
209                color: 0 0 0 0; \
210                visible: 0; \
211             } \
212             description { state: "disabled" 0.0; \
213                inherit: "default" 0.0; \
214                visible: 1; \
215             } \
216          } \
217       } \
218       programs { \
219          program { name: "show"; \
220             signal: "show"; \
221             script { \
222                set_int(check_visible, CHECK_SHOW); \
223             } \
224          } \
225          program { name: "hide"; \
226             signal: "hide"; \
227             script { \
228                set_int(check_visible, CHECK_HIDE); \
229             } \
230          } \
231          program { name: "click"; \
232             signal: "mouse,clicked,1"; \
233             source: "events1"; \
234             action: SIGNAL_EMIT "elm,action,check,toggle" ""; \
235             after: "touch_sound"; \
236          } \
237          program { name: "touch_sound"; \
238             action: PLAY_SAMPLE "touch_sound" 1.0; \
239          } \
240          program { name: "mouse,out"; \
241             signal: "mouse,out"; \
242             source: "events2"; \
243             script { \
244                if (get_int(check_state) == CHECK_STATE_VISIBLE) \
245                  { \
246                     set_state(PART:"check", "visible", 0.0); \
247                     set_state(PART:"sequence_clip", "visible", 0.0); \
248                  } \
249                else \
250                  { \
251                     set_state(PART:"check", "default", 0.0); \
252                     set_state(PART:"sequence_clip", "default", 0.0); \
253                  } \
254             } \
255          } \
256          program { name: "check_on"; \
257             signal: "elm,state,check,on"; \
258             source: "elm"; \
259             script { \
260                set_int(check_state, CHECK_STATE_VISIBLE); \
261                if (get_int(check_visible) == CHECK_SHOW) \
262                  { \
263                     run_program(PROGRAM:"check_show_effect"); \
264                     run_program(PROGRAM:"check_draw_effect"); \
265                  } \
266                else \
267                  { \
268                     set_state(PART:"check", "visible", 0.0); \
269                     set_state(PART:"sequence_clip", "visible", 0.0); \
270                  } \
271             } \
272          } \
273          program { name: "check_off"; \
274             signal: "elm,state,check,off"; \
275             source: "elm"; \
276             action: STATE_SET "default" 0.0; \
277             target: "check"; \
278             script { \
279                if (get_int(check_state) == CHECK_STATE_VISIBLE) \
280                  { \
281                     set_int(check_state, CHECK_STATE_DEFAULT); \
282                     set_state(PART:"check", "default", 0.0); \
283                     set_state(PART:"sequence_clip", "default", 0.0); \
284                  } \
285             } \
286          } \
287          program { name: "check_show_effect"; \
288             action: STATE_SET "visible" 0.0; \
289             transition: LINEAR 0.233; \
290             target: "check"; \
291          } \
292          program { name: "check_draw_effect"; \
293             action: STATE_SET "visible" 0.0; \
294             transition: LINEAR 0.267; \
295             target: "sequence_clip"; \
296          } \
297          program { name: "text_show"; \
298             signal: "elm,state,text,visible"; \
299             source: "elm"; \
300             action: STATE_SET "visible" 0.0; \
301             target: "elm.text"; \
302          } \
303          program { name: "text_hide"; \
304             signal: "elm,state,text,hidden"; \
305             source: "elm"; \
306             action: STATE_SET "default" 0.0; \
307             target: "elm.text"; \
308          } \
309          program { name: "icon_show"; \
310             signal: "elm,state,icon,visible"; \
311             source: "elm"; \
312             action: STATE_SET "visible" 0.0; \
313             target: "elm.swallow.content"; \
314          } \
315          program { name: "icon_hide"; \
316             signal: "elm,state,icon,hidden"; \
317             source: "elm"; \
318             action: STATE_SET "default" 0.0; \
319             target: "elm.swallow.content"; \
320          } \
321          program { name: "disable"; \
322             signal: "elm,state,disabled"; \
323             source: "elm"; \
324             action: STATE_SET "disabled" 0.0; \
325             target: "disabler"; \
326             target: "disclip"; \
327             target: "bg"; \
328             after: "disable_text"; \
329          } \
330          program { name: "disable_text"; \
331             script { \
332                new st[31]; \
333                new Float:vl; \
334                get_state(PART:"elm.text", st, 30, vl); \
335                if (!strcmp(st, "visible")) \
336                  set_state(PART:"elm.text", "disabled_visible", 0.0); \
337                else \
338                  set_state(PART:"elm.text", "disabled", 0.0); \
339                get_state(PART:"elm.swallow.content", st, 30, vl); \
340                if (!strcmp(st, "visible")) \
341                  set_state(PART:"elm.swallow.content", "disabled_visible", 0.0); \
342                else \
343                  set_state(PART:"elm.swallow.content", "disabled", 0.0); \
344                get_state(PART:"check", st, 30, vl); \
345                if (!strcmp(st, "visible")) \
346                  { \
347                     set_state(PART:"check", "disabled_visible", 0.0); \
348                     set_int(check_state, CHECK_STATE_DISABLED_VISIBLE); \
349                  } \
350             } \
351          } \
352          program { name: "enable"; \
353             signal: "elm,state,enabled"; \
354             source: "elm"; \
355             action: STATE_SET "default" 0.0; \
356             target: "disabler"; \
357             target: "disclip"; \
358             target: "bg"; \
359             after: "enable_text"; \
360          } \
361          program { name: "enable_text"; \
362             script { \
363                new st[31]; \
364                new Float:vl; \
365                get_state(PART:"elm.text", st, 30, vl); \
366                if (!strcmp(st, "disabled_visible")) \
367                  set_state(PART:"elm.text", "visible", 0.0); \
368                else \
369                  set_state(PART:"elm.text", "default", 0.0); \
370                get_state(PART:"elm.swallow.content", st, 30, vl); \
371                if (!strcmp(st, "visible")) \
372                  set_state(PART:"elm.swallow.content", "visible", 0.0); \
373                else \
374                  set_state(PART:"elm.swallow.content", "default", 0.0); \
375                get_state(PART:"check", st, 30, vl); \
376                if (!strcmp(st, "disabled_visible")) \
377                  { \
378                     set_state(PART:"check", "visible", 0.0); \
379                     set_state(PART:"sequence_clip", "visible", 0.0); \
380                     set_int(check_state, CHECK_STATE_VISIBLE); \
381                  } \
382                else \
383                  set_int(check_state, CHECK_STATE_DEFAULT); \
384             } \
385          } \
386       } \
387    }
388 ////////////////////////////////////////////////////////////////////////////////
389 CHECK_STYLE_DEFAULT("default", CHECK_STYLE_DEFAULT_DEFAULT_BG_IMAGE_MIN_WIDTH_INC, CHECK_STYLE_DEFAULT_DEFAULT_BG_IMAGE_MIN_HEIGHT_INC)
390 ////////////////////////////////////////////////////////////////////////////////
391 CHECK_STYLE_DEFAULT("default/extended", CHECK_STYLE_DEFAULT_EXTENDED_BG_IMAGE_MIN_WIDTH_INC, CHECK_STYLE_DEFAULT_EXTENDED_BG_IMAGE_MIN_HEIGHT_INC)
392 ////////////////////////////////////////////////////////////////////////////////
393
394 #define CHECK_STYLE_FOR_GENLIST(style_name, min_width, min_height) \
395    group { name: "elm/check/base/"style_name; \
396       images { \
397          image: "00_check_bg.png" COMP; \
398          image: "00_check_dim_bg.png" COMP; \
399          image: "00_check_dim.png" COMP; \
400          image: "00_check_Activated.png" COMP; \
401       } \
402       script { \
403          public check_state = CHECK_STATE_DEFAULT; \
404       } \
405       parts { \
406          part { name: "back_bg"; \
407             type: RECT; \
408             scale: 1; \
409             description { state: "default" 0.0; \
410                min: min_width min_height; \
411                fixed: 0 0; \
412                color: 0 0 0 0; \
413             } \
414          } \
415          part { name: "bg"; \
416             mouse_events: 0; \
417             scale: 1; \
418             description { state: "default" 0.0; \
419                min: CHECK_STYLE_DEFAULT_BG_NORMAL_MIN_MAX_INC; \
420                max: CHECK_STYLE_DEFAULT_BG_NORMAL_MIN_MAX_INC; \
421                fixed: 1 1; \
422                rel1.to: "back_bg"; \
423                rel2.to: "back_bg"; \
424                image.normal: "00_check_bg.png"; \
425                fill.smooth : 0; \
426             } \
427             description { state: "disabled" 0.0; \
428                inherit: "default" 0.0; \
429                image.normal: "00_check_dim_bg.png"; \
430             } \
431          } \
432          part { name: "check"; \
433             mouse_events: 0; \
434             scale: 1; \
435             description { state: "default" 0.0; \
436                rel1.to: "bg"; \
437                rel2.to: "bg"; \
438                visible: 0; \
439                image.normal: "00_check_Activated.png"; \
440             } \
441             description { state: "visible" 0.0; \
442                inherit: "default" 0.0; \
443                visible: 1; \
444             } \
445             description { state: "disabled_visible" 0.0; \
446                inherit: "default" 0.0; \
447                visible: 1; \
448                image.normal: "00_check_dim.png"; \
449             } \
450          } \
451          part { name: "elm.swallow.content"; \
452             type: SWALLOW; \
453             clip_to: "disclip"; \
454             description { state: "default" 0.0; \
455                fixed: 1 0; \
456                visible: 0; \
457                align: 0.0 0.5; \
458                rel1 { \
459                   to_x: "bg"; \
460                   relative: 1.0 0.0; \
461                   offset: 1 1; \
462                } \
463                rel2 { \
464                   to_x: "bg"; \
465                   relative: 1.0 1.0; \
466                   offset: 2 -2; \
467                } \
468             } \
469             description { state: "visible" 0.0; \
470                inherit: "default" 0.0; \
471                fixed: 1 1; \
472                visible: 1; \
473                aspect: 1.0 1.0; \
474                aspect_preference: VERTICAL; \
475             } \
476             description { state: "disabled" 0.0; \
477                inherit: "default" 0.0; \
478             } \
479             description { state: "disabled_visible" 0.0; \
480                inherit: "default" 0.0; \
481                fixed: 1 1; \
482                visible: 1; \
483                aspect: 1.0 1.0; \
484             } \
485          } \
486          part { name: "elm.text"; \
487             type: TEXTBLOCK; \
488             mouse_events: 0; \
489             clip_to: "disclip"; \
490             scale: 1; \
491             description { state: "default" 0.0; \
492                visible: 0; \
493                fixed: 0 1; \
494                rel1 { \
495                   relative: 1.0 0.5; \
496                   offset: 1 1; \
497                   to_x: "elm.swallow.content"; \
498                } \
499                rel2 { \
500                   relative: 1.0 0.5; \
501                   offset: -2 -2; \
502                } \
503                align: 0.0 0.5; \
504                text { \
505                   style: "check_label_textblock_style"; \
506                   min: 0 0; \
507                } \
508                color: CHECK_DEFAULT_TEXT_NORMAL_COLOR_INC; \
509             } \
510             description { state: "visible" 0.0; \
511                inherit: "default" 0.0; \
512                visible: 1; \
513                text.min: 1 1; \
514             } \
515             description { state: "disabled" 0.0; \
516                inherit: "default" 0.0; \
517             } \
518             description { state: "disabled_visible" 0.0; \
519                inherit: "default" 0.0; \
520                visible: 1; \
521                text.min: 1 1; \
522                color: CHECK_DEFAULT_TEXT_DISABLED_COLOR_INC; \
523             } \
524          } \
525          part { name: "events1"; \
526             type: RECT; \
527             ignore_flags: ON_HOLD; \
528             description { state: "default" 0.0; \
529                color: 0 0 0 0; \
530             } \
531          } \
532          part { name: "events2"; \
533             type: RECT; \
534             repeat_events: 1; \
535             description { state: "default" 0.0; \
536                color: 0 0 0 0; \
537             } \
538          } \
539          part { name: "disclip"; \
540             type: RECT; \
541             mouse_events: 0; \
542             description { state: "default" 0.0; \
543                color: CHECK_DISCLIP_NORMAL_COLOR_INC; \
544             } \
545             description { state: "disabled" 0.0; \
546                inherit: "default" 0.0; \
547                color: CHECK_DISCLIP_DISABLED_COLOR_INC; \
548             } \
549          } \
550          part { name: "disabler"; \
551             type: RECT; \
552             description { state: "default" 0.0; \
553                color: 0 0 0 0; \
554                visible: 0; \
555             } \
556             description { state: "disabled" 0.0; \
557                inherit: "default" 0.0; \
558                visible: 1; \
559             } \
560          } \
561       } \
562       programs { \
563          program { name: "click"; \
564             signal: "mouse,clicked,1"; \
565             source: "events1"; \
566             action: SIGNAL_EMIT "elm,action,check,toggle" ""; \
567             after: "touch_sound"; \
568          } \
569          program { name: "touch_sound"; \
570             action: PLAY_SAMPLE "touch_sound" 1.0; \
571          } \
572          program { name: "check_on"; \
573             signal: "elm,state,check,on"; \
574             source: "elm"; \
575             script { \
576                set_int(check_state, CHECK_STATE_VISIBLE); \
577                set_state(PART:"check", "visible", 0.0); \
578             } \
579          } \
580          program { name: "check_off"; \
581             signal: "elm,state,check,off"; \
582             source: "elm"; \
583             action: STATE_SET "default" 0.0; \
584             target: "check"; \
585             script { \
586                if (get_int(check_state) == CHECK_STATE_VISIBLE) \
587                  { \
588                     set_int(check_state, CHECK_STATE_DEFAULT); \
589                     set_state(PART:"check", "default", 0.0); \
590                  } \
591             } \
592          } \
593          program { name: "text_show"; \
594             signal: "elm,state,text,visible"; \
595             source: "elm"; \
596             action: STATE_SET "visible" 0.0; \
597             target: "elm.text"; \
598          } \
599          program { name: "text_hide"; \
600             signal: "elm,state,text,hidden"; \
601             source: "elm"; \
602             action: STATE_SET "default" 0.0; \
603             target: "elm.text"; \
604          } \
605          program { name: "icon_show"; \
606             signal: "elm,state,icon,visible"; \
607             source: "elm"; \
608             action: STATE_SET "visible" 0.0; \
609             target: "elm.swallow.content"; \
610          } \
611          program { name: "icon_hide"; \
612             signal: "elm,state,icon,hidden"; \
613             source: "elm"; \
614             action: STATE_SET "default" 0.0; \
615             target: "elm.swallow.content"; \
616          } \
617          program { name: "disable"; \
618             signal: "elm,state,disabled"; \
619             source: "elm"; \
620             action: STATE_SET "disabled" 0.0; \
621             target: "disabler"; \
622             target: "disclip"; \
623             target: "bg"; \
624             after: "disable_text"; \
625          } \
626          program { name: "disable_text"; \
627             script { \
628                new st[31]; \
629                new Float:vl; \
630                get_state(PART:"elm.text", st, 30, vl); \
631                if (!strcmp(st, "visible")) \
632                  set_state(PART:"elm.text", "disabled_visible", 0.0); \
633                else \
634                  set_state(PART:"elm.text", "disabled", 0.0); \
635                get_state(PART:"elm.swallow.content", st, 30, vl); \
636                if (!strcmp(st, "visible")) \
637                  set_state(PART:"elm.swallow.content", "disabled_visible", 0.0); \
638                else \
639                  set_state(PART:"elm.swallow.content", "disabled", 0.0); \
640                get_state(PART:"check", st, 30, vl); \
641                if (!strcmp(st, "visible")) \
642                  { \
643                     set_state(PART:"check", "disabled_visible", 0.0); \
644                     set_int(check_state, CHECK_STATE_DISABLED_VISIBLE); \
645                  } \
646             } \
647          } \
648          program { name: "enable"; \
649             signal: "elm,state,enabled"; \
650             source: "elm"; \
651             action: STATE_SET "default" 0.0; \
652             target: "disabler"; \
653             target: "disclip"; \
654             target: "bg"; \
655             after: "enable_text"; \
656          } \
657          program { name: "enable_text"; \
658             script { \
659                new st[31]; \
660                new Float:vl; \
661                get_state(PART:"elm.text", st, 30, vl); \
662                if (!strcmp(st, "disabled_visible")) \
663                  set_state(PART:"elm.text", "visible", 0.0); \
664                else \
665                  set_state(PART:"elm.text", "default", 0.0); \
666                get_state(PART:"elm.swallow.content", st, 30, vl); \
667                if (!strcmp(st, "visible")) \
668                  set_state(PART:"elm.swallow.content", "visible", 0.0); \
669                else \
670                  set_state(PART:"elm.swallow.content", "default", 0.0); \
671                get_state(PART:"check", st, 30, vl); \
672                if (!strcmp(st, "disabled_visible")) \
673                  { \
674                     set_state(PART:"check", "visible", 0.0); \
675                     set_int(check_state, CHECK_STATE_VISIBLE); \
676                  } \
677                else \
678                  set_int(check_state, CHECK_STATE_DEFAULT); \
679             } \
680          } \
681       } \
682    }
683 ////////////////////////////////////////////////////////////////////////////////
684 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)
685 ////////////////////////////////////////////////////////////////////////////////
686    styles {
687       style { name: "check_label_textblock_style";
688          base: "font=Tizen:style=Roman font_size="CHECK_DEFAULT_TEXT_FONT_SIZE_INC" color=#ffffff wrap=char text_class=tizen";
689          tag: "br" "\n";
690          tag: "ps" "ps";
691          tag: "hilight" "+ font=Tizen:style=Bold";
692          tag: "b" "+ font=Tizen:style=Bold";
693          tag: "whitecolor" "+ color=#ffffff";
694          tag: "tab" "\t";
695       }
696    }
697
698    group { name: "elm/check/base/on&off";
699       images {
700          image: "00_button_on.png" COMP;
701          image: "00_button_on_dim.png" COMP;
702          image: "00_button_off.png" COMP;
703          image: "00_button_off_dim.png" COMP;
704          image: "00_button_on_off_handler.png" COMP;
705          image: "00_button_on_off_handler_dim.png" COMP;
706       }
707       script {
708          public is_rtl = 0;
709          public is_drag = 0;
710          public was_drag = 0;
711          public check_on = 0;
712       }
713       parts {
714          part { name: "bg";
715             type: RECT;
716             mouse_events: 1;
717             scale: 1;
718             description { state: "default" 0.0;
719                min: CHECK_ONOFF_BG_NORMAL_MIN_MAX_INC;
720                max: CHECK_ONOFF_BG_NORMAL_MIN_MAX_INC;
721                rel2.relative: 0.0 1.0;
722                fixed: 1 1;
723                align: 0.0 0.5;
724                visible: 0;
725             }
726          }
727          part { name: "padding_left";
728             type: RECT;
729             scale: 1;
730             mouse_events: 0;
731             description { state: "default" 0.0;
732                align: 0.0 0.0;
733                rel1{ relative: 0.0 0.0; to: "bg"; }
734                rel2{ relative: 0.0 1.0; to: "bg"; }
735                min: 0 0;
736                fixed: 1 1;
737                color: 0 0 0 0;
738             }
739          }
740          part { name: "padding_right";
741             type: RECT;
742             scale: 1;
743             mouse_events: 0;
744             description { state: "default" 0.0;
745                align: 1.0 0.0;
746                rel1 {
747                   relative: 1.0 0.0;
748                   to: "bg";
749                }
750                rel2 {
751                   relative: 1.0 1.0;
752                   to: "bg";
753                }
754                min: 0 0;
755                fixed: 1 1;
756                color: 0 0 0 0;
757             }
758          }
759          part { name: "padding_top";
760             type: RECT;
761             scale: 1;
762             mouse_events: 0;
763             description { state: "default" 0.0;
764                align: 0.0 0.0;
765                rel1.to: "bg";
766                rel2 {
767                   relative: 1.0 0.0;
768                   to: "bg";
769                }
770                min: 0 0;
771                fixed: 1 1;
772                color: 0 0 0 0;
773             }
774          }
775          part { name: "padding_bottom";
776             type: RECT;
777             scale: 1;
778             mouse_events: 0;
779             description { state: "default" 0.0;
780                align: 1.0 1.0;
781                rel1 {
782                   relative: 0.0 1.0;
783                   to: "bg";
784                }
785                rel2 {
786                   relative: 1.0 1.0;
787                   to: "bg";
788                }
789                min: 0 0;
790                fixed: 0 1;
791                color: 0 0 0 0;
792             }
793          }
794          part { name: "bg_image";
795             mouse_events: 0;
796             scale: 1;
797             description { state: "default" 0.0;
798                align: 0.0 0.5;
799                rel1 {
800                   relative: 0.0 1.0;
801                   to_x: "bg";
802                   to_y: "padding_top";
803                }
804                rel2 {
805                   relative: 1.0 0.0;
806                   to_x: "bg";
807                   to_y: "padding_bottom";
808                }
809                image.normal: "00_button_off.png";
810             }
811             description { state: "visible" 0.0;
812                inherit: "default" 0.0;
813                image.normal: "00_button_on.png";
814             }
815             description { state: "pressed" 0.0;
816                inherit: "default" 0.0;
817                image.normal: "00_button_off.png";
818             }
819             description { state: "visible_pressed" 0.0;
820                inherit: "default" 0.0;
821                image.normal: "00_button_on.png";
822             }
823             description { state: "visible_disable" 0.0;
824                inherit: "default" 0.0;
825                image.normal: "00_button_on_dim.png";
826             }
827             description { state: "off_disable" 0.0;
828                inherit: "default" 0.0;
829                image.normal: "00_button_off_dim.png";
830             }
831          }
832          part { name: "drag_container";
833             type: RECT;
834             scale: 1;
835             mouse_events: 0;
836             description { state: "default" 0.0;
837                rel1 {
838                   relative: 1.0 0.0;
839                   to_x: "padding_left";
840                   to_y: "bg";
841                }
842                rel2 {
843                   relative: 0.0 1.0;
844                   to_x: "padding_right";
845                   to_y: "bg";
846                }
847                color: 0 0 0 0;
848             }
849          }
850          part { name: "clipper";
851             type: RECT;
852             mouse_events: 0;
853             description { state: "default" 0.0;
854                rel1.to: "bg";
855                rel2.to: "bg";
856                color: 255 255 255 255;
857             }
858          }
859          part { name: "clipper_inner";
860             type: RECT;
861             mouse_events: 0;
862             description { state: "default" 0.0;
863                rel1.to: "bg_image";
864                rel2.to: "bg_image";
865                color: 255 255 255 255;
866             }
867          }
868          part { name: "button";
869             scale: 1;
870             clip_to: "clipper";
871             mouse_events: 1;
872             dragable {
873                x: 1 1 0;
874                y: 0 0 0;
875                confine: "drag_container";
876             }
877             description { state: "default" 0.0;
878                min: CHECK_ONOFF_HANDLER_MIN_MAX_INC;
879                max: CHECK_ONOFF_HANDLER_MIN_MAX_INC;
880                rel1.to: "bg";
881                rel2.to: "bg";
882                align: 0.0 0.5;
883                fixed: 1 1;
884                image.normal: "00_button_on_off_handler.png";
885             }
886             description { state: "disabled" 0.0;
887                inherit: "default" 0.0;
888                image.normal: "00_button_on_off_handler_dim.png";
889             }
890          }
891          part { name: "button_events";
892             type: RECT;
893             dragable {
894                events: "button";
895             }
896             description { state: "default" 0.0;
897                rel1.to_x: "bg";
898                rel2.to_x: "bg";
899                color: 0 0 0 0;
900             }
901          }
902          part { name: "onrect";
903             type: RECT;
904             scale: 1;
905             clip_to: "clipper";
906             mouse_events: 0;
907             description { state: "default" 0.0;
908                rel1 {
909                   relative: -1.0 0.0;
910                   to: "button";
911                }
912                rel2 {
913                   relative: 0.0 1.0;
914                   to: "button";
915                }
916                align: 1.0 0.5;
917                color: 0 0 0 0;
918             }
919          }
920          part { name: "offrect";
921             type: RECT;
922             scale: 1;
923             clip_to: "clipper";
924             mouse_events: 0;
925             description { state: "default" 0.0;
926                rel1 {
927                   relative: 1.0 0.0;
928                   to: "button";
929                }
930                rel2 {
931                   relative: 2.0 1.0;
932                   to: "button";
933                }
934                color: 0 0 0 0;
935             }
936          }
937          part { name: "elm.offtext";
938             type: TEXT;
939             mouse_events: 0;
940             scale: 1;
941             clip_to: "clipper_inner";
942             description { state: "default" 0.0;
943                rel1.to: "offrect";
944                rel2.to: "offrect";
945                color: 255 255 255 255;
946                text {
947                   font: "Tizen:style=Medium";
948                   size: 20;
949                   min: 0 1;
950                   text_class: "tizen";
951                }
952             }
953             description { state: "disabled" 0.0;
954                inherit: "default" 0.0;
955                color: 128 128 128 128;
956             }
957          }
958          part { name: "elm.ontext";
959             type: TEXT;
960             mouse_events: 0;
961             scale: 1;
962             clip_to: "clipper_inner";
963             description { state: "default" 0.0;
964                rel1.to: "onrect";
965                rel2.to: "onrect";
966                color: 255 255 255 255;
967                text {
968                   font: "Tizen:style=Medium";
969                   size: 20;
970                   min: 0 1;
971                   text_class: "tizen";
972                }
973             }
974             description { state: "disabled" 0.0;
975                inherit: "default" 0.0;
976                color: 128 128 128 128;
977             }
978          }
979          part { name: "elm.swallow.content";
980             type: SWALLOW;
981             clip_to: "disclip";
982             description { state: "default" 0.0;
983                fixed: 1 0;
984                visible: 0;
985                align: 0.0 0.5;
986                rel1 {
987                   to_x: "bg";
988                   relative: 1.0 0.0;
989                }
990                rel2 {
991                   to_x: "bg";
992                   relative: 1.0 1.0;
993                }
994             }
995             description { state: "visible" 0.0;
996                inherit: "default" 0.0;
997                fixed: 1 1;
998                visible: 1;
999                aspect: 1.0 1.0;
1000                aspect_preference: VERTICAL;
1001             }
1002             description { state: "disabled" 0.0;
1003                inherit: "default" 0.0;
1004             }
1005             description { state: "disabled_visible" 0.0;
1006                inherit: "default" 0.0;
1007                fixed: 1 1;
1008                visible: 1;
1009                aspect: 1.0 1.0;
1010             }
1011          }
1012          part { name: "elm.text";
1013             type: TEXTBLOCK;
1014             mouse_events: 0;
1015             scale: 1;
1016             clip_to: "disclip";
1017             description { state: "default" 0.0;
1018                visible: 0;
1019                fixed: 0 1;
1020                rel1 {
1021                   relative: 1.0 0.5;
1022                   offset: 1 1;
1023                   to_x: "elm.swallow.content";
1024                }
1025                rel2 {
1026                   relative: 1.0 0.5;
1027                   offset: -2 -2;
1028                }
1029                align: 0.0 0.5;
1030                text {
1031                   style: "check_label_textblock_style";
1032                   min: 0 0;
1033                }
1034                color: CHECK_DEFAULT_TEXT_NORMAL_COLOR_INC;
1035             }
1036             description { state: "visible" 0.0;
1037                inherit: "default" 0.0;
1038                visible: 1;
1039                text.min: 1 1;
1040             }
1041             description { state: "disabled" 0.0;
1042                inherit: "default" 0.0;
1043             }
1044             description { state: "disabled_visible" 0.0;
1045                inherit: "default" 0.0;
1046                visible: 1;
1047                text.min: 1 1;
1048             }
1049          }
1050          part { name: "disclip";
1051             type: RECT;
1052             mouse_events: 0;
1053             description { state: "default" 0.0;
1054                color: CHECK_DISCLIP_NORMAL_COLOR_INC;
1055             }
1056             description { state: "disabled" 0.0;
1057                inherit: "default" 0.0;
1058                color: CHECK_DISCLIP_DISABLED_COLOR_INC;
1059             }
1060          }
1061          part { name: "disabler";
1062             type: RECT;
1063             description { state: "default" 0.0;
1064                color: 0 0 0 0;
1065                visible: 0;
1066             }
1067             description { state: "disabled" 0.0;
1068                inherit: "default" 0.0;
1069                visible: 1;
1070             }
1071          }
1072       }
1073       programs {
1074          program {
1075             signal: "mouse,clicked,1";
1076             source: "button";
1077             script {
1078                new Float:dx, Float:dy;
1079                get_drag(PART:"button", dx, dy);
1080                if (!get_int(was_drag)) {
1081                   if (dx > 0.5)
1082                     set_drag(PART:"button", 0.0, 0.0);
1083                   else
1084                     set_drag(PART:"button", 1.0, 0.0);
1085                   if (((get_int(is_rtl) == 1) && (dx <= 0.5)) ||
1086                       (get_int(is_rtl) == 0) && (dx > 0.5)) {
1087                      if (get_int(check_on)) {
1088                        emit("elm,action,check,off", "");
1089                        emit("elm,action,touch,sound", "");
1090                      }
1091                   }
1092                   else {
1093                      if (!get_int(check_on)) {
1094                        emit("elm,action,check,on", "");
1095                        emit("elm,action,touch,sound", "");
1096                      }
1097                   }
1098                }
1099             }
1100          }
1101          program { name: "touch_sound";
1102             signal: "elm,action,touch,sound";
1103             source: "";
1104             action: PLAY_SAMPLE "touch_sound" 1.0;
1105          }
1106          program {
1107             signal: "drag";
1108             source: "button";
1109             script {
1110                if (!get_int(is_drag)) emit("elm,action,check,drag,start", "");
1111                set_int(is_drag, 1);
1112             }
1113          }
1114          program {
1115             signal: "mouse,down,1";
1116             source: "button";
1117             script {
1118                set_int(was_drag, 0);
1119                set_int(is_drag, 0);
1120             }
1121          }
1122          program { name: "drag_end";
1123             signal: "mouse,up,1";
1124             source: "button";
1125             script {
1126                new Float:dx, Float:dy;
1127                get_drag(PART:"button", dx, dy);
1128                if (get_int(is_drag)) {
1129                   if (dx > 0.5)
1130                     set_drag(PART:"button", 1.0, 0.0);
1131                   else
1132                     set_drag(PART:"button", 0.0, 0.0);
1133                   if (((get_int(is_rtl) == 1) && (dx <= 0.5)) ||
1134                       (get_int(is_rtl) == 0) && (dx > 0.5)) {
1135                      if (!get_int(check_on)) {
1136                        emit("elm,action,check,on", "");
1137                        emit("elm,action,touch,sound", "");
1138                      }
1139                   }
1140                   else {
1141                      if (get_int(check_on)) {
1142                        emit("elm,action,check,off", "");
1143                        emit("elm,action,touch,sound", "");
1144                      }
1145                   }
1146                   set_int(was_drag, get_int(is_drag));
1147                   set_int(is_drag, 0);
1148                   emit("elm,action,check,drag,stop", "");
1149                }
1150             }
1151          }
1152          program { name: "check_on";
1153             signal: "elm,state,check,on";
1154             source: "elm";
1155             script {
1156                new Float:drag;
1157                if (get_int(is_rtl) == 0) {
1158                   drag = 100.0;
1159                }
1160                else {
1161                   drag = 0.0;
1162                }
1163                set_drag(PART:"button", drag, 0.0);
1164                set_state(PART:"bg_image", "visible", 0.0);
1165                set_int(check_on, 1);
1166             }
1167          }
1168          program { name: "check_off";
1169             signal: "elm,state,check,off";
1170             source: "elm";
1171             script {
1172                new Float:drag;
1173                if (get_int(is_rtl) == 0) {
1174                   drag = 0.0;
1175                }
1176                else {
1177                   drag = 100.0;
1178                }
1179                set_drag(PART:"button", drag, 0.0);
1180                set_state(PART:"bg_image", "default", 0.0);
1181                set_int(check_on, 0);
1182             }
1183          }
1184          program { name: "text_show";
1185             signal: "elm,state,text,visible";
1186             source: "elm";
1187             action:  STATE_SET "visible" 0.0;
1188             target: "elm.text";
1189          }
1190          program { name: "text_hide";
1191             signal: "elm,state,text,hidden";
1192             source: "elm";
1193             action:  STATE_SET "default" 0.0;
1194             target: "elm.text";
1195          }
1196          program { name: "icon_show";
1197             signal: "elm,state,icon,visible";
1198             source: "elm";
1199             action:  STATE_SET "visible" 0.0;
1200             target: "elm.swallow.content";
1201          }
1202          program { name: "icon_hide";
1203             signal: "elm,state,icon,hidden";
1204             source: "elm";
1205             action: STATE_SET "default" 0.0;
1206             target: "elm.swallow.content";
1207          }
1208          program { name: "disable";
1209             signal: "elm,state,disabled";
1210             source: "elm";
1211             action: STATE_SET "disabled" 0.0;
1212             target: "elm.offtext";
1213             target: "elm.ontext";
1214             target: "onrect";
1215             target: "offrect";
1216             target: "disabler";
1217             after: "disable_text";
1218          }
1219          program { name: "disable_text";
1220             script {
1221                new st[31];
1222                new Float:vl;
1223                get_state(PART:"elm.text", st, 30, vl);
1224                if (!strcmp(st, "visible"))
1225                  set_state(PART:"elm.text", "disabled_visible", 0.0);
1226                else
1227                  set_state(PART:"elm.text", "disabled", 0.0);
1228                get_state(PART:"bg_image", st, 30, vl);
1229                if (!strcmp(st, "visible"))
1230                  set_state(PART:"bg_image", "visible_disable", 0.0);
1231                else
1232                  set_state(PART:"bg_image", "off_disable", 0.0);
1233                get_state(PART:"elm.swallow.content", st, 30, vl);
1234                if (!strcmp(st, "visible"))
1235                  set_state(PART:"elm.swallow.content", "disabled_visible", 0.0);
1236                else
1237                  set_state(PART:"elm.swallow.content", "disabled", 0.0);
1238                set_state(PART:"button", "disabled", 0.0);
1239             }
1240          }
1241          program { name: "enable";
1242             signal: "elm,state,enabled";
1243             source: "elm";
1244             action: STATE_SET "default" 0.0;
1245             target: "disabler";
1246             target: "onrect";
1247             target: "offrect";
1248             after: "enable_text";
1249          }
1250          program { name: "enable_text";
1251             script {
1252                new st[31];
1253                new Float:vl;
1254                get_state(PART:"elm.text", st, 30, vl);
1255                if (!strcmp(st, "disabled_visible"))
1256                  set_state(PART:"elm.text", "visible", 0.0);
1257                else
1258                  set_state(PART:"elm.text", "default", 0.0);
1259                get_state(PART:"bg_image", st, 30, vl);
1260                if (!strcmp(st, "visible_disable"))
1261                  set_state(PART:"bg_image", "visible", 0.0);
1262                else
1263                  set_state(PART:"bg_image", "default", 0.0);
1264                get_state(PART:"elm.swallow.content", st, 30, vl);
1265                if (!strcmp(st, "visible"))
1266                  set_state(PART:"elm.swallow.content", "visible", 0.0);
1267                else
1268                  set_state(PART:"elm.swallow.content", "default", 0.0);
1269                set_state(PART:"button", "default", 0.0);
1270             }
1271          }
1272          program { name: "to_rtl";
1273             signal: "edje,state,rtl";
1274             source: "edje";
1275             script {
1276                set_int(is_rtl, 1);
1277             }
1278          }
1279          program { name: "to_ltr";
1280             signal: "edje,state,ltr";
1281             source: "edje";
1282             script {
1283                set_int(is_rtl, 0);
1284             }
1285          }
1286       }
1287    }
1288 ///////////////////////////////////////////////////////////////////////////////////////
1289
1290 #define CHECK_STYLE_FAVORITE(style_name, min_width, min_height) \
1291    group { name: "elm/check/base/"style_name; \
1292       images { \
1293          image: "00_icon_favorite_on_72x72.png" COMP; \
1294          image: "00_icon_favorite_on_72x72_dim.png" COMP; \
1295          image: "00_icon_favorite_off_72x72.png" COMP; \
1296          image: "00_icon_favorite_off_72x72_dim.png" COMP; \
1297       } \
1298       parts { \
1299          part { name: "back_bg"; \
1300             type: RECT; \
1301             scale: 1; \
1302             description { state: "default" 0.0; \
1303                visible: 0; \
1304                rel2.relative: 0.0 1.0; \
1305                align: 0 0.5; \
1306                min: min_width min_height; \
1307                fixed: 1 0; \
1308             } \
1309          } \
1310          part { name: "bg"; \
1311             type: RECT; \
1312             clip_to: "disclip"; \
1313             scale: 1; \
1314             description { state: "default" 0.0; \
1315                visible: 0; \
1316                rel1.to: "back_bg"; \
1317                rel2.to: "back_bg"; \
1318                min: CHECK_STYLE_FAVORITE_BG_NORMAL_MIN_MAX_INC; \
1319                max: CHECK_STYLE_FAVORITE_BG_NORMAL_MIN_MAX_INC; \
1320                fixed: 1 1; \
1321             } \
1322          } \
1323          part { name: "check"; \
1324             mouse_events: 0; \
1325             clip_to: "disclip"; \
1326             scale: 1; \
1327             description { state: "default" 0.0; \
1328                rel1.to: "bg"; \
1329                rel2.to: "bg"; \
1330                image.normal: "00_icon_favorite_off_72x72.png"; \
1331             } \
1332             description { state: "visible" 0.0; \
1333                inherit: "default" 0.0; \
1334                image.normal: "00_icon_favorite_on_72x72.png"; \
1335             } \
1336             description { state: "disabled" 0.0; \
1337                inherit: "default" 0.0; \
1338                image.normal: "00_icon_favorite_off_72x72_dim.png"; \
1339             } \
1340             description { state: "disabled_visible" 0.0; \
1341                inherit: "default" 0.0; \
1342                image.normal: "00_icon_favorite_on_72x72_dim.png"; \
1343             } \
1344          } \
1345          part { name: "elm.swallow.content"; \
1346             type: SWALLOW; \
1347             clip_to: "disclip"; \
1348             description { state: "default" 0.0; \
1349                fixed: 1 0; \
1350                visible: 0; \
1351                align: 0.0 0.5; \
1352                rel1 { \
1353                   to_x: "bg"; \
1354                   relative: 1.0 0.0; \
1355                   offset: 1 1; \
1356                } \
1357                rel2 { \
1358                   to_x: "bg"; \
1359                   relative: 1.0 1.0; \
1360                   offset: 2 -2; \
1361                } \
1362             } \
1363             description { state: "visible" 0.0; \
1364                inherit: "default" 0.0; \
1365                fixed: 1 1; \
1366                visible: 1; \
1367                aspect: 1.0 1.0; \
1368                aspect_preference: VERTICAL; \
1369             } \
1370             description { state: "disabled" 0.0; \
1371                inherit: "default" 0.0; \
1372             } \
1373             description { state: "disabled_visible" 0.0; \
1374                inherit: "default" 0.0; \
1375                fixed: 1 1; \
1376                visible: 1; \
1377                aspect: 1.0 1.0; \
1378             } \
1379          } \
1380          part { name: "elm.text"; \
1381             type: TEXTBLOCK; \
1382             clip_to: "disclip"; \
1383             mouse_events: 0; \
1384             scale: 1; \
1385             description { state: "default" 0.0; \
1386                visible: 0; \
1387                fixed: 0 1; \
1388                rel1 { \
1389                   relative: 1.0 0.5; \
1390                   offset: 1 1; \
1391                   to_x: "elm.swallow.content"; \
1392                } \
1393                rel2 { \
1394                   relative: 1.0 0.5; \
1395                   offset: -2 -2; \
1396                } \
1397                align: 0.0 0.5; \
1398                text { \
1399                  style: "check_label_textblock_style"; \
1400                  min: 0 0; \
1401                } \
1402                color: CHECK_DEFAULT_TEXT_NORMAL_COLOR_INC; \
1403             } \
1404             description { state: "visible" 0.0; \
1405                inherit: "default" 0.0; \
1406                visible: 1; \
1407                text.min: 1 1; \
1408             } \
1409             description { state: "disabled" 0.0; \
1410                inherit: "default" 0.0; \
1411             } \
1412             description { state: "disabled_visible" 0.0; \
1413                inherit: "default" 0.0; \
1414                visible: 1; \
1415                text.min: 1 1; \
1416                color: CHECK_DEFAULT_TEXT_DISABLED_COLOR_INC; \
1417             } \
1418          } \
1419          part { name: "disclip"; \
1420             type: RECT; \
1421             mouse_events: 0; \
1422             description { state: "default" 0.0; \
1423                color: CHECK_DISCLIP_NORMAL_COLOR_INC; \
1424             } \
1425          } \
1426          part { name: "events"; \
1427             type: RECT; \
1428             ignore_flags: ON_HOLD; \
1429             description { state: "default" 0.0; \
1430                color: 0 0 0 0; \
1431             } \
1432          } \
1433          part { name: "disabler"; \
1434             type: RECT; \
1435             description { state: "default" 0.0; \
1436                color: 0 0 0 0; \
1437                visible: 0; \
1438             } \
1439             description { state: "disabled" 0.0; \
1440                inherit: "default" 0.0; \
1441                visible: 1; \
1442             } \
1443          } \
1444       } \
1445       programs { \
1446          program { name: "click"; \
1447             signal: "mouse,clicked,1"; \
1448             source: "events"; \
1449             action: SIGNAL_EMIT "elm,action,check,toggle" ""; \
1450             after: "touch_sound"; \
1451          } \
1452          program { name: "touch_sound"; \
1453             action: PLAY_SAMPLE "touch_sound" 1.0; \
1454          } \
1455          program { name: "check_on"; \
1456             signal: "elm,state,check,on"; \
1457             source: "elm"; \
1458             action: STATE_SET "visible" 0.0; \
1459             target: "check"; \
1460          } \
1461          program { name: "check_off"; \
1462             signal: "elm,state,check,off"; \
1463             source: "elm"; \
1464             action: STATE_SET "default" 0.0; \
1465             target: "check"; \
1466          } \
1467          program { name: "text_show"; \
1468             signal: "elm,state,text,visible"; \
1469             source: "elm"; \
1470             action: STATE_SET "visible" 0.0; \
1471             target: "elm.text"; \
1472          } \
1473          program { name: "text_hide"; \
1474             signal: "elm,state,text,hidden"; \
1475             source: "elm"; \
1476             action: STATE_SET "default" 0.0; \
1477             target: "elm.text"; \
1478          } \
1479          program { name: "icon_show"; \
1480             signal: "elm,state,icon,visible"; \
1481             source: "elm"; \
1482             action: STATE_SET "visible" 0.0; \
1483             target: "elm.swallow.content"; \
1484          } \
1485          program { name: "icon_hide"; \
1486             signal: "elm,state,icon,hidden"; \
1487             source: "elm"; \
1488             action: STATE_SET "default" 0.0; \
1489             target: "elm.swallow.content"; \
1490          } \
1491          program { name: "disable"; \
1492             signal: "elm,state,disabled"; \
1493             source: "elm"; \
1494             action: STATE_SET "disabled" 0.0; \
1495             target: "disabler"; \
1496             after: "disable_text"; \
1497          } \
1498          program { name: "disable_text"; \
1499             script { \
1500                new st[31]; \
1501                new Float:vl; \
1502                get_state(PART:"elm.text", st, 30, vl); \
1503                if (!strcmp(st, "visible")) \
1504                  set_state(PART:"elm.text", "disabled_visible", 0.0); \
1505                else \
1506                  set_state(PART:"elm.text", "disabled", 0.0); \
1507                get_state(PART:"elm.swallow.content", st, 30, vl); \
1508                if (!strcmp(st, "visible")) \
1509                  set_state(PART:"elm.swallow.content", "disabled_visible", 0.0); \
1510                else \
1511                  set_state(PART:"elm.swallow.content", "disabled", 0.0); \
1512                get_state(PART:"check", st, 30, vl); \
1513                if (!strcmp(st, "visible")) \
1514                  set_state(PART:"check", "disabled_visible", 0.0); \
1515                else \
1516                  set_state(PART:"check", "disabled", 0.0); \
1517             } \
1518          } \
1519          program { name: "enable"; \
1520             signal: "elm,state,enabled"; \
1521             source: "elm"; \
1522             action: STATE_SET "default" 0.0; \
1523             target: "disabler"; \
1524             after: "enable_text"; \
1525          } \
1526          program { name: "enable_text"; \
1527             script { \
1528                new st[31]; \
1529                new Float:vl; \
1530                get_state(PART:"elm.text", st, 30, vl); \
1531                if (!strcmp(st, "disabled_visible")) \
1532                  set_state(PART:"elm.text", "visible", 0.0); \
1533                else \
1534                  set_state(PART:"elm.text", "default", 0.0); \
1535                get_state(PART:"elm.swallow.content", st, 30, vl); \
1536                if (!strcmp(st, "visible")) \
1537                  set_state(PART:"elm.swallow.content", "visible", 0.0); \
1538                else \
1539                  set_state(PART:"elm.swallow.content", "default", 0.0); \
1540                get_state(PART:"check", st, 30, vl); \
1541                if (!strcmp(st, "disabled_visible")) \
1542                  set_state(PART:"check", "visible", 0.0); \
1543                else \
1544                  set_state(PART:"check", "default", 0.0); \
1545             } \
1546          } \
1547       } \
1548    }
1549 ////////////////////////////////////////////////////////////////////////////////
1550 CHECK_STYLE_FAVORITE("favorite", CHECK_STYLE_FAVORITE_DEFAULT_BG_IMAGE_MIN_WIDTH_INC, CHECK_STYLE_FAVORITE_DEFAULT_BG_IMAGE_MIN_HEIGHT_INC)
1551 ////////////////////////////////////////////////////////////////////////////////
1552 CHECK_STYLE_FAVORITE("favorite/extended", CHECK_STYLE_FAVORITE_EXTENDED_BG_IMAGE_MIN_WIDTH_INC, CHECK_STYLE_FAVORITE_EXTENDED_BG_IMAGE_MIN_HEIGHT_INC)
1553 ////////////////////////////////////////////////////////////////////////////////
1554
1555    group { name: "elm/check/base/grid";
1556       images.image: "00_grid_select_check.png" COMP;
1557       images.image: "00_grid_select_check_bg.png" COMP;
1558       images.image: "00_grid_select_check_bg_press.png" COMP;
1559       script {
1560          public check_state = CHECK_STATE_DEFAULT;
1561          public check_visible = CHECK_HIDE;
1562       }
1563       parts {
1564          part { name: "bg";
1565             type: RECT;
1566             scale: 1;
1567             description { state: "default" 0.0;
1568                visible: 0;
1569             }
1570          }
1571          part { name: "top_right_padding";
1572             type: RECT;
1573             mouse_events: 0;
1574             scale: 1;
1575             description { state: "default" 0.0;
1576                visible: 0;
1577                min: GENGRID_ITEM_CHECK_TOP_RIGHT_PADDING_INC;
1578                align: 1.0 0.0;
1579                fixed: 1 1;
1580                rel1 {
1581                   relative: 1.0 0.0;
1582                   to: "bg";
1583                }
1584                rel2 {
1585                   relative: 1.0 0.0;
1586                   to: "bg";
1587                }
1588             }
1589          }
1590          part { name: "selected_bg";
1591             scale: 1;
1592             type: RECT;
1593             description { state: "default" 0.0;
1594                visible: 0;
1595                rel1.to: "bg";
1596                rel2.to: "bg";
1597             }
1598             description { state: "visible" 0.0;
1599                inherit: "default" 0.0;
1600                visible: 1;
1601                color: GENGRID_EDIT_MODE_CHECK_BG_COLOR_INC;
1602             }
1603          }
1604          part { name: "bg2";
1605             mouse_events: 0;
1606             scale: 1;
1607             description { state: "default" 0.0;
1608                min: GENGRID_EDIT_MODE_CHECK_SIZE_INC;
1609                align: 1.0 0.0;
1610                fixed: 1 1;
1611                rel1 {
1612                   relative: 0.0 1.0;
1613                   to: "top_right_padding";
1614                }
1615                rel2 {
1616                   relative: 0.0 1.0;
1617                   to: "top_right_padding";
1618                }
1619                image.normal: "00_grid_select_check_bg.png";
1620             }
1621             description { state: "visible" 0.0;
1622                inherit: "default" 0.0;
1623                image.normal: "00_grid_select_check_bg_press.png";
1624             }
1625             description { state: "disabled" 0.0;
1626                inherit: "default" 0.0;
1627             }
1628          }
1629          part { name: "check";
1630             mouse_events: 0;
1631             clip_to: "sequence_clip";
1632             scale: 1;
1633             description { state: "default" 0.0;
1634                visible: 0;
1635                rel1.to: "bg2";
1636                rel2.to: "bg2";
1637                image.normal: "00_grid_select_check.png";
1638                color: 255 255 255 0;
1639             }
1640             description { state: "visible" 0.0;
1641                inherit: "default" 0.0;
1642                visible: 1;
1643                color: 255 255 255 255;
1644             }
1645             description { state: "pressed" 0.0;
1646                inherit: "visible" 0.0;
1647             }
1648             description { state: "disabled_visible" 0.0;
1649                inherit: "default" 0.0;
1650                visible: 1;
1651             }
1652          }
1653          part { name: "sequence_clip";
1654             type: RECT;
1655             mouse_events: 0;
1656             description { state: "default" 0.0;
1657                rel1.to: "bg2";
1658                rel2.to: "bg2";
1659                rel2.relative: 0.0 1.0;
1660                color: 255 255 255 255;
1661             }
1662             description { state: "visible" 0.0;
1663                inherit: "default" 0.0;
1664                rel2.relative: 1.0 1.0;
1665             }
1666          }
1667          part { name: "elm.swallow.content";
1668             type: SWALLOW;
1669             description {
1670                state: "default" 0.0;
1671                fixed: 1 0;
1672                visible: 0;
1673                color: 255 255 255 255;
1674                align: 0.0 0.5;
1675                rel1 {
1676                   to_x: "bg2";
1677                   relative: 1.0 0.0;
1678                   offset: 1 1;
1679                }
1680                rel2 {
1681                   to_x: "bg2";
1682                   relative: 1.0 1.0;
1683                   offset: 2 -2;
1684                }
1685             }
1686             description { state: "visible" 0.0;
1687                inherit: "default" 0.0;
1688                fixed: 1 1;
1689                visible: 1;
1690                aspect: 1.0 1.0;
1691                aspect_preference: VERTICAL;
1692             }
1693             description { state: "disabled" 0.0;
1694                inherit: "default" 0.0;
1695                color: 128 128 128 128;
1696             }
1697             description { state: "disabled_visible" 0.0;
1698                inherit: "default" 0.0;
1699                color: 128 128 128 128;
1700                fixed: 1 1;
1701                visible: 1;
1702                aspect: 1.0 1.0;
1703             }
1704          }
1705          part { name: "elm.text";
1706             type: TEXTBLOCK;
1707             mouse_events: 0;
1708             scale: 1;
1709             description { state: "default" 0.0;
1710                visible: 0;
1711                fixed: 0 1;
1712                rel1 {
1713                   relative: 1.0 0.5;
1714                   offset: 1 1;
1715                   to_x: "elm.swallow.content";
1716                }
1717                rel2 {
1718                   relative: 1.0 0.5;
1719                   offset: -2 -2;
1720                }
1721                color: 255 255 255 255;
1722                align: 0.0 0.5;
1723                text {
1724                   style: "check_label_textblock_style";
1725                   min: 0 0;
1726                }
1727                color: CHECK_DEFAULT_TEXT_NORMAL_COLOR_INC;
1728             }
1729             description { state: "visible" 0.0;
1730                inherit: "default" 0.0;
1731                visible: 1;
1732                text.min: 1 1;
1733             }
1734             description { state: "disabled" 0.0;
1735                inherit: "default" 0.0;
1736             }
1737             description { state: "disabled_visible" 0.0;
1738                inherit: "default" 0.0;
1739                visible: 1;
1740                text.min: 1 1;
1741                color: CHECK_DEFAULT_TEXT_DISABLED_COLOR_INC;
1742             }
1743          }
1744          part { name: "events";
1745             type: RECT;
1746             ignore_flags: ON_HOLD;
1747             description { state: "default" 0.0;
1748                color: 0 0 0 0;
1749             }
1750          }
1751          part { name: "disabler";
1752             type: RECT;
1753             description { state: "default" 0.0;
1754                color: 0 0 0 0;
1755                visible: 0;
1756             }
1757             description { state: "disabled" 0.0;
1758                inherit: "default" 0.0;
1759                visible: 1;
1760             }
1761          }
1762       }
1763       programs {
1764          program { name: "show";
1765             signal: "show";
1766             script {
1767                set_int(check_visible, CHECK_SHOW);
1768             }
1769          }
1770          program { name: "hide";
1771             signal: "hide";
1772             script {
1773                set_int(check_visible, CHECK_HIDE);
1774             }
1775          }
1776          program { name: "click";
1777             signal: "mouse,clicked,1";
1778             source: "events";
1779             action: SIGNAL_EMIT "elm,action,check,toggle" "";
1780             after: "touch_sound";
1781          }
1782          program { name: "touch_sound";
1783             action: PLAY_SAMPLE "touch_sound" 1.0;
1784             after: "bg_normal";
1785          }
1786          program { name: "bg_normal";
1787             script {
1788                set_state(PART:"bg2", "default", 0.0);
1789             }
1790          }
1791          program { name: "pressed";
1792             signal: "mouse,down,1";
1793             source: "events";
1794             script {
1795                new st[31];
1796                new Float:vl;
1797                get_state(PART:"check", st, 30, vl);
1798                if (!strcmp(st, "visible"))
1799                  {
1800                     set_state(PART:"check", "pressed", 0.0);
1801                     set_state(PART:"bg2", "visible", 0.0);
1802                  }
1803             }
1804          }
1805          program { name: "mouse,out";
1806             signal: "mouse,out";
1807             source: "events";
1808             script {
1809                if (get_int(check_state) == CHECK_STATE_VISIBLE)
1810                  {
1811                     set_state(PART:"check", "visible", 0.0);
1812                     set_state(PART:"sequence_clip", "visible", 0.0);
1813                     set_state(PART:"bg2", "visible", 0.0);
1814                  }
1815                else
1816                  {
1817                     set_state(PART:"check", "default", 0.0);
1818                     set_state(PART:"sequence_clip", "default", 0.0);
1819                     set_state(PART:"bg2", "default", 0.0);
1820                  }
1821             }
1822          }
1823          program { name: "check_on";
1824             signal: "elm,state,check,on";
1825             source: "elm";
1826             script {
1827                set_int(check_state, CHECK_STATE_VISIBLE);
1828                if (get_int(check_visible) == CHECK_SHOW)
1829                  {
1830                     run_program(PROGRAM:"check_show_effect");
1831                     run_program(PROGRAM:"check_draw_effect");
1832                  }
1833                else
1834                  {
1835                     set_state(PART:"check", "visible", 0.0);
1836                     set_state(PART:"sequence_clip", "visible", 0.0);
1837                  }
1838                set_state(PART:"bg2", "visible", 0.0);
1839                set_state(PART:"selected_bg", "visible", 0.0);
1840             }
1841          }
1842          program { name: "check_off";
1843             signal: "elm,state,check,off";
1844             source: "elm";
1845             action: STATE_SET "default" 0.0;
1846             target: "check";
1847             script {
1848                if (get_int(check_state) == CHECK_STATE_VISIBLE)
1849                  {
1850                     set_int(check_state, CHECK_STATE_DEFAULT);
1851                     set_state(PART:"check", "default", 0.0);
1852                     set_state(PART:"sequence_clip", "default", 0.0);
1853                  }
1854                set_state(PART:"bg2", "default", 0.0);
1855                set_state(PART:"selected_bg", "default", 0.0);
1856             }
1857          }
1858          program { name: "check_show_effect";
1859             action: STATE_SET "visible" 0.0;
1860             transition: LINEAR 0.233;
1861             target: "check";
1862          }
1863          program { name: "check_draw_effect";
1864             action: STATE_SET "visible" 0.0;
1865             transition: LINEAR 0.267;
1866             target: "sequence_clip";
1867          }
1868          program { name: "text_show";
1869             signal: "elm,state,text,visible";
1870             source: "elm";
1871             action: STATE_SET "visible" 0.0;
1872             target: "elm.text";
1873          }
1874          program { name: "text_hide";
1875             signal: "elm,state,text,hidden";
1876             source: "elm";
1877             action: STATE_SET "default" 0.0;
1878             target: "elm.text";
1879          }
1880          program { name: "icon_show";
1881             signal: "elm,state,icon,visible";
1882             source: "elm";
1883             action: STATE_SET "visible" 0.0;
1884             target: "elm.swallow.content";
1885          }
1886          program { name: "icon_hide";
1887             signal: "elm,state,icon,hidden";
1888             source: "elm";
1889             action: STATE_SET "default" 0.0;
1890             target: "elm.swallow.content";
1891          }
1892          program { name: "disable";
1893             signal: "elm,state,disabled";
1894             source: "elm";
1895             action: STATE_SET "disabled" 0.0;
1896             target: "disabler";
1897             target: "bg2";
1898             after: "disable_text";
1899          }
1900          program { name: "disable_text";
1901             script {
1902                new st[31];
1903                new Float:vl;
1904                get_state(PART:"elm.text", st, 30, vl);
1905                if (!strcmp(st, "visible"))
1906                  set_state(PART:"elm.text", "disabled_visible", 0.0);
1907                else
1908                  set_state(PART:"elm.text", "disabled", 0.0);
1909                get_state(PART:"elm.swallow.content", st, 30, vl);
1910                if (!strcmp(st, "visible"))
1911                  set_state(PART:"elm.swallow.content", "disabled_visible", 0.0);
1912                else
1913                  set_state(PART:"elm.swallow.content", "disabled", 0.0);
1914                get_state(PART:"check", st, 30, vl);
1915                if (!strcmp(st, "visible"))
1916                  {
1917                     set_state(PART:"check", "disabled_visible", 0.0);
1918                     set_int(check_state, CHECK_STATE_DISABLED_VISIBLE);
1919                  }
1920             }
1921          }
1922          program { name: "enable";
1923             signal: "elm,state,enabled";
1924             source: "elm";
1925             action: STATE_SET "default" 0.0;
1926             target: "disabler";
1927             target: "bg2";
1928             after: "enable_text";
1929          }
1930          program { name: "enable_text";
1931             script {
1932                new st[31];
1933                new Float:vl;
1934                get_state(PART:"elm.text", st, 30, vl);
1935                if (!strcmp(st, "disabled_visible"))
1936                  set_state(PART:"elm.text", "visible", 0.0);
1937                else
1938                  set_state(PART:"elm.text", "default", 0.0);
1939                get_state(PART:"elm.swallow.content", st, 30, vl);
1940                if (!strcmp(st, "visible"))
1941                  set_state(PART:"elm.swallow.content", "visible", 0.0);
1942                else
1943                  set_state(PART:"elm.swallow.content", "default", 0.0);
1944                get_state(PART:"check", st, 30, vl);
1945                if (!strcmp(st, "disabled_visible"))
1946                  {
1947                     set_state(PART:"check", "visible", 0.0);
1948                     set_state(PART:"sequence_clip", "visible", 0.0);
1949                     set_int(check_state, CHECK_STATE_VISIBLE);
1950                  }
1951                else
1952                  set_int(check_state, CHECK_STATE_DEFAULT);
1953             }
1954          }
1955       }
1956    }
1957
1958 /////////////////////////////////////////////////////////////////////////////
1959 #if 0
1960    group { name: "elm/check/base/delete";
1961       images {
1962          image: "00_button_minus.png" COMP;
1963          image: "00_button_minus_press.png" COMP;
1964          image: "00_button_edit_Delete.png" COMP;
1965          image: "00_button_edit_Delete_press.png" COMP;
1966          image: "00_button_edit_dim.png" COMP;
1967          image: "00_button_edit_focus.png" COMP;
1968       }
1969       script {
1970          public button_state = 0; //0:enabled, 1: disabled
1971       }
1972       parts {
1973          part { name: "bg1";
1974             scale: 1;
1975             description { state: "default" 0.0;
1976                align: 1.0 0.5;
1977                rel1.to: "bg2";
1978                rel2.to: "bg2";
1979                image {
1980                   normal: "00_button_edit_Delete.png";
1981                   border: CHECK_STYLE_DELETE_BUTTON_BG_EXPAND_BORDER_INC;
1982                   border_scale: 1;
1983                }
1984             }
1985             description { state: "clicked" 0.0;
1986                inherit: "default" 0.0;
1987                image.normal: "00_button_edit_Delete_press.png";
1988             }
1989             description { state: "intermediate" 0.0;
1990                inherit: "default" 0.0;
1991                visible: 0;
1992             }
1993             description { state: "on" 0.0;
1994                inherit: "default" 0.0;
1995                visible: 0;
1996             }
1997             description { state: "disabled" 0.0;
1998                inherit: "default" 0.0;
1999                image.normal: "00_button_edit_dim.png";
2000             }
2001             description { state: "focused" 0.0;
2002                inherit: "default" 0.0;
2003                image.normal: "00_button_edit_focus.png";
2004             }
2005          }
2006          part { name: "bg2";
2007             scale: 1;
2008             description { state: "default" 0.0;
2009                align: 1.0 0.5;
2010                min: CHECK_STYLE_DELETE_BUTTON_BG_IMAGE_MIN_MAX_WIDTH_INC;
2011                max: CHECK_STYLE_DELETE_BUTTON_BG_IMAGE_MIN_MAX_WIDTH_INC;
2012                rel1.relative: 1.0 0.0;
2013                fixed: 1 0;
2014                image.normal: "00_button_minus.png";
2015             }
2016             description { state: "clicked" 0.0;
2017                inherit: "default" 0.0;
2018                image.normal: "00_button_minus_press.png";
2019             }
2020             description { state: "intermediate" 0.0;
2021                inherit: "default" 0.0;
2022                visible: 0;
2023             }
2024             description { state: "on" 0.0;
2025                inherit: "default" 0.0;
2026                visible: 0;
2027             }
2028             description { state: "disabled" 0.0;
2029                inherit: "default" 0.0;
2030                image.normal: "00_button_minus.png";
2031             }
2032          }
2033          part { name: "clipper";
2034             type: RECT;
2035             mouse_events: 0;
2036             scale: 1;
2037             description { state: "default" 0.0;
2038                align: 1.0 0.5;
2039                min: CHECK_STYLE_DELETE_BUTTON_BG_IMAGE_MIN_MAX_WIDTH_INC;
2040                max: CHECK_STYLE_DELETE_BUTTON_BG_IMAGE_MIN_MAX_WIDTH_INC;
2041                color: 255 255 255 255;
2042             }
2043             description { state: "on" 0.0;
2044                align: 1.0 0.5;
2045                min: CHECK_STYLE_DELETE_BUTTON_BG_EXPAND_IMAGE_MIN_MAX_WIDTH_INC;
2046                max: CHECK_STYLE_DELETE_BUTTON_BG_EXPAND_IMAGE_MIN_MAX_WIDTH_INC;
2047                color: 255 255 255 255;
2048             }
2049          }
2050          part { name: "bg_expand";
2051             mouse_events: 0;
2052             scale: 1;
2053             clip_to: "clipper";
2054             description { state: "default" 0.0;
2055                align: 0.0 0.5;
2056                min: CHECK_STYLE_DELETE_BUTTON_BG_EXPAND_IMAGE_MIN_MAX_WIDTH_INC;
2057                max: CHECK_STYLE_DELETE_BUTTON_BG_EXPAND_IMAGE_MIN_MAX_WIDTH_INC;
2058                image {
2059                   normal: "00_button_edit_Delete.png";
2060                   border: CHECK_STYLE_DELETE_BUTTON_BG_EXPAND_BORDER_INC;
2061                   border_scale: 1;
2062                }
2063                rel1 {
2064                   relative: 1 0; 
2065                   to_x: "bg2"; 
2066                }
2067                rel2.to_x: "bg2";
2068                fixed: 1 0;
2069             }
2070             description { state: "clicked" 0.0;
2071                inherit: "default" 0.0;
2072                align: 1.0 0.5;
2073                image.normal: "00_button_edit_Delete_press.png";
2074             }
2075             description { state: "intermediate" 0.0;
2076                inherit: "default" 0.0;
2077                rel1 {
2078                   relative: 0 0;
2079                   to_x: "bg2";
2080                }
2081                rel2 {
2082                   relative: 0 1;
2083                   to_x: "bg2";
2084                }
2085             }
2086             description { state: "on" 0.0;
2087                inherit: "default" 0.0;
2088                align: 1.0 0.5;
2089             }
2090          }
2091          part { name: "check";
2092             type: TEXT;
2093             mouse_events: 0;
2094             scale: 1;
2095             description { state: "default" 0.0;
2096                visible: 0;
2097                align: 1.0 0.5;
2098                min: 0 0;
2099                text {
2100                   font: "Tizen:style=Medium";
2101                   size: CHECK_STYLE_DELETE_BUTTON_TEXT_FONT_SIZE_INC;
2102                   min: 0 0;
2103                   text: "";
2104                   text_class: "tizen";
2105                }
2106             }
2107             description { state: "visible" 0.0;
2108                align: 1.0 0.5;
2109                min: CHECK_STYLE_DELETE_BUTTON_BG_EXPAND_IMAGE_MIN_MAX_WIDTH_INC;
2110                max: CHECK_STYLE_DELETE_BUTTON_BG_EXPAND_IMAGE_MIN_MAX_WIDTH_INC;
2111                color: CHECK_DELETE_TEXT_DELETE_NORMAL_COLOR_INC;
2112                text {
2113                   font: "Tizen:style=Medium";
2114                   size: CHECK_STYLE_DELETE_BUTTON_TEXT_FONT_SIZE_INC;
2115                   min: 1 0;
2116                   text: "Delete";
2117                   text_class: "tizen";
2118                }
2119             }
2120             description { state: "visible_pressed" 0.0;
2121                inherit: "visible" 0.0;
2122                color: CHECK_DELETE_TEXT_DELETE_PRESS_COLOR_INC;
2123             }
2124          }
2125          part { name: "elm.swallow.content";
2126             type: SWALLOW;
2127             description { state: "default" 0.0;
2128                fixed: 1 0;
2129                visible: 0;
2130                color: 255 255 255 255;
2131                align: 0.0 0.5;
2132                rel1 {
2133                   to_x: "bg2";
2134                   relative: 1.0 0.0;
2135                   offset: 1 1;
2136                }
2137                rel2 {
2138                   to_x: "bg2";
2139                   relative: 1.0 1.0;
2140                   offset: 2 -2;
2141                }
2142             }
2143             description { state: "visible" 0.0;
2144                inherit: "default" 0.0;
2145                fixed: 1 1;
2146                visible: 1;
2147                aspect: 1.0 1.0;
2148                aspect_preference: VERTICAL;
2149             }
2150             description { state: "disabled" 0.0;
2151                inherit: "default" 0.0;
2152                color: 128 128 128 128;
2153             }
2154             description { state: "disabled_visible" 0.0;
2155                inherit: "default" 0.0;
2156                color: 128 128 128 128;
2157                fixed: 1 1;
2158                visible: 1;
2159                aspect: 1.0 1.0;
2160             }
2161          }
2162          part { name: "elm.text";
2163             type: TEXTBLOCK;
2164             mouse_events: 0;
2165             scale: 1;
2166             description { state: "default" 0.0;
2167                visible: 0;
2168                fixed: 1 1;
2169                rel1 {
2170                   relative: 1.0 0.5;
2171                   offset: 1 1;
2172                   to_x: "elm.swallow.content";
2173                }
2174                rel2 {
2175                   relative: 1.0 0.5;
2176                   offset: -2 -2;
2177                }
2178                color: 255 255 255 255;
2179                align: 0.0 0.5;
2180                text {
2181                   style: "check_label_textblock_style";
2182                   min: 0 0;
2183                }
2184                color: CHECK_DEFAULT_TEXT_NORMAL_COLOR_INC;
2185             }
2186             description { state: "visible" 0.0;
2187                inherit: "default" 0.0;
2188                visible: 1;
2189                text.min: 1 1;
2190             }
2191             description { state: "disabled" 0.0;
2192                inherit: "default" 0.0;
2193             }
2194             description { state: "disabled_visible" 0.0;
2195                inherit: "default" 0.0;
2196                visible: 1;
2197                text.min: 1 1;
2198                color: CHECK_DEFAULT_TEXT_DISABLED_COLOR_INC;
2199             }
2200          }
2201          part { name: "events1";
2202             type: RECT;
2203             ignore_flags: ON_HOLD;
2204             description { state: "default" 0.0;
2205                color: 0 0 0 0;
2206                rel1.to: "bg2";
2207                rel2.to_x: "elm.text";
2208                align: 0.0 0.5;
2209             }
2210             description { state: "visible" 0.0;
2211                color: 0 0 0 0;
2212                rel1.to: "bg_expand";
2213                rel2.to_x: "elm.text";
2214                align: 0.0 0.5;
2215             }
2216          }
2217          part { name: "events2";
2218             type: RECT;
2219             repeat_events: 1;
2220             description { state: "default" 0.0;
2221                color: 0 0 0 0;
2222                rel1.to: "bg2";
2223                rel2.to_x: "elm.text";
2224                align: 0.0 0.5;
2225             }
2226             description { state: "visible" 0.0;
2227                color: 0 0 0 0;
2228                rel1.to: "bg_expand";
2229                rel2.to_x: "elm.text";
2230                align: 0.0 0.5;
2231             }
2232          }
2233          part { name: "disabler";
2234             type: RECT;
2235             description { state: "default" 0.0;
2236                rel2.to_x: "elm.text";
2237                color: 0 0 0 0;
2238                visible: 0;
2239             }
2240             description { state: "disabled" 0.0;
2241                inherit: "default" 0.0;
2242                visible: 1;
2243             }
2244          }
2245       }
2246       programs {
2247          program { name: "click";
2248             signal: "mouse,clicked,1";
2249             source: "events1";
2250             script {
2251                new st[31];
2252                new Float:vl;
2253                get_state(PART:"check", st, 30, vl);
2254                if (!strcmp(st, "visible_pressed"))
2255                  set_state(PART:"check", "visible", 0.0);
2256             }
2257             after: "toggle";
2258          }
2259          program { name: "toggle";
2260             action: SIGNAL_EMIT "elm,action,check,toggle" "";
2261             after: "touch_sound";
2262          }
2263          program { name: "touch_sound";
2264             action: PLAY_SAMPLE "touch_sound" 1.0;
2265          }
2266          program { name: "unfocused";
2267             signal: "elm,action,unfocus";
2268             source: "elm";
2269             script {
2270                new st[31];
2271                new Float:vl;
2272                get_state(PART:"bg2", st, 30, vl);
2273                if (!strcmp(st, "on"))
2274                  emit("elm,action,check,toggle", "");
2275             }
2276          }
2277          program { name: "click_down";
2278             signal: "mouse,down,1";
2279             source: "events2";
2280             script {
2281                new st[31];
2282                new Float:vl;
2283                get_state(PART:"check", st, 30, vl);
2284                if (!strcmp(st, "visible"))
2285                  {
2286                     set_state(PART:"bg_expand", "clicked", 0.0);
2287                     set_state(PART:"check", "visible_pressed", 0.0);
2288                  }
2289                else 
2290                  {
2291                     set_state(PART:"bg2", "clicked", 0.0);
2292                     set_state(PART:"bg1", "clicked", 0.0);
2293                  }
2294             }
2295          }
2296          program { name: "check_normal";
2297             signal: "mouse,up,1";
2298             source: "events2";
2299             script {
2300                new st[31];
2301                new Float:vl;
2302                get_state(PART:"check", st, 30, vl);
2303                if (!strcmp(st, "visible_pressed"))
2304                  {
2305                     set_state(PART:"bg_expand", "on", 0.0);
2306                     set_state(PART:"check", "visible", 0.0);
2307                  }
2308                get_state(PART:"bg_expand", st, 30, vl);
2309                if (!strcmp(st, "default"))
2310                  {
2311                     set_state(PART:"bg2", "default", 0.0);
2312                     set_state(PART:"bg1", "default", 0.0);
2313                  }
2314             }
2315          }
2316          program { name: "check_on";
2317             signal: "elm,state,check,on";
2318             source: "elm";
2319             action: STATE_SET "on" 0.0;
2320             target: "clipper";
2321             after: "start_expand";
2322          }
2323          program { name: "start_expand";
2324             action: STATE_SET "intermediate" 0.0;
2325             target: "bg2";
2326             target: "bg1";
2327             target: "bg_expand";
2328             after: "expand";
2329          }
2330          program { name: "expand";
2331             action: STATE_SET "on" 0.0;
2332             target: "bg_expand";
2333             target: "bg2";
2334             target: "bg1";
2335             transition: ACCELERATE 0.1;
2336             after: "check_visible";
2337          }
2338          program { name: "check_visible";
2339             action: STATE_SET "visible" 0.0;
2340             target: "check";
2341             target: "events1";
2342             target: "events2";
2343          }
2344          program { name: "check_off";
2345             signal: "elm,state,check,off";
2346             source: "elm";
2347             action: STATE_SET "default" 0.0;
2348             target: "check";
2349             after: "contract";
2350          }
2351          program { name: "contract";
2352             action: STATE_SET "intermediate" 0.0;
2353             target: "bg_expand";
2354             transition: ACCELERATE 0.1;
2355             after: "normal_bg";
2356          }
2357          program { name: "normal_bg";
2358             script {
2359                if (get_int(button_state) !=1)
2360                  {
2361                     set_state(PART:"bg2", "default", 0.0);
2362                     set_state(PART:"bg1", "default", 0.0);
2363                  }
2364                else
2365                  {
2366                     set_state(PART:"bg2", "disabled", 0.0);
2367                     set_state(PART:"bg1", "disabled", 0.0);
2368                  }
2369             }
2370             after: "bg_default";
2371          }
2372          program { name: "bg_default";
2373             action: STATE_SET "default" 0.0;
2374             target: "bg_expand";
2375             target: "clipper";
2376             target: "events1";
2377             target: "events2";
2378          }
2379          program { name: "text_show";
2380             signal: "elm,state,text,visible";
2381             source: "elm";
2382             action: STATE_SET "visible" 0.0;
2383             target: "elm.text";
2384          }
2385          program { name: "text_hide";
2386             signal: "elm,state,text,hidden";
2387             source: "elm";
2388             action: STATE_SET "default" 0.0;
2389             target: "elm.text";
2390          }
2391          program { name: "icon_show";
2392             signal: "elm,state,icon,visible";
2393             source: "elm";
2394             action: STATE_SET "visible" 0.0;
2395             target: "elm.swallow.content";
2396          }
2397          program { name: "icon_hide";
2398             signal: "elm,state,icon,hidden";
2399             source: "elm";
2400             action: STATE_SET "default" 0.0;
2401             target: "elm.swallow.content";
2402          }
2403          program { name: "disable";
2404             signal: "elm,state,disabled";
2405             source: "elm";
2406             action: STATE_SET "disabled" 0.0;
2407             target: "disabler";
2408             target: "bg2";
2409             target: "bg1";
2410             after: "disable_text";
2411          }
2412          program { name: "disable_text";
2413             script {
2414                new st[31];
2415                new Float:vl;
2416                get_state(PART:"elm.text", st, 30, vl);
2417                if (!strcmp(st, "visible"))
2418                  set_state(PART:"elm.text", "disabled_visible", 0.0);
2419                else
2420                  set_state(PART:"elm.text", "disabled", 0.0);
2421                get_state(PART:"elm.swallow.content", st, 30, vl);
2422                if (!strcmp(st, "visible"))
2423                  set_state(PART:"elm.swallow.content", "disabled_visible", 0.0);
2424                else
2425                  set_state(PART:"elm.swallow.content", "disabled", 0.0);
2426                set_int(button_state, 1);
2427             }
2428          }
2429          program { name: "enable";
2430             signal: "elm,state,enabled";
2431             source: "elm";
2432             action: STATE_SET "default" 0.0;
2433             target: "disabler";
2434             target: "bg2";
2435             target: "bg1";
2436             after: "enable_text";
2437          }
2438          program { name: "enable_text";
2439             script {
2440                new st[31];
2441                new Float:vl;
2442                get_state(PART:"elm.text", st, 30, vl);
2443                if (!strcmp(st, "disabled_visible"))
2444                  set_state(PART:"elm.text", "visible", 0.0);
2445                else
2446                  set_state(PART:"elm.text", "default", 0.0);
2447                get_state(PART:"elm.swallow.content", st, 30, vl);
2448                if (!strcmp(st, "visible"))
2449                  set_state(PART:"elm.swallow.content", "visible", 0.0);
2450                else
2451                  set_state(PART:"elm.swallow.content", "default", 0.0);
2452                set_int(button_state, 0);
2453             }
2454          }
2455       }
2456    }
2457
2458 ////////////////////////////////////////////////////////////////////////////////////
2459    group { name: "elm/check/base/multicheck";
2460       images {
2461          image: "00_check_bg.png" COMP;
2462          image: "00_check_bg_press.png" COMP;
2463          image: "multicheck_0001.png" COMP;
2464          image: "multicheck_0002.png" COMP;
2465          image: "multicheck_0003.png" COMP;
2466          image: "multicheck_0004.png" COMP;
2467          image: "multicheck_0005.png" COMP;
2468          image: "multicheck_0006.png" COMP;
2469          image: "00_check_checking.png" COMP;
2470       }
2471       script {
2472          public check_state = 0; //0:default, 1: visible, 2: disabled_visible
2473       }
2474       parts {
2475          part { name: "bg";
2476             scale: 1;
2477             clip_to: "disclip";
2478             description { state: "default" 0.0;
2479                rel2.relative: 0.0 1.0;
2480                align: 0.0 0.5;
2481                min: 44 44;
2482                max: 44 44;
2483                aspect: 1.0 1.0;
2484                aspect_preference: VERTICAL;
2485                image.normal: "00_check_bg.png";
2486                fill.smooth : 0;
2487             }
2488             description { state: "pressed" 0.0;
2489                inherit: "default" 0.0;
2490                image.normal: "00_check_bg_press.png";
2491                fill.smooth : 0;
2492             }
2493             description { state: "disabled" 0.0;
2494                inherit: "default" 0.0;
2495             }
2496          }
2497          part { name: "check";
2498             mouse_events: 0;
2499             clip_to: "disclip";
2500             scale: 1;
2501             description { state: "default" 0.0;
2502                rel1.to: "bg";
2503                rel2.to: "bg";
2504                visible: 0;
2505             }
2506             description { state: "visible_1" 0.0;
2507                inherit: "default" 0.0;
2508                visible: 1;
2509                image.normal: "multicheck_0001.png";
2510             }
2511             description { state: "visible_2" 0.0;
2512                inherit: "default" 0.0;
2513                visible: 1;
2514                image.normal: "multicheck_0002.png";
2515             }
2516             description { state: "visible_3" 0.0;
2517                inherit: "default" 0.0;
2518                visible: 1;
2519                image.normal: "multicheck_0003.png";
2520             }
2521             description { state: "visible_4" 0.0;
2522                inherit: "default" 0.0;
2523                visible: 1;
2524                image.normal: "multicheck_0004.png";
2525             }
2526             description { state: "visible_5" 0.0;
2527                inherit: "default" 0.0;
2528                visible: 1;
2529                image.normal: "multicheck_0005.png";
2530             }
2531             description { state: "visible" 0.0;
2532                inherit: "default" 0.0;
2533                visible: 1;
2534                image.normal: "multicheck_0006.png";
2535             }
2536             description { state: "pressed" 0.0;
2537                inherit: "default" 0.0;
2538                visible: 1;
2539                image.normal: "multicheck_0006.png";
2540             }
2541             description { state: "disabled_visible" 0.0;
2542                inherit: "default" 0.0;
2543                image.normal: "00_check_checking.png";
2544                visible: 1;
2545             }
2546          }
2547          part { name: "elm.swallow.content";
2548             type: SWALLOW;
2549             clip_to: "disclip";
2550             description { state: "default" 0.0;
2551                fixed: 1 0;
2552                visible: 0;
2553                color: 255 255 255 255;
2554                align: 0.0 0.5;
2555                rel1 {
2556                   to_x: "bg";
2557                   relative: 1.0 0.0;
2558                   offset: 1 1;
2559                }
2560                rel2 {
2561                   to_x: "bg";
2562                   relative: 1.0 1.0;
2563                   offset: 2 -2;
2564                }
2565             }
2566             description { state: "visible" 0.0;
2567                inherit: "default" 0.0;
2568                fixed: 1 1;
2569                visible: 1;
2570                aspect: 1.0 1.0;
2571                aspect_preference: VERTICAL;
2572             }
2573             description { state: "disabled" 0.0;
2574                inherit: "default" 0.0;
2575                color: 128 128 128 128;
2576             }
2577             description { state: "disabled_visible" 0.0;
2578                inherit: "default" 0.0;
2579                color: 128 128 128 128;
2580                fixed: 1 1;
2581                visible: 1;
2582                aspect: 1.0 1.0;
2583             }
2584          }
2585          part { name: "elm.text";
2586             type: TEXTBLOCK;
2587             clip_to: "disclip";
2588             mouse_events: 0;
2589             scale: 1;
2590             description { state: "default" 0.0;
2591                visible: 0;
2592                fixed: 0 1;
2593                rel1 {
2594                   relative: 1.0 0.5;
2595                   offset: 1 1;
2596                   to_x: "elm.swallow.content";
2597                }
2598                rel2 {
2599                   relative: 1.0 0.5;
2600                   offset: -2 -2;
2601                }
2602                align: 0.0 0.5;
2603                text {
2604                   style: "check_label_textblock_style";
2605                   min: 0 0;
2606                }
2607                color: CHECK_DEFAULT_TEXT_NORMAL_COLOR_INC;
2608             }
2609             description { state: "visible" 0.0;
2610                inherit: "default" 0.0;
2611                visible: 1;
2612                text.min: 1 1;
2613             }
2614             description { state: "disabled" 0.0;
2615                inherit: "default" 0.0;
2616             }
2617             description { state: "disabled_visible" 0.0;
2618                inherit: "default" 0.0;
2619                visible: 1;
2620                text.min: 1 1;
2621                color: CHECK_DEFAULT_TEXT_DISABLED_COLOR_INC;
2622             }
2623          }
2624          part { name: "events1";
2625             type: RECT;
2626             ignore_flags: ON_HOLD;
2627             description { state: "default" 0.0;
2628                color: 0 0 0 0;
2629             }
2630          }
2631          part { name: "disclip";
2632             type: RECT;
2633             mouse_events: 0;
2634             description { state: "default" 0.0;
2635                color: 255 255 255 255;
2636             }
2637             description { state: "disabled" 0.0;
2638                inherit: "default" 0.0;
2639                color: 255 255 255 102;
2640             }
2641          }
2642          part { name: "events2";
2643             type: RECT;
2644             repeat_events: 1;
2645             description { state: "default" 0.0;
2646                color: 0 0 0 0;
2647             }
2648          }
2649          part { name: "disabler";
2650             type: RECT;
2651             description { state: "default" 0.0;
2652                color: 0 0 0 0;
2653                visible: 0;
2654             }
2655             description { state: "disabled" 0.0;
2656                inherit: "default" 0.0;
2657                visible: 1;
2658             }
2659          }
2660       }
2661       programs {
2662          program { name: "click";
2663             signal: "mouse,clicked,1";
2664             source: "events1";
2665             action: SIGNAL_EMIT "elm,action,check,toggle" "";
2666             after: "touch_sound";
2667          }
2668          program { name: "touch_sound";
2669             action: PLAY_SAMPLE "touch_sound" 1.0;
2670          }
2671          program { name: "bg_normal";
2672             signal: "mouse,up,1";
2673             source: "events2";
2674             script {
2675                new st[31];
2676                new Float:vl;
2677                get_state(PART:"check", st, 30, vl);
2678                if (!strcmp(st, "pressed"))
2679                  set_state(PART:"check", "visible", 0.0);
2680                set_state(PART:"bg", "default", 0.0);
2681             }
2682          }
2683          program { name: "pressed";
2684             signal: "mouse,down,1";
2685             source: "events2";
2686             script {
2687                new st[31];
2688                new Float:vl;
2689                get_state(PART:"check", st, 30, vl);
2690                if (!strcmp(st, "default"))
2691                  set_state(PART:"check", "pressed", 0.0);
2692                else
2693                  set_state(PART:"check", "default", 0.0);
2694                set_state(PART:"bg", "pressed", 0.0);
2695             }
2696          }
2697          program { name: "mouse,out";
2698             signal: "mouse,out";
2699             source: "events2";
2700             script {
2701                if (get_int(check_state) == 1)
2702                  set_state(PART:"check", "visible", 0.0);
2703                else
2704                  set_state(PART:"check", "default", 0.0);
2705             }
2706          }
2707          program { name: "check_on";
2708             signal: "elm,state,check,on";
2709             source: "elm";
2710             script {
2711                set_int(check_state, 1);
2712             }
2713             after: "check_on_1";
2714          }
2715          program { name: "check_on_1";
2716             in: 0.05 0.0;
2717             script {
2718                if (get_int(check_state) == 1)
2719                  set_state(PART:"check", "visible_1", 0.0);
2720             }
2721             after: "check_on_2";
2722          }
2723          program { name: "check_on_2";
2724             in: 0.05 0.0;
2725             script {
2726                if (get_int(check_state) == 1)
2727                  set_state(PART:"check", "visible_2", 0.0);
2728             }
2729             after: "check_on_3";
2730          }
2731          program { name: "check_on_3";
2732             in: 0.05 0.0;
2733             script {
2734                if (get_int(check_state) == 1)
2735                  set_state(PART:"check", "visible_3", 0.0);
2736             }
2737             after: "check_on_4";
2738          }
2739          program { name: "check_on_4";
2740             in: 0.05 0.0;
2741             script {
2742                if (get_int(check_state) == 1)
2743                  set_state(PART:"check", "visible_4", 0.0);
2744             }
2745             after: "check_on_5";
2746          }
2747          program { name: "check_on_5";
2748             in: 0.05 0.0;
2749             script {
2750                if (get_int(check_state) == 1)
2751                  set_state(PART:"check", "visible_5", 0.0);
2752             }
2753             after: "check_on_6";
2754          }
2755          program { name: "check_on_6";
2756             in: 0.05 0.0;
2757             script {
2758                if (get_int(check_state) == 1)
2759                  set_state(PART:"check", "visible", 0.0);
2760             }
2761          }
2762          program { name: "check_off";
2763             signal: "elm,state,check,off";
2764             source: "elm";
2765             action: STATE_SET "default" 0.0;
2766             target: "check";
2767             script {
2768                if (get_int(check_state) == 1)
2769                  {
2770                     set_int(check_state, 0);
2771                     set_state(PART:"check", "default", 0.0);
2772                  }
2773             }
2774          }
2775          program { name: "text_show";
2776             signal: "elm,state,text,visible";
2777             source: "elm";
2778             action: STATE_SET "visible" 0.0;
2779             target: "elm.text";
2780          }
2781          program { name: "text_hide";
2782             signal: "elm,state,text,hidden";
2783             source: "elm";
2784             action: STATE_SET "default" 0.0;
2785             target: "elm.text";
2786          }
2787          program { name: "icon_show";
2788             signal: "elm,state,icon,visible";
2789             source: "elm";
2790             action: STATE_SET "visible" 0.0;
2791             target: "elm.swallow.content";
2792          }
2793          program { name: "icon_hide";
2794             signal: "elm,state,icon,hidden";
2795             source: "elm";
2796             action: STATE_SET "default" 0.0;
2797             target: "elm.swallow.content";
2798          }
2799          program { name: "disable";
2800             signal: "elm,state,disabled";
2801             source: "elm";
2802             action: STATE_SET "disabled" 0.0;
2803             target: "disabler";
2804             target: "disclip";
2805             target: "bg";
2806             after: "disable_text";
2807          }
2808          program { name: "disable_text";
2809             script {
2810                new st[31];
2811                new Float:vl;
2812                get_state(PART:"elm.text", st, 30, vl);
2813                if (!strcmp(st, "visible"))
2814                  set_state(PART:"elm.text", "disabled_visible", 0.0);
2815                else
2816                  set_state(PART:"elm.text", "disabled", 0.0);
2817                get_state(PART:"elm.swallow.content", st, 30, vl);
2818                if (!strcmp(st, "visible"))
2819                  set_state(PART:"elm.swallow.content", "disabled_visible", 0.0);
2820                else
2821                  set_state(PART:"elm.swallow.content", "disabled", 0.0);
2822                get_state(PART:"check", st, 30, vl);
2823                if (!strcmp(st, "visible"))
2824                  set_state(PART:"check", "disabled_visible", 0.0);
2825                set_int(check_state, 2);
2826             }
2827          }
2828          program { name: "enable";
2829             signal: "elm,state,enabled";
2830             source: "elm";
2831             action: STATE_SET "default" 0.0;
2832             target: "disabler";
2833             target: "disclip";
2834             target: "bg";
2835             after: "enable_text";
2836          }
2837          program { name: "enable_text";
2838             script {
2839                new st[31];
2840                new Float:vl;
2841                get_state(PART:"elm.text", st, 30, vl);
2842                if (!strcmp(st, "disabled_visible"))
2843                  set_state(PART:"elm.text", "visible", 0.0);
2844                else
2845                  set_state(PART:"elm.text", "default", 0.0);
2846                get_state(PART:"elm.swallow.content", st, 30, vl);
2847                if (!strcmp(st, "visible"))
2848                  set_state(PART:"elm.swallow.content", "visible", 0.0);
2849                else
2850                  set_state(PART:"elm.swallow.content", "default", 0.0);
2851                get_state(PART:"check", st, 30, vl);
2852                if (!strcmp(st, "disabled_visible"))
2853                  {
2854                     set_state(PART:"check", "visible", 0.0);
2855                     set_int(check_state, 1);
2856                  }
2857                else
2858                  set_int(check_state, 0);
2859             }
2860          }
2861       }
2862    }
2863 #endif
2864
2865 #undef CHECK_STATE_DEFAULT
2866 #undef CHECK_STATE_VISIBLE
2867 #undef CHECK_STATE_DISABLED_VISIBLE
2868 #undef CHECK_STATE_DISABLED
2869
2870 #undef CHECK_HIDE
2871 #undef CHECK_SHOW