// wxProcess(wxEvtHandler *parent = NULL, int nId = wxID_ANY ); static int LUACALL wxLua_wxProcess_constructor(lua_State *L) { // get number of arguments int argCount = lua_gettop(L); // int nId = wxID_ANY int nId = (argCount >= 2 ? (int)wxlua_getnumbertype(L, 2) : wxID_ANY); // wxEvtHandler parent = NULL wxEvtHandler * parent = (argCount >= 1 ? (wxEvtHandler *)wxluaT_getuserdatatype(L, 1, wxluatype_wxEvtHandler) : NULL); // call constructor wxProcess* returns = new wxProcess(parent, nId); // add to tracked memory list wxluaO_addgcobject(L, returns, wxluatype_wxProcess); // push the constructed class pointer wxluaT_pushuserdatatype(L, returns, wxluatype_wxProcess); return 1; }
// %override wxLua_wxBusyCursor_constructor // wxBusyCursor(wxCursor* cursor = wxHOURGLASS_CURSOR) static int LUACALL wxLua_wxBusyCursor_constructor(lua_State *L) { // get number of arguments int argCount = lua_gettop(L); // const wxCursor cursor = wxHOURGLASS_CURSOR // NOTE: gcc complains that wxHOURGLASS_CURSOR is const, if changed to const MSVC complains wxBusyCursor takes non const wxCursor * cursor = (argCount >= 1 ? (wxCursor *)wxluaT_getuserdatatype(L, 1, wxluatype_wxCursor) : (wxCursor*)wxHOURGLASS_CURSOR); // call constructor wxBusyCursor *returns = new wxBusyCursor(cursor); // add to tracked memory list wxluaO_addgcobject(L, returns, wxluatype_wxBusyCursor); // push the constructed class pointer wxluaT_pushuserdatatype(L, returns, wxluatype_wxBusyCursor); return 1; }
// bool Start(int milliseconds = -1, bool oneShot = false ); static int LUACALL wxLua_wxTimer_Start(lua_State *L) { // get number of arguments int argCount = lua_gettop(L); // bool oneShot = false bool oneShot = (argCount >= 3 ? wxlua_getbooleantype(L, 3) : false); // int milliseconds = -1 int milliseconds = (argCount >= 2 ? (int)wxlua_getnumbertype(L, 2) : -1); // get this wxTimer * self = (wxTimer *)wxluaT_getuserdatatype(L, 1, wxluatype_wxTimer); // call Start bool returns = (self->Start(milliseconds, oneShot)); // push the result flag lua_pushboolean(L, returns); return 1; }
// wxTimer(wxEvtHandler *owner, int id = -1 ); static int LUACALL wxLua_wxTimer_constructor(lua_State *L) { // get number of arguments int argCount = lua_gettop(L); // int id = -1 int id = (argCount >= 2 ? (int)wxlua_getnumbertype(L, 2) : -1); // wxEvtHandler owner wxEvtHandler * owner = (wxEvtHandler *)wxluaT_getuserdatatype(L, 1, wxluatype_wxEvtHandler); // call constructor wxTimer* returns = new wxTimer(owner, id); // add to tracked memory list wxluaO_addgcobject(L, returns, wxluatype_wxTimer); // push the constructed class pointer wxluaT_pushuserdatatype(L, returns, wxluatype_wxTimer); return 1; }
// wxBusyInfo(const wxString& message, wxWindow *parent = NULL ); static int LUACALL wxLua_wxBusyInfo_constructor(lua_State *L) { // get number of arguments int argCount = lua_gettop(L); // wxWindow parent = NULL wxWindow * parent = (argCount >= 2 ? (wxWindow *)wxluaT_getuserdatatype(L, 2, wxluatype_wxWindow) : NULL); // const wxString message const wxString message = wxlua_getwxStringtype(L, 1); // call constructor wxBusyInfo* returns = new wxBusyInfo(message, parent); // add to tracked memory list wxluaO_addgcobject(L, returns, wxluatype_wxBusyInfo); // push the constructed class pointer wxluaT_pushuserdatatype(L, returns, wxluatype_wxBusyInfo); return 1; }
// wxFileOffset Seek(wxFileOffset where, wxSeekMode mode = wxFromStart) static int LUACALL wxLua_wxMediaCtrl_Seek(lua_State *L) { // get number of arguments int argCount = lua_gettop(L); // wxSeekMode mode = wxFromStart wxSeekMode mode = (argCount >= 3 ? (wxSeekMode)wxlua_getenumtype(L, 3) : wxFromStart); // wxFileOffset where wxFileOffset where = (wxFileOffset)wxlua_getuintegertype(L, 2); // get this wxMediaCtrl * self = (wxMediaCtrl *)wxluaT_getuserdatatype(L, 1, wxluatype_wxMediaCtrl); // call Seek wxFileOffset returns = (self->Seek(where, mode)); // push the result number lua_pushnumber(L, returns); return 1; }
// bool DeleteEntry(const wxString& key, bool bDeleteGroupIfEmpty = true) static int LUACALL wxLua_wxConfigBase_DeleteEntry(lua_State *L) { // get number of arguments int argCount = lua_gettop(L); // bool bDeleteGroupIfEmpty = true bool bDeleteGroupIfEmpty = (argCount >= 3 ? wxlua_getbooleantype(L, 3) : true); // const wxString key const wxString key = wxlua_getwxStringtype(L, 2); // get this wxConfigBase * self = (wxConfigBase *)wxluaT_getuserdatatype(L, 1, wxluatype_wxConfigBase); // call DeleteEntry bool returns = (self->DeleteEntry(key, bDeleteGroupIfEmpty)); // push the result flag lua_pushboolean(L, returns); return 1; }
// %override wxLua_wxConfigBase_GetNextGroup // bool GetNextGroup(wxString& str, long& index) const static int LUACALL wxLua_wxConfigBase_GetNextGroup(lua_State *L) { // only the number is needed long index = (long)wxlua_getintegertype(L, 2); wxString str; // get this wxConfig *self = (wxConfig *)wxluaT_getuserdatatype(L, 1, wxluatype_wxConfigBase); // call GetNextGroup bool returns = self->GetNextGroup(str, index); // push the result number lua_pushboolean(L, returns); // push the next result string wxlua_pushwxString(L, str); // push the next index lua_pushnumber(L, index); // return the number of parameters return 3; }
// %override wxLua_romloader_write_image static int LUACALL wxLua_romloader_write_image(lua_State *L) { int iLuaCallbackTag; wxLuaState wxlState(L); // voidptr_long vplCallbackUserData long vplCallbackUserData = (long)wxlua_getnumbertype(L, 5); // LuaFunction fnCallback if( lua_isfunction(L, 4) ) { // push function to top of stack lua_pushvalue(L, 4); // ref function and pop it from stack iLuaCallbackTag = luaL_ref(L, LUA_REGISTRYINDEX); } else { // no callback function provided wxlua_argerror(L, 4, wxT("a 'function'")); } // wxString strData wxString strData; size_t sizLen; const char *pcBuf; pcBuf = lua_tolstring(L, 3, &sizLen); if( sizLen==0 ) { strData = wxEmptyString; } else { strData = wxString::From8BitData(pcBuf, sizLen); } // unsigned long ulNetxAddress double dNetxAddress = wxlua_getnumbertype(L, 2); // get this romloader * self = (romloader *)wxluaT_getuserdatatype(L, 1, wxluatype_romloader); // call write_image self->write_image(dNetxAddress, strData, L, iLuaCallbackTag, (void*)vplCallbackUserData); // remove ref to function luaL_unref(L, LUA_REGISTRYINDEX, iLuaCallbackTag); return 0; }
// int CompareVersion(int major, int minor, int release, int revision) const; static int LUACALL wxLua_wxXmlResource_CompareVersion(lua_State *L) { // int revision int revision = (int)wxlua_getnumbertype(L, 5); // int release int release = (int)wxlua_getnumbertype(L, 4); // int minor int minor = (int)wxlua_getnumbertype(L, 3); // int major int major = (int)wxlua_getnumbertype(L, 2); // get this wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, wxluatype_wxXmlResource); // call CompareVersion int returns = (self->CompareVersion(major, minor, release, revision)); // push the result number lua_pushnumber(L, returns); return 1; }
// static wxLuaBindCFunc s_wxluafunc_wxLua_wxConfigBase_Read1[1] = {{ wxLua_wxConfigBase_Read1, WXLUAMETHOD_METHOD, 3, 3, s_wxluatypeArray_wxLua_wxConfigBase_Read1 }}; // %override wxLua_wxConfigBase_ReadFloat // %rename ReadFloat bool Read(const wxString& key, double* d, double defaultVal = 0) const static int LUACALL wxLua_wxConfigBase_ReadFloat(lua_State *L) { double returns = 0; // get number of arguments int argCount = lua_gettop(L); // double defaultVal = 0 double defaultVal = (argCount >= 3 ? (double)wxlua_getnumbertype(L, 3) : 0); // const wxString& key wxString key = wxlua_getwxStringtype(L, 2); // get this wxConfigBase *self = (wxConfigBase *)wxluaT_getuserdatatype(L, 1, wxluatype_wxConfigBase); // call Read bool ret = self->Read(key, &returns, defaultVal); // push the result bool lua_pushboolean(L, ret); // push the result number lua_pushnumber(L, returns); // return the number of parameters return 2; }
// %override wxLua_wxConfigBase_GetFirstGroup // bool GetFirstGroup(wxString& str, long& index) const static int LUACALL wxLua_wxConfigBase_GetFirstGroup(lua_State *L) { // get number of arguments int argCount = lua_gettop(L); // these are optional and are not used anyway long index = (argCount >= 3 ? (long)wxlua_getintegertype(L, 3) : 0); wxString str = (argCount >= 2 ? wxlua_getwxStringtype(L, 2) : wxString(wxEmptyString)); // get this wxConfig *self = (wxConfig *)wxluaT_getuserdatatype(L, 1, wxluatype_wxConfigBase); // call GetFirstGroup bool returns = self->GetFirstGroup(str, index); // push the result number lua_pushboolean(L, returns); // push the result string wxlua_pushwxString(L, str); // push the next index lua_pushnumber(L, index); // return the number of parameters return 3; }
// static wxLuaBindCFunc s_wxluafunc_wxLua_wxConfigBase_Read[1] = {{ wxLua_wxConfigBase_Read, WXLUAMETHOD_METHOD, 2, 3, s_wxluatypeArray_wxLua_wxConfigBase_Read }}; // %override wxLua_wxConfigBase_Read // bool Read(const wxString& key, wxString* str, const wxString& defaultVal = wxEmptyString) const static int LUACALL wxLua_wxConfigBase_Read(lua_State *L) { wxString returns; // get number of arguments int argCount = lua_gettop(L); // wxString defaultVal wxString defaultVal = (argCount >= 3 ? wxlua_getwxStringtype(L, 3) : wxString(wxEmptyString)); // const wxString& key wxString key = wxlua_getwxStringtype(L, 2); // get this wxConfigBase *self = (wxConfigBase *)wxluaT_getuserdatatype(L, 1, wxluatype_wxConfigBase); // call Read bool ret = self->Read(key, &returns, defaultVal); // push the result bool lua_pushboolean(L, ret); // push the result string wxlua_pushwxString(L, returns); // return the number of parameters return 2; }
// wxLogWindow(wxWindow *pParent, const wxString& szTitle, bool bShow = true, bool bPassToOld = true); static int LUACALL wxLua_wxLogWindow_constructor(lua_State *L) { // get number of arguments int argCount = lua_gettop(L); // bool bPassToOld = true bool bPassToOld = (argCount >= 4 ? wxlua_getbooleantype(L, 4) : true); // bool bShow = true bool bShow = (argCount >= 3 ? wxlua_getbooleantype(L, 3) : true); // const wxString szTitle const wxString szTitle = wxlua_getwxStringtype(L, 2); // wxWindow pParent wxWindow * pParent = (wxWindow *)wxluaT_getuserdatatype(L, 1, wxluatype_wxWindow); // call constructor wxLogWindow* returns = new wxLogWindow(pParent, szTitle, bShow, bPassToOld); // add to tracked memory list wxluaO_addgcobject(L, returns, wxluatype_wxLogWindow); // push the constructed class pointer wxluaT_pushuserdatatype(L, returns, wxluatype_wxLogWindow); return 1; }
// %override wxLua_wxTextValidator_constructor // wxTextValidator(long style = wxFILTER_NONE, wxString *valPtr = NULL) static int LUACALL wxLua_wxTextValidator_constructor(lua_State *L) { wxTextValidator *returns; // get number of arguments int argCount = lua_gettop(L); // long style = wxFILTER_NONE long style = (argCount >= 1 ? (long)wxlua_getintegertype(L, 1) : wxFILTER_NONE); // call constructor if (argCount >= 2) { wxLuaObject *valPtr = (wxLuaObject *)wxluaT_getuserdatatype(L, 2, wxluatype_wxLuaObject); returns = new wxTextValidator(style, valPtr->GetStringPtr(L)); } else returns = new wxTextValidator(style); // push the constructed class pointer wxluaT_pushuserdatatype(L, returns, wxluatype_wxTextValidator); // return the number of parameters return 1; }
// %override wxLua_romloader_read_image static int LUACALL wxLua_romloader_read_image(lua_State *L) { int iLuaCallbackTag; wxLuaState wxlState(L); wxString returns; // voidptr_long vplCallbackUserData long vplCallbackUserData = (long)wxlua_getnumbertype(L, 5); // LuaFunction fnCallback if( lua_isfunction(L, 4) ) { // push function to top of stack lua_pushvalue(L, 4); // ref function and pop it from stack iLuaCallbackTag = luaL_ref(L, LUA_REGISTRYINDEX); } else { // no callback function provided wxlua_argerror(L, 4, wxT("a 'function'")); } // unsigned long ulSize double dSize = wxlua_getnumbertype(L, 3); // unsigned long ulNetxAddress double dNetxAddress = wxlua_getnumbertype(L, 2); // get this romloader * self = (romloader *)wxluaT_getuserdatatype(L, 1, wxluatype_romloader); // call read_image returns = (self->read_image(dNetxAddress, dSize, L, iLuaCallbackTag, (void*)vplCallbackUserData)); // remove ref to function luaL_unref(L, LUA_REGISTRYINDEX, iLuaCallbackTag); // push the result string wxlState.lua_PushLString(returns.fn_str(),returns.Len()); return 1; }
// %override wxLua_dpm_read_image static int LUACALL wxLua_dpm_read_image(lua_State *L) { int iLuaCallbackTag; wxString returns; // voidptr_long vplCallbackUserData long vplCallbackUserData = (long)wxlua_getnumbertype(L, 5); // LuaFunction fnCallback if( lua_isfunction(L, 4) ) { // push function to top of stack lua_pushvalue(L, 4); // ref function and pop it from stack iLuaCallbackTag = luaL_ref(L, LUA_REGISTRYINDEX); } else { // no callback function provided wxlua_argerror(L, 4, wxT("a 'function'")); } // unsigned long ulSize unsigned long ulSize = (unsigned long)wxlua_getuintegertype(L, 3); // unsigned long ulNetxAddress unsigned long ulNetxAddress = (unsigned long)wxlua_getuintegertype(L, 2); // get this dpm * self = (dpm *)wxluaT_getuserdatatype(L, 1, wxluatype_dpm); // call read_image returns = (self->read_image(ulNetxAddress, ulSize, L, iLuaCallbackTag, (void*)vplCallbackUserData)); // remove ref to function luaL_unref(L, LUA_REGISTRYINDEX, iLuaCallbackTag); // push the result string wxlua_pushwxString(L, returns); return 1; }