[cairo] Updated ROADMAP for cairo 1.2.0 (and beyond)

Carl Worth cworth at cworth.org
Mon May 1 16:15:44 PDT 2006

On Tue, 02 May 2006 00:01:55 +0200, Emmanuel Pacaud wrote:
> What about:

It's looking pretty good. I'll suggest a couple tweaks.

> typedef enum {
> 	CAIRO_SVG_1_1,
> 	CAIRO_SVG_1_2
> } cairo_svg_version_t;

The names here should be have a prefix that includes the entire enum
label. For example, CAIRO_SVG_VERSION_1_1. That's the style for all
existing cairo enums.

> typedef stuct {
> 	cairo_svg_version_t id;
> 	char const *desc;
> } cairo_svg_version_info_t;
> cairo_svg_version_info_t * cairo_svg_surface_get_version_infos (void);

One thing that is missing here is a way to take a bare
cairo_svg_version_t and get the string representation of it. Using
cairo_status_to_string as a model, that would be:

cairo_public const char *
cairo_svg_version_to_string (cairo_svg_version_t version);

And once that's in place it would then be possible to do the query of
available versions without any additional data structure. As for the
list query itself, we don't really have a lot of list-returning
functions in cairo yet, (cairo_copy_path perhaps), but where we do
accept lists, (cairo_set_dash, cairo_show_glyphs (and similar), and
cairo_path_t), we do it with a pointer plus a length rather than a
NULL-terminated list. So maybe it would be:

cairo_public void
cairo_svg_get_versions (cairo_svg_version_t	**versions,
			int			**num_versions);

One thing that's a bit unique about this function is that it would be
the first instance of a backend-specific "cairo_foo" function rather
than a "cairo_foo_surface" function. But I think that's the right thing.

> cairo_surface_t * cairo_svg_surface_create (..., cairo_svg_version_t version_id);
> cairo_surface_t * cairo_svg_surface_create_for_stream (..., cairo_svg_version_t version_id);

I still like the idea of not requiring the user to pass a version here
if they really don't care. So we could leave this argument off the
create functions and add a new function:

/* ...
 * This function should only be called before any drawing operations
 * have been performed on the given surface. The simplest way to do
 * this is to call this function immediately after creating the
 * surface.
cairo_public void
cairo_svg_surface_restrict_to_version (cairo_surface_t		*surface,
				       cairo_svg_version_t	 version);

How does that look?

-------------- 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/20060501/43f80b1d/attachment.pgp

More information about the cairo mailing list