[cairo] Cleaning up the PDF API

Kristian Høgsberg krh at bitplanet.net
Mon May 16 19:55:48 PDT 2005


On Mon, 2005-05-16 at 16:59 -0700, Carl Worth wrote:
> On Mon, 16 May 2005 19:36:26 -0400, Kristian Høgsberg wrote:
> > Also, what are we trying to achieve here?  To reduce the number of
> > arguments or to make it easier to use?
> 
> Specifically, I want to unify the notion of a "stream" in the cairo
> API. Here's what we have right now:

OK, that's a worthy goal, and it did nag me a bit when I wrote the pdf
stream constructor that I couldn't get that.  The three functions differ
in the way they are used, as I described in the first part of my
previous email.  cairo_surface_write_to_png_stream() and
cairo_image_surface_create_from_png_surface() only use the stream for
the duration of the function call and the code to destroy the closure
will typically follow immediately after the call.

cairo_pdf_surface_create_for_stream() on the other hand, will use the
closure for a longer time, specifically, the created pdf surface will
continue to reference it and use it *after* the function call returns.

Kristian





More information about the cairo mailing list