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