2 * Copyright (c) 2009-2014 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 name: "camera-layout";
20 image: "lock_circle_line_camera_drag.png" COMP;
21 image: "lock_circle_line_camera.png" COMP;
22 image: "quick_shot_bg.png" COMP;
23 image: "quick_shot_icon.png" COMP;
33 min: CAMERA_LAYOUT_SIZE CAMERA_LAYOUT_SIZE;
34 max: CAMERA_LAYOUT_SIZE CAMERA_LAYOUT_SIZE;
35 rel1 { relative: 0.0 0.0; }
36 rel2 { relative: 1.0 1.0; }
40 name: "img.camera.circle.line";
46 rel1 { relative: 0.5 0.5; to: "bg"; }
47 rel2 { relative: 0.5 0.5; to: "bg"; }
48 min: CAMERA_ICON_SIZE CAMERA_ICON_SIZE;
49 max: CAMERA_ICON_SIZE CAMERA_ICON_SIZE;
50 image.normal: "lock_circle_line_camera.png";
55 inherit: "default" 0.0;
56 min: CAMERA_ICON_SIZE CAMERA_ICON_SIZE;
57 max: CAMERA_ICON_SIZE CAMERA_ICON_SIZE;
62 inherit: "default" 0.0;;
63 min: CAMERA_LAYOUT_SIZE CAMERA_LAYOUT_SIZE;
64 max: CAMERA_LAYOUT_SIZE CAMERA_LAYOUT_SIZE;
69 name: "img.camera.circle.drag";
75 rel1 { relative: 0.5 0.5; to: "bg"; }
76 rel2 { relative: 0.5 0.5; to: "bg"; }
79 image.normal: "lock_circle_line_camera_drag.png";
84 inherit: "default" 0.0;
91 inherit: "default" 0.0;;
96 name: "img.camera.bg";
100 state: "default" 0.0;
101 min: CAMERA_ICON_SIZE CAMERA_ICON_SIZE;
102 max: CAMERA_ICON_SIZE CAMERA_ICON_SIZE;
104 rel1 { relative: 0.5 0.5; to: "bg"; }
105 rel2 { relative: 0.5 0.5; to: "bg"; }
106 image.normal: "quick_shot_bg.png";
107 color_class: "AO001";
110 state: "release" 0.0;
111 inherit: "default" 0.0;
112 color_class: "AO001";
116 inherit: "default" 0.0;;
117 color_class: "AO001P";
121 name: "img.camera.icon";
126 state: "default" 0.0;
127 min: CAMERA_ICON_SIZE CAMERA_ICON_SIZE;
128 max: CAMERA_ICON_SIZE CAMERA_ICON_SIZE;
130 rel1 { relative: 0.5 0.5; to: "img.camera.bg"; }
131 rel2 { relative: 0.5 0.5; to: "img.camera.bg"; }
132 image.normal: "quick_shot_icon.png";
154 public g_anim_fill_enable;
155 public g_filler_expanded;
162 set_int(g_mouse_down, 0);
164 set_int(g_angle_new, 0);
165 set_int(g_angle_busy, 0);
166 set_int(g_anim_fill_enable, 0);
167 set_int(g_full_state, 0);
168 set_int(g_filler_expanded, 0);
169 set_int(use_custom, 0);
173 name: "rotation,end";
178 angle_old = get_int(g_angle);
179 angle_new = get_int(g_angle_new);
181 if (angle_old != angle_new) {
182 set_int(g_angle_busy, 1);
184 set_int(g_angle_busy, 0);
189 signal: "mouse,down,1";
190 source: "img.camera.bg";
191 action: SIGNAL_EMIT "camera,icon,mouse,down" "img.camera.bg";
193 set_int(g_mouse_down, 1);
197 name: "camera,icon,press";
198 signal: "camera,icon,press";
199 source: "img.camera.bg";
200 action: STATE_SET "press" 0.0;
201 target: "img.camera.bg";
202 target: "img.camera.circle.drag";
203 after: "camera,circle,start";
206 name: "camera,circle,start";
207 source: "img.camera.circle.line";
208 action: STATE_SET "press" 0.0;
209 target: "img.camera.circle.line";
210 transition: SIN_FAC 0.5 1.7;
213 signal: "mouse,up,1";
214 source: "img.camera.bg";
215 action: SIGNAL_EMIT "camera,icon,mouse,up" "img.camera.bg";
217 set_int(g_mouse_down, 0);
222 name: "camera,icon,release";
223 signal: "camera,icon,release";
224 source: "img.camera.bg";
225 action: STATE_SET "release" 0.0;
226 target: "img.camera.bg";
227 after: "camera,circle,end";
230 name: "camera,circle,end";
231 source: "img.camera.circle.line";
232 action: STATE_SET "release" 0.0;
233 target: "img.camera.circle.line";
234 target: "img.camera.circle.drag";
235 transition: SIN_FAC 0.5 1.7;
238 signal: "mouse,move";
239 source: "img.camera.icon";
245 if (get_int(g_mouse_down) == 0) {
253 get_geometry(PART:"img.camera.icon", x_icon, y_icon, w_icon, h_icon);
259 get_geometry(PART:"bg", x_max, y_max, w_max, h_max);
263 d_x = abs((x_icon + (w_icon / 2) - x) * 2);
264 d_y = abs((y_icon + (h_icon / 2) - y) * 2);
266 new min = round(sqrt((d_x * d_x) + (d_y * d_y)));
268 min = (min > w_max) ? w_max : min;
269 min = (min < w_icon) ? w_icon : min;
271 custom_state(PART:"img.camera.circle.drag", "press", 0.0);
272 set_state_val(PART:"img.camera.circle.drag", STATE_MIN, min, min);
273 set_state_val(PART:"img.camera.circle.drag", STATE_MAX, min, min);
274 set_state(PART:"img.camera.circle.drag", "custom", 0.0);
277 if (get_int(g_full_state) == 0) {
278 stop_programs_on(PART:"img.camera.circle.line");
280 set_int(g_full_state, 1);
282 set_int(g_full_state, 0);
284 set_int(g_filler_expanded, 1);