Rev 6466 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
6450 | punk_joker | 1 | #ifndef KOLIBRI_FRAME_H |
2 | #define KOLIBRI_FRAME_H |
||
3 | |||
4 | enum { |
||
5 | TOP, |
||
6 | BOTTON |
||
7 | }; |
||
8 | |||
6457 | punk_joker | 9 | typedef struct { |
6479 | siemargl | 10 | uint32_t type; |
11 | uint32_t x_w; |
||
12 | uint32_t y_h; |
||
13 | color_t ext_col; |
||
14 | color_t int_col; |
||
15 | uint32_t draw_text_flag; |
||
6466 | siemargl | 16 | char *text_pointer; |
6479 | siemargl | 17 | uint32_t text_position; |
18 | uint32_t font_number; |
||
19 | uint32_t font_size_y; |
||
20 | color_t font_color; |
||
21 | color_t font_bg_color; |
||
6466 | siemargl | 22 | }frame; |
6479 | siemargl | 23 | |
24 | inline frame* kolibri_frame(frame* f, uint32_t x_w, uint32_t y_h, color_t ext_col, color_t int_col, char *text, uint32_t text_position, color_t font_color, color_t font_bgcolor) |
||
25 | { |
||
26 | f->type = 0; |
||
27 | f->x_w = x_w; |
||
28 | f->y_h = y_h; |
||
29 | f->ext_col = ext_col; |
||
30 | f->int_col = int_col; |
||
31 | f->draw_text_flag = text != NULL; |
||
32 | f->text_pointer = text; |
||
33 | f->text_position = text_position; |
||
34 | f->font_number = 0; // 0 == font 6x9, 1==8x16 |
||
35 | f->font_size_y = 9; |
||
36 | f->font_color = font_color | 0x80000000; |
||
37 | f->font_bg_color = font_bgcolor; |
||
38 | |||
39 | return f; |
||
40 | } |
||
6450 | punk_joker | 41 | |
6479 | siemargl | 42 | inline frame* kolibri_new_frame(uint32_t x_w, uint32_t y_h, color_t ext_col, color_t int_col, char *text, uint32_t text_position, color_t font_color, color_t font_bgcolor) |
6450 | punk_joker | 43 | { |
6457 | punk_joker | 44 | frame *new_frame = (frame *)malloc(sizeof(frame)); |
6479 | siemargl | 45 | return kolibri_frame(new_frame, x_w, y_h, ext_col, int_col, text, text_position, font_color, font_bgcolor); |
46 | } |
||
47 | |||
48 | inline frame* kolibri_frame_def(frame* f, uint32_t x_w, uint32_t y_h, char *text) |
||
49 | { |
||
50 | return kolibri_frame(f, x_w, y_h, 0x00FCFCFC, 0x00DCDCDC, text, TOP, kolibri_color_table.color_work_text, kolibri_color_table.color_work_area); |
||
51 | } |
||
52 | |||
53 | inline frame* kolibri_new_frame_def(uint32_t x_w, uint32_t y_h, char *text) |
||
54 | { |
||
55 | return kolibri_new_frame(x_w, y_h, 0x00FCFCFC, 0x00DCDCDC, text, TOP, kolibri_color_table.color_work_text, kolibri_color_table.color_work_area); |
||
56 | } |
||
57 | |||
58 | inline void gui_add_frame(kolibri_window *wnd, frame* f) |
||
59 | { |
||
60 | kolibri_window_add_element(wnd, KOLIBRI_FRAME, f); |
||
61 | } |
||
6450 | punk_joker | 62 | |
6479 | siemargl | 63 | |
6457 | punk_joker | 64 | extern void (*frame_draw)(frame *) __attribute__((__stdcall__)); |
6450 | punk_joker | 65 | |
66 | #endif /* KOLIBRI_FRAME_H */ |