From: John L. <jr...@us...> - 2007-03-23 04:27:27
|
Update of /cvsroot/wxlua/wxLua/modules/wxlua/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv24349/wxLua/modules/wxlua/src Modified Files: wxlbind.cpp wxlstate.cpp Log Message: Renamed all 'C' functions from wxLua_lua_XXX to just wxlua_XXX to shorten them and match lua's lua_XXX function convention. Index: wxlstate.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlstate.cpp,v retrieving revision 1.93 retrieving revision 1.94 diff -C2 -d -r1.93 -r1.94 *** wxlstate.cpp 23 Mar 2007 00:09:36 -0000 1.93 --- wxlstate.cpp 23 Mar 2007 04:27:23 -0000 1.94 *************** *** 71,75 **** // ---------------------------------------------------------------------------- ! int LUACALL wxLua_lua_printFunction( lua_State *L ) { wxLuaState wxlState(L); // doesn't have to be ok --- 71,75 ---- // ---------------------------------------------------------------------------- ! int LUACALL wxlua_printFunction( lua_State *L ) { [...1324 lines suppressed...] --- 2366,2370 ---- { wxCHECK_MSG(Ok(), NULL, wxT("Invalid wxLuaState")); ! return wxlua_getintarray(M_WXLSTATEDATA->m_lua_State, stack_idx, count); } *************** *** 2372,2376 **** { wxCHECK_MSG(Ok(), 0, wxT("Invalid wxLuaState")); ! return wxLua_lua_getwxArrayInt(M_WXLSTATEDATA->m_lua_State, stack_idx, intArray); } --- 2372,2376 ---- { wxCHECK_MSG(Ok(), 0, wxT("Invalid wxLuaState")); ! return wxlua_getwxArrayInt(M_WXLSTATEDATA->m_lua_State, stack_idx, intArray); } Index: wxlbind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlbind.cpp,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** wxlbind.cpp 23 Mar 2007 00:09:36 -0000 1.58 --- wxlbind.cpp 23 Mar 2007 04:27:23 -0000 1.59 *************** *** 56,60 **** // A function object needs to be deleted because the object is being // garbage collected. ! int LUACALL wxLua_lua_gc_wxLuaFunction(lua_State *L) { wxLuaState wxlState(L); --- 56,60 ---- // A function object needs to be deleted because the object is being // garbage collected. ! int LUACALL wxlua_gc_wxLuaFunction(lua_State *L) { wxLuaState wxlState(L); *************** *** 72,76 **** // Handler for the 'function' tag method. ! int LUACALL wxLua_lua_call_wxLuaFunction(lua_State *L) { wxLuaState wxlState(L); --- 72,76 ---- // Handler for the 'function' tag method. ! int LUACALL wxlua_call_wxLuaFunction(lua_State *L) { wxLuaState wxlState(L); *************** *** 232,249 **** // ---------------------------------------------------------------------------- ! // wxLua_lua_tableErrorHandler // ---------------------------------------------------------------------------- ! static int LUACALL wxLua_lua_tableErrorHandler(lua_State *L) { ! wxLua_lua_terror(L, "Cannot modify read-only wxLua table"); return 0; } // ---------------------------------------------------------------------------- ! // wxLua_lua_garbageCollect - if the class defines a gc function, then call it. // ---------------------------------------------------------------------------- ! int LUACALL wxLua_lua_garbageCollect(lua_State *L) { wxLuaState wxlState(L); --- 232,249 ---- // ---------------------------------------------------------------------------- ! // wxlua_tableErrorHandler // ---------------------------------------------------------------------------- ! static int LUACALL wxlua_tableErrorHandler(lua_State *L) { ! wxlua_terror(L, "Cannot modify read-only wxLua table"); return 0; } // ---------------------------------------------------------------------------- ! // wxlua_garbageCollect - if the class defines a gc function, then call it. // ---------------------------------------------------------------------------- ! int LUACALL wxlua_garbageCollect(lua_State *L) { wxLuaState wxlState(L); *************** *** 261,265 **** key = (long)wxlState.ttouserdata(1, true); ! wxCHECK_MSG(key != 0, 0, wxT("NULL user data in wxLua_lua_garbageCollect")); //tracked = --- 261,265 ---- key = (long)wxlState.ttouserdata(1, true); ! wxCHECK_MSG(key != 0, 0, wxT("NULL user data in wxlua_garbageCollect")); //tracked = *************** *** 270,274 **** if (it != pDerivedList.end()) { ! //wxPrintf(wxT("wxLua_lua_garbageCollect - Derived GC '%s'\n"), lua2wx(pClass->name).c_str()); wxLuaStringToLongHashMap *pHashTable = (wxLuaStringToLongHashMap *)it->second; --- 270,274 ---- if (it != pDerivedList.end()) { ! //wxPrintf(wxT("wxlua_garbageCollect - Derived GC '%s'\n"), lua2wx(pClass->name).c_str()); wxLuaStringToLongHashMap *pHashTable = (wxLuaStringToLongHashMap *)it->second; *************** *** 278,286 **** pDerivedList.erase(it); } ! //else wxPrintf(wxT("wxLua_lua_garbageCollect - Invalid WXLUACLASS derived hashmap iterator key %d!\n"), key); } ! //else wxPrintf(wxT("wxLua_lua_garbageCollect - NULL WXLUACLASS!\n")); ! //wxPrintf(wxT("wxLua_lua_garbageCollect - '%s' tag %d lua %d key %ld tracked %d return value %d\n"), // lua2wx(pClass ? pClass->name : "").c_str(), pClass ? *pClass->class_tag : 0, (int)L, key, (int)tracked, retVal); --- 278,286 ---- pDerivedList.erase(it); } ! //else wxPrintf(wxT("wxlua_garbageCollect - Invalid WXLUACLASS derived hashmap iterator key %d!\n"), key); } ! //else wxPrintf(wxT("wxlua_garbageCollect - NULL WXLUACLASS!\n")); ! //wxPrintf(wxT("wxlua_garbageCollect - '%s' tag %d lua %d key %ld tracked %d return value %d\n"), // lua2wx(pClass ? pClass->name : "").c_str(), pClass ? *pClass->class_tag : 0, (int)L, key, (int)tracked, retVal); *************** *** 289,293 **** // ---------------------------------------------------------------------------- ! // wxLua_lua_getTableFunc // // Called by LUA to find the method that corresponds to a given method name. --- 289,293 ---- // ---------------------------------------------------------------------------- ! // wxlua_getTableFunc // // Called by LUA to find the method that corresponds to a given method name. *************** *** 301,305 **** #define CALL_BASECLASS_FUNC_LEN 5 ! int LUACALL wxLua_lua_getTableFunc(lua_State *L) { wxLuaState wxlState(L); --- 301,305 ---- #define CALL_BASECLASS_FUNC_LEN 5 ! int LUACALL wxlua_getTableFunc(lua_State *L) { wxLuaState wxlState(L); *************** *** 371,375 **** //if (lua2wx(funcName).Find(wxT("OnBeginDocument")) != -1) ! // wxPrintf(wxT("wxLua_lua_getTableFunc func '%s' pClass %d '%s', userdata %d, lightuserdata %d, ttag %d, class_tag %d lua_State %d wxLuaStateRefData %d call base %d\n"), // lua2wx(funcName).c_str(), (long)pClass, pClass ? lua2wx(pClass->name).c_str() : wxT(""), init_isuserdata, init_islightuserdata, init_ttag, init_class_tag, (long)L, (long)wxlState.GetRefData(), (int)wxlState.GetCallBaseClassFunction()); --- 371,375 ---- //if (lua2wx(funcName).Find(wxT("OnBeginDocument")) != -1) ! // wxPrintf(wxT("wxlua_getTableFunc func '%s' pClass %d '%s', userdata %d, lightuserdata %d, ttag %d, class_tag %d lua_State %d wxLuaStateRefData %d call base %d\n"), // lua2wx(funcName).c_str(), (long)pClass, pClass ? lua2wx(pClass->name).c_str() : wxT(""), init_isuserdata, init_islightuserdata, init_ttag, init_class_tag, (long)L, (long)wxlState.GetRefData(), (int)wxlState.GetCallBaseClassFunction()); *************** *** 381,385 **** // ---------------------------------------------------------------------------- ! // wxLua_lua_setTableFunc // // Called by LUA to find the method that corresponds to a given method name. --- 381,385 ---- // ---------------------------------------------------------------------------- ! // wxlua_setTableFunc // // Called by LUA to find the method that corresponds to a given method name. *************** *** 388,392 **** // ---------------------------------------------------------------------------- ! int LUACALL wxLua_lua_setTableFunc(lua_State *L) { wxLuaState wxlState(L); --- 388,392 ---- // ---------------------------------------------------------------------------- ! int LUACALL wxlua_setTableFunc(lua_State *L) { wxLuaState wxlState(L); *************** *** 396,400 **** const char *cpIndex = lua_tostring(L, 2); ! //wxPrintf(wxT("wxLua_lua_setTableFunc '%s'\n"), lua2wx(cpIndex).c_str()); if ((pClass != NULL) && lua_isuserdata(L, 1) && --- 396,400 ---- const char *cpIndex = lua_tostring(L, 2); ! //wxPrintf(wxT("wxlua_setTableFunc '%s'\n"), lua2wx(cpIndex).c_str()); if ((pClass != NULL) && lua_isuserdata(L, 1) && *************** *** 545,549 **** // prevent changes from lua scripts ! //wxlState.tsettagmethod(m_wxLuaTable, "__newindex", wxLua_lua_tableErrorHandler); // FIXME allow this? } else --- 545,549 ---- // prevent changes from lua scripts ! //wxlState.tsettagmethod(m_wxLuaTable, "__newindex", wxlua_tableErrorHandler); // FIXME allow this? } else *************** *** 584,590 **** static const luaL_reg s_funcTable[] = { ! {"__gc", wxLua_lua_garbageCollect }, ! {"__index", wxLua_lua_getTableFunc }, ! {"__newindex", wxLua_lua_setTableFunc } }; static const size_t s_funcCount = sizeof(s_funcTable)/sizeof(s_funcTable[0]); --- 584,590 ---- static const luaL_reg s_funcTable[] = { ! {"__gc", wxlua_garbageCollect }, ! {"__index", wxlua_getTableFunc }, ! {"__newindex", wxlua_setTableFunc } }; static const size_t s_funcCount = sizeof(s_funcTable)/sizeof(s_funcTable[0]); *************** *** 615,619 **** // store a lookup table for the class tags to WXLUACLASS structs ! wxLua_lua_tget(L, *pClass->class_tag); lua_pushstring(L, "WXLUACLASS"); lua_pushlightuserdata(L, (void *)pClass); --- 615,619 ---- // store a lookup table for the class tags to WXLUACLASS structs ! wxlua_tget(L, *pClass->class_tag); lua_pushstring(L, "WXLUACLASS"); lua_pushlightuserdata(L, (void *)pClass); *************** *** 622,626 **** // store a lookup table for the class names to WXLUACLASS structs ! wxLua_lua_push_wxLuaClasses(L); lua_rawget(L, LUA_REGISTRYINDEX); // pop key, push result (the classes table) --- 622,626 ---- // store a lookup table for the class names to WXLUACLASS structs ! wxlua_pushstring_wxLuaClasses(L); lua_rawget(L, LUA_REGISTRYINDEX); // pop key, push result (the classes table) |