diff options
author | Christopher James Lahey <clahey@helixcode.com> | 2001-01-22 13:30:07 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2001-01-22 13:30:07 +0800 |
commit | 6adb44b607e483357a6784ce75c26f411be143b0 (patch) | |
tree | 34565ec4022a8934b2a40414bcf207bdeb524b4e /widgets/menus/gal-view.c | |
parent | f43c14605c19d0ee0c2119dd68eefc41f561748b (diff) | |
download | gsoc2013-evolution-6adb44b607e483357a6784ce75c26f411be143b0.tar gsoc2013-evolution-6adb44b607e483357a6784ce75c26f411be143b0.tar.gz gsoc2013-evolution-6adb44b607e483357a6784ce75c26f411be143b0.tar.bz2 gsoc2013-evolution-6adb44b607e483357a6784ce75c26f411be143b0.tar.lz gsoc2013-evolution-6adb44b607e483357a6784ce75c26f411be143b0.tar.xz gsoc2013-evolution-6adb44b607e483357a6784ce75c26f411be143b0.tar.zst gsoc2013-evolution-6adb44b607e483357a6784ce75c26f411be143b0.zip |
Initialize collection field to NULL. Set the collection on the model as
2001-01-22 Christopher James Lahey <clahey@helixcode.com>
* gal-define-views-dialog.c, gal-define-views-dialog.h
(gal_define_views_dialog_init): Initialize collection field to
NULL. Set the collection on the model as soon as we create it.
(gal_define_views_dialog_new): Add a GalViewCollection argument to
this function. This just makes this dialog a bit easier to use
through the API.
(gal_define_views_dialog_set_arg): When we set the collection, set
it on the dialog->model.
* gal-define-views-model.c, gal-define-views-model.h: Rewrote this
object to use a GalViewCollection to store the information instead
of an array of GalViews.
* gal-view-collection.c, gal-view-collection.h: Added
gal_view_collection_get_count, gal_view_collection_get_view,
gal_view_collection_append, gal_view_collection_delete_view, and
gal_view_collection_copy_view.
(view_changed, load_single_file): Connect to the "changed" signal
on the views.
(load_single_dir): Survive loading if there's no xml file.
* gal-view-etable.c: Implemented get_type_code method.
* gal-view-factory-etable.c: Implemented get_type_code method.
* gal-view.c, gal-view.h: Added gal_view_get_type_code and
"changed" signal.
svn path=/trunk/; revision=7699
Diffstat (limited to 'widgets/menus/gal-view.c')
-rw-r--r-- | widgets/menus/gal-view.c | 56 |
1 files changed, 54 insertions, 2 deletions
diff --git a/widgets/menus/gal-view.c b/widgets/menus/gal-view.c index 484e1d5116..f48a6f0026 100644 --- a/widgets/menus/gal-view.c +++ b/widgets/menus/gal-view.c @@ -8,6 +8,7 @@ * (C) 2000 Helix Code, Inc. */ #include <config.h> +#include <gtk/gtksignal.h> #include "gal-view.h" #define GV_CLASS(e) ((GalViewClass *)((GtkObject *)e)->klass) @@ -21,6 +22,13 @@ d(static gint depth = 0); static GtkObjectClass *gal_view_parent_class; +enum { + CHANGED, + LAST_SIGNAL +}; + +static guint gal_view_signals [LAST_SIGNAL] = { 0, }; + /** * gal_view_edit * @view: The view to edit @@ -102,6 +110,24 @@ gal_view_set_title (GalView *view, } /** + * gal_view_get_type_code + * @view: The view to get. + * + * Returns: The type of the view. + */ +const char * +gal_view_get_type_code (GalView *view) +{ + g_return_val_if_fail (view != NULL, NULL); + g_return_val_if_fail (GAL_IS_VIEW (view), NULL); + + if (GV_CLASS (view)->get_type_code) + return GV_CLASS (view)->get_type_code (view); + else + return NULL; +} + +/** * gal_view_clone * @view: The view to clone. * @@ -119,6 +145,20 @@ gal_view_clone (GalView *view) return NULL; } +/** + * gal_view_changed + * @view: The view that changed. + */ +void +gal_view_changed (GalView *view) +{ + g_return_if_fail (view != NULL); + g_return_if_fail (GAL_IS_VIEW (view)); + + gtk_signal_emit(GTK_OBJECT(view), + gal_view_signals [CHANGED]); +} + static void gal_view_class_init (GtkObjectClass *object_class) { @@ -126,10 +166,22 @@ gal_view_class_init (GtkObjectClass *object_class) gal_view_parent_class = gtk_type_class (PARENT_TYPE); klass->edit = NULL; - klass->load = NULL; - klass->save = NULL; + klass->load = NULL; + klass->save = NULL; klass->get_title = NULL; klass->clone = NULL; + + klass->changed = NULL; + + gal_view_signals [CHANGED] = + gtk_signal_new ("changed", + GTK_RUN_LAST, + object_class->type, + GTK_SIGNAL_OFFSET (GalViewClass, changed), + gtk_marshal_NONE__NONE, + GTK_TYPE_NONE, 0); + + gtk_object_class_add_signals (object_class, gal_view_signals, LAST_SIGNAL); } GtkType |