Cairo - some questions

BlitzMax Forums/Brucey's Modules/Cairo - some questions

Difference(Posted 2009) [#1]
Hi Brucey, or anybody who can answer these.
4 questions, if you can spare the time.

1)
Can Cairo draw directly to the backbuffer, or do one always need an image?
For large dynamicly changing stuff, it would be nice to just use the backbuffer.

2)
I was looking into using libSVG, but don't how to load and draw SVG with transparent background onto the BlitzMax backbuffer. Can that be done?

3)
Can I use an XML file from memory (libXML or sting) so that I can change attributes in the SVG before loading them? I'd amongst other things like to change the fill color on certain elements.

Please note that the SVG questions are not to relevant if the answer to the 4th question is no, because then I'm going to have to drop using libSVG due to the licence.

4)
Does LGPL 2 allow static linking without sharing the source?


Brucey(Posted 2009) [#2]
1) No. Unless one uses the "glitz" backend, which allows Cairo to render directly via OpenGL calls. However, glitz is completely undocumented and there are very few simple examples of usage anywhere (bet you can't guess I've looked into this one before!)

4) No. However, I could probably fudge a dll/so/dylib build of libsvg if need be. However, it seems libsvg is no longer supported, and now librsvg is the preferred choice of SVG support with Cairo these days. It too is LGPL, but requires some other libs (like libart) to function... making it a bit bulky.
libsvg's SVG support is ... okay... but it struggles on gradients and other things.


Licenses are annoying, eh?
I've always tried to stay away from LGPL... but if I can get the source compiling as I need it, I've occasionally gone with the "you'll need to include this dll" line, for the module (one example is the recent RTL module, where the library is LGPL).


Difference(Posted 2009) [#3]
Thanks for answering.

Yes, that license stuff is so annoying!

GPL I understand, but the static linking exception on LGPL is nothing but an inconvenience.
I'm just realizing that Cairo is LGPL too, and that the other licence option for Cairo, MPL, has the classic GPL source restriction too.


Difference(Posted 2009) [#4]
...though Cairo may be okay without source under MPL: (from http://www.mozilla.org/MPL/mpl-faq.html ) ?

How 'viral' is the MPL? If I use MPLed code in my proprietary application, will I have to give all the source code away?

The MPL has a limited amount of 'copyleft' - more copyleft than the BSD family of licenses, which have no copyleft at all, but less than the LGPL or the GPL. It is based around the definition of a 'Modification' in the license [1.9].

What is a Modification? Any changes to MPLed files, or new files into which MPLed code has been copied, are Modifications and so fall under the MPL. New files containing only your code are not Modifications, and not covered by the MPL.

Files which fall under the MPL because they are or contain Modifications must be made available as detailed in the license (or elsewhere in this FAQ.) Other files may be kept proprietary.

One well-known example of this is the Netscape-branded browser. It contains (and Netscape makes source code available for) many files from the Mozilla project, which are under the MPL. But it also contains proprietary code, for example to integrate with the AOL Instant Messenger service.




Brucey(Posted 2009) [#5]
There are no modifications to the Cairo source used in the module. Used as is, so I believe it is fine under the terms of the MPL.
Since Cairo is multi-licensable I chose the least restrictive under which to release the module.

wxWidgets is also LGPL, but with an exception to allow static linking - otherwise I don't think it would be as popular in general.


Difference(Posted 2009) [#6]
Great. Thanks for clearing that up.