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: "quick_shot.png" COMP;
21 image: "quick_shot_press.png" COMP;
22 image: "lock_circle_line_camera.png" COMP;
23 image: "lock_circle_line_camera_drag.png" COMP;
27 name: "camera.circle";
34 image.normal: "lock_circle_line_camera.png";
35 rel1 { relative: 0.0 0.0; }
36 rel2 { relative: 1.0 1.0; }
45 name: "camera.circle.fill";
52 image.normal: "lock_circle_line_camera_drag.png";
53 rel1 { relative: 0.0 0.0; }
54 rel2 { relative: 1.0 1.0; }
72 rel1 { relative: 0.0 0.0; to: "camera.circle.fill"; }
73 rel2 { relative: 462/500 462/500; to: "camera.circle.fill"; }
74 image.normal: "quick_shot.png";
79 inherit: "default" 0.0;;
80 image.normal: "quick_shot_press.png";
86 signal: "mouse,down,1";
88 action: STATE_SET "pressed" 1.0;
89 target: "camera.circle.fill";
90 target: "camera.circle";
96 action: STATE_SET "default" 0.0;
97 target: "camera.circle.fill";
98 target: "camera.circle";
102 signal: "mouse,up,1";
103 source: "img.camera";
105 /* get parts coords */
106 new x,y,w,h,ix,iy,iw,ih;
107 get_geometry(PART:"img.camera", ix, iy, iw, ih);
108 get_geometry(PART:"camera.circle.fill", x, y, w, h);
110 /* calculate elipsis center */
111 new xc = x + ix + iw / 2;
112 new yc = y + iy + ih / 2;
114 /* calculate elipsis radious */
118 /* get mouse coords */
122 /* check if mouse is inside elipsis */
123 new Float:d = float((mx-xc)*(mx-xc))/float(radx*radx) + float((my-yc)*(my-yc))/float(rady*rady);
125 /* Emit signal if mouse inside elipsis */
128 emit("camera,icon,clicked", "camera-layout");