summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/pygtk/files/pygtk-2.10.1-tree-model.patch')
-rw-r--r--dev-python/pygtk/files/pygtk-2.10.1-tree-model.patch95
1 files changed, 95 insertions, 0 deletions
diff --git a/dev-python/pygtk/files/pygtk-2.10.1-tree-model.patch b/dev-python/pygtk/files/pygtk-2.10.1-tree-model.patch
new file mode 100644
index 000000000000..80916927feb6
--- /dev/null
+++ b/dev-python/pygtk/files/pygtk-2.10.1-tree-model.patch
@@ -0,0 +1,95 @@
+diff --exclude-from=/home/dang/.diffrc -u -ruN pygtk-2.10.1.orig/gtk/gtkobject-support.c pygtk-2.10.1/gtk/gtkobject-support.c
+--- pygtk-2.10.1.orig/gtk/gtkobject-support.c 2006-07-05 09:12:16.000000000 -0400
++++ pygtk-2.10.1/gtk/gtkobject-support.c 2006-09-30 17:10:16.000000000 -0400
+@@ -120,3 +120,19 @@
+ return list;
+ }
+
++void
++pygtk_boxed_unref_shared(PyObject *boxed)
++{
++ PyGBoxed *pyboxed;
++ g_return_if_fail(boxed != NULL && PyObject_TypeCheck(boxed, &PyGBoxed_Type));
++ pyboxed = (PyGBoxed *) boxed;
++ if (pyboxed->ob_refcnt != 1) {
++ if (!pyboxed->free_on_dealloc) {
++ pyboxed->boxed = g_boxed_copy(pyboxed->gtype,
++ pyboxed->boxed);
++ pyboxed->free_on_dealloc = TRUE;
++ }
++ }
++ Py_DECREF(boxed);
++}
++
+diff --exclude-from=/home/dang/.diffrc -u -ruN pygtk-2.10.1.orig/gtk/gtktreeview.override pygtk-2.10.1/gtk/gtktreeview.override
+--- pygtk-2.10.1.orig/gtk/gtktreeview.override 2006-07-19 16:29:19.000000000 -0400
++++ pygtk-2.10.1/gtk/gtktreeview.override 2006-09-30 17:10:16.000000000 -0400
+@@ -579,6 +579,7 @@
+ }
+ %%
+ override gtk_tree_selection_selected_foreach
++
+ static void
+ pygtk_tree_selection_foreach_marshal(GtkTreeModel *model,
+ GtkTreePath *path,
+@@ -597,17 +598,17 @@
+ py_path = pygtk_tree_path_to_pyobject(path);
+ py_iter = pyg_boxed_new(GTK_TYPE_TREE_ITER, iter, FALSE, FALSE);
+ if (cunote->data)
+- retobj = PyEval_CallFunction(cunote->func, "(NNNO)",
++ retobj = PyEval_CallFunction(cunote->func, "(NNOO)",
+ py_model, py_path, py_iter,
+ cunote->data);
+ else
+- retobj = PyEval_CallFunction(cunote->func, "(NNN)",
++ retobj = PyEval_CallFunction(cunote->func, "(NNO)",
+ py_model, py_path, py_iter);
+
+ if (retobj == NULL) {
+ PyErr_Print();
+ }
+-
++ pygtk_boxed_unref_shared(py_iter);
+ Py_XDECREF(retobj);
+
+ pyg_gil_state_release(state);
+@@ -1124,13 +1125,14 @@
+ py_iter2 = pyg_boxed_new(GTK_TYPE_TREE_ITER, iter2, FALSE, FALSE);
+
+ if (cunote->data) {
+- retobj = PyEval_CallFunction(cunote->func, "(NNNO)", py_model,
++ retobj = PyEval_CallFunction(cunote->func, "(OONO)", py_model,
+ py_iter1, py_iter2, cunote->data);
+ } else {
+- retobj = PyEval_CallFunction(cunote->func, "(NNN)", py_model,
++ retobj = PyEval_CallFunction(cunote->func, "(OON)", py_model,
+ py_iter1, py_iter2);
+ }
+-
++ pygtk_boxed_unref_shared(py_iter1);
++ pygtk_boxed_unref_shared(py_iter2);
+ if (retobj)
+ ret = PyInt_AsLong(retobj);
+ if (PyErr_Occurred()) {
+diff --exclude-from=/home/dang/.diffrc -u -ruN pygtk-2.10.1.orig/gtk/pygtkcellrenderer.c pygtk-2.10.1/gtk/pygtkcellrenderer.c
+--- pygtk-2.10.1.orig/gtk/pygtkcellrenderer.c 2005-01-09 12:35:02.000000000 -0500
++++ pygtk-2.10.1/gtk/pygtkcellrenderer.c 2006-09-30 17:10:16.000000000 -0400
+@@ -250,7 +250,7 @@
+ Py_DECREF(py_ret);
+
+ out:
+- Py_DECREF(py_event);
++ pygtk_boxed_unref_shared(py_event);
+ Py_DECREF(py_widget);
+ Py_DECREF(py_background_area);
+ Py_DECREF(py_cell_area);
+diff --exclude-from=/home/dang/.diffrc -u -ruN pygtk-2.10.1.orig/gtk/pygtk-private.h pygtk-2.10.1/gtk/pygtk-private.h
+--- pygtk-2.10.1.orig/gtk/pygtk-private.h 2006-07-05 09:12:17.000000000 -0400
++++ pygtk-2.10.1/gtk/pygtk-private.h 2006-09-30 17:10:16.000000000 -0400
+@@ -70,4 +70,6 @@
+ #define PYGDK_TYPE_REGION (pygdk_region_get_type ())
+ #endif /* GDK_TYPE_REGION */
+
++void pygtk_boxed_unref_shared(PyObject *boxed);
++
+ #endif