this is... the beginning of accessibility supportin elm. it's direct
[framework/uifw/elementary.git] / data / themes / widgets / label.edc
1 #define TEXT_SLIDE_DURATION     10
2
3 group { name: "elm/label/base/default";
4    data.item: "default_font_size" "10";
5    data.item: "min_font_size" "6";
6    data.item: "max_font_size" "60";
7    styles {
8       style { name: "textblock_style";
9          base: "font=Sans font_size=10 color=#000 text_class=label";
10          tag:  "br" "\n";
11          tag:  "ps" "ps";
12          tag:  "hilight" "+ font_weight=Bold";
13          tag:  "b" "+ font_weight=Bold";
14          tag:  "tab" "\t";
15       }
16    }
17    parts {
18       part { name: "label.swallow.background";
19          type: SWALLOW;
20          description { state: "default" 0.0;
21             visible: 1;
22          }
23       }
24       part { name: "label.text.clip";
25          type: RECT;
26          description { state: "default" 0.0;
27             rel1 { relative: 0 0; to: "label.swallow.background"; }
28             rel2 { relative: 1 1; to: "label.swallow.background"; }
29          }
30       }
31       part { name: "elm.text";
32          type: TEXTBLOCK;
33          scale: 1;
34          clip_to: "label.text.clip";
35          description { state: "default" 0.0;
36             rel1.relative: 0.0 0.0;
37             rel2.relative: 1.0 1.0;
38             text {
39                style: "textblock_style";
40                min: 0 1;
41             }
42          }
43       }
44    }
45 }
46
47 group { name: "elm/label/base/marker";
48    data.item: "default_font_size" "10";
49    data.item: "min_font_size" "6";
50    data.item: "max_font_size" "60";
51    styles {
52       style { name: "textblock_style2";
53          base: "font=Sans:style=Bold font_size=10 align=center color=#fff wrap=word text_class=label";
54          tag:  "br" "\n";
55          tag:  "ps" "ps";
56          tag:  "hilight" "+ color=#ffff";
57          tag:  "b" "+ color=#ffff";
58          tag:  "tab" "\t";
59       }
60    }
61    parts {
62       part { name: "label.swallow.background";
63          type: SWALLOW;
64          description { state: "default" 0.0;
65             visible: 1;
66             rel1 { relative: 0 0; to: "elm.text"; }
67             rel2 { relative: 1 1; to: "elm.text"; }
68          }
69       }
70       part { name: "elm.text";
71          type: TEXTBLOCK;
72          scale: 1;
73          description { state: "default" 0.0;
74             text {
75                style: "textblock_style2";
76                min: 1 1;
77             }
78          }
79       }
80    }
81 }
82
83 group { name: "elm/label/base/slide_long";
84    data.item: "default_font_size" "10";
85    data.item: "min_font_size" "6";
86    data.item: "max_font_size" "60";
87
88    script {
89       public g_duration, g_stopslide, g_timer_id, g_anim_id;
90
91       public message(Msg_Type:type, id, ...) {
92          if ((type == MSG_FLOAT_SET) && (id == 0)) {
93             new Float:duration;
94             duration = getfarg(2);
95             set_float(g_duration, duration);
96          }
97       }
98       public slide_to_end_anim(val, Float:pos) {
99          new stopflag;
100          new id;
101          stopflag = get_int(g_stopslide);
102          if (stopflag == 1) return;
103          set_tween_state(PART:"elm.text", pos, "slide_begin", 0.0, "slide_end", 0.0);
104          if (pos >= 1.0) {
105             id = timer(0.5, "slide_to_begin", 1);
106             set_int(g_timer_id, id);
107          }
108       }
109       public slide_to_end() {
110          new stopflag;
111          new id;
112          new Float:duration;
113          stopflag = get_int(g_stopslide);
114          if (stopflag == 1) return;
115          duration = get_float(g_duration);
116          id = anim(duration, "slide_to_end_anim", 1);
117          set_int(g_anim_id, id);
118       }
119       public slide_to_begin() {
120          new stopflag;
121          new id;
122          stopflag = get_int(g_stopslide);
123          if (stopflag == 1) return;
124          set_state(PART:"elm.text", "slide_begin", 0.0);
125          id = timer(0.5, "slide_to_end", 1);
126          set_int(g_timer_id, id);
127       }
128       public start_slide() {
129          set_int(g_stopslide, 0);
130          set_state(PART:"elm.text", "slide_begin", 0.0);
131          slide_to_end();
132       }
133       public stop_slide() {
134          new id;
135          set_int(g_stopslide, 1);
136          id = get_int(g_anim_id);
137          cancel_anim(id);
138          id = get_int(g_timer_id);
139          cancel_timer(id);
140          set_state(PART:"elm.text", "default", 0.0);
141       }
142    }
143
144    parts {
145       part { name: "label.swallow.background";
146          type: SWALLOW;
147          description { state: "default" 0.0;
148             visible: 1;
149          }
150       }
151       part { name: "label.text.clip";
152          type: RECT;
153          description { state: "default" 0.0;
154             visible: 1;
155             color: 255 255 255 255;
156             rel1 { relative: 0 0; to: "label.swallow.background"; }
157             rel2 { relative: 1 1; to: "label.swallow.background"; }
158          }
159       }
160       part { name: "elm.text";
161          type: TEXTBLOCK;
162          scale: 1;
163          clip_to: "label.text.clip";
164          description { state: "default" 0.0;
165             rel1.relative: 0.0 0.0;
166             rel2.relative: 1.0 1.0;
167             align: 0.0 0.0;
168             text {
169                style: "textblock_style";
170                min: 1 1;
171             }
172          }
173          description { state: "slide_end" 0.0;
174             inherit: "default" 0.0;
175             rel1.relative: 0.0 0.0;
176             rel2.relative: 0.0 1.0;
177             align: 1.0 0.0;
178          }
179          description { state: "slide_begin" 0.0;
180             inherit: "default" 0.0;
181             rel1.relative: 1.0 0.0;
182             rel2.relative: 1.0 1.0;
183             align: 0.0 0.0;
184          }
185       }
186    }
187    programs {
188       program { name: "start_slide";
189          source: "elm";
190          signal: "elm,state,slide,start";
191          script
192          {
193             start_slide();
194          }
195       }
196       program { name: "stop_slide";
197          source: "elm";
198          signal: "elm,state,slide,stop";
199          script
200          {
201             stop_slide();
202          }
203       }
204    }
205 }
206
207
208 group { name: "elm/label/base/slide_short";
209    data.item: "default_font_size" "10";
210    data.item: "min_font_size" "6";
211    data.item: "max_font_size" "60";
212
213    script {
214       public g_duration, g_stopslide, g_timer_id, g_anim_id;
215
216       public message(Msg_Type:type, id, ...) {
217          if ((type == MSG_FLOAT_SET) && (id == 0)) {
218             new Float:duration;
219             duration = getfarg(2);
220             set_float(g_duration, duration);
221          }
222       }
223       public slide_to_end_anim(val, Float:pos) {
224          new stopflag;
225          new id;
226          stopflag = get_int(g_stopslide);
227          if (stopflag == 1) return;
228          set_tween_state(PART:"elm.text", pos, "slide_begin", 0.0, "slide_end", 0.0);
229          if (pos >= 1.0) {
230             id = timer(0.5, "slide_to_begin", 1);
231             set_int(g_timer_id, id);
232          }
233       }
234       public slide_to_end() {
235          new stopflag;
236          new id;
237          new Float:duration;
238          stopflag = get_int(g_stopslide);
239          if (stopflag == 1) return;
240          duration = get_float(g_duration);
241          id = anim(duration, "slide_to_end_anim", 1);
242          set_int(g_anim_id, id);
243       }
244       public slide_to_begin() {
245          new stopflag;
246          new id;
247          stopflag = get_int(g_stopslide);
248          if (stopflag == 1) return;
249          set_state(PART:"elm.text", "slide_begin", 0.0);
250          id = timer(0.5, "slide_to_end", 1);
251          set_int(g_timer_id, id);
252       }
253       public start_slide() {
254          set_int(g_stopslide, 0);
255          set_state(PART:"elm.text", "slide_begin", 0.0);
256          slide_to_end();
257       }
258       public stop_slide() {
259          new id;
260          set_int(g_stopslide, 1);
261          id = get_int(g_anim_id);
262          cancel_anim(id);
263          id = get_int(g_timer_id);
264          cancel_timer(id);
265          set_state(PART:"elm.text", "default", 0.0);
266       }
267    }
268
269    parts {
270       part { name: "label.swallow.background";
271          type: SWALLOW;
272          description { state: "default" 0.0;
273             visible: 1;
274          }
275       }
276       part { name: "label.text.clip";
277          type: RECT;
278          description { state: "default" 0.0;
279             visible: 1;
280             color: 255 255 255 255;
281             rel1 { relative: 0 0; to: "label.swallow.background"; }
282             rel2 { relative: 1 1; to: "label.swallow.background"; }
283          }
284       }
285       part { name: "elm.text";
286          type: TEXTBLOCK;
287          scale: 1;
288          clip_to: "label.text.clip";
289          description { state: "default" 0.0;
290             rel1.relative: 0.0 0.0;
291             rel2.relative: 1.0 1.0;
292             align: 0.0 0.0;
293             text {
294                style: "textblock_style";
295                min: 1 1;
296             }
297          }
298          description { state: "slide_end" 0.0;
299             inherit: "default" 0.0;
300             rel1.relative: 1.0 0.0;
301             rel2.relative: 1.0 1.0;
302             align: 1.0 0.0;
303          }
304          description { state: "slide_begin" 0.0;
305             inherit: "default" 0.0;
306             rel1.relative: 0.0 0.0;
307             rel2.relative: 0.0 1.0;
308             align: 0.0 0.0;
309          }
310       }
311    }
312    programs {
313       program { name: "start_slide";
314          source: "elm";
315          signal: "elm,state,slide,start";
316          script
317          {
318             start_slide();
319          }
320       }
321       program { name: "stop_slide";
322          source: "elm";
323          signal: "elm,state,slide,stop";
324          script
325          {
326             stop_slide();
327          }
328       }
329    }
330 }
331
332 group { name: "elm/label/base/slide_bounce";
333    data.item: "default_font_size" "10";
334    data.item: "min_font_size" "6";
335    data.item: "max_font_size" "60";
336
337    script {
338       public g_duration, g_stopslide, g_timer_id, g_anim_id;
339
340       public message(Msg_Type:type, id, ...) {
341          if ((type == MSG_FLOAT_SET) && (id == 0)) {
342             new Float:duration;
343             duration = getfarg(2);
344             set_float(g_duration, duration);
345          }
346       }
347       public slide_to_end_anim(val, Float:pos) {
348          new stopflag;
349          new id;
350          stopflag = get_int(g_stopslide);
351          if (stopflag == 1) return;
352          set_tween_state(PART:"elm.text", pos, "slide_begin", 0.0, "slide_end", 0.0);
353          if (pos >= 1.0) {
354             id = timer(0.5, "slide_to_begin", 1);
355             set_int(g_timer_id, id);
356          }
357       }
358       public slide_to_end() {
359          new stopflag;
360          new id;
361          new Float:duration;
362          stopflag = get_int(g_stopslide);
363          if (stopflag == 1) return;
364          duration = get_float(g_duration);
365          id = anim(duration, "slide_to_end_anim", 1);
366          set_int(g_anim_id, id);
367       }
368       public slide_to_begin_anim(val, Float:pos) {
369          new stopflag;
370          new id;
371          stopflag = get_int(g_stopslide);
372          if (stopflag == 1) return;
373          set_tween_state(PART:"elm.text", pos, "slide_end", 0.0, "slide_begin", 0.0);
374          if (pos >= 1.0) {
375             id = timer(0.5, "slide_to_end", 1);
376             set_int(g_timer_id, id);
377          }
378       }
379       public slide_to_begin() {
380          new stopflag;
381          new id;
382          new Float:duration;
383          stopflag = get_int(g_stopslide);
384          if (stopflag == 1) return;
385          duration = get_float(g_duration);
386          id = anim(duration, "slide_to_begin_anim", 1);
387          set_int(g_anim_id, id);
388       }
389       public start_slide() {
390          set_int(g_stopslide, 0);
391          set_state(PART:"elm.text", "slide_begin", 0.0);
392          slide_to_end();
393       }
394       public stop_slide() {
395          new id;
396          set_int(g_stopslide, 1);
397          id = get_int(g_anim_id);
398          cancel_anim(id);
399          id = get_int(g_timer_id);
400          cancel_timer(id);
401          set_state(PART:"elm.text", "default", 0.0);
402       }
403    }
404
405    parts {
406       part { name: "label.swallow.background";
407          type: SWALLOW;
408          description { state: "default" 0.0;
409             visible: 1;
410          }
411       }
412       part { name: "label.text.clip";
413          type: RECT;
414          description { state: "default" 0.0;
415             visible: 1;
416             color: 255 255 255 255;
417             rel1 { relative: 0 0; to: "label.swallow.background"; }
418             rel2 { relative: 1 1; to: "label.swallow.background"; }
419          }
420       }
421       part { name: "elm.text";
422          type: TEXTBLOCK;
423          scale: 1;
424          clip_to: "label.text.clip";
425          description { state: "default" 0.0;
426             rel1.relative: 0.0 0.0;
427             rel2.relative: 1.0 1.0;
428             align: 0.0 0.0;
429             text {
430                style: "textblock_style";
431                min: 1 1;
432             }
433          }
434          description { state: "slide_end" 0.0;
435             inherit: "default" 0.0;
436             rel1.relative: 1.0 0.0;
437             rel2.relative: 1.0 1.0;
438             align: 1.0 0.0;
439          }
440          description { state: "slide_begin" 0.0;
441             inherit: "default" 0.0;
442             rel1.relative: 0.0 0.0;
443             rel2.relative: 0.0 1.0;
444             align: 0.0 0.0;
445          }
446       }
447    }
448    programs {
449       program { name: "start_slide";
450          source: "elm";
451          signal: "elm,state,slide,start";
452          script
453          {
454             start_slide();
455          }
456       }
457       program { name: "stop_slide";
458          source: "elm";
459          signal: "elm,state,slide,stop";
460          script
461          {
462             stop_slide();
463          }
464       }
465    }
466 }