summaryrefslogtreecommitdiff
path: root/gobject/gobject.h
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2005-05-05 14:57:29 +0000
committerOwen Taylor <otaylor@src.gnome.org>2005-05-05 14:57:29 +0000
commit2ae1a46b4c8d9849f43eb9f059a98eadb4f2a6c9 (patch)
tree813adfe3e8615ba3e9d4d65051691c8fc5706802 /gobject/gobject.h
parent1167d7d6a78578da2a622f7226c9e1b557ef65cb (diff)
downloadglib-2ae1a46b4c8d9849f43eb9f059a98eadb4f2a6c9.tar.gz
Add g_object_add/remove_toggle_ref() functions to get notification when a
2005-05-05 Owen Taylor <otaylor@redhat.com> * gobject.[ch] gobject.symbols: Add g_object_add/remove_toggle_ref() functions to get notification when a reference count is the last remaining reference; this enables better memory management for language bindings. (http://mail.gnome.org/archives/gtk-devel-list/2005-April/msg00095.html) 2005-05-05 Owen Taylor <otaylor@redhat.com> * glib/gdataset.[ch] glib/gdatasetprivate.h: Add g_datalist_set/unset_flags(), g_datalist_get_flags() functions to squeeze some bits into a GDataSet... this is needed for efficient implementation of toggle references in GObject. * tests/gobject/references.c tests/gobject/Makefile.am: Add a test case for weak and toggle references. * glib/gfileutils.[ch]: Rename g_file_replace() back to g_file_set_contents(). * glib/glib.symbols: Update. 2005-05-05 Owen Taylor <otaylor@redhat.com> * glib/Makefile.am glib/glib-sections.txt gobject/gobject-sections.txt: Update * gobject/tmpl/objects.sgml: Document toggle-references.
Diffstat (limited to 'gobject/gobject.h')
-rw-r--r--gobject/gobject.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/gobject/gobject.h b/gobject/gobject.h
index f3935ca9e..e835e7348 100644
--- a/gobject/gobject.h
+++ b/gobject/gobject.h
@@ -178,6 +178,18 @@ void g_object_add_weak_pointer (GObject *object,
gpointer *weak_pointer_location);
void g_object_remove_weak_pointer (GObject *object,
gpointer *weak_pointer_location);
+
+typedef void (*GToggleNotify) (gpointer data,
+ GObject *object,
+ gboolean is_last_ref);
+
+void g_object_add_toggle_ref (GObject *object,
+ GToggleNotify notify,
+ gpointer data);
+void g_object_remove_toggle_ref (GObject *object,
+ GToggleNotify notify,
+ gpointer data);
+
gpointer g_object_get_qdata (GObject *object,
GQuark quark);
void g_object_set_qdata (GObject *object,