5a4ce5be9ff0baf9367fef7584962369577ac86e
[profile/ivi/efl-theme-tizen.git] / themes / widgets / label.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 TEXT_SLIDE_DURATION 10
20
21       styles {
22          style { name: "textblock_style";
23             base: "font=SLP:style=Medium font_size="LABEL_FONT_SIZE_INC" color="LABEL_TEXT_BLOCK_STYLE_COLOR_INC" text_class=slp_medium";
24             tag:  "br" "\n";
25             tag:  "ps" "ps";
26             tag:  "hilight" "+ font=SLP:style=Bold";
27             tag:  "b" "+ font=SLP:style=Bold";
28             tag:  "tab" "\t";
29          }
30       }
31
32       /* label doesn't use it */
33       styles {
34          style { name: "textblock_charwrap_style";
35 base: "font=SLP:style=Medium font_size="LABEL_FONT_SIZE_INC" color="LABEL_TEXT_BLOCK_STYLE_COLOR_INC" text_class=slp_medium";
36             tag:  "br" "\n";
37             tag:  "ps" "ps";
38             tag:  "hilight" "+ font=SLP:style=Bold";
39             tag:  "b" "+ font=SLP:style=Bold";
40             tag:  "tab" "\t";
41          }
42       }
43
44       group { name: "elm/label/base/default";
45          data.item: "default_font_size" LABEL_FONT_SIZE_INC;
46          data.item: "min_font_size" LABEL_MIN_FONT_SIZE_INC;
47          data.item: "max_font_size" LABEL_MAX_FONT_SIZE_INC;
48          parts {
49             part { name: "label.text.clip";
50                type: RECT;
51                description { state: "default" 0.0;
52                }
53             }
54             part { name: "elm.text";
55                type: TEXTBLOCK;
56                scale: 1;
57                clip_to: "label.text.clip";
58                description { state: "default" 0.0;
59                   text {
60                      style: "textblock_style";
61                      min: 0 1;
62                      align: 0.0 0.0;
63                   }
64                }
65             }
66          }
67       }
68
69       /* default label doesn't use it */
70       group { name: "elm/label/base_wrap/default";
71          data.item: "default_font_size" LABEL_FONT_SIZE_INC;
72          data.item: "min_font_size" LABEL_MIN_FONT_SIZE_INC;
73          data.item: "max_font_size" LABEL_MAX_FONT_SIZE_INC;
74          parts {
75             part { name: "elm.text";
76                type: TEXTBLOCK;
77                mouse_events: 1;
78                scale: 1;
79                multiline: 1;
80                description { state: "default" 0.0;
81                   text {
82                        style: "textblock_style";
83                        min: 0 1;
84                        align: 0.0 0.0;
85                   }
86                } 
87                description { state: "charwrap_mode" 0.0;
88                   text {
89                      style: "textblock_charwrap_style";
90                      min: 0 1;
91                      align: 0.0 0.0;
92                   }
93                } 
94             }
95          }
96          programs {
97             program { name: "default_on";
98                signal: "elm,state,default";
99                source: "elm";
100                action: STATE_SET "default" 0.0;
101                target: "elm.text";
102             }
103             program { name: "charwrap_on";
104                signal: "elm,state,charwrap";
105                source: "elm";
106                action: STATE_SET "charwrap_mode" 0.0;
107                target: "elm.text";
108             }
109          } // end programs
110       } // end group
111
112       /* default label doesn't use it */
113       group { name: "elm/label/base_wrap_ellipsis/default";
114          data.item: "default_font_size" LABEL_FONT_SIZE_INC;
115          data.item: "min_font_size" LABEL_MIN_FONT_SIZE_INC;
116          data.item: "max_font_size" LABEL_MAX_FONT_SIZE_INC;
117          parts {
118             part { name: "elm.text";
119                type: TEXTBLOCK;
120                mouse_events: 0;
121                scale: 1;
122                multiline: 1;
123                description { state: "default" 0.0;
124                   // FIXME : fixed for multiline ellipsis.
125                   //         does it need to make another ellipsis style? 
126                   fixed: 0 1; 
127                   text {
128                      style: "textblock_style";
129                      min: 0 1;
130                      align: 0.0 0.0;
131                   }
132                }
133                description { state: "charwrap_mode" 0.0;
134                   // FIXME : fixed for multiline ellipsis.
135                   //         does it need to make another ellipsis style? 
136                   fixed: 0 1; 
137                   text {
138                      style: "textblock_charwrap_style";
139                      min: 0 1;
140                      align: 0.0 0.0;
141                   }
142                }
143             }
144          }
145          programs {
146             program { name: "default_on";
147                signal: "elm,state,default";
148                source: "elm";
149                action: STATE_SET "default" 0.0;
150                target: "elm.text";
151             }
152             program { name: "charwrap_on";
153                signal: "elm,state,charwrap";
154                source: "elm";
155                action: STATE_SET "charwrap_mode" 0.0;
156                target: "elm.text";
157             }
158          } // end programs
159       } // end group
160
161       group { name: "elm/label/base/marker";
162          data.item: "default_font_size" LABEL_FONT_SIZE_INC;
163          data.item: "min_font_size" LABEL_MIN_FONT_SIZE_INC;
164          data.item: "max_font_size" LABEL_MAX_FONT_SIZE_INC;
165          styles {
166             style { name: "textblock_style2";
167                base: "font=SLP:style=Bold font_size=14 align=center color=#fff wrap=word text_class=slp_bold";
168                tag:  "br" "\n";
169                tag:  "ps" "ps";
170                tag:  "hilight" "+ color=#ffff";
171                tag:  "b" "+ color=#ffff";
172                tag:  "tab" "\t";
173             }
174          }
175          parts {
176             part { name: "elm.text";
177                type: TEXTBLOCK;
178                mouse_events: 0;
179                scale: 1;
180                description { state: "default" 0.0;
181                   text {
182                      style: "textblock_style2";
183                      min: 1 1;
184                      align: 0.0 0.0;
185                   }
186                }
187             }
188          }
189       }
190
191       /* default label doesn't use it */
192       group { name: "elm/label/base_wrap/marker";
193          data.item: "default_font_size" LABEL_FONT_SIZE_INC;
194          data.item: "min_font_size" LABEL_MIN_FONT_SIZE_INC;
195          data.item: "max_font_size" LABEL_MAX_FONT_SIZE_INC;
196          parts {
197             part { name: "elm.text";
198                type: TEXTBLOCK;
199                mouse_events: 0;
200                scale: 1;
201                multiline: 1;
202                description { state: "default" 0.0;
203                   text {
204                      style: "textblock_style2";
205                      min: 1 1;
206                      align: 0.0 0.0;
207                   }
208                }
209             }
210          }
211       }
212
213       group { name: "elm/label/base/titlebar/default";
214          data.item: "default_font_size" LABEL_FONT_SIZE_INC;
215          data.item: "min_font_size" LABEL_MIN_FONT_SIZE_INC;
216          data.item: "max_font_size" LABEL_MAX_FONT_SIZE_INC;
217          parts {
218             part { name: "elm.text";
219                type: TEXT;
220                effect: SHADOW;
221                mouse_events: 0;
222                scale: 1;
223                description { state: "default" 0.0;
224                   text {
225                      font: "SLP:style=Bold";
226                      size: 28;
227                      min: 0 0;
228                      align: 0.0 0.5;
229                      text: "slp";
230                   }
231                   color2: 0 0 0 255;
232                }
233             }
234          }
235       }
236
237       group { name: "elm/label/base/titlebar/header";
238          data.item: "default_font_size" LABEL_FONT_SIZE_INC;
239          data.item: "min_font_size" LABEL_MIN_FONT_SIZE_INC;
240          data.item: "max_font_size" LABEL_MAX_FONT_SIZE_INC;
241          styles {
242             style { name: "header_textblock_style";
243                base: "font=SLP:style=Medium font_size=34 color=#ffffff wrap=mixed";
244                tag:  "br" "\n";
245                tag:  "ps" "ps";
246                tag:  "tab" "\t";
247                tag:  "em" "+ font=SLP:style=Oblique";
248                tag:  "b" "+ font=SLP:style=Bold";
249                tag:  "link" "+ color=#800 underline=on underline_color=#8008";
250                tag:  "hilight" "+ font=SLP:style=Bold";
251             }
252          }
253
254          parts {
255             part { name: "elm.text";
256                type: TEXT;
257                effect: SHADOW;
258                mouse_events: 0;
259                scale: 1;
260                description { state: "default" 0.0;
261                   text {
262                      font:     "SLP:style=Medium";
263                      size:     34;
264                      min:      0 0;
265                      align:    0.0 0.5;
266                      text: "slp";
267                   }
268                   color2: 0 0 0 255;
269                }
270             }
271          }
272       }
273
274
275       group { name: "elm/label/base/slide_long";
276          data.item: "default_font_size" LABEL_FONT_SIZE_INC;
277          data.item: "min_font_size" LABEL_MIN_FONT_SIZE_INC;
278          data.item: "max_font_size" LABEL_MAX_FONT_SIZE_INC;
279
280          script {
281             public g_duration, g_stopslide, g_timer_id, g_anim_id;
282
283             public message(Msg_Type:type, id, ...) {
284                if ((type == MSG_FLOAT_SET) && (id == 0)) {
285                   new Float:duration;
286                   duration = getfarg(2);
287                   set_float(g_duration, duration);
288                }
289             }
290             public slide_to_end_anim(val, Float:pos) {
291                new stopflag;
292                new id;
293                stopflag = get_int(g_stopslide);
294                if (stopflag == 1) return;
295                set_tween_state(PART:"elm.text", pos, "slide_begin", 0.0, "slide_end", 0.0);
296                if (pos >= 1.0) {
297                   id = timer(0.5, "slide_to_begin", 1);
298                   set_int(g_timer_id, id);
299                }
300             }
301             public slide_to_end() {
302                new stopflag;
303                new id;
304                new Float:duration;
305                stopflag = get_int(g_stopslide);
306                if (stopflag == 1) return;
307                duration = get_float(g_duration);
308                id = anim(duration, "slide_to_end_anim", 1);
309                set_int(g_anim_id, id);
310             }
311             public slide_to_begin() {
312                new stopflag;
313                new id;
314                stopflag = get_int(g_stopslide);
315                if (stopflag == 1) return;
316                set_state(PART:"elm.text", "slide_begin", 0.0);
317                id = timer(0.5, "slide_to_end", 1);
318                set_int(g_timer_id, id);
319             }
320             public start_slide() {
321                set_int(g_stopslide, 0);
322                set_state(PART:"elm.text", "slide_begin", 0.0);
323                slide_to_end();
324             }
325             public stop_slide() {
326                new id;
327                set_int(g_stopslide, 1);
328                id = get_int(g_anim_id);
329                cancel_anim(id);
330                id = get_int(g_timer_id);
331                cancel_timer(id);
332                set_state(PART:"elm.text", "default", 0.0);
333             }
334          }
335
336          parts {
337             part { name: "label.text.clip";
338                type: RECT;
339                description { state: "default" 0.0;
340                }
341             }
342             part { name: "elm.text";
343                type: TEXTBLOCK;
344                mouse_events: 0;
345                scale: 1;
346                clip_to: "label.text.clip";
347                description { state: "default" 0.0;
348                   rel1.relative: 0.0 0.0;
349                   rel2.relative: 1.0 1.0;
350                   align: 0.0 0.0;
351                   text {
352                      style: "textblock_style";
353                      min: 1 1;
354                      align: 0.0 0.0;
355                   }
356                }
357                description { state: "slide_end" 0.0;
358                   inherit: "default" 0.0;
359                   rel1.relative: 0.0 0.0;
360                   rel2.relative: 0.0 1.0;
361                   align: 1.0 0.0;
362                }
363                description { state: "slide_begin" 0.0;
364                   inherit: "default" 0.0;
365                   rel1.relative: 1.0 0.0;
366                   rel2.relative: 1.0 1.0;
367                   align: 0.0 0.0;
368                }
369             }
370          }
371          programs {
372             program { name: "start_slide";
373                source: "elm";
374                signal: "elm,state,slide,start";
375                script {
376                   start_slide();
377                }
378             }
379             program { name: "stop_slide";
380                source: "elm";
381                signal: "elm,state,slide,stop";
382                script {
383                   stop_slide();
384                }
385             }
386          }
387       }
388
389
390       group { name: "elm/label/base/slide_short";
391          data.item: "default_font_size" LABEL_FONT_SIZE_INC;
392          data.item: "min_font_size" LABEL_MIN_FONT_SIZE_INC;
393          data.item: "max_font_size" LABEL_MAX_FONT_SIZE_INC;
394
395          script {
396             public g_duration, g_stopslide, g_timer_id, g_anim_id;
397
398             public message(Msg_Type:type, id, ...) {
399                if ((type == MSG_FLOAT_SET) && (id == 0)) {
400                   new Float:duration;
401                   duration = getfarg(2);
402                   set_float(g_duration, duration);
403                }
404             }
405             public slide_to_end_anim(val, Float:pos) {
406                new stopflag;
407                new id;
408                stopflag = get_int(g_stopslide);
409                if (stopflag == 1) return;
410                set_tween_state(PART:"elm.text", pos, "slide_begin", 0.0, "slide_end", 0.0);
411                if (pos >= 1.0) {
412                   id = timer(0.5, "slide_to_begin", 1);
413                   set_int(g_timer_id, id);
414                }
415             }
416             public slide_to_end() {
417                new stopflag;
418                new id;
419                new Float:duration;
420                stopflag = get_int(g_stopslide);
421                if (stopflag == 1) return;
422                duration = get_float(g_duration);
423                id = anim(duration, "slide_to_end_anim", 1);
424                set_int(g_anim_id, id);
425             }
426             public slide_to_begin() {
427                new stopflag;
428                new id;
429                stopflag = get_int(g_stopslide);
430                if (stopflag == 1) return;
431                set_state(PART:"elm.text", "slide_begin", 0.0);
432                id = timer(0.5, "slide_to_end", 1);
433                set_int(g_timer_id, id);
434             }
435             public start_slide() {
436                set_int(g_stopslide, 0);
437                set_state(PART:"elm.text", "slide_begin", 0.0);
438                slide_to_end();
439             }
440             public stop_slide() {
441                new id;
442                set_int(g_stopslide, 1);
443                id = get_int(g_anim_id);
444                cancel_anim(id);
445                id = get_int(g_timer_id);
446                cancel_timer(id);
447                set_state(PART:"elm.text", "default", 0.0);
448             }
449          }
450
451          parts {
452             part { name: "label.text.clip";
453                type: RECT;
454                description { state: "default" 0.0;
455                }
456             }
457             part { name: "elm.text";
458                type: TEXTBLOCK;
459                mouse_events: 0;
460                scale: 1;
461                clip_to: "label.text.clip";
462                description { state: "default" 0.0;
463                   rel1.relative: 0.0 0.0;
464                   rel2.relative: 1.0 1.0;
465                   align: 0.0 0.0;
466                   text {
467                      style: "textblock_style";
468                      min: 1 1;
469                      align: 0.0 0.0;
470                   }
471                }
472                description { state: "slide_end" 0.0;
473                   inherit: "default" 0.0;
474                   rel1.relative: 1.0 0.0;
475                   rel2.relative: 1.0 1.0;
476                   align: 1.0 0.0;
477                }
478                description { state: "slide_begin" 0.0;
479                   inherit: "default" 0.0;
480                   rel1.relative: 0.0 0.0;
481                   rel2.relative: 0.0 1.0;
482                   align: 0.0 0.0;
483                }
484             }
485          }
486          programs {
487             program { name: "start_slide";
488                source: "elm";
489                signal: "elm,state,slide,start";
490                script {
491                   start_slide();
492                }
493             }
494             program { name: "stop_slide";
495                source: "elm";
496                signal: "elm,state,slide,stop";
497                script {
498                   stop_slide();
499                }
500             }
501          }
502       }
503
504       group { name: "elm/label/base/slide_bounce";
505          data.item: "default_font_size" LABEL_FONT_SIZE_INC;
506          data.item: "min_font_size" LABEL_MIN_FONT_SIZE_INC;
507          data.item: "max_font_size" LABEL_MAX_FONT_SIZE_INC;
508
509          script {
510             public g_duration, g_stopslide, g_timer_id, g_anim_id;
511
512             public message(Msg_Type:type, id, ...) {
513                if ((type == MSG_FLOAT_SET) && (id == 0)) {
514                   new Float:duration;
515                   duration = getfarg(2);
516                   set_float(g_duration, duration);
517                }
518             }
519             public slide_to_end_anim(val, Float:pos) {
520                new stopflag;
521                new id;
522                stopflag = get_int(g_stopslide);
523                if (stopflag == 1) return;
524                set_tween_state(PART:"elm.text", pos, "slide_begin", 0.0, "slide_end", 0.0);
525                if (pos >= 1.0) {
526                   id = timer(0.5, "slide_to_begin", 1);
527                   set_int(g_timer_id, id);
528                }
529             }
530             public slide_to_end() {
531                new stopflag;
532                new id;
533                new Float:duration;
534                stopflag = get_int(g_stopslide);
535                if (stopflag == 1) return;
536                duration = get_float(g_duration);
537                id = anim(duration, "slide_to_end_anim", 1);
538                set_int(g_anim_id, id);
539             }
540             public slide_to_begin_anim(val, Float:pos) {
541                new stopflag;
542                new id;
543                stopflag = get_int(g_stopslide);
544                if (stopflag == 1) return;
545                set_tween_state(PART:"elm.text", pos, "slide_end", 0.0, "slide_begin", 0.0);
546                if (pos >= 1.0) {
547                   id = timer(0.5, "slide_to_end", 1);
548                   set_int(g_timer_id, id);
549                }
550             }
551             public slide_to_begin() {
552                new stopflag;
553                new id;
554                new Float:duration;
555                stopflag = get_int(g_stopslide);
556                if (stopflag == 1) return;
557                duration = get_float(g_duration);
558                id = anim(duration, "slide_to_begin_anim", 1);
559                set_int(g_anim_id, id);
560             }
561             public start_slide() {
562                set_int(g_stopslide, 0);
563                set_state(PART:"elm.text", "slide_begin", 0.0);
564                slide_to_end();
565             }
566             public stop_slide() {
567                new id;
568                set_int(g_stopslide, 1);
569                id = get_int(g_anim_id);
570                cancel_anim(id);
571                id = get_int(g_timer_id);
572                cancel_timer(id);
573                set_state(PART:"elm.text", "default", 0.0);
574             }
575          }
576
577          parts {
578             part { name: "label.text.clip";
579                type: RECT;
580                description { state: "default" 0.0;
581                }
582             }
583             part { name: "elm.text";
584                type: TEXTBLOCK;
585                mouse_events: 0;
586                scale: 1;
587                clip_to: "label.text.clip";
588                description { state: "default" 0.0;
589                   rel1.relative: 0.0 0.0;
590                   rel2.relative: 1.0 1.0;
591                   align: 0.0 0.0;
592                   text {
593                      style: "textblock_style";
594                      min: 1 1;
595                      align: 0.0 0.0;
596                   }
597                }
598                description { state: "slide_end" 0.0;
599                   inherit: "default" 0.0;
600                   rel1.relative: 1.0 0.0;
601                   rel2.relative: 1.0 1.0;
602                   align: 1.0 0.0;
603                }
604                description { state: "slide_begin" 0.0;
605                   inherit: "default" 0.0;
606                   rel1.relative: 0.0 0.0;
607                   rel2.relative: 0.0 1.0;
608                   align: 0.0 0.0;
609                }
610             }
611          }
612          programs {
613             program { name: "start_slide";
614                source: "elm";
615                signal: "elm,state,slide,start";
616                script {
617                   start_slide();
618                }
619             }
620             program { name: "stop_slide";
621                source: "elm";
622                signal: "elm,state,slide,stop";
623                script {
624                   stop_slide();
625                }
626             }
627          }
628       }