[Check] Multisense Sound support added to Check Button.
[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 6;
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.0;
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.0;
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                   offset: 1 1;
1412                }
1413                rel2 {
1414                   to_x: "bg";
1415                   relative: 1.0 1.0;
1416                   offset: 2 -2;
1417                }
1418             }
1419             description { state: "visible" 0.0;
1420                inherit: "default" 0.0;
1421                fixed: 1 1;
1422                visible: 1;
1423                aspect: 1.0 1.0;
1424                aspect_preference: VERTICAL;
1425             }
1426             description { state: "disabled" 0.0;
1427                inherit: "default" 0.0;
1428             }
1429             description { state: "disabled_visible" 0.0;
1430                inherit: "default" 0.0;
1431                fixed: 1 1;
1432                visible: 1;
1433                aspect: 1.0 1.0;
1434             }
1435          }
1436          part { name: "elm.text";
1437             type: TEXTBLOCK;
1438             mouse_events: 0;
1439             scale: 1;
1440             clip_to: "disclip";
1441             description { state: "default" 0.0;
1442                visible: 0;
1443                fixed: 0 1;
1444                rel1 {
1445                   relative: 1.0 0.5;
1446                   offset: 1 1;
1447                   to_x: "elm.swallow.content";
1448                }
1449                rel2 {
1450                   relative: 1.0 0.5;
1451                   offset: -2 -2;
1452                }
1453                align: 0.0 0.5;
1454                text {
1455                   style: "check_label_textblock_style";
1456                   min: 0 0;
1457                }
1458                color: CHECK_DEFAULT_TEXT_NORMAL_COLOR_INC;
1459             }
1460             description { state: "visible" 0.0;
1461                inherit: "default" 0.0;
1462                visible: 1;
1463                text.min: 1 1;
1464             }
1465             description { state: "disabled" 0.0;
1466                inherit: "default" 0.0;
1467             }
1468             description { state: "disabled_visible" 0.0;
1469                inherit: "default" 0.0;
1470                visible: 1;
1471                text.min: 1 1;
1472             }
1473          }
1474          part { name: "disclip";
1475             type: RECT;
1476             mouse_events: 0;
1477             description { state: "default" 0.0;
1478                color: CHECK_DISCLIP_NORMAL_COLOR_INC;
1479             }
1480             description { state: "disabled" 0.0;
1481                inherit: "default" 0.0;
1482                color: CHECK_DISCLIP_DISABLED_COLOR_INC;
1483             }
1484          }
1485          part { name: "disabler";
1486             type: RECT;
1487             description { state: "default" 0.0;
1488                color: 0 0 0 0;
1489                visible: 0;
1490             }
1491             description { state: "disabled" 0.0;
1492                inherit: "default" 0.0;
1493                visible: 1;
1494             }
1495          }
1496       }
1497       programs {
1498          program {
1499             signal: "mouse,clicked,1";
1500             source: "button";
1501             script {
1502                new Float:dx, Float:dy;
1503                get_drag(PART:"button", dx, dy);
1504                if (!get_int(was_drag)) {
1505                   if (dx > 0.5)
1506                     set_drag(PART:"button", 0.0, 0.0);
1507                   else
1508                     set_drag(PART:"button", 1.0, 0.0);
1509                   if (((get_int(is_rtl) == 1) && (dx <= 0.5)) ||
1510                       (get_int(is_rtl) == 0) && (dx > 0.5)) {
1511                      if (get_int(check_on)) {
1512                        emit("elm,action,check,off", "");
1513                        emit("elm,action,touch,sound", "");
1514                      }
1515                   }
1516                   else {
1517                      if (!get_int(check_on)) {
1518                        emit("elm,action,check,on", "");
1519                        emit("elm,action,touch,sound", "");
1520                      }
1521                   }
1522                }
1523             }
1524          }
1525          program { name: "touch_sound";
1526             signal: "elm,action,touch,sound";
1527             source: "";
1528             action: PLAY_SAMPLE "touch_sound" 1.0;
1529          }
1530          program {
1531             signal: "drag";
1532             source: "button";
1533             script {
1534                if (!get_int(is_drag)) emit("elm,action,check,drag,start", "");
1535                set_int(is_drag, 1);
1536             }
1537          }
1538          program {
1539             signal: "mouse,down,1";
1540             source: "button";
1541             script {
1542                set_int(was_drag, 0);
1543                set_int(is_drag, 0);
1544             }
1545          }
1546          program { name: "drag_end";
1547             signal: "mouse,up,1";
1548             source: "button";
1549             script {
1550                new Float:dx, Float:dy;
1551                get_drag(PART:"button", dx, dy);
1552                if (get_int(is_drag)) {
1553                   if (dx > 0.5)
1554                     set_drag(PART:"button", 1.0, 0.0);
1555                   else
1556                     set_drag(PART:"button", 0.0, 0.0);
1557                   if (((get_int(is_rtl) == 1) && (dx <= 0.5)) ||
1558                       (get_int(is_rtl) == 0) && (dx > 0.5)) {
1559                      if (!get_int(check_on)) {
1560                        emit("elm,action,check,on", "");
1561                        emit("elm,action,touch,sound", "");
1562                      }
1563                   }
1564                   else {
1565                      if (get_int(check_on)) {
1566                        emit("elm,action,check,off", "");
1567                        emit("elm,action,touch,sound", "");
1568                      }
1569                   }
1570                   set_int(was_drag, get_int(is_drag));
1571                   set_int(is_drag, 0);
1572                   emit("elm,action,check,drag,stop", "");
1573                }
1574             }
1575          }
1576          program { name: "check_on";
1577             signal: "elm,state,check,on";
1578             source: "elm";
1579             script {
1580                new Float:drag;
1581                if (get_int(is_rtl) == 0) {
1582                   drag = 100.0;
1583                }
1584                else {
1585                   drag = 0.0;
1586                }
1587                set_drag(PART:"button", drag, 0.0);
1588                set_state(PART:"bg_image", "visible", 0.0);
1589                set_int(check_on, 1);
1590             }
1591          }
1592          program { name: "check_off";
1593             signal: "elm,state,check,off";
1594             source: "elm";
1595             script {
1596                new Float:drag;
1597                if (get_int(is_rtl) == 0) {
1598                   drag = 0.0;
1599                }
1600                else {
1601                   drag = 100.0;
1602                }
1603                set_drag(PART:"button", drag, 0.0);
1604                set_state(PART:"bg_image", "default", 0.0);
1605                set_int(check_on, 0);
1606             }
1607          }
1608          program { name: "text_show";
1609             signal: "elm,state,text,visible";
1610             source: "elm";
1611             action:  STATE_SET "visible" 0.0;
1612             target: "elm.text";
1613          }
1614          program { name: "text_hide";
1615             signal: "elm,state,text,hidden";
1616             source: "elm";
1617             action:  STATE_SET "default" 0.0;
1618             target: "elm.text";
1619          }
1620          program { name: "icon_show";
1621             signal: "elm,state,icon,visible";
1622             source: "elm";
1623             action:  STATE_SET "visible" 0.0;
1624             target: "elm.swallow.content";
1625          }
1626          program { name: "icon_hide";
1627             signal: "elm,state,icon,hidden";
1628             source: "elm";
1629             action: STATE_SET "default" 0.0;
1630             target: "elm.swallow.content";
1631          }
1632          program { name: "disable";
1633             signal: "elm,state,disabled";
1634             source: "elm";
1635             action: STATE_SET "disabled" 0.0;
1636             target: "elm.offtext";
1637             target: "elm.ontext";
1638             target: "onrect";
1639             target: "offrect";
1640             target: "disabler";
1641             after: "disable_text";
1642          }
1643          program { name: "disable_text";
1644             script {
1645                new st[31];
1646                new Float:vl;
1647                get_state(PART:"elm.text", st, 30, vl);
1648                if (!strcmp(st, "visible"))
1649                  set_state(PART:"elm.text", "disabled_visible", 0.0);
1650                else
1651                  set_state(PART:"elm.text", "disabled", 0.0);
1652                get_state(PART:"bg_image", st, 30, vl);
1653                if (!strcmp(st, "visible"))
1654                  set_state(PART:"bg_image", "visible_disable", 0.0);
1655                else
1656                  set_state(PART:"bg_image", "off_disable", 0.0);
1657                get_state(PART:"elm.swallow.content", st, 30, vl);
1658                if (!strcmp(st, "visible"))
1659                  set_state(PART:"elm.swallow.content", "disabled_visible", 0.0);
1660                else
1661                  set_state(PART:"elm.swallow.content", "disabled", 0.0);
1662                set_state(PART:"button", "disabled", 0.0);
1663             }
1664          }
1665          program { name: "enable";
1666             signal: "elm,state,enabled";
1667             source: "elm";
1668             action: STATE_SET "default" 0.0;
1669             target: "disabler";
1670             target: "onrect";
1671             target: "offrect";
1672             after: "enable_text";
1673          }
1674          program { name: "enable_text";
1675             script {
1676                new st[31];
1677                new Float:vl;
1678                get_state(PART:"elm.text", st, 30, vl);
1679                if (!strcmp(st, "disabled_visible"))
1680                  set_state(PART:"elm.text", "visible", 0.0);
1681                else
1682                  set_state(PART:"elm.text", "default", 0.0);
1683                get_state(PART:"bg_image", st, 30, vl);
1684                if (!strcmp(st, "visible_disable"))
1685                  set_state(PART:"bg_image", "visible", 0.0);
1686                else
1687                  set_state(PART:"bg_image", "default", 0.0);
1688                get_state(PART:"elm.swallow.content", st, 30, vl);
1689                if (!strcmp(st, "visible"))
1690                  set_state(PART:"elm.swallow.content", "visible", 0.0);
1691                else
1692                  set_state(PART:"elm.swallow.content", "default", 0.0);
1693                set_state(PART:"button", "default", 0.0);
1694             }
1695          }
1696          program { name: "to_rtl";
1697             signal: "edje,state,rtl";
1698             source: "edje";
1699             script {
1700                set_int(is_rtl, 1);
1701             }
1702          }
1703          program { name: "to_ltr";
1704             signal: "edje,state,ltr";
1705             source: "edje";
1706             script {
1707                set_int(is_rtl, 0);
1708             }
1709          }
1710       }
1711    }
1712 ///////////////////////////////////////////////////////////////////////////////////////
1713
1714 #define CHECK_STYLE_FAVORITE(style_name, min_width, min_height) \
1715    group { name: "elm/check/base/"style_name; \
1716       images { \
1717          image: "00_icon_favorite_on_72x72.png" COMP; \
1718          image: "00_icon_favorite_on_72x72_dim.png" COMP; \
1719          image: "00_icon_favorite_off_72x72.png" COMP; \
1720          image: "00_icon_favorite_off_72x72_dim.png" COMP; \
1721       } \
1722       parts { \
1723          part { name: "back_bg"; \
1724             type: RECT; \
1725             scale: 1; \
1726             description { state: "default" 0.0; \
1727                visible: 0; \
1728                rel2.relative: 0.0 1.0; \
1729                align: 0 0.5; \
1730                min: min_width min_height; \
1731                fixed: 1 0; \
1732             } \
1733          } \
1734          part { name: "bg"; \
1735             type: RECT; \
1736             clip_to: "disclip"; \
1737             scale: 1; \
1738             description { state: "default" 0.0; \
1739                visible: 0; \
1740                rel1.to: "back_bg"; \
1741                rel2.to: "back_bg"; \
1742                min: CHECK_STYLE_FAVORITE_BG_NORMAL_MIN_MAX_INC; \
1743                max: CHECK_STYLE_FAVORITE_BG_NORMAL_MIN_MAX_INC; \
1744                fixed: 1 1; \
1745             } \
1746          } \
1747          part { name: "check"; \
1748             mouse_events: 0; \
1749             clip_to: "disclip"; \
1750             scale: 1; \
1751             description { state: "default" 0.0; \
1752                rel1.to: "bg"; \
1753                rel2.to: "bg"; \
1754                image.normal: "00_icon_favorite_off_72x72.png"; \
1755             } \
1756             description { state: "visible" 0.0; \
1757                inherit: "default" 0.0; \
1758                image.normal: "00_icon_favorite_on_72x72.png"; \
1759             } \
1760             description { state: "disabled" 0.0; \
1761                inherit: "default" 0.0; \
1762                image.normal: "00_icon_favorite_off_72x72_dim.png"; \
1763             } \
1764             description { state: "disabled_visible" 0.0; \
1765                inherit: "default" 0.0; \
1766                image.normal: "00_icon_favorite_on_72x72_dim.png"; \
1767             } \
1768          } \
1769          part { name: "elm.swallow.content"; \
1770             type: SWALLOW; \
1771             clip_to: "disclip"; \
1772             description { state: "default" 0.0; \
1773                fixed: 1 0; \
1774                visible: 0; \
1775                align: 0.0 0.5; \
1776                rel1 { \
1777                   to_x: "bg"; \
1778                   relative: 1.0 0.0; \
1779                   offset: 1 1; \
1780                } \
1781                rel2 { \
1782                   to_x: "bg"; \
1783                   relative: 1.0 1.0; \
1784                   offset: 2 -2; \
1785                } \
1786             } \
1787             description { state: "visible" 0.0; \
1788                inherit: "default" 0.0; \
1789                fixed: 1 1; \
1790                visible: 1; \
1791                aspect: 1.0 1.0; \
1792                aspect_preference: VERTICAL; \
1793             } \
1794             description { state: "disabled" 0.0; \
1795                inherit: "default" 0.0; \
1796             } \
1797             description { state: "disabled_visible" 0.0; \
1798                inherit: "default" 0.0; \
1799                fixed: 1 1; \
1800                visible: 1; \
1801                aspect: 1.0 1.0; \
1802             } \
1803          } \
1804          part { name: "elm.text"; \
1805             type: TEXTBLOCK; \
1806             clip_to: "disclip"; \
1807             mouse_events: 0; \
1808             scale: 1; \
1809             description { state: "default" 0.0; \
1810                visible: 0; \
1811                fixed: 0 1; \
1812                rel1 { \
1813                   relative: 1.0 0.5; \
1814                   offset: 1 1; \
1815                   to_x: "elm.swallow.content"; \
1816                } \
1817                rel2 { \
1818                   relative: 1.0 0.5; \
1819                   offset: -2 -2; \
1820                } \
1821                align: 0.0 0.5; \
1822                text { \
1823                  style: "check_label_textblock_style"; \
1824                  min: 0 0; \
1825                } \
1826                color: CHECK_DEFAULT_TEXT_NORMAL_COLOR_INC; \
1827             } \
1828             description { state: "visible" 0.0; \
1829                inherit: "default" 0.0; \
1830                visible: 1; \
1831                text.min: 1 1; \
1832             } \
1833             description { state: "disabled" 0.0; \
1834                inherit: "default" 0.0; \
1835             } \
1836             description { state: "disabled_visible" 0.0; \
1837                inherit: "default" 0.0; \
1838                visible: 1; \
1839                text.min: 1 1; \
1840                color: CHECK_DEFAULT_TEXT_DISABLED_COLOR_INC; \
1841             } \
1842          } \
1843          part { name: "disclip"; \
1844             type: RECT; \
1845             mouse_events: 0; \
1846             description { state: "default" 0.0; \
1847                color: CHECK_DISCLIP_NORMAL_COLOR_INC; \
1848             } \
1849          } \
1850          part { name: "events"; \
1851             type: RECT; \
1852             ignore_flags: ON_HOLD; \
1853             description { state: "default" 0.0; \
1854                color: 0 0 0 0; \
1855             } \
1856          } \
1857          part { name: "disabler"; \
1858             type: RECT; \
1859             description { state: "default" 0.0; \
1860                color: 0 0 0 0; \
1861                visible: 0; \
1862             } \
1863             description { state: "disabled" 0.0; \
1864                inherit: "default" 0.0; \
1865                visible: 1; \
1866             } \
1867          } \
1868       } \
1869       programs { \
1870          program { name: "click"; \
1871             signal: "mouse,clicked,1"; \
1872             source: "events"; \
1873             action: SIGNAL_EMIT "elm,action,check,toggle" ""; \
1874             after: "touch_sound"; \
1875          } \
1876          program { name: "touch_sound"; \
1877             action: PLAY_SAMPLE "touch_sound" 1.0; \
1878          } \
1879          program { name: "check_on"; \
1880             signal: "elm,state,check,on"; \
1881             source: "elm"; \
1882             action: STATE_SET "visible" 0.0; \
1883             target: "check"; \
1884          } \
1885          program { name: "check_off"; \
1886             signal: "elm,state,check,off"; \
1887             source: "elm"; \
1888             action: STATE_SET "default" 0.0; \
1889             target: "check"; \
1890          } \
1891          program { name: "text_show"; \
1892             signal: "elm,state,text,visible"; \
1893             source: "elm"; \
1894             action: STATE_SET "visible" 0.0; \
1895             target: "elm.text"; \
1896          } \
1897          program { name: "text_hide"; \
1898             signal: "elm,state,text,hidden"; \
1899             source: "elm"; \
1900             action: STATE_SET "default" 0.0; \
1901             target: "elm.text"; \
1902          } \
1903          program { name: "icon_show"; \
1904             signal: "elm,state,icon,visible"; \
1905             source: "elm"; \
1906             action: STATE_SET "visible" 0.0; \
1907             target: "elm.swallow.content"; \
1908          } \
1909          program { name: "icon_hide"; \
1910             signal: "elm,state,icon,hidden"; \
1911             source: "elm"; \
1912             action: STATE_SET "default" 0.0; \
1913             target: "elm.swallow.content"; \
1914          } \
1915          program { name: "disable"; \
1916             signal: "elm,state,disabled"; \
1917             source: "elm"; \
1918             action: STATE_SET "disabled" 0.0; \
1919             target: "disabler"; \
1920             after: "disable_text"; \
1921          } \
1922          program { name: "disable_text"; \
1923             script { \
1924                new st[31]; \
1925                new Float:vl; \
1926                get_state(PART:"elm.text", st, 30, vl); \
1927                if (!strcmp(st, "visible")) \
1928                  set_state(PART:"elm.text", "disabled_visible", 0.0); \
1929                else \
1930                  set_state(PART:"elm.text", "disabled", 0.0); \
1931                get_state(PART:"elm.swallow.content", st, 30, vl); \
1932                if (!strcmp(st, "visible")) \
1933                  set_state(PART:"elm.swallow.content", "disabled_visible", 0.0); \
1934                else \
1935                  set_state(PART:"elm.swallow.content", "disabled", 0.0); \
1936                get_state(PART:"check", st, 30, vl); \
1937                if (!strcmp(st, "visible")) \
1938                  set_state(PART:"check", "disabled_visible", 0.0); \
1939                else \
1940                  set_state(PART:"check", "disabled", 0.0); \
1941             } \
1942          } \
1943          program { name: "enable"; \
1944             signal: "elm,state,enabled"; \
1945             source: "elm"; \
1946             action: STATE_SET "default" 0.0; \
1947             target: "disabler"; \
1948             after: "enable_text"; \
1949          } \
1950          program { name: "enable_text"; \
1951             script { \
1952                new st[31]; \
1953                new Float:vl; \
1954                get_state(PART:"elm.text", st, 30, vl); \
1955                if (!strcmp(st, "disabled_visible")) \
1956                  set_state(PART:"elm.text", "visible", 0.0); \
1957                else \
1958                  set_state(PART:"elm.text", "default", 0.0); \
1959                get_state(PART:"elm.swallow.content", st, 30, vl); \
1960                if (!strcmp(st, "visible")) \
1961                  set_state(PART:"elm.swallow.content", "visible", 0.0); \
1962                else \
1963                  set_state(PART:"elm.swallow.content", "default", 0.0); \
1964                get_state(PART:"check", st, 30, vl); \
1965                if (!strcmp(st, "disabled_visible")) \
1966                  set_state(PART:"check", "visible", 0.0); \
1967                else \
1968                  set_state(PART:"check", "default", 0.0); \
1969             } \
1970          } \
1971       } \
1972    }
1973 ////////////////////////////////////////////////////////////////////////////////
1974 CHECK_STYLE_FAVORITE("favorite", CHECK_STYLE_FAVORITE_DEFAULT_BG_IMAGE_MIN_WIDTH_INC, CHECK_STYLE_FAVORITE_DEFAULT_BG_IMAGE_MIN_HEIGHT_INC)
1975 ////////////////////////////////////////////////////////////////////////////////
1976 CHECK_STYLE_FAVORITE("favorite/extended", CHECK_STYLE_FAVORITE_EXTENDED_BG_IMAGE_MIN_WIDTH_INC, CHECK_STYLE_FAVORITE_EXTENDED_BG_IMAGE_MIN_HEIGHT_INC)
1977 ////////////////////////////////////////////////////////////////////////////////
1978
1979    group { name: "elm/check/base/delete";
1980       images {
1981          image: "00_button_minus.png" COMP;
1982          image: "00_button_minus_press.png" COMP;
1983          image: "00_button_edit_Delete.png" COMP;
1984          image: "00_button_edit_Delete_press.png" COMP;
1985          image: "00_button_edit_dim.png" COMP;
1986          image: "00_button_edit_focus.png" COMP;
1987       }
1988       script {
1989          public button_state = 0; //0:enabled, 1: disabled
1990       }
1991       parts {
1992          part { name: "bg1";
1993             scale: 1;
1994             description { state: "default" 0.0;
1995                align: 1.0 0.5;
1996                rel1.to: "bg2";
1997                rel2.to: "bg2";
1998                image {
1999                   normal: "00_button_edit_Delete.png";
2000                   border: CHECK_STYLE_DELETE_BUTTON_BG_EXPAND_BORDER_INC;
2001                   border_scale: 1;
2002                }
2003             }
2004             description { state: "clicked" 0.0;
2005                inherit: "default" 0.0;
2006                image.normal: "00_button_edit_Delete_press.png";
2007             }
2008             description { state: "intermediate" 0.0;
2009                inherit: "default" 0.0;
2010                visible: 0;
2011             }
2012             description { state: "on" 0.0;
2013                inherit: "default" 0.0;
2014                visible: 0;
2015             }
2016             description { state: "disabled" 0.0;
2017                inherit: "default" 0.0;
2018                image.normal: "00_button_edit_dim.png";
2019             }
2020             description { state: "focused" 0.0;
2021                inherit: "default" 0.0;
2022                image.normal: "00_button_edit_focus.png";
2023             }
2024          }
2025          part { name: "bg2";
2026             scale: 1;
2027             description { state: "default" 0.0;
2028                align: 1.0 0.5;
2029                min: CHECK_STYLE_DELETE_BUTTON_BG_IMAGE_MIN_MAX_WIDTH_INC;
2030                max: CHECK_STYLE_DELETE_BUTTON_BG_IMAGE_MIN_MAX_WIDTH_INC;
2031                rel1.relative: 1.0 0.0;
2032                fixed: 1 0;
2033                image.normal: "00_button_minus.png";
2034             }
2035             description { state: "clicked" 0.0;
2036                inherit: "default" 0.0;
2037                image.normal: "00_button_minus_press.png";
2038             }
2039             description { state: "intermediate" 0.0;
2040                inherit: "default" 0.0;
2041                visible: 0;
2042             }
2043             description { state: "on" 0.0;
2044                inherit: "default" 0.0;
2045                visible: 0;
2046             }
2047             description { state: "disabled" 0.0;
2048                inherit: "default" 0.0;
2049                image.normal: "00_button_minus.png";
2050             }
2051          }
2052          part { name: "clipper";
2053             type: RECT;
2054             mouse_events: 0;
2055             scale: 1;
2056             description { state: "default" 0.0;
2057                align: 1.0 0.5;
2058                min: CHECK_STYLE_DELETE_BUTTON_BG_IMAGE_MIN_MAX_WIDTH_INC;
2059                max: CHECK_STYLE_DELETE_BUTTON_BG_IMAGE_MIN_MAX_WIDTH_INC;
2060                color: 255 255 255 255;
2061             }
2062             description { state: "on" 0.0;
2063                align: 1.0 0.5;
2064                min: CHECK_STYLE_DELETE_BUTTON_BG_EXPAND_IMAGE_MIN_MAX_WIDTH_INC;
2065                max: CHECK_STYLE_DELETE_BUTTON_BG_EXPAND_IMAGE_MIN_MAX_WIDTH_INC;
2066                color: 255 255 255 255;
2067             }
2068          }
2069          part { name: "bg_expand";
2070             mouse_events: 0;
2071             scale: 1;
2072             clip_to: "clipper";
2073             description { state: "default" 0.0;
2074                align: 0.0 0.5;
2075                min: CHECK_STYLE_DELETE_BUTTON_BG_EXPAND_IMAGE_MIN_MAX_WIDTH_INC;
2076                max: CHECK_STYLE_DELETE_BUTTON_BG_EXPAND_IMAGE_MIN_MAX_WIDTH_INC;
2077                image {
2078                   normal: "00_button_edit_Delete.png";
2079                   border: CHECK_STYLE_DELETE_BUTTON_BG_EXPAND_BORDER_INC;
2080                   border_scale: 1;
2081                }
2082                rel1 {
2083                   relative: 1 0; 
2084                   to_x: "bg2"; 
2085                }
2086                rel2.to_x: "bg2";
2087                fixed: 1 0;
2088             }
2089             description { state: "clicked" 0.0;
2090                inherit: "default" 0.0;
2091                align: 1.0 0.5;
2092                image.normal: "00_button_edit_Delete_press.png";
2093             }
2094             description { state: "intermediate" 0.0;
2095                inherit: "default" 0.0;
2096                rel1 {
2097                   relative: 0 0;
2098                   to_x: "bg2";
2099                }
2100                rel2 {
2101                   relative: 0 1;
2102                   to_x: "bg2";
2103                }
2104             }
2105             description { state: "on" 0.0;
2106                inherit: "default" 0.0;
2107                align: 1.0 0.5;
2108             }
2109          }
2110          part { name: "check";
2111             type: TEXT;
2112             mouse_events: 0;
2113             scale: 1;
2114             description { state: "default" 0.0;
2115                visible: 0;
2116                align: 1.0 0.5;
2117                min: 0 0;
2118                text {
2119                   font: "Tizen:style=Medium";
2120                   size: CHECK_STYLE_DELETE_BUTTON_TEXT_FONT_SIZE_INC;
2121                   min: 0 0;
2122                   text: "";
2123                   text_class: "tizen";
2124                }
2125             }
2126             description { state: "visible" 0.0;
2127                align: 1.0 0.5;
2128                min: CHECK_STYLE_DELETE_BUTTON_BG_EXPAND_IMAGE_MIN_MAX_WIDTH_INC;
2129                max: CHECK_STYLE_DELETE_BUTTON_BG_EXPAND_IMAGE_MIN_MAX_WIDTH_INC;
2130                color: CHECK_DELETE_TEXT_DELETE_NORMAL_COLOR_INC;
2131                text {
2132                   font: "Tizen:style=Medium";
2133                   size: CHECK_STYLE_DELETE_BUTTON_TEXT_FONT_SIZE_INC;
2134                   min: 1 0;
2135                   text: "Delete";
2136                   text_class: "tizen";
2137                }
2138             }
2139             description { state: "visible_pressed" 0.0;
2140                inherit: "visible" 0.0;
2141                color: CHECK_DELETE_TEXT_DELETE_PRESS_COLOR_INC;
2142             }
2143          }
2144          part { name: "elm.swallow.content";
2145             type: SWALLOW;
2146             description { state: "default" 0.0;
2147                fixed: 1 0;
2148                visible: 0;
2149                color: 255 255 255 255;
2150                align: 0.0 0.5;
2151                rel1 {
2152                   to_x: "bg2";
2153                   relative: 1.0 0.0;
2154                   offset: 1 1;
2155                }
2156                rel2 {
2157                   to_x: "bg2";
2158                   relative: 1.0 1.0;
2159                   offset: 2 -2;
2160                }
2161             }
2162             description { state: "visible" 0.0;
2163                inherit: "default" 0.0;
2164                fixed: 1 1;
2165                visible: 1;
2166                aspect: 1.0 1.0;
2167                aspect_preference: VERTICAL;
2168             }
2169             description { state: "disabled" 0.0;
2170                inherit: "default" 0.0;
2171                color: 128 128 128 128;
2172             }
2173             description { state: "disabled_visible" 0.0;
2174                inherit: "default" 0.0;
2175                color: 128 128 128 128;
2176                fixed: 1 1;
2177                visible: 1;
2178                aspect: 1.0 1.0;
2179             }
2180          }
2181          part { name: "elm.text";
2182             type: TEXTBLOCK;
2183             mouse_events: 0;
2184             scale: 1;
2185             description { state: "default" 0.0;
2186                visible: 0;
2187                fixed: 1 1;
2188                rel1 {
2189                   relative: 1.0 0.5;
2190                   offset: 1 1;
2191                   to_x: "elm.swallow.content";
2192                }
2193                rel2 {
2194                   relative: 1.0 0.5;
2195                   offset: -2 -2;
2196                }
2197                color: 255 255 255 255;
2198                align: 0.0 0.5;
2199                text {
2200                   style: "check_label_textblock_style";
2201                   min: 0 0;
2202                }
2203                color: CHECK_DEFAULT_TEXT_NORMAL_COLOR_INC;
2204             }
2205             description { state: "visible" 0.0;
2206                inherit: "default" 0.0;
2207                visible: 1;
2208                text.min: 1 1;
2209             }
2210             description { state: "disabled" 0.0;
2211                inherit: "default" 0.0;
2212             }
2213             description { state: "disabled_visible" 0.0;
2214                inherit: "default" 0.0;
2215                visible: 1;
2216                text.min: 1 1;
2217                color: CHECK_DEFAULT_TEXT_DISABLED_COLOR_INC;
2218             }
2219          }
2220          part { name: "events1";
2221             type: RECT;
2222             ignore_flags: ON_HOLD;
2223             description { state: "default" 0.0;
2224                color: 0 0 0 0;
2225                rel1.to: "bg2";
2226                rel2.to_x: "elm.text";
2227                align: 0.0 0.5;
2228             }
2229             description { state: "visible" 0.0;
2230                color: 0 0 0 0;
2231                rel1.to: "bg_expand";
2232                rel2.to_x: "elm.text";
2233                align: 0.0 0.5;
2234             }
2235          }
2236          part { name: "events2";
2237             type: RECT;
2238             repeat_events: 1;
2239             description { state: "default" 0.0;
2240                color: 0 0 0 0;
2241                rel1.to: "bg2";
2242                rel2.to_x: "elm.text";
2243                align: 0.0 0.5;
2244             }
2245             description { state: "visible" 0.0;
2246                color: 0 0 0 0;
2247                rel1.to: "bg_expand";
2248                rel2.to_x: "elm.text";
2249                align: 0.0 0.5;
2250             }
2251          }
2252          part { name: "disabler";
2253             type: RECT;
2254             description { state: "default" 0.0;
2255                rel2.to_x: "elm.text";
2256                color: 0 0 0 0;
2257                visible: 0;
2258             }
2259             description { state: "disabled" 0.0;
2260                inherit: "default" 0.0;
2261                visible: 1;
2262             }
2263          }
2264       }
2265       programs {
2266          program { name: "click";
2267             signal: "mouse,clicked,1";
2268             source: "events1";
2269             script {
2270                new st[31];
2271                new Float:vl;
2272                get_state(PART:"check", st, 30, vl);
2273                if (!strcmp(st, "visible_pressed"))
2274                  set_state(PART:"check", "visible", 0.0);
2275             }
2276             after: "toggle";
2277          }
2278          program { name: "toggle";
2279             action: SIGNAL_EMIT "elm,action,check,toggle" "";
2280             after: "touch_sound";
2281          }
2282          program { name: "touch_sound";
2283             action: PLAY_SAMPLE "touch_sound" 1.0;
2284          }
2285          program { name: "unfocused";
2286             signal: "elm,action,unfocus";
2287             source: "elm";
2288             script {
2289                new st[31];
2290                new Float:vl;
2291                get_state(PART:"bg2", st, 30, vl);
2292                if (!strcmp(st, "on"))
2293                  emit("elm,action,check,toggle", "");
2294             }
2295          }
2296          program { name: "click_down";
2297             signal: "mouse,down,1";
2298             source: "events2";
2299             script {
2300                new st[31];
2301                new Float:vl;
2302                get_state(PART:"check", st, 30, vl);
2303                if (!strcmp(st, "visible"))
2304                  {
2305                     set_state(PART:"bg_expand", "clicked", 0.0);
2306                     set_state(PART:"check", "visible_pressed", 0.0);
2307                  }
2308                else 
2309                  {
2310                     set_state(PART:"bg2", "clicked", 0.0);
2311                     set_state(PART:"bg1", "clicked", 0.0);
2312                  }
2313             }
2314          }
2315          program { name: "check_normal";
2316             signal: "mouse,up,1";
2317             source: "events2";
2318             script {
2319                new st[31];
2320                new Float:vl;
2321                get_state(PART:"check", st, 30, vl);
2322                if (!strcmp(st, "visible_pressed"))
2323                  {
2324                     set_state(PART:"bg_expand", "on", 0.0);
2325                     set_state(PART:"check", "visible", 0.0);
2326                  }
2327                get_state(PART:"bg_expand", st, 30, vl);
2328                if (!strcmp(st, "default"))
2329                  {
2330                     set_state(PART:"bg2", "default", 0.0);
2331                     set_state(PART:"bg1", "default", 0.0);
2332                  }
2333             }
2334          }
2335          program { name: "check_on";
2336             signal: "elm,state,check,on";
2337             source: "elm";
2338             action: STATE_SET "on" 0.0;
2339             target: "clipper";
2340             after: "start_expand";
2341          }
2342          program { name: "start_expand";
2343             action: STATE_SET "intermediate" 0.0;
2344             target: "bg2";
2345             target: "bg1";
2346             target: "bg_expand";
2347             after: "expand";
2348          }
2349          program { name: "expand";
2350             action: STATE_SET "on" 0.0;
2351             target: "bg_expand";
2352             target: "bg2";
2353             target: "bg1";
2354             transition: ACCELERATE 0.1;
2355             after: "check_visible";
2356          }
2357          program { name: "check_visible";
2358             action: STATE_SET "visible" 0.0;
2359             target: "check";
2360             target: "events1";
2361             target: "events2";
2362          }
2363          program { name: "check_off";
2364             signal: "elm,state,check,off";
2365             source: "elm";
2366             action: STATE_SET "default" 0.0;
2367             target: "check";
2368             after: "contract";
2369          }
2370          program { name: "contract";
2371             action: STATE_SET "intermediate" 0.0;
2372             target: "bg_expand";
2373             transition: ACCELERATE 0.1;
2374             after: "normal_bg";
2375          }
2376          program { name: "normal_bg";
2377             script {
2378                if (get_int(button_state) !=1)
2379                  {
2380                     set_state(PART:"bg2", "default", 0.0);
2381                     set_state(PART:"bg1", "default", 0.0);
2382                  }
2383                else
2384                  {
2385                     set_state(PART:"bg2", "disabled", 0.0);
2386                     set_state(PART:"bg1", "disabled", 0.0);
2387                  }
2388             }
2389             after: "bg_default";
2390          }
2391          program { name: "bg_default";
2392             action: STATE_SET "default" 0.0;
2393             target: "bg_expand";
2394             target: "clipper";
2395             target: "events1";
2396             target: "events2";
2397          }
2398          program { name: "text_show";
2399             signal: "elm,state,text,visible";
2400             source: "elm";
2401             action: STATE_SET "visible" 0.0;
2402             target: "elm.text";
2403          }
2404          program { name: "text_hide";
2405             signal: "elm,state,text,hidden";
2406             source: "elm";
2407             action: STATE_SET "default" 0.0;
2408             target: "elm.text";
2409          }
2410          program { name: "icon_show";
2411             signal: "elm,state,icon,visible";
2412             source: "elm";
2413             action: STATE_SET "visible" 0.0;
2414             target: "elm.swallow.content";
2415          }
2416          program { name: "icon_hide";
2417             signal: "elm,state,icon,hidden";
2418             source: "elm";
2419             action: STATE_SET "default" 0.0;
2420             target: "elm.swallow.content";
2421          }
2422          program { name: "disable";
2423             signal: "elm,state,disabled";
2424             source: "elm";
2425             action: STATE_SET "disabled" 0.0;
2426             target: "disabler";
2427             target: "bg2";
2428             target: "bg1";
2429             after: "disable_text";
2430          }
2431          program { name: "disable_text";
2432             script {
2433                new st[31];
2434                new Float:vl;
2435                get_state(PART:"elm.text", st, 30, vl);
2436                if (!strcmp(st, "visible"))
2437                  set_state(PART:"elm.text", "disabled_visible", 0.0);
2438                else
2439                  set_state(PART:"elm.text", "disabled", 0.0);
2440                get_state(PART:"elm.swallow.content", st, 30, vl);
2441                if (!strcmp(st, "visible"))
2442                  set_state(PART:"elm.swallow.content", "disabled_visible", 0.0);
2443                else
2444                  set_state(PART:"elm.swallow.content", "disabled", 0.0);
2445                set_int(button_state, 1);
2446             }
2447          }
2448          program { name: "enable";
2449             signal: "elm,state,enabled";
2450             source: "elm";
2451             action: STATE_SET "default" 0.0;
2452             target: "disabler";
2453             target: "bg2";
2454             target: "bg1";
2455             after: "enable_text";
2456          }
2457          program { name: "enable_text";
2458             script {
2459                new st[31];
2460                new Float:vl;
2461                get_state(PART:"elm.text", st, 30, vl);
2462                if (!strcmp(st, "disabled_visible"))
2463                  set_state(PART:"elm.text", "visible", 0.0);
2464                else
2465                  set_state(PART:"elm.text", "default", 0.0);
2466                get_state(PART:"elm.swallow.content", st, 30, vl);
2467                if (!strcmp(st, "visible"))
2468                  set_state(PART:"elm.swallow.content", "visible", 0.0);
2469                else
2470                  set_state(PART:"elm.swallow.content", "default", 0.0);
2471                set_int(button_state, 0);
2472             }
2473          }
2474       }
2475    }
2476
2477 ////////////////////////////////////////////////////////////////////////////////
2478
2479    group { name: "elm/check/base/grid";
2480       images.image: "00_grid_select_check.png" COMP;
2481       images.image: "00_grid_select_check_bg.png" COMP;
2482       images.image: "00_grid_select_check_bg_press.png" COMP;
2483       script {
2484          public check_state = CHECK_STATE_DEFAULT;
2485          public check_visible = CHECK_HIDE;
2486       }
2487       parts {
2488          part { name: "bg";
2489             type: RECT;
2490             scale: 1;
2491             description { state: "default" 0.0;
2492                visible: 0;
2493             }
2494          }
2495          part { name: "top_right_padding";
2496             type: RECT;
2497             mouse_events: 0;
2498             scale: 1;
2499             description { state: "default" 0.0;
2500                visible: 0;
2501                min: GENGRID_ITEM_CHECK_TOP_RIGHT_PADDING_INC;
2502                align: 1.0 0.0;
2503                fixed: 1 1;
2504                rel1 {
2505                   relative: 1.0 0.0;
2506                   to: "bg";
2507                }
2508                rel2 {
2509                   relative: 1.0 0.0;
2510                   to: "bg";
2511                }
2512             }
2513          }
2514          part { name: "selected_bg";
2515             scale: 1;
2516             type: RECT;
2517             description { state: "default" 0.0;
2518                visible: 0;
2519                rel1.to: "bg";
2520                rel2.to: "bg";
2521             }
2522             description { state: "visible" 0.0;
2523                inherit: "default" 0.0;
2524                visible: 1;
2525                color: GENGRID_EDIT_MODE_CHECK_BG_COLOR_INC;
2526             }
2527          }
2528          part { name: "bg2";
2529             mouse_events: 0;
2530             scale: 1;
2531             description { state: "default" 0.0;
2532                min: GENGRID_EDIT_MODE_CHECK_SIZE_INC;
2533                align: 1.0 0.0;
2534                fixed: 1 1;
2535                rel1 {
2536                   relative: 0.0 1.0;
2537                   to: "top_right_padding";
2538                }
2539                rel2 {
2540                   relative: 0.0 1.0;
2541                   to: "top_right_padding";
2542                }
2543                image.normal: "00_grid_select_check_bg.png";
2544             }
2545             description { state: "visible" 0.0;
2546                inherit: "default" 0.0;
2547                image.normal: "00_grid_select_check_bg_press.png";
2548             }
2549             description { state: "disabled" 0.0;
2550                inherit: "default" 0.0;
2551             }
2552          }
2553          part { name: "check";
2554             mouse_events: 0;
2555             clip_to: "sequence_clip";
2556             scale: 1;
2557             description { state: "default" 0.0;
2558                visible: 0;
2559                rel1.to: "bg2";
2560                rel2.to: "bg2";
2561                image.normal: "00_grid_select_check.png";
2562                color: 255 255 255 0;
2563             }
2564             description { state: "visible" 0.0;
2565                inherit: "default" 0.0;
2566                visible: 1;
2567                color: 255 255 255 255;
2568             }
2569             description { state: "pressed" 0.0;
2570                inherit: "visible" 0.0;
2571             }
2572             description { state: "disabled_visible" 0.0;
2573                inherit: "default" 0.0;
2574                visible: 1;
2575             }
2576          }
2577          part { name: "sequence_clip";
2578             type: RECT;
2579             mouse_events: 0;
2580             description { state: "default" 0.0;
2581                rel1.to: "bg2";
2582                rel2.to: "bg2";
2583                rel2.relative: 0.0 1.0;
2584                color: 255 255 255 255;
2585             }
2586             description { state: "visible" 0.0;
2587                inherit: "default" 0.0;
2588                rel2.relative: 1.0 1.0;
2589             }
2590          }
2591          part { name: "elm.swallow.content";
2592             type: SWALLOW;
2593             description {
2594                state: "default" 0.0;
2595                fixed: 1 0;
2596                visible: 0;
2597                color: 255 255 255 255;
2598                align: 0.0 0.5;
2599                rel1 {
2600                   to_x: "bg2";
2601                   relative: 1.0 0.0;
2602                   offset: 1 1;
2603                }
2604                rel2 {
2605                   to_x: "bg2";
2606                   relative: 1.0 1.0;
2607                   offset: 2 -2;
2608                }
2609             }
2610             description { state: "visible" 0.0;
2611                inherit: "default" 0.0;
2612                fixed: 1 1;
2613                visible: 1;
2614                aspect: 1.0 1.0;
2615                aspect_preference: VERTICAL;
2616             }
2617             description { state: "disabled" 0.0;
2618                inherit: "default" 0.0;
2619                color: 128 128 128 128;
2620             }
2621             description { state: "disabled_visible" 0.0;
2622                inherit: "default" 0.0;
2623                color: 128 128 128 128;
2624                fixed: 1 1;
2625                visible: 1;
2626                aspect: 1.0 1.0;
2627             }
2628          }
2629          part { name: "elm.text";
2630             type: TEXTBLOCK;
2631             mouse_events: 0;
2632             scale: 1;
2633             description { state: "default" 0.0;
2634                visible: 0;
2635                fixed: 0 1;
2636                rel1 {
2637                   relative: 1.0 0.5;
2638                   offset: 1 1;
2639                   to_x: "elm.swallow.content";
2640                }
2641                rel2 {
2642                   relative: 1.0 0.5;
2643                   offset: -2 -2;
2644                }
2645                color: 255 255 255 255;
2646                align: 0.0 0.5;
2647                text {
2648                   style: "check_label_textblock_style";
2649                   min: 0 0;
2650                }
2651                color: CHECK_DEFAULT_TEXT_NORMAL_COLOR_INC;
2652             }
2653             description { state: "visible" 0.0;
2654                inherit: "default" 0.0;
2655                visible: 1;
2656                text.min: 1 1;
2657             }
2658             description { state: "disabled" 0.0;
2659                inherit: "default" 0.0;
2660             }
2661             description { state: "disabled_visible" 0.0;
2662                inherit: "default" 0.0;
2663                visible: 1;
2664                text.min: 1 1;
2665                color: CHECK_DEFAULT_TEXT_DISABLED_COLOR_INC;
2666             }
2667          }
2668          part { name: "events";
2669             type: RECT;
2670             ignore_flags: ON_HOLD;
2671             description { state: "default" 0.0;
2672                color: 0 0 0 0;
2673             }
2674          }
2675          part { name: "disabler";
2676             type: RECT;
2677             description { state: "default" 0.0;
2678                color: 0 0 0 0;
2679                visible: 0;
2680             }
2681             description { state: "disabled" 0.0;
2682                inherit: "default" 0.0;
2683                visible: 1;
2684             }
2685          }
2686       }
2687       programs {
2688          program { name: "show";
2689             signal: "show";
2690             script {
2691                set_int(check_visible, CHECK_SHOW);
2692             }
2693          }
2694          program { name: "hide";
2695             signal: "hide";
2696             script {
2697                set_int(check_visible, CHECK_HIDE);
2698             }
2699          }
2700          program { name: "click";
2701             signal: "mouse,clicked,1";
2702             source: "events";
2703             action: SIGNAL_EMIT "elm,action,check,toggle" "";
2704             after: "touch_sound";
2705          }
2706          program { name: "touch_sound";
2707             action: PLAY_SAMPLE "touch_sound" 1.0;
2708             after: "bg_normal";
2709          }
2710          program { name: "bg_normal";
2711             script {
2712                set_state(PART:"bg2", "default", 0.0);
2713             }
2714          }
2715          program { name: "pressed";
2716             signal: "mouse,down,1";
2717             source: "events";
2718             script {
2719                new st[31];
2720                new Float:vl;
2721                get_state(PART:"check", st, 30, vl);
2722                if (!strcmp(st, "visible"))
2723                  {
2724                     set_state(PART:"check", "pressed", 0.0);
2725                     set_state(PART:"bg2", "visible", 0.0);
2726                  }
2727             }
2728          }
2729          program { name: "mouse,out";
2730             signal: "mouse,out";
2731             source: "events";
2732             script {
2733                if (get_int(check_state) == CHECK_STATE_VISIBLE)
2734                  {
2735                     set_state(PART:"check", "visible", 0.0);
2736                     set_state(PART:"sequence_clip", "visible", 0.0);
2737                     set_state(PART:"bg2", "visible", 0.0);
2738                  }
2739                else
2740                  {
2741                     set_state(PART:"check", "default", 0.0);
2742                     set_state(PART:"sequence_clip", "default", 0.0);
2743                     set_state(PART:"bg2", "default", 0.0);
2744                  }
2745             }
2746          }
2747          program { name: "check_on";
2748             signal: "elm,state,check,on";
2749             source: "elm";
2750             script {
2751                set_int(check_state, CHECK_STATE_VISIBLE);
2752                if (get_int(check_visible) == CHECK_SHOW)
2753                  {
2754                     run_program(PROGRAM:"check_show_effect");
2755                     run_program(PROGRAM:"check_draw_effect");
2756                  }
2757                else
2758                  {
2759                     set_state(PART:"check", "visible", 0.0);
2760                     set_state(PART:"sequence_clip", "visible", 0.0);
2761                  }
2762                set_state(PART:"bg2", "visible", 0.0);
2763                set_state(PART:"selected_bg", "visible", 0.0);
2764             }
2765          }
2766          program { name: "check_off";
2767             signal: "elm,state,check,off";
2768             source: "elm";
2769             action: STATE_SET "default" 0.0;
2770             target: "check";
2771             script {
2772                if (get_int(check_state) == CHECK_STATE_VISIBLE)
2773                  {
2774                     set_int(check_state, CHECK_STATE_DEFAULT);
2775                     set_state(PART:"check", "default", 0.0);
2776                     set_state(PART:"sequence_clip", "default", 0.0);
2777                  }
2778                set_state(PART:"bg2", "default", 0.0);
2779                set_state(PART:"selected_bg", "default", 0.0);
2780             }
2781          }
2782          program { name: "check_show_effect";
2783             action: STATE_SET "visible" 0.0;
2784             transition: LINEAR 0.233;
2785             target: "check";
2786          }
2787          program { name: "check_draw_effect";
2788             action: STATE_SET "visible" 0.0;
2789             transition: LINEAR 0.267;
2790             target: "sequence_clip";
2791          }
2792          program { name: "text_show";
2793             signal: "elm,state,text,visible";
2794             source: "elm";
2795             action: STATE_SET "visible" 0.0;
2796             target: "elm.text";
2797          }
2798          program { name: "text_hide";
2799             signal: "elm,state,text,hidden";
2800             source: "elm";
2801             action: STATE_SET "default" 0.0;
2802             target: "elm.text";
2803          }
2804          program { name: "icon_show";
2805             signal: "elm,state,icon,visible";
2806             source: "elm";
2807             action: STATE_SET "visible" 0.0;
2808             target: "elm.swallow.content";
2809          }
2810          program { name: "icon_hide";
2811             signal: "elm,state,icon,hidden";
2812             source: "elm";
2813             action: STATE_SET "default" 0.0;
2814             target: "elm.swallow.content";
2815          }
2816          program { name: "disable";
2817             signal: "elm,state,disabled";
2818             source: "elm";
2819             action: STATE_SET "disabled" 0.0;
2820             target: "disabler";
2821             target: "bg2";
2822             after: "disable_text";
2823          }
2824          program { name: "disable_text";
2825             script {
2826                new st[31];
2827                new Float:vl;
2828                get_state(PART:"elm.text", st, 30, vl);
2829                if (!strcmp(st, "visible"))
2830                  set_state(PART:"elm.text", "disabled_visible", 0.0);
2831                else
2832                  set_state(PART:"elm.text", "disabled", 0.0);
2833                get_state(PART:"elm.swallow.content", st, 30, vl);
2834                if (!strcmp(st, "visible"))
2835                  set_state(PART:"elm.swallow.content", "disabled_visible", 0.0);
2836                else
2837                  set_state(PART:"elm.swallow.content", "disabled", 0.0);
2838                get_state(PART:"check", st, 30, vl);
2839                if (!strcmp(st, "visible"))
2840                  {
2841                     set_state(PART:"check", "disabled_visible", 0.0);
2842                     set_int(check_state, CHECK_STATE_DISABLED_VISIBLE);
2843                  }
2844             }
2845          }
2846          program { name: "enable";
2847             signal: "elm,state,enabled";
2848             source: "elm";
2849             action: STATE_SET "default" 0.0;
2850             target: "disabler";
2851             target: "bg2";
2852             after: "enable_text";
2853          }
2854          program { name: "enable_text";
2855             script {
2856                new st[31];
2857                new Float:vl;
2858                get_state(PART:"elm.text", st, 30, vl);
2859                if (!strcmp(st, "disabled_visible"))
2860                  set_state(PART:"elm.text", "visible", 0.0);
2861                else
2862                  set_state(PART:"elm.text", "default", 0.0);
2863                get_state(PART:"elm.swallow.content", st, 30, vl);
2864                if (!strcmp(st, "visible"))
2865                  set_state(PART:"elm.swallow.content", "visible", 0.0);
2866                else
2867                  set_state(PART:"elm.swallow.content", "default", 0.0);
2868                get_state(PART:"check", st, 30, vl);
2869                if (!strcmp(st, "disabled_visible"))
2870                  {
2871                     set_state(PART:"check", "visible", 0.0);
2872                     set_state(PART:"sequence_clip", "visible", 0.0);
2873                     set_int(check_state, CHECK_STATE_VISIBLE);
2874                  }
2875                else
2876                  set_int(check_state, CHECK_STATE_DEFAULT);
2877             }
2878          }
2879       }
2880    }
2881
2882 #undef CHECK_STATE_DEFAULT
2883 #undef CHECK_STATE_VISIBLE
2884 #undef CHECK_STATE_DISABLED_VISIBLE
2885 #undef CHECK_STATE_DISABLED
2886
2887 #undef CHECK_HIDE
2888 #undef CHECK_SHOW