From: John L. <jr...@us...> - 2007-06-16 06:22:16
|
Update of /cvsroot/wxlua/wxLua/bindings/wxlua In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv19284/wxLua/bindings/wxlua Modified Files: override.hpp wxlua.i Log Message: Add back the wxTreeCtrl into the stack dialog, on left of listctrl so you get both for easier navigation. Added functions to the wxlua.XXX table to get info about the status of wxLua Use qsort and bsearch to find the class methods ~ %25 faster Make wxLuaDebugData not always create it's ref data so it can !Ok() Index: wxlua.i =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxlua/wxlua.i,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** wxlua.i 14 Jun 2007 23:59:41 -0000 1.2 --- wxlua.i 16 Jun 2007 06:21:42 -0000 1.3 *************** *** 8,11 **** --- 8,12 ---- // ============================================================================ + //----------------------------------------------------------------------------- // Compile the luaScript of the given name and return the lua error code, a message // and the line number (or -1) of the error. *************** *** 14,17 **** --- 15,42 ---- //----------------------------------------------------------------------------- + // Get information about the status of wxLua. + // + // Please take special note of + + // Get a table of all tracked top level windows that wxLua will Destroy() + // when lua is closed. + // Example output : { ["wxFrame"] = 1, ["wxDialog"] = 2 } + %function LuaTable GetTrackedTopLevelWindows() + + // Get a table of all tracked userdata wxLua will delete when lua is closed + // or lua will eventually garbage collect. + // Example output : { ["wxPoint"] = 3, ["wxPen"] = 5 } + %function LuaTable GetTrackedUserData() + + // Get a table of all tracked wxEvent callbacks that have been installed using + // wxEvtHandler::Connect(...) + // Example output : { ["wxEVT_COMMAND_TOOL_CLICKED"] = 2, ... } + %function LuaTable GetTrackedEventCallbacks() + + // Get a table of all wxWindow derived classes that have been created in wxLua. + // Example output : { ["wxFrame"] = 1, ["wxButton"] = 4 } + %function LuaTable GetTrackedWindows() + + //----------------------------------------------------------------------------- // Type information about the bindings or current userdata *************** *** 44,51 **** %define WXLUAARG_Number %define WXLUAARG_String ! %define WXLUAARG_LuaTable ! %define WXLUAARG_LuaFunction %define WXLUAARG_UserData ! %define WXLUAARG_LuaThread %define WXLUAARG_Integer --- 69,76 ---- %define WXLUAARG_Number %define WXLUAARG_String ! %define WXLUAARG_Table ! %define WXLUAARG_Function %define WXLUAARG_UserData ! %define WXLUAARG_Thread %define WXLUAARG_Integer *************** *** 61,66 **** %define LUA_TTHREAD // 8 ! ! // Is this lua_type() (or in lua type()) considered %function int wxlua_iswxluatype(int luatype, int wxluaarg_tag) --- 86,90 ---- %define LUA_TTHREAD // 8 ! // Is this lua_type() (or in lua the type() function) considered equivalent %function int wxlua_iswxluatype(int luatype, int wxluaarg_tag) *************** *** 71,75 **** %function wxString wxlua_typename(int wxluaarg_tag) - // %override int wxlua_type(void* object) // Get the wxlua type (tag) of the object, this is the arg tags number --- 95,98 ---- *************** *** 85,88 **** --- 108,112 ---- // Note: Use only '.' and NO () to make it a function call, also check to see // if the item exists first (unlike the example above)! + // Please see the bindings.wx.lua sample program for usage. /* *************** *** 110,114 **** %endclass ! %class wxLuaBindClass // No constructor as this is read only --- 134,138 ---- %endclass ! %struct wxLuaBindClass // No constructor as this is read only *************** *** 123,129 **** int enums_n ! %endclass ! %class wxLuaBindMethod // No constructor as this is read only --- 147,153 ---- int enums_n ! %endstruct ! %struct wxLuaBindMethod // No constructor as this is read only *************** *** 137,143 **** wxString class_name // class name this is part of (not in struct) ! %endclass ! %class wxLuaBindCFunc // No constructor as this is read only --- 161,167 ---- wxString class_name // class name this is part of (not in struct) ! %endstruct ! %struct wxLuaBindCFunc // No constructor as this is read only *************** *** 150,154 **** wxString class_name // added, not in struct ! %endclass */ --- 174,178 ---- wxString class_name // added, not in struct ! %endstruct */ Index: override.hpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxlua/override.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** override.hpp 14 Jun 2007 05:02:45 -0000 1.2 --- override.hpp 16 Jun 2007 06:21:42 -0000 1.3 *************** *** 32,35 **** --- 32,123 ---- %end + %override wxLua_function_GetTrackedTopLevelWindows + // %function LuaTable GetTrackedTopLevelWindows() + static int LUACALL wxLua_function_GetTrackedTopLevelWindows(lua_State *L) + { + wxLuaState wxlState(L); + wxArrayString strArr = wxlState.GetTrackedWindowStrings(); + size_t n, count = strArr.GetCount(); + long val = 0; + lua_createtable(L, 0, count); + + for (n = 0; n < count; ++n) + { + lua_pushstring(L, wx2lua(strArr[n].BeforeLast(wxT(' ')))); + strArr[n].AfterLast(wxT(' ')).ToLong(&val); + lua_pushnumber(L, (double)val); + lua_rawset(L, -3); + } + + return 1; + } + %end + + %override wxLua_function_GetTrackedUserData + // %function LuaTable GetTrackedUserData() + static int LUACALL wxLua_function_GetTrackedUserData(lua_State *L) + { + wxLuaState wxlState(L); + wxArrayString strArr = wxlState.GetTrackedObjectStrings(); + size_t n, count = strArr.GetCount(); + long val = 0; + lua_createtable(L, 0, count); + + for (n = 0; n < count; ++n) + { + lua_pushstring(L, wx2lua(strArr[n].BeforeLast(wxT(' ')))); + strArr[n].AfterLast(wxT(' ')).ToLong(&val); + lua_pushnumber(L, (double)val); + lua_rawset(L, -3); + } + + return 1; + } + %end + + %override wxLua_function_GetTrackedEventCallbacks + // %function LuaTable GetTrackedEventCallbacks() + static int LUACALL wxLua_function_GetTrackedEventCallbacks(lua_State *L) + { + wxLuaState wxlState(L); + wxArrayString strArr = wxlState.GetTrackedCallbackStrings(); + size_t n, count = strArr.GetCount(); + long val = 0; + lua_createtable(L, 0, count); + + for (n = 0; n < count; ++n) + { + lua_pushstring(L, wx2lua(strArr[n].BeforeFirst(wxT(' ')))); + strArr[n].AfterLast(wxT(' ')).ToLong(&val); + lua_pushnumber(L, (double)val); + lua_rawset(L, -3); + } + + return 1; + } + %end + + %override wxLua_function_GetTrackedWindows + // %function LuaTable GetTrackedWindows() + static int LUACALL wxLua_function_GetTrackedWindows(lua_State *L) + { + wxLuaState wxlState(L); + wxArrayString strArr = wxlState.GetTrackedWinDestroyCallbackStrings(); + size_t n, count = strArr.GetCount(); + long val = 0; + lua_createtable(L, 0, count); + + for (n = 0; n < count; ++n) + { + lua_pushstring(L, wx2lua(strArr[n].BeforeLast(wxT(' ')))); + strArr[n].AfterLast(wxT(' ')).ToLong(&val); + lua_pushnumber(L, (double)val); + lua_rawset(L, -3); + } + + return 1; + } + %end + %override wxLua_function_wxlua_typename // %function wxString wxlua_getwxluatypename(int wxluaarg_tag) |