PS/PDF API Change Proposal: (Re: [cairo] Semantics of transparent objects)

Alexander Larsson alexl at redhat.com
Wed Jan 18 11:31:53 PST 2006


On Wed, 2006-01-18 at 11:12 -0800, Keith Packard wrote:
> On Wed, 2006-01-18 at 09:37 -0800, Carl Worth wrote:
> 
> > I'm wondering if we can't just use cairo_t for these, and specify that
> > the time to set them is before any drawing operation on any given
> > page. That is, just after cairo_create or cairo_show_page, and before
> > any of cairo_stroke, cairo_fill, cairo_paint, cairo_mask,
> > cairo_show_text/glyphs on that page.
> 
> Seems like these are more likely associated with the surface and not the
> drawing state.
> 
> I see something like:
> 
> surface = cairo_ps_surface_create ();
> 
> while (more pages)
> {
> 	set page options (surface);
> 	draw_surface (surface);
> 	cr = cairo_create (surface);
> 	cairo_show_page (cr);
> 	cairo_destroy (cr);
> }
> 
> In this way, draw_surface is independent of the target, and only this
> outer loop "knows" about printing at all.

Yes, this looks right to me. It also matches the idea I have of the gtk+
print model in a recent mail[1] to gtk-devel-list, where you have the
print job code actually do the while loop, taking care of collation and
duplication, calling first a "get page settings" callback and then a
"render page" callback, passing a page nr and a cairo_t object.

[1] Not in archive yet, but i think it will be at:
http://mail.gnome.org/archives/gtk-devel-list/2006-January/msg00166.html

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl at redhat.com    alla at lysator.liu.se 
He's a Nobel prize-winning pirate cowboy on the run. She's a cold-hearted 
Buddhist snake charmer from a secret island of warrior women. They fight 
crime! 



More information about the cairo mailing list