diff options
Diffstat (limited to 'libdbusmenu-gtk/genericmenuitem.c')
-rw-r--r-- | libdbusmenu-gtk/genericmenuitem.c | 39 |
1 files changed, 29 insertions, 10 deletions
diff --git a/libdbusmenu-gtk/genericmenuitem.c b/libdbusmenu-gtk/genericmenuitem.c index 3dd3969..1d59d34 100644 --- a/libdbusmenu-gtk/genericmenuitem.c +++ b/libdbusmenu-gtk/genericmenuitem.c @@ -4,10 +4,9 @@ #include "genericmenuitem.h" -typedef struct _GenericmenuitemPrivate GenericmenuitemPrivate; - -struct _GenericmenuitemPrivate -{ +struct _GenericmenuitemPrivate { + int checkbox_type; + int state; }; #define GENERICMENUITEM_GET_PRIVATE(o) \ @@ -20,30 +19,50 @@ static void genericmenuitem_finalize (GObject *object); G_DEFINE_TYPE (Genericmenuitem, genericmenuitem, GTK_TYPE_CHECK_MENU_ITEM); +/* Initializing all of the classes. Most notably we're + disabling the drawing of the check early. */ static void genericmenuitem_class_init (GenericmenuitemClass *klass) { -GObjectClass *object_class = G_OBJECT_CLASS (klass); + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (klass, sizeof (GenericmenuitemPrivate)); + + object_class->dispose = genericmenuitem_dispose; + object_class->finalize = genericmenuitem_finalize; -g_type_class_add_private (klass, sizeof (GenericmenuitemPrivate)); + GtkCheckMenuItemClass * check_class = GTK_CHECK_MENU_ITEM_CLASS (klass); -object_class->dispose = genericmenuitem_dispose; -object_class->finalize = genericmenuitem_finalize; + /* We'll put this back if we get a type set */ + check_class->draw_indicator = NULL; + + return; } +/* Sets default values for all the class variables. Mostly, + this puts us in a default state. */ static void genericmenuitem_init (Genericmenuitem *self) { + self->priv = GENERICMENUITEM_GET_PRIVATE(self); + + return; } +/* Clean everything up. Whew, that can be work. */ static void genericmenuitem_dispose (GObject *object) { -G_OBJECT_CLASS (genericmenuitem_parent_class)->dispose (object); + + G_OBJECT_CLASS (genericmenuitem_parent_class)->dispose (object); + return; } +/* Now free memory, we no longer need it. */ static void genericmenuitem_finalize (GObject *object) { -G_OBJECT_CLASS (genericmenuitem_parent_class)->finalize (object); + + G_OBJECT_CLASS (genericmenuitem_parent_class)->finalize (object); + return; } |