gntcheckbox.h
Go to the documentation of this file.
1
5 /*
6 * GNT - The GLib Ncurses Toolkit
7 *
8 * GNT is the legal property of its developers, whose names are too numerous
9 * to list here. Please refer to the COPYRIGHT file distributed with this
10 * source distribution.
11 *
12 * This library is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
25 */
26
27 #ifndef GNT_CHECK_BOX_H
28 #define GNT_CHECK_BOX_H
29
30 #include "gntbutton.h"
31 #include "gnt.h"
32 #include "gntcolors.h"
33 #include "gntkeys.h"
34
35 #define GNT_TYPE_CHECK_BOX (gnt_check_box_get_gtype())
36 #define GNT_CHECK_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GNT_TYPE_CHECK_BOX, GntCheckBox))
37 #define GNT_CHECK_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GNT_TYPE_CHECK_BOX, GntCheckBoxClass))
38 #define GNT_IS_CHECK_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GNT_TYPE_CHECK_BOX))
39 #define GNT_IS_CHECK_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GNT_TYPE_CHECK_BOX))
40 #define GNT_CHECK_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GNT_TYPE_CHECK_BOX, GntCheckBoxClass))
41
42 #define GNT_CHECK_BOX_FLAGS(obj) (GNT_CHECK_BOX(obj)->priv.flags)
43 #define GNT_CHECK_BOX_SET_FLAGS(obj, flags) (GNT_CHECK_BOX_FLAGS(obj) |= flags)
44 #define GNT_CHECK_BOX_UNSET_FLAGS(obj, flags) (GNT_CHECK_BOX_FLAGS(obj) &= ~(flags))
45
46 typedef struct _GntCheckBox GntCheckBox;
47 typedef struct _GntCheckBoxPriv GntCheckBoxPriv;
48 typedef struct _GntCheckBoxClass GntCheckBoxClass;
49
50 struct _GntCheckBox
51 {
52 GntButton parent;
53 gboolean checked;
54 };
55
56 struct _GntCheckBoxClass
57 {
58 GntButtonClass parent;
59
60 void (*toggled)(void);
61
62 void (*gnt_reserved1)(void);
63 void (*gnt_reserved2)(void);
64 void (*gnt_reserved3)(void);
65 void (*gnt_reserved4)(void);
66 };
67
68 G_BEGIN_DECLS
69
73 GType gnt_check_box_get_gtype(void);
74
82 GntWidget * gnt_check_box_new(const char *text);
83
90 void gnt_check_box_set_checked(GntCheckBox *box, gboolean set);
91
99 gboolean gnt_check_box_get_checked(GntCheckBox *box);
100
101 G_END_DECLS
102
103 #endif /* GNT_CHECK_BOX_H */
_GntCheckBox
Definition: gntcheckbox.h:50
_GntButtonClass
Definition: gntbutton.h:63
gntcolors.h
Colors API.
_GntButton
Definition: gntbutton.h:51
gnt.h
GNT API.
gntkeys.h
Keys API.
gnt_check_box_new
GntWidget * gnt_check_box_new(const char *text)
Create a new checkbox.
gntbutton.h
Button API.
gnt_check_box_get_checked
gboolean gnt_check_box_get_checked(GntCheckBox *box)
Return the checked state of the checkbox.
_GntCheckBoxClass
Definition: gntcheckbox.h:56
gnt_check_box_get_gtype
G_BEGIN_DECLS GType gnt_check_box_get_gtype(void)
_GntWidget
Definition: gntwidget.h:98
gnt_check_box_set_checked
void gnt_check_box_set_checked(GntCheckBox *box, gboolean set)
Set whether the checkbox should be checked or not.