Tizen release 1.0
[apps/core/preloaded/video-player.git] / res / edc / option_button.edc
1 /*
2  * Copyright   2000 - 2012 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * This file is part of org.tizen.video-player
5  * Written by  JongDong Lee <jongdong.lee@samsung.com>, ChangSun Lee <cs78.lee@samsung.com>
6  *
7  * PROPRIETARY/CONFIDENTIAL
8  *
9  * This software is the confidential and proprietary information of SAMSUNG ELECTRONICS ("Confidential Information").
10  * You shall not disclose such Confidential Information and shall
11  * use it only in accordance with the terms of the license agreement you entered into with SAMSUNG ELECTRONICS.
12  * SAMSUNG make no representations or warranties about the suitability
13  * of the software, either express or implied, including but not
14  * limited to the implied warranties of merchantability, fitness for a particular purpose, or non-infringement.
15  * SAMSUNG shall not be liable for any damages suffered by licensee as
16  * a result of using, modifying or distributing this software or its derivatives.
17  *
18  */
19
20
21 #include "image_res.edc"
22 #include "vp_font.edc"
23
24 #define CONTROL_BUTTON_PRESS_PART(_name_ , _w_ , _h_ , _align_x_ , _align_y_ , _rel_x1_ , _rel_x2_ , _rel_y1_, _rel_y2_ , _img_def_ , _img_press_ )     \
25 part {                                                                                                          \
26         name: _name_;                                                                                   \
27         type: IMAGE;                                                                                            \
28         scale: 1;                                                                                                       \
29         mouse_events: 1;                                                                                        \
30         description {                                                                                           \
31                 state: "default" 0.0;                                                                   \
32                 min: _w_ _h_;                                                                                   \
33                 fixed: 1 1;                                                                                     \
34                 visible: 0;                                                                                             \
35                 align: _align_x_ _align_y_;                                                             \
36                 rel1 { relative: _rel_x1_ _rel_y1_; }                                                   \
37                 rel2 { relative: _rel_x2_ _rel_y2_; }                                                   \
38                 image { normal: _img_def_; border: 4 4 0 0;}                            \
39                 color: 255 255 255 255;                                                                 \
40         }                                                                                                               \
41         description {                                                                                           \
42                 state: "pressed" 0.0;                                                                   \
43                 visible: 1;                                                                                             \
44                 min: _w_ _h_;                                                                                   \
45                 fixed: 1 1;                                                                                     \
46                 align: _align_x_ _align_y_;                                                             \
47                 rel1 { relative: _rel_x1_ _rel_y1_; }                                                   \
48                 rel2 { relative: _rel_x2_ _rel_y2_; }                                                   \
49                 image { normal: _img_press_; border: 4 4 0 0;}                  \
50                 color: 255 255 255 255;                                                                 \
51         }                                                                                                               \
52         description {                                                                                           \
53                 state: "hide" 0.0;                                                                              \
54                 inherit: "default" 0.0;                                                                         \
55                 visible: 0;                                                                                     \
56         }                                                                                                               \
57 }       /* CONTROL_BUTTON_PRESS_PART */
58
59
60 #define CONTROL_BUTTON_PROG(_item_name_)                                        \
61 program {                                                                                                       \
62         name: _item_name_".pressed";                                                            \
63         source: _item_name_;                                                                            \
64         signal: "mouse,down,1";                                                                         \
65         action: STATE_SET "pressed" 0.0;                                                        \
66         target: _item_name_;                                                                            \
67         after: "send."_item_name_".down.signal";                                                \
68 }                                                                                                                       \
69 program {                                                                                                       \
70         name: _item_name_".clicked";                                                            \
71         source: _item_name_;                                                                            \
72         signal: "mouse,up,1";                                                                           \
73         action: STATE_SET "default" 0.0;                                                                \
74         target: _item_name_;                                                                            \
75         after: "send."_item_name_".up.signal";                                          \
76 }                                                                                                                       \
77 program {                                                                                                       \
78         name: "send."_item_name_".down.signal";                                                 \
79         action: SIGNAL_EMIT "signal."_item_name_".down" _item_name_;    \
80 }                                                                                                                       \
81 program {                                                                                                       \
82         name: "send."_item_name_".up.signal";                                           \
83         action: SIGNAL_EMIT "signal."_item_name_".up" _item_name_;      \
84 } /* CONTROL_BUTTON_PROG */
85
86
87 collections {
88         group {
89                 name: "option";
90
91                 script {
92                         public val_screensize_check = 0;        /* 0: reduce, 1: full */
93
94                         public change_screensize() {
95                                 if(get_int(val_screensize_check) == 0) {
96                                         set_int(val_screensize_check, 1);
97                                         set_state(PART:"option.screensize", "reduce", 0.0);
98                                         run_program(PROGRAM:"send.screensize.expand");
99                                 } else {
100                                         set_int(val_screensize_check, 0);
101                                         set_state(PART:"option.screensize", "default", 0.0);
102                                         run_program(PROGRAM:"send.screensize.normal");
103                                 }
104                         }
105
106                 }
107
108                 parts {
109                         part {
110                                 name: "option.rect";
111                                 type: RECT;
112                                 mouse_events: 0;
113                                 scale: 1;
114                                 description {
115                                         state: "default" 0.0;
116                                         rel1 { relative: 0.0 0.0;}
117                                         rel2 { relative: 1.0 1.0;}
118                                         color: 255 255 255 0;
119                                 }
120                         }
121
122                         CONTROL_BUTTON_PRESS_PART("option.screensize.button.bg", 74 ,74, 0.0, 0.0, 0.05, 0.05, 0.114, 0.114, "T01_controller_btn.png" , "T01_controller_btn_press.png");
123                         part {
124                                 name: "option.screensize";
125                                 type: IMAGE;
126                                 mouse_events: 1;
127                                 scale: 1;
128                                 description {
129                                         state: "default" 0.0;
130                                         visible: 1;
131                                         min: 74 74;
132                                         fixed: 1 1;
133                                         align: 0.0 0.0;
134                                         rel1 { relative: 0.05 0.114; }
135                                         rel2 { relative: 0.05 0.114; }
136                                         image { normal: "T01_control_icon_fullscreen.png"; }
137                                         color: 255 255 255 255;
138                                 }
139                                 description {
140                                         state: "reduce" 0.0;
141                                         inherit: "default" 0.0;
142                                         visible: 1;
143                                         image { normal: "T01_control_icon_reduce.png"; }
144                                 }
145                                 description {
146                                         state: "hide" 0.0;
147                                         inherit: "default" 0.0;
148                                         visible: 0;
149                                 }
150                         }
151
152                         CONTROL_BUTTON_PRESS_PART("option.detail.button.bg", 74 ,74, 1.0, 0.0, 0.95, 0.95, 0.114, 0.114, "T01_controller_btn.png" , "T01_controller_btn_press.png");
153                         part {
154                                 name: "option.detail";
155                                 type: IMAGE;
156                                 mouse_events: 1;
157                                 scale: 1;
158                                 description {
159                                         state: "default" 0.0;
160                                         visible: 1;
161                                         min: 74 74;
162                                         fixed: 1 1;
163                                         align: 1.0 0.0;
164                                         rel1 { relative: 0.95 0.114; }
165                                         rel2 { relative: 0.95 0.114; }
166                                         image { normal: "T01_control_icon_detail.png"; }
167                                         color: 255 255 255 255;
168                                 }
169                                 description {
170                                         state: "hide" 0.0;
171                                         inherit: "default" 0.0;
172                                         visible: 0;
173                                 }
174                         }
175
176                         programs {
177                                 CONTROL_BUTTON_PROG("option.screensize");
178                                 CONTROL_BUTTON_PROG("option.detail");
179
180                                 program {
181                                         signal: "signal.option.screensize.down";
182                                         source: "*";
183                                         action: STATE_SET "pressed" 0.0;
184                                         target: "option.screensize.button.bg";
185                                 }
186
187                                 program {
188                                         signal: "signal.option.screensize.up";
189                                         source: "*";
190                                         action: STATE_SET "hide" 0.0;
191                                         target: "option.screensize.button.bg";
192                                         after: "option.screensize.change";
193                                 }
194
195                                 program {
196                                         name: "option.screensize.change";
197                                         script: { change_screensize(); }
198                                 }
199
200                                 program {
201                                         name: "send.screensize.normal";
202                                         action: SIGNAL_EMIT "signal.option.screensize.normal" "option.screensize";
203                                 }
204
205                                 program {
206                                         name: "send.screensize.expand";
207                                         action: SIGNAL_EMIT "signal.option.screensize.expand" "option.screensize";
208                                 }
209
210                                 program {
211                                         signal: "signal.option.detail.down";
212                                         source: "*";
213                                         action: STATE_SET "pressed" 0.0;
214                                         target: "option.detail.button.bg";
215                                 }
216
217                                 program {
218                                         signal: "signal.option.detail.up";
219                                         source: "*";
220                                         action: STATE_SET "hide" 0.0;
221                                         target: "option.detail.button.bg";
222                                 }
223
224                                 program {
225                                         signal: "signal.option.mode.streaming";
226                                         source: "*";
227                                         action: STATE_SET "hide" 0.0;
228                                         target: "option.detail";
229                                         target: "option.detail.button.bg";
230                                 }
231                         } //programs
232                 } //parts
233         } //group
234 } //collections