Mercurial > pidgin.yaz
annotate finch/libgnt/gntcombobox.h @ 32805:064eb5d78946
propagate from branch 'im.pidgin.pidgin.2.x.y' (head 0ba3afb8adb303a77581a7872d674c600979a5a6)
to branch 'im.pidgin.pidgin' (head 7711a4d267e1fe776387496c764fb63227d70aec)
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Mon, 31 Oct 2011 01:25:36 +0000 |
parents | 44f53d3fc54f |
children |
rev | line source |
---|---|
17718
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15931
diff
changeset
|
1 /** |
18303
5c6f019e48f8
Generate doxy-help files for libgnt. And make it actually work.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17718
diff
changeset
|
2 * @file gntcombobox.h Combobox API |
5c6f019e48f8
Generate doxy-help files for libgnt. And make it actually work.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17718
diff
changeset
|
3 * @ingroup gnt |
5c6f019e48f8
Generate doxy-help files for libgnt. And make it actually work.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17718
diff
changeset
|
4 */ |
5c6f019e48f8
Generate doxy-help files for libgnt. And make it actually work.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
17718
diff
changeset
|
5 /* |
17718
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15931
diff
changeset
|
6 * GNT - The GLib Ncurses Toolkit |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15931
diff
changeset
|
7 * |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15931
diff
changeset
|
8 * GNT is the legal property of its developers, whose names are too numerous |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15931
diff
changeset
|
9 * to list here. Please refer to the COPYRIGHT file distributed with this |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15931
diff
changeset
|
10 * source distribution. |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15931
diff
changeset
|
11 * |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15931
diff
changeset
|
12 * This library is free software; you can redistribute it and/or modify |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15931
diff
changeset
|
13 * it under the terms of the GNU General Public License as published by |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15931
diff
changeset
|
14 * the Free Software Foundation; either version 2 of the License, or |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15931
diff
changeset
|
15 * (at your option) any later version. |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15931
diff
changeset
|
16 * |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15931
diff
changeset
|
17 * This program is distributed in the hope that it will be useful, |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15931
diff
changeset
|
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15931
diff
changeset
|
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15931
diff
changeset
|
20 * GNU General Public License for more details. |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15931
diff
changeset
|
21 * |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15931
diff
changeset
|
22 * You should have received a copy of the GNU General Public License |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15931
diff
changeset
|
23 * along with this program; if not, write to the Free Software |
19680
44b4e8bd759b
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19120
diff
changeset
|
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
17718
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15931
diff
changeset
|
25 */ |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15931
diff
changeset
|
26 |
15818 | 27 #ifndef GNT_COMBO_BOX_H |
28 #define GNT_COMBO_BOX_H | |
29 | |
30 #include "gnt.h" | |
31 #include "gntcolors.h" | |
32 #include "gntkeys.h" | |
33 #include "gntwidget.h" | |
34 | |
35 #define GNT_TYPE_COMBO_BOX (gnt_combo_box_get_gtype()) | |
36 #define GNT_COMBO_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GNT_TYPE_COMBO_BOX, GntComboBox)) | |
37 #define GNT_COMBO_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GNT_TYPE_COMBO_BOX, GntComboBoxClass)) | |
38 #define GNT_IS_COMBO_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GNT_TYPE_COMBO_BOX)) | |
39 #define GNT_IS_COMBO_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GNT_TYPE_COMBO_BOX)) | |
40 #define GNT_COMBO_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GNT_TYPE_COMBO_BOX, GntComboBoxClass)) | |
41 | |
42 #define GNT_COMBO_BOX_FLAGS(obj) (GNT_COMBO_BOX(obj)->priv.flags) | |
43 #define GNT_COMBO_BOX_SET_FLAGS(obj, flags) (GNT_COMBO_BOX_FLAGS(obj) |= flags) | |
44 #define GNT_COMBO_BOX_UNSET_FLAGS(obj, flags) (GNT_COMBO_BOX_FLAGS(obj) &= ~(flags)) | |
45 | |
15931
f00f2e283ffb
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15818
diff
changeset
|
46 typedef struct _GntComboBox GntComboBox; |
f00f2e283ffb
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15818
diff
changeset
|
47 typedef struct _GntComboBoxPriv GntComboBoxPriv; |
f00f2e283ffb
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15818
diff
changeset
|
48 typedef struct _GntComboBoxClass GntComboBoxClass; |
15818 | 49 |
15931
f00f2e283ffb
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15818
diff
changeset
|
50 struct _GntComboBox |
15818 | 51 { |
52 GntWidget parent; | |
53 | |
54 GntWidget *dropdown; /* This is a GntTree */ | |
55 | |
56 void *selected; /* Currently selected key */ | |
57 }; | |
58 | |
15931
f00f2e283ffb
Some define changes. This helps in generating the python bindings.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents:
15818
diff
changeset
|
59 struct _GntComboBoxClass |
15818 | 60 { |
61 GntWidgetClass parent; | |
62 | |
63 void (*gnt_reserved1)(void); | |
64 void (*gnt_reserved2)(void); | |
65 void (*gnt_reserved3)(void); | |
66 void (*gnt_reserved4)(void); | |
67 }; | |
68 | |
69 G_BEGIN_DECLS | |
70 | |
17718
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15931
diff
changeset
|
71 /** |
20306
665d6d7eea83
applied changes from 88f296b3653b5a7578a7581c1582d37390c9d212
Luke Schierer <lschiere@pidgin.im>
parents:
19680
diff
changeset
|
72 * @return Get the GType for GntComboBox |
17718
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15931
diff
changeset
|
73 */ |
15818 | 74 GType gnt_combo_box_get_gtype(void); |
75 | |
17718
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15931
diff
changeset
|
76 /** |
19116 | 77 * Create a new GntComboBox |
17718
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15931
diff
changeset
|
78 * |
19116 | 79 * @return A new GntComboBox |
17718
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15931
diff
changeset
|
80 */ |
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15931
diff
changeset
|
81 GntWidget * gnt_combo_box_new(void); |
15818 | 82 |
17718
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15931
diff
changeset
|
83 /** |
19116 | 84 * Add an entry |
85 * | |
86 * @param box The GntComboBox | |
87 * @param key The data | |
88 * @param text The text to display | |
17718
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15931
diff
changeset
|
89 */ |
15818 | 90 void gnt_combo_box_add_data(GntComboBox *box, gpointer key, const char *text); |
91 | |
17718
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15931
diff
changeset
|
92 /** |
19116 | 93 * Remove an entry |
31533
44f53d3fc54f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
20306
diff
changeset
|
94 * |
19116 | 95 * @param box The GntComboBox |
96 * @param key The data to be removed | |
17718
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15931
diff
changeset
|
97 */ |
15818 | 98 void gnt_combo_box_remove(GntComboBox *box, gpointer key); |
99 | |
17718
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15931
diff
changeset
|
100 /** |
19116 | 101 * Remove all entries |
102 * | |
103 * @param box The GntComboBox | |
17718
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15931
diff
changeset
|
104 */ |
15818 | 105 void gnt_combo_box_remove_all(GntComboBox *box); |
106 | |
17718
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15931
diff
changeset
|
107 /** |
19116 | 108 * Get the data that is currently selected |
17718
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15931
diff
changeset
|
109 * |
19116 | 110 * @param box The GntComboBox |
111 * | |
112 * @return The data of the currently selected entry | |
17718
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15931
diff
changeset
|
113 */ |
15818 | 114 gpointer gnt_combo_box_get_selected_data(GntComboBox *box); |
115 | |
17718
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15931
diff
changeset
|
116 /** |
19116 | 117 * Set the current selection to a specific entry |
118 * | |
119 * @param box The GntComboBox | |
120 * @param key The data to be set to | |
17718
8410511f4dbb
applied changes from 016401bd409e6229fae0ab1e80d9fef9365511b3
Eric Polino <aluink@pidgin.im>
parents:
15931
diff
changeset
|
121 */ |
15818 | 122 void gnt_combo_box_set_selected(GntComboBox *box, gpointer key); |
123 | |
124 G_END_DECLS | |
125 | |
126 #endif /* GNT_COMBO_BOX_H */ |