Support for metafile and printing

Since I have abandoned the idea of using the xprint extension
to let gdk users print using the gdk_draw_* stuff (the xp protocol
and library is a mess, you need a multi-display enabled gtk+) I'm
checking what is needed in gdk to let this happen (the intent is to
port the Xprint server backend).
This stuff is needed to support some sort of metafile, also:
I think we should add metafile support at the gdk level, not at
the GnomeCanvas/GtkCaanvas level (the format should be extensible,
so the canvas widgets would add their own specific feautures to
the base metafile sopported by gdk).
The things we need is the chance to read back from GdkFont and
GdkGC all the settings: this is actually not possible for the
font name in GdkFont and for the ClipMask in GdkGC.
The first is easy: just add a name field to GdkFont or to
The second is more tricky: we can set a mask with either a
pixmap, a rect or a region. In the end a region and a pixmap
is reduced to a list of rectangles, so we can store in the gc
an array of rectangles. The thing is the X window system
doesn't let us retreive the ClipMask.
The code to handle Region is in libX11, so the easiest hack is
to cast Region to _XRegion and access the field in there, but
this is not portable as Region is supposed to be an opaque type.
I plan to copy the region stuff and include it in gdk (this may
be useful for the win32 port as well).
The pixmap to list of rectangles stuff is handled by the xserver
and is a lot of code and a lot of overhead: we may copy the source
or let the result be undefined...

Any comments?


"The number of UNIX installations has grown to 10, with more expected."
    - _The UNIX Programmer's Manual_, Second Edition, June, 1972.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]