Tizen 2.0 Release
[profile/ivi/org.tizen.video-player.git] / res / edc / vp-check.edc
1 #define CHECK_STYLE_DEFAULT_BG_NORMAL_MIN_MAX_INC 42 42
2
3 #define CHECK_DEFAULT_TEXT_NORMAL_COLOR_INC        255 255 255 255
4 #define CHECK_DEFAULT_TEXT_PRESSED_COLOR_INC      255 255 255 255
5 #define CHECK_DEFAULT_TEXT_DISABLED_COLOR_INC          136 136 136 136
6
7 //////////////////////////////////////////////////////////
8 //
9 #define GALLERY_EDC_IMAGE_CHECK_BG "T01_checkbox.png"
10 #define GALLERY_EDC_IMAGE_CHECK_BG_DIM "00_check_bg_dim.png"
11 #define GALLERY_EDC_IMAGE_CHECK_BG_CHECKING "T01_check.png"
12 #define GALLERY_EDC_IMAGE_CHECK_ALBUM_BG "T01_checkbox.png"
13 #define GALLERY_EDC_IMAGE_CHECK_GRID "T01_grid_select_check.png"
14 #define GALLERY_EDC_IMAGE_CHECK_PINCH_GRID "00_grid_select_check.png"
15
16 // Grid item background size W: 14+158+6; H: 24+158
17 #define W               178
18 #define H               182
19
20 // Gap between bg and icon
21 #define GAP_BG_L         14
22 #define GAP_BG_R         6
23 #define GAP_BG_T         24
24
25 // Gap between icon and shadow
26 #define GAP_ICON_L         3
27 #define GAP_ICON_R         3
28 #define GAP_ICON_T         0
29 #define GAP_ICON_B         4
30
31 // Shadow image size
32 #define SHADOW_W               (W-GAP_BG_L-GAP_BG_R+GAP_ICON_L+GAP_ICON_R)
33 #define SHADOW_H               (H-GAP_BG_T+GAP_ICON_B)
34
35 // Gap between bg and shadow
36 #define GAP_SHADOW_L         (GAP_BG_L-GAP_ICON_L)
37 #define GAP_SHADOW_R         (GAP_BG_R-GAP_ICON_R)
38 #define GAP_SHADOW_T         (GAP_BG_T-GAP_ICON_T)
39 #define GAP_SHADOW_B         (0+GAP_ICON_B)
40
41
42
43 #define ZOOMED_W               116 //6+104+6
44 #define ZOOMED_H               110 //6+104
45
46 #define ZOOMED_GAP_L         6
47 #define ZOOMED_GAP_R         6
48 #define ZOOMED_GAP_T         6
49 #define ZOOMED_GAP_B         0
50 //
51 //////////////////////////////////////////////////////////
52
53 ////////////////////////////////////////////////////////////////////////////////////////
54 //
55 // check default textblock style
56 //
57 ///////////////////////////////////////////////////////////////////////////////////////
58         styles {
59                 style { name: "check_label_textblock_style";
60                         base: "font=SLP:style=Roman font_size=32 color=#ffffff wrap=char";
61                         tag: "br" "\n";
62                         tag: "ps" "ps";
63                         tag: "hilight" "+ font=SLP:style=Bold";
64                         tag: "b" "+ font=SLP:style=Bold";
65                         tag: "whitecolor" "+ color=#ffffff";
66                         tag: "tab" "\t";
67                 }
68         }
69
70 #define CHECK_STATE_DEFAULT 0
71 #define CHECK_STATE_VISIBLE 1
72 #define CHECK_STATE_DISABLED_VISIBLE 2
73 #define CHECK_STATE_DISABLED 3
74
75 ////////////////////////////////////////////////////////////////////////////////
76 #define CHECK_STYLE_DEFAULT(style_name, image_bg, image_checking, min_width, min_height) \
77  group { name: "elm/check/base/"style_name; \
78       images { \
79          image: image_bg COMP; \
80          image: GALLERY_EDC_IMAGE_CHECK_BG_DIM COMP; \
81          image: image_checking COMP; \
82       } \
83       script { \
84          public check_state = CHECK_STATE_DEFAULT; \
85       } \
86       parts { \
87          part { name: "back_bg"; \
88             type: RECT; \
89             scale: 1; \
90             description { state: "default" 0.0; \
91                rel2.relative: 0.0 1.0; \
92                align: 0 0.5; \
93                min: min_width min_height; \
94                fixed: 1 0; \
95                color: 0 0 0 0; \
96             } \
97          } \
98          part { name: "bg"; \
99             mouse_events: 0; \
100             scale: 1; \
101             description { state: "default" 0.0; \
102                min: CHECK_STYLE_DEFAULT_BG_NORMAL_MIN_MAX_INC; \
103                max: CHECK_STYLE_DEFAULT_BG_NORMAL_MIN_MAX_INC; \
104                fixed: 1 1; \
105                rel1.to: "back_bg"; \
106                rel2.to: "back_bg"; \
107                image.normal: image_bg; \
108                fill.smooth : 0; \
109             } \
110             description { state: "disabled" 0.0; \
111                inherit: "default" 0.0; \
112                image.normal: GALLERY_EDC_IMAGE_CHECK_BG_DIM; \
113                fill.smooth : 0; \
114             } \
115          } \
116          part { name: "check"; \
117             mouse_events: 0; \
118             scale: 1; \
119             description { state: "default" 0.0; \
120                rel1.to: "bg"; \
121                rel2.to: "bg"; \
122                visible: 0; \
123                image.normal: image_checking; \
124             } \
125             description { state: "visible" 0.0; \
126                inherit: "default" 0.0; \
127                visible: 1; \
128             } \
129             description { state: "disabled_visible" 0.0; \
130                inherit: "default" 0.0; \
131                visible: 1; \
132             } \
133          } \
134          part { name: "elm.swallow.content"; \
135             type: SWALLOW; \
136             description { state: "default" 0.0; \
137                fixed: 1 0; \
138                visible: 0; \
139                color: 255 255 255 255; \
140                align: 0.0 0.5; \
141                rel1 { \
142                   to_x: "bg"; \
143                   relative: 1.0 0.0; \
144                   offset: 1 1; \
145                } \
146                rel2 { \
147                   to_x: "bg"; \
148                   relative: 1.0 1.0; \
149                   offset: 2 -2; \
150                } \
151             } \
152             description { state: "visible" 0.0; \
153                inherit: "default" 0.0; \
154                fixed: 1 1; \
155                visible: 1; \
156                aspect: 1.0 1.0; \
157                aspect_preference: VERTICAL; \
158             } \
159             description { state: "disabled" 0.0; \
160                inherit: "default" 0.0; \
161                color: 128 128 128 128; \
162             } \
163             description { state: "disabled_visible" 0.0; \
164                inherit: "default" 0.0; \
165                color: 128 128 128 128; \
166                fixed: 1 1; \
167                visible: 1; \
168                aspect: 1.0 1.0; \
169             } \
170          } \
171          part { name: "elm.text"; \
172             type: TEXTBLOCK; \
173             mouse_events: 0; \
174             scale: 1; \
175             description { state: "default" 0.0; \
176                visible: 0; \
177                fixed: 0 1; \
178                rel1 { \
179                   relative: 1.0 0.5; \
180                   offset: 1 1; \
181                   to_x: "elm.swallow.content"; \
182                } \
183                rel2 { \
184                   relative: 1.0 0.5; \
185                   offset: -2 -2; \
186                } \
187                align: 0.0 0.5; \
188                text { \
189                   style: "check_label_textblock_style"; \
190                   min: 0 0; \
191                } \
192                color: CHECK_DEFAULT_TEXT_NORMAL_COLOR_INC; \
193             } \
194             description { state: "visible" 0.0; \
195                inherit: "default" 0.0; \
196                visible: 1; \
197                text.min: 1 1; \
198             } \
199             description { state: "disabled" 0.0; \
200                inherit: "default" 0.0; \
201             } \
202             description { state: "disabled_visible" 0.0; \
203                inherit: "default" 0.0; \
204                visible: 1; \
205                text.min: 1 1; \
206                color: CHECK_DEFAULT_TEXT_DISABLED_COLOR_INC; \
207             } \
208          } \
209          part { name: "events1"; \
210             type: RECT; \
211             ignore_flags: ON_HOLD; \
212             description { state: "default" 0.0; \
213                color: 0 0 0 0; \
214             } \
215          } \
216          part { name: "events2"; \
217             type: RECT; \
218             repeat_events: 1; \
219             description { state: "default" 0.0; \
220                color: 0 0 0 0; \
221             } \
222          } \
223          part { name: "disabler"; \
224             type: RECT; \
225             description { state: "default" 0.0; \
226                color: 0 0 0 0; \
227                visible: 0; \
228             } \
229             description { state: "disabled" 0.0; \
230                inherit: "default" 0.0; \
231                visible: 1; \
232             } \
233          } \
234       } \
235       programs { \
236          program { name: "click"; \
237             signal: "mouse,clicked,1"; \
238             source: "events1"; \
239             action: SIGNAL_EMIT "elm,action,check,toggle" ""; \
240          } \
241          program { name: "check_on"; \
242             signal: "elm,state,check,on"; \
243             source: "elm"; \
244             script { \
245                set_int(check_state, CHECK_STATE_VISIBLE); \
246                set_state(PART:"check", "visible", 0.0); \
247             } \
248          } \
249          program { name: "check_off"; \
250             signal: "elm,state,check,off"; \
251             source: "elm"; \
252             action: STATE_SET "default" 0.0; \
253             target: "check"; \
254             script { \
255                if (get_int(check_state) == CHECK_STATE_VISIBLE) \
256                  { \
257                     set_int(check_state, CHECK_STATE_DEFAULT); \
258                     set_state(PART:"check", "default", 0.0); \
259                  } \
260             } \
261          } \
262          program { name: "text_show"; \
263             signal: "elm,state,text,visible"; \
264             source: "elm"; \
265             action: STATE_SET "visible" 0.0; \
266             target: "elm.text"; \
267          } \
268          program { name: "text_hide"; \
269             signal: "elm,state,text,hidden"; \
270             source: "elm"; \
271             action: STATE_SET "default" 0.0; \
272             target: "elm.text"; \
273          } \
274          program { name: "icon_show"; \
275             signal: "elm,state,icon,visible"; \
276             source: "elm"; \
277             action: STATE_SET "visible" 0.0; \
278             target: "elm.swallow.content"; \
279          } \
280          program { name: "icon_hide"; \
281             signal: "elm,state,icon,hidden"; \
282             source: "elm"; \
283             action: STATE_SET "default" 0.0; \
284             target: "elm.swallow.content"; \
285          } \
286          program { name: "disable"; \
287             signal: "elm,state,disabled"; \
288             source: "elm"; \
289             action: STATE_SET "disabled" 0.0; \
290             target: "disabler"; \
291             target: "bg"; \
292             after: "disable_text"; \
293          } \
294          program { name: "disable_text"; \
295             script { \
296                new st[31]; \
297                new Float:vl; \
298                get_state(PART:"elm.text", st, 30, vl); \
299                if (!strcmp(st, "visible")) \
300                  set_state(PART:"elm.text", "disabled_visible", 0.0); \
301                else \
302                  set_state(PART:"elm.text", "disabled", 0.0); \
303                get_state(PART:"elm.swallow.content", st, 30, vl); \
304                if (!strcmp(st, "visible")) \
305                  set_state(PART:"elm.swallow.content", "disabled_visible", 0.0); \
306                else \
307                  set_state(PART:"elm.swallow.content", "disabled", 0.0); \
308                get_state(PART:"check", st, 30, vl); \
309                if (!strcmp(st, "visible")) \
310                  { \
311                     set_state(PART:"check", "disabled_visible", 0.0); \
312                     set_int(check_state, CHECK_STATE_DISABLED_VISIBLE); \
313                  } \
314             } \
315          } \
316          program { name: "enable"; \
317             signal: "elm,state,enabled"; \
318             source: "elm"; \
319             action: STATE_SET "default" 0.0; \
320             target: "disabler"; \
321             target: "bg"; \
322             after: "enable_text"; \
323          } \
324          program { name: "enable_text"; \
325             script { \
326                new st[31]; \
327                new Float:vl; \
328                get_state(PART:"elm.text", st, 30, vl); \
329                if (!strcmp(st, "disabled_visible")) \
330                  set_state(PART:"elm.text", "visible", 0.0); \
331                else \
332                  set_state(PART:"elm.text", "default", 0.0); \
333                get_state(PART:"elm.swallow.content", st, 30, vl); \
334                if (!strcmp(st, "visible")) \
335                  set_state(PART:"elm.swallow.content", "visible", 0.0); \
336                else \
337                  set_state(PART:"elm.swallow.content", "default", 0.0); \
338                get_state(PART:"check", st, 30, vl); \
339                if (!strcmp(st, "disabled_visible")) \
340                  { \
341                     set_state(PART:"check", "visible", 0.0); \
342                     set_int(check_state, CHECK_STATE_VISIBLE); \
343                  } \
344                else \
345                  set_int(check_state, CHECK_STATE_DEFAULT); \
346             } \
347          } \
348       } \
349    }
350
351 ////////////////////////////////////////////////////////////////////////////////
352         CHECK_STYLE_DEFAULT("gallery/default", GALLERY_EDC_IMAGE_CHECK_BG, GALLERY_EDC_IMAGE_CHECK_BG_CHECKING, 42, 42)
353
354 ////////////////////////////////////////////////////////////////////////////////
355         CHECK_STYLE_DEFAULT("gallery/album", GALLERY_EDC_IMAGE_CHECK_ALBUM_BG, GALLERY_EDC_IMAGE_CHECK_BG_CHECKING, 42, 42)
356
357 ////////////////////////////////////////////////////////////////////////////////
358 #define CHECK_STYLE_GRID(style_name, image_grid, width, height) \
359    group { name: "elm/check/base/"style_name; \
360       images.image: image_grid COMP; \
361       parts { \
362          part { name: "bg"; \
363             type: RECT; \
364             scale: 1; \
365             description { state: "default" 0.0; \
366                color: 0 0 0 0; \
367             } \
368             description { state: "pressed" 0.0; \
369                inherit: "default" 0.0; \
370             } \
371             description { state: "disabled" 0.0; \
372                inherit: "default" 0.0; \
373                visible: 0; \
374             } \
375          } \
376                 part { name: "icon_bg_img"; \
377                         type: RECT; \
378                         mouse_events: 0; \
379                         scale : 1; \
380                         description { \
381                                 color: 0 0 0 0; \
382                                 rel1 { relative: GAP_SHADOW_L/W GAP_SHADOW_T/H; to: "bg"; } \
383                                 rel2 { relative: (W-GAP_SHADOW_R-1)/W (H+GAP_SHADOW_B-1)/H; to: "bg"; } \
384                         } \
385                 } \
386                 part { name: "icon_bg"; \
387                         type: RECT; \
388                         description { state: "default" 0.0; \
389                                 color: 0 0 0 0; \
390                                 rel1 { relative: GAP_ICON_L/SHADOW_W GAP_ICON_T/SHADOW_H; to: "icon_bg_img"; } \
391                                 rel2 { relative: (SHADOW_W-GAP_ICON_R+2)/SHADOW_W (SHADOW_H-GAP_ICON_B+1)/SHADOW_H; to: "icon_bg_img"; } \
392                         } \
393                 } \
394          part { name: "bg2"; \
395             type: RECT; \
396             mouse_events: 0; \
397             scale: 1; \
398             description { state: "default" 0.0; \
399                rel1.to: "icon_bg"; \
400                rel2.to: "icon_bg"; \
401                align: 0.5 0.5; \
402                min: width height; \
403                max: width height; \
404                color:  0 0 0 0; \
405             } \
406             description { state: "pressed" 0.0; \
407                inherit: "default" 0.0; \
408             } \
409             description { state: "disabled" 0.0; \
410                inherit: "default" 0.0; \
411                visible: 0; \
412             } \
413          } \
414          part { name: "selected_bg"; \
415             type: RECT; \
416             scale: 1; \
417             description { state: "default" 0.0; \
418                rel1.to: "icon_bg"; \
419                rel2.to: "icon_bg"; \
420                color: 0 0 0 0; \
421                visible: 0; \
422             } \
423             description { state: "visible" 0.0; \
424                inherit: "default" 0.0; \
425                color: 0 0 0 153; \
426                visible: 1; \
427             } \
428          } \
429          part { name: "check"; \
430             mouse_events: 0; \
431             scale: 1; \
432             description { state: "default" 0.0; \
433                rel1.to: "bg2"; \
434                rel2.to: "bg2"; \
435                visible: 0; \
436                image.normal: image_grid; \
437             } \
438             description { state: "visible" 0.0; \
439                inherit: "default" 0.0; \
440                visible: 1; \
441             } \
442             description { state: "pressed" 0.0; \
443                inherit: "default" 0.0; \
444                visible: 1; \
445             } \
446             description { state: "disabled_visible" 0.0; \
447                inherit: "default" 0.0; \
448                visible: 1; \
449             } \
450          } \
451          part { name: "elm.swallow.content"; \
452             type: SWALLOW; \
453             description { \
454                state: "default" 0.0; \
455                fixed: 1 0; \
456                visible: 0; \
457                color: 255 255 255 255; \
458                align: 0.0 0.5; \
459                rel1 { \
460                   to_x: "bg2"; \
461                   relative: 1.0 0.0; \
462                   offset: 1 1; \
463                } \
464                rel2 { \
465                   to_x: "bg2"; \
466                   relative: 1.0 1.0; \
467                   offset: 2 -2; \
468                } \
469             } \
470             description { state: "visible" 0.0; \
471                inherit: "default" 0.0; \
472                fixed: 1 1; \
473                visible: 1; \
474                aspect: 1.0 1.0; \
475                aspect_preference: VERTICAL; \
476             } \
477             description { state: "disabled" 0.0; \
478                inherit: "default" 0.0; \
479                color: 128 128 128 128; \
480             } \
481             description { state: "disabled_visible" 0.0; \
482                inherit: "default" 0.0; \
483                color: 128 128 128 128; \
484                fixed: 1 1; \
485                visible: 1; \
486                aspect: 1.0 1.0; \
487             } \
488          } \
489          part { name: "elm.text"; \
490             type: TEXTBLOCK; \
491             mouse_events: 0; \
492             scale: 1; \
493             description { state: "default" 0.0; \
494                visible: 0; \
495                fixed: 0 1; \
496                rel1 { \
497                   relative: 1.0 0.5; \
498                   offset: 1 1; \
499                   to_x: "elm.swallow.content"; \
500                } \
501                rel2 { \
502                   relative: 1.0 0.5; \
503                   offset: -2 -2; \
504                } \
505                color: 255 255 255 255; \
506                align: 0.0 0.5; \
507                text { \
508                   style: "check_label_textblock_style"; \
509                   min: 0 0; \
510                } \
511                color: CHECK_DEFAULT_TEXT_NORMAL_COLOR_INC; \
512             } \
513             description { state: "visible" 0.0; \
514                inherit: "default" 0.0; \
515                visible: 1; \
516                text.min: 1 1; \
517             } \
518             description { state: "disabled" 0.0; \
519                inherit: "default" 0.0; \
520             } \
521             description { state: "disabled_visible" 0.0; \
522                inherit: "default" 0.0; \
523                visible: 1; \
524                text.min: 1 1; \
525                color: CHECK_DEFAULT_TEXT_DISABLED_COLOR_INC; \
526             } \
527          } \
528          part { name: "events"; \
529             type: RECT; \
530             ignore_flags: ON_HOLD; \
531             description { state: "default" 0.0; \
532                color: 0 0 0 0; \
533             } \
534          } \
535          part { name: "disabler"; \
536             type: RECT; \
537             description { state: "default" 0.0; \
538                color: 0 0 0 0; \
539                visible: 0; \
540             } \
541             description { state: "disabled" 0.0; \
542                inherit: "default" 0.0; \
543                visible: 1; \
544             } \
545          } \
546       } \
547       programs { \
548          program { name: "click"; \
549             signal: "mouse,up,1"; \
550             source: "events"; \
551             action: SIGNAL_EMIT "elm,action,check,toggle" ""; \
552             after: "bg_normal"; \
553          } \
554          program { name: "bg_normal"; \
555             script { \
556                set_state(PART:"bg", "default", 0.0); \
557                set_state(PART:"bg2", "default", 0.0); \
558             } \
559          } \
560          program { name: "mouseout"; \
561             signal: "mouse,out"; \
562             source: "events"; \
563             after: "bg_check_normal"; \
564          } \
565          program { name: "bg_check_normal"; \
566             script { \
567                new st[31]; \
568                new Float:vl; \
569                get_state(PART:"check", st, 30, vl); \
570                if (!strcmp(st, "pressed")) \
571                  set_state(PART:"check", "visible", 0.0); \
572                set_state(PART:"bg", "default", 0.0); \
573                set_state(PART:"bg2", "default", 0.0); \
574             } \
575          } \
576          program { name: "pressed"; \
577             signal: "mouse,down,1"; \
578             source: "events"; \
579             script { \
580                new st[31]; \
581                new Float:vl; \
582                get_state(PART:"check", st, 30, vl); \
583                if (!strcmp(st, "visible")) \
584                  set_state(PART:"check", "pressed", 0.0); \
585                set_state(PART:"bg", "pressed", 0.0); \
586                set_state(PART:"bg2", "pressed", 0.0); \
587             } \
588          } \
589          program { name: "check_on"; \
590             signal: "elm,state,check,on"; \
591             source: "elm"; \
592             action: STATE_SET "visible" 0.0; \
593             target: "check"; \
594             target: "selected_bg"; \
595          } \
596          program { name: "check_off"; \
597             signal: "elm,state,check,off"; \
598             source: "elm"; \
599             action: STATE_SET "default" 0.0; \
600             target: "check"; \
601             target: "selected_bg"; \
602          } \
603          program { name: "text_show"; \
604             signal: "elm,state,text,visible"; \
605             source: "elm"; \
606             action: STATE_SET "visible" 0.0; \
607             target: "elm.text"; \
608          } \
609          program { name: "text_hide"; \
610             signal: "elm,state,text,hidden"; \
611             source: "elm"; \
612             action: STATE_SET "default" 0.0; \
613             target: "elm.text"; \
614          } \
615          program { name: "icon_show"; \
616             signal: "elm,state,icon,visible"; \
617             source: "elm"; \
618             action: STATE_SET "visible" 0.0; \
619             target: "elm.swallow.content"; \
620          } \
621          program { name: "icon_hide"; \
622             signal: "elm,state,icon,hidden"; \
623             source: "elm"; \
624             action: STATE_SET "default" 0.0; \
625             target: "elm.swallow.content"; \
626          } \
627          program { name: "disable"; \
628             signal: "elm,state,disabled"; \
629             source: "elm"; \
630             action: STATE_SET "disabled" 0.0; \
631             target: "disabler"; \
632             target: "bg"; \
633             target: "bg2"; \
634             after: "disable_text"; \
635          } \
636          program { name: "disable_text"; \
637             script { \
638                new st[31]; \
639                new Float:vl; \
640                get_state(PART:"elm.text", st, 30, vl); \
641                if (!strcmp(st, "visible")) \
642                  set_state(PART:"elm.text", "disabled_visible", 0.0); \
643                else \
644                  set_state(PART:"elm.text", "disabled", 0.0); \
645                get_state(PART:"elm.swallow.content", st, 30, vl); \
646                if (!strcmp(st, "visible")) \
647                  set_state(PART:"elm.swallow.content", "disabled_visible", 0.0); \
648                else \
649                  set_state(PART:"elm.swallow.content", "disabled", 0.0); \
650                get_state(PART:"check", st, 30, vl); \
651                if (!strcmp(st, "visible")) \
652                  set_state(PART:"check", "disabled_visible", 0.0); \
653             } \
654          } \
655          program { name: "enable"; \
656             signal: "elm,state,enabled"; \
657             source: "elm"; \
658             action: STATE_SET "default" 0.0; \
659             target: "disabler"; \
660             target: "bg"; \
661             target: "bg2"; \
662             after: "enable_text"; \
663          } \
664          program { name: "enable_text"; \
665             script { \
666                new st[31]; \
667                new Float:vl; \
668                get_state(PART:"elm.text", st, 30, vl); \
669                if (!strcmp(st, "disabled_visible")) \
670                  set_state(PART:"elm.text", "visible", 0.0); \
671                else \
672                  set_state(PART:"elm.text", "default", 0.0); \
673                get_state(PART:"elm.swallow.content", st, 30, vl); \
674                if (!strcmp(st, "visible")) \
675                  set_state(PART:"elm.swallow.content", "visible", 0.0); \
676                else \
677                  set_state(PART:"elm.swallow.content", "default", 0.0); \
678                get_state(PART:"check", st, 30, vl); \
679                if (!strcmp(st, "disabled_visible")) \
680                  set_state(PART:"check", "visible", 0.0); \
681             } \
682          } \
683       } \
684    }
685
686 ////////////////////////////////////////////////////////////////////////////////
687         CHECK_STYLE_GRID("gallery/grid", GALLERY_EDC_IMAGE_CHECK_GRID, 64, 64)
688
689 ////////////////////////////////////////////////////////////////////////////////
690    group { name: "elm/check/base/gallery/pinch/grid";
691       images.image: GALLERY_EDC_IMAGE_CHECK_PINCH_GRID COMP;
692       parts {
693          part { name: "bg";
694             type: RECT;
695             scale: 1;
696             description { state: "default" 0.0;
697                color: 0 0 0 0;
698             }
699             description { state: "pressed" 0.0;
700                inherit: "default" 0.0;
701             }
702             description { state: "disabled" 0.0;
703                inherit: "default" 0.0;
704                visible: 0;
705             }
706          }
707         part { name: "icon_bg";
708                 type: RECT;
709                 description {
710                     state: "default" 0.0;
711                     color: 0 0 0 0;
712                     rel1 { relative: ZOOMED_GAP_L/ZOOMED_W ZOOMED_GAP_T/ZOOMED_H; to: "bg"; }
713                     rel2 { relative: (ZOOMED_W-ZOOMED_GAP_R)/ZOOMED_W (ZOOMED_H-ZOOMED_GAP_B)/ZOOMED_H; to: "bg"; }
714                 }
715         }
716          part { name: "bg2";
717             type: RECT;
718             mouse_events: 0;
719             scale: 1;
720             description { state: "default" 0.0;
721                rel1.to: "icon_bg";
722                rel2.to: "icon_bg";
723                align: 0.5 0.5;
724                min: 40 40;
725                max: 40 40;
726                color:  0 0 0 0;
727             }
728             description { state: "pressed" 0.0;
729                inherit: "default" 0.0;
730             }
731             description { state: "disabled" 0.0;
732                inherit: "default" 0.0;
733                visible: 0;
734             }
735          }
736          part { name: "selected_bg";
737             type: RECT;
738             scale: 1;
739             description { state: "default" 0.0;
740                rel1.to: "icon_bg";
741                rel2.to: "icon_bg";
742                color: 0 0 0 0;
743                visible: 0;
744             }
745             description { state: "visible" 0.0;
746                inherit: "default" 0.0;
747                color: 0 0 0 153;
748                visible: 1;
749             }
750          }
751          part { name: "check";
752             mouse_events: 0;
753             scale: 1;
754             description { state: "default" 0.0;
755                rel1.to: "bg2";
756                rel2.to: "bg2";
757                visible: 0;
758                image.normal: GALLERY_EDC_IMAGE_CHECK_PINCH_GRID;
759             }
760             description { state: "visible" 0.0;
761                inherit: "default" 0.0;
762                visible: 1;
763             }
764             description { state: "pressed" 0.0;
765                inherit: "default" 0.0;
766                visible: 1;
767             }
768             description { state: "disabled_visible" 0.0;
769                inherit: "default" 0.0;
770                visible: 1;
771             }
772          }
773          part { name: "elm.swallow.content";
774             type: SWALLOW;
775             description {
776                state: "default" 0.0;
777                fixed: 1 0;
778                visible: 0;
779                color: 255 255 255 255;
780                align: 0.0 0.5;
781                rel1 {
782                   to_x: "bg2";
783                   relative: 1.0 0.0;
784                   offset: 1 1;
785                }
786                rel2 {
787                   to_x: "bg2";
788                   relative: 1.0 1.0;
789                   offset: 2 -2;
790                }
791             }
792             description { state: "visible" 0.0;
793                inherit: "default" 0.0;
794                fixed: 1 1;
795                visible: 1;
796                aspect: 1.0 1.0;
797                aspect_preference: VERTICAL;
798             }
799             description { state: "disabled" 0.0;
800                inherit: "default" 0.0;
801                color: 128 128 128 128;
802             }
803             description { state: "disabled_visible" 0.0;
804                inherit: "default" 0.0;
805                color: 128 128 128 128;
806                fixed: 1 1;
807                visible: 1;
808                aspect: 1.0 1.0;
809             }
810          }
811          part { name: "elm.text";
812             type: TEXTBLOCK;
813             mouse_events: 0;
814             scale: 1;
815             description { state: "default" 0.0;
816                visible: 0;
817                fixed: 0 1;
818                rel1 {
819                   relative: 1.0 0.5;
820                   offset: 1 1;
821                   to_x: "elm.swallow.content";
822                }
823                rel2 {
824                   relative: 1.0 0.5;
825                   offset: -2 -2;
826                }
827                color: 255 255 255 255;
828                align: 0.0 0.5;
829                text {
830                   style: "check_label_textblock_style";
831                   min: 0 0;
832                }
833                color: CHECK_DEFAULT_TEXT_NORMAL_COLOR_INC;
834             }
835             description { state: "visible" 0.0;
836                inherit: "default" 0.0;
837                visible: 1;
838                text.min: 1 1;
839             }
840             description { state: "disabled" 0.0;
841                inherit: "default" 0.0;
842             }
843             description { state: "disabled_visible" 0.0;
844                inherit: "default" 0.0;
845                visible: 1;
846                text.min: 1 1;
847                color: CHECK_DEFAULT_TEXT_DISABLED_COLOR_INC;
848             }
849          }
850          part { name: "events";
851             type: RECT;
852             ignore_flags: ON_HOLD;
853             description { state: "default" 0.0;
854                color: 0 0 0 0;
855             }
856          }
857          part { name: "disabler";
858             type: RECT;
859             description { state: "default" 0.0;
860                color: 0 0 0 0;
861                visible: 0;
862             }
863             description { state: "disabled" 0.0;
864                inherit: "default" 0.0;
865                visible: 1;
866             }
867          }
868       }
869       programs {
870          program { name: "click";
871             signal: "mouse,up,1";
872             source: "events";
873             action: SIGNAL_EMIT "elm,action,check,toggle" "";
874             after: "bg_normal";
875          }
876          program { name: "bg_normal";
877             script {
878                set_state(PART:"bg", "default", 0.0);
879                set_state(PART:"bg2", "default", 0.0);
880             }
881          }
882          program { name: "mouseout";
883             signal: "mouse,out";
884             source: "events";
885             after: "bg_check_normal";
886          }
887          program { name: "bg_check_normal";
888             script {
889                new st[31];
890                new Float:vl;
891                get_state(PART:"check", st, 30, vl);
892                if (!strcmp(st, "pressed"))
893                  set_state(PART:"check", "visible", 0.0);
894                set_state(PART:"bg", "default", 0.0);
895                set_state(PART:"bg2", "default", 0.0);
896             }
897          }
898          program { name: "pressed";
899             signal: "mouse,down,1";
900             source: "events";
901             script {
902                new st[31];
903                new Float:vl;
904                get_state(PART:"check", st, 30, vl);
905                if (!strcmp(st, "visible"))
906                  set_state(PART:"check", "pressed", 0.0);
907                set_state(PART:"bg", "pressed", 0.0);
908                set_state(PART:"bg2", "pressed", 0.0);
909             }
910          }
911          program { name: "check_on";
912             signal: "elm,state,check,on";
913             source: "elm";
914             action: STATE_SET "visible" 0.0;
915             target: "check";
916             target: "selected_bg";
917          }
918          program { name: "check_off";
919             signal: "elm,state,check,off";
920             source: "elm";
921             action: STATE_SET "default" 0.0;
922             target: "check";
923             target: "selected_bg";
924          }
925          program { name: "text_show";
926             signal: "elm,state,text,visible";
927             source: "elm";
928             action: STATE_SET "visible" 0.0;
929             target: "elm.text";
930          }
931          program { name: "text_hide";
932             signal: "elm,state,text,hidden";
933             source: "elm";
934             action: STATE_SET "default" 0.0;
935             target: "elm.text";
936          }
937          program { name: "icon_show";
938             signal: "elm,state,icon,visible";
939             source: "elm";
940             action: STATE_SET "visible" 0.0;
941             target: "elm.swallow.content";
942          }
943          program { name: "icon_hide";
944             signal: "elm,state,icon,hidden";
945             source: "elm";
946             action: STATE_SET "default" 0.0;
947             target: "elm.swallow.content";
948          }
949          program { name: "disable";
950             signal: "elm,state,disabled";
951             source: "elm";
952             action: STATE_SET "disabled" 0.0;
953             target: "disabler";
954             target: "bg";
955             target: "bg2";
956             after: "disable_text";
957          }
958          program { name: "disable_text";
959             script {
960                new st[31];
961                new Float:vl;
962                get_state(PART:"elm.text", st, 30, vl);
963                if (!strcmp(st, "visible"))
964                  set_state(PART:"elm.text", "disabled_visible", 0.0);
965                else
966                  set_state(PART:"elm.text", "disabled", 0.0);
967                get_state(PART:"elm.swallow.content", st, 30, vl);
968                if (!strcmp(st, "visible"))
969                  set_state(PART:"elm.swallow.content", "disabled_visible", 0.0);
970                else
971                  set_state(PART:"elm.swallow.content", "disabled", 0.0);
972                get_state(PART:"check", st, 30, vl);
973                if (!strcmp(st, "visible"))
974                  set_state(PART:"check", "disabled_visible", 0.0);
975             }
976          }
977          program { name: "enable";
978             signal: "elm,state,enabled";
979             source: "elm";
980             action: STATE_SET "default" 0.0;
981             target: "disabler";
982             target: "bg";
983             target: "bg2";
984             after: "enable_text";
985          }
986          program { name: "enable_text";
987             script {
988                new st[31];
989                new Float:vl;
990                get_state(PART:"elm.text", st, 30, vl);
991                if (!strcmp(st, "disabled_visible"))
992                  set_state(PART:"elm.text", "visible", 0.0);
993                else
994                  set_state(PART:"elm.text", "default", 0.0);
995                get_state(PART:"elm.swallow.content", st, 30, vl);
996                if (!strcmp(st, "visible"))
997                  set_state(PART:"elm.swallow.content", "visible", 0.0);
998                else
999                  set_state(PART:"elm.swallow.content", "default", 0.0);
1000                get_state(PART:"check", st, 30, vl);
1001                if (!strcmp(st, "disabled_visible"))
1002                  set_state(PART:"check", "visible", 0.0);
1003             }
1004          }
1005       }
1006    }
1007
1008 ////////////////////////////////////////////////////////////////////////////////
1009    group { name: "elm/check/base/gallery/album/grid";
1010       parts {
1011          part { name: "bg";
1012             type: RECT;
1013             scale: 1;
1014             description { state: "default" 0.0;
1015                color: 0 0 0 0;
1016             }
1017             description { state: "pressed" 0.0;
1018                inherit: "default" 0.0;
1019             }
1020             description { state: "disabled" 0.0;
1021                inherit: "default" 0.0;
1022                visible: 0;
1023             }
1024          }
1025          part { name: "bg2";
1026             type: RECT;
1027             mouse_events: 0;
1028             scale: 1;
1029             description { state: "default" 0.0;
1030                rel1.to: "bg";
1031                rel2.to: "bg";
1032                align: 0.5 0.5;
1033                min: 40 40;
1034                max: 40 40;
1035                color:  0 0 0 0;
1036             }
1037             description { state: "pressed" 0.0;
1038                inherit: "default" 0.0;
1039             }
1040             description { state: "disabled" 0.0;
1041                inherit: "default" 0.0;
1042                visible: 0;
1043             }
1044          }
1045          part { name: "selected_bg";
1046             type: RECT;
1047             scale: 1;
1048             description { state: "default" 0.0;
1049                rel1.to: "bg";
1050                rel2.to: "bg";
1051                color: 0 0 0 0;
1052                visible: 0;
1053             }
1054             description { state: "visible" 0.0;
1055                inherit: "default" 0.0;
1056                color: 0 0 0 153;
1057                visible: 1;
1058             }
1059          }
1060          part { name: "check";
1061             type: RECT;
1062             mouse_events: 0;
1063             scale: 1;
1064             description { state: "default" 0.0;
1065                rel1.to: "bg2";
1066                rel2.to: "bg2";
1067                color: 0 0 0 0;
1068                visible: 0;
1069             }
1070             description { state: "visible" 0.0;
1071                inherit: "default" 0.0;
1072             }
1073             description { state: "pressed" 0.0;
1074                inherit: "default" 0.0;
1075             }
1076             description { state: "disabled_visible" 0.0;
1077                inherit: "default" 0.0;
1078             }
1079          }
1080          part { name: "elm.swallow.content";
1081             type: SWALLOW;
1082             description {
1083                state: "default" 0.0;
1084                fixed: 1 0;
1085                visible: 0;
1086                color: 255 255 255 255;
1087                align: 0.0 0.5;
1088                rel1 {
1089                   to_x: "bg2";
1090                   relative: 1.0 0.0;
1091                   offset: 1 1;
1092                }
1093                rel2 {
1094                   to_x: "bg2";
1095                   relative: 1.0 1.0;
1096                   offset: 2 -2;
1097                }
1098             }
1099             description { state: "visible" 0.0;
1100                inherit: "default" 0.0;
1101                fixed: 1 1;
1102                visible: 1;
1103                aspect: 1.0 1.0;
1104                aspect_preference: VERTICAL;
1105             }
1106             description { state: "disabled" 0.0;
1107                inherit: "default" 0.0;
1108                color: 128 128 128 128;
1109             }
1110             description { state: "disabled_visible" 0.0;
1111                inherit: "default" 0.0;
1112                color: 128 128 128 128;
1113                fixed: 1 1;
1114                visible: 1;
1115                aspect: 1.0 1.0;
1116             }
1117          }
1118          part { name: "elm.text";
1119             type: TEXTBLOCK;
1120             mouse_events: 0;
1121             scale: 1;
1122             description { state: "default" 0.0;
1123                visible: 0;
1124                fixed: 0 1;
1125                rel1 {
1126                   relative: 1.0 0.5;
1127                   offset: 1 1;
1128                   to_x: "elm.swallow.content";
1129                }
1130                rel2 {
1131                   relative: 1.0 0.5;
1132                   offset: -2 -2;
1133                }
1134                color: 255 255 255 255;
1135                align: 0.0 0.5;
1136                text {
1137                   style: "check_label_textblock_style";
1138                   min: 0 0;
1139                }
1140                color: CHECK_DEFAULT_TEXT_NORMAL_COLOR_INC;
1141             }
1142             description { state: "visible" 0.0;
1143                inherit: "default" 0.0;
1144                visible: 1;
1145                text.min: 1 1;
1146             }
1147             description { state: "disabled" 0.0;
1148                inherit: "default" 0.0;
1149             }
1150             description { state: "disabled_visible" 0.0;
1151                inherit: "default" 0.0;
1152                visible: 1;
1153                text.min: 1 1;
1154                color: CHECK_DEFAULT_TEXT_DISABLED_COLOR_INC;
1155             }
1156          }
1157          part { name: "events";
1158             type: RECT;
1159             ignore_flags: ON_HOLD;
1160             description { state: "default" 0.0;
1161                color: 0 0 0 0;
1162             }
1163          }
1164          part { name: "disabler";
1165             type: RECT;
1166             description { state: "default" 0.0;
1167                color: 0 0 0 0;
1168                visible: 0;
1169             }
1170             description { state: "disabled" 0.0;
1171                inherit: "default" 0.0;
1172                visible: 1;
1173             }
1174          }
1175       }
1176       programs {
1177          program { name: "click";
1178             signal: "mouse,up,1";
1179             source: "events";
1180             action: SIGNAL_EMIT "elm,action,check,toggle" "";
1181             after: "bg_normal";
1182          }
1183          program { name: "bg_normal";
1184             script {
1185                set_state(PART:"bg", "default", 0.0);
1186                set_state(PART:"bg2", "default", 0.0);
1187             }
1188          }
1189          program { name: "mouseout";
1190             signal: "mouse,out";
1191             source: "events";
1192             after: "bg_check_normal";
1193          }
1194          program { name: "bg_check_normal";
1195             script {
1196                new st[31];
1197                new Float:vl;
1198                get_state(PART:"check", st, 30, vl);
1199                if (!strcmp(st, "pressed"))
1200                  set_state(PART:"check", "visible", 0.0);
1201                set_state(PART:"bg", "default", 0.0);
1202                set_state(PART:"bg2", "default", 0.0);
1203             }
1204          }
1205          program { name: "pressed";
1206             signal: "mouse,down,1";
1207             source: "events";
1208             script {
1209                new st[31];
1210                new Float:vl;
1211                get_state(PART:"check", st, 30, vl);
1212                if (!strcmp(st, "visible"))
1213                  set_state(PART:"check", "pressed", 0.0);
1214                set_state(PART:"bg", "pressed", 0.0);
1215                set_state(PART:"bg2", "pressed", 0.0);
1216             }
1217          }
1218          program { name: "check_on";
1219             signal: "elm,state,check,on";
1220             source: "elm";
1221             action: STATE_SET "visible" 0.0;
1222             target: "check";
1223             target: "selected_bg";
1224          }
1225          program { name: "check_off";
1226             signal: "elm,state,check,off";
1227             source: "elm";
1228             action: STATE_SET "default" 0.0;
1229             target: "check";
1230             target: "selected_bg";
1231          }
1232          program { name: "text_show";
1233             signal: "elm,state,text,visible";
1234             source: "elm";
1235             action: STATE_SET "visible" 0.0;
1236             target: "elm.text";
1237          }
1238          program { name: "text_hide";
1239             signal: "elm,state,text,hidden";
1240             source: "elm";
1241             action: STATE_SET "default" 0.0;
1242             target: "elm.text";
1243          }
1244          program { name: "icon_show";
1245             signal: "elm,state,icon,visible";
1246             source: "elm";
1247             action: STATE_SET "visible" 0.0;
1248             target: "elm.swallow.content";
1249          }
1250          program { name: "icon_hide";
1251             signal: "elm,state,icon,hidden";
1252             source: "elm";
1253             action: STATE_SET "default" 0.0;
1254             target: "elm.swallow.content";
1255          }
1256          program { name: "disable";
1257             signal: "elm,state,disabled";
1258             source: "elm";
1259             action: STATE_SET "disabled" 0.0;
1260             target: "disabler";
1261             target: "bg";
1262             target: "bg2";
1263             after: "disable_text";
1264          }
1265          program { name: "disable_text";
1266             script {
1267                new st[31];
1268                new Float:vl;
1269                get_state(PART:"elm.text", st, 30, vl);
1270                if (!strcmp(st, "visible"))
1271                  set_state(PART:"elm.text", "disabled_visible", 0.0);
1272                else
1273                  set_state(PART:"elm.text", "disabled", 0.0);
1274                get_state(PART:"elm.swallow.content", st, 30, vl);
1275                if (!strcmp(st, "visible"))
1276                  set_state(PART:"elm.swallow.content", "disabled_visible", 0.0);
1277                else
1278                  set_state(PART:"elm.swallow.content", "disabled", 0.0);
1279                get_state(PART:"check", st, 30, vl);
1280                if (!strcmp(st, "visible"))
1281                  set_state(PART:"check", "disabled_visible", 0.0);
1282             }
1283          }
1284          program { name: "enable";
1285             signal: "elm,state,enabled";
1286             source: "elm";
1287             action: STATE_SET "default" 0.0;
1288             target: "disabler";
1289             target: "bg";
1290             target: "bg2";
1291             after: "enable_text";
1292          }
1293          program { name: "enable_text";
1294             script {
1295                new st[31];
1296                new Float:vl;
1297                get_state(PART:"elm.text", st, 30, vl);
1298                if (!strcmp(st, "disabled_visible"))
1299                  set_state(PART:"elm.text", "visible", 0.0);
1300                else
1301                  set_state(PART:"elm.text", "default", 0.0);
1302                get_state(PART:"elm.swallow.content", st, 30, vl);
1303                if (!strcmp(st, "visible"))
1304                  set_state(PART:"elm.swallow.content", "visible", 0.0);
1305                else
1306                  set_state(PART:"elm.swallow.content", "default", 0.0);
1307                get_state(PART:"check", st, 30, vl);
1308                if (!strcmp(st, "disabled_visible"))
1309                  set_state(PART:"check", "visible", 0.0);
1310             }
1311          }
1312       }
1313    }
1314
1315 #undef CHECK_STATE_DEFAULT
1316 #undef CHECK_STATE_VISIBLE
1317 #undef CHECK_STATE_DISABLED_VISIBLE
1318 #undef CHECK_STATE_DISABLED