On Fri, 2008-09-26 at 21:48 -0700, [EMAIL PROTECTED] wrote:
> Here is a start on an API for a "geometry" layer.  Right now, the API  
> includes polygons, hatching and some support functions.  I'd like to  
> get comments on the API including if any additional functions are  
> required.  If acceptable, I'd like to continue with implementation to  
> add support for the new path code.

Looks quite good.

Nits: (Please take them for what they are.. just nits, not criticism)

Source files are sorted alphabetically in the makefile, so don't add
m_geometry.c at the end of the list.

m_geometry_.... fees a bit long for a namespace. Keeping code using this
API on 80 lines will be awkward.. perhaps m_geom_... m_geo_...?

I'm always confused by function prototype ordering myself, but I wonder
if things like:

m_geometry_polygon_hatch ()

could become

m_geometry_hatch_polygon ()

I think the latter is more consistent with GLib / GTK naming. "hatch" is
a verb, not a type in its-self, so comes before the type it acts on.

E.g.: g_object_set_property () (not g_object_property_set)

If "hatch" were a structure in its own right, I'd go for something like:

m_geometry_hatch_from_polygon () etc..


Nits aside (and please remember, they are only nits!), I really like
where you're going with this.

It will allow me to get hatching working in gdk / cario, without vast
quantities of duplicated code. It will allow the printing code which
duplicates the definitions of hashing, to be simplified too. BIG WIN!

BTW.. I'd not suggest subdividning lines which are dashed etc.. (don't
think you have though). We can mimic the required effects with cairo /
postscript? stroking, and I'd leave the code to painfully draw each
dash, dot etc.. using GDK in place).


Kudos,

-- 
Peter Clifton

Electrical Engineering Division,
Engineering Department,
University of Cambridge,
9, JJ Thomson Avenue,
Cambridge
CB3 0FA

Tel: +44 (0)7729 980173 - (No signal in the lab!)



_______________________________________________
geda-dev mailing list
[email protected]
http://www.seul.org/cgi-bin/mailman/listinfo/geda-dev

Reply via email to