You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(60) |
Jul
(35) |
Aug
(32) |
Sep
(5) |
Oct
(5) |
Nov
(58) |
Dec
(34) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(114) |
Feb
(184) |
Mar
(153) |
Apr
(90) |
May
(153) |
Jun
(59) |
Jul
(24) |
Aug
(43) |
Sep
(17) |
Oct
(34) |
Nov
(11) |
Dec
(204) |
2007 |
Jan
(84) |
Feb
(119) |
Mar
(38) |
Apr
(28) |
May
(52) |
Jun
(105) |
Jul
(64) |
Aug
(67) |
Sep
(14) |
Oct
(3) |
Nov
(28) |
Dec
(55) |
2008 |
Jan
(228) |
Feb
(55) |
Mar
(30) |
Apr
(30) |
May
(15) |
Jun
(20) |
Jul
(12) |
Aug
(3) |
Sep
(13) |
Oct
(54) |
Nov
(35) |
Dec
(35) |
2009 |
Jan
(19) |
Feb
(20) |
Mar
(34) |
Apr
(4) |
May
(60) |
Jun
(25) |
Jul
(16) |
Aug
(51) |
Sep
(19) |
Oct
(62) |
Nov
(21) |
Dec
(12) |
2010 |
Jan
(1) |
Feb
|
Mar
(4) |
Apr
(12) |
May
(23) |
Jun
(13) |
Jul
(1) |
Aug
(40) |
Sep
(18) |
Oct
(21) |
Nov
(26) |
Dec
(34) |
2011 |
Jan
(17) |
Feb
(23) |
Mar
(1) |
Apr
(10) |
May
(1) |
Jun
(5) |
Jul
(1) |
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
(43) |
2012 |
Jan
(5) |
Feb
(19) |
Mar
(6) |
Apr
(24) |
May
(39) |
Jun
(83) |
Jul
(29) |
Aug
(36) |
Sep
(64) |
Oct
(55) |
Nov
(12) |
Dec
(7) |
2013 |
Jan
(17) |
Feb
(10) |
Mar
(37) |
Apr
(27) |
May
(13) |
Jun
(9) |
Jul
(7) |
Aug
(61) |
Sep
(23) |
Oct
(23) |
Nov
(30) |
Dec
(16) |
2014 |
Jan
(23) |
Feb
(13) |
Mar
(9) |
Apr
(17) |
May
(2) |
Jun
(11) |
Jul
(2) |
Aug
|
Sep
(9) |
Oct
(24) |
Nov
(2) |
Dec
(14) |
2015 |
Jan
(6) |
Feb
(4) |
Mar
(17) |
Apr
|
May
(7) |
Jun
(3) |
Jul
|
Aug
|
Sep
(2) |
Oct
(21) |
Nov
(6) |
Dec
(2) |
2016 |
Jan
(4) |
Feb
(2) |
Mar
(7) |
Apr
(3) |
May
(11) |
Jun
(6) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2018 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
(6) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(4) |
Dec
|
2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(8) |
Nov
|
Dec
|
2024 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
|
|
1
|
2
|
3
|
4
|
5
|
6
|
7
(4) |
8
|
9
|
10
(4) |
11
|
12
|
13
|
14
|
15
|
16
|
17
|
18
(3) |
19
|
20
(3) |
21
(4) |
22
(9) |
23
|
24
(6) |
25
(4) |
26
(1) |
27
(7) |
28
(1) |
29
(4) |
30
(3) |
31
(1) |
|
From: John L. <jla...@gm...> - 2008-10-24 03:41:37
|
On Wed, Oct 22, 2008 at 2:56 PM, klaas.holwerda <ng...@kl...> wrote: > John Labenski wrote: >> >>> //%operator a2dAffineMatrix operator-( const a2dAffineMatrix& a, >>> const a2dAffineMatrix& b ) >>> > Even this one compiles now. > Which looks like two operands?? I don't know why, didn't it generate something like this? %operator double operator-( int col, int row ) double returns = ((*self)-(col, row)); Anyway, it should be fixed in CVS. >>> //static a2dAffineMatrix Mul( const a2dAffineMatrix &m1, const >>> a2dAffineMatrix &m2 ) >>> //double& operator()( int col, int row ) This should work too, but without the "double&" since there really isn't a good way to wrap a reference to the double value without A LOT of changes. In the end it'd be far more inefficient than simply calling a Set(col,row) function to change the value. Regards, John |
From: John L. <jla...@gm...> - 2008-10-24 02:52:09
|
On Wed, Oct 22, 2008 at 2:15 PM, klaas.holwerda <ng...@kl...> wrote: > John Labenski wrote: >> On Tue, Oct 21, 2008 at 12:50 PM, klaas.holwerda <ng...@kl...> wrote: >> >>> Hi John, >>> >>> This might be an easy one to fix. >>> >>> a2dCanvasObject* GetParent( void ) const >>> >>> The void parameter causes problems. Maybe you can simply skip it. I >>> remember some compilers give a warning if its missing, so it is often there. > So maybe it is just worth the hack?? Fixed in CVS. Regards, John |
From: John L. <jla...@gm...> - 2008-10-22 22:34:41
|
On Wed, Oct 22, 2008 at 2:45 PM, klaas.holwerda <ng...@kl...> wrote: > John Labenski wrote: >> I've added the ability to wrap the <<, >>, ~, operators in CVS. >> > I tested it, but i still get the same errors in C++. > I think a name like this is not allowed, if i change << in say _ss, this > lines at least compiles. > wxLuaArgType s_wxluatypeArray_wxLua_a2dIOHandlerXMLWrite_operator<< > > Here the error and the code.i > > \..\..\wxArt2D\modules\luawraps\src\xmlparse.cpp(507) : error C2143: > syntax error : missing ';' before '<<' > ..\..\..\..\wxArt2D\modules\luawraps\src\xmlparse.cpp(507) : error > C2143: syntax error : missing ';' before '{' > ..\..\..\..\wxArt2D\modules\luawraps\src\xmlparse.cpp(507) : error > C2447: '{' : missing function header (old-style formal list?) > > static wxLuaArgType > s_wxluatypeArray_wxLua_a2dIOHandlerXMLWrite_operator<<[] = { > &wxluatype_a2dIOHandlerXMLWrite, &wxluatype_TLIGHTUSERDATA, NULL }; > > %class %noclassinfo a2dIOHandlerXMLWrite, a2dIOHandlerStrOut > > a2dIOHandlerXMLWrite& operator<<(const wxInt16 & c) > %endclass Put the keyword %operator in front of it since it thinks it's just a regular function. %operator a2dIOHandlerXMLWrite& operator<<(const wxInt16 & c) -John |
From: klaas.holwerda <ng...@kl...> - 2008-10-22 19:33:26
|
John, You told that templates are not possible, and i understand that. But i still need to find a solutions, since all my lists are STL/STD template based. Like my main a2dList class is a pure std::list, with some extra members that return an iterator. All the other list are derived from that or they are template instantiations of it. template<class T> class a2dlist: public std::list< T, std::allocator<T> > Has a member like: typename a2dlist<T>::iterator item(size_t index) {.....} The smart pointer list is also a2dlist / std::list based. template<class T> class a2dSmrtPtrList: public a2dlist< a2dSmrtPtr< T > > And of those i have many instantiations like this: class a2dVertexList : public a2dSmrtPtrList< a2dLineSegment > class a2dCanvasObjectList: public a2dSmrtPtrList<a2dCanvasObject> This use iterators like: a2dCanvasObjectList::iterator a2dCanvasObjectList::const_iterator So do you have any idea how i best approach this? Should i for instance best write lua code to generate the template instantiation in *.i lines code?? Its the iterators that worry me the most :-( What i saw in wxLua looks like its based on wxList "old fashion" use, where wxNode is not typed. But my iterator are typed i am afraid. Is there a sample demo-ing wxList usage?? I think it is weird to use lists in lua, should be a table. But my data in the document/C++, is all stored in the type of lists is showed above, and i like to iterate through them. Maybe i should just make a GetFirst() GetNext() kind of iteration inside list classes ?? I am very bad in writing lua code, but this will change :-). But for the moment this makes it a bit difficult to see through all this :-(. Thanks for any ideas! Klaas |
From: klaas.holwerda <ng...@kl...> - 2008-10-22 19:06:10
|
John, I hope you don't mind i keep reporting issues, it just to improve wxLua. Most of them i can just change to make them work, but maybe you can improve the binding generator. If you prefer i report them in separate threads, let me know. Klaas ===================================== The default values like this are refused. virtual void BlitBuffer( wxDC* dc, wxRect rect, const wxPoint& bufferpos = wxPoint( 0, 0 ) ) ===================================== I have no idea, why this member of a class is a problem. void SetAlpha( unsigned char* alphadata ) 1>..\..\..\..\wxArt2D\modules\luawraps\src\artbase.cpp(7533) : error C2664: 'void a2dImageRGBA::SetAlpha(unsigned char)' : cannot convert parameter 1 from 'wxCharBuffer' to 'unsigned char' ======================================== These are memebers of a class, i just removed friend, and it is compiling, did not actually use it in lua code. %operator friend bool operator==(const a2dFont& a, const a2dFont& b) %operator friend bool operator!=(const a2dFont& a, const a2dFont& b) I made it: %operator bool operator==(const a2dFont& a, const a2dFont& b) %operator bool operator!=(const a2dFont& a, const a2dFont& b) ======================================= It seems that a default value like &something is not accepted. a2dComEvent( a2dPropObject* sender, const a2dPropertyId& id, const wxEventType* eventid = &a2dComEvent::sm_changedProperty ) a2dComEvent( wxObject* sender, a2dNamedProperty* property, const wxEventType* id = &sm_changedProperty, bool ownProp = false ) ERROR: Expected Parameter Default Value, got Tag='&'. File: 'C:/data/art2d/wxArt2D/modules/luawraps/src/general.i':(line 435) ' a2dComEvent( a2dPropObject* sender, const a2dPropertyId& id, const wxEventType* eventid = &a2dComEvent::sm_changedProperty )' ERROR: Expected Parameter Default Value, got Tag='&'. File: 'C:/data/art2d/wxArt2D/modules/luawraps/src/general.i':(line 436) ' a2dComEvent( wxObject* sender, a2dNamedProperty* property, const wxEventType* id = &sm_changedProperty, bool ownProp = false )' ======================================= I don't know why, but a reference to wxUint32 are any other type does give a problem in C++. %class %noclassinfo a2dUint32Property, a2dNamedProperty a2dUint32Property() wxUint32& GetValueRef() 1> There is no context in which this conversion is possible 1>..\..\..\..\wxArt2D\modules\luawraps\src\general.cpp(5161) : error C2440: 'initializing' : cannot convert from 'wxUint32 *' to 'wxUint32' static int LUACALL wxLua_a2dUint32Property_GetValueRef(lua_State *L) { // get this a2dUint32Property * self = (a2dUint32Property *)wxluaT_getuserdatatype(L, 1, wxluatype_a2dUint32Property); // call GetValueRef wxUint32 returns = &self->GetValueRef(); // push the result number lua_pushnumber(L, returns); return 1; } |
From: klaas.holwerda <ng...@kl...> - 2008-10-22 18:56:31
|
John Labenski wrote: > > > Fixed in CVS. It was not translating the typedef. > Thanks, i keep testing. I changed the typedefs, and it looks good sofar. > > > > Should work? See wxPoint2DDouble operators. > After updating wxLua etc., it work fine. > >> //%operator a2dAffineMatrix operator-( const a2dAffineMatrix& a, >> const a2dAffineMatrix& b ) >> Even this one compiles now. Which looks like two operands?? >> //static a2dAffineMatrix Mul( const a2dAffineMatrix &m1, const >> a2dAffineMatrix &m2 ) >> //double& operator()( int col, int row ) >> //%operator double& operator()( int col, int row ) >> //double operator()( int col, int row ) const >> //%operator double operator()( int col, int row ) const >> > > There is no support for 2 params to the operators, I can add this. > Hope you will :-) > >> a2dPoint2D GetTranslation() const >> //%member double m_matrix[3][2] >> > > This would be hard to implement since we'd have to return m_matrix[3] > as an array wrapped in a new userdata type that would allow you to get > to the second [2] dimension. I would provide a safe member function, > with bounds checks so you don't get a segfault with no error message > if you try to access a value out of bounds. > Well this one is not that important. There are member functions to set the matrix. And if operator() is fixed all is fine, and even that i can solve using member functions. Thanks, Klaas |
From: klaas.holwerda <ng...@kl...> - 2008-10-22 18:46:02
|
John Labenski wrote: > I've added the ability to wrap the <<, >>, ~, operators in CVS. > I tested it, but i still get the same errors in C++. I think a name like this is not allowed, if i change << in say _ss, this lines at least compiles. wxLuaArgType s_wxluatypeArray_wxLua_a2dIOHandlerXMLWrite_operator<< Here the error and the code.i \..\..\wxArt2D\modules\luawraps\src\xmlparse.cpp(507) : error C2143: syntax error : missing ';' before '<<' ..\..\..\..\wxArt2D\modules\luawraps\src\xmlparse.cpp(507) : error C2143: syntax error : missing ';' before '{' ..\..\..\..\wxArt2D\modules\luawraps\src\xmlparse.cpp(507) : error C2447: '{' : missing function header (old-style formal list?) static wxLuaArgType s_wxluatypeArray_wxLua_a2dIOHandlerXMLWrite_operator<<[] = { &wxluatype_a2dIOHandlerXMLWrite, &wxluatype_TLIGHTUSERDATA, NULL }; %class %noclassinfo a2dIOHandlerXMLWrite, a2dIOHandlerStrOut a2dIOHandlerXMLWrite& operator<<(const wxInt16 & c) %endclass |
From: klaas.holwerda <ng...@kl...> - 2008-10-22 18:15:46
|
John Labenski wrote: > On Tue, Oct 21, 2008 at 12:50 PM, klaas.holwerda <ng...@kl...> wrote: > >> Hi John, >> >> This might be an easy one to fix. >> >> a2dCanvasObject* GetParent( void ) const >> >> The void parameter causes problems. Maybe you can simply skip it. I >> remember some compilers give a warning if its missing, so it is often there. >> >> > > I'll look into it, but it'll be a hack. > > I can't imagine that any compiler that can compile wxWidgets still > needs them anymore. I know the one that comes with National > Instruments LabWindowsCVI and perhaps the Matlab one does, but those > two are so backwards they don't even accept C++ // comments for > convenience. > You must be right, but somehow i did/needed to add them in old times, i can't remember for what compiler. And i scanned the wxWidgets header files, and it is still used there like this. So maybe it is just worth the hack?? Klaas |
From: John L. <jla...@gm...> - 2008-10-22 05:18:02
|
On Tue, Oct 21, 2008 at 12:50 PM, klaas.holwerda <ng...@kl...> wrote: > Hi John, > > This might be an easy one to fix. > > a2dCanvasObject* GetParent( void ) const > > The void parameter causes problems. Maybe you can simply skip it. I > remember some compilers give a warning if its missing, so it is often there. > I'll look into it, but it'll be a hack. I can't imagine that any compiler that can compile wxWidgets still needs them anymore. I know the one that comes with National Instruments LabWindowsCVI and perhaps the Matlab one does, but those two are so backwards they don't even accept C++ // comments for convenience. Regards, John |
From: John L. <jla...@gm...> - 2008-10-22 05:04:28
|
On Tue, Oct 21, 2008 at 12:42 PM, klaas.holwerda <ng...@kl...> wrote: > John Labenski wrote: >> On Sat, Oct 18, 2008 at 6:23 AM, klaas.holwerda <ng...@kl...> wrote: >>> >>> One more, a2dWalkEvent is a simple "const long" >>> In the rules file i did add this: >>> AllocDataType("a2dWalkEvent", "const long", false) >> >> Force it to be treated as a number: >> AllocDataType("a2dWalkEvent", "const long", true) >> > I think you mean: > AllocDataType("a2dWalkEvent", "number", true) Sorry, yes. > That is how its used in genwxbind.lua. And it does work. > Still strange that i need to this and not a %typedef, which it really > is. We do i use %typedef??. > > Still I am confused about the use of AllocDataType(). > > If i add this to the rules file. > AllocDataType("a2dNamedPropertyList", "class", false) > > What does that mean, do, and what not? > Is it like a forward declaration, in case where there is a cycle > dependency in a classA with member using pointers to classB, and visa > versa? %typedefs simply allow the binder to translate between the new type to some already known type. AllocDataType() gives a little more info to the binder about how to get and set it to Lua. I've made a modification to the generator so that you won't need the AllocDataType() for %typedefs anymore. > Do i still need to wrap this class, at a minimum like this, if it not in > another bind library? > > %class %noclassinfo a2dNamedPropertyList > %endclass > > And if so, then it is in fact only a forward declaration mechanism in > case of classes. > The strange thing is that for a2dWalkEvent it seems no other information > in the *.i file is needed. For an AllocDataType() for a2dWalkEvent you've declared that it's a number so the binder knows how to get/set from/to Lua. However, simply calling AllocDataType() for a class like a2dNamedPropertyList may not work since it needs to know if it's encapsulated. The generator may work, but it won't compile. Basically, the interface files are run through before fully parsing and AllocDataType() is called for all %class, %enum, %struct types with the assumption that they will be fully defined correctly. This allows us to give better messages for typos and missing types when we really parse it. > And what is the difference compared to what happens in here: > > datatype_cache_input_fileTable = { > "c:/data/art2d/wxluacvs/wxLua/bindings/wxwidgets/wx_datatypes.lua" } > > Is this more or less the same, as the AllocDataType? This is a cache of the AllocDataType() calls for other bindings. Regards, John |
From: John L. <jla...@gm...> - 2008-10-22 03:55:14
|
On Tue, Oct 21, 2008 at 12:47 PM, klaas.holwerda <ng...@kl...> wrote: > John Labenski wrote: >> This should be fixable if I >> can get a simple example of what makes the binder crash. >> >> %typedef a2dPoint2D wxPoint2DDouble >> >> %function a2dPoint2D GetPoint() >> %function void SetPoint(const a2dPoint2D& pt) >> > Here is there error i get, and after that the wrapping code i used > > c:\data\art2d\a2d288deb\modules\luawraps\src>genwxbind.bat | more > Generating wxWidgets Binding > c:/data/art2d/wxluacvs/wxLua\bin\vc_lib\lua: > c:/data/art2d/wxluacvs/wxLua\bindings\genwxbind.lua:3712: attempt to > index field '?' (a nil value) Fixed in CVS. It was not translating the typedef. > ------------------------------------ > This LINE is the problem line in the next code: > > a2dPoint2D GetTranslation() const > > But as you can see, i out commented many things which also give problems. > > --------------------- Here the wrapped code -------- > > // ***************************************************************** > // artbase/include\afmatrix.h > // ***************************************************************** > > %typedef a2dPoint2D wxPoint2DDouble ******* NOTE I changed the $typedef semantics to match that of C/C++ %typedef wxPoint2DDouble a2dPoint2D > // > --------------------------------------------------------------------------- > // a2dAffineMatrix > // > --------------------------------------------------------------------------- > > %include "artbase/include/afmatrix.h" > %class %noclassinfo %encapsulate a2dAffineMatrix > a2dAffineMatrix( double xt, double yt, double scalex = 1, double > scaley = 1, double degrees = 0 ) > a2dAffineMatrix() > a2dAffineMatrix( const a2dAffineMatrix& mat ) > %operator void operator = ( const a2dAffineMatrix& mat ) > %operator bool operator == ( const a2dAffineMatrix& a, const > a2dAffineMatrix& b ) > %operator bool operator != ( const a2dAffineMatrix& a, const > a2dAffineMatrix& b ) > //%operator a2dAffineMatrix& operator*=( const > a2dAffineMatrix& m ) > //%operator a2dAffineMatrix operator*( const > a2dAffineMatrix& m ) const Should work? See wxPoint2DDouble operators. > //%operator a2dAffineMatrix operator-( const a2dAffineMatrix& a, > const a2dAffineMatrix& b ) > //static a2dAffineMatrix Mul( const a2dAffineMatrix &m1, const > a2dAffineMatrix &m2 ) > //double& operator()( int col, int row ) > //%operator double& operator()( int col, int row ) > //double operator()( int col, int row ) const > //%operator double operator()( int col, int row ) const There is no support for 2 params to the operators, I can add this. > a2dPoint2D GetTranslation() const > //%member double m_matrix[3][2] This would be hard to implement since we'd have to return m_matrix[3] as an array wrapped in a new userdata type that would allow you to get to the second [2] dimension. I would provide a safe member function, with bounds checks so you don't get a segfault with no error message if you try to access a value out of bounds. > %member bool m_isIdentity > %endclass > > > %define a2dACCUR 1e-6 > //%define Round( x ) (int) floor( (x) + 0.5 ) Treat this as a function, the binder doesn't know the difference. %function double Round(double x) Regards, John |
From: klaas.holwerda <ng...@kl...> - 2008-10-21 16:51:02
|
Hi John, This might be an easy one to fix. a2dCanvasObject* GetParent( void ) const The void parameter causes problems. Maybe you can simply skip it. I remember some compilers give a warning if its missing, so it is often there. Klaas |
From: klaas.holwerda <ng...@kl...> - 2008-10-21 16:47:11
|
John Labenski wrote: > This should be fixable if I > can get a simple example of what makes the binder crash. > > %typedef a2dPoint2D wxPoint2DDouble > > %function a2dPoint2D GetPoint() > %function void SetPoint(const a2dPoint2D& pt) > Here is there error i get, and after that the wrapping code i used c:\data\art2d\a2d288deb\modules\luawraps\src>genwxbind.bat | more Generating wxWidgets Binding c:/data/art2d/wxluacvs/wxLua\bin\vc_lib\lua: c:/data/art2d/wxluacvs/wxLua\bindings\genwxbind.lua:3712: attempt to index field '?' (a nil value) stack traceback: c:/data/art2d/wxluacvs/wxLua\bindings\genwxbind.lua:3712: in function 'GenerateLuaLanguageBinding' c:/data/art2d/wxluacvs/wxLua\bindings\genwxbind.lua:1473: in function 'WriteWrapperFiles' c:/data/art2d/wxluacvs/wxLua\bindings\genwxbind.lua:4915: in function 'main' c:/data/art2d/wxluacvs/wxLua\bindings\genwxbind.lua:4933: in main chunk [C]: ? Loaded rules file: luawraps_rules.lua Loaded datatypes cache file: c:/data/art2d/wxluacvs/wxLua/bindings/wxwidgets/wx_datatypes.lua Timing: BuildDataTypeTable 0 seconds. Timing: ParseData 0 seconds. Done luawraps ------------------------------------ This LINE is the problem line in the next code: a2dPoint2D GetTranslation() const But as you can see, i out commented many things which also give problems. --------------------- Here the wrapped code -------- // ***************************************************************** // artbase/include\afmatrix.h // ***************************************************************** %typedef a2dPoint2D wxPoint2DDouble // --------------------------------------------------------------------------- // a2dAffineMatrix // --------------------------------------------------------------------------- %include "artbase/include/afmatrix.h" %class %noclassinfo %encapsulate a2dAffineMatrix a2dAffineMatrix( double xt, double yt, double scalex = 1, double scaley = 1, double degrees = 0 ) a2dAffineMatrix() a2dAffineMatrix( const a2dAffineMatrix& mat ) %operator void operator = ( const a2dAffineMatrix& mat ) %operator bool operator == ( const a2dAffineMatrix& a, const a2dAffineMatrix& b ) %operator bool operator != ( const a2dAffineMatrix& a, const a2dAffineMatrix& b ) //%operator a2dAffineMatrix& operator*=( const a2dAffineMatrix& m ) //%operator a2dAffineMatrix operator*( const a2dAffineMatrix& m ) const //%operator a2dAffineMatrix operator-( const a2dAffineMatrix& a, const a2dAffineMatrix& b ) //static a2dAffineMatrix Mul( const a2dAffineMatrix &m1, const a2dAffineMatrix &m2 ) //double& operator()( int col, int row ) //%operator double& operator()( int col, int row ) //double operator()( int col, int row ) const //%operator double operator()( int col, int row ) const a2dPoint2D GetTranslation() const //%member double m_matrix[3][2] %member bool m_isIdentity %endclass %define a2dACCUR 1e-6 //%define Round( x ) (int) floor( (x) + 0.5 ) |
From: klaas.holwerda <ng...@kl...> - 2008-10-21 16:42:12
|
John Labenski wrote: > On Sat, Oct 18, 2008 at 6:23 AM, klaas.holwerda <ng...@kl...> wrote: > >> Hi John, >> >> One more, a2dWalkEvent is a simple "const long" >> >> In the rules file i did add this: >> >> AllocDataType("a2dWalkEvent", "const long", false) >> > > Force it to be treated as a number: > > AllocDataType("a2dWalkEvent", "const long", true) > I think you mean: AllocDataType("a2dWalkEvent", "number", true) That is how its used in genwxbind.lua. And it does work. Still strange that i need to this and not a %typedef, which it really is. We do i use %typedef??. Still I am confused about the use of AllocDataType(). If i add this to the rules file. AllocDataType("a2dNamedPropertyList", "class", false) What does that mean, do, and what not? Is it like a forward declaration, in case where there is a cycle dependency in a classA with member using pointers to classB, and visa versa? Do i still need to wrap this class, at a minimum like this, if it not in another bind library? %class %noclassinfo a2dNamedPropertyList %endclass And if so, then it is in fact only a forward declaration mechanism in case of classes. The strange thing is that for a2dWalkEvent it seems no other information in the *.i file is needed. And what is the difference compared to what happens in here: datatype_cache_input_fileTable = { "c:/data/art2d/wxluacvs/wxLua/bindings/wxwidgets/wx_datatypes.lua" } Is this more or less the same, as the AllocDataType? Thanks, Klaas |
From: John L. <jla...@gm...> - 2008-10-21 04:50:08
|
I've added the ability to wrap the <<, >>, ~, operators in CVS. -John On Mon, Oct 20, 2008 at 11:34 AM, John Labenski <jla...@gm...> wrote: > On Sat, Oct 18, 2008 at 5:00 AM, klaas.holwerda <ng...@kl...> wrote: >> Hi John, >> >> Started some serious wrapping now, and understand that it is no so >> automatic as i hoped :-) >> Anyway the tag extraction script give a reasonable start. But when it >> come to operator its a bit bad. >> I tried to fix it by adding %operator in front of those members in >> parse_ctags, but that should not be done for all. >> Now i could make it work for the operators that are oke. But what about >> the rest?? >> >> So i wonder, where is the real problem, in Lua in C++. Is it possible to >> have operators like below? >> Or should they somehow be renamed? What would be a good solution?? >> >> Anyway the next one refuses to compile in C++. >> >> a2dIOHandlerXMLWrite& operator<<(const wxInt16 & c) >> >> It does not like the name of the array variable. >> >> static wxLuaArgType >> s_wxluatypeArray_wxLua_a2dIOHandlerXMLWrite_operator<<[] = { >> &wxluatype_a2dIOHandlerXMLWrite, &wxluatype_TLIGHTUSERDATA, NULL }; > > I forgot to add the << and >> operators so they are not handled > properly. I'll try to look into it tonight. > > -John > |
From: John L. <jla...@gm...> - 2008-10-20 15:56:18
|
On Sat, Oct 18, 2008 at 6:23 AM, klaas.holwerda <ng...@kl...> wrote: > Hi John, > > One more, a2dWalkEvent is a simple "const long" > > In the rules file i did add this: > > AllocDataType("a2dWalkEvent", "const long", false) Force it to be treated as a number: AllocDataType("a2dWalkEvent", "const long", true) > > Tried this as an extra, no difference. > > %typedef a2dWalkEvent const long > > The problem is here: > > virtual bool WalkTask( wxObject* parent, wxObject* object, > a2dWalkEvent event ) > > ..\..\..\..\wxArt2D\modules\luawraps\src\general.cpp(2592) : error > C2065: 'wxluatype_long' : undeclared identifier > > Changing it in the *.i file to this makes it work: > > virtual bool WalkTask( wxObject* parent, wxObject* object, long > event ) > > Any idea? It thinks the a2dWalkEvent is a class, but then translates the typedef to get wxluatype_long. I think it should work if you make the change above and use a2dWalkEvent in the bindings as you first did since it should work as wxWindowID does. -John |
From: John L. <jla...@gm...> - 2008-10-20 15:49:42
|
On Sat, Oct 18, 2008 at 5:19 AM, klaas.holwerda <ng...@kl...> wrote: > Hi, > > My typedef in C++ become reversed in *.i files. not a problem, but > further down, it looks like the typedef is not respected. > Not only with a template like down here, also with simple classes. > Like: > > %typedef a2dPoint2D wxPoint2DDouble > > That line is understood by the generator, but next when a2dPoint is > used, eg as return value for a function, it is not oke (exceptions in > lua). So i decided to copy the wxPoint2DDouble wrapping from wxLua as a > whole, and put in my own after replacing wxPoint2DDouble with > a2dPoint2D. So in end "as if" i have a class a2dPoint2D, and that works > for all the generated C++ code. > Still i wonder how this should be solved. > Maybe it does not work because wxPoint2DDouble is from another wrap module?? The typename wxPoint2DDouble should be known if you have this line in your rules since the file wxcore_datatypes.lua defines them. datatype_cache_input_fileTable = { wxlua_dir.."bindings/wxwidgets/wxcore_datatypes.lua" } The typedefs have not been thoroughly tested as they're not used too much in the bindings. You're saying that if you have something like this in your interface files you get a crash. For both uses of the typedef or only for the return value... ? This should be fixable if I can get a simple example of what makes the binder crash. %typedef a2dPoint2D wxPoint2DDouble %function a2dPoint2D GetPoint() %function void SetPoint(const a2dPoint2D& pt) > After that i have many of the next, which are instances of a template. > If instead of using a typedef, i just wrap the a2dPropertyIdMatrix as > an empty class, it does work better. > > %class %noclassinfo a2dPropertyIdMatrix > %endclass > > Since it are id's and most of the time static id's in C++, i think this > will work. But for me its all a bit fuzzy logic at the moment :-) > > %typedef a2dPropertyIdMatrix a2dPropertyIdTyped<a2dAffineMatrix, > a2dMatrixProperty> > > ERROR: Supposed datatype: 'a2dPropertyIdMatrix' has typedef = > 'a2dPropertyIdTyped<a2dAffineMatrix , a2dMatrixProperty>' which is not a > data type either There is no support for templates, therefore you have to define each templated class. However, if you can, wrap the base class and then for each templated class only override the functions whose input or output data types are different. -John |
From: John L. <jla...@gm...> - 2008-10-20 15:34:14
|
On Sat, Oct 18, 2008 at 5:00 AM, klaas.holwerda <ng...@kl...> wrote: > Hi John, > > Started some serious wrapping now, and understand that it is no so > automatic as i hoped :-) > Anyway the tag extraction script give a reasonable start. But when it > come to operator its a bit bad. > I tried to fix it by adding %operator in front of those members in > parse_ctags, but that should not be done for all. > Now i could make it work for the operators that are oke. But what about > the rest?? > > So i wonder, where is the real problem, in Lua in C++. Is it possible to > have operators like below? > Or should they somehow be renamed? What would be a good solution?? > > Anyway the next one refuses to compile in C++. > > a2dIOHandlerXMLWrite& operator<<(const wxInt16 & c) > > It does not like the name of the array variable. > > static wxLuaArgType > s_wxluatypeArray_wxLua_a2dIOHandlerXMLWrite_operator<<[] = { > &wxluatype_a2dIOHandlerXMLWrite, &wxluatype_TLIGHTUSERDATA, NULL }; I forgot to add the << and >> operators so they are not handled properly. I'll try to look into it tonight. -John |
From: klaas.holwerda <ng...@kl...> - 2008-10-18 10:23:41
|
Hi John, One more, a2dWalkEvent is a simple "const long" In the rules file i did add this: AllocDataType("a2dWalkEvent", "const long", false) Tried this as an extra, no difference. %typedef a2dWalkEvent const long The problem is here: virtual bool WalkTask( wxObject* parent, wxObject* object, a2dWalkEvent event ) ..\..\..\..\wxArt2D\modules\luawraps\src\general.cpp(2592) : error C2065: 'wxluatype_long' : undeclared identifier Changing it in the *.i file to this makes it work: virtual bool WalkTask( wxObject* parent, wxObject* object, long event ) Any idea? Klaas |
From: klaas.holwerda <ng...@kl...> - 2008-10-18 09:25:41
|
Hi, My typedef in C++ become reversed in *.i files. not a problem, but further down, it looks like the typedef is not respected. Not only with a template like down here, also with simple classes. Like: %typedef a2dPoint2D wxPoint2DDouble That line is understood by the generator, but next when a2dPoint is used, eg as return value for a function, it is not oke (exceptions in lua). So i decided to copy the wxPoint2DDouble wrapping from wxLua as a whole, and put in my own after replacing wxPoint2DDouble with a2dPoint2D. So in end "as if" i have a class a2dPoint2D, and that works for all the generated C++ code. Still i wonder how this should be solved. Maybe it does not work because wxPoint2DDouble is from another wrap module?? After that i have many of the next, which are instances of a template. If instead of using a typedef, i just wrap the a2dPropertyIdMatrix as an empty class, it does work better. %class %noclassinfo a2dPropertyIdMatrix %endclass Since it are id's and most of the time static id's in C++, i think this will work. But for me its all a bit fuzzy logic at the moment :-) %typedef a2dPropertyIdMatrix a2dPropertyIdTyped<a2dAffineMatrix, a2dMatrixProperty> ERROR: Supposed datatype: 'a2dPropertyIdMatrix' has typedef = 'a2dPropertyIdTyped<a2dAffineMatrix , a2dMatrixProperty>' which is not a data type either |
From: klaas.holwerda <ng...@kl...> - 2008-10-18 09:06:10
|
Hi John, Started some serious wrapping now, and understand that it is no so automatic as i hoped :-) Anyway the tag extraction script give a reasonable start. But when it come to operator its a bit bad. I tried to fix it by adding %operator in front of those members in parse_ctags, but that should not be done for all. Now i could make it work for the operators that are oke. But what about the rest?? So i wonder, where is the real problem, in Lua in C++. Is it possible to have operators like below? Or should they somehow be renamed? What would be a good solution?? Anyway the next one refuses to compile in C++. a2dIOHandlerXMLWrite& operator<<(const wxInt16 & c) It does not like the name of the array variable. static wxLuaArgType s_wxluatypeArray_wxLua_a2dIOHandlerXMLWrite_operator<<[] = { &wxluatype_a2dIOHandlerXMLWrite, &wxluatype_TLIGHTUSERDATA, NULL }; |
From: John L. <jla...@gm...> - 2008-10-10 20:59:21
|
On Fri, Oct 10, 2008 at 12:55 PM, Scott Kirkpatrick <ski...@co...> wrote: > John, > > That's what I had picked up from reading the Lua documentation and works > if I want to use a wxWidgets object. Here's what I want to do: > > class Item > { > public: > wxString RefID; > bool InProcess; > double Length; > double Priority; > > double CalculateValue(); > }; > > WX_WX_DECLARE_LIST(Item, ListItems); > > ListItems ProcessItems; > > > The Item class is a very abbreviated version of what I have. What I > need to do is to pass ProcessItems to a Lua function that will determine > what Item to process next. The Lua function needs to access the public > properties and the member function. It of course has to iterate over > all the Items in the wxList ProcessItems. You need to make bindings for your class then. http://wxlua.sourceforge.net/docs/binding.html wxList is in wxLua/bindings/wxwidgets/wxbase_data.i See wxLua/bindings/wxwidgets/wxadv_rules.lua as an example of the rules to build the binding files using genwxbind.lua note that in your interface files you should derive your "ListItems" wxList class from the wxList binding to get all the wxList functions, but also you might want to add some "overridden" functions to shortcut the work to get the wxNode data, see wxNode comments in wxLua/bindings/wxwidgets/wxbase_data.i. Regards, John |
From: Scott K. <ski...@co...> - 2008-10-10 16:59:01
|
John, That's what I had picked up from reading the Lua documentation and works if I want to use a wxWidgets object. Here's what I want to do: class Item { public: wxString RefID; bool InProcess; double Length; double Priority; double CalculateValue(); }; WX_WX_DECLARE_LIST(Item, ListItems); ListItems ProcessItems; The Item class is a very abbreviated version of what I have. What I need to do is to pass ProcessItems to a Lua function that will determine what Item to process next. The Lua function needs to access the public properties and the member function. It of course has to iterate over all the Items in the wxList ProcessItems. Scott John Labenski wrote: > On Fri, Oct 10, 2008 at 9:25 AM, Scott Kirkpatrick > <ski...@co...> wrote: > >> I'm new to embedding a scripting engine in another application but I can >> follow how to call a Lua function from a wxWidgets application and how >> to pass data to it and get data back. I see that wxLua gives me the >> ability to do that with wxWidgets objects. However, I haven't been able >> to figure out how to do that with my own classes. >> >> I have a wxList of my custom objects that I need to pass to a Lua >> function and get a return value. I've looked at the wxLuacan >> application and realize that I have to do something with bindings but >> for the life of me, I can't figure out how to go about it. I haven't >> been able to locate a tutorial on the subject either. Can somebody give >> me a step-by-step for doing this? >> > > The best way to see how to run code is to check the binding functions > in modules/wxbind/src, constructors will create new objects and the > others will get an object from > > Also see here: http://www.lua.org/pil/25.2.html > > Warning, untested code. > > Example: > > Call this Lua function from C. > > function PrintwxPoint(pt) > print(pt.x, pt.y) > end > > C code would be (see wxLua_wxPoint_constructor in > modules/wxbind/src/wxcore.gdi.cpp) > > wxLuaState wxlState(myEventHandlerThatHandles_wxEVT_LUA_PRINT); > wxlState.RunString("function PrintwxPoint(...."); > > lua_State* L = wxlState.GetLuaState(); > > lua_getglobal(L, "PrintwxPoint"); // Lua func on stack > > if (Lua should own object we push) > wxPoint* pt= new wxPoint(1, 2); > // add to tracked memory list > wxluaO_addgcobject(L, (void*)pt, new wxLua_wxObject_wxPoint((wxPoint*)pt)); > // push the constructed class pointer > wxluaT_pushuserdatatype(L, pt, wxluatype_wxPoint); > else > wxPoint pt(1,2); // must exist for the life of the Lua function > wxluaT_pushuserdatatype(L, &pt, wxluatype_wxPoint); > end > > int status = wxlState.LuaPCall(1, 0); // call PrintwxPoint w/ one param > > > > Hope this helps, > John > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > wxlua-users mailing list > wxl...@li... > https://lists.sourceforge.net/lists/listinfo/wxlua-users > > -- Scott Kirkpatrick Software Engineer Control Logic Inc. (A Weinig Group Company) 8656 Huffman Ave. Connelly Springs, NC 28612 USA Phone : +1 828.397.5078 Ext. 23 Fax : +1 828.397.5292 Email : ski...@co... Internet : www.weinigusa.com "WEINIG - ForWood Thinking" Weinig Technology EXPO 2008 February 28 - 29, 2008 For more details, visit us at www.weinigusa.com |
From: John L. <jla...@gm...> - 2008-10-10 15:52:25
|
On Fri, Oct 10, 2008 at 9:25 AM, Scott Kirkpatrick <ski...@co...> wrote: > I'm new to embedding a scripting engine in another application but I can > follow how to call a Lua function from a wxWidgets application and how > to pass data to it and get data back. I see that wxLua gives me the > ability to do that with wxWidgets objects. However, I haven't been able > to figure out how to do that with my own classes. > > I have a wxList of my custom objects that I need to pass to a Lua > function and get a return value. I've looked at the wxLuacan > application and realize that I have to do something with bindings but > for the life of me, I can't figure out how to go about it. I haven't > been able to locate a tutorial on the subject either. Can somebody give > me a step-by-step for doing this? The best way to see how to run code is to check the binding functions in modules/wxbind/src, constructors will create new objects and the others will get an object from Also see here: http://www.lua.org/pil/25.2.html Warning, untested code. Example: Call this Lua function from C. function PrintwxPoint(pt) print(pt.x, pt.y) end C code would be (see wxLua_wxPoint_constructor in modules/wxbind/src/wxcore.gdi.cpp) wxLuaState wxlState(myEventHandlerThatHandles_wxEVT_LUA_PRINT); wxlState.RunString("function PrintwxPoint(...."); lua_State* L = wxlState.GetLuaState(); lua_getglobal(L, "PrintwxPoint"); // Lua func on stack if (Lua should own object we push) wxPoint* pt= new wxPoint(1, 2); // add to tracked memory list wxluaO_addgcobject(L, (void*)pt, new wxLua_wxObject_wxPoint((wxPoint*)pt)); // push the constructed class pointer wxluaT_pushuserdatatype(L, pt, wxluatype_wxPoint); else wxPoint pt(1,2); // must exist for the life of the Lua function wxluaT_pushuserdatatype(L, &pt, wxluatype_wxPoint); end int status = wxlState.LuaPCall(1, 0); // call PrintwxPoint w/ one param Hope this helps, John |
From: Scott K. <ski...@co...> - 2008-10-10 13:56:07
|
I'm new to embedding a scripting engine in another application but I can follow how to call a Lua function from a wxWidgets application and how to pass data to it and get data back. I see that wxLua gives me the ability to do that with wxWidgets objects. However, I haven't been able to figure out how to do that with my own classes. I have a wxList of my custom objects that I need to pass to a Lua function and get a return value. I've looked at the wxLuacan application and realize that I have to do something with bindings but for the life of me, I can't figure out how to go about it. I haven't been able to locate a tutorial on the subject either. Can somebody give me a step-by-step for doing this? Scott |