[cairo] add solid/gradient pattern info getters
Carl Worth
cworth at cworth.org
Thu Sep 14 10:23:16 PDT 2006
On Thu, 14 Sep 2006 10:03:09 -0700, "Vladimir Vukicevic" wrote:
>
> Eh.. I'd still prefer the API I suggested, but I don't care enough
> about it to argue for it :) So, sure, though I'll probably do
> get_color_stop_count and get_color_stop_rgba.
Using "count" would be creating a new word for the API, (there's
nothing wrong with new words, but we should take some care in creating
them).
We've been using a num_<things> convention in the implementation quite
a bit, but that has mostly managed to avoid coming out in the API. It
does appear in one place, but not a function name, (the num_data
member of cairo_path_t). [We do also have similar "num_"-style naming
for for parameter names in several functions, but those names are
obviously not part of the API.]
The proposal above does have two advantages: the two related functions
sort next to each other, and we avoid having both "color_stop" and its
plural "color_stops" in the API.
Plural avoidance seems quite important, as made evident by a case like
dash and dashes. We're kinder if we can avoid forcing cairo API users
to memorize English pluralization rules. [It looks like so far we're
OK in this regard. The only plurals that I notice in the API,
(extents, metrics, and options), never appear in singular form.]
So I guess I'm coming down in favor of "_count" even though it will
take me some effort to get used to the new style, (and start changing
things in the implementation to go along with it).
-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/20060914/b28dcb0e/attachment-0001.pgp
More information about the cairo
mailing list