[cairo] Cairo and GdiPlus or two win32 backends

Hans Breuer hans at breuer.org
Sat Jan 15 14:20:45 PST 2005


Since 2004-11-12 there is code for a GDI+ backend in cairo
cvs but it isn't referenced anywhere (i.e. unusable) and
as Stuart already pointed out: to even make it compile
some change to cairoint.h is needed to use it from C++
(shouldn't use the operator keyword as parameter name). [1]

This has nothing to do with compiling .c files as C++ but just with
having the ability to write cairo backends in C++.
BTW: It gave very nice and easy to decipher error messages ;) :

         cl -G5 -Zi -MD -W3 [...] -DHAVE_CONFIG_H -DWIN32 
-DVERSION=\"0.2.0\"  -GD -c  cairo_gdip_surface.cpp
cairo_gdip_surface.cpp
cairoint.h(482) : error C2629: unexpected 'enum cairo_status ('
cairoint.h(482) : error C2238: unexpected token(s) preceding ';'


As there still seems to be no consensus if a Cairo/win32 backend
should be implemented on top of GDI+ or GDI I've modified the GDI+
backend to build side by side with my plain GDI backend.

Also the patch available since 2004-05-30 [1] - pending since
about half a year [3] - is updated to cleanly apply to current
cvs. See: http://hans.breuer.org/dia/cairo-2005-01-15-hb.diff

I still use msvc exclusively on windoze but from my experience it
should be really simple to integrate this patch (at least the
plain C/plain GDI part) with a mingw build - given that one
understands the auto-magic at all.

Current limitations of the plain win32/GDI backend (and other
backends as well as Cairo itself) are shown at my Dia/Cairo
page http://hans.breuer.org/dia/dia-cairo.htm

In short the text rendering is still limited (glyphs rendered
via Freetype/bitmaps) and no antialising at all. But my GDI
backend shares some of these limitations with the PDF and
- judging from the code - also the GdiPlus backend. Or the
latter two don't do text at all yet.
Maybe all these backends are waiting for improvements in
the backend interface ?

	Hans

1 http://lists.freedesktop.org/archives/cairo/2004-December/002436.html
2 http://lists.freedesktop.org/archives/cairo/2004-May/001519.html
3 http://lists.freedesktop.org/archives/cairo/2004-July/001581.html

-------- Hans "at" Breuer "dot" Org -----------
Tell me what you need, and I'll tell you how to
get along without it.                -- Dilbert



More information about the cairo mailing list