[cairo-commit] pycairo/cairo pycairo-surface.c,1.19,1.20
Steve Chaplin
commit at pdx.freedesktop.org
Mon Apr 11 19:41:25 PDT 2005
Committed by: stevech1097
Update of /cvs/cairo/pycairo/cairo
In directory gabe:/tmp/cvs-serv30142/cairo
Modified Files:
pycairo-surface.c
Log Message:
SC 2005/04/12
Index: pycairo-surface.c
===================================================================
RCS file: /cvs/cairo/pycairo/cairo/pycairo-surface.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- pycairo-surface.c 10 Apr 2005 10:50:05 -0000 1.19
+++ pycairo-surface.c 12 Apr 2005 02:41:23 -0000 1.20
@@ -29,7 +29,7 @@
*
* Contributor(s):
* Maarten Breddels
- *
+ * Steve Chaplin
*/
#ifdef HAVE_CONFIG_H
@@ -61,7 +61,7 @@
}
static void
-pycairo_surface_dealloc(PyCairoSurface *self)
+surface_dealloc(PyCairoSurface *self)
{
#ifdef DEBUG
printf("surface_dealloc start\n");
@@ -83,7 +83,7 @@
}
static PyObject *
-pycairo_surface_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
+surface_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
PyCairoSurface *self;
cairo_format_t format;
@@ -107,7 +107,7 @@
/* alternative constructor */
static PyObject *
-pycairo_surface_create_for_data(PyTypeObject *type, PyObject *args)
+surface_create_for_data(PyTypeObject *type, PyObject *args)
{
PyCairoSurface *py_surface;
char *data;
@@ -163,7 +163,7 @@
/* alternative constructor */
static PyObject *
-pycairo_surface_create_for_png(PyTypeObject *type, PyObject *args)
+surface_create_for_png(PyTypeObject *type, PyObject *args)
{
PyCairoSurface *py_surface;
PyObject *file_object;
@@ -198,7 +198,7 @@
}
static PyObject *
-pycairo_surface_create_similar(PyCairoSurface *self, PyObject *args)
+surface_create_similar(PyCairoSurface *self, PyObject *args)
{
PyObject *py_surface;
cairo_surface_t *surface;
@@ -221,7 +221,7 @@
}
static PyObject *
-pycairo_surface_finish(PyCairoSurface *self)
+surface_finish(PyCairoSurface *self)
{
cairo_status_t status = cairo_surface_finish(self->surface);
Py_CLEAR(self->base);
@@ -235,13 +235,13 @@
}
static PyObject *
-pycairo_surface_get_filter(PyCairoSurface *self)
+surface_get_filter(PyCairoSurface *self)
{
return PyInt_FromLong(cairo_surface_get_filter(self->surface));
}
static PyObject *
-pycairo_surface_get_matrix(PyCairoSurface *self)
+surface_get_matrix(PyCairoSurface *self)
{
cairo_matrix_t matrix;
cairo_status_t status;
@@ -253,7 +253,7 @@
}
static PyObject *
-pycairo_surface_set_device_offset(PyCairoSurface *self, PyObject *args)
+surface_set_device_offset(PyCairoSurface *self, PyObject *args)
{
double x_offset, y_offset;
@@ -266,7 +266,7 @@
}
static PyObject *
-pycairo_surface_set_filter(PyCairoSurface *self, PyObject *args)
+surface_set_filter(PyCairoSurface *self, PyObject *args)
{
cairo_filter_t filter;
cairo_status_t status;
@@ -281,7 +281,7 @@
}
static PyObject *
-pycairo_surface_set_matrix(PyCairoSurface *self, PyObject *args)
+surface_set_matrix(PyCairoSurface *self, PyObject *args)
{
PyCairoMatrix *matrix;
@@ -294,7 +294,7 @@
}
static PyObject *
-pycairo_surface_set_repeat(PyCairoSurface *self, PyObject *args)
+surface_set_repeat(PyCairoSurface *self, PyObject *args)
{
int repeat;
cairo_status_t status;
@@ -310,7 +310,7 @@
#ifdef CAIRO_HAS_PNG_FUNCTIONS
static PyObject *
-pycairo_surface_write_png(PyCairoSurface *self, PyObject *args)
+surface_write_png(PyCairoSurface *self, PyObject *args)
{
PyObject *file_object;
cairo_status_t status;
@@ -326,75 +326,74 @@
}
#endif /* CAIRO_HAS_PNG_FUNCTIONS */
-static PyMethodDef pycairo_surface_methods[] = {
- { "create_for_data", (PyCFunction)pycairo_surface_create_for_data,
- METH_VARARGS | METH_CLASS },
+
+static PyMethodDef surface_methods[] = {
+ { "create_for_data",(PyCFunction)surface_create_for_data,
+ METH_VARARGS | METH_CLASS },
#ifdef CAIRO_HAS_PNG_FUNCTIONS
- { "create_for_png", (PyCFunction)pycairo_surface_create_for_png,
- METH_VARARGS | METH_CLASS },
+ { "create_for_png", (PyCFunction)surface_create_for_png,
+ METH_VARARGS | METH_CLASS },
#endif
- { "create_similar", (PyCFunction)pycairo_surface_create_similar,
- METH_VARARGS },
- { "finish", (PyCFunction)pycairo_surface_finish, METH_NOARGS },
- { "set_device_offset", (PyCFunction)pycairo_surface_set_device_offset,
- 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 },
+ { "create_similar", (PyCFunction)surface_create_similar, METH_VARARGS },
+ { "finish", (PyCFunction)surface_finish, METH_NOARGS },
+ { "set_device_offset",(PyCFunction)surface_set_device_offset,
+ METH_VARARGS },
+ { "set_filter", (PyCFunction)surface_set_filter, METH_VARARGS },
+ { "set_matrix", (PyCFunction)surface_set_matrix, METH_VARARGS },
+ { "set_repeat", (PyCFunction)surface_set_repeat, METH_VARARGS },
#ifdef CAIRO_HAS_PNG_FUNCTIONS
- { "write_png", (PyCFunction)pycairo_surface_write_png, METH_VARARGS },
+ { "write_png", (PyCFunction)surface_write_png, METH_VARARGS },
#endif
{ NULL, NULL, 0 }
};
-static PyGetSetDef pycairo_surface_getsets[] = {
- { "filter", (getter)pycairo_surface_get_filter, (setter)0 },
- { "matrix", (getter)pycairo_surface_get_matrix, (setter)0 },
+static PyGetSetDef surface_getsets[] = {
+ { "filter", (getter)surface_get_filter, (setter)0 },
+ { "matrix", (getter)surface_get_matrix, (setter)0 },
{ NULL, }
};
PyTypeObject PyCairoSurface_Type = {
- PyObject_HEAD_INIT(NULL)
+ PyObject_HEAD_INIT(&PyType_Type)
0, /* ob_size */
"cairo.Surface", /* tp_name */
sizeof(PyCairoSurface), /* tp_basicsize */
0, /* tp_itemsize */
- /* methods */
- (destructor)pycairo_surface_dealloc, /* tp_dealloc */
- (printfunc)0, /* tp_print */
- (getattrfunc)0, /* tp_getattr */
- (setattrfunc)0, /* tp_setattr */
- (cmpfunc)0, /* tp_compare */
- (reprfunc)0, /* tp_repr */
+ (destructor)surface_dealloc, /* tp_dealloc */
+ 0, /* tp_print */
+ 0, /* tp_getattr */
+ 0, /* tp_setattr */
+ 0, /* tp_compare */
+ 0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
- (hashfunc)0, /* tp_hash */
- (ternaryfunc)0, /* tp_call */
- (reprfunc)0, /* tp_str */
- (getattrofunc)0, /* tp_getattro */
- (setattrofunc)0, /* tp_setattro */
+ 0, /* tp_hash */
+ 0, /* tp_call */
+ 0, /* tp_str */
+ 0, /* tp_getattro */
+ 0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT, /* tp_flags */
- NULL, /* Documentation string */
- (traverseproc)0, /* tp_traverse */
- (inquiry)0, /* tp_clear */
- (richcmpfunc)0, /* tp_richcompare */
+ NULL, /* tp_doc */
+ 0, /* tp_traverse */
+ 0, /* tp_clear */
+ 0, /* tp_richcompare */
0, /* tp_weaklistoffset */
- (getiterfunc)0, /* tp_iter */
- (iternextfunc)0, /* tp_iternext */
- pycairo_surface_methods, /* tp_methods */
+ 0, /* tp_iter */
+ 0, /* tp_iternext */
+ surface_methods, /* tp_methods */
0, /* tp_members */
- pycairo_surface_getsets, /* tp_getset */
- (PyTypeObject *)0, /* tp_base */
- (PyObject *)0, /* tp_dict */
+ surface_getsets, /* tp_getset */
+ 0, /* tp_base */
+ 0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
- (initproc)0, /* tp_init */
- (allocfunc)0, /* tp_alloc */
- pycairo_surface_new, /* tp_new */
+ 0, /* tp_init */
+ 0, /* tp_alloc */
+ surface_new, /* tp_new */
0, /* tp_free */
- (inquiry)0, /* tp_is_gc */
- (PyObject *)0, /* tp_bases */
+ 0, /* tp_is_gc */
+ 0, /* tp_bases */
};
More information about the cairo-commit
mailing list