update changelog
[profile/ivi/efl-theme-tizen.git] / themes / widgets / radio.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 #define RADIO_STATE_DEFAULT 0
20 #define RADIO_STATE_VISIBLE 1
21 #define RADIO_STATE_DISABLED_VISIBLE 2
22 #define RADIO_STATE_DISABLED 3
23
24    styles {
25       style { name: "radio_label_textblock_style";
26          base: "font=SLP:style=Medium font_size="RADIO_STYLE_DEFAULT_FONT_SIZE_INC" color=#ffffff wrap=char text_class=slp_medium";
27          tag: "br" "\n";
28          tag: "ps" "ps";
29          tag: "hilight" "+ font=SLP:style=Bold";
30          tag: "b" "+ font=SLP:style=Bold";
31          tag: "whitecolor" "+ color=#ffffff";
32          tag: "tab" "\t";
33       }
34    }
35 ////////////////////////////////////////////////////////////////////////////////////////
36
37 #define RADIO_STYLE_DEFAULT(style_name, min_width, min_height) \
38    group { name: "elm/radio/base/"style_name; \
39       images { \
40          image: "00_button_radio_normal1.png" COMP; \
41          image: "00_button_radio_normal2.png" COMP; \
42       } \
43       parts { \
44          part { name: "back_bg"; \
45             type: RECT; \
46             scale: 1; \
47             description { state: "default" 0.0; \
48                rel2.relative: 0.0 1.0; \
49                align: 0 0.5; \
50                min: min_width min_height; \
51                fixed: 1 0; \
52                color: 0 0 0 0; \
53             } \
54          } \
55          part { name: "bg"; \
56             scale: 1; \
57             type: RECT; \
58             description { state: "default" 0.0; \
59                rel1.to: "back_bg"; \
60                rel2.to: "back_bg"; \
61                fixed: 1 1; \
62                min: RADIO_STYLE_DEFAULT_BG_MIN_MAX_INC; \
63                max: RADIO_STYLE_DEFAULT_BG_MIN_MAX_INC; \
64                color: 0 0 0 0; \
65             } \
66          } \
67          part { name: "radio"; \
68             mouse_events: 0; \
69             scale: 1; \
70             description { state: "default" 0.0; \
71                rel1 { \
72                   to: "bg"; \
73                   offset: 0 0; \
74                } \
75                rel2 { \
76                   to: "bg"; \
77                   offset: 0 0; \
78                } \
79                color: 255 255 255 255; \
80                image.normal: "00_button_radio_normal2.png"; \
81             } \
82             description { state: "visible" 0.0; \
83                inherit: "default" 0.0; \
84                image.normal: "00_button_radio_normal1.png"; \
85                color: 255 255 255 255; \
86             } \
87             description { state: "disabled" 0.0; \
88                inherit: "default" 0.0; \
89                color: 255 255 255 128; \
90             } \
91             description { state: "disabled_visible" 0.0; \
92                inherit: "visible" 0.0; \
93                color: 255 255 255 128; \
94             } \
95          } \
96          part { name: "elm.swallow.content"; \
97             type: SWALLOW; \
98             description { state: "default" 0.0; \
99                fixed: 1 0; \
100                visible: 0; \
101                color: 255 255 255 255; \
102                align: 0.0 0.5; \
103                rel1 { \
104                   to_x: "bg"; \
105                   relative: 1.0 0.0; \
106                   offset: 1 1; \
107                } \
108                rel2 { \
109                   to_x: "bg"; \
110                   offset: 2 -2; \
111                } \
112             } \
113             description { state: "visible" 0.0; \
114                inherit: "default" 0.0; \
115                fixed: 1 1; \
116                visible: 1; \
117                aspect: 1.0 1.0; \
118                aspect_preference: VERTICAL; \
119             } \
120             description { state: "disabled" 0.0; \
121                inherit: "default" 0.0; \
122                color: 128 128 128 128; \
123             } \
124             description { state: "disabled_visible" 0.0; \
125                inherit: "default" 0.0; \
126                color: 128 128 128 128; \
127                fixed: 1 1; \
128                visible: 1; \
129                aspect: 1.0 1.0; \
130             } \
131          } \
132          part { name: "elm.text"; \
133             type: TEXTBLOCK; \
134             mouse_events: 0; \
135             scale: 1; \
136             description { state: "default" 0.0; \
137                visible: 0; \
138                fixed: 0 1; \
139                rel1 { \
140                   relative: 1.0 0.5; \
141                   offset: 1 1; \
142                   to_x: "elm.swallow.content"; \
143                } \
144                rel2 { \
145                   relative: 1.0 0.5; \
146                   offset: -2 -2; \
147                } \
148                color: 255 255 255 255; \
149                align: 0.0 0.5; \
150                text { \
151                   style: "radio_label_textblock_style"; \
152                   min: 0 0; \
153                } \
154                color: RADIO_DEFAULT_TEXT_NORMAL_COLOR_INC; \
155             } \
156             description { state: "visible" 0.0; \
157                inherit: "default" 0.0; \
158                visible: 1; \
159                text.min: 1 1; \
160             } \
161             description { state: "disabled" 0.0; \
162                inherit: "default" 0.0; \
163             } \
164             description { state: "disabled_visible" 0.0; \
165                inherit: "default" 0.0; \
166                visible: 1; \
167                text.min: 1 1; \
168                color: RADIO_DEFAULT_TEXT_DISABLED_COLOR_INC; \
169             } \
170          } \
171          part { name: "over1"; \
172             type: RECT; \
173             ignore_flags: ON_HOLD; \
174             description { state: "default" 0.0; \
175                color: 0 0 0 0; \
176             } \
177          } \
178          part { name: "over2"; \
179             type: RECT; \
180             repeat_events:1; \
181             description { state: "default" 0.0; \
182                color: 0 0 0 0; \
183             } \
184          } \
185          part { name: "disabler"; \
186             type: RECT; \
187             description { state: "default" 0.0; \
188                visible: 0; \
189             } \
190             description { state: "disabled" 0.0; \
191                inherit: "default" 0.0; \
192                visible: 1; \
193                color: 0 0 0 0; \
194             } \
195          } \
196       } \
197       programs { \
198          program { name: "click"; \
199             signal: "mouse,clicked,1"; \
200             source: "over1"; \
201             action: SIGNAL_EMIT "elm,action,radio,toggle" ""; \
202          } \
203          program { name: "radio_on"; \
204             signal: "elm,state,radio,on"; \
205             source: "elm"; \
206             script { \
207                set_state(PART:"radio", "visible", 0.0); \
208             } \
209          } \
210          program { name: "radio_off"; \
211             signal: "elm,state,radio,off"; \
212             source: "elm"; \
213             script { \
214                set_state(PART:"radio", "default", 0.0); \
215             } \
216          } \
217          program { name: "text_show"; \
218             signal: "elm,state,text,visible"; \
219             source: "elm"; \
220             action: STATE_SET "visible" 0.0; \
221             target: "elm.text"; \
222          } \
223          program { name: "text_hide"; \
224             signal: "elm,state,text,hidden"; \
225             source: "elm"; \
226             action: STATE_SET "default" 0.0; \
227             target: "elm.text"; \
228          } \
229          program { name: "icon_show"; \
230             signal: "elm,state,icon,visible"; \
231             source: "elm"; \
232             action: STATE_SET "visible" 0.0; \
233             target: "elm.swallow.content"; \
234          } \
235          program { name: "icon_hide"; \
236             signal: "elm,state,icon,hidden"; \
237             source: "elm"; \
238             action: STATE_SET "default" 0.0; \
239             target: "elm.swallow.content"; \
240          } \
241          program { name: "disable"; \
242             signal: "elm,state,disabled"; \
243             source: "elm"; \
244             action: STATE_SET "disabled" 0.0; \
245             target: "disabler"; \
246             after: "disable_text"; \
247          } \
248          program { name: "disable_text"; \
249             script { \
250                new st[31]; \
251                new Float:vl; \
252                get_state(PART:"elm.text", st, 30, vl); \
253                if (!strcmp(st, "visible")) \
254                  set_state(PART:"elm.text", "disabled_visible", 0.0); \
255                else \
256                  set_state(PART:"elm.text", "disabled", 0.0); \
257                get_state(PART:"elm.swallow.content", st, 30, vl); \
258                if (!strcmp(st, "visible")) \
259                  set_state(PART:"elm.swallow.content", "disabled_visible", 0.0); \
260                else \
261                  set_state(PART:"elm.swallow.content", "disabled", 0.0); \
262                get_state(PART:"radio", st, 30, vl); \
263                if (!strcmp(st, "visible")) \
264                  set_state(PART:"radio", "disabled_visible", 0.0); \
265                else \
266                  set_state(PART:"radio", "disabled", 0.0); \
267             } \
268          } \
269          program { name: "enable"; \
270             signal: "elm,state,enabled"; \
271             source: "elm"; \
272             action: STATE_SET "default" 0.0; \
273             target: "disabler"; \
274             after: "enable_text"; \
275          } \
276          program { name: "enable_text"; \
277             script { \
278                new st[31]; \
279                new Float:vl; \
280                get_state(PART:"elm.text", st, 30, vl); \
281                if (!strcmp(st, "disabled_visible")) \
282                  set_state(PART:"elm.text", "visible", 0.0); \
283                else \
284                  set_state(PART:"elm.text", "default", 0.0); \
285                get_state(PART:"elm.swallow.content", st, 30, vl); \
286                if (!strcmp(st, "disabled_visible")) \
287                  set_state(PART:"elm.swallow.content", "visible", 0.0); \
288                else \
289                  set_state(PART:"elm.swallow.content", "default", 0.0); \
290                get_state(PART:"radio", st, 30, vl); \
291                if (!strcmp(st, "disabled_visible")) \
292                  set_state(PART:"radio", "visible", 0.0); \
293                else \
294                  set_state(PART:"radio", "default", 0.0); \
295             } \
296          } \
297       } \
298    }
299
300 ///////////////////////////////////////////////////////////////////////////////////////
301 RADIO_STYLE_DEFAULT("default", RADIO_STYLE_DEFAULT_BG_IMAGE_MIN_WIDTH_INC, RADIO_STYLE_DEFAULT_BG_IMAGE_MIN_HEIGHT_INC)
302
303 ///////////////////////////////////////////////////////////////////////////////////////
304 RADIO_STYLE_DEFAULT("default/extended", RADIO_STYLE_DEFAULT_EXTENDED_BG_IMAGE_MIN_WIDTH_INC, RADIO_STYLE_DEFAULT_EXTENDED_BG_IMAGE_MIN_WIDTH_INC)
305
306 ///////////////////////////////////////////////////////////////////////////////////////
307
308 #undef RADIO_STATE_DEFAULT
309 #undef RADIO_STATE_VISIBLE
310 #undef RADIO_STATE_DISABLED_VISIBLE
311 #undef RADIO_STATE_DISABLED