[cairo-commit] pycairo/cairo pycairo-context.c, 1.25, 1.26 pycairo-surface.c, 1.15, 1.16

Steve Chaplin commit at pdx.freedesktop.org
Wed Apr 6 06:53:01 PDT 2005


Committed by: stevech1097

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

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

Index: pycairo-context.c
===================================================================
RCS file: /cvs/cairo/pycairo/cairo/pycairo-context.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- pycairo-context.c	2 Apr 2005 13:31:25 -0000	1.25
+++ pycairo-context.c	6 Apr 2005 13:52:59 -0000	1.26
@@ -507,15 +507,6 @@
 }
 
 static PyObject *
-pycairo_default_matrix(PyCairoContext *self)
-{
-    cairo_default_matrix(self->ctx);
-    if (pycairo_check_status(cairo_status(self->ctx)))
-	return NULL;
-    Py_RETURN_NONE;
-}
-
-static PyObject *
 pycairo_identity_matrix(PyCairoContext *self)
 {
     cairo_identity_matrix(self->ctx);
@@ -862,7 +853,9 @@
     cairo_text_extents(self->ctx, utf8, &extents);
     if (pycairo_check_status(cairo_status(self->ctx)))
 	return NULL;
-    return Py_BuildValue("(dddddd)", extents.x_bearing, extents.y_bearing, extents.width, extents.height, extents.x_advance, extents.y_advance);
+    return Py_BuildValue("(dddddd)", extents.x_bearing, extents.y_bearing, 
+			 extents.width, extents.height, extents.x_advance, 
+			 extents.y_advance);
 }
 
 static PyObject *
@@ -873,7 +866,9 @@
     cairo_get_font_extents(self->ctx, &extents);
     if (pycairo_check_status(cairo_status(self->ctx)))
 	return NULL;
-    return Py_BuildValue("(ddddd)", extents.ascent, extents.descent, extents.height, extents.max_x_advance, extents.max_y_advance);
+    return Py_BuildValue("(ddddd)", extents.ascent, extents.descent, 
+			 extents.height, extents.max_x_advance, 
+			 extents.max_y_advance);
 }
 
 static PyObject *
@@ -1134,7 +1129,6 @@
     /* copy_path_data */
     /* copy_path_data_flat */
     { "curve_to",      (PyCFunction)pycairo_curve_to,      METH_VARARGS },
-    { "default_matrix",(PyCFunction)pycairo_default_matrix,METH_NOARGS },
     { "device_to_user",(PyCFunction)pycairo_device_to_user,METH_VARARGS },
     { "device_to_user_distance",
       (PyCFunction)pycairo_device_to_user_distance,        METH_VARARGS },
@@ -1172,6 +1166,7 @@
     { "set_operator",  (PyCFunction)pycairo_set_operator,  METH_VARARGS },
     { "set_pattern",   (PyCFunction)pycairo_set_pattern,   METH_VARARGS },
     { "set_rgb_color", (PyCFunction)pycairo_set_rgb_color, METH_VARARGS },
+    /* "set_target_image" */
 # if 0
 #ifdef CAIRO_HAS_PDF_SURFACE
     { "set_target_pdf",(PyCFunction)pycairo_set_target_pdf,METH_VARARGS},

Index: pycairo-surface.c
===================================================================
RCS file: /cvs/cairo/pycairo/cairo/pycairo-surface.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- pycairo-surface.c	5 Apr 2005 02:24:17 -0000	1.15
+++ pycairo-surface.c	6 Apr 2005 13:52:59 -0000	1.16
@@ -134,7 +134,7 @@
     py_surface = (PyCairoSurface *)type->tp_alloc(type, 0);
     if (py_surface){
 	py_surface->surface = cairo_image_surface_create_for_data
-	    (data, format, width, height, stride);
+	    ((unsigned char *)data, format, width, height, stride);
 	if (!py_surface->surface) {
 	    Py_DECREF(py_surface);
 	    return PyErr_NoMemory();
@@ -166,7 +166,8 @@
 	    return NULL;
 	}
     }
-    return Py_BuildValue("O(ii)", py_surface, width, height);
+    /*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 ? */




More information about the cairo-commit mailing list