From: John L. <jr...@us...> - 2005-11-29 23:52:21
|
Update of /cvsroot/wxlua/wxLua/modules/wxlua/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1493/wxLua/modules/wxlua/src Modified Files: internal.cpp wxlbind.cpp wxlcallb.cpp wxlstate.cpp Log Message: reorder libs in apps.bkl and rebake, (remove -- in bkl, got error) pulled in generic code in wxLuaInterface into the wxLuaState Index: internal.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/internal.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** internal.cpp 29 Nov 2005 05:57:12 -0000 1.17 --- internal.cpp 29 Nov 2005 23:52:12 -0000 1.18 *************** *** 45,56 **** extern wxLuaInterpreter *wxFindLuaInterpreter(lua_State *L); - extern int wxLuaEventListCompareFn(const void *p1, const void *p2); // in wxlbind.cpp - extern int s_wxluatag_wxBitmap; extern int s_wxluatag_wxEvtHandler; // lua registry table ! const char wxLuaReferences[] = "wxLuaReferences"; ! const char wxLuaNull[] = "wxNull"; wxString GetSourceLine(lua_State *L) --- 45,54 ---- extern wxLuaInterpreter *wxFindLuaInterpreter(lua_State *L); extern int s_wxluatag_wxBitmap; extern int s_wxluatag_wxEvtHandler; // lua registry table ! const char* wxLuaReferences = "wxLuaReferences"; ! const char* wxLuaNull = "wxNull"; wxString GetSourceLine(lua_State *L) Index: wxlstate.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlstate.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** wxlstate.cpp 29 Nov 2005 05:45:09 -0000 1.9 --- wxlstate.cpp 29 Nov 2005 23:52:12 -0000 1.10 *************** *** 48,57 **** extern int wxLuaEventListCompareFn(const void *p1, const void *p2); // wxlbind.cpp extern int wxLuaClassListCompareByTag(const void *p1, const void *p2); // wxlbind.cpp ! const char *wxLuaReferences; // in internal.cpp ! const char *wxLuaNull; // in internal.cpp extern int s_wxluatag_wxWindow; ! wxLuaState wxNullLuaState; // ---------------------------------------------------------------------------- --- 48,57 ---- extern int wxLuaEventListCompareFn(const void *p1, const void *p2); // wxlbind.cpp extern int wxLuaClassListCompareByTag(const void *p1, const void *p2); // wxlbind.cpp ! ! extern const char* wxLuaNull; extern int s_wxluatag_wxWindow; ! wxLuaState wxNullLuaState(false); // ---------------------------------------------------------------------------- *************** *** 217,221 **** wxLuaBindingList::Node *node; ! for (node = wxLuaBinding::GetBindingsList()->GetFirst(); node; node = node->GetNext() ) { wxLuaBinding* binding = node->GetData(); --- 217,221 ---- wxLuaBindingList::Node *node; ! for (node = wxLuaBinding::GetBindingList()->GetFirst(); node; node = node->GetNext() ) { wxLuaBinding* binding = node->GetData(); *************** *** 557,562 **** // Find binding with given nameSpace ! wxLuaBinding* wxLuaState::GetLuaBinding(const wxString& nameSpace) { wxLuaBindingList::Node *node; for (node = M_WXLSTATEDATA->m_bindings.GetFirst(); node; node = node->GetNext() ) --- 557,563 ---- // Find binding with given nameSpace ! wxLuaBinding* wxLuaState::GetLuaBinding(const wxString& nameSpace) const { + wxCHECK_MSG(GetRefData() != NULL, NULL, wxT("Invalid wxLuaState")); wxLuaBindingList::Node *node; for (node = M_WXLSTATEDATA->m_bindings.GetFirst(); node; node = node->GetNext() ) *************** *** 573,576 **** --- 574,578 ---- const WXLUACLASS* wxLuaState::GetLuaClass(int iClassTag) { + wxCHECK_MSG(GetRefData() != NULL, NULL, wxT("Invalid wxLuaState")); WXLUACLASS classItem; classItem.class_tag = &iClassTag; *************** *** 600,603 **** --- 602,606 ---- const WXLUACLASS* wxLuaState::GetLuaClass(const char* className) { + wxCHECK_MSG(GetRefData() != NULL, NULL, wxT("Invalid wxLuaState")); wxLuaBindingList::Node *node; for (node = M_WXLSTATEDATA->m_bindings.GetFirst(); node; node = node->GetNext() ) *************** *** 622,625 **** --- 625,629 ---- const WXLUACLASS* wxLuaState::GetBaseLuaClass(int iClassTag) { + wxCHECK_MSG(GetRefData() != NULL, NULL, wxT("Invalid wxLuaState")); const WXLUACLASS *pLuaClass = GetLuaClass(iClassTag); if (pLuaClass && (pLuaClass->baseclass_tag != -1)) *************** *** 645,649 **** const WXLUAEVENT* wxLuaState::GetLuaEvent(wxEvent *pEvent) { ! wxCHECK_MSG(pEvent, NULL, wxT("Invalid wxEvent")); WXLUAEVENT eventItem; int eventType = pEvent->GetEventType(); --- 649,653 ---- const WXLUAEVENT* wxLuaState::GetLuaEvent(wxEvent *pEvent) { ! wxCHECK_MSG(Ok() && pEvent, NULL, wxT("Invalid wxLuaState or wxEvent")); WXLUAEVENT eventItem; int eventType = pEvent->GetEventType(); *************** *** 714,718 **** bool wxLuaState::removeTrackedMemory(void *pObject, bool fDelete) { ! wxCHECK_MSG(Ok(), false, wxT("Invalid wxLuaState")) wxObject *pDeleteObject = M_WXLSTATEDATA->m_pTrackedList->Delete((int) pObject); --- 718,722 ---- bool wxLuaState::removeTrackedMemory(void *pObject, bool fDelete) { ! wxCHECK_MSG(Ok() && pObject, false, wxT("Invalid wxLuaState or object")) wxObject *pDeleteObject = M_WXLSTATEDATA->m_pTrackedList->Delete((int) pObject); *************** *** 747,751 **** } ! bool wxLuaState::isWindowTracked(wxWindow *win) const { wxCHECK_MSG(Ok() && win, false, wxT("Invalid wxLuaState or wxWindow")); --- 751,755 ---- } ! bool wxLuaState::isWindowTracked(wxWindow *win, bool check_parents) const { wxCHECK_MSG(Ok() && win, false, wxT("Invalid wxLuaState or wxWindow")); *************** *** 759,763 **** return true; ! parent = parent->GetParent(); } --- 763,767 ---- return true; ! parent = check_parents ? parent->GetParent() : NULL; } *************** *** 1685,1688 **** --- 1689,1697 ---- // lua_pushvalue(m_state, object); //} + void wxLuaState::PushNil() + { + wxCHECK_RET(Ok(), wxT("Invalid wxLuaState")); + lua_pushnil(M_WXLSTATEDATA->m_lua_State); + } void wxLuaState::Remove(int index) { *************** *** 1690,1693 **** --- 1699,1712 ---- lua_remove(M_WXLSTATEDATA->m_lua_State, index); } + void wxLuaState::Pop(int count) + { + wxCHECK_RET(Ok(), wxT("Invalid wxLuaState")); + lua_pop(M_WXLSTATEDATA->m_lua_State, count); + } + int wxLuaState::Next(int index) + { + wxCHECK_MSG(Ok(), 0, wxT("Invalid wxLuaState")); + return lua_next(M_WXLSTATEDATA->m_lua_State, index); + } void wxLuaState::Insert(int index) { *************** *** 1730,1733 **** --- 1749,1804 ---- // Raw lua Arg functions. + void wxLuaState::GetGlobals() + { + wxCHECK_RET(Ok(), wxT("Invalid wxLuaState")); + lua_pushvalue(M_WXLSTATEDATA->m_lua_State, LUA_GLOBALSINDEX); + } + + int wxLuaState::GetN(int index) + { + wxCHECK_MSG(Ok(), 0, wxT("Invalid wxLuaState")); + return luaL_getn(M_WXLSTATEDATA->m_lua_State, index); + } + int wxLuaState::Type(int index) + { + wxCHECK_MSG(Ok(), 0, wxT("Invalid wxLuaState")); + return lua_type(M_WXLSTATEDATA->m_lua_State, index); + } + double wxLuaState::ToNumber(int index) + { + wxCHECK_MSG(Ok(), 0, wxT("Invalid wxLuaState")); + return lua_tonumber(M_WXLSTATEDATA->m_lua_State, index); + } + int wxLuaState::ToBoolean(int index) + { + wxCHECK_MSG(Ok(), 0, wxT("Invalid wxLuaState")); + return lua_toboolean(M_WXLSTATEDATA->m_lua_State, index); + } + wxString wxLuaState::TowxString(int index) + { + wxCHECK_MSG(Ok(), wxEmptyString, wxT("Invalid wxLuaState")); + return lua2wx(lua_tostring(M_WXLSTATEDATA->m_lua_State, index)); + } + const void *wxLuaState::ToPointer(int index) + { + wxCHECK_MSG(Ok(), NULL, wxT("Invalid wxLuaState")); + return lua_topointer(M_WXLSTATEDATA->m_lua_State, index); + } + bool wxLuaState::IsCFunction(int index) + { + wxCHECK_MSG(Ok(), false, wxT("Invalid wxLuaState")); + return lua_iscfunction(M_WXLSTATEDATA->m_lua_State, index) != 0; + } + const void *wxLuaState::ToCFunction(int index) + { + wxCHECK_MSG(Ok(), NULL, wxT("Invalid wxLuaState")); + return (const void *) lua_tocfunction(M_WXLSTATEDATA->m_lua_State, index); + } + const void *wxLuaState::ToUserData(int index) + { + wxCHECK_MSG(Ok(), NULL, wxT("Invalid wxLuaState")); + return lua_touserdata(M_WXLSTATEDATA->m_lua_State, index); + } + int wxLuaState::TypeError(int narg, const char* tname) { Index: wxlbind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlbind.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** wxlbind.cpp 29 Nov 2005 05:45:09 -0000 1.5 --- wxlbind.cpp 29 Nov 2005 23:52:12 -0000 1.6 *************** *** 95,99 **** // create references table in registry ! // lua_pushstring(L, wxLuaReferences); // lua_newtable(L); // lua_rawset(L, LUA_REGISTRYINDEX); --- 95,99 ---- // create references table in registry ! // tpushwxLuaReferences(L); // lua_newtable(L); // lua_rawset(L, LUA_REGISTRYINDEX); Index: wxlcallb.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlcallb.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** wxlcallb.cpp 29 Nov 2005 05:45:09 -0000 1.6 --- wxlcallb.cpp 29 Nov 2005 23:52:12 -0000 1.7 *************** *** 32,36 **** //----------------------------------------------------------------------------- ! IMPLEMENT_ABSTRACT_CLASS(wxLuaCallback, wxEvtHandler); // Encapsulate a lua function reference for use by a event callback --- 32,36 ---- //----------------------------------------------------------------------------- ! IMPLEMENT_ABSTRACT_CLASS(wxLuaCallback, wxEvtHandler) // Encapsulate a lua function reference for use by a event callback *************** *** 162,166 **** // ---------------------------------------------------------------------------- ! IMPLEMENT_ABSTRACT_CLASS(wxLuaDestroyCallback, wxEvtHandler); wxLuaDestroyCallback::wxLuaDestroyCallback(const wxLuaState& state, int id, --- 162,166 ---- // ---------------------------------------------------------------------------- ! IMPLEMENT_ABSTRACT_CLASS(wxLuaDestroyCallback, wxEvtHandler) wxLuaDestroyCallback::wxLuaDestroyCallback(const wxLuaState& state, int id, |