From: John L. <jr...@us...> - 2008-01-29 01:39:30
|
Update of /cvsroot/wxlua/wxLua/apps/wxluacan/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv28032/wxLua/apps/wxluacan/src Modified Files: Makefile wxluacan_bind.cpp wxluacan_rules.lua Removed Files: genwxbind.bat wxluacan.cpp Log Message: Try to speed up the build process by having only one cpp file for the smaller bindings using output_single_cpp_binding_file in the rules file. --- wxluacan.cpp DELETED --- Index: Makefile =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxluacan/src/Makefile,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Makefile 16 Jul 2007 19:34:12 -0000 1.14 --- Makefile 29 Jan 2008 01:38:55 -0000 1.15 *************** *** 21,25 **** HEADERS = ! SOURCES = cancom.cpp canlua.cpp cansim.cpp wxluacan_bind.cpp wxluacan.cpp OBJECTS=$(SOURCES:.cpp=.o) --- 21,25 ---- HEADERS = ! SOURCES = cancom.cpp canlua.cpp cansim.cpp wxluacan_bind.cpp OBJECTS=$(SOURCES:.cpp=.o) --- genwxbind.bat DELETED --- Index: wxluacan_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxluacan/src/wxluacan_bind.cpp,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** wxluacan_bind.cpp 29 Jan 2008 00:49:10 -0000 1.32 --- wxluacan_bind.cpp 29 Jan 2008 01:38:55 -0000 1.33 *************** *** 1,3 **** --- 1,526 ---- // --------------------------------------------------------------------------- + // ./wxluacan.cpp was generated by genwxbind.lua + // + // Any changes made to this file will be lost when the file is regenerated. + // --------------------------------------------------------------------------- + + #ifdef __BORLANDC__ + #pragma hdrstop + #endif + + #include "wx/wxprec.h" + + + #ifndef WX_PRECOMP + #include "wx/wx.h" + #endif + + #include "wxlua/include/wxlstate.h" + #include "wxluacan_bind.h" + + + // --------------------------------------------------------------------------- + // Bind class wxlCanObj + // --------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class 'wxlCanObj' + int wxluatype_wxlCanObj = WXLUA_TUNKNOWN; + + static wxLuaArgType s_wxluatypeArray_wxLua_wxlCanObj_AddObject[] = { &wxluatype_wxlCanObj, &wxluatype_wxlCanObj, NULL }; + static int LUACALL wxLua_wxlCanObj_AddObject(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxlCanObj_AddObject[1] = {{ wxLua_wxlCanObj_AddObject, WXLUAMETHOD_METHOD, 2, 2, s_wxluatypeArray_wxLua_wxlCanObj_AddObject }}; + // void AddObject( wxlCanObj *canobj ) + static int LUACALL wxLua_wxlCanObj_AddObject(lua_State *L) + { + // wxlCanObj canobj + wxlCanObj * canobj = (wxlCanObj *)wxluaT_getuserdatatype(L, 2, wxluatype_wxlCanObj); + // get this + wxlCanObj * self = (wxlCanObj *)wxluaT_getuserdatatype(L, 1, wxluatype_wxlCanObj); + // call AddObject + self->AddObject(canobj); + + return 0; + } + + static wxLuaArgType s_wxluatypeArray_wxLua_wxlCanObj_GetX[] = { &wxluatype_wxlCanObj, NULL }; + static int LUACALL wxLua_wxlCanObj_GetX(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxlCanObj_GetX[1] = {{ wxLua_wxlCanObj_GetX, WXLUAMETHOD_METHOD, 1, 1, s_wxluatypeArray_wxLua_wxlCanObj_GetX }}; + // double GetX() + static int LUACALL wxLua_wxlCanObj_GetX(lua_State *L) + { + // get this + wxlCanObj * self = (wxlCanObj *)wxluaT_getuserdatatype(L, 1, wxluatype_wxlCanObj); + // call GetX + double returns = (self->GetX()); + // push the result number + lua_pushnumber(L, returns); + + return 1; + } + + static wxLuaArgType s_wxluatypeArray_wxLua_wxlCanObj_GetY[] = { &wxluatype_wxlCanObj, NULL }; + static int LUACALL wxLua_wxlCanObj_GetY(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxlCanObj_GetY[1] = {{ wxLua_wxlCanObj_GetY, WXLUAMETHOD_METHOD, 1, 1, s_wxluatypeArray_wxLua_wxlCanObj_GetY }}; + // double GetY() + static int LUACALL wxLua_wxlCanObj_GetY(lua_State *L) + { + // get this + wxlCanObj * self = (wxlCanObj *)wxluaT_getuserdatatype(L, 1, wxluatype_wxlCanObj); + // call GetY + double returns = (self->GetY()); + // push the result number + lua_pushnumber(L, returns); + + return 1; + } + + + #if wxLUA_USE_wxColourPenBrush + static wxLuaArgType s_wxluatypeArray_wxLua_wxlCanObj_SetBrush[] = { &wxluatype_wxlCanObj, &wxluatype_wxBrush, NULL }; + static int LUACALL wxLua_wxlCanObj_SetBrush(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxlCanObj_SetBrush[1] = {{ wxLua_wxlCanObj_SetBrush, WXLUAMETHOD_METHOD, 2, 2, s_wxluatypeArray_wxLua_wxlCanObj_SetBrush }}; + // void SetBrush( const wxBrush& brush ) + static int LUACALL wxLua_wxlCanObj_SetBrush(lua_State *L) + { + // const wxBrush brush + const wxBrush * brush = (const wxBrush *)wxluaT_getuserdatatype(L, 2, wxluatype_wxBrush); + // get this + wxlCanObj * self = (wxlCanObj *)wxluaT_getuserdatatype(L, 1, wxluatype_wxlCanObj); + // call SetBrush + self->SetBrush(*brush); + + return 0; + } + + static wxLuaArgType s_wxluatypeArray_wxLua_wxlCanObj_SetPen[] = { &wxluatype_wxlCanObj, &wxluatype_wxPen, NULL }; + static int LUACALL wxLua_wxlCanObj_SetPen(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxlCanObj_SetPen[1] = {{ wxLua_wxlCanObj_SetPen, WXLUAMETHOD_METHOD, 2, 2, s_wxluatypeArray_wxLua_wxlCanObj_SetPen }}; + // void SetPen( const wxPen& pen ) + static int LUACALL wxLua_wxlCanObj_SetPen(lua_State *L) + { + // const wxPen pen + const wxPen * pen = (const wxPen *)wxluaT_getuserdatatype(L, 2, wxluatype_wxPen); + // get this + wxlCanObj * self = (wxlCanObj *)wxluaT_getuserdatatype(L, 1, wxluatype_wxlCanObj); + // call SetPen + self->SetPen(*pen); + + return 0; + } + + #endif // wxLUA_USE_wxColourPenBrush + + static wxLuaArgType s_wxluatypeArray_wxLua_wxlCanObj_SetPending[] = { &wxluatype_wxlCanObj, &wxluatype_TBOOLEAN, NULL }; + static int LUACALL wxLua_wxlCanObj_SetPending(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxlCanObj_SetPending[1] = {{ wxLua_wxlCanObj_SetPending, WXLUAMETHOD_METHOD, 1, 2, s_wxluatypeArray_wxLua_wxlCanObj_SetPending }}; + // void SetPending( bool pending = true ) + static int LUACALL wxLua_wxlCanObj_SetPending(lua_State *L) + { + // get number of arguments + int argCount = lua_gettop(L); + // bool pending = true + bool pending = (argCount >= 2 ? wxlua_getbooleantype(L, 2) : true); + // get this + wxlCanObj * self = (wxlCanObj *)wxluaT_getuserdatatype(L, 1, wxluatype_wxlCanObj); + // call SetPending + self->SetPending(pending); + + return 0; + } + + static wxLuaArgType s_wxluatypeArray_wxLua_wxlCanObj_SetPos[] = { &wxluatype_wxlCanObj, &wxluatype_TNUMBER, &wxluatype_TNUMBER, NULL }; + static int LUACALL wxLua_wxlCanObj_SetPos(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxlCanObj_SetPos[1] = {{ wxLua_wxlCanObj_SetPos, WXLUAMETHOD_METHOD, 3, 3, s_wxluatypeArray_wxLua_wxlCanObj_SetPos }}; + // void SetPos( double x, double y ) + static int LUACALL wxLua_wxlCanObj_SetPos(lua_State *L) + { + // double y + double y = (double)wxlua_getnumbertype(L, 3); + // double x + double x = (double)wxlua_getnumbertype(L, 2); + // get this + wxlCanObj * self = (wxlCanObj *)wxluaT_getuserdatatype(L, 1, wxluatype_wxlCanObj); + // call SetPos + self->SetPos(x, y); + + return 0; + } + + static wxLuaArgType s_wxluatypeArray_wxLua_wxlCanObj_constructor[] = { &wxluatype_TNUMBER, &wxluatype_TNUMBER, NULL }; + static int LUACALL wxLua_wxlCanObj_constructor(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxlCanObj_constructor[1] = {{ wxLua_wxlCanObj_constructor, WXLUAMETHOD_CONSTRUCTOR, 0, 2, s_wxluatypeArray_wxLua_wxlCanObj_constructor }}; + // wxlCanObj( double x = 0, double y = 0 ) + static int LUACALL wxLua_wxlCanObj_constructor(lua_State *L) + { + // get number of arguments + int argCount = lua_gettop(L); + // double y = 0 + double y = (argCount >= 2 ? (double)wxlua_getnumbertype(L, 2) : 0); + // double x = 0 + double x = (argCount >= 1 ? (double)wxlua_getnumbertype(L, 1) : 0); + // call constructor + wxlCanObj* returns = new wxlCanObj(x, y); + // push the constructed class pointer + wxluaT_pushuserdatatype(L, returns, wxluatype_wxlCanObj); + + return 1; + } + + + + // Map Lua Class Methods to C Binding Functions + wxLuaBindMethod wxlCanObj_methods[] = { + { "AddObject", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxlCanObj_AddObject, 1, NULL }, + { "GetX", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxlCanObj_GetX, 1, NULL }, + { "GetY", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxlCanObj_GetY, 1, NULL }, + + #if wxLUA_USE_wxColourPenBrush + { "SetBrush", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxlCanObj_SetBrush, 1, NULL }, + { "SetPen", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxlCanObj_SetPen, 1, NULL }, + #endif // wxLUA_USE_wxColourPenBrush + + { "SetPending", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxlCanObj_SetPending, 1, NULL }, + { "SetPos", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxlCanObj_SetPos, 1, NULL }, + { "wxlCanObj", WXLUAMETHOD_CONSTRUCTOR, s_wxluafunc_wxLua_wxlCanObj_constructor, 1, NULL }, + { 0, 0, 0, 0 }, + }; + + int wxlCanObj_methodCount = sizeof(wxlCanObj_methods)/sizeof(wxLuaBindMethod) - 1; + + + // --------------------------------------------------------------------------- + // Bind class wxlCanObjRect + // --------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class 'wxlCanObjRect' + int wxluatype_wxlCanObjRect = WXLUA_TUNKNOWN; + + static wxLuaArgType s_wxluatypeArray_wxLua_wxlCanObjRect_constructor[] = { &wxluatype_TNUMBER, &wxluatype_TNUMBER, &wxluatype_TNUMBER, &wxluatype_TNUMBER, NULL }; + static int LUACALL wxLua_wxlCanObjRect_constructor(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxlCanObjRect_constructor[1] = {{ wxLua_wxlCanObjRect_constructor, WXLUAMETHOD_CONSTRUCTOR, 4, 4, s_wxluatypeArray_wxLua_wxlCanObjRect_constructor }}; + // wxlCanObjRect( double x, double y, double w, double h ) + static int LUACALL wxLua_wxlCanObjRect_constructor(lua_State *L) + { + // double h + double h = (double)wxlua_getnumbertype(L, 4); + // double w + double w = (double)wxlua_getnumbertype(L, 3); + // double y + double y = (double)wxlua_getnumbertype(L, 2); + // double x + double x = (double)wxlua_getnumbertype(L, 1); + // call constructor + wxlCanObjRect* returns = new wxlCanObjRect(x, y, w, h); + // push the constructed class pointer + wxluaT_pushuserdatatype(L, returns, wxluatype_wxlCanObjRect); + + return 1; + } + + + + // Map Lua Class Methods to C Binding Functions + wxLuaBindMethod wxlCanObjRect_methods[] = { + { "wxlCanObjRect", WXLUAMETHOD_CONSTRUCTOR, s_wxluafunc_wxLua_wxlCanObjRect_constructor, 1, NULL }, + { 0, 0, 0, 0 }, + }; + + int wxlCanObjRect_methodCount = sizeof(wxlCanObjRect_methods)/sizeof(wxLuaBindMethod) - 1; + + + // --------------------------------------------------------------------------- + // Bind class wxlCanObjCircle + // --------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class 'wxlCanObjCircle' + int wxluatype_wxlCanObjCircle = WXLUA_TUNKNOWN; + + static wxLuaArgType s_wxluatypeArray_wxLua_wxlCanObjCircle_constructor[] = { &wxluatype_TNUMBER, &wxluatype_TNUMBER, &wxluatype_TNUMBER, NULL }; + static int LUACALL wxLua_wxlCanObjCircle_constructor(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxlCanObjCircle_constructor[1] = {{ wxLua_wxlCanObjCircle_constructor, WXLUAMETHOD_CONSTRUCTOR, 3, 3, s_wxluatypeArray_wxLua_wxlCanObjCircle_constructor }}; + // wxlCanObjCircle( double x, double y, double r ) + static int LUACALL wxLua_wxlCanObjCircle_constructor(lua_State *L) + { + // double r + double r = (double)wxlua_getnumbertype(L, 3); + // double y + double y = (double)wxlua_getnumbertype(L, 2); + // double x + double x = (double)wxlua_getnumbertype(L, 1); + // call constructor + wxlCanObjCircle* returns = new wxlCanObjCircle(x, y, r); + // push the constructed class pointer + wxluaT_pushuserdatatype(L, returns, wxluatype_wxlCanObjCircle); + + return 1; + } + + + + // Map Lua Class Methods to C Binding Functions + wxLuaBindMethod wxlCanObjCircle_methods[] = { + { "wxlCanObjCircle", WXLUAMETHOD_CONSTRUCTOR, s_wxluafunc_wxLua_wxlCanObjCircle_constructor, 1, NULL }, + { 0, 0, 0, 0 }, + }; + + int wxlCanObjCircle_methodCount = sizeof(wxlCanObjCircle_methods)/sizeof(wxLuaBindMethod) - 1; + + + // --------------------------------------------------------------------------- + // Bind class wxlCanObjScript + // --------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class 'wxlCanObjScript' + int wxluatype_wxlCanObjScript = WXLUA_TUNKNOWN; + + static wxLuaArgType s_wxluatypeArray_wxLua_wxlCanObjScript_constructor[] = { &wxluatype_TNUMBER, &wxluatype_TNUMBER, &wxluatype_TSTRING, NULL }; + static int LUACALL wxLua_wxlCanObjScript_constructor(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxlCanObjScript_constructor[1] = {{ wxLua_wxlCanObjScript_constructor, WXLUAMETHOD_CONSTRUCTOR, 3, 3, s_wxluatypeArray_wxLua_wxlCanObjScript_constructor }}; + // wxlCanObjScript( double x, double y, const wxString& name ) + static int LUACALL wxLua_wxlCanObjScript_constructor(lua_State *L) + { + // const wxString name + const wxString name = wxlua_getwxStringtype(L, 3); + // double y + double y = (double)wxlua_getnumbertype(L, 2); + // double x + double x = (double)wxlua_getnumbertype(L, 1); + // call constructor + wxlCanObjScript* returns = new wxlCanObjScript(x, y, name); + // push the constructed class pointer + wxluaT_pushuserdatatype(L, returns, wxluatype_wxlCanObjScript); + + return 1; + } + + + + // Map Lua Class Methods to C Binding Functions + wxLuaBindMethod wxlCanObjScript_methods[] = { + { "wxlCanObjScript", WXLUAMETHOD_CONSTRUCTOR, s_wxluafunc_wxLua_wxlCanObjScript_constructor, 1, NULL }, + { 0, 0, 0, 0 }, + }; + + int wxlCanObjScript_methodCount = sizeof(wxlCanObjScript_methods)/sizeof(wxLuaBindMethod) - 1; + + + // --------------------------------------------------------------------------- + // Bind class wxlCanObjAddScript + // --------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class 'wxlCanObjAddScript' + int wxluatype_wxlCanObjAddScript = WXLUA_TUNKNOWN; + + static wxLuaArgType s_wxluatypeArray_wxLua_wxlCanObjAddScript_SetScript[] = { &wxluatype_wxlCanObjAddScript, &wxluatype_TSTRING, NULL }; + static int LUACALL wxLua_wxlCanObjAddScript_SetScript(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxlCanObjAddScript_SetScript[1] = {{ wxLua_wxlCanObjAddScript_SetScript, WXLUAMETHOD_METHOD, 2, 2, s_wxluatypeArray_wxLua_wxlCanObjAddScript_SetScript }}; + // void SetScript( const wxString& script ) + static int LUACALL wxLua_wxlCanObjAddScript_SetScript(lua_State *L) + { + // const wxString script + const wxString script = wxlua_getwxStringtype(L, 2); + // get this + wxlCanObjAddScript * self = (wxlCanObjAddScript *)wxluaT_getuserdatatype(L, 1, wxluatype_wxlCanObjAddScript); + // call SetScript + self->SetScript(script); + + return 0; + } + + static wxLuaArgType s_wxluatypeArray_wxLua_wxlCanObjAddScript_constructor[] = { &wxluatype_TNUMBER, &wxluatype_TNUMBER, &wxluatype_TSTRING, NULL }; + static int LUACALL wxLua_wxlCanObjAddScript_constructor(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxlCanObjAddScript_constructor[1] = {{ wxLua_wxlCanObjAddScript_constructor, WXLUAMETHOD_CONSTRUCTOR, 3, 3, s_wxluatypeArray_wxLua_wxlCanObjAddScript_constructor }}; + // wxlCanObjAddScript( double x, double y, const wxString& script ) + static int LUACALL wxLua_wxlCanObjAddScript_constructor(lua_State *L) + { + // const wxString script + const wxString script = wxlua_getwxStringtype(L, 3); + // double y + double y = (double)wxlua_getnumbertype(L, 2); + // double x + double x = (double)wxlua_getnumbertype(L, 1); + // call constructor + wxlCanObjAddScript* returns = new wxlCanObjAddScript(x, y, script); + // push the constructed class pointer + wxluaT_pushuserdatatype(L, returns, wxluatype_wxlCanObjAddScript); + + return 1; + } + + + + // Map Lua Class Methods to C Binding Functions + wxLuaBindMethod wxlCanObjAddScript_methods[] = { + { "SetScript", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxlCanObjAddScript_SetScript, 1, NULL }, + { "wxlCanObjAddScript", WXLUAMETHOD_CONSTRUCTOR, s_wxluafunc_wxLua_wxlCanObjAddScript_constructor, 1, NULL }, + { 0, 0, 0, 0 }, + }; + + int wxlCanObjAddScript_methodCount = sizeof(wxlCanObjAddScript_methods)/sizeof(wxLuaBindMethod) - 1; + + + // --------------------------------------------------------------------------- + // Bind class wxlCan + // --------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class 'wxlCan' + int wxluatype_wxlCan = WXLUA_TUNKNOWN; + + static wxLuaArgType s_wxluatypeArray_wxLua_wxlCan_AddObject[] = { &wxluatype_wxlCan, &wxluatype_wxlCanObj, NULL }; + static int LUACALL wxLua_wxlCan_AddObject(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxlCan_AddObject[1] = {{ wxLua_wxlCan_AddObject, WXLUAMETHOD_METHOD, 2, 2, s_wxluatypeArray_wxLua_wxlCan_AddObject }}; + // void AddObject( wxlCanObj *canobj ) + static int LUACALL wxLua_wxlCan_AddObject(lua_State *L) + { + // wxlCanObj canobj + wxlCanObj * canobj = (wxlCanObj *)wxluaT_getuserdatatype(L, 2, wxluatype_wxlCanObj); + // get this + wxlCan * self = (wxlCan *)wxluaT_getuserdatatype(L, 1, wxluatype_wxlCan); + // call AddObject + self->AddObject(canobj); + + return 0; + } + + static wxLuaArgType s_wxluatypeArray_wxLua_wxlCan_GetCmdh[] = { &wxluatype_wxlCan, NULL }; + static int LUACALL wxLua_wxlCan_GetCmdh(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxlCan_GetCmdh[1] = {{ wxLua_wxlCan_GetCmdh, WXLUAMETHOD_METHOD, 1, 1, s_wxluatypeArray_wxLua_wxlCan_GetCmdh }}; + // wxlLuaCanCmd* GetCmdh() + static int LUACALL wxLua_wxlCan_GetCmdh(lua_State *L) + { + // get this + wxlCan * self = (wxlCan *)wxluaT_getuserdatatype(L, 1, wxluatype_wxlCan); + // call GetCmdh + wxlLuaCanCmd* returns = (wxlLuaCanCmd*)self->GetCmdh(); + // push the result datatype + wxluaT_pushuserdatatype(L, returns, wxluatype_wxlLuaCanCmd); + + return 1; + } + + static wxLuaArgType s_wxluatypeArray_wxLua_wxlCan_GetYaxis[] = { &wxluatype_wxlCan, NULL }; + static int LUACALL wxLua_wxlCan_GetYaxis(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxlCan_GetYaxis[1] = {{ wxLua_wxlCan_GetYaxis, WXLUAMETHOD_METHOD, 1, 1, s_wxluatypeArray_wxLua_wxlCan_GetYaxis }}; + // bool GetYaxis() + static int LUACALL wxLua_wxlCan_GetYaxis(lua_State *L) + { + // get this + wxlCan * self = (wxlCan *)wxluaT_getuserdatatype(L, 1, wxluatype_wxlCan); + // call GetYaxis + bool returns = (self->GetYaxis()); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + + #if wxLUA_USE_wxPointSizeRect + static wxLuaArgType s_wxluatypeArray_wxLua_wxlCan_constructor[] = { &wxluatype_wxWindow, &wxluatype_TNUMBER, &wxluatype_wxPoint, &wxluatype_wxSize, NULL }; + static int LUACALL wxLua_wxlCan_constructor(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxlCan_constructor[1] = {{ wxLua_wxlCan_constructor, WXLUAMETHOD_CONSTRUCTOR, 1, 4, s_wxluatypeArray_wxLua_wxlCan_constructor }}; + // wxlCan( wxWindow* parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize ) + static int LUACALL wxLua_wxlCan_constructor(lua_State *L) + { + // get number of arguments + int argCount = lua_gettop(L); + // const wxSize size = wxDefaultSize + const wxSize * size = (argCount >= 4 ? (const wxSize *)wxluaT_getuserdatatype(L, 4, wxluatype_wxSize) : &wxDefaultSize); + // const wxPoint pos = wxDefaultPosition + const wxPoint * pos = (argCount >= 3 ? (const wxPoint *)wxluaT_getuserdatatype(L, 3, wxluatype_wxPoint) : &wxDefaultPosition); + // wxWindowID id = -1 + wxWindowID id = (argCount >= 2 ? (wxWindowID)wxlua_getnumbertype(L, 2) : -1); + // wxWindow parent + wxWindow * parent = (wxWindow *)wxluaT_getuserdatatype(L, 1, wxluatype_wxWindow); + // call constructor + wxlCan* returns = new wxlCan(parent, id, *pos, *size); + // push the constructed class pointer + wxluaT_pushuserdatatype(L, returns, wxluatype_wxlCan); + + return 1; + } + + #endif // wxLUA_USE_wxPointSizeRect + + + + // Map Lua Class Methods to C Binding Functions + wxLuaBindMethod wxlCan_methods[] = { + { "AddObject", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxlCan_AddObject, 1, NULL }, + { "GetCmdh", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxlCan_GetCmdh, 1, NULL }, + { "GetYaxis", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxlCan_GetYaxis, 1, NULL }, + + #if wxLUA_USE_wxPointSizeRect + { "wxlCan", WXLUAMETHOD_CONSTRUCTOR, s_wxluafunc_wxLua_wxlCan_constructor, 1, NULL }, + #endif // wxLUA_USE_wxPointSizeRect + + { 0, 0, 0, 0 }, + }; + + int wxlCan_methodCount = sizeof(wxlCan_methods)/sizeof(wxLuaBindMethod) - 1; + + + // --------------------------------------------------------------------------- + // Bind class wxlLuaCanCmd + // --------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class 'wxlLuaCanCmd' + int wxluatype_wxlLuaCanCmd = WXLUA_TUNKNOWN; + + static wxLuaArgType s_wxluatypeArray_wxLua_wxlLuaCanCmd_MoveObject[] = { &wxluatype_wxlLuaCanCmd, &wxluatype_TNUMBER, &wxluatype_TNUMBER, &wxluatype_TNUMBER, NULL }; + static int LUACALL wxLua_wxlLuaCanCmd_MoveObject(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxlLuaCanCmd_MoveObject[1] = {{ wxLua_wxlLuaCanCmd_MoveObject, WXLUAMETHOD_METHOD, 4, 4, s_wxluatypeArray_wxLua_wxlLuaCanCmd_MoveObject }}; + // void MoveObject( int index, double x, double y ) + static int LUACALL wxLua_wxlLuaCanCmd_MoveObject(lua_State *L) + { + // double y + double y = (double)wxlua_getnumbertype(L, 4); + // double x + double x = (double)wxlua_getnumbertype(L, 3); + // int index + int index = (int)wxlua_getnumbertype(L, 2); + // get this + wxlLuaCanCmd * self = (wxlLuaCanCmd *)wxluaT_getuserdatatype(L, 1, wxluatype_wxlLuaCanCmd); + // call MoveObject + self->MoveObject(index, x, y); + + return 0; + } + + static wxLuaArgType s_wxluatypeArray_wxLua_wxlLuaCanCmd_constructor[] = { &wxluatype_wxlCan, &wxluatype_TNUMBER, NULL }; + static int LUACALL wxLua_wxlLuaCanCmd_constructor(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxlLuaCanCmd_constructor[1] = {{ wxLua_wxlLuaCanCmd_constructor, WXLUAMETHOD_CONSTRUCTOR, 1, 2, s_wxluatypeArray_wxLua_wxlLuaCanCmd_constructor }}; + // wxlLuaCanCmd( wxlCan* canvas, int maxCommands = -1 ) + static int LUACALL wxLua_wxlLuaCanCmd_constructor(lua_State *L) + { + // get number of arguments + int argCount = lua_gettop(L); + // int maxCommands = -1 + int maxCommands = (argCount >= 2 ? (int)wxlua_getnumbertype(L, 2) : -1); + // wxlCan canvas + wxlCan * canvas = (wxlCan *)wxluaT_getuserdatatype(L, 1, wxluatype_wxlCan); + // call constructor + wxlLuaCanCmd* returns = new wxlLuaCanCmd(canvas, maxCommands); + // push the constructed class pointer + wxluaT_pushuserdatatype(L, returns, wxluatype_wxlLuaCanCmd); + + return 1; + } + + + + // Map Lua Class Methods to C Binding Functions + wxLuaBindMethod wxlLuaCanCmd_methods[] = { + { "MoveObject", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxlLuaCanCmd_MoveObject, 1, NULL }, + { "wxlLuaCanCmd", WXLUAMETHOD_CONSTRUCTOR, s_wxluafunc_wxLua_wxlLuaCanCmd_constructor, 1, NULL }, + { 0, 0, 0, 0 }, + }; + + int wxlLuaCanCmd_methodCount = sizeof(wxlLuaCanCmd_methods)/sizeof(wxLuaBindMethod) - 1; + + + + + // --------------------------------------------------------------------------- // ./wxluacan_bind.cpp was generated by genwxbind.lua // Index: wxluacan_rules.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxluacan/src/wxluacan_rules.lua,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** wxluacan_rules.lua 29 Jan 2008 00:49:10 -0000 1.17 --- wxluacan_rules.lua 29 Jan 2008 01:38:55 -0000 1.18 *************** *** 42,46 **** -- hook_cpp_binding_filename, as opposed to generating a single cpp file -- for each *.i file plus the hook_cpp_binding_filename file. ! output_single_cpp_binding_file = false -- ---------------------------------------------------------------------------- --- 42,46 ---- -- hook_cpp_binding_filename, as opposed to generating a single cpp file -- for each *.i file plus the hook_cpp_binding_filename file. ! output_single_cpp_binding_file = true -- ---------------------------------------------------------------------------- |