c8865f489376dd0514e748d5322cb7c2bb540dde
[platform/core/uifw/inputdelegator.git] / res / edje / w-input-stt-button.edc
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  *  Licensed under the Apache License, Version 2.0 (the "License");
5  *  you may not use this file except in compliance with the License.
6  *  You may obtain a copy of the License at
7  *
8  *        http://www.apache.org/licenses/LICENSE-2.0
9  *
10  *  Unless required by applicable law or agreed to in writing, software
11  *  distributed under the License is distributed on an "AS IS" BASIS,
12  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  *  See the License for the specific language governing permissions and
14  *  limitations under the License.
15  *
16  */
17
18 #define NORMAL_BG_IMAGE                                          "B09_voice_input_panel.png"
19
20 #define PROGRESSING_DELAY 0.03
21 #define PROGRESS_BG_DESC1( param_name, param_num )                                                              \
22 description                                                                                                                                        \
23 {                                                                                                                                                                \
24         state, "pulse" 0.#param_num;                                                                                              \
25         inherit, "default" 0.0;                                                                                                    \
26         image.normal, "B09_"#param_name"_"#param_num".png";                                                \
27 }
28
29 #define LISTEN_BG_DESC( param_name, param_num )                                                            \
30 description                                                                                                                                        \
31 {                                                                                                                                                                \
32         state, "wave" 0.#param_num;                                                                                                \
33         inherit, "default" 0.0;                                                                                                    \
34         image.normal, "B09_"#param_name"_"#param_num".png";                                                \
35 }
36
37 #define BUTTON_CIRCLE_STYLE_BG_MIN_MAX_INC 112 112
38 #define BUTTON_CIRCLE_STYLE_IMAGE_MIN_MAX_INC 45 45
39 #define BUTTON_CIRCLE_STYLE_CONTENT_MIN_MAX_INC 45 45
40 #define BUTTON_CIRCLE_STYLE_LEFT_PADDING_MIN_MAX_INC 13 13
41 #define BUTTON_CIRCLE_STYLE_RIGHT_PADDING_MIN_MAX_INC 14 14
42
43 #define BUTTON_CIRCLE_STYLE_NORMAL_TOP_OFFSET_INC 0 2
44 #define BUTTON_CIRCLE_STYLE_NORMAL_BOTTOM_OFFSET_INC -1 1
45 #define BUTTON_CIRCLE_STYLE_PRESSED_TOP_OFFSET_INC 0 -2
46 #define BUTTON_CIRCLE_STYLE_PRESSED_BOTTOM_OFFSET_INC -1 -3
47
48 #define BUTTON_CIRCLE_STYLE_CLIPPER_DEFAULT_COLOR_INC 0 0 0 255
49 #define BUTTON_CIRCLE_STYLE_ICON_CLIPPER_PRESSED_COLOR_INC 0 0 0 255
50 #define BUTTON_CIRCLE_STYLE_ICON_CLIPPER_DISABLED_COLOR_INC 21 22 25 255
51
52 #define BUTTON_CIRCLE_STYLE_NORMAL_COLOR_INC 250 250 250 255
53 #define BUTTON_CIRCLE_STYLE_PRESSED_COLOR_INC 250 250 250 255
54 #define BUTTON_CIRCLE_STYLE_DISABLED_COLOR_INC 166 167 169 255
55
56
57 ///////////////////////////////////////////////////////////////////////////////////////
58
59
60 //============================================================================
61 //============================================================================
62
63 /**
64  * Resources
65  *
66  */
67
68 /**
69  * Macro
70  *
71  */
72 #define BTN_IMAGE()                                                                                                               \
73 part                                                                                                                                             \
74 {                                                                                                                                                       \
75         name, "button_image";                                                                                                   \
76         mouse_events, 1;                                                                                                                 \
77         scale, 1;                                                                                                                               \
78         description                                                                                                                       \
79         {                                                                                                                                               \
80                 state, "default" 0.0;                                                                                           \
81         }                                                                                                                                               \
82         description                                                                                                                       \
83         {                                                                                                                                               \
84                 state, "clicked" 0.0;                                                                                           \
85                 inherit, "default" 0.0;                                                                                   \
86         }                                                                                                                                               \
87         description                                                                                                                       \
88         {                                                                                                                                               \
89                 state, "disabled" 0.0;                                                                                     \
90                 inherit, "default" 0.0;                                                                                   \
91                 visible, 1;                                                                                                               \
92         }                                                                                                                                               \
93         description                                                                                                                       \
94         {                                                                                                                                               \
95                 state, "focused" 0.0;                                                                                           \
96                 inherit, "default" 0.0;                                                                                   \
97         }                                                                                                                                               \
98 }
99
100 #define OVER()                                                                                                                     \
101 part                                                                                                                                             \
102 {                                                                                                                                                       \
103         name, "over2";                                                                                                             \
104         type, RECT;                                                                                                                       \
105         mouse_events, 1;                                                                                                                 \
106         repeat_events, 1;                                                                                                               \
107         ignore_flags, ON_HOLD;                                                                                             \
108         description                                                                                                                       \
109         {                                                                                                                                               \
110                 state, "default" 0.0;                                                                                           \
111                 color, 0 0 0 0;                                                                                                   \
112         }                                                                                                                                               \
113         description                                                                                                                       \
114         {                                                                                                                                               \
115                 state, "disabled" 0.0;                                                                                     \
116                 inherit,  "default" 0.0;                                                                                         \
117                 visible, 0;                                                                                                               \
118         }                                                                                                                                               \
119 }                                                                                                                                                       \
120 part                                                                                                                                             \
121 {                                                                                                                                                       \
122         name, "over3";                                                                                                             \
123         type, RECT;                                                                                                                       \
124         mouse_events, 1;                                                                                                                 \
125         repeat_events, 1;                                                                                                               \
126         description                                                                                                                       \
127         {                                                                                                                                               \
128                 state, "default" 0.0;                                                                                           \
129                 color, 0 0 0 0;                                                                                                   \
130         }                                                                                                                                               \
131         description                                                                                                                       \
132         {                                                                                                                                               \
133                 state, "clicked" 0.0;                                                                                           \
134                 inherit,  "default" 0.0;                                                                                         \
135                 visible, 1;                                                                                                               \
136         }                                                                                                                                               \
137 }
138
139 #define DISABLER()                                                                                                                 \
140 part                                                                                                                                             \
141 {                                                                                                                                                       \
142         name, "disabler";                                                                                                               \
143         type, RECT;                                                                                                                       \
144         description                                                                                                                       \
145         {                                                                                                                                               \
146                 state, "default" 0.0;                                                                                           \
147                 color, 255 255 255 0;                                                                                           \
148                 visible, 0;                                                                                                               \
149         }                                                                                                                                               \
150         description                                                                                                                       \
151         {                                                                                                                                               \
152                 state, "disabled" 0.0;                                                                                     \
153                 inherit, "default" 0.0;                                                                                   \
154                 visible, 1;                                                                                                               \
155         }                                                                                                                                               \
156 }
157
158 #define PROG_FOCUS                                                                                                                 \
159 program                                                                                                                                   \
160 {                                                                                                                                                       \
161         name, "focused";                                                                                                                 \
162         signal, "elm,action,focus";                                                                                       \
163         source, "elm";                                                                                                             \
164         action, STATE_SET "focused" 0.0;                                                                                 \
165         target, "button_image";                                                                                           \
166 }                                                                                                                                                       \
167 program                                                                                                                                   \
168 {                                                                                                                                                       \
169         name, "unfocused";                                                                                                         \
170         signal, "elm,action,unfocus";                                                                                   \
171         source, "elm";                                                                                                             \
172         action, STATE_SET "default" 0.0;                                                                                 \
173         target, "button_image";                                                                                           \
174 }
175
176 #define PROG_ENABLE                                                                                                               \
177 program                                                                                                                                   \
178 {                                                                                                                                                       \
179         name: "disable";                                                                                                                 \
180         signal: "elm,state,disabled";                                                                                   \
181         source: "elm";                                                                                                             \
182         action: STATE_SET "disabled" 0.0;                                                                               \
183         target: "button_image";                                                                                           \
184         target: "over2";                                                                                                                 \
185         target: "disabler";                                                                                                       \
186 }                                                                                                                                                       \
187 program                                                                                                                                   \
188 {                                                                                                                                                       \
189         name: "enable";                                                                                                           \
190         signal: "elm,state,enabled";                                                                                     \
191         source: "elm";                                                                                                             \
192         action: STATE_SET "default" 0.0;                                                                                 \
193         target: "button_image";                                                                                           \
194         target: "over2";                                                                                                                 \
195         target: "disabler";                                                                                                       \
196 }
197
198 #define PROG_CLICK                                                                                                                 \
199 program                                                                                                                                   \
200 {                                                                                                                                                       \
201         name: "button_click";                                                                                                   \
202         signal: "mouse,down,1";                                                                                           \
203         source: "over2";                                                                                                                 \
204         action: SIGNAL_EMIT "elm,action,press" "";                                                         \
205         after: "button_click_anim";                                                                                       \
206 }                                                                                                                                                       \
207 program                                                                                                                                   \
208 {                                                                                                                                                       \
209         name: "button_click_anim";                                                                                         \
210         action: STATE_SET "clicked" 0.0;                                                                                 \
211         target: "button_image";                                                                                           \
212 }                                                                                                                                                       \
213 program                                                                                                                                   \
214 {                                                                                                                                                       \
215         name: "button_unclick";                                                                                           \
216         signal: "mouse,up,1";                                                                                                   \
217         source: "over2";                                                                                                                 \
218         action: SIGNAL_EMIT "elm,action,unpress" "";                                                     \
219         after: "button_unclick_anim";                                                                                   \
220 }                                                                                                                                                       \
221 program                                                                                                                                   \
222 {                                                                                                                                                       \
223         name: "button_unclick_anim";                                                                                     \
224         action: STATE_SET "default" 0.0;                                                                                 \
225         target: "button_image";                                                                                           \
226 }                                                                                                                                                       \
227 program                                                                                                                                   \
228 {                                                                                                                                                       \
229         name: "button_mouseout_clicked";                                                                                 \
230         signal: "mouse,out";                                                                                                     \
231         source: "over2";                                                                                                                 \
232         script                                                                                                                             \
233         {                                                                                                                                               \
234                 new st[31];                                                                                                               \
235                 new Float:vl;                                                                                                           \
236                 get_state(PART:"button_image", st, 30, vl);                                               \
237                 if (!strcmp(st, "clicked"))                                                                               \
238                 {                                                                                                                                       \
239                         set_state(PART:"button_image", "visible", 0.0);                           \
240                 }                                                                                                                                       \
241         }                                                                                                                                               \
242 }                                                                                                                                                       \
243 program                                                                                                                                   \
244 {                                                                                                                                                       \
245         name: "button_click2";                                                                                             \
246         signal: "mouse,down,1";                                                                                           \
247         source: "over3";                                                                                                                 \
248         action: STATE_SET "clicked" 0.0;                                                                                 \
249         target: "over3";                                                                                                                 \
250         action: SIGNAL_EMIT "elm,action,click" "";                                                         \
251 }                                                                                                                                                       \
252 program                                                                                                                                   \
253 {                                                                                                                                                       \
254         name: "button_unclick2";                                                                                                 \
255         signal: "mouse,up,1";                                                                                                   \
256         source: "over3";                                                                                                                 \
257         action: STATE_SET "default" 0.0;                                                                                 \
258         target: "over3";                                                                                                                 \
259 }                                                                                                                                                       \
260 program                                                                                                                                   \
261 {                                                                                                                                                       \
262         name: "button_unclick3";                                                                                                 \
263         signal: "mouse,up,1";                                                                                                   \
264         source: "over2";                                                                                                                 \
265 }
266
267 #define VIC_BUTTON()                                                                                                             \
268 group                                                                                                                                           \
269 {                                                                                                                                                       \
270         name, "elm/button/base/vic/micbutton";                                                             \
271         parts                                                                                                                                   \
272         {                                                                                                                                               \
273                 BTN_IMAGE()                                                                                                               \
274                 OVER()                                                                                                                     \
275                 DISABLER()                                                                                                                 \
276         }                                                                                                                                               \
277         programs                                                                                                                                 \
278         {                                                                                                                                               \
279                 PROG_CLICK                                                                                                                 \
280                 PROG_ENABLE                                                                                                               \
281                 PROG_FOCUS                                                                                                                 \
282         }                                                                                                                                               \
283 }
284
285 collections
286 {
287         VIC_BUTTON()
288 }