3 * Copyright 2012 Samsung Electronics Co., Ltd
5 * Licensed under the Flora License, Version 1.1 (the License);
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://floralicense.org/license
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an AS IS BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
19 #define BG_H_POR (1280-60-88)
20 #define PANNEL_W_POR 720
21 #define PANNEL_H_POR (782+18)
22 #define PANNEL_FULL_W_POR 720
23 #define PANNEL_FULL_H_POR (782+14)
25 #define PANNEL_X_LOFF_POR 34
26 #define PANNEL_Y_LOFF_POR 14//???
28 #define PANNEL_KEY_W_PAD_POR 23
29 #define PANNEL_KEY_H_PAD_POR 8
30 #define PANNEL_KEY_W_POR 150
31 #define PANNEL_KEY_H_POR 150
32 #define PANNEL_KEY_FULL_W_POR (PANNEL_KEY_W_POR+PANNEL_KEY_W_PAD_POR)
33 #define PANNEL_KEY_FULL_H_POR (PANNEL_KEY_H_POR+PANNEL_KEY_H_PAD_POR)
35 #define PANNEL_COR_POR_REF1_X(X,Y) ((PANNEL_X_LOFF_POR+PANNEL_KEY_FULL_W_POR*(Y))/PANNEL_W_POR)
36 #define PANNEL_COR_POR_REF1_Y(X,Y) ((PANNEL_Y_LOFF_POR+PANNEL_KEY_FULL_H_POR*(X))/PANNEL_FULL_H_POR)
37 #define PANNEL_COR_POR_REF2_X(X,Y) ((PANNEL_X_LOFF_POR+PANNEL_KEY_FULL_W_POR*(Y)+PANNEL_KEY_W_POR)/PANNEL_W_POR)
38 #define PANNEL_COR_POR_REF2_Y(X,Y) ((PANNEL_Y_LOFF_POR+PANNEL_KEY_FULL_H_POR*(X)+PANNEL_KEY_H_POR)/PANNEL_FULL_H_POR)
40 #define KEYPAD_KEY_IMG_POR(key_name, relx1, rely1, relx2, rely2, bg_img, bg_img_press, to_part) \
41 EDC_PART_RECT_RELATIVE(key_name, to_part, relx1, rely1, relx2, rely2)\
42 EDC_PART_BUTTON_IMG(key_name"_bg", key_name, EDC_IMAGE(bg_img), EDC_IMAGE(bg_img_press))
45 #define KEYPAD_KEY_PROG_POR(key_name) \
47 name: "mouse_down_"key_name; \
48 signal: "mouse,down,1"; \
50 action: STATE_SET "pressed" 0.0; \
51 target: key_name"_bg"; \
54 name: "mouse_up_"key_name; \
55 signal: "mouse,up,1"; \
57 action: STATE_SET "default" 0.0; \
58 target: key_name"_bg"; \
61 ///////////////////// prtrait pannel ////////////////////////////////////////
70 name: "por_pannel/in";
76 rel1 { relative: 0.0 (270+48)/BG_H_POR; }
77 rel2 { relative: 1.0 (BG_H_POR-18)/BG_H_POR; }
81 inherit: "default" 0.0;
82 rel1 { relative: 0.0 1.0; offset: 0 -12;}
83 rel2 { relative: 1.0 1.0; offset: 0 PANNEL_H_POR;}
87 name: "por_pannel/BG";
93 rel1 { relative: 0.0 (270+48)/BG_H_POR;offset: 0 -2;}
94 rel2 { relative: 1.0 1.1; }
95 color: 201 198 190 255;
99 inherit: "default" 0.0;
100 rel1 { relative: 0.0 1.0; offset: 0 -12;}
101 rel2 { relative: 1.0 1.0; offset: 0 PANNEL_H_POR;}
105 /* close&open icon */
111 state: "default" 0.0;
112 rel1 { relative: 0.0 (270)/BG_H_POR;}
113 rel2 { relative: 1.0 (270+48)/BG_H_POR;}
114 image { normal: "images/port_down_handle_nor.png"; }
118 inherit: "default" 0.0;
119 rel1 { relative: 0.0 (BG_H_POR-48)/BG_H_POR;}
120 rel2 { relative: 1.0 (BG_H_POR)/BG_H_POR;}
121 image { normal: "images/port_up_handle_nor.png"; }
124 state: "default_press" 0.0;
125 rel1 { relative: 0.0 (270)/BG_H_POR;}
126 rel2 { relative: 1.0 (270+48)/BG_H_POR;}
127 image { normal: "images/port_down_handle_press.png"; }
130 state: "open_press" 0.0;
131 inherit: "default" 0.0;
132 rel1 { relative: 0.0 (BG_H_POR-48)/BG_H_POR;}
133 rel2 { relative: 1.0 (BG_H_POR)/BG_H_POR;}
134 image { normal: "images/port_up_handle_press.png"; }
138 /* create pannel keys */
140 KEYPAD_KEY_IMG_POR("item_c",
141 PANNEL_COR_POR_REF1_X(0,0), PANNEL_COR_POR_REF1_Y(0,0),
142 PANNEL_COR_POR_REF2_X(0,0), PANNEL_COR_POR_REF2_Y(0,0),
143 "images/btn_type_a_01_nor.png", "images/btn_type_a_01_press.png",
145 KEYPAD_KEY_IMG_POR("item_div",
146 PANNEL_COR_POR_REF1_X(0,1), PANNEL_COR_POR_REF1_Y(0,1),
147 PANNEL_COR_POR_REF2_X(0,1), PANNEL_COR_POR_REF2_Y(0,1),
148 "images/btn_type_a_02_nor.png", "images/btn_type_a_02_press.png",
150 KEYPAD_KEY_IMG_POR("item_mul",
151 PANNEL_COR_POR_REF1_X(0,2), PANNEL_COR_POR_REF1_Y(0,2),
152 PANNEL_COR_POR_REF2_X(0,2), PANNEL_COR_POR_REF2_Y(0,2),
153 "images/btn_type_a_03_nor.png", "images/btn_type_a_03_press.png",
155 KEYPAD_KEY_IMG_POR("item_del",
156 PANNEL_COR_POR_REF1_X(0,3), PANNEL_COR_POR_REF1_Y(0,3),
157 PANNEL_COR_POR_REF2_X(0,3), PANNEL_COR_POR_REF2_Y(0,3),
158 "images/btn_type_a_04_nor.png", "images/btn_type_a_04_press.png",
163 KEYPAD_KEY_IMG_POR("item_num7",
164 PANNEL_COR_POR_REF1_X(1,0), PANNEL_COR_POR_REF1_Y(1,0),
165 PANNEL_COR_POR_REF2_X(1,0), PANNEL_COR_POR_REF2_Y(1,0),
166 "images/btn_type_a_num7_nor.png", "images/btn_type_a_num7_press.png",
168 KEYPAD_KEY_IMG_POR("item_num8",
169 PANNEL_COR_POR_REF1_X(1,1), PANNEL_COR_POR_REF1_Y(1,1),
170 PANNEL_COR_POR_REF2_X(1,1), PANNEL_COR_POR_REF2_Y(1,1),
171 "images/btn_type_a_num8_nor.png", "images/btn_type_a_num8_press.png",
173 KEYPAD_KEY_IMG_POR("item_num9",
174 PANNEL_COR_POR_REF1_X(1,2), PANNEL_COR_POR_REF1_Y(1,2),
175 PANNEL_COR_POR_REF2_X(1,2), PANNEL_COR_POR_REF2_Y(1,2),
176 "images/btn_type_a_num9_nor.png", "images/btn_type_a_num9_press.png",
178 KEYPAD_KEY_IMG_POR("item_sub",
179 PANNEL_COR_POR_REF1_X(1,3), PANNEL_COR_POR_REF1_Y(1,3),
180 PANNEL_COR_POR_REF2_X(1,3), PANNEL_COR_POR_REF2_Y(1,3),
181 "images/btn_type_a_05_nor.png", "images/btn_type_a_05_press.png",
186 KEYPAD_KEY_IMG_POR("item_num4",
187 PANNEL_COR_POR_REF1_X(2,0), PANNEL_COR_POR_REF1_Y(2,0),
188 PANNEL_COR_POR_REF2_X(2,0), PANNEL_COR_POR_REF2_Y(2,0),
189 "images/btn_type_a_num4_nor.png", "images/btn_type_a_num4_press.png",
191 KEYPAD_KEY_IMG_POR("item_num5",
192 PANNEL_COR_POR_REF1_X(2,1), PANNEL_COR_POR_REF1_Y(2,1),
193 PANNEL_COR_POR_REF2_X(2,1), PANNEL_COR_POR_REF2_Y(2,1),
194 "images/btn_type_a_num5_nor.png", "images/btn_type_a_num5_press.png",
196 KEYPAD_KEY_IMG_POR("item_num6",
197 PANNEL_COR_POR_REF1_X(2,2), PANNEL_COR_POR_REF1_Y(2,3),
198 PANNEL_COR_POR_REF2_X(2,2), PANNEL_COR_POR_REF2_Y(2,3),
199 "images/btn_type_a_num6_nor.png", "images/btn_type_a_num6_press.png",
201 KEYPAD_KEY_IMG_POR("item_plus",
202 PANNEL_COR_POR_REF1_X(2,3), PANNEL_COR_POR_REF1_Y(2,3),
203 PANNEL_COR_POR_REF2_X(2,3), PANNEL_COR_POR_REF2_Y(2,3),
204 "images/btn_type_a_06_nor.png", "images/btn_type_a_06_press.png",
210 KEYPAD_KEY_IMG_POR("item_num1",
211 PANNEL_COR_POR_REF1_X(3,0), PANNEL_COR_POR_REF1_Y(3,0),
212 PANNEL_COR_POR_REF2_X(3,0), PANNEL_COR_POR_REF2_Y(3,0),
213 "images/btn_type_a_num1_nor.png", "images/btn_type_a_num1_press.png",
215 KEYPAD_KEY_IMG_POR("item_num2",
216 PANNEL_COR_POR_REF1_X(3,1), PANNEL_COR_POR_REF1_Y(3,1),
217 PANNEL_COR_POR_REF2_X(3,1), PANNEL_COR_POR_REF2_Y(3,1),
218 "images/btn_type_a_num2_nor.png", "images/btn_type_a_num2_press.png",
220 KEYPAD_KEY_IMG_POR("item_num3",
221 PANNEL_COR_POR_REF1_X(3,2), PANNEL_COR_POR_REF1_Y(3,2),
222 PANNEL_COR_POR_REF2_X(3,2), PANNEL_COR_POR_REF2_Y(3,2),
223 "images/btn_type_a_num3_nor.png", "images/btn_type_a_num3_press.png",
225 KEYPAD_KEY_IMG_POR("item_brack",
226 PANNEL_COR_POR_REF1_X(3,3), PANNEL_COR_POR_REF1_Y(3,3),
227 PANNEL_COR_POR_REF2_X(3,3), PANNEL_COR_POR_REF2_Y(3,3),
228 "images/btn_type_a_07_nor.png", "images/btn_type_a_07_press.png",
233 KEYPAD_KEY_IMG_POR("item_num0",
234 PANNEL_COR_POR_REF1_X(4,0), PANNEL_COR_POR_REF1_Y(4,0),
235 PANNEL_COR_POR_REF2_X(4,0), PANNEL_COR_POR_REF2_Y(4,0),
236 "images/btn_type_a_num0_nor.png", "images/btn_type_a_num0_press.png",
238 KEYPAD_KEY_IMG_POR("item_dot",
239 PANNEL_COR_POR_REF1_X(4,1), PANNEL_COR_POR_REF1_Y(4,1),
240 PANNEL_COR_POR_REF2_X(4,1), PANNEL_COR_POR_REF2_Y(4,1),
241 "images/btn_type_a_10_nor.png", "images/btn_type_a_10_press.png",
243 KEYPAD_KEY_IMG_POR("item_neg",
244 PANNEL_COR_POR_REF1_X(4,2), PANNEL_COR_POR_REF1_Y(4,2),
245 PANNEL_COR_POR_REF2_X(4,2), PANNEL_COR_POR_REF2_Y(4,2),
246 "images/btn_type_a_09_nor.png", "images/btn_type_a_09_press.png",
248 KEYPAD_KEY_IMG_POR("item_eq",
249 PANNEL_COR_POR_REF1_X(4,3), PANNEL_COR_POR_REF1_Y(4,4),
250 PANNEL_COR_POR_REF2_X(4,3), PANNEL_COR_POR_REF2_Y(4,4),
251 "images/btn_type_a_08_nor.png", "images/btn_type_a_08_press.png",
260 set_int(pannel_state, 1);
265 name:"icon_tween_down";
266 action: STATE_SET "open" 0.0;
267 transition: ACCELERATE 0.4;
268 target: "pannel/icon";
272 name:"icon_tween_up";
273 action: STATE_SET "default" 0.0;
274 transition: ACCELERATE 0.3;
275 target: "pannel/icon";
278 /* pannel open/close program */
281 name: "icon_click2_down";
282 signal: "mouse,down,1";
283 source: "pannel/icon";
285 if (get_int(pannel_state) == 1) {
286 set_state(PART:"pannel/icon", "default_press", 0.0);
288 set_state(PART:"pannel/icon", "open_press", 0.0);
294 name: "icon_click2_up";
295 signal: "mouse,up,1";
296 source: "pannel/icon";
298 if (get_int(pannel_state) == 1) {
299 run_program(PROGRAM:"icon_tween_down");
300 emit("pannel,down", "por");
301 set_int(pannel_state, 0);
303 run_program(PROGRAM:"icon_tween_up");
304 emit("pannel,up", "por");
305 set_int(pannel_state, 1);
313 signal: "pannel,flick";
316 if (get_int(pannel_state) == 1) {
317 emit("pannel,down", "por");
318 set_state(PART:"pannel/icon", "open", 0.0);
319 set_int(pannel_state, 0);
321 emit("pannel,up", "por");
322 set_state(PART:"pannel/icon", "default", 0.0);
323 set_int(pannel_state, 1);
330 signal: "pannel,down";
332 action: STATE_SET "down" 0.0;
333 target: "por_pannel/in";
334 target: "por_pannel/BG";
335 transition: ACCELERATE 0.4;
336 after: "check_icon_open";
339 name: "pannel/down_i";
340 signal: "pannel,down_i";
342 action: STATE_SET "down" 0.0;
343 target: "por_pannel/in";
344 target: "por_pannel/BG";
345 after: "check_icon_open";
351 action: STATE_SET "default" 0.0;
352 target: "por_pannel/in";
353 target: "por_pannel/BG";
354 transition: ACCELERATE 0.3;
355 after: "check_icon_default";
359 name: "check_icon_open";
361 if (get_int(pannel_state) == 1) {
362 set_state(PART:"pannel/icon", "open", 0.0);
363 set_int(pannel_state, 0);
369 name: "check_icon_default";
371 if (get_int(pannel_state) == 0) {
372 set_state(PART:"pannel/icon", "default", 0.0);
373 set_int(pannel_state, 1);
378 /* programs for pennel items */
379 KEYPAD_KEY_PROG_POR("item_c");
380 KEYPAD_KEY_PROG_POR("item_div");
381 KEYPAD_KEY_PROG_POR("item_mul");
382 KEYPAD_KEY_PROG_POR("item_del");
384 KEYPAD_KEY_PROG_POR("item_num7");
385 KEYPAD_KEY_PROG_POR("item_num8");
386 KEYPAD_KEY_PROG_POR("item_num9");
387 KEYPAD_KEY_PROG_POR("item_sub");
389 KEYPAD_KEY_PROG_POR("item_num4");
390 KEYPAD_KEY_PROG_POR("item_num5");
391 KEYPAD_KEY_PROG_POR("item_num6");
392 KEYPAD_KEY_PROG_POR("item_plus");
394 KEYPAD_KEY_PROG_POR("item_num1");
395 KEYPAD_KEY_PROG_POR("item_num2");
396 KEYPAD_KEY_PROG_POR("item_num3");
397 KEYPAD_KEY_PROG_POR("item_brack");
399 KEYPAD_KEY_PROG_POR("item_dot");
400 KEYPAD_KEY_PROG_POR("item_num0");
401 KEYPAD_KEY_PROG_POR("item_neg");
402 KEYPAD_KEY_PROG_POR("item_eq");
405 ///////////////////// prtrait pannel finish ////////////////////////////////////////