[cairo-commit] pycairo/cairo cairomodule.c, 1.47, 1.48 pycairo-surface.c, 1.54, 1.55

Steve Chaplin commit at pdx.freedesktop.org
Sun Aug 21 23:37:39 PDT 2005


Committed by: stevech1097

Update of /cvs/cairo/pycairo/cairo
In directory gabe:/tmp/cvs-serv2989/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.47
retrieving revision 1.48
diff -u -d -r1.47 -r1.48
--- cairomodule.c	19 Aug 2005 02:46:54 -0000	1.47
+++ cairomodule.c	22 Aug 2005 06:37:37 -0000	1.48
@@ -103,6 +103,26 @@
     Pycairo_Check_Status,
 };
 
+static PyObject *
+pycairo_cairo_version (PyObject *self)
+{
+    return PyInt_FromLong (cairo_version());
+}
+
+static PyObject *
+pycairo_cairo_version_string (PyObject *self)
+{
+    return PyString_FromString (cairo_version_string());
+}
+
+static PyMethodDef cairo_functions[] = {
+    {"cairo_version",    (PyCFunction)pycairo_cairo_version, METH_NOARGS},
+    {"cairo_version_string", (PyCFunction)pycairo_cairo_version_string,
+                                                             METH_NOARGS},
+    {NULL, NULL, 0, NULL},
+};
+
+
 DL_EXPORT(void)
 init_cairo(void)
 {
@@ -152,7 +172,7 @@
         return;
 #endif
 
-    m = Py_InitModule("cairo._cairo", NULL);
+    m = Py_InitModule("cairo._cairo", cairo_functions);
 
     Py_INCREF(&PycairoContext_Type);
     PyModule_AddObject(m, "Context", (PyObject *)&PycairoContext_Type);

Index: pycairo-surface.c
===================================================================
RCS file: /cvs/cairo/pycairo/cairo/pycairo-surface.c,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -d -r1.54 -r1.55
--- pycairo-surface.c	19 Aug 2005 02:46:55 -0000	1.54
+++ pycairo-surface.c	22 Aug 2005 06:37:37 -0000	1.55
@@ -659,7 +659,7 @@
     }
     return o;
 }
-/* declared in cairo-ps.h but function does not exist!
+
 static PyObject *
 ps_surface_set_dpi (PycairoPSSurface *o, PyObject *args)
 {
@@ -670,9 +670,9 @@
     cairo_ps_surface_set_dpi (o->surface, x_dpi, y_dpi);
     Py_RETURN_NONE;
 }
-*/
+
 static PyMethodDef pssurface_methods[] = {
-    /*{"set_dpi", (PyCFunction)ps_surface_set_dpi,    METH_VARARGS },*/
+    {"set_dpi", (PyCFunction)ps_surface_set_dpi,    METH_VARARGS },
     {NULL, NULL, 0, NULL},
 };
 



More information about the cairo-commit mailing list