[cairo] API Shapeup, setters and getters consistency, get vs current

Owen Taylor otaylor at redhat.com
Tue Feb 15 15:13:34 PST 2005


On Tue, 2005-02-15 at 17:38 -0500, Keith Packard wrote:
> Around 17 o'clock on Feb 15, Carl Worth wrote:
> 
> > And besides, even if I'm not a fan of abbreviation, I do like shorter
> > names when they are equally clear. So I propose "get" everywhere
> > instead of "current".
> 
> Does that eliminate the distinction between accessors for values which are 
> in the gstate and values which are not?  I like that particular 
> distinction as it re-enforces what the gstate consists of right in the API 
> itself.

The thing is - is it useful for the user to be able to reverse
engineer:

 whether the line cap is saved by cairo_save()

By:

 whether it is cairo_current_line_cap() or cairo_get_line_cap()

I don't think the getters are common enough that the user will know
them by heart and use that to predict the behavior of cairo_save().
Rather, they'll just have to guess/look them up when they want
to call them, which is vaguely annoying.

(And a problem if language binding wants to map them to properties.)

Regards,
						Owen





More information about the cairo mailing list