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