28 |
28 |
29 #ifndef MENU_H |
29 #ifndef MENU_H |
30 #define MENU_H |
30 #define MENU_H |
31 |
31 |
32 #include "../ui/menu.h" |
32 #include "../ui/menu.h" |
|
33 #include "../common/menu.h" |
33 #include <cx/list.h> |
34 #include <cx/list.h> |
34 #include "toolkit.h" |
35 #include "toolkit.h" |
35 |
36 |
36 #ifdef __cplusplus |
37 #ifdef __cplusplus |
37 extern "C" { |
38 extern "C" { |
38 #endif |
39 #endif |
39 |
40 |
40 typedef struct UiMenuItemI UiMenuItemI; |
|
41 typedef struct UiMenu UiMenu; |
|
42 typedef struct UiMenuItem UiMenuItem; |
|
43 typedef struct UiStMenuItem UiStMenuItem; |
|
44 typedef struct UiCheckItem UiCheckItem; |
|
45 typedef struct UiCheckItemNV UiCheckItemNV; |
|
46 typedef struct UiMenuItemList UiMenuItemList; |
|
47 |
41 |
48 typedef struct UiActiveMenuItemList UiActiveMenuItemList; |
42 typedef struct UiActiveMenuItemList UiActiveMenuItemList; |
49 |
43 |
50 typedef GtkWidget*(*ui_menu_add_f)(GtkWidget *, int, UiMenuItemI*, UiObject*); |
44 typedef void(*ui_menu_add_f)(GtkWidget *, int, UiMenuItemI*, UiObject*); |
51 |
|
52 struct UiMenuItemI { |
|
53 UiMenuItemI *prev; |
|
54 UiMenuItemI *next; |
|
55 ui_menu_add_f add_to; |
|
56 }; |
|
57 |
|
58 struct UiMenu { |
|
59 UiMenuItemI item; |
|
60 char *label; |
|
61 UiMenuItemI *items_begin; |
|
62 UiMenuItemI *items_end; |
|
63 UiMenu *parent; |
|
64 }; |
|
65 |
|
66 struct UiMenuItem { |
|
67 UiMenuItemI item; |
|
68 ui_callback callback; |
|
69 char *label; |
|
70 void *userdata; |
|
71 CxList *groups; |
|
72 }; |
|
73 |
|
74 struct UiStMenuItem { |
|
75 UiMenuItemI item; |
|
76 ui_callback callback; |
|
77 char *stockid; |
|
78 void *userdata; |
|
79 CxList *groups; |
|
80 }; |
|
81 |
|
82 struct UiCheckItem { |
|
83 UiMenuItemI item; |
|
84 char *label; |
|
85 ui_callback callback; |
|
86 void *userdata; |
|
87 }; |
|
88 |
|
89 struct UiCheckItemNV { |
|
90 UiMenuItemI item; |
|
91 char *label; |
|
92 char *varname; |
|
93 }; |
|
94 |
|
95 struct UiMenuItemList { |
|
96 UiMenuItemI item; |
|
97 ui_callback callback; |
|
98 void *userdata; |
|
99 UiList *list; |
|
100 }; |
|
101 |
45 |
102 struct UiActiveMenuItemList { |
46 struct UiActiveMenuItemList { |
103 UiObject *object; |
47 UiObject *object; |
104 GtkMenuShell *menu; |
48 GtkMenuShell *menu; |
105 int index; |
49 int index; |