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