diff options
author | Christopher James Lahey <clahey@helixcode.com> | 2000-12-07 02:46:31 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2000-12-07 02:46:31 +0800 |
commit | a8463d6703469a525fc9192af521f5048e0957ae (patch) | |
tree | 86435b79ff5ace8fc7e1e0c74e319215074c0ae8 /widgets/menus | |
parent | c847cac2be25b11319d615dded3f71eee46cd60f (diff) | |
download | gsoc2013-evolution-a8463d6703469a525fc9192af521f5048e0957ae.tar gsoc2013-evolution-a8463d6703469a525fc9192af521f5048e0957ae.tar.gz gsoc2013-evolution-a8463d6703469a525fc9192af521f5048e0957ae.tar.bz2 gsoc2013-evolution-a8463d6703469a525fc9192af521f5048e0957ae.tar.lz gsoc2013-evolution-a8463d6703469a525fc9192af521f5048e0957ae.tar.xz gsoc2013-evolution-a8463d6703469a525fc9192af521f5048e0957ae.tar.zst gsoc2013-evolution-a8463d6703469a525fc9192af521f5048e0957ae.zip |
Added a GalViewCollection argument to the new function here.
2000-12-06 Christopher James Lahey <clahey@helixcode.com>
* 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 <clahey@helixcode.com>
* e-meeting-time-sel.c: Fixed a bunch of warnings.
svn path=/trunk/; revision=6816
Diffstat (limited to 'widgets/menus')
-rw-r--r-- | widgets/menus/gal-view-menus.c | 36 | ||||
-rw-r--r-- | widgets/menus/gal-view-menus.h | 34 |
2 files changed, 43 insertions, 27 deletions
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 <gal/menus/gal-define-views-dialog.h> +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 diff --git a/widgets/menus/gal-view-menus.h b/widgets/menus/gal-view-menus.h index 74bfbdbe82..21b302771c 100644 --- a/widgets/menus/gal-view-menus.h +++ b/widgets/menus/gal-view-menus.h @@ -5,6 +5,7 @@ #include <gtk/gtkobject.h> #include <gnome-xml/tree.h> #include <bonobo/bonobo-ui-component.h> +#include <gal/menus/gal-view-collection.h> #define GAL_VIEW_MENUS_TYPE (gal_view_menus_get_type ()) #define GAL_VIEW_MENUS(o) (GTK_CHECK_CAST ((o), GAL_VIEW_MENUS_TYPE, GalViewMenus)) @@ -12,35 +13,24 @@ #define GAL_IS_VIEW_MENUS(o) (GTK_CHECK_TYPE ((o), GAL_VIEW_MENUS_TYPE)) #define GAL_IS_VIEW_MENUS_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), GAL_VIEW_MENUS_TYPE)) +typedef struct _GalViewMenusPrivate GalViewMenusPrivate; + typedef struct { GtkObject base; - void *priv; + GalViewMenusPrivate *priv; } GalViewMenus; typedef struct { GtkObjectClass parent_class; } GalViewMenusClass; -GtkType gal_view_menus_get_type (void); -GalViewMenus *gal_view_menus_new (void); - -void gal_view_menus_apply (GalViewMenus *menus, - BonoboUIComponent *component, - CORBA_Environment *ev); - -#if 0 -gboolean gal_view_menus_load_from_file (GalViewMenus *menus, - const char *filename); -void gal_view_menus_load_from_string (GalViewMenus *menus, - const char *xml); -void gal_view_menus_load_from_node (GalViewMenus *menus, - const xmlNode *node); - -void gal_view_menus_save_to_file (GalViewMenus *menus, - const char *filename); -char *gal_view_menus_save_to_string (GalViewMenus *menus); -xmlNode *gal_view_menus_save_to_node (GalViewMenus *menus, - xmlNode *parent); -#endif +GtkType gal_view_menus_get_type (void); +GalViewMenus *gal_view_menus_new (GalViewCollection *collection); +GalViewMenus *gal_view_menus_construct (GalViewMenus *menus, + GalViewCollection *collection); + +void gal_view_menus_apply (GalViewMenus *menus, + BonoboUIComponent *component, + CORBA_Environment *ev); #endif /* _GAL_VIEW_MENUS_H_ */ |