[cairo-commit] pycairo/cairo pycairo-pattern.c, 1.6, 1.7 pycairo-surface.c, 1.6, 1.7

Steve Chaplin commit at pdx.freedesktop.org
Sun Dec 5 19:06:53 PST 2004


Committed by: stevech1097

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

Modified Files:
	pycairo-pattern.c pycairo-surface.c 
Log Message:
SC 06/12/2004

Index: pycairo-pattern.c
===================================================================
RCS file: /cvs/cairo/pycairo/cairo/pycairo-pattern.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- pycairo-pattern.c	1 Dec 2004 14:44:51 -0000	1.6
+++ pycairo-pattern.c	6 Dec 2004 03:06:51 -0000	1.7
@@ -116,10 +116,7 @@
 	PyErr_SetString(PyExc_RuntimeError, "could not create pattern");
 	return -1;
     }
-
-    /*cairo_pattern_reference(pattern);*/
     self->pattern = pattern;
-
     return 0;
 }
 
@@ -210,16 +207,16 @@
 static PyMethodDef pycairo_pattern_methods[] = {
     { "add_color_stop", (PyCFunction)pycairo_pattern_add_color_stop, 
       METH_VARARGS },
-    { "set_matrix", (PyCFunction)pycairo_pattern_set_matrix, METH_VARARGS },
     { "set_extend", (PyCFunction)pycairo_pattern_set_extend, METH_VARARGS },
     { "set_filter", (PyCFunction)pycairo_pattern_set_filter, METH_VARARGS },
+    { "set_matrix", (PyCFunction)pycairo_pattern_set_matrix, METH_VARARGS },
     { NULL, NULL, 0 }
 };
 
 static PyGetSetDef pycairo_pattern_getsets[] = {
-    { "matrix", (getter)pycairo_pattern_get_matrix, (setter)0 },
     { "extend", (getter)pycairo_pattern_get_extend, (setter)0 },
     { "filter", (getter)pycairo_pattern_get_filter, (setter)0 },
+    { "matrix", (getter)pycairo_pattern_get_matrix, (setter)0 },
     { NULL, (getter)0, (setter)0 }
 };
 

Index: pycairo-surface.c
===================================================================
RCS file: /cvs/cairo/pycairo/cairo/pycairo-surface.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- pycairo-surface.c	1 Dec 2004 14:44:51 -0000	1.6
+++ pycairo-surface.c	6 Dec 2004 03:06:51 -0000	1.7
@@ -88,11 +88,14 @@
 pycairo_surface_set_repeat(PyCairoSurface *self, PyObject *args)
 {
     int repeat;
+    cairo_status_t status;
 
     if (!PyArg_ParseTuple(args, "i:Surface.set_repeat", &repeat))
 	return NULL;
 
-    cairo_surface_set_repeat(self->surface, repeat);
+    status = cairo_surface_set_repeat(self->surface, repeat);
+    if (pycairo_check_status(status))
+	return NULL;
     Py_RETURN_NONE;
 }
 
@@ -113,11 +116,17 @@
 pycairo_surface_get_matrix(PyCairoSurface *self)
 {
     cairo_matrix_t *matrix;
+    cairo_status_t status;
 
     matrix = cairo_matrix_create();
     if (!matrix)
 	return PyErr_NoMemory();
-    cairo_surface_get_matrix(self->surface, matrix);
+
+    status = cairo_surface_get_matrix(self->surface, matrix);
+    if (pycairo_check_status(status)){
+	cairo_matrix_destroy(matrix);
+	return NULL;
+    }
     return pycairo_matrix_new(matrix);
 }
 
@@ -132,27 +141,30 @@
 pycairo_surface_set_filter(PyCairoSurface *self, PyObject *args)
 {
     cairo_filter_t filter;
+    cairo_status_t status;
 
     if (!PyArg_ParseTuple(args, "i:Surface.set_filter", &filter))
 	return NULL;
 
-    cairo_surface_set_filter(self->surface, filter);
+    status = cairo_surface_set_filter(self->surface, filter);
+    if (pycairo_check_status(status))
+	return NULL;
     Py_RETURN_NONE;
 }
 
 static PyMethodDef pycairo_surface_methods[] = {
     { "create_similar", (PyCFunction)pycairo_surface_create_similar,
       METH_VARARGS },
-    { "set_repeat", (PyCFunction)pycairo_surface_set_repeat, METH_VARARGS },
-    { "set_matrix", (PyCFunction)pycairo_surface_set_matrix, METH_VARARGS },
     { "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 },
     { NULL, NULL, 0 }
 };
 
 static PyGetSetDef pycairo_surface_getsets[] = {
     /* for some reason, there is no cairo_surface_get_repeat */
-    { "matrix", (getter)pycairo_surface_get_matrix, (setter)0 },
     { "filter", (getter)pycairo_surface_get_filter, (setter)0 },
+    { "matrix", (getter)pycairo_surface_get_matrix, (setter)0 },
     { NULL, }
 };
 




More information about the cairo-commit mailing list