[cairo-commit] pycairo/cairo pycairo-surface.c, 1.11, 1.12 pycairo-context.c, 1.23, 1.24

Steve Chaplin commit at pdx.freedesktop.org
Tue Mar 29 16:22:20 PST 2005


Committed by: stevech1097

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

Modified Files:
	pycairo-surface.c pycairo-context.c 
Log Message:
SC 2005/03/30

Index: pycairo-surface.c
===================================================================
RCS file: /cvs/cairo/pycairo/cairo/pycairo-surface.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- pycairo-surface.c	19 Mar 2005 17:23:46 -0000	1.11
+++ pycairo-surface.c	30 Mar 2005 00:22:18 -0000	1.12
@@ -196,6 +196,24 @@
     Py_RETURN_NONE;
 }
 
+#ifdef CAIRO_HAS_PNG_FUNCTIONS
+static PyObject *
+pycairo_surface_write_png(PyCairoSurface *self, PyObject *args)
+{
+    PyObject *file_object;
+    cairo_status_t status;
+
+    if (!PyArg_ParseTuple(args, "O!:Surface.write_png",
+			  &PyFile_Type, &file_object))
+	return NULL;
+
+    status = cairo_surface_write_png(self->surface, PyFile_AsFile(file_object));
+    if (pycairo_check_status(status))
+	return NULL;
+    Py_RETURN_NONE;
+}
+#endif  /* CAIRO_HAS_PDF_FUNCTIONS */
+
 static PyMethodDef pycairo_surface_methods[] = {
     { "create_similar", (PyCFunction)pycairo_surface_create_similar,
       METH_VARARGS },
@@ -204,6 +222,9 @@
     { "set_filter", (PyCFunction)pycairo_surface_set_filter, METH_VARARGS },
     { "set_matrix", (PyCFunction)pycairo_surface_set_matrix, METH_VARARGS },
     { "set_repeat", (PyCFunction)pycairo_surface_set_repeat, METH_VARARGS },
+#ifdef CAIRO_HAS_PNG_FUNCTIONS
+    { "write_png",  (PyCFunction)pycairo_surface_write_png,  METH_VARARGS },
+#endif
     { NULL, NULL, 0 }
 };
 

Index: pycairo-context.c
===================================================================
RCS file: /cvs/cairo/pycairo/cairo/pycairo-context.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- pycairo-context.c	22 Mar 2005 03:33:15 -0000	1.23
+++ pycairo-context.c	30 Mar 2005 00:22:18 -0000	1.24
@@ -183,27 +183,6 @@
 #endif  /* CAIRO_HAS_PDF_SURFACE */
 #endif
 
-#ifdef CAIRO_HAS_PNG_SURFACE
-static PyObject *
-pycairo_set_target_png(PyCairoContext *self, PyObject *args)
-{
-    PyObject *file_object;
-    cairo_format_t format;
-    int width, height;
-
-    if (!PyArg_ParseTuple(args, "O!iii:Context.set_target_png",
-			  &PyFile_Type, &file_object, &format, &width,
-			  &height))
-	return NULL;
-
-    cairo_set_target_png(self->ctx, PyFile_AsFile(file_object), format,
-			 width, height);
-    if (pycairo_check_status(cairo_status(self->ctx)))
-	return NULL;
-    Py_RETURN_NONE;
-}
-#endif /* CAIRO_HAS_PNG_SURFACE */
-
 static PyObject *
 pycairo_set_operator(PyCairoContext *self, PyObject *args)
 {
@@ -1165,6 +1144,7 @@
     /* glyph_extents */
     /* glyph_path */
     { "identity_matrix",(PyCFunction)pycairo_identity_matrix,METH_NOARGS },
+    /* image_surface_create_for_png */
     { "in_fill",       (PyCFunction)pycairo_in_fill,       METH_VARARGS },
     { "in_stroke",     (PyCFunction)pycairo_in_stroke,     METH_VARARGS },
     { "line_to",       (PyCFunction)pycairo_line_to,       METH_VARARGS },
@@ -1201,9 +1181,6 @@
 #ifdef CAIRO_HAS_PS_SURFACE
     { "set_target_ps", (PyCFunction)pycairo_set_target_ps, METH_VARARGS},
 #endif
-#ifdef CAIRO_HAS_PNG_SURFACE
-    { "set_target_png",(PyCFunction)pycairo_set_target_png,METH_VARARGS },
-#endif
     { "set_target_surface",(PyCFunction)pycairo_set_target_surface,
       METH_VARARGS },
     { "set_tolerance", (PyCFunction)pycairo_set_tolerance, METH_VARARGS },




More information about the cairo-commit mailing list