50bb0634b6c18c50b6ed094ef224dc93b85273a3
[framework/uifw/efl-theme-tizen.git] / themes / widgets / genlist / genlist.edc
1 /*
2  * Copyright (c) 2010 Samsung Electronics Co., Ltd All Rights Reserved 
3  *
4  * PROPRIETARY/CONFIDENTIAL
5  *
6  * This software is the confidential and proprietary information of SAMSUNG
7  * ELECTRONICS ("Confidential Information"). You agree and acknowledge that this
8  * software is owned by Samsung and you shall not disclose such Confidential
9  * Information and shall use it only in accordance with the terms of the license
10  * agreement you entered into with SAMSUNG ELECTRONICS. SAMSUNG make no
11  * representations or warranties about the suitability of the software, either
12  * express or implied, including but not limited to the implied warranties of
13  * merchantability, fitness for a particular purpose, or non-infringement.
14  * SAMSUNG shall not be liable for any damages suffered by licensee arising out
15  * of or releated to this software.
16  *
17  */
18
19 /*
20  * vim:ts=3
21 */
22
23 #include "genlist_macro.edc"
24 #include "genlist_textblock_style.edc"
25
26 #include "genlist_normal.edc"
27 #include "genlist_sweep.edc"
28 #include "genlist_group_index.edc"
29 #include "genlist_expandable.edc"
30 #include "genlist_decorate.edc"
31 #include "../scroller.edc"
32
33    group { name: "elm/genlist/base/dialogue";
34       inherit: "elm/scroller/base/default";
35          script {
36          public sbvis_v, sbvis_h, sbalways_v, sbalways_h, sbvis_timer;
37          public timer0(val) {
38             new v;
39             v = get_int(sbvis_v);
40             if (v) {
41                v = get_int(sbalways_v);
42                if (!v) {
43                   emit("do-hide-vbar", "");
44                   set_int(sbvis_v, 0);
45                }
46             }
47             v = get_int(sbvis_h);
48             if (v) {
49                v = get_int(sbalways_h);
50                if (!v) {
51                   emit("do-hide-hbar", "");
52                   set_int(sbvis_h, 0);
53                }
54             }
55             set_int(sbvis_timer, 0);
56             return 0;
57          }
58       }
59       parts {
60          part { name: "elm.padding.left";
61             type: RECT;
62             scale: 1;
63             description { state: "default" 0.0;
64                min: GENLIST_PADDING_16_INC 0;
65                fixed: 1 0;
66                visible: 0;
67                align: 0.0 0.0;
68                rel2.relative: 0.0  1.0;
69                color: GENLIST_PART_BG_COLOR_INC;
70             }
71          }
72          part { name: "elm.padding.right";
73             type: RECT;
74             scale: 1;
75             description { state: "default" 0.0;
76                min: GENLIST_PADDING_16_INC 0;
77                fixed: 1 0;
78                visible: 0;
79                align: 1.0 0.0;
80                rel1.relative: 1.0  0.0;
81                color: GENLIST_PART_BG_COLOR_INC;
82             }
83          }
84          part { name: "bg";
85             type: RECT;
86             scale: 1;
87             description { state: "default" 0.0;
88                rel1 {
89                   relative: 1.0 0.0;
90                   to_x: "elm.padding.left";
91                }
92                rel2 {
93                   relative: 0.0 1.0;
94                   to_x: "elm.padding.right";
95                }
96                color: 0 0 0 0;
97             }
98          }
99       }
100    }
101
102    group { name: "elm/list/base/matchlist";
103       script {
104          public sbvis_v, sbvis_h, sbnever_v, sbalways_v, sbalways_h, sbvis_timer;
105          public timer0(val) {
106             new v;
107             v = get_int(sbvis_v);
108             if (v) {
109                v = get_int(sbalways_v);
110                if (!v) {
111                   emit("do-hide-vbar", "");
112                   set_int(sbvis_v, 0);
113                }
114             }
115             v = get_int(sbvis_h);
116             if (v) {
117                v = get_int(sbalways_h);
118                if (!v) {
119                   emit("do-hide-hbar", "");
120                   set_int(sbvis_h, 0);
121                }
122             }
123             set_int(sbvis_timer, 0);
124             return 0;
125          }
126       }
127       images {
128                   image: "00_scroll_bar.png" COMP;
129                   image: "bt_sm_shine.png" COMP;
130                   image: "bt_sm_hilight.png" COMP;
131                   image: "sb_runnerh.png" COMP;
132                   image: "sb_runnerv.png" COMP;
133          image: "01_dialoguegroup_bg_default.png" COMP;
134       }
135       parts {
136          part { name: "bg";
137             type: RECT;
138             scale: 1;
139             description { state: "default" 0.0;
140                rel1.offset: 0 0;
141                rel2.offset: -1 -1;
142                color: 255 255 255 0;
143             }
144          }
145          part { name: "bg_image";
146             mouse_events: 0;
147             scale: 1;
148             description { state: "default" 0.0;
149                rel1.to: "bg";
150                rel2.to: "bg";
151                rel1.offset: -5 -3;
152                rel2.offset: 4 10;
153                image {
154                   normal: "01_dialoguegroup_bg_default.png";
155                   border: 13 13 10 15;
156                   border_scale: 1;
157                }
158                fill.smooth: 0;
159             }
160          }
161          part { name: "clipper";
162             type: RECT;
163             mouse_events: 0;
164             scale: 1;
165             description { state: "default" 0.0;
166                rel1.to: "bg";
167                rel2.to: "bg";
168             }
169          }
170          part { name: "elm.swallow.content";
171             clip_to: "clipper";
172             type: SWALLOW;
173             scale: 1;
174             description { state: "default" 0.0;
175                rel1.offset: 0 0;
176                rel2.offset: -1 -1;
177             }
178          }
179          part { name: "conf_over";
180             mouse_events: 0;
181             scale: 1;
182             description { state: "default" 0.0;
183                rel1.offset: 0 0;
184                rel2.offset: -1 -1;
185                visible: 0;
186             }
187          }
188          part { name: "sb_vbar_clip_master";
189             type: RECT;
190             mouse_events: 0;
191             scale: 1;
192             description { state: "default" 0.0;
193             }
194             description { state: "hidden" 0.0;
195                visible: 0;
196                color: 255 255 255 0;
197             }
198          }
199          part { name: "sb_vbar_clip";
200             clip_to: "sb_vbar_clip_master";
201             type: RECT;
202             mouse_events: 0;
203             scale: 1;
204             description { state: "default" 0.0;
205             }
206             description { state: "hidden" 0.0;
207                visible: 0;
208                color: 255 255 255 0;
209             }
210          }
211          part { name: "sb_vbar";
212             type: RECT;
213             mouse_events: 0;
214             scale: 1;
215             description { state: "default" 0.0;
216                fixed: 1 1;
217                visible: 0;
218                min: 8 8;
219                align: 1.0 0.0;
220                rel1 {
221                   relative: 1.0 0.0;
222                   offset: -1 0;
223                }
224                rel2 {
225                   relative: 1.0 0.0;
226                   offset: -1 -1;
227                   to_y: "sb_hbar";
228                }
229             }
230          }
231          part { name: "sb_vbar_runner";
232             clip_to: "sb_vbar_clip";
233             mouse_events: 0;
234             scale: 1;
235             description { state: "default" 0.0;
236                min: 8 8;
237                max: 8 99999;
238                rel1.to: "sb_vbar";
239                rel2.to: "sb_vbar";
240                visible: 0;
241                image {
242                   normal: "sb_runnerv.png";
243                   border: 0 0 4 4;
244                   border_scale: 1;
245                }
246                fill.smooth: 0;
247             }
248          }
249          part { name: "elm.dragable.vbar";
250             clip_to: "sb_vbar_clip";
251             mouse_events: 0;
252             scale: 1;
253             dragable {
254                x: 0 0 0;
255                y: 1 1 0;
256                confine: "sb_vbar";
257             }
258             description { state: "default" 0.0;
259                fixed: 1 1;
260                min: 8 8;
261                rel1 {
262                   relative: 0.5  0.5;
263                   offset:   0    0;
264                   to: "sb_vbar";
265                }
266                rel2 {
267                   relative: 0.5  0.5;
268                   offset:   0    0;
269                   to: "sb_vbar";
270                }
271                image {
272                                    normal: "00_scroll_bar.png";
273                                    border: 2 2 2 2;
274                                    border_scale: 1;
275                                    middle: DEFAULT;
276                }
277             }
278          }
279          part { name: "sb_vbar_over1";
280             clip_to: "sb_vbar_clip";
281             mouse_events: 0;
282             scale: 1;
283             description { state: "default" 0.0;
284                rel1.to: "elm.dragable.vbar";
285                rel2.relative: 1.0 0.5;
286                rel2.to: "elm.dragable.vbar";
287                visible: 0;
288                image {
289                   normal: "bt_sm_hilight.png";
290                   border: 6 6 6 0;
291                   border_scale: 1;
292                }
293             }
294          }
295          part { name: "sb_vbar_over2";
296             clip_to: "sb_vbar_clip";
297             mouse_events: 0;
298             scale: 1;
299             description { state: "default" 0.0;
300                rel1.to: "elm.dragable.vbar";
301                rel2.to: "elm.dragable.vbar";
302                visible: 0;
303                image {
304                   normal: "bt_sm_shine.png";
305                   border: 6 6 6 0;
306                   border_scale: 1;
307                }
308             }
309          }
310          part { name: "sb_hbar_clip_master";
311             type: RECT;
312             mouse_events: 0;
313             description { state: "default" 0.0;
314             }
315             description { state: "hidden" 0.0;
316                visible: 0;
317                color: 255 255 255 0;
318             }
319          }
320          part { name: "sb_hbar_clip";
321             clip_to: "sb_hbar_clip_master";
322             type: RECT;
323             mouse_events: 0;
324             scale: 1;
325             description { state: "default" 0.0;
326             }
327             description { state: "hidden" 0.0;
328                visible: 0;
329                color: 255 255 255 0;
330             }
331          }
332          part { name: "sb_hbar";
333             type: RECT;
334             mouse_events: 0;
335             scale: 1;
336             description { state: "default" 0.0;
337                fixed: 1 1;
338                visible: 0;
339                min: 50 8;
340                align: 0.0 1.0;
341                rel1 {
342                   relative: 0.0 1.0;
343                   offset: 0 -1;
344                }
345                rel2 {
346                   relative: 0.0 1.0;
347                   offset: -1 -1;
348                   to_x: "sb_vbar";
349                }
350             }
351          }
352          part { name: "sb_hbar_runner";
353             clip_to: "sb_hbar_clip";
354             mouse_events: 0;
355             scale: 1;
356             description { state: "default" 0.0;
357                min: 50 8;
358                max: 99999 8;
359                rel1.to: "sb_hbar";
360                rel2.to: "sb_hbar";
361                visible: 0;
362                image {
363                   normal: "sb_runnerh.png";
364                   border: 4 4 0 0;
365                   border_scale: 1;
366                }
367                fill.smooth: 0;
368             }
369          }
370          part { name: "elm.dragable.hbar";
371             clip_to: "sb_hbar_clip";
372             mouse_events: 0;
373             scale: 1;
374             dragable {
375                x: 1 1 0;
376                y: 0 0 0;
377                confine: "sb_hbar";
378             }
379             description { state: "default" 0.0;
380                fixed: 1 1;
381                min: 50 8;
382                rel1 {
383                   relative: 0.5  0.5;
384                   offset: 0 0;
385                   to: "sb_hbar";
386                }
387                rel2 {
388                   relative: 0.5  0.5;
389                   offset: 0 0;
390                   to: "sb_hbar";
391                }
392                color: 255 255 255 0;
393                image {
394                                    normal: "00_scroll_bar.png";
395                                    border: 2 2 2 2;
396                                    border_scale: 1;
397                }
398                image.middle: SOLID;
399             }
400          }
401          part { name: "sb_hbar_over1";
402             clip_to: "sb_hbar_clip";
403             mouse_events: 0;
404             scale: 1;
405             description { state: "default" 0.0;
406                rel1.to: "elm.dragable.hbar";
407                rel2.relative: 1.0 0.5;
408                rel2.to: "elm.dragable.hbar";
409                visible: 0;
410                image {
411                   normal: "bt_sm_hilight.png";
412                   border: 6 6 6 0;
413                   border_scale: 1;
414                }
415             }
416          }
417          part { name: "sb_hbar_over2";
418             clip_to: "sb_hbar_clip";
419             mouse_events: 0;
420             scale: 1;
421             description { state: "default" 0.0;
422                rel1.to: "elm.dragable.hbar";
423                rel2.to: "elm.dragable.hbar";
424                visible: 0;
425                image {
426                   normal: "bt_sm_shine.png";
427                   border: 6 6 6 0;
428                   border_scale: 1;
429                }
430             }
431          }
432       }
433       programs {
434          program { name: "load";
435             signal: "load";
436             source: "";
437             script {
438                set_state(PART:"sb_hbar_clip", "hidden", 0.0);
439                set_state(PART:"sb_vbar_clip", "hidden", 0.0);
440                set_int(sbvis_h, 0);
441                set_int(sbvis_v, 0);
442                set_int(sbalways_v, 0);
443                set_int(sbalways_h, 0);
444                set_int(sbvis_timer, 0);
445                set_int(sbnever_v, 0);
446             }
447          }
448          program { name: "vbar_show";
449             signal: "elm,action,show,vbar";
450             source: "elm";
451             action: STATE_SET "default" 0.0;
452             target: "sb_vbar_clip_master";
453          }
454          program { name: "vbar_hide";
455             signal: "elm,action,hide,vbar";
456             source: "elm";
457             action: STATE_SET "hidden" 0.0;
458             target: "sb_vbar_clip_master";
459          }
460          program { name: "vbar_show_always";
461             signal: "elm,action,show_always,vbar";
462             source: "elm";
463             script {
464                new v;
465                v = get_int(sbvis_v);
466                v |= get_int(sbalways_v);
467                if (!v) {
468                   set_int(sbalways_v, 1);
469                   emit("do-show-vbar", "");
470                   set_int(sbvis_v, 1);
471                }
472                set_int(sbnever_v, 0);
473             }
474          }
475          program { name: "vbar_show_notalways";
476             signal: "elm,action,show_notalways,vbar";
477             source: "elm";
478             script {
479                new v;
480                v = get_int(sbalways_v);
481                if (v) {
482                   set_int(sbalways_v, 0);
483                   v = get_int(sbvis_v);
484                   if (!v) {
485                      emit("do-hide-vbar", "");
486                      set_int(sbvis_v, 0);
487                   }
488                }
489                set_int(sbnever_v, 0);
490             }
491          }
492          program { name: "vbar_hide_always";
493             signal: "elm,action,hide_always,vbar";
494             source: "elm";
495             script {
496                new v1, v2;
497                v1 = get_int(sbnever_v);
498                if (!v1) {
499                   set_int(sbnever_v, 1);
500                   set_int(sbalways_v, 0);
501                   v2 = get_int(sbvis_v);
502                   if (!v2) {
503                      emit("do-hide-vbar", "");
504                      set_int(sbvis_v, 0);
505                   }
506                }
507             }
508          }
509          program { name: "sb_vbar_show";
510             signal: "do-show-vbar";
511             source: "";
512             action: STATE_SET "default" 0.0;
513             transition: LINEAR 1.0;
514             target: "sb_vbar_clip";
515          }
516          program { name: "sb_vbar_hide";
517             signal: "do-hide-vbar";
518             source: "";
519             action: STATE_SET "hidden" 0.0;
520             transition: LINEAR 1.0;
521             target: "sb_vbar_clip";
522          }
523          program { name: "hbar_show";
524             signal: "elm,action,show,hbar";
525             source: "elm";
526             action: STATE_SET "default" 0.0;
527             target: "sb_hbar_clip_master";
528          }
529          program { name: "hbar_hide";
530             signal: "elm,action,hide,hbar";
531             source: "elm";
532             action:  STATE_SET "hidden" 0.0;
533             target: "sb_hbar_clip_master";
534          }
535          program { name: "hbar_show_always";
536             signal: "elm,action,show_always,hbar";
537             source: "elm";
538             script {
539                new v;
540                v = get_int(sbvis_h);
541                v |= get_int(sbalways_h);
542                if (!v) {
543                   set_int(sbalways_h, 1);
544                   emit("do-show-hbar", "");
545                   set_int(sbvis_h, 1);
546                }
547             }
548          }
549          program { name: "hbar_show_notalways";
550             signal: "elm,action,show_notalways,hbar";
551             source: "elm";
552             script {
553                new v;
554                v = get_int(sbalways_h);
555                if (v) {
556                   set_int(sbalways_h, 0);
557                   v = get_int(sbvis_h);
558                   if (!v) {
559                      emit("do-hide-hbar", "");
560                      set_int(sbvis_h, 0);
561                   }
562                }
563             }
564          }
565          program { name: "sb_hbar_show";
566             signal: "do-show-hbar";
567             source: "";
568             action: STATE_SET "default" 0.0;
569             transition: LINEAR 1.0;
570             target: "sb_hbar_clip";
571          }
572          program { name: "sb_hbar_hide";
573             signal: "do-hide-hbar";
574             source: "";
575             action: STATE_SET "hidden" 0.0;
576             transition: LINEAR 1.0;
577             target: "sb_hbar_clip";
578          }
579          program { name: "scroll";
580             signal: "elm,action,scroll";
581             source: "elm";
582             action:  STATE_SET "default" 0.0;
583             script {
584                new v, v1;
585                v = get_int(sbvis_v);
586                v |= get_int(sbalways_v);
587                v1 = get_int(sbnever_v);
588                if (!v && !v1) {
589                   emit("do-show-vbar", "");
590                   set_int(sbvis_v, 1);
591                }
592                v = get_int(sbvis_h);
593                v |= get_int(sbalways_h);
594                if (!v) {
595                   emit("do-show-hbar", "");
596                   set_int(sbvis_h, 1);
597                }
598                v = get_int(sbvis_timer);
599                if (v > 0) cancel_timer(v);
600                v = timer(0.5, "timer0", 0);
601                set_int(sbvis_timer, v);
602             }
603          }
604       }
605    }
606
607