Tizen 2.0 Release
[profile/ivi/org.tizen.video-player.git] / res / edc / subtitle_sync.edc
1 #include "image_res.edc"
2 #include "vp_font.edc"
3
4 // program macro
5
6 #define CONTROL_BUTTON_PROG(_item_name_)                                        \
7 program {                                                                                                       \
8         name: _item_name_".pressed";                                                            \
9         source: _item_name_;                                                                            \
10         signal: "mouse,down,1";                                                                         \
11         action: STATE_SET "pressed" 0.0;                                                        \
12         target: _item_name_;                                                                            \
13         after: "send."_item_name_".down.signal";                                                \
14 }                                                                                                                       \
15 program {                                                                                                       \
16         name: _item_name_".clicked";                                                            \
17         source: _item_name_;                                                                            \
18         signal: "mouse,up,1";                                                                           \
19         action: STATE_SET "default" 0.0;                                                                \
20         target: _item_name_;                                                                            \
21         after: "send."_item_name_".up.signal";                                          \
22 }                                                                                                                       \
23 program {                                                                                                       \
24         name: "send."_item_name_".down.signal";                                                 \
25         action: SIGNAL_EMIT "signal."_item_name_".down" _item_name_;    \
26 }                                                                                                                       \
27 program {                                                                                                       \
28         name: "send."_item_name_".up.signal";                                           \
29         action: SIGNAL_EMIT "signal."_item_name_".up" _item_name_;      \
30 } // CONTROL_BUTTON_PROG
31
32 collections {
33         group {
34                 name: "subtitle.sync";
35                 script {
36                         public val_rotate_mode = 0;             /* 0: portrate, 1: landscape */
37                         public val_layout_show = 1;             /* 0: off, 1: on */
38
39                         public change_top_line() {
40                                          if(get_int(val_rotate_mode) == 0) {
41                                                 if(get_int(val_layout_show) == 1) {
42                                                         set_state(PART:"subtitle.sync.line", "default", 0.0);
43                                                 }
44                                                 else {
45                                                         set_state(PART:"subtitle.sync.line", "visible_off", 0.0);
46                                                 }
47                                         }
48                                         else if(get_int(val_rotate_mode) == 1) {
49                                                 if(get_int(val_layout_show) == 1) {
50                                                         set_state(PART:"subtitle.sync.line", "land_default", 0.0);
51                                                 }
52                                                 else {
53                                                         set_state(PART:"subtitle.sync.line", "land_visible_off", 0.0);
54                                                 }
55                                         }
56                         } /* change_top_line */
57
58                 }       /* script */
59
60                 parts {
61                         part {
62                                 name: "subtitle.sync.bg";
63                                 type: RECT;
64                                 mouse_events: 0;
65                                 scale: 1;
66                                 description {
67                                         state: "default" 0.0;
68                                         visible: 0;
69                                         rel1 { relative: 0.0 0.0;}
70                                         rel2 { relative: 1.0 1.0;}
71                                         color:  0 0 0 0;
72                                 }
73                         }
74
75                         part {
76                                 name: "subtitle.sync.line";
77                                 type: RECT;
78                                 mouse_events: 0;
79                                 scale: 1;
80                                 description {
81                                         state: "default" 0.0;
82                                         min: 0 1;
83                                         fixed: 0 1;
84                                         align: 0.0 1.0;
85                                         visible: 0;
86                                         rel1 { relative: 0.0 0.735156;  to_y:subtitle.sync.bg; }
87                                         rel2 { relative: 1.0 0.735156;  to_y:subtitle.sync.bg; }
88                                         color:  0 0 0 0;
89                                 }
90                                 description {
91                                         state: "visible_off" 0.0;
92                                         inherit: "default" 0.0;
93                                         rel1 { relative: 0.0 0.903125;  to_y:subtitle.sync.bg; }
94                                         rel2 { relative: 1.0 0.903125;  to_y:subtitle.sync.bg; }
95                                 }
96                                 description {
97                                         state: "land_default" 0.0;
98                                         inherit: "default" 0.0;
99                                         rel1 { relative: 0.0 0.558333;  to_y:subtitle.sync.bg; }
100                                         rel2 { relative: 1.0 0.558333;  to_y:subtitle.sync.bg; }
101                                 }
102                                 description {
103                                         state: "land_visible_off" 0.0;
104                                         inherit: "default" 0.0;
105                                         rel1 { relative: 0.0 0.82777;  to_y:subtitle.sync.bg; }
106                                         rel2 { relative: 1.0 0.82777;  to_y:subtitle.sync.bg; }
107                                 }
108                         }
109
110                         part {
111                                 name: "subtitle.sync.rect";
112                                 type: IMAGE;
113                                 mouse_events: 1;
114                                 scale: 1;
115                                 description {
116                                         state: "default" 0.0;
117                                         visible: 1;
118                                         min: 0 104;
119                                         fixed: 0 1;
120                                         align: 0.0 0.0;
121                                         rel1 { relative: 0.07222 1.0; to_y: subtitle.sync.line; }
122                                         rel2 { relative: 0.92778 1.0; to_y: subtitle.sync.line; }
123                                         image { normal: "subtitle/T01-2_sync_btn_bg.png"; border: 19 19 0 0; border_scale: 1;}
124                                         color:  255 255 255 255;
125                                 }
126                                 description {
127                                         state: "hide" 0.0;
128                                         inherit: "default" 0.0;
129                                         visible: 0;
130                                 }
131                         }
132                         part {
133                                 name: "subtitle.sync.rect.1";
134                                 type: IMAGE;
135                                 mouse_events: 1;
136                                 scale: 1;
137                                 description {
138                                         state: "default" 0.0;
139                                         visible: 0;
140                                         min: 64 64;
141                                         fixed: 1 1;
142                                         align: 0.0 0.5;
143                                         rel1 { relative: 0.02922 0.5; to: subtitle.sync.rect; }
144                                         rel2 { relative: 0.02922 0.5; to: subtitle.sync.rect; }
145                                         image { normal: "subtitle/T01-2_sync_list_press.png"; }
146                                         color:  255 255 255 255;
147                                 }
148                                 description {
149                                         state: "pressed" 0.0;
150                                         inherit: "default" 0.0;
151                                         visible: 1;
152                                 }
153                                 description {
154                                         state: "hide" 0.0;
155                                         inherit: "default" 0.0;
156                                         visible: 0;
157                                 }
158                         }
159
160                         part {
161                                 name: "subtitle.sync.rect.2";
162                                 type: RECT;
163                                 mouse_events: 1;
164                                 scale: 1;
165                                 description {
166                                         state: "default" 0.0;
167                                         visible: 0;
168                                         align: 0.0 0.5;
169                                         rel1 { relative: 0.0 0.5; to: subtitle.sync.rect; }
170                                         rel2 { relative: 1.0 0.5; to: subtitle.sync.rect; }
171                                         color:  0 0 0 0;
172                                 }
173                                 description {
174                                         state: "hide" 0.0;
175                                         inherit: "default" 0.0;
176                                         visible: 0;
177                                 }
178                         }
179
180                         part {
181                                 name: "subtitle.sync.rect.3";
182                                 type: IMAGE;
183                                 mouse_events: 1;
184                                 scale: 1;
185                                 description {
186                                         state: "default" 0.0;
187                                         visible: 0;
188                                         min: 64 64;
189                                         fixed: 1 1;
190                                         align: 0.0 0.5;
191                                         rel1 { relative: 0.86688 0.5; to: subtitle.sync.rect; }
192                                         rel2 { relative: 0.86688 0.5; to: subtitle.sync.rect; }
193                                         image { normal: "subtitle/T01-2_sync_list_press.png"; }
194                                         color:  255 255 255 255;
195                                 }
196                                 description {
197                                         state: "pressed" 0.0;
198                                         inherit: "default" 0.0;
199                                         visible: 1;
200                                 }
201                                 description {
202                                         state: "hide" 0.0;
203                                         inherit: "default" 0.0;
204                                         visible: 0;
205                                 }
206                         }
207
208                         part {
209                                 name: "subtitle.sync.slow.button";
210                                 type: IMAGE;
211                                 mouse_events: 1;
212                                 scale: 1;
213                                 description {
214                                         state: "default" 0.0;
215                                         visible: 1;
216                                         min: 64 64;
217                                         fixed: 1 1;
218                                         align: 0.5 0.5;
219                                         rel1 { relative: 0.5 0.5; to: subtitle.sync.rect.1; }
220                                         rel2 { relative: 0.5 0.5; to: subtitle.sync.rect.1; }
221                                         image { normal: "subtitle/T01-2_sync_slowly.png"; }
222                                         color:  255 255 255 255;
223                                 }
224                                 description {
225                                         state: "hide" 0.0;
226                                         inherit: "default" 0.0;
227                                         visible: 0;
228                                 }
229                         }
230
231                         part {
232                                 name: "subtitle.sync.fast.button";
233                                 type: IMAGE;
234                                 mouse_events: 1;
235                                 scale: 1;
236                                 description {
237                                         state: "default" 0.0;
238                                         visible: 1;
239                                         min: 56 56;
240                                         fixed: 1 1;
241                                         align: 0.5 0.5;
242                                         rel1 { relative: 0.5 0.5; to: subtitle.sync.rect.3; }
243                                         rel2 { relative: 0.5 0.5; to: subtitle.sync.rect.3; }
244                                         image { normal: "subtitle/T01-2_sync_faster.png"; }
245                                         color:  255 255 255 255;
246                                 }
247                                 description {
248                                         state: "hide" 0.0;
249                                         inherit: "default" 0.0;
250                                         visible: 0;
251                                 }
252                         }
253
254                         part { name: "subtitle.sync.txt";
255                                 type: TEXT;
256                                 scale: 1;
257                                 mouse_events: 0;
258                                 description {
259                                         state: "default" 0.0;
260                                         align: 0.5 0.5;
261                                         rel1 { relative: 0.0 0.0; to: subtitle.sync.rect.2; }
262                                         rel2 { relative: 1.0 1.0; to: subtitle.sync.rect.2; }
263                                         color: FONT_START_COLOR;
264                                         text {
265                                                 font: FONT_ROMAN_TYPE;
266                                                 text_class: "slp";
267                                                 size: 40;
268                                                 text: "0.0 sec";
269                                                 align: 0.5 0.5;
270                                         }
271                                 }
272                                 description {
273                                         state: "hide" 0.0;
274                                         inherit: "default" 0.0;
275                                         visible: 0;
276                                 }
277                         }
278
279                 }  /* parts */
280
281                 programs {
282                         program {
283                                 signal: "signal.subtitle.portrate.mode";
284                                 source: "*";
285                                 script {
286                                         set_int(val_rotate_mode, 0);
287                                         change_top_line();
288                                 }
289                         }
290                         program {
291                                 signal: "signal.subtitle.landscape.mode";
292                                 source: "*";
293                                 script {
294                                         set_int(val_rotate_mode, 1);
295                                         change_top_line();
296                                 }
297                         }
298
299                         program {
300                                 signal: "signal.subtitle.layout.show";
301                                 source: "*";
302                                 script {
303                                         set_int(val_layout_show, 1);
304                                         change_top_line();
305                                 }
306                         }
307
308                         program {
309                                 signal: "signal.subtitle.layout.hide";
310                                 source: "*";
311                                 script {
312                                         set_int(val_layout_show, 0);
313                                         change_top_line();
314                                 }
315                         }
316
317                         CONTROL_BUTTON_PROG("subtitle.sync.slow.button");
318                         CONTROL_BUTTON_PROG("subtitle.sync.fast.button");
319
320                         program {
321                                 name: "subtitle.sync.rect.1.pressed";
322                                 source: "subtitle.sync.rect.1";
323                                 signal: "mouse,down,1";
324                                 action: STATE_SET "pressed" 0.0;
325                                 target: subtitle.sync.rect.1;
326                                 after: "send.subtitle.sync.slow.button.down.signal";
327                         }
328
329                         program {
330                                 name: "subtitle.sync.rect.3.pressed";
331                                 source: "subtitle.sync.rect.3";
332                                 signal: "mouse,down,1";
333                                 action: STATE_SET "pressed" 0.0;
334                                 target: subtitle.sync.rect.3;
335                                 after: "send.subtitle.sync.fast.button.down.signal";
336                         }
337
338                         program {
339                                 name: "subtitle.sync.rect.1.clicked";
340                                 source: "subtitle.sync.rect.1";
341                                 signal: "mouse,up,1";
342                                 action: STATE_SET "default" 0.0;
343                                 target: subtitle.sync.rect.1;
344                                 after: "send.subtitle.sync.slow.button.up.signal";
345                         }
346
347                         program {
348                                 name: "subtitle.sync.rect.3.clicked";
349                                 source: "subtitle.sync.rect.3";
350                                 signal: "mouse,up,1";
351                                 action: STATE_SET "default" 0.0;
352                                 target: subtitle.sync.rect.3;
353                                 after: "send.subtitle.sync.fast.button.up.signal";
354                         }
355
356                         program {
357                                 signal: "signal.subtitle.sync.slow.button.down";
358                                 source: "*";
359                                 script {
360                                         set_state(PART:"subtitle.sync.rect.1", "pressed", 0.0);
361                                 }
362                         }
363                         program {
364                                 signal: "signal.subtitle.sync.fast.button.down";
365                                 source: "*";
366                                 script {
367                                         set_state(PART:"subtitle.sync.rect.3", "pressed", 0.0);
368                                 }
369                         }
370
371                         program {
372                                 signal: "signal.subtitle.sync.slow.button.up";
373                                 source: "*";
374                                 script {
375                                         set_state(PART:"subtitle.sync.rect.1", "default", 0.0);
376                                 }
377                         }
378                         program {
379                                 signal: "signal.subtitle.sync.fast.button.up";
380                                 source: "*";
381                                 script {
382                                         set_state(PART:"subtitle.sync.rect.3", "default", 0.0);
383                                 }
384                         }
385
386                         program {
387                                 signal: "signal.subtitle.sync.show";
388                                 source: "*";
389                                 script {
390                                         set_state(PART:"subtitle.sync.fast.button", "default", 0.0);
391                                         set_state(PART:"subtitle.sync.txt", "default", 0.0);
392                                         set_state(PART:"subtitle.sync.slow.button", "default", 0.0);
393                                         set_state(PART:"subtitle.sync.rect", "default", 0.0);
394                                         set_state(PART:"subtitle.sync.rect.1", "default", 0.0);
395                                         set_state(PART:"subtitle.sync.rect.2", "default", 0.0);
396                                         set_state(PART:"subtitle.sync.rect.3", "default", 0.0);
397                                 }
398                         }
399                         program {
400                                 signal: "signal.subtitle.sync.hide";
401                                 source: "*";
402                                 script {
403                                         set_state(PART:"subtitle.sync.fast.button", "hide", 0.0);
404                                         set_state(PART:"subtitle.sync.txt", "hide", 0.0);
405                                         set_state(PART:"subtitle.sync.slow.button", "hide", 0.0);
406                                         set_state(PART:"subtitle.sync.rect", "hide", 0.0);
407                                         set_state(PART:"subtitle.sync.rect.1", "hide", 0.0);
408                                         set_state(PART:"subtitle.sync.rect.2", "hide", 0.0);
409                                         set_state(PART:"subtitle.sync.rect.3", "hide", 0.0);
410                                 }
411                         }
412
413                 } /* programs */
414         } /* group */
415 } /* collection */