apply FSL(Flora Software License)
[profile/ivi/org.tizen.browser.git] / edc / browser-view-progressbar.edc
1 /*
2   * Copyright 2012  Samsung Electronics Co., Ltd
3   *
4   * Licensed under the Flora License, Version 1.0 (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://www.tizenopensource.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 "browser-macro.edc"
18
19 collections {
20    group { name: "elm/progressbar/horizontal/browser/loading";
21       images {
22          image: "browser-view-images/progressbar/00_search_input_field_bg_progress.png" COMP;
23          image: "browser-view-images/progressbar/progressbar.png" COMP;
24       }
25       parts {
26              part { name: "elm.padding.left";
27             type: RECT;
28                         scale: 1;
29             description {
30                                 state: "default" 0.0;
31                                 min: 0 0;
32                                 fixed: 1 0;
33                                 rel1 {
34                                         relative: 0.0  0.0;
35                                         offset:   0    0;
36                                 }
37                                 rel2 {
38                                         relative: 0.0  1.0;
39                                         offset:   0   0;
40                                 }
41                                 color: 0 0 0 0;
42                                 align: 0.0 0.0;
43             }
44          }
45          part { name: "elm.padding.right";
46             type: RECT;
47                         scale: 1;
48             description {
49                                 state: "default" 0.0;
50                                 min: 0 0;
51                                 fixed: 1 0;
52                                 rel1 {
53                                         relative: 1.0  0.0;
54                                     offset:   0    0;
55                                 }
56                                 rel2 {
57                                         relative: 1.0  1.0;
58                                         offset:   0   0;
59                                 }
60                                 color: 0 0 0 0;
61                                 align: 1.0 0.0;
62             }
63          }
64                   part { name: "elm.background.progressbar";
65             mouse_events: 0;
66             scale: 1;
67             description {
68                state: "default" 0.0;
69                rel1 {
70                                   to_x: "elm.padding.left";
71                   relative: 1.0 0.0;
72                   offset: 0 0;
73                }
74                rel2 {
75                                   to_x: "elm.padding.right";
76                   relative: 0.0 1.0;
77                   offset: -1 -1;
78                }
79             }
80          }
81          part { name: "elm.swallow.bar";
82             mouse_events: 0;
83             scale: 1;
84             type: SWALLOW;
85             description {
86                min: 48 0;
87                            fixed: 1 0;
88                state: "default" 0.0;
89                rel1 {
90                   to: "elm.background.progressbar";
91                   relative: 0.0 0.0;
92                }
93                rel2 {
94                   to: "elm.background.progressbar";
95                   relative: 1.0 1.0;
96                }
97             }
98          }
99          part { name: "elm.swallow.content";
100             type: SWALLOW;
101             scale: 1;
102             description { state: "default" 0.0;
103                visible: 0;
104                align: 0.0 0.5;
105                rel1 {
106                   offset: 0 0;
107                   to_y: "elm.background.progressbar";
108                }
109                rel2 {
110                   offset: 0 -1;
111                   relative: 0.0 1.0;
112                   to_y: "elm.background.progressbar";
113                }
114             }
115             description { state: "visible" 0.0;
116                inherit: "default" 0.0;
117                visible: 1;
118                aspect: 1.0 1.0;
119                aspect_preference: VERTICAL;
120 #ifdef WVGA_NBEAT // 480 * 800
121                rel2.offset: 4 -1;
122 #else
123                rel2.offset: 6 -1;
124 #endif
125             }
126          }
127          part { name: "elm.text";
128             type: TEXT;
129             mouse_events: 0;
130             scale: 1;
131             description { state: "default" 0.0;
132                visible: 0;
133                fixed: 1 1;
134                align: 0.0 0.5;
135                rel1.to_x: "elm.swallow.content";
136                rel1.relative: 1.0 0.0;
137 #ifdef WVGA_NBEAT // 480 * 800
138                rel1.offset: -1 4;
139 #else
140                rel1.offset: -1 6;
141 #endif
142                rel2.to_x: "elm.swallow.content";
143                rel2.relative: 1.0 1.0;
144                rel2.offset: -1 -5;
145                color: 0 0 0 255;
146                text {
147                   font: "SLP:style=Medium";
148 #ifdef WVGA_NBEAT // 480 * 800
149                   size: 10;
150 #else
151                   size: 15;
152 #endif
153                   min: 0 0;
154                   align: 0.0 0.5;
155                }
156             }
157             description { state: "visible" 0.0;
158                inherit: "default" 0.0;
159                visible: 0;
160                text.min: 1 1;
161 #ifdef WVGA_NBEAT // 480 * 800
162                rel1.offset: 0 4;
163                rel2.offset: 0 -5;
164 #else
165                rel1.offset: 0 6;
166                rel2.offset: 0 -7;
167 #endif
168             }
169          }
170
171          part { name: "background";
172             mouse_events: 0;
173             scale: 1;
174             clip_to: "elm.background.progressbar";
175             description {
176                state: "default" 0.0;
177                rel1 {
178                   to: "elm.swallow.bar";
179                   relative: 0.0 0.0;
180                }
181                rel2 {
182                   to: "elm.swallow.bar";
183                   relative: 1.0 1.0;
184                   offset: -1 -1;
185                }
186             }
187          }
188
189          part { name: "elm.text.status";
190             type: TEXT;
191             mouse_events: 0;
192             scale: 1;
193             description { state: "default" 0.0;
194                fixed: 1 1;
195                visible: 0;
196                rel1 {
197                   to: "background";
198                   relative: 0.5 0.5;
199                }
200                rel2 {
201                   to: "background";
202                   relative: 0.5 0.5;
203                }
204                text {
205                   font: "SLP:style=Medium";
206 #ifdef WVGA_NBEAT // 480 * 800
207                   size: 10;
208 #else
209                   size: 15;
210 #endif
211                   min: 0 0;
212                   align: 0.5 0.0;
213                }
214                color: 0 0 0 255;
215             }
216             description { state: "show" 0.0;
217                inherit: "default" 0.0;
218                visible: 0;
219                text.min: 1 1;
220             }
221          }
222
223          part { name: "elm.progress.progressbar";
224             mouse_events: 0;
225             scale: 1;
226             clip_to: "elm.background.progressbar";
227             description {
228                state: "default" 0.0;
229                min: 0 0;
230                fixed: 1 1;
231                rel1 {
232                   to: "elm.swallow.bar";
233                   relative: 0.0 0.0;
234                }
235                rel2 {
236                   to_y: "elm.swallow.bar";
237                   to_x: "elm.cur.progressbar";
238                   offset: -1 -1;
239                }
240                image {
241                                   normal: "browser-view-images/progressbar/progressbar.png";
242                   border: 5 5 5 5;
243                }
244             }
245             description {
246                state: "invert" 0.0;
247                inherit: "default" 0.0;
248                rel1 {
249                   to_y: "elm.swallow.bar";
250                   to_x: "elm.cur.progressbar";
251                }
252                rel2 {
253                   to: "elm.swallow.bar";
254                   relative: 1.0 1.0;
255                }
256             }
257             description {
258                state: "state_begin" 0.0;
259                inherit: "default" 0.0;
260                rel1 {
261                   to: "elm.swallow.bar";
262                   relative: 0.0 0.0;
263                }
264                rel2 {
265                   to: "elm.swallow.bar";
266                   relative: 0.1 1.0;
267                }
268             }
269             description {
270                state: "state_end" 0.0;
271                inherit: "default" 0.0;
272                rel1 {
273                   to: "elm.swallow.bar";
274                   relative: 0.9 0.0;
275                }
276                rel2 {
277                   to: "elm.swallow.bar";
278                   relative: 1.0 1.0;
279                }
280             }
281          }
282          part { name: "text-bar";
283             type: TEXT;
284             mouse_events: 0;
285             scale: 1;
286             clip_to: "progress-rect";
287             effect: SOFT_SHADOW;
288             scale: 0;
289             description { state: "default" 0.0;
290                align: 0.0 0.0;
291                fixed: 1 1;
292                visible: 0;
293                rel1.to: "elm.text.status";
294                rel1.offset: -1 -1;
295                rel2.to: "elm.text.status";
296                text {
297                   text_source: "elm.text.status";
298                   font: "SLP:style=Medium";
299 #ifdef WVGA_NBEAT // 480 * 800
300                   size: 10;
301 #else
302                   size: 15;
303 #endif
304                   min: 0 0;
305                   align: 0.0 0.0;
306                }
307                color: 224 224 224 255;
308                color3: 0 0 0 64;
309             }
310             description { state: "show" 0.0;
311                inherit: "default" 0.0;
312                visible: 0;
313                text.min: 1 1;
314             }
315          }
316          part { name: "elm.cur.progressbar";
317             mouse_events: 0;
318             scale: 1;
319             dragable {
320                confine: "background";
321                x: 1 1 1;
322                y: 0 0 0;
323             }
324             description { state: "default" 0.0;
325 #ifdef WVGA_NBEAT // 480 * 800
326                min: 0 28;
327 #else
328                min: 0 42;
329 #endif
330                fixed: 1 1;
331                visible: 0;
332                rel1 {
333                   to: "background";
334                   relative: 0 0;
335                }
336                rel2.to: "background";
337            }
338          }
339          part { name: "progress-rect";
340             mouse_events: 0;
341             scale: 1;
342             description {
343                state: "default" 0.0;
344                rel1.to: "elm.progress.progressbar";
345                rel2.to: "elm.progress.progressbar";
346             }
347          }
348       }
349       programs {
350          program { name: "label_show";
351             signal: "elm,state,text,visible";
352             source: "elm";
353             action:  STATE_SET "visible" 0.0;
354             target: "elm.text";
355          }
356          program { name: "label_hide";
357             signal: "elm,state,text,hidden";
358             source: "elm";
359             action:  STATE_SET "default" 0.0;
360             target: "elm.text";
361          }
362          program { name: "icon_show";
363             signal: "elm,state,icon,visible";
364             source: "elm";
365             action:  STATE_SET "visible" 0.0;
366             target: "elm.swallow.content";
367          }
368          program { name: "icon_hide";
369             signal: "elm,state,icon,hidden";
370             source: "elm";
371             action:  STATE_SET "default" 0.0;
372             target: "elm.swallow.content";
373          }
374          program { name: "units_show";
375             signal: "elm,state,units,visible";
376             source: "elm";
377             action:  STATE_SET "show" 0.0;
378             target: "text-bar";
379             target: "elm.text.status";
380          }
381          program { name: "units_hide";
382             signal: "elm,state,units,hidden";
383             source: "elm";
384             action:  STATE_SET "default" 0.0;
385             target: "text-bar";
386             target: "elm.text.status";
387          }
388          program { name: "slide_to_end";
389             action:  STATE_SET "state_end" 0.0;
390             transition: LINEAR 0.5;
391             target: "elm.progress.progressbar";
392             after: "slide_to_begin";
393          }
394          program { name: "slide_to_begin";
395             signal: "elm,state,slide,begin";
396             action: STATE_SET "state_begin" 0.0;
397             target: "elm.progress.progressbar";
398             transition: LINEAR 0.5;
399             after: "slide_to_end";
400          }
401          program { name: "start_pulse";
402             signal: "elm,state,pulse,start";
403             source: "elm";
404             after: "slide_to_end";
405          }
406          program { name: "stop_pulse";
407             signal: "elm,state,pulse,stop";
408             source: "elm";
409             action: ACTION_STOP;
410             target: "slide_to_begin";
411             target: "slide_to_end";
412             target: "start_pulse";
413             after: "state_pulse";
414          }
415          program { name: "state_pulse";
416             signal: "elm,state,pulse";
417             source: "elm";
418             action: STATE_SET "state_begin" 0.0;
419             target: "elm.progress.progressbar";
420             after: "units_hide";
421          }
422          program { name: "state_fraction";
423             signal: "elm,state,fraction";
424             source: "elm";
425             action: ACTION_STOP;
426             target: "slide_to_begin";
427             target: "slide_to_end";
428             target: "start_pulse";
429             action: STATE_SET "default" 0.0;
430             target: "elm.progress.progressbar";
431          }
432          program { name: "set_invert_on";
433             signal: "elm,state,inverted,on";
434             source: "elm";
435             action:  STATE_SET "invert" 0.0;
436             target: "elm.progress.progressbar";
437          }
438          program { name: "set_invert_off";
439             signal: "elm,state,inverted,off";
440             source: "elm";
441             action:  STATE_SET "default" 0.0;
442             target: "elm.progress.progressbar";
443          }
444       }
445    }
446
447 /* The cpu consumption depends on the time delay of progress bar */
448 #define PROGRESSING_DELAY       0.14
449    group { name: "elm/progressbar/horizontal/browser/loading_wheel";
450        images {
451            image: "browser-view-images/progressbar/processing_ani00.png" COMP;
452            image: "browser-view-images/progressbar/processing_ani01.png" COMP;
453            image: "browser-view-images/progressbar/processing_ani02.png" COMP;
454            image: "browser-view-images/progressbar/processing_ani03.png" COMP;
455            image: "browser-view-images/progressbar/processing_ani04.png" COMP;
456            image: "browser-view-images/progressbar/processing_ani05.png" COMP;
457            image: "browser-view-images/progressbar/processing_ani06.png" COMP;
458            image: "browser-view-images/progressbar/processing_ani07.png" COMP;
459        }
460        parts {
461            part { name: "elm.background.progressbar";
462                mouse_events: 0;
463                scale: 1;
464                type: RECT;
465                description {
466                    state: "default" 0.0;
467                }
468            }
469            part { name: "elm.swallow.bar";
470                mouse_events: 0;
471                scale: 1;
472                type: SWALLOW;
473                description { state: "default" 0.0;
474                    min: 0 0;
475                    max: 0 0;
476                    visible: 0;
477                }
478            }
479            part { name: "elm.swallow.content";
480                type: SWALLOW;
481                scale: 1;
482                description { state: "default" 0.0;
483                    min: 0 0;
484                    max: 0 0;
485                    visible: 0;
486                }
487            }
488            part { name: "background";
489                mouse_events: 0;
490                scale: 1;
491                clip_to: "elm.background.progressbar";
492                description {
493                    state: "default" 0.0;
494 #ifdef WVGA_NBEAT // 480 * 800
495                    min: 40 40;
496                    max: 60 60;
497 #else
498                    min: 60 60;
499                    max: 90 90;
500 #endif
501                    visible: 1;
502                    aspect: 1.0 1.0;
503                    aspect_preference: BOTH;
504                    image {
505                        normal: "browser-view-images/progressbar/processing_ani00.png";
506                    }
507                }
508                description { state: "pulse" 0.0;
509                    inherit: "default" 0.0;
510                    image {
511                        normal: "browser-view-images/progressbar/processing_ani00.png";
512                    }
513                }
514                            description { state: "pulse" 0.01;
515                                    inherit: "default" 0.0;
516                                    image {
517                                            normal: "browser-view-images/progressbar/processing_ani01.png";
518                                    }
519                            }
520                            description { state: "pulse" 0.02;
521                                    inherit: "default" 0.0;
522                                    image {
523                                            normal: "browser-view-images/progressbar/processing_ani02.png";
524                                    }
525                            }
526                            description { state: "pulse" 0.03;
527                                    inherit: "default" 0.0;
528                                    image {
529                                            normal: "browser-view-images/progressbar/processing_ani03.png";
530                                    }
531                            }
532                            description { state: "pulse" 0.04;
533                                    inherit: "default" 0.0;
534                                    image {
535                                            normal: "browser-view-images/progressbar/processing_ani04.png";
536                                    }
537                            }
538                            description { state: "pulse" 0.05;
539                                    inherit: "default" 0.0;
540                                    image {
541                                            normal: "browser-view-images/progressbar/processing_ani05.png";
542                                    }
543                            }
544                            description { state: "pulse" 0.06;
545                                    inherit: "default" 0.0;
546                                    image {
547                                            normal: "browser-view-images/progressbar/processing_ani06.png";
548                                    }
549                            }
550                            description { state: "pulse" 0.07;
551                                    inherit: "default" 0.0;
552                                    image {
553                                            normal: "browser-view-images/progressbar/processing_ani07.png";
554                                    }
555                            }
556            }
557        }
558            script {
559                         public pulse_state;
560            }
561        programs {
562            program { name: "continue_pulse";
563                            script {
564                                         new Float:state;
565                                         state = get_float(pulse_state);
566                                         set_state(PART:"background", "pulse", state);
567                                         state += 0.01;
568                                         if( state > 0.07 )
569                                                 state = 0.00;
570                                         set_float(pulse_state, state);
571                            }
572                after: "delay";
573            }
574            program { name: "delay";
575                action: STATE_SET "pulse" 0.10;
576                target: "background";
577                            in: PROGRESSING_DELAY 0.0;
578                after: "continue_pulse";
579            }
580            program { name: "start_pulse";
581                signal: "elm,state,pulse,start";
582                source: "elm";
583                            script {
584                                         set_float(pulse_state, 0.0);
585                            }
586                after: "continue_pulse";
587            }
588            program { name: "stop_pulse";
589                signal: "elm,state,pulse,stop";
590                source: "elm";
591                            action: ACTION_STOP;
592                target: "continue_pulse";
593                target: "delay";
594                target: "start_pulse";
595                after: "init_pulse";
596            }
597                    program { name: "init_pulse";
598                                 action: STATE_SET "default" 0.0;
599                                 target: "background";
600                    }
601        }
602    }
603 }
604