The source code moved from the SPIN with license changed to Flora 1.1
[apps/native/home/homescreen-efl.git] / res / edje / livebox_container.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 {
21         image: "../images/btn_delete_nor.png" COMP;
22         image: "../images/edit_all_page_create.png" COMP;
23         image: "../images/frame.png" COMP;
24         image: "../images/resize_button.png" COMP;
25 }
26
27 collections {
28         group {
29                 ///@todo it would rather be named livebox_scroller_page
30                 name: "livebox_container";
31
32                 parts {
33                         part {
34                                 //background fills the whole page in pagescroller
35                                 name: "bg";
36                                 scale: 1;
37                                 type: SWALLOW;
38                                 description {
39                                         state: "default" 0.0;
40                                         rel1
41                                         {
42                                                 relative: 0.0 CONTENT_Y_MIN;
43                                         }
44                                         rel2 {
45                                                 relative: 1.0 CONTENT_Y_MAX;
46                                         }
47                                 }
48                         }
49
50                         part
51                         {
52                                 name: "grid_bg";
53                                 scale: 1;
54                                 type: SWALLOW;
55                                 description
56                                 {
57                                         state: "default" 0.0;
58                                         visible: 1;
59                                         rel1
60                                         {
61                                                 relative: 0.0 0.0; to: "content";
62                                         }
63                                         rel2
64                                         {
65                                                 relative: 1.0 1.0; to: "content";
66                                         }
67                                 }
68                                 description
69                                 {
70                                         state: "hidden" 0.0;
71                                         inherit: "default";
72                                         visible: 0;
73                                 }
74
75                         }
76
77                         part {
78                                 name: "edit_dim";
79                                 scale: 1;
80                                 type: RECT;
81                                 repeat_events: 1;
82                                 description {
83                                         state: "default" 0.0;
84                                         rel1 {relative: 0.0 0.0; to: "content";}
85                                         rel2 {relative: 1.0 1.0; to: "content";}
86                                         color: 0 0 0 40;
87                                         visible: 0;
88                                 }
89                                 description {
90                                         state: "edit";
91                                         inherit: "default" 0.0;
92                                         visible: 1;
93                                 }
94                         }
95
96                         part {
97                                 name : "add_page_button";
98                                 scale: 1;
99                                 type: IMAGE;
100                                 description {
101                                         state: "default" 0.0;
102                                         rel1 {relative: LIVEBOX_ADD_PAGE_BUTTON_X_MIN LIVEBOX_ADD_PAGE_BUTTON_Y_MIN; to: "edit_dim";}
103                                         rel2 {relative: LIVEBOX_ADD_PAGE_BUTTON_X_MAX LIVEBOX_ADD_PAGE_BUTTON_Y_MAX; to: "edit_dim";}
104                                         image {
105                                                 normal: "../images/edit_all_page_create.png";
106                                         }
107                                         aspect_preference: BOTH;
108                                         visible: 0;
109                                 }
110                                 description {
111                                         state: "visible";
112                                         inherit: "default" 0.0;
113                                         visible: 1;
114                                 }
115                         }
116
117                         part {
118                                 //content is smaller than the background and positioned in the center
119                                 name: "content";
120                                 scale: 1;
121                                 type: SWALLOW;
122                                 description {
123                                         state: "default" 0.0;
124                                         rel1 { relative: LIVEBOX_X_MIN 0.0; to: "bg";}
125                                         rel2 { relative: LIVEBOX_X_MAX 1.0; to: "bg";}
126                                         fixed: 1 1;
127                                 }
128                                 description {
129                                         state: "edit" 0.0;
130                                         rel1 {relative: LIVEBOX_EDIT_X_MIN LIVEBOX_EDIT_Y_MIN; to: "bg";}
131                                         rel2 {relative: LIVEBOX_EDIT_X_MAX LIVEBOX_EDIT_Y_MAX; to: "bg";}
132                                 }
133                         }
134
135                         part {
136                                 name: "remove_button";
137                                 scale: 1;
138                                 type: IMAGE;
139                                 mouse_events: 1;
140                                 description {
141                                         state: "default" 0.0;
142                                         rel1{relative: 0.0 0.0; to: "content";}
143                                         rel2{relative: 1.0 1.0; to: "content";}
144                                         color: 255 255 255 255;
145                                         visible: 0;
146                                         aspect: 1.0 1.0;
147                                         align: 0.0 0.0;
148                                         min: LIVEBOX_REMOVE_BUTTON_SIZE LIVEBOX_REMOVE_BUTTON_SIZE;
149                                         max: LIVEBOX_REMOVE_BUTTON_SIZE LIVEBOX_REMOVE_BUTTON_SIZE;
150                                         aspect_preference: BOTH;
151                                         fixed: 1 1;
152                                         image {
153                                                 normal: "../images/btn_delete_nor.png";
154                                         }
155                                 }
156                                 description {
157                                         state: "show" 0.0;
158                                         inherit: "default" 0.0;
159                                         visible: 1;
160                                 }
161                         }
162
163 // =================================================================================
164                         part
165                         {
166                                 name: "slider.vertical";
167                                 type: SPACER;
168                                 scale: 1;
169                                 repeat_events: 1;
170                                 description
171                                 {
172                                         state: "default" 0.0;
173                                         align: 0.5 0.5;
174                                         rel1
175                                         {
176                                                 relative: 0.0 -0.025;
177                                                 to_x: "button.left";
178                                                 to_y: "content";
179                                         }
180                                         rel2
181                                         {
182                                                 relative: 1.0 1.03;
183                                                 to_x: "button.right";
184                                                 to_y: "content";
185                                         }
186
187                                         min: LIVEBOX_SLIDER_BUTTON_SIZE 0;
188                                         max: LIVEBOX_SLIDER_BUTTON_SIZE -1;
189                                 }
190                         }
191                         part
192                         {
193                                 name: "button.down";
194                                 type: IMAGE;
195                                 scale: 1;
196                                 mouse_events: 1;
197                                 repeat_events: 0;
198
199                                 dragable {
200                                         confine: "slider.vertical";
201                                         x: 0 0 0;
202                                         y: 1 1 10;
203                                 }
204                                 description
205                                 {
206                                         state: "default" 0.0;
207                                         color: 0 255 0 255;
208                                         align: 0.5 0.5;
209                                         visible: 1;
210                                         min: LIVEBOX_SLIDER_BUTTON_SIZE LIVEBOX_SLIDER_BUTTON_SIZE;
211
212                                         image
213                                         {
214                                                 normal: "../images/resize_button.png";
215                                         }
216                                 }
217                                 description
218                                 {
219                                         state: "button,warning" 0.0;
220                                         inherit: "default";
221                                         color: 255 0 0 255;
222                                 }
223                                 description
224                                 {
225                                         state: "hidden";
226                                         inherit: "default";
227                                         visible: 0;
228                                 }
229                         }
230                         part
231                         {
232                                 name: "button.up";
233                                 type: IMAGE;
234                                 scale: 1;
235                                 mouse_events: 1;
236                                 repeat_events: 0;
237
238                                 dragable
239                                 {
240                                         confine: "slider.vertical";
241                                         x: 0 0 0;
242                                         y: 1 1 10;
243                                 }
244
245                                 description
246                                 {
247                                         state: "default" 0.0;
248                                         color: 0 255 0 255;
249                                         align: 0.5 0.5;
250                                         visible: 1;
251                                         min: LIVEBOX_SLIDER_BUTTON_SIZE LIVEBOX_SLIDER_BUTTON_SIZE;
252
253                                         image
254                                         {
255                                                 normal: "../images/resize_button.png";
256                                         }
257                                 }
258                                 description
259                                 {
260                                         state: "button,warning" 0.0;
261                                         inherit: "default";
262                                         color: 255 0 0 255;
263                                 }
264                                 description
265                                 {
266                                         state: "hidden";
267                                         inherit: "default";
268                                         visible: 0;
269                                 }
270                         }
271
272                         part
273                         {
274                                 name: "slider.horizontal";
275                                 type: SPACER;
276                                 scale: 1;
277                                 repeat_events: 1;
278
279                                 description
280                                 {
281                                         state: "default" 0.0;
282                                         align: 0.5 0.5;
283
284                                         rel1
285                                         {
286                                                 relative: -0.025 0.0;
287                                                 to_x: "content";
288                                                 to_y: "button.up";
289                                         }
290                                         rel2
291                                         {
292                                                 relative: 1.03 1.0;
293                                                 to_x: "content";
294                                                 to_y: "button.down";
295                                         }
296
297                                         min: 0 LIVEBOX_SLIDER_BUTTON_SIZE;
298                                         max: -1 LIVEBOX_SLIDER_BUTTON_SIZE;
299                                 }
300                         }
301                         part
302                         {
303                                 name: "button.right";
304                                 type: IMAGE;
305                                 scale: 1;
306                                 mouse_events: 1;
307                                 repeat_events: 0;
308
309                                 dragable
310                                 {
311                                         confine: "slider.horizontal";
312                                         x: 1 1 10;
313                                         y: 0 0 0;
314                                 }
315
316                                 description
317                                 {
318                                         state: "default" 0.0;
319                                         color: 0 255 0 255;
320                                         align: 0.5 0.5;
321                                         min: LIVEBOX_SLIDER_BUTTON_SIZE LIVEBOX_SLIDER_BUTTON_SIZE;
322                                         max: LIVEBOX_SLIDER_BUTTON_SIZE LIVEBOX_SLIDER_BUTTON_SIZE;
323                                         rel1
324                                         {
325                                                 relative: 0.90 0.0;
326                                                 to_y: "button.up";
327                                         }
328                                         rel2
329                                         {
330                                                 relative: 1.00 1.0;
331                                                 to_y: "button.down";
332                                         }
333
334                                         image
335                                         {
336                                                 normal: "../images/resize_button.png";
337                                         }
338                                 }
339                                 description
340                                 {
341                                         state: "button,warning" 0.0;
342                                         inherit: "default";
343                                         color: 255 0 0 255;
344                                 }
345                                 description
346                                 {
347                                         state: "hidden";
348                                         inherit: "default";
349                                         visible: 0;
350                                 }
351                         }
352                         part
353                         {
354                                 name: "button.left";
355                                 type: IMAGE;
356                                 scale: 1;
357                                 mouse_events: 1;
358                                 repeat_events: 0;
359
360                                 dragable
361                                 {
362                                         confine: "slider.horizontal";
363                                         x: 1 1 10;
364                                         y: 0 0 0;
365                                 }
366
367                                 description
368                                 {
369                                         state: "default" 0.0;
370                                         color: 0 255 0 255;
371                                         align: 0.5 0.5;
372                                         min: LIVEBOX_SLIDER_BUTTON_SIZE LIVEBOX_SLIDER_BUTTON_SIZE;
373                                         max: LIVEBOX_SLIDER_BUTTON_SIZE LIVEBOX_SLIDER_BUTTON_SIZE;
374                                         visible: 1;
375                                         rel1
376                                         {
377                                                 relative: 0.0 1.0;
378                                                 to_y: "button.up";
379                                         }
380                                         rel2
381                                         {
382                                                 relative: 0.1 0.0;
383                                                 to_y: "button.down";
384                                         }
385
386                                         image
387                                         {
388                                                 normal: "../images/resize_button.png";
389                                         }
390                                 }
391                                 description
392                                 {
393                                         state: "button,warning" 0.0;
394                                         inherit: "default";
395                                         color: 255 0 0 255;
396                                 }
397                                 description
398                                 {
399                                         state: "hidden";
400                                         inherit: "default";
401                                         visible: 0;
402                                 }
403                         }
404
405                         part {
406                                 name: "event_blocker";
407                                 type: RECT;
408                                 mouse_events: 1;
409                                 repeat_events: 1;
410                                 description {
411                                         state: "default" 0.0;
412                                         fixed: 1 1;
413                                         color: 0 0 0 0;
414                                         visible: 0;
415                                         rel1 { relative: 0.0 0.0; to: "content";}
416                                         rel2 { relative: 1.0 1.0; to: "content";}
417                                 }
418                                 description {
419                                         state: "show" 0.0;
420                                         inherit: "default" 0.0;
421                                         visible: 1;
422                                 }
423                         }
424
425                         part {
426                                 name : "frame";
427                                 type: IMAGE;
428                                 mouse_events: 0;
429                                 repeat_events: 1;
430                                 description {
431                                         state: "default" 0.0;
432                                         rel1
433                                         {
434                                                 relative: LIVEBOX_RESIZE_FRAME_REL_1 LIVEBOX_RESIZE_FRAME_REL_1;
435                                                 to_x: "button.left";
436                                                 to_y: "button.up";
437                                         }
438                                         rel2
439                                         {
440                                                 relative: LIVEBOX_RESIZE_FRAME_REL_2 LIVEBOX_RESIZE_FRAME_REL_2;
441                                                 to_x: "button.right";
442                                                 to_y: "button.down";
443                                         }
444                                         image {
445                                                 normal: "../images/frame.png";
446                                                 border: 20 20 20 20;
447                                         }
448                                         color: 0 255 0 255;
449                                         visible: 1;
450                                 }
451                                 description {
452                                         state: "hidden";
453                                         inherit: "default" 0.0;
454                                         visible: 0;
455                                 }
456                                 description {
457                                         state: "button,warning";
458                                         inherit: "default" 0.0;
459                                         color: 255 0 0 255;
460                                 }
461                         }
462
463 // ===========================================================================
464                 programs {
465                 //Remove button
466                         program {
467                                 name: "remove_button_show";
468                                 signal: "remove_button,show";
469                                 source: "layout";
470                                 action: STATE_SET "show" 0.0;
471                                 target: "remove_button";
472                                 transition: DECELERATE 0.20;
473                         }
474                         program {
475                                 name: "event_blocker_show";
476                                 action: STATE_SET "show" 0.0;
477                                 target: "event_blocker";
478                         }
479
480                         program {
481                                 name: "remove_button_hide";
482                                 signal: "remove_button,hide";
483                                 source: "layout";
484                                 action: STATE_SET "default" 0.0;
485                                 target: "remove_button";
486                                 transition: DECELERATE 0.20;
487                         }
488                         program {
489                                 name: "remove_button_hide_instant";
490                                 signal: "remove_button,hide,instant";
491                                 source: "layout";
492                                 action: STATE_SET "default" 0.0;
493                                 target: "remove_button";
494                                 after: "event_blocker_hide";
495                         }
496                         program {
497                                 name: "event_blocker_hide";
498                                 action: STATE_SET "default" 0.0;
499                                 target: "event_blocker";
500                         }
501
502                         program {
503                                 name: "remove_button_clicked";
504                                 signal: "mouse,clicked,1";
505                                 source: "remove_button";
506                                 action: SIGNAL_EMIT "remove_button,clicked" "layout";
507                         }
508
509 // =========================================================================
510                         program
511                         {
512                                 name: "drag,outside";
513                                 signal: "drag,outside";
514                                 source: "livebox";
515                                 action: STATE_SET "button,warning" 0.0;
516                                 target: "button.left";
517                                 target: "button.right";
518                                 target: "button.up";
519                                 target: "button.down";
520                                 target: "frame";
521                         }
522                         program
523                         {
524                                 name: "drag,ok";
525                                 signal: "drag,ok";
526                                 source: "livebox";
527                                 action: STATE_SET "default" 0.0;
528                                 target: "button.left";
529                                 target: "button.right";
530                                 target: "button.up";
531                                 target: "button.down";
532                                 target: "frame";
533                         }
534
535                         program
536                         {
537                                 name: "sliders,hide";
538                                 signal: "sliders,hide";
539                                 source: "livebox";
540                                 action: STATE_SET "hidden" 0.0;
541                                 target: "button.left";
542                                 target: "button.right";
543                                 target: "button.up";
544                                 target: "button.down";
545                                 target: "frame";
546                         }
547
548                         program
549                         {
550                                 name: "sliders,show";
551                                 signal: "sliders,show";
552                                 source: "livebox";
553                                 action: STATE_SET "default" 0.0;
554                                 target: "button.left";
555                                 target: "button.right";
556                                 target: "button.up";
557                                 target: "button.down";
558                                 target: "frame";
559                         }
560 // ==================================================================================================
561
562                         program
563                         {
564                                 name: "grid,hide";
565                                 signal: SIGNAL_GRID_SHADOW_HIDE;
566                                 source: PART_GRID_BG;
567                                 action: STATE_SET "hidden" 0.0;
568                                 target: "grid_bg";
569                         }
570
571                         program
572                         {
573                                 name: "grid,show";
574                                 signal: SIGNAL_GRID_SHADOW_SHOW;
575                                 source: PART_GRID_BG;
576                                 action: STATE_SET "default" 0.0;
577                                 target: "grid_bg";
578                         }
579
580
581 // ==================================================================================================
582
583                         program {
584                                 name: "edit_start";
585                                 signal: "edit,start";
586                                 source: "layout";
587                                 action: STATE_SET "edit" 0.0;
588                                 target: "edit_dim";
589                                 target: "content";
590                         }
591                         program {
592                                 name: "edit_stop";
593                                 signal: "edit,stop";
594                                 source: "layout";
595                                 action: STATE_SET "default" 0.0;
596                                 target: "edit_dim";
597                                 target: "content";
598                         }
599                         program {
600                                 name: "add_show";
601                                 signal: "add,show";
602                                 source: "layout";
603                                 action: STATE_SET "visible" 0.0;
604                                 target: "add_page_button";
605                         }
606                         program {
607                                 name: "add_hide";
608                                 signal: "add,hide";
609                                 source: "layout";
610                                 action: STATE_SET "default" 0.0;
611                                 target: "add_page_button";
612                         }
613                         program
614                         {
615                                 name: "add_page_clicked";
616                                 signal: "mouse,clicked,1";
617                                 source: "add_page_button";
618                                 action: SIGNAL_EMIT "add_page_button_clicked" "layout";
619                         }
620                 }
621         }
622 }