[cairo-commit] pycairo/cairo pycairo-context.c, 1.29, 1.30 pycairo-surface.c, 1.17, 1.18

Steve Chaplin commit at pdx.freedesktop.org
Sat Apr 9 00:28:18 PDT 2005


Committed by: stevech1097

Update of /cvs/cairo/pycairo/cairo
In directory gabe:/tmp/cvs-serv12533/cairo

Modified Files:
	pycairo-context.c pycairo-surface.c 
Log Message:
SC 2005/04/09

Index: pycairo-context.c
===================================================================
RCS file: /cvs/cairo/pycairo/cairo/pycairo-context.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- pycairo-context.c	8 Apr 2005 08:51:17 -0000	1.29
+++ pycairo-context.c	9 Apr 2005 07:28:15 -0000	1.30
@@ -55,6 +55,7 @@
 static void
 pycairo_dealloc(PyCairoContext *self)
 {
+    /*printf("context_dealloc start\n");*/
     if (self->ctx)
 	cairo_destroy(self->ctx);
     self->ctx = NULL;
@@ -63,6 +64,7 @@
 	self->ob_type->tp_free((PyObject *)self);
     else
 	PyObject_Del(self);
+    /*printf("context_dealloc end\n");*/
 }
 
 static PyObject *

Index: pycairo-surface.c
===================================================================
RCS file: /cvs/cairo/pycairo/cairo/pycairo-surface.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- pycairo-surface.c	8 Apr 2005 08:51:17 -0000	1.17
+++ pycairo-surface.c	9 Apr 2005 07:28:15 -0000	1.18
@@ -57,6 +57,7 @@
 static void
 pycairo_surface_dealloc(PyCairoSurface *self)
 {
+    /*printf("surface_dealloc start\n");*/
     if (self->surface)
 	cairo_surface_destroy(self->surface);
     self->surface = NULL;
@@ -65,6 +66,7 @@
 	self->ob_type->tp_free((PyObject *)self);
     else
 	PyObject_Del(self);
+    /*printf("surface_dealloc end\n");*/
 }
 
 static PyObject *
@@ -166,11 +168,17 @@
 	    return NULL;
 	}
     }
-    /*return Py_BuildValue("O(ii)", py_surface, width, height);*/
-    return (PyObject *)py_surface;
-    /* Py_BuildValue increments object ref count, which we don't want */
-    /* proposed solution of returning object only (with getter for width,height) is better */
-    /* see examples/gtk/png_view.py - causes seg fault ? */
+    return Py_BuildValue("O(ii)", py_surface, width, height);
+    /*return (PyObject *)py_surface;*/
+
+    /* Py_BuildValue increments object ref count, which we don't want
+     * proposed solution of returning object only (with getter for width,height) is better 
+     */
+
+    /* wrapping cairo_image_surface_create_for_png() gives a seg fault
+     * since cairo_image_surface_create_for_png() calls fclose(file)
+     *
+     */
 }
 
 static PyObject *
@@ -286,8 +294,10 @@
 static PyMethodDef pycairo_surface_methods[] = {
     { "create_for_data", (PyCFunction)pycairo_surface_create_for_data, 
                                                 METH_VARARGS | METH_CLASS },
+#ifdef CAIRO_HAS_PNG_FUNCTIONS
     { "create_for_png", (PyCFunction)pycairo_surface_create_for_png, 
                                                 METH_VARARGS | METH_CLASS },
+#endif
     { "create_similar", (PyCFunction)pycairo_surface_create_similar,
       METH_VARARGS },
     /* (image_)surface_create_for_png */




More information about the cairo-commit mailing list