2 * Copyright 2012 Samsung Electronics Co., Ltd
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
8 * http://floralicense.org/license/
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 #include "../include/edc_string.h"
21 #define BACKGROUND_IMAGE(part_name, x, y, w, h, img) \
26 state: "default" 0.0;\
27 rel1 { relative: (x)/MAIN_W (y)/MAIN_H; } \
28 rel2 { relative: (x+w)/MAIN_W (y+h)/MAIN_H; } \
29 image { normal: img; } \
32 #define BACKGROUND_IMAGE_WITH_ALPHA(part_name, x, y, w, h, img, alpha) \
37 state: "default" 0.0;\
38 rel1 { relative: (x)/MAIN_W (y)/MAIN_H; } \
39 rel2 { relative: (x+w)/MAIN_W (y+h)/MAIN_H; } \
40 image { normal: img; }\
41 color: 255 255 255 alpha; \
45 #define VER_BACKGROUND_IMAGE(part_name, x, y, w, h, img) \
50 state: "default" 0.0;\
51 rel1 { relative: (x)/VER_MAIN_W (y)/VER_MAIN_H; } \
52 rel2 { relative: (x+w)/VER_MAIN_W (y+h)/VER_MAIN_H; } \
53 image { normal: img; } \
57 #define GENERAL_BUTTON(part_name, x, y, w, h, img_dim, img, img_p, img_s) \
63 state: "default" 0.0;\
64 rel1 { relative: (x)/MAIN_W (y)/MAIN_H; } \
65 rel2 { relative: (x+w)/MAIN_W (y+h)/MAIN_H; } \
66 image { normal: img; } \
70 inherit: "default" 0.0; \
71 image { normal: img_p; }\
74 state: "selected" 0.0; \
75 inherit: "default" 0.0; \
76 image { normal: img_s; }\
80 inherit: "default" 0.0; \
81 image { normal: img_dim;} \
84 state: "invisible" 0.0; \
85 inherit: "default" 0.0; \
90 #define VER_GENERAL_BUTTON(part_name, x, y, w, h, img_dim, img, img_p, img_s) \
96 state: "default" 0.0;\
97 rel1 { relative: (x)/VER_MAIN_W (y)/VER_MAIN_H; } \
98 rel2 { relative: (x+w)/VER_MAIN_W (y+h)/VER_MAIN_H; } \
99 image { normal: img; } \
102 state: "press" 0.0; \
103 inherit: "default" 0.0; \
104 image { normal: img_p; }\
107 state: "selected" 0.0; \
108 inherit: "default" 0.0; \
109 image { normal: img_s; }\
113 inherit: "default" 0.0; \
114 image { normal: img_dim;} \
117 state: "invisible" 0.0; \
118 inherit: "default" 0.0; \
123 #define GENERAL_BUTTON_PROGRAMS(part_name, signal_name, source_name) \
125 name: "lbutton_down_"part_name; \
126 signal: "mouse,down,1"; \
131 get_state(PART:part_name, st, 30, vl);\
132 if (strcmp(st, "dim") != 0) \
134 set_state(PART:part_name, "press", 0.0);\
135 emit( HAPTIC_SIG, HAPTIC_SIG_SRC );\
140 name: "lbutton_send_event_"part_name; \
141 signal: "mouse,clicked,1"; \
146 get_state(PART:part_name, st, 30, vl);\
147 if (strcmp(st, "dim") != 0) \
148 emit( signal_name, source_name );\
152 name: "lbutton_up_"part_name; \
153 signal: "mouse,up,1"; \
158 get_state(PART:part_name, st, 30, vl);\
159 if (strcmp(st, "dim") != 0) \
160 set_state(PART:part_name, "default", 0.0);\