2b6ccc3a3e302f4943f874827deac1e55877a099
[framework/web/webkit-efl.git] / Source / WebKit / efl / DefaultTheme / widget / spinner / spinner.edc
1 /*
2  * Copyright (C) 2012, Intel Corporation.
3  *
4  * This program is free software; you can redistribute it and/or modify it
5  * under the terms and conditions of the GNU Lesser General Public License,
6  * version 2.1, as published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope it will be useful, but WITHOUT
9  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
11  * more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License along with
14  * this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St
15  * - Fifth Floor, Boston, MA 02110-1301 USA
16  *
17  */
18
19 group {
20     name: "webkit/widget/spinner";
21
22     images {
23        image: "widget/spinner/sp_bg.png" COMP;
24        image: "widget/spinner/sp_up_default.png" COMP;
25        image: "widget/spinner/sp_down_default.png" COMP;
26        image: "widget/spinner/sp_up_pressed.png" COMP;
27        image: "widget/spinner/sp_down_pressed.png" COMP;
28        image: "widget/spinner/sp_up_hover.png" COMP;
29        image: "widget/spinner/sp_down_hover.png" COMP;
30     }
31
32     script {
33         public isSpinup;
34         public isEnabled;
35         public isPressed;
36
37         public show() {
38             if (get_int(isEnabled) == 1) {
39                 set_state(PART:"up_bt", "default", 0.0);
40                 set_state(PART:"down_bt", "default", 0.0);
41                 if (get_int(isSpinup)) {
42                     if (get_int(isPressed))
43                         set_state(PART:"up_bt", "pressed", 0.0);
44                 }
45                 else {
46                     if (get_int(isPressed))
47                         set_state(PART:"down_bt", "pressed", 0.0);
48                 }
49             }
50             else {
51                 set_state(PART:"up_bt", "disabled", 0.0);
52                 set_state(PART:"down_bt", "disabled", 0.0);
53             }
54         }
55     }
56
57     parts {
58         part {
59             name: "bg";
60             type: IMAGE;
61             description {
62                 state: "default" 0.0;
63                 rel1 {
64                     relative: 0.0 0.0;
65                     offset: 0 6;
66                 }
67                 rel2 {
68                     relative: 1.0 1.0;
69                     offset: -2 -6;
70                 }
71                 image {
72                     normal: "widget/spinner/sp_bg.png";
73                     border: 1 0 0 0;
74                 }
75             }
76         }
77
78         part {
79             name: "up_bt";
80             description {
81                 state: "default" 0.0;
82                 min: 9 7;
83                 max: 9 7;
84                 fixed: 1 1;
85                 rel1 {
86                     relative: 0.0 0.0;
87                     offset: 0 16;
88                 }
89                 rel2 {
90                     relative: 1.0 0.0;
91                     offset: -1 -1;
92                 }
93                 image.normal: "widget/spinner/sp_up_default.png";
94             }
95             description {
96                 state: "pressed" 0.0;
97                 inherit: "default" 0.0;
98                 image.normal: "widget/spinner/sp_up_pressed.png";
99             }
100             description {
101                 state: "disabled" 0.0;
102                 inherit: "default" 0.0;
103                 color: 255 255 255 150;
104             }
105         }
106
107         part {
108             name: "down_bt";
109             description {
110                 state: "default" 0.0;
111                 min: 9 7;
112                 max: 9 7;
113                 fixed: 1 1;
114                 rel1 {
115                     relative: 0.0 1.0;
116                     offset: 0 0;
117                 }
118                 rel2 {
119                     relative: 1.0 1.0;
120                     offset: -1 -18;
121                 }
122                 image.normal: "widget/spinner/sp_down_default.png";
123             }
124             description {
125                 state: "pressed" 0.0;
126                 inherit: "default" 0.0;
127                 image.normal: "widget/spinner/sp_down_pressed.png";
128             }
129             description {
130                 state: "disabled" 0.0;
131                 inherit: "default" 0.0;
132                 color: 255 255 255 150;
133             }
134         }
135
136         part {
137             name: "text_confinement";
138             type: RECT;
139             description {
140                 state: "default" 0.0;
141                 rel1 {
142                     relative: 0.0 0.0;
143                     offset: 0 0;
144                 }
145                 rel2 {
146                     relative: 1.0 1.0;
147                     offset: -18 0;
148                 }
149             }
150         }
151     }
152
153     programs {
154         program {
155             name: "spinup";
156             signal: "spinup";
157             script {
158                 set_int(isSpinup, 1);
159                 show();
160             }
161         }
162
163         program {
164             name: "pressed";
165             signal: "pressed";
166             script {
167                 set_int(isPressed, 1);
168                 show();
169             }
170         }
171
172         program {
173             name: "enabled";
174             signal: "enabled";
175             script {
176                 set_int(isEnabled, 1);
177                 show();
178             }
179         }
180         program {
181             name: "reset";
182             signal: "reset";
183             script {
184                 set_int(isSpinup, 0);
185                 set_int(isEnabled, 0);
186                 set_int(isPressed, 0);
187                 show();
188             }
189         }
190     }
191 }