tizen 2.4 release
[framework/uifw/efl-theme-tizen.git] / wearable-circle / widgets / slider.edc
1 /*
2  * Copyright (c) 2010 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions are met:
8  *
9  *   1. Redistributions of source code must retain the above copyright notice, this
10  *      list of conditions and the following disclaimer.
11  *   2. Redistributions in binary form must reproduce the above copyright notice,
12  *      this list of conditions and the following disclaimer in the documentation
13  *      and/or other materials provided with the distribution.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
19  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25  */
26
27 group { name: "elm/slider/horizontal/indicator/default";
28         alias: "elm/slider/horizontal/indicator/disabled";
29         alias: "elm/slider/horizontal/indicator/tap_to_drag";
30         alias: "elm/slider/horizontal/indicator/textstyle";
31         alias: "elm/slider/horizontal/indicator/numberstyle";
32       images {
33          image: "tw_scrubber_control_holo_dark_press.png" COMP;
34          image: "tw_scrubber_control_press_line.png" COMP;
35       }
36       parts {
37          part { name: "access";
38             type: RECT;
39             description { state: "default" 0.0;
40                fixed: 1 1;
41                color: 0 0 0 0;
42             }
43          }
44          part { name: "button_events";
45             type: RECT;
46             mouse_events: 1;
47             scale: 1;
48             description { state: "default" 0.0;
49                fixed: 1 1;
50                min: 2.5*SLIDER_IND_WIDTH 2*SLIDER_IND_HEIGHT;
51                color: 0 0 0 0;
52             }
53             description { state: "disabled" 0.0;
54                inherit: "default" 0.0;
55                visible: 0;
56             }
57          }
58          part { name: "button0";
59             mouse_events: 0;
60             scale: 1;
61             description { state: "default" 0.0;
62                fixed: 1 1;
63                min: SLIDER_IND_WIDTH SLIDER_IND_HEIGHT;
64                max: SLIDER_IND_MAX_WIDTH SLIDER_IND_MAX_HEIGHT;
65                image {
66                   normal: "tw_scrubber_control_holo_dark_press.png";
67                }
68                color: 249 249 249 255; /*(Changeable UI) color_class: "B065L1";*/
69             }
70             description { state: "pressed" 0.0;
71                inherit: "default" 0.0;
72                color: 249 249 249 255; /*(Changeable UI) color_class: "B065L1P";*/
73             }
74             description { state: "disabled" 0.0;
75                inherit: "default" 0.0;
76                color: 147 147 147 255; /*(Changeable UI) color_class: "B065L1D";*/
77             }
78          }
79          part { name: "button_effect";
80             mouse_events: 0;
81             scale: 1;
82             description { state: "default" 0.0;
83                fixed: 1 1;
84                min: SLIDER_IND_WIDTH SLIDER_IND_HEIGHT;
85                max: SLIDER_IND_MAX_WIDTH SLIDER_IND_MAX_HEIGHT;
86                image.normal: "tw_scrubber_control_press_line.png";
87                color: 249 249 249 0; /*(Changeable UI) color_class: "B141";*/
88                rel1.to: "button0";
89                rel2.to: "button0";
90             }
91          }
92       }
93       programs {
94          program { name: "slider_disable";
95             signal: "elm,state,disabled";
96             source: "elm";
97             action:  STATE_SET "disabled" 0.0;
98             target: "button0";
99             target: "button_events";
100          }
101          program { name: "slider_enable";
102             signal: "elm,state,enabled";
103             source: "elm";
104             action:  STATE_SET "default" 0.0;
105             target: "button0";
106             target: "button_events";
107          }
108          program { name: "mouse_down";
109             signal: "mouse,down,*";
110             source: "button_events";
111             action:  STATE_SET "pressed" 0.0;
112             target: "button0";
113          }
114          program { name: "mouse_up";
115             signal: "mouse,up,*";
116             source: "button_events";
117             action:  STATE_SET "default" 0.0;
118             target: "button0";
119          }
120       }
121    }
122
123    group { name: "elm/slider/horizontal/default";
124            alias: "elm/slider/horizontal/disabled";
125       data {
126          item: "access_highlight" on;
127       }
128       images {
129          image: "tw_timepicker_num_bg_new.#.png" COMP;
130          image: "tw_focused_effect.#.png" COMP;
131       }
132       script {
133          public icon_show = 0;
134          public invert_on = 0;
135          public set_invert_on() {
136             set_state(PART:"level", "inverted", 0.0);
137             set_int(invert_on, 1);
138          }
139          public set_invert_off() {
140             set_state(PART:"level", "default", 0.0);
141             set_int(invert_on, 0);
142          }
143          public thumb_down() {
144             if(get_int(invert_on) == 0)
145                set_state(PART:"level", "pressed", 0.0);
146             }
147          public thumb_up() {
148             if(get_int(invert_on) == 0)
149                set_state(PART:"level", "default", 0.0);
150          }
151       }
152       parts {
153          part { name: "access";
154             type: RECT;
155             description { state: "default" 0.0;
156                fixed: 1 1;
157                color: 0 0 0 0;
158              }
159          }
160          part {
161             name: "bg";
162             type: SPACER;
163             scale: 1;
164             description {
165                state: "default" 0.0;
166                min: 0 SLIDER_BG_HEIGHT_INC;
167                max: -1 SLIDER_BG_HEIGHT_INC;
168             }
169          }
170          part {
171             name: "top_padding";
172             type: SPACER;
173             scale: 1;
174             description {
175                state: "default" 0.0;
176                min: 0 0;
177                max: 0 0;
178                rel1.to: "bg";
179                rel2 {
180                   relative: 1.0  0.0;
181                   to: "bg";
182                }
183                align: 0.5 1.0;
184                fixed: 1 1;
185             }
186             description { state: "visible";
187                inherit: "default" 0.0;
188                min: 0 SLIDER_POPUP_BOTTOM_PADDING_HEIGHT_INC;
189                max: -1 SLIDER_POPUP_BOTTOM_PADDING_HEIGHT_INC;
190             }
191          }
192          part { name: "popup_bg";
193             type: SPACER;
194             scale: 1;
195             description { state: "default" 0.0;
196                rel1.to: "top_padding";
197                rel2 {
198                   relative: 1.0 0.0;
199                   to: "top_padding";
200                }
201                min: SLIDER_POPUP_SIZE_INC;
202                max: SLIDER_POPUP_SIZE_INC;
203                fixed: 1 1;
204                align: 0.5 1.0;
205             }
206          }
207          part { name: "popup.image";
208             scale: 1;
209             description { state: "default" 0.0;
210                visible: 0;
211                fixed: 1 1;
212                rel1.to: "popup_bg";
213                rel2.to: "popup_bg";
214                image.normal: "tw_timepicker_num_bg_new.#.png";
215                color: 9 37 63 255; /*(Changeable UI) color_class: "W0811";*/
216             }
217             description { state: "visible" 0.0;
218                inherit: "default" 0.0;
219                visible: 1;
220             }
221             description { state: "pressed" 0.0;
222                inherit: "default" 0.0;
223                visible: 1;
224                color: 0 110 255 255; /*(Changeable UI) color_class: "W0812";*/
225             }
226          }
227          part { name: "elm.indicator";
228             type: TEXT;
229             scale: 1;
230             description { state: "default" 0.0;
231                visible: 0;
232                fixed: 1 1;
233                color: 249 249 249 255; /*(Changeable UI) color_class: "T051";*/
234                rel1.to: "popup.image";
235                rel2.to: "popup.image";
236                text {
237                   align: 0.5 0.5;
238                   min: 1 1;
239                   font: "Tizen:style=Bold"; size: "50"; /*(Changeable UI) text_class: "T051";*/
240                   text_class: "tizen";
241                }
242             }
243             description { state: "visible" 0.0;
244                inherit: "default" 0.0;
245                visible: 1;
246             }
247             description { state: "pressed" 0.0;
248                inherit: "default" 0.0;
249                color: 7 7 7 255; /*(Changeable UI) color_class: "T051P";*/
250                visible: 1;
251             }
252             description { state: "disabled" 0.0;
253                inherit: "default" 0.0;
254                color: 96 96 96 255; /*(Changeable UI) color_class: "T051D";*/
255                visible: 1;
256             }
257          }
258          part { name: "elm.swallow.icon";
259             type: SWALLOW;
260             clip_to: "icon_clipper";
261             scale: 1;
262             description { state: "default" 0.0;
263                visible: 0;
264                rel1 {
265                   relative: 0.0 0.0;
266                   to: "bg";
267                }
268                rel2 {
269                   relative: 0.0 1.0;
270                   to: "bg";
271                }
272                align: 0.0 0.5;
273             }
274             description { state: "visible" 0.0;
275                inherit: "default" 0.0;
276                visible: 1;
277             }
278          }
279          part {
280             name: "icon_padding";
281             type: SPACER;
282             scale: 1;
283             description {
284                state: "default" 0.0;
285                min: 0 0;
286                max: 0 0;
287                rel1 {
288                   relative: 1.0  0.0;
289                   to: "elm.swallow.icon";
290                }
291                rel2 {
292                   relative: 1.0  1.0;
293                   to: "elm.swallow.icon";
294                }
295                align: 0.0 0.5;
296                fixed: 1 1;
297             }
298             description { state: "visible";
299                inherit: "default" 0.0;
300                min: SLIDER_ICON_PADDING_SIZE_INC;
301                max: SLIDER_ICON_PADDING_SIZE_INC;
302             }
303          }
304          part {
305             name: "base";
306             type: RECT;
307             scale: 1;
308             description {
309                state: "default" 0.0;
310                rel1 {
311                   relative: 1.0 0.0;
312                   to_x: "icon_padding";
313                   to_y: "bg";
314                }
315                rel2.to: "bg";
316                min: 0 PROGRESSBAR_HEIGHT_INC;
317                max: -1 PROGRESSBAR_HEIGHT_INC;
318                fixed: 0 1;
319                color: 71 71 71 255; /*(Changeable UI) color_class: "B065L3";*/
320             }
321          }
322          part { name: "level";
323             type: RECT;
324             mouse_events: 0;
325             scale: 1;
326             clip_to: "clipper";
327             description { state: "default" 0.0;
328                fixed: 0 1;
329                rel1 {
330                   to_x: "base";
331                   relative: 0.0 0.0;
332                }
333                rel2 {
334                   to_x: "elm.dragable.slider";
335                   relative: 0.5 1.0;
336                }
337                min: 0 PROGRESSBAR_HEIGHT_INC;
338                max: -1 PROGRESSBAR_HEIGHT_INC;
339                fixed: 0 1;
340             }
341             description { state: "inverted" 0.0;
342                inherit: "default" 0.0;
343                visible: 0;
344             }
345             description { state: "pressed" 0.0;
346                inherit: "default" 0.0;
347             }
348          }
349          part { name: "rect_swallow";
350             type: SWALLOW;
351             scale: 1;
352             description { state: "default" 0.0;
353                fixed: 1 1;
354                min: 0 0;
355                rel1 {
356                   to_x: "base";
357                   relative: 0.0 0.0;
358                }
359                rel2 {
360                   to_x: "base";
361                   relative: 0.0 1.0;
362                }
363                align: 0.0 0.5;
364             }
365          }
366          part { name: "drag_base";
367             type: RECT;
368             mouse_events: 0;
369             scale: 1;
370             description { state: "default" 0.0;
371                visible: 0;
372                rel1.to: "rect_swallow";
373                rel1.relative: 1.0 0.0;
374                rel1.offset: -18 0; // FIXME: slider image has transparent area
375                rel2.to: "elm.swallow.bar";
376                rel2.offset: -6 0;  // FIXME: slider image has transparent area
377             }
378             description { state: "pressed" 0.0;
379                inherit: "default" 0.0;
380                rel1.offset: -22 0;
381                rel2.offset: -1 0;
382             }
383          }
384          part { name: "elm.swallow.bar";
385             type: SWALLOW;
386             scale: 1;
387             description { state: "default" 0.0;
388                min: 0 SLIDER_IND_MAX_HEIGHT;
389                max: -1 SLIDER_IND_MAX_HEIGHT;
390                align: 1.0 0.5;
391                fixed: 0 1;
392                rel1 {
393                   to_x: "base";
394                   relative: 0.0 0.0;
395                   offset: -22 0;
396                }
397                rel2 {
398                   to_x: "base";
399                   relative: 1.0 1.0;
400                   offset: 22 0;
401                }
402             }
403          }
404          part { name: "elm.dragable.slider";
405             type: GROUP;
406             source: "elm/slider/horizontal/indicator/default";
407             mouse_events: 1;
408             scale: 1;
409             dragable {
410                x: 1 1 0;
411                y: 0 0 0;
412                confine: "drag_base";
413             }
414             description { state: "default" 0.0;
415                min: SLIDER_IND_WIDTH SLIDER_IND_HEIGHT;
416                max: SLIDER_IND_WIDTH SLIDER_IND_HEIGHT;
417                fixed: 1 1;
418                color: 0 0 0 0;
419                rel1.to: "elm.swallow.bar";
420                rel2.to: "elm.swallow.bar";
421             }
422             description { state: "pressed" 0.0;
423                inherit: "default" 0.0;
424                min: SLIDER_IND_MAX_WIDTH SLIDER_IND_MAX_HEIGHT;
425                max: SLIDER_IND_MAX_WIDTH SLIDER_IND_MAX_HEIGHT;
426             }
427          }
428          part { name: "disabler";
429             type: RECT;
430             mouse_events: 1;
431             repeat_events: 0;
432             scale: 1;
433             description { state: "default" 0.0;
434                visible: 0;
435                color: 0 0 0 0;
436                rel1.to_x: "elm.swallow.bar";
437                rel2.to_x: "elm.swallow.bar";
438             }
439             description { state: "disabled" 0.0;
440                inherit: "default" 0.0;
441                visible: 1;
442             }
443          }
444          part { name: "clipper";
445             type: RECT;
446             description { state: "default" 0.0;
447                color: 0 110 255 255; /*(Changeable UI) color_class: "B065L2";*/
448             }
449             description { state: "disabled" 0.0;
450                color: 0 110 255 38; /*(Changeable UI) color_class: "B0651L2";*/
451             }
452          }
453          part { name: "icon_clipper";
454             scale: 1;
455             type: RECT;
456             description { state: "default" 0.0;
457                color: 249 249 249 255; /*(Changeable UI) color_class: "W173L1";*/
458             }
459          }
460          part { name: "access_image";
461             mouse_events: 0;
462             scale: 1;
463             description { state: "default" 0.0;
464                rel1.to: "bg";
465                rel1.offset: -14 0;
466                rel2.to: "bg";
467                rel2.offset: 14 0;
468                visible: 0;
469                fill.smooth: 0;
470                image.normal: "tw_focused_effect.#.png";
471                color: 0 110 255 255; //(Changeable UI) color_class: "W201";
472             }
473             description { state: "highlighted" 0.0;
474                inherit: "default" 0.0;
475                visible: 1;
476             }
477             description { state: "highlighted_icon_show" 0.0;
478                inherit: "highlighted" 0.0;
479                rel1.offset: 0 0;
480             }
481          }
482       }
483       programs {
484          program { name: "invert_on";
485             signal: "elm,state,inverted,on";
486             source: "elm";
487             script {
488                set_invert_on();
489             }
490          }
491          program { name: "invert_off";
492             signal: "elm,state,inverted,off";
493             source: "elm";
494             script {
495                set_invert_off();
496             }
497          }
498          program { name: "val_show";
499             signal: "mouse,down,*";
500             source: "elm.dragable.slider";
501             script {
502                thumb_down();
503             }
504             action: STATE_SET "pressed" 0.0;
505             transition: LINEAR 0.1;
506             target: "drag_base";
507             target: "elm.dragable.slider";
508          }
509          program { name: "val_hide";
510             signal: "mouse,up,*";
511             source: "elm.dragable.slider";
512             script {
513                thumb_up();
514             }
515             action: STATE_SET "default" 0.0;
516             transition: LINEAR 0.1;
517             target: "drag_base";
518             target: "elm.dragable.slider";
519          }
520          program { name: "button_expand";
521             signal: "mouse,down,*";
522             source: "elm.swallow.bar";
523             action: STATE_SET "pressed" 0.0;
524             transition: LINEAR 0.1;
525             target: "drag_base";
526             target: "elm.dragable.slider";
527          }
528          program { name: "button_reduce";
529             signal: "mouse,up,*";
530             source: "elm.swallow.bar";
531             action: STATE_SET "default" 0.0;
532             transition: LINEAR 0.1;
533             target: "drag_base";
534             target: "elm.dragable.slider";
535          }
536          program { name: "popup_val_show";
537             signal: "elm,state,val,show";
538             source: "elm";
539             action:  STATE_SET "visible" 0.0;
540             target: "top_padding";
541             target: "popup.image";
542             target: "elm.indicator";
543          }
544          program { name: "popup,show";
545             signal: "popup,show";
546             source: "elm";
547             action:  STATE_SET "visible" 0.0;
548             target: "top_padding";
549             target: "popup.image";
550             target: "elm.indicator";
551          }
552          program { name: "popup_hide";
553             signal: "popup,hide";
554             source: "elm";
555             action:  STATE_SET "default" 0.0;
556             target: "top_padding";
557             target: "popup.image";
558             target: "elm.indicator";
559          }
560          program { name: "icon_show";
561             signal: "elm,state,icon,visible";
562             source: "elm";
563             script {
564                set_int(icon_show, 1);
565                set_state(PART:"elm.swallow.icon", "visible", 0.0);
566                set_state(PART:"icon_padding", "visible", 0.0);
567             }
568          }
569          program { name: "slider_disable";
570             signal: "elm,state,disabled";
571             source: "elm";
572             action:  STATE_SET "disabled" 0.0;
573             target: "disabler";
574             target: "clipper";
575          }
576          program { name: "slider_enable";
577            signal: "elm,state,enabled";
578            source: "elm";
579            action:  STATE_SET "default" 0.0;
580            target: "disabler";
581            target: "clipper";
582          }
583         program { name: "action_highlight";
584             signal: "elm,action,access_highlight,show";
585             source: "elm";
586             script {
587                if (get_int(icon_show))
588                   set_state(PART:"access_image", "highlighted_icon_show", 0.0);
589                else
590                   set_state(PART:"access_image", "highlighted", 0.0);
591             }
592          }
593          program { name: "action_no_highlight";
594             signal: "elm,action,access_highlight,hide";
595             source: "elm";
596             action: STATE_SET "default" 0.0;
597             target: "access_image";
598          }
599       }
600    }