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

Jim Gettys Jim.Gettys at hp.com
Thu Feb 17 05:14:50 PST 2005


On Wed, 2005-02-16 at 12:32 -0800, Bill Spitzak wrote:
> 
> Keith Packard wrote:
> > Around 18 o'clock on Feb 15, Carl Worth wrote:
> > 
> > 
> >>Having both "get" and "current" would require also explaining why in
> >>the documentation, and I think this just makes things harder, not
> >>easier, to understand.
> > 
> > 
> > Ok, I'll buy in.  In Xlib, there are 'Get' functions and 'Query' functions 
> > along with 'Destroy' and 'Free' functions, both sets prove a constant 
> > source of confusion.
> > 
> > I think the rule here is that synonyms have no place in the API.
> 
> A similar confusion from Xlib is whether a function takes a GC, Window, 
> Visual, VisualID, Colormap, Screen, or something else as an argument. 
> This needlessly exposes internal implemenation details. If every call 
> only took a GC it would be a lot easier to deal with and it might be 
> possible to create an Xlib program without keeping the reference manual 
> next to you.

Yes, we'd probably do it this way if we got to do X over again...  At
least Cairo hides this from the end user...

20-20 hindsight is always perfect.
				- Jim





More information about the cairo mailing list