From: John L. <jr...@us...> - 2007-05-19 02:05:50
|
Update of /cvsroot/wxlua/wxLua/modules/wxbind/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv11964/wxLua/modules/wxbind/src Modified Files: Makefile defsutil.cpp wx_bind.cpp Log Message: Make wxProcess Kill and Exists functions %staticonly Remove all exception code from wxLuaSocket code (debugger code) Rename wxLuaSocket to wxLuaCSocket and move wxLuaDebuggerSocket to wxLuawxSocket we have two options C or wx sockets now... both work in 2.8 GTK2 Lots of reorganization in server and socket code Update the editor.wx.lua for new code and only Delete() the debugger server in EVT_IDLE to give it a chance to exit gracefully Index: wx_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wx_bind.cpp,v retrieving revision 1.91 retrieving revision 1.92 diff -C2 -d -r1.91 -r1.92 *** wx_bind.cpp 19 Mar 2007 03:47:20 -0000 1.91 --- wx_bind.cpp 19 May 2007 02:05:46 -0000 1.92 *************** *** 1982,1986 **** --- 1982,1988 ---- { "wxKILL_ACCESS_DENIED", wxKILL_ACCESS_DENIED }, { "wxKILL_BAD_SIGNAL", wxKILL_BAD_SIGNAL }, + { "wxKILL_CHILDREN", wxKILL_CHILDREN }, { "wxKILL_ERROR", wxKILL_ERROR }, + { "wxKILL_NOCHILDREN", wxKILL_NOCHILDREN }, { "wxKILL_NO_PROCESS", wxKILL_NO_PROCESS }, { "wxKILL_OK", wxKILL_OK }, *************** *** 6103,6106 **** --- 6105,6135 ---- #endif // (wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxJoystick && wxUSE_JOYSTICK) + #if wxLUA_USE_wxProcess + static wxLuaArgTag s_wxluatagArray_wxLua_function_wxKill[] = { &s_wxluaarg_Number, &s_wxluaarg_Enumeration, &s_wxluaarg_LightUserData, &s_wxluaarg_Number, 0 }; + // %function int wxKill(long pid, wxSignal sig = wxSIGTERM, wxKillError *rc = NULL, int flags = 0) + static int LUACALL wxLua_function_wxKill(lua_State *L) + { + wxLuaState wxlState(L); + int returns; + // get number of arguments + int argCount = lua_gettop(L); + // int flags = 0 + int flags = (argCount >= 4 ? (int)wxlState.GetNumberType(4) : 0); + // wxKillError rc = NULL + wxKillError * rc = (argCount >= 3 ? (wxKillError *)wxlState.ttouserdata(3) : NULL); + // wxSignal sig = wxSIGTERM + wxSignal sig = (argCount >= 2 ? (wxSignal)wxlState.GetEnumerationType(2) : wxSIGTERM); + // long pid + long pid = (long)wxlState.GetNumberType(1); + // call wxKill + returns = wxKill(pid, sig, rc, flags); + // push the result number + lua_pushnumber(L, returns); + + return 1; + } + + #endif // wxLUA_USE_wxProcess + static wxLuaArgTag s_wxluatagArray_wxLua_function_wxLaunchDefaultBrowser[] = { &s_wxluaarg_String, 0 }; // %function bool wxLaunchDefaultBrowser(const wxString& sUrl) *************** *** 6275,6278 **** --- 6304,6348 ---- + #if wxLUA_USE_wxProcess + static wxLuaArgTag s_wxluatagArray_wxLua_wxProcess_Exists[] = { &s_wxluaarg_Number, 0 }; + // %staticonly bool Exists(int pid) + static int LUACALL wxLua_wxProcess_Exists(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // int pid + int pid = (int)wxlState.GetNumberType(1); + // call Exists + returns = wxProcess::Exists(pid); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxProcess_Kill[] = { &s_wxluaarg_Number, &s_wxluaarg_Enumeration, &s_wxluaarg_Number, 0 }; + // %staticonly wxKillError Kill(int pid, wxSignal sig = wxSIGTERM, int flags = wxKILL_NOCHILDREN) + static int LUACALL wxLua_wxProcess_Kill(lua_State *L) + { + wxLuaState wxlState(L); + wxKillError returns; + // get number of arguments + int argCount = lua_gettop(L); + // int flags = wxKILL_NOCHILDREN + int flags = (argCount >= 3 ? (int)wxlState.GetNumberType(3) : wxKILL_NOCHILDREN); + // wxSignal sig = wxSIGTERM + wxSignal sig = (argCount >= 2 ? (wxSignal)wxlState.GetEnumerationType(2) : wxSIGTERM); + // int pid + int pid = (int)wxlState.GetNumberType(1); + // call Kill + returns = wxProcess::Kill(pid, sig, flags); + // push the result number + lua_pushnumber(L, returns); + + return 1; + } + + #endif // wxLUA_USE_wxProcess + #if wxCHECK_VERSION(2,8,0) static wxLuaArgTag s_wxluatagArray_wxLua_function_wxRealPath[] = { &s_wxluaarg_String, 0 }; *************** *** 7151,7154 **** --- 7221,7228 ---- #endif // (wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxJoystick && wxUSE_JOYSTICK) + #if wxLUA_USE_wxProcess + { LuaGlobal, "wxKill", wxLua_function_wxKill, 4, 1, s_wxluatagArray_wxLua_function_wxKill }, + #endif // wxLUA_USE_wxProcess + { LuaGlobal, "wxLaunchDefaultBrowser", wxLua_function_wxLaunchDefaultBrowser, 1, 1, s_wxluatagArray_wxLua_function_wxLaunchDefaultBrowser }, { LuaGlobal, "wxMatchWild", wxLua_function_wxMatchWild, 3, 3, s_wxluatagArray_wxLua_function_wxMatchWild }, *************** *** 7166,7169 **** --- 7240,7248 ---- { LuaGlobal, "wxPostEvent", wxLua_function_wxPostEvent, 2, 2, s_wxluatagArray_wxLua_function_wxPostEvent }, + #if wxLUA_USE_wxProcess + { LuaGlobal, "wxProcess_Exists", wxLua_wxProcess_Exists, 1, 1, s_wxluatagArray_wxLua_wxProcess_Exists }, + { LuaGlobal, "wxProcess_Kill", wxLua_wxProcess_Kill, 3, 1, s_wxluatagArray_wxLua_wxProcess_Kill }, + #endif // wxLUA_USE_wxProcess + #if wxCHECK_VERSION(2,8,0) { LuaGlobal, "wxRealPath", wxLua_function_wxRealPath, 1, 1, s_wxluatagArray_wxLua_function_wxRealPath }, Index: Makefile =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/Makefile,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Makefile 21 Dec 2006 06:02:03 -0000 1.11 --- Makefile 19 May 2007 02:05:46 -0000 1.12 *************** *** 39,43 **** CXX = $(WXCXX) ! APPEXTRADEFS = -I$(WXLUA_WXLUASETUP_DIR) -I$(WXLUA_DIR) -I$(WXLUA_DIR)/modules -I$(WXLUA_DIR)/modules/lua/include -I$(WXPREFIX)/contrib/include -fexceptions -DLUACALL= WXBIND_TARGET_LIBNAME = lib$(WXBASENAME)_wxluabind-$(WXRELEASE) --- 39,43 ---- CXX = $(WXCXX) ! APPEXTRADEFS = -I$(WXLUA_WXLUASETUP_DIR) -I$(WXLUA_DIR) -I$(WXLUA_DIR)/modules -I$(WXLUA_DIR)/modules/lua/include -I$(WXPREFIX)/contrib/include -DLUACALL= WXBIND_TARGET_LIBNAME = lib$(WXBASENAME)_wxluabind-$(WXRELEASE) Index: defsutil.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/defsutil.cpp,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** defsutil.cpp 19 Mar 2007 03:47:18 -0000 1.30 --- defsutil.cpp 19 May 2007 02:05:46 -0000 1.31 *************** *** 76,95 **** } - static wxLuaArgTag s_wxluatagArray_wxLua_wxProcess_Exists[] = { &s_wxluaarg_Number, 0 }; - // static bool Exists(int pid) - static int LUACALL wxLua_wxProcess_Exists(lua_State *L) - { - wxLuaState wxlState(L); - bool returns; - // int pid - int pid = (int)wxlState.GetNumberType(2); - // call Exists - returns = wxProcess::Exists(pid); - // push the result flag - lua_pushboolean(L, returns); - - return 1; - } - #endif // wxLUA_USE_wxProcess --- 76,79 ---- *************** *** 206,231 **** } - static wxLuaArgTag s_wxluatagArray_wxLua_wxProcess_Kill[] = { &s_wxluaarg_Number, &s_wxluaarg_Enumeration, &s_wxluaarg_Number, 0 }; - // static wxKillError Kill(int pid, wxSignal sig = wxSIGTERM, int flags = wxKILL_NOCHILDREN) - static int LUACALL wxLua_wxProcess_Kill(lua_State *L) - { - wxLuaState wxlState(L); - wxKillError returns; - // get number of arguments - int argCount = lua_gettop(L); - // int flags = wxKILL_NOCHILDREN - int flags = (argCount >= 4 ? (int)wxlState.GetNumberType(4) : wxKILL_NOCHILDREN); - // wxSignal sig = wxSIGTERM - wxSignal sig = (argCount >= 3 ? (wxSignal)wxlState.GetEnumerationType(3) : wxSIGTERM); - // int pid - int pid = (int)wxlState.GetNumberType(2); - // call Kill - returns = wxProcess::Kill(pid, sig, flags); - // push the result number - lua_pushnumber(L, returns); - - return 1; - } - static wxLuaArgTag s_wxluatagArray_wxLua_wxProcess_Open[] = { &s_wxluaarg_String, &s_wxluaarg_Number, 0 }; // static wxProcess *Open(const wxString& cmd, int flags = wxEXEC_ASYNC) --- 190,193 ---- *************** *** 319,323 **** { LuaMethod, "Delete", wxLua_wxProcess_Delete, 0, 0, s_wxluaargArray_None }, { LuaMethod, "Detach", wxLua_wxProcess_Detach, 0, 0, s_wxluaargArray_None }, - { LuaMethod, "Exists", wxLua_wxProcess_Exists, 1, 1, s_wxluatagArray_wxLua_wxProcess_Exists }, #if ((wxUSE_STREAMS) && (wxLUA_USE_wxProcess)) && (wxUSE_STREAMS) --- 281,284 ---- *************** *** 334,338 **** { LuaMethod, "IsRedirected", wxLua_wxProcess_IsRedirected, 0, 0, s_wxluaargArray_None }, - { LuaMethod, "Kill", wxLua_wxProcess_Kill, 3, 1, s_wxluatagArray_wxLua_wxProcess_Kill }, { LuaMethod, "Open", wxLua_wxProcess_Open, 2, 1, s_wxluatagArray_wxLua_wxProcess_Open }, { LuaMethod, "Redirect", wxLua_wxProcess_Redirect, 0, 0, s_wxluaargArray_None }, --- 295,298 ---- |