// void write_data32(unsigned long ulNetxAddress, unsigned long ulData) static int LUACALL wxLua_dpm_write_data32(lua_State *L) { // unsigned long ulData unsigned long ulData = (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 write_data32 self->write_data32(ulNetxAddress, ulData); return 0; }
// bool testDescription_setTest(unsigned int uiTestIdx) static int LUACALL wxLua_muhkuh_wrap_xml_testDescription_setTest(lua_State *L) { // unsigned int uiTestIdx unsigned int uiTestIdx = (unsigned int)wxlua_getuintegertype(L, 2); // get this muhkuh_wrap_xml * self = (muhkuh_wrap_xml *)wxluaT_getuserdatatype(L, 1, wxluatype_muhkuh_wrap_xml); // call testDescription_setTest bool returns = (self->testDescription_setTest(uiTestIdx)); // push the result flag lua_pushboolean(L, returns); return 1; }
// unsigned long read_data32(unsigned long ulNetxAddress) static int LUACALL wxLua_dpm_read_data32(lua_State *L) { // 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_data32 unsigned long returns = (self->read_data32(ulNetxAddress)); // push the result number lua_pushnumber(L, returns); 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; }
// 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; }
// %override wxLua_dpm_write_image static int LUACALL wxLua_dpm_write_image(lua_State *L) { int iLuaCallbackTag; // 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 unsigned long ulNetxAddress = (unsigned long)wxlua_getuintegertype(L, 2); // get this dpm * self = (dpm *)wxluaT_getuserdatatype(L, 1, wxluatype_dpm); // call write_image self->write_image(ulNetxAddress, strData, L, iLuaCallbackTag, (void*)vplCallbackUserData); // remove ref to function luaL_unref(L, LUA_REGISTRYINDEX, iLuaCallbackTag); return 0; }