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