port to Tizen 3.0 SDK
[apps/native/home/homescreen-efl.git] / res / edje / icon.edc
1 /*
2  * Copyright 2012  Samsung Electronics Co., Ltd
3  *
4  * Licensed under the Flora License, Version 1.1 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://floralicense.org/license/
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #include "../../inc/conf.h"
18
19 images {
20         image: "app_press_117.png" COMP;
21         image: "btn_delete_nor.png" COMP;
22         image: "btn_delete_press.png" COMP;
23         image: "app_icon_checkbox_bg.png" COMP;
24         image: "app_icon_checkbox_on.png" COMP;
25         image: "app_icon_checkbox_border.png" COMP;
26         image: "icon_badge_container.png" COMP;
27 }
28
29 styles {
30         style{
31                 name: "icon_label";
32                 base: "font=Samsung Condensed:style=Regular align=center color=#FFFFFFFF font_size=28 wrap=mixed";
33         }
34         style{
35                 name: "icon_label_edit";
36                 base: "font=Samsung Condensed:style=Regular align=center color=#FFFFFFFF font_size=25 wrap=mixed";
37         }
38 }
39
40 collections {
41         group {
42                 name: "app_icon_layout";
43                 script {
44                         public checkbox_state;
45                         public alpha;
46
47                         public message(Msg_Type:type, id, ...) {
48                                 if(type == MSG_INT_SET)
49                                 {
50                                         set_int(alpha, getarg(2));
51                                         send_message(type, id, getarg(2));
52                                 }
53                         }
54                 }
55                 parts {
56                         part { //"icon_bg"
57                                 name: "icon_bg";
58                                 type: SPACER;
59                                 mouse_events: 1;
60                                 repeat_events: 1;
61                                 scale: 0;
62                                 description {
63                                         state: "default" 0.0;
64                                         rel1{relative: 0.0 0.0; }
65                                         rel2{relative: 1.0 1.0; }
66                                 }
67                                 description {
68                                         state: "moved" 0.0;
69                                         inherit: "default" 0.0;
70                                 }
71                                 description {
72                                         state: "edit" 0.0;
73                                         inherit: "default" 0.0;
74                                 }
75                                 description
76                                 {
77                                         state: "manage_state" 0.0;
78                                         inherit: "default" 0.0;
79                                 }
80                         }
81
82                         part { //PART_ICON_CONTENT
83                                 name: PART_ICON_CONTENT;
84                                 type: SWALLOW;
85                                 mouse_events: 1;
86                                 repeat_events: 1;
87                                 scale: 0;
88                                 description {
89                                         state: "default" 0.0;
90                                         rel1{relative: ICON_X_MIN ICON_Y_MIN; to: "icon_bg";}
91                                         rel2{relative: ICON_X_MAX ICON_Y_MAX; to: "icon_bg";}
92                                 }
93                         }
94
95
96                         part { //"icon_content_touch"
97                                 name: "icon_content_touch";
98                                 type: IMAGE;
99                                 mouse_events: 1;
100                                 repeat_events: 1;
101                                 scale: 0;
102                                 description {
103                                         state: "default" 0.0;
104                                         rel1{relative: 0.0 0.0; to: PART_ICON_CONTENT;}
105                                         rel2{relative: 1.0 1.0; to: PART_ICON_CONTENT;}
106                                         aspect: 1.0 1.0;
107                                         aspect_preference: BOTH;
108                                         color: 0 0 0 0;
109                                         image {
110                                                 normal: "app_press_117.png";
111                                         }
112                                 }
113                                 description{
114                                         state: "icon_touched" 0.0;
115                                         inherit: "default" 0.0;
116                                         color: 0 0 0 150;
117                                 }
118                         }
119
120                         part { //PART_ICON_NAME
121                                 name: PART_ICON_NAME;
122                                 type: TEXTBLOCK;
123                                 mouse_events: 1;
124                                 repeat_events: 1;
125                                 scale: 1;
126                                 description {
127                                         state: "default" 0.0;
128                                         rel1{relative: ICON_NAME_X_MIN ICON_NAME_Y_MIN; to: "icon_bg";}
129                                         rel2{relative: ICON_NAME_X_MAX ICON_NAME_Y_MAX; to: "icon_bg";}
130                                         color: 255 255 255 255;
131                                         text {
132                                                 style: "icon_label";
133                                                 align: 0.5 0.0;
134                                         }
135                                 }
136                                 description {
137                                         state: "edit" 0.0;
138                                         inherit: "default" 0.0;
139                                         rel1{relative: ICON_NAME_X_MIN ICON_NAME_Y_MIN; to: "icon_bg";}
140                                         rel2{relative: ICON_NAME_X_MAX 1.0; to: "icon_bg";}
141                                         text {
142                                                 style: "icon_label_edit";
143                                         }
144                                 }
145                                 description {
146                                         state: "black_text" 0.0;
147                                         inherit: "default" 0.0;
148                                         color: 0 0 0 255;
149                                 }
150                                 description {
151                                         state: "black_edit" 0.0;
152                                         inherit: "black_text" 0.0;
153                                         text {
154                                                 style: "icon_label_edit";
155                                         }
156                                 }
157                         }
158
159
160                         /*************************** BADGE *************************************/
161
162                         part
163                         {
164                                 name: "icon_badge";
165                                 type: IMAGE;
166                                 scale: 0;
167                                 description
168                                 {
169                                         state: "default" 0.0;
170                                         rel1{relative: 0.0 0.0; offset: -10 -1; to: "icon_badge_text";}
171                                         rel2{relative: 1.0 1.0; offset: 9 1; to: "icon_badge_text";}
172                                         visible: 0;
173                                         image
174                                         {
175                                                 normal: "icon_badge_container.png";
176                                                 border: 15 14 0 0;
177                                         }
178                                 }
179                                 description
180                                 {
181                                         state: "visible" 0.0;
182                                         inherit: "default" 0.0;
183                                         visible: 1;
184                                 }
185                         }
186
187                         part
188                         {
189                                 name: "icon_badge_text";
190                                 type: TEXT;
191                                 scale: 1;
192                                 description
193                                 {
194                                         state: "default" 0.0;
195                                         visible: 0;
196                                         fixed: 1 1;
197                                         color: 255 255 255 255;
198                                         rel1{relative: BADGE_REL_X BADGE_REL_Y; to: "icon_bg";}
199                                         rel2{relative: BADGE_REL_X BADGE_REL_Y; to: "icon_bg";}
200                                         align: 1.0 0.0;
201                                         text
202                                         {
203                                                 font: "arial";
204                                                 size: 32;
205                                                 text_class: "ATO002";
206                                                 min: 1 1;
207                                                 max: 1 1;
208                                         }
209                                 }
210                                 description
211                                 {
212                                         state: "visible" 0.0;
213                                         inherit: "default" 0.0;
214                                         visible: 1;
215                                 }
216                         }
217
218                         /*************************** END OF BADGE *************************************/
219
220                         part { //"icon_uninstall_button";
221                                 name: "icon_uninstall_button";
222                                 type: IMAGE;
223                                 scale: 0;
224                                 description {
225                                         state: "default" 0.0;
226                                         rel1{relative: 0.0 0.0; to: "icon_bg";}
227                                         rel2{relative: ICON_UNINSTALL_BTN_X_MAX ICON_UNINSTALL_BTN_Y_MAX; to: "icon_bg";}
228                                         color: 255 255 255 0;
229                                         visible: 0;
230                                         aspect: 1.0 1.0;
231                                         aspect_preference: BOTH;
232                                         image {
233                                                 normal: "btn_delete_nor.png";
234                                         }
235                                 }
236                                 description {
237                                         state: "show" 0.0;
238                                         inherit: "default" 0.0;
239                                         color: 255 255 255 255;
240                                         visible: 1;
241                                 }
242                                 description {
243                                         state: "press" 0.0;
244                                         inherit: "default" 0.0;
245                                         color: 255 255 255 255;
246                                         image {
247                                                 normal: "btn_delete_press.png";
248                                         }
249                                         visible: 1;
250                                 }
251                         }
252
253                         /*Icons checkboxes in choose state:*/
254                         part { //"icon_checkbox_bg";
255                                 name: "icon_checkbox_bg";
256                                 type: IMAGE;
257                                 scale: 0;
258                                 description {
259                                         state: "default" 0.0;
260                                         rel1{relative: ICON_BADGE_CHECKBOX_REL1_X ICON_BADGE_CHECKBOX_REL1_Y; to: "icon_bg";}
261                                         rel2{relative: ICON_BADGE_CHECKBOX_REL2_X ICON_BADGE_CHECKBOX_REL2_Y; to: "icon_bg";}
262                                         color: 255 255 255 120;
263                                         visible: 0;
264                                         aspect: 1.0 1.0;
265                                         aspect_preference: BOTH;
266                                         //TODO: image from home-lite is used...
267                                         image {
268                                                 normal: "app_icon_checkbox_bg.png";
269                                         }
270                                 }
271                                 description {
272                                         state: "blank" 0.0;
273                                         inherit: "default" 0.0;
274                                         visible: 1;
275                                 }
276                                 description {
277                                         state: "checked" 0.0;
278                                         inherit: "default" 0.0;
279                                         //color_class: "ATO005";
280                                         color: 255 255 255 255;
281                                         visible: 1;
282                                 }
283                         }
284
285                         part { //"icon_checkbox_border";
286                                 name: "icon_checkbox_border";
287                                 type: IMAGE;
288                                 scale: 0;
289                                 description {
290                                         state: "default" 0.0;
291                                         rel1{relative: 0.0 0.0; to: "icon_checkbox_bg";}
292                                         rel2{relative: 1.0 1.0; to: "icon_checkbox_bg";}
293                                         color: 255 255 255 0;
294                                         visible: 0;
295                                         aspect: 1.0 1.0;
296                                         aspect_preference: BOTH;
297                                         image {
298                                                 normal: "app_icon_checkbox_border.png";
299                                         }
300                                 }
301                                 description {
302                                         state: "blank" 0.0;
303                                         inherit: "default" 0.0;
304                                         color: 255 255 255 255;
305                                         visible: 1;
306                                 }
307                                 description {
308                                         state: "checked" 0.0;
309                                         inherit: "default" 0.0;
310                                         color: 255 255 255 120;
311                                         visible: 1;
312                                 }
313                         }
314
315                         part { //"icon_checkbox"
316                                 name: "icon_checkbox";
317                                 type: IMAGE;
318                                 scale: 0;
319                                 description {
320                                         state: "default" 0.0;
321                                         rel1{relative: 0.0 0.0; to: "icon_checkbox_bg";}
322                                         rel2{relative: 1.0 1.0; to: "icon_checkbox_bg";}
323                                         color: 255 255 255 0;
324                                         visible: 0;
325                                         aspect: 1.0 1.0;
326                                         aspect_preference: BOTH;
327                                         image {
328                                                 normal: "app_icon_checkbox_on.png";
329                                         }
330                                 }
331                                 description {
332                                         state: "blank" 0.0;
333                                         inherit: "default" 0.0;
334                                         color: 255 255 255 255;
335                                         visible: 0;
336                                 }
337                                 description {
338                                         state: "checked" 0.0;
339                                         inherit: "default" 0.0;
340                                         color: 255 255 255 255;
341                                         visible: 1;
342                                 }
343                         }
344
345                         part { //checkbox_click_area
346                                 name: "checkbox_click_area";
347                                 type: RECT;
348                                 scale: 0;
349                                 description {
350                                         state: "default" 0.0;
351                                         color: 0 0 0 0;
352                                         rel1 {
353                                                 relative: -0.2 -0.2;
354                                                 to: "icon_checkbox";
355                                         }
356                                         rel2 {
357                                                 relative: 1.2 1.2;
358                                                 to: "icon_checkbox";
359                                         }
360                                         visible: 0;
361                                 }
362                                 description {
363                                         state: "visible" 0.0;
364                                         inherit: "default" 0.0;
365                                         visible: 1;
366                                 }
367                         }
368                 }
369
370                 programs {
371                         program {
372                                 name: "group_loaded";
373                                 signal: "load";
374                                 source: "";
375                                 script {
376                                         set_int(checkbox_state, 0);
377                                 }
378                         }
379                         program {
380                                 name: "icon_clicked_program";
381                                 signal :"mouse,clicked,1";
382                                 source: "icon_content";
383                                 action: SIGNAL_EMIT SIGNAL_ICON_CLICKED SIGNAL_SOURCE;
384                                 //after: program with change the icon shadow state to clicked!
385                         }
386
387                         program {
388                                 name: "icon_touch_program";
389                                 signal: SIGNAL_ICON_PRESS;
390                                 source: SIGNAL_PRESS_SOURCE;
391                                 action: STATE_SET "icon_touched" 0.0;
392                                 target: "icon_content_touch";
393                                 transition: LINEAR 0.1;
394                         }
395
396                         program {
397                                 name: "icon_touch_release_program";
398                                 signal: "mouse,up,1";
399                                 source: "icon_content_touch";
400                                 action: STATE_SET "default" 0.0;
401                                 target: "icon_content_touch";
402                                 transition: LINEAR 0.1;
403                         }
404                         program {
405                                 name: "edit_mode_on";
406                                 signal: SIGNAL_EDIT_MODE_ON;
407                                 source: SIGNAL_SOURCE;
408                                 action: STATE_SET "edit" 0.0;
409                                 target: PART_ICON_NAME;
410                         }
411                         program {
412                                 name: "edit_mode_off";
413                                 signal: SIGNAL_EDIT_MODE_OFF;
414                                 source: SIGNAL_SOURCE;
415                                 action: STATE_SET "default" 0.0;
416                                 target: PART_ICON_NAME;
417                         }
418                         program {
419                                 name: "edit_mode_black_on";
420                                 signal: SIGNAL_EDIT_MODE_BLACK_ON;
421                                 source: SIGNAL_SOURCE;
422                                 action: STATE_SET "black_edit" 0.0;
423                                 target: PART_ICON_NAME;
424                         }
425                         program {
426                                 name: "edit_mode_black_off";
427                                 signal: SIGNAL_EDIT_MODE_BLACK_OFF;
428                                 source: SIGNAL_SOURCE;
429                                 action: STATE_SET "black_text" 0.0;
430                                 target: PART_ICON_NAME;
431                         }
432                         program {
433                                 name: "uninstall_button_show";
434                                 signal: SIGNAL_UNINSTALL_BUTTON_SHOW;
435                                 source: SIGNAL_SOURCE;
436                                 action: STATE_SET "show" 0.0;
437                                 target: "icon_uninstall_button";
438                                 transition: DECELERATE 0.20;
439                         }
440                         program {
441                                 name: "uninstall_button_hide";
442                                 signal: SIGNAL_UNINSTALL_BUTTON_HIDE;
443                                 source: SIGNAL_SOURCE;
444                                 action: STATE_SET "default" 0.0;
445                                 target: "icon_uninstall_button";
446                                 transition: DECELERATE 0.20;
447                         }
448                         program {
449                                 name: "uninstall_button_clicked";
450                                 signal: "mouse,clicked,1";
451                                 source: "icon_uninstall_button";
452                                 action: SIGNAL_EMIT SIGNAL_UNINSTALL_BUTTON_CLICKED SIGNAL_SOURCE;
453                         }
454                         program {
455                                 name: "uninstall_button_mouse_down";
456                                 signal: "mouse,down,1";
457                                 source: "icon_uninstall_button";
458                                 action: STATE_SET "press" 0.0;
459                                 target: "icon_uninstall_button";
460                                 transition: DECELERATE 0.20;
461                         }
462                         program {
463                                 name: "uninstall_button_mouse_up";
464                                 signal: "mouse,up,1";
465                                 source: "icon_uninstall_button";
466                                 action: STATE_SET "show" 0.0;
467                                 target: "icon_uninstall_button";
468                                 transition: DECELERATE 0.20;
469                         }
470
471                         //Checkbox
472                         program {
473                                 name: "checkbox_show_unchecked";
474                                 signal: SIGNAL_CHECKBOX_SHOW_UNCHECKED;
475                                 source: SIGNAL_SOURCE;
476                                 script {
477                                         set_int(checkbox_state, 0);
478                                         emit("checkbox,blank,show", SIGNAL_SOURCE);
479                                 }
480                                 after: "checkbox_area_visible";
481                         }
482                         program {
483                                 name: "checkbox_show_checked";
484                                 signal: SIGNAL_CHECKBOX_SHOW_CHECKED;
485                                 source: SIGNAL_SOURCE;
486                                 script {
487                                         set_int(checkbox_state, 1);
488                                         emit("checkbox,checked,show", SIGNAL_SOURCE);
489                                 }
490                                 after: "checkbox_area_visible";
491                         }
492                         program {
493                                 name: "checkbox_blank_show";
494                                 signal: "checkbox,blank,show";
495                                 source: SIGNAL_SOURCE;
496                                 action: STATE_SET "blank" 0.0;
497                                 target: "icon_checkbox";
498                                 target: "icon_checkbox_border";
499                                 target: "icon_checkbox_bg";
500                         }
501                         program {
502                                 name: "checkbox_hide";
503                                 signal: SIGNAL_CHECKBOX_HIDE;
504                                 source: SIGNAL_SOURCE;
505                                 action: STATE_SET "default" 0.0;
506                                 target: "icon_checkbox";
507                                 target: "icon_checkbox_border";
508                                 target: "icon_checkbox_bg";
509                                 transition: DECELERATE 0.20;
510                                 after: "checkbox_area_hide";
511                         }
512                         program {
513                                 name: "checkbox_checked_show";
514                                 signal: "checkbox,checked,show";
515                                 source: SIGNAL_SOURCE;
516                                 action: STATE_SET "checked" 0.0;
517                                 target: "icon_checkbox";
518                                 target: "icon_checkbox_border";
519                                 target: "icon_checkbox_bg";
520                                 transition: DECELERATE 0.20;
521                         }
522                         program {
523                                 name: "checkbox_clicked";
524                                 signal: "mouse,clicked,1";
525                                 source: "checkbox_click_area";
526                                 script {
527                                         if (get_int(checkbox_state) == 0) {
528                                                 set_int(checkbox_state, 1); //isnt it deprecated?
529                                                 emit("checkbox,checked,show", SIGNAL_SOURCE); //signal for edje state change
530                                                 emit("checkbox,checked", SIGNAL_SOURCE); //signal for C listener
531                                         }
532                                         else {
533                                                 set_int(checkbox_state, 0);
534                                                 emit("checkbox,blank,show", SIGNAL_SOURCE); //signal for edje state change
535                                                 emit("checkbox,unchecked", SIGNAL_SOURCE); //signal for C listener
536                                         }
537                                 }
538                         }
539                         /*This is when ALLs are in management mode:*/
540                         program {
541                                 name: "set_manage_state_program";
542                                 signal: "set_manage_state";
543                                 source: SIGNAL_SOURCE;
544                                 action: STATE_SET "manage_state" 0.0;
545                                 target: "icon_bg";
546                                 transition: DECELERATE 0.2;
547                         }
548                         /*This is default for ALLs: */
549                         program {
550                                 name: "unset_manage_state_program";
551                                 signal: "unset_manage_state";
552                                 source: SIGNAL_SOURCE;
553                                 action: STATE_SET "default" 0.0;
554                                 target: "icon_bg";
555                                 transition: DECELERATE 0.2;
556                         }
557                         program {
558                                 name: "program_no_text";
559                                 signal: SIGNAL_LABEL_HIDE;
560                                 source: SIGNAL_SOURCE;
561                                 action: STATE_SET "no_text" 0.0;
562                                 target: PART_ICON_NAME;
563                         }
564                         program {
565                                 name: "program_black_text";
566                                 signal: "label,text,black";
567                                 source: SIGNAL_SOURCE;
568                                 action: STATE_SET "black_text" 0.0;
569                                 target: PART_ICON_NAME;
570                         }
571                         program {
572                                 name: "program_default";
573                                 signal: SIGNAL_LABEL_SHOW;
574                                 source: SIGNAL_SOURCE;
575                                 action: STATE_SET "default" 0.0;
576                                 target: PART_ICON_NAME;
577                                 transition: DECELERATE 0.20;
578                         }
579                         program {
580                                 name: "icon_badge_show";
581                                 signal: SIGNAL_BADGE_SHOW;
582                                 source: SIGNAL_SOURCE;
583                                 action: STATE_SET "visible" 0.0;
584                                 target: "icon_badge";
585                                 target: "icon_badge_text";
586                         }
587                         program {
588                                 name: "icon_badge_hide";
589                                 signal: SIGNAL_BADGE_HIDE;
590                                 source: SIGNAL_SOURCE;
591                                 action: STATE_SET "default" 0.0;
592                                 target: "icon_badge";
593                                 target: "icon_badge_text";
594                         }
595                         program {
596                                 name: "checkbox_area_visible";
597                                 action: STATE_SET "visible" 0.0;
598                                 target: "checkbox_click_area";
599                         }
600                         program {
601                                 name: "checkbox_area_hide";
602                                 action: STATE_SET "default" 0.0;
603                                 target: "checkbox_click_area";
604                         }
605                         program {
606                                 name: "area,clicked";
607                                 signal: "mouse,clicked,1";
608                                 source: "checkbox_click_area";
609                                 action: SIGNAL_EMIT "mouse,clicked,1" "icon_checkbox";
610                         }
611                         program {
612                                 name: "checkbox,block";
613                                 signal: SIGNAL_CHECKBOX_BLOCK;
614                                 source: SIGNAL_SOURCE;
615                                 action: STATE_SET "default" 0.0;
616                                 target: "checkbox_click_area";
617                         }
618                         program {
619                                 name: "checkbox,unblock";
620                                 signal: SIGNAL_CHECKBOX_UNBLOCK;
621                                 source: SIGNAL_SOURCE;
622                                 action: STATE_SET "visible" 0.0;
623                                 target: "checkbox_click_area";
624                         }
625                 }
626         }
627 }