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