fix wrong edc usage.
[platform/core/uifw/inputdelegator.git] / res / mobile / 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 rect                                                                                                                                             \
74 {                                                                                                                                                       \
75         name, "button_image";                                                                                                   \
76         mouse_events, 1;                                                                                                                 \
77         scale, 1;                                                                                                                               \
78         description                                                                                                                       \
79         {                                                                                                                                               \
80                 state, "default" 0.0;                                                                                           \
81                 color, 0 0 0 0;                                                                                         \
82         }                                                                                                                                               \
83         description                                                                                                                       \
84         {                                                                                                                                               \
85                 state, "clicked" 0.0;                                                                                           \
86                 inherit, "default" 0.0;                                                                                   \
87         }                                                                                                                                               \
88         description                                                                                                                       \
89         {                                                                                                                                               \
90                 state, "disabled" 0.0;                                                                                     \
91                 inherit, "default" 0.0;                                                                                   \
92                 visible, 1;                                                                                                               \
93         }                                                                                                                                               \
94         description                                                                                                                       \
95         {                                                                                                                                               \
96                 state, "focused" 0.0;                                                                                           \
97                 inherit, "default" 0.0;                                                                                   \
98         }                                                                                                                                               \
99 }
100
101 #define OVER()                                                                                                                     \
102 part                                                                                                                                             \
103 {                                                                                                                                                       \
104         name, "over2";                                                                                                             \
105         type, RECT;                                                                                                                       \
106         mouse_events, 1;                                                                                                                 \
107         repeat_events, 1;                                                                                                               \
108         ignore_flags, ON_HOLD;                                                                                             \
109         description                                                                                                                       \
110         {                                                                                                                                               \
111                 state, "default" 0.0;                                                                                           \
112                 color, 0 0 0 0;                                                                                                   \
113         }                                                                                                                                               \
114         description                                                                                                                       \
115         {                                                                                                                                               \
116                 state, "disabled" 0.0;                                                                                     \
117                 inherit,  "default" 0.0;                                                                                         \
118                 visible, 0;                                                                                                               \
119         }                                                                                                                                               \
120 }                                                                                                                                                       \
121 part                                                                                                                                             \
122 {                                                                                                                                                       \
123         name, "over3";                                                                                                             \
124         type, RECT;                                                                                                                       \
125         mouse_events, 1;                                                                                                                 \
126         repeat_events, 1;                                                                                                               \
127         description                                                                                                                       \
128         {                                                                                                                                               \
129                 state, "default" 0.0;                                                                                           \
130                 color, 0 0 0 0;                                                                                                   \
131         }                                                                                                                                               \
132         description                                                                                                                       \
133         {                                                                                                                                               \
134                 state, "clicked" 0.0;                                                                                           \
135                 inherit,  "default" 0.0;                                                                                         \
136                 visible, 1;                                                                                                               \
137         }                                                                                                                                               \
138 }
139
140 #define DISABLER()                                                                                                                 \
141 part                                                                                                                                             \
142 {                                                                                                                                                       \
143         name, "disabler";                                                                                                               \
144         type, RECT;                                                                                                                       \
145         description                                                                                                                       \
146         {                                                                                                                                               \
147                 state, "default" 0.0;                                                                                           \
148                 color, 255 255 255 0;                                                                                           \
149                 visible, 0;                                                                                                               \
150         }                                                                                                                                               \
151         description                                                                                                                       \
152         {                                                                                                                                               \
153                 state, "disabled" 0.0;                                                                                     \
154                 inherit, "default" 0.0;                                                                                   \
155                 visible, 1;                                                                                                               \
156         }                                                                                                                                               \
157 }
158
159 #define PROG_FOCUS                                                                                                                 \
160 program                                                                                                                                   \
161 {                                                                                                                                                       \
162         name, "focused";                                                                                                                 \
163         signal, "elm,action,focus";                                                                                       \
164         source, "elm";                                                                                                             \
165         action, STATE_SET "focused" 0.0;                                                                                 \
166         target, "button_image";                                                                                           \
167 }                                                                                                                                                       \
168 program                                                                                                                                   \
169 {                                                                                                                                                       \
170         name, "unfocused";                                                                                                         \
171         signal, "elm,action,unfocus";                                                                                   \
172         source, "elm";                                                                                                             \
173         action, STATE_SET "default" 0.0;                                                                                 \
174         target, "button_image";                                                                                           \
175 }
176
177 #define PROG_ENABLE                                                                                                               \
178 program                                                                                                                                   \
179 {                                                                                                                                                       \
180         name: "disable";                                                                                                                 \
181         signal: "elm,state,disabled";                                                                                   \
182         source: "elm";                                                                                                             \
183         action: STATE_SET "disabled" 0.0;                                                                               \
184         target: "button_image";                                                                                           \
185         target: "over2";                                                                                                                 \
186         target: "disabler";                                                                                                       \
187 }                                                                                                                                                       \
188 program                                                                                                                                   \
189 {                                                                                                                                                       \
190         name: "enable";                                                                                                           \
191         signal: "elm,state,enabled";                                                                                     \
192         source: "elm";                                                                                                             \
193         action: STATE_SET "default" 0.0;                                                                                 \
194         target: "button_image";                                                                                           \
195         target: "over2";                                                                                                                 \
196         target: "disabler";                                                                                                       \
197 }
198
199 #define PROG_CLICK                                                                                                                 \
200 program                                                                                                                                   \
201 {                                                                                                                                                       \
202         name: "button_click";                                                                                                   \
203         signal: "mouse,down,1";                                                                                           \
204         source: "over2";                                                                                                                 \
205         action: SIGNAL_EMIT "elm,action,press" "";                                                         \
206         after: "button_click_anim";                                                                                       \
207 }                                                                                                                                                       \
208 program                                                                                                                                   \
209 {                                                                                                                                                       \
210         name: "button_click_anim";                                                                                         \
211         action: STATE_SET "clicked" 0.0;                                                                                 \
212         target: "button_image";                                                                                           \
213 }                                                                                                                                                       \
214 program                                                                                                                                   \
215 {                                                                                                                                                       \
216         name: "button_unclick";                                                                                           \
217         signal: "mouse,up,1";                                                                                                   \
218         source: "over2";                                                                                                                 \
219         action: SIGNAL_EMIT "elm,action,unpress" "";                                                     \
220         after: "button_unclick_anim";                                                                                   \
221 }                                                                                                                                                       \
222 program                                                                                                                                   \
223 {                                                                                                                                                       \
224         name: "button_unclick_anim";                                                                                     \
225         action: STATE_SET "default" 0.0;                                                                                 \
226         target: "button_image";                                                                                           \
227 }                                                                                                                                                       \
228 program                                                                                                                                   \
229 {                                                                                                                                                       \
230         name: "button_mouseout_clicked";                                                                                 \
231         signal: "mouse,out";                                                                                                     \
232         source: "over2";                                                                                                                 \
233         script                                                                                                                             \
234         {                                                                                                                                               \
235                 new st[31];                                                                                                               \
236                 new Float:vl;                                                                                                           \
237                 get_state(PART:"button_image", st, 30, vl);                                               \
238                 if (!strcmp(st, "clicked"))                                                                               \
239                 {                                                                                                                                       \
240                         set_state(PART:"button_image", "visible", 0.0);                           \
241                 }                                                                                                                                       \
242         }                                                                                                                                               \
243 }                                                                                                                                                       \
244 program                                                                                                                                   \
245 {                                                                                                                                                       \
246         name: "button_click2";                                                                                             \
247         signal: "mouse,down,1";                                                                                           \
248         source: "over3";                                                                                                                 \
249         action: STATE_SET "clicked" 0.0;                                                                                 \
250         target: "over3";                                                                                                                 \
251         action: SIGNAL_EMIT "elm,action,click" "";                                                         \
252 }                                                                                                                                                       \
253 program                                                                                                                                   \
254 {                                                                                                                                                       \
255         name: "button_unclick2";                                                                                                 \
256         signal: "mouse,up,1";                                                                                                   \
257         source: "over3";                                                                                                                 \
258         action: STATE_SET "default" 0.0;                                                                                 \
259         target: "over3";                                                                                                                 \
260 }                                                                                                                                                       \
261 program                                                                                                                                   \
262 {                                                                                                                                                       \
263         name: "button_unclick3";                                                                                                 \
264         signal: "mouse,up,1";                                                                                                   \
265         source: "over2";                                                                                                                 \
266 }
267
268 #define VIC_BUTTON()                                                                                                             \
269 group                                                                                                                                           \
270 {                                                                                                                                                       \
271         name, "elm/button/base/vic/micbutton";                                                             \
272         parts                                                                                                                                   \
273         {                                                                                                                                               \
274                 BTN_IMAGE()                                                                                                               \
275                 OVER()                                                                                                                     \
276                 DISABLER()                                                                                                                 \
277         }                                                                                                                                               \
278         programs                                                                                                                                 \
279         {                                                                                                                                               \
280                 PROG_CLICK                                                                                                                 \
281                 PROG_ENABLE                                                                                                               \
282                 PROG_FOCUS                                                                                                                 \
283         }                                                                                                                                               \
284 }
285
286 collections
287 {
288         VIC_BUTTON()
289 }