*** empty log message ***
[midnight-commander.git] / src / menu.h
blobbd7568283c9b4020ffe5249bf44ad2a075bfc56e
1 #ifndef __MENU_H
2 #define __MENU_H
4 #include "dlg.h"
5 #include "widget.h"
7 typedef void (*callfn) ();
8 /* FIXME: We have to leave this type ambiguous, because `callfn' is
9 used both for functions that take an argument and ones that don't.
10 That ought to be cleared up. */
12 typedef struct {
13 char first_letter;
14 char *text;
15 int hot_key;
16 callfn call_back;
17 } menu_entry;
19 typedef struct {
20 char *name;
21 int count;
22 int max_entry_len;
23 int selected;
24 int hotkey;
25 menu_entry *entries;
26 int start_x; /* position relative to menubar start */
27 char *help_node;
28 } sMenu;
29 typedef sMenu *Menu;
31 extern int menubar_visible;
33 /* The button bar menu */
34 typedef struct {
35 Widget widget;
37 int active; /* If the menubar is in use */
38 int dropped; /* If the menubar has dropped */
39 Menu *menu; /* The actual menus */
40 int items;
41 int selected; /* Selected menu on the top bar */
42 int subsel; /* Selected entry on the submenu */
43 int max_entry_len; /* Cache value for the columns in a box */
44 int previous_selection; /* Selected widget before activating menu */
45 } WMenu;
47 Menu create_menu (char *name, menu_entry *entries, int count,
48 char *help_node);
49 void destroy_menu (Menu menu);
50 WMenu *menubar_new (int y, int x, int cols, Menu menu [], int items);
51 void menubar_arrange (WMenu* menubar);
52 int menubar_event (Gpm_Event *event, WMenu *menubar);
54 #endif /* __MENU_H */