[cairo] surfaces and backends

Carl Worth cworth at redhat.com
Fri Feb 24 13:49:18 PST 2006


On Fri, 24 Feb 2006 14:59:06 -0500 (EST), Behdad Esfahbod wrote:
> 
> I don't like the hardcoding of backend-specific stuff in cairo.h.
> cairo does not export enough internals to allow implementing a
> backend out of tree I guess, but still I find the following
> approach more flexible:
> 
> typedef const char *CairoTypeID;
> 
> CairoTypeID cairo_surface_get_type (cairo_surface_t *surface);

Hmm... I went to implement this and found it really hard to
document. There's no available list to point at in the documentation
for what values can be expected to be returned by the function. The
destruction of the central list is the point of the approach, but it's
quite a defect when it comes to the documentation.

So, if we have to put the central list into the documentation, (I
can't come up with any alternative really), why don't we just put the
enum in cairo.h too?

As for out-of-tree backends, we can extend this type advertising as
needed when we allow those in the future.

-Carl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20060224/55e939a6/attachment.pgp


More information about the cairo mailing list