[toolbar] fixed edc signal processing for default toolbar
[platform/core/uifw/efl-theme-tizen.git] / themes / widgets / toolbar.edc
1 /*
2  * efl-theme-tizen
3  * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4  *
5  * Licensed under the Apache License, Version 2.0 (the License);
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an AS IS BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17
18
19
20 #define ITEM_STATE_ENABLED 0
21 #define ITEM_STATE_DISABLED 1
22 #define TOOLBAR_SLIDING_PER_FPS     2
23 #define TOOLBAR_SLIDING_FPS         40.0
24 #define TOOLBAR_SLIDING_TEXT_GAP    40
25 #define TOOLBAR_SLIDING_TEXT_OFFSET 5
26
27 #define TOOLBAR_TEXT_STYLE(_font_size) \
28    style { name: "toolbar_text_style_"_font_size; \
29       base: "font=Tizen:style=Bold style=far_shadow,bottom shadow_color=#000000be font_size="_font_size" align=center color="TOOLBAR_ITEM_TEXTBLOCK_COLOR_INC" wrap=word ellipsis=1 text_class=tizen linegap=0"; \
30       tag: "br" "\n"; \
31       tag: "ps" "ps"; \
32       tag: "hilight" "+ font=Tizen:style=Bold"; \
33       tag: "b" "+ font=Tizen:style=Bold"; \
34       tag: "tab" "\t"; \
35    }
36
37 #define TABBAR_TEXT_STYLE(_font_size) \
38    style { name: "tabbar_text_style_"_font_size; \
39       base: "font=Tizen:style=Bold style=far_shadow,bottom shadow_color=#000000ff font_size="_font_size" align=center color="TABBAR_ITEM_TEXTBLOCK_COLOR_INC" wrap=word ellipsis=1 text_class=tizen linegap=0"; \
40       tag: "br" "\n"; \
41       tag: "ps" "ps"; \
42       tag: "hilight" "+ font=Tizen:style=Bold"; \
43       tag: "b" "+ font=Tizen:style=Bold"; \
44       tag: "tab" "\t"; \
45    }
46
47 #define TOOLBAR_SELECTED_TEXT_STYLE(_font_size) \
48    style { name: "toolbar_selected_text_style_"_font_size; \
49       base: "font=Tizen:style=Bold style=far_shadow,bottom shadow_color=#000000ff font_size="_font_size" align=center color="TABBAR_ITEM_SELECTED_TEXTBLOCK_COLOR_INC" wrap=word ellipsis=1 text_class=tizen linegap=0"; \
50       tag: "br" "\n"; \
51       tag: "ps" "ps"; \
52       tag: "hilight" "+ font=Tizen:style=Bold"; \
53       tag: "b" "+ font=Tizen:style=Bold"; \
54       tag: "tab" "\t"; \
55    }
56
57 styles{
58    TABBAR_TEXT_STYLE(30)
59    TOOLBAR_TEXT_STYLE(36)
60 }
61
62 group { name: "elm/toolbar/base/default";
63    data {
64       item: "focus_highlight" "on";
65    }
66    images {
67        image: "00_toolbar_bg.png" COMP;
68    }
69    parts {
70       part { name: "base";
71          type: RECT;
72          mouse_events: 1;
73          description { state: "default" 0.0;
74          }
75       }
76       part { name: "base_bg";
77          type: IMAGE;
78          scale: 1;
79          description {
80             state: "default" 0.0;
81             rel1 {
82                 relative: 0.0 0.0;
83                 to: "base";
84             }
85             rel2 {
86                 relative: 1.0 1.0;
87                 to: "base";
88             }
89             image {
90                 normal: "00_toolbar_bg.png";
91                 border: TOOLBAR_ITEM_BG_DEFAULT_BORDER_INC;
92                 border_scale: 1;
93             }
94          }
95       }
96       part { name: "clipper";
97          type: RECT;
98          mouse_events: 0;
99          description {
100             state: "default" 0.0;
101             rel1 {
102                relative: 0.0 0.0;
103                to: "base";
104             }
105             rel2 {
106                relative: 1.0 1.0;
107                to: "base";
108             }
109          }
110       }
111       part { name: "elm.swallow.content";
112          clip_to: "clipper";
113          type: SWALLOW;
114          description {
115             state: "default" 0.0;
116             rel1.to: "clipper";
117             rel2.to: "clipper";
118          }
119       }
120       part { name: "event";
121          type: RECT;
122          mouse_events: 1;
123          repeat_events: 1;
124          description { state: "default" 0.0;
125             color: 0 0 0 0;
126          }
127       }
128    }
129 }
130
131 group { name: "elm/toolbar/item/default";
132    images {
133       image: "00_toolbar_press.png" COMP;
134       image: "00_tab_focus.png" COMP;
135    }
136
137    data.item: "transition_animation_on" "1";
138    script {
139       public item_state = ITEM_STATE_ENABLED;
140       public items_number = 0;
141    }
142    parts {
143       part { name: "bg";
144          type: IMAGE;
145          scale: 1;
146          mouse_events: 0;
147          description { state: "default" 0.0;
148             visible: 0;
149             image {
150                normal: "00_toolbar_press.png";
151                border: TOOLBAR_ITEM_BG_SELECTED_BORDER_INC;
152                border_scale: 1;
153             }
154          }
155          description { state: "selected" 0.0;
156             inherit: "default" 0.0;
157             visible: 1;
158          }
159          description { state: "disabled" 0.0;
160             inherit: "default" 0.0;
161             visible: 0;
162          }
163       }
164       part { name: "padding_left_top";
165          type: RECT;
166          scale: 1;
167          mouse_events: 0;
168          description { state: "default" 0.0;
169             align: 0.0 0.0;
170             rel2.relative: 0.0 0.0;
171             min: 0 0;
172             fixed: 1 1;
173             visible: 0;
174             color: 0 0 0 0;
175          }
176          description { state: "1_item" 0.0;
177             inherit: "default" 0.0;
178             min: 60 0;
179          }
180          description { state: "2_items" 0.0;
181             inherit: "default" 0.0;
182             min: 40 0;
183          }
184          description { state: "3_items" 0.0;
185             inherit: "default" 0.0;
186             min: 20 0;
187          }
188       }
189       part { name: "padding_right_bottom";
190          type: RECT;
191          scale: 1;
192          mouse_events: 0;
193          description { state: "default" 0.0;
194             align: 1.0 1.0;
195             rel1.relative: 1.0 1.0;
196             min: 0 0;
197             fixed: 1 1;
198             visible: 0;
199             color: 0 0 0 0;
200          }
201          description { state: "1_item" 0.0;
202             inherit: "default" 0.0;
203             min: 60 0;
204          }
205          description { state: "2_items" 0.0;
206             inherit: "default" 0.0;
207             min: 40 0;
208          }
209          description { state: "3_items" 0.0;
210             inherit: "default" 0.0;
211             min: 20 0;
212          }
213       }
214       part { name: "elm.text";
215          type: TEXTBLOCK;
216          mouse_events: 0;
217          scale: 1;
218          clip_to: "elm.text.clipper";
219          description { state: "default" 0.0;
220             visible: 0;
221             rel1 {
222                relative: 1.0 1.0;
223                to: "padding_left_top";
224             }
225             rel2 {
226                relative: 0.0 0.0;
227                to: "padding_right_bottom";
228             }
229             fixed: 1 1;
230             max: 9999 60;
231             text {
232                style: "toolbar_text_style_36";
233                min: 0 1;
234             }
235          }
236          description { state: "visible" 0.0;
237             inherit: "default" 0.0;
238             visible: 1;
239          }
240       }
241       part { name: "elm.text_new";
242          type: TEXTBLOCK;
243          mouse_events: 0;
244          scale: 1;
245          clip_to: "elm.text_new.clipper";
246          description { state: "default" 0.0;
247             visible: 0;
248             rel1 {
249                relative: 1.0 1.0;
250                to: "padding_left_top";
251             }
252             rel2 {
253                relative: 0.0 0.0;
254                to: "padding_right_bottom";
255             }
256             color: BUTTON_NAVIFRAME_DEFAULT_TEXT_COLOR_INC;
257             fixed: 1 1;
258             text {
259                style: "toolbar_text_style_36";
260                min: 0 1;
261             }
262          }
263          description { state: "visible" 0.0;
264             inherit: "default" 0.0;
265             visible: 1;
266          }
267       }
268       part { name: "elm.text.clipper";
269          type: RECT;
270          description { state: "default" 0.0;
271             color: 255 255 255 255;
272          }
273          description { state: "animation" 0.0;
274             color: 255 255 255 0;
275          }
276          description { state: "disabled" 0.0;
277             color: 255 255 255 153;
278          }
279       }
280       part { name: "elm.text_new.clipper";
281          type: RECT;
282          description { state: "default" 0.0;
283             color: 255 255 255 0;
284          }
285          description { state: "animation" 0.0;
286             color: 255 255 255 255;
287          }
288          description { state: "disabled" 0.0;
289             color: 255 255 255 153;
290          }
291       }
292       part { name: "divider";
293          type: RECT;
294          scale: 1;
295          description { state: "default" 0.0;
296             min: 2 78;
297             max: 2 78;
298             fixed: 1 1;
299             rel1 {
300                 relative: 1.0 0.5;
301             }
302             rel2 {
303                 relative: 1.0 0.5;
304             }
305          }
306          description { state: "hidden" 0.0;
307             inherit: "default" 0.0;
308             visible: 0;
309          }
310       }
311       part { name: "divider_left";
312          type: RECT;
313          clip_to: "divider";
314          description { state: "default" 0.0;
315             color: TABBAR_ITEM_DIVIDER_LEFT_COLOR_INC;
316             rel1 {
317                 relative: 0.0 0.0;
318                 to: "divider";
319             }
320             rel2 {
321                 relative: 0.5 1.0;
322                 to: "divider";
323             }
324          }
325       }
326       part { name: "divider_right";
327          type: RECT;
328          clip_to: "divider";
329          description { state: "default" 0.0;
330             color: TABBAR_ITEM_DIVIDER_RIGHT_COLOR_INC;
331             rel1 {
332                 relative: 0.5 0.0;
333                 to: "divider";
334             }
335             rel2 {
336                 relative: 1.0 1.0;
337                 to: "divider";
338             }
339          }
340       }
341       part { name: "event";
342          type: RECT;
343          mouse_events: 1;
344          ignore_flags: ON_HOLD;
345          description { state: "default" 0.0;
346             color: 0 0 0 0;
347          }
348       }
349       part { name: "event2";
350          type: RECT;
351          mouse_events: 1;
352          repeat_events: 1;
353          description { state: "default" 0.0;
354             color: 0 0 0 0;
355          }
356       }
357       part { name: "highlight";
358          type: IMAGE;
359          scale: 1;
360          description { state: "default" 0.0;
361             visible: 0;
362             image {
363                 normal: "00_tab_focus.png";
364                 border: 8 8 8 8;
365                 border_scale: 1;
366             }
367          }
368          description { state: "highlighted" 0.0;
369             inherit: "default" 0.0;
370             visible: 1;
371          }
372       }
373    }
374    programs {
375       program { name: "pressed";
376          signal:  "mouse,down,1";
377          source:  "event";
378          script {
379             if (get_int(item_state) != ITEM_STATE_DISABLED)
380               set_state(PART:"bg", "selected", 0.0);
381          }
382          transition: LINEAR 0.2;
383       }
384       program { name: "unpressed";
385          signal:  "mouse,up,1";
386          source:  "event2";
387          action:  STATE_SET "default" 0.0;
388          target:  "bg";
389          transition: LINEAR 0.1;
390       }
391       program { name: "go";
392          signal:  "mouse,clicked,1";
393          source:  "event";
394          action:  SIGNAL_EMIT "elm,action,click" "elm";
395          after: "play_sound";
396       }
397       program { name: "play_sound";
398          action: PLAY_SAMPLE "touch_sound" 1.0;
399       }
400       program { name: "mouse,in";
401          signal:  "mouse,in";
402          source:  "event";
403          action:  SIGNAL_EMIT "elm,mouse,in" "elm";
404       }
405       program { name: "mouse,out";
406          signal:  "mouse,out";
407          source:  "event";
408          action:  SIGNAL_EMIT "elm,mouse,out" "elm";
409       }
410       program { name: "disable";
411          signal: "elm,state,disabled";
412          source: "elm";
413          script {
414             set_int(item_state, ITEM_STATE_DISABLED);
415             set_state(PART:"bg", "disabled", 0.0);
416             set_state(PART:"elm.text.clipper", "disabled", 0.0);
417             run_program(PROGRAM:"label_set,animation,done");
418          }
419       }
420       program { name: "enable";
421          signal: "elm,state,enabled";
422          source: "elm";
423          script {
424             set_int(item_state, ITEM_STATE_ENABLED);
425             set_state(PART:"bg", "default", 0.0);
426             set_state(PART:"elm.text.clipper", "default", 0.0);
427             run_program(PROGRAM:"label_set,animation,done");
428          }
429       }
430       program { name: "label_set,animation,forward";
431          signal: "elm,state,label_set,forward";
432          source: "elm";
433          after: "label_set,sync";
434       }
435       program { name: "label_set,animation,backward";
436          signal: "elm,state,label_set,backward";
437          source: "elm";
438          after: "label_set,sync";
439       }
440       program { name: "label_set,sync";
441          signal: "elm,state,label_set";
442          source: "elm";
443          script {
444             new st[31];
445             new Float:vl;
446             get_state(PART:"elm.text", st, 30, vl);
447             set_state(PART:"elm.text_new", st, vl);
448          }
449          after: "label_set,animation";
450       }
451       program { name: "label_set,animation";
452          action: STATE_SET "animation" 0.0;
453          target: "elm.text.clipper";
454          target: "elm.text_new.clipper";
455          transition: LINEAR 0.2;
456          after: "label_set,animation,done";
457       }
458       program { name: "label_set,animation,done";
459          action: SIGNAL_EMIT "elm,state,label_set,done" "elm";
460       }
461       program { name: "label,reset";
462          signal: "elm,state,label,reset";
463          source: "elm";
464          script {
465             set_state(PART:"elm.text_new.clipper", "default", 0.0);
466             if (get_int(item_state) != ITEM_STATE_DISABLED)
467               set_state(PART:"elm.text.clipper", "default", 0.0);
468             else
469               set_state(PART:"elm.text.clipper", "disabled", 0.0);
470          }
471       }
472       program { name: "text_show";
473          signal: "elm,state,text,visible";
474          source: "elm";
475          script {
476                set_state(PART:"elm.text", "visible", 0.0);
477          }
478       }
479       program { name: "text_hide";
480          signal: "elm,state,text,hidden";
481          source: "elm";
482          script {
483             set_state(PART:"elm.text", "default", 0.0);
484          }
485       }
486       program { name: "text_only_item_1";
487          signal: "elm,number,item,1";
488          source: "elm";
489          script {
490             set_int(items_number, 1);
491             set_state(PART:"padding_left_top", "1_item", 0.0);
492             set_state(PART:"padding_right_bottom", "1_item", 0.0);
493          }
494       }
495       program { name: "text_only_item_2";
496          signal: "elm,number,item,2";
497          source: "elm";
498          script {
499             set_int(items_number, 2);
500             set_state(PART:"padding_left_top", "2_items", 0.0);
501             set_state(PART:"padding_right_bottom", "2_items", 0.0);
502          }
503       }
504       program { name: "text_only_item_3";
505          signal: "elm,number,item,3";
506          source: "elm";
507          script {
508             set_int(items_number, 3);
509             set_state(PART:"padding_left_top", "3_items", 0.0);
510             set_state(PART:"padding_right_bottom", "3_items", 0.0);
511          }
512       }
513       program { name: "divider_visible_1";
514          signal: "elm,order,first,item";
515          source: "elm";
516          action: STATE_SET "default" 0.0;
517          target: "divider";
518       }
519       program { name: "divider_visible_2";
520          signal: "elm,order,default,item";
521          source: "elm";
522          action: STATE_SET "default" 0.0;
523          target: "divider";
524       }
525       program { name: "divider_hidden";
526          signal: "elm,order,last,item";
527          source: "elm";
528          action: STATE_SET "hidden" 0.0;
529          target: "divider";
530       }
531       program { name: "highlight_on";
532          signal: "elm,highlight,on";
533          source: "elm";
534          action: STATE_SET "highlighted" 0.0;
535          target: "highlight";
536       }
537       program { name: "highlight_off";
538          signal: "elm,highlight,off";
539          source: "elm";
540          action: STATE_SET "default" 0.0;
541          target: "highlight";
542       }
543    }
544 }
545
546 group { name: "elm/toolbar/separator/default";
547    parts {
548       part { name: "divider";
549          type: RECT;
550          scale: 1;
551          description { state: "default" 0.0;
552             min: 2 88;
553             max: 2 88;
554             fixed: 1 1;
555             rel1 {
556                 relative: 0.5 0.5;
557             }
558             rel2 {
559                 relative: 0.5 0.5;
560             }
561          }
562       }
563       part { name: "divider_left";
564          type: RECT;
565          clip_to: "divider";
566          description { state: "default" 0.0;
567             color: TABBAR_ITEM_DIVIDER_LEFT_COLOR_INC;
568             rel1 {
569                 relative: 0.0 0.0;
570                 to: "divider";
571             }
572             rel2 {
573                 relative: 0.5 1.0;
574                 to: "divider";
575             }
576          }
577       }
578       part { name: "divider_right";
579          type: RECT;
580          clip_to: "divider";
581          description { state: "default" 0.0;
582             color: TABBAR_ITEM_DIVIDER_RIGHT_COLOR_INC;
583             rel1 {
584                 relative: 0.5 0.0;
585                 to: "divider";
586             }
587             rel2 {
588                 relative: 1.0 1.0;
589                 to: "divider";
590             }
591          }
592       }
593    }
594 }
595
596 group { name: "elm/toolbar/object/default";
597    parts {
598       part { name: "elm.swallow.object"; // object group
599          type: SWALLOW;
600          description {
601              state: "default" 0.0;
602          }
603       }
604    }
605 }
606
607 group { name: "elm/toolbar/base/tabbar";
608    data {
609       item: "focus_highlight" "on";
610    }
611    images {
612       image: "00_effect_tab_bounce_left.png" COMP;
613       image: "00_effect_tab_bounce_right.png" COMP;
614       image: "00_title_bg.png" COMP;
615    }
616    script {
617       public left_timer, right_timer;
618       public l_timer(val) {
619          emit("do-hide-left-shadow", "");
620          set_int(left_timer, 0);
621          return 0;
622       }
623       public r_timer(val) {
624          emit("do-hide-right-shadow", "");
625          set_int(right_timer, 0);
626          return 0;
627       }
628    }
629    parts {
630       part { name: "base";
631          type: RECT;
632          scale: 1;
633          description { state: "default" 0.0;
634          }
635       }
636       part { name: "base_bg";
637          type: IMAGE;
638          scale: 1;
639          description {
640             state: "default" 0.0;
641             rel1 {
642                 relative: 0.0 0.0;
643                 to: "base";
644             }
645             rel2 {
646                 relative: 1.0 1.0;
647                 to: "base";
648             }
649             image {
650                 normal: "00_title_bg.png";
651             }
652          }
653       }
654       part { name: "left_padding";
655          type: RECT;
656          mouse_events: 0;
657          scale: 1;
658          description {
659             state: "default" 0.0;
660             min: 0 0;
661             fixed: 1 1;
662             visible: 0;
663             align: 0.0 0.5;
664             rel1.to: "base";
665             rel2.to: "base";
666             rel1.relative: 0.0 0.0;
667             rel2.relative: 0.0 1.0;
668          }
669       }
670       part { name: "right_padding";
671          type: RECT;
672          mouse_events: 0;
673          scale: 1;
674          description {
675             state: "default" 0.0;
676             min: 0 0;
677             fixed: 1 1;
678             visible: 0;
679             align: 1.0 0.5;
680             rel1.to: "base";
681             rel2.to: "base";
682             rel1.relative: 1.0 0.0;
683             rel2.relative: 1.0 1.0;
684          }
685       }
686       part { name: "clipper";
687          type: RECT;
688          mouse_events: 0;
689          scale: 1;
690          description {
691             state: "default" 0.0;
692             rel1.to: "left_padding";
693             rel1.relative: 1.0 0.0;
694             rel2.to: "right_padding";
695             rel2.relative: 0.0 1.0;
696          }
697       }
698       part { name: "elm.swallow.content";
699          clip_to: "clipper";
700          type: SWALLOW;
701          scale: 1;
702          description {
703             state: "default" 0.0;
704             rel1.to: "clipper";
705             rel2.to: "clipper";
706          }
707       }
708       part { name: "left_shadow_clip";
709          type: RECT;
710          mouse_events: 0;
711          scale: 1;
712          description { state: "default" 0.0;
713             visible: 0;
714             color: 255 255 255 0;
715          }
716          description { state: "show" 0.0;
717          }
718       }
719       part { name: "right_shadow_clip";
720          type: RECT;
721          mouse_events: 0;
722          scale: 1;
723          description { state: "default" 0.0;
724             visible: 0;
725             color: 255 255 255 0;
726          }
727          description { state: "show" 0.0;
728          }
729       }
730       part { name: "shadow_left";
731          clip_to: "left_shadow_clip";
732          type: IMAGE;
733          scale: 1;
734          repeat_events: 1;
735          description { state: "default" 0.0;
736             min: 162 0;
737             fixed: 1 1;
738             align: 0.0 0.5;
739             color: 255 255 255 255;
740             rel1.relative: 0.0 0.0;
741             rel2.relative: 0.0 1.0;
742             image.normal: "00_effect_tab_bounce_left.png";
743          }
744       }
745       part { name: "shadow_right";
746          clip_to: "right_shadow_clip";
747          type: IMAGE;
748          scale: 1;
749          repeat_events: 1;
750          description { state: "default" 0.0;
751             min: 162 0;
752             fixed: 1 1;
753             align: 1.0 0.5;
754             color: 255 255 255 255;
755             rel1.relative: 1.0 0.0;
756             rel2.relative: 1.0 1.0;
757             image.normal: "00_effect_tab_bounce_right.png";
758          }
759       }
760    }
761    programs {
762       program { name: "load";
763          script {
764             set_int(left_timer, 0);
765             set_int(right_timer, 0);
766          }
767       }
768       program { name: "left_shadow_show";
769          signal: "do-show-left-shadow";
770          source: "";
771          action:  STATE_SET "show" 0.0;
772          transition: LINEAR 0.3;
773          target: "left_shadow_clip";
774       }
775       program { name: "left_shadow_hide";
776          signal: "do-hide-left-shadow";
777          source: "";
778          action:  STATE_SET "default" 0.0;
779          transition: LINEAR 0.3;
780          target: "left_shadow_clip";
781       }
782       program { name: "right_shadow_show";
783          signal: "do-show-right-shadow";
784          source: "";
785          action:  STATE_SET "show" 0.0;
786          transition: LINEAR 0.3;
787          target: "right_shadow_clip";
788       }
789       program { name: "right_shadow_hide";
790          signal: "do-hide-right-shadow";
791          source: "";
792          action:  STATE_SET "default" 0.0;
793          transition: LINEAR 0.3;
794          target: "right_shadow_clip";
795       }
796       program { name: "edge_left";
797          signal: "elm,edge,left";
798          source: "elm";
799          script {
800             new v;
801             v = get_int(left_timer);
802             if (!v) {
803                 emit("do-show-left-shadow", "");
804             }
805             if (v > 0) cancel_timer(v);
806             v = timer(0.5, "l_timer", 0);
807             set_int(left_timer, v);
808          }
809       }
810       program { name: "edge_right";
811          signal: "elm,edge,right";
812          source: "elm";
813          script {
814             new v;
815             v = get_int(right_timer);
816             if (!v) {
817                 emit("do-show-right-shadow", "");
818             }
819             if (v > 0) cancel_timer(v);
820             v = timer(0.5, "r_timer", 0);
821             set_int(right_timer, v);
822          }
823       }
824    }
825 }
826
827 group { name: "elm/toolbar/item/tabbar";
828    images {
829       image: "00_tab_press.png" COMP;
830       image: "00_badge_bg.png" COMP;
831       image: "00_tab_focus.png" COMP;
832       image: "00_tab_select_bar.png" COMP;
833       image: "00_effect_tab_text_dim_left.png" COMP;
834       image: "00_effect_tab_text_dim_right.png" COMP;
835    }
836
837    data.item: "transition_animation_on" "1";
838    script {
839       public item_state = ITEM_STATE_ENABLED;
840       public items_number = 0;
841       public sliding_timer;
842       public end_timer;
843       public text_w;
844       public org_text_w;
845       public loop_count = 0;
846
847       public get_width() {
848          new x, y, w, h;
849          set_state(PART:"elm.text", "visible", 0.0);
850          get_geometry(PART:"elm.text", x, y, w, h);
851          set_int(org_text_w, w);
852
853          set_state(PART:"elm.text", "sliding", 0.0);
854          get_geometry(PART:"elm.text", x, y, w, h);
855          set_int(text_w, w);
856       }
857       public ender(val) {
858          set_int(loop_count, 0);
859          if (get_int(sliding_timer)) cancel_timer(get_int(sliding_timer));
860          set_int(sliding_timer, 0);
861          if (get_int(end_timer)) cancel_timer(get_int(end_timer));
862          set_int(end_timer, 0);
863          set_state(PART:"elm.text.dim.left", "default", 0.0);
864          set_state(PART:"elm.text_new.clipper", "default", 0.0);
865          if (val == 1) {
866             custom_state(PART:"elm.text", "sliding", 0.0);
867             set_state_val(PART:"elm.text", STATE_REL1_OFFSET, TOOLBAR_SLIDING_TEXT_OFFSET, 0);
868             set_state_val(PART:"elm.text", STATE_REL2_OFFSET, TOOLBAR_SLIDING_TEXT_OFFSET, 0);
869             set_state(PART:"elm.text", "custom", 0.0);
870          } else {
871             set_state(PART:"elm.text", "visible", 0.0);
872             set_state(PART:"elm.text.dim.right", "default", 0.0);
873          }
874       }
875       public sliding(val) {
876          new buf[128];
877          if (val == TOOLBAR_SLIDING_TEXT_OFFSET) {
878             set_int(loop_count, get_int(loop_count) + 1);
879             get_width();
880             if (get_int(text_w) <= get_int(org_text_w)) {
881                ender(0);
882                return;
883             }
884          }
885          val -= TOOLBAR_SLIDING_PER_FPS;
886 // for debuging //////////////////////////////
887 /*         snprintf(buf, 127, "%d:%d:%d",
888             val, get_int(org_text_w), get_int(text_w));
889          set_text(PART:"dbg", buf);*/
890
891          if (val <= -get_int(text_w) - TOOLBAR_SLIDING_TEXT_GAP + TOOLBAR_SLIDING_TEXT_OFFSET)
892             val = TOOLBAR_SLIDING_TEXT_OFFSET;
893          custom_state(PART:"elm.text", "sliding", 0.0);
894          set_state_val(PART:"elm.text", STATE_REL1_OFFSET, val, 0);
895          set_state_val(PART:"elm.text", STATE_REL2_OFFSET, val, 0);
896          set_state(PART:"elm.text", "custom", 0.0);
897
898          set_state(PART:"elm.text_new.clipper", "animation", 0.0);
899          get_text(PART:"elm.text", buf, 128);
900          set_text(PART:"elm.text_new", buf);
901          custom_state(PART:"elm.text_new", "sliding", 0.0);
902          set_state_val(PART:"elm.text_new", STATE_REL1_OFFSET,
903             val + get_int(text_w) + TOOLBAR_SLIDING_TEXT_GAP, 0);
904          set_state_val(PART:"elm.text_new", STATE_REL2_OFFSET,
905             val + get_int(text_w) + TOOLBAR_SLIDING_TEXT_GAP, 0);
906          set_state(PART:"elm.text_new", "custom", 0.0);
907
908          set_state(PART:"elm.text.dim.left", "show", 0.0);
909          set_state(PART:"elm.text.dim.right", "show", 0.0);
910
911          if (val == TOOLBAR_SLIDING_TEXT_OFFSET || val <= -get_int(text_w))
912             set_state(PART:"elm.text.dim.left", "default", 0.0);
913
914          if (val == TOOLBAR_SLIDING_TEXT_OFFSET) {
915             if (get_int(loop_count) < 3)
916                set_int(sliding_timer, timer(2.0, "sliding", TOOLBAR_SLIDING_TEXT_OFFSET));
917             else
918                set_int(end_timer, timer(0.5, "ender", 1));
919          } else
920             set_int(sliding_timer, timer(1.0/TOOLBAR_SLIDING_FPS, "sliding", val));
921       }
922    }
923    parts {
924       part { name: "bg";
925          type: RECT;
926          scale: 1;
927          mouse_events: 0;
928          description { state: "default" 0.0;
929             min: 180 0;
930             visible: 0;
931          }
932          description { state: "icon_text" 0.0;
933             inherit: "default" 0.0;
934             min: 180 0;
935          }
936       }
937       part { name: "selected_line";
938          type: IMAGE;
939          scale: 1;
940          mouse_events: 0;
941          description { state: "default" 0.0;
942             rel1 {
943                 relative: 0.0 1.0;
944             }
945             rel2 {
946                 relative: 1.0 1.0;
947             }
948             image {
949                 normal: "00_tab_select_bar.png";
950                 border: 1 1 1 1;
951                 border_scale: 1;
952             }
953             align: 0.0 1.0;
954             min: 0 10;
955             fixed: 0 1;
956             visible: 0;
957          }
958          description { state: "selected" 0.0;
959             inherit: "default" 0.0;
960             visible: 1;
961          }
962       }
963       part { name: "bg_cover";
964          type: IMAGE;
965          scale: 1;
966          mouse_events: 0;
967          description { state: "default" 0.0;
968             visible: 0;
969             image {
970                normal: "00_tab_press.png";
971                border: 0 0 8 0;
972                border_scale: 1;
973             }
974          }
975          description { state: "pressed" 0.0;
976             inherit: "default" 0.0;
977             visible: 1;
978          }
979          description { state: "moving" 0.0;
980             inherit: "default" 0.0;
981             visible: 1;
982          }
983       }
984       part { name: "padding_left_top";
985          type: RECT;
986          scale: 1;
987          mouse_events: 0;
988          description { state: "default" 0.0;
989             align: 0.0 0.0;
990             rel2.relative: 0.0 0.0;
991             min: 2 0;
992             fixed: 1 1;
993             visible: 0;
994             color: 0 0 0 0;
995          }
996       }
997       part { name: "padding_right_bottom";
998          type: RECT;
999          scale: 1;
1000          mouse_events: 0;
1001          description { state: "default" 0.0;
1002             align: 1.0 1.0;
1003             rel1.relative: 1.0 1.0;
1004             min: 2 0;
1005             fixed: 1 1;
1006             visible: 0;
1007             color: 0 0 0 0;
1008          }
1009       }
1010       part {
1011          name: "icon_rect";
1012          type: RECT;
1013          scale: 1;
1014          mouse_events: 0;
1015          description { state: "default" 0.0;
1016             min: 0 0;
1017             fixed: 0 1;
1018             rel1 {
1019                relative: 1.0 1.0;
1020                to: "padding_left_top";
1021             }
1022             rel2 {
1023                relative: 0.0 1.0;
1024                to_x: "padding_right_bottom";
1025                to_y: "padding_left_top";
1026             }
1027             align: 0.5 0.0;
1028             color: 0 0 0 0;
1029          }
1030          description { state: "visible" 0.0;
1031             inherit: "default" 0.0;
1032             min: TABBAR_ITEM_ICON_SIZE_INC;
1033          }
1034          description { state: "icononly" 0.0;
1035             inherit: "default" 0.0;
1036          }
1037       }
1038       part { name: "padding_after_icon";
1039          type: RECT;
1040          scale: 1;
1041          mouse_events: 0;
1042          description { state: "default" 0.0; //when only icon or no icon is there
1043             align: 0.5 0.0;
1044             rel1 {
1045                relative: 0.0 1.0;
1046                to: "icon_rect";
1047             }
1048             rel2.to: "icon_rect";
1049             fixed: 0 1;
1050             min: 0 0;
1051             color: 0 0 0 0;
1052          }
1053          description { state: "visible" 0.0;
1054             inherit: "default" 0.0;
1055             min: 0 1;
1056          }
1057          description { state: "icononly" 0.0;
1058             inherit: "default" 0.0;
1059          }
1060       }
1061       part { name: "padding_before_text";
1062          type: RECT;
1063          scale: 1;
1064          mouse_events: 0;
1065          description { state: "default" 0.0; //when only icon or no icon is there
1066             align: 0.5 1.0;
1067             rel1 {
1068                relative: 1.0 0.0;
1069                to_x: "padding_left_top";
1070                to_y: "elm.text";
1071             }
1072             rel2 {
1073                relative: 0.0 0.0;
1074                to_x: "padding_right_bottom";
1075                to_y: "elm.text";
1076             }
1077             fixed: 0 1;
1078             min: 0 0;
1079             color: 0 0 0 0;
1080          }
1081       }
1082       part { name: "elm.swallow.icon.proxy";
1083          type: PROXY;
1084          scale: 1;
1085          clip_to: "elm.icon.proxy.clipper";
1086          description { state: "default" 0.0;
1087              source: "elm.swallow.icon";
1088              proxy.source_clip: 0;
1089              rel1.to: "elm.swallow.icon";
1090              rel1.offset: 0 3;
1091              rel2.to: "elm.swallow.icon";
1092              rel2.offset: -1 2;
1093          }
1094       }
1095       part { name: "elm.swallow.icon_new.proxy";
1096          type: PROXY;
1097          scale: 1;
1098          clip_to: "elm.icon_new.proxy.clipper";
1099          description { state: "default" 0.0;
1100              source: "elm.swallow.icon_new";
1101              proxy.source_clip: 0;
1102              rel1.to: "elm.swallow.icon_new";
1103              rel1.offset: 0 3;
1104              rel2.to: "elm.swallow.icon_new";
1105              rel2.offset: -1 2;
1106          }
1107       }
1108       part { name: "elm.swallow.icon";
1109          type: SWALLOW;
1110          scale: 1;
1111          clip_to: "elm.icon.clipper";
1112          description { state: "default" 0.0;
1113             visible: 0;
1114             min: TABBAR_ITEM_ICON_SIZE_INC;
1115             max: TABBAR_ITEM_ICON_SIZE_INC;
1116             rel1 {
1117                 to: "padding_left_top";
1118             }
1119             rel2 {
1120                 to: "padding_right_bottom";
1121             }
1122             aspect: 1.0 1.0;
1123             aspect_preference: HORIZONTAL;
1124          }
1125          description { state: "visible" 0.0;
1126             fixed: 1 0;
1127             min: TABBAR_ITEM_ICON_SIZE_INC;
1128             max: TABBAR_ITEM_ICON_SIZE_INC;
1129             align: 0.5 1.0;
1130             rel1 {
1131                relative: 1.0 0.0;
1132                to_x: "padding_left_top";
1133                to_y: "padding_before_text";
1134             }
1135             rel2 {
1136                relative: 0.0 0.0;
1137                to_x: "padding_right_bottom";
1138                to_y: "padding_before_text";
1139             }
1140             aspect: 1.0 1.0;
1141             aspect_preference: HORIZONTAL;
1142          }
1143          description { state: "icononly" 0.0;
1144             inherit: "default" 0.0;
1145             visible: 1;
1146          }
1147       }
1148       part { name: "elm.swallow.icon_new";
1149          type: SWALLOW;
1150          scale: 1;
1151          clip_to: "elm.icon_new.clipper";
1152          description { state: "default" 0.0;
1153             visible: 0;
1154             min: TABBAR_ITEM_ICON_SIZE_INC;
1155             max: TABBAR_ITEM_ICON_SIZE_INC;
1156             rel1.to: "padding_left_top";
1157             rel2.to: "padding_right_bottom";
1158             aspect: 1.0 1.0;
1159             aspect_preference: HORIZONTAL;
1160          }
1161          description { state: "visible" 0.0;
1162             fixed: 1 0;
1163             min: TABBAR_ITEM_ICON_SIZE_INC;
1164             max: TABBAR_ITEM_ICON_SIZE_INC;
1165             rel1 {
1166                relative: 0.0 1.0;
1167                to_x: "padding_left_top";
1168                to_y: "padding_before_text";
1169             }
1170             rel2 {
1171                relative: 0.0 0.0;
1172                to_x: "padding_right_bottom";
1173                to_y: "padding_before_text";
1174             }
1175             aspect: 1.0 1.0;
1176             aspect_preference: HORIZONTAL;
1177          }
1178          description { state: "icononly" 0.0;
1179             inherit: "default" 0.0;
1180             visible: 1;
1181          }
1182       }
1183       part { name: "elm.text";
1184          type: TEXTBLOCK;
1185          mouse_events: 0;
1186          scale: 1;
1187          clip_to: "elm.text.clipper";
1188          description { state: "default" 0.0;
1189             visible: 0;
1190             rel1 {
1191                relative: 1.0 1.0;
1192                to_x: "padding_left_top";
1193                to_y: "padding_after_icon";
1194             }
1195             rel2 {
1196                relative: 0.0 0.0;
1197                to: "padding_right_bottom";
1198             }
1199             fixed: 1 1;
1200             max: 0 34;
1201             text {
1202                style: "tabbar_text_style_30";
1203                min: 0 1;
1204                max: 1 0;
1205             }
1206          }
1207          description { state: "visible" 0.0;
1208             inherit: "default" 0.0;
1209             visible: 1;
1210          }
1211          description { state: "sliding" 0.0;
1212             inherit: "visible" 0.0;
1213             rel1.offset: TOOLBAR_SLIDING_TEXT_OFFSET 0;
1214             rel2.offset: TOOLBAR_SLIDING_TEXT_OFFSET 0;
1215             text.min: 1 1;
1216             align: 0.0 0.5;
1217          }
1218       }
1219       part { name: "elm.text_new";
1220          type: TEXTBLOCK;
1221          mouse_events: 0;
1222          scale: 1;
1223          clip_to: "elm.text_new.clipper";
1224          description { state: "default" 0.0;
1225             visible: 0;
1226             rel1 {
1227                relative: 1.0 1.0;
1228                to_x: "padding_left_top";
1229                to_y: "padding_after_icon";
1230             }
1231             rel2 {
1232                relative: 0.0 0.0;
1233                to: "padding_right_bottom";
1234             }
1235             max: 0 34;
1236             fixed: 1 1;
1237             text {
1238                style: "tabbar_text_style_30";
1239                min: 0 1;
1240                max: 1 0;
1241             }
1242          }
1243          description { state: "visible" 0.0;
1244             inherit: "default" 0.0;
1245             visible: 1;
1246          }
1247          description { state: "sliding" 0.0;
1248             inherit: "visible" 0.0;
1249             rel1.offset: TOOLBAR_SLIDING_TEXT_OFFSET 0;
1250             rel2.offset: TOOLBAR_SLIDING_TEXT_OFFSET 0;
1251             text.min: 1 1;
1252             align: 0.0 0.5;
1253          }
1254       }
1255       part { name: "padding.badge";
1256          type: RECT;
1257          scale: 1;
1258          mouse_events: 0;
1259          description { state: "default" 0.0;
1260             align: 1.0 0.0;
1261             rel1 {
1262                 relative: 1.0 0.0;
1263             }
1264             rel2 {
1265                 relative: 1.0 0.0;
1266             }
1267             min: 10 10;
1268             fixed: 1 1;
1269             visible: 0;
1270          }
1271          description { state: "default" 0.10;
1272             inherit: "default" 0.0;
1273             min: 10 10;
1274          }
1275          description { state: "default" 0.06;
1276             inherit: "default" 0.0;
1277             min: 6 10;
1278          }
1279          description { state: "default" 0.04;
1280             inherit: "default" 0.0;
1281             min: 4 10;
1282          }
1283       }
1284       part { name: "elm.image.badge";
1285          mouse_events: 0;
1286          scale: 1;
1287          description { state: "default" 0.0;
1288             visible: 0;
1289             min: 54 54;
1290             fixed: 1 1;
1291             rel1 {
1292                to: "left.padding.text";
1293                relative: 0.0 0.0;
1294             }
1295             rel2 {
1296                to: "right.padding.text";
1297                relative: 1.0 1.0;
1298             }
1299             image {
1300                normal: "00_badge_bg.png";
1301                border: 26 26 0 0;
1302                border_scale: 1;
1303             }
1304          }
1305          description { state: "visible" 0.0;
1306             inherit: "default" 0.0;
1307             visible: 1;
1308          }
1309       }
1310       part { name: "left.padding.text";
1311          type: RECT;
1312          scale: 1;
1313          description {
1314             state: "default" 0.0;
1315             visible: 0;
1316             fixed: 1 1;
1317             min: 12 54;
1318             rel1 {
1319                to: "elm.text.badge";
1320                relative: 0.0 0.0;
1321             }
1322             rel2 {
1323                to: "elm.text.badge";
1324                relative: 0.0 1.0;
1325             }
1326             align: 1.0 0.0;
1327          }
1328       }
1329       part { name: "right.padding.text";
1330          type: RECT;
1331          scale: 1;
1332          description {
1333             state: "default" 0.0;
1334             visible: 0;
1335             fixed: 1 1;
1336             min: 12 54;
1337             rel1 {
1338                to: "padding.badge";
1339                relative: 0.0 1.0;
1340             }
1341             rel2 {
1342                to: "padding.badge";
1343                relative: 0.0 1.0;
1344             }
1345             align: 1.0 0.0;
1346          }
1347       }
1348       part { name: "elm.text.badge";
1349          type: TEXT;
1350          mouse_events: 0;
1351          scale: 1;
1352          description {
1353             state: "default" 0.0;
1354             visible: 0;
1355             rel1 {
1356                to: "right.padding.text";
1357                relative: 0.0 0.0;
1358             }
1359             rel2 {
1360                to: "right.padding.text";
1361                relative: 0.0 1.0;
1362             }
1363             min: 30 0;
1364             fixed: 1 0;
1365             align: 1.0 0.5;
1366             color: 250 250 250 255;
1367             text {
1368                font: "Tizen:style=Bold";
1369                size: 34;
1370                min: 1 0;
1371                text_class: "tizen";
1372             }
1373          }
1374          description { state: "visible" 0.0;
1375             inherit: "default" 0.0;
1376             visible: 1;
1377          }
1378       }
1379       part { name: "elm.text.clipper";
1380          type: RECT;
1381          description { state: "default" 0.0;
1382             rel1 {
1383                relative: 1.0 1.0;
1384                to: "padding_left_top";
1385             }
1386             rel2 {
1387                relative: 0.0 0.0;
1388                to: "padding_right_bottom";
1389             }
1390             color: 255 255 255 255;
1391          }
1392          description { state: "animation" 0.0;
1393             inherit: "default" 0.0;
1394             color: 255 255 255 0;
1395          }
1396          description { state: "disabled" 0.0;
1397             inherit: "default" 0.0;
1398             color: 255 255 255 153;
1399          }
1400       }
1401       part { name: "elm.text_new.clipper";
1402          type: RECT;
1403          description { state: "default" 0.0;
1404             rel1 {
1405                relative: 1.0 1.0;
1406                to: "padding_left_top";
1407             }
1408             rel2 {
1409                relative: 0.0 0.0;
1410                to: "padding_right_bottom";
1411             }
1412             color: 255 255 255 0;
1413          }
1414          description { state: "animation" 0.0;
1415             inherit: "default" 0.0;
1416             color: 255 255 255 255;
1417          }
1418          description { state: "disabled" 0.0;
1419             inherit: "default" 0.0;
1420             color: 255 255 255 153;
1421          }
1422       }
1423       part { name: "elm.icon.proxy.clipper";
1424          type: RECT;
1425          description { state: "default" 0.0;
1426             rel1 {
1427                relative: 1.0 1.0;
1428                to: "padding_left_top";
1429             }
1430             rel2 {
1431                relative: 0.0 0.0;
1432                to: "padding_right_bottom";
1433             }
1434             color: 0 0 0 255;
1435          }
1436          description { state: "animation" 0.0;
1437             inherit: "default" 0.0;
1438             color: 0 0 0 255;
1439          }
1440          description { state: "selected" 0.0;
1441             inherit: "default" 0.0;
1442             color: 0 0 0 255;
1443          }
1444          description { state: "disabled" 0.0;
1445             inherit: "default" 0.0;
1446             color: 0 0 0 255;
1447          }
1448       }
1449       part { name: "elm.icon_new.proxy.clipper";
1450          type: RECT;
1451          description { state: "default" 0.0;
1452             rel1 {
1453                relative: 1.0 1.0;
1454                to: "padding_left_top";
1455             }
1456             rel2 {
1457                relative: 0.0 0.0;
1458                to: "padding_right_bottom";
1459             }
1460             color: 0 0 0 255;
1461          }
1462          description { state: "animation" 0.0;
1463             inherit: "default" 0.0;
1464             color: 0 0 0 255;
1465          }
1466          description { state: "selected" 0.0;
1467             inherit: "default" 0.0;
1468             color: 0 0 0 255;
1469          }
1470          description { state: "disabled" 0.0;
1471             inherit: "default" 0.0;
1472             color: 0 0 0 255;
1473          }
1474       }
1475
1476       part { name: "elm.icon.clipper";
1477          type: RECT;
1478          description { state: "default" 0.0;
1479             rel1 {
1480                relative: 1.0 1.0;
1481                to: "padding_left_top";
1482             }
1483             rel2 {
1484                relative: 0.0 0.0;
1485                to: "padding_right_bottom";
1486             }
1487             color: 255 255 255 255;
1488          }
1489          description { state: "animation" 0.0;
1490             inherit: "default" 0.0;
1491             color: 255 255 255 255;
1492          }
1493          description { state: "selected" 0.0;
1494             inherit: "default" 0.0;
1495             color: 255 255 255 255;
1496          }
1497          description { state: "disabled" 0.0;
1498             inherit: "default" 0.0;
1499             color: 255 255 255 255;
1500          }
1501       }
1502       part { name: "elm.icon_new.clipper";
1503          type: RECT;
1504          description { state: "default" 0.0;
1505             rel1 {
1506                relative: 1.0 1.0;
1507                to: "padding_left_top";
1508             }
1509             rel2 {
1510                relative: 0.0 0.0;
1511                to: "padding_right_bottom";
1512             }
1513             color: 255 255 255 255;
1514          }
1515          description { state: "animation" 0.0;
1516             inherit: "default" 0.0;
1517             color: 255 255 255 255;
1518          }
1519          description { state: "selected" 0.0;
1520             inherit: "default" 0.0;
1521             color: 255 255 255 255;
1522          }
1523          description { state: "disabled" 0.0;
1524             inherit: "default" 0.0;
1525             color: 255 255 255 255;
1526          }
1527       }
1528       part { name: "elm.text.dim.left";
1529          type: IMAGE;
1530          scale: 1;
1531          mouse_events: 0;
1532          description { state: "default" 0.0;
1533             min: 45 0;
1534             fixed: 1 0;
1535             align: 0.0 0.5;
1536             visible: 0;
1537             rel1 {
1538                 relative: 0.0 0.0;
1539                 to_x: "elm.text.clipper";
1540                 to_y: "elm.text";
1541             }
1542             rel2 {
1543                 relative: 0.0 1.0;
1544                 to_x: "elm.text.clipper";
1545                 to_y: "elm.text";
1546             }
1547             image.normal: "00_effect_tab_text_dim_left.png";
1548          }
1549          description { state: "show" 0.0;
1550             inherit: "default" 0.0;
1551             visible: 1;
1552          }
1553       }
1554       part { name: "elm.text.dim.right";
1555          type: IMAGE;
1556          scale: 1;
1557          mouse_events: 0;
1558          description { state: "default" 0.0;
1559             min: 45 0;
1560             fixed: 1 0;
1561             align: 1.0 0.5;
1562             visible: 0;
1563             rel1 {
1564                 relative: 1.0 0.0;
1565                 to_x: "elm.text.clipper";
1566                 to_y: "elm.text";
1567             }
1568             rel2 {
1569                 relative: 1.0 1.0;
1570                 to_x: "elm.text.clipper";
1571                 to_y: "elm.text";
1572             }
1573             image.normal: "00_effect_tab_text_dim_right.png";
1574          }
1575          description { state: "show" 0.0;
1576             inherit: "default" 0.0;
1577             visible: 1;
1578          }
1579       }
1580       part { name: "divider";
1581          type: RECT;
1582          scale: 1;
1583          description { state: "default" 0.0;
1584             min: 2 88;
1585             max: 2 88;
1586             fixed: 1 1;
1587             rel1 {
1588                 relative: 1.0 0.5;
1589             }
1590             rel2 {
1591                 relative: 1.0 0.5;
1592             }
1593          }
1594          description { state: "hidden" 0.0;
1595             inherit: "default" 0.0;
1596             visible: 0;
1597          }
1598       }
1599       part { name: "divider_left";
1600          type: RECT;
1601          clip_to: "divider";
1602          description { state: "default" 0.0;
1603             color: TABBAR_ITEM_DIVIDER_LEFT_COLOR_INC;
1604             rel1 {
1605                 relative: 0.0 0.0;
1606                 to: "divider";
1607             }
1608             rel2 {
1609                 relative: 0.5 1.0;
1610                 to: "divider";
1611             }
1612          }
1613       }
1614       part { name: "divider_right";
1615          type: RECT;
1616          clip_to: "divider";
1617          description { state: "default" 0.0;
1618             color: TABBAR_ITEM_DIVIDER_RIGHT_COLOR_INC;
1619             rel1 {
1620                 relative: 0.5 0.0;
1621                 to: "divider";
1622             }
1623             rel2 {
1624                 relative: 1.0 1.0;
1625                 to: "divider";
1626             }
1627          }
1628       }
1629       part { name: "highlight";
1630          type: IMAGE;
1631          scale: 1;
1632          description { state: "default" 0.0;
1633             visible: 0;
1634             image {
1635                 normal: "00_tab_focus.png";
1636                 border: 8 8 8 8;
1637                 border_scale: 1;
1638             }
1639          }
1640          description { state: "highlighted" 0.0;
1641             inherit: "default" 0.0;
1642             visible: 1;
1643          }
1644       }
1645       part { name: "event";
1646          type: RECT;
1647          mouse_events: 1;
1648          dragable {
1649             x: 1 0 0;
1650             y: 1 0 0;
1651          }
1652          description { state: "default" 0.0;
1653             color: 0 0 0 0;
1654          }
1655       }
1656 // for debuging //////////////////////////////
1657 /*      part { name: "dbg";
1658          type: TEXTBLOCK;
1659          mouse_events: 0;
1660          scale: 1;
1661          description { state: "default" 0.0;
1662             rel1.relative: 1.0 0.0;
1663             rel2.relative: 1.0 0.0;
1664             fixed: 1 1;
1665             align: 1.0 0.0;
1666             text {
1667                style: "tabbar_text_style_30";
1668                text: "test";
1669                min: 1 1;
1670             }
1671          }
1672       }*/
1673    }
1674    programs {
1675       program { name: "go_active";
1676          signal:  "elm,state,selected";
1677          source:  "elm";
1678          action:  STATE_SET "selected" 0.0;
1679          target:  "elm.icon.clipper";
1680          target:  "elm.icon.proxy.clipper";
1681          target:  "selected_line";
1682          after: "selected_text";
1683       }
1684       program { name: "selected_text";
1685          script{
1686             new st[31];
1687             new Float:vl;
1688             get_state(PART:"elm.text", st, 30, vl);
1689             if (strcmp(st, "default"))
1690                 run_program(PROGRAM:"slide_start");
1691          }
1692       }
1693       program { name: "go_passive";
1694          signal:  "elm,state,unselected";
1695          source:  "elm";
1696          action:  STATE_SET "default" 0.0;
1697          target:  "elm.icon.clipper";
1698          target:  "elm.icon.proxy.clipper";
1699          target:  "selected_line";
1700          after: "unselected_text";
1701       }
1702       program { name: "unselected_text";
1703          script{
1704             new st[31];
1705             new Float:vl;
1706             get_state(PART:"elm.text", st, 30, vl);
1707             if (strcmp(st, "default"))
1708                 run_program(PROGRAM:"slide_stop");
1709          }
1710       }
1711       program { name: "moving";
1712          signal:  "elm,state,moving";
1713          source:  "elm";
1714          action:  STATE_SET "moving" 0.0;
1715          target:  "bg_cover";
1716       }
1717       program { name: "pressed";
1718          signal:  "mouse,down,1";
1719          source:  "event";
1720          action:  STATE_SET "pressed" 0.0;
1721          target:  "bg_cover";
1722       }
1723       program {
1724          name: "drag";
1725          signal: "drag";
1726          source: "event";
1727          script {
1728             new st[31];
1729             new Float:vl;
1730             new Float:dx, Float:dy;
1731             get_state(PART:"bg_cover", st, 30, vl);
1732             if (strcmp(st, "moving"))
1733               {
1734                 get_drag(PART:"event", dx, dy);
1735                 if ((abs(dx)*abs(dx))+(abs(dy)*abs(dy)) > 400)
1736                   {
1737                     set_drag(PART:"event", 0.0, 0.0);
1738                     set_state(PART:"bg_cover", "default", 0.0);
1739                   }
1740                 set_drag(PART:"event", 0.0, 0.0);
1741               }
1742           }
1743       }
1744       program { name: "unpressed";
1745          signal:  "mouse,up,1";
1746          source:  "event";
1747          script {
1748             set_drag(PART:"event", 0.0, 0.0);
1749             set_state(PART:"bg_cover", "default", 0.0);
1750          }
1751       }
1752       program { name: "go";
1753          signal:  "mouse,clicked,1";
1754          source:  "event";
1755          action:  SIGNAL_EMIT "elm,action,click" "elm";
1756          after: "play_sound";
1757       }
1758       program { name: "play_sound";
1759          action: PLAY_SAMPLE "touch_sound" 1.0;
1760       }
1761       program { name: "mouse,in";
1762          signal:  "mouse,in";
1763          source:  "event";
1764          action:  SIGNAL_EMIT "elm,mouse,in" "elm";
1765       }
1766       program { name: "mouse,out";
1767          signal:  "mouse,out";
1768          source:  "event";
1769          action:  SIGNAL_EMIT "elm,mouse,out" "elm";
1770       }
1771       program { name: "disable";
1772          signal: "elm,state,disabled";
1773          source: "elm";
1774          script {
1775             set_int(item_state, ITEM_STATE_DISABLED);
1776             set_state(PART:"bg", "disabled", 0.0);
1777             set_state(PART:"elm.text.clipper", "disabled", 0.0);
1778             set_state(PART:"elm.icon.clipper", "disabled", 0.0);
1779             set_state(PART:"elm.icon.proxy.clipper", "disabled", 0.0);
1780             run_program(PROGRAM:"label_set,animation,done");
1781             run_program(PROGRAM:"icon_set,animation,done");
1782          }
1783       }
1784       program { name: "enable";
1785          signal: "elm,state,enabled";
1786          source: "elm";
1787          script {
1788             set_int(item_state, ITEM_STATE_ENABLED);
1789             set_state(PART:"bg", "default", 0.0);
1790             set_state(PART:"elm.text.clipper", "default", 0.0);
1791             set_state(PART:"elm.icon.clipper", "default", 0.0);
1792             set_state(PART:"elm.icon.proxy.clipper", "default", 0.0);
1793             run_program(PROGRAM:"label_set,animation,done");
1794             run_program(PROGRAM:"icon_set,animation,done");
1795          }
1796       }
1797       program { name: "label_set,animation,forward";
1798          signal: "elm,state,label_set,forward";
1799          source: "elm";
1800          after: "label_set,sync";
1801       }
1802       program { name: "label_set,animation,backward";
1803          signal: "elm,state,label_set,backward";
1804          source: "elm";
1805          after: "label_set,sync";
1806       }
1807       program { name: "label_set,sync";
1808          signal: "elm,state,label_set";
1809          source: "elm";
1810          script {
1811             new st[31];
1812             new Float:vl;
1813             get_state(PART:"elm.text", st, 30, vl);
1814             set_state(PART:"elm.text_new", st, vl);
1815          }
1816          after: "label_set,animation";
1817       }
1818       program { name: "label_set,animation";
1819          action: STATE_SET "animation" 0.0;
1820          target: "elm.text.clipper";
1821          target: "elm.text_new.clipper";
1822          after: "label_set,animation,done";
1823       }
1824       program { name: "label_set,animation,done";
1825          action: SIGNAL_EMIT "elm,state,label_set,done" "elm";
1826       }
1827       program { name: "label,reset";
1828          signal: "elm,state,label,reset";
1829          source: "elm";
1830          script {
1831             set_state(PART:"elm.text_new.clipper", "default", 0.0);
1832             if (get_int(item_state) != ITEM_STATE_DISABLED)
1833               set_state(PART:"elm.text.clipper", "default", 0.0);
1834             else
1835               set_state(PART:"elm.text.clipper", "disabled", 0.0);
1836          }
1837       }
1838       program { name: "icon_set,animation,forward";
1839          signal: "elm,state,icon_set,forward";
1840          source: "elm";
1841          after: "icon_set,animation";
1842       }
1843       program { name: "icon_set,animation,backward";
1844          signal: "elm,state,icon_set,backward";
1845          source: "elm";
1846          after: "icon_set,animation";
1847       }
1848       program { name: "icon_set,animation";
1849          signal: "elm,state,icon_set";
1850          source: "elm";
1851          action: STATE_SET "animation" 0.0;
1852          target: "elm.icon.clipper";
1853          target: "elm.icon_new.clipper";
1854          target: "elm.icon.proxy.clipper";
1855          target: "elm.icon_new.proxy.clipper";
1856          after: "icon_set,animation,done";
1857       }
1858       program { name: "icon_set,animation,done";
1859          action: SIGNAL_EMIT "elm,state,icon_set,done" "elm";
1860       }
1861       program { name: "icon,reset";
1862          signal: "elm,state,icon,reset";
1863          source: "elm";
1864          script {
1865             set_state(PART:"elm.icon_new.clipper", "default", 0.0);
1866             if (get_int(item_state) != ITEM_STATE_DISABLED)
1867               {
1868                  set_state(PART:"elm.icon.clipper", "default", 0.0);
1869                  set_state(PART:"elm.icon.proxy.clipper", "default", 0.0);
1870               }
1871             else
1872               {
1873                  set_state(PART:"elm.icon.clipper", "disabled", 0.0);
1874                  set_state(PART:"elm.icon.proxy.clipper", "disabled", 0.0);
1875               }
1876          }
1877       }
1878       program { name: "text_show";
1879          signal: "elm,state,text,visible";
1880          source: "elm";
1881          script {
1882             new st[31];
1883             new Float:vl;
1884             get_state(PART:"elm.swallow.icon", st, 30, vl);
1885             if (!strcmp(st, "icononly"))
1886               {
1887                  set_state(PART:"elm.swallow.icon", "visible", 0.0);
1888                  set_state(PART:"icon_rect", "visible", 0.0);
1889                  set_state(PART:"padding_after_icon", "visible", 0.0);
1890                  set_state(PART:"bg", "icon_text", 0.0);
1891               }
1892             set_state(PART:"elm.text", "visible", 0.0);
1893          }
1894       }
1895       program { name: "text_hide";
1896          signal: "elm,state,text,hidden";
1897          source: "elm";
1898          script {
1899             new st[31];
1900             new Float:vl;
1901             get_state(PART:"elm.swallow.icon", st, 30, vl);
1902             if (strcmp(st, "default"))
1903               {
1904                  set_state(PART:"elm.swallow.icon", "icononly", 0.0);
1905                  set_state(PART:"icon_rect", "icononly", 0.0);
1906                  set_state(PART:"padding_after_icon", "icononly", 0.0);
1907               }
1908             set_state(PART:"elm.text", "default", 0.0);
1909             set_state(PART:"bg", "default", 0.0);
1910          }
1911       }
1912       program { name: "icon_show";
1913          signal: "elm,state,icon,visible";
1914          source: "elm";
1915          script {
1916             new st[31];
1917             new Float:vl;
1918             get_state(PART:"elm.text", st, 30, vl);
1919             if (strncmp(st, "default", 7))
1920               {
1921                  set_state(PART:"elm.swallow.icon", "visible", 0.0);
1922                  set_state(PART:"icon_rect", "visible", 0.0);
1923                  set_state(PART:"padding_after_icon", "visible", 0.0);
1924                  set_state(PART:"bg", "icon_text", 0.0);
1925               }
1926             else
1927               {
1928                  set_state(PART:"elm.swallow.icon", "icononly", 0.0);
1929                  set_state(PART:"icon_rect", "icononly", 0.0);
1930                  set_state(PART:"padding_after_icon", "icononly", 0.0);
1931               }
1932          }
1933       }
1934       program { name: "icon_hide";
1935          signal: "elm,state,icon,hidden";
1936          source: "elm";
1937          script {
1938             set_state(PART:"elm.swallow.icon", "default", 0.0);
1939             set_state(PART:"icon_rect", "default", 0.0);
1940             set_state(PART:"padding_after_icon", "default", 0.0);
1941             set_state(PART:"bg", "default", 0.0);
1942          }
1943       }
1944       program { name: "badge_show";
1945          signal: "elm,state,elm.text.badge,visible";
1946          source: "elm";
1947          action: STATE_SET "visible" 0.0;
1948          target: "elm.text.badge";
1949          target: "elm.image.badge";
1950       }
1951       program { name: "badge_hide";
1952          signal: "elm,state,elm.text.badge,hidden";
1953          source: "elm";
1954          action:  STATE_SET "default" 0.0;
1955          target: "elm.text.badge";
1956          target: "elm.image.badge";
1957       }
1958       program { name: "divider_visible_1";
1959          signal: "elm,order,first,item";
1960          source: "elm";
1961          action: STATE_SET "default" 0.0;
1962          target: "divider";
1963       }
1964       program { name: "divider_visible_2";
1965          signal: "elm,order,default,item";
1966          source: "elm";
1967          action: STATE_SET "default" 0.0;
1968          target: "divider";
1969       }
1970       program { name: "divider_hidden";
1971          signal: "elm,order,last,item";
1972          source: "elm";
1973          action: STATE_SET "hidden" 0.0;
1974          target: "divider";
1975       }
1976       program { name: "highlight_on";
1977          signal: "elm,highlight,on";
1978          source: "elm";
1979          action: STATE_SET "highlighted" 0.0;
1980          target: "highlight";
1981       }
1982       program { name: "highlight_off";
1983          signal: "elm,highlight,off";
1984          source: "elm";
1985          action: STATE_SET "default" 0.0;
1986          target: "highlight";
1987       }
1988       program { name: "tab_item_2";
1989          signal: "elm,number,item,2";
1990          source: "elm";
1991          script {
1992             set_int(items_number, 2);
1993             set_state(PART:"padding.badge", "default", 0.10);
1994          }
1995       }
1996       program { name: "tab_item_3";
1997          signal: "elm,number,item,3";
1998          source: "elm";
1999          script {
2000             set_int(items_number, 3);
2001             set_state(PART:"padding.badge", "default", 0.06);
2002          }
2003       }
2004       program { name: "tab_item_4";
2005          signal: "elm,number,item,4";
2006          source: "elm";
2007          script {
2008             set_int(items_number, 4);
2009          }
2010          after: "tab_item_upper_4";
2011       }
2012       program { name: "tab_item_5";
2013          signal: "elm,number,item,5";
2014          source: "elm";
2015          script {
2016             set_int(items_number, 5);
2017          }
2018          after: "tab_item_upper_4";
2019       }
2020       program { name: "tab_item_6";
2021          signal: "elm,number,item,6";
2022          source: "elm";
2023          script {
2024             set_int(items_number, 6);
2025          }
2026          after: "tab_item_upper_4";
2027       }
2028       program { name: "tab_item_7";
2029          signal: "elm,number,item,7";
2030          source: "elm";
2031          script {
2032             set_int(items_number, 7);
2033          }
2034          after: "tab_item_upper_4";
2035       }
2036       program { name: "tab_item_8";
2037          signal: "elm,number,item,8";
2038          source: "elm";
2039          script {
2040             set_int(items_number, 8);
2041          }
2042          after: "tab_item_upper_4";
2043       }
2044       program { name: "tab_item_9";
2045          signal: "elm,number,item,9";
2046          source: "elm";
2047          script {
2048             set_int(items_number, 9);
2049          }
2050          after: "tab_item_upper_4";
2051       }
2052       program { name: "tab_item_10";
2053          signal: "elm,number,item,10";
2054          source: "elm";
2055          script {
2056             set_int(items_number, 10);
2057          }
2058          after: "tab_item_upper_4";
2059       }
2060       program { name: "tab_item_upper_4";
2061          script {
2062             set_state(PART:"padding.badge", "default", 0.04);
2063          }
2064       }
2065       program { name: "slide_start";
2066          script {
2067             if (!get_int(sliding_timer) && !get_int(end_timer)) {
2068                set_int(sliding_timer, timer(1.5, "sliding", TOOLBAR_SLIDING_TEXT_OFFSET));
2069             }
2070          }
2071       }
2072       program { name: "slide_stop";
2073          script {
2074              ender(0);
2075          }
2076       }
2077    }
2078 }
2079
2080 group { name: "elm/toolbar/base/tabbar/item_with_title";
2081    inherit: "elm/toolbar/base/tabbar";
2082    images {
2083       image: "00_sub_title_bg.png" COMP;
2084    }
2085    parts {
2086        part { name: "base_bg";
2087          type: IMAGE;
2088          scale: 1;
2089          description {
2090             state: "default" 0.0;
2091             rel1 {
2092                 relative: 0.0 0.0;
2093                 to: "base";
2094             }
2095             rel2 {
2096                 relative: 1.0 1.0;
2097                 to: "base";
2098             }
2099             image {
2100                 normal: "00_sub_title_bg.png";
2101                 border: 8 8 35 35;
2102                 border_scale: 1;
2103             }
2104          }
2105       }
2106    }
2107 }
2108
2109 group { name: "elm/toolbar/item/tabbar/item_with_title";
2110    inherit: "elm/toolbar/item/tabbar";
2111    images {
2112       image: "00_effect_tab_text_dim_left_02.png" COMP;
2113       image: "00_effect_tab_text_dim_right_02.png" COMP;
2114    }
2115    parts {
2116       part { name: "elm.text.dim.left";
2117          description { state: "default" 0.0;
2118             image.normal: "00_effect_tab_text_dim_left_02.png";
2119          }
2120          description { state: "show" 0.0;
2121             inherit: "default" 0.0;
2122             visible: 1;
2123          }
2124       }
2125       part { name: "elm.text.dim.right";
2126          description { state: "default" 0.0;
2127             image.normal: "00_effect_tab_text_dim_right_02.png";
2128          }
2129          description { state: "show" 0.0;
2130             inherit: "default" 0.0;
2131             visible: 1;
2132          }
2133       }
2134       part { name: "divider";
2135          type: RECT;
2136          scale: 1;
2137          description { state: "default" 0.0;
2138             min: 2 48;
2139             max: 2 48;
2140             fixed: 1 1;
2141             rel1 {
2142                 relative: 1.0 0.5;
2143             }
2144             rel2 {
2145                 relative: 1.0 0.5;
2146             }
2147          }
2148          description { state: "hidden" 0.0;
2149             inherit: "default" 0.0;
2150             visible: 0;
2151          }
2152       }
2153       part { name: "divider_left";
2154          type: RECT;
2155          clip_to: "divider";
2156          description { state: "default" 0.0;
2157             color: TABBAR_ITEM_DIVIDER_LEFT_COLOR_INC;
2158             rel1 {
2159                 relative: 0.0 0.0;
2160                 to: "divider";
2161             }
2162             rel2 {
2163                 relative: 0.5 1.0;
2164                 to: "divider";
2165             }
2166          }
2167       }
2168       part { name: "divider_right";
2169          type: RECT;
2170          clip_to: "divider";
2171          description { state: "default" 0.0;
2172             color: TABBAR_ITEM_DIVIDER_RIGHT_COLOR_INC;
2173             rel1 {
2174                 relative: 0.5 0.0;
2175                 to: "divider";
2176             }
2177             rel2 {
2178                 relative: 1.0 1.0;
2179                 to: "divider";
2180             }
2181          }
2182       }
2183    }
2184 }