Subversion Repositories Kolibri OS

Rev

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

Rev 6495 Rev 6500
Line 11... Line 11...
11
#define KMENUITEM_SEPARATOR_HEIGHT 2
11
#define KMENUITEM_SEPARATOR_HEIGHT 2
Line 12... Line 12...
12
 
12
 
13
#define KMENU_LBORDER_SIZE 2
13
#define KMENU_LBORDER_SIZE 2
Line -... Line 14...
-
 
14
#define KMENU_DBORDER_SIZE 1
-
 
15
 
-
 
16
typedef struct {
-
 
17
	int type;
-
 
18
	uint32_t color;
-
 
19
	union {
-
 
20
		uint32_t bgcolor;
-
 
21
		void *buffer;
-
 
22
	};
-
 
23
} t_font;
-
 
24
 
-
 
25
typedef struct {
-
 
26
	uint16_t left, top, right, bottom;
-
 
27
} t_rect;
-
 
28
 
-
 
29
typedef struct kmenuitem_t{
-
 
30
	int type;
-
 
31
	char *text;
-
 
32
	union {
-
 
33
		void *submenu;		
-
 
34
		//kmenuitem_callback_t callback;
-
 
35
		size_t btnid;
-
 
36
	};
-
 
37
	
-
 
38
	void (*paint)(struct kmenuitem_t *item, t_rect *rc) __attribute__((__stdcall__));
-
 
39
	
-
 
40
	int is_focused;
-
 
41
	int is_enabled;
-
 
42
	int is_visible;
-
 
43
	size_t style;
-
 
44
 
-
 
45
	int font_width, font_height;
-
 
46
	t_font font;
-
 
47
	
-
 
48
	size_t left, top;
-
 
49
	size_t width, height, pref_width, pref_height;
-
 
50
	size_t margin_left, margin_right, margin_top, margin_bottom;
-
 
51
	size_t padding_left, padding_right, padding_top, padding_bottom;
-
 
52
} kmenuitem_t;
-
 
53
 
-
 
54
typedef struct ksubmenu_t{
-
 
55
	kmenuitem_t **items;
-
 
56
	int count;
-
 
57
	
-
 
58
	void (*paint)(struct ksubmenu_t *menu) __attribute__((__stdcall__));
-
 
59
	
-
 
60
	int is_opened;
-
 
61
	int focus_idx;
-
 
62
	
-
 
63
	size_t width, height;
-
 
64
	size_t left, top;
-
 
65
	int tid;
-
 
66
	int parent_wnd, parent_tid, submenu_tid, self_wnd;
-
 
67
	int level;
-
 
68
	size_t return_btnid;
-
 
69
	
-
 
70
	int set_new_padding, set_new_margin;
-
 
71
	t_rect items_padding;
-
 
72
	t_rect items_margin;
-
 
73
	
-
 
74
	struct ksubmenu_t *parent;
-
 
75
} ksubmenu_t;
-
 
76
 
-
 
77
typedef struct {
-
 
78
	kmenuitem_t **submenu;
-
 
79
	int count;
-
 
80
	
-
 
81
	size_t width, height;
-
 
82
	size_t left, top;
-
 
83
	
-
 
84
	int line_height;
-
 
85
	
-
 
86
	int focus_idx;
-
 
87
	int submenu_tid;
-
 
88
} kmenu_t;
14
#define KMENU_DBORDER_SIZE 1
89
 
Line 15... Line 90...
15
 
90
 
16
extern int kolibri_kmenu_init(void); 
91
extern int kolibri_kmenu_init(void); 
17
 
92
 
18
extern void (*kmainmenu_draw)(void *) __attribute__((__stdcall__));
93
extern void (*kmainmenu_draw)(ksubmenu_t *) __attribute__((__stdcall__));
19
extern void (*kmainmenu_dispatch_cursorevent)(void *) __attribute__((__stdcall__));
94
extern void (*kmainmenu_dispatch_cursorevent)(ksubmenu_t *) __attribute__((__stdcall__));
20
extern void (*kmenu_init)(void *) __attribute__((__stdcall__));
95
extern void (*kmenu_init)(void *) __attribute__((__stdcall__));
21
extern void* (*ksubmenu_new)() __attribute__((__stdcall__));
96
extern ksubmenu_t* (*ksubmenu_new)() __attribute__((__stdcall__));
Line 22... Line 97...
22
extern void (*ksubmenu_add)(void *, void *) __attribute__((__stdcall__));
97
extern void (*ksubmenu_add)(ksubmenu_t *, kmenuitem_t *) __attribute__((__stdcall__));