Rev 6524 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
6524 | siemargl | 1 | #ifndef KOLIBRI_PATHSHOW_H |
2 | #define KOLIBRI_PATHSHOW_H |
||
3 | |||
6589 | siemargl | 4 | typedef struct __attribute__ ((__packed__)) { |
6524 | siemargl | 5 | uint32_t type; |
6 | uint32_t x_y; |
||
7 | uint16_t font_size_x; // 6 - for font 0, 8 - for font 1 |
||
8 | uint16_t area_size_x; |
||
9 | uint32_t font_number; // 0 - monospace, 1 - variable, as fn4 (2bit only 0-3) |
||
10 | uint32_t background_flag; // as fn4, if 0, bk_color unneeded |
||
11 | color_t font_color; // as fn4 |
||
12 | color_t background_color; // as fn4 |
||
13 | char* text_pointer; // 4096 ? |
||
14 | char* work_area_pointer; // 4096 ? |
||
15 | uint32_t temp_text_length; |
||
16 | } pathview; |
||
17 | |||
18 | |||
19 | |||
20 | inline pathview* kolibri_pathview(pathview* p, uint32_t x_y, uint32_t width, uint32_t font_number, uint32_t is_bkgr, char* text, char* temp_buf, color_t font, color_t bkgr) |
||
21 | { |
||
22 | p->type = p->temp_text_length = 0; |
||
23 | p->x_y = x_y; |
||
24 | p->font_size_x = font_number == 0 ? 6 : 8; // need correction for bigger fonts |
||
25 | p->area_size_x = width; |
||
26 | p->font_number = font_number; |
||
27 | p->background_flag = is_bkgr; |
||
28 | p->text_pointer = text; |
||
29 | p->work_area_pointer = temp_buf; |
||
30 | p->font_color = font; |
||
31 | p->background_color = bkgr; |
||
32 | |||
33 | return p; |
||
34 | } |
||
35 | |||
36 | inline pathview* kolibri_new_pathview(pathview* p, uint32_t x_y, uint32_t width, uint32_t font_number, uint32_t is_bkgr, char* text, char* temp_buf, color_t font, color_t bkgr) |
||
37 | { |
||
38 | pathview *new_pv = (pathview *)malloc(sizeof(pathview)); |
||
39 | return kolibri_pathview(new_pv, x_y, width, font_number, is_bkgr, text, temp_buf, font, bkgr); |
||
40 | } |
||
41 | |||
42 | inline void gui_add_pathview(kolibri_window *wnd, pathview* pv) |
||
43 | { |
||
44 | kolibri_window_add_element(wnd, KOLIBRI_PATHSHOW, pv); |
||
45 | } |
||
46 | |||
47 | |||
48 | extern void (*path_show_prepare)(pathview *) __attribute__((__stdcall__)); |
||
49 | extern void (*path_show_draw)(pathview *) __attribute__((__stdcall__)); |
||
50 | |||
51 | #endif /* KOLIBRI_PATHSHOW_H */ |