Bug 3441

Summary: Allow PycairoContext_FromContext to instantiate subclasses of cairo.Context
Product: pycairo Reporter: Gustavo J. A. M. Carneiro <gjc>
Component: generalAssignee: Steve Chaplin <d74n5pohf9>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: high    
Version: unspecified   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: patch

Description Gustavo J. A. M. Carneiro 2005-05-31 14:10:12 UTC
I'd like to follow Owen's suggestion in some mailing list I don't remember of
using inheritance to represent cairo contexts enhanced with some more methods,
some provided by pango, some by gdk.  Thus we would have the following
inheritance chain:

  cairo.Context <--- pango.CairoContext <--- gtk.gdk.CairoContext

To help support this goal, it would be nice to allow PycairoContext_FromContext
to create all these objects, by receiving the type of cairo context to create as
argument.
Comment 1 Gustavo J. A. M. Carneiro 2005-05-31 14:10:30 UTC
Created attachment 2803 [details] [review]
patch
Comment 2 Steve Chaplin 2005-06-01 05:44:25 UTC
The patch has been applied, I changed the type to parameter 2 since I think the
type is more important that the base object which is optional.
I also added a type parameter to PycairoSurface_FromSurface since it allows the
removal of 4 other subclass constructor functions and a simplified C API.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.