[cairo] Delphi/FreePascal Headers
acjgenius at earthlink.net
Sat Oct 16 18:46:58 PDT 2004
Just to give a heads up, for a project I had to do recently I needed
access to cairo in Delphi, so I made some quick and dirty headers of
pixman, cairo, libsvg, and libsvg-cairo. I initially embedded them very
specifically in the project, but thought it might be easier to be able
to make a static build of all of the dlls required for distribution
reasons so I hacked up the headers separately to either link against all
libs, or against a single cairosystem.dll, or to dynamically load
all/single at runtime. For various reasons it doesn't have the funtions
available for any of the backends, not even png, though it would be
trivial to add them in.
I am not sure I like the way I did any of it, and because I didn't make
any perl scripts or anything to autogenerate them, keeping up with api
changes may be a pain, but its been what I needed so thats that.
I also started to work on OO wrappers for things, but didn't really get
past pixman as I wasn't sure what level of functionality should be
hidden from the user vs simply OO wrapers around actual functions, and a
few of the functions I couldn't completely make sense..
Just for good measure I modified them to work with freepascal, and added
headers to try and compile them with fpc 1.9.5 under linux macos and
windows, though I really only tested under windows. Also, probably needs
work to compile with kylix if its needed there.
I created a test Program using sdl to display resulting images in
delphi.. its quick dirty and really hackish as it was mostly just a few
of the png demos ported over with lots of pointless code for my initial
thoughts on OO'ing things. :)
I include the sdl headers I used, a cairosystem.dll and an sdl.dll, and
project for both lazarus and delphi.
an example resulting jpeg -
Andrew Johnson <acjgenius at earthlink.net>
More information about the cairo