Tizen 2.1 base
[apps/core/preloaded/calendar.git] / data / edc / layout / inc.main.year.edc
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 //480 x 620
19 //base_real 690x850
20 //HD size 720x1280
21 #define HD_SCALE 800/1280
22 #define WIDTH_OF_YEAR_VIEW (WIDTH_OF_HD-PAD)
23 #define PAD 15
24
25 #define PAD_L (32*R_X_L)
26 #define WIDTH_OF_YEAR_VIEW_L (WIDTH_OF_HD_L-PAD_L)
27
28 #define MB(_pos) \
29         part { name, "mb/"#_pos"/base"; \
30                 type, RECT; \
31                 description { \
32                         state, "default" 0.0; \
33                         rel1 { \
34                                 relative, (_pos % 3 / 3) \
35                                         (_pos / 3 / 4 - _pos % 3 / 3 / 4); \
36                                 to, "base_real"; \
37                         } \
38                         rel2 { \
39                                 relative, (_pos % 3 / 3 + 1 / 3) \
40                                         (_pos / 3 / 4 - _pos % 3 / 3 / 4 + 1 / 4); \
41                                 to, "base_real"; \
42                         } \
43                         color, 0 0 0 0; \
44                 } \
45         } \
46         part { name, "mb/"#_pos"/sel"; \
47                 mouse_events, 0; \
48                 scale, 1; \
49                 description { \
50                         state, "default" 0.0; \
51                         rel1.to, "mb/"#_pos"/base"; \
52                         rel2 { \
53                                 offset, 0 0; \
54                                 to, "mb/"#_pos"/base"; \
55                         } \
56                         image { \
57                                 normal, CALENDAR_YEAR_MONTH_SELSECTED; \
58                                 border, 3 3 3 3; \
59                                 border_scale, 1; \
60                         } \
61                         visible, 0; \
62                 } \
63                 description { \
64                         state, "selected" 0.0; \
65                         inherit, "default" 0.0; \
66                         visible, 1; \
67                 } \
68         } \
69         part { name, "mb/"#_pos"/bg"; \
70                 mouse_events, 0; \
71                 scale, 1; \
72                 description { \
73                         state, "default" 0.0; \
74                         rel1.to, "mb/"#_pos"/base"; \
75                         rel2 { \
76                                 offset, 0 0; \
77                                 to, "mb/"#_pos"/base"; \
78                         } \
79                         image.normal, CALENDAR_WEEK_VIEW_PRESS; \
80                         visible, 0; \
81                 } \
82                 description { \
83                         state, "selected" 0.0; \
84                         inherit, "default" 0.0; \
85                         visible, 0; \
86                 } \
87         } \
88         part { name, "mb/"#_pos"/text"; \
89                 type, TEXT; \
90                 mouse_events, 0; \
91                 scale, 1; \
92                 description { \
93                         state, "default" 0.0; \
94                         rel1.to, "mb/"#_pos"/base"; \
95                         rel2 { \
96                                 relative, 1.0 0.15; \
97                                 to, "mb/"#_pos"/base"; \
98                         } \
99                         text { \
100                                 font, "SLP:style=Medium"; \
101                                 size, 22; \
102                                 align, 0.5 0.5; \
103                         } \
104                         color, 0 0 0 255; \
105                 } \
106                 description { \
107                         state, "selected" 0.0; \
108                         inherit, "default" 0.0; \
109                         color, 255 255 255 255; \
110                 } \
111         } \
112         part { name, "mb/"#_pos"/line"; \
113                 type, RECT; \
114                 description { \
115                         state, "default" 0.0; \
116                         min, 0 2; \
117                         fixed: 0 1; \
118                         align: 0.0 0.0; \
119                         rel1 { \
120                                 relative, 0.01 1.0;\
121                                 to_x, "mb/"#_pos"/base"; \
122                                 to_y, "mb/"#_pos"/text"; \
123                         } \
124                         rel2 { \
125                                 relative, 0.98 1.0;\
126                                 to_x, "mb/"#_pos"/base"; \
127                                 to_y, "mb/"#_pos"/text"; \
128                         } \
129                         color, COLOR_OF_LINE_FOR_YEAR_CAL; \
130                         visible, 1; \
131                 } \
132                 description { \
133                         state, "selected" 0.0; \
134                         inherit, "default" 0.0; \
135                         visible, 0; \
136                 } \
137         } \
138         part { name, "mb/"#_pos"/sw"; \
139                 type, SWALLOW; \
140                 mouse_events, 0; \
141                 description { \
142                         state, "default" 0.0; \
143                         rel1 { \
144                                 relative, 0.0 1.0;\
145                                 to_x, "mb/"#_pos"/base"; \
146                                 to_y, "mb/"#_pos"/line"; \
147                         } \
148                         rel2 { \
149                                 relative, 1.0 1.0;\
150                                 to_x, "mb/"#_pos"/base"; \
151                                 to_y, "mb/"#_pos"/base"; \
152                         } \
153                 } \
154         } \
155         programs { \
156                 program { name, "mb/"#_pos"/down"; \
157                         signal, "mouse,down,1"; \
158                         source, "mb/"#_pos"/base"; \
159                         action, STATE_SET "selected" 0.0; \
160                         target, "mb/"#_pos"/bg"; \
161                 } \
162                 program { name, "mb/"#_pos"/up"; \
163                         signal, "mouse,up,1"; \
164                         source, "mb/"#_pos"/base"; \
165                         action, STATE_SET "default" 0.0; \
166                         target, "mb/"#_pos"/bg"; \
167                 } \
168                 program { name, "mb/"#_pos"/click"; \
169                         signal, "mouse,clicked,1"; \
170                         source, "mb/"#_pos"/base"; \
171                         action, SIGNAL_EMIT #_pos "cal"; \
172                 } \
173                 program { name, "mb/"#_pos"/select"; \
174                         signal, "select,"#_pos; \
175                         source, "prog"; \
176                         action, STATE_SET "selected" 0.0; \
177                         target, "mb/"#_pos"/sel"; \
178                         target, "mb/"#_pos"/text"; \
179                         target, "mb/"#_pos"/line"; \
180                 } \
181                 program { name, "mb/"#_pos"/unselect"; \
182                         signal, "unselect,"#_pos; \
183                         source, "prog"; \
184                         action, STATE_SET "default" 0.0; \
185                         target, "mb/"#_pos"/sel"; \
186                         target, "mb/"#_pos"/text"; \
187                         target, "mb/"#_pos"/line"; \
188                 } \
189         }
190
191 #define HANDLE(_pos) \
192         part { name, "handle/"#_pos"/sw"; \
193                 type, SWALLOW; \
194                 description { \
195                         state, "default" 0.0; \
196                         rel1 { \
197                                 relative, (_pos % 3 / 3) \
198                                         (_pos / 3 / 4 - _pos % 3 / 3 / 4); \
199                                 to, "base"; \
200                         } \
201                         rel2 { \
202                                 relative, (_pos % 3 / 3 + 1 / 3) \
203                                         (_pos / 3 / 4 - _pos % 3 / 3 / 4 + 1 / 4); \
204                                 to, "base"; \
205                         } \
206                 } \
207         } \
208
209 group { name, "year/layout";
210
211         parts {
212
213                 part { name, "base";
214                         type, RECT;
215                         description {
216                                 state, "default" 0.0;
217                                 color, 0 0 0 0;
218                                 rel1 { relative, 0.0 0.0; }
219                                 rel2 { relative, 1.0 1.0; }
220                         }
221                 }
222
223                 part { name, "content";
224                         type, SWALLOW;
225                         clip_to, "clip";
226                         description {
227                                 state, "default" 0.0;
228                                 rel1.to, "base";
229                                 rel2.to, "base";
230                         }
231                 }
232
233                 part { name, "edje/handle";
234                         type, SWALLOW;
235                         clip_to, "clip";
236                         description {
237                                 state, "default" 0.0;
238                                 rel1.to, "base";
239                                 rel2.to, "base";
240                         }
241                 }
242
243                 part { name, "content/left";
244                         type, SWALLOW;
245                         clip_to, "clip";
246                         description {
247                                 state, "default" 0.0;
248                                 rel1 { relative, -1.0 0.0; to, "content"; }
249                                 rel2 { relative, 0.0 1.0; to, "content";}
250                         }
251                 }
252
253                 part { name, "content/right";
254                         type, SWALLOW;
255                         clip_to, "clip";
256                         description {
257                                 state, "default" 0.0;
258                                 rel1 { relative, 1.0 0.0; to, "content"; }
259                                 rel2 { relative, 2.0 1.0; to, "content";}
260                         }
261                 }
262
263                 part { name, "clip";
264                         type, RECT;
265                         description {
266                                 state, "default" 0.0;
267                                 rel1.to, "content";
268                                 rel2.to, "content";
269                         }
270                 }
271         }
272
273 }
274
275 group { name, "year/edje/handle";
276
277         parts {
278
279                 part { name, "base";
280                         type, RECT;
281                         description {
282                                 state, "default" 0.0;
283                                 color, 0 0 0 0;
284                                 rel1 { relative, 0.0 0.0; }
285                                 rel2 { relative, 1.0 1.0; }
286                         }
287                 }
288
289                 HANDLE(0) HANDLE(1) HANDLE(2)
290                 HANDLE(3) HANDLE(4) HANDLE(5)
291                 HANDLE(6) HANDLE(7) HANDLE(8)
292                 HANDLE(9) HANDLE(10) HANDLE(11)
293         }
294 }
295
296 group { name, "main/year/months";
297
298         images {
299                 image, "calendar_selected.png" COMP;
300                 image, "57_calendar_week_view_press.png" COMP;
301                 image, CALENDAR_YEAR_MONTH_SELSECTED COMP;
302         }
303
304         parts {
305                 part { name, "base";
306                         type, RECT;
307                         description {
308                                 state, "default" 0.0;
309                                 color, 248 246 239 255;
310                         }
311                 }
312                 part { name, "base_real";
313                         type, RECT;
314                         description {
315                                 state, "default" 0.0;
316                                 rel1 { relative, PAD/WIDTH_OF_HD 0/HEIGHT_OF_HD; }
317                                 rel2 { relative, WIDTH_OF_YEAR_VIEW/WIDTH_OF_HD HEIGHT_OF_HD/HEIGHT_OF_HD; }
318                                 color, 0 0 0 0;
319                         }
320                 }
321
322                 MB(0) MB(1) MB(2)
323                 MB(3) MB(4) MB(5)
324                 MB(6) MB(7) MB(8)
325                 MB(9) MB(10) MB(11)
326         }
327 }
328
329 #define MB_L(_pos) \
330         part { name, "mb/"#_pos"/base"; \
331                 type, RECT; \
332                 description { \
333                         state, "default" 0.0; \
334                         rel1 { \
335                                 relative, (_pos % 4 / 4) \
336                                         (_pos / 4 / 3 - _pos % 4 / 4/ 3); \
337                                 to, "base_real"; \
338                         } \
339                         rel2 { \
340                                 relative, (_pos % 4 / 4 + 1 / 4) \
341                                         (_pos / 4 / 3 - _pos % 4 / 4 / 3 + 1 / 3); \
342                                 to, "base_real"; \
343                         } \
344                         color, 0 0 0 0; \
345                 } \
346         } \
347         part { name, "mb/"#_pos"/sel"; \
348                 mouse_events, 0; \
349                 scale, 1; \
350                 description { \
351                         state, "default" 0.0; \
352                         rel1.to, "mb/"#_pos"/base"; \
353                         rel2 { \
354                                 offset, 0 0; \
355                                 to, "mb/"#_pos"/base"; \
356                         } \
357                         image { \
358                                 normal, CALENDAR_YEAR_MONTH_SELSECTED; \
359                                 border, 3 3 3 3; \
360                                 border_scale, 1; \
361                         } \
362                         visible, 0; \
363                 } \
364                 description { \
365                         state, "selected" 0.0; \
366                         inherit, "default" 0.0; \
367                         visible, 1; \
368                 } \
369         } \
370         part { name, "mb/"#_pos"/bg"; \
371                 mouse_events, 0; \
372                 scale, 1; \
373                 description { \
374                         state, "default" 0.0; \
375                         rel1.to, "mb/"#_pos"/base"; \
376                         rel2 { \
377                                 offset, 0 0; \
378                                 to, "mb/"#_pos"/base"; \
379                         } \
380                         image.normal, CALENDAR_WEEK_VIEW_PRESS; \
381                         visible, 0; \
382                 } \
383                 description { \
384                         state, "selected" 0.0; \
385                         inherit, "default" 0.0; \
386                         visible, 0; \
387                 } \
388         } \
389         part { name, "mb/"#_pos"/text"; \
390                 type, TEXT; \
391                 mouse_events, 0; \
392                 scale, 1; \
393                 description { \
394                         state, "default" 0.0; \
395                         rel1.to, "mb/"#_pos"/base"; \
396                         rel2 { \
397                                 relative, 1.0 0.15; \
398                                 to, "mb/"#_pos"/base"; \
399                         } \
400                         text { \
401                                 font, "SLP:style=Medium"; \
402                                 size, 22; \
403                                 align, 0.5 0.5; \
404                         } \
405                         color, 0 0 0 255; \
406                 } \
407                 description { \
408                         state, "selected" 0.0; \
409                         inherit, "default" 0.0; \
410                         color, 255 255 255 255; \
411                 } \
412         } \
413         part { name, "mb/"#_pos"/line"; \
414                 type, RECT; \
415                 description { \
416                         state, "default" 0.0; \
417                         min, 0 2; \
418                         fixed: 0 1; \
419                         align: 0.0 0.0; \
420                         rel1 { \
421                                 relative, 0.02 1.0;\
422                                 to_x, "mb/"#_pos"/base"; \
423                                 to_y, "mb/"#_pos"/text"; \
424                         } \
425                         rel2 { \
426                                 relative, 0.98 1.0;\
427                                 to_x, "mb/"#_pos"/base"; \
428                                 to_y, "mb/"#_pos"/text"; \
429                         } \
430                         color, COLOR_OF_LINE_FOR_YEAR_CAL; \
431                         visible, 1; \
432                 } \
433                 description { \
434                         state, "selected" 0.0; \
435                         inherit, "default" 0.0; \
436                         visible, 0; \
437                 } \
438         } \
439         part { name, "mb/"#_pos"/sw"; \
440                 type, SWALLOW; \
441                 mouse_events, 0; \
442                 description { \
443                         state, "default" 0.0; \
444                         rel1 { \
445                                 relative, 0.0 1.0;\
446                                 to_x, "mb/"#_pos"/base"; \
447                                 to_y, "mb/"#_pos"/line"; \
448                         } \
449                         rel2 { \
450                                 relative, 1.0 1.0;\
451                                 to_x, "mb/"#_pos"/base"; \
452                                 to_y, "mb/"#_pos"/base"; \
453                         } \
454                 } \
455         } \
456         programs { \
457                 program { name, "mb/"#_pos"/down"; \
458                         signal, "mouse,down,1"; \
459                         source, "mb/"#_pos"/base"; \
460                         action, STATE_SET "selected" 0.0; \
461                         target, "mb/"#_pos"/bg"; \
462                 } \
463                 program { name, "mb/"#_pos"/up"; \
464                         signal, "mouse,up,1"; \
465                         source, "mb/"#_pos"/base"; \
466                         action, STATE_SET "default" 0.0; \
467                         target, "mb/"#_pos"/bg"; \
468                 } \
469                 program { name, "mb/"#_pos"/click"; \
470                         signal, "mouse,clicked,1"; \
471                         source, "mb/"#_pos"/base"; \
472                         action, SIGNAL_EMIT #_pos "cal"; \
473                 } \
474                 program { name, "mb/"#_pos"/select"; \
475                         signal, "select,"#_pos; \
476                         source, "prog"; \
477                         action, STATE_SET "selected" 0.0; \
478                         target, "mb/"#_pos"/sel"; \
479                         target, "mb/"#_pos"/text"; \
480                         target, "mb/"#_pos"/line"; \
481                 } \
482                 program { name, "mb/"#_pos"/unselect"; \
483                         signal, "unselect,"#_pos; \
484                         source, "prog"; \
485                         action, STATE_SET "default" 0.0; \
486                         target, "mb/"#_pos"/sel"; \
487                         target, "mb/"#_pos"/text"; \
488                         target, "mb/"#_pos"/line"; \
489                 } \
490         }
491
492 #define HANDLE_L(_pos) \
493         part { name, "handle/"#_pos"/sw"; \
494                 type, SWALLOW; \
495                 description { \
496                         state, "default" 0.0; \
497                         rel1 { \
498                                 relative, (_pos % 4 / 4) \
499                                         (_pos / 4 / 3 - _pos % 4 / 4 / 3); \
500                                 to, "base"; \
501                         } \
502                         rel2 { \
503                                 relative, (_pos % 4 / 4 + 1 / 4) \
504                                         (_pos / 4 / 3 - _pos % 4 / 4 / 3 + 1 / 3); \
505                                 to, "base"; \
506                         } \
507                 } \
508         } \
509
510 group { name, "year/edje/handle/l";
511
512         parts {
513
514                 part { name, "base";
515                         type, RECT;
516                         description {
517                                 state, "default" 0.0;
518                                 color, 0 0 0 0;
519                                 rel1 { relative, 0.0 0.0; }
520                                 rel2 { relative, 1.0 1.0; }
521                         }
522                 }
523
524                 HANDLE_L(0) HANDLE_L(1) HANDLE_L(2)
525                 HANDLE_L(3) HANDLE_L(4) HANDLE_L(5)
526                 HANDLE_L(6) HANDLE_L(7) HANDLE_L(8)
527                 HANDLE_L(9) HANDLE_L(10) HANDLE_L(11)
528         }
529 }
530
531 group { name, "main/year/months/l";
532
533         images {
534                 image, "calendar_selected.png" COMP;
535                 image, "57_calendar_week_view_press.png" COMP;
536                 image, CALENDAR_YEAR_MONTH_SELSECTED COMP;
537         }
538
539         parts {
540                 part { name, "base";
541                         type, RECT;
542                         description {
543                                 state, "default" 0.0;
544                                 color, 248 246 239 255;
545                         }
546                 }
547
548                 part { name, "base_real";
549                         type, RECT;
550                         description {
551                                 state, "default" 0.0;
552                                 rel1 { relative, PAD_L/WIDTH_OF_HD_L 0/HEIGHT_OF_HD_L; }
553                                 rel2 { relative, WIDTH_OF_YEAR_VIEW_L/WIDTH_OF_HD_L HEIGHT_OF_HD_L/HEIGHT_OF_HD_L; }
554                                 color, 0 0 0 0;
555                         }
556                 }
557
558                 MB_L(0) MB_L(1) MB_L(2)
559                 MB_L(3) MB_L(4) MB_L(5)
560                 MB_L(6) MB_L(7) MB_L(8)
561                 MB_L(9) MB_L(10) MB_L(11)
562         }
563 }