remove edc warnings
[profile/tv/apps/native/filebrowser.git] / res / edc / widgets / button.edc
1 #define STATE_NORMAL 0
2 #define STATE_HIGHLIGHT 1
3
4 group {
5         name: "elm/button/base/fbr_hover_entry";
6         data.item: "focus_highlight" "on";
7         images {
8                 image: FBR_IMAGE_TICK COMP;
9         }
10         script {
11                 public cur_state;
12                 public hide_line;
13         }
14         parts {
15                 part {
16                         name: "bg";
17                         type: RECT;
18                         scale: 1;
19                         description {
20                                 state: "default" 0.0;
21                                 min: 290 72;
22                                 color: 255 255 255 255;
23                         }
24                         description {
25                                 state: "selected" 0.0;
26                                 inherit: "default" 0.0;
27                                 color: 126 128 255 255;
28                         }
29                         description {
30                                 state: "highlight" 0.0;
31                                 inherit: "default" 0.0;
32                                 color: 255 255 255 255;
33                         }
34                 }
35                 part {
36                         name: "division_line";
37                         type: RECT;
38                         scale: 1;
39                         description {
40                                 state: "default" 0.0;
41                                 min: 290 2;
42                                 color: 89 89 89 51;
43                                 rel1 {
44                                         to: "bg";
45                                         relative: 1.0 1.0;
46                                 }
47                                 rel2 {
48                                         to: "bg";
49                                 }
50                                 align: 1.0 1.0;
51                                 fixed: 1 1;
52                         }
53                         description {
54                                 state: "selected" 0.0;
55                                 inherit: "default" 0.0;
56                                 visible: 0;
57                         }
58                         description {
59                                 state: "highlight" 0.0;
60                                 inherit: "default" 0.0;
61                         }
62                 }
63                 part {
64                         name: "padding_text";
65                         type: RECT;
66                         scale: 1;
67                         description {
68                                 state: "default" 0.0;
69                                 min: 40 0;
70                                 rel1 {
71                                         to: "bg";
72                                 }
73                                 rel2 {
74                                         to: "bg";
75                                         relative: 0.0 1.0;
76                                 }
77                                 fixed: 1 0;
78                                 visible: 0;
79                                 align: 0.0 0.0;
80                         }
81                 }
82                 part {
83                         name: "elm.text";
84                         type: TEXT;
85                         mouse_events: 0;
86                         scale: 1;
87                         description {
88                                 state: "default" 0.0;
89                                 min: 170 80;
90                                 rel1 {
91                                         to: "padding_text";
92                                         relative: 1.0 0.0;
93                                 }
94                                 rel2 {
95                                         to: "padding_text";
96                                 }
97                                 text {
98                                         font: FONT_STYLE_REGULAR;
99                                         size: 30;
100                                         align: 0.0 0.5;
101                                 }
102                                 color: 89 89 89 255;
103                                 fixed: 1 1;
104                                 align: 0.0 0.0;
105                         }
106                         description {
107                                 state: "selected" 0.0;
108                                 inherit: "default" 0.0;
109                                 color: 255 255 255 255;
110                         }
111                         description {
112                                 state: "highlight" 0.0;
113                                 inherit: "default" 0.0;
114                                 color: 126 128 255 255;
115                         }
116                 }
117                 part {
118                         name: "padding_icon";
119                         type: RECT;
120                         scale: 1;
121                         description {
122                                 state: "default" 0.0;
123                                 min: 20 30;
124                                 rel1 {
125                                         to: "elm.text";
126                                         relative: 1.0 0.0;
127                                 }
128                                 rel2 {
129                                         to: "elm.text";
130                                         relative: 1.0 0.0;
131                                 }
132                                 fixed: 1 1;
133                                 visible: 0;
134                                 align: 0.0 0.0;
135                         }
136                 }
137                 part {
138                         name: "image_part";
139                         mouse_events: 0;
140                         scale: 1;
141                         description {
142                                 state: "default" 0.0;
143                                 min: 20 20;
144                                 rel1 {
145                                         to: "padding_icon";
146                                         relative: 1.0 1.0;
147                                 }
148                                 rel2 {
149                                         to: "padding_icon";
150                                 }
151                                 image.normal: FBR_IMAGE_TICK;
152                                 fixed: 1 1;
153                                 align: 0.0 0.0;
154                                 visible: 0;
155                         }
156                         description {
157                                 state: "selected" 0.0;
158                                 inherit: "default" 0.0;
159                                 visible: 1;
160                         }
161                         description {
162                                 state: "highlight" 0.0;
163                                 inherit: "default" 0.0;
164                                 color: 126 128 255 255;
165                                 visible: 1;
166                         }
167                 }
168         }
169         programs {
170                 program {
171                         name: "load";
172                         signal: "load";
173                         source: "";
174                         script {
175                                 set_int(cur_state, STATE_NORMAL);
176                                 set_int(hide_line, 0);
177                         }
178                 }
179                 program {
180                         name: "button_down";
181                         signal: "mouse,down,1";
182                         source: "bg";
183                         action: SIGNAL_EMIT "elm,action,press" "";
184                 }
185                 program {
186                         name: "button_mouseup";
187                         signal: "mouse,up,1";
188                         source: "bg";
189                         action: SIGNAL_EMIT "elm,action,unpress" "";
190                 }
191                 program {
192                         name: "button_clicked";
193                         signal: "mouse,clicked,1";
194                         source: "bg";
195                         action: SIGNAL_EMIT "elm,action,click" "";
196                 }
197                 program {
198                         name: "focused";
199                         signal: "elm,action,focus";
200                         source: "elm";
201                         script {
202                                 new state;
203                                 state = get_int(cur_state);
204
205                                 if (state == STATE_HIGHLIGHT)
206                                         set_state(PART:"image_part", "selected", 0.0);
207
208                                 set_state(PART:"bg", "selected", 0.0);
209                                 set_state(PART:"division_line", "selected", 0.0);
210                                 set_state(PART:"elm.text", "selected", 0.0);
211                         }
212                 }
213                 program {
214                         name: "unfocused";
215                         signal: "elm,action,unfocus";
216                         source: "elm";
217                         script {
218                                 new state;
219                                 new var;
220                                 new buf[100];
221                                 state = get_int(cur_state);
222
223                                 if (state == STATE_HIGHLIGHT)
224                                         snprintf(buf, sizeof(buf), "highlight");
225                                 else
226                                         snprintf(buf, sizeof(buf), "default");
227
228                                 var = get_int(hide_line);
229                                 set_state(PART:"bg", buf, 0.0);
230                                 if (!var)
231                                         set_state(PART:"division_line", buf, 0.0);
232                                 set_state(PART:"elm.text", buf, 0.0);
233                                 set_state(PART:"image_part", buf, 0.0);
234                         }
235                 }
236                 program {
237                         name: "highlight";
238                         signal: "elm,action,highlight";
239                         source: "elm";
240                         script {
241                                 set_int(cur_state, STATE_HIGHLIGHT);
242                         }
243                         after: "highlight1";
244                 }
245                 program {
246                         name: "highlight1";
247                         action: STATE_SET "highlight" 0.0;
248                         target: "bg";
249                         target: "elm.text";
250                         target: "image_part";
251                         target: "division_line";
252                 }
253                 program {
254                         name: "hide_line";
255                         signal: "elm,action,hideline";
256                         source: "elm";
257                         script {
258                                 set_int(hide_line, 1);
259                                 set_state(PART:"division_line", "selected", 0.0);
260                         }
261                 }
262         }
263 }
264
265 group {
266         name: "elm/button/base/fbr_sourcebtn";
267         data.item: "focus_highlight" "on";
268         images {
269                 image: FBR_IMAGE_PULLDOWN_ARROW COMP;
270                 image: FBR_IMAGE_ROUND_ICON COMP;
271         }
272         script {
273                 public cur_state;
274         }
275         parts {
276                 part {
277                         name: "bg";
278                         scale: 1;
279                         description {
280                                 state: "default" 0.0;
281                                 min: 290 72;
282                                 rel2.relative: 0.0 0.0;
283                                 image {
284                                         normal: FBR_IMAGE_ROUND_ICON;
285                                         border: 4 4 4 4;
286                                         border_scale: 1;
287                                 }
288                                 color: 255 255 255 12;
289                                 align: 0.0 0.0;
290                                 fixed: 1 1;
291                         }
292                         description {
293                                 state: "selected" 0.0;
294                                 inherit: "default" 0.0;
295                                 color: 126 128 255 255;
296                         }
297                         description {
298                                 state: "selected_0" 0.0;
299                                 inherit: "selected" 0.0;
300                                 color: 126 128 255 0;
301                         }
302                         description {
303                                 state: "highlight" 0.0;
304                                 inherit: "default" 0.0;
305                                 color: 255 255 255 255;
306                         }
307                 }
308                 part {
309                         name: "padding_txt";
310                         type: RECT;
311                         scale: 1;
312                         description {
313                                 state: "default" 0.0;
314                                 min: 32 0;
315                                 rel2.relative: 0.0 0.0;
316                                 align: 0.0 0.5;
317                                 fixed: 1 1;
318                                 visible: 0;
319                         }
320                 }
321                 part {
322                         name: "elm.text";
323                         type: TEXT;
324                         scale: 1;
325                         mouse_events: 0;
326                         description {
327                                 state: "default" 0.0;
328                                 min: 0 72;
329                                 rel1 {
330                                         relative: 1.0 0.0;
331                                         to: "padding_txt";
332                                 }
333                                 rel2 {
334                                         relative: 1.0 0.0;
335                                         to: "padding_txt";
336                                 }
337                                 text {
338                                         font: FONT_STYLE_REGULAR;
339                                         size: 30;
340                                         align: 0.0 0.5;
341                                         min: 1 0;
342                                         ellipsis: -1;
343                                 }
344                                 align: 0.0 0.0;
345                                 color: 175 175 175 255;
346                                 fixed: 1 1;
347                         }
348                         description {
349                                 state: "selected" 0.0;
350                                 inherit: "default" 0.0;
351                                 color: 255 255 255 255;
352                         }
353                         description {
354                                 state: "highlight" 0.0;
355                                 inherit: "default" 0.0;
356                                 color: 126 128 255 255;
357                         }
358                         description {
359                                 state: "disabled" 0.0;
360                                 inherit: "default" 0.0;
361                                 color: 175 175 175 25;
362                         }
363                 }
364                 part {
365                         name: "padding_updown";
366                         type: RECT;
367                         scale: 1;
368                         description {
369                                 state: "default" 0.0;
370                                 min: 10 0;
371                                 rel1 {
372                                         to: "elm.text";
373                                         relative: 1.0 0.0;
374                                 }
375                                 rel2 {
376                                         to: "elm.text";
377                                 }
378                                 align: 0.0 0.5;
379                                 fixed: 1 1;
380                                 visible: 0;
381                         }
382                 }
383                 part {
384                         name: FBR_PART_ELM_SWALLOWICON;
385                         type: SWALLOW;
386                         scale: 1;
387                         description {
388                                 state: "default" 0.0;
389                                 min: 24 24;
390                                 max: 24 24;
391                                 rel1 {
392                                         relative: 1.0 0.0;
393                                         to: "padding_updown";
394                                 }
395                                 rel2 {
396                                         to: "padding_updown";
397                                 }
398                                 align: 0.0 0.5;
399                                 fixed: 1 1;
400                                 color: 193 193 193 255;
401                         }
402                         description {
403                                 state: "focused" 0.0;
404                                 inherit: "default" 0.0;
405                                 color: 255 255 255 255;
406                         }
407                         description {
408                                 state: "highlight" 0.0;
409                                 inherit: "focused" 0.0;
410                         }
411                         description {
412                                 state: "mouse_over" 0.0;
413                                 inherit: "focused" 0.0;
414                         }
415                 }
416                 part {
417                         name: "padding_arrow";
418                         type: RECT;
419                         scale: 1;
420                         description {
421                                 state: "default" 0.0;
422                                 min: 24 0;
423                                 rel1 {
424                                         relative: 1.0 0.0;
425                                         to: "bg";
426                                 }
427                                 rel2 {
428                                         to: "bg";
429                                 }
430                                 align: 1.0 0.5;
431                                 fixed: 1 1;
432                                 visible: 0;
433                         }
434                 }
435                 part {
436                         name: "arrow_img";
437                         type: IMAGE;
438                         scale: 1;
439                         description {
440                                 state: "default" 0.0;
441                                 min: 24 24;
442                                 max: 24 24;
443                                 rel1 {
444                                         relative: 0.0 0.0;
445                                         to: "padding_arrow";
446                                 }
447                                 rel2 {
448                                         relative: 0.0 1.0;
449                                         to: "padding_arrow";
450                                 }
451                                 image.normal: FBR_IMAGE_PULLDOWN_ARROW;
452                                 align: 1.0 0.5;
453                                 fixed: 1 1;
454                         }
455                         description {
456                                 state: "disabled" 0.0;
457                                 inherit: "default" 0.0;
458                                 color: 175 175 175 25;
459                         }
460                 }
461         }
462         programs {
463                 program {
464                         name: "load";
465                         signal: "load";
466                         source: "";
467                         script {
468                                 set_int(cur_state, STATE_NORMAL);
469                         }
470                 }
471                 program {
472                         name: "button_down";
473                         signal: "mouse,down,1";
474                         source: "bg";
475                         action: SIGNAL_EMIT "elm,action,press" "";
476                 }
477                 program {
478                         name: "button_mouseup";
479                         signal: "mouse,up,1";
480                         source: "bg";
481                         action: SIGNAL_EMIT "elm,action,unpress" "";
482                 }
483                 program {
484                         name: "button_clicked";
485                         signal: "mouse,clicked,1";
486                         source: "bg";
487                         action: SIGNAL_EMIT "elm,action,click" "";
488                 }
489                 program {
490                         name: "focused";
491                         signal: "elm,action,focus";
492                         source: "elm";
493                         script {
494                                 set_int(cur_state, STATE_NORMAL);
495                                 set_state(PART:"bg", "selected", 0.0);
496                                 set_state(PART:"elm.text", "selected", 0.0);
497                         }
498                 }
499                 program {
500                         name: "focus,anim";
501                         action: STATE_SET "selected" 0.0;
502                         target: "bg";
503                         target: "elm.text";
504                         target: FBR_PART_ELM_SWALLOWICON;
505                         transition: LINEAR 0.17;
506                 }
507                 program {
508                         name: "unfocused";
509                         signal: "elm,action,unfocus";
510                         source: "elm";
511                         script {
512                                 new state;
513                                 state = get_int(cur_state);
514                                 if (state == STATE_HIGHLIGHT) {
515                                         set_state(PART:"bg", "highlight_0", 0.0);
516                                         set_state(PART:"elm.text", "highlight", 0.0);
517                                         set_state(PART:FBR_PART_ELM_SWALLOWICON, "highlight", 0.0);
518                                         run_program(PROGRAM:"unfocus,high,anim");
519                                 } else {
520                                         set_state(PART:"bg","default", 0.0);
521                                         set_state(PART:"elm.text","default", 0.0);
522                                 }
523                         }
524                 }
525                 program {
526                         name: "unfocus,high,anim";
527                         action: STATE_SET "highlight" 0.0;
528                         target: "bg";
529                         transition: LINEAR 0.17;
530                 }
531                 program {
532                         name: "unfocus,default,anim";
533                         action: STATE_SET "default" 0.0;
534                         target: "bg";
535                         target: "elm.text";
536                         target: FBR_PART_ELM_SWALLOWICON;
537                         transition: LINEAR 0.17;
538                 }
539                 program {
540                         name: "unfocus";
541                         signal: "unfocused";
542                         source: "";
543                         action: STATE_SET "default" 0.0;
544                         target: "bg";
545                         target: "elm.text";
546                         target: FBR_PART_ELM_SWALLOWICON;
547                 }
548                 program {
549                         name: "highlight";
550                         signal: "highlight";
551                         source: "";
552                         script {
553                                 set_int(cur_state, STATE_HIGHLIGHT);
554                                 set_state(PART:"bg", "highlight", 0.0);
555                                 set_state(PART:"elm.text", "highlight", 0.0);
556                                 set_state(PART:FBR_PART_ELM_SWALLOWICON, "highlight", 0.0);
557                         }
558                 }
559                 program {
560                         name: "unhighlight";
561                         signal: "unhighlight";
562                         source: "";
563                         script {
564                                 set_int(cur_state, STATE_NORMAL);
565                                 set_state(PART:"bg", "default", 0.0);
566                                 set_state(PART:"elm.text", "default", 0.0);
567                                 set_state(PART:FBR_PART_ELM_SWALLOWICON, "default", 0.0);
568                         }
569                 }
570                 program {
571                         name: "enable";
572                         signal: "elm,state,enabled";
573                         source: "elm";
574                         script {
575                                 set_state(PART:"bg", "default", 0.0);
576                                 set_state(PART:"elm.text", "default", 0.0);
577                                 set_state(PART:"arrow_img", "default", 0.0);
578                         }
579                 }
580                 program {
581                         name: "disable";
582                         signal: "elm,state,disabled";
583                         source: "elm";
584                         script{
585                                 set_state(PART:"bg", "disabled", 0.0);
586                                 set_state(PART:"elm.text", "disabled", 0.0);
587                                 set_state(PART:"arrow_img", "disabled", 0.0);
588                         }
589                 }
590         }
591 }
592
593 group {
594         name: "elm/button/base/fbr_sortbtn";
595         inherit: "elm/button/base/fbr_sourcebtn";
596         parts {
597                 part {
598                         name: "bg";
599                         scale: 1;
600                         description {
601                                 state: "default" 0.0;
602                                 color: 0 0 0 76;
603                         }
604                 }
605         }
606 }
607
608
609 group {
610         name: "elm/button/base/fbr_menubtn";
611         data.item: "focus_highlight" "on";
612         images {
613                 image: FBR_GROUPBTN_BG COMP;
614         }
615         parts {
616                 part {
617                         name: "bg";
618                         scale: 1;
619                         description {
620                                 state: "default" 0.0;
621                                 min: 406 87;
622                                 image.normal: FBR_GROUPBTN_BG;
623                                 color: 0 0 0 0;
624                         }
625                         description {
626                                 state: "focused" 0.0;
627                                 inherit: "default" 0.0;
628                                 color: 126 128 255 255;
629                         }
630                         description {
631                                 state: "highlight" 0.0;
632                                 inherit: "default" 0.0;
633                                 color: 126 128 255 51;
634                         }
635                 }
636                 part {
637                         name: "padding_icon";
638                         type: RECT;
639                         scale: 1;
640                         description {
641                                 state: "default" 0.0;
642                                 min: 85 0;
643                                 rel1 {
644                                         to: "bg";
645                                 }
646                                 rel2 {
647                                         to: "bg";
648                                         relative: 0.0 1.0;
649                                 }
650                                 fixed: 1 0;
651                                 visible: 0;
652                                 align: 0.0 0.5;
653                         }
654                 }
655                 part {
656                         name: FBR_PART_ELM_SWALLOWICON;
657                         type: SWALLOW;
658                         mouse_events: 0;
659                         scale: 1;
660                         description {
661                                 state: "default" 0.0;
662                                 min: 40 40;
663                                 rel1 {
664                                         to: "padding_icon";
665                                         relative: 1.0 0.0;
666                                 }
667                                 rel2 {
668                                         to: "padding_icon";
669                                 }
670                                 fixed: 1 0;
671                                 align: 0.0 0.5;
672                         }
673                 }
674                 part {
675                         name: "padding_text";
676                         type: RECT;
677                         scale: 1;
678                         description {
679                                 state: "default" 0.0;
680                                 min: 37 0;
681                                 rel1 {
682                                         to: FBR_PART_ELM_SWALLOWICON;
683                                         relative: 1.0 0.0;
684                                 }
685                                 rel2 {
686                                         to: FBR_PART_ELM_SWALLOWICON;
687                                         relative: 1.0 0.0;
688                                 }
689                                 fixed: 1 1;
690                                 visible: 0;
691                                 align: 0.0 0.0;
692                         }
693                 }
694                 part {
695                         name: "elm.text";
696                         type: TEXT;
697                         mouse_events: 0;
698                         scale: 1;
699                         description {
700                                 state: "default" 0.0;
701                                 min: 219 87;
702                                 rel1 {
703                                         to_x: "padding_text";
704                                         relative: 1.0 0.0;
705                                 }
706                                 rel2 {
707                                         to_x: "padding_text";
708                                         relative: 1.0 1.0;
709                                 }
710                                 text {
711                                         font: FONT_STYLE_REGULAR;
712                                         size: 30;
713                                         align: 0.0 0.5;
714                                 }
715                                 color: 255 255 255 153;
716                                 fixed: 1 1;
717                                 align: 0.0 0.0;
718                         }
719                         description {
720                                 state: "focused" 0.0;
721                                 inherit: "default" 0.0;
722                                 text {
723                                         font: FONT_STYLE_BOLD;
724                                 }
725                                 color: 255 255 255 255;
726                         }
727                         description {
728                                 state: "highlight" 0.0;
729                                 inherit: "default" 0.0;
730                                 text {
731                                         font: FONT_STYLE_MEDIUM;
732                                 }
733                                 color: 255 255 255 255;
734                         }
735                 }
736         }
737         script {
738                 public select_status = 0;
739         }
740         programs {
741                 program {
742                         name: "button_down";
743                         signal: "mouse,down,1";
744                         source: "bg";
745                         action: SIGNAL_EMIT "elm,action,press" "";
746                 }
747                 program {
748                         name: "button_mouseup";
749                         signal: "mouse,up,1";
750                         source: "bg";
751                         action: SIGNAL_EMIT "elm,action,unpress" "";
752                 }
753                 program {
754                         name: "focused";
755                         signal: "elm,action,focus";
756                         source: "elm";
757                         action: STATE_SET "focused" 0.0;
758                         script {
759                                 if (get_int(select_status) != 1) {
760                                         emit("elm,action,click", "");
761                                 }
762                                 set_state(PART:"bg", "focused", 0.0);
763                                 set_state(PART:"elm.text", "focused", 0.0);
764                         }
765                 }
766                 program {
767                         name: "unfocused";
768                         signal: "elm,action,unfocus";
769                         source: "elm";
770                         script {
771                                 if (get_int(select_status) == 1) {
772                                         set_state(PART:"bg", "highlight", 0.0);
773                                         set_state(PART:"elm.text", "highlight", 0.0);
774                                 } else {
775                                         set_state(PART:"bg", "default", 0.0);
776                                         set_state(PART:"elm.text", "default", 0.0);
777                                 }
778                         }
779                 }
780                 program {
781                         name: "select";
782                         signal: FBR_SIGNAL_GROUP_SELECTED;
783                         source: "";
784                         script {
785                                 set_int(select_status, 1);
786                         }
787                 }
788                 program {
789                         name: "unselect";
790                         signal: FBR_SIGNAL_GROUP_UNSELECTED;
791                         source: "";
792                         script {
793                                 set_int(select_status, 0);
794                                 set_state(PART:"bg", "default", 0.0);
795                                 set_state(PART:"elm.text", "default", 0.0);
796                         }
797                 }
798         }
799 }
800