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