Bug 3441 - Allow PycairoContext_FromContext to instantiate subclasses of cairo.Context
Summary: Allow PycairoContext_FromContext to instantiate subclasses of cairo.Context
Status: RESOLVED FIXED
Alias: None
Product: pycairo
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: high normal
Assignee: Steve Chaplin
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-31 14:10 UTC by Gustavo J. A. M. Carneiro
Modified: 2005-05-31 12:44 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
patch (3.98 KB, patch)
2005-05-31 14:10 UTC, Gustavo J. A. M. Carneiro
Details | Splinter Review

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.