diff options
author | Tim Janik <timj@gimp.org> | 1998-03-14 04:43:14 +0000 |
---|---|---|
committer | Tim Janik <timj@src.gnome.org> | 1998-03-14 04:43:14 +0000 |
commit | 294cfcdb222b75d741a318e76f7c8acd0690e807 (patch) | |
tree | 1cec83c608b35358da4686b39fabcef1f68d98ba /gtk/gtkobject.h | |
parent | 3ef2c37a835190df03ed393db12c78b50d5c7fd5 (diff) | |
download | gtk+-294cfcdb222b75d741a318e76f7c8acd0690e807.tar.gz |
make use of *_by_id() functions for handler key.
Sat Mar 14 02:03:13 1998 Tim Janik <timj@gimp.org>
* gtk/gtksignal.c: make use of *_by_id() functions for handler key.
* gtk/gtkwidget.c: make use of *_by_id() functions for a bunch of keys.
(gtk_widget_shutdown): new function to perform pre-destruction shutdown
of the widget.
(gtk_widget_unparent): call gtk_widget_set_parent_window(widget,NULL)
* gtk/gtkobject.h:
* gtk/gtkobject.c: GtkObject destruction is now split into an internally
used shutdown class method and the usual GtkObject::destroy signal
emission. this allowes for class based shutdown functionality prior
to actuall object destruction.
added *_by_id() counterparts for gtk_object_data_* functions, meant for
internal use only.
* gtk/gtkmain.c (gtk_quit_add_destroy): new function which will destroy
a GtkObject once gtk_main() of a certain level finishes. it is save to
destroy the object prior to that, gtk_quit_add_destroy will only destroy
objects that are still existing.
Diffstat (limited to 'gtk/gtkobject.h')
-rw-r--r-- | gtk/gtkobject.h | 59 |
1 files changed, 40 insertions, 19 deletions
diff --git a/gtk/gtkobject.h b/gtk/gtkobject.h index 44d218f84d..220c8316d2 100644 --- a/gtk/gtkobject.h +++ b/gtk/gtkobject.h @@ -67,15 +67,17 @@ extern "C" { #define GTK_OBJECT_NSIGNALS(obj) (GTK_OBJECT (obj)->klass->nsignals) /* GtkObject only uses the first 4 bits of the flags field. - * GtkWidget uses the remaining bits. Though this is a kinda nasty - * break up, it does make the size of GtkWidget smaller. + * Derived objects may use the remaining bits. Though this + * is a kinda nasty break up, it does make the size of + * derived objects smaller. */ enum { GTK_DESTROYED = 1 << 0, GTK_FLOATING = 1 << 1, GTK_RESERVED_1 = 1 << 2, - GTK_RESERVED_2 = 1 << 3 + GTK_RESERVED_2 = 1 << 3, + GTK_OBJECT_FLAG_LAST = GTK_RESERVED_2 }; /* GtkArg flag bits for gtk_object_add_arg_type @@ -161,13 +163,15 @@ struct _GtkObjectClass */ guint n_args; - /* The destroy function for objects. In one way ore another - * this is defined for all objects. If an object class overrides - * this method in order to perform class specific destruction - * then it should still call it after it is finished with its + /* The functions that will end an objects life time. In one way ore + * another all three of them are defined for all objects. If an + * object class overrides one of the methods in order to perform class + * specific destruction then it must still invoke its superclass' + * implementation of the method after it is finished with its * own cleanup. (See the destroy function for GtkWidget for * an example of how to do this). */ + void (* shutdown) (GtkObject *object); void (* destroy) (GtkObject *object); void (* finalize) (GtkObject *object); @@ -270,28 +274,45 @@ GtkType gtk_object_get_arg_type (const gchar *arg_name); * If 'data' is NULL then this call is equivalent to * 'gtk_object_remove_data'. */ -void gtk_object_set_data (GtkObject *object, - const gchar *key, - gpointer data); +void gtk_object_set_data (GtkObject *object, + const gchar *key, + gpointer data); /* Like gtk_object_set_data, but takes an additional argument - * which is a function to be called when the data is removed + * which is a function to be called when the data is removed. */ -void gtk_object_set_data_full (GtkObject *object, - const gchar *key, - gpointer data, - GtkDestroyNotify destroy); +void gtk_object_set_data_full (GtkObject *object, + const gchar *key, + gpointer data, + GtkDestroyNotify destroy); /* Get the data associated with "key". */ -gpointer gtk_object_get_data (GtkObject *object, - const gchar *key); +gpointer gtk_object_get_data (GtkObject *object, + const gchar *key); /* Remove the data associated with "key". This call is * equivalent to 'gtk_object_set_data' where 'data' is NULL. */ -void gtk_object_remove_data (GtkObject *object, - const gchar *key); +void gtk_object_remove_data (GtkObject *object, + const gchar *key); + +/* Object data functions that operate on key ids. + * These functions are meant for *internal* use only. + */ +void gtk_object_set_data_by_id (GtkObject *object, + guint data_id, + gpointer data); +void gtk_object_set_data_by_id_full (GtkObject *object, + guint data_id, + gpointer data, + GtkDestroyNotify destroy); +gpointer gtk_object_get_data_by_id (GtkObject *object, + guint data_id); +void gtk_object_remove_data_by_id (GtkObject *object, + guint data_id); +guint gtk_object_data_try_key (const gchar *key); +guint gtk_object_data_force_id (const gchar *key); /* Set the "user_data" object data field of "object". It should * be noted that this is no different than calling 'gtk_object_set_data' |