Index: cairo/pycairo-surface.c =================================================================== RCS file: /cvs/cairo/pycairo/cairo/pycairo-surface.c,v retrieving revision 1.73 diff -u -r1.73 pycairo-surface.c --- cairo/pycairo-surface.c 28 May 2006 02:03:07 -0000 1.73 +++ cairo/pycairo-surface.c 11 Jun 2006 06:04:50 -0000 @@ -242,6 +242,21 @@ Py_RETURN_NONE; } +static PyObject * +surface_set_fallback_resolution (PycairoSurface *o, PyObject *args) +{ + double x_pixels_per_inch, y_pixels_per_inch; + + if (!PyArg_ParseTuple(args, "dd:Surface.set_fallback_resolution", + &x_pixels_per_inch, &y_pixels_per_inch)) + return NULL; + cairo_surface_set_fallback_resolution (o->surface, + x_pixels_per_inch, y_pixels_per_inch); + Py_RETURN_NONE; +} + + + #ifdef CAIRO_HAS_PNG_FUNCTIONS /* METH_O */ static PyObject * @@ -290,7 +305,9 @@ {"get_font_options",(PyCFunction)surface_get_font_options, METH_NOARGS }, {"mark_dirty", (PyCFunction)surface_mark_dirty, METH_KEYWORDS }, {"set_device_offset",(PyCFunction)surface_set_device_offset, - METH_VARARGS }, + METH_VARARGS }, + {"set_fallback_resolution", (PyCFunction)surface_set_fallback_resolution, + METH_VARARGS }, #ifdef CAIRO_HAS_PNG_FUNCTIONS {"write_to_png", (PyCFunction)surface_write_to_png, METH_O }, #endif @@ -727,17 +744,6 @@ } static PyObject * -pdf_surface_set_dpi (PycairoPDFSurface *o, PyObject *args) -{ - double x_dpi, y_dpi; - - if (!PyArg_ParseTuple(args, "dd:PDFSurface.set_dpi", &x_dpi, &y_dpi)) - return NULL; - cairo_pdf_surface_set_dpi (o->surface, x_dpi, y_dpi); - Py_RETURN_NONE; -} - -static PyObject * pdf_surface_set_size (PycairoPDFSurface *o, PyObject *args) { double width_in_points, height_in_points; @@ -751,7 +757,6 @@ } static PyMethodDef pdf_surface_methods[] = { - {"set_dpi", (PyCFunction)pdf_surface_set_dpi, METH_VARARGS }, {"set_size", (PyCFunction)pdf_surface_set_size, METH_VARARGS }, {NULL, NULL, 0, NULL}, }; @@ -875,17 +880,6 @@ } static PyObject * -ps_surface_set_dpi (PycairoPSSurface *o, PyObject *args) -{ - double x_dpi, y_dpi; - - if (!PyArg_ParseTuple(args, "dd:PSSurface.set_dpi", &x_dpi, &y_dpi)) - return NULL; - cairo_ps_surface_set_dpi (o->surface, x_dpi, y_dpi); - Py_RETURN_NONE; -} - -static PyObject * ps_surface_set_size (PycairoPSSurface *o, PyObject *args) { double width_in_points, height_in_points; @@ -902,7 +896,6 @@ (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 }, - {"set_dpi", (PyCFunction)ps_surface_set_dpi, METH_VARARGS }, {"set_size", (PyCFunction)ps_surface_set_size, METH_VARARGS }, {NULL, NULL, 0, NULL}, }; @@ -993,24 +986,12 @@ } } -static PyObject * -svg_surface_set_dpi (PycairoSVGSurface *o, PyObject *args) -{ - double x_dpi, y_dpi; - - if (!PyArg_ParseTuple(args, "dd:SVGSurface.set_dpi", &x_dpi, &y_dpi)) - return NULL; - cairo_svg_surface_set_dpi (o->surface, x_dpi, y_dpi); - Py_RETURN_NONE; -} - static PyMethodDef svg_surface_methods[] = { /* TODO * cairo_svg_surface_restrict_to_version * cairo_svg_get_versions * cairo_svg_version_to_string */ - {"set_dpi", (PyCFunction)svg_surface_set_dpi, METH_VARARGS }, {NULL, NULL, 0, NULL}, };