Internal menu structures are opaque now.
[midnight-commander.git] / lib / widget / menu.h
blobda1acf4ded2fe6296ab7c8d38ca31e8a68130110
1 /*
2 Header file for pulldown menu engine for Midnignt Commander
3 */
5 /** \file menu.h
6 * \brief Header: pulldown menu code
7 */
9 #ifndef MC__WIDGET_MENU_H
10 #define MC__WIDGET_MENU_H
12 /*** typedefs(not structures) and defined constants **********************************************/
14 #define MENUBAR(x) ((WMenuBar *)(x))
16 #define menu_separator_create() NULL
18 /*** enums ***************************************************************************************/
20 /*** structures declarations (and typedefs of structures)*****************************************/
22 struct menu_entry_t;
23 typedef struct menu_entry_t menu_entry_t;
25 struct menu_t;
26 typedef struct menu_t menu_t;
28 /* The button bar menu */
29 typedef struct WMenuBar
31 Widget widget;
33 gboolean is_visible; /* If the menubar is visible */
34 gboolean is_active; /* If the menubar is in use */
35 gboolean is_dropped; /* If the menubar has dropped */
36 GList *menu; /* The actual menus */
37 size_t selected; /* Selected menu on the top bar */
38 unsigned long previous_widget; /* Selected widget ID before activating menu */
39 } WMenuBar;
41 /*** global variables defined in .c file *********************************************************/
43 /*** declarations of public functions ************************************************************/
45 menu_entry_t *menu_entry_create (const char *name, unsigned long command);
46 void menu_entry_free (menu_entry_t * me);
48 menu_t *create_menu (const char *name, GList * entries, const char *help_node);
49 void menu_set_name (menu_t * menu, const char *name);
50 void destroy_menu (menu_t * menu);
52 WMenuBar *menubar_new (int y, int x, int cols, GList * menu);
53 void menubar_set_menu (WMenuBar * menubar, GList * menu);
54 void menubar_add_menu (WMenuBar * menubar, menu_t * menu);
55 void menubar_arrange (WMenuBar * menubar);
57 WMenuBar *find_menubar (const WDialog * h);
59 /*** inline functions ****************************************************************************/
61 static inline void
62 menubar_set_visible (WMenuBar * menubar, gboolean visible)
64 menubar->is_visible = visible;
67 #endif /* MC__WIDGET_MENU_H */