[cairo] Cleaning up the PDF API

Carl Worth cworth at redhat.com
Tue May 17 05:06:13 PDT 2005


On Tue, 17 May 2005 07:56:51 -0400, Owen Taylor wrote:
> So, you disagree with the idea that a language binding should
> be able to implement cairo_pdf_surface_create(filename...)
> in terms of its native IO implementation and 
> cairo_pdf_surface_create_for_stream()?

Not at all. As I said earlier in the thread, that seems like a useful
thing to do as I said above (see quote below).

It just doesn't seem like it's asking a lot to have the binding author
clean up from this style of cairo_pdf_surface_create in
cairo_surface_finish.

It doesn't seem to qualify for the test you proposed of forcing the
binding author to understand complex interdependencies in order to get
a correct binding.

-Carl

On Mon, 16 May 2005 21:22:19 -0700, Carl Worth wrote
> > > On Mon, 16 May 2005 19:23:42 -0400, Owen Taylor wrote:
> >  
> > I think it makes sense for language bindings to implement the
> > filename version using the stream API, so they get native IO
> > errors.
> 
> That seems like a perfectly legitimate thing for a binding author to
> do. But that's also a very straightforward situation. If the binding
> author opens a file in cairo_pdf_surface_create, then obviously, the
> author also needs to close it. Doing so in cairo_surface_finish is
> very straightforward. The interaction between cairo functions that the
> binding author has to understand is not complex. The extra data needed
> can be stored in user_data or in some binding-specific wrapper. AND,
> this case doesn't even show up in a more strict one-to-one binding
> approach that you also advocated.
-------------- 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/20050517/8a012b34/attachment.pgp


More information about the cairo mailing list