[Release] wrt_0.8.149
[platform/framework/web/wrt.git] / data / wrt_theme.edc
1 #define BACKWARD_ICON_1 "backward_1.png"
2 #define BACKWARD_ICON_2 "backward_2.png"
3
4 #define BUTTON(button_name, normal_image, press_image, l, r, t, b) \
5 group { \
6     name: "elm/button/base/wrt/"#button_name; \
7     images { \
8         image: normal_image COMP; \
9         image: press_image COMP; \
10     } \
11     styles { \
12         style { \
13             name: #button_name"btn_textblock_style"; \
14             base: "font=FONT_CONTENT font_size=20 align=center color=#4E4945 wrap=char"; \
15             tag:  "br" "\n"; \
16             tag:  "hilight" "+ font=FONT_CONTENT:style=Bold"; \
17             tag:  "b" "+ font=FONT_CONTENT:style=Bold"; \
18             tag:  "tab" "\t"; \
19         } \
20     } \
21     parts { \
22         part { \
23             name: "button_image"; \
24             mouse_events: 1; \
25             effect:        SOFT_SHADOW; \
26             description { \
27                 state: "default" 0.0; \
28                 image { \
29                     normal: normal_image; \
30                     border: l r t b; \
31                 } \
32             } \
33             description { \
34                 state: "clicked" 0.0; \
35                 inherit: "default" 0.0; \
36                 image.normal: press_image; \
37             } \
38             description { \
39                state: "disabled" 0.0; \
40                inherit:  "default" 0.0; \
41                image.normal: normal_image; \
42             } \
43         } \
44         part { \
45             name: "elm.text"; \
46             type: TEXTBLOCK; \
47             effect: SHADOW; \
48             mouse_events: 0; \
49             scale: 1; \
50             description { \
51                 state: "default" 0.0; \
52                 visible: 0; \
53                 fixed: 1 1; \
54                 align: 0.5 0.5; \
55                 rel1 { relative: 0.1 0; to: "button_image"; } \
56                 rel2 { relative: 0.9 1; to: "button_image"; } \
57                 color: 0 0 0 255; \
58                 text { \
59                     style: #button_name"btn_textblock_style"; \
60                     min: 0 0; \
61                     max: 0 1; \
62                 } \
63             } \
64             description { \
65                 state: "visible" 0.0; \
66                 inherit: "default" 0.0; \
67                 visible: 1; \
68                 min: 1 1; \
69             } \
70             description { \
71                 state: "clicked" 0.0; \
72                 inherit: "default" 0.0; \
73                 visible: 1; \
74                 min: 1 1; \
75             } \
76             description { \
77                 state: "disabled" 0.0; \
78                 inherit: "default" 0.0; \
79                 color: 0 0 0 128; \
80                 color3: 0 0 0 0; \
81             } \
82             description { \
83                 state: "disabled_visible" 0.0; \
84                 inherit: "default" 0.0; \
85                 color: 0 0 0 128; \
86                 color3: 0 0 0 0; \
87                 visible: 1; \
88                 min: 1 1; \
89             } \
90         } \
91         part { \
92             name: "over1"; \
93             mouse_events: 0; \
94             description { \
95                 state: "default" 0.0; \
96                 rel2.relative: 1.0 0.5; \
97                 } \
98                 description { \
99                     state: "disabled" 0.0; \
100                     inherit:  "default" 0.0; \
101                 } \
102             } \
103             part { \
104                 name: "over2"; \
105                 mouse_events: 1; \
106                 repeat_events: 1; \
107                 ignore_flags: ON_HOLD; \
108                 description { \
109                     state: "default" 0.0; \
110                 } \
111                 description { \
112                     state: "disabled" 0.0; \
113                     inherit:  "default" 0.0; \
114                     visible: 0; \
115                 } \
116             } \
117             part { \
118                 name: "over3"; \
119                 mouse_events: 1; \
120                 repeat_events: 1; \
121                 description { \
122                     state: "default" 0.0; \
123                     color: 255 255 255 0; \
124                 } \
125                 description { \
126                     state: "clicked" 0.0; \
127                     inherit:  "default" 0.0; \
128                     visible: 1; \
129                     color: 255 255 255 0; \
130                 } \
131             } \
132             part { \
133                 name: "disabler"; \
134                 type: RECT; \
135                 description { \
136                     state: "default" 0.0; \
137                     color: 0 0 0 0; \
138                     visible: 0; \
139                 } \
140                 description { \
141                     state: "disabled" 0.0; \
142                     inherit: "default" 0.0; \
143                     visible: 1; \
144                 } \
145             } \
146         } \
147         programs { \
148             program { \
149                 name: "button_click"; \
150                 signal: "mouse,down,1"; \
151                 source: "over2"; \
152                 action: SIGNAL_EMIT "elm,action,press" ""; \
153                 after: "button_click_anim"; \
154             } \
155             program { \
156                 name: "button_click_anim"; \
157                 action: STATE_SET "clicked" 0.0; \
158                 target: "button_image"; \
159                 target: "elm.text"; \
160             } \
161             program { \
162                 name: "button_unclick"; \
163                 signal: "mouse,up,1"; \
164                 source: "over2"; \
165                 action: SIGNAL_EMIT "elm,action,unpress" ""; \
166                 after: "button_unclick_anim"; \
167             } \
168             program { \
169                 name: "button_unclick_anim"; \
170                 action: STATE_SET "default" 0.0; \
171                 target: "button_image"; \
172                 action: STATE_SET "visible" 0.0; \
173                 target: "elm.text"; \
174             } \
175             program { \
176                 name: "button_mouseout_clicked"; \
177                 signal: "mouse,out"; \
178                 source: "over2"; \
179                 script { \
180                     new st[31]; \
181                     new Float:vl; \
182                     get_state(PART:"elm.text", st, 30, vl); \
183                     if (!strcmp(st, "clicked")) \
184                     { \
185                         set_state(PART:"elm.text", "visible", 0.0); \
186                         set_state(PART:"button_image", "visible", 0.0); \
187                     } \
188                 } \
189             } \
190             program { \
191                 name: "button_click2"; \
192                 signal: "mouse,down,1"; \
193                 source: "over3"; \
194                 action: STATE_SET "clicked" 0.0; \
195                 target: "over3"; \
196             } \
197             program { \
198                 name: "button_unclick2"; \
199                 signal: "mouse,clicked,1"; \
200                 source: "over3"; \
201                 action: STATE_SET "default" 0.0; \
202                 target: "over3"; \
203             } \
204             program { \
205                 name: "button_unclick3"; \
206                 signal: "mouse,clicked,1"; \
207                 source: "over2"; \
208                 action: SIGNAL_EMIT "elm,action,click" ""; \
209             } \
210             program { \
211                 name: "text_show"; \
212                 signal: "elm,state,text,visible"; \
213                 source: "elm"; \
214                 action: STATE_SET "visible" 0.0; \
215                 target: "elm.text"; \
216             } \
217             program { \
218                 name: "text_hide"; \
219                 signal: "elm,state,text,hidden"; \
220                 source: "elm"; \
221                 action: STATE_SET "default" 0.0; \
222                 target: "elm.text"; \
223             } \
224             program { \
225                 name: "disable"; \
226                 signal: "elm,state,disabled"; \
227                 source: "elm"; \
228                 action: STATE_SET "disabled" 0.0; \
229                 target: "button_image"; \
230                 target: "over1"; \
231                 target: "over2"; \
232                 target: "disabler"; \
233                 after: "disable_text"; \
234             } \
235             program { \
236                 name: "disable_text"; \
237                 script { \
238                     new st[31]; \
239                     new Float:vl; \
240                     get_state(PART:"elm.text", st, 30, vl); \
241                     if (!strcmp(st, "visible")) \
242                         set_state(PART:"elm.text", "disabled_visible", 0.0); \
243                     else \
244                         set_state(PART:"elm.text", "disabled", 0.0); \
245                 } \
246             } \
247             program { \
248                 name: "enable"; \
249                 signal: "elm,state,enabled"; \
250                 source: "elm"; \
251                 action: STATE_SET "default" 0.0; \
252                 target: "button_image"; \
253                 target: "over1"; \
254                 target: "over2"; \
255                 target: "disabler"; \
256                 after: "enable_text"; \
257             } \
258             program { \
259                 name: "enable_text"; \
260                 script { \
261                     new st[31]; \
262                     new Float:vl; \
263                     get_state(PART:"elm.text", st, 30, vl); \
264                     if (!strcmp(st, "disabled_visible")) \
265                         set_state(PART:"elm.text", "visible", 0.0); \
266                     else \
267                         set_state(PART:"elm.text", "default", 0.0); \
268                 } \
269             } \
270         } \
271 }
272
273 collections {
274     BUTTON(backward, BACKWARD_ICON_1, BACKWARD_ICON_2, 0, 0, 0, 0);
275 }
276