root/lib/widget/menu.h

/* [previous][next][first][last][top][bottom][index][help]  */

INCLUDED FROM


DEFINITIONS

This source file includes following definitions.
  1. menubar_set_visible

   1 /*
   2    Header file for pulldown menu engine for Midnignt Commander
   3  */
   4 
   5 /** \file menu.h
   6  *  \brief Header: pulldown menu code
   7  */
   8 
   9 #ifndef MC__WIDGET_MENU_H
  10 #define MC__WIDGET_MENU_H
  11 
  12 /*** typedefs(not structures) and defined constants **********************************************/
  13 
  14 #define MENUBAR(x) ((WMenuBar *)(x))
  15 
  16 #define menu_separator_create() NULL
  17 
  18 /*** enums ***************************************************************************************/
  19 
  20 /*** structures declarations (and typedefs of structures)*****************************************/
  21 
  22 struct menu_entry_t;
  23 typedef struct menu_entry_t menu_entry_t;
  24 
  25 struct menu_t;
  26 typedef struct menu_t menu_t;
  27 
  28 /* The button bar menu */
  29 typedef struct WMenuBar
  30 {
  31     Widget widget;
  32 
  33     gboolean is_visible;        /* If the menubar is visible */
  34     gboolean is_dropped;        /* If the menubar has dropped */
  35     GList *menu;                /* The actual menus */
  36     guint selected;             /* Selected menu on the top bar */
  37     unsigned long previous_widget;      /* Selected widget ID before activating menu */
  38 } WMenuBar;
  39 
  40 /*** global variables defined in .c file *********************************************************/
  41 
  42 /*** declarations of public functions ************************************************************/
  43 
  44 menu_entry_t *menu_entry_create (const char *name, long command);
  45 void menu_entry_free (menu_entry_t * me);
  46 
  47 menu_t *create_menu (const char *name, GList * entries, const char *help_node);
  48 void menu_set_name (menu_t * menu, const char *name);
  49 void destroy_menu (menu_t * menu);
  50 
  51 WMenuBar *menubar_new (GList * menu, gboolean visible);
  52 void menubar_set_menu (WMenuBar * menubar, GList * menu);
  53 void menubar_add_menu (WMenuBar * menubar, menu_t * menu);
  54 void menubar_arrange (WMenuBar * menubar);
  55 
  56 WMenuBar *find_menubar (const WDialog * h);
  57 
  58 void menubar_activate (WMenuBar * menubar, gboolean dropped, int which);
  59 
  60 /*** inline functions ****************************************************************************/
  61 
  62 static inline void
  63 menubar_set_visible (WMenuBar * menubar, gboolean visible)
     /* [previous][next][first][last][top][bottom][index][help]  */
  64 {
  65     menubar->is_visible = visible;
  66 }
  67 
  68 #endif /* MC__WIDGET_MENU_H */

/* [previous][next][first][last][top][bottom][index][help]  */