apply FSL(Flora Software License)
[apps/home/gallery.git] / libug / libug-gallery-efl / res / edc / gallery-efl-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 108 115 118 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_TEXT_STYLE1_BG_MIN_INC 100 74
32 #define BUTTON_TEXT_STYLE1_VISIBLE_BG_MIN_INC 148 74
33 #define BUTTON_TEXT_STYLE1_ICONONLY_BG_MIN_INC 74 74
34 #define BUTTON_TEXT_STYLE1_BG_BORDER_INC 5 5 5 5
35 #define BUTTON_TEXT_STYLE1_PADDING_MIN_INC 20 5
36 #define BUTTON_TEXT_STYLE1_VISIBLE_ICON_RECT_MIN_MAX_INC 38 38
37 #define BUTTON_TEXT_STYLE1_VISIBLE_PADDING_ICON_TEXT_MIN_INC 10 0
38 #define BUTTON_TEXT_STYLE1_VISIBLE_ICON_MIN_MAX_INC 38 38
39 #define BUTTON_TEXT_STYLE1_ICONONLY_ICON_MIN_MAX_INC 38 38
40 #define BUTTON_TEXT_STYLE1_FONT_SIZE_INC 32
41
42 #define BUTTON_CIRCLE_STYLE_BG_MIN_MAX_INC 64 64
43 #define BUTTON_CIRCLE_STYLE_IMAGE_MIN_MAX_INC 64 64
44 #define BUTTON_CIRCLE_STYLE_CONTENT_MIN_MAX_INC 35 35
45
46 #define BUTTON_NAVIFRAME_BACK_BUTTON_BG_MIN_MAX_INC 106 74
47 #define BUTTON_NAVIFRAME_BACK_BUTTON_BG_BORDER_INC 5 5 5 5
48 #define BUTTON_NAVIFRAME_BACK_BUTTON_MIN_MAX_INC 56 56
49
50 #define BUTTON_NAVIFRAME_BG_MIN_INC 124 74
51 #define BUTTON_NAVIFRAME_VISIBLE_BG_MIN_INC 124 74
52 #define BUTTON_NAVIFRAME_ICONONLY_BG_MIN_INC 74 74
53 #define BUTTON_NAVIFRAME_BG_BORDER_INC 5 5 5 5
54 #define BUTTON_NAVIFRAME_PADDING_MIN_INC 5 5
55 #define BUTTON_NAVIFRAME_VISIBLE_ICON_RECT_MIN_MAX_INC 38 38
56 #define BUTTON_NAVIFRAME_VISIBLE_PADDING_ICON_TEXT_MIN_INC 10 0
57 #define BUTTON_NAVIFRAME_VISIBLE_ICON_MIN_MAX_INC 38 38
58 #define BUTTON_NAVIFRAME_ICONONLY_ICON_MIN_MAX_INC 38 38
59 #define BUTTON_TEXT_NAVIFRAME_FONT_SIZE_INC 28
60 #define BUTTON_NAVIFRAME_TITLE_BUTTON_MIN_INC 124 74
61
62 ///////////////////////////////////////////////////////////////////////////////////////
63    group { name: "elm/button/base/style1";
64       alias: "elm/button/base/text_only/style1";
65       alias: "elm/button/base/center";
66       alias: "elm/button/base/icon_and_text/center";
67       alias: "elm/button/base/nocontents/search_button";
68       images {
69          image: GE_EDC_IMAGE_BTN_01_NORMAL COMP;
70          image: GE_EDC_IMAGE_BTN_01_PRESS COMP;
71          image: GE_EDC_IMAGE_BTN_01_DIM COMP;
72       }
73       script {
74          public button_state = BUTTON_STATE_ENABLED;
75       }
76       parts {
77          part { name: "button_image";
78             scale: 1;
79             description { state: "default" 0.0;
80                image {
81                   normal: GE_EDC_IMAGE_BTN_01_NORMAL;
82                   border: BUTTON_TEXT_STYLE1_BG_BORDER_INC;
83                   border_scale: 1;
84                }
85             }
86             description { state: "clicked" 0.0;
87                inherit: "default" 0.0;
88                image.normal: GE_EDC_IMAGE_BTN_01_PRESS;
89             }
90             description { state: "disabled" 0.0;
91                inherit: "default" 0.0;
92                image.normal: GE_EDC_IMAGE_BTN_01_DIM;
93             }
94             description { state: "focused" 0.0;
95                inherit: "default" 0.0;
96                image.normal: GE_EDC_IMAGE_BTN_01_PRESS;
97             }
98          }
99          part { name: "padding_left_top";
100             type: RECT;
101             scale: 1;
102             mouse_events: 0;
103             description { state: "default" 0.0;
104                align: 0.0 0.0;
105                rel2.relative: 0.0 0.0;
106                min: BUTTON_TEXT_STYLE1_PADDING_MIN_INC;
107                fixed: 1 1;
108                visible: 0;
109             }
110          }
111          part { name: "bg";
112             type: RECT;
113             scale: 1;
114             mouse_events: 0;
115             description { state: "default" 0.0;
116                min: BUTTON_TEXT_STYLE1_BG_MIN_INC;
117                visible: 0;
118             }
119             description { state: "visible" 0.0;
120                inherit: "default" 0.0;
121                min: BUTTON_TEXT_STYLE1_VISIBLE_BG_MIN_INC;
122             }
123             description { state: "icononly" 0.0;
124                inherit: "default" 0.0;
125                min: BUTTON_TEXT_STYLE1_ICONONLY_BG_MIN_INC;
126             }
127          }
128          part { name: "padding_right_bottom";
129             type: RECT;
130             scale: 1;
131             mouse_events: 0;
132             description { state: "default" 0.0;
133                align: 1.0 1.0;
134                rel1.relative: 1.0 1.0;
135                min: BUTTON_TEXT_STYLE1_PADDING_MIN_INC;
136                fixed: 1 1;
137                visible: 0;
138             }
139          }
140          part { name: "icon_rect";
141             type: RECT;
142             scale: 1;
143             mouse_events: 0;
144             description { state: "default" 0.0;
145                visible: 0;
146                min: 0 0;
147                fixed: 1 0;
148                rel1 {
149                   relative: 1.0 1.0;
150                   to: "padding_left_top";
151                }
152                rel2 {
153                   relative: 1.0 0.0;
154                   to_x: "padding_left_top";
155                   to_y: "padding_right_bottom";
156                }
157                align: 0.0 0.5;
158             }
159             description { state: "visible" 0.0;
160                visible: 0;
161                min: BUTTON_TEXT_STYLE1_VISIBLE_ICON_RECT_MIN_MAX_INC;
162                max: BUTTON_TEXT_STYLE1_VISIBLE_ICON_RECT_MIN_MAX_INC;
163                fixed: 1 0;
164                rel1 {
165                   relative: 1.0 1.0;
166                   to: "padding_left_top";
167                }
168                rel2 {
169                   relative: 1.0 0.0;
170                   to_x: "padding_left_top";
171                   to_y: "padding_right_bottom";
172                }
173                align: 0.0 0.5;
174             }
175             description { state: "icononly" 0.0;
176                inherit: "default" 0.0;
177             }
178          }
179          part { name: "padding_after_icon";
180             type: RECT;
181             scale: 1;
182             mouse_events: 0;
183             description { state: "default" 0.0; //when only icon or no icon is there
184                align: 0.0 0.0;
185                rel1 {
186                   relative: 1.0 0.0;
187                   to: "icon_rect";
188                }
189                rel2.to: "icon_rect";
190                fixed: 1 0;
191                min: 0 0;
192                visible: 0;
193             }
194             description { state: "visible" 0.0;
195                visible: 0;
196                align: 0.0 0.0;
197                rel1 {
198                   relative: 1.0 0.0;
199                   to: "icon_rect";
200                }
201                rel2.to: "icon_rect";
202                fixed: 1 0;
203                min: BUTTON_TEXT_STYLE1_VISIBLE_PADDING_ICON_TEXT_MIN_INC;
204             }
205             description { state: "icononly" 0.0;
206                inherit: "default" 0.0;
207             }
208          }
209          part { name: "padding_before_text";
210             type: RECT;
211             scale: 1;
212             mouse_events: 0;
213             description { state: "default" 0.0; //when only icon or no icon is there
214                align: 1.0 0.5;
215                rel1 {
216                   relative: 0.0 1.0;
217                   to_x: "elm.text";
218                   to_y: "padding_left_top";
219                }
220                rel2 {
221                   relative: 0.0 0.0;
222                   to_x: "elm.text";
223                   to_y: "padding_right_bottom";
224                }
225                fixed: 1 0;
226                min: BUTTON_TEXT_STYLE1_VISIBLE_PADDING_ICON_TEXT_MIN_INC;
227                visible: 0;
228             }
229          }
230          part { name: "elm.swallow.content";
231             type: SWALLOW;
232             scale: 1;
233             clip_to: "clipper";
234             description { state: "default" 0.0;
235                visible: 0;
236                align: 0.0 0.5;
237                rel1 {
238                   relative: 1.0 1.0;
239                   to: "padding_left_top";
240                }
241                rel2 {
242                   relative: 1.0 0.0;
243                   to_x: "padding_left_top";
244                   to_y: "padding_right_bottom";
245                }
246                fixed: 1 0;
247             }
248             description { state: "visible" 0.0;
249                fixed: 1 0;
250                min: BUTTON_TEXT_STYLE1_VISIBLE_ICON_MIN_MAX_INC;
251                max: BUTTON_TEXT_STYLE1_VISIBLE_ICON_MIN_MAX_INC;
252                align: 1.0 0.5;
253                rel1 {
254                   relative: 0.0 1.0;
255                   to_x: "padding_before_text";
256                   to_y: "padding_left_top";
257                }
258                rel2 {
259                   relative: 0.0 0.0;
260                   to_x: "padding_before_text";
261                   to_y: "padding_right_bottom";
262                }
263             }
264             description { state: "icononly" 0.0;
265                min: BUTTON_TEXT_STYLE1_ICONONLY_ICON_MIN_MAX_INC;
266                max: BUTTON_TEXT_STYLE1_ICONONLY_ICON_MIN_MAX_INC;
267             }
268          }
269          part { name: "elm.text";
270             type: TEXT;
271             mouse_events: 0;
272             scale: 1;
273             clip_to: "clipper";
274             description { state: "default" 0.0;
275                visible: 0;
276                rel1 {
277                   relative: 1.0 1.0;
278                   to_x: "padding_after_icon";
279                   to_y: "padding_left_top";
280                }
281                rel2 {
282                   relative: 0.0 0.0;
283                   to: "padding_right_bottom";
284                }
285                color: BUTTON_TEXT_STYLE1_NORMAL_COLOR_INC;
286                text {
287                   font: "HelveticaNeue:style=Medium";
288                   size: BUTTON_TEXT_STYLE1_FONT_SIZE_INC;
289                   min: 0 0;
290                   max: 1 0;
291                }
292             }
293             description { state: "visible" 0.0;
294                inherit: "default" 0.0;
295                visible: 1;
296             }
297             description { state: "clicked" 0.0;
298                inherit: "default" 0.0;
299                visible: 1;
300                color: BUTTON_TEXT_STYLE1_PRESSED_COLOR_INC;
301             }
302             description { state: "disabled" 0.0;
303                inherit: "default" 0.0;
304                color: 0 0 0 128;
305             }
306             description { state: "disabled_visible" 0.0;
307                inherit: "default" 0.0;
308                color: BUTTON_TEXT_STYLE1_DISABLED_COLOR_INC;
309                visible: 1;
310             }
311             description { state: "focused" 0.0;
312                inherit: "default" 0.0;
313                visible: 1;
314                color: BUTTON_TEXT_STYLE1_FOCUSED_COLOR_INC;
315             }
316          }
317          part { name: "over2";
318             type: RECT;
319             repeat_events: 1;
320             ignore_flags: ON_HOLD;
321             description { state: "default" 0.0;
322                color: 0 0 0 0;
323             }
324          }
325          part { name: "over3";
326             type: RECT;
327             repeat_events: 1;
328             description { state: "default" 0.0;
329                color: 0 0 0 0;
330             }
331          }
332          part { name: "clipper";
333             type: RECT;
334             description { state: "default" 0.0;
335                color: 255 255 255 255;
336             }
337          }
338          part { name: "disabler";
339             type: RECT;
340             description { state: "default" 0.0;
341                color: 0 0 0 0;
342                visible: 0;
343             }
344             description { state: "disabled" 0.0;
345                inherit: "default" 0.0;
346                visible: 1;
347             }
348          }
349       }
350       programs {
351          program { name: "button_click";
352             signal: "mouse,down,1";
353             source: "over2";
354             action: SIGNAL_EMIT "elm,action,press" "";
355             after: "button_click_anim";
356          }
357          program { name: "button_click_anim";
358             action: STATE_SET "clicked" 0.0;
359             target: "button_image";
360             after: "text_clicked";
361          }
362          program { name: "text_clicked";
363             script {
364                new st[31];
365                new Float:vl;
366                get_state(PART:"elm.text", st, 30, vl);
367                if (!strcmp(st, "visible"))
368                  set_state(PART:"elm.text", "clicked", 0.0);
369             }
370          }
371          program { name: "button_unpress";
372             action: SIGNAL_EMIT "elm,action,unpress" "";
373          }
374          program { name: "button_mouseout_clicked";
375             signal: "mouse,up,1";
376             source: "over3";
377             script {
378                new st[31];
379                new Float:vl;
380                get_state(PART:"elm.swallow.content", st, 30, vl);
381                if (strcmp(st, "icononly"))
382                  {
383                     emit("elm,action,default,text,set", "");
384                     set_state(PART:"elm.text", "visible", 0.0);
385                  }
386                if (get_int(button_state) != BUTTON_STATE_DISABLED)
387                  set_state(PART:"button_image", "default", 0.0);
388             }
389             after: button_unpress;
390          }
391          program { name: "button_unclick3";
392             signal: "mouse,clicked,1";
393             source: "over2";
394             action: SIGNAL_EMIT "elm,action,click" "";
395          }
396          program { name: "text_show";
397             signal: "elm,state,text,visible";
398             source: "elm";
399             script {
400                new st[31];
401                new Float:vl;
402                get_state(PART:"elm.swallow.content", st, 30, vl);
403                if (!strcmp(st, "icononly"))
404                  {
405                     set_state(PART:"elm.swallow.content", "visible", 0.0);
406                     set_state(PART:"icon_rect", "visible", 0.0);
407                     set_state(PART:"padding_after_icon", "visible", 0.0);
408                     set_state(PART:"bg", "visible", 0.0);
409                  }
410                if (get_int(button_state) != BUTTON_STATE_DISABLED)
411                  set_state(PART:"elm.text", "visible", 0.0);
412                else
413                  set_state(PART:"elm.text", "disabled_visible", 0.0);
414             }
415          }
416          program { name: "text_hide";
417             signal: "elm,state,text,hidden";
418             source: "elm";
419             script {
420                new st[31];
421                new Float:vl;
422                get_state(PART:"elm.swallow.content", st, 30, vl);
423                if (!strcmp(st, "visible"))
424                  {
425                     set_state(PART:"elm.swallow.content", "icononly", 0.0);
426                     set_state(PART:"icon_rect", "icononly", 0.0);
427                     set_state(PART:"padding_after_icon", "icononly", 0.0);
428                     set_state(PART:"bg", "icononly", 0.0);
429                  }
430                set_state(PART:"elm.text", "default", 0.0);
431             }
432          }
433          program { name: "icon_show";
434             signal: "elm,state,icon,visible";
435             source: "elm";
436             script {
437                new st[31];
438                new Float:vl;
439                get_state(PART:"elm.text", st, 30, vl);
440                if (!strcmp(st, "visible"))
441                  {
442                     set_state(PART:"elm.swallow.content", "visible", 0.0);
443                     set_state(PART:"icon_rect", "visible", 0.0);
444                     set_state(PART:"padding_after_icon", "visible", 0.0);
445                     set_state(PART:"bg", "visible", 0.0);
446                  }
447                else
448                  {
449                     set_state(PART:"elm.swallow.content", "icononly", 0.0);
450                     set_state(PART:"icon_rect", "icononly", 0.0);
451                     set_state(PART:"padding_after_icon", "icononly", 0.0);
452                     set_state(PART:"bg", "icononly", 0.0);
453                  }
454             }
455          }
456          program { name: "icon_hide";
457             signal: "elm,state,icon,hidden";
458             source: "elm";
459             action: STATE_SET "default" 0.0;
460             target: "elm.swallow.content";
461             target: "padding_after_icon";
462             target: "icon_rect";
463             target: "bg";
464          }
465          program { name: "disable";
466             signal: "elm,state,disabled";
467             source: "elm";
468             action: STATE_SET "disabled" 0.0;
469             target: "button_image";
470             target: "disabler";
471             after: "disable_text";
472          }
473          program { name: "disable_text";
474             script {
475                new st[31];
476                new Float:vl;
477                get_state(PART:"elm.text", st, 30, vl);
478                if (!strcmp(st, "visible"))
479                  set_state(PART:"elm.text", "disabled_visible", 0.0);
480                else
481                  set_state(PART:"elm.text", "disabled", 0.0);
482                set_int(button_state, BUTTON_STATE_DISABLED);
483             }
484          }
485          program { name: "enable";
486             signal: "elm,state,enabled";
487             source: "elm";
488             action: STATE_SET "default" 0.0;
489             target: "button_image";
490             target: "disabler";
491             after: "enable_text";
492          }
493          program { name: "enable_text";
494             script {
495                new st[31];
496                new Float:vl;
497                get_state(PART:"elm.text", st, 30, vl);
498                if (!strcmp(st, "disabled_visible"))
499                  set_state(PART:"elm.text", "visible", 0.0);
500                else
501                  set_state(PART:"elm.text", "default", 0.0);
502                set_int(button_state, BUTTON_STATE_ENABLED);
503             }
504          }
505          program { name: "focused";
506             //signal: "elm,action,focus";
507             //source: "elm";
508             action: STATE_SET "focused" 0.0;
509             target: "button_image";
510             target: "elm.text";
511          }
512          program { name: "unfocused";
513             //signal: "elm,action,unfocus";
514             //source: "elm";
515             action: STATE_SET "default" 0.0;
516             target: "button_image";
517             after: "unfocus_text";
518          }
519          program { name: "unfocus_text";
520             action: STATE_SET "visible" 0.0;
521             target: "elm.text";
522          }
523       }
524    }
525    ///////////////////////////////////////////////////////////////////////////////////////
526    group { name: "elm/button/base/naviframe/back_btn/gallery_efl";
527        alias: "elm/button/base/naviframe/back_btn/default";
528        alias: "elm/button/base/naviframe/prev_btn/default";
529        alias: "elm/button/base/naviframe/end_btn/default";
530        images {
531          image: GE_EDC_IMAGE_BTN_PREV COMP;
532          image: GE_EDC_IMAGE_BTN_PREV_PRESS COMP;
533          image: GE_EDC_IMAGE_PREV COMP;
534       }
535       script {
536          public button_state = BUTTON_STATE_ENABLED;
537       }
538       parts {
539          part { name: "button_image";
540             scale: 1;
541             description { state: "default" 0.0;
542                min: BUTTON_NAVIFRAME_BACK_BUTTON_BG_MIN_MAX_INC;
543                max: BUTTON_NAVIFRAME_BACK_BUTTON_BG_MIN_MAX_INC;
544                image {
545                   normal: GE_EDC_IMAGE_BTN_PREV;
546                   border: BUTTON_NAVIFRAME_BACK_BUTTON_BG_BORDER_INC;
547                   border_scale: 1;
548                }
549             }
550             description { state: "clicked" 0.0;
551                inherit: "default" 0.0;
552                image.normal: GE_EDC_IMAGE_BTN_PREV_PRESS;
553             }
554             description { state: "disabled" 0.0;
555                inherit: "default" 0.0;
556             }
557             description { state: "focused" 0.0;
558                inherit: "default" 0.0;
559                image.normal: GE_EDC_IMAGE_BTN_PREV_PRESS;
560             }
561          }
562          part { name: "back_button";
563             scale: 1;
564             mouse_events: 0;
565             description { state: "default" 0.0;
566                min: BUTTON_NAVIFRAME_BACK_BUTTON_MIN_MAX_INC;
567                max: BUTTON_NAVIFRAME_BACK_BUTTON_MIN_MAX_INC;
568                rel1.to: "button_image";
569                rel2.to: "button_image";
570                image.normal: GE_EDC_IMAGE_PREV;
571             }
572             description { state: "clicked" 0.0;
573                inherit: "default" 0.0;
574             }
575          }
576          part { name: "over2";
577             type: RECT;
578             repeat_events: 1;
579             ignore_flags: ON_HOLD;
580             description { state: "default" 0.0;
581                color: 0 0 0 0;
582             }
583          }
584          part { name: "over3";
585             type: RECT;
586             repeat_events: 1;
587             description { state: "default" 0.0;
588                color: 0 0 0 0;
589             }
590          }
591          part { name: "disabler";
592             type: RECT;
593             description { state: "default" 0.0;
594                color: 0 0 0 0;
595                visible: 0;
596             }
597             description { state: "disabled" 0.0;
598                inherit: "default" 0.0;
599                visible: 1;
600             }
601          }
602       }
603       programs {
604          program { name: "button_click";
605             signal: "mouse,down,1";
606             source: "over2";
607             action: SIGNAL_EMIT "elm,action,press" "";
608             after: "button_click_anim";
609          }
610          program { name: "button_click_anim";
611             action: STATE_SET "clicked" 0.0;
612             target: "button_image";
613          }
614          program { name: "button_unpress";
615             action: SIGNAL_EMIT "elm,action,unpress" "";
616          }
617          program { name: "button_mouseout_clicked";
618             signal: "mouse,up,1";
619             source: "over3";
620             script {
621                if (get_int(button_state) != BUTTON_STATE_DISABLED)
622                  set_state(PART:"button_image", "default", 0.0);
623             }
624             after: button_unpress;
625          }
626          program { name: "button_unclick3";
627             signal: "mouse,clicked,1";
628             source: "over2";
629             action: SIGNAL_EMIT "elm,action,click" "";
630          }
631          program { name: "disable";
632             signal: "elm,state,disabled";
633             source: "elm";
634             action: STATE_SET "disabled" 0.0;
635             target: "button_image";
636             target: "disabler";
637             after: "disable_button";
638          }
639          program { name: "disable_button";
640             script {
641                set_int(button_state, BUTTON_STATE_DISABLED);
642             }
643          }
644          program { name: "enable";
645             signal: "elm,state,enabled";
646             source: "elm";
647             action: STATE_SET "default" 0.0;
648             target: "button_image";
649             target: "disabler";
650             after: "enable_button";
651          }
652          program { name: "enable_button";
653             script {
654                set_int(button_state, BUTTON_STATE_ENABLED);
655             }
656          }
657       }
658    }
659
660 ///////////////////////////////////////////////////////////////////////////////////////
661    group { name: "elm/button/base/naviframe/title/gallery_efl";
662         alias: "elm/button/base/naviframe/title/default";
663
664       images {
665          image: GE_EDC_IMAGE_TITLE_BTN COMP;
666          image: GE_EDC_IMAGE_TITLE_BTN_PRESS COMP;
667       }
668       script {
669          public button_state = BUTTON_STATE_ENABLED;
670       }
671       parts {
672          part { name: "button_image";
673             scale: 1;
674             description { state: "default" 0.0;
675                min: BUTTON_NAVIFRAME_TITLE_BUTTON_MIN_INC;
676                max: BUTTON_NAVIFRAME_TITLE_BUTTON_MIN_INC;
677                image {
678                   normal: GE_EDC_IMAGE_TITLE_BTN;
679                   border: BUTTON_NAVIFRAME_BG_BORDER_INC;
680                   border_scale: 1;
681                }
682             }
683             description { state: "clicked" 0.0;
684                inherit: "default" 0.0;
685                image.normal: GE_EDC_IMAGE_TITLE_BTN_PRESS;
686             }
687             description { state: "disabled" 0.0;
688                inherit: "default" 0.0;
689                color: 0 0 0 128;
690             }
691             description { state: "focused" 0.0;
692                inherit: "default" 0.0;
693                image.normal: GE_EDC_IMAGE_TITLE_BTN_PRESS;
694             }
695          }
696          part { name: "padding_left_top";
697             type: RECT;
698             scale: 1;
699             mouse_events: 0;
700             description { state: "default" 0.0;
701                align: 0.0 0.0;
702                rel2.relative: 0.0 0.0;
703                min: BUTTON_NAVIFRAME_PADDING_MIN_INC;
704                fixed: 1 1;
705                visible: 0;
706             }
707          }
708          part { name: "bg";
709             type: RECT;
710             scale: 1;
711             mouse_events: 0;
712             description { state: "default" 0.0;
713                min: BUTTON_NAVIFRAME_BG_MIN_INC;
714                visible: 0;
715             }
716             description { state: "visible" 0.0;
717                inherit: "default" 0.0;
718                min: BUTTON_NAVIFRAME_VISIBLE_BG_MIN_INC;
719             }
720             description { state: "icononly" 0.0;
721                inherit: "default" 0.0;
722                min: BUTTON_NAVIFRAME_ICONONLY_BG_MIN_INC;
723             }
724          }
725          part { name: "padding_right_bottom";
726             type: RECT;
727             scale: 1;
728             mouse_events: 0;
729             description { state: "default" 0.0;
730                align: 1.0 1.0;
731                rel1.relative: 1.0 1.0;
732                min: BUTTON_NAVIFRAME_PADDING_MIN_INC;
733                fixed: 1 1;
734                visible: 0;
735             }
736          }
737          part { name: "icon_rect";
738             type: RECT;
739             scale: 1;
740             mouse_events: 0;
741             description { state: "default" 0.0;
742                visible: 0;
743                min: 0 0;
744                fixed: 1 0;
745                rel1 {
746                   relative: 1.0 1.0;
747                   to: "padding_left_top";
748                }
749                rel2 {
750                   relative: 1.0 0.0;
751                   to_x: "padding_left_top";
752                   to_y: "padding_right_bottom";
753                }
754                align: 0.0 0.5;
755             }
756             description { state: "visible" 0.0;
757                visible: 0;
758                min: BUTTON_NAVIFRAME_VISIBLE_ICON_RECT_MIN_MAX_INC;
759                max: BUTTON_NAVIFRAME_VISIBLE_ICON_RECT_MIN_MAX_INC;
760                fixed: 1 0;
761                rel1 {
762                   relative: 1.0 1.0;
763                   to: "padding_left_top";
764                }
765                rel2 {
766                   relative: 1.0 0.0;
767                   to_x: "padding_left_top";
768                   to_y: "padding_right_bottom";
769                }
770                align: 0.0 0.5;
771             }
772             description { state: "icononly" 0.0;
773                inherit: "default" 0.0;
774             }
775          }
776          part { name: "padding_after_icon";
777             type: RECT;
778             scale: 1;
779             mouse_events: 0;
780             description { state: "default" 0.0; //when only icon or no icon is there
781                align: 0.0 0.0;
782                rel1 {
783                   relative: 1.0 0.0;
784                   to: "icon_rect";
785                }
786                rel2.to: "icon_rect";
787                fixed: 1 0;
788                min: 0 0;
789                visible: 0;
790             }
791             description { state: "visible" 0.0;
792                visible: 0;
793                align: 0.0 0.0;
794                rel1 {
795                   relative: 1.0 0.0;
796                   to: "icon_rect";
797                }
798                rel2.to: "icon_rect";
799                fixed: 1 0;
800                min: BUTTON_NAVIFRAME_VISIBLE_PADDING_ICON_TEXT_MIN_INC;
801             }
802             description { state: "icononly" 0.0;
803                inherit: "default" 0.0;
804             }
805          }
806          part { name: "padding_before_text";
807             type: RECT;
808             scale: 1;
809             mouse_events: 0;
810             description { state: "default" 0.0; //when only icon or no icon is there
811                align: 1.0 0.5;
812                rel1 {
813                   relative: 0.0 1.0;
814                   to_x: "elm.text";
815                   to_y: "padding_left_top";
816                }
817                rel2 {
818                   relative: 0.0 0.0;
819                   to_x: "elm.text";
820                   to_y: "padding_right_bottom";
821                }
822                fixed: 1 0;
823                min: BUTTON_NAVIFRAME_VISIBLE_PADDING_ICON_TEXT_MIN_INC;
824                visible: 0;
825             }
826          }
827          part { name: "elm.swallow.content";
828             type: SWALLOW;
829             scale: 1;
830             clip_to: "clipper";
831             description { state: "default" 0.0;
832                visible: 0;
833                align: 0.0 0.5;
834                rel1 {
835                   relative: 1.0 1.0;
836                   to: "padding_left_top";
837                }
838                rel2 {
839                   relative: 1.0 0.0;
840                   to_x: "padding_left_top";
841                   to_y: "padding_right_bottom";
842                }
843                fixed: 1 0;
844             }
845             description { state: "visible" 0.0;
846                fixed: 1 0;
847                min: BUTTON_NAVIFRAME_VISIBLE_ICON_MIN_MAX_INC;
848                max: BUTTON_NAVIFRAME_VISIBLE_ICON_MIN_MAX_INC;
849                align: 1.0 0.5;
850                rel1 {
851                   relative: 0.0 1.0;
852                   to_x: "padding_before_text";
853                   to_y: "padding_left_top";
854                }
855                rel2 {
856                   relative: 0.0 0.0;
857                   to_x: "padding_before_text";
858                   to_y: "padding_right_bottom";
859                }
860             }
861             description { state: "icononly" 0.0;
862                min: BUTTON_NAVIFRAME_ICONONLY_ICON_MIN_MAX_INC;
863                max: BUTTON_NAVIFRAME_ICONONLY_ICON_MIN_MAX_INC;
864             }
865          }
866          part { name: "elm.text";
867             type: TEXT;
868             mouse_events: 0;
869             scale: 1;
870             clip_to: "clipper";
871             description { state: "default" 0.0;
872                visible: 0;
873                rel1 {
874                   relative: 1.0 1.0;
875                   to_x: "padding_after_icon";
876                   to_y: "padding_left_top";
877                }
878                rel2 {
879                   relative: 0.0 0.0;
880                   to: "padding_right_bottom";
881                }
882                color: BUTTON_TEXT_NAVIFRAME_NORMAL_COLOR_INC;
883                text {
884                   font: "HelveticaNeue:style=Medium";
885                   size: BUTTON_TEXT_NAVIFRAME_FONT_SIZE_INC;
886                   min: 0 0;
887                   max: 1 0;
888                }
889             }
890             description { state: "visible" 0.0;
891                inherit: "default" 0.0;
892                visible: 1;
893             }
894             description { state: "clicked" 0.0;
895                inherit: "default" 0.0;
896                visible: 1;
897                color: BUTTON_TEXT_NAVIFRAME_PRESSED_COLOR_INC;
898             }
899             description { state: "disabled" 0.0;
900                inherit: "default" 0.0;
901                color: 0 0 0 128;
902             }
903             description { state: "disabled_visible" 0.0;
904                inherit: "default" 0.0;
905                color: BUTTON_TEXT_NAVIFRAME_DISABLED_COLOR_INC;
906                visible: 1;
907             }
908             description { state: "focused" 0.0;
909                inherit: "default" 0.0;
910                visible: 1;
911                color: BUTTON_TEXT_NAVIFRAME_FOCUSED_COLOR_INC;
912             }
913          }
914          part { name: "over2";
915             type: RECT;
916             repeat_events: 1;
917             ignore_flags: ON_HOLD;
918             description { state: "default" 0.0;
919                color: 0 0 0 0;
920             }
921          }
922          part { name: "over3";
923             type: RECT;
924             repeat_events: 1;
925             description { state: "default" 0.0;
926                color: 0 0 0 0;
927             }
928          }
929          part { name: "clipper";
930             type: RECT;
931             description { state: "default" 0.0;
932                color: 255 255 255 255;
933             }
934          }
935          part { name: "disabler";
936             type: RECT;
937             description { state: "default" 0.0;
938                color: 0 0 0 0;
939                visible: 0;
940             }
941             description { state: "disabled" 0.0;
942                inherit: "default" 0.0;
943                visible: 1;
944             }
945          }
946       }
947       programs {
948          program { name: "button_click";
949             signal: "mouse,down,1";
950             source: "over2";
951             action: SIGNAL_EMIT "elm,action,press" "";
952             after: "button_click_anim";
953          }
954          program { name: "button_click_anim";
955             action: STATE_SET "clicked" 0.0;
956             target: "button_image";
957             after: "text_clicked";
958          }
959          program { name: "text_clicked";
960             script {
961                new st[31];
962                new Float:vl;
963                get_state(PART:"elm.text", st, 30, vl);
964                if (!strcmp(st, "visible"))
965                  set_state(PART:"elm.text", "clicked", 0.0);
966             }
967          }
968          program { name: "button_unpress";
969             action: SIGNAL_EMIT "elm,action,unpress" "";
970          }
971          program { name: "button_mouseout_clicked";
972             signal: "mouse,up,1";
973             source: "over3";
974             script {
975                new st[31];
976                new Float:vl;
977                get_state(PART:"elm.swallow.content", st, 30, vl);
978                if (strcmp(st, "icononly"))
979                  {
980                     emit("elm,action,default,text,set", "");
981                     set_state(PART:"elm.text", "visible", 0.0);
982                  }
983                if (get_int(button_state) != BUTTON_STATE_DISABLED)
984                  set_state(PART:"button_image", "default", 0.0);
985             }
986             after: button_unpress;
987          }
988          program { name: "button_unclick3";
989             signal: "mouse,clicked,1";
990             source: "over2";
991             action: SIGNAL_EMIT "elm,action,click" "";
992          }
993          program { name: "text_show";
994             signal: "elm,state,text,visible";
995             source: "elm";
996             script {
997                new st[31];
998                new Float:vl;
999                get_state(PART:"elm.swallow.content", st, 30, vl);
1000                if (!strcmp(st, "icononly"))
1001                  {
1002                     set_state(PART:"elm.swallow.content", "visible", 0.0);
1003                     set_state(PART:"icon_rect", "visible", 0.0);
1004                     set_state(PART:"padding_after_icon", "visible", 0.0);
1005                     set_state(PART:"bg", "visible", 0.0);
1006                  }
1007                if (get_int(button_state) != BUTTON_STATE_DISABLED)
1008                  set_state(PART:"elm.text", "visible", 0.0);
1009                else
1010                  set_state(PART:"elm.text", "disabled_visible", 0.0);
1011             }
1012          }
1013          program { name: "text_hide";
1014             signal: "elm,state,text,hidden";
1015             source: "elm";
1016             script {
1017                new st[31];
1018                new Float:vl;
1019                get_state(PART:"elm.swallow.content", st, 30, vl);
1020                if (!strcmp(st, "visible"))
1021                  {
1022                     set_state(PART:"elm.swallow.content", "icononly", 0.0);
1023                     set_state(PART:"icon_rect", "icononly", 0.0);
1024                     set_state(PART:"padding_after_icon", "icononly", 0.0);
1025                     set_state(PART:"bg", "icononly", 0.0);
1026                  }
1027                set_state(PART:"elm.text", "default", 0.0);
1028             }
1029          }
1030          program { name: "icon_show";
1031             signal: "elm,state,icon,visible";
1032             source: "elm";
1033             script {
1034                new st[31];
1035                new Float:vl;
1036                get_state(PART:"elm.text", st, 30, vl);
1037                if (!strcmp(st, "visible"))
1038                  {
1039                     set_state(PART:"elm.swallow.content", "visible", 0.0);
1040                     set_state(PART:"icon_rect", "visible", 0.0);
1041                     set_state(PART:"padding_after_icon", "visible", 0.0);
1042                     set_state(PART:"bg", "visible", 0.0);
1043                  }
1044                else
1045                  {
1046                     set_state(PART:"elm.swallow.content", "icononly", 0.0);
1047                     set_state(PART:"icon_rect", "icononly", 0.0);
1048                     set_state(PART:"padding_after_icon", "icononly", 0.0);
1049                     set_state(PART:"bg", "icononly", 0.0);
1050                  }
1051             }
1052          }
1053          program { name: "icon_hide";
1054             signal: "elm,state,icon,hidden";
1055             source: "elm";
1056             action: STATE_SET "default" 0.0;
1057             target: "elm.swallow.content";
1058             target: "padding_after_icon";
1059             target: "icon_rect";
1060             target: "bg";
1061          }
1062          program { name: "disable";
1063             signal: "elm,state,disabled";
1064             source: "elm";
1065             action: STATE_SET "disabled" 0.0;
1066             target: "button_image";
1067             target: "disabler";
1068             after: "disable_text";
1069          }
1070          program { name: "disable_text";
1071             script {
1072                new st[31];
1073                new Float:vl;
1074                get_state(PART:"elm.text", st, 30, vl);
1075                if (!strcmp(st, "visible"))
1076                  set_state(PART:"elm.text", "disabled_visible", 0.0);
1077                else
1078                  set_state(PART:"elm.text", "disabled", 0.0);
1079                set_int(button_state, BUTTON_STATE_DISABLED);
1080             }
1081          }
1082          program { name: "enable";
1083             signal: "elm,state,enabled";
1084             source: "elm";
1085             action: STATE_SET "default" 0.0;
1086             target: "button_image";
1087             target: "disabler";
1088             after: "enable_text";
1089          }
1090          program { name: "enable_text";
1091             script {
1092                new st[31];
1093                new Float:vl;
1094                get_state(PART:"elm.text", st, 30, vl);
1095                if (!strcmp(st, "disabled_visible"))
1096                  set_state(PART:"elm.text", "visible", 0.0);
1097                else
1098                  set_state(PART:"elm.text", "default", 0.0);
1099                set_int(button_state, BUTTON_STATE_ENABLED);
1100             }
1101          }
1102          program { name: "focused";
1103             //signal: "elm,action,focus";
1104             //source: "elm";
1105             action: STATE_SET "focused" 0.0;
1106             target: "button_image";
1107             target: "elm.text";
1108          }
1109          program { name: "unfocused";
1110             //signal: "elm,action,unfocus";
1111             //source: "elm";
1112             action: STATE_SET "default" 0.0;
1113             target: "button_image";
1114             after: "unfocus_text";
1115          }
1116          program { name: "unfocus_text";
1117             action: STATE_SET "visible" 0.0;
1118             target: "elm.text";
1119          }
1120       }
1121    }
1122 #undef BUTTON_STATE_ENABLED
1123 #undef BUTTON_STATE_DISABLED
1124