From a8463d6703469a525fc9192af521f5048e0957ae Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Wed, 6 Dec 2000 18:46:31 +0000 Subject: Added a GalViewCollection argument to the new function here. 2000-12-06 Christopher James Lahey * menus/gal-view-menus.c, menus/gal-view-menus.h: Added a GalViewCollection argument to the new function here. From meeting-time-sel/ChangeLog: 2000-12-06 Christopher James Lahey * e-meeting-time-sel.c: Fixed a bunch of warnings. svn path=/trunk/; revision=6816 --- widgets/menus/gal-view-menus.c | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) (limited to 'widgets/menus/gal-view-menus.c') diff --git a/widgets/menus/gal-view-menus.c b/widgets/menus/gal-view-menus.c index 2808eff29f..377bb5918a 100644 --- a/widgets/menus/gal-view-menus.c +++ b/widgets/menus/gal-view-menus.c @@ -17,6 +17,10 @@ #include "gal-view-menus.h" #include +struct _GalViewMenusPrivate { + GalViewCollection *collection; +}; + #define PARENT_TYPE (gtk_object_get_type()) static GtkObjectClass *gvm_parent_class; @@ -24,9 +28,12 @@ static GtkObjectClass *gvm_parent_class; static void gvm_destroy (GtkObject *object) { -#if 0 GalViewMenus *gvm = GAL_VIEW_MENUS (object); -#endif + + if (gvm->priv->collection) + gtk_object_unref(GTK_OBJECT(gvm->priv->collection)); + g_free(gvm->priv); + gvm->priv = NULL; GTK_OBJECT_CLASS (gvm_parent_class)->destroy (object); } @@ -39,14 +46,33 @@ gvm_class_init (GtkObjectClass *klass) klass->destroy = gvm_destroy; } -E_MAKE_TYPE(gal_view_menus, "GalViewMenus", GalViewMenus, gvm_class_init, NULL, PARENT_TYPE); +static void +gvm_init (GalViewMenus *gvm) +{ + gvm->priv = g_new(GalViewMenusPrivate, 1); + gvm->priv->collection = NULL; +} + +E_MAKE_TYPE(gal_view_menus, "GalViewMenus", GalViewMenus, gvm_class_init, gvm_init, PARENT_TYPE); GalViewMenus * -gal_view_menus_new (void) +gal_view_menus_new (GalViewCollection *collection) { GalViewMenus *gvm = gtk_type_new (GAL_VIEW_MENUS_TYPE); - return (GalViewMenus *) gvm; + gal_view_menus_construct(gvm, collection); + + return gvm; +} + +GalViewMenus * +gal_view_menus_construct (GalViewMenus *gvm, + GalViewCollection *collection) +{ + if (collection) + gtk_object_ref(GTK_OBJECT(gvm)); + gvm->priv->collection = collection; + return gvm; } static void -- cgit v1.2.3