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