tizen 2.4 release
[framework/uifw/elementary.git] / data / themes / edc / clock.edc
1 group { name: "e/modules/clock/digital";
2    min: 64 16;
3    max: 512 128;
4    images.image: "digit_na.png" COMP;
5    images.image: "digit_nm.png" COMP;
6    images.image: "digit_0.png" COMP;
7    images.image: "digit_1.png" COMP;
8    images.image: "digit_2.png" COMP;
9    images.image: "digit_3.png" COMP;
10    images.image: "digit_4.png" COMP;
11    images.image: "digit_5.png" COMP;
12    images.image: "digit_6.png" COMP;
13    images.image: "digit_7.png" COMP;
14    images.image: "digit_8.png" COMP;
15    images.image: "digit_9.png" COMP;
16    images.image: "digit_am.png" COMP;
17    images.image: "digit_pm.png" COMP;
18    images.image: "hole_tiny.png" COMP;
19    script {
20       public do_seconds, do_24h, do_date, tick_timer;
21
22       evalsize() {
23          new do24h, dosec, v[14], i, tot, mul;
24          new parts[] = {
25             PART:"hours1", PART:"hours1",
26             PART:"hours2", PART:"hours2",
27             PART:"mins1", PART:"mins1",
28             PART:"mins2", PART:"mins2",
29             PART:"secs1", PART:"secs1",
30             PART:"secs2", PART:"secs2",
31             PART:"ampm", PART:"ampm"
32          };
33          
34          mul = 4;
35          if (get_int(do_date)) {
36             mul = 3;
37          }
38          
39          for (i = 0; i < 14; i += 2) {
40             custom_state(parts[i], "default", 0.0);
41          }
42          v[0] = 0; v[1] = 2; v[2] = 2; v[3] = 4; // hrs
43          v[4] = 5; v[5] = 7; v[6] = 7; v[7] = 9; // mins
44          tot = 9;
45          
46          dosec = get_int(do_seconds);
47          do24h = get_int(do_24h);
48          if ((dosec) && (!do24h)) { // sec + ampm
49             tot += 7;
50             v[8] = 10; v[9] = 12; v[10] = 12; v[11] = 14;
51             v[12] = 14; v[13] = 16;
52          }
53          else if ((dosec) && (do24h)) { // sec + -
54             tot += 5;
55             v[8] = 10; v[9] = 12; v[10] = 12; v[11] = 14;
56             v[12] = 0; v[13] = 0;
57          }
58          else if ((!dosec) && (!do24h)) { // - + ampm
59             tot += 2;
60             v[8] = 0; v[9] = 0; v[10] = 0; v[11] = 0;
61             v[12] = 9; v[13] = 11;
62          }
63          else if ((!dosec) && (do24h)) { // - + -
64             tot += 0;
65             v[8] = 0; v[9] = 0; v[10] = 0; v[11] = 0;
66             v[12] = 0; v[13] = 0;
67          }
68          for (i = 0; i < 14; i += 2) {
69             set_state_val(parts[i], STATE_REL1,
70                           float(v[i]) / float(tot), 0.0);
71             set_state_val(parts[i + 1], STATE_REL2,
72                           float(v[i + 1]) / float(tot), 1.0);
73          }
74          for (i = 0; i < 14; i += 2) {
75             set_state(parts[i], "custom", 0.0);
76          }
77          set_min_size(tot * mul, 16);
78          set_max_size(tot * 8 * mul, 128);
79          emit("e,state,sizing,changed", "");
80       }
81       reset() {
82          new tim;
83          
84          evalsize();
85          tim = get_int(tick_timer);
86          if (tim) {
87             cancel_timer(tim);
88             set_int(tick_timer, 0);
89          }
90          clock_cb(0);
91       }
92       valset(name[], v) {
93          new buf[20], i;
94          
95          for (i = 0; i < 10; i++) {
96             if (i == v) {
97                snprintf(buf, 20, "show,%s-%i", name, i);
98             }
99             else {
100                snprintf(buf, 20, "hide,%s-%i", name, i);
101             }
102             emit(buf, "c");
103          }
104       }
105       apvalset(id, pm) {
106          if (pm) set_state(id, "active", 0.0);
107          else set_state(id, "default", 0.0);
108       }
109       public clock_cb(val) {
110          new year, month, day, yearday, weekday, hour, minute;
111          new Float:second;
112          new v, dosec, do24h, tim;
113          
114          date(year, month, day, yearday, weekday, hour, minute, second);
115          dosec = get_int(do_seconds);
116          if (dosec) {
117             v = round(second);
118             tim = timer(1.0 - (second - v), "clock_cb", 1);
119             // set seconds to v
120             valset("s0", v / 10);
121             valset("s1", v % 10);
122          }
123          else {
124             tim = timer(60.0 - (second), "clock_cb", 1);
125          }
126          set_int(tick_timer, tim);
127          
128          // set minutes to minute
129          valset("m0", minute / 10);
130          valset("m1", minute % 10);
131          
132          // set hours to hour
133          do24h = get_int(do_24h);
134          if (do24h) {
135             valset("h0", hour / 10);
136             valset("h1", hour % 10);
137          }
138          else {
139             new pm;
140             
141             // if 12 or later, its pm
142             if (hour >= 12) {
143                pm = 1;
144                // if we are after 12 (1, 2, 3 etc.) then mod by 12
145                if (hour > 12) hour = hour % 12;
146             }
147             else {
148                pm = 0;
149                // make after midnight be 12:XX AM :)
150                if (hour == 0) hour = 12;
151             }
152             valset("h0", hour / 10);
153             valset("h1", hour % 10);
154             apvalset(PART:"ap", pm);
155          }
156       }
157    }
158    parts {
159       part { name: "secclip"; type: RECT;
160          description { state: "default" 0.0;
161          }
162          description { state: "hidden" 0.0;
163             visible: 0;
164          }
165       }
166       part { name: "ampmclip"; type: RECT;
167          description { state: "default" 0.0;
168          }
169          description { state: "hidden" 0.0;
170             visible: 0;
171          }
172       }
173       // XXX: hours1/2, mins1/2, secs1/2 and ampm SHOULD be spacers... but
174       // if they are calculations go weird. this shouldnt happen, but does.
175       part { name: "timearea"; type: RECT;
176          description { state: "default" 0.0;
177             visible: 0;
178          }
179          description { state: "date" 0.0;
180             inherit: "default" 0.0;
181             rel2.relative: 1.0 0.0;
182             rel2.offset: -1 4;
183             rel2.to_y: "e.text.today";
184          }
185       }
186       part { name: "hours1"; type: RECT;
187          description { state: "default" 0.0;
188             rel1.relative: (0/16) 0.0;
189             rel2.relative: (2/16) 1.0;
190             rel1.to: "timearea";
191             rel2.to: "timearea";
192             visible: 0;
193          }
194       }
195       part { name: "hours2"; type: RECT;
196          description { state: "default" 0.0;
197             rel1.relative: (2/16) 0.0;
198             rel2.relative: (4/16) 1.0;
199             rel1.to: "timearea";
200             rel2.to: "timearea";
201             visible: 0;
202          }
203       }
204       part { name: "mins1"; type: RECT;
205          description { state: "default" 0.0;
206             rel1.relative: (5/16) 0.0;
207             rel2.relative: (7/16) 1.0;
208             rel1.to: "timearea";
209             rel2.to: "timearea";
210             visible: 0;
211          }
212       }
213       part { name: "mins2"; type: RECT;
214          description { state: "default" 0.0;
215             rel1.relative: (7/16) 0.0;
216             rel2.relative: (9/16) 1.0;
217             rel1.to: "timearea";
218             rel2.to: "timearea";
219             visible: 0;
220          }
221       }
222       part { name: "secs1"; type: RECT;
223          description { state: "default" 0.0;
224             rel1.relative: (10/16) 0.0;
225             rel2.relative: (12/16) 1.0;
226             rel1.to: "timearea";
227             rel2.to: "timearea";
228             visible: 0;
229          }
230       }
231       part { name: "secs2"; type: RECT;
232          description { state: "default" 0.0;
233             rel1.relative: (12/16) 0.0;
234             rel2.relative: (14/16) 1.0;
235             rel1.to: "timearea";
236             rel2.to: "timearea";
237             visible: 0;
238          }
239       }
240       part { name: "ampm"; type: RECT;
241          description { state: "default" 0.0;
242             rel1.relative: (14/16) 0.0;
243             rel2.relative: (16/16) 1.0;
244             rel1.to: "timearea";
245             rel2.to: "timearea";
246             visible: 0;
247          }
248       }
249       part { name: "c00";
250          description { state: "default" 0.0;
251             rel1.to: "hours2";
252             rel1.relative: 1.0 0.5;
253             rel1.offset: 0 -2;
254             rel2.to: "mins1";
255             rel2.relative: 0.0 0.5;
256             rel2.offset: 0 -2;
257             align: 0.5 1.0;
258             FIXED_SIZE(4, 4)
259             image.normal: "hole_tiny.png";
260          }
261       }
262       part { name: "c01";
263          description { state: "default" 0.0;
264             rel1.to: "hours2";
265             rel1.relative: 1.0 0.5;
266             rel1.offset: 0 1;
267             rel2.to: "mins1";
268             rel2.relative: 0.0 0.5;
269             rel2.offset: 0 1;
270             align: 0.5 0.0;
271             FIXED_SIZE(4, 4)
272             image.normal: "hole_tiny.png";
273          }
274       }
275       part { name: "c10";
276          clip_to: "secclip";
277          description { state: "default" 0.0;
278             rel1.to: "mins2";
279             rel1.relative: 1.0 0.5;
280             rel1.offset: 0 -2;
281             rel2.to: "secs1";
282             rel2.relative: 0.0 0.5;
283             rel2.offset: 0 -2;
284             align: 0.5 1.0;
285             FIXED_SIZE(4, 4)
286             image.normal: "hole_tiny.png";
287          }
288       }
289       part { name: "c11";
290          clip_to: "secclip";
291          description { state: "default" 0.0;
292             rel1.to: "mins2";
293             rel1.relative: 1.0 0.5;
294             rel1.offset: 0 1;
295             rel2.to: "secs1";
296             rel2.relative: 0.0 0.5;
297             rel2.offset: 0 1;
298             align: 0.5 0.0;
299             FIXED_SIZE(4, 4)
300             image.normal: "hole_tiny.png";
301          }
302       }
303 #define ELEM(_NAME, _TO, _DIGIT) \
304    part { name: _NAME; \
305       description { state: "default" 0.0; \
306          rel1.to: _TO; rel2.to: _TO; \
307          aspect: (52/72) (52/72); aspect_preference: BOTH; \
308          image.normal: "digit_"_DIGIT".png"; \
309          visible: 0; \
310          color: 255 255 255 0; \
311       } \
312       description { state: "active" 0.0; \
313          inherit: "default" 0.0; \
314          visible: 1; \
315          color: 255 255 255 255; \
316       } \
317    }
318 #define DIGIT(_NAME, _TO) \
319    ELEM(_NAME"-0", _TO, "0") \
320    ELEM(_NAME"-1", _TO, "1") \
321    ELEM(_NAME"-2", _TO, "2") \
322    ELEM(_NAME"-3", _TO, "3") \
323    ELEM(_NAME"-4", _TO, "4") \
324    ELEM(_NAME"-5", _TO, "5") \
325    ELEM(_NAME"-6", _TO, "6") \
326    ELEM(_NAME"-7", _TO, "7") \
327    ELEM(_NAME"-8", _TO, "8") \
328    ELEM(_NAME"-9", _TO, "9")
329 #define ELEMC(_NAME, _TO, _DIGIT, _CLIP) \
330    part { name: _NAME; \
331       clip_to: _CLIP; \
332       description { state: "default" 0.0; \
333          rel1.to: _TO; rel2.to: _TO; \
334          aspect: (52/72) (52/72); aspect_preference: BOTH; \
335          image.normal: "digit_"_DIGIT".png"; \
336          visible: 0; \
337          color: 255 255 255 0; \
338       } \
339       description { state: "active" 0.0; \
340          inherit: "default" 0.0; \
341          visible: 1; \
342          color: 255 255 255 255; \
343       } \
344    }
345 #define DIGITC(_NAME, _TO, _CLIP) \
346    ELEMC(_NAME"-0", _TO, "0", _CLIP) \
347    ELEMC(_NAME"-1", _TO, "1", _CLIP) \
348    ELEMC(_NAME"-2", _TO, "2", _CLIP) \
349    ELEMC(_NAME"-3", _TO, "3", _CLIP) \
350    ELEMC(_NAME"-4", _TO, "4", _CLIP) \
351    ELEMC(_NAME"-5", _TO, "5", _CLIP) \
352    ELEMC(_NAME"-6", _TO, "6", _CLIP) \
353    ELEMC(_NAME"-7", _TO, "7", _CLIP) \
354    ELEMC(_NAME"-8", _TO, "8", _CLIP) \
355    ELEMC(_NAME"-9", _TO, "9", _CLIP)
356       
357 #define TAG(_NAME, _TO, _CLIP) \
358    part { name: _NAME; \
359       clip_to: _CLIP; \
360       description { state: "default" 0.0; \
361          rel1.to: _TO; rel2.to: _TO; \
362          aspect: (48/31) (48/31); aspect_preference: BOTH; \
363          image.normal: "digit_am.png"; \
364       } \
365       description { state: "active" 0.0; \
366          inherit: "default" 0.0; \
367          image.normal: "digit_pm.png"; \
368       } \
369    }
370 #define BASE(_NAME, _BASE, _IMG) \
371    part { name: _NAME; \
372       description { state: "default" 0.0; \
373          rel1.to: _BASE; \
374          rel2.to: _BASE; \
375          image.normal: _IMG; \
376          color: 255 255 255 128; \
377       } \
378    }
379 #define BASEC(_NAME, _CLIP, _BASE, _IMG) \
380    part { name: _NAME; \
381       clip_to: _CLIP; \
382       description { state: "default" 0.0; \
383          rel1.to: _BASE; \
384          rel2.to: _BASE; \
385          image.normal: _IMG; \
386          color: 255 255 255 128; \
387       } \
388    }
389       
390       BASE ("ha", "h0-0", "digit_na.png")
391       BASE ("hb", "h1-0", "digit_na.png")
392       BASE ("ma", "m0-0", "digit_na.png")
393       BASE ("mb", "m1-0", "digit_na.png")
394               
395       BASEC("sa", "secclip", "s0-0", "digit_na.png")
396       BASEC("sb", "secclip", "s1-0", "digit_na.png")
397       BASEC("aa", "ampmclip", "ap", "digit_nm.png")
398         
399       DIGIT ("h0", "hours1")
400       DIGIT ("h1", "hours2")
401       DIGIT ("m0", "mins1")
402       DIGIT ("m1", "mins2")
403       DIGITC("s0", "secs1", "secclip")
404       DIGITC("s1", "secs2", "secclip")
405       TAG("ap", "ampm", "ampmclip")
406 #undef TAG
407 #undef TAG
408 #undef ELEM
409 #undef ELEMC
410 #undef BASE
411 #undef BASEC
412 #undef DIGIT
413 #undef DIGITC
414
415        part { name: "e.text.today"; type: TEXT;
416           effect: GLOW;
417           scale: 1;
418           description { state: "default" 0.0;
419              rel1.relative: 0.0 1.0;
420              rel1.offset: 0 1;
421              rel2.offset: -1 1;
422              align: 0.5 1.0;
423              color: FN_COL_HIGHLIGHT;
424              text { font: FN; size: 8;
425                 text_class: "module_small";
426                 align: 0.5 0.5;
427                 min: 0 1;
428              }
429              fixed: 0 1;
430              visible: 0;
431           }
432           description { state: "date" 0.0;
433              inherit: "default" 0.0;
434              visible: 1;
435              fixed: 1 1;
436              text.min: 1 1;
437              text.ellipsis: -1;
438           }
439        }
440                        
441        part { name: "event"; type: RECT;
442           description { state: "default" 0.0;
443              color: 0 0 0 0;
444           }
445        }
446    }
447    programs {
448       program {
449          signal: "load"; source: "";
450          script {
451             reset();
452          }
453       }
454       program {
455          signal: "e,state,date,on"; source: "e";
456          script {
457             set_int(do_date, 1);
458             set_state(PART:"timearea", "date", 0.0);
459             set_state(PART:"e.text.today", "date", 0.0);
460             reset();
461          }
462       }
463       program {
464          signal: "e,state,date,off"; source: "e";
465          script {
466             set_int(do_date, 0);
467             set_state(PART:"timearea", "default", 0.0);
468             set_state(PART:"e.text.today", "default", 0.0);
469             reset();
470          }
471       }
472       program {
473          signal: "e,state,seconds,on"; source: "e";
474          script {
475             set_int(do_seconds, 1);
476             set_state(PART:"secclip", "default", 0.0);
477             reset();
478          }
479       }
480       program {
481          signal: "e,state,seconds,off"; source: "e";
482          script {
483             set_int(do_seconds, 0);
484             set_state(PART:"secclip", "hidden", 0.0);
485             reset();
486          }
487       }
488       program {
489          signal: "e,state,24h,on"; source: "e";
490          script {
491             set_int(do_24h, 1);
492             set_state(PART:"ampmclip", "hidden", 0.0);
493             reset();
494          }
495       }
496       program {
497          signal: "e,state,24h,off"; source: "e";
498          script {
499             set_int(do_24h, 0);
500             set_state(PART:"ampmclip", "default", 0.0);
501             reset();
502          }
503       }
504 #define DIGPRG(_NAME) \
505       program { \
506          signal: "show,"_NAME; source: "c"; \
507          action: STATE_SET "active" 0.0; \
508          transition: BOUNCE 0.3 0.5 2; \
509          target: _NAME; \
510       } \
511       program { \
512          signal: "hide,"_NAME; source: "c"; \
513          action: STATE_SET "default" 0.0; \
514          transition: DECELERATE 0.3; \
515          target: _NAME; \
516       }
517 #define DIGPRGS(_NAME) \
518       DIGPRG(_NAME"-0") \
519       DIGPRG(_NAME"-1") \
520       DIGPRG(_NAME"-2") \
521       DIGPRG(_NAME"-3") \
522       DIGPRG(_NAME"-4") \
523       DIGPRG(_NAME"-5") \
524       DIGPRG(_NAME"-6") \
525       DIGPRG(_NAME"-7") \
526       DIGPRG(_NAME"-8") \
527       DIGPRG(_NAME"-9")
528
529       DIGPRGS("h0")
530       DIGPRGS("h1")
531       DIGPRGS("m0")
532       DIGPRGS("m1")
533       DIGPRGS("s0")
534       DIGPRGS("s1")
535 #undef DIGPRG
536 #undef DIGPRGS
537    }
538 }
539
540 group { name: "e/modules/clock/main";
541    images.image: "clock_base.png" COMP;
542    images.image: "inset_round_hilight.png" COMP;
543    images.image: "inset_round_shadow.png" COMP;
544    images.image: "inset_round_shading.png" COMP;
545    set { name: "tacho_hand_big";
546       image { image: "tacho_hand_big.png" COMP; size: 73 73 99999 99999; }
547       image { image: "tacho_hand_big2.png" COMP; size: 37 37 72 72; }
548       image { image: "tacho_hand_big3.png" COMP; size: 19 19 36 36; }
549       image { image: "tacho_hand_big4.png" COMP; size: 0 0 18 18; }
550    }
551    images.image: "tacho_hand_big_shadow.png" COMP;
552    set { name: "tacho_hand_small_min";
553       image { image: "tacho_hand_small_min.png" COMP; size: 73 73 99999 99999; }
554       image { image: "tacho_hand_small_min2.png" COMP; size: 37 37 72 72; }
555       image { image: "tacho_hand_small_min3.png" COMP; size: 19 19 36 36; }
556       image { image: "tacho_hand_small_min4.png" COMP; size: 0 0 18 18; }
557    }
558    set { name: "knob";
559       image { image: "knob_sz_24.png"  COMP; size: 31 31 32 32; }
560       image { image: "knob_sz_22.png"  COMP; size: 29 29 30 30; }
561       image { image: "knob_sz_20.png"  COMP; size: 27 27 28 28; }
562       image { image: "knob_sz_18.png"  COMP; size: 25 25 26 26; }
563       image { image: "knob_sz_16.png"  COMP; size: 23 23 24 24; }
564       image { image: "knob_sz_14.png"  COMP; size: 21 21 22 22; }
565       image { image: "knob_sz_12.png"  COMP; size: 19 19 20 20; }
566       image { image: "knob_sz_10.png"  COMP; size: 17 17 18 18; }
567       image { image: "knob_sz_08.png"  COMP; size: 15 15 16 16; }
568       image { image: "knob_sz_06.png"  COMP; size: 13 13 14 14; }
569       image { image: "knob_sz_04.png"  COMP; size:  0  0 12 12; }
570    }
571    min: 16 16;
572    max: 160 160;
573    script {
574       public do_seconds, tick_timer;
575       
576          public clock_cb(val) {
577             new year, month, day, yearday, weekday, hour, minute;
578             new Float:second;
579             new v, dosec, tim;
580             
581             date(year, month, day, yearday, weekday, hour, minute, second);
582             dosec = get_int(do_seconds);
583             if (dosec) {
584                v = round(second);
585                tim = timer(1.0 - (second - v), "clock_cb", 1);
586                
587                custom_state(PART:"seconds", "default", 0.0);
588                set_state_val(PART:"seconds", STATE_MAP_ROT_Z, (v * 360.0) / 60.0);
589                set_state(PART:"seconds", "custom", 0.0);
590                
591                custom_state(PART:"seconds-sh", "default", 0.0);
592                set_state_val(PART:"seconds-sh", STATE_MAP_ROT_Z, (v * 360.0) / 60.0);
593                set_state(PART:"seconds-sh", "custom", 0.0);
594             }
595             else {
596                tim = timer(60.0 - (second), "clock_cb", 1);
597             }
598             set_int(tick_timer, tim);
599             
600             custom_state(PART:"minutes", "default", 0.0);
601             set_state_val(PART:"minutes", STATE_MAP_ROT_Z, (float(minute) * 360.0) / 60.0);
602             set_state(PART:"minutes", "custom", 0.0);
603             
604             custom_state(PART:"minutes-sh", "default", 0.0);
605             set_state_val(PART:"minutes-sh", STATE_MAP_ROT_Z, (float(minute) * 360.0) / 60.0);
606             set_state(PART:"minutes-sh", "custom", 0.0);
607             
608             custom_state(PART:"hours", "default", 0.0);
609             set_state_val(PART:"hours", STATE_MAP_ROT_Z, ((float(hour) + (float(minute) / 60.0)) * 360.0) / 12.0);
610             set_state(PART:"hours", "custom", 0.0);
611             
612             custom_state(PART:"hours-sh", "default", 0.0);
613             set_state_val(PART:"hours-sh", STATE_MAP_ROT_Z, ((float(hour) + (float(minute) / 60.0)) * 360.0) / 12.0);
614             set_state(PART:"hours-sh", "custom", 0.0);
615          }
616    }
617    parts {   
618       part { name: "event"; type: RECT;
619          description { state: "default" 0.0;
620             color: 0 0 0 0;
621          }
622       }
623       part { name: "base-sh";
624          description { state: "default" 0.0;
625             rel1.to: "base";
626             rel1.offset: 0 -1;
627             rel2.to: "base";
628             rel2.offset: -1 -2;
629             image.normal: "inset_round_shadow.png";
630          }
631       }
632       part { name: "base-hi";
633          description { state: "default" 0.0;
634             rel1.to: "base";
635             rel1.offset: 0 1;
636             rel2.to: "base";
637             rel2.offset: -1 0;
638             image.normal: "inset_round_hilight.png";
639          }
640       }
641       part { name: "base";
642          description { state: "default" 0.0;
643             rel1.relative: (25/380) (25/380);
644             rel2.relative: (365/380) (365/380);
645             aspect: 1.0 1.0; aspect_preference: BOTH;
646             image.normal: "clock_base.png";
647          }
648       }
649       part { name: "seconds-sh"; mouse_events: 0;
650          description { state: "default" 0.0;
651             image.normal: "tacho_hand_big_shadow.png";
652             rel1.to: "hours-sh";
653             rel2.to: "hours-sh";
654             map {
655                on: 1;
656                rotation.center: "seconds-sh";
657             }
658          }
659          description { state: "hidden" 0.0;
660             inherit: "default" 0.0;
661             visible: 0;
662          }
663       }
664       part { name: "seconds"; mouse_events: 0;
665          description { state: "default" 0.0;
666             image.normal: "tacho_hand_big";
667             color: 255 0 0 255;
668             rel1.to: "base";
669             rel2.to: "base";
670             map {
671                on: 1;
672                rotation.center: "base";
673             }
674          }
675          description { state: "hidden" 0.0;
676             inherit: "default" 0.0;
677             visible: 0;
678          }
679       }
680       part { name: "minutes-sh"; mouse_events: 0;
681          description { state: "default" 0.0;
682             image.normal: "tacho_hand_big_shadow.png";
683             rel1.to: "hours-sh";
684             rel2.to: "hours-sh";
685             map {
686                on: 1;
687                rotation.center: "minutes-sh";
688             }
689          }
690       }
691       part { name: "minutes"; mouse_events: 0;
692          description { state: "default" 0.0000;
693             color: 255 255 255 255;
694             image.normal: "tacho_hand_big";
695             rel1.to: "base";
696             rel2.to: "base";
697             map {
698                on: 1;
699                rotation.center: "base";
700             }
701          }
702       }
703       part { name: "hours-sh"; mouse_events: 0;
704          description { state: "default" 0.0;
705             image.normal: "tacho_hand_small_shadow.png";
706             rel1.to: "hours";
707             rel1.relative: 0.0 (15/380);
708             rel1.offset: 0 1;
709             rel2.to: "hours";
710             rel2.relative: 1.0 (395/380);
711             rel2.offset: -1 0;
712             map {
713                on: 1;
714                rotation.center: "hours-sh";
715             }
716          }
717       }
718       part { name: "hours"; mouse_events: 0;
719          description { state: "default" 0.0;
720             image.normal: "tacho_hand_small_min";
721             color: 255 255 255 255;
722             rel1.to: "base";
723             rel2.to: "base";
724             map {
725                on: 1;
726                rotation.center: "base";
727             }
728          }
729       }
730       part { name: "over"; mouse_events: 0;
731          description { state: "default" 0.0;
732             rel1.to: "base";
733             rel2.to: "base";
734             image.normal: "inset_round_shading.png";
735          }
736       }
737       part { name: "knob"; type: SPACER;
738          description { state: "default" 0.0;
739             rel1.relative: (140/340) (140/340);
740             rel1.to: "base";
741             rel2.relative: (205/340) (205/340);
742             rel2.to: "base";
743             min: 4 4;
744             step: 2 2;
745             max: 24 24;
746          }
747       }
748       part { name: "knob2";
749          description { state: "default" 0.0;
750             rel1.offset: -4 -4;
751             rel1.to: "knob";
752             rel2.offset: 3 3;
753             rel2.to: "knob";
754             min: 12 12;
755             max: 32 32;
756             image.normal: "knob";
757          }
758       }
759    }
760    programs {
761       program {
762          signal: "load"; source: "";
763          script {
764             clock_cb(0);
765          }
766       }
767       program {
768          signal: "e,state,seconds,on"; source: "e";
769          action: STATE_SET "default" 0.0;
770          target: "seconds";
771          target: "seconds-sh";
772          after: "sec2";
773       }
774       program { name: "sec2";
775          script {
776             new tim;
777             
778             set_int(do_seconds, 1);
779             tim = get_int(tick_timer);
780             if (tim) {
781                cancel_timer(tim);
782                set_int(tick_timer, 0);
783             }
784             clock_cb(0);
785          }
786       }
787       program {
788          signal: "e,state,seconds,off"; source: "e";
789          action: STATE_SET "hidden" 0.0;
790          target: "seconds";
791          target: "seconds-sh";
792          after: "sec3";
793       }
794       program { name: "sec3";
795          script {
796             new tim;
797             
798             set_int(do_seconds, 0);
799             tim = get_int(tick_timer);
800             if (tim) {
801                cancel_timer(tim);
802                set_int(tick_timer, 0);
803             }
804             clock_cb(0);
805          }
806       }
807    }
808 }
809
810 group { name: "e/modules/clock/calendar/dayname";
811    parts {
812       part { name: "e.text.label"; type: TEXT; mouse_events: 0;
813          effect: SHADOW BOTTOM;
814          scale: 1;
815          description { state: "default" 0.0;
816             color: FN_COL_DISABLE;
817             text { font: FN; size: 8;
818                text: "WWe";
819                min: 1 1;
820                ellipsis: -1;
821                align: 0.5 0.5;
822                text_class: "module_small";
823             }
824          }
825          description { state: "weekend" 0.0;
826             inherit: "default" 0.0;
827             color: 48 48 48 255;
828          }
829       }
830    }
831    programs {
832       program {
833          signal: "e,state,weekend"; source: "e";
834          action: STATE_SET "weekend" 0.0;
835          target: "e.text.label";
836       }
837       program {
838          signal: "e,state,weekday"; source: "e";
839          action: STATE_SET "default" 0.0;
840          target: "e.text.label";
841       }
842    }
843 }
844
845 group { name: "e/modules/clock/calendar/day";
846    script {
847       public day_state = 0;
848       evalstate() {
849          new vv = get_int(day_state);
850          
851          if (vv & 2)
852            {
853               set_state(PART:"e.text.label", "today", 0.0);
854               set_state(PART:"label2", "today", 0.0);
855            }
856          else if (vv & 4)
857            {
858               set_state(PART:"e.text.label", "hidden", 0.0);
859               set_state(PART:"label2", "default", 0.0);
860            }
861          else if (vv & 1)
862            {
863               set_state(PART:"e.text.label", "weekend", 0.0);
864               set_state(PART:"label2", "default", 0.0);
865            }
866          else
867            {
868               set_state(PART:"e.text.label", "default", 0.0);
869               set_state(PART:"label2", "default", 0.0);
870            }
871       }
872    }
873    parts {
874       part { name: "e.text.label"; type: TEXT; mouse_events: 0;
875          effect: SHADOW BOTTOM;
876          scale: 1;
877          description { state: "default" 0.0;
878             color: FN_COL_DEFAULT;
879             text { font: FN; size: 10;
880                text: "00";
881                min: 1 1;
882                ellipsis: -1;
883                align: 0.5 0.5;
884             }
885          }
886          description { state: "today" 0.0;
887             inherit: "default" 0.0;
888             visible: 0;
889          }
890          description { state: "weekend" 0.0;
891             inherit: "default" 0.0;
892             color: FN_COL_MID_GREY;
893          }
894          description { state: "hidden" 0.0;
895             inherit: "default" 0.0;
896             color: FN_COL_DISABLE;
897          }
898       }
899       part { name: "label2"; type: TEXT; mouse_events: 0;
900          effect: GLOW;
901          scale: 1;
902          description { state: "default" 0.0;
903             rel1.offset: -3 -3;
904             rel1.to: "e.text.label";
905             rel2.offset: 2 1;
906             rel2.to: "e.text.label";
907             color: FN_COL_HIGHLIGHT;
908             text { font: FN; size: 10;
909                text_source: "e.text.label";
910                min: 1 1;
911                ellipsis: -1;
912                align: 0.5 0.5;
913             }
914             visible: 0;
915          }
916          description { state: "today" 0.0;
917             inherit: "default" 0.0;
918             visible: 1;
919          }
920       }
921    }
922    programs {
923       program {
924          signal: "e,state,weekend"; source: "e";
925          script {
926             new vv = get_int(day_state);
927             set_int(day_state, vv | 1);
928             evalstate();
929          }
930       }
931       program {
932          signal: "e,state,weekday"; source: "e";
933          script {
934             new vv = get_int(day_state);
935             set_int(day_state, vv & (~1));
936             evalstate();
937          }
938       }
939       
940       program {
941          signal: "e,state,today"; source: "e";
942          script {
943             new vv = get_int(day_state);
944             set_int(day_state, vv | 2);
945             evalstate();
946          }
947       }
948       program {
949          signal: "e,state,someday"; source: "e";
950          script {
951             new vv = get_int(day_state);
952             set_int(day_state, vv & (~2));
953             evalstate();
954          }
955       }
956       
957       program {
958          signal: "e,state,hidden"; source: "e";
959          script {
960             new vv = get_int(day_state);
961             set_int(day_state, vv | 4);
962             evalstate();
963          }
964       }
965       program {
966          signal: "e,state,visible"; source: "e";
967          script {
968             new vv = get_int(day_state);
969             set_int(day_state, vv & (~4));
970             evalstate();
971          }
972       }
973    }
974 }
975
976 group { name: "e/modules/clock/calendar";
977    images.image: "separator_horiz.png" COMP;
978    images.image: "sym_left_light_normal.png" COMP;
979    images.image: "sym_right_light_normal.png" COMP;
980    images.image: "sym_left_glow_normal.png" COMP;
981    images.image: "sym_right_glow_normal.png" COMP;
982    parts {
983       part { name: "e.text.month"; type: TEXT;
984          effect: SHADOW BOTTOM;
985          mouse_events: 1;
986          scale: 1;
987          description { state: "default" 0.0;
988             fixed: 0 1;
989             align: 0.0 0.0;
990             rel1.to_x: "prev";
991             rel1.relative: 1.0 0.0;
992             rel2.relative: 1.0 0.0;
993             color: FN_COL_DEFAULT;
994             text { font: FNBD; size: 10;
995                text: "000000000000";
996                align: 0.0 0.5;
997                min: 0 1;
998                text_class: "module_normal";
999             }
1000          }
1001       }
1002       part { name: "e.text.year"; type: TEXT; mouse_events: 0;
1003          effect: SHADOW BOTTOM;
1004          scale: 1;
1005          description { state: "default" 0.0;
1006             fixed: 0 1;
1007             align: 1.0 0.0;
1008             rel1.relative: 0.0 0.0;
1009             rel2.to_x: "next";
1010             rel2.relative: 0.0 0.0;
1011             color: FN_COL_DEFAULT;
1012             text { font: FNBD; size: 10;
1013                text: "0000";
1014                align: 1.0 0.5;
1015                min: 0 1;
1016                text_class: "module_normal";
1017             }
1018          }
1019       }
1020       part { name: "previm"; mouse_events: 0;
1021          description { state: "default" 0.0;
1022             min: 15 15;
1023             max: 15 15;
1024             rel1.to: "prev";
1025             rel2.to: "prev";
1026             image.normal: "sym_left_light_normal.png";
1027          }
1028          description { state: "pressed" 0.0;
1029             inherit: "default" 0.0;
1030             image.normal: "sym_left_glow_normal.png";
1031          }
1032       }
1033       part { name: "prev"; type: RECT;
1034          description { state: "default" 0.0;
1035             align: 0.0 0.5;
1036             color: 0 0 0 0;
1037             aspect: 1.0 1.0; aspect_preference: VERTICAL;
1038             rel1.to_y: "e.text.month";
1039             rel1.relative: 0.0 0.0;
1040             rel2.to_y: "e.text.month";
1041             rel2.relative: 0.0 1.0;
1042          }
1043          program { name: "prev_down";
1044             signal: "mouse,down,1*"; source: "prev";
1045             action: STATE_SET "pressed" 0.0;
1046             target: "previm";
1047          }
1048          program { name: "prev_up";
1049             signal: "mouse,up,1"; source: "prev";
1050             action: STATE_SET "default" 0.0;
1051             target: "previm";
1052          }
1053          program { name: "prev_clicked";
1054             signal: "mouse,clicked,1*"; source: "prev";
1055             action: SIGNAL_EMIT "e,action,prev" "";
1056          }
1057       }
1058       part { name: "nextim"; mouse_events: 0;
1059          description { state: "default" 0.0;
1060             min: 15 15;
1061             max: 15 15;
1062             rel1.to: "next";
1063             rel2.to: "next";
1064             image.normal: "sym_right_light_normal.png";
1065          }
1066          description { state: "pressed" 0.0;
1067             inherit: "default" 0.0;
1068             image.normal: "sym_right_glow_normal.png";
1069          }
1070       }
1071       part { name: "next"; type: RECT;
1072          description { state: "default" 0.0;
1073             align: 1.0 0.5;
1074             color: 0 0 0 0;
1075             aspect: 1.0 1.0; aspect_preference: VERTICAL;
1076             rel1.to_y: "e.text.month";
1077             rel1.relative: 1.0 0.0;
1078             rel2.to_y: "e.text.month";
1079             rel2.relative: 1.0 1.0;
1080          }
1081          program { name: "next_down";
1082             signal: "mouse,down,1"; source: "next";
1083             action: STATE_SET "pressed" 0.0;
1084             target: "nextim";
1085          }
1086          program { name: "next_up";
1087             signal: "mouse,up,1"; source: "next";
1088             action: STATE_SET "default" 0.0;
1089             target: "nextim";
1090          }
1091          program { name: "next_clicked";
1092             signal: "mouse,clicked,1"; source: "next";
1093             action: SIGNAL_EMIT "e,action,next" "";
1094          }
1095       }
1096       part { name: "sel";
1097          description { state: "default" 0.0;
1098             image.normal: "separator_horiz.png";
1099             rel1.relative: 0.0 1.0;
1100             rel1.offset: 0 0;
1101             rel1.to: "e.table.daynames";
1102             rel2.offset: -1 1;
1103             rel2.to: "e.table.daynames";
1104             min: 0 2;
1105             fill.smooth: 0;
1106          }
1107       }
1108       
1109       part { name: "e.table.daynames"; type: TABLE;
1110          description { state: "default" 0.0;
1111             fixed: 0 1;
1112             align: 0.5 0.0;
1113             rel1.to_y: "e.text.month";
1114             rel1.relative: 0.0 1.0;
1115             rel1.offset: 2 2;
1116             rel2.to_y: "e.text.month";
1117             rel2.relative: 1.0 1.0;
1118             rel2.offset: -3 2;
1119             step: 7 1;
1120             table { homogeneous: TABLE;
1121                padding: 1 1;
1122                align: 0.5 0.5;
1123                min: 1 1;
1124             }
1125          }
1126          table {
1127             items {
1128 #define D(x) \
1129 item { \
1130    position: x 0; \
1131    span: 1 1; \
1132    source: "e/modules/clock/calendar/dayname"; \
1133    weight: 1.0 1.0; \
1134    align: -1.0 -1.0; \
1135 }
1136                D(0) D(1) D(2) D(3) D(4) D(5) D(6)
1137 #undef D                 
1138             }
1139          }
1140       }
1141       part { name: "e.table.days"; type: TABLE;
1142          description { state: "default" 0.0;
1143             rel1.to_y: "e.table.daynames";
1144             rel1.relative: 0.0 1.0;
1145             rel1.offset: 2 2;
1146             rel2.offset: -3 -3;
1147             step: 7 5;
1148             table { homogeneous: TABLE;
1149                padding: 1 1;
1150                align: 0.5 0.5;
1151                min: 1 1;
1152             }
1153          }
1154          table {
1155             items {
1156 #define D(x, y) \
1157 item { \
1158    position: x y; \
1159    span: 1 1; \
1160    source: "e/modules/clock/calendar/day"; \
1161    weight: 1.0 1.0; \
1162    align: -1.0 -1.0; \
1163 }
1164                D(0, 0) D(1, 0) D(2, 0) D(3, 0) D(4, 0) D(5, 0) D(6, 0)
1165                D(0, 1) D(1, 1) D(2, 1) D(3, 1) D(4, 1) D(5, 1) D(6, 1)
1166                D(0, 2) D(1, 2) D(2, 2) D(3, 2) D(4, 2) D(5, 2) D(6, 2)
1167                D(0, 3) D(1, 3) D(2, 3) D(3, 3) D(4, 3) D(5, 3) D(6, 3)
1168                D(0, 4) D(1, 4) D(2, 4) D(3, 4) D(4, 4) D(5, 4) D(6, 4)
1169                D(0, 5) D(1, 5) D(2, 5) D(3, 5) D(4, 5) D(5, 5) D(6, 5)
1170 #undef D
1171             }
1172          }
1173       }
1174    }
1175 }