[cairo] Re: pycairo: set_pattern currently disabled

Steve Chaplin stevech1097 at yahoo.com.au
Thu Nov 4 00:37:52 PST 2004


On Thu, 2004-11-04 at 01:55, cairo-request at cairographics.org wrote:
> Message: 3
> Date: Tue, 02 Nov 2004 21:43:54 -0500
> From: Carl Worth <cworth at cworth.org>
> Subject: [cairo] pycairo: set_pattern currently disabled
> To: cairo at cairographics.org
> Message-ID: <E1CPB7q-0007P6-00 at chootrain.carl.worth>
> 
> As I was recently updating the pycairo bindings I noticed that the
> binding for cairo_set_pattern had not been updated since the change from
> accepting a cairo_surface_t* to a cairo_pattern_t*.
> 
> I imagine it would be an easy fix for someone familiar with making
> python bindings to a C library.
> 
> I'm not such a person, so I've disabled the broken function for now.
> 
> -Carl

Here's a patch to get cairo_set_pattern() working again.
It was a bit more involved than simply wrapping one function. It
involved creating a new Python type, similar to existing Surface type.
 Patched files:
  cairomodule.c
  Makefile.am
  pycairo.h
  pycairo-private.h
  examples/cairo-knockout.py - fixed a few problems to get it working
again

 New file: pycairo-pattern.c
 Demo program : gradient.py - example usage of patterns

Steve

-------------- next part --------------
A non-text attachment was scrubbed...
Name: patchfile
Type: text/x-patch
Size: 8110 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20041104/e7c7dca0/patchfile.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pycairo-pattern.c
Type: text/x-csrc
Size: 5209 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20041104/e7c7dca0/pycairo-pattern.c
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gradient.py
Type: application/x-python
Size: 855 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20041104/e7c7dca0/gradient.bin


More information about the cairo mailing list