Mercurial > pidgin.yaz
comparison finch/libgnt/gntmenu.h @ 15818:0e3a8505ebbe
renamed gaim-text to finch
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Sun, 18 Mar 2007 19:38:15 +0000 |
parents | |
children | f00f2e283ffb |
comparison
equal
deleted
inserted
replaced
15817:317e7613e581 | 15818:0e3a8505ebbe |
---|---|
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 _GnMenu GntMenu; | |
20 typedef struct _GnMenuPriv GntMenuPriv; | |
21 typedef struct _GnMenuClass 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 _GnMenu | |
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 _GnMenuClass | |
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 */ |