I have updated the API's to support x/y 'spread' and points, as suggested by 
Frank.

The general rule is '-*' a the end of a function indicates that the function 
takes a parameter spread of x/y or x/y/w/h.

I chose the '-*' to indicate a spread as emacs will expand "d-l" to draw-line, 
and "d-l-" to draw-line-* . I dislike having to shift-8 to get a *.

For example:

draw-line X0 Y0 X1 Y1
draw-line-* POINT

draw-rectangle RECTANGLE
draw-rectangle-* X Y W H

I have also added generic methods that act on points, rectangles and surfaces:

(defgeneric point-* (obj))
(defgeneric set-point (obj point))
(defgeneric set-point-* (obj &key x y))

(defgeneric position-* (obj))
(defgeneric set-position (dst src))
(defgeneric set-position-* (obj &key x y))

(defgeneric rectangle-* (rectangle))
(defgeneric set-rectangle (rectangle position))
(defgeneric set-rectangle-* (rectangle &key x y w h))

(defgeneric set-surface (surface position))
(defgeneric set-surface-* (surface &key x y))

"point-*", "position-*" and "rectangle-*" return separate x/y or x/y/w/h 
parameters for the object using VALUES.

I think the API is becoming more consistent, which is good.

There are a couple of inconsistencies that remain, for example some functions 
take keyword parameters and others do not:

(RECTANGLE :x x :y y :w w :h h) , and 
(set-rectangle-* x y w h)

And some API's take ":FREE t" and others ":FREE-P t" to free a surface.

- Luke

_______________________________________________
application-builder mailing list
application-builder@lispniks.com
http://www.lispniks.com/mailman/listinfo/application-builder

Reply via email to