[gtkada] Cairo : Binding hints for cairo_image_surface_create_from_png_stream

David SAUVAGE - AdaLabs Ltd david.sauvage at adalabs.com
Sat Sep 17 12:45:25 CEST 2011


Le 10/09/2011 00:00, Nicolas Setton a écrit :
> Ah, sorry, I still don't understand why the Ada representation of this function
> would need an "out" parameter? I guess it would work if the parameter "data" is
> mapped to a Cairo.Image_Surface.Byte_Array_Access: I assume the right amount of
> data is allocated by cairo before calling read_func, and it isn't the user's job
> to allocate this memory? Unless I'm missing something?
>  
Hi Nicolas,

sorry for the late feedback,

yes, you are true, as it knowns the PNG format,
cairo_surface_write_to_png_stream take care of the memory allocations
concerning data, and guess the values of length every-time it calls the
cairo_read_func_t callback.
It work like a charm.
I used a Guchars_Ptr.Pointer type (gdk-property.adb:41) as the data type.

Cheers

David SAUVAGE

Software Agile Architect, Director
AdaLabs Ltd - Mauritius
http://adalabs.com
+230 428 18 32
skype sauvaged
BRN C10097052
VAT 27035043




More information about the gtkada mailing list