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

Steve stevech1097 at yahoo.com.au
Mon Sep 1 07:19:05 PDT 2008


On Thu, 2008-08-28 at 21:48 -0400, Owen Taylor wrote:
> 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
> 
It looks OK so I've applied the patch to CVS. It achieves quite a lot
for just a few lines of code.
Thanks,
Steve



More information about the cairo mailing list