Tor,<br>&nbsp;&nbsp;&nbsp;&nbsp; Would delay loading the dependent DLLs work? <br><br><a href="http://msdn2.microsoft.com/en-us/library/151kt790(VS.80).aspx">http://msdn2.microsoft.com/en-us/library/151kt790(VS.80).aspx</a><br><br>Thanks,<br>
Jonathan<br><br><div><span class="gmail_quote">On 8/15/07, <b class="gmail_sendername">Tor Lillqvist</b> &lt;<a href="mailto:tml@iki.fi">tml@iki.fi</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
One thing related to cairo bindings especially for non-interpretd<br>languages, is this: How should such bindings handle backend-specific<br>cairo functions?<br><br>I guess this is not a problem on Linux because presumably distros tend
<br>to build cairo with all possible backends, as the dependencies<br>required by them are all present anyway on typical installations, and<br>if not, handled sensibly by package management anyway.<br><br>But on Windows it is a real problem. There is no package
<br>management. In general one should try to minimize the number of<br>dependencies a 3rd-party library has.<br><br>For instance the cairo DLL I distribute for use with GTK+ doesn&#39;t have<br>the FreeType font backend included, because there is no need for that
<br>with GTK+. Including it would mean introducing a run-time dependency<br>on freetype and fontconfig.<br><br>(Note that dependent DLLs *have* to be present at run-time on<br>Windows. As far as I recall, this is unlike ELF-based systems, where
<br>they need only be present if symbols from them are actually referenced<br>at run-time.)<br><br>I also build and distribute another cairo DLL that doesn&#39;t include<br>even the SVG, PDF and PS backends. I still use the same DLL name
<br>(i.e. &quot;soname&quot; in ELF terminology) for it, because in other respects<br>it is binary compatible. (I.e. an app that uses only the Win32 backend<br>functions is able to run as well against a cairo DLL that also include
<br>other backends.)<br><br>I don&#39;t know how much this win32-only cairo DLL actually gets used.<br>(IIRC I started building it on explicit request from somebody.)&nbsp;&nbsp;For<br>some app that wants to use from cairo just the Win32 surface and font
<br>backends, it should be enough. (GTK+ needs the PDF stuff because of<br>its printing support.)<br><br>So what has this got to do with bindings? Well, a binding can&#39;t know<br>what backends happen to be compiled in to the cairo shared object
<br>present on a certain end-user system. I think the cairomm bindings,<br>for instance, *require* that the FreeType font backends are<br>present. Thus people who want to use cairomm on Windows can&#39;t use my<br>build of cairo.
<br><br>For interpreted languages I guess this is not necessarily a problem as<br>the binding can check at run-time whether a specific function is<br>present or not. But for compiled language bindings like cairomm it can<br>
be a problem.<br><br>I thus suggest that the public functions from the optional backends<br>should be always present in the cairo binary, but in such a form that<br>if the corresponding backend is not compiled in the functions would
<br>always return NULL, -1, or whatever appropriate kind of error<br>indication. The CAIRO_HAS_* feature test macros in the corresponding<br>cairo-features.h header should still correspond to reality.<br><br>I&#39;ll submit a patch later (unless you convince me this is not a good
<br>idea after all).<br><br>--tml<br>_______________________________________________<br>cairo mailing list<br><a href="mailto:cairo@cairographics.org">cairo@cairographics.org</a><br><a href="http://lists.cairographics.org/mailman/listinfo/cairo">
http://lists.cairographics.org/mailman/listinfo/cairo</a><br></blockquote></div><br>