[cairo] cairo_draw_with_xlib API

Carl Worth cworth at cworth.org
Fri Feb 24 12:56:59 PST 2006


On Fri, 24 Feb 2006 12:32:04 -0800, Carl Worth wrote:
>
> 	typedef struct _cairo_rectangles {
> 	    cairo_rectangle_t *rectangles;
> 	    int num_rectangles;
> 	} cairo_rectangles_t;

Err... that one needs to have the allocated size of rectangles in it
as well, (or else the user is going to have one heck of a time trying
to hold on to that size if a call to cairo_get_clip_as_rectangles ever
fills in less than there is space for already.

It's the first time we would be exporting something like this. The
style I've used internally would be to add a field named
rectangles_size field. But now, "size" suggests to me a size in bytes
than a maximum number of rectangles that can fit in the allocated
space. So I propose instead:

	typedef struct _cairo_rectangles {
	    cairo_rectangle_t *rectangles;
	    int max_rectangles;
	    int num_rectangles;
	} cairo_rectangles_t;

-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/d94c13c1/attachment.pgp


More information about the cairo mailing list