[cairo-commit] pycairo/cairo cairomodule.c, 1.66, 1.67 pycairo-surface.c, 1.87, 1.88

Steve Chaplin commit at pdx.freedesktop.org
Thu May 8 07:58:58 PDT 2008


Committed by: stevech1097

Update of /cvs/cairo/pycairo/cairo
In directory kemper:/tmp/cvs-serv9865/cairo

Modified Files:
	cairomodule.c pycairo-surface.c 
Log Message:
'SC'

Index: cairomodule.c
===================================================================
RCS file: /cvs/cairo/pycairo/cairo/cairomodule.c,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -d -r1.66 -r1.67
--- cairomodule.c	13 Dec 2007 06:45:27 -0000	1.66
+++ cairomodule.c	8 May 2008 14:58:56 -0000	1.67
@@ -36,6 +36,11 @@
 #endif
 #include "pycairo-private.h"
 
+#ifdef CAIRO_HAS_PS_SURFACE
+#  include <cairo-ps.h>
+#endif
+
+
 #define VERSION_MAJOR 1
 #define VERSION_MINOR 4
 #define VERSION_MICRO 13
@@ -451,6 +456,11 @@
     CONSTANT(PATH_CURVE_TO);
     CONSTANT(PATH_CLOSE_PATH);
 
+#ifdef CAIRO_HAS_PS_SURFACE
+    CONSTANT(PS_LEVEL_2);
+    CONSTANT(PS_LEVEL_3);
+#endif
+
     CONSTANT(SUBPIXEL_ORDER_DEFAULT);
     CONSTANT(SUBPIXEL_ORDER_RGB);
     CONSTANT(SUBPIXEL_ORDER_BGR);

Index: pycairo-surface.c
===================================================================
RCS file: /cvs/cairo/pycairo/cairo/pycairo-surface.c,v
retrieving revision 1.87
retrieving revision 1.88
diff -u -d -r1.87 -r1.88
--- pycairo-surface.c	11 Dec 2007 02:56:48 -0000	1.87
+++ pycairo-surface.c	8 May 2008 14:58:56 -0000	1.88
@@ -793,6 +793,39 @@
 }
 
 static PyObject *
+ps_surface_get_eps (PycairoPSSurface *o)
+{
+    PyObject *eps = cairo_ps_surface_get_eps (o->surface) ? Py_True : Py_False;
+    RETURN_NULL_IF_CAIRO_SURFACE_ERROR(o->surface);
+    Py_INCREF(eps);
+    return eps;
+}
+
+static PyObject *
+ps_surface_restrict_to_level (PycairoPSSurface *o, PyObject *args)
+{
+    int level;
+
+    if (!PyArg_ParseTuple(args, "i:PSSurface.restrict_to_level", &level))
+	return NULL;
+    cairo_ps_surface_restrict_to_level (o->surface, level);
+    RETURN_NULL_IF_CAIRO_SURFACE_ERROR(o->surface);
+    Py_RETURN_NONE;
+}
+
+static PyObject *
+ps_surface_set_eps (PycairoPSSurface *o, PyObject *args)
+{
+    PyObject *py_eps;
+    if (!PyArg_ParseTuple(args, "O!:PSSurface.set_eps",
+			  &PyBool_Type, &py_eps))
+	return NULL;
+    cairo_ps_surface_set_eps (o->surface, (py_eps == Py_True));
+    RETURN_NULL_IF_CAIRO_SURFACE_ERROR(o->surface);
+    Py_RETURN_NONE;
+}
+
+static PyObject *
 ps_surface_set_size (PycairoPSSurface *o, PyObject *args)
 {
     double width_in_points, height_in_points;
@@ -809,6 +842,10 @@
                    (PyCFunction)ps_surface_dsc_begin_page_setup, METH_NOARGS },
     {"dsc_begin_setup", (PyCFunction)ps_surface_dsc_begin_setup, METH_NOARGS },
     {"dsc_comment", (PyCFunction)ps_surface_dsc_comment,        METH_VARARGS },
+    {"get_eps", (PyCFunction)ps_surface_get_eps,                 METH_NOARGS },
+    {"restrict_to_level", (PyCFunction)ps_surface_restrict_to_level,
+                                                                METH_VARARGS },
+    {"set_eps", (PyCFunction)ps_surface_set_eps,                METH_VARARGS },
     {"set_size", (PyCFunction)ps_surface_set_size,              METH_VARARGS },
     {NULL, NULL, 0, NULL},
 };



More information about the cairo-commit mailing list