[gtkada] Cairo : Binding hints for cairo_image_surface_create_from_png_stream

Anne et Damien Carbonne aetdcarbonne at free.fr
Fri Sep 9 23:40:16 CEST 2011


Le 09/09/2011 14:34, David SAUVAGE - AdaLabs Ltd a écrit :
> Hi,
>
> As those cairo services [1] do not seem to be part of the current GTKAda
> bindings, I am trying to add them.
>
> I have a pain concerning cairo_image_surface_create_from_png_stream [2],
> as the cairo_read_func_t type seems to require in the Ada world a
> function that would have out parameter to be able to proceed a memory
> allocation for the data parameter [2] (thus, using an anonymous access
> type does not seems to be sufficient).
>
> Any tips that could help me achieve this in Ada using the current GNAT
> GPL 2011 is most welcome.
>
> Cheers,
>
> [1]
> cairo_surface_write_to_png_stream
> cairo_image_surface_create_from_png_stream
>
> http://cgit.freedesktop.org/cairo/tree/src/cairo.h
>
> [2]
> http://cairographics.org/manual/cairo-PNG-Support.html#cairo-image-surface-create-from-png-stream
>
>
Hi,

You may have a look at the CairoAda binding 
(http://sourceforge.net/projects/cairoada/) I created to see how I 
handled this case. This binding is normally complete.
I think one main difference with the AdaCore version is that I tried to 
hide all functions related to reference counts. They are automatically 
handled.

Regards,
Damien



More information about the gtkada mailing list