1 | #ifndef MENU_H |
---|
2 | #define MENU_H |
---|
3 | |
---|
4 | #include <panel-widget.h> |
---|
5 | #include "applet.h" |
---|
6 | |
---|
7 | BEGIN_GNOME_DECLS |
---|
8 | |
---|
9 | /*compatibility only*/ |
---|
10 | typedef enum { |
---|
11 | X_MAIN_MENU_BOTH, |
---|
12 | X_MAIN_MENU_USER, |
---|
13 | X_MAIN_MENU_SYSTEM |
---|
14 | } X_MainMenuType; |
---|
15 | |
---|
16 | enum { |
---|
17 | MAIN_MENU_USER = 1<<0, |
---|
18 | MAIN_MENU_USER_SUB = 1<<1, |
---|
19 | MAIN_MENU_SYSTEM = 1<<2, |
---|
20 | MAIN_MENU_SYSTEM_SUB = 1<<3, |
---|
21 | MAIN_MENU_DISTRIBUTION = 1<<4, |
---|
22 | MAIN_MENU_DISTRIBUTION_SUB = 1<<5, |
---|
23 | MAIN_MENU_KDE = 1<<6, |
---|
24 | MAIN_MENU_KDE_SUB = 1<<7, |
---|
25 | /* keep this for compatibility. */ |
---|
26 | MAIN_MENU_OBSOLETE_DEBIAN = 1<<8, |
---|
27 | MAIN_MENU_OBSOLETE_DEBIAN_SUB = 1<<9, |
---|
28 | MAIN_MENU_APPLETS = 1<<10, |
---|
29 | MAIN_MENU_APPLETS_SUB = 1<<11, |
---|
30 | MAIN_MENU_PANEL = 1<<12, |
---|
31 | MAIN_MENU_PANEL_SUB = 1<<13, |
---|
32 | MAIN_MENU_DESKTOP = 1<<14, |
---|
33 | MAIN_MENU_DESKTOP_SUB = 1<<15 |
---|
34 | }; |
---|
35 | |
---|
36 | /* this is defined in menu-properties.c */ |
---|
37 | typedef struct _MenuDialogInfo MenuDialogInfo; |
---|
38 | |
---|
39 | typedef struct _Menu Menu; |
---|
40 | struct _Menu { |
---|
41 | GtkWidget *button; |
---|
42 | GtkWidget *menu; |
---|
43 | gboolean custom_icon; |
---|
44 | char *custom_icon_file; |
---|
45 | char *path; |
---|
46 | int main_menu_flags; |
---|
47 | gboolean global_main; |
---|
48 | int age; |
---|
49 | GtkWidget *prop_dialog; |
---|
50 | MenuDialogInfo *dialog_info; |
---|
51 | AppletInfo *info; |
---|
52 | }; |
---|
53 | |
---|
54 | void load_menu_applet (const char *params, |
---|
55 | int main_menu_flags, |
---|
56 | gboolean global_main, |
---|
57 | gboolean custom_icon, |
---|
58 | const char *custom_icon_file, |
---|
59 | PanelWidget *panel, |
---|
60 | int pos, |
---|
61 | gboolean exactpos); |
---|
62 | void add_menu_widget (Menu *menu, |
---|
63 | PanelWidget *panel, |
---|
64 | GSList *menudirl, |
---|
65 | gboolean main_menu, |
---|
66 | gboolean fake_subs); |
---|
67 | |
---|
68 | void set_menu_applet_orient (Menu *menu, |
---|
69 | PanelOrientType orient); |
---|
70 | |
---|
71 | void setup_menuitem (GtkWidget *menuitem, |
---|
72 | GtkWidget *pixmap, |
---|
73 | const char *title); |
---|
74 | void make_panel_submenu (GtkWidget *menu, |
---|
75 | gboolean fake_submenus, |
---|
76 | gboolean is_basep); |
---|
77 | |
---|
78 | GtkWidget * create_panel_root_menu (PanelWidget *panel, |
---|
79 | gboolean tearoff); |
---|
80 | |
---|
81 | void menu_properties (Menu *menu); |
---|
82 | |
---|
83 | void panel_lock (GtkWidget *widget, |
---|
84 | gpointer data); |
---|
85 | |
---|
86 | /*to be called on startup to load in some of the directories*/ |
---|
87 | void init_menus (void); |
---|
88 | |
---|
89 | void save_tornoff (void); |
---|
90 | void load_tornoff (void); |
---|
91 | |
---|
92 | GtkWidget * create_menu_at (GtkWidget *menu, |
---|
93 | const char *menudir, |
---|
94 | gboolean applets, |
---|
95 | gboolean launcher_add, |
---|
96 | gboolean favourites_add, |
---|
97 | const char *dir_name, |
---|
98 | const char *pixmap_name, |
---|
99 | gboolean fake_submenus, |
---|
100 | gboolean force, |
---|
101 | gboolean title); |
---|
102 | GtkWidget * create_fake_menu_at (const char *menudir, |
---|
103 | gboolean applets, |
---|
104 | gboolean launcher_add, |
---|
105 | gboolean favourites_add, |
---|
106 | const char *dir_name, |
---|
107 | const char *pixmap_name, |
---|
108 | gboolean title); |
---|
109 | GtkWidget * start_favourites_menu (GtkWidget *menu, |
---|
110 | gboolean fake_submenus); |
---|
111 | |
---|
112 | void submenu_to_display (GtkWidget *menuw, gpointer data); |
---|
113 | gboolean menu_need_reread (GtkWidget *menuw); |
---|
114 | |
---|
115 | void setup_internal_applet_drag (GtkWidget *menuitem, |
---|
116 | const char *applet_type); |
---|
117 | GtkWidget * create_root_menu (GtkWidget *root_menu, |
---|
118 | gboolean fake_submenus, |
---|
119 | int flags, |
---|
120 | gboolean tearoff, |
---|
121 | gboolean is_basep, |
---|
122 | gboolean title); |
---|
123 | |
---|
124 | /* some gtk code cut-n-paste action */ |
---|
125 | void our_gtk_menu_position (GtkMenu *menu); |
---|
126 | |
---|
127 | /* Why the hell do we have a "hack", when we have scroll-menu in |
---|
128 | * our own codebase? Well cuz I don't want to require panel code in |
---|
129 | * scroll-menu, since people copy it around */ |
---|
130 | GtkWidget * hack_scroll_menu_new (void); |
---|
131 | |
---|
132 | void panel_add_favourite (const char *source_dentry); |
---|
133 | |
---|
134 | #define MENU_PATH "menu_path" |
---|
135 | |
---|
136 | #define MENU_TYPES "types_menu" |
---|
137 | #define MENU_TYPE_EDGE "type-edge" |
---|
138 | #define MENU_TYPE_ALIGNED "type-aligned" |
---|
139 | #define MENU_TYPE_SLIDING "type-sliding" |
---|
140 | #define MENU_TYPE_FLOATING "type-floating" |
---|
141 | |
---|
142 | #define MENU_MODES "modes_menu" |
---|
143 | #define MENU_MODE_EXPLICIT_HIDE "mode-explicit-hide" |
---|
144 | #define MENU_MODE_AUTO_HIDE "mode-auto-hide" |
---|
145 | |
---|
146 | #define MENU_HIDEBUTTONS "hidebuttons_menu" |
---|
147 | #define MENU_HIDEBUTTONS_PIXMAP "hidebuttons-pixmap" |
---|
148 | #define MENU_HIDEBUTTONS_PLAIN "hidebuttons-plain" |
---|
149 | #define MENU_HIDEBUTTONS_NONE "hidebuttons-none" |
---|
150 | |
---|
151 | /* perhaps into basep-widget.h? */ |
---|
152 | enum { |
---|
153 | HIDEBUTTONS_PIXMAP, |
---|
154 | HIDEBUTTONS_PLAIN, |
---|
155 | HIDEBUTTONS_NONE |
---|
156 | }; |
---|
157 | |
---|
158 | |
---|
159 | #define MENU_SIZES "sizes_menu" |
---|
160 | #define MENU_SIZE_ULTRA_TINY "size-ultra-tiny" |
---|
161 | #define MENU_SIZE_TINY "size-tiny" |
---|
162 | #define MENU_SIZE_SMALL "size-small" |
---|
163 | #define MENU_SIZE_STANDARD "size-standard" |
---|
164 | #define MENU_SIZE_LARGE "size-large" |
---|
165 | #define MENU_SIZE_HUGE "size-huge" |
---|
166 | #define MENU_SIZE_RIDICULOUS "size-ridiculous" |
---|
167 | |
---|
168 | #define MENU_BACKS "background_menu" |
---|
169 | #define MENU_BACK_NONE "back-none" |
---|
170 | #define MENU_BACK_PIXMAP "back-pixmap" |
---|
171 | #define MENU_BACK_COLOR "back-color" |
---|
172 | #define MENU_BACK_TRANSLUCENT "back-translucent" |
---|
173 | |
---|
174 | #define MENU_ORIENTS "orients_menu" |
---|
175 | #define MENU_ORIENT_HORIZONTAL "orient-horizontal" |
---|
176 | #define MENU_ORIENT_VERTICAL "orient-vertical" |
---|
177 | |
---|
178 | #define MENU_MAXIMIZE_MODE "maximize_mode_menu" |
---|
179 | #define MENU_AVOID_ON_MAX "avoid-on-max" |
---|
180 | #define MENU_NO_AVOID_ON_MAX "no-avoid-on-max" |
---|
181 | |
---|
182 | #define MENU_LEVELS "levels_menu" |
---|
183 | #define MENU_LEVEL_DEFAULT "level-default" |
---|
184 | #define MENU_LEVEL_ABOVE "level-above" |
---|
185 | #define MENU_LEVEL_NORMAL "level-normal" |
---|
186 | #define MENU_LEVEL_BELOW "level-below" |
---|
187 | |
---|
188 | END_GNOME_DECLS |
---|
189 | |
---|
190 | #endif |
---|