[cairo] mesh APi naming (was: cairo snapshot 1.11.2 now available)

Andrea Canciani ranma42 at gmail.com
Thu Feb 3 14:19:21 PST 2011


On Fri, Jan 28, 2011 at 1:10 PM, Carl Worth <cworth at cworth.org> wrote:
> On Fri, 28 Jan 2011 07:43:57 +0100, Benjamin Otte <otte at redhat.com> wrote:
>> Yeah, I think that was a mistake in retrospect. It works very well if
>> you only intend to have 3 different pattern types and don't do a real
>> object system - like the situation was when Carl created the universe.
>> But now where we get mesh patterns and are still thinking about more
>> pattern types (like blur filters etc), I think it makes sense to apply
>> the same naming we do for the other "real" objects: surfaces.
>> And that's cairo_foo_surface_get_bar(). So I'm thinking
>> cairo_foo_pattern_get_bar() is the right thing to do.
>
> Yes, fair enough.
>
> If we're going to have a getter like _get_patch_count that will work on
> "mesh patterns" but not on other types of patterns, then it really would
> be more consistent with the cairo API naming for that to be:
>
>        cairo_mesh_pattern_get_patch_count
>
> I think my earlier comment about liking the function name without "mesh"
> at all was only in preference to the version with cairo_pattern_mesh
> which is backwards.
>
> So cairo_mesh_pattern_get_patch_count (and friends) should satisfy the
> original point Behdad made about the functions needing to be
> namespace-restricted to mesh patterns, and should do it in a way that's
> consistent with the rest of the cairo API naming conventions.

The consensus seems to be that cairo_mesh_pattern_... is the best
naming. The attachment updates the documentation, the code and
the tests to use this naming.

Andrea
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-mesh-Rename-cairo_pattern_mesh_-functions-to-cairo_m.patch
Type: application/octet-stream
Size: 53650 bytes
Desc: not available
URL: <http://lists.cairographics.org/archives/cairo/attachments/20110203/16e1860e/attachment-0001.obj>


More information about the cairo mailing list