Subversion Repositories Kolibri OS

Rev

Rev 6466 | Rev 6589 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6466 Rev 6479
Line 5... Line 5...
5
	TOP,
5
	TOP,
6
	BOTTON
6
	BOTTON
7
};
7
};
Line 8... Line 8...
8
 
8
 
9
typedef struct {
9
typedef struct {
10
	unsigned int type;
10
	uint32_t type;
11
	uint16_t size_x;
-
 
12
	uint16_t start_x;
11
	uint32_t x_w;
13
	uint16_t size_y;
-
 
14
	uint16_t start_y;
12
	uint32_t y_h;
15
	unsigned int ext_col;
13
	color_t ext_col;
16
	unsigned int int_col;
14
	color_t int_col;
17
	unsigned int draw_text_flag;
15
	uint32_t draw_text_flag;
18
	char *text_pointer;
16
	char *text_pointer;
19
	unsigned int text_position;
17
	uint32_t text_position;
20
	unsigned int font_number;
18
	uint32_t font_number;
21
	unsigned int font_size_y;
19
	uint32_t font_size_y;
22
	unsigned int font_color;
20
	color_t font_color;
23
	unsigned int font_backgr_color;
21
	color_t font_bg_color;
Line -... Line 22...
-
 
22
}frame;
-
 
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;
24
}frame;
40
}
25
 
41
 
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)
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)
27
{
-
 
28
    frame *new_frame = (frame *)malloc(sizeof(frame));
-
 
29
    new_frame -> type = 0;
-
 
30
    new_frame -> size_x = sizex;
-
 
31
    new_frame -> start_x = tlx;
-
 
32
    new_frame -> size_y = sizey;
-
 
33
    new_frame -> start_y = tly;
-
 
34
    new_frame -> ext_col = ext_col;
-
 
35
    new_frame -> int_col = int_col;
-
 
36
    new_frame -> draw_text_flag = draw_text_flag;
43
{
-
 
44
    frame *new_frame = (frame *)malloc(sizeof(frame));
-
 
45
    return kolibri_frame(new_frame, x_w, y_h, ext_col, int_col, text, text_position, font_color, font_bgcolor);
37
    new_frame -> text_pointer = text_pointer;
46
}
38
    new_frame -> text_position = text_position;
-
 
39
    new_frame -> font_number = 0;  // 0 == font 6x9, 1==8x16
-
 
-
 
47
 
40
    new_frame -> font_size_y = 9;
48
inline frame* kolibri_frame_def(frame* f, uint32_t x_w, uint32_t y_h, char *text)
41
    new_frame -> font_color = font_color;
-
 
42
    new_frame -> font_backgr_color = font_bgcolor;
49
{
Line -... Line 50...
-
 
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);
43
    return new_frame;
61
}
Line 44... Line 62...
44
}
62