2011-10-15 14:56:47 +04:00
|
|
|
/*
|
|
|
|
Header file for pulldown menu engine for Midnignt Commander
|
|
|
|
*/
|
2009-05-04 20:11:51 +04:00
|
|
|
|
2009-02-05 21:28:18 +03:00
|
|
|
/** \file menu.h
|
|
|
|
* \brief Header: pulldown menu code
|
|
|
|
*/
|
|
|
|
|
2010-11-12 11:03:57 +03:00
|
|
|
#ifndef MC__WIDGET_MENU_H
|
|
|
|
#define MC__WIDGET_MENU_H
|
1998-02-27 07:54:42 +03:00
|
|
|
|
2010-11-10 14:09:42 +03:00
|
|
|
/*** typedefs(not structures) and defined constants **********************************************/
|
|
|
|
|
2012-10-11 12:25:07 +04:00
|
|
|
#define MENUBAR(x) ((WMenuBar *)(x))
|
|
|
|
|
2010-11-10 14:09:42 +03:00
|
|
|
#define menu_separator_create() NULL
|
|
|
|
|
|
|
|
/*** enums ***************************************************************************************/
|
2009-05-04 20:11:51 +04:00
|
|
|
|
2010-11-10 14:09:42 +03:00
|
|
|
/*** structures declarations (and typedefs of structures)*****************************************/
|
|
|
|
|
2012-10-11 12:41:29 +04:00
|
|
|
struct menu_entry_t;
|
|
|
|
typedef struct menu_entry_t menu_entry_t;
|
2009-05-04 20:11:51 +04:00
|
|
|
|
2012-10-11 12:41:29 +04:00
|
|
|
struct menu_t;
|
|
|
|
typedef struct menu_t menu_t;
|
1998-02-27 07:54:42 +03:00
|
|
|
|
|
|
|
/* The button bar menu */
|
2010-11-10 14:09:42 +03:00
|
|
|
typedef struct WMenuBar
|
|
|
|
{
|
1998-02-27 07:54:42 +03:00
|
|
|
Widget widget;
|
|
|
|
|
2010-11-14 11:35:56 +03:00
|
|
|
gboolean is_visible; /* If the menubar is visible */
|
2010-11-10 14:09:42 +03:00
|
|
|
gboolean is_active; /* If the menubar is in use */
|
|
|
|
gboolean is_dropped; /* If the menubar has dropped */
|
|
|
|
GList *menu; /* The actual menus */
|
2015-11-15 20:09:40 +03:00
|
|
|
guint selected; /* Selected menu on the top bar */
|
2011-04-17 14:12:07 +04:00
|
|
|
unsigned long previous_widget; /* Selected widget ID before activating menu */
|
2009-05-04 20:11:51 +04:00
|
|
|
} WMenuBar;
|
|
|
|
|
2010-11-10 14:09:42 +03:00
|
|
|
/*** global variables defined in .c file *********************************************************/
|
|
|
|
|
|
|
|
/*** declarations of public functions ************************************************************/
|
|
|
|
|
2015-11-21 18:15:11 +03:00
|
|
|
menu_entry_t *menu_entry_create (const char *name, long command);
|
2010-11-10 14:09:42 +03:00
|
|
|
void menu_entry_free (menu_entry_t * me);
|
|
|
|
|
2012-10-11 12:41:29 +04:00
|
|
|
menu_t *create_menu (const char *name, GList * entries, const char *help_node);
|
|
|
|
void menu_set_name (menu_t * menu, const char *name);
|
|
|
|
void destroy_menu (menu_t * menu);
|
2010-11-10 14:09:42 +03:00
|
|
|
|
2013-07-27 10:15:43 +04:00
|
|
|
WMenuBar *menubar_new (int y, int x, int cols, GList * menu, gboolean visible);
|
2010-11-10 14:09:42 +03:00
|
|
|
void menubar_set_menu (WMenuBar * menubar, GList * menu);
|
2012-10-11 12:41:29 +04:00
|
|
|
void menubar_add_menu (WMenuBar * menubar, menu_t * menu);
|
2010-11-10 14:09:42 +03:00
|
|
|
void menubar_arrange (WMenuBar * menubar);
|
2009-05-04 20:11:51 +04:00
|
|
|
|
2012-09-28 11:18:45 +04:00
|
|
|
WMenuBar *find_menubar (const WDialog * h);
|
2009-11-08 13:49:27 +03:00
|
|
|
|
2010-11-10 14:09:42 +03:00
|
|
|
/*** inline functions ****************************************************************************/
|
2010-11-12 11:03:57 +03:00
|
|
|
|
2010-11-14 11:35:56 +03:00
|
|
|
static inline void
|
|
|
|
menubar_set_visible (WMenuBar * menubar, gboolean visible)
|
|
|
|
{
|
|
|
|
menubar->is_visible = visible;
|
|
|
|
}
|
|
|
|
|
2010-11-12 11:03:57 +03:00
|
|
|
#endif /* MC__WIDGET_MENU_H */
|