e37a614655364b0109b50d3e979198ed6209bd24
[apps/home/gallery.git] / res / edc / gl-button.edc
1 /*
2   * Copyright 2012  Samsung Electronics Co., Ltd
3   *
4   * Licensed under the Flora License, Version 1.0 (the "License");
5   * you may not use this file except in compliance with the License.
6   * You may obtain a copy of the License at
7   *
8   *     http://www.tizenopensource.org/license
9   *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16
17 #define BUTTON_STATE_ENABLED  0
18 #define BUTTON_STATE_DISABLED 1
19
20 #define BUTTON_TEXT_STYLE1_NORMAL_COLOR_INC 249 249 249 255
21 #define BUTTON_TEXT_STYLE1_PRESSED_COLOR_INC 249 249 249 255
22 #define BUTTON_TEXT_STYLE1_FOCUSED_COLOR_INC 249 249 249 255
23 #define BUTTON_TEXT_STYLE1_DISABLED_COLOR_INC 106 106 106 255
24 #define BUTTON_TEXT_STYLE1_TEXT_DISABLED_COLOR_INC 180 180 1 255
25
26 #define BUTTON_TEXT_NAVIFRAME_NORMAL_COLOR_INC 211 211 211 255
27 #define BUTTON_TEXT_NAVIFRAME_PRESSED_COLOR_INC 249 249 249 255
28 #define BUTTON_TEXT_NAVIFRAME_FOCUSED_COLOR_INC 249 249 249 255
29 #define BUTTON_TEXT_NAVIFRAME_DISABLED_COLOR_INC 193 193 193 255
30
31 #define BUTTON_POPUP_BUTTON_TEXT_NORMAL_COLOR_INC 255 255 255 255
32 #define BUTTON_POPUP_BUTTON_TEXT_PRESSED_COLOR_INC 255 255 255 255
33 #define BUTTON_POPUP_BUTTON_TEXT_FOCUSED_COLOR_INC 255 255 255 255
34 #define BUTTON_POPUP_BUTTON_TEXT_DISABLED_COLOR_INC 204 200 188 255
35
36 #define BUTTON_SWEEP_BUTTON_TEXT_NORMAL_COLOR_INC 249 249 249 255
37 #define BUTTON_SWEEP_BUTTON_TEXT_PRESSED_COLOR_INC 249 249 249 255
38 #define BUTTON_SWEEP_BUTTON_TEXT_FOCUSED_COLOR_INC 249 249 249 255
39 #define BUTTON_SWEEP_BUTTON_TEXT_DISABLED_COLOR_INC 108 115 118 255
40
41 #define BUTTON_TEXT_STYLE1_BG_MIN_INC 100 74
42 #define BUTTON_TEXT_STYLE1_VISIBLE_BG_MIN_INC 148 74
43 #define BUTTON_TEXT_STYLE1_ICONONLY_BG_MIN_INC 74 74
44 #define BUTTON_TEXT_STYLE1_BG_BORDER_INC 5 5 5 5
45 #define BUTTON_TEXT_STYLE1_PADDING_MIN_INC 20 5
46 #define BUTTON_TEXT_STYLE1_VISIBLE_ICON_RECT_MIN_MAX_INC 38 38
47 #define BUTTON_TEXT_STYLE1_VISIBLE_PADDING_ICON_TEXT_MIN_INC 10 0
48 #define BUTTON_TEXT_STYLE1_VISIBLE_ICON_MIN_MAX_INC 38 38
49 #define BUTTON_TEXT_STYLE1_ICONONLY_ICON_MIN_MAX_INC 38 38
50 #define BUTTON_TEXT_STYLE1_FONT_SIZE_INC 32
51
52 #define BUTTON_CIRCLE_STYLE_BG_MIN_MAX_INC 64 64
53 #define BUTTON_CIRCLE_STYLE_IMAGE_MIN_MAX_INC 64 64
54 #define BUTTON_CIRCLE_STYLE_CONTENT_MIN_MAX_INC 35 35
55
56 #define BUTTON_POPUP_BG_NORMAL_MIN_INC 30 74
57 #define BUTTON_POPUP_BG_BORDER_INC 5 5 5 5
58 #define BUTTON_POPUP_PADDING_MIN_INC 8 5
59 #define BUTTON_POPUP_PADDING_ICON_TEXT_VISIBLE_MIN_INC 8 0
60 #define BUTTON_POPUP_ICON_ICONONLY_MIN_INC 38 38
61 #define BUTTON_POPUP_TEXT_MIN_INC 64 20
62 #define BUTTON_POPUP_TEXT_FONT_SIZE_INC 32
63
64 #define BUTTON_EDIT_STYLE_BG_NORMAL_MIN_MAX_INC 74 74
65 #define BUTTON_EDIT_STYLE_IMAGE_NORMAL_MIN_MAX_INC 74 74
66 #define BUTTON_EDIT_STYLE_BORDER_INC 8 0 5 5
67
68 #define BUTTON_SWEEP_BG_NORMAL_MIN_INC 12 60
69 #define BUTTON_SWEEP_BG_BORDER_INC 5 5 5 5
70 #define BUTTON_SWEEP_PADDING_MIN_INC 5 5
71 #define BUTTON_SWEEP_ICON_RECT_MIN_INC 0 28
72 #define BUTTON_SWEEP_PADDING_ICON_TEXT_VISIBLE_MIN_INC 5 0
73 #define BUTTON_SWEEP_ICONONLY_ICON_MIN_INC 28 28
74 #define BUTTON_SWEEP_TEXT_MIN_INC 90 28
75 #define BUTTON_SWEEP_FONT_SIZE_INC 32
76
77 #define BUTTON_NAVIFRAME_BACK_BUTTON_BG_MIN_MAX_INC 106 74
78 #define BUTTON_NAVIFRAME_BACK_BUTTON_BG_BORDER_INC 5 5 5 5
79 #define BUTTON_NAVIFRAME_BACK_BUTTON_MIN_MAX_INC 56 56
80
81 #define BUTTON_NAVIFRAME_DEFAULT_TEXT_COLOR_INC 249 249 249 255
82 #define BUTTON_NAVIFRAME_FOCUSED_TEXT_COLOR_INC 249 249 249 255
83
84 #define BUTTON_NAVIFRAME_CENTER_BG_NORMAL_MIN_INC 22 46
85 #define BUTTON_NAVIFRAME_CENTER_BG_NORMAL_BORDER_INC 4 4 4 4
86 #define BUTTON_NAVIFRAME_CENTER_PADDING_MIN_MAX_INC 16 2
87 #define BUTTON_NAVIFRAME_CENTER_ICON_RECT_VISIBLE_MIN_SIZE 36 36
88 #define BUTTON_NAVIFRAME_CENTER_PADDING_AFTER_ICON_VISIBLE_MIN_INC 6 0
89 #define BUTTON_NAVIFRAME_CENTER_PADDING_BEFORE_TEXT_DEFAULT_MIN_INC 6 0
90 #define BUTTON_NAVIFRAME_CENTER_SWALLOW_VISIBLE_MIN_MAX_INC 36 36
91 #define BUTTON_NAVIFRAME_CENTER_SWALLOW_ICONONLY_MIN_MAX_INC 38 38
92 #define BUTTON_NAVIFRAME_CENTER_TEXT_FONT_SIZE_INC 32
93 #define BUTTON_NAVIFRAME_MULTILINE_TEXT_FONT_SIZE_INC 24
94
95 #define BUTTON_NAVIFRAME_BG_MIN_INC 124 74
96 #define BUTTON_NAVIFRAME_VISIBLE_BG_MIN_INC 124 74
97 #define BUTTON_NAVIFRAME_ICONONLY_BG_MIN_INC 74 74
98 #define BUTTON_NAVIFRAME_BG_BORDER_INC 5 5 5 5
99 #define BUTTON_NAVIFRAME_PADDING_MIN_INC 5 5
100 #define BUTTON_NAVIFRAME_VISIBLE_ICON_RECT_MIN_MAX_INC 38 38
101 #define BUTTON_NAVIFRAME_VISIBLE_PADDING_ICON_TEXT_MIN_INC 10 0
102 #define BUTTON_NAVIFRAME_VISIBLE_ICON_MIN_MAX_INC 38 38
103 #define BUTTON_NAVIFRAME_ICONONLY_ICON_MIN_MAX_INC 38 38
104 #define BUTTON_TEXT_NAVIFRAME_FONT_SIZE_INC 28
105 #define BUTTON_NAVIFRAME_TITLE_BUTTON_MIN_INC 124 74
106
107 ///////////////////////////////////////////////////////////////////////////////////////
108    group { name: "elm/button/base/style1";
109       alias: "elm/button/base/text_only/style1";
110       alias: "elm/button/base/center";
111       alias: "elm/button/base/icon_and_text/center";
112       alias: "elm/button/base/nocontents/search_button";
113       images {
114          image: GALLERY_EDC_IMAGE_BTN_01_NORMAL COMP;
115          image: GALLERY_EDC_IMAGE_BTN_01_PRESS COMP;
116          image: GALLERY_EDC_IMAGE_BTN_01_DIM COMP;
117       }
118       script {
119          public button_state = BUTTON_STATE_ENABLED;
120       }
121       parts {
122          part { name: "button_image";
123             scale: 1;
124             description { state: "default" 0.0;
125                image {
126                   normal: GALLERY_EDC_IMAGE_BTN_01_NORMAL;
127                   border: BUTTON_TEXT_STYLE1_BG_BORDER_INC;
128                   border_scale: 1;
129                }
130             }
131             description { state: "clicked" 0.0;
132                inherit: "default" 0.0;
133                image.normal: GALLERY_EDC_IMAGE_BTN_01_PRESS;
134             }
135             description { state: "disabled" 0.0;
136                inherit: "default" 0.0;
137                image.normal: GALLERY_EDC_IMAGE_BTN_01_DIM;
138                //image.normal: GALLERY_EDC_IMAGE_BTN_01_NORMAL;
139             }
140             description { state: "focused" 0.0;
141                inherit: "default" 0.0;
142                image.normal: GALLERY_EDC_IMAGE_BTN_01_PRESS;
143             }
144          }
145          part { name: "padding_left_top";
146             type: RECT;
147             scale: 1;
148             mouse_events: 0;
149             description { state: "default" 0.0;
150                align: 0.0 0.0;
151                rel2.relative: 0.0 0.0;
152                min: BUTTON_TEXT_STYLE1_PADDING_MIN_INC;
153                fixed: 1 1;
154                visible: 0;
155             }
156          }
157          part { name: "bg";
158             type: RECT;
159             scale: 1;
160             mouse_events: 0;
161             description { state: "default" 0.0;
162                min: BUTTON_TEXT_STYLE1_BG_MIN_INC;
163                visible: 0;
164             }
165             description { state: "visible" 0.0;
166                inherit: "default" 0.0;
167                min: BUTTON_TEXT_STYLE1_VISIBLE_BG_MIN_INC;
168             }
169             description { state: "icononly" 0.0;
170                inherit: "default" 0.0;
171                min: BUTTON_TEXT_STYLE1_ICONONLY_BG_MIN_INC;
172             }
173          }
174          part { name: "padding_right_bottom";
175             type: RECT;
176             scale: 1;
177             mouse_events: 0;
178             description { state: "default" 0.0;
179                align: 1.0 1.0;
180                rel1.relative: 1.0 1.0;
181                min: BUTTON_TEXT_STYLE1_PADDING_MIN_INC;
182                fixed: 1 1;
183                visible: 0;
184             }
185          }
186          part { name: "icon_rect";
187             type: RECT;
188             scale: 1;
189             mouse_events: 0;
190             description { state: "default" 0.0;
191                visible: 0;
192                min: 0 0;
193                fixed: 1 0;
194                rel1 {
195                   relative: 1.0 1.0;
196                   to: "padding_left_top";
197                }
198                rel2 {
199                   relative: 1.0 0.0;
200                   to_x: "padding_left_top";
201                   to_y: "padding_right_bottom";
202                }
203                align: 0.0 0.5;
204             }
205             description { state: "visible" 0.0;
206                visible: 0;
207                min: BUTTON_TEXT_STYLE1_VISIBLE_ICON_RECT_MIN_MAX_INC;
208                max: BUTTON_TEXT_STYLE1_VISIBLE_ICON_RECT_MIN_MAX_INC;
209                fixed: 1 0;
210                rel1 {
211                   relative: 1.0 1.0;
212                   to: "padding_left_top";
213                }
214                rel2 {
215                   relative: 1.0 0.0;
216                   to_x: "padding_left_top";
217                   to_y: "padding_right_bottom";
218                }
219                align: 0.0 0.5;
220             }
221             description { state: "icononly" 0.0;
222                inherit: "default" 0.0;
223             }
224          }
225          part { name: "padding_after_icon";
226             type: RECT;
227             scale: 1;
228             mouse_events: 0;
229             description { state: "default" 0.0; //when only icon or no icon is there
230                align: 0.0 0.0;
231                rel1 {
232                   relative: 1.0 0.0;
233                   to: "icon_rect";
234                }
235                rel2.to: "icon_rect";
236                fixed: 1 0;
237                min: 0 0;
238                visible: 0;
239             }
240             description { state: "visible" 0.0;
241                visible: 0;
242                align: 0.0 0.0;
243                rel1 {
244                   relative: 1.0 0.0;
245                   to: "icon_rect";
246                }
247                rel2.to: "icon_rect";
248                fixed: 1 0;
249                min: BUTTON_TEXT_STYLE1_VISIBLE_PADDING_ICON_TEXT_MIN_INC;
250             }
251             description { state: "icononly" 0.0;
252                inherit: "default" 0.0;
253             }
254          }
255          part { name: "padding_before_text";
256             type: RECT;
257             scale: 1;
258             mouse_events: 0;
259             description { state: "default" 0.0; //when only icon or no icon is there
260                align: 1.0 0.5;
261                rel1 {
262                   relative: 0.0 1.0;
263                   to_x: "elm.text";
264                   to_y: "padding_left_top";
265                }
266                rel2 {
267                   relative: 0.0 0.0;
268                   to_x: "elm.text";
269                   to_y: "padding_right_bottom";
270                }
271                fixed: 1 0;
272                min: BUTTON_TEXT_STYLE1_VISIBLE_PADDING_ICON_TEXT_MIN_INC;
273                visible: 0;
274             }
275          }
276          part { name: "elm.swallow.content";
277             type: SWALLOW;
278             scale: 1;
279             clip_to: "clipper";
280             description { state: "default" 0.0;
281                visible: 0;
282                align: 0.0 0.5;
283                rel1 {
284                   relative: 1.0 1.0;
285                   to: "padding_left_top";
286                }
287                rel2 {
288                   relative: 1.0 0.0;
289                   to_x: "padding_left_top";
290                   to_y: "padding_right_bottom";
291                }
292                fixed: 1 0;
293             }
294             description { state: "visible" 0.0;
295                fixed: 1 0;
296                min: BUTTON_TEXT_STYLE1_VISIBLE_ICON_MIN_MAX_INC;
297                max: BUTTON_TEXT_STYLE1_VISIBLE_ICON_MIN_MAX_INC;
298                align: 1.0 0.5;
299                rel1 {
300                   relative: 0.0 1.0;
301                   to_x: "padding_before_text";
302                   to_y: "padding_left_top";
303                }
304                rel2 {
305                   relative: 0.0 0.0;
306                   to_x: "padding_before_text";
307                   to_y: "padding_right_bottom";
308                }
309             }
310             description { state: "icononly" 0.0;
311                min: BUTTON_TEXT_STYLE1_ICONONLY_ICON_MIN_MAX_INC;
312                max: BUTTON_TEXT_STYLE1_ICONONLY_ICON_MIN_MAX_INC;
313             }
314          }
315          part { name: "elm.text";
316             type: TEXT;
317             mouse_events: 0;
318             scale: 1;
319             clip_to: "clipper";
320             description { state: "default" 0.0;
321                visible: 0;
322                rel1 {
323                   relative: 1.0 1.0;
324                   to_x: "padding_after_icon";
325                   to_y: "padding_left_top";
326                }
327                rel2 {
328                   relative: 0.0 0.0;
329                   to: "padding_right_bottom";
330                }
331                color: BUTTON_TEXT_STYLE1_NORMAL_COLOR_INC;
332                text {
333                   font: "HelveticaNeue:style=Medium";
334                   size: BUTTON_TEXT_STYLE1_FONT_SIZE_INC;
335                   min: 0 0;
336                   max: 1 0;
337                }
338             }
339             description { state: "visible" 0.0;
340                inherit: "default" 0.0;
341                visible: 1;
342             }
343             description { state: "clicked" 0.0;
344                inherit: "default" 0.0;
345                visible: 1;
346                color: BUTTON_TEXT_STYLE1_PRESSED_COLOR_INC;
347             }
348             description { state: "disabled" 0.0;
349                inherit: "default" 0.0;
350                color: 0 0 0 128;
351             }
352             description { state: "disabled_visible" 0.0;
353                inherit: "default" 0.0;
354                color: BUTTON_TEXT_STYLE1_DISABLED_COLOR_INC;
355                visible: 1;
356             }
357             description { state: "focused" 0.0;
358                inherit: "default" 0.0;
359                visible: 1;
360                color: BUTTON_TEXT_STYLE1_FOCUSED_COLOR_INC;
361             }
362          }
363          part { name: "over2";
364             type: RECT;
365             repeat_events: 1;
366             ignore_flags: ON_HOLD;
367             description { state: "default" 0.0;
368                color: 0 0 0 0;
369             }
370          }
371          part { name: "over3";
372             type: RECT;
373             repeat_events: 1;
374             description { state: "default" 0.0;
375                color: 0 0 0 0;
376             }
377          }
378          part { name: "clipper";
379             type: RECT;
380             description { state: "default" 0.0;
381                color: 255 255 255 255;
382             }
383          }
384          part { name: "disabler";
385             type: RECT;
386             description { state: "default" 0.0;
387                color: 0 0 0 0;
388                visible: 0;
389             }
390             description { state: "disabled" 0.0;
391                inherit: "default" 0.0;
392                visible: 1;
393             }
394          }
395       }
396       programs {
397          program { name: "button_click";
398             signal: "mouse,down,1";
399             source: "over2";
400             action: SIGNAL_EMIT "elm,action,press" "";
401             after: "button_click_anim";
402          }
403          program { name: "button_click_anim";
404             action: STATE_SET "clicked" 0.0;
405             target: "button_image";
406             after: "text_clicked";
407          }
408          program { name: "text_clicked";
409             script {
410                new st[31];
411                new Float:vl;
412                get_state(PART:"elm.text", st, 30, vl);
413                if (!strcmp(st, "visible"))
414                  set_state(PART:"elm.text", "clicked", 0.0);
415             }
416          }
417          program { name: "button_unpress";
418             action: SIGNAL_EMIT "elm,action,unpress" "";
419          }
420          program { name: "button_mouseout_clicked";
421             signal: "mouse,up,1";
422             source: "over3";
423             script {
424                new st[31];
425                new Float:vl;
426                get_state(PART:"elm.swallow.content", st, 30, vl);
427                if (strcmp(st, "icononly"))
428                  {
429                     emit("elm,action,default,text,set", "");
430                     set_state(PART:"elm.text", "visible", 0.0);
431                  }
432                if (get_int(button_state) != BUTTON_STATE_DISABLED)
433                  set_state(PART:"button_image", "default", 0.0);
434             }
435             after: button_unpress;
436          }
437          program { name: "button_unclick3";
438             signal: "mouse,clicked,1";
439             source: "over2";
440             action: SIGNAL_EMIT "elm,action,click" "";
441          }
442          program { name: "text_show";
443             signal: "elm,state,text,visible";
444             source: "elm";
445             script {
446                new st[31];
447                new Float:vl;
448                get_state(PART:"elm.swallow.content", st, 30, vl);
449                if (!strcmp(st, "icononly"))
450                  {
451                     set_state(PART:"elm.swallow.content", "visible", 0.0);
452                     set_state(PART:"icon_rect", "visible", 0.0);
453                     set_state(PART:"padding_after_icon", "visible", 0.0);
454                     set_state(PART:"bg", "visible", 0.0);
455                  }
456                if (get_int(button_state) != BUTTON_STATE_DISABLED)
457                  set_state(PART:"elm.text", "visible", 0.0);
458                else
459                  set_state(PART:"elm.text", "disabled_visible", 0.0);
460             }
461          }
462          program { name: "text_hide";
463             signal: "elm,state,text,hidden";
464             source: "elm";
465             script {
466                new st[31];
467                new Float:vl;
468                get_state(PART:"elm.swallow.content", st, 30, vl);
469                if (!strcmp(st, "visible"))
470                  {
471                     set_state(PART:"elm.swallow.content", "icononly", 0.0);
472                     set_state(PART:"icon_rect", "icononly", 0.0);
473                     set_state(PART:"padding_after_icon", "icononly", 0.0);
474                     set_state(PART:"bg", "icononly", 0.0);
475                  }
476                set_state(PART:"elm.text", "default", 0.0);
477             }
478          }
479          program { name: "icon_show";
480             signal: "elm,state,icon,visible";
481             source: "elm";
482             script {
483                new st[31];
484                new Float:vl;
485                get_state(PART:"elm.text", st, 30, vl);
486                if (!strcmp(st, "visible"))
487                  {
488                     set_state(PART:"elm.swallow.content", "visible", 0.0);
489                     set_state(PART:"icon_rect", "visible", 0.0);
490                     set_state(PART:"padding_after_icon", "visible", 0.0);
491                     set_state(PART:"bg", "visible", 0.0);
492                  }
493                else
494                  {
495                     set_state(PART:"elm.swallow.content", "icononly", 0.0);
496                     set_state(PART:"icon_rect", "icononly", 0.0);
497                     set_state(PART:"padding_after_icon", "icononly", 0.0);
498                     set_state(PART:"bg", "icononly", 0.0);
499                  }
500             }
501          }
502          program { name: "icon_hide";
503             signal: "elm,state,icon,hidden";
504             source: "elm";
505             action: STATE_SET "default" 0.0;
506             target: "elm.swallow.content";
507             target: "padding_after_icon";
508             target: "icon_rect";
509             target: "bg";
510          }
511          program { name: "disable";
512             signal: "elm,state,disabled";
513             source: "elm";
514             action: STATE_SET "disabled" 0.0;
515             target: "button_image";
516             target: "disabler";
517             after: "disable_text";
518          }
519          program { name: "disable_text";
520             script {
521                new st[31];
522                new Float:vl;
523                get_state(PART:"elm.text", st, 30, vl);
524                if (!strcmp(st, "visible"))
525                  set_state(PART:"elm.text", "disabled_visible", 0.0);
526                else
527                  set_state(PART:"elm.text", "disabled", 0.0);
528                set_int(button_state, BUTTON_STATE_DISABLED);
529             }
530          }
531          program { name: "enable";
532             signal: "elm,state,enabled";
533             source: "elm";
534             action: STATE_SET "default" 0.0;
535             target: "button_image";
536             target: "disabler";
537             after: "enable_text";
538          }
539          program { name: "enable_text";
540             script {
541                new st[31];
542                new Float:vl;
543                get_state(PART:"elm.text", st, 30, vl);
544                if (!strcmp(st, "disabled_visible"))
545                  set_state(PART:"elm.text", "visible", 0.0);
546                else
547                  set_state(PART:"elm.text", "default", 0.0);
548                set_int(button_state, BUTTON_STATE_ENABLED);
549             }
550          }
551          program { name: "focused";
552             //signal: "elm,action,focus";
553             //source: "elm";
554             action: STATE_SET "focused" 0.0;
555             target: "button_image";
556             target: "elm.text";
557          }
558          program { name: "unfocused";
559             //signal: "elm,action,unfocus";
560             //source: "elm";
561             action: STATE_SET "default" 0.0;
562             target: "button_image";
563             after: "unfocus_text";
564          }
565          program { name: "unfocus_text";
566             action: STATE_SET "visible" 0.0;
567             target: "elm.text";
568          }
569       }
570    }
571
572 ///////////////////////////////////////////////////////////////////////////////////////
573    group { name: "elm/button/base/sweep/gallery";
574       alias: "elm/button/base/sweep";
575       alias: "elm/button/base/text_only/sweep";
576       alias: "elm/button/base/searchbar/default";
577       images {
578          image: GALLERY_EDC_IMAGE_BTN_SWEEP COMP;
579          image: GALLERY_EDC_IMAGE_BTN_SWEEP_PRESS COMP;//focus image is missing, so using press
580          image: GALLERY_EDC_IMAGE_BTN_SWEEP_DIM COMP;
581       }
582       script {
583          public button_state = BUTTON_STATE_ENABLED;
584       }
585       parts {
586          part { name: "button_image";
587             scale: 1;
588             description { state: "default" 0.0;
589                min: BUTTON_SWEEP_BG_NORMAL_MIN_INC;
590                image {
591                   normal: GALLERY_EDC_IMAGE_BTN_SWEEP;
592                   border: BUTTON_SWEEP_BG_BORDER_INC;
593                   border_scale: 1;
594                }
595             }
596             description { state: "clicked" 0.0;
597                inherit: "default" 0.0;
598                image.normal: GALLERY_EDC_IMAGE_BTN_SWEEP_PRESS;
599             }
600             description { state: "disabled" 0.0;
601                inherit: "default" 0.0;
602                image.normal: GALLERY_EDC_IMAGE_BTN_SWEEP_DIM;
603             }
604             description { state: "focused" 0.0;
605                inherit: "default" 0.0;
606                image.normal: GALLERY_EDC_IMAGE_BTN_SWEEP_PRESS;
607             }
608          }
609          part { name: "padding_left_top";
610             type: RECT;
611             scale: 1;
612             mouse_events: 0;
613             description { state: "default" 0.0;
614                align: 0.0 0.0;
615                rel2.relative: 0.0 0.0;
616                min: BUTTON_SWEEP_PADDING_MIN_INC;
617                fixed: 1 1;
618                visible: 0;
619             }
620          }
621          part { name: "padding_right_bottom";
622             type: RECT;
623             scale: 1;
624             mouse_events: 0;
625             description { state: "default" 0.0;
626                align: 1.0 1.0;
627                rel1.relative: 1.0 1.0;
628                min: BUTTON_SWEEP_PADDING_MIN_INC;
629                fixed: 1 1;
630                visible: 0;
631             }
632          }
633          part { name: "icon_rect";
634             type: RECT;
635             scale: 1;
636             mouse_events: 0;
637             description { state: "default" 0.0;
638                min: BUTTON_SWEEP_ICON_RECT_MIN_INC;
639                fixed: 1 0;
640                rel1 {
641                   relative: 0.0 1.0;
642                   to_x: "elm.swallow.content";
643                   to_y: "padding_left_top";
644                }
645                rel2 {
646                   relative: 1.0 0.0;
647                   to_x: "elm.swallow.content";
648                   to_y: "padding_right_bottom";
649                }
650                align: 0.0 0.5;
651                color: 0 0 0 0;
652             }
653          }
654          part { name: "padding_icon_text";
655             type: RECT;
656             scale: 1;
657             mouse_events: 0;
658             description { state: "default" 0.0; //when only icon or no icon is there
659                align: 0.0 0.0;
660                rel1 {
661                   relative: 1.0 0.0;
662                   to: "icon_rect";
663                }
664                rel2.to: "icon_rect";
665                fixed: 1 0;
666                min: 0 0;
667                color: 0 0 0 0;
668             }
669             description { state: "icononly" 0.0;
670                inherit: "default" 0.0;
671             }
672             description { state: "visible" 0.0; //when icon is visible
673                align: 0.0 0.0;
674                rel1 {
675                   relative: 1.0 0.0;
676                   to: "icon_rect";
677                }
678                rel2.to: "icon_rect";
679                fixed: 1 0;
680                min: BUTTON_SWEEP_PADDING_ICON_TEXT_VISIBLE_MIN_INC;
681                color: 0 0 0 0;
682             }
683          }
684          part { name: "elm.swallow.content";
685             type: SWALLOW;
686             scale: 1;
687             clip_to: "clipper";
688             description { state: "default" 0.0;
689                visible: 0;
690                align: 0.0 0.5;
691                rel1 {
692                   relative: 1.0 1.0;
693                   to: "padding_left_top";
694                }
695                rel2 {
696                   relative: 1.0 0.0;
697                   to_x: "padding_left_top";
698                   to_y: "padding_right_bottom";
699                }
700                fixed: 1 0;
701             }
702             description { state: "visible" 0.0;
703                fixed: 1 0;
704                align: 0.0 0.5;
705                rel1 {
706                   relative: 1.0 1.0;
707                   to: "padding_left_top";
708                }
709                rel2 {
710                   relative: 1.0 0.0;
711                   to_x: "padding_left_top";
712                   to_y: "padding_right_bottom";
713                }
714                aspect: 1.0 1.0;
715                aspect_preference: VERTICAL;
716             }
717             description { state: "icononly" 0.0;
718                min: BUTTON_SWEEP_ICONONLY_ICON_MIN_INC;
719                rel1 {
720                   relative: 1.0 1.0;
721                   to: "padding_left_top";
722                }
723                rel2 {
724                   relative: 1.0 0.0;
725                   to_x: "padding_left_top";
726                   to_y: "padding_right_bottom";
727                }
728             }
729          }
730          part { name: "elm.text";
731             type: TEXT;
732             mouse_events: 0;
733             scale: 1;
734             clip_to: "clipper";
735             description { state: "default" 0.0;
736                visible: 0;
737                rel1 {
738                   relative: 1.0 1.0;
739                   to_x: "padding_icon_text";
740                   to_y: "padding_left_top";
741                }
742                rel2 {
743                   relative: 0.0 0.0;
744                   to: "padding_right_bottom";
745                }
746                color: BUTTON_SWEEP_BUTTON_TEXT_NORMAL_COLOR_INC;
747                text {
748                   font: "HelveticaNeue:style=Medium";
749                   size: BUTTON_SWEEP_FONT_SIZE_INC;
750                   min: 0 0;
751                }
752             }
753             description { state: "visible" 0.0;
754                inherit: "default" 0.0;
755                visible: 1;
756                min: BUTTON_SWEEP_TEXT_MIN_INC;
757             }
758             description { state: "clicked" 0.0;
759                inherit: "default" 0.0;
760                visible: 1;
761                min: 0 0;
762                color: BUTTON_SWEEP_BUTTON_TEXT_PRESSED_COLOR_INC;
763             }
764             description { state: "disabled" 0.0;
765                inherit: "default" 0.0;
766                color: 0 0 0 128;
767             }
768             description { state: "disabled_visible" 0.0;
769                inherit: "default" 0.0;
770                color: BUTTON_SWEEP_BUTTON_TEXT_DISABLED_COLOR_INC;
771                visible: 1;
772                min: BUTTON_SWEEP_TEXT_MIN_INC;
773             }
774             description { state: "focused" 0.0;
775                inherit: "default" 0.0;
776                visible: 1;
777                min: 0 0;
778                color: BUTTON_SWEEP_BUTTON_TEXT_FOCUSED_COLOR_INC;
779             }
780          }
781          part { name: "over2";
782             type: RECT;
783             repeat_events: 1;
784             ignore_flags: ON_HOLD;
785             description { state: "default" 0.0;
786                color: 0 0 0 0;
787             }
788          }
789          part { name: "over3";
790             type: RECT;
791             repeat_events: 1;
792             description { state: "default" 0.0;
793                color: 0 0 0 0;
794             }
795          }
796          part { name: "clipper";
797             type: RECT;
798             description { state: "default" 0.0;
799                color: 255 255 255 255;
800             }
801          }
802          part { name: "disabler";
803             type: RECT;
804             description { state: "default" 0.0;
805                color: 0 0 0 0;
806                visible: 0;
807             }
808             description { state: "disabled" 0.0;
809                inherit: "default" 0.0;
810                visible: 1;
811             }
812          }
813       }
814       programs {
815          program { name: "button_click";
816             signal: "mouse,down,1";
817             source: "over2";
818             action: SIGNAL_EMIT "elm,action,press" "";
819             after: "button_click_anim";
820          }
821          program { name: "button_click_anim";
822             action: STATE_SET "clicked" 0.0;
823             target: "button_image";
824             after: "text_clicked";
825          }
826          program { name: "text_clicked";
827             script {
828                new st[31];
829                new Float:vl;
830                get_state(PART:"elm.text", st, 30, vl);
831                if (!strcmp(st, "visible"))
832                  set_state(PART:"elm.text", "clicked", 0.0);
833             }
834          }
835          program { name: "button_unpress";
836             action: SIGNAL_EMIT "elm,action,unpress" "";
837          }
838          program { name: "button_mouseout_clicked";
839             signal: "mouse,up,1";
840             source: "over3";
841             script {
842                new st[31];
843                new Float:vl;
844                get_state(PART:"elm.swallow.content", st, 30, vl);
845                if (strcmp(st, "icononly"))
846                  {
847                     emit("elm,action,default,text,set", "");
848                     set_state(PART:"elm.text", "visible", 0.0);
849                  }
850                if (get_int(button_state) != BUTTON_STATE_DISABLED)
851                  set_state(PART:"button_image", "default", 0.0);
852             }
853             after: button_unpress;
854          }
855          program { name: "button_unclick3";
856             signal: "mouse,clicked,1";
857             source: "over2";
858             action: SIGNAL_EMIT "elm,action,click" "";
859          }
860          program { name: "text_show";
861             signal: "elm,state,text,visible";
862             source: "elm";
863             script {
864                new st[31];
865                new Float:vl;
866                get_state(PART:"elm.swallow.content", st, 30, vl);
867                if (!strcmp(st, "icononly"))
868                  {
869                     set_state(PART:"elm.swallow.content", "visible", 0.0);
870                     set_state(PART:"padding_icon_text", "visible", 0.0);
871                  }
872                if (get_int(button_state) != BUTTON_STATE_DISABLED)
873                  set_state(PART:"elm.text", "visible", 0.0);
874                else
875                  set_state(PART:"elm.text", "disabled_visible", 0.0);
876             }
877          }
878          program { name: "text_hide";
879             signal: "elm,state,text,hidden";
880             source: "elm";
881             script {
882                new st[31];
883                new Float:vl;
884                get_state(PART:"elm.swallow.content", st, 30, vl);
885                if (!strcmp(st, "visible"))
886                  {
887                     set_state(PART:"elm.swallow.content", "icononly", 0.0);
888                     set_state(PART:"padding_icon_text", "icononly", 0.0);
889                  }
890                set_state(PART:"elm.text", "default", 0.0);
891             }
892          }
893          program { name: "icon_show";
894             signal: "elm,state,icon,visible";
895             source: "elm";
896             script {
897                new st[31];
898                new Float:vl;
899                get_state(PART:"elm.text", st, 30, vl);
900                if (!strcmp(st, "visible"))
901                  {
902                     set_state(PART:"elm.swallow.content", "visible", 0.0);
903                     set_state(PART:"padding_icon_text", "visible", 0.0);
904                  }
905                else
906                  {
907                     set_state(PART:"elm.swallow.content", "icononly", 0.0);
908                     set_state(PART:"padding_icon_text", "icononly", 0.0);
909                  }
910             }
911          }
912          program { name: "icon_hide";
913             signal: "elm,state,icon,hidden";
914             source: "elm";
915             action: STATE_SET "default" 0.0;
916             target: "elm.swallow.content";
917             target: "padding_icon_text";
918          }
919          program { name: "disable";
920             signal: "elm,state,disabled";
921             source: "elm";
922             action: STATE_SET "disabled" 0.0;
923             target: "button_image";
924             target: "disabler";
925             after: "disable_text";
926          }
927          program { name: "disable_text";
928             script {
929                new st[31];
930                new Float:vl;
931                get_state(PART:"elm.text", st, 30, vl);
932                if (!strcmp(st, "visible"))
933                  set_state(PART:"elm.text", "disabled_visible", 0.0);
934                else
935                  set_state(PART:"elm.text", "disabled", 0.0);
936                set_int(button_state, BUTTON_STATE_DISABLED);
937             }
938          }
939          program { name: "enable";
940             signal: "elm,state,enabled";
941             source: "elm";
942             action: STATE_SET "default" 0.0;
943             target: "button_image";
944             target: "disabler";
945             after: "enable_text";
946          }
947          program { name: "enable_text";
948             script {
949                new st[31];
950                new Float:vl;
951                get_state(PART:"elm.text", st, 30, vl);
952                if (!strcmp(st, "disabled_visible"))
953                  set_state(PART:"elm.text", "visible", 0.0);
954                else
955                  set_state(PART:"elm.text", "default", 0.0);
956                set_int(button_state, BUTTON_STATE_ENABLED);
957             }
958          }
959          program { name: "focused";
960             //signal: "elm,action,focus";
961             //source: "elm";
962             action: STATE_SET "focused" 0.0;
963             target: "button_image";
964             target: "elm.text";
965          }
966          program { name: "unfocused";
967             //signal: "elm,action,unfocus";
968             //source: "elm";
969             action: STATE_SET "default" 0.0;
970             target: "button_image";
971             after: "unfocus_text";
972          }
973          program { name: "unfocus_text";
974             action: STATE_SET "visible" 0.0;
975             target: "elm.text";
976          }
977       }
978    }
979
980 ///////////////////////////////////////////////////////////////////////////////////////
981    group { name: "elm/button/base/popup_button/default";
982       alias: "elm/button/base/popup_button/gallery/menustyle";
983       alias: "elm/button/base/popup_button/gallery/default";
984       images {
985          image: GALLERY_EDC_IMAGE_BUTTON_POPUP_NORMAL COMP;
986          image: GALLERY_EDC_IMAGE_BUTTON_POPUP_PRESS COMP;
987          image: GALLERY_EDC_IMAGE_BUTTON_POPUP_FOCUS COMP;
988          image: GALLERY_EDC_IMAGE_BUTTON_POPUP_DIM COMP;
989       }
990       script {
991          public button_state = BUTTON_STATE_ENABLED;
992       }
993       parts {
994          part { name: "button_image";
995             scale: 1;
996             description { state: "default" 0.0;
997                min: BUTTON_POPUP_BG_NORMAL_MIN_INC;
998                image {
999                   normal: GALLERY_EDC_IMAGE_BUTTON_POPUP_NORMAL;
1000                   border: BUTTON_POPUP_BG_BORDER_INC;
1001                   border_scale: 1;
1002                }
1003             }
1004             description { state: "clicked" 0.0;
1005                inherit: "default" 0.0;
1006                image {
1007                   normal: GALLERY_EDC_IMAGE_BUTTON_POPUP_PRESS;
1008                }
1009             }
1010             description { state: "disabled" 0.0;
1011                inherit:  "default" 0.0;
1012                image.normal: GALLERY_EDC_IMAGE_BUTTON_POPUP_DIM;
1013             }
1014             description { state: "focused" 0.0;
1015                inherit: "default" 0.0;
1016                image.normal: GALLERY_EDC_IMAGE_BUTTON_POPUP_FOCUS;
1017             }
1018          }
1019          part { name: "padding_left_top";
1020             type: RECT;
1021             scale: 1;
1022             mouse_events: 0;
1023             description { state: "default" 0.0;
1024                align: 0.0 0.0;
1025                rel2 {
1026                   relative: 0.0 0.0;
1027                }
1028                min: BUTTON_POPUP_PADDING_MIN_INC;
1029                fixed: 1 1;
1030                visible: 0;
1031             }
1032          }
1033          part { name: "padding_right_bottom";
1034             type: RECT;
1035             scale: 1;
1036             description { state: "default" 0.0;
1037                align: 1.0 0.0;
1038                rel1 {
1039                   relative: 1.0 1.0;
1040                }
1041                min: BUTTON_POPUP_PADDING_MIN_INC;
1042                fixed: 1 1;
1043                visible: 0;
1044             }
1045          }
1046          part { name: "padding_icon_text";
1047             type: RECT;
1048             scale: 1;
1049             description { state: "default" 0.0; //when only icon or no icon is there
1050                align: 0.0 0.0;
1051                rel1 {
1052                   relative: 1.0 0.0;
1053                   to: "elm.swallow.content";
1054                }
1055                rel2 {
1056                   to: "elm.swallow.content";
1057                }
1058                fixed: 1 0;
1059                min: 0 0;
1060                visible: 0;
1061             }
1062             description { state: "icononly" 0.0;
1063                inherit: "default" 0.0;
1064             }
1065             description { state: "visible" 0.0; //when icon is visible
1066                inherit: "default" 0.0;
1067                min: BUTTON_POPUP_PADDING_ICON_TEXT_VISIBLE_MIN_INC;
1068             }
1069          }
1070          part { name: "elm.swallow.content";
1071             type: SWALLOW;
1072             scale: 1;
1073             clip_to: "clipper";
1074             description { state: "default" 0.0;
1075                visible: 0;
1076                align: 0.0 0.5;
1077                rel1 {
1078                   relative: 1.0 1.0;
1079                   to: "padding_left_top";
1080                }
1081                rel2 {
1082                   relative: 1.0 0.0;
1083                   to_x: "padding_left_top";
1084                   to_y: "padding_right_bottom";
1085                }
1086                fixed: 1 0;
1087             }
1088             description { state: "visible" 0.0;
1089                inherit: "default" 0.0;
1090                fixed: 1 0;
1091                visible: 1;
1092                aspect: 1.0 1.0;
1093                aspect_preference: VERTICAL;
1094             }
1095             description { state: "icononly" 0.0;
1096                visible: 1;
1097                min: BUTTON_POPUP_ICON_ICONONLY_MIN_INC;
1098                rel1 {
1099                   relative: 1.0 1.0;
1100                   to: "padding_left_top";
1101                }
1102                rel2 {
1103                   relative: 1.0 0.0;
1104                   to_x: "padding_left_top";
1105                   to_y: "padding_right_bottom";
1106                }
1107             }
1108          }
1109          part { name: "elm.text";
1110             type: TEXT;
1111             mouse_events: 0;
1112             scale: 1;
1113             clip_to: "clipper";
1114             description { state: "default" 0.0;
1115                visible: 0;
1116                rel1 {
1117                   relative: 1.0 1.0;
1118                   to_x: "padding_icon_text";
1119                   to_y: "padding_left_top";
1120                }
1121                rel2 {
1122                   relative: 0.0 0.0;
1123                   to: "padding_right_bottom";
1124                }
1125                color: BUTTON_POPUP_BUTTON_TEXT_NORMAL_COLOR_INC;
1126                text {
1127                   font: "Helvetica Neue:style=Medium";
1128                   size: BUTTON_POPUP_TEXT_FONT_SIZE_INC;
1129                   min: 0 0;
1130                }
1131             }
1132             description { state: "visible" 0.0;
1133                inherit: "default" 0.0;
1134                visible: 1;
1135                min: BUTTON_POPUP_TEXT_MIN_INC;
1136             }
1137             description { state: "clicked" 0.0;
1138                inherit: "default" 0.0;
1139                visible: 1;
1140                min: 0 0;
1141                color: BUTTON_POPUP_BUTTON_TEXT_PRESSED_COLOR_INC;
1142             }
1143             description { state: "disabled" 0.0;
1144                inherit: "default" 0.0;
1145                color: 0 0 0 128;
1146             }
1147             description { state: "disabled_visible" 0.0;
1148                inherit: "default" 0.0;
1149                color: BUTTON_POPUP_BUTTON_TEXT_DISABLED_COLOR_INC;
1150                visible: 1;
1151                min: BUTTON_POPUP_TEXT_MIN_INC;
1152             }
1153             description { state: "focused" 0.0;
1154                inherit: "default" 0.0;
1155                visible: 1;
1156                min: 0 0;
1157                color: BUTTON_POPUP_BUTTON_TEXT_FOCUSED_COLOR_INC;
1158             }
1159          }
1160          part { name: "over2";
1161             type: RECT;
1162             repeat_events: 1;
1163             ignore_flags: ON_HOLD;
1164             description { state: "default" 0.0;
1165                color: 0 0 0 0;
1166             }
1167          }
1168          part { name: "over3";
1169             type: RECT;
1170             repeat_events: 1;
1171             description { state: "default" 0.0;
1172                color: 0 0 0 0;
1173             }
1174          }
1175          part { name: "clipper";
1176             type: RECT;
1177             description { state: "default" 0.0;
1178                color: 255 255 255 255;
1179             }
1180          }
1181          part { name: "disabler";
1182             type: RECT;
1183             description { state: "default" 0.0;
1184                color: 0 0 0 0;
1185                visible: 0;
1186             }
1187             description { state: "disabled" 0.0;
1188                inherit: "default" 0.0;
1189                visible: 1;
1190             }
1191          }
1192       }
1193       programs {
1194          program { name: "button_click";
1195             signal: "mouse,down,1";
1196             source: "over2";
1197             action: SIGNAL_EMIT "elm,action,press" "";
1198             after: "button_click_anim";
1199          }
1200          program { name: "button_click_anim";
1201             action: STATE_SET "clicked" 0.0;
1202             target: "button_image";
1203             after: "text_clicked";
1204          }
1205          program { name: "text_clicked";
1206             script {
1207                new st[31];
1208                new Float:vl;
1209                get_state(PART:"elm.text", st, 30, vl);
1210                if (!strcmp(st, "visible"))
1211                  set_state(PART:"elm.text", "clicked", 0.0);
1212             }
1213          }
1214          program { name: "button_unpress";
1215             action: SIGNAL_EMIT "elm,action,unpress" "";
1216          }
1217          program { name: "button_mouseout_clicked";
1218             signal: "mouse,up,1";
1219             source: "over3";
1220             script {
1221                new st[31];
1222                new Float:vl;
1223                get_state(PART:"elm.swallow.content", st, 30, vl);
1224                if (strcmp(st, "icononly"))
1225                  {
1226                     emit("elm,action,default,text,set", "");
1227                     set_state(PART:"elm.text", "visible", 0.0);
1228                  }
1229                if (get_int(button_state) != BUTTON_STATE_DISABLED)
1230                  set_state(PART:"button_image", "default", 0.0);
1231             }
1232             after: button_unpress;
1233          }
1234          program { name: "button_unclick3";
1235             signal: "mouse,clicked,1";
1236             source: "over2";
1237             action: SIGNAL_EMIT "elm,action,click" "";
1238          }
1239          program { name: "text_show";
1240             signal: "elm,state,text,visible";
1241             source: "elm";
1242             script {
1243                new st[31];
1244                new Float:vl;
1245                get_state(PART:"elm.swallow.content", st, 30, vl);
1246                if (!strcmp(st, "icononly"))
1247                  {
1248                     set_state(PART:"elm.swallow.content", "visible", 0.0);
1249                     set_state(PART:"padding_icon_text", "visible", 0.0);
1250                  }
1251                if (get_int(button_state) != BUTTON_STATE_DISABLED)
1252                  set_state(PART:"elm.text", "visible", 0.0);
1253                else
1254                  set_state(PART:"elm.text", "disabled_visible", 0.0);
1255             }
1256          }
1257          program { name: "text_hide";
1258             signal: "elm,state,text,hidden";
1259             source: "elm";
1260             script {
1261                new st[31];
1262                new Float:vl;
1263                get_state(PART:"elm.swallow.content", st, 30, vl);
1264                if (!strcmp(st, "visible"))
1265                  {
1266                     set_state(PART:"elm.swallow.content", "icononly", 0.0);
1267                     set_state(PART:"padding_icon_text", "icononly", 0.0);
1268                  }
1269                set_state(PART:"elm.text", "default", 0.0);
1270             }
1271          }
1272          program { name: "icon_show";
1273             signal: "elm,state,icon,visible";
1274             source: "elm";
1275             script {
1276                new st[31];
1277                new Float:vl;
1278                get_state(PART:"elm.text", st, 30, vl);
1279                if (!strcmp(st, "visible"))
1280                  {
1281                     set_state(PART:"elm.swallow.content", "visible", 0.0);
1282                     set_state(PART:"padding_icon_text", "visible", 0.0);
1283                  }
1284                else
1285                  {
1286                     set_state(PART:"elm.swallow.content", "icononly", 0.0);
1287                     set_state(PART:"padding_icon_text", "icononly", 0.0);
1288                  }
1289             }
1290          }
1291          program { name: "icon_hide";
1292             signal: "elm,state,icon,hidden";
1293             source: "elm";
1294             action: STATE_SET "default" 0.0;
1295             target: "elm.swallow.content";
1296             target: "padding_icon_text";
1297          }
1298          program { name: "disable";
1299             signal: "elm,state,disabled";
1300             source: "elm";
1301             action: STATE_SET "disabled" 0.0;
1302             target: "button_image";
1303             target: "disabler";
1304             after: "disable_text";
1305          }
1306          program { name: "disable_text";
1307             script {
1308                new st[31];
1309                new Float:vl;
1310                get_state(PART:"elm.text", st, 30, vl);
1311                if (!strcmp(st, "visible"))
1312                  set_state(PART:"elm.text", "disabled_visible", 0.0);
1313                else
1314                  set_state(PART:"elm.text", "disabled", 0.0);
1315                set_int(button_state, BUTTON_STATE_DISABLED);
1316             }
1317          }
1318          program { name: "enable";
1319             signal: "elm,state,enabled";
1320             source: "elm";
1321             action: STATE_SET "default" 0.0;
1322             target: "button_image";
1323             target: "disabler";
1324             after: "enable_text";
1325          }
1326          program { name: "enable_text";
1327             script {
1328                new st[31];
1329                new Float:vl;
1330                get_state(PART:"elm.text", st, 30, vl);
1331                if (!strcmp(st, "disabled_visible"))
1332                  set_state(PART:"elm.text", "visible", 0.0);
1333                else
1334                  set_state(PART:"elm.text", "default", 0.0);
1335                set_int(button_state, BUTTON_STATE_ENABLED);
1336             }
1337          }
1338          program { name: "focused";
1339             action: STATE_SET "focused" 0.0;
1340             target: "button_image";
1341             target: "elm.text";
1342          }
1343          program { name: "unfocused";
1344             action: STATE_SET "default" 0.0;
1345             target: "button_image";
1346             after: "unfocus_text";
1347          }
1348          program { name: "unfocus_text";
1349             action: STATE_SET "visible" 0.0;
1350             target: "elm.text";
1351          }
1352       }
1353    }
1354
1355 ///////////////////////////////////////////////////////////////////////////////////////
1356 #define BUTTON_CIRCLE_STYLES(style_name, image_normal, image_press, min_width, min_height) \
1357    group { name: "elm/button/base/"style_name; \
1358       images { \
1359          image: GALLERY_EDC_IMAGE_BTN_CIRCLE_BG_NORMAL COMP; \
1360          image: GALLERY_EDC_IMAGE_BTN_CIRCLE_BG_PRESS COMP; \
1361          image: image_normal COMP; \
1362          image: image_press COMP; \
1363       } \
1364       parts { \
1365          part { name: "button_image"; \
1366             scale: 1; \
1367             description { state: "default" 0.0; \
1368                min: BUTTON_CIRCLE_STYLE_BG_MIN_MAX_INC; \
1369                max: BUTTON_CIRCLE_STYLE_BG_MIN_MAX_INC; \
1370                image.normal: GALLERY_EDC_IMAGE_BTN_CIRCLE_BG_NORMAL; \
1371                color: 255 255 255 255; \
1372             } \
1373             description { \
1374                state: "clicked" 0.0; \
1375                inherit: "default" 0.0; \
1376                image.normal: GALLERY_EDC_IMAGE_BTN_CIRCLE_BG_PRESS; \
1377             } \
1378             description { \
1379                state: "disabled" 0.0; \
1380                inherit: "default" 0.0; \
1381                color: 255 255 255 128; \
1382             } \
1383          } \
1384          part { name: "button_center_part"; \
1385             scale: 1; \
1386             description { state: "default" 0.0; \
1387                min: BUTTON_CIRCLE_STYLE_IMAGE_MIN_MAX_INC; \
1388                max: BUTTON_CIRCLE_STYLE_IMAGE_MIN_MAX_INC; \
1389                image.normal: image_normal; \
1390                color: 255 255 255 255; \
1391             } \
1392             description { \
1393                state: "clicked" 0.0; \
1394                inherit: "default" 0.0; \
1395                image.normal: image_press; \
1396             } \
1397             description { \
1398                state: "disabled" 0.0; \
1399                inherit: "default" 0.0; \
1400                color: 255 255 255 128; \
1401             } \
1402          } \
1403          part { name: "over1"; \
1404             type: RECT; \
1405             ignore_flags: ON_HOLD; \
1406             description { state: "default" 0.0; \
1407                color: 0 0 0 0; \
1408                min: min_width min_height; \
1409             } \
1410          } \
1411          part { name: "over2"; \
1412             repeat_events: 1; \
1413             description { state: "default" 0.0; \
1414                color: 0 0 0 0; \
1415             } \
1416          } \
1417          part { name: "disabler"; \
1418             type: RECT; \
1419             description { state: "default" 0.0; \
1420                color: 0 0 0 0; \
1421                visible: 0; \
1422             } \
1423             description { state: "disabled" 0.0; \
1424                inherit: "default" 0.0; \
1425                visible: 1; \
1426             } \
1427          } \
1428       } \
1429       programs { \
1430          program { name: "button_click"; \
1431             signal: "mouse,down,1"; \
1432             source: "over1"; \
1433             action: SIGNAL_EMIT "elm,action,press" ""; \
1434             after: "button_click_anim"; \
1435          } \
1436          program { name: "button_click_anim"; \
1437             action: STATE_SET "clicked" 0.0; \
1438             target: "button_image"; \
1439             target: "button_center_part"; \
1440          } \
1441          program { name: "button_unclick"; \
1442             signal: "mouse,up,1"; \
1443             source: "over2"; \
1444             action: SIGNAL_EMIT "elm,action,unpress" ""; \
1445             after: "button_unclick_anim"; \
1446          } \
1447          program { name: "button_unclick_anim"; \
1448             action: STATE_SET "default" 0.0; \
1449             target: "button_image"; \
1450             target: "button_center_part"; \
1451          } \
1452          program { name: "button_unclick2"; \
1453             signal: "mouse,clicked,1"; \
1454             source: "over1"; \
1455             action: SIGNAL_EMIT "elm,action,click" ""; \
1456          } \
1457          program { name: "disable"; \
1458             signal: "elm,state,disabled"; \
1459             source: "elm"; \
1460             action: STATE_SET "disabled" 0.0; \
1461             target: "disabler"; \
1462             target: "button_image"; \
1463             target: "button_center_part"; \
1464          } \
1465          program { name: "enable"; \
1466             signal: "elm,state,enabled"; \
1467             source: "elm"; \
1468             action: STATE_SET "default" 0.0; \
1469             target: "disabler"; \
1470             target: "button_image"; \
1471             target: "button_center_part"; \
1472          } \
1473       } \
1474    }
1475
1476 ///////////////////////////////////////////////////////////////////////////////////////
1477    BUTTON_CIRCLE_STYLES("gallery/rename", GALLERY_EDC_IMAGE_BUTTON_RENAME, GALLERY_EDC_IMAGE_BUTTON_RENAME_PRESS, 40, 40)
1478
1479    group { name: "elm/button/base/multiline/gallery";
1480       alias: "elm/button/base/multiline";
1481       alias: "elm/button/base/text_only/multiline";
1482       images {
1483          image: GALLERY_EDC_IMAGE_BTN_04_NORMAL COMP;
1484          image: GALLERY_EDC_IMAGE_BTN_04_PRESS COMP;
1485 //         image: GALLERY_EDC_IMAGE_BTN_04_DIM COMP;
1486       }
1487       script {
1488          public button_state = BUTTON_STATE_ENABLED;
1489       }
1490       styles{
1491          style { name: "btn_multiline_style";
1492             base: "font=HelveticaNeue:style=Medium font_size=18 align=center color=#ffffff wrap=mixed";
1493             tag: "br" "\n";
1494             tag: "ps" "ps";
1495             tag: "tab" "\t";
1496          }
1497       }
1498       parts {
1499          part { name: "button_image";
1500             scale: 1;
1501             description { state: "default" 0.0;
1502                min: 10 46;
1503                image {
1504                   normal: GALLERY_EDC_IMAGE_BTN_04_NORMAL;
1505                   border: 4 4 3 3;
1506                   border_scale: 1;
1507                }
1508             }
1509             description { state: "clicked" 0.0;
1510                inherit: "default" 0.0;
1511                image.normal: GALLERY_EDC_IMAGE_BTN_04_PRESS;
1512             }
1513             description { state: "disabled" 0.0;
1514                inherit: "default" 0.0;
1515                //image.normal: GALLERY_EDC_IMAGE_BTN_04_DIM;
1516                image.normal: GALLERY_EDC_IMAGE_BTN_04_NORMAL;
1517             }
1518             description { state: "focused" 0.0;
1519                inherit: "default" 0.0;
1520                image.normal: GALLERY_EDC_IMAGE_BTN_04_PRESS;
1521             }
1522          }
1523          part { name: "padding_left_top";
1524             type: RECT;
1525             scale: 1;
1526             mouse_events: 0;
1527             description { state: "default" 0.0;
1528                align: 0.0 0.0;
1529                rel2.relative: 0.0 0.0;
1530                min: 2 2;
1531                fixed: 1 1;
1532                visible: 0;
1533             }
1534          }
1535          part { name: "padding_right_bottom";
1536             type: RECT;
1537             scale: 1;
1538             mouse_events: 0;
1539             description { state: "default" 0.0;
1540                align: 1.0 1.0;
1541                rel1.relative: 1.0 1.0;
1542                min: 2 2;
1543                fixed: 1 1;
1544                visible: 0;
1545             }
1546          }
1547          part { name: "icon_rect";
1548             type: RECT;
1549             scale: 1;
1550             mouse_events: 0;
1551             description { state: "default" 0.0;
1552                visible: 1;
1553                min: 0 40;
1554                fixed: 1 0;
1555                rel1 {
1556                   relative: 0.0 1.0;
1557                   to_x: "elm.swallow.content";
1558                   to_y: "padding_left_top";
1559                }
1560                rel2 {
1561                   relative: 1.0 0.0;
1562                   to_x: "elm.swallow.content";
1563                   to_y: "padding_right_bottom";
1564                }
1565                align: 0.0 0.5;
1566                color: 0 0 0 0;
1567             }
1568          }
1569          part { name: "padding_icon_text";
1570             type: RECT;
1571             scale: 1;
1572             mouse_events: 0;
1573             description { state: "default" 0.0; //when only icon or no icon is there
1574                align: 0.0 0.0;
1575                rel1 {
1576                   relative: 1.0 0.0;
1577                   to: "icon_rect";
1578                }
1579                rel2.to: "icon_rect";
1580                fixed: 1 0;
1581                min: 0 0;
1582                color: 0 0 0 0;
1583             }
1584             description { state: "icononly" 0.0;
1585                inherit: "default" 0.0;
1586             }
1587             description { state: "visible" 0.0; //when icon is visible
1588                align: 0.0 0.0;
1589                rel1 {
1590                   relative: 1.0 0.0;
1591                   to: "icon_rect";
1592                }
1593                rel2.to: "icon_rect";
1594                fixed: 1 0;
1595                min: 5 0;
1596                color: 0 0 0 0;
1597             }
1598          }
1599          part { name: "elm.swallow.content";
1600             type: SWALLOW;
1601             scale: 1;
1602             clip_to: "clipper";
1603             description { state: "default" 0.0;
1604                visible: 0;
1605                align: 0.0 0.5;
1606                rel1 {
1607                   relative: 1.0 1.0;
1608                   to: "padding_left_top";
1609                }
1610                rel2 {
1611                   relative: 1.0 0.0;
1612                   to_x: "padding_left_top";
1613                   to_y: "padding_right_bottom";
1614                }
1615                fixed: 1 0;
1616             }
1617             description { state: "visible" 0.0;
1618                fixed: 1 0;
1619                align: 0.0 0.5;
1620                rel1 {
1621                   relative: 1.0 1.0;
1622                   to: "padding_left_top";
1623                }
1624                rel2 {
1625                   relative: 1.0 0.0;
1626                   to_x: "padding_left_top";
1627                   to_y: "padding_right_bottom";
1628                }
1629                aspect: 1.0 1.0;
1630                aspect_preference: VERTICAL;
1631             }
1632             description { state: "icononly" 0.0;
1633                min: 40 40;
1634                rel1 {
1635                   relative: 1.0 1.0;
1636                   to: "padding_left_top";
1637                }
1638                rel2 {
1639                   relative: 0.0 0.0;
1640                   to: "padding_right_bottom";
1641                }
1642                aspect: 1.0 1.0;
1643                aspect_preference: VERTICAL;
1644             }
1645          }
1646          part { name: "elm.text";
1647             type: TEXTBLOCK;
1648             mouse_events: 0;
1649             scale: 1;
1650             clip_to: "clipper";
1651             description { state: "default" 0.0;
1652                visible: 0;
1653                rel1 {
1654                   relative: 1.0 1.0;
1655                   to_x: "padding_icon_text";
1656                   to_y: "padding_left_top";
1657                }
1658                rel2 {
1659                   relative: 0.0 0.0;
1660                   to: "padding_right_bottom";
1661                }
1662                color: BUTTON_TEXT_STYLE1_NORMAL_COLOR_INC;
1663                text {
1664                   style: "btn_multiline_style";
1665                   min: 0 0;
1666                   max: 0 1;
1667                }
1668             }
1669             description { state: "visible" 0.0;
1670                inherit: "default" 0.0;
1671                visible: 1;
1672                min: 80 0;
1673             }
1674             description { state: "clicked" 0.0;
1675                inherit: "default" 0.0;
1676                visible: 1;
1677                min: 0 0;
1678                color: BUTTON_TEXT_STYLE1_PRESSED_COLOR_INC;
1679             }
1680             description { state: "disabled" 0.0;
1681                inherit: "default" 0.0;
1682                color: 0 0 0 128;
1683             }
1684             description { state: "disabled_visible" 0.0;
1685                inherit: "default" 0.0;
1686                color: BUTTON_TEXT_STYLE1_TEXT_DISABLED_COLOR_INC;
1687                visible: 1;
1688                min: 80 0;
1689             }
1690             description { state: "focused" 0.0;
1691                inherit: "default" 0.0;
1692                visible: 1;
1693                min: 0 0;
1694                color: BUTTON_TEXT_STYLE1_DISABLED_COLOR_INC;
1695             }
1696          }
1697          part { name: "over2";
1698             type: RECT;
1699             repeat_events: 1;
1700             ignore_flags: ON_HOLD;
1701             description { state: "default" 0.0;
1702                color: 0 0 0 0;
1703             }
1704          }
1705          part { name: "over3";
1706             type: RECT;
1707             repeat_events: 1;
1708             description { state: "default" 0.0;
1709                color: 0 0 0 0;
1710             }
1711          }
1712          part { name: "clipper";
1713             type: RECT;
1714             description { state: "default" 0.0;
1715                color: 255 255 255 255;
1716             }
1717          }
1718          part { name: "disabler";
1719             type: RECT;
1720             description { state: "default" 0.0;
1721                color: 0 0 0 0;
1722                visible: 0;
1723             }
1724             description { state: "disabled" 0.0;
1725                inherit: "default" 0.0;
1726                visible: 1;
1727             }
1728          }
1729       }
1730       programs {
1731          program { name: "button_click";
1732             signal: "mouse,down,1";
1733             source: "over2";
1734             action: SIGNAL_EMIT "elm,action,press" "";
1735             after: "button_click_anim";
1736          }
1737          program { name: "button_click_anim";
1738             action: STATE_SET "clicked" 0.0;
1739             target: "button_image";
1740             after: "text_clicked";
1741          }
1742          program { name: "text_clicked";
1743             script {
1744                new st[31];
1745                new Float:vl;
1746                get_state(PART:"elm.text", st, 30, vl);
1747                if (!strcmp(st, "visible"))
1748                  set_state(PART:"elm.text", "clicked", 0.0);
1749             }
1750          }
1751          program { name: "button_unpress";
1752             action: SIGNAL_EMIT "elm,action,unpress" "";
1753          }
1754          program { name: "button_mouseout_clicked";
1755             signal: "mouse,up,1";
1756             source: "over3";
1757             script {
1758                new st[31];
1759                new Float:vl;
1760                get_state(PART:"elm.swallow.content", st, 30, vl);
1761                if (strcmp(st, "icononly"))
1762                  {
1763                     emit("elm,action,default,text,set", "");
1764                     set_state(PART:"elm.text", "visible", 0.0);
1765                  }
1766                if (get_int(button_state) != BUTTON_STATE_DISABLED)
1767                  set_state(PART:"button_image", "default", 0.0);
1768             }
1769             after: button_unpress;
1770          }
1771          program { name: "button_unclick3";
1772             signal: "mouse,clicked,1";
1773             source: "over2";
1774             action: SIGNAL_EMIT "elm,action,click" "";
1775          }
1776          program { name: "text_show";
1777             signal: "elm,state,text,visible";
1778             source: "elm";
1779             script {
1780                new st[31];
1781                new Float:vl;
1782                get_state(PART:"elm.swallow.content", st, 30, vl);
1783                if (!strcmp(st, "icononly"))
1784                  {
1785                     set_state(PART:"elm.swallow.content", "visible", 0.0);
1786                     set_state(PART:"padding_icon_text", "visible", 0.0);
1787                  }
1788                if (get_int(button_state) != BUTTON_STATE_DISABLED)
1789                  set_state(PART:"elm.text", "visible", 0.0);
1790                else
1791                  set_state(PART:"elm.text", "disabled_visible", 0.0);
1792             }
1793          }
1794          program { name: "text_hide";
1795             signal: "elm,state,text,hidden";
1796             source: "elm";
1797             script {
1798                new st[31];
1799                new Float:vl;
1800                get_state(PART:"elm.swallow.content", st, 30, vl);
1801                if (!strcmp(st, "visible"))
1802                  {
1803                     set_state(PART:"elm.swallow.content", "icononly", 0.0);
1804                     set_state(PART:"padding_icon_text", "icononly", 0.0);
1805                  }
1806                set_state(PART:"elm.text", "default", 0.0);
1807             }
1808          }
1809          program { name: "icon_show";
1810             signal: "elm,state,icon,visible";
1811             source: "elm";
1812             script {
1813                new st[31];
1814                new Float:vl;
1815                get_state(PART:"elm.text", st, 30, vl);
1816                if (!strcmp(st, "visible"))
1817                  {
1818                     set_state(PART:"elm.swallow.content", "visible", 0.0);
1819                     set_state(PART:"padding_icon_text", "visible", 0.0);
1820                  }
1821                else
1822                  {
1823                     set_state(PART:"elm.swallow.content", "icononly", 0.0);
1824                     set_state(PART:"padding_icon_text", "icononly", 0.0);
1825                  }
1826             }
1827          }
1828          program { name: "icon_hide";
1829             signal: "elm,state,icon,hidden";
1830             source: "elm";
1831             action: STATE_SET "default" 0.0;
1832             target: "elm.swallow.content";
1833             target: "padding_icon_text";
1834          }
1835          program { name: "disable";
1836             signal: "elm,state,disabled";
1837             source: "elm";
1838             action: STATE_SET "disabled" 0.0;
1839             target: "button_image";
1840             target: "disabler";
1841             after: "disable_text";
1842          }
1843          program { name: "disable_text";
1844             script {
1845                new st[31];
1846                new Float:vl;
1847                get_state(PART:"elm.text", st, 30, vl);
1848                if (!strcmp(st, "visible"))
1849                  set_state(PART:"elm.text", "disabled_visible", 0.0);
1850                else
1851                  set_state(PART:"elm.text", "disabled", 0.0);
1852                set_int(button_state, BUTTON_STATE_DISABLED);
1853             }
1854          }
1855          program { name: "enable";
1856             signal: "elm,state,enabled";
1857             source: "elm";
1858             action: STATE_SET "default" 0.0;
1859             target: "button_image";
1860             target: "disabler";
1861             after: "enable_text";
1862          }
1863          program { name: "enable_text";
1864             script {
1865                new st[31];
1866                new Float:vl;
1867                get_state(PART:"elm.text", st, 30, vl);
1868                if (!strcmp(st, "disabled_visible"))
1869                  set_state(PART:"elm.text", "visible", 0.0);
1870                else
1871                  set_state(PART:"elm.text", "default", 0.0);
1872                set_int(button_state, BUTTON_STATE_ENABLED);
1873             }
1874          }
1875          program { name: "focused";
1876             //signal: "elm,action,focus";
1877             //source: "elm";
1878             action: STATE_SET "focused" 0.0;
1879             target: "button_image";
1880             target: "elm.text";
1881          }
1882          program { name: "unfocused";
1883             //signal: "elm,action,unfocus";
1884             //source: "elm";
1885             action: STATE_SET "default" 0.0;
1886             target: "button_image";
1887             after: "unfocus_text";
1888          }
1889          program { name: "unfocus_text";
1890             action: STATE_SET "visible" 0.0;
1891             target: "elm.text";
1892          }
1893       }
1894    }
1895
1896    ///////////////////////////////////////////////////////////////////////////////////////
1897    group { name: "elm/button/base/naviframe/back_btn/gallery";
1898        alias: "elm/button/base/naviframe/back_btn/default";
1899        alias: "elm/button/base/naviframe/prev_btn/default";
1900        alias: "elm/button/base/naviframe/end_btn/default";
1901        images {
1902          image: GALLERY_EDC_IMAGE_BTN_PREV COMP;
1903          image: GALLERY_EDC_IMAGE_BTN_PREV_PRESS COMP;
1904          image: GALLERY_EDC_IMAGE_PREV COMP;
1905       }
1906       script {
1907          public button_state = BUTTON_STATE_ENABLED;
1908       }
1909       parts {
1910          part { name: "button_image";
1911             scale: 1;
1912             description { state: "default" 0.0;
1913                min: BUTTON_NAVIFRAME_BACK_BUTTON_BG_MIN_MAX_INC;
1914                max: BUTTON_NAVIFRAME_BACK_BUTTON_BG_MIN_MAX_INC;
1915                image {
1916                   normal: GALLERY_EDC_IMAGE_BTN_PREV;
1917                   border: BUTTON_NAVIFRAME_BACK_BUTTON_BG_BORDER_INC;
1918                   border_scale: 1;
1919                }
1920             }
1921             description { state: "clicked" 0.0;
1922                inherit: "default" 0.0;
1923                image.normal: GALLERY_EDC_IMAGE_BTN_PREV_PRESS;
1924             }
1925             description { state: "disabled" 0.0;
1926                inherit: "default" 0.0;
1927             }
1928             description { state: "focused" 0.0;
1929                inherit: "default" 0.0;
1930                image.normal: GALLERY_EDC_IMAGE_BTN_PREV_PRESS;
1931             }
1932          }
1933          part { name: "back_button";
1934             scale: 1;
1935             mouse_events: 0;
1936             description { state: "default" 0.0;
1937                min: BUTTON_NAVIFRAME_BACK_BUTTON_MIN_MAX_INC;
1938                max: BUTTON_NAVIFRAME_BACK_BUTTON_MIN_MAX_INC;
1939                rel1.to: "button_image";
1940                rel2.to: "button_image";
1941                image.normal: GALLERY_EDC_IMAGE_PREV;
1942             }
1943             description { state: "clicked" 0.0;
1944                inherit: "default" 0.0;
1945             }
1946          }
1947          part { name: "over2";
1948             type: RECT;
1949             repeat_events: 1;
1950             ignore_flags: ON_HOLD;
1951             description { state: "default" 0.0;
1952                color: 0 0 0 0;
1953             }
1954          }
1955          part { name: "over3";
1956             type: RECT;
1957             repeat_events: 1;
1958             description { state: "default" 0.0;
1959                color: 0 0 0 0;
1960             }
1961          }
1962          part { name: "disabler";
1963             type: RECT;
1964             description { state: "default" 0.0;
1965                color: 0 0 0 0;
1966                visible: 0;
1967             }
1968             description { state: "disabled" 0.0;
1969                inherit: "default" 0.0;
1970                visible: 1;
1971             }
1972          }
1973       }
1974       programs {
1975          program { name: "button_click";
1976             signal: "mouse,down,1";
1977             source: "over2";
1978             action: SIGNAL_EMIT "elm,action,press" "";
1979             after: "button_click_anim";
1980          }
1981          program { name: "button_click_anim";
1982             action: STATE_SET "clicked" 0.0;
1983             target: "button_image";
1984          }
1985          program { name: "button_unpress";
1986             action: SIGNAL_EMIT "elm,action,unpress" "";
1987          }
1988          program { name: "button_mouseout_clicked";
1989             signal: "mouse,up,1";
1990             source: "over3";
1991             script {
1992                if (get_int(button_state) != BUTTON_STATE_DISABLED)
1993                  set_state(PART:"button_image", "default", 0.0);
1994             }
1995             after: button_unpress;
1996          }
1997          program { name: "button_unclick3";
1998             signal: "mouse,clicked,1";
1999             source: "over2";
2000             action: SIGNAL_EMIT "elm,action,click" "";
2001          }
2002          program { name: "disable";
2003             signal: "elm,state,disabled";
2004             source: "elm";
2005             action: STATE_SET "disabled" 0.0;
2006             target: "button_image";
2007             target: "disabler";
2008             after: "disable_button";
2009          }
2010          program { name: "disable_button";
2011             script {
2012                set_int(button_state, BUTTON_STATE_DISABLED);
2013             }
2014          }
2015          program { name: "enable";
2016             signal: "elm,state,enabled";
2017             source: "elm";
2018             action: STATE_SET "default" 0.0;
2019             target: "button_image";
2020             target: "disabler";
2021             after: "enable_button";
2022          }
2023          program { name: "enable_button";
2024             script {
2025                set_int(button_state, BUTTON_STATE_ENABLED);
2026             }
2027          }
2028       }
2029    }
2030
2031 ///////////////////////////////////////////////////////////////////////////////////////
2032       group { name: "elm/button/base/naviframe_control/gallery";
2033          alias: "elm/button/base/naviframe_control/default";
2034          alias: "elm/button/base/naviframe_control/center";
2035       script {
2036          public button_state = BUTTON_STATE_ENABLED;
2037       }
2038       images {
2039          image: GALLERY_EDC_IMAGE_OPTION_HEADER_BT COMP;
2040          image: GALLERY_EDC_IMAGE_OPTION_HEADER_BT_DIM COMP;
2041          image: GALLERY_EDC_IMAGE_OPTION_HEADER_BT_PRESS COMP;
2042       }
2043       parts {
2044          part { name: "button_image";
2045             scale: 1;
2046             description { state: "default" 0.0;
2047                min: BUTTON_NAVIFRAME_CENTER_BG_NORMAL_MIN_INC;
2048                color: 0 0 0 0;
2049                rel1.offset: 0 0;
2050                rel2.offset: -1 -1;
2051                image {
2052                   normal: GALLERY_EDC_IMAGE_OPTION_HEADER_BT;
2053                   border: BUTTON_NAVIFRAME_CENTER_BG_NORMAL_BORDER_INC;
2054                }
2055                color: 255 255 255 255;
2056             }
2057             description { state: "disabled" 0.0;
2058                inherit: "default" 0.0;
2059                image.normal: GALLERY_EDC_IMAGE_OPTION_HEADER_BT_DIM;
2060             }
2061             description { state: "clicked" 0.0;
2062                inherit: "default" 0.0;
2063                image.normal: GALLERY_EDC_IMAGE_OPTION_HEADER_BT_PRESS;
2064             }
2065          }
2066          part { name: "padding_left_top";
2067             type: RECT;
2068             scale: 1;
2069             mouse_events: 0;
2070             description { state: "default" 0.0;
2071                align: 0.0 0.0;
2072                rel2.relative: 0.0 0.0;
2073                min: BUTTON_NAVIFRAME_CENTER_PADDING_MIN_MAX_INC;
2074                fixed: 1 1;
2075                visible: 0;
2076             }
2077          }
2078          part { name: "padding_right_bottom";
2079             type: RECT;
2080             scale: 1;
2081             mouse_events: 0;
2082             description { state: "default" 0.0;
2083                align: 1.0 1.0;
2084                rel1.relative: 1.0 1.0;
2085                min: BUTTON_NAVIFRAME_CENTER_PADDING_MIN_MAX_INC;
2086                fixed: 1 1;
2087                visible: 0;
2088             }
2089          }
2090          part { name: "icon_rect";
2091             type: RECT;
2092             scale: 1;
2093             mouse_events: 0;
2094             description { state: "default" 0.0;
2095                min: 0 0;
2096                fixed: 1 0;
2097                rel1 {
2098                   relative: 1.0 1.0;
2099                   to: "padding_left_top";
2100                }
2101                rel2 {
2102                   relative: 1.0 0.0;
2103                   to_x: "padding_left_top";
2104                   to_y: "padding_right_bottom";
2105                }
2106                align: 0.0 0.5;
2107                color: 0 0 0 0;
2108             }
2109             description { state: "visible" 0.0;
2110                min: BUTTON_NAVIFRAME_CENTER_ICON_RECT_VISIBLE_MIN_SIZE;
2111                fixed: 1 0;
2112                rel1 {
2113                   relative: 1.0 1.0;
2114                   to: "padding_left_top";
2115                }
2116                rel2 {
2117                   relative: 1.0 0.0;
2118                   to_x: "padding_left_top";
2119                   to_y: "padding_right_bottom";
2120                }
2121                align: 0.0 0.5;
2122                color: 0 0 0 0;
2123             }
2124             description { state: "icononly" 0.0;
2125                inherit: "default" 0.0;
2126             }
2127          }
2128          part { name: "padding_after_icon";
2129             type: RECT;
2130             scale: 1;
2131             mouse_events: 0;
2132             description { state: "default" 0.0; //when only icon or no icon is there
2133                align: 0.0 0.0;
2134                rel1 {
2135                   relative: 1.0 0.0;
2136                   to: "icon_rect";
2137                }
2138                rel2.to: "icon_rect";
2139                fixed: 1 0;
2140                min: 0 0;
2141                color: 0 0 0 0;
2142             }
2143             description { state: "visible" 0.0;
2144                align: 0.0 0.0;
2145                rel1 {
2146                   relative: 1.0 0.0;
2147                   to: "icon_rect";
2148                }
2149                rel2.to: "icon_rect";
2150                fixed: 1 0;
2151                min: BUTTON_NAVIFRAME_CENTER_PADDING_AFTER_ICON_VISIBLE_MIN_INC;
2152                color: 0 0 0 0;
2153             }
2154             description { state: "icononly" 0.0;
2155                inherit: "default" 0.0;
2156             }
2157          }
2158          part { name: "padding_before_text";
2159             type: RECT;
2160             scale: 1;
2161             mouse_events: 0;
2162             description { state: "default" 0.0; //when only icon or no icon is there
2163                align: 1.0 0.5;
2164                rel1 {
2165                   relative: 0.0 1.0;
2166                   to_x: "elm.text";
2167                   to_y: "padding_left_top";
2168                }
2169                rel2 {
2170                   relative: 0.0 0.0;
2171                   to_x: "elm.text";
2172                   to_y: "padding_right_bottom";
2173                }
2174                fixed: 1 0;
2175                min: BUTTON_NAVIFRAME_CENTER_PADDING_BEFORE_TEXT_DEFAULT_MIN_INC;
2176                color: 0 0 0 0;
2177             }
2178          }
2179          part { name: "elm.swallow.content";
2180             type: SWALLOW;
2181             scale: 1;
2182             clip_to: "clipper";
2183             description { state: "default" 0.0;
2184                visible: 0;
2185                align: 0.0 0.5;
2186                rel1 {
2187                   relative: 1.0 1.0;
2188                   to: "padding_left_top";
2189                }
2190                rel2 {
2191                   relative: 1.0 0.0;
2192                   to_x: "padding_left_top";
2193                   to_y: "padding_right_bottom";
2194                }
2195                fixed: 1 0;
2196             }
2197             description { state: "visible" 0.0;
2198                fixed: 1 0;
2199                min: BUTTON_NAVIFRAME_CENTER_SWALLOW_VISIBLE_MIN_MAX_INC;
2200                max: BUTTON_NAVIFRAME_CENTER_SWALLOW_VISIBLE_MIN_MAX_INC;
2201                align: 1.0 0.5;
2202                rel1 {
2203                   relative: 0.0 1.0;
2204                   to_x: "padding_before_text";
2205                   to_y: "padding_left_top";
2206                }
2207                rel2 {
2208                   relative: 0.0 0.0;
2209                   to_x: "padding_before_text";
2210                   to_y: "padding_right_bottom";
2211                }
2212                aspect: 1.0 1.0;
2213                aspect_preference: VERTICAL;
2214             }
2215             description { state: "icononly" 0.0;
2216                min: BUTTON_NAVIFRAME_CENTER_SWALLOW_ICONONLY_MIN_MAX_INC;
2217                max: BUTTON_NAVIFRAME_CENTER_SWALLOW_ICONONLY_MIN_MAX_INC;
2218                rel1 {
2219                   relative: 1.0 1.0;
2220                   to: "padding_left_top";
2221                }
2222                rel2 {
2223                   relative: 0.0 0.0;
2224                   to: "padding_right_bottom";
2225                }
2226                aspect: 1.0 1.0;
2227                aspect_preference: VERTICAL;
2228             }
2229          }
2230          part { name: "elm.text";
2231             type: TEXT;
2232             mouse_events: 0;
2233             scale: 1;
2234             clip_to: "clipper";
2235             description { state: "default" 0.0;
2236                visible: 0;
2237                rel1 {
2238                   relative: 1.0 1.0;
2239                   to_x: "padding_after_icon";
2240                   to_y: "padding_left_top";
2241                }
2242                rel2 {
2243                   relative: 0.0 0.0;
2244                   to: "padding_right_bottom";
2245                }
2246                color: BUTTON_NAVIFRAME_DEFAULT_TEXT_COLOR_INC;
2247                text {
2248                   font: "Helvetica Neue:style=Medium";
2249                   size: BUTTON_NAVIFRAME_CENTER_TEXT_FONT_SIZE_INC;
2250                   min: 0 0;
2251                   max: 1 0;
2252                }
2253             }
2254             description { state: "visible" 0.0;
2255                inherit: "default" 0.0;
2256                visible: 1;
2257             }
2258             description { state: "clicked" 0.0;
2259                inherit: "default" 0.0;
2260                visible: 1;
2261                min: 0 0;
2262             }
2263             description { state: "focused" 0.0;
2264                inherit: "default" 0.0;
2265                visible: 1;
2266                min: 0 0;
2267                color: BUTTON_NAVIFRAME_FOCUSED_TEXT_COLOR_INC;
2268             }
2269          }
2270          part { name: "over2";
2271             type: RECT;
2272             repeat_events: 1;
2273             ignore_flags: ON_HOLD;
2274             description { state: "default" 0.0;
2275                color: 0 0 0 0;
2276             }
2277          }
2278          part { name: "over3";
2279             type: RECT;
2280             repeat_events: 1;
2281             description { state: "default" 0.0;
2282                color: 0 0 0 0;
2283             }
2284          }
2285          part { name: "clipper";
2286             type: RECT;
2287             description { state: "default" 0.0;
2288                color: 255 255 255 255;
2289             }
2290             description { state: "disabled" 0.0;
2291                color: 255 255 255 127;
2292             }
2293          }
2294          part { name: "disabler";
2295             type: RECT;
2296             description { state: "default" 0.0;
2297                color: 0 0 0 0;
2298                visible: 0;
2299             }
2300             description { state: "disabled" 0.0;
2301                inherit: "default" 0.0;
2302                visible: 1;
2303             }
2304          }
2305       }
2306       programs {
2307          program { name: "button_click";
2308             signal: "mouse,down,1";
2309             source: "over2";
2310             action: SIGNAL_EMIT "elm,action,press" "";
2311             after: "button_click_anim";
2312          }
2313          program { name: "button_click_anim";
2314             action: STATE_SET "clicked" 0.0;
2315             target: "button_image";
2316             after: "text_clicked";
2317          }
2318          program { name: "text_clicked";
2319             script {
2320                new st[31];
2321                new Float:vl;
2322                get_state(PART:"elm.text", st, 30, vl);
2323                if (!strcmp(st, "visible"))
2324                  set_state(PART:"elm.text", "clicked", 0.0);
2325             }
2326          }
2327          program { name: "button_unpress";
2328             action: SIGNAL_EMIT "elm,action,unpress" "";
2329          }
2330          program { name: "button_mouseout_clicked";
2331             signal: "mouse,up,1";
2332             source: "over3";
2333             script {
2334                new st[31];
2335                new Float:vl;
2336                get_state(PART:"elm.swallow.content", st, 30, vl);
2337                if (strcmp(st, "icononly"))
2338                  {
2339                     emit("elm,action,default,text,set", "");
2340                     set_state(PART:"elm.text", "visible", 0.0);
2341                  }
2342                if (get_int(button_state) != BUTTON_STATE_DISABLED)
2343                  set_state(PART:"button_image", "default", 0.0);
2344             }
2345             after: button_unpress;
2346          }
2347          program { name: "button_unclick3";
2348             signal: "mouse,clicked,1";
2349             source: "over2";
2350             action: SIGNAL_EMIT "elm,action,click" "";
2351          }
2352          program { name: "text_show";
2353             signal: "elm,state,text,visible";
2354             source: "elm";
2355             script {
2356                new st[31];
2357                new Float:vl;
2358                get_state(PART:"elm.swallow.content", st, 30, vl);
2359                if (!strcmp(st, "icononly"))
2360                  {
2361                     set_state(PART:"elm.swallow.content", "visible", 0.0);
2362                     set_state(PART:"icon_rect", "visible", 0.0);
2363                     set_state(PART:"padding_after_icon", "visible", 0.0);
2364                  }
2365                set_state(PART:"elm.text", "visible", 0.0);
2366             }
2367          }
2368          program { name: "text_hide";
2369             signal: "elm,state,text,hidden";
2370             source: "elm";
2371             script {
2372                new st[31];
2373                new Float:vl;
2374                get_state(PART:"elm.swallow.content", st, 30, vl);
2375                if (!strcmp(st, "visible"))
2376                  {
2377                     set_state(PART:"elm.swallow.content", "icononly", 0.0);
2378                     set_state(PART:"icon_rect", "icononly", 0.0);
2379                     set_state(PART:"padding_after_icon", "icononly", 0.0);
2380                  }
2381                set_state(PART:"elm.text", "default", 0.0);
2382             }
2383          }
2384          program { name: "icon_show";
2385             signal: "elm,state,icon,visible";
2386             source: "elm";
2387             script {
2388                new st[31];
2389                new Float:vl;
2390                get_state(PART:"elm.text", st, 30, vl);
2391                if (!strcmp(st, "visible"))
2392                  {
2393                     set_state(PART:"elm.swallow.content", "visible", 0.0);
2394                     set_state(PART:"icon_rect", "visible", 0.0);
2395                     set_state(PART:"padding_after_icon", "visible", 0.0);
2396                  }
2397                else
2398                  {
2399                     set_state(PART:"elm.swallow.content", "icononly", 0.0);
2400                     set_state(PART:"icon_rect", "icononly", 0.0);
2401                     set_state(PART:"padding_after_icon", "icononly", 0.0);
2402                  }
2403             }
2404          }
2405          program { name: "icon_hide";
2406             signal: "elm,state,icon,hidden";
2407             source: "elm";
2408             action: STATE_SET "default" 0.0;
2409             target: "elm.swallow.content";
2410             target: "icon_rect";
2411             target: "padding_after_icon";
2412          }
2413          program { name: "disable";
2414             signal: "elm,state,disabled";
2415             source: "elm";
2416             action: STATE_SET "disabled" 0.0;
2417             target: "button_image";
2418             target: "clipper";
2419             target: "disabler";
2420             after: "disable_text";
2421          }
2422          program { name: "disable_text";
2423             script {
2424                new st[31];
2425                new Float:vl;
2426                set_int(button_state, BUTTON_STATE_DISABLED);
2427                get_state(PART:"elm.text", st, 30, vl);
2428                if (!strcmp(st, "clicked") || !strcmp(st, "focused"))
2429                  set_state(PART:"elm.text", "visible", 0.0);
2430             }
2431          }
2432          program { name: "enable";
2433             signal: "elm,state,enabled";
2434             source: "elm";
2435             action: STATE_SET "default" 0.0;
2436             target: "button_image";
2437             target: "clipper";
2438             target: "disabler";
2439             after: "enable_text";
2440          }
2441          program { name: "enable_text";
2442             script {
2443                new st[31];
2444                new Float:vl;
2445                set_int(button_state, BUTTON_STATE_ENABLED);
2446                get_state(PART:"elm.text", st, 30, vl);
2447                if (!strcmp(st, "clicked") || !strcmp(st, "focused"))
2448                  set_state(PART:"elm.text", "visible", 0.0);
2449             }
2450          }
2451          program { name: "focused";
2452             action: STATE_SET "focused" 0.0;
2453             target: "button_image";
2454             target: "elm.text";
2455          }
2456          program { name: "unfocused";
2457             action: STATE_SET "default" 0.0;
2458             target: "button_image";
2459             after: "unfocus_text";
2460          }
2461          program { name: "unfocus_text";
2462             action: STATE_SET "visible" 0.0;
2463             target: "elm.text";
2464          }
2465       }
2466    }
2467
2468 ///////////////////////////////////////////////////////////////////////////////////////
2469    group { name: "elm/button/base/naviframe_control/multiline/gallery";
2470             alias: "elm/button/base/naviframe_control/multiline";
2471
2472       script {
2473          public button_state = BUTTON_STATE_ENABLED;
2474       }
2475       images {
2476          image: GALLERY_EDC_IMAGE_OPTION_HEADER_BT COMP;
2477          image: GALLERY_EDC_IMAGE_OPTION_HEADER_BT_DIM COMP;
2478          image: GALLERY_EDC_IMAGE_OPTION_HEADER_BT_PRESS COMP;
2479       }
2480       styles{
2481          style { name: "btn_multiline_naviframe_controlbar_style";
2482             base: "font=Helvetica Neue:style=Medium font_size="BUTTON_NAVIFRAME_MULTILINE_TEXT_FONT_SIZE_INC" align=center color=#ffffff wrap=mixed";
2483             tag: "br" "\n";
2484             tag: "ps" "ps";
2485             tag: "tab" "\t";
2486          }
2487       }
2488       parts {
2489          part { name: "button_image";
2490             scale: 1;
2491             description { state: "default" 0.0;
2492                min: BUTTON_NAVIFRAME_CENTER_BG_NORMAL_MIN_INC;
2493                rel1.offset: 0 0;
2494                rel2.offset: -1 -1;
2495                image {
2496                   normal: GALLERY_EDC_IMAGE_OPTION_HEADER_BT;
2497                   border: BUTTON_NAVIFRAME_CENTER_BG_NORMAL_BORDER_INC;
2498                }
2499                color: 255 255 255 255;
2500             }
2501             description { state: "disabled" 0.0;
2502                inherit: "default" 0.0;
2503                image.normal: GALLERY_EDC_IMAGE_OPTION_HEADER_BT_DIM;
2504             }
2505             description { state: "clicked" 0.0;
2506                inherit: "default" 0.0;
2507                image.normal: GALLERY_EDC_IMAGE_OPTION_HEADER_BT_PRESS;
2508             }
2509          }
2510          part { name: "padding_left_top";
2511             type: RECT;
2512             scale: 1;
2513             mouse_events: 0;
2514             description { state: "default" 0.0;
2515                align: 0.0 0.0;
2516                rel2.relative: 0.0 0.0;
2517                min: BUTTON_NAVIFRAME_CENTER_PADDING_MIN_MAX_INC;
2518                fixed: 1 1;
2519                visible: 0;
2520             }
2521          }
2522          part { name: "padding_right_bottom";
2523             type: RECT;
2524             scale: 1;
2525             mouse_events: 0;
2526             description { state: "default" 0.0;
2527                align: 1.0 1.0;
2528                rel1.relative: 1.0 1.0;
2529                min: BUTTON_NAVIFRAME_CENTER_PADDING_MIN_MAX_INC;
2530                fixed: 1 1;
2531                visible: 0;
2532             }
2533          }
2534          part { name: "icon_rect";
2535             type: RECT;
2536             scale: 1;
2537             mouse_events: 0;
2538             description { state: "default" 0.0;
2539                visible: 0;
2540                min: 0 0;
2541                fixed: 1 0;
2542                rel1 {
2543                   relative: 0.0 1.0;
2544                   to_x: "elm.swallow.content";
2545                   to_y: "padding_left_top";
2546                }
2547                rel2 {
2548                   relative: 1.0 0.0;
2549                   to_x: "elm.swallow.content";
2550                   to_y: "padding_right_bottom";
2551                }
2552                align: 0.0 0.5;
2553             }
2554          }
2555          part { name: "padding_icon_text";
2556             type: RECT;
2557             scale: 1;
2558             mouse_events: 0;
2559             description { state: "default" 0.0; //when only icon or no icon is there
2560                visible: 0;
2561                align: 0.0 0.0;
2562                rel1 {
2563                   relative: 1.0 0.0;
2564                   to: "icon_rect";
2565                }
2566                rel2 {
2567                   relative: 1.0 1.0;
2568                   to: "icon_rect";
2569                }
2570                fixed: 1 0;
2571                min: 0 0;
2572             }
2573             description { state: "visible" 0.0;
2574                inherit: "default" 0.0;
2575                min: BUTTON_NAVIFRAME_CENTER_PADDING_AFTER_ICON_VISIBLE_MIN_INC;
2576                rel1 {
2577                   relative: 1.0 0.0;
2578                   to: "icon_rect";
2579                }
2580                rel2 {
2581                   relative: 1.0 1.0;
2582                   to: "icon_rect";
2583                }
2584            }
2585             description { state: "icononly" 0.0;
2586                inherit: "default" 0.0;
2587             }
2588          }
2589          part { name: "elm.swallow.content";
2590             type: SWALLOW;
2591             scale: 1;
2592             clip_to: "clipper";
2593             description { state: "default" 0.0;
2594                visible: 0;
2595                align: 0.0 0.5;
2596                rel1 {
2597                   relative: 1.0 1.0;
2598                   to: "padding_left_top";
2599                }
2600                rel2 {
2601                   relative: 1.0 0.0;
2602                   to_x: "padding_left_top";
2603                   to_y: "padding_right_bottom";
2604                }
2605                fixed: 1 0;
2606             }
2607             description { state: "visible" 0.0;
2608                fixed: 1 0;
2609                min: BUTTON_NAVIFRAME_CENTER_SWALLOW_VISIBLE_MIN_MAX_INC;
2610                max: BUTTON_NAVIFRAME_CENTER_SWALLOW_VISIBLE_MIN_MAX_INC;
2611                align: 0.0 0.5;
2612                rel1 {
2613                   relative: 1.0 1.0;
2614                   to: "padding_left_top";
2615                }
2616                rel2 {
2617                   relative: 0.0 0.0;
2618                   to_x: "padding_left_top";
2619                   to_y: "padding_right_bottom";
2620                }
2621             }
2622             description { state: "icononly" 0.0;
2623                min: BUTTON_NAVIFRAME_CENTER_SWALLOW_ICONONLY_MIN_MAX_INC;
2624                max: BUTTON_NAVIFRAME_CENTER_SWALLOW_ICONONLY_MIN_MAX_INC;
2625                rel1 {
2626                   relative: 1.0 1.0;
2627                   to: "padding_left_top";
2628                }
2629                rel2 {
2630                   relative: 0.0 0.0;
2631                   to: "padding_right_bottom";
2632                }
2633             }
2634          }
2635          part { name: "elm.text";
2636             type: TEXTBLOCK;
2637             mouse_events: 0;
2638             scale: 1;
2639             clip_to: "clipper";
2640             description { state: "default" 0.0;
2641                visible: 0;
2642                rel1 {
2643                   relative: 1.0 1.0;
2644                   to_x: "padding_icon_text";
2645                   to_y: "padding_left_top";
2646                }
2647                rel2 {
2648                    relative: 0.0 0.0;
2649                    to: "padding_right_bottom";
2650                }
2651                color: BUTTON_NAVIFRAME_DEFAULT_TEXT_COLOR_INC;
2652                text {
2653                   style: "btn_multiline_naviframe_controlbar_style";
2654                   min: 0 0;
2655                   max: 0 1;
2656                }
2657             }
2658             description { state: "visible" 0.0;
2659                inherit: "default" 0.0;
2660                visible: 1;
2661                min: 80 0;
2662             }
2663             description { state: "clicked" 0.0;
2664                inherit: "default" 0.0;
2665                visible: 1;
2666                min: 0 0;
2667             }
2668             description { state: "focused" 0.0;
2669                inherit: "default" 0.0;
2670                visible: 1;
2671                min: 0 0;
2672                color: BUTTON_NAVIFRAME_FOCUSED_TEXT_COLOR_INC;
2673             }
2674          }
2675          part { name: "over2";
2676             type: RECT;
2677             repeat_events: 1;
2678             ignore_flags: ON_HOLD;
2679             description { state: "default" 0.0;
2680                color: 0 0 0 0;
2681             }
2682          }
2683          part { name: "over3";
2684             type: RECT;
2685             repeat_events: 1;
2686             description { state: "default" 0.0;
2687                color: 0 0 0 0;
2688             }
2689          }
2690          part { name: "clipper";
2691             type: RECT;
2692             description { state: "default" 0.0;
2693                color: 255 255 255 255;
2694             }
2695             description { state: "disabled" 0.0;
2696                color: 255 255 255 127;
2697             }
2698          }
2699          part { name: "disabler";
2700             type: RECT;
2701             description { state: "default" 0.0;
2702                color: 0 0 0 0;
2703                visible: 0;
2704             }
2705             description { state: "disabled" 0.0;
2706                inherit: "default" 0.0;
2707                visible: 1;
2708             }
2709          }
2710       }
2711       programs {
2712          program { name: "button_click";
2713             signal: "mouse,down,1";
2714             source: "over2";
2715             action: SIGNAL_EMIT "elm,action,press" "";
2716             after: "button_click_anim";
2717          }
2718          program { name: "button_click_anim";
2719             action: STATE_SET "clicked" 0.0;
2720             target: "button_image";
2721             after: "text_clicked";
2722          }
2723          program { name: "text_clicked";
2724             script {
2725                new st[31];
2726                new Float:vl;
2727                get_state(PART:"elm.text", st, 30, vl);
2728                if (!strcmp(st, "visible"))
2729                  set_state(PART:"elm.text", "clicked", 0.0);
2730             }
2731          }
2732          program { name: "button_unpress";
2733             action: SIGNAL_EMIT "elm,action,unpress" "";
2734          }
2735          program { name: "button_mouseout_clicked";
2736             signal: "mouse,up,1";
2737             source: "over3";
2738             script {
2739                new st[31];
2740                new Float:vl;
2741                get_state(PART:"elm.swallow.content", st, 30, vl);
2742                if (strcmp(st, "icononly"))
2743                  {
2744                     emit("elm,action,default,text,set", "");
2745                     set_state(PART:"elm.text", "visible", 0.0);
2746                  }
2747                if (get_int(button_state) != BUTTON_STATE_DISABLED)
2748                  set_state(PART:"button_image", "default", 0.0);
2749             }
2750             after: button_unpress;
2751          }
2752          program { name: "button_unclick3";
2753             signal: "mouse,clicked,1";
2754             source: "over2";
2755             action: SIGNAL_EMIT "elm,action,click" "";
2756          }
2757          program { name: "text_show";
2758             signal: "elm,state,text,visible";
2759             source: "elm";
2760             script {
2761                new st[31];
2762                new Float:vl;
2763                get_state(PART:"elm.swallow.content", st, 30, vl);
2764                if (!strcmp(st, "icononly"))
2765                  {
2766                     set_state(PART:"elm.swallow.content", "visible", 0.0);
2767                     set_state(PART:"padding_icon_text", "visible", 0.0);
2768                  }
2769                set_state(PART:"elm.text", "visible", 0.0);
2770             }
2771          }
2772          program { name: "text_hide";
2773             signal: "elm,state,text,hidden";
2774             source: "elm";
2775             script {
2776                new st[31];
2777                new Float:vl;
2778                get_state(PART:"elm.swallow.content", st, 30, vl);
2779                if (!strcmp(st, "visible"))
2780                  {
2781                     set_state(PART:"elm.swallow.content", "icononly", 0.0);
2782                     set_state(PART:"padding_icon_text", "icononly", 0.0);
2783                  }
2784                set_state(PART:"elm.text", "default", 0.0);
2785             }
2786          }
2787          program { name: "icon_show";
2788             signal: "elm,state,icon,visible";
2789             source: "elm";
2790             script {
2791                new st[31];
2792                new Float:vl;
2793                get_state(PART:"elm.text", st, 30, vl);
2794                if (!strcmp(st, "visible"))
2795                  {
2796                     set_state(PART:"elm.swallow.content", "visible", 0.0);
2797                     set_state(PART:"padding_icon_text", "visible", 0.0);
2798                  }
2799                else
2800                  {
2801                     set_state(PART:"elm.swallow.content", "icononly", 0.0);
2802                     set_state(PART:"padding_icon_text", "icononly", 0.0);
2803                  }
2804             }
2805          }
2806          program { name: "icon_hide";
2807             signal: "elm,state,icon,hidden";
2808             source: "elm";
2809             action: STATE_SET "default" 0.0;
2810             target: "elm.swallow.content";
2811             target: "padding_icon_text";
2812          }
2813          program { name: "disable";
2814             signal: "elm,state,disabled";
2815             source: "elm";
2816             action: STATE_SET "disabled" 0.0;
2817             target: "button_image";
2818             target: "clipper";
2819             target: "disabler";
2820             after: "disable_text";
2821          }
2822          program { name: "disable_text";
2823             script {
2824                new st[31];
2825                new Float:vl;
2826                set_int(button_state, BUTTON_STATE_DISABLED);
2827                get_state(PART:"elm.text", st, 30, vl);
2828                if (!strcmp(st, "clicked") || !strcmp(st, "focused"))
2829                  set_state(PART:"elm.text", "visible", 0.0);
2830             }
2831          }
2832          program { name: "enable";
2833             signal: "elm,state,enabled";
2834             source: "elm";
2835             action: STATE_SET "default" 0.0;
2836             target: "button_image";
2837             target: "clipper";
2838             target: "disabler";
2839             after: "enable_text";
2840          }
2841          program { name: "enable_text";
2842             script {
2843                new st[31];
2844                new Float:vl;
2845                set_int(button_state, BUTTON_STATE_ENABLED);
2846                get_state(PART:"elm.text", st, 30, vl);
2847                if (!strcmp(st, "clicked") || !strcmp(st, "focused"))
2848                  set_state(PART:"elm.text", "visible", 0.0);
2849             }
2850          }
2851          program { name: "focused";
2852             action: STATE_SET "focused" 0.0;
2853             target: "button_image";
2854             target: "elm.text";
2855          }
2856          program { name: "unfocused";
2857             action: STATE_SET "default" 0.0;
2858             target: "button_image";
2859             after: "unfocus_text";
2860          }
2861          program { name: "unfocus_text";
2862             action: STATE_SET "visible" 0.0;
2863             target: "elm.text";
2864          }
2865       }
2866    }
2867
2868 ///////////////////////////////////////////////////////////////////////////////////////
2869    group { name: "elm/button/base/naviframe/title/gallery";
2870         alias: "elm/button/base/naviframe/title/default";
2871
2872       images {
2873          image: GALLERY_EDC_IMAGE_BTN_TITLE COMP;
2874          image: GALLERY_EDC_IMAGE_BTN_TITLE_PRESS COMP;
2875       }
2876       script {
2877          public button_state = BUTTON_STATE_ENABLED;
2878       }
2879       parts {
2880          part { name: "button_image";
2881             scale: 1;
2882             description { state: "default" 0.0;
2883                min: BUTTON_NAVIFRAME_TITLE_BUTTON_MIN_INC;
2884                max: BUTTON_NAVIFRAME_TITLE_BUTTON_MIN_INC;
2885                image {
2886                   normal: GALLERY_EDC_IMAGE_BTN_TITLE;
2887                   border: BUTTON_NAVIFRAME_BG_BORDER_INC;
2888                   border_scale: 1;
2889                }
2890             }
2891             description { state: "clicked" 0.0;
2892                inherit: "default" 0.0;
2893                image.normal: GALLERY_EDC_IMAGE_BTN_TITLE_PRESS;
2894             }
2895             description { state: "disabled" 0.0;
2896                inherit: "default" 0.0;
2897                color: 0 0 0 128;
2898             }
2899             description { state: "focused" 0.0;
2900                inherit: "default" 0.0;
2901                image.normal: GALLERY_EDC_IMAGE_BTN_TITLE_PRESS;
2902             }
2903          }
2904          part { name: "padding_left_top";
2905             type: RECT;
2906             scale: 1;
2907             mouse_events: 0;
2908             description { state: "default" 0.0;
2909                align: 0.0 0.0;
2910                rel2.relative: 0.0 0.0;
2911                min: BUTTON_NAVIFRAME_PADDING_MIN_INC;
2912                fixed: 1 1;
2913                visible: 0;
2914             }
2915          }
2916          part { name: "bg";
2917             type: RECT;
2918             scale: 1;
2919             mouse_events: 0;
2920             description { state: "default" 0.0;
2921                min: BUTTON_NAVIFRAME_BG_MIN_INC;
2922                visible: 0;
2923             }
2924             description { state: "visible" 0.0;
2925                inherit: "default" 0.0;
2926                min: BUTTON_NAVIFRAME_VISIBLE_BG_MIN_INC;
2927             }
2928             description { state: "icononly" 0.0;
2929                inherit: "default" 0.0;
2930                min: BUTTON_NAVIFRAME_ICONONLY_BG_MIN_INC;
2931             }
2932          }
2933          part { name: "padding_right_bottom";
2934             type: RECT;
2935             scale: 1;
2936             mouse_events: 0;
2937             description { state: "default" 0.0;
2938                align: 1.0 1.0;
2939                rel1.relative: 1.0 1.0;
2940                min: BUTTON_NAVIFRAME_PADDING_MIN_INC;
2941                fixed: 1 1;
2942                visible: 0;
2943             }
2944          }
2945          part { name: "icon_rect";
2946             type: RECT;
2947             scale: 1;
2948             mouse_events: 0;
2949             description { state: "default" 0.0;
2950                visible: 0;
2951                min: 0 0;
2952                fixed: 1 0;
2953                rel1 {
2954                   relative: 1.0 1.0;
2955                   to: "padding_left_top";
2956                }
2957                rel2 {
2958                   relative: 1.0 0.0;
2959                   to_x: "padding_left_top";
2960                   to_y: "padding_right_bottom";
2961                }
2962                align: 0.0 0.5;
2963             }
2964             description { state: "visible" 0.0;
2965                visible: 0;
2966                min: BUTTON_NAVIFRAME_VISIBLE_ICON_RECT_MIN_MAX_INC;
2967                max: BUTTON_NAVIFRAME_VISIBLE_ICON_RECT_MIN_MAX_INC;
2968                fixed: 1 0;
2969                rel1 {
2970                   relative: 1.0 1.0;
2971                   to: "padding_left_top";
2972                }
2973                rel2 {
2974                   relative: 1.0 0.0;
2975                   to_x: "padding_left_top";
2976                   to_y: "padding_right_bottom";
2977                }
2978                align: 0.0 0.5;
2979             }
2980             description { state: "icononly" 0.0;
2981                inherit: "default" 0.0;
2982             }
2983          }
2984          part { name: "padding_after_icon";
2985             type: RECT;
2986             scale: 1;
2987             mouse_events: 0;
2988             description { state: "default" 0.0; //when only icon or no icon is there
2989                align: 0.0 0.0;
2990                rel1 {
2991                   relative: 1.0 0.0;
2992                   to: "icon_rect";
2993                }
2994                rel2.to: "icon_rect";
2995                fixed: 1 0;
2996                min: 0 0;
2997                visible: 0;
2998             }
2999             description { state: "visible" 0.0;
3000                visible: 0;
3001                align: 0.0 0.0;
3002                rel1 {
3003                   relative: 1.0 0.0;
3004                   to: "icon_rect";
3005                }
3006                rel2.to: "icon_rect";
3007                fixed: 1 0;
3008                min: BUTTON_NAVIFRAME_VISIBLE_PADDING_ICON_TEXT_MIN_INC;
3009             }
3010             description { state: "icononly" 0.0;
3011                inherit: "default" 0.0;
3012             }
3013          }
3014          part { name: "padding_before_text";
3015             type: RECT;
3016             scale: 1;
3017             mouse_events: 0;
3018             description { state: "default" 0.0; //when only icon or no icon is there
3019                align: 1.0 0.5;
3020                rel1 {
3021                   relative: 0.0 1.0;
3022                   to_x: "elm.text";
3023                   to_y: "padding_left_top";
3024                }
3025                rel2 {
3026                   relative: 0.0 0.0;
3027                   to_x: "elm.text";
3028                   to_y: "padding_right_bottom";
3029                }
3030                fixed: 1 0;
3031                min: BUTTON_NAVIFRAME_VISIBLE_PADDING_ICON_TEXT_MIN_INC;
3032                visible: 0;
3033             }
3034          }
3035          part { name: "elm.swallow.content";
3036             type: SWALLOW;
3037             scale: 1;
3038             clip_to: "clipper";
3039             description { state: "default" 0.0;
3040                visible: 0;
3041                align: 0.0 0.5;
3042                rel1 {
3043                   relative: 1.0 1.0;
3044                   to: "padding_left_top";
3045                }
3046                rel2 {
3047                   relative: 1.0 0.0;
3048                   to_x: "padding_left_top";
3049                   to_y: "padding_right_bottom";
3050                }
3051                fixed: 1 0;
3052             }
3053             description { state: "visible" 0.0;
3054                fixed: 1 0;
3055                min: BUTTON_NAVIFRAME_VISIBLE_ICON_MIN_MAX_INC;
3056                max: BUTTON_NAVIFRAME_VISIBLE_ICON_MIN_MAX_INC;
3057                align: 1.0 0.5;
3058                rel1 {
3059                   relative: 0.0 1.0;
3060                   to_x: "padding_before_text";
3061                   to_y: "padding_left_top";
3062                }
3063                rel2 {
3064                   relative: 0.0 0.0;
3065                   to_x: "padding_before_text";
3066                   to_y: "padding_right_bottom";
3067                }
3068             }
3069             description { state: "icononly" 0.0;
3070                min: BUTTON_NAVIFRAME_ICONONLY_ICON_MIN_MAX_INC;
3071                max: BUTTON_NAVIFRAME_ICONONLY_ICON_MIN_MAX_INC;
3072             }
3073          }
3074          part { name: "elm.text";
3075             type: TEXT;
3076             mouse_events: 0;
3077             scale: 1;
3078             clip_to: "clipper";
3079             description { state: "default" 0.0;
3080                visible: 0;
3081                rel1 {
3082                   relative: 1.0 1.0;
3083                   to_x: "padding_after_icon";
3084                   to_y: "padding_left_top";
3085                }
3086                rel2 {
3087                   relative: 0.0 0.0;
3088                   to: "padding_right_bottom";
3089                }
3090                color: BUTTON_TEXT_NAVIFRAME_NORMAL_COLOR_INC;
3091                text {
3092                   font: "HelveticaNeue:style=Medium";
3093                   size: BUTTON_TEXT_NAVIFRAME_FONT_SIZE_INC;
3094                   min: 0 0;
3095                   max: 1 0;
3096                }
3097             }
3098             description { state: "visible" 0.0;
3099                inherit: "default" 0.0;
3100                visible: 1;
3101             }
3102             description { state: "clicked" 0.0;
3103                inherit: "default" 0.0;
3104                visible: 1;
3105                color: BUTTON_TEXT_NAVIFRAME_PRESSED_COLOR_INC;
3106             }
3107             description { state: "disabled" 0.0;
3108                inherit: "default" 0.0;
3109                color: 0 0 0 128;
3110             }
3111             description { state: "disabled_visible" 0.0;
3112                inherit: "default" 0.0;
3113                color: BUTTON_TEXT_NAVIFRAME_DISABLED_COLOR_INC;
3114                visible: 1;
3115             }
3116             description { state: "focused" 0.0;
3117                inherit: "default" 0.0;
3118                visible: 1;
3119                color: BUTTON_TEXT_NAVIFRAME_FOCUSED_COLOR_INC;
3120             }
3121          }
3122          part { name: "over2";
3123             type: RECT;
3124             repeat_events: 1;
3125             ignore_flags: ON_HOLD;
3126             description { state: "default" 0.0;
3127                color: 0 0 0 0;
3128             }
3129          }
3130          part { name: "over3";
3131             type: RECT;
3132             repeat_events: 1;
3133             description { state: "default" 0.0;
3134                color: 0 0 0 0;
3135             }
3136          }
3137          part { name: "clipper";
3138             type: RECT;
3139             description { state: "default" 0.0;
3140                color: 255 255 255 255;
3141             }
3142          }
3143          part { name: "disabler";
3144             type: RECT;
3145             description { state: "default" 0.0;
3146                color: 0 0 0 0;
3147                visible: 0;
3148             }
3149             description { state: "disabled" 0.0;
3150                inherit: "default" 0.0;
3151                visible: 1;
3152             }
3153          }
3154       }
3155       programs {
3156          program { name: "button_click";
3157             signal: "mouse,down,1";
3158             source: "over2";
3159             action: SIGNAL_EMIT "elm,action,press" "";
3160             after: "button_click_anim";
3161          }
3162          program { name: "button_click_anim";
3163             action: STATE_SET "clicked" 0.0;
3164             target: "button_image";
3165             after: "text_clicked";
3166          }
3167          program { name: "text_clicked";
3168             script {
3169                new st[31];
3170                new Float:vl;
3171                get_state(PART:"elm.text", st, 30, vl);
3172                if (!strcmp(st, "visible"))
3173                  set_state(PART:"elm.text", "clicked", 0.0);
3174             }
3175          }
3176          program { name: "button_unpress";
3177             action: SIGNAL_EMIT "elm,action,unpress" "";
3178          }
3179          program { name: "button_mouseout_clicked";
3180             signal: "mouse,up,1";
3181             source: "over3";
3182             script {
3183                new st[31];
3184                new Float:vl;
3185                get_state(PART:"elm.swallow.content", st, 30, vl);
3186                if (strcmp(st, "icononly"))
3187                  {
3188                     emit("elm,action,default,text,set", "");
3189                     set_state(PART:"elm.text", "visible", 0.0);
3190                  }
3191                if (get_int(button_state) != BUTTON_STATE_DISABLED)
3192                  set_state(PART:"button_image", "default", 0.0);
3193             }
3194             after: button_unpress;
3195          }
3196          program { name: "button_unclick3";
3197             signal: "mouse,clicked,1";
3198             source: "over2";
3199             action: SIGNAL_EMIT "elm,action,click" "";
3200          }
3201          program { name: "text_show";
3202             signal: "elm,state,text,visible";
3203             source: "elm";
3204             script {
3205                new st[31];
3206                new Float:vl;
3207                get_state(PART:"elm.swallow.content", st, 30, vl);
3208                if (!strcmp(st, "icononly"))
3209                  {
3210                     set_state(PART:"elm.swallow.content", "visible", 0.0);
3211                     set_state(PART:"icon_rect", "visible", 0.0);
3212                     set_state(PART:"padding_after_icon", "visible", 0.0);
3213                     set_state(PART:"bg", "visible", 0.0);
3214                  }
3215                if (get_int(button_state) != BUTTON_STATE_DISABLED)
3216                  set_state(PART:"elm.text", "visible", 0.0);
3217                else
3218                  set_state(PART:"elm.text", "disabled_visible", 0.0);
3219             }
3220          }
3221          program { name: "text_hide";
3222             signal: "elm,state,text,hidden";
3223             source: "elm";
3224             script {
3225                new st[31];
3226                new Float:vl;
3227                get_state(PART:"elm.swallow.content", st, 30, vl);
3228                if (!strcmp(st, "visible"))
3229                  {
3230                     set_state(PART:"elm.swallow.content", "icononly", 0.0);
3231                     set_state(PART:"icon_rect", "icononly", 0.0);
3232                     set_state(PART:"padding_after_icon", "icononly", 0.0);
3233                     set_state(PART:"bg", "icononly", 0.0);
3234                  }
3235                set_state(PART:"elm.text", "default", 0.0);
3236             }
3237          }
3238          program { name: "icon_show";
3239             signal: "elm,state,icon,visible";
3240             source: "elm";
3241             script {
3242                new st[31];
3243                new Float:vl;
3244                get_state(PART:"elm.text", st, 30, vl);
3245                if (!strcmp(st, "visible"))
3246                  {
3247                     set_state(PART:"elm.swallow.content", "visible", 0.0);
3248                     set_state(PART:"icon_rect", "visible", 0.0);
3249                     set_state(PART:"padding_after_icon", "visible", 0.0);
3250                     set_state(PART:"bg", "visible", 0.0);
3251                  }
3252                else
3253                  {
3254                     set_state(PART:"elm.swallow.content", "icononly", 0.0);
3255                     set_state(PART:"icon_rect", "icononly", 0.0);
3256                     set_state(PART:"padding_after_icon", "icononly", 0.0);
3257                     set_state(PART:"bg", "icononly", 0.0);
3258                  }
3259             }
3260          }
3261          program { name: "icon_hide";
3262             signal: "elm,state,icon,hidden";
3263             source: "elm";
3264             action: STATE_SET "default" 0.0;
3265             target: "elm.swallow.content";
3266             target: "padding_after_icon";
3267             target: "icon_rect";
3268             target: "bg";
3269          }
3270          program { name: "disable";
3271             signal: "elm,state,disabled";
3272             source: "elm";
3273             action: STATE_SET "disabled" 0.0;
3274             target: "button_image";
3275             target: "disabler";
3276             after: "disable_text";
3277          }
3278          program { name: "disable_text";
3279             script {
3280                new st[31];
3281                new Float:vl;
3282                get_state(PART:"elm.text", st, 30, vl);
3283                if (!strcmp(st, "visible"))
3284                  set_state(PART:"elm.text", "disabled_visible", 0.0);
3285                else
3286                  set_state(PART:"elm.text", "disabled", 0.0);
3287                set_int(button_state, BUTTON_STATE_DISABLED);
3288             }
3289          }
3290          program { name: "enable";
3291             signal: "elm,state,enabled";
3292             source: "elm";
3293             action: STATE_SET "default" 0.0;
3294             target: "button_image";
3295             target: "disabler";
3296             after: "enable_text";
3297          }
3298          program { name: "enable_text";
3299             script {
3300                new st[31];
3301                new Float:vl;
3302                get_state(PART:"elm.text", st, 30, vl);
3303                if (!strcmp(st, "disabled_visible"))
3304                  set_state(PART:"elm.text", "visible", 0.0);
3305                else
3306                  set_state(PART:"elm.text", "default", 0.0);
3307                set_int(button_state, BUTTON_STATE_ENABLED);
3308             }
3309          }
3310          program { name: "focused";
3311             //signal: "elm,action,focus";
3312             //source: "elm";
3313             action: STATE_SET "focused" 0.0;
3314             target: "button_image";
3315             target: "elm.text";
3316          }
3317          program { name: "unfocused";
3318             //signal: "elm,action,unfocus";
3319             //source: "elm";
3320             action: STATE_SET "default" 0.0;
3321             target: "button_image";
3322             after: "unfocus_text";
3323          }
3324          program { name: "unfocus_text";
3325             action: STATE_SET "visible" 0.0;
3326             target: "elm.text";
3327          }
3328       }
3329    }
3330
3331 #undef BUTTON_STATE_ENABLED
3332 #undef BUTTON_STATE_DISABLED
3333