[cairo] [patch] pycairo: support for unknown surface and pattern types

Owen Taylor otaylor at redhat.com
Thu Aug 28 18:48:19 PDT 2008


The attached patch makes pycairo create a generic proxy of the base type
if it doesn't know the specific type of a surface.

Where I wanted this was to call cr.get_target() and then pass the result
to matplotlib ... I didn't care what type of surface it was, but I
needed it to be wrapped in Python.

The particular surface type that was problematic was a Quartz surface,
so adding Quartz support along the lines of:

http://lists.freedesktop.org/archives/cairo/2007-November/012032.html

Would also fix my problem, but this patch is simple and I believe
correct on principle and increases robustness against future changes:
there is no reason not to let the user manipulate a surface or pattern
generically even if we don't know the specific subclass.

- Owen

-------------- next part --------------
A non-text attachment was scrubbed...
Name: pycairo-unknown-surface-pattern.patch
Type: text/x-patch
Size: 1097 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20080828/b13a6273/attachment.bin 


More information about the cairo mailing list