Index: ChangeLog =================================================================== RCS file: /cvs/cairo/pycairo/ChangeLog,v retrieving revision 1.121 diff -u -p -d -r1.121 ChangeLog --- ChangeLog 20 May 2005 11:07:31 -0000 1.121 +++ ChangeLog 22 May 2005 16:23:38 -0000 @@ -1,3 +1,11 @@ +2005-05-22 Gustavo J. A. M. Carneiro + + * cairo/cairogtkmodule.c (gdk_cairo_create): Don't define + gdk_cairo_create if compiling agains gtk+ 2.8 API. + + * configure.ac (export_dynamic): Define HAVE_GTK28 if gtk+ > 2.7 + is found. + === Pycairo 0.5.0 === 2005-05-20 Steve Chaplin Index: configure.ac =================================================================== RCS file: /cvs/cairo/pycairo/configure.ac,v retrieving revision 1.24 diff -u -p -d -r1.24 configure.ac --- configure.ac 20 May 2005 11:07:31 -0000 1.24 +++ configure.ac 22 May 2005 16:23:39 -0000 @@ -65,6 +65,15 @@ else fi AM_CONDITIONAL(WITH_PYGTK, $with_pygtk) +dnl Define HAVE_GTK28 if gtk+ > 2.7 is found +AC_MSG_CHECKING([for gtk+ 2.8 API]) +if $PKG_CONFIG --modversion "gtk+-2.0 >= 2.7.0" > /dev/null 2>&1; then + AC_MSG_RESULT([found]) + AC_DEFINE([HAVE_GTK28], [], [Defined if gtk+ 2.8 API is found]) +else + AC_MSG_RESULT([not found]) +fi + # Numeric Python save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES" Index: cairo/cairogtkmodule.c =================================================================== RCS file: /cvs/cairo/pycairo/cairo/cairogtkmodule.c,v retrieving revision 1.25 diff -u -p -d -r1.25 cairogtkmodule.c --- cairo/cairogtkmodule.c 19 May 2005 04:47:56 -0000 1.25 +++ cairo/cairogtkmodule.c 22 May 2005 16:23:39 -0000 @@ -88,11 +88,12 @@ surface_create_for_pixbuf(PyObject *self (PyObject *)py_pixbuf); } +#ifndef HAVE_GTK28 /* copied from gtk+/gdk/gdkcairo.c and gtk+/gdk/x11/gdkdrawable-x11.c * gdk_cairo_create() should be available in gtk 2.8 */ static cairo_t * -_gdk_cairo_create (GdkDrawable *drawable) +gdk_cairo_create (GdkDrawable *drawable) { int width, height; cairo_t *cr = NULL; @@ -125,10 +126,11 @@ _gdk_cairo_create (GdkDrawable *drawable } return cr; } +#endif /* gdk.cairo_create() should be available in pygtk 2.8 */ static PyObject * -gdk_cairo_create(PyObject *self, PyObject *args) +pygdk_cairo_create(PyObject *self, PyObject *args) { cairo_t *cr; PyGObject *py_drawable; @@ -137,7 +139,7 @@ gdk_cairo_create(PyObject *self, PyObjec &PyGdkDrawable_Type, &py_drawable)) return NULL; - cr = _gdk_cairo_create (GDK_DRAWABLE(py_drawable->obj)); + cr = gdk_cairo_create (GDK_DRAWABLE(py_drawable->obj)); if (!cr) { PyErr_SetString(PyExc_RuntimeError, "could not create context"); return NULL; @@ -145,9 +147,8 @@ gdk_cairo_create(PyObject *self, PyObjec return PycairoContext_FromContext (cr, (PyObject *)py_drawable); } - static PyMethodDef cairogtk_functions[] = { - { "gdk_cairo_create", (PyCFunction)gdk_cairo_create, METH_VARARGS }, + { "gdk_cairo_create", (PyCFunction)pygdk_cairo_create, METH_VARARGS }, { "surface_create_for_pixbuf", (PyCFunction)surface_create_for_pixbuf, METH_VARARGS }, { NULL, NULL, 0 }