[cairo] Cairo on win32

Hans Breuer Hans at Breuer.org
Sun May 30 14:20:29 PDT 2004

At 01:53 29.05.04, Maarten Breddels wrote:
>Hans Breuer wrote:
> >At 23:07 26.05.04, Maarten Breddels wrote:


> >>cairo_win32_surface.c implements a simple surface for displaying on a
> >>window, usefull for playing around with cairo on windows.
> >>
> >>
> >In my mind the Cairo Win32 Surface was always based on a Device Context - a
> >HDC in win32 api parlance. Having a Window Creation within Cairo is sure
> >useful to have something visible, but finally the window creation and event
> >handling needs to be outside of Cairo to make it fit with the next level -
> >being either a toolkit or an application.
> >
> >Using a Device Context would also allow Cairo to not only draw on windows
> >and memory backends but also to be bound to a printer (driver). On could
> >even use
> >a metafile DC got from CreateEnhMetaFile(() and let the update be done by
> >PlayEnhMetaFile(). See dia/plug-ins/wmf/wmf.cpp for all those nice things
> >being doable with metafiles ;-)
> >
> >
> >
>Well, the win32 backend was really not meant to be generic, I just like
>it when you can get graphical output with just a few lines of code.
>Maybe it's a good idea to make at least 2 backends for win32.
>cairo_win32window_surface_backend and cairo_win32gdi_surface_backend.
>One for a quick result non-generic as it can be, the other more generic
>with bells and whistles. Do you think it's a good idea?

Not really, to get on 'quick results' just another whistle was needed :-)
There is an all new win32 backend available almost as described above.
One of it's targets is CAIRO_WIN32_TARGET_CLIPBOARD, which allows to get on 
the rendered image in almost any program you like. And there is a simple 
viewer for it include in windoze, the clipboard viewer.

The patch is available here :
cause it is rather huge (62k) - at least for a mailing list.

The suggested ChangeLog entry is duplicated here :

2004-05-30  Hans Breuer  <hans at breuer.org>

         * cairo/src/cairo.c : s/CAIRO_CHECK_SANITY 
         At least the msvc compiler does not like stray semicolons

         * cairo/src/makefile.msc cairo/src/libcairo.def : allow to build
         cairo with Micro$oft toolchain

         * cairo/src/cairo_png_surface.c : use setjmp(png->jmpbuf)

         * cairo/src/cairo_win32_surface.c : cairo backend based on enhanced
         metafiles. Can render to file, clipboard and a HWND, the latter
         untested. Currently text is based on 'bitmapped glyphs' provided
         by the Freetype2 font backend.
         * cairo/src/cairo.h : added cairo_win32_surface_create() and
         cairo_set_target_win32 under CAIRO_HAS_WIN32_SURFACE
         * cairo/src/cairo-features.h.in : added WIN32_SURFACE_FEATURE

-------- 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