[wx-dev] wxRealRect implementation

Martin Ettl orbitcowboy at web.de
Wed Apr 23 05:35:19 PDT 2008


Hey @ all,

here is a template implementation (see attachment) of wxPoint<T>,wxSize<T> =
and wxRect<T> including a Linux makefile and a testapplication (not all fun=
ctions are tested, because of lack of time ... )

To my mind it is quite simple to merge this classes to the current branch..=
..

Regards

Martin


> -----Urspr=FCngliche Nachricht-----
> Von: wx-dev at lists.wxwidgets.org
> Gesendet: 23.04.08 13:45:25
> An: wx-dev at lists.wxwidgets.org
> Betreff: Re[4]: [wx-dev] wxRealRect implementation


> On Wed, 23 Apr 2008 10:22:15 +0200 Laurent Humbertclaude <laurent.humbert=
claude at gmail.com> wrote:
> =

> LH> Is it ok to use templates in a low level class like wxPoint, or event=
 wxSize ?
> LH> Rule number One of the guideline is: Don't use C++ templates. I assum=
e this
> LH> is ok to break rules as wxString already does in trunk.
> =

>  Yes, the guidelines are out of date. The new template-related guideline =
is
> "Use templates but carefully and always check compilation with VC6".
> =

> LH> - I am not sure if we want to merge wxPoint and wxPoint2DInt:
> LH> the wxPoint2DInt and wxPoint2DDouble are more a 2D vector than a poin=
t.
> =

>  OTOH does it really make sense to have 2 different classes with so simil=
ar
> names?
> =

> LH> - On a more basic level, I have no clue of where to put the
> LH> WXDLLIMPEXP_CORE macro.
> =

>  In the class declaration. But if all class methods are inline (which will
> be the case for the template), you don't need it at all.
> =

> LH> Is a typedef class exported ?
> =

>  You don't need WXDLLIMPEXP_CORE in the typedef.
> =

> LH> This will break ABI? ( do we care ?)
> =

>  It will break the ABI but this change is for the trunk only anyhow so we
> don't care.
> =

> =

> LH> - What is the best solution for wxPoint<T>::operator=3D=3D ?
> LH> We need a specialized version for double (and float) that calls wxIsS=
ameDouble()
> LH> or we can change
> LH>   bool wxIsSameDouble(double x, double y)
> LH> to
> LH>   bool wxIsSame(double x, double y)
> LH>   bool wxIsSame(int x, int y) { //nop }
> LH> or also to
> LH>   bool wxIsSame<T>(T x, T y)
> LH> with a specialized version for double.
> =

>  I think it's ok to have template wxIsSame(T, T).
> =

> LH> ps : Ok, re-reading myself, I found some answers in wx/string.h
> LH>  like WXDLLIMPEXP_BASE, and I am afraid that it will be more complica=
ted
> LH> than I was thinking initialy to get a cross compiler version working.
> =

>  I don't really know what did you find to frighten you so much (there are=
 a
> lot of candidates in wx/string.h :-) but WXDLLIMPEXP_BASE is the same as
> WXDLLIMPEXP_CORE except that it's used for the non-GUI classes defined in
> wxBase.
> =

>  Regards,
> VZ
> =

> _______________________________________________
> wx-dev mailing list
> wx-dev at lists.wxwidgets.org
> http://lists.wxwidgets.org/mailman/listinfo/wx-dev
> =



______________________________________________________
Bis 50 MB Dateianh=E4nge? Kein Problem!
http://freemail.web.de/club/landingpage.htm/?mc=3D025556

-------------- next part --------------
A non-text attachment was scrubbed...
Name: wxPoint_T_wxSize_T_wxRect_T_.tar.gz
Type: application/x-gzip
Size: 9547 bytes
Desc: not available
Url : http://lists.wxwidgets.org/pipermail/wx-dev/attachments/20080423/134d=
cd8c/wxPoint_T_wxSize_T_wxRect_T_.tar-0001.bin


More information about the wx-dev mailing list