2 /* Header file for pulldown menu engine for Midnignt Commander
3 Copyright (C) 1994, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
4 2007, 2009 Free Software Foundation, Inc.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
21 * \brief Header: pulldown menu code
30 extern int menubar_visible
;
32 typedef struct menu_entry_t
{
33 unsigned char first_letter
;
39 menu_entry_t
*menu_entry_create (const char *name
, int command
);
40 void menu_entry_free (menu_entry_t
*me
);
41 #define menu_separator_create() NULL
44 int start_x
; /* position relative to menubar start */
47 size_t max_entry_len
; /* cached max length of entry texts (text + shortcut) */
48 size_t max_hotkey_len
; /* cached max length of shortcuts */
49 unsigned int selected
; /* pointer to current menu entry */
53 Menu
*create_menu (const char *name
, GList
*entries
,
54 const char *help_node
);
56 void destroy_menu (Menu
*menu
);
58 /* The button bar menu */
59 typedef struct WMenuBar
{
62 gboolean is_active
; /* If the menubar is in use */
63 gboolean is_dropped
; /* If the menubar has dropped */
64 GList
*menu
; /* The actual menus */
65 size_t selected
; /* Selected menu on the top bar */
66 int previous_widget
; /* Selected widget ID before activating menu */
69 WMenuBar
*menubar_new (int y
, int x
, int cols
, GList
*menu
);
70 void menubar_set_menu (WMenuBar
*menubar
, GList
*menu
);
71 void menubar_add_menu (WMenuBar
*menubar
, Menu
*menu
);
72 void menubar_arrange (WMenuBar
*menubar
);
74 #endif /* MC_MENU_H */