home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / usr / include / gnt / gntmenu.h < prev    next >
Encoding:
C/C++ Source or Header  |  2007-05-04  |  1.8 KB  |  71 lines

  1. #ifndef GNT_MENU_H
  2. #define GNT_MENU_H
  3.  
  4. #include "gnttree.h"
  5. #include "gntcolors.h"
  6. #include "gntkeys.h"
  7.  
  8. #define GNT_TYPE_MENU                (gnt_menu_get_gtype())
  9. #define GNT_MENU(obj)                (G_TYPE_CHECK_INSTANCE_CAST((obj), GNT_TYPE_MENU, GntMenu))
  10. #define GNT_MENU_CLASS(klass)        (G_TYPE_CHECK_CLASS_CAST((klass), GNT_TYPE_MENU, GntMenuClass))
  11. #define GNT_IS_MENU(obj)            (G_TYPE_CHECK_INSTANCE_TYPE((obj), GNT_TYPE_MENU))
  12. #define GNT_IS_MENU_CLASS(klass)    (G_TYPE_CHECK_CLASS_TYPE((klass), GNT_TYPE_MENU))
  13. #define GNT_MENU_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS((obj), GNT_TYPE_MENU, GntMenuClass))
  14.  
  15. #define GNT_MENU_FLAGS(obj)                (GNT_MENU(obj)->priv.flags)
  16. #define GNT_MENU_SET_FLAGS(obj, flags)        (GNT_MENU_FLAGS(obj) |= flags)
  17. #define GNT_MENU_UNSET_FLAGS(obj, flags)    (GNT_MENU_FLAGS(obj) &= ~(flags))
  18.  
  19. typedef struct _GntMenu            GntMenu;
  20. typedef struct _GntMenuPriv        GntMenuPriv;
  21. typedef struct _GntMenuClass        GntMenuClass;
  22.  
  23. #include "gntmenuitem.h"
  24.  
  25. /**
  26.  * A toplevel-menu is displayed at the top of the screen, and it spans accross
  27.  * the entire width of the screen.
  28.  * A popup-menu could be displayed, for example, as a context menu for widgets.
  29.  */
  30. typedef enum
  31. {
  32.     GNT_MENU_TOPLEVEL = 1,  /* Menu for a toplevel window */
  33.     GNT_MENU_POPUP,         /* A popup menu */
  34. } GntMenuType;
  35.  
  36. struct _GntMenu
  37. {
  38.     GntTree parent;
  39.     GntMenuType type;
  40.     
  41.     GList *list;
  42.     int selected;
  43.  
  44.     /* This will keep track of its immediate submenu which is visible so that
  45.      * keystrokes can be passed to it. */
  46.     GntMenu *submenu;
  47.     GntMenu *parentmenu;
  48. };
  49.  
  50. struct _GntMenuClass
  51. {
  52.     GntTreeClass parent;
  53.  
  54.     void (*gnt_reserved1)(void);
  55.     void (*gnt_reserved2)(void);
  56.     void (*gnt_reserved3)(void);
  57.     void (*gnt_reserved4)(void);
  58. };
  59.  
  60. G_BEGIN_DECLS
  61.  
  62. GType gnt_menu_get_gtype(void);
  63.  
  64. GntWidget *gnt_menu_new(GntMenuType type);
  65.  
  66. void gnt_menu_add_item(GntMenu *menu, GntMenuItem *item);
  67.  
  68. G_END_DECLS
  69.  
  70. #endif /* GNT_MENU_H */
  71.