[Initialize] nBeat theme initialization.
[platform/core/uifw/efl-theme-tizen.git] / themes / groups / slidingdrawer.edc
1 /*
2  *  nBeat-theme
3  *
4  * Copyright (c) 2000 - 2010 Samsung Electronics Co., Ltd.
5  *
6  * Contact: Seokjae Jeong <seok.j.jeong@samsung.com>, Myoungwoon Roy Kim <Myoungwoon.kim@samsung.com>, Jeonghyun Yun <jh0506.yun@samsung.com>, Jaehwan Kim <jae.hwan.kim@samsung.com>, 
7  *              Chuneon Park <chuneon.park@samsung.com>, Juyung Seo <juyung.seo@samsung.com>, Woohyun Jung <wh0705.jung@samsung.com>, Myungjae Lee <mjae.lee@samsung.com>, Hyoyoung Chang <hyoyoung.chang@samsung.com>, 
8  *              Hyunsil Park <hyunsil.park@samsung.com>, Sohyun Kim <anna1014.kim@samsung.com>, Seunggyun Kim <sgyun.kim@samsung.com>
9  * 
10  * This library is free software; you can redistribute it and/or modify it under
11  * the terms of the GNU Lesser General Public License as published by the
12  * Free Software Foundation; either version 2.1 of the License, or (at your option)
13  * any later version.
14  * 
15  * This library is distributed in the hope that it will be useful, but WITHOUT ANY
16  * WARRANTY; without even the implied warranty of MERCHANTABILITY or
17  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
18  * License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * along with this library; if not, write to the Free Software Foundation, Inc., 51
22  * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23  *
24  */
25
26 #define SLIDINGDRAWER_BG_COLOR 246 245 237 255 
27 #define SLIDINGDRAWER_HANDLER_WIDTH 53
28 #define SLIDINGDRAWER_HANDLER_HEIGHT 20
29 #define SLIDINGDRAWER_TOPDOWN_HANDLER_HEIGHT 40
30 #define SLIDINGDRAWER_LEFTRIGHT_HANDLER_WIDTH 40
31
32 group {
33         name: "elm/slidingdrawer/bottom/default";
34         images {
35                 image: "slidingdrawer_bottom_handler.png" COMP;
36                 image: "slidingdrawer_bottom_handler_bar.png" COMP;
37         }
38         script {
39                 public g_mouse_state = 0;
40                 public animator_up(val, Float:step) {
41                         new Float:vx;
42                         new Float:vy;
43                         get_drag(PART:"elm.dragable.handler", vx, vy);
44                         vy += step;
45                         if (vy > 1.0)
46                                 vy = 1.0;
47                         set_drag(PART:"elm.dragable.handler", 1.0, vy);
48                 }
49                 public animator_down(val, Float:step) {
50                         new Float:vx;
51                         new Float:vy;
52                         get_drag(PART:"elm.dragable.handler", vx, vy);
53                         vy -= step;
54                         if (vy < 0.0)
55                                 vy = 0.0;
56                         set_drag(PART:"elm.dragable.handler", 1.0, vy);
57                 }
58         }       
59         parts {         
60                 part {
61                         name: "elm.swallow.dragable_rect";
62                         type: SWALLOW;
63                         mouse_events: 0;
64                         description {
65                                 visible: 0;
66                                 align: 0 1;
67                         }
68                 }
69                 part {
70                         name: "content_bg";
71                         type: RECT;
72                         mouse_events: 0;
73                         description {
74                                 rel1 {to:"elm.swallow.content";}
75                                 rel2 {to:"elm.swallow.content";}
76                                 color: SLIDINGDRAWER_BG_COLOR;
77                         }
78                 }
79                 part {
80                         name: "elm.swallow.content";
81                         type: SWALLOW;
82                         mouse_events: 1;
83                         description {
84                                 rel1 {to: "elm.dragable.handler"; relative: 0 1;}                               
85                         }
86                 }
87                 part {
88                         name: "handler_bar";
89                         type: IMAGE;
90                         scale: 1;
91                         description {
92                                 fixed: 0 1;
93                                 rel1 {to: "elm.dragable.handler";}
94                                 rel2 {to: "elm.dragable.handler";}
95                                 image {
96                                         normal: "slidingdrawer_bottom_handler_bar.png";
97                                 }                       
98                         }
99                 }
100                 part {
101                         name: "elm.dragable.handler";
102                         type: SWALLOW;
103                         mouse_events: 1;
104                         scale: 1;
105                         dragable {
106                                 confine: "elm.swallow.dragable_rect";
107                                 x: 0 0 0;
108                                 y: -1 1 1;
109                         } 
110                         description {
111                                 min: 1 SLIDINGDRAWER_TOPDOWN_HANDLER_HEIGHT;
112                                 fixed: 0 1;
113                                 align: 0 0;
114                                 rel1 {relative: 0 0; to: "elm.swallow.dragable_rect";}
115                                 rel2 {relative: 1 0; to: "elm.swallow.dragable_rect";}
116                         }
117                 }               
118                 part {
119                         name: "elm.image.handler";
120                         type: IMAGE;
121                         mouse_events: 0;
122                         scale: 1;
123                         description {
124                                 min: SLIDINGDRAWER_HANDLER_WIDTH SLIDINGDRAWER_HANDLER_HEIGHT;
125                                 max: SLIDINGDRAWER_HANDLER_WIDTH SLIDINGDRAWER_HANDLER_HEIGHT;
126                                 fixed: 1 1;
127                                 align: 0.5 0.5;
128                                 image {
129                                         normal: "slidingdrawer_bottom_handler.png";
130                                 }
131                                 rel1 {to:"elm.dragable.handler";}
132                                 rel2 {to:"elm.dragable.handler";} 
133                         }                       
134                 }
135         }
136         programs {
137                 program { 
138                         name: "drag_handler"; 
139                         signal: "drag"; 
140                         source: "elm.dragable.handler";
141                         script { 
142                                 set_int (g_mouse_state, 1);
143                         }
144                 }
145                 program { 
146                         name: "down_handler"; 
147                         signal: "mouse,down,*"; 
148                         source: "elm.dragable.handler"; 
149                         script { 
150                                 set_int (g_mouse_state, 0);
151                         } 
152                 }
153                 program { 
154                         name: "handler_clicked"; 
155                         signal: "mouse,clicked,1"; 
156                         source: "elm.dragable.handler"; 
157                         script { 
158                                 new Float:x;
159                                 new Float:y;
160                                 if (get_int(g_mouse_state) == 0) {
161                                         emit("animation_start", "elm.dragable.handler");
162                                         get_drag(PART:"elm.dragable.handler", x, y);
163                                         if (y == 0) {
164                                                 anim(1, "animator_up", 1);
165                                         }
166                                         else if( y == 1 ){
167                                                 anim(1, "animator_down", 1);
168                                         }
169                                 }
170                         } 
171                 } 
172         } 
173 }
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218 group {
219         name: "elm/slidingdrawer/left/default";
220         images {
221                 image: "slidingdrawer_left_handler.png" COMP;
222                 image: "slidingdrawer_left_handler_bar.png" COMP;
223         }
224         script {
225                 public g_mouse_state = 0;
226                 public animator_right(val, Float:step) {
227                         new Float:vx;
228                         new Float:vy;
229                         get_drag(PART:"elm.dragable.handler", vx, vy);
230                         vx += step;
231                         if (vx > 1.0)
232                                 vx = 1.0;
233                         set_drag(PART:"elm.dragable.handler", vx, 1.0);
234                 }
235                 public animator_left(val, Float:step) {
236                         new Float:vx;
237                         new Float:vy;
238                         get_drag(PART:"elm.dragable.handler", vx, vy);
239                         vx -= step;
240                         if (vx < 0.0)
241                                 vx = 0.0;
242                         set_drag(PART:"elm.dragable.handler", vx, 1.0);
243                 }
244         }
245         parts {         
246                 part {
247                         name: "elm.swallow.dragable_rect";
248                         type: SWALLOW;
249                         mouse_events: 0;
250                         description {
251                                 visible: 0;
252                                 align: 0 0;
253                         }
254                 }
255                 part {
256                         name: "content_bg";
257                         type: RECT;
258                         mouse_events: 0;
259                         description {
260                                 rel1 {to:"elm.swallow.content";}
261                                 rel2 {to:"elm.swallow.content";}
262                                 color: SLIDINGDRAWER_BG_COLOR;
263                         }
264                 }                       
265                 part {
266                         name: "elm.swallow.content";
267                         type: SWALLOW;
268                         mouse_events: 1;
269                         description {
270                                 rel2 {to: "elm.dragable.handler"; relative: 0 1;}
271                         }
272                 }
273                 part {
274                         name: "handler_bar";
275                         type: IMAGE;
276                         scale: 1;
277                         description {
278                                 fixed: 0 1;
279                                 rel1 {to: "elm.dragable.handler";}
280                                 rel2 {to: "elm.dragable.handler";}
281                                 image {
282                                         normal: "slidingdrawer_left_handler_bar.png";
283                                 }                       
284                         }
285                 }               
286                 part {
287                         name: "elm.dragable.handler";
288                         type: SWALLOW;
289                         mouse_events: 1;
290                         scale: 1;
291                         dragable {
292                                 confine: "elm.swallow.dragable_rect";
293                                 x: 1 1 1;
294                                 y: 0 0 0;
295                         }  
296                         description {
297                                 min: SLIDINGDRAWER_LEFTRIGHT_HANDLER_WIDTH 1;
298                                 fixed: 1 0;
299                                 align: 0 0.5;
300                                 rel1 {relative: 1 0; to: "elm.swallow.dragable_rect";}
301                                 rel2 {relative: 1 1; to: "elm.swallow.dragable_rect";}                          
302                         }
303                 }                               
304                 part {
305                         name: "elm.image.handler";
306                         type: IMAGE;
307                         mouse_events: 0;
308                         scale: 1;
309                         description {
310                                 min: SLIDINGDRAWER_HANDLER_HEIGHT SLIDINGDRAWER_HANDLER_WIDTH;
311                                 max: SLIDINGDRAWER_HANDLER_HEIGHT SLIDINGDRAWER_HANDLER_WIDTH;
312                                 fixed: 1 1;
313                                 align: 0.5 0.5;
314                                 image {
315                                         normal: "slidingdrawer_left_handler.png";
316                                 }
317                                 rel1 {to:"elm.dragable.handler";}
318                                 rel2 {to:"elm.dragable.handler";} 
319                         }                       
320                 }               
321         }
322         programs {
323                 program { 
324                         name: "drag_handler"; 
325                         signal: "drag"; 
326                         source: "elm.dragable.handler";
327                         script { 
328                                 set_int (g_mouse_state, 1);
329                         } 
330                 }
331                 program { 
332                         name: "down_handler"; 
333                         signal: "mouse,down,*"; 
334                         source: "elm.dragable.handler"; 
335                         script { 
336                                 set_int (g_mouse_state, 0);
337                         } 
338                 }       
339                 program { 
340                         name: "handler_clicked"; 
341                         signal: "mouse,clicked,1"; 
342                         source: "elm.dragable.handler"; 
343                         script { 
344                                 new Float:x;
345                                 new Float:y;
346                                 if (get_int(g_mouse_state) == 0) {
347                                         emit("animation_start", "elm.dragable.handler");
348                                         get_drag(PART:"elm.dragable.handler", x, y);
349                                         if (x == 0) {
350                                                 anim(1, "animator_right", 1);
351                                         }
352                                         else if( x == 1 ){
353                                                 anim(1, "animator_left", 1);
354                                         }
355                                 }
356                         } 
357                 } 
358         } 
359 }
360 group { 
361         name: "elm/slidingdrawer/top/default";
362         images {
363                 image: "slidingdrawer_top_handler.png" COMP;
364                 image: "slidingdrawer_top_handler_bar.png" COMP;
365         }
366         script {
367                 public g_mouse_state = 0;
368                 public animator_up(val, Float:step) {
369                         new Float:vx;
370                         new Float:vy;
371                         get_drag(PART:"elm.dragable.handler", vx, vy);
372                         vy += step;
373                         if (vy > 1.0)
374                                 vy = 1.0;
375                         set_drag(PART:"elm.dragable.handler", 1.0, vy);
376                 }
377                 public animator_down(val, Float:step) {
378                         new Float:vx;
379                         new Float:vy;
380                         get_drag(PART:"elm.dragable.handler", vx, vy);
381                         vy -= step;
382                         if (vy < 0.0)
383                                 vy = 0.0;
384                         set_drag(PART:"elm.dragable.handler", 1.0, vy);
385                 } 
386         }               
387         parts {         
388                 part {
389                         name: "elm.swallow.dragable_rect";
390                         type: SWALLOW;
391                         mouse_events: 0;
392                         description {
393                                 visible: 0;
394                                 align: 0 0;
395                         }
396                 }
397                 part {
398                         name: "content_bg";
399                         type: RECT;
400                         mouse_events: 0;
401                         description {
402                                 rel1 {to:"elm.swallow.content";}
403                                 rel2 {to:"elm.swallow.content";}
404                                 color: SLIDINGDRAWER_BG_COLOR;
405                         }
406                 }               
407                 part {
408                         name: "elm.swallow.content";
409                         type: SWALLOW;
410                         mouse_events: 1;
411                         description {
412                                 rel2 {to: "elm.dragable.handler"; relative: 1 0;}
413                         }
414                 }
415                 part {
416                         name: "handler_bar";
417                         type: IMAGE;
418                         scale: 1;
419                         description {
420                                 fixed: 0 1;
421                                 rel1 {to: "elm.dragable.handler";}
422                                 rel2 {to: "elm.dragable.handler";}
423                                 image {
424                                         normal: "slidingdrawer_top_handler_bar.png";
425                                 }                       
426                         }
427                 }               
428                 part {
429                         name: "elm.dragable.handler";
430                         type: SWALLOW;
431                         mouse_events: 1;
432                         scale: 1;
433                         dragable {
434                                 confine: "elm.swallow.dragable_rect";
435                                 x: 0 0 0;
436                                 y: 1 1 1;
437                         }  
438                         description {
439                                 min: 1 SLIDINGDRAWER_TOPDOWN_HANDLER_HEIGHT;
440                                 fixed: 0 0;
441                                 align: 0 1;
442                                 rel1 {relative: 0 1; to: "elm.swallow.dragable_rect";}
443                                 rel2 {relative: 1 1; to: "elm.swallow.dragable_rect";}                          
444                         }
445                 }
446                 part {
447                         name: "elm.image.handler";
448                         type: IMAGE;
449                         mouse_events: 0;
450                         scale: 1;
451                         description {
452                                 min: SLIDINGDRAWER_HANDLER_WIDTH SLIDINGDRAWER_HANDLER_HEIGHT;
453                                 max: SLIDINGDRAWER_HANDLER_WIDTH SLIDINGDRAWER_HANDLER_HEIGHT;
454                                 fixed: 1 1;
455                                 align: 0.5 0.5;
456                                 image {
457                                         normal: "slidingdrawer_top_handler.png";
458                                 }
459                                 rel1 {to:"elm.dragable.handler";}
460                                 rel2 {to:"elm.dragable.handler";} 
461                         }                       
462                 }
463         }
464         programs {
465                 program { 
466                         name: "drag_handler"; 
467                         signal: "drag"; 
468                         source: "elm.dragable.handler";
469                         script { 
470                                 set_int (g_mouse_state, 1);
471                         } 
472                 }
473                 program { 
474                         name: "down_handler"; 
475                         signal: "mouse,down,*"; 
476                         source: "elm.dragable.handler"; 
477                         script { 
478                                 set_int (g_mouse_state, 0);
479                         } 
480                 }
481                 program { 
482                         name: "handler_clicked"; 
483                         signal: "mouse,clicked,1"; 
484                         source: "elm.dragable.handler"; 
485                         script { 
486                                 new Float:x;
487                                 new Float:y;
488                                 if (get_int(g_mouse_state) == 0) {
489                                         emit("animation_start", "elm.dragable.handler");
490                                         get_drag(PART:"elm.dragable.handler", x, y);
491                                         if (y == 1) {
492                                                 anim(1, "animator_down", 1);
493                                         }
494                                         else if( y == 0 ){
495                                                 anim(1, "animator_up", 1);
496                                         }
497                                 }
498                         } 
499                 } 
500         } 
501         
502 }
503
504 group {
505         name: "elm/slidingdrawer/right/default";
506         images {
507                 image: "slidingdrawer_right_handler.png" COMP;
508                 image: "slidingdrawer_right_handler_bar.png" COMP;
509         }
510         script {
511                 public g_mouse_state = 0;
512                 public animator_right(val, Float:step) {
513                         new Float:vx;
514                         new Float:vy;
515                         get_drag(PART:"elm.dragable.handler", vx, vy);
516                         vx += step;
517                         if (vx > 1.0)
518                                 vx = 1.0;
519                         set_drag(PART:"elm.dragable.handler", vx, 1.0);
520                 }
521                 public animator_left(val, Float:step) {
522                         new Float:vx;
523                         new Float:vy;
524                         get_drag(PART:"elm.dragable.handler", vx, vy);
525                         vx -= step;
526                         if (vx < 0.0)
527                                 vx = 0.0;
528                         set_drag(PART:"elm.dragable.handler", vx, 1.0);
529                 }
530         }       
531         parts {         
532                 part {
533                         name: "elm.swallow.dragable_rect";
534                         type: SWALLOW;
535                         mouse_events: 0;
536                         description {
537                                 visible: 0;
538                                 align: 1 0;
539                         }
540                 }
541                 part {
542                         name: "content_bg";
543                         type: RECT;
544                         mouse_events: 0;
545                         description {
546                                 rel1 {to:"elm.swallow.content";}
547                                 rel2 {to:"elm.swallow.content";}
548                                 color: SLIDINGDRAWER_BG_COLOR;
549                         }
550                 }               
551                 part {
552                         name: "elm.swallow.content";
553                         type: SWALLOW;
554                         mouse_events: 1;
555                         description {
556                                 rel1 {to: "elm.dragable.handler"; relative: 1 0;}
557                         }
558                 }
559                 part {
560                         name: "handler_bar";
561                         type: IMAGE;
562                         scale: 1;
563                         description {
564                                 fixed: 0 1;
565                                 rel1 {to: "elm.dragable.handler";}
566                                 rel2 {to: "elm.dragable.handler";}
567                                 image {
568                                         normal: "slidingdrawer_right_handler_bar.png";
569                                 }                       
570                         }
571                 }               
572                 part {
573                         name: "elm.dragable.handler";
574                         type: SWALLOW;
575                         mouse_events: 1;
576                         scale: 1;
577                         dragable {
578                                 confine: "elm.swallow.dragable_rect";
579                                 x: -1 1 1;
580                                 y: 0 0 0;
581                         }  
582                         description {
583                                 min: SLIDINGDRAWER_LEFTRIGHT_HANDLER_WIDTH 1;
584                                 fixed: 1 0;
585                                 align: 1 0.5;
586                                 rel1 {relative: 0 0; to: "elm.swallow.dragable_rect";}
587                                 rel2 {relative: 0 1; to: "elm.swallow.dragable_rect";}                          
588                         }
589                 }               
590                 part {
591                         name: "elm.image.handler";
592                         type: IMAGE;
593                         mouse_events: 0;
594                         scale: 1;
595                         description {
596                                 min: SLIDINGDRAWER_HANDLER_HEIGHT SLIDINGDRAWER_HANDLER_WIDTH;
597                                 max: SLIDINGDRAWER_HANDLER_HEIGHT SLIDINGDRAWER_HANDLER_WIDTH;
598                                 fixed: 1 1;
599                                 align: 0.5 0.5;
600                                 image {
601                                         normal: "slidingdrawer_right_handler.png";
602                                 }
603                                 rel1 {to:"elm.dragable.handler";}
604                                 rel2 {to:"elm.dragable.handler";} 
605                         }                       
606                 }               
607         }
608         programs {
609                 program { 
610                         name: "drag_handler"; 
611                         signal: "drag"; 
612                         source: "elm.dragable.handler";
613                         script { 
614                                 set_int (g_mouse_state, 1);
615                         } 
616                 }
617                 program { 
618                         name: "down_handler"; 
619                         signal: "mouse,down,*"; 
620                         source: "elm.dragable.handler"; 
621                         script { 
622                                 set_int (g_mouse_state, 0);
623                         } 
624                 }       
625                 program { 
626                         name: "handler_clicked"; 
627                         signal: "mouse,clicked,1"; 
628                         source: "elm.dragable.handler"; 
629                         script { 
630                                 new Float:x;
631                                 new Float:y;
632                                 if (get_int(g_mouse_state) == 0) {
633                                         emit("animation_start", "elm.dragable.handler");
634                                         get_drag(PART:"elm.dragable.handler", x, y);
635                                         if (x == 0) {
636                                                 anim(1, "animator_right", 1);
637                                         }
638                                         else if( x == 1 ){
639                                                 anim(1, "animator_left", 1);
640                                         }
641                                 }
642                         } 
643                 } 
644         }       
645 }
646