[gtkada] Gdk.Pixbuf patch - inline data

Jeffrey Creem jeff at thecreems.com
Tue Jan 18 13:32:27 CET 2005


>
> I do not see why this is easier (actually it looks more complicated
> to me) than doing:
>
>   Pixbuf : Chars_Ptr_Array (1 .. 0);
>   pragma Import (C, arrow_xpm, "arrow_xpm");
>   --  Actual bounds are maintained by the C code directly, and is
>
> And then pass Pixbuf as a parameter to the gdk_pixbuf_new_from_data 
> function.
>

Ok I really did not find it more complicated and would still argue that the 
single character
approach is easier....But..Clearly once one is aware of the null slice 
approach you
ptovided, this added complexity is trivial and it has the advantage of 
allowing for a future native
Ada inline.  I had not considered that it was possible to import a null 
slice.. I like it and I'll change it
to something like that.


> You could even I guess see whethere the array passed has empty bound or
> not to pass -1 or 'Length to the C function, although I tried to find the
> gdk_pixbuf_new_from_data or gdk_pixbuf_new_from_inline functions and 
> failed
> to find any of them in Gtk+ 2.2 or 2.4, so could you clarify where
> this function is defined ? If it is only defined in Gtk+ 2.6, then there's
> also the issue of making GtkAda compatible with Gtk+ 2.6 only, which is
> probably a little bit early at this stage.


Hmm...Well first off I am (currently) building/testing this in win32 so the 
symbol is certainly already present in the Gtk+
.dlls that are included in GtkAda-2.4 for win32.

Also previously this symbol  gdk_pixbuf_new_from_inline was explictly 
mentioned as "missing" in the
spec of gdk-pixbuf.ads so it was known at the time that that file was last 
touched.

It is not listed as a symbol that was added in 2.6 or 2.4 (or even 2.2) for 
that matter in the
gtk documentatiom so it certainly seems like it has been there for a while.

I am not sure how to pin down exactly what version it showed up in but it 
certainly seems safe to include to me.


I'll rework the patch tonight based on your other comment. 




More information about the gtkada mailing list