diff options
author | James Henstridge <james@daa.com.au> | 2002-01-07 10:46:32 +0000 |
---|---|---|
committer | James Henstridge <jamesh@src.gnome.org> | 2002-01-07 10:46:32 +0000 |
commit | 1bc78a422c4127c3d18cf21d1f28a16469d215b9 (patch) | |
tree | 3090f188ed51906be9532d6ce19a4b6ab73d6fe9 /gobject/gobjectmodule.c | |
parent | 22ddb79502701fc47318ae05e3a7f5e085b9fa68 (diff) | |
download | pygtk-1bc78a422c4127c3d18cf21d1f28a16469d215b9.tar.gz |
add overriden implementation that allows threads while waiting, so some
2002-01-07 James Henstridge <james@daa.com.au>
* gtk/gdk.override (_wrap_gdk_threads_enter): add overriden
implementation that allows threads while waiting, so some other
thread has a chance to give up the gdk lock.
* gtk/gtkmodule.c (functions): remove stuff.
* gtk/pygtk-private.h: remove definitions here as well.
* gtk/pygtk.h (_PyGtk_FunctionStruct): remove destroy notify and
thread block stuff.
* gtk/gtkobject-support.c: remove pygtk_destroy_notify.
* gtk/gtk.override (pygtk_tree_foreach_marshal): move this
function here from gtkobject-support.c, and don't bother blocking
threads.
(_wrap_gtk_tree_selection_selected_foreach): same here -- don't
need to unblock threads.
(pygtk_tree_selection_marshal): move this function here from
gtkobject-support.c. Convert to use pyg_block_threads.
(_wrap_gtk_dialog_run): add overriden implementation that unblocks
threads.
(_wrap_gtk_main): use pyg_block_threads
(_wrap_gtk_main_iteration): same.
(_wrap_gtk_item_factory_create_items): same here.
(_wrap_gtk_menu_popup): same here.
(_wrap_gtk_clist_set_row_data): use pyg_destroy_notify
(_wrap_gtk_timeout_add): same here.
(_wrap_gtk_idle_add): same here.
(_wrap_gtk_quit_add): same here.
(_wrap_gtk_input_add_full): same here.
(_wrap_gtk_ctree_node_set_row_data): same here.
* gtk/gtkobject-support.c: remove PyGTK_BLOCK_THREADS and
PyGTK_UNBLOCK_THREADS macros.
(pygtk_destroy_notify): use pyg_block_threads.
(pygtk_custom_destroy_notify): same.
(pygtk_handler_marshal): same.
(pygtk_input_marshal): same.
* gtk/gdk.override (_wrap_gdk_threads_init): register gdk lock
based recursive threads block/unblock functions. If threading was
disabled at compile time, then this function will error out.
* gtk/gdk.defs (threads_enter, threads_leave, threads_leave): add
functions.
* gobjectmodule.c (functions): add destroy_notify here as well.
* pygobject.h: add destroy_notify to the PyGObject_Functions
vtable.
Diffstat (limited to 'gobject/gobjectmodule.c')
-rw-r--r-- | gobject/gobjectmodule.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gobject/gobjectmodule.c b/gobject/gobjectmodule.c index 1e61fd2b..39fba99f 100644 --- a/gobject/gobjectmodule.c +++ b/gobject/gobjectmodule.c @@ -250,7 +250,7 @@ pyg_param_spec_new(GParamSpec *pspec) /* -------------- class <-> wrapper manipulation --------------- */ static void -pygobject_destroy_notify(gpointer user_data) +pyg_destroy_notify(gpointer user_data) { PyObject *obj = (PyObject *)user_data; @@ -1228,7 +1228,7 @@ pygobject_dealloc(PyGObject *self) Py_INCREF(self); /* grab a reference on the wrapper */ self->hasref = TRUE; g_object_set_qdata_full(obj, pygobject_ownedref_key, - self, pygobject_destroy_notify); + self, pyg_destroy_notify); g_object_unref(obj); /* we ref the type, so subtype_dealloc() doesn't kill off our @@ -1441,7 +1441,7 @@ pygobject_set_data(PyGObject *self, PyObject *args) return NULL; quark = g_quark_from_string(key); Py_INCREF(data); - g_object_set_qdata_full(self->obj, quark, data, pygobject_destroy_notify); + g_object_set_qdata_full(self->obj, quark, data, pyg_destroy_notify); Py_INCREF(Py_None); return Py_None; } @@ -3002,7 +3002,10 @@ static struct _PyGObject_Functions functions = { pygobject_register_wrapper, pygobject_lookup_class, pygobject_new, + pyg_closure_new, + pyg_destroy_notify, + pyg_type_from_object, pyg_type_wrapper_new, pyg_enum_get_value, |