Re: Using Cairo from introspected GTK3



On Fri, Dec 2, 2011 at 11:14, Conscious User <conscioususer gmail com> wrote:
> Em 02-12-2011 07:51, Tomeu Vizoso escreveu:
>
>> Actually, Cairo isn't a GObject library so it's not accessible using
>> introspection. What we have is a typelib that allows Cairo classes to
>> be mentioned in other typelibs, marked as "foreign" to denote that the
>> actual bindings are somewhere else:
>>
>>
>> http://git.gnome.org/browse/gobject-introspection/tree/gir/cairo-1.0.gir.in
>>
>> In this case, I think PyGObject just lacks the glue code that allows
>> it to pass the statically-wrapped cairo.Pattern to introspected
>> methods, it should be done in a similar way to what we do now with
>> Context and Surface:
>>
>> http://git.gnome.org/browse/pygobject/tree/gi/pygi-foreign-cairo.c#n127
>>
>> Should be pretty easy to write a patch that adds this support. If this
>> is your first time, this link may help:
>>
>> https://live.gnome.org/GnomeLove/SubmittingPatches
>
>
> That does not seem difficult, I'll take a look. Thanks!
>
> Seems like registering Pattern and Region would cover Gtk use cases.
>
> One question, though: is it enough to register base classes like
> cairo.Pattern or should I register the entire hierarchy?
> (SolidPattern, SurfacePattern, Gradient...)

Not sure, sorry, I would start with Pattern and see if anything else is needed.

Good luck,

Tomeu

>> Regards,
>>
>> Tomeu


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]