From: John L. <jr...@us...> - 2006-02-03 04:54:06
|
Update of /cvsroot/wxlua/wxLua/apps/wxlua/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24553/wxLua/apps/wxlua/src Modified Files: lconsole.cpp wxlua.cpp wxlua.h Log Message: -1 to wxID_ANY match #if #endif with comment of #if statement Move CreateStandAloneBitmaps from internal.cpp to wxlua.cpp, the app allow %rename for enums in genwxbind.lua, remove #defines in internal.h (a hack) Index: wxlua.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxlua/src/wxlua.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** wxlua.cpp 29 Jan 2006 15:45:39 -0000 1.13 --- wxlua.cpp 3 Feb 2006 04:53:57 -0000 1.14 *************** *** 35,39 **** #include "wxluadebug/include/splttree.h" #include "wxluadebug/include/staktree.h" ! #endif #include "art/wxluasmall.xpm" --- 35,39 ---- #include "wxluadebug/include/splttree.h" #include "wxluadebug/include/staktree.h" ! #endif // wxCHECK_VERSION(2, 3, 0) #include "art/wxluasmall.xpm" *************** *** 48,51 **** --- 48,118 ---- // --------------------------------------------------------------------------- + // CreateStandaloneBitmaps + // --------------------------------------------------------------------------- + + extern int s_wxluatag_wxBitmap; // declared in wxbind module + + int LUACALL CreateStandaloneBitmaps(lua_State *L) + { + #include "art/new.xpm" + #include "art/open.xpm" + #include "art/save.xpm" + #include "art/saveall.xpm" + #include "art/cut.xpm" + #include "art/copy.xpm" + #include "art/paste.xpm" + #include "art/help.xpm" + + wxCHECK_MSG(s_wxluatag_wxBitmap != -1, 1, wxT("wxBitmap is not wrapped by wxLua")); + + wxLuaState wxlState(L); + wxCHECK_MSG(wxlState.Ok(), 0, wxT("Invalid wxLuaState")); + + wxBitmap *returns; + + returns = new wxBitmap(new_xpm); + wxlState.addToTrackedMemoryList(returns); + wxlState.pushuserdatatype(s_wxluatag_wxBitmap, returns ); + lua_setglobal(L, "newBitmap"); + + returns = new wxBitmap(open_xpm); + wxlState.addToTrackedMemoryList(returns); + wxlState.pushuserdatatype(s_wxluatag_wxBitmap, returns ); + lua_setglobal(L, "openBitmap"); + + returns = new wxBitmap(save_xpm); + wxlState.addToTrackedMemoryList(returns); + wxlState.pushuserdatatype(s_wxluatag_wxBitmap, returns ); + lua_setglobal(L, "saveBitmap"); + + returns = new wxBitmap(saveall_xpm); + wxlState.addToTrackedMemoryList(returns); + wxlState.pushuserdatatype(s_wxluatag_wxBitmap, returns ); + lua_setglobal(L, "saveAllBitmap"); + + returns = new wxBitmap(cut_xpm); + wxlState.addToTrackedMemoryList(returns); + wxlState.pushuserdatatype(s_wxluatag_wxBitmap, returns ); + lua_setglobal(L, "cutBitmap"); + + returns = new wxBitmap(copy_xpm); + wxlState.addToTrackedMemoryList(returns); + wxlState.pushuserdatatype(s_wxluatag_wxBitmap, returns ); + lua_setglobal(L, "copyBitmap"); + + returns = new wxBitmap(paste_xpm); + wxlState.addToTrackedMemoryList(returns); + wxlState.pushuserdatatype(s_wxluatag_wxBitmap, returns ); + lua_setglobal(L, "pasteBitmap"); + + returns = new wxBitmap(help_xpm); + wxlState.addToTrackedMemoryList(returns); + wxlState.pushuserdatatype(s_wxluatag_wxBitmap, returns ); + lua_setglobal(L, "helpBitmap"); + + return 0; + } + + // --------------------------------------------------------------------------- // LuaHandler - routes commands from the wxLuaHandler to the app // --------------------------------------------------------------------------- *************** *** 91,99 **** BEGIN_EVENT_TABLE(wxLuaStandaloneApp, wxApp) ! EVT_LUA_CONSOLE (-1, wxLuaStandaloneApp::OnLua) ! EVT_LUA_WARNING (-1, wxLuaStandaloneApp::OnLua) ! EVT_LUA_ERROR (-1, wxLuaStandaloneApp::OnLua) ! EVT_LUA_DEBUG_HOOK (-1, wxLuaStandaloneApp::OnLua) ! EVT_LUA_SHUTDOWN (-1, wxLuaStandaloneApp::OnLua) EVT_WXLUA_DEBUG_STACK_ENUM(wxLuaStandaloneApp::OnDebugStackEnum) EVT_WXLUA_DEBUG_STACK_ENTRY_ENUM(wxLuaStandaloneApp::OnDebugStackEntryEnum) --- 158,166 ---- BEGIN_EVENT_TABLE(wxLuaStandaloneApp, wxApp) ! EVT_LUA_CONSOLE (wxID_ANY, wxLuaStandaloneApp::OnLua) ! EVT_LUA_WARNING (wxID_ANY, wxLuaStandaloneApp::OnLua) ! EVT_LUA_ERROR (wxID_ANY, wxLuaStandaloneApp::OnLua) ! EVT_LUA_DEBUG_HOOK (wxID_ANY, wxLuaStandaloneApp::OnLua) ! EVT_LUA_SHUTDOWN (wxID_ANY, wxLuaStandaloneApp::OnLua) EVT_WXLUA_DEBUG_STACK_ENUM(wxLuaStandaloneApp::OnDebugStackEnum) EVT_WXLUA_DEBUG_STACK_ENTRY_ENUM(wxLuaStandaloneApp::OnDebugStackEntryEnum) *************** *** 112,116 **** WORD wVersionRequested = MAKEWORD(1, 1); WSAStartup(wVersionRequested, &wsaData); ! #endif g_strProgramName = argv[0]; --- 179,183 ---- WORD wVersionRequested = MAKEWORD(1, 1); WSAStartup(wVersionRequested, &wsaData); ! #endif // defined(__WXMSW__) && wxCHECK_VERSION(2, 3, 3) g_strProgramName = argv[0]; *************** *** 120,127 **** #if wxCHECK_VERSION(2, 3, 0) m_pDebugTarget = NULL; ! #endif #ifdef __WXMSW__ m_pConsole = NULL; ! #endif // Initialize lua --- 187,194 ---- #if wxCHECK_VERSION(2, 3, 0) m_pDebugTarget = NULL; ! #endif // wxCHECK_VERSION(2, 3, 0) #ifdef __WXMSW__ m_pConsole = NULL; ! #endif // __WXMSW__ // Initialize lua *************** *** 157,161 **** if (argc == 2 && *argv[1] == wxT('-')) { ! #if wxCHECK_VERSION(2, 3, 0) // Check if we are launched as a debuggee if (wxStrlen(argv[1]) > 2 && argv[1][1] == wxT('d')) --- 224,228 ---- if (argc == 2 && *argv[1] == wxT('-')) { ! #if wxCHECK_VERSION(2, 3, 0) // Check if we are launched as a debuggee if (wxStrlen(argv[1]) > 2 && argv[1][1] == wxT('d')) *************** *** 179,184 **** return FALSE; } ! #endif ! #ifdef __WXMSW__ // Check if we are to display the console if ((wxStrlen(argv[1]) == 2) && (argv[1][1] == wxT('c'))) --- 246,251 ---- return FALSE; } ! #endif // wxCHECK_VERSION(2, 3, 0) ! #ifdef __WXMSW__ // Check if we are to display the console if ((wxStrlen(argv[1]) == 2) && (argv[1][1] == wxT('c'))) *************** *** 196,200 **** } else ! #endif // See if a file has been specified that we are to edit if ((wxStrlen(argv[1]) > 2) && (argv[1][1] == wxT('e'))) --- 263,267 ---- } else ! #endif // __WXMSW__ // See if a file has been specified that we are to edit if ((wxStrlen(argv[1]) > 2) && (argv[1][1] == wxT('e'))) *************** *** 224,228 **** } else ! #endif // execute the program using argc, argv; for (int idx = 1; idx < argc; ++idx) --- 291,295 ---- } else ! #endif // wxCHECK_VERSION(2, 3, 0) || defined(__WXMSW__) // execute the program using argc, argv; for (int idx = 1; idx < argc; ++idx) *************** *** 236,240 **** } else ! #endif // See if we are to run the specified file with command-line arguments. if (wxStrlen(argv[idx]) > 2 && argv[idx][0] == wxT('-') && argv[idx][1] == wxT('f')) --- 303,307 ---- } else ! #endif // __WXMSW__ // See if we are to run the specified file with command-line arguments. if (wxStrlen(argv[idx]) > 2 && argv[idx][0] == wxT('-') && argv[idx][1] == wxT('f')) *************** *** 294,298 **** #else return fOk; ! #endif } --- 361,365 ---- #else return fOk; ! #endif // __WXMSW__ } *************** *** 307,311 **** m_pDebugTarget = NULL; } ! #endif if (m_fMemoryBitmapAdded) --- 374,378 ---- m_pDebugTarget = NULL; } ! #endif // wxCHECK_VERSION(2, 3, 0) if (m_fMemoryBitmapAdded) *************** *** 322,326 **** #if defined(__WXMSW__) && wxCHECK_VERSION(2, 3, 3) WSACleanup (); ! #endif return 0; --- 389,393 ---- #if defined(__WXMSW__) && wxCHECK_VERSION(2, 3, 3) WSACleanup (); ! #endif // defined(__WXMSW__) && wxCHECK_VERSION(2, 3, 3) return 0; *************** *** 338,342 **** #else wxPrintf(wxT("%s\n"), event.GetString().c_str()); ! #endif } else if (event.GetEventType() == wxEVT_LUA_ERROR) --- 405,409 ---- #else wxPrintf(wxT("%s\n"), event.GetString().c_str()); ! #endif // __WXMSW__ } else if (event.GetEventType() == wxEVT_LUA_ERROR) *************** *** 359,363 **** wxGetApp().SetStackFrame(NULL); pStackFrame->Destroy(); ! #endif return 0; } --- 426,430 ---- wxGetApp().SetStackFrame(NULL); pStackFrame->Destroy(); ! #endif // wxCHECK_VERSION(2, 3, 0) return 0; } *************** *** 399,403 **** #else fprintf(stderr, wx2lua(errorStr)); ! #endif } } --- 466,470 ---- #else fprintf(stderr, wx2lua(errorStr)); ! #endif // __WXMSW__ } } *************** *** 417,421 **** m_pStackFrame->FillStackCombobox(event.GetDebugData()); else ! #endif event.Skip(); } --- 484,488 ---- m_pStackFrame->FillStackCombobox(event.GetDebugData()); else ! #endif // wxCHECK_VERSION(2, 3, 0) event.Skip(); } *************** *** 427,431 **** m_pStackFrame->FillStackEntry(event.GetReference(), event.GetDebugData()); else ! #endif event.Skip(); } --- 494,498 ---- m_pStackFrame->FillStackEntry(event.GetReference(), event.GetDebugData()); else ! #endif // wxCHECK_VERSION(2, 3, 0) event.Skip(); } *************** *** 437,441 **** m_pStackFrame->FillTableEntry(wxTreeItemId((wxTreeItemIdValue)event.GetReference()), event.GetDebugData()); else ! #endif event.Skip(); } --- 504,508 ---- m_pStackFrame->FillTableEntry(wxTreeItemId((wxTreeItemIdValue)event.GetReference()), event.GetDebugData()); else ! #endif // wxCHECK_VERSION(2, 3, 0) event.Skip(); } Index: wxlua.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxlua/src/wxlua.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** wxlua.h 22 Dec 2005 18:42:33 -0000 1.9 --- wxlua.h 3 Feb 2006 04:53:57 -0000 1.10 *************** *** 47,51 **** #ifdef __WXMSW__ void SetLuaConsole(wxLuaConsole *pConsole) { m_pConsole = pConsole; } ! #endif void SetStackFrame(wxLuaStackFrame *pStackFrame) { m_pStackFrame = pStackFrame; } --- 47,51 ---- #ifdef __WXMSW__ void SetLuaConsole(wxLuaConsole *pConsole) { m_pConsole = pConsole; } ! #endif // __WXMSW__ void SetStackFrame(wxLuaStackFrame *pStackFrame) { m_pStackFrame = pStackFrame; } *************** *** 72,80 **** #ifdef __WXMSW__ wxLuaConsole *m_pConsole; ! #endif bool m_fMemoryBitmapAdded; #if wxCHECK_VERSION(2, 3, 0) ! wxLuaDebugTarget *m_pDebugTarget; ! #endif DECLARE_EVENT_TABLE(); --- 72,80 ---- #ifdef __WXMSW__ wxLuaConsole *m_pConsole; ! #endif // __WXMSW__ bool m_fMemoryBitmapAdded; #if wxCHECK_VERSION(2, 3, 0) ! wxLuaDebugTarget *m_pDebugTarget; ! #endif // wxCHECK_VERSION(2, 3, 0) DECLARE_EVENT_TABLE(); *************** *** 83,85 **** DECLARE_APP(wxLuaStandaloneApp) ! #endif --- 83,85 ---- DECLARE_APP(wxLuaStandaloneApp) ! #endif // WX_LUAAPP_H Index: lconsole.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxlua/src/lconsole.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** lconsole.cpp 29 Jan 2006 15:45:39 -0000 1.5 --- lconsole.cpp 3 Feb 2006 04:53:57 -0000 1.6 *************** *** 47,51 **** { m_listBox = new wxListBox( this, ! -1, wxPoint(0, 20), wxSize(0, 130), --- 47,51 ---- { m_listBox = new wxListBox( this, ! wxID_ANY, wxPoint(0, 20), wxSize(0, 130), *************** *** 115,119 **** wxLuaConsole::wxLuaConsole(wxLuaStandaloneApp *pApp, lua_State *pState) ! : wxFrame(0, -1, wxT("wxLua Console"), wxPoint(0, 0), wxSize(250, 340)), m_pApp(pApp), m_fError(false) { --- 115,119 ---- wxLuaConsole::wxLuaConsole(wxLuaStandaloneApp *pApp, lua_State *pState) ! : wxFrame(0, wxID_ANY, wxT("wxLua Console"), wxPoint(0, 0), wxSize(250, 340)), m_pApp(pApp), m_fError(false) { *************** *** 125,134 **** m_splitter = new wxSplitterWindow(this, ! -1, wxPoint(0, 0), wxSize(0, 0), wxSP_3DSASH); m_textCtrl = new wxTextCtrl( m_splitter, ! -1, wxT(""), wxPoint(0, 0), --- 125,134 ---- m_splitter = new wxSplitterWindow(this, ! wxID_ANY, wxPoint(0, 0), wxSize(0, 0), wxSP_3DSASH); m_textCtrl = new wxTextCtrl( m_splitter, ! wxID_ANY, wxT(""), wxPoint(0, 0), |