* POTFILES.in: add gnome/gcustom-layout.c file
[midnight-commander.git] / src / menu.h
blobecd027ca78639cc6fca9cc9ad5d3c61c844a9f6d
1 #ifndef __MENU_H
2 #define __MENU_H
4 /* IMPORTANT NOTE: This header is dependent on HAVE_X / HAVE_XVIEW. If you
5 * include this header, you have to move it to the group of HAVE_X dependant
6 * modules in {xv|tk}/Makefile.in !!!
7 */
9 #include "dlg.h"
10 #include "widget.h"
12 typedef void (*callfn) ();
13 /* FIXME: We have to leave this type ambiguous, because `callfn' is
14 used both for functions that take an argument and ones that don't.
15 That ought to be cleared up. */
17 typedef struct {
18 char first_letter;
19 char *text;
20 int hot_key;
21 callfn call_back;
22 } menu_entry;
24 #ifdef HAVE_XVIEW
25 # ifndef xview_walkmenu_DEFINED
26 typedef unsigned long Menu;
27 # endif
28 #else
29 typedef struct {
30 char *name;
31 int count;
32 int max_entry_len;
33 int selected;
34 int hotkey;
35 menu_entry *entries;
36 int start_x; /* position relative to menubar start */
37 } sMenu;
38 typedef sMenu *Menu;
39 #endif
41 extern int menubar_visible;
43 /* The button bar menu */
44 typedef struct {
45 Widget widget;
47 int active; /* If the menubar is in use */
48 int dropped; /* If the menubar has dropped */
49 Menu *menu; /* The actual menus */
50 int items;
51 int selected; /* Selected menu on the top bar */
52 int subsel; /* Selected entry on the submenu */
53 int max_entry_len; /* Cache value for the columns in a box */
54 int previous_selection; /* Selected widget before activating menu */
55 } WMenu;
57 Menu create_menu (char *name, menu_entry *entries, int count);
58 void destroy_menu (Menu menu);
59 WMenu *menubar_new (int y, int x, int cols, Menu menu [], int items);
60 void menubar_arrange (WMenu* menubar);
61 int menubar_event (Gpm_Event *event, WMenu *menubar);
63 #endif /* __MENU_H */