77c1f33322b7396b8ff13ade08ea67cfb598e27b
[apps/core/preloaded/calendar.git] / data / edc / layout / extended-edc.h
1 /*
2   *
3   *  Copyright 2012  Samsung Electronics Co., Ltd
4   *
5   *  Licensed under the Flora License, Version 1.0 (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
8   *
9   *       http://floralicense.org/license/
10   *
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.
16   */
17
18 #ifndef __CALENDAR_EXTENDED_EDC_H__
19 #define __CALENDAR_EXTENDED_EDC_H__
20
21 #define PPART PART:
22 #define PIMAGE IMAGE:
23
24 /***********************************************************************/
25 /* size difinition layer */
26 #define PART_BG(iName)\
27 part {\
28     name: iName;\
29     type: RECT;\
30     mouse_events: 0;\
31     scale: 1;\
32     description {\
33         state: "default" 0.0;\
34         color: 0 0 0 0;\
35     } \
36 } \
37
38 #define PART_BG_EX(iName, iMinx, iMiny)\
39 part {\
40     name: iName;\
41     type: RECT;\
42     mouse_events: 0;\
43     scale: 1;\
44     description {\
45         state: "default" 0.0;\
46         min: iMinx iMiny;\
47         color: 0 0 0 0;\
48     } \
49 } \
50
51 #define PART_RECT(iName, iR1x, iR1y, iR1t, iR2x, iR2y, iR2t)\
52 part {\
53     name: iName;\
54     type: RECT;\
55     mouse_events: 0;\
56     scale: 1;\
57     description {\
58         state: "default" 0.0;\
59         rel1 { relative: iR1x iR1y; to: iR1t; } \
60         rel2 { relative: iR2x iR2y; to: iR2t; } \
61         color: 0 0 0 0;\
62     } \
63 } \
64
65 #define PART_V_PIXEL_RECT(iName, size, iTo, iRy, iAy)\
66 part {\
67     name: iName;\
68     type: RECT;\
69     mouse_events: 0;\
70     scale: 1;\
71     description {\
72         state: "default" 0.0;\
73         min: 0 size;\
74         align: 0.5 iAy;\
75         fixed: 0 1;\
76         rel1 { relative: 0.0 iRy; to: iTo; } \
77         rel2 { relative: 1.0 iRy; to: iTo; } \
78         color: 0 0 0 0;\
79     } \
80 } \
81
82 #define PART_H_PIXEL_RECT(iName, size, iTo, iRx, iAx)\
83 part {\
84     name: iName;\
85     type: RECT;\
86     mouse_events: 0;\
87     scale: 1;\
88     description {\
89         state: "default" 0.0;\
90         min: size 0;\
91         align: iAx 0.5;\
92         fixed: 1 0;\
93         rel1 { relative: iRx 0.0; to: iTo; } \
94         rel2 { relative: iRx 1.0; to: iTo; } \
95         color: 0 0 0 0;\
96     } \
97 } \
98
99 #define PART_PIXEL_RECT(iName, iX, iY, iRx, iRy, iTo, iAx, iAy)\
100 part {\
101     name: iName;\
102     type: RECT;\
103     mouse_events: 0;\
104     scale: 1;\
105     description {\
106         state: "default" 0.0;\
107         min: iX iY;\
108         align: iAx iAy;\
109         fixed: 1 1;\
110         rel1 { relative: iRx iRy; to: iTo; } \
111         rel2 { relative: iRx iRy; to: iTo; } \
112         color: 0 0 0 0;\
113     } \
114 } \
115
116
117 /* vertical divided rect, index range from 0~N-1
118  * iIndex must be immediate integer and expression like (1+2) is not allowed
119  */
120 #define PART_V_DIVID_RECT(iName, iTo, iIndex, iN)\
121 part {\
122     name: iName;\
123     type: RECT;\
124     mouse_events: 0;\
125     scale: 1;\
126     description {\
127         state: "default" 0.0;\
128         rel1 { relative: 0.0 (iIndex%iN)/iN; to: iTo; } \
129         rel2 { relative: 1.0 (iIndex%iN+1)/iN; to: iTo; } \
130         color: 0 0 0 0;\
131     } \
132 } \
133
134 /* horizontal divided rect, index range from 0~N-1
135  * iIndex must be immediate integer and expression like (1+2) is not allowed
136  */
137 #define PART_H_DIVID_RECT(iName, iTo, iIndex, iN)\
138 part {\
139     name: iName;\
140     type: RECT;\
141     mouse_events: 0;\
142     scale: 1;\
143     description {\
144         state: "default" 0.0;\
145         rel1 { relative: (iIndex%iN)/iN 0.0; to: iTo; } \
146         rel2 { relative: (iIndex%iN+1)/iN 1.0; to: iTo; } \
147         color: 0 0 0 0;\
148     } \
149 } \
150
151 #define PART_CLIPPER_RECT(iName, iR1x, iR1y, iR1t, iR2x, iR2y, iR2t)\
152 part {\
153     name: iName;\
154     type: RECT;\
155     mouse_events: 0;\
156     scale: 1;\
157     description {\
158         state: "default" 0.0;\
159         rel1 { relative: iR1x iR1y; to: iR1t; } \
160         rel2 { relative: iR2x iR2y; to: iR2t; } \
161         color: 255 255 255 255;\
162     } \
163 } \
164
165 /***********************************************************************/
166 /* mouse event filter layer */
167 #define PART_EVENT_RECT(iName, iTo)\
168 part {\
169     name: iName;\
170     type: RECT;\
171     mouse_events: 1;\
172     scale: 1;\
173     description {\
174         state: "default" 0.0;\
175         rel1 { relative: 0.0 0.0; to: iTo; } \
176         rel2 { relative: 1.0 1.0; to: iTo; } \
177         color: 0 0 0 0;\
178     } \
179 } \
180
181 /***********************************************************************/
182 /* content layer */
183 #define PART_COLOR_RECT(iName, iTo, iCr, iCg, iCb, iCa)\
184 part {\
185     name: iName;\
186     type: RECT;\
187     mouse_events: 0;\
188     scale: 1;\
189     description {\
190         state: "default" 0.0;\
191         rel1 { relative: 0.0 0.0; to: iTo; } \
192         rel2 { relative: 1.0 1.0; to: iTo; } \
193         color: iCr iCg iCb iCa;\
194     } \
195 } \
196
197 #define PART_IMAGE(iName, iTo, iImage)\
198 part {\
199     name: iName;\
200     type: IMAGE;\
201     mouse_events: 0;\
202     scale: 1;\
203     description {\
204         state: "default" 0.0;\
205         rel1 { relative: 0.0 0.0; to: iTo; } \
206         rel2 { relative: 1.0 1.0; to: iTo; } \
207         image.normal : iImage;\
208     } \
209 } \
210
211 #define PART_IMAGE_REL(iName, iImage, iR1x, iR1y, iR1t, iR2x, iR2y, iR2t)\
212 PART_RECT("_"iName, iR1x, iR1y, iR1t, iR2x, iR2y, iR2t)\
213 PART_IMAGE(iName, "_"iName, iImage)\
214
215 #define PART_BORDER_IMAGE(iName, iTo, iImage, iBl, iBr, iBt, iBb)\
216 part {\
217     name: iName;\
218     type: IMAGE;\
219     mouse_events: 0;\
220     scale: 1;\
221     description {\
222         state: "default" 0.0;\
223         rel1 { relative: 0.0 0.0; to: iTo; } \
224         rel2 { relative: 1.0 1.0; to: iTo; } \
225         image.normal : iImage;\
226         image.border : iBl iBr iBt iBb;\
227     } \
228 } \
229
230 #define PART_SWALLOW(iName, iTo)\
231 part {\
232     name: iName;\
233     type: SWALLOW;\
234     mouse_events: 1;\
235     scale: 1;\
236     description {\
237         state: "default" 0.0;\
238         rel1 { relative: 0.0 0.0; to: iTo; } \
239         rel2 { relative: 1.0 1.0; to: iTo; } \
240     } \
241 } \
242
243 #define PART_SWALLOW_REL(iName, iR1x, iR1y, iR1t, iR2x, iR2y, iR2t)\
244 PART_RECT("_"iName, iR1x, iR1y, iR1t, iR2x, iR2y, iR2t)\
245 PART_SWALLOW(iName, "_"iName)\
246
247 #define PART_UNVISIBLE_SWALLOW(iName, iTo)\
248 part {\
249     name: iName;\
250     type: SWALLOW;\
251     mouse_events: 1;\
252     scale: 1;\
253     description {\
254         state: "default" 0.0;\
255         visible: 0;\
256         rel1 { relative: 0.0 0.0; to: iTo; } \
257         rel2 { relative: 1.0 1.0; to: iTo; } \
258     } \
259 } \
260
261 #define PART_UNVISIBLE_SWALLOW_REL(iName, iR1x, iR1y, iR1t, iR2x, iR2y, iR2t)\
262 PART_RECT("_"iName, iR1x, iR1y, iR1t, iR2x, iR2y, iR2t)\
263 PART_UNVISIBLE_SWALLOW(iName, "_"iName)\
264
265 #define PART_CLIPPED_SWALLOW(iName, iR1x, iR1y, iR1t, iR2x, iR2y, iR2t,\
266         iAx, iAy, iCliper)\
267 part {\
268     name: iName;\
269     type: SWALLOW;\
270     mouse_events: 0;\
271     scale: 1;\
272     clip_to: iCliper;\
273     description {\
274         state: "default" 0.0;\
275         align: iAx iAy;\
276         fixed: 1 1;\
277         rel1 { relative: iR1x iR1y; to: iR1t; } \
278         rel2 { relative: iR2x iR2y; to: iR2t; } \
279     } \
280 } \
281
282 #define PART_TEXT(iName, iTo, iText, iFont, iSize,\
283         iAx, iAy, iCr, iCg, iCb, iCa)\
284 part {\
285     name: iName;\
286     type: TEXT;\
287     mouse_events: 0;\
288     scale: 1;\
289     description {\
290         state: "default" 0.0;\
291         rel1 { relative: 0.0 0.0; to: iTo; } \
292         rel2 { relative: 1.0 1.0; to: iTo; } \
293         color: iCr iCg iCb iCa;\
294         text {\
295             text: iText;\
296             font: iFont;\
297             size: iSize;\
298             align: iAx iAy;\
299         } \
300     } \
301 } \
302
303 #define PART_TEXT_REL(iName, iR1x, iR1y, iR1t, iR2x, iR2y, iR2t,\
304         iText, iFont, iSize, iAx, iAy, iCr, iCg, iCb, iCa)\
305 PART_RECT("_"iName, iR1x, iR1y, iR1t, iR2x, iR2y, iR2t)\
306 PART_TEXT(iName, "_"iName, iText, iFont, iSize, iAx, iAy, iCr, iCg, iCb, iCa)\
307
308 /***********************************************************************/
309 /* script */
310 #define SCRIPT_CUSTOM_PART(iPart)\
311 custom_state(PPART#iPart, "default", 0.0);\
312 set_state(PPART#iPart, "custom", 0.0)
313
314 #define SCRIPT_SET_REL(iPart, iR1x, iR1y, iR1t, iR2x, iR2y, iR2t)\
315 set_state_val(PPART#iPart, STATE_REL1, iR1x, iR1y);\
316 set_state_val(PPART#iPart, STATE_REL1_TO, PPART#iR1t, PPART#iR1t);\
317 set_state_val(PPART#iPart, STATE_REL2, iR2x, iR2y);\
318 set_state_val(PPART#iPart, STATE_REL2_TO, PPART#iR2t, PPART#iR2t)\
319
320 #define SCRIPT_SET_VISIBLE(iPart, iV)\
321 set_state_val(PPART#iPart, STATE_VISIBLE, iV)
322
323 #define SCRIPT_SET_IMAGE(iPart, iV)\
324 set_state_val(PPART#iPart, STATE_IMAGE, PIMAGE#iV)
325
326 /***********************************************************************/
327 /* program */
328 #define PROGRAM_STATE_SET(isignal, isource, itarget, istate)\
329 program {\
330     name: #isource#isignal;\
331     source: #isource;\
332     signal: #isignal;\
333     action: STATE_SET #istate 0.0;\
334     target: #itarget;\
335 } \
336
337 #define PROGRAM_SET_VISIBLE(isignal, isource, iPart, iV)\
338 program {\
339     name: #isource#isignal;\
340     source: #isource;\
341     signal: #isignal;\
342     script {\
343         SCRIPT_SET_VISIBLE(iPart, iV);\
344     } \
345 } \
346
347 #define PROGRAM_SET_IMAGE(iname, isignal, isource, iPart, image)\
348 program {\
349     name: iname;\
350     source: isource;\
351     signal: isignal;\
352     script {\
353         set_state_val(PPART#iPart, STATE_IMAGE, PIMAGE#image);\
354     } \
355 } \
356
357 #define PROGRAM_SET_INT(iname, isignal, isource, var, value)\
358 program {\
359     name: iname;\
360     source: isource;\
361     signal: isignal;\
362     script {\
363         set_int(var, value);\
364     } \
365 } \
366
367 #endif /* __CALENDAR_EXTENDED_EDC_H__ */