propagate from branch 'im.pidgin.pidgin.mxit' (head 2629bf405a36a13177423301925120fe8...
[pidgin-git.git] / finch / libgnt / gntmenuitemcheck.c
blob7a4dd9f7790447c36aa3c3a46ede76845b996a1a
1 /**
2 * GNT - The GLib Ncurses Toolkit
4 * GNT is the legal property of its developers, whose names are too numerous
5 * to list here. Please refer to the COPYRIGHT file distributed with this
6 * source distribution.
8 * This library is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
23 #include "gntinternal.h"
24 #include "gntmenuitemcheck.h"
26 static GntMenuItemClass *parent_class = NULL;
28 static void
29 gnt_menuitem_check_class_init(GntMenuItemCheckClass *klass)
31 parent_class = GNT_MENU_ITEM_CLASS(klass);
33 GNTDEBUG;
36 static void
37 gnt_menuitem_check_init(GTypeInstance *instance, gpointer class)
39 GNTDEBUG;
42 /******************************************************************************
43 * GntMenuItemCheck API
44 *****************************************************************************/
45 GType
46 gnt_menuitem_check_get_gtype(void)
48 static GType type = 0;
50 if(type == 0)
52 static const GTypeInfo info = {
53 sizeof(GntMenuItemCheckClass),
54 NULL, /* base_init */
55 NULL, /* base_finalize */
56 (GClassInitFunc)gnt_menuitem_check_class_init,
57 NULL, /* class_finalize */
58 NULL, /* class_data */
59 sizeof(GntMenuItemCheck),
60 0, /* n_preallocs */
61 gnt_menuitem_check_init, /* instance_init */
62 NULL /* value_table */
65 type = g_type_register_static(GNT_TYPE_MENU_ITEM,
66 "GntMenuItemCheck",
67 &info, 0);
70 return type;
73 GntMenuItem *gnt_menuitem_check_new(const char *text)
75 GntMenuItem *item = g_object_new(GNT_TYPE_MENU_ITEM_CHECK, NULL);
76 GntMenuItem *menuitem = GNT_MENU_ITEM(item);
78 menuitem->text = g_strdup(text);
79 return item;
82 gboolean gnt_menuitem_check_get_checked(GntMenuItemCheck *item)
84 return item->checked;
87 void gnt_menuitem_check_set_checked(GntMenuItemCheck *item, gboolean set)
89 item->checked = set;