comparison console/libgnt/gntcombobox.h @ 13935:cd2da4b079cf

[gaim-migrate @ 16466] New widget GntComboBox. I have addde a test file as an example as well. Rename gntutils.* to gntmarshal.* I am going to have some util-functions in gntutils.* later. committer: Tailor Script <tailor@pidgin.im>
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sat, 08 Jul 2006 23:58:20 +0000
parents
children a71678d2da16
comparison
equal deleted inserted replaced
13934:ef0d515b9f97 13935:cd2da4b079cf
1 #ifndef GNT_COMBO_BOX_H
2 #define GNT_COMBO_BOX_H
3
4 #include "gnt.h"
5 #include "gntcolors.h"
6 #include "gntkeys.h"
7 #include "gntwidget.h"
8
9 #define GNT_TYPE_COMBO_BOX (gnt_combo_box_get_gtype())
10 #define GNT_COMBO_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GNT_TYPE_COMBO_BOX, GntComboBox))
11 #define GNT_COMBO_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GNT_TYPE_COMBO_BOX, GntComboBoxClass))
12 #define GNT_IS_COMBO_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GNT_TYPE_COMBO_BOX))
13 #define GNT_IS_COMBO_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GNT_TYPE_COMBO_BOX))
14 #define GNT_COMBO_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GNT_TYPE_COMBO_BOX, GntComboBoxClass))
15
16 #define GNT_COMBO_BOX_FLAGS(obj) (GNT_COMBO_BOX(obj)->priv.flags)
17 #define GNT_COMBO_BOX_SET_FLAGS(obj, flags) (GNT_COMBO_BOX_FLAGS(obj) |= flags)
18 #define GNT_COMBO_BOX_UNSET_FLAGS(obj, flags) (GNT_COMBO_BOX_FLAGS(obj) &= ~(flags))
19
20 typedef struct _GnComboBox GntComboBox;
21 typedef struct _GnComboBoxPriv GntComboBoxPriv;
22 typedef struct _GnComboBoxClass GntComboBoxClass;
23
24 struct _GnComboBox
25 {
26 GntWidget parent;
27
28 GntWidget *dropdown; /* This is a GntTree */
29
30 void *selected; /* Currently selected key */
31 };
32
33 struct _GnComboBoxClass
34 {
35 GntWidgetClass parent;
36
37 void (*gnt_reserved1)(void);
38 void (*gnt_reserved2)(void);
39 void (*gnt_reserved3)(void);
40 void (*gnt_reserved4)(void);
41 };
42
43 G_BEGIN_DECLS
44
45 GType gnt_combo_box_get_gtype(void);
46
47 GntWidget *gnt_combo_box_new();
48
49 void gnt_combo_box_add_data(GntComboBox *box, gpointer key, const char *text);
50
51 gpointer gnt_combo_box_get_selected_data(GntComboBox *box);
52
53 G_END_DECLS
54
55 #endif /* GNT_COMBO_BOX_H */