commit python-cairo for openSUSE:Factory

Hello community, here is the log from the commit of package python-cairo for openSUSE:Factory checked in at Thu Mar 26 17:56:23 CET 2009. -------- --- python-cairo/python-cairo.changes 2009-02-01 23:21:01.000000000 +0100 +++ python-cairo/python-cairo.changes 2009-03-20 00:57:49.000000000 +0100 @@ -1,0 +2,33 @@ +Fri Mar 20 00:02:49 CET 2009 - vuntz@novell.com + +- Update to version 1.8.4: + + General Changes: + - Pycairo 1.8.4 requires cairo 1.8.4 (or later) and Python 2.6 + + Bug Fixes: + - fdo#20674: Add get/set_extend for Gradient Patterns + + New Classes: + - cairo.ToyFontFace + + New Methods: + - Pattern.get_extend + - Pattern.set_extend + - ToyFontFace.get_family + - ToyFontFace.get_slant + - ToyFontFace.get_weight + + Deleted Methods: + - SurfacePattern.get_extend + - SurfacePattern.set_extend + + Other Changes: + - Threading for surfaces with stream functions has been + reenabled. + - Documentation updates. +- Stop re-defining _prefix. +- Remove unneeded BuildRequires: gtk2-devel, libjpeg-devel, + python-numeric, update-desktop-files. +- Add BuildRequires: cairo-devel, fdupes. +- Remove Suggests on python-numeric (Numeric support was removed). +- Remove Suggests on python-gtk since, well, there's no real reason + to put it. +- Stop running suse_update_config. +- Use fdupes. + +------------------------------------------------------------------- calling whatdependson for head-i586 Old: ---- pycairo-1.8.2.tar.bz2 New: ---- pycairo-1.8.4.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-cairo.spec ++++++ --- /var/tmp/diff_new_pack.j10366/_old 2009-03-26 17:55:21.000000000 +0100 +++ /var/tmp/diff_new_pack.j10366/_new 2009-03-26 17:55:21.000000000 +0100 @@ -1,5 +1,5 @@ # -# spec file for package python-cairo (Version 1.8.2) +# spec file for package python-cairo (Version 1.8.4) # # Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany. # @@ -19,17 +19,17 @@ Name: python-cairo -BuildRequires: gtk2-devel libjpeg-devel python-devel python-numeric update-desktop-files -%define _prefix /usr +BuildRequires: cairo-devel +BuildRequires: fdupes +BuildRequires: python-devel License: LGPL v2.1 or later; MOZILLA PUBLIC LICENSE (MPL/NPL) Group: Development/Libraries/Python Summary: Python Bindings for Cairo -Version: 1.8.2 +Version: 1.8.4 Release: 1 Url: http://www.cairographics.org/ Source: pycairo-%{version}.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-build -Suggests: python-gtk python-numeric %py_requires %description @@ -63,7 +63,6 @@ %prep %setup -n pycairo-%{version} -%{?suse_update_config:%{suse_update_config -f}} %build %configure @@ -72,6 +71,7 @@ %install %makeinstall rm $RPM_BUILD_ROOT/%{py_sitedir}/cairo/*.la +%fdupes $RPM_BUILD_ROOT/%{py_sitedir} %clean rm -rf $RPM_BUILD_ROOT @@ -87,7 +87,37 @@ %{_libdir}/pkgconfig/pycairo.pc %changelog -* Sun Feb 01 2009 mboman@suse.de +* Fri Mar 20 2009 vuntz@novell.com +- Update to version 1.8.4: + + General Changes: + - Pycairo 1.8.4 requires cairo 1.8.4 (or later) and Python 2.6 + + Bug Fixes: + - fdo#20674: Add get/set_extend for Gradient Patterns + + New Classes: + - cairo.ToyFontFace + + New Methods: + - Pattern.get_extend + - Pattern.set_extend + - ToyFontFace.get_family + - ToyFontFace.get_slant + - ToyFontFace.get_weight + + Deleted Methods: + - SurfacePattern.get_extend + - SurfacePattern.set_extend + + Other Changes: + - Threading for surfaces with stream functions has been + reenabled. + - Documentation updates. +- Stop re-defining _prefix. +- Remove unneeded BuildRequires: gtk2-devel, libjpeg-devel, + python-numeric, update-desktop-files. +- Add BuildRequires: cairo-devel, fdupes. +- Remove Suggests on python-numeric (Numeric support was removed). +- Remove Suggests on python-gtk since, well, there's no real reason + to put it. +- Stop running suse_update_config. +- Use fdupes. +* Mon Feb 02 2009 mboman@suse.de - Update to version 1.8.2: + bfo#19287: Threading support results in crashes in cairo.ImageSurface ++++++ pycairo-1.8.2.tar.bz2 -> pycairo-1.8.4.tar.bz2 ++++++ ++++ 1621 lines of diff (skipped) ++++ retrying with extended exclude list diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pycairo-1.8.2/cairo/cairomodule.c new/pycairo-1.8.4/cairo/cairomodule.c --- old/pycairo-1.8.2/cairo/cairomodule.c 2009-01-15 10:34:02.000000000 +0100 +++ new/pycairo-1.8.4/cairo/cairomodule.c 2009-03-19 09:43:58.000000000 +0100 @@ -43,8 +43,8 @@ #define VERSION_MAJOR 1 #define VERSION_MINOR 8 -#define VERSION_MICRO 2 -static char pycairo_version_string[] = "1.8.2"; +#define VERSION_MICRO 4 +static char pycairo_version_string[] = "1.8.4"; /* A module specific exception */ @@ -88,7 +88,10 @@ */ static Pycairo_CAPI_t CAPI = { &PycairoContext_Type, PycairoContext_FromContext, - &PycairoFontFace_Type, PycairoFontFace_FromFontFace, + + &PycairoFontFace_Type, + &PycairoToyFontFace_Type, PycairoFontFace_FromFontFace, + &PycairoFontOptions_Type, PycairoFontOptions_FromFontOptions, &PycairoMatrix_Type, PycairoMatrix_FromMatrix, &PycairoPath_Type, PycairoPath_FromPath, @@ -170,6 +173,9 @@ PycairoFontFace_Type.tp_base = &PyBaseObject_Type; if (PyType_Ready(&PycairoFontFace_Type) < 0) return; + PycairoToyFontFace_Type.tp_base = &PyBaseObject_Type; + if (PyType_Ready(&PycairoToyFontFace_Type) < 0) + return; PycairoFontOptions_Type.tp_base = &PyBaseObject_Type; if (PyType_Ready(&PycairoFontOptions_Type) < 0) return; @@ -249,6 +255,8 @@ PyModule_AddObject(m, "Context", (PyObject *)&PycairoContext_Type); Py_INCREF(&PycairoFontFace_Type); PyModule_AddObject(m, "FontFace",(PyObject *)&PycairoFontFace_Type); + Py_INCREF(&PycairoToyFontFace_Type); + PyModule_AddObject(m, "ToyFontFace",(PyObject *)&PycairoToyFontFace_Type); Py_INCREF(&PycairoFontOptions_Type); PyModule_AddObject(m, "FontOptions",(PyObject *)&PycairoFontOptions_Type); Py_INCREF(&PycairoMatrix_Type); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pycairo-1.8.2/cairo/pycairo-font.c new/pycairo-1.8.4/cairo/pycairo-font.c --- old/pycairo-1.8.2/cairo/pycairo-font.c 2008-11-29 00:52:52.000000000 +0100 +++ new/pycairo-1.8.4/cairo/pycairo-font.c 2009-02-12 09:50:51.000000000 +0100 @@ -48,6 +48,7 @@ PyObject * PycairoFontFace_FromFontFace (cairo_font_face_t *font_face) { + PyTypeObject *type = NULL; PyObject *o; assert (font_face != NULL); @@ -57,7 +58,15 @@ return NULL; } - o = PycairoFontFace_Type.tp_alloc (&PycairoFontFace_Type, 0); + switch (cairo_font_face_get_type (font_face)) { + case CAIRO_FONT_TYPE_TOY: + type = &PycairoToyFontFace_Type; + break; + default: + type = &PycairoFontFace_Type; + break; + } + o = type->tp_alloc (type, 0); if (o == NULL) cairo_font_face_destroy (font_face); else @@ -141,6 +150,95 @@ }; +/* class cairo.ToyFontFace ------------------------------------------------- */ + +static PyObject * +toy_font_face_new (PyTypeObject *type, PyObject *args, PyObject *kwds) +{ + char *family; + cairo_font_slant_t slant = CAIRO_FONT_SLANT_NORMAL; + cairo_font_weight_t weight = CAIRO_FONT_WEIGHT_NORMAL; + + if (!PyArg_ParseTuple(args, "s|II:ToyFont.__new__", &family, &slant, + &weight)) + return NULL; + + return PycairoFontFace_FromFontFace ( + cairo_toy_font_face_create (family, slant, weight)); +} + +static PyObject * +toy_font_get_family (PycairoToyFontFace *o) +{ + return PyString_FromString (cairo_toy_font_face_get_family (o->font_face)); +} + +static PyObject * +toy_font_get_slant (PycairoToyFontFace *o) +{ + return PyInt_FromLong (cairo_toy_font_face_get_slant (o->font_face)); +} + +static PyObject * +toy_font_get_weight (PycairoToyFontFace *o) +{ + return PyInt_FromLong (cairo_toy_font_face_get_weight (o->font_face)); +} + +static PyMethodDef toy_font_face_methods[] = { + {"get_family", (PyCFunction)toy_font_get_family, METH_NOARGS}, + {"get_slant", (PyCFunction)toy_font_get_slant, METH_NOARGS}, + {"get_weight", (PyCFunction)toy_font_get_weight, METH_NOARGS}, + {NULL, NULL, 0, NULL}, +}; + + +PyTypeObject PycairoToyFontFace_Type = { + PyObject_HEAD_INIT(NULL) + 0, /* ob_size */ + "cairo.ToyFontFace", /* tp_name */ + sizeof(PycairoToyFontFace), /* tp_basicsize */ + 0, /* tp_itemsize */ + 0, /* 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 */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT, /* tp_flags */ + 0, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + 0, /* tp_iter */ + 0, /* tp_iternext */ + toy_font_face_methods, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + 0, /* &PycairoFontFace_Type, */ /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + 0, /* tp_init */ + 0, /* tp_alloc */ + (newfunc)toy_font_face_new, /* tp_new */ + 0, /* tp_free */ + 0, /* tp_is_gc */ + 0, /* tp_bases */ +}; + + /* class cairo.ScaledFont ------------------------------------------------- */ /* PycairoScaledFont_FromScaledFont diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pycairo-1.8.2/cairo/pycairo.h new/pycairo-1.8.4/cairo/pycairo.h --- old/pycairo-1.8.2/cairo/pycairo.h 2008-12-10 08:50:10.000000000 +0100 +++ new/pycairo-1.8.4/cairo/pycairo.h 2009-02-12 05:26:06.000000000 +0100 @@ -47,6 +47,8 @@ cairo_font_face_t *font_face; } PycairoFontFace; +#define PycairoToyFontFace PycairoFontFace + typedef struct { PyObject_HEAD cairo_font_options_t *font_options; @@ -102,6 +104,7 @@ PyObject *(*Context_FromContext)(cairo_t *ctx, PyTypeObject *type, PyObject *base); PyTypeObject *FontFace_Type; + PyTypeObject *ToyFontFace_Type; PyObject *(*FontFace_FromFontFace)(cairo_font_face_t *font_face); PyTypeObject *FontOptions_Type; PyObject *(*FontOptions_FromFontOptions)( @@ -117,7 +120,7 @@ PyTypeObject *Gradient_Type; PyTypeObject *LinearGradient_Type; PyTypeObject *RadialGradient_Type; - PyObject *(*Pattern_FromPattern)(cairo_pattern_t *pattern); + PyObject *(*Pattern_FromPattern)(cairo_pattern_t *pattern, PyObject *base); PyTypeObject *ScaledFont_Type; PyObject *(*ScaledFont_FromScaledFont)(cairo_scaled_font_t *scaled_font); @@ -142,6 +145,7 @@ #define PycairoContext_Type *(Pycairo_CAPI->Context_Type) #define PycairoContext_FromContext (Pycairo_CAPI->Context_FromContext) #define PycairoFontFace_Type *(Pycairo_CAPI->FontFace_Type) +#define PycairoToyFontFace_Type *(Pycairo_CAPI->ToyFontFace_Type) #define PycairoFontFace_FromFontFace (Pycairo_CAPI->FontFace_FromFontFace) #define PycairoFontOptions_Type *(Pycairo_CAPI->FontOptions_Type) #define PycairoFontOptions_FromFontOptions \ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pycairo-1.8.2/cairo/pycairo-pattern.c new/pycairo-1.8.4/cairo/pycairo-pattern.c --- old/pycairo-1.8.2/cairo/pycairo-pattern.c 2008-12-15 06:58:51.000000000 +0100 +++ new/pycairo-1.8.4/cairo/pycairo-pattern.c 2009-03-16 09:59:59.000000000 +0100 @@ -117,6 +117,12 @@ } static PyObject * +pattern_get_extend (PycairoPattern *o) +{ + return PyInt_FromLong (cairo_pattern_get_extend (o->pattern)); +} + +static PyObject * pattern_get_matrix (PycairoPattern *o) { cairo_matrix_t matrix; @@ -125,6 +131,18 @@ } static PyObject * +pattern_set_extend (PycairoPattern *o, PyObject *args) +{ + int extend; + + if (!PyArg_ParseTuple(args, "i:Pattern.set_extend", &extend)) + return NULL; + + cairo_pattern_set_extend (o->pattern, extend); + Py_RETURN_NONE; +} + +static PyObject * pattern_set_matrix (PycairoPattern *o, PyObject *args) { PycairoMatrix *m; @@ -146,8 +164,10 @@ * cairo_pattern_status() * - not needed since Pycairo handles status checking */ - {"get_matrix", (PyCFunction)pattern_get_matrix, METH_NOARGS }, - {"set_matrix", (PyCFunction)pattern_set_matrix, METH_VARARGS }, + {"get_extend", (PyCFunction)pattern_get_extend, METH_NOARGS }, + {"get_matrix", (PyCFunction)pattern_get_matrix, METH_NOARGS }, + {"set_extend", (PyCFunction)pattern_set_extend, METH_VARARGS }, + {"set_matrix", (PyCFunction)pattern_set_matrix, METH_VARARGS }, {NULL, NULL, 0, NULL}, }; @@ -273,18 +293,11 @@ surface_pattern_new (PyTypeObject *type, PyObject *args, PyObject *kwds) { PycairoSurface *s; - PyObject *o; if (!PyArg_ParseTuple (args, "O!:SurfacePattern.__new__", &PycairoSurface_Type, &s)) return NULL; return PycairoPattern_FromPattern ( - cairo_pattern_create_for_surface (s->surface), s); -} - -static PyObject * -surface_pattern_get_extend (PycairoSurfacePattern *o) -{ - return PyInt_FromLong (cairo_pattern_get_extend (o->pattern)); + cairo_pattern_create_for_surface (s->surface), (PyObject *)s); } static PyObject * @@ -307,18 +320,6 @@ } static PyObject * -surface_pattern_set_extend (PycairoSurfacePattern *o, PyObject *args) -{ - int extend; - - if (!PyArg_ParseTuple(args, "i:SurfacePattern.set_extend", &extend)) - return NULL; - - cairo_pattern_set_extend (o->pattern, extend); - Py_RETURN_NONE; -} - -static PyObject * surface_pattern_set_filter (PycairoSurfacePattern *o, PyObject *args) { int filter; @@ -331,10 +332,8 @@ } static PyMethodDef surface_pattern_methods[] = { - {"get_extend", (PyCFunction)surface_pattern_get_extend, METH_NOARGS }, {"get_filter", (PyCFunction)surface_pattern_get_filter, METH_NOARGS }, {"get_surface", (PyCFunction)surface_pattern_get_surface, METH_NOARGS }, - {"set_extend", (PyCFunction)surface_pattern_set_extend, METH_VARARGS }, {"set_filter", (PyCFunction)surface_pattern_set_filter, METH_VARARGS }, {NULL, NULL, 0, NULL}, }; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pycairo-1.8.2/cairo/pycairo-private.h new/pycairo-1.8.4/cairo/pycairo-private.h --- old/pycairo-1.8.2/cairo/pycairo-private.h 2008-12-10 09:07:20.000000000 +0100 +++ new/pycairo-1.8.4/cairo/pycairo-private.h 2009-02-12 05:27:01.000000000 +0100 @@ -50,6 +50,7 @@ PyObject *base); extern PyTypeObject PycairoFontFace_Type; +extern PyTypeObject PycairoToyFontFace_Type; PyObject *PycairoFontFace_FromFontFace (cairo_font_face_t *font_face); extern PyTypeObject PycairoFontOptions_Type; diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pycairo-1.8.2/cairo/pycairo-surface.c new/pycairo-1.8.4/cairo/pycairo-surface.c --- old/pycairo-1.8.2/cairo/pycairo-surface.c 2009-01-01 06:57:46.000000000 +0100 +++ new/pycairo-1.8.4/cairo/pycairo-surface.c 2009-03-03 12:11:20.000000000 +0100 @@ -103,7 +103,6 @@ type = &PycairoSurface_Type; break; } - o = type->tp_alloc (type, 0); if (o == NULL) { cairo_surface_destroy (surface); @@ -122,15 +121,18 @@ static cairo_status_t _write_func (void *closure, const unsigned char *data, unsigned int length) { + PyGILState_STATE gstate = PyGILState_Ensure(); PyObject *res = PyObject_CallMethod ((PyObject *)closure, "write", "(s#)", data, (Py_ssize_t)length); if (res == NULL) { /* an exception has occurred, it will be picked up later by * Pycairo_Check_Status() */ + PyGILState_Release(gstate); return CAIRO_STATUS_WRITE_ERROR; } Py_DECREF(res); + PyGILState_Release(gstate); return CAIRO_STATUS_SUCCESS; } @@ -310,10 +312,10 @@ return NULL; } Py_DECREF(writer); - /*Py_BEGIN_ALLOW_THREADS*/ /*seg faults reported*/ + Py_BEGIN_ALLOW_THREADS status = cairo_surface_write_to_png_stream (o->surface, _write_func, file); - /*Py_END_ALLOW_THREADS*/ + Py_END_ALLOW_THREADS } RETURN_NULL_IF_CAIRO_ERROR(status); Py_RETURN_NONE; @@ -467,12 +469,20 @@ _read_func (void *closure, unsigned char *data, unsigned int length) { char *str; + PyGILState_STATE gstate = PyGILState_Ensure(); PyObject *pystr = PyObject_CallMethod ((PyObject *)closure, "read", "(i)", length); - if (pystr == NULL) + if (pystr == NULL){ + /* an exception has occurred, it will be picked up later by + * Pycairo_Check_Status() + */ + PyGILState_Release(gstate); return CAIRO_STATUS_READ_ERROR; + } str = PyString_AsString(pystr); Py_DECREF(pystr); + PyGILState_Release(gstate); + if (str == NULL) return CAIRO_STATUS_READ_ERROR; /* don't use strncpy() since png data may contain NUL bytes */ @@ -505,9 +515,9 @@ } Py_DECREF(reader); - /*Py_BEGIN_ALLOW_THREADS*/ /*seg faults reported*/ + Py_BEGIN_ALLOW_THREADS is = cairo_image_surface_create_from_png_stream (_read_func, file); - /*Py_END_ALLOW_THREADS*/ + Py_END_ALLOW_THREADS return PycairoSurface_FromSurface (is, NULL); } #endif /* CAIRO_HAS_PNG_FUNCTIONS */ @@ -542,15 +552,15 @@ } static PyObject * -image_surface_get_width (PycairoImageSurface *o) +image_surface_get_stride (PycairoImageSurface *o) { - return PyInt_FromLong (cairo_image_surface_get_width (o->surface)); + return PyInt_FromLong (cairo_image_surface_get_stride (o->surface)); } static PyObject * -image_surface_get_stride (PycairoImageSurface *o) +image_surface_get_width (PycairoImageSurface *o) { - return PyInt_FromLong (cairo_image_surface_get_stride (o->surface)); + return PyInt_FromLong (cairo_image_surface_get_width (o->surface)); } @@ -625,8 +635,8 @@ {"get_data", (PyCFunction)image_surface_get_data, METH_NOARGS}, {"get_format", (PyCFunction)image_surface_get_format, METH_NOARGS}, {"get_height", (PyCFunction)image_surface_get_height, METH_NOARGS}, - {"get_width", (PyCFunction)image_surface_get_width, METH_NOARGS}, {"get_stride", (PyCFunction)image_surface_get_stride, METH_NOARGS}, + {"get_width", (PyCFunction)image_surface_get_width, METH_NOARGS}, {NULL, NULL, 0, NULL}, }; @@ -712,10 +722,10 @@ } Py_DECREF(writer); - /*Py_BEGIN_ALLOW_THREADS*/ /*seg faults reported*/ + Py_BEGIN_ALLOW_THREADS sfc = cairo_pdf_surface_create_for_stream (_write_func, file, width_in_points, height_in_points); - /*Py_END_ALLOW_THREADS*/ + Py_END_ALLOW_THREADS return PycairoSurface_FromSurface (sfc, file); } @@ -818,10 +828,10 @@ } Py_DECREF(writer); - /*Py_BEGIN_ALLOW_THREADS*/ /*seg faults reported*/ + Py_BEGIN_ALLOW_THREADS sfc = cairo_ps_surface_create_for_stream (_write_func, file, width_in_points, height_in_points); - /*Py_END_ALLOW_THREADS*/ + Py_END_ALLOW_THREADS return PycairoSurface_FromSurface (sfc, file); } @@ -1010,10 +1020,10 @@ } Py_DECREF(writer); - /*Py_BEGIN_ALLOW_THREADS*/ /*seg faults reported*/ + Py_BEGIN_ALLOW_THREADS sfc = cairo_svg_surface_create_for_stream (_write_func, file, width_in_points, height_in_points); - /*Py_END_ALLOW_THREADS*/ + Py_END_ALLOW_THREADS return PycairoSurface_FromSurface (sfc, file); } diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pycairo-1.8.2/ChangeLog new/pycairo-1.8.4/ChangeLog --- old/pycairo-1.8.2/ChangeLog 2009-01-15 10:40:56.000000000 +0100 +++ new/pycairo-1.8.4/ChangeLog 2009-03-19 09:50:41.000000000 +0100 @@ -1,3 +1,69 @@ +=== Pycairo 1.8.4 === +2009-03-19 Steven Chaplin <stevech1097 # yahoo.com.au> + + * cairo/cairomodule.c: + * configure.ac: + * doc/conf.py: + * NEWS: + * setup.py: + Update for 1.8.4 release. + +2009-03-19 Steven Chaplin <stevech1097 # yahoo.com.au> + + * doc/reference/surfaces.rst: update documentation. + +2009-03-16 Steven Chaplin <stevech1097 # yahoo.com.au> + + * cairo/pycairo-pattern.c : + * doc/reference/patterns.rst: + Move SurfacePattern.{get_extend,set_extend} up into the Pattern class + so Gradient Patterns can use the methods also. + Fixes #20674. + +2009-03-03 Steven Chaplin <stevech1097 # yahoo.com.au> + + * configure.ac: + * setup.py: + * README: + Require Python 2.6, cairo 1.8.4 + + * cairo/pycairo-surface.c: tidy up. + + * doc/reference/mattributes.rst: + * doc/reference/surfaces.rst: + Update docs. + +2009-02-16 Steven Chaplin <stevech1097 # yahoo.com.au> + + * cairo/pycairo-surface.c: Reenable threading for all cairo stream + functions and wrap PyGILState_Ensure/PyGILState_Release around the + calls to PyObject_CallMethod. This should fix bug #19287. + Patch from Torsten Marek. + +2009-02-12 Steven Chaplin <stevech1097 # yahoo.com.au> + + * doc/reference/patterns.rst: + * doc/reference/surfaces.rst: + use '.. versionadded::' markup + + * cairo/cairomodule.c: + * cairo/pycairo-font.c: + * cairo/pycairo.h: + * cairo/pycairo-private.h: + * doc/reference/mattributes.rst: + * doc/reference/text.rst: + Add patch by Torsten Marek to support ToyFontFace. + + * cairo/pycairo.h : update Pattern_FromPattern prototype + * cairo/pycairo-pattern.c (surface_pattern_new): remove unused variable. + +2009-01-15 Steven Chaplin <stevech1097 # yahoo.com.au> + + * configure.ac: + * cairo/cairomodule.c: + * setup.py: + increment version to 1.8.3 + === Pycairo 1.8.2 === 2009-01-15 Steven Chaplin <stevech1097 # yahoo.com.au> diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pycairo-1.8.2/configure.ac new/pycairo-1.8.4/configure.ac --- old/pycairo-1.8.2/configure.ac 2009-01-15 10:32:57.000000000 +0100 +++ new/pycairo-1.8.4/configure.ac 2009-03-19 09:43:24.000000000 +0100 @@ -4,11 +4,11 @@ # the pycairo version number m4_define(pycairo_version_major, 1) m4_define(pycairo_version_minor, 8) -m4_define(pycairo_version_micro, 2) +m4_define(pycairo_version_micro, 4) m4_define(pycairo_version, pycairo_version_major.pycairo_version_minor.pycairo_version_micro) # versions of packages we require -m4_define(cairo_required_version, 1.8.2) +m4_define(cairo_required_version, 1.8.4) AC_INIT([pycairo], [pycairo_version], @@ -34,7 +34,7 @@ AC_DISABLE_STATIC AC_PROG_LIBTOOL dnl required version (1.4) DON'T REMOVE - used by autogen.sh -AM_PATH_PYTHON(2.5) +AM_PATH_PYTHON(2.6) # Checks for libraries --- diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pycairo-1.8.2/doc/conf.py new/pycairo-1.8.4/doc/conf.py --- old/pycairo-1.8.2/doc/conf.py 2009-01-15 09:31:54.000000000 +0100 +++ new/pycairo-1.8.4/doc/conf.py 2009-03-19 09:45:52.000000000 +0100 @@ -48,7 +48,7 @@ # The short X.Y version. version = '1.8' # The full version, including alpha/beta/rc tags. -release = '1.8.2' +release = '1.8.4' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pycairo-1.8.2/doc/reference/mattributes.rst new/pycairo-1.8.4/doc/reference/mattributes.rst --- old/pycairo-1.8.2/doc/reference/mattributes.rst 2008-11-28 08:16:14.000000000 +0100 +++ new/pycairo-1.8.4/doc/reference/mattributes.rst 2009-03-03 11:56:21.000000000 +0100 @@ -134,6 +134,7 @@ These attributes are used to indicate what filtering should be applied when reading pixel values from patterns. See :meth:`SurfacePattern.set_filter` for indicating the desired filter to be used with a particular pattern. +.. _mattributes_weight: .. attribute:: cairo.FONT_WEIGHT_NORMAL cairo.FONT_WEIGHT_BOLD @@ -142,6 +143,7 @@ These attributes specify variants of a font face based on their weight. +.. _mattributes_slant: .. attribute:: cairo.FONT_SLANT_NORMAL cairo.FONT_SLANT_ITALIC cairo.FONT_SLANT_OBLIQUE @@ -152,6 +154,7 @@ These attributes specify variants of a font face based on their slant. +.. _mattributes_format: .. attribute:: cairo.FORMAT_ARGB32 cairo.FORMAT_RGB24 cairo.FORMAT_A8 @@ -162,7 +165,8 @@ * *cairo.FORMAT_RGB24*: each pixel is a 32-bit quantity, with the upper 8 bits unused. Red, Green, and Blue are stored in the remaining 24 bits in that order. * *cairo.FORMAT_A8*: each pixel is a 8-bit quantity holding an alpha value. * *cairo.FORMAT_A1*: each pixel is a 1-bit quantity holding an alpha value. Pixels are packed together into 32-bit quantities. The ordering of the bits matches the endianess of the platform. On a big-endian machine, the first pixel is in the uppermost bit, on a little-endian machine the first pixel is in the least-significant bit. -* *cairo.FORMAT_RGB16_565*: This format value is deprecated. It has never been properly implemented in cairo and should not be used by applications. (since 1.2) +* *cairo.FORMAT_RGB16_565*: This format value is deprecated. It has never been properly implemented in cairo and should not be used by applications. + .. versionadded:: 1.2 These attributes are used to identify the memory format of image data. diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pycairo-1.8.2/doc/reference/patterns.rst new/pycairo-1.8.4/doc/reference/patterns.rst --- old/pycairo-1.8.2/doc/reference/patterns.rst 2008-11-27 09:37:27.000000000 +0100 +++ new/pycairo-1.8.4/doc/reference/patterns.rst 2009-03-16 10:13:07.000000000 +0100 @@ -21,10 +21,31 @@ .. class:: Pattern() + .. method:: get_extend() + + :returns: the current extend strategy used for drawing the *Pattern*. + :rtype: int + + Gets the current extend mode for the *Pattern*. See + :ref:`EXTEND attributes <mattributes_extend>` + for details on the semantics of each extend strategy. + .. method:: get_matrix() :returns: a new :class:`Matrix` which stores a copy of the *Pattern's* transformation matrix + .. method:: set_extend(extend) + + :param extend: an extend describing how the area outside of the *Pattern* will be drawn + + Sets the mode to be used for drawing outside the area of a *Pattern*. See + :ref:`EXTEND attributes <mattributes_extend>` + for details on the semantics of each extend strategy. + + The default extend mode is :attr:`cairo.EXTEND_NONE` for + :class:`SurfacePattern` and :attr:`cairo.EXTEND_PAD` for + :class:`Gradient` Patterns. + .. method:: set_matrix(matrix) :param matrix: a cairo matrix (:class:`Matrix`) @@ -82,7 +103,7 @@ Gets the solid color for a *SolidPattern*. - Since: 1.4 + .. versionadded:: 1.4 class SurfacePattern(:class:`Pattern`) @@ -96,15 +117,6 @@ Create a new *SurfacePattern* for the given surface. - .. method:: get_extend() - - :returns: the current extend strategy used for drawing the *Pattern*. - :rtype: int - - Gets the current extend mode for the *Pattern*. See - :ref:`EXTEND attributes <mattributes_extend>` - for details on the semantics of each extend strategy. - .. method:: get_filter() :returns: the current filter used for resizing the *Pattern*. @@ -118,18 +130,7 @@ :returns: the :class:`Surface` of the *SurfacePattern*. - Since: 1.4 - - .. method:: set_extend(extend) - - :param extend: an extend describing how the area outside of the *Pattern* will be drawn - - Sets the mode to be used for drawing outside the area of a *Pattern*. See - :ref:`EXTEND attributes <mattributes_extend>` - for details on the semantics of each extend strategy. - - The default extend mode is :attr:`cairo.EXTEND_NONE` for *SurfacePatterns* - and :attr:`cairo.EXTEND_PAD` for *Gradient* patterns. + .. versionadded:: 1.4 .. method:: set_filter(filter) @@ -245,7 +246,7 @@ Gets the gradient endpoints for a *LinearGradient*. - Since: 1.4 + .. versionadded:: 1.4 class RadialGradient(:class:`Gradient`) @@ -290,4 +291,4 @@ Gets the *Gradient* endpoint circles for a *RadialGradient*, each specified as a center coordinate and a radius. - Since: 1.4 + .. versionadded:: 1.4 diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pycairo-1.8.2/doc/reference/surfaces.rst new/pycairo-1.8.4/doc/reference/surfaces.rst --- old/pycairo-1.8.2/doc/reference/surfaces.rst 2009-01-15 10:05:57.000000000 +0100 +++ new/pycairo-1.8.4/doc/reference/surfaces.rst 2009-03-19 09:27:49.000000000 +0100 @@ -28,7 +28,7 @@ :meth:`Context.copy_page` is a convenience function for this. - Since: 1.6 + .. versionadded:: 1.6 .. method:: create_similar(content, width, height) @@ -77,7 +77,7 @@ whether the surface contains color and/or alpha information. See :ref:`content <mattributes_content>`. - Since: 1.2 + .. versionadded:: 1.2 .. method:: get_device_offset() @@ -88,7 +88,7 @@ This method returns the previous device offset set by :meth:`.set_device_offset`. - Since: 1.2 + .. versionadded:: 1.2 .. method:: get_fallback_resolution() @@ -101,7 +101,7 @@ :meth:`.set_fallback_resolution`, or default fallback resolution if never set. - Since: 1.8 + .. versionadded:: 1.8 .. method:: get_font_options() @@ -185,7 +185,7 @@ The default fallback resoultion is 300 pixels per inch in both dimensions. - Since: 1.2 + .. versionadded:: 1.2 .. method:: show_page() @@ -195,7 +195,7 @@ There is a convenience function for this that takes a :meth:`Context.show_page`. - Since: 1.6 + .. versionadded:: 1.6 .. method:: write_to_png(fobj) @@ -211,37 +211,86 @@ class ImageSurface(:class:`Surface`) ==================================== -.. class:: ImageSurface +A *cairo.ImageSurface* provides the ability to render to memory buffers either +allocated by cairo or by the calling code. The supported image formats are +those defined in :ref:`FORMAT attributes <mattributes_format>`. + +.. class:: ImageSurface(format, width, height) + + :param format: format of pixels in the surface to create + :param width: width of the surface, in pixels + :param height: height of the surface, in pixels + :returns: a new *ImageSurface* + :raises: *MemoryError* in case of no memory + + Creates an *ImageSurface* of the specified format and dimensions. Initially + the surface contents are all 0. (Specifically, within each pixel, each + color or alpha channel belonging to format will be 0. The contents of bits + within a pixel, but not belonging to the given format are undefined). + + .. method:: create_for_data(data, format, width, height, stride) + + :param data: a writable Python buffer object + :param format: the format of pixels in the buffer + :param width: the width of the image to be stored in the buffer + :param height: the height of the image to be stored in the buffer + :param stride: the number of bytes between the start of rows in the buffer as allocated. This value should always be computed by :meth:`.format_stride_for_width` before allocating the data buffer. + :returns: a new *ImageSurface* + :raises: *MemoryError* in case of no memory. + + :class:`cairo.Error` in case of invalid *stride* value. + + Creates an *ImageSurface* for the provided pixel data. The initial + contents of buffer will be used as the initial image contents; you must + explicitly clear the buffer, using, for example, cairo_rectangle() and + cairo_fill() if you want it cleared. + + Note that the *stride* may be larger than width*bytes_per_pixel to + provide proper alignment for each pixel and row. This alignment is + required to allow high-performance rendering within cairo. The correct + way to obtain a legal stride value is to call + :meth:`.format_stride_for_width` with the desired format and maximum + image width value, and use the resulting stride value to allocate the + data and to create the *ImageSurface*. See + :meth:`.format_stride_for_width` for example code. + + .. method:: create_from_png(fobj) + + :param fobj: a filename, file, or file-like object of the PNG to load. + + Creates a new *ImageSurface* and initializes the contents to the given + PNG file. + + .. method:: format_stride_for_width(format, width) + + :param format: a cairo :ref:`format <mattributes_format>` value + :param width: the desired width of an *ImageSurface* to be created. + :returns: the appropriate stride to use given the desired format and width, or -1 if either the format is invalid or the width too large. + + This method provides a stride value that will respect all alignment + requirements of the accelerated image-rendering code within + cairo. Typical usage will be of the form:: + + stride = cairo.ImageSurface.stride_for_width (format, width) + surface = cairo.ImageSurface.create_for_data (data, format, + width, height, stride) -.. comment - C : surface = cairo_image_surface_create (format, width, height); - surface = cairo_image_surface_create_from_png (filename); - surface = cairo_image_surface_create_from_png_stream (read_func, closure); - surface = cairo_image_surface_create_for_data (data, format, w, h, stride) - - Py: surface = cairo.ImageSurface (format, width, height) - surface = cairo.ImageSurface.create_from_png (f) - where 'f' is a filename, a file object, or a file-like object - surface = cairo.ImageSurface.create_for_data (data, format, w, h, stride) - where 'data' if a writable Python buffer object -.. - - .. method:: create_for_data() + .. versionadded:: 1.6 - .. method:: create_from_png() + .. method:: get_data() - .. method:: format_stride_for_width() + :returns: a Python buffer object for the data of the *ImageSurface*, for direct inspection or modification. - .. method:: get_data() + .. versionadded:: 1.2 .. method:: get_format() .. method:: get_height() - .. method:: get_width() - .. method:: get_stride() + .. method:: get_width() + class PDFSurface(:class:`Surface`) ================================== diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pycairo-1.8.2/doc/reference/text.rst new/pycairo-1.8.4/doc/reference/text.rst --- old/pycairo-1.8.2/doc/reference/text.rst 2008-11-29 00:51:57.000000000 +0100 +++ new/pycairo-1.8.4/doc/reference/text.rst 2009-02-12 09:40:52.000000000 +0100 @@ -22,12 +22,69 @@ matrix are set with :meth:`Context.set_font_size` and :meth:`Context.set_font_matrix`. -*FontFace* cannot be instantiated directly, it is returned from -:meth:`Context.get_font_face` - There are various types of *FontFace*, depending on the font backend they use. +.. class:: FontFace() + + .. note:: This class cannot be instantiated directly, it is returned by :meth:`Context.get_font_face`. + + + +class ToyFontFace(:class:`FontFace`) +==================================== + +The *cairo.ToyFontFace* class can be used instead of :meth:`Context.select_font_face` to create a toy font independently of a context. + +.. class:: ToyFontFace(family, [slant[, weight]]) + + :param family: a font family name, encoded in UTF-8 + :type family: str + :param slant: the slant of the font, by default + :attr:`cairo.FONT_SLANT_NORMAL`. See :ref:`SLANT attributes + <mattributes_slant>` for details of the slant values available. + :param weight: the weight of the font, by default + :attr:`cairo.FONT_WEIGHT_NORMAL`. See :ref:`WEIGHT attributes + <mattributes_weight>` for details of the available weights. + :returns: a new *ToyFontFace* + + Creates a *ToyFontFace* from a triplet of family, slant, and weight. These + font faces are used in implementation of the the cairo_t "toy" font API. + + If family is the zero-length string "", the platform-specific default + family is assumed. The default family then can be queried using + :meth:`.get_family`. + + The :meth:`Context.select_font_face` method uses this to create font + faces. See that function for limitations of toy font faces. + + .. versionadded:: 1.8.4 + + .. method:: get_family() + + :returns: the family name + :rtype: str + + Gets the familly name of a toy font. + + .. versionadded:: 1.8.4 + + .. method:: get_slant() + + :returns: the slant value + + Gets the slant a toy font. + + .. versionadded:: 1.8.4 + + .. method:: get_weight() + + :returns: the weight value + + Gets the weight a toy font. + + .. versionadded:: 1.8.4 + class ScaledFont() ================== @@ -64,7 +121,7 @@ :returns: the :class:`FontFace` that this *ScaledFont* was created for. - Since: 1.2 + .. versionadded:: 1.2 .. method:: get_scale_matrix() @@ -74,7 +131,7 @@ with the scaled font, and hence is the matrix mapping from font space to device space. - Since: 1.8 + .. versionadded:: 1.8 .. method:: text_extents() @@ -96,7 +153,7 @@ trailing whitespace characters are likely to not affect the size of the rectangle, though they will affect the x_advance and y_advance values. - Since: 1.2 + .. versionadded:: 1.2 class FontOptions() diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pycairo-1.8.2/NEWS new/pycairo-1.8.4/NEWS --- old/pycairo-1.8.2/NEWS 2009-01-15 10:40:14.000000000 +0100 +++ new/pycairo-1.8.4/NEWS 2009-03-19 09:42:19.000000000 +0100 @@ -1,3 +1,30 @@ +Overview of changes from pycairo 1.8.2 to pycairo 1.8.4 +======================================================= +General Changes: + Pycairo 1.8.4 requires cairo 1.8.4 (or later) and Python 2.6 + +Bug Fixes: + 20674: Add get/set_extend for Gradient Patterns + +New Classes: + cairo.ToyFontFace + +New Methods: + Pattern.get_extend + Pattern.set_extend + ToyFontFace.get_family + ToyFontFace.get_slant + ToyFontFace.get_weight + +Deleted Methods: + SurfacePattern.get_extend + SurfacePattern.set_extend + +Other Changes: + Threading for surfaces with stream functions has been reenabled. + Documentation updates. + + Overview of changes from pycairo 1.8.0 to pycairo 1.8.2 ======================================================= diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pycairo-1.8.2/README new/pycairo-1.8.4/README --- old/pycairo-1.8.2/README 2009-01-15 10:35:22.000000000 +0100 +++ new/pycairo-1.8.4/README 2009-03-03 13:30:08.000000000 +0100 @@ -3,8 +3,8 @@ Dependencies ------------ - cairo >= 1.8.2 - Python >= 2.5 + cairo >= 1.8.4 + Python >= 2.6 Compiling --------- diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/pycairo-1.8.2/setup.py new/pycairo-1.8.4/setup.py --- old/pycairo-1.8.2/setup.py 2009-01-15 10:34:33.000000000 +0100 +++ new/pycairo-1.8.4/setup.py 2009-03-19 09:44:29.000000000 +0100 @@ -6,8 +6,8 @@ import subprocess import sys -pycairo_version = '1.8.2' -cairo_version_required = '1.8.2' +pycairo_version = '1.8.4' +cairo_version_required = '1.8.4' def call(command): pipe = subprocess.Popen(command, shell=True, @@ -32,8 +32,8 @@ return [x.lstrip(opt) for x in output.split()] -if sys.version_info < (2,5): - raise SystemExit('Error: Python >= 2.5 is required') +if sys.version_info < (2,6): + raise SystemExit('Error: Python >= 2.6 is required') pkg_config_version_check ('cairo', cairo_version_required) if sys.platform == 'win32': ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@Hilbert.suse.de