Re: GObject introspection for cairo
- From: "Jasper St. Pierre" <jstpierre mecheye net>
- To: Nicola Fontana <ntd entidi it>
- Cc: GTK Devel List <gtk-devel-list gnome org>
- Subject: Re: GObject introspection for cairo
- Date: Thu, 22 Jan 2015 09:50:00 -0800
Cairo-GObject provides access to enums, but it won't automatically get you great cairo bindings. It might actually get you 90% of the way there, though, and I'd be interested seeing how far you can run with just that, and be happy to merge patches that make it easier.
Why? cairo has a subtype system where you have subtypes of cairo_surface_t (e.g. cairo_image_surface_t) or cairo_pattern_t (e.g. cairo_gradient_pattern_t) where some objects have special methods. You determine which type this is by calling cairo_surface_get_type(); and matching it against a closed enum (cairo_surface_type_t).
It might be enough to do 90% of the work with GObject-Introspection and write some small by-hand functions when you need to "cast" to a specific type in your binding, but you do always need some small native glue code that calls cairo_surface_get_type();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]