[cairo] Cairo backend for GNUstep

Fred Kiefer fredkiefer at gmx.de
Wed Sep 28 13:38:40 PDT 2005


About a month ago I did send a rather similar mail to this mailing list,
but as I wasn't member of this list, the mail never made it through:

Some of you may know that GNUstep (http:\\www.gnustep.org) is a free
implementation of the OpenStep API. An API formerly used by NeXT now
part of the Apple Cocoa interface.
A GNUstep backend is an implementation of the basic drawing methods,
used by GNUstep, for a specific environment. About a year ago Banlu
Kemiyatorn wrote a GNUstep backend based on cairo and as he didn't have
the time to maintain it, I took over this task. During the last few
weeks, I moved the GNUstep cairo backend over to the reworked cairo API
for release 1.0.

The drawing model used by GNUstep (and OpenStep) is similar to the
PostScript one. In most cases this fits fine with the way cairo does
things, but there are a few mismatches. The biggest one is the missing
cairo_copy() function. I followed the explenations in the mailing list
on why you think this function is not needed, but our case seems to be
different. GNUstep stores Gstates (normally one per window, but
more are possible) which later get reloaded. This isn't done with the
save/restore pattern, but based on names (or rather numbers). As cairo
doesn't provide this functionality I want to implement it via copies of
the current state and as cairo encapsulates the Gstate this needs to be
done on the cairo ct level. I tried to write my own copy function on a
higher level, but this is rather slow and misses some parameters. Making
the Gstate copy functionality available in the ct level would help a lot.

Another problem I was facing where access to some font functions. For
some reason I need (or rather I think I need) the two functions
_cairo_toy_font_face_create
_cairo_scaled_font_text_to_glyphs
They are declared as cairo_private, so they don't get exported for newer
releases of the build tools. I need them in a context, where there is no
ct available, as fonts in GNUstep have an independent existence. For
example, its possible to ask a font for the display width of a given
string, without providing a ct.

There are also some missing functionality in cairo, which is required
for GNUstep. For example there is no way to ask for the current RGB
value, even when a simple colour pattern gets used.

There are still more problems with the backend, but I expect them to be
caused by me not cairo. For example copying within the same gstate fails
for many cases (this is used to implement scrolling).

Cheers
Fred


More information about the cairo mailing list