[cairo-commit] pycairo/cairo cairomodule.c, 1.25, 1.26 Makefile.am, 1.10, 1.11 pycairo.h, 1.24, 1.25

Steve Chaplin commit at pdx.freedesktop.org
Sun May 1 19:25:53 PDT 2005


Committed by: stevech1097

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

Modified Files:
	cairomodule.c Makefile.am pycairo.h 
Log Message:
SC

Index: cairomodule.c
===================================================================
RCS file: /cvs/cairo/pycairo/cairo/cairomodule.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- cairomodule.c	27 Apr 2005 07:34:50 -0000	1.25
+++ cairomodule.c	2 May 2005 02:25:51 -0000	1.26
@@ -72,6 +72,10 @@
     case CAIRO_STATUS_INVALID_PATH_DATA:
 	PyErr_SetString(PyExc_RuntimeError, "invalid path data not valid");
 	return 1;
+    case CAIRO_STATUS_READ_ERROR:
+	PyErr_SetString(PyExc_RuntimeError, "error while reading from input "
+			"stream");
+	return 1;
     case CAIRO_STATUS_WRITE_ERROR:
 	PyErr_SetString(PyExc_RuntimeError, "error while writing to output "
 			"stream");
@@ -80,59 +84,18 @@
 	PyErr_SetString(PyExc_RuntimeError, "the target surface has been "
 			"finished");
 	return 1;
+    case CAIRO_STATUS_SURFACE_TYPE_MISMATCH:
+	PyErr_SetString(PyExc_RuntimeError, "the surface type is not "
+			"appropriate for the operation");
+	return 1;
     default:
 	PyErr_SetString(PyExc_RuntimeError, "<unknown error status>");
 	return 1;
     }
 }
 
-#ifdef CAIRO_HAS_PS_SURFACE
-static PyObject *
-pycairo_ps_surface_create(PyObject *self, PyObject *args)
-{
-    PyObject *py_surface;
-    PyObject *file_object;
-    int width_inches, height_inches, x_pixels_per_inch, y_pixels_per_inch;
-    cairo_surface_t *surface;
-
-    if (!PyArg_ParseTuple(args, "O!iiii:ps_surface_create",
-			  &PyFile_Type, &file_object, &width_inches, 
-			  &height_inches, &x_pixels_per_inch, 
-			  &y_pixels_per_inch))
-	return NULL;
-    if (width_inches <= 0) {
-	PyErr_SetString(PyExc_ValueError, "width_inches must be positive");
-	return NULL;
-    }
-    if (height_inches <= 0) {
-	PyErr_SetString(PyExc_ValueError, "height_inches must be positive");
-	return NULL;
-    }
-    if (x_pixels_per_inch <= 0) {
-	PyErr_SetString(PyExc_ValueError, "x_pixels_per_inch must be positive");
-	return NULL;
-    }
-    if (y_pixels_per_inch <= 0) {
-	PyErr_SetString(PyExc_ValueError, "y_pixels_per_inch must be positive");
-	return NULL;
-    }
-    surface = cairo_ps_surface_create(PyFile_AsFile(file_object), width_inches,
-				      height_inches, x_pixels_per_inch, 
-				      y_pixels_per_inch);
-    if (!surface)
-	return PyErr_NoMemory();
-
-    py_surface = PyCairoSurface_FromSurface(surface, file_object);
-    if (!py_surface)
-	cairo_surface_destroy(surface);
-    return py_surface;
-}
-#endif /* CAIRO_HAS_PS_SURFACE */
 
 static PyMethodDef cairo_functions[] = {
-#ifdef CAIRO_HAS_PS_SURFACE
-    { "ps_surface_create", (PyCFunction)pycairo_ps_surface_create, METH_VARARGS, "" },
-#endif
     { NULL, NULL, 0 }
 };
 

Index: Makefile.am
===================================================================
RCS file: /cvs/cairo/pycairo/cairo/Makefile.am,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- Makefile.am	14 Apr 2005 15:47:20 -0000	1.10
+++ Makefile.am	2 May 2005 02:25:51 -0000	1.11
@@ -4,6 +4,9 @@
 pycairodir = $(pythondir)/cairo
 pycairoexecdir = $(pyexecdir)/cairo
 
+pkgincludedir = $(includedir)/pycairo
+pkginclude_HEADERS = pycairo.h
+
 nodist_pycairo_PYTHON = __init__.py
 
 pycairoexec_LTLIBRARIES = _cairo.la

Index: pycairo.h
===================================================================
RCS file: /cvs/cairo/pycairo/cairo/pycairo.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- pycairo.h	27 Apr 2005 07:34:50 -0000	1.24
+++ pycairo.h	2 May 2005 02:25:51 -0000	1.25
@@ -41,9 +41,11 @@
 #ifdef CAIRO_HAS_PDF_SURFACE
 # include <cairo-pdf.h>
 #endif
+/* PS backend support has been removed - the C API is broken
 #ifdef CAIRO_HAS_PS_SURFACE
 # include <cairo-ps.h>
 #endif
+*/
 
 typedef struct {
     PyObject_HEAD




More information about the cairo-commit mailing list