Flora license update
[apps/core/preloaded/ug-camera-efl.git] / edc / cam_utils.edc
1 /*
2  * Copyright 2012  Samsung Electronics Co., Ltd
3  *
4  * Licensed under the Flora License, Version 1.1 (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://floralicense.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 "cam_funcs.edc"
19 #include "../include/edc_image_name.h"
20
21 #define CAM_FOCUS_IMG "CAMERA_FOCUS_IMG"
22
23 images {
24         image: FOCUS_GUIDE_NOTREADY_IMAGE COMP;
25         image: FOCUS_GUIDE_FOCUSED_IMAGE COMP;
26         image: FOCUS_GUIDE_FAILED_IMAGE COMP;
27         image: SHOTTING_MODE_POPUP_BG_IMAGE COMP;
28         image: TIMER_ICON_BG_IMAGE COMP;
29 }
30
31 styles {
32         style {
33                 name: "textblock_style";
34                 base: "font=SLP:style=Roman font_size=40 align=left valign=top color=#ffffff  wrap=word";
35                 tag:  "br"        "  \n";
36         }
37
38         style {
39                 name: "textblock_style_center";
40                 base: "font=SLP:style=Roman  font_size=40 align=center valign=top color=#ffffff  wrap=word";
41                 tag:  "br"        "  \n";
42         }
43
44         style {
45                 name: "textblock_style_shot_guide";
46                 base: "font=SLP:style=Roman font_size=36 align=center color=#FFFFFF ellipise=1.0 wrap=mixed";
47                 tag:  "br" "\n";
48                 tag:  "hilight" "+ font=SLP:style=Bold";
49                 tag:  "b" "+ font=SLP:style=Bold";
50                 tag:  "tab" "\t";
51         }
52 }
53
54
55 collections {
56         group { name: "focus_image";
57                 min: CAMERA_FOCUS_W CAMERA_FOCUS_H;
58                 max: CAMERA_FOCUS_W CAMERA_FOCUS_H;
59                 parts{
60                         part {
61                                 name: CAM_FOCUS_IMG;
62                                 type: IMAGE;
63                                 scale: 1;
64                                 mouse_events: 0;
65                                 description {
66                                         state: "default" 0.0;
67                                         visible: 0;
68
69                                         rel1 { relative: 0.0 0.0; }
70                                         rel2 { relative: 1.0 1.0; }
71
72                                 }
73                                 description {
74                                         state: "notready" 0.0;
75                                         inherit: "default" 0.0;
76                                         visible: 1;
77                                         image{
78                                                 normal: FOCUS_GUIDE_NOTREADY_IMAGE;
79                                                 border: 9 9 9 9;
80                                                 border_scale: 1;
81                                                 }
82                                 }
83                                 description {
84                                         state: "focused" 0.0;
85                                         inherit: "default" 0.0;
86                                         visible: 1;
87                                         image{
88                                                 normal:FOCUS_GUIDE_FOCUSED_IMAGE;
89                                                 border: 9 9 9 9;
90                                                 border_scale: 1;
91                                                 }
92                                 }
93                                 description {
94                                         state: "failed" 0.0;
95                                         inherit: "default" 0.0;
96                                         visible: 1;
97                                         image{
98                                                 normal: FOCUS_GUIDE_FAILED_IMAGE;
99                                                 border: 9 9 9 9;
100                                                 border_scale: 1;
101                                                 }
102                                 }
103
104                         }
105                 }
106
107                 programs {
108                         program { name: "focus,hide";
109                                 source: "program";
110                                 signal: "focus,hide";
111                                 action: STATE_SET "default" 0.0;
112                                 target: CAM_FOCUS_IMG;
113                         }
114                         program { name: "focus,notready";
115                                 source: "program";
116                                 signal: "focus,notready";
117                                 action: STATE_SET "notready" 0.0;
118                                 target: CAM_FOCUS_IMG;
119                         }
120                         program { name: "focus,focused";
121                                 source: "program";
122                                 signal: "focus,focused";
123                                 action: STATE_SET "focused" 0.0;
124                                 target: CAM_FOCUS_IMG;
125                         }
126                         program { name: "focus,failed";
127                                 source: "program";
128                                 signal: "focus,failed";
129                                 action: STATE_SET "failed" 0.0;
130                                 target: CAM_FOCUS_IMG;
131                         }
132                 }
133         }
134
135 #define PX_POPUP_BOX_X 288
136 #define PX_POPUP_BOX_Y 239
137 #define VER_PX_POPUP_BOX_X 8
138 #define VER_PX_POPUP_BOX_Y 519
139
140 #define PX_POPUP_BOX_W 704
141 #define PX_POPUP_BOX_H 242
142
143
144 #define PX_POPUP_TEXT_Y 32
145
146 #define PX_POPUP_BAR_X 72
147 #define PX_POPUP_BAR_Y 182
148 #define PX_POPUP_BAR_W 560
149 #define PX_POPUP_BAR_H 21
150
151
152         group { name: "progress_popup";
153                 parts {
154                         part {
155                                 name: "progress_popup_bg";
156                                 type: IMAGE;
157                                 mouse_events: 0;
158                                 scale: 1;
159                                 description {
160                                         state: "default" 0.0;
161                                         visible: 0;
162                                         rel1 { relative: PX_POPUP_BOX_X/MAIN_W PX_POPUP_BOX_Y/MAIN_H; }
163                                         rel2 { relative: (PX_POPUP_BOX_X+PX_POPUP_BOX_W)/MAIN_W (PX_POPUP_BOX_Y+PX_POPUP_BOX_H)/MAIN_H; }
164                                         image{ normal: SHOTTING_MODE_POPUP_BG_IMAGE; }
165                                 }
166                                 description {
167                                         state: "landscape" 0.0;
168                                         visible: 1;
169                                         rel1 { relative: PX_POPUP_BOX_X/MAIN_W PX_POPUP_BOX_Y/MAIN_H; }
170                                         rel2 { relative: (PX_POPUP_BOX_X+PX_POPUP_BOX_W)/MAIN_W (PX_POPUP_BOX_Y+PX_POPUP_BOX_H)/MAIN_H; }
171                                         image{ normal: SHOTTING_MODE_POPUP_BG_IMAGE; }
172                                 }
173                                 description {
174                                         state: "vertical" 0.0;
175                                         visible: 1;
176                                         rel1 { relative: VER_PX_POPUP_BOX_X/VER_MAIN_W VER_PX_POPUP_BOX_Y/VER_MAIN_H; }
177                                         rel2 { relative: (VER_PX_POPUP_BOX_X+PX_POPUP_BOX_W)/VER_MAIN_W (VER_PX_POPUP_BOX_Y+PX_POPUP_BOX_H)/VER_MAIN_H; }
178                                         image{ normal: SHOTTING_MODE_POPUP_BG_IMAGE; }
179                                 }
180                         }
181                         part {
182                                 name: "progress_popup_text";
183                                 type: TEXTBLOCK;
184                                 scale: 1;
185                                 description {
186                                                 state: "default" 0.0;
187                                                 fixed: 1 1;
188                                                 visible: 1;
189                                                 rel1 { relative: 66/PX_POPUP_BOX_W PX_POPUP_TEXT_Y/PX_POPUP_BOX_H; to:  progress_popup_bg; }
190                                                 rel2 { relative: (PX_POPUP_BOX_W - 66)/PX_POPUP_BOX_W 152/PX_POPUP_BOX_H;  to:  progress_popup_bg; }
191                                                 color: FONT_COLOR;
192                                                 text {
193                                                         style: "textblock_style";
194                                                         min: 0 1;
195                                                 }
196                                 }
197                         }
198                         //to swallow progressbar
199                         part {
200                                 name: "progress_popup_bar";
201                                 type: SWALLOW;
202                                 scale: 1;
203                                 description {
204                                                 state: "default" 0.0;
205                                                 fixed: 1 1;
206                                                 rel1 { relative: PX_POPUP_BAR_X/PX_POPUP_BOX_W  PX_POPUP_BAR_Y/PX_POPUP_BOX_H;
207                                                                         to:  progress_popup_bg; }
208                                                 rel2 { relative: (PX_POPUP_BAR_X+PX_POPUP_BAR_W)/PX_POPUP_BOX_W         (PX_POPUP_BAR_Y+PX_POPUP_BAR_H)/PX_POPUP_BOX_H;
209                                                                         to:  progress_popup_bg; }
210                                 }
211                         }
212                 }
213                 programs {
214                         program {
215                                 name: "progress_popup,default";
216                                 source: "prog";
217                                 signal: "progress_popup,default";
218                                 script: {
219                                         set_state(PART:"progress_popup_bg", "landscape", 0.0);
220                                 }
221                         }
222                         program {
223                                 name: "progress_popup,vertical";
224                                 source: "prog";
225                                 signal: "progress_popup,vertical";
226                                 script: {
227                                         set_state(PART:"progress_popup_bg", "vertical", 0.0);
228                                 }
229                         }
230                 }
231         }
232 #if 1/*note: for burst mode*/
233 //#define PX_POPUP_BOX_W 704
234 //#define PX_POPUP_BOX_H 180
235
236 group { name: "burst_progress_popup";
237         parts {
238                 part {
239                         name: "progress_popup_bg";
240                         type: IMAGE;
241                         mouse_events: 0;
242                         scale: 1;
243                         description {
244                                 state: "default" 0.0;
245                                 visible: 0;
246                                 rel1 { relative: PX_POPUP_BOX_X/MAIN_W PX_POPUP_BOX_Y/MAIN_H; }
247                                 rel2 { relative: (PX_POPUP_BOX_X+PX_POPUP_BOX_W)/MAIN_W (PX_POPUP_BOX_Y+PX_POPUP_BOX_H)/MAIN_H; }
248                                 image{ normal: SHOTTING_MODE_POPUP_BG_IMAGE; }
249                         }
250                         description {
251                                 state: "landscape" 0.0;
252                                 visible: 1;
253                                 rel1 { relative: PX_POPUP_BOX_X/MAIN_W PX_POPUP_BOX_Y/MAIN_H; }
254                                 rel2 { relative: (PX_POPUP_BOX_X+PX_POPUP_BOX_W)/MAIN_W (PX_POPUP_BOX_Y+PX_POPUP_BOX_H)/MAIN_H; }
255                                 image{ normal: SHOTTING_MODE_POPUP_BG_IMAGE; }
256                         }
257                         description {
258                                 state: "vertical" 0.0;
259                                 visible: 1;
260                                 rel1 { relative: VER_PX_POPUP_BOX_X/VER_MAIN_W VER_PX_POPUP_BOX_Y/VER_MAIN_H; }
261                                 rel2 { relative: (VER_PX_POPUP_BOX_X+PX_POPUP_BOX_W)/VER_MAIN_W (VER_PX_POPUP_BOX_Y+PX_POPUP_BOX_H)/VER_MAIN_H; }
262                                 image{ normal: SHOTTING_MODE_POPUP_BG_IMAGE; }
263                         }
264                 }
265                 part {
266                         name: "progress_popup_text";
267                         type: TEXTBLOCK;
268                         scale: 1;
269                         description {
270                                         state: "default" 0.0;
271                                         fixed: 1 1;
272                                         visible: 1;
273                                         rel1 { relative: 66/PX_POPUP_BOX_W PX_POPUP_TEXT_Y/PX_POPUP_BOX_H; to:  progress_popup_bg; }
274                                         rel2 { relative: (PX_POPUP_BOX_W - 66)/PX_POPUP_BOX_W 152/PX_POPUP_BOX_H;  to:  progress_popup_bg; }
275                                         color: FONT_COLOR;
276                                         text {
277                                                 style: "textblock_style_center";
278                                                 min: 0 1;
279                                         }
280                         }
281                 }
282                 //to swallow progressbar
283                 part {
284                         name: "progress_popup_bar";
285                         type: SWALLOW;
286                         scale: 1;
287                         description {
288                                         state: "default" 0.0;
289                                         fixed: 1 1;
290                                         rel1 { relative: PX_POPUP_BAR_X/PX_POPUP_BOX_W  PX_POPUP_BAR_Y/PX_POPUP_BOX_H;
291                                                                 to:  progress_popup_bg; }
292                                         rel2 { relative: (PX_POPUP_BAR_X+PX_POPUP_BAR_W)/PX_POPUP_BOX_W         (PX_POPUP_BAR_Y+PX_POPUP_BAR_H)/PX_POPUP_BOX_H;
293                                                                 to:  progress_popup_bg; }
294                         }
295                 }
296         }
297         programs {
298                 program {
299                         name: "progress_popup,default";
300                         source: "prog";
301                         signal: "progress_popup,default";
302                         script: {
303                                 set_state(PART:"progress_popup_bg", "landscape", 0.0);
304                         }
305                 }
306                 program {
307                         name: "progress_popup,vertical";
308                         source: "prog";
309                         signal: "progress_popup,vertical";
310                         script: {
311                                 set_state(PART:"progress_popup_bg", "vertical", 0.0);
312                         }
313                 }
314         }
315 }
316
317
318 #endif
319
320
321 #define TIMER_ICON_W 188
322 #define TIMER_ICON_H 158
323         group{ name: "timer_icon_landscape";
324
325                 parts{
326                         part {
327                                 name: "icon";
328                                 type: IMAGE;
329                                 scale: 1;
330                                 description {
331                                         state: "default" 0.0;
332                                         rel1 { relative: (1 - TIMER_ICON_W/MAIN_W)/2 (1 - TIMER_ICON_H/MAIN_H)/2; offset: 0 0; }
333                                         rel2 { relative: (1 + TIMER_ICON_W/MAIN_W)/2 (1 + TIMER_ICON_H/MAIN_H)/2; offset: -1 -1; }
334                                         image { normal: TIMER_ICON_BG_IMAGE; }
335                                 }
336                         }
337                         part {
338                                 name: "text";
339                                 type: TEXT;
340                                 scale: 1;
341                                 description {
342                                         state: "default" 0.0;
343                                         rel1 { relative: 0.0 0.0; offset: 0 0; to:  "icon"; }
344                                         rel2 { relative: 1.0 1.0; offset: -1 -1;  to:  "icon"; }
345                                         color: COLOR_1;
346                                         text {
347                                                 font: FONT_NAME;
348                                                 size: 60;
349                                                 min: 1 1;
350                                                 align: 0.8 0.8;
351                                         }
352                                 }
353                         }
354                 }
355         }
356
357         group{ name: "timer_icon_portrait";
358
359                 parts{
360                         part {
361                                 name: "icon";
362                                 type: IMAGE;
363                                 scale: 1;
364                                 description {
365                                         state: "default" 0.0;
366                                         rel1 { relative: (1 - TIMER_ICON_W/MAIN_H)/2 (1 - TIMER_ICON_H/MAIN_W)/2; offset: 0 0; }
367                                         rel2 { relative: (1 + TIMER_ICON_W/MAIN_H)/2 (1 + TIMER_ICON_H/MAIN_W)/2; offset: -1 -1; }
368                                         image { normal: TIMER_ICON_BG_IMAGE; }
369                                 }
370                         }
371                         part {
372                                 name: "text";
373                                 type: TEXT;
374                                 scale: 1;
375                                 description {
376                                         state: "default" 0.0;
377                                         rel1 { relative: 0.0 0.0; offset: 0 0; to:      "icon"; }
378                                         rel2 { relative: 1.0 1.0; offset: -1 -1;  to:  "icon"; }
379                                         color: COLOR_1;
380                                         text {
381                                                 font: FONT_NAME;
382                                                 size: 60;
383                                                 min: 1 1;
384                                                 align: 0.8 0.8;
385                                         }
386                                 }
387                         }
388                 }
389         }
390
391
392 #define SHOT_GUIDE_POPUP_WIDTH  600
393 #define SHOT_GUIDE_POPUP_HEIGHT 72
394         group{ name: "shot_guide_landscape";
395                 parts{
396                         part {
397                                 name: "text";
398                                 type: TEXTBLOCK;
399                                 scale: 1;
400                                 description {
401                                         state: "default" 0.0;
402                                         rel1 { relative: (1 - SHOT_GUIDE_POPUP_WIDTH/MAIN_W)/2 0.8; offset: 0 0; }
403                                         rel2 { relative: (1 + SHOT_GUIDE_POPUP_WIDTH/MAIN_W)/2 1.0; offset: -1 -1; }
404                                         color: COLOR_1;
405                                         text {
406                                                 style: textblock_style_shot_guide;
407                                                 min: 0 0;
408                                                 max: 0 1;
409                                         }
410                                 }
411                         }
412                 }
413         }
414
415         group{ name: "shot_guide_potrait";
416                 parts{
417                         part {
418                                 name: "text";
419                                 type: TEXTBLOCK;
420                                 scale: 1;
421                                 description {
422                                         state: "default" 0.0;
423                                         rel1 { relative: (1 - SHOT_GUIDE_POPUP_WIDTH/MAIN_H)/2 0.75; offset: 0 0; }
424                                         rel2 { relative: (1 + SHOT_GUIDE_POPUP_WIDTH/MAIN_H)/2 0.85; offset: -1 -1; }
425                                         color: COLOR_1;
426                                         text {
427                                                 style: textblock_style_shot_guide;
428                                                 min: 0 0;
429                                                 max: 0 1;
430                                         }
431                                 }
432                         }
433                 }
434         }
435 }
436