Mercurial > pidgin
diff console/libgnt/gntmenuitemcheck.c @ 14843:97977138cf29
[gaim-migrate @ 17612]
Add a 'MenuItemCheck' thing.
Use GntMenu for the context-menu in the buddylist.
This patch has 666 lines ... but I'm sure it's a good patch!
committer: Tailor Script <tailor@pidgin.im>
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Sat, 28 Oct 2006 22:14:52 +0000 |
parents | |
children | 1c8f1dc50685 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/console/libgnt/gntmenuitemcheck.c Sat Oct 28 22:14:52 2006 +0000 @@ -0,0 +1,67 @@ +#include "gntmenuitemcheck.h" + +static GntMenuItemClass *parent_class = NULL; + +static void +gnt_menuitem_check_class_init(GntMenuItemCheckClass *klass) +{ + parent_class = GNT_MENUITEM_CLASS(klass); + + GNTDEBUG; +} + +static void +gnt_menuitem_check_init(GTypeInstance *instance, gpointer class) +{ + GNTDEBUG; +} + +/****************************************************************************** + * GntMenuItemCheck API + *****************************************************************************/ +GType +gnt_menuitem_check_get_gtype(void) +{ + static GType type = 0; + + if(type == 0) + { + static const GTypeInfo info = { + sizeof(GntMenuItemCheckClass), + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc)gnt_menuitem_check_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof(GntMenuItemCheck), + 0, /* n_preallocs */ + gnt_menuitem_check_init, /* instance_init */ + }; + + type = g_type_register_static(GNT_TYPE_MENUITEM, + "GntMenuItemCheck", + &info, 0); + } + + return type; +} + +GntMenuItem *gnt_menuitem_check_new(const char *text) +{ + GntMenuItem *item = g_object_new(GNT_TYPE_MENUITEM_CHECK, NULL); + GntMenuItem *menuitem = GNT_MENUITEM(item); + + menuitem->text = g_strdup(text); + return item; +} + +gboolean gnt_menuitem_check_get_checked(GntMenuItemCheck *item) +{ + return item->checked; +} + +void gnt_menuitem_check_set_checked(GntMenuItemCheck *item, gboolean set) +{ + item->checked = set; +} +