Merge "[Button]Naviframe_control style macro's modified."
[profile/ivi/efl-theme-tizen.git] / themes / widgets / segmentedcontrol.edc
1 /*
2  * Copyright (c) 2010 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * PROPRIETARY/CONFIDENTIAL
5  *
6  * This software is the confidential and proprietary information of SAMSUNG
7  * ELECTRONICS ("Confidential Information"). You agree and acknowledge that this
8  * software is owned by Samsung and you shall not disclose such Confidential
9  * Information and shall use it only in accordance with the terms of the license
10  * agreement you entered into with SAMSUNG ELECTRONICS. SAMSUNG make no
11  * representations or warranties about the suitability of the software, either
12  * express or implied, including but not limited to the implied warranties of
13  * merchantability, fitness for a particular purpose, or non-infringement.
14  * SAMSUNG shall not be liable for any damages suffered by licensee arising out
15  * of or releated to this software.
16  *
17  */
18
19 //################################################################
20 //Segment Control
21 //################################################################
22
23 group { name: "elm/segment_control/base/default";
24    images {
25       image: "00_winset_btn_sge_normal.png" COMP;
26    }
27 #define SEGMENT_TYPE_SINGLE 1
28 #define SEGMENT_TYPE_LEFT 2
29 #define SEGMENT_TYPE_MIDDLE 3
30 #define SEGMENT_TYPE_RIGHT 4
31 #define SEGMENT_STATE_NORMAL 1
32 #define SEGMENT_STATE_PRESSED 2
33 #define SEGMENT_STATE_SELECTED 3
34 #define SEGMENT_STATUS_ENABLED 0
35 #define SEGMENT_STATUS_DISABLED 1
36    parts {
37       part { name: "bg";
38          mouse_events: 0;
39          scale: 1;
40          description {
41             state: "default" 0.0;
42             min: 100 40;
43             rel1.offset: 0 0;
44             rel2.offset: 0 0;
45             image {
46                normal: "00_winset_btn_sge_normal.png";
47                border: 5 5 5 5;
48                border_scale: 1;
49                middle: 1;
50             }
51          }
52       }
53    }
54 }
55 group { name: "elm/segment_control/item/default";
56    images {
57       image: "00_winset_btn_sge_normal.png" COMP;
58       image: "00_winset_btn_sge_normal_left.png" COMP;
59       image: "00_winset_btn_sge_normal_centre.png" COMP;
60       image: "00_winset_btn_sge_normal_right.png" COMP;
61       image: "00_winset_btn_sge_press_normal.png" COMP;
62       image: "00_winset_btn_sge_press_01.png" COMP;
63       image: "00_winset_btn_sge_press_02.png" COMP;
64       image: "00_winset_btn_sge_press_03.png" COMP;
65    }
66    parts {
67       part { name: "base";
68          mouse_events: 0;
69          scale: 1;
70          description { state: "default" 0.0;
71             visible: 0;
72          }
73       }
74       part { name: "segment";
75          scale: 1;
76          description { state: "default" 0.0;
77             min: 1 1;
78             visible: 0;
79             align: 0.0 0.5;
80             rel1 {
81                to: "base";
82                relative: 0.0 0.0;
83                offset: 0 0;
84             }
85             rel2 {
86                to: "base";
87                relative: 1.0 1.0;
88                offset: 0 0;
89             }
90             image {
91                normal: "00_winset_btn_sge_normal.png";
92                border: 5 5 5 5;
93                border_scale: 1;
94                middle: 1;
95             }
96          }
97          description { state: "default_single" 0.0;
98             inherit: "default" 0.0;
99             visible: 1;
100             image {
101                normal: "00_winset_btn_sge_normal.png";
102                border: 5 5 5 5;
103             }
104          }
105          description { state: "default_left" 0.0;
106             inherit: "default" 0.0;
107             visible: 1;
108             image {
109                normal: "00_winset_btn_sge_normal_left.png";
110                border:  5 2 5 5;
111             }
112          }
113          description { state: "default_right" 0.0;
114             inherit: "default" 0.0;
115             visible: 1;
116             image {
117                normal: "00_winset_btn_sge_normal_right.png";
118                border: 2 5 5 5;
119             }
120          }
121          description { state: "default_middle" 0.0;
122             inherit: "default" 0.0;
123             visible: 1;
124             image {
125             normal: "00_winset_btn_sge_normal_centre.png";
126             border: 0 0 7 7;
127             }
128          }
129          description { state: "pressed_single" 0.0;
130             inherit: "default" 0.0;
131             visible: 1;
132             image {
133                normal: "00_winset_btn_sge_press_normal.png";
134                border: 5 5 5 5;
135             }
136          }
137          description { state: "pressed_left" 0.0;
138             inherit: "default" 0.0;
139             visible: 1;
140             image {
141                normal: "00_winset_btn_sge_press_01.png";
142                border:  5 2 5 5;
143             }
144          }
145          description { state: "pressed_right" 0.0;
146             inherit: "default" 0.0;
147             visible: 1;
148             image {
149                normal: "00_winset_btn_sge_press_03.png";
150                border: 2 5 5 5;
151             }
152          }
153          description { state: "pressed_middle" 0.0;
154             inherit: "default" 0.0;
155             visible: 1;
156             image {
157                normal: "00_winset_btn_sge_press_02.png";
158                border: 0 0 7 7;
159             }
160          }
161          description { state: "selected_single" 0.0;
162             inherit: "default" 0.0;
163             visible: 1;
164             image {
165                normal: "00_winset_btn_sge_press_normal.png";
166                border: 5 5 5 5;
167             }
168          }
169          description { state: "selected_left" 0.0;
170             inherit: "default" 0.0;
171             visible: 1;
172             image {
173                normal: "00_winset_btn_sge_press_01.png";
174                border:  5 2 5 5;
175             }
176          }
177          description { state: "selected_right" 0.0;
178             inherit: "default" 0.0;
179             visible: 1;
180             image {
181                normal: "00_winset_btn_sge_press_03.png";
182                border: 2 5 5 5;
183             }
184          }
185          description { state: "selected_middle" 0.0;
186             inherit: "default" 0.0;
187             visible: 1;
188             image {
189                normal: "00_winset_btn_sge_press_02.png";
190                border: 0 0 7 7;
191             }
192          }
193       }
194       part { name: "left_1pxl_padding";
195          type: RECT;
196          mouse_events: 0;
197          description { state: "default" 0.0;
198             visible: 0;
199             align: 0.0 0.5;
200             min: 1 0;
201             fixed: 1 0;
202             rel1 {
203                to: "base";
204                relative: 0.0 0.0;
205             }
206             rel2 {
207                to: "base";
208                relative: 0.0 1.0;
209             }
210             color: SEGMENT_CONTROL_ITEM_1PX_LEFT_PADDING_COLOR_INC;
211           }
212          description { state: "visible" 0.0;
213             inherit: "default" 0.0;
214             visible: 1;
215           }
216       }
217       part { name: "right_1pxl_padding";
218          type: RECT;
219          mouse_events: 0;
220          description { state: "default" 0.0;
221             visible: 0;
222             align: 1.0 0.5;
223             min: 1 0;
224             fixed: 1 0;
225             rel1 {
226                to: "base";
227                relative: 1.0 0.0;
228                offset: -1 0;
229             }
230             rel2 {
231                to: "base";
232                relative: 1.0 1.0;
233                offset: -1 0;
234             }
235             color: SEGMENT_CONTROL_ITEM_1PX_RIGHT_PADDING_COLOR_INC;
236          }
237          description { state: "visible" 0.0;
238             inherit: "default" 0.0;
239             visible: 1;
240          }
241       }
242       part { name: "padding_frame";
243          type: RECT;
244          scale: 1;
245          mouse_events: 0;
246          description { state: "default" 0.0;
247             visible: 0;
248             /* Add a padding of 2 pxs in all directions */
249             rel1.offset: 2 2;
250             rel2.offset: -3 -3;
251          }
252       }
253       part { name: "icon.bg";
254          type: RECT;
255          scale: 1;
256          mouse_events: 0;
257          description { state: "default" 0.0;
258             visible: 0;
259             fixed: 1 0;
260             rel1.to: "elm.swallow.icon";
261             rel2.to: "elm.swallow.icon";
262          }
263       }
264       part { name: "padding_icon_text";
265          type: RECT;
266          scale: 1;
267          mouse_events: 0;
268          description { state: "default" 0.0; //when only icon or no icon is there
269             visible: 0;
270             align: 0.0 0.0;
271             rel1 {
272                to: "icon.bg";
273                relative: 1.0 0.0;
274             }
275             rel2 {
276                to: "icon.bg";
277                relative: 1.0 1.0;
278             }
279          }
280          description { state: "icononly" 0.0;
281             inherit: "default" 0.0;
282          }
283          description { state: "visible" 0.0; //when icon is visible
284             inherit: "default" 0.0;
285             rel2.offset: 2 0;
286          }
287       }
288       part { name: "elm.swallow.icon";
289          type: SWALLOW;
290          scale: 1;
291          description { state: "default" 0.0;
292             visible: 0;
293             align: 0.5 0.5;
294             rel1.to: "padding_frame";
295             rel2.to: "padding_frame";
296             rel2.relative: 0.0 0.0;
297             aspect: 1.0 1.0;
298             aspect_preference: BOTH;
299          }
300          description { state: "visible" 0.0;
301             inherit: "default" 0.0;
302             visible: 1;
303             rel2.relative: 0.3 1.0;
304          }
305          description { state: "icononly" 0.0;
306             inherit: "default" 0.0;
307             visible: 1;
308             rel2.relative: 1.0 1.0;
309          }
310       }
311       part { name: "elm.text";
312          type: TEXT;
313          mouse_events: 0;
314          scale: 1;
315          description {
316             state: "default" 0.0;
317             visible: 0;
318             fixed: 1 1;
319             min: 1 1;
320             rel1 {
321                to_x: "padding_icon_text";
322                relative: 1.0 0.0;
323             }
324             rel2.to: "padding_frame";
325             color: SEGMENT_CONTROL_ITEM_TITLE_TEXT_COLOR_NORMAL_INC;
326             text {
327                font: "SLP";
328                ellipsis: 0.0;
329                fit: 1 1;
330                size: SEGMENT_CONTROL_TEXT_SIZE_INC;
331                size_range: SEGMENT_CONTROL_TEXT_SIZE_RANGE_MIN_INC SEGMENT_CONTROL_TEXT_SIZE_RANGE_MAX_INC;
332                min: 0 1;
333                text_class: "slp";
334             }
335          }
336          description { state: "normal" 0.0;
337             inherit: "default" 0.0;
338             visible: 1;
339          }
340          description { state: "pressed" 0.0;
341             inherit: "default" 0.0;
342             visible: 1;
343             color: SEGMENT_CONTROL_ITEM_TITLE_TEXT_COLOR_PRESSED_INC;
344          }
345          description { state: "selected" 0.0;
346             inherit: "default" 0.0;
347             visible: 1;
348             color: SEGMENT_CONTROL_ITEM_TITLE_TEXT_COLOR_SELECTED_INC;
349          }
350          description { state: "disabled" 0.0;
351             inherit: "default" 0.0;
352             visible: 1;
353             color: SEGMENT_CONTROL_ITEM_TITLE_TEXT_COLOR_DISABLED_INC;
354          }
355       }
356       part { name: "disabler";
357          repeat_events: 0;
358          scale: 1;
359          description { state: "default" 0.0;
360             visible: 0;
361             fixed: 1 1;
362             min: 1 1;
363             align: 0.0 0.5;
364             rel1 {
365                relative: 0.0 0.0;
366                to: "segment";
367             }
368             rel2 {
369                relative: 1.0 1.0;
370                to: "segment";
371             }
372             color: 255 255 255 150;
373          }
374          description { state: "disabled_single" 0.0;
375             inherit: "default" 0.0;
376             visible: 1;
377             image {
378                normal: "00_winset_btn_sge_body.png";
379                border: 5 5 5 5;
380             }
381          }
382          description { state: "disabled_left" 0.0;
383             inherit: "default" 0.0;
384             visible: 1;
385             image {
386                normal: "00_winset_btn_sge_normal_left.png";
387                border:  5 2 5 5;
388             }
389          }
390          description { state: "disabled_right" 0.0;
391             inherit: "default" 0.0;
392             visible: 1;
393             image {
394                normal: "00_winset_btn_sge_normal_right.png";
395                border: 2 5 5 5;
396             }
397          }
398          description { state: "disabled_middle" 0.0;
399             inherit: "default" 0.0;
400             visible: 1;
401             image {
402                normal: "00_winset_btn_sge_normal_centre.png";
403                border: 0 0 7 7;
404             }
405          }
406       }
407    }
408    programs {
409       script {
410          public seg_type; // Single, Left, Middle, Right.
411          public seg_state; // Normal/Default, Pressed, Selected.
412          public seg_status;// Enabled/Default, Disabled
413
414          public update_state() {
415             new type, state, disabled;
416             type = get_int(seg_type);
417             state = get_int(seg_state);
418             disabled = get_int(seg_status);
419
420             if(state == SEGMENT_STATE_NORMAL)
421               {
422                  if(type == SEGMENT_TYPE_SINGLE)
423                    {
424                       set_state(PART:"segment", "default_single", 0.0);
425                       set_state(PART:"left_1pxl_padding", "default", 0.0);
426                       set_state(PART:"right_1pxl_padding", "default", 0.0);
427                    }
428                  else if(type == SEGMENT_TYPE_LEFT)
429                    {
430                       set_state(PART:"segment", "default_left", 0.0);
431                       set_state(PART:"left_1pxl_padding", "default", 0.0);
432                       set_state(PART:"right_1pxl_padding", "visible", 0.0);
433                    }
434                  else if(type == SEGMENT_TYPE_MIDDLE)
435                    {
436                       set_state(PART:"segment", "default_middle", 0.0);
437                       set_state(PART:"left_1pxl_padding", "visible", 0.0);
438                       set_state(PART:"right_1pxl_padding", "visible", 0.0);
439                    }
440                  else if(type == SEGMENT_TYPE_RIGHT)
441                    {
442                       set_state(PART:"segment", "default_right", 0.0);
443                       set_state(PART:"left_1pxl_padding", "visible", 0.0);
444                       set_state(PART:"right_1pxl_padding", "default", 0.0);
445                    }
446                  set_state(PART:"elm.text", "normal", 0.0);
447               }
448             else if(state == SEGMENT_STATE_PRESSED)
449               {
450                  if(type == SEGMENT_TYPE_SINGLE)
451                    {
452                       set_state(PART:"segment", "pressed_single", 0.0);
453                       set_state(PART:"left_1pxl_padding", "default", 0.0);
454                       set_state(PART:"right_1pxl_padding", "default", 0.0);
455                    }
456                  else if(type == SEGMENT_TYPE_LEFT)
457                    {
458                       set_state(PART:"segment", "pressed_left", 0.0);
459                       set_state(PART:"left_1pxl_padding", "default", 0.0);
460                       set_state(PART:"right_1pxl_padding", "visible", 0.0);
461                    }
462                  else if(type == SEGMENT_TYPE_MIDDLE)
463                    {
464                       set_state(PART:"segment", "pressed_middle", 0.0);
465                       set_state(PART:"left_1pxl_padding", "visible", 0.0);
466                       set_state(PART:"right_1pxl_padding", "visible", 0.0);
467                    }
468                  else if(type == SEGMENT_TYPE_RIGHT)
469                    {
470                       set_state(PART:"segment", "pressed_right", 0.0);
471                       set_state(PART:"left_1pxl_padding", "visible", 0.0);
472                       set_state(PART:"right_1pxl_padding", "default", 0.0);
473                    }
474                  set_state(PART:"elm.text", "pressed", 0.0);
475               }
476             else if(state == SEGMENT_STATE_SELECTED)
477               {
478                  if(type == SEGMENT_TYPE_SINGLE)
479                    {
480                       set_state(PART:"segment", "selected_single", 0.0);
481                       set_state(PART:"left_1pxl_padding", "default", 0.0);
482                       set_state(PART:"right_1pxl_padding", "default", 0.0);
483                    }
484                  else if(type == SEGMENT_TYPE_LEFT)
485                    {
486                       set_state(PART:"segment", "selected_left", 0.0);
487                       set_state(PART:"left_1pxl_padding", "default", 0.0);
488                       set_state(PART:"right_1pxl_padding", "visible", 0.0);
489                    }
490                  else if(type == SEGMENT_TYPE_MIDDLE)
491                    {
492                       set_state(PART:"segment", "selected_middle", 0.0);
493                       set_state(PART:"left_1pxl_padding", "visible", 0.0);
494                       set_state(PART:"right_1pxl_padding", "visible", 0.0);
495                    }
496                  else if(type == SEGMENT_TYPE_RIGHT)
497                    {
498                       set_state(PART:"segment", "selected_right", 0.0);
499                       set_state(PART:"left_1pxl_padding", "visible", 0.0);
500                       set_state(PART:"right_1pxl_padding", "default", 0.0);
501                    }
502                  set_state(PART:"elm.text", "selected", 0.0);
503               }
504             if(disabled == SEGMENT_STATUS_DISABLED)
505               {
506                  if(type == SEGMENT_TYPE_SINGLE)
507                    {
508                       set_state(PART:"disabler", "disabled_single", 0.0);
509                    }
510                  else if(type == SEGMENT_TYPE_LEFT)
511                    {
512                       set_state(PART:"disabler", "disabled_left", 0.0);
513                       set_state(PART:"left_1pxl_padding", "default", 0.0);
514                       set_state(PART:"right_1pxl_padding", "visible", 0.0);
515                    }
516                  else if(type == SEGMENT_TYPE_MIDDLE)
517                    {
518                       set_state(PART:"disabler", "disabled_middle", 0.0);
519                       set_state(PART:"left_1pxl_padding", "visible", 0.0);
520                       set_state(PART:"right_1pxl_padding", "visible", 0.0);
521                    }
522                  else if(type == SEGMENT_TYPE_RIGHT)
523                    {
524                       set_state(PART:"disabler", "disabled_right", 0.0);
525                       set_state(PART:"left_1pxl_padding", "visible", 0.0);
526                       set_state(PART:"right_1pxl_padding", "default", 0.0);
527                    }
528                  set_state(PART:"elm.text", "disabled", 0.0);
529               }
530             else
531               {
532                  set_state(PART:"disabler", "default", 0.0);
533               }
534          }
535       }
536       program {
537          name: "segment_type_s";
538          signal: "elm,type,segment,single";
539          source: "elm";
540          script {
541             set_int(seg_type, SEGMENT_TYPE_SINGLE);
542             update_state();
543          }
544       }
545       program {
546          name: "segment_type_l";
547          signal: "elm,type,segment,left";
548          source: "elm";
549          script {
550             set_int(seg_type, SEGMENT_TYPE_LEFT);
551             update_state();
552          }
553       }
554       program {
555          name: "segment_type_m";
556          signal: "elm,type,segment,middle";
557          source: "elm";
558          script {
559             set_int(seg_type, SEGMENT_TYPE_MIDDLE);
560             update_state();
561          }
562       }
563       program {
564          name: "segment_type_r";
565          signal: "elm,type,segment,right";
566          source: "elm";
567          script {
568             set_int(seg_type, SEGMENT_TYPE_RIGHT);
569             update_state();
570          }
571       }
572       program {
573          name: "normal_segment";
574          signal: "elm,state,segment,normal";
575          source: "elm";
576          script {
577             set_int(seg_state, SEGMENT_STATE_NORMAL);
578             update_state();
579          }
580       }
581       program {
582          name: "pressed_segment";
583          signal: "elm,state,segment,pressed";
584          source: "elm";
585          script {
586             set_int(seg_state, SEGMENT_STATE_PRESSED);
587             update_state();
588          }
589       }
590       program {
591          name: "selected_segment";
592          signal: "elm,state,segment,selected";
593          source: "elm";
594          script {
595             set_int(seg_state, SEGMENT_STATE_SELECTED);
596             update_state();
597          }
598       }
599       program { name: "disable_segment";
600          signal: "elm,state,disabled";
601          source: "elm";
602          script {
603             set_int(seg_status, SEGMENT_STATUS_DISABLED);
604             update_state();
605          }
606       }
607       program { name: "enable_segment";
608          signal: "elm,state,enabled";
609          source: "elm";
610          script {
611             set_int(seg_status, SEGMENT_STATUS_ENABLED);
612             update_state();
613          }
614       }
615       program { name: "text_show";
616          signal: "elm,state,text,visible";
617          source: "elm";
618          script {
619             new st[31];
620             new Float:vl;
621             get_state(PART:"elm.swallow.icon", st, 30, vl);
622             if (!strcmp(st, "icononly"))
623               {
624                  set_state(PART:"elm.swallow.icon", "visible", 0.0);
625                  set_state(PART:"padding_icon_text", "visible", 0.0);
626               }
627             get_state(PART:"elm.text", st, 30, vl);
628             if (!strcmp(st, "selected"))
629                set_state(PART:"elm.text", "selected", 0.0);
630             else
631                set_state(PART:"elm.text", "normal", 0.0);
632          }
633       }
634       program { name: "text_hide";
635          signal: "elm,state,text,hidden";
636          source: "elm";
637          script {
638             new st[31];
639             new Float:vl;
640             get_state(PART:"elm.swallow.icon", st, 30, vl);
641             if (!strcmp(st, "visible"))
642               {
643                  set_state(PART:"elm.swallow.icon", "icononly", 0.0);
644                  set_state(PART:"padding_icon_text", "icononly", 0.0);
645               }
646             set_state(PART:"elm.text", "default", 0.0);
647          }
648       }
649       program { name: "icon_show";
650          signal: "elm,state,icon,visible";
651          source: "elm";
652          script {
653             new st[31];
654             new Float:vl;
655             get_state(PART:"elm.text", st, 30, vl);
656             if ((!strcmp(st, "normal")) || (!strcmp(st, "selected")))
657               {
658                  set_state(PART:"elm.swallow.icon", "visible", 0.0);
659                  set_state(PART:"padding_icon_text", "visible", 0.0);
660               }
661             else
662               {
663                  set_state(PART:"elm.swallow.icon", "icononly", 0.0);
664                  set_state(PART:"padding_icon_text", "icononly", 0.0);
665               }
666          }
667       }
668       program { name: "icon_hide";
669          signal: "elm,state,icon,hidden";
670          source: "elm";
671          action:  STATE_SET "default" 0.0;
672          target: "elm.swallow.icon";
673       }
674    }
675 }
676
677 group { name: "elm/segment_control/base/body_style";
678    images {
679       image: "00_winset_btn_sge_body.png" COMP;
680    }
681    parts {
682       part { name: "bg";
683          mouse_events: 0;
684          scale: 1;
685          description {
686             state: "default" 0.0;
687             rel1.offset: 0 0;
688             rel2.offset: 0 1;
689             min: 100 40;
690             image {
691                normal: "00_winset_btn_sge_body.png";
692                border: 5 5 5 5;
693                border_scale: 1;
694                middle: 1;
695             }
696          }
697       }
698    }
699 }
700
701 group { name: "elm/segment_control/item/body_style";
702
703    images {
704       image: "00_winset_btn_sge_body_press_single.png" COMP;
705       image: "00_winset_btn_sge_body_normal_left.png" COMP;
706       image: "00_winset_btn_sge_body_normal_centre.png" COMP;
707       image: "00_winset_btn_sge_body_normal_right.png" COMP;
708       image: "00_winset_btn_sge_body.png" COMP;
709       image: "00_winset_btn_sge_body_press_left.png" COMP;
710       image: "00_winset_btn_sge_body_press_center.png" COMP;
711       image: "00_winset_btn_sge_body_press_right.png" COMP;
712    }
713    parts {
714       part { name: "base";
715          mouse_events: 0;
716          scale: 1;
717          description { state: "default" 0.0;
718             visible: 0;
719          }
720       }
721       part { name: "segment";
722          mouse_events: 1;
723          scale: 1;
724          description { state: "default" 0.0;
725             min: 1 1;
726             visible: 0;
727             rel1 {
728                to: "base";
729                relative: 0.0 0.0;
730                offset: 0 0;
731             }
732             rel2 {
733                to: "base";
734                relative: 1.0 1.0;
735                offset: 0 0;
736             }
737             image {
738                normal: "00_winset_btn_sge_body.png";
739                border: 5 5 5 5;
740                border_scale: 1;
741                middle: 1;
742             }
743          }
744          description { state: "default_single" 0.0;
745             inherit: "default" 0.0;
746             visible: 1;
747             image {
748                normal: "00_winset_btn_sge_body.png";
749                border: 5 5 5 5;
750             }
751          }
752          description { state: "default_left" 0.0;
753             inherit: "default" 0.0;
754             visible: 1;
755             image {
756                normal: "00_winset_btn_sge_body_normal_left.png";
757                border:  5 2 5 5;
758             }
759          }
760          description { state: "default_right" 0.0;
761             inherit: "default" 0.0;
762             visible: 1;
763             image {
764                normal: "00_winset_btn_sge_body_normal_right.png";
765                border: 2 5 5 5;
766             }
767          }
768          description { state: "default_middle" 0.0;
769             inherit: "default" 0.0;
770             visible: 1;
771             image {
772             normal: "00_winset_btn_sge_body_normal_centre.png";
773             border: 0 0 5 5;
774             }
775          }
776          description { state: "pressed_single" 0.0;
777             inherit: "default" 0.0;
778             visible: 1;
779             image {
780                normal: "00_winset_btn_sge_body_press_single.png";
781                border: 5 5 5 5;
782             }
783          }
784          description { state: "pressed_left" 0.0;
785             inherit: "default" 0.0;
786             visible: 1;
787             image {
788                normal: "00_winset_btn_sge_body_press_left.png";
789                border:  5 2 5 5;
790             }
791          }
792          description { state: "pressed_right" 0.0;
793             inherit: "default" 0.0;
794             visible: 1;
795             image {
796                normal: "00_winset_btn_sge_body_press_right.png";
797                border: 2 5 5 5;
798             }
799          }
800          description { state: "pressed_middle" 0.0;
801             inherit: "default" 0.0;
802             visible: 1;
803             image {
804                normal: "00_winset_btn_sge_body_press_center.png";
805                border: 0 0 7 7;
806             }
807          }
808          description { state: "selected_single" 0.0;
809             inherit: "default" 0.0;
810             visible: 1;
811             image {
812                normal: "00_winset_btn_sge_body_press_single.png";
813                border: 5 5 5 5;
814             }
815          }
816          description { state: "selected_left" 0.0;
817             inherit: "default" 0.0;
818             visible: 1;
819             image {
820                normal: "00_winset_btn_sge_body_press_left.png";
821                border:  5 2 5 5;
822             }
823          }
824          description { state: "selected_right" 0.0;
825             inherit: "default" 0.0;
826             visible: 1;
827             image {
828                normal: "00_winset_btn_sge_body_press_right.png";
829                border: 2 5 5 5;
830             }
831          }
832          description { state: "selected_middle" 0.0;
833             inherit: "default" 0.0;
834             visible: 1;
835             image {
836                normal: "00_winset_btn_sge_body_press_center.png";
837                border: 0 0 7 7;
838             }
839          }
840       }
841       part { name: "left_1pxl_padding";
842          type: RECT;
843          mouse_events: 0;
844          description { state: "default" 0.0;
845             visible: 0;
846             align: 0.0 0.5;
847             min: 1 0;
848             fixed: 1 0;
849             rel1 {
850                to: "base";
851                relative: 0.0 0.0;
852             }
853             rel2 {
854                to: "base";
855                relative: 0.0 1.0;
856             }
857             color: SEGMENT_CONTROL_BODY_ITEM_1PX_LEFT_PADDING_COLOR_INC;
858          }
859          description { state: "visible" 0.0;
860             inherit: "default" 0.0;
861             visible: 1;
862          }
863       }
864       part { name: "right_1pxl_padding";
865          type: RECT;
866          mouse_events: 0;
867          description { state: "default" 0.0;
868             visible: 0;
869             align: 1.0 0.5;
870             min: 1 0;
871             fixed: 1 0;
872             rel1 {
873                to: "base";
874                relative: 1.0 0.0;
875                offset: -1 0;
876             }
877             rel2 {
878                to: "base";
879                relative: 1.0 1.0;
880                offset: -1 0;
881             }
882             color: SEGMENT_CONTROL_BODY_ITEM_1PX_RIGHT_PADDING_COLOR_INC;
883          }
884          description { state: "visible" 0.0;
885             inherit: "default" 0.0;
886             visible: 1;
887          }
888       }
889       part { name: "padding_frame";
890          type: RECT;
891          scale: 1;
892          mouse_events: 0;
893          description { state: "default" 0.0;
894             visible: 0;
895             /* Add a padding of 2 pxs in all directions */
896             rel1.offset: 2 2;
897             rel2.offset: -3 -3;
898           }
899       }
900       part { name: "icon.bg";
901          type: RECT;
902          scale: 1;
903          mouse_events: 0;
904          description { state: "default" 0.0;
905             visible: 0;
906             fixed: 1 0;
907             rel1.to: "elm.swallow.icon";
908             rel2.to: "elm.swallow.icon";
909          }
910       }
911       part { name: "padding_icon_text";
912          type: RECT;
913          scale: 1;
914          mouse_events: 0;
915          description { state: "default" 0.0; //when only icon or no icon is there
916             visible: 0;
917             align: 0.0 0.0;
918             rel1 {
919                to: "icon.bg";
920                relative: 1.0 0.0;
921             }
922             rel2 {
923                to: "icon.bg";
924                relative: 1.0 1.0;
925             }
926          }
927          description { state: "icononly" 0.0;
928             inherit: "default" 0.0;
929          }
930          description { state: "visible" 0.0; //when icon is visible
931             inherit: "default" 0.0;
932             rel2.offset: 2 0;
933          }
934       }
935       part { name: "elm.swallow.icon";
936          type: SWALLOW;
937          scale: 1;
938          description { state: "default" 0.0;
939             visible: 0;
940             align: 0.5 0.5;
941             rel1.to: "padding_frame";
942             rel2.to: "padding_frame";
943             rel2.relative: 0.0 0.0;
944             aspect: 1.0 1.0;
945             aspect_preference: BOTH;
946          }
947          description { state: "visible" 0.0;
948             inherit: "default" 0.0;
949             visible: 1;
950             rel2.relative: 0.3 1.0;
951          }
952          description { state: "icononly" 0.0;
953             inherit: "default" 0.0;
954             visible: 1;
955             rel2.relative: 1.0 1.0;
956          }
957       }
958       part { name: "elm.text";
959          type: TEXT;
960          mouse_events: 0;
961          scale: 1;
962          description {
963             state: "default" 0.0;
964             visible: 0;
965             fixed: 1 1;
966             min: 1 1;
967             rel1 {
968                to_x: "padding_icon_text";
969                relative: 1.0 0.0;
970             }
971             rel2.to: "padding_frame";
972             color: SEGMENT_CONTROL_BODY_STYLE_ITEM_TITLE_TEXT_COLOR_NORMAL_INC;
973             text {
974                font: "SLP";
975                ellipsis: 0.0;
976                fit: 1 1;
977                size: SEGMENT_CONTROL_TEXT_SIZE_INC;
978                size_range: SEGMENT_CONTROL_TEXT_SIZE_RANGE_MIN_INC SEGMENT_CONTROL_TEXT_SIZE_RANGE_MAX_INC;
979                min: 0 1;
980                text_class: "slp";
981             }
982          }
983          description { state: "normal" 0.0;
984             inherit: "default" 0.0;
985             visible: 1;
986          }
987          description { state: "pressed" 0.0;
988             inherit: "default" 0.0;
989             visible: 1;
990             color: SEGMENT_CONTROL_BODY_STYLE_ITEM_TITLE_TEXT_COLOR_PRESSED_INC;
991          }
992          description { state: "selected" 0.0;
993             inherit: "default" 0.0;
994             visible: 1;
995             color: SEGMENT_CONTROL_BODY_STYLE_ITEM_TITLE_TEXT_COLOR_SELECTED_INC;
996          }
997          description { state: "disabled" 0.0;
998             inherit: "default" 0.0;
999             visible: 1;
1000             color: SEGMENT_CONTROL_BODY_STYLE_ITEM_TITLE_TEXT_COLOR_DISABLED_INC;
1001          }
1002       }
1003       part { name: "disabler";
1004          repeat_events: 0;
1005          scale: 1;
1006          description { state: "default" 0.0;
1007             visible: 0;
1008             fixed: 1 1;
1009             min: 1 1;
1010             align: 0.0 0.5;
1011             rel1 {
1012                relative: 0.0 0.0;
1013                to: "segment";
1014             }
1015             rel2 {
1016                relative: 1.0 1.0;
1017                to: "segment";
1018             }
1019             color: 255 255 255 150;
1020          }
1021          description { state: "disabled_single" 0.0;
1022             inherit: "default" 0.0;
1023             visible: 1;
1024             image {
1025                normal: "00_winset_btn_sge_body.png";
1026                border: 5 5 5 5;
1027             }
1028          }
1029          description { state: "disabled_left" 0.0;
1030             inherit: "default" 0.0;
1031             visible: 1;
1032             image {
1033                normal: "00_winset_btn_sge_body_normal_left.png";
1034                border:  5 2 5 5;
1035             }
1036          }
1037          description { state: "disabled_right" 0.0;
1038             inherit: "default" 0.0;
1039             visible: 1;
1040             image {
1041                normal: "00_winset_btn_sge_body_normal_right.png";
1042                border: 2 5 5 5;
1043             }
1044          }
1045          description { state: "disabled_middle" 0.0;
1046             inherit: "default" 0.0;
1047             visible: 1;
1048             image {
1049                normal: "00_winset_btn_sge_body_normal_centre.png";
1050                border: 0 0 7 7;
1051             }
1052          }
1053       }
1054    }
1055    programs {
1056       script {
1057          public seg_type; // Single, Left, Middle, Right.
1058          public seg_state; // Normal/Default, Pressed, Selected.
1059          public seg_status;// Enabled/Default, Disabled
1060
1061          public update_state() {
1062             new type, state, disabled;
1063             type = get_int(seg_type);
1064             state = get_int(seg_state);
1065             disabled = get_int(seg_status);
1066
1067             if(state == SEGMENT_STATE_NORMAL)
1068               {
1069                  if(type == SEGMENT_TYPE_SINGLE)
1070                    {
1071                       set_state(PART:"segment", "default_single", 0.0);
1072                       set_state(PART:"left_1pxl_padding", "default", 0.0);
1073                       set_state(PART:"right_1pxl_padding", "default", 0.0);
1074                    }
1075                  else if(type == SEGMENT_TYPE_LEFT)
1076                    {
1077                       set_state(PART:"segment", "default_left", 0.0);
1078                       set_state(PART:"left_1pxl_padding", "default", 0.0);
1079                       set_state(PART:"right_1pxl_padding", "visible", 0.0);
1080                    }
1081                  else if(type == SEGMENT_TYPE_MIDDLE)
1082                    {
1083                       set_state(PART:"segment", "default_middle", 0.0);
1084                       set_state(PART:"left_1pxl_padding", "visible", 0.0);
1085                       set_state(PART:"right_1pxl_padding", "visible", 0.0);
1086                    }
1087                  else if(type == SEGMENT_TYPE_RIGHT)
1088                    {
1089                       set_state(PART:"segment", "default_right", 0.0);
1090                       set_state(PART:"left_1pxl_padding", "visible", 0.0);
1091                       set_state(PART:"right_1pxl_padding", "default", 0.0);
1092                    }
1093                  set_state(PART:"elm.text", "normal", 0.0);
1094               }
1095             else if(state == SEGMENT_STATE_PRESSED)
1096               {
1097                  if(type == SEGMENT_TYPE_SINGLE)
1098                    {
1099                       set_state(PART:"segment", "pressed_single", 0.0);
1100                       set_state(PART:"left_1pxl_padding", "default", 0.0);
1101                       set_state(PART:"right_1pxl_padding", "default", 0.0);
1102                    }
1103                  else if(type == SEGMENT_TYPE_LEFT)
1104                    {
1105                       set_state(PART:"segment", "pressed_left", 0.0);
1106                       set_state(PART:"left_1pxl_padding", "default", 0.0);
1107                       set_state(PART:"right_1pxl_padding", "visible", 0.0);
1108                    }
1109                  else if(type == SEGMENT_TYPE_MIDDLE)
1110                    {
1111                       set_state(PART:"segment", "pressed_middle", 0.0);
1112                       set_state(PART:"left_1pxl_padding", "visible", 0.0);
1113                       set_state(PART:"right_1pxl_padding", "visible", 0.0);
1114                    }
1115                  else if(type == SEGMENT_TYPE_RIGHT)
1116                    {
1117                       set_state(PART:"segment", "pressed_right", 0.0);
1118                       set_state(PART:"left_1pxl_padding", "visible", 0.0);
1119                       set_state(PART:"right_1pxl_padding", "default", 0.0);
1120                    }
1121                  set_state(PART:"elm.text", "pressed", 0.0);
1122               }
1123             else if(state == SEGMENT_STATE_SELECTED)
1124               {
1125                  if(type == SEGMENT_TYPE_SINGLE)
1126                    {
1127                       set_state(PART:"segment", "selected_single", 0.0);
1128                       set_state(PART:"left_1pxl_padding", "default", 0.0);
1129                       set_state(PART:"right_1pxl_padding", "default", 0.0);
1130                    }
1131                  else if(type == SEGMENT_TYPE_LEFT)
1132                    {
1133                       set_state(PART:"segment", "selected_left", 0.0);
1134                       set_state(PART:"left_1pxl_padding", "default", 0.0);
1135                       set_state(PART:"right_1pxl_padding", "visible", 0.0);
1136                    }
1137                  else if(type == SEGMENT_TYPE_MIDDLE)
1138                    {
1139                       set_state(PART:"segment", "selected_middle", 0.0);
1140                       set_state(PART:"left_1pxl_padding", "visible", 0.0);
1141                       set_state(PART:"right_1pxl_padding", "visible", 0.0);
1142                    }
1143                  else if(type == SEGMENT_TYPE_RIGHT)
1144                    {
1145                       set_state(PART:"segment", "selected_right", 0.0);
1146                       set_state(PART:"left_1pxl_padding", "visible", 0.0);
1147                       set_state(PART:"right_1pxl_padding", "default", 0.0);
1148                    }
1149                  set_state(PART:"elm.text", "selected", 0.0);
1150               }
1151             if(disabled == SEGMENT_STATUS_DISABLED)
1152               {
1153                  if(type == SEGMENT_TYPE_SINGLE)
1154                    {
1155                        set_state(PART:"disabler", "disabled_single", 0.0);
1156                        set_state(PART:"left_1pxl_padding", "default", 0.0);
1157                        set_state(PART:"right_1pxl_padding", "default", 0.0);
1158                    }
1159                  else if(type == SEGMENT_TYPE_LEFT)
1160                    {
1161                       set_state(PART:"disabler", "disabled_left", 0.0);
1162                       set_state(PART:"left_1pxl_padding", "default", 0.0);
1163                       set_state(PART:"right_1pxl_padding", "visible", 0.0);
1164                    }
1165                  else if(type == SEGMENT_TYPE_MIDDLE)
1166                    {
1167                       set_state(PART:"disabler", "disabled_middle", 0.0);
1168                       set_state(PART:"left_1pxl_padding", "visible", 0.0);
1169                       set_state(PART:"right_1pxl_padding", "visible", 0.0);
1170                    }
1171                  else if(type == SEGMENT_TYPE_RIGHT)
1172                    {
1173                       set_state(PART:"disabler", "disabled_right", 0.0);
1174                       set_state(PART:"left_1pxl_padding", "visible", 0.0);
1175                       set_state(PART:"right_1pxl_padding", "default", 0.0);
1176                    }
1177                  set_state(PART:"elm.text", "disabled", 0.0);
1178               }
1179             else
1180               {
1181                  set_state(PART:"disabler", "default", 0.0);
1182               }
1183          }
1184       }
1185       program {
1186          name: "segment_type_s";
1187          signal: "elm,type,segment,single";
1188          source: "elm";
1189          script {
1190             set_int(seg_type, SEGMENT_TYPE_SINGLE);
1191             update_state();
1192          }
1193       }
1194       program {
1195          name: "segment_type_l";
1196          signal: "elm,type,segment,left";
1197          source: "elm";
1198          script {
1199             set_int(seg_type, SEGMENT_TYPE_LEFT);
1200             update_state();
1201          }
1202       }
1203       program {
1204          name: "segment_type_m";
1205          signal: "elm,type,segment,middle";
1206          source: "elm";
1207          script {
1208             set_int(seg_type, SEGMENT_TYPE_MIDDLE);
1209             update_state();
1210          }
1211       }
1212       program {
1213          name: "segment_type_r";
1214          signal: "elm,type,segment,right";
1215          source: "elm";
1216          script {
1217             set_int(seg_type, SEGMENT_TYPE_RIGHT);
1218             update_state();
1219          }
1220       }
1221       program {
1222          name: "normal_segment";
1223          signal: "elm,state,segment,normal";
1224          source: "elm";
1225          script {
1226             set_int(seg_state, SEGMENT_STATE_NORMAL);
1227             update_state();
1228          }
1229       }
1230       program {
1231          name: "pressed_segment";
1232          signal: "elm,state,segment,pressed";
1233          source: "elm";
1234          script {
1235             set_int(seg_state, SEGMENT_STATE_PRESSED);
1236             update_state();
1237          }
1238       }
1239       program {
1240          name: "selected_segment";
1241          signal: "elm,state,segment,selected";
1242          source: "elm";
1243          script {
1244             set_int(seg_state, SEGMENT_STATE_SELECTED);
1245             update_state();
1246          }
1247       }
1248       program { name: "disable_segment";
1249          signal: "elm,state,disabled";
1250          source: "elm";
1251          script {
1252             set_int(seg_status, SEGMENT_STATUS_DISABLED);
1253             update_state();
1254          }
1255       }
1256       program { name: "enable_segment";
1257          signal: "elm,state,enabled";
1258          source: "elm";
1259          script {
1260             set_int(seg_status, SEGMENT_STATUS_ENABLED);
1261             update_state();
1262          }
1263       }
1264       program { name: "text_show";
1265          signal: "elm,state,text,visible";
1266          source: "elm";
1267          script {
1268             new st[31];
1269             new Float:vl;
1270             get_state(PART:"elm.swallow.icon", st, 30, vl);
1271             if (!strcmp(st, "icononly"))
1272               {
1273                  set_state(PART:"elm.swallow.icon", "visible", 0.0);
1274                  set_state(PART:"padding_icon_text", "visible", 0.0);
1275               }
1276             get_state(PART:"elm.text", st, 30, vl);
1277             if (!strcmp(st, "selected"))
1278                set_state(PART:"elm.text", "selected", 0.0);
1279             else
1280                set_state(PART:"elm.text", "normal", 0.0);
1281          }
1282       }
1283       program { name: "text_hide";
1284          signal: "elm,state,text,hidden";
1285          source: "elm";
1286          script {
1287             new st[31];
1288             new Float:vl;
1289             get_state(PART:"elm.swallow.icon", st, 30, vl);
1290             if (!strcmp(st, "visible"))
1291               {
1292                  set_state(PART:"elm.swallow.icon", "icononly", 0.0);
1293                  set_state(PART:"padding_icon_text", "icononly", 0.0);
1294               }
1295             set_state(PART:"elm.text", "default", 0.0);
1296          }
1297       }
1298       program { name: "icon_show";
1299          signal: "elm,state,icon,visible";
1300          source: "elm";
1301          script {
1302             new st[31];
1303             new Float:vl;
1304             get_state(PART:"elm.text", st, 30, vl);
1305             if ((!strcmp(st, "normal")) || (!strcmp(st, "selected")))
1306               {
1307                  set_state(PART:"elm.swallow.icon", "visible", 0.0);
1308                  set_state(PART:"padding_icon_text", "visible", 0.0);
1309               }
1310             else
1311               {
1312                  set_state(PART:"elm.swallow.icon", "icononly", 0.0);
1313                  set_state(PART:"padding_icon_text", "icononly", 0.0);
1314               }
1315          }
1316       }
1317       program { name: "icon_hide";
1318          signal: "elm,state,icon,hidden";
1319          source: "elm";
1320          action:  STATE_SET "default" 0.0;
1321          target: "elm.swallow.icon";
1322       }
1323    }
1324 }
1325
1326 group { name: "elm/segment_control/base/multiline";
1327    images {
1328       image: "00_winset_btn_sge_normal.png" COMP;
1329    }
1330    parts {
1331       part { name: "bg";
1332          mouse_events: 0;
1333          scale: 1;
1334          description {
1335             state: "default" 0.0;
1336             min: 100 40;
1337             image {
1338                normal: "00_winset_btn_sge_normal.png";
1339                border: 5 5 5 5;
1340                border_scale: 1;
1341                middle: 1;
1342             }
1343          }
1344       }
1345    }
1346 }
1347
1348 group { name: "elm/segment_control/item/multiline";
1349
1350    images {
1351       image: "00_winset_btn_sge_normal.png" COMP;
1352       image: "00_winset_btn_sge_normal_left.png" COMP;
1353       image: "00_winset_btn_sge_normal_centre.png" COMP;
1354       image: "00_winset_btn_sge_normal_right.png" COMP;
1355       image: "00_winset_btn_sge_press_normal.png" COMP;
1356       image: "00_winset_btn_sge_press_01.png" COMP;
1357       image: "00_winset_btn_sge_press_02.png" COMP;
1358       image: "00_winset_btn_sge_press_03.png" COMP;
1359    }
1360
1361    styles{
1362       style { name: "segment_control_multiline_style";
1363          base: "font=SLP:style=Roman font_size="SEGMENT_CONTROL_MULTILINE_TEXT_SIZE_INC" align=center color=#ffffff wrap=char ellipsis=1.0 text_class=slp_roman";
1364          tag:  "br" "\n";
1365          tag:  "hilight" "+ font=SLP:style=Bold";
1366          tag:  "b" "+ font=SLP:style=Bold";
1367          tag:  "tab" "\t";
1368       }
1369    }
1370    parts {
1371       part { name: "base";
1372          mouse_events: 0;
1373          scale: 1;
1374          description { state: "default" 0.0;
1375             visible: 0;
1376          }
1377       }
1378       part { name: "segment";
1379          mouse_events: 1;
1380          scale: 1;
1381          description { state: "default" 0.0;
1382             min: 1 1;
1383             visible: 0;
1384             rel1 {
1385                to: "base";
1386                relative: 0.0 0.0;
1387             }
1388             rel2 {
1389                to: "base";
1390                relative: 1.0 1.0;
1391             }
1392             image {
1393                normal: "00_winset_btn_sge_normal.png";
1394                border: 5 5 5 5;
1395                border_scale: 1;
1396                middle: 1;
1397             }
1398          }
1399          description { state: "default_single" 0.0;
1400             inherit: "default" 0.0;
1401             visible: 1;
1402             image {
1403                normal: "00_winset_btn_sge_normal.png";
1404                border: 5 5 5 5;
1405             }
1406          }
1407          description { state: "default_left" 0.0;
1408             inherit: "default" 0.0;
1409             visible: 1;
1410             image {
1411                normal: "00_winset_btn_sge_normal_left.png";
1412                border:  6 0 5 5;
1413             }
1414          }
1415          description { state: "default_right" 0.0;
1416             inherit: "default" 0.0;
1417             visible: 1;
1418             image {
1419                normal: "00_winset_btn_sge_normal_right.png";
1420                border: 0 6 5 5;
1421             }
1422          }
1423          description { state: "default_middle" 0.0;
1424             inherit: "default" 0.0;
1425             visible: 1;
1426             image {
1427             normal: "00_winset_btn_sge_normal_centre.png";
1428             border: 0 0 5 5;
1429             }
1430          }
1431          description { state: "pressed_single" 0.0;
1432             inherit: "default" 0.0;
1433             visible: 1;
1434             image {
1435                normal: "00_winset_btn_sge_press_normal.png";
1436                border: 5 5 5 5;
1437             }
1438          }
1439          description { state: "pressed_left" 0.0;
1440             inherit: "default" 0.0;
1441             visible: 1;
1442             image {
1443                normal: "00_winset_btn_sge_press_01.png";
1444                border:  6 0 5 5;
1445             }
1446          }
1447          description { state: "pressed_right" 0.0;
1448             inherit: "default" 0.0;
1449             visible: 1;
1450             image {
1451                normal: "00_winset_btn_sge_press_03.png";
1452                border: 0 6 5 5;
1453             }
1454          }
1455          description { state: "pressed_middle" 0.0;
1456             inherit: "default" 0.0;
1457             visible: 1;
1458             image {
1459                normal: "00_winset_btn_sge_press_02.png";
1460                border: 0 0 7 7;
1461             }
1462          }
1463          description { state: "selected_single" 0.0;
1464             inherit: "default" 0.0;
1465             visible: 1;
1466             image {
1467                normal: "00_winset_btn_sge_press_normal.png";
1468                border: 5 5 5 5;
1469             }
1470          }
1471          description { state: "selected_left" 0.0;
1472             inherit: "default" 0.0;
1473             visible: 1;
1474             image {
1475                normal: "00_winset_btn_sge_press_01.png";
1476                border:  6 0 5 5;
1477             }
1478          }
1479          description { state: "selected_right" 0.0;
1480             inherit: "default" 0.0;
1481             visible: 1;
1482             image {
1483                normal: "00_winset_btn_sge_press_03.png";
1484                border: 0 6 5 5;
1485             }
1486          }
1487          description { state: "selected_middle" 0.0;
1488             inherit: "default" 0.0;
1489             visible: 1;
1490             image {
1491                normal: "00_winset_btn_sge_press_02.png";
1492                border: 0 0 7 7;
1493             }
1494          }
1495       }
1496       part { name: "left_1pxl_padding";
1497          type: RECT;
1498          mouse_events: 0;
1499          description { state: "default" 0.0;
1500             visible: 0;
1501             align: 0.0 0.5;
1502             min: 1 0;
1503             fixed: 1 0;
1504             rel1 {
1505                to: "base";
1506                relative: 0.0 0.11;
1507                offset: 0 0;
1508             }
1509             rel2 {
1510                to: "base";
1511                relative: 0.0 0.89;
1512                offset: 0 0;
1513             }
1514             color: SEGMENT_CONTROL_ITEM_1PX_LEFT_PADDING_COLOR_INC;
1515          }
1516          description { state: "visible" 0.0;
1517             inherit: "default" 0.0;
1518             visible: 1;
1519          }
1520       }
1521       part { name: "right_1pxl_padding";
1522          type: RECT;
1523          mouse_events: 0;
1524          description { state: "default" 0.0;
1525             visible: 0;
1526             align: 1.0 0.5;
1527             min: 1 0;
1528             fixed: 1 0;
1529             rel1 {
1530                to: "base";
1531                relative: 1.0 0.11;
1532                offset: -1 0;
1533             }
1534             rel2 {
1535                to: "base";
1536                relative: 1.0 0.89;
1537                offset: -1 0;
1538             }
1539             color: SEGMENT_CONTROL_ITEM_1PX_RIGHT_PADDING_COLOR_INC;
1540          }
1541          description { state: "visible" 0.0;
1542             inherit: "default" 0.0;
1543             visible: 1;
1544          }
1545       }
1546       part { name: "padding_frame";
1547          type: RECT;
1548          scale: 1;
1549          mouse_events: 0;
1550          description { state: "default" 0.0;
1551             visible: 0;
1552             /* Add a padding of 2 pxs in all directions */
1553             rel1.offset: 2 2;
1554             rel2.offset: -3 -3;
1555           }
1556       }
1557       part { name: "icon.bg";
1558          type: RECT;
1559          scale: 1;
1560          mouse_events: 0;
1561          description { state: "default" 0.0;
1562             visible: 0;
1563             fixed: 1 0;
1564             rel1.to: "elm.swallow.icon";
1565             rel2.to: "elm.swallow.icon";
1566          }
1567       }
1568       part { name: "padding_icon_text";
1569          type: RECT;
1570          scale: 1;
1571          mouse_events: 0;
1572          description { state: "default" 0.0; //when only icon or no icon is there
1573             visible: 0;
1574             align: 0.0 0.0;
1575             rel1 {
1576                to: "icon.bg";
1577                relative: 1.0 0.0;
1578             }
1579             rel2 {
1580                to: "icon.bg";
1581                relative: 1.0 1.0;
1582             }
1583          }
1584          description { state: "icononly" 0.0;
1585             inherit: "default" 0.0;
1586          }
1587          description { state: "visible" 0.0; //when icon is visible
1588             inherit: "default" 0.0;
1589             rel2.offset: 2 0;
1590          }
1591       }
1592       part { name: "elm.swallow.icon";
1593          type: SWALLOW;
1594          scale: 1;
1595          description { state: "default" 0.0;
1596             visible: 0;
1597             align: 0.5 0.5;
1598             rel1.to: "padding_frame";
1599             rel2.to: "padding_frame";
1600             rel2.relative: 0.0 0.0;
1601             aspect: 1.0 1.0;
1602             aspect_preference: BOTH;
1603          }
1604          description { state: "visible" 0.0;
1605             inherit: "default" 0.0;
1606             visible: 1;
1607             rel2.relative: 0.3 1.0;
1608          }
1609          description { state: "icononly" 0.0;
1610             inherit: "default" 0.0;
1611             visible: 1;
1612             rel2.relative: 1.0 1.0;
1613          }
1614       }
1615       part { name: "elm.text";
1616          type: TEXTBLOCK;
1617          mouse_events: 0;
1618          scale: 1;
1619          description {
1620             state: "default" 0.0;
1621             visible: 0;
1622             fixed: 1 1;
1623             max: 9999 84;
1624             rel1 {
1625                to_x: "padding_icon_text";
1626                to_y: "base";
1627                relative: 1.0 0.0;
1628             }
1629             rel2.to_x: "padding_frame";
1630             rel2.to_y: "base";
1631             color: SEGMENT_CONTROL_ITEM_TITLE_TEXT_COLOR_NORMAL_INC;
1632             text {
1633               style: "segment_control_multiline_style";
1634               min: 0 1;
1635               max: 0 1;
1636             }
1637          }
1638          description { state: "normal" 0.0;
1639             inherit: "default" 0.0;
1640             visible: 1;
1641          }
1642          description { state: "pressed" 0.0;
1643             inherit: "default" 0.0;
1644             visible: 1;
1645             color: SEGMENT_CONTROL_ITEM_TITLE_TEXT_COLOR_PRESSED_INC;
1646          }
1647          description { state: "selected" 0.0;
1648             inherit: "default" 0.0;
1649             visible: 1;
1650             color: SEGMENT_CONTROL_ITEM_TITLE_TEXT_COLOR_SELECTED_INC;
1651          }
1652          description { state: "disabled" 0.0;
1653             inherit: "default" 0.0;
1654             visible: 1;
1655             color: SEGMENT_CONTROL_ITEM_TITLE_TEXT_COLOR_DISABLED_INC;
1656          }
1657       }
1658       part { name: "disabler";
1659          repeat_events: 0;
1660          scale: 1;
1661          description { state: "default" 0.0;
1662             visible: 0;
1663             fixed: 1 1;
1664             min: 1 1;
1665             align: 0.0 0.5;
1666             rel1 {
1667                relative: 0.0 0.0;
1668                to: "segment";
1669             }
1670             rel2 {
1671                relative: 1.0 1.0;
1672                to: "segment";
1673             }
1674             color: 255 255 255 150;
1675          }
1676          description { state: "disabled_single" 0.0;
1677             inherit: "default" 0.0;
1678             visible: 1;
1679             image {
1680                normal: "00_winset_btn_sge_body.png";
1681                border: 5 5 5 5;
1682             }
1683          }
1684          description { state: "disabled_left" 0.0;
1685             inherit: "default" 0.0;
1686             visible: 1;
1687             image {
1688                normal: "00_winset_btn_sge_body_normal_left.png";
1689                border:  5 2 5 5;
1690             }
1691          }
1692          description { state: "disabled_right" 0.0;
1693             inherit: "default" 0.0;
1694             visible: 1;
1695             image {
1696                normal: "00_winset_btn_sge_body_normal_right.png";
1697                border: 2 5 5 5;
1698             }
1699          }
1700          description { state: "disabled_middle" 0.0;
1701             inherit: "default" 0.0;
1702             visible: 1;
1703             image {
1704                normal: "00_winset_btn_sge_body_normal_centre.png";
1705                border: 0 0 7 7;
1706             }
1707          }
1708       }
1709    }
1710    programs {
1711       script {
1712          public seg_type; // Single, Left, Middle, Right.
1713          public seg_state; // Normal/Default, Pressed, Selected.
1714          public seg_status;// Enabled/Default, Disabled
1715
1716          public update_state() {
1717             new type, state, disabled;
1718             type = get_int(seg_type);
1719             state = get_int(seg_state);
1720             disabled = get_int(seg_status);
1721
1722             if(state == SEGMENT_STATE_NORMAL)
1723               {
1724                  if(type == SEGMENT_TYPE_SINGLE)
1725                    {
1726                       set_state(PART:"segment", "default_single", 0.0);
1727                       set_state(PART:"left_1pxl_padding", "default", 0.0);
1728                       set_state(PART:"right_1pxl_padding", "default", 0.0);
1729                    }
1730                  else if(type == SEGMENT_TYPE_LEFT)
1731                    {
1732                       set_state(PART:"segment", "default_left", 0.0);
1733                       set_state(PART:"left_1pxl_padding", "default", 0.0);
1734                       set_state(PART:"right_1pxl_padding", "visible", 0.0);
1735                    }
1736                  else if(type == SEGMENT_TYPE_MIDDLE)
1737                    {
1738                       set_state(PART:"segment", "default_middle", 0.0);
1739                       set_state(PART:"left_1pxl_padding", "visible", 0.0);
1740                       set_state(PART:"right_1pxl_padding", "visible", 0.0);
1741                    }
1742                  else if(type == SEGMENT_TYPE_RIGHT)
1743                    {
1744                       set_state(PART:"segment", "default_right", 0.0);
1745                       set_state(PART:"left_1pxl_padding", "visible", 0.0);
1746                       set_state(PART:"right_1pxl_padding", "default", 0.0);
1747                    }
1748                  set_state(PART:"elm.text", "normal", 0.0);
1749               }
1750             else if(state == SEGMENT_STATE_PRESSED)
1751               {
1752                  if(type == SEGMENT_TYPE_SINGLE)
1753                    {
1754                       set_state(PART:"segment", "pressed_single", 0.0);
1755                       set_state(PART:"left_1pxl_padding", "default", 0.0);
1756                       set_state(PART:"right_1pxl_padding", "default", 0.0);
1757                    }
1758                  else if(type == SEGMENT_TYPE_LEFT)
1759                    {
1760                       set_state(PART:"segment", "pressed_left", 0.0);
1761                       set_state(PART:"left_1pxl_padding", "default", 0.0);
1762                       set_state(PART:"right_1pxl_padding", "visible", 0.0);
1763                    }
1764                  else if(type == SEGMENT_TYPE_MIDDLE)
1765                    {
1766                       set_state(PART:"segment", "pressed_middle", 0.0);
1767                       set_state(PART:"left_1pxl_padding", "visible", 0.0);
1768                       set_state(PART:"right_1pxl_padding", "visible", 0.0);
1769                    }
1770                  else if(type == SEGMENT_TYPE_RIGHT)
1771                    {
1772                       set_state(PART:"segment", "pressed_right", 0.0);
1773                       set_state(PART:"left_1pxl_padding", "visible", 0.0);
1774                       set_state(PART:"right_1pxl_padding", "default", 0.0);
1775                    }
1776                  set_state(PART:"elm.text", "pressed", 0.0);
1777               }
1778             else if(state == SEGMENT_STATE_SELECTED)
1779               {
1780                  if(type == SEGMENT_TYPE_SINGLE)
1781                    {
1782                       set_state(PART:"segment", "selected_single", 0.0);
1783                       set_state(PART:"left_1pxl_padding", "default", 0.0);
1784                       set_state(PART:"right_1pxl_padding", "default", 0.0);
1785                    }
1786                  else if(type == SEGMENT_TYPE_LEFT)
1787                    {
1788                       set_state(PART:"segment", "selected_left", 0.0);
1789                       set_state(PART:"left_1pxl_padding", "default", 0.0);
1790                       set_state(PART:"right_1pxl_padding", "visible", 0.0);
1791                    }
1792                  else if(type == SEGMENT_TYPE_MIDDLE)
1793                    {
1794                       set_state(PART:"segment", "selected_middle", 0.0);
1795                       set_state(PART:"left_1pxl_padding", "visible", 0.0);
1796                       set_state(PART:"right_1pxl_padding", "visible", 0.0);
1797                    }
1798                  else if(type == SEGMENT_TYPE_RIGHT)
1799                    {
1800                       set_state(PART:"segment", "selected_right", 0.0);
1801                       set_state(PART:"left_1pxl_padding", "visible", 0.0);
1802                       set_state(PART:"right_1pxl_padding", "default", 0.0);
1803                    }
1804                  set_state(PART:"elm.text", "selected", 0.0);
1805               }
1806             if(disabled == SEGMENT_STATUS_DISABLED)
1807               {
1808                  if(type == SEGMENT_TYPE_SINGLE)
1809                    {
1810                        set_state(PART:"disabler", "disabled_single", 0.0);
1811                        set_state(PART:"left_1pxl_padding", "default", 0.0);
1812                        set_state(PART:"right_1pxl_padding", "default", 0.0);
1813                    }
1814                  else if(type == SEGMENT_TYPE_LEFT)
1815                    {
1816                       set_state(PART:"disabler", "disabled_left", 0.0);
1817                       set_state(PART:"left_1pxl_padding", "default", 0.0);
1818                       set_state(PART:"right_1pxl_padding", "visible", 0.0);
1819                    }
1820                  else if(type == SEGMENT_TYPE_MIDDLE)
1821                    {
1822                       set_state(PART:"disabler", "disabled_middle", 0.0);
1823                       set_state(PART:"left_1pxl_padding", "visible", 0.0);
1824                       set_state(PART:"right_1pxl_padding", "visible", 0.0);
1825                    }
1826                  else if(type == SEGMENT_TYPE_RIGHT)
1827                    {
1828                       set_state(PART:"disabler", "disabled_right", 0.0);
1829                       set_state(PART:"left_1pxl_padding", "visible", 0.0);
1830                       set_state(PART:"right_1pxl_padding", "default", 0.0);
1831                    }
1832                  set_state(PART:"elm.text", "disabled", 0.0);
1833               }
1834             else
1835               {
1836                  set_state(PART:"disabler", "default", 0.0);
1837               }
1838          }
1839       }
1840       program {
1841          name: "segment_type_s";
1842          signal: "elm,type,segment,single";
1843          source: "elm";
1844          script {
1845             set_int(seg_type, SEGMENT_TYPE_SINGLE);
1846             update_state();
1847          }
1848       }
1849       program {
1850          name: "segment_type_l";
1851          signal: "elm,type,segment,left";
1852          source: "elm";
1853          script {
1854             set_int(seg_type, SEGMENT_TYPE_LEFT);
1855             update_state();
1856          }
1857       }
1858       program {
1859          name: "segment_type_m";
1860          signal: "elm,type,segment,middle";
1861          source: "elm";
1862          script {
1863             set_int(seg_type, SEGMENT_TYPE_MIDDLE);
1864             update_state();
1865          }
1866       }
1867       program {
1868          name: "segment_type_r";
1869          signal: "elm,type,segment,right";
1870          source: "elm";
1871          script {
1872             set_int(seg_type, SEGMENT_TYPE_RIGHT);
1873             update_state();
1874          }
1875       }
1876       program {
1877          name: "normal_segment";
1878          signal: "elm,state,segment,normal";
1879          source: "elm";
1880          script {
1881             set_int(seg_state, SEGMENT_STATE_NORMAL);
1882             update_state();
1883          }
1884       }
1885       program {
1886          name: "pressed_segment";
1887          signal: "elm,state,segment,pressed";
1888          source: "elm";
1889          script {
1890             set_int(seg_state, SEGMENT_STATE_PRESSED);
1891             update_state();
1892          }
1893       }
1894       program {
1895          name: "selected_segment";
1896          signal: "elm,state,segment,selected";
1897          source: "elm";
1898          script {
1899             set_int(seg_state, SEGMENT_STATE_SELECTED);
1900             update_state();
1901          }
1902       }
1903       program { name: "disable_segment";
1904          signal: "elm,state,disabled";
1905          source: "elm";
1906          script {
1907             set_int(seg_status, SEGMENT_STATUS_DISABLED);
1908             update_state();
1909          }
1910       }
1911       program { name: "enable_segment";
1912          signal: "elm,state,enabled";
1913          source: "elm";
1914          script {
1915             set_int(seg_status, SEGMENT_STATUS_ENABLED);
1916             update_state();
1917          }
1918       }
1919       program { name: "text_show";
1920          signal: "elm,state,text,visible";
1921          source: "elm";
1922          script {
1923             new st[31];
1924             new Float:vl;
1925             get_state(PART:"elm.swallow.icon", st, 30, vl);
1926             if (!strcmp(st, "icononly"))
1927               {
1928                  set_state(PART:"elm.swallow.icon", "visible", 0.0);
1929                  set_state(PART:"padding_icon_text", "visible", 0.0);
1930               }
1931             get_state(PART:"elm.text", st, 30, vl);
1932             if (!strcmp(st, "selected"))
1933                set_state(PART:"elm.text", "selected", 0.0);
1934             else
1935                set_state(PART:"elm.text", "normal", 0.0);
1936          }
1937       }
1938       program { name: "text_hide";
1939          signal: "elm,state,text,hidden";
1940          source: "elm";
1941          script {
1942             new st[31];
1943             new Float:vl;
1944             get_state(PART:"elm.swallow.icon", st, 30, vl);
1945             if (!strcmp(st, "visible"))
1946               {
1947                  set_state(PART:"elm.swallow.icon", "icononly", 0.0);
1948                  set_state(PART:"padding_icon_text", "icononly", 0.0);
1949               }
1950             set_state(PART:"elm.text", "default", 0.0);
1951          }
1952       }
1953       program { name: "icon_show";
1954          signal: "elm,state,icon,visible";
1955          source: "elm";
1956          script {
1957             new st[31];
1958             new Float:vl;
1959             get_state(PART:"elm.text", st, 30, vl);
1960             if ((!strcmp(st, "normal")) || (!strcmp(st, "selected")))
1961               {
1962                  set_state(PART:"elm.swallow.icon", "visible", 0.0);
1963                  set_state(PART:"padding_icon_text", "visible", 0.0);
1964               }
1965             else
1966               {
1967                  set_state(PART:"elm.swallow.icon", "icononly", 0.0);
1968                  set_state(PART:"padding_icon_text", "icononly", 0.0);
1969               }
1970          }
1971       }
1972       program { name: "icon_hide";
1973          signal: "elm,state,icon,hidden";
1974          source: "elm";
1975          action:  STATE_SET "default" 0.0;
1976          target: "elm.swallow.icon";
1977       }
1978    }
1979 }
1980
1981
1982 group { name: "elm/segment_control/base/title_multiline";
1983    images {
1984       image: "00_winset_btn_sge_body.png" COMP;
1985    }
1986    parts {
1987       part { name: "bg";
1988          mouse_events: 0;
1989          scale: 1;
1990          description {
1991             state: "default" 0.0;
1992             rel1.offset: 0 0;
1993             rel2.offset: 0 1;
1994             image {
1995                normal: "00_winset_btn_sge_body.png";
1996                border: 5 5 5 5;
1997                border_scale: 1;
1998                middle: 1;
1999             }
2000          }
2001       }
2002    }
2003 }
2004
2005 group { name: "elm/segment_control/item/title_multiline";
2006
2007    images {
2008       image: "00_winset_btn_sge_body.png" COMP;
2009       image: "00_winset_btn_sge_body_normal_left.png" COMP;
2010       image: "00_winset_btn_sge_body_normal_centre.png" COMP;
2011       image: "00_winset_btn_sge_body_normal_right.png" COMP;
2012       image: "00_winset_btn_sge_body_press_left.png" COMP;
2013       image: "00_winset_btn_sge_body_press_center.png" COMP;
2014       image: "00_winset_btn_sge_body_press_right.png" COMP;
2015    }
2016    parts {
2017       part { name: "base";
2018          mouse_events: 0;
2019          scale: 1;
2020          description { state: "default" 0.0;
2021             visible: 0;
2022          }
2023       }
2024       part { name: "segment";
2025          mouse_events: 1;
2026          scale: 1;
2027          description { state: "default" 0.0;
2028             min: 1 1;
2029             visible: 0;
2030             rel1 {
2031                to: "base";
2032                relative: 0.0 0.0;
2033                offset: 0 0;
2034             }
2035             rel2 {
2036                to: "base";
2037                relative: 1.0 1.0;
2038                offset: 0 0;
2039             }
2040             image {
2041                normal: "00_winset_btn_sge_body.png";
2042                border: 5 5 5 5;
2043                border_scale: 1;
2044                middle: 1;
2045             }
2046          }
2047          description { state: "default_single" 0.0;
2048             inherit: "default" 0.0;
2049             visible: 1;
2050             image {
2051                normal: "00_winset_btn_sge_body.png";
2052                border: 5 5 5 5;
2053             }
2054          }
2055          description { state: "default_left" 0.0;
2056             inherit: "default" 0.0;
2057             visible: 1;
2058             image {
2059                normal: "00_winset_btn_sge_body_normal_left.png";
2060                border:  6 0 5 5;
2061             }
2062          }
2063          description { state: "default_right" 0.0;
2064             inherit: "default" 0.0;
2065             visible: 1;
2066             image {
2067                normal: "00_winset_btn_sge_body_normal_right.png";
2068                border: 0 6 5 5;
2069             }
2070          }
2071          description { state: "default_middle" 0.0;
2072             inherit: "default" 0.0;
2073             visible: 1;
2074             image {
2075             normal: "00_winset_btn_sge_body_normal_centre.png";
2076             border: 0 0 5 5;
2077             }
2078          }
2079          description { state: "pressed_single" 0.0;
2080             inherit: "default" 0.0;
2081             visible: 1;
2082             image {
2083                normal: "00_winset_btn_sge_normal.png";
2084                border: 5 5 5 5;
2085             }
2086          }
2087          description { state: "pressed_left" 0.0;
2088             inherit: "default" 0.0;
2089             visible: 1;
2090             image {
2091                normal: "00_winset_btn_sge_body_press_left.png";
2092                border:  6 0 5 5;
2093             }
2094          }
2095          description { state: "pressed_right" 0.0;
2096             inherit: "default" 0.0;
2097             visible: 1;
2098             image {
2099                normal: "00_winset_btn_sge_body_press_right.png";
2100                border: 0 6 5 5;
2101             }
2102          }
2103          description { state: "pressed_middle" 0.0;
2104             inherit: "default" 0.0;
2105             visible: 1;
2106             image {
2107                normal: "00_winset_btn_sge_body_press_center.png";
2108                border: 0 0 7 7;
2109             }
2110          }
2111          description { state: "selected_single" 0.0;
2112             inherit: "default" 0.0;
2113             visible: 1;
2114             image {
2115                normal: "00_winset_btn_sge_normal.png";
2116                border: 5 5 5 5;
2117             }
2118          }
2119          description { state: "selected_left" 0.0;
2120             inherit: "default" 0.0;
2121             visible: 1;
2122             image {
2123                normal: "00_winset_btn_sge_body_press_left.png";
2124                border:  6 0 5 5;
2125             }
2126          }
2127          description { state: "selected_right" 0.0;
2128             inherit: "default" 0.0;
2129             visible: 1;
2130             image {
2131                normal: "00_winset_btn_sge_body_press_right.png";
2132                border: 0 6 5 5;
2133             }
2134          }
2135          description { state: "selected_middle" 0.0;
2136             inherit: "default" 0.0;
2137             visible: 1;
2138             image {
2139                normal: "00_winset_btn_sge_body_press_center.png";
2140                border: 0 0 7 7;
2141             }
2142          }
2143       }
2144       part { name: "left_1pxl_padding";
2145          type: RECT;
2146          mouse_events: 0;
2147          description { state: "default" 0.0;
2148             visible: 0;
2149             align: 0.0 0.5;
2150             min: 1 0;
2151             fixed: 1 0;
2152             rel1 {
2153                to: "base";
2154                relative: 0.0 0.11;
2155                offset: 0 0;
2156             }
2157             rel2 {
2158                to: "base";
2159                relative: 0.0 0.89;
2160                offset: 0 0;
2161             }
2162             color: SEGMENT_CONTROL_BODY_ITEM_1PX_LEFT_PADDING_COLOR_INC;
2163          }
2164          description { state: "visible" 0.0;
2165             inherit: "default" 0.0;
2166             visible: 1;
2167          }
2168       }
2169       part { name: "right_1pxl_padding";
2170          type: RECT;
2171          mouse_events: 0;
2172          description { state: "default" 0.0;
2173             visible: 0;
2174             align: 1.0 0.5;
2175             min: 1 0;
2176             fixed: 1 0;
2177             rel1 {
2178                to: "base";
2179                relative: 1.0 0.11;
2180                offset: -1 0;
2181             }
2182             rel2 {
2183                to: "base";
2184                relative: 1.0 0.89;
2185                offset: 1 0;
2186                offset: -1 0;
2187             }
2188             color: SEGMENT_CONTROL_BODY_ITEM_1PX_RIGHT_PADDING_COLOR_INC;
2189          }
2190          description { state: "visible" 0.0;
2191             inherit: "default" 0.0;
2192             visible: 1;
2193          }
2194       }
2195       part { name: "padding_frame";
2196          type: RECT;
2197          scale: 1;
2198          mouse_events: 0;
2199          description { state: "default" 0.0;
2200             visible: 0;
2201             /* Add a padding of 2 pxs in all directions */
2202             rel1.offset: 2 2;
2203             rel2.offset: -3 -3;
2204           }
2205       }
2206       part { name: "icon.bg";
2207          type: RECT;
2208          scale: 1;
2209          mouse_events: 0;
2210          description { state: "default" 0.0;
2211             visible: 0;
2212             fixed: 1 0;
2213             rel1.to: "elm.swallow.icon";
2214             rel2.to: "elm.swallow.icon";
2215          }
2216       }
2217       part { name: "padding_icon_text";
2218          type: RECT;
2219          scale: 1;
2220          mouse_events: 0;
2221          description { state: "default" 0.0; //when only icon or no icon is there
2222             visible: 0;
2223             align: 0.0 0.0;
2224             rel1 {
2225                to: "icon.bg";
2226                relative: 1.0 0.0;
2227             }
2228             rel2 {
2229                to: "icon.bg";
2230                relative: 1.0 1.0;
2231             }
2232          }
2233          description { state: "icononly" 0.0;
2234             inherit: "default" 0.0;
2235          }
2236          description { state: "visible" 0.0; //when icon is visible
2237             inherit: "default" 0.0;
2238             rel2.offset: 2 0;
2239          }
2240       }
2241       part { name: "elm.swallow.icon";
2242          type: SWALLOW;
2243          scale: 1;
2244          description { state: "default" 0.0;
2245             visible: 0;
2246             align: 0.5 0.5;
2247             rel1.to: "padding_frame";
2248             rel2.to: "padding_frame";
2249             rel2.relative: 0.0 0.0;
2250             aspect: 1.0 1.0;
2251             aspect_preference: BOTH;
2252          }
2253          description { state: "visible" 0.0;
2254             inherit: "default" 0.0;
2255             visible: 1;
2256             rel2.relative: 0.3 1.0;
2257          }
2258          description { state: "icononly" 0.0;
2259             inherit: "default" 0.0;
2260             visible: 1;
2261             rel2.relative: 1.0 1.0;
2262          }
2263       }
2264       part { name: "elm.text";
2265          type: TEXTBLOCK;
2266          mouse_events: 0;
2267          scale: 1;
2268          description {
2269             state: "default" 0.0;
2270             visible: 0;
2271             fixed: 1 1;
2272             max: 9999 84;
2273             rel1 {
2274                to_x: "padding_icon_text";
2275                relative: 1.0 0.0;
2276             }
2277             rel2.to: "padding_frame";
2278             color: SEGMENT_CONTROL_BODY_STYLE_ITEM_TITLE_TEXT_COLOR_NORMAL_INC;
2279             text {
2280               style: "segment_control_multiline_style";
2281               min: 0 1;
2282               max: 0 1;
2283             }
2284          }
2285          description { state: "normal" 0.0;
2286             inherit: "default" 0.0;
2287             visible: 1;
2288          }
2289          description { state: "pressed" 0.0;
2290             inherit: "default" 0.0;
2291             visible: 1;
2292             color: SEGMENT_CONTROL_BODY_STYLE_ITEM_TITLE_TEXT_COLOR_PRESSED_INC;
2293          }
2294          description { state: "selected" 0.0;
2295             inherit: "default" 0.0;
2296             visible: 1;
2297             color: SEGMENT_CONTROL_BODY_STYLE_ITEM_TITLE_TEXT_COLOR_SELECTED_INC;
2298          }
2299          description { state: "disabled" 0.0;
2300             inherit: "default" 0.0;
2301             visible: 1;
2302             color: SEGMENT_CONTROL_BODY_STYLE_ITEM_TITLE_TEXT_COLOR_DISABLED_INC;
2303          }
2304       }
2305       part { name: "disabler";
2306          repeat_events: 0;
2307          scale: 1;
2308          description { state: "default" 0.0;
2309             visible: 0;
2310             fixed: 1 1;
2311             min: 1 1;
2312             align: 0.0 0.5;
2313             rel1 {
2314                relative: 0.0 0.0;
2315                to: "segment";
2316             }
2317             rel2 {
2318                relative: 1.0 1.0;
2319                to: "segment";
2320             }
2321             color: 255 255 255 150;
2322          }
2323          description { state: "disabled_single" 0.0;
2324             inherit: "default" 0.0;
2325             visible: 1;
2326             image {
2327                normal: "00_winset_btn_sge_body.png";
2328                border: 5 5 5 5;
2329             }
2330          }
2331          description { state: "disabled_left" 0.0;
2332             inherit: "default" 0.0;
2333             visible: 1;
2334             image {
2335                normal: "00_winset_btn_sge_body_normal_left.png";
2336                border:  5 2 5 5;
2337             }
2338          }
2339          description { state: "disabled_right" 0.0;
2340             inherit: "default" 0.0;
2341             visible: 1;
2342             image {
2343                normal: "00_winset_btn_sge_body_normal_right.png";
2344                border: 2 5 5 5;
2345             }
2346          }
2347          description { state: "disabled_middle" 0.0;
2348             inherit: "default" 0.0;
2349             visible: 1;
2350             image {
2351                normal: "00_winset_btn_sge_body_normal_centre.png";
2352                border: 0 0 7 7;
2353             }
2354          }
2355       }
2356    }
2357    programs {
2358       script {
2359          public seg_type; // Single, Left, Middle, Right.
2360          public seg_state; // Normal/Default, Pressed, Selected.
2361          public seg_status;// Enabled/Default, Disabled
2362
2363          public update_state() {
2364             new type, state, disabled;
2365             type = get_int(seg_type);
2366             state = get_int(seg_state);
2367             disabled = get_int(seg_status);
2368
2369             if(state == SEGMENT_STATE_NORMAL)
2370               {
2371                  if(type == SEGMENT_TYPE_SINGLE)
2372                    {
2373                       set_state(PART:"segment", "default_single", 0.0);
2374                       set_state(PART:"left_1pxl_padding", "default", 0.0);
2375                       set_state(PART:"right_1pxl_padding", "default", 0.0);
2376                    }
2377                  else if(type == SEGMENT_TYPE_LEFT)
2378                    {
2379                       set_state(PART:"segment", "default_left", 0.0);
2380                       set_state(PART:"left_1pxl_padding", "default", 0.0);
2381                       set_state(PART:"right_1pxl_padding", "visible", 0.0);
2382                    }
2383                  else if(type == SEGMENT_TYPE_MIDDLE)
2384                    {
2385                       set_state(PART:"segment", "default_middle", 0.0);
2386                       set_state(PART:"left_1pxl_padding", "visible", 0.0);
2387                       set_state(PART:"right_1pxl_padding", "visible", 0.0);
2388                    }
2389                  else if(type == SEGMENT_TYPE_RIGHT)
2390                    {
2391                       set_state(PART:"segment", "default_right", 0.0);
2392                       set_state(PART:"left_1pxl_padding", "visible", 0.0);
2393                       set_state(PART:"right_1pxl_padding", "default", 0.0);
2394                    }
2395                  set_state(PART:"elm.text", "normal", 0.0);
2396               }
2397             else if(state == SEGMENT_STATE_PRESSED)
2398               {
2399                  if(type == SEGMENT_TYPE_SINGLE)
2400                    {
2401                       set_state(PART:"segment", "pressed_single", 0.0);
2402                       set_state(PART:"left_1pxl_padding", "default", 0.0);
2403                       set_state(PART:"right_1pxl_padding", "default", 0.0);
2404                    }
2405                  else if(type == SEGMENT_TYPE_LEFT)
2406                    {
2407                       set_state(PART:"segment", "pressed_left", 0.0);
2408                       set_state(PART:"left_1pxl_padding", "default", 0.0);
2409                       set_state(PART:"right_1pxl_padding", "visible", 0.0);
2410                    }
2411                  else if(type == SEGMENT_TYPE_MIDDLE)
2412                    {
2413                       set_state(PART:"segment", "pressed_middle", 0.0);
2414                       set_state(PART:"left_1pxl_padding", "visible", 0.0);
2415                       set_state(PART:"right_1pxl_padding", "visible", 0.0);
2416                    }
2417                  else if(type == SEGMENT_TYPE_RIGHT)
2418                    {
2419                       set_state(PART:"segment", "pressed_right", 0.0);
2420                       set_state(PART:"left_1pxl_padding", "visible", 0.0);
2421                       set_state(PART:"right_1pxl_padding", "default", 0.0);
2422                    }
2423                  set_state(PART:"elm.text", "pressed", 0.0);
2424               }
2425             else if(state == SEGMENT_STATE_SELECTED)
2426               {
2427                  if(type == SEGMENT_TYPE_SINGLE)
2428                    {
2429                       set_state(PART:"segment", "selected_single", 0.0);
2430                       set_state(PART:"left_1pxl_padding", "default", 0.0);
2431                       set_state(PART:"right_1pxl_padding", "default", 0.0);
2432                    }
2433                  else if(type == SEGMENT_TYPE_LEFT)
2434                    {
2435                       set_state(PART:"segment", "selected_left", 0.0);
2436                       set_state(PART:"left_1pxl_padding", "default", 0.0);
2437                       set_state(PART:"right_1pxl_padding", "visible", 0.0);
2438                    }
2439                  else if(type == SEGMENT_TYPE_MIDDLE)
2440                    {
2441                       set_state(PART:"segment", "selected_middle", 0.0);
2442                       set_state(PART:"left_1pxl_padding", "visible", 0.0);
2443                       set_state(PART:"right_1pxl_padding", "visible", 0.0);
2444                    }
2445                  else if(type == SEGMENT_TYPE_RIGHT)
2446                    {
2447                       set_state(PART:"segment", "selected_right", 0.0);
2448                       set_state(PART:"left_1pxl_padding", "visible", 0.0);
2449                       set_state(PART:"right_1pxl_padding", "default", 0.0);
2450                    }
2451                  set_state(PART:"elm.text", "selected", 0.0);
2452               }
2453             if(disabled == SEGMENT_STATUS_DISABLED)
2454               {
2455                  if(type == SEGMENT_TYPE_SINGLE)
2456                    {
2457                        set_state(PART:"disabler", "disabled_single", 0.0);
2458                        set_state(PART:"left_1pxl_padding", "default", 0.0);
2459                        set_state(PART:"right_1pxl_padding", "default", 0.0);
2460                    }
2461                  else if(type == SEGMENT_TYPE_LEFT)
2462                    {
2463                       set_state(PART:"disabler", "disabled_left", 0.0);
2464                       set_state(PART:"left_1pxl_padding", "default", 0.0);
2465                       set_state(PART:"right_1pxl_padding", "visible", 0.0);
2466                    }
2467                  else if(type == SEGMENT_TYPE_MIDDLE)
2468                    {
2469                       set_state(PART:"disabler", "disabled_middle", 0.0);
2470                       set_state(PART:"left_1pxl_padding", "visible", 0.0);
2471                       set_state(PART:"right_1pxl_padding", "visible", 0.0);
2472                    }
2473                  else if(type == SEGMENT_TYPE_RIGHT)
2474                    {
2475                       set_state(PART:"disabler", "disabled_right", 0.0);
2476                       set_state(PART:"left_1pxl_padding", "visible", 0.0);
2477                       set_state(PART:"right_1pxl_padding", "default", 0.0);
2478                    }
2479                  set_state(PART:"elm.text", "disabled", 0.0);
2480               }
2481             else
2482               {
2483                  set_state(PART:"disabler", "default", 0.0);
2484               }
2485          }
2486       }
2487       program {
2488          name: "segment_type_s";
2489          signal: "elm,type,segment,single";
2490          source: "elm";
2491          script {
2492             set_int(seg_type, SEGMENT_TYPE_SINGLE);
2493             update_state();
2494          }
2495       }
2496       program {
2497          name: "segment_type_l";
2498          signal: "elm,type,segment,left";
2499          source: "elm";
2500          script {
2501             set_int(seg_type, SEGMENT_TYPE_LEFT);
2502             update_state();
2503          }
2504       }
2505       program {
2506          name: "segment_type_m";
2507          signal: "elm,type,segment,middle";
2508          source: "elm";
2509          script {
2510             set_int(seg_type, SEGMENT_TYPE_MIDDLE);
2511             update_state();
2512          }
2513       }
2514       program {
2515          name: "segment_type_r";
2516          signal: "elm,type,segment,right";
2517          source: "elm";
2518          script {
2519             set_int(seg_type, SEGMENT_TYPE_RIGHT);
2520             update_state();
2521          }
2522       }
2523       program {
2524          name: "normal_segment";
2525          signal: "elm,state,segment,normal";
2526          source: "elm";
2527          script {
2528             set_int(seg_state, SEGMENT_STATE_NORMAL);
2529             update_state();
2530          }
2531       }
2532       program {
2533          name: "pressed_segment";
2534          signal: "elm,state,segment,pressed";
2535          source: "elm";
2536          script {
2537             set_int(seg_state, SEGMENT_STATE_PRESSED);
2538             update_state();
2539          }
2540       }
2541       program {
2542          name: "selected_segment";
2543          signal: "elm,state,segment,selected";
2544          source: "elm";
2545          script {
2546             set_int(seg_state, SEGMENT_STATE_SELECTED);
2547             update_state();
2548          }
2549       }
2550       program { name: "disable_segment";
2551          signal: "elm,state,disabled";
2552          source: "elm";
2553          script {
2554             set_int(seg_status, SEGMENT_STATUS_DISABLED);
2555             update_state();
2556          }
2557       }
2558       program { name: "enable_segment";
2559          signal: "elm,state,enabled";
2560          source: "elm";
2561          script {
2562             set_int(seg_status, SEGMENT_STATUS_ENABLED);
2563             update_state();
2564          }
2565       }
2566       program { name: "text_show";
2567          signal: "elm,state,text,visible";
2568          source: "elm";
2569          script {
2570             new st[31];
2571             new Float:vl;
2572             get_state(PART:"elm.swallow.icon", st, 30, vl);
2573             if (!strcmp(st, "icononly"))
2574               {
2575                  set_state(PART:"elm.swallow.icon", "visible", 0.0);
2576                  set_state(PART:"padding_icon_text", "visible", 0.0);
2577               }
2578             get_state(PART:"elm.text", st, 30, vl);
2579             if (!strcmp(st, "selected"))
2580                set_state(PART:"elm.text", "selected", 0.0);
2581             else
2582                set_state(PART:"elm.text", "normal", 0.0);
2583          }
2584       }
2585       program { name: "text_hide";
2586          signal: "elm,state,text,hidden";
2587          source: "elm";
2588          script {
2589             new st[31];
2590             new Float:vl;
2591             get_state(PART:"elm.swallow.icon", st, 30, vl);
2592             if (!strcmp(st, "visible"))
2593               {
2594                  set_state(PART:"elm.swallow.icon", "icononly", 0.0);
2595                  set_state(PART:"padding_icon_text", "icononly", 0.0);
2596               }
2597             set_state(PART:"elm.text", "default", 0.0);
2598          }
2599       }
2600       program { name: "icon_show";
2601          signal: "elm,state,icon,visible";
2602          source: "elm";
2603          script {
2604             new st[31];
2605             new Float:vl;
2606             get_state(PART:"elm.text", st, 30, vl);
2607             if ((!strcmp(st, "normal")) || (!strcmp(st, "selected")))
2608               {
2609                  set_state(PART:"elm.swallow.icon", "visible", 0.0);
2610                  set_state(PART:"padding_icon_text", "visible", 0.0);
2611               }
2612             else
2613               {
2614                  set_state(PART:"elm.swallow.icon", "icononly", 0.0);
2615                  set_state(PART:"padding_icon_text", "icononly", 0.0);
2616               }
2617          }
2618       }
2619       program { name: "icon_hide";
2620          signal: "elm,state,icon,hidden";
2621          source: "elm";
2622          action:  STATE_SET "default" 0.0;
2623          target: "elm.swallow.icon";
2624       }
2625    }
2626 #undef SEGMENT_TYPE_SINGLE
2627 #undef SEGMENT_TYPE_LEFT
2628 #undef SEGMENT_TYPE_MIDDLE
2629 #undef SEGMENT_TYPE_RIGHT
2630 #undef SEGMENT_STATE_NORMAL
2631 #undef SEGMENT_STATE_PRESSED
2632 #undef SEGMENT_STATE_SELECTED
2633 #undef SEGMENT_STATUS_ENABLED
2634 #undef SEGMENT_STATUS_DISABLED
2635 }
2636