2.0_alpha
[apps/core/preloaded/video-player.git] / res / edc / option_button.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
18 #include "image_res.edc"
19 #include "vp_font.edc"
20
21 #define CONTROL_BUTTON_PRESS_PART(_name_ , _w_ , _h_ , _align_x_ , _align_y_ , _rel_x1_ , _rel_x2_ , _rel_y1_, _rel_y2_ , _img_def_ , _img_press_ )     \
22 part {                                                                                                          \
23         name: _name_;                                                                                   \
24         type: IMAGE;                                                                                            \
25         scale: 1;                                                                                                       \
26         mouse_events: 1;                                                                                        \
27         description {                                                                                           \
28                 state: "default" 0.0;                                                                   \
29                 min: _w_ _h_;                                                                                   \
30                 fixed: 1 1;                                                                                     \
31                 visible: 0;                                                                                             \
32                 align: _align_x_ _align_y_;                                                             \
33                 rel1 { relative: _rel_x1_ _rel_y1_; }                                                   \
34                 rel2 { relative: _rel_x2_ _rel_y2_; }                                                   \
35                 image { normal: _img_def_; border: 4 4 0 0;}                            \
36                 color: 255 255 255 255;                                                                 \
37         }                                                                                                               \
38         description {                                                                                           \
39                 state: "pressed" 0.0;                                                                   \
40                 visible: 1;                                                                                             \
41                 min: _w_ _h_;                                                                                   \
42                 fixed: 1 1;                                                                                     \
43                 align: _align_x_ _align_y_;                                                             \
44                 rel1 { relative: _rel_x1_ _rel_y1_; }                                                   \
45                 rel2 { relative: _rel_x2_ _rel_y2_; }                                                   \
46                 image { normal: _img_press_; border: 4 4 0 0;}                  \
47                 color: 255 255 255 255;                                                                 \
48         }                                                                                                               \
49         description {                                                                                           \
50                 state: "hide" 0.0;                                                                              \
51                 inherit: "default" 0.0;                                                                         \
52                 visible: 0;                                                                                     \
53         }                                                                                                               \
54 }       /* CONTROL_BUTTON_PRESS_PART */
55
56
57 #define CONTROL_BUTTON_PROG(_item_name_)                                        \
58 program {                                                                                                       \
59         name: _item_name_".pressed";                                                            \
60         source: _item_name_;                                                                            \
61         signal: "mouse,down,1";                                                                         \
62         action: STATE_SET "pressed" 0.0;                                                        \
63         target: _item_name_;                                                                            \
64         after: "send."_item_name_".down.signal";                                                \
65 }                                                                                                                       \
66 program {                                                                                                       \
67         name: _item_name_".clicked";                                                            \
68         source: _item_name_;                                                                            \
69         signal: "mouse,up,1";                                                                           \
70         action: STATE_SET "default" 0.0;                                                                \
71         target: _item_name_;                                                                            \
72         after: "send."_item_name_".up.signal";                                          \
73 }                                                                                                                       \
74 program {                                                                                                       \
75         name: "send."_item_name_".down.signal";                                                 \
76         action: SIGNAL_EMIT "signal."_item_name_".down" _item_name_;    \
77 }                                                                                                                       \
78 program {                                                                                                       \
79         name: "send."_item_name_".up.signal";                                           \
80         action: SIGNAL_EMIT "signal."_item_name_".up" _item_name_;      \
81 } /* CONTROL_BUTTON_PROG */
82
83
84 collections {
85         group {
86                 name: "option";
87
88                 script {
89                         public val_screensize_check = 0;        /* 0: reduce, 1: full */
90
91                         public change_screensize() {
92                                 if(get_int(val_screensize_check) == 0) {
93                                         set_int(val_screensize_check, 1);
94                                         set_state(PART:"option.screensize", "reduce", 0.0);
95                                         run_program(PROGRAM:"send.screensize.expand");
96                                 } else {
97                                         set_int(val_screensize_check, 0);
98                                         set_state(PART:"option.screensize", "default", 0.0);
99                                         run_program(PROGRAM:"send.screensize.normal");
100                                 }
101                         }
102
103                 }
104
105                 parts {
106                         part {
107                                 name: "option.rect";
108                                 type: RECT;
109                                 mouse_events: 0;
110                                 scale: 1;
111                                 description {
112                                         state: "default" 0.0;
113                                         rel1 { relative: 0.0 0.0;}
114                                         rel2 { relative: 1.0 1.0;}
115                                         color: 255 255 255 0;
116                                 }
117                         }
118
119                         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");
120                         part {
121                                 name: "option.screensize";
122                                 type: IMAGE;
123                                 mouse_events: 1;
124                                 scale: 1;
125                                 description {
126                                         state: "default" 0.0;
127                                         visible: 1;
128                                         min: 74 74;
129                                         fixed: 1 1;
130                                         align: 0.0 0.0;
131                                         rel1 { relative: 0.05 0.114; }
132                                         rel2 { relative: 0.05 0.114; }
133                                         image { normal: "T01_control_icon_fullscreen.png"; }
134                                         color: 255 255 255 255;
135                                 }
136                                 description {
137                                         state: "reduce" 0.0;
138                                         inherit: "default" 0.0;
139                                         visible: 1;
140                                         image { normal: "T01_control_icon_reduce.png"; }
141                                 }
142                                 description {
143                                         state: "hide" 0.0;
144                                         inherit: "default" 0.0;
145                                         visible: 0;
146                                 }
147                         }
148
149                         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");
150                         part {
151                                 name: "option.detail";
152                                 type: IMAGE;
153                                 mouse_events: 1;
154                                 scale: 1;
155                                 description {
156                                         state: "default" 0.0;
157                                         visible: 1;
158                                         min: 74 74;
159                                         fixed: 1 1;
160                                         align: 1.0 0.0;
161                                         rel1 { relative: 0.95 0.114; }
162                                         rel2 { relative: 0.95 0.114; }
163                                         image { normal: "T01_control_icon_detail.png"; }
164                                         color: 255 255 255 255;
165                                 }
166                                 description {
167                                         state: "hide" 0.0;
168                                         inherit: "default" 0.0;
169                                         visible: 0;
170                                 }
171                         }
172
173                         programs {
174                                 CONTROL_BUTTON_PROG("option.screensize");
175                                 CONTROL_BUTTON_PROG("option.detail");
176
177                                 program {
178                                         signal: "signal.option.screensize.down";
179                                         source: "*";
180                                         action: STATE_SET "pressed" 0.0;
181                                         target: "option.screensize.button.bg";
182                                 }
183
184                                 program {
185                                         signal: "signal.option.screensize.up";
186                                         source: "*";
187                                         action: STATE_SET "hide" 0.0;
188                                         target: "option.screensize.button.bg";
189                                         after: "option.screensize.change";
190                                 }
191
192                                 program {
193                                         name: "option.screensize.change";
194                                         script: { change_screensize(); }
195                                 }
196
197                                 program {
198                                         name: "send.screensize.normal";
199                                         action: SIGNAL_EMIT "signal.option.screensize.normal" "option.screensize";
200                                 }
201
202                                 program {
203                                         name: "send.screensize.expand";
204                                         action: SIGNAL_EMIT "signal.option.screensize.expand" "option.screensize";
205                                 }
206
207                                 program {
208                                         signal: "signal.option.detail.down";
209                                         source: "*";
210                                         action: STATE_SET "pressed" 0.0;
211                                         target: "option.detail.button.bg";
212                                 }
213
214                                 program {
215                                         signal: "signal.option.detail.up";
216                                         source: "*";
217                                         action: STATE_SET "hide" 0.0;
218                                         target: "option.detail.button.bg";
219                                 }
220
221                                 program {
222                                         signal: "signal.option.mode.streaming";
223                                         source: "*";
224                                         action: STATE_SET "hide" 0.0;
225                                         target: "option.detail";
226                                         target: "option.detail.button.bg";
227                                 }
228                         } //programs
229                 } //parts
230         } //group
231 } //collections