Rev 6457 | Rev 6479 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6457 | Rev 6466 | ||
---|---|---|---|
1 | #ifndef KOLIBRI_FRAME_H |
1 | #ifndef KOLIBRI_FRAME_H |
2 | #define KOLIBRI_FRAME_H |
2 | #define KOLIBRI_FRAME_H |
3 | 3 | ||
4 | enum { |
4 | enum { |
5 | TOP, |
5 | TOP, |
6 | BOTTON |
6 | BOTTON |
7 | }; |
7 | }; |
8 | 8 | ||
9 | typedef struct { |
9 | typedef struct { |
10 | unsigned int type; |
10 | unsigned int type; |
11 | uint16_t size_x; |
11 | uint16_t size_x; |
12 | uint16_t start_x; |
12 | uint16_t start_x; |
13 | uint16_t size_y; |
13 | uint16_t size_y; |
14 | uint16_t start_y; |
14 | uint16_t start_y; |
15 | unsigned int ext_col; |
15 | unsigned int ext_col; |
16 | unsigned int int_col; |
16 | unsigned int int_col; |
17 | unsigned int draw_text_flag; |
17 | unsigned int draw_text_flag; |
18 | char *text_pointer; |
18 | char *text_pointer; |
19 | unsigned int text_position; |
19 | unsigned int text_position; |
20 | unsigned int font_number; |
20 | unsigned int font_number; |
21 | unsigned int font_size_y; |
21 | unsigned int font_size_y; |
22 | unsigned int font_color; |
22 | unsigned int font_color; |
23 | unsigned int font_backgr_color; |
23 | unsigned int font_backgr_color; |
24 | }frame; |
24 | }frame; |
25 | 25 | ||
26 | frame* kolibri_new_frame(uint16_t tlx, uint16_t tly, uint16_t sizex, uint16_t sizey, unsigned int ext_col, unsigned int int_col, unsigned int draw_text_flag, char *text_pointer, unsigned int text_position, unsigned int font_color, unsigned int font_bgcolor) |
26 | frame* kolibri_new_frame(uint16_t tlx, uint16_t tly, uint16_t sizex, uint16_t sizey, unsigned int ext_col, unsigned int int_col, unsigned int draw_text_flag, char *text_pointer, unsigned int text_position, unsigned int font_color, unsigned int font_bgcolor) |
27 | { |
27 | { |
28 | frame *new_frame = (frame *)malloc(sizeof(frame)); |
28 | frame *new_frame = (frame *)malloc(sizeof(frame)); |
29 | new_frame -> type = 0; |
29 | new_frame -> type = 0; |
30 | new_frame -> size_x = sizex; |
30 | new_frame -> size_x = sizex; |
31 | new_frame -> start_x = tlx; |
31 | new_frame -> start_x = tlx; |
32 | new_frame -> size_y = sizey; |
32 | new_frame -> size_y = sizey; |
33 | new_frame -> start_y = tly; |
33 | new_frame -> start_y = tly; |
34 | new_frame -> ext_col = ext_col; |
34 | new_frame -> ext_col = ext_col; |
35 | new_frame -> int_col = int_col; |
35 | new_frame -> int_col = int_col; |
36 | new_frame -> draw_text_flag = draw_text_flag; |
36 | new_frame -> draw_text_flag = draw_text_flag; |
37 | new_frame -> text_pointer = text_pointer; |
37 | new_frame -> text_pointer = text_pointer; |
38 | new_frame -> text_position = text_position; |
38 | new_frame -> text_position = text_position; |
39 | new_frame -> font_number = 1; |
39 | new_frame -> font_number = 0; // 0 == font 6x9, 1==8x16 |
40 | new_frame -> font_size_y = 12; |
40 | new_frame -> font_size_y = 9; |
41 | new_frame -> font_color = font_color; |
41 | new_frame -> font_color = font_color; |
42 | new_frame -> font_backgr_color = font_bgcolor; |
42 | new_frame -> font_backgr_color = font_bgcolor; |
43 | return new_frame; |
43 | return new_frame; |
44 | } |
44 | } |
45 | 45 | ||
46 | extern void (*frame_draw)(frame *) __attribute__((__stdcall__)); |
46 | extern void (*frame_draw)(frame *) __attribute__((__stdcall__)); |
47 | 47 | ||
48 | #endif /* KOLIBRI_FRAME_H */ |
48 | #endif /* KOLIBRI_FRAME_H */ |