[cairo] Separating Cairo from stdio.h

Keith Packard keithp at keithp.com
Mon Nov 1 12:11:52 PST 2004


Around 9 o'clock on Nov 1, Ned Konz wrote:

> Looking at the code in cairo_ps_surface.c, I see that the file is indeed a 
> pure, non-seekable stream.

The postscript backend exists largely to demonstrate that it is possible to
build a printer backend for cairo, so conclusions based on the code
represent a transient reality at best.

However, I would prefer to avoid creating a new file abstraction unless 
there are significant platforms for which the standard C library cannot be 
used.

> In cairo_png_surface.c I see that the file is just being passed to libpng, 
> which lets its users use other I/O routines at runtime using 
> png_set_???_fn(), and also lets you compile libpng using the PNG_NO_STDIO 
> define and just create PNG structures in buffers.

In this case, exposing the functionality of the PNG library does seem like 
a reasonable request.  If there is an abstract PNG object which can 
represent the stream, we could create a lower-level cairo API that plugged 
in there instead of at the FILE level.

Naming, as always, would probably be the hardest part of this particular change.

-keith


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20041101/323d3e98/attachment.pgp


More information about the cairo mailing list