15818
|
1 #include "gntmenuitemcheck.h"
|
|
2
|
|
3 static GntMenuItemClass *parent_class = NULL;
|
|
4
|
|
5 static void
|
|
6 gnt_menuitem_check_class_init(GntMenuItemCheckClass *klass)
|
|
7 {
|
|
8 parent_class = GNT_MENUITEM_CLASS(klass);
|
|
9
|
|
10 GNTDEBUG;
|
|
11 }
|
|
12
|
|
13 static void
|
|
14 gnt_menuitem_check_init(GTypeInstance *instance, gpointer class)
|
|
15 {
|
|
16 GNTDEBUG;
|
|
17 }
|
|
18
|
|
19 /******************************************************************************
|
|
20 * GntMenuItemCheck API
|
|
21 *****************************************************************************/
|
|
22 GType
|
|
23 gnt_menuitem_check_get_gtype(void)
|
|
24 {
|
|
25 static GType type = 0;
|
|
26
|
|
27 if(type == 0)
|
|
28 {
|
|
29 static const GTypeInfo info = {
|
|
30 sizeof(GntMenuItemCheckClass),
|
|
31 NULL, /* base_init */
|
|
32 NULL, /* base_finalize */
|
|
33 (GClassInitFunc)gnt_menuitem_check_class_init,
|
|
34 NULL, /* class_finalize */
|
|
35 NULL, /* class_data */
|
|
36 sizeof(GntMenuItemCheck),
|
|
37 0, /* n_preallocs */
|
|
38 gnt_menuitem_check_init, /* instance_init */
|
|
39 NULL /* value_table */
|
|
40 };
|
|
41
|
|
42 type = g_type_register_static(GNT_TYPE_MENUITEM,
|
|
43 "GntMenuItemCheck",
|
|
44 &info, 0);
|
|
45 }
|
|
46
|
|
47 return type;
|
|
48 }
|
|
49
|
|
50 GntMenuItem *gnt_menuitem_check_new(const char *text)
|
|
51 {
|
|
52 GntMenuItem *item = g_object_new(GNT_TYPE_MENUITEM_CHECK, NULL);
|
|
53 GntMenuItem *menuitem = GNT_MENUITEM(item);
|
|
54
|
|
55 menuitem->text = g_strdup(text);
|
|
56 return item;
|
|
57 }
|
|
58
|
|
59 gboolean gnt_menuitem_check_get_checked(GntMenuItemCheck *item)
|
|
60 {
|
|
61 return item->checked;
|
|
62 }
|
|
63
|
|
64 void gnt_menuitem_check_set_checked(GntMenuItemCheck *item, gboolean set)
|
|
65 {
|
|
66 item->checked = set;
|
|
67 }
|
|
68
|