On Wed, 01 Aug 2007 18:07:07 +1200 Klaas Hartmann <[EMAIL PROTECTED]> wrote:
Hi, > Thanks for your tip it worked well. Here is the diff for implementing the > remaining useful functions in wxGraphicsContext, Path and Matrix. I have not > yet fully tested these, but everything I've tested so far has worked. > > I had to add a few bits and pieces around the place for handling the static > function overloading and for constructing a wxPoint2DDouble from a SV*. I > have not implemented wxPoint2DDouble (it contains just an x,y co-ordinate). I decided to change the overload dispatch macros from _STATIC to _FUNCTION, because thei might also be used to dispatch functions as well as C++-static-methods-mapped-as-Perl-package-functions. I have applied the patch, but I see some (easily fixed) issues: - where you use wxPli_av_2_wxPoint2DDouble, you must free the allocated array (like in wxDC::DrawPolygon). - MIN(n,wxPli_av_2_wxPoint2DDouble(aTHX_ endPoints, &endPoints2d)) I do not think MIN is a standard macro; and being a macro, it evaluates wxPli_av_2_wxPoint2DDouble twice; you can use the wxMin macro (but the caveat about double-evaluation still applies) - #including <wx/graphics.h> outside #if wxUSE_GRAPHICS_CONTEXT breaks compilation with old wxWidgets versions (fixed in SVN) > There are three functions that require a wxPoint2DDouble (the rest have > overloaded alternatives) and these require an array of points. The perl > interface I have used here uses an array ref of points instead. These are of > the format [x1,y1,x2,y2,x3,y3]. Let me know what you think of this approach, > it is easy enough to change -- before anyone other than me starts using it! I'd rather have the array be of the form [ $p1, $p2, $p3 ] where $px is a [$x, $y] array (or a point object). I believe it is more common to have an array of points rather than a flat list. It's also consistent with other wxWidgets/wxPerl functions. Thanks! Mattia
