Rev 4973 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4973 | Rev 5098 | ||
---|---|---|---|
Line 2... | Line 2... | ||
2 | 2 | ||
Line 3... | Line 3... | ||
3 | #define B_SZ 10 |
3 | #define B_SZ 10 |
Line 4... | Line 4... | ||
4 | 4 | ||
5 | static char * Title="BinClock"; |
5 | static char * Title="BinClock"; |
6 | 6 | ||
7 | void draw_small_box(int x,int y,int is_on) |
7 | static void draw_small_box(int x,int y,int is_on) |
Line 8... | Line 8... | ||
8 | { |
8 | { |
9 | __menuet__bar(x,y,B_SZ,B_SZ,is_on ? 0xFF0000 : 0x103000); |
9 | __menuet__bar(x,y,B_SZ,B_SZ,is_on ? 0xFF0000 : 0x103000); |
10 | } |
10 | } |
11 | 11 | ||
12 | void draw_box_group(int x,int y,int num) |
12 | static void draw_box_group(int x,int y,int num) |
13 | { |
13 | { |
Line 22... | Line 22... | ||
22 | } |
22 | } |
23 | __menuet__bar(x,y+((B_SZ+2)*4),B_SZ,B_SZ,0x800000); |
23 | __menuet__bar(x,y+((B_SZ+2)*4),B_SZ,B_SZ,0x800000); |
24 | __menuet__write_text(x+2,y+((B_SZ+2)*4)+3,0xFFFFFF,buf,1); |
24 | __menuet__write_text(x+2,y+((B_SZ+2)*4)+3,0xFFFFFF,buf,1); |
25 | } |
25 | } |
Line 26... | Line 26... | ||
26 | 26 | ||
27 | void draw_bcd_num(int x,int y,int num) |
27 | static void draw_bcd_num(int x,int y,int num) |
28 | { |
28 | { |
29 | int v1,v2; |
29 | int v1,v2; |
30 | v1=(num>>4)&(1+2+4+8); |
30 | v1=(num>>4)&(1+2+4+8); |
31 | v2=num & (1+2+4+8); |
31 | v2=num & (1+2+4+8); |
32 | draw_box_group(x,y,v1); |
32 | draw_box_group(x,y,v1); |
33 | draw_box_group(x+B_SZ+2,y,v2); |
33 | draw_box_group(x+B_SZ+2,y,v2); |
Line 34... | Line 34... | ||
34 | } |
34 | } |
35 | 35 | ||
36 | void draw_hms(int x,int y) |
36 | static void draw_hms(int x,int y) |
37 | { |
37 | { |
38 | __u32 t; |
38 | __u32 t; |
39 | int h,m,s; |
39 | int h,m,s; |
Line 46... | Line 46... | ||
46 | draw_bcd_num(x,y,m); |
46 | draw_bcd_num(x,y,m); |
47 | x+=((B_SZ+2)<<1)+2; |
47 | x+=((B_SZ+2)<<1)+2; |
48 | draw_bcd_num(x,y,s); |
48 | draw_bcd_num(x,y,s); |
49 | } |
49 | } |
Line 50... | Line 50... | ||
50 | 50 | ||
51 | void draw_h(void) |
51 | static void draw_h(void) |
52 | { |
52 | { |
53 | draw_hms(22,28); |
53 | draw_hms(22,28); |
Line 54... | Line 54... | ||
54 | } |
54 | } |
55 | 55 | ||
56 | void paint(void) |
56 | static void paint(void) |
57 | { |
57 | { |
58 | __menuet__window_redraw(1); |
58 | __menuet__window_redraw(1); |
59 | __menuet__define_window(100,100,40+((B_SZ+2)*6)+4,30+((B_SZ+2)*4)+16,0x03000080,0x800000FF,0x000080); |
59 | __menuet__define_window(100,100,40+((B_SZ+2)*6)+4,30+((B_SZ+2)*4)+16,0x03000080,0x800000FF,0x000080); |