You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(191) |
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
(238) |
Dec
(68) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(104) |
Feb
(518) |
Mar
(302) |
Apr
(211) |
May
(311) |
Jun
(55) |
Jul
(6) |
Aug
(35) |
Sep
(76) |
Oct
(50) |
Nov
(37) |
Dec
(340) |
2007 |
Jan
(23) |
Feb
(107) |
Mar
(98) |
Apr
(60) |
May
(136) |
Jun
(371) |
Jul
(175) |
Aug
(74) |
Sep
(3) |
Oct
(2) |
Nov
(53) |
Dec
(129) |
2008 |
Jan
(337) |
Feb
(23) |
Mar
(18) |
Apr
(4) |
May
(3) |
Jun
|
Jul
|
Aug
(4) |
Sep
|
Oct
(33) |
Nov
|
Dec
(26) |
2009 |
Jan
(4) |
Feb
(1) |
Mar
(15) |
Apr
|
May
(35) |
Jun
(11) |
Jul
|
Aug
|
Sep
(19) |
Oct
(26) |
Nov
(11) |
Dec
(11) |
2010 |
Jan
(4) |
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
(8) |
Sep
|
Oct
|
Nov
(8) |
Dec
(7) |
2011 |
Jan
|
Feb
|
Mar
(4) |
Apr
(8) |
May
(5) |
Jun
(8) |
Jul
(1) |
Aug
|
Sep
|
Oct
(5) |
Nov
(13) |
Dec
|
From: John L. <jr...@us...> - 2007-11-08 23:47:20
|
Update of /cvsroot/wxlua/wxLua/modules/wxlua/include In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv10188/wxLua/modules/wxlua/include Modified Files: wxlbind.h Log Message: Add storage for key and value datatype in wxLuaDebugItem and show it in the stack dialog Index: wxlbind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxlbind.h,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** wxlbind.h 4 Sep 2007 22:21:10 -0000 1.61 --- wxlbind.h 8 Nov 2007 23:47:15 -0000 1.62 *************** *** 49,63 **** // wxlua arg tags for common Lua types ! #define WXLUAARG_None 0 ! #define WXLUAARG_Nil -2 ! #define WXLUAARG_Boolean -3 ! #define WXLUAARG_LightUserData -4 ! #define WXLUAARG_Number -5 ! #define WXLUAARG_String -6 ! #define WXLUAARG_Table -7 ! #define WXLUAARG_Function -8 ! #define WXLUAARG_UserData -9 ! #define WXLUAARG_Thread -10 ! #define WXLUAARG_Integer -11 // Variables used in the wxLuaArgTag member of the wxLuaBindCFunc for --- 49,69 ---- // wxlua arg tags for common Lua types ! #define WXLUAARG_None 0 // LUA_TNONE ! #define WXLUAARG_Unknown -1 // unset and invalid ! #define WXLUAARG_Nil -2 // LUA_TNIL ! #define WXLUAARG_Boolean -3 // LUA_TBOOLEAN ! #define WXLUAARG_LightUserData -4 // LUA_TLIGHTUSERDATA ! #define WXLUAARG_Number -5 // LUA_TNUMBER ! #define WXLUAARG_String -6 // LUA_TSTRING ! #define WXLUAARG_Table -7 // LUA_TTABLE ! #define WXLUAARG_Function -8 // LUA_TFUNCTION ! #define WXLUAARG_UserData -9 // LUA_TUSERDATA ! #define WXLUAARG_Thread -10 // LUA_TTHREAD ! #define WXLUAARG_Integer -11 // LUA_TNUMBER bit wants only an integer ! #define WXLUAARG_CFunction -12 // LUA_TFUNCTION & lua_iscfunction, not a LUA_TXXX ! ! #define WXLUAARG__MIN -13 // Min of the WXLUAARG_XXX values ! ! #define WXLUAARG_TO_POSINDEX(wxlua_arg) (-(wxlua_arg)) // Variables used in the wxLuaArgTag member of the wxLuaBindCFunc for *************** *** 75,78 **** --- 81,85 ---- extern WXDLLIMPEXP_DATA_WXLUA(int) s_wxluaarg_Thread; extern WXDLLIMPEXP_DATA_WXLUA(int) s_wxluaarg_Integer; + extern WXDLLIMPEXP_DATA_WXLUA(int) s_wxluaarg_CFunction; // copies of wxlua arg tags for binding types that are used very often |
From: John L. <jr...@us...> - 2007-11-08 23:47:19
|
Update of /cvsroot/wxlua/wxLua/modules/wxluadebug/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv10188/wxLua/modules/wxluadebug/src Modified Files: wxldebug.cpp wxlstack.cpp Log Message: Add storage for key and value datatype in wxLuaDebugItem and show it in the stack dialog Index: wxlstack.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluadebug/src/wxlstack.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** wxlstack.cpp 8 Aug 2007 22:49:32 -0000 1.15 --- wxlstack.cpp 8 Nov 2007 23:47:15 -0000 1.16 *************** *** 41,44 **** --- 41,46 ---- + #define WXLUAARG_WXLUADATA (WXLUAARG__MIN - 100) + // ---------------------------------------------------------------------------- // wxLuaStackDialog *************** *** 95,100 **** wxBitmap bmp(wxArtProvider::GetIcon(wxART_NORMAL_FILE, wxART_TOOLBAR, wxSize(16,16))); - m_imageList->Add(bmp); // IMG_UNKNOWN m_imageList->Add(bmp); // IMG_NONE m_imageList->Add(CreateBmpString(bmp, wxT("0"))); // IMG_NIL m_imageList->Add(CreateBmpString(bmp, wxT("b"))); // IMG_BOOLEAN --- 97,102 ---- wxBitmap bmp(wxArtProvider::GetIcon(wxART_NORMAL_FILE, wxART_TOOLBAR, wxSize(16,16))); m_imageList->Add(bmp); // IMG_NONE + m_imageList->Add(bmp); // IMG_UNKNOWN m_imageList->Add(CreateBmpString(bmp, wxT("0"))); // IMG_NIL m_imageList->Add(CreateBmpString(bmp, wxT("b"))); // IMG_BOOLEAN *************** *** 106,109 **** --- 108,112 ---- m_imageList->Add(CreateBmpString(bmp, wxT("u"))); // IMG_USERDATA m_imageList->Add(CreateBmpString(bmp, wxT("t"))); // IMG_THREAD + m_imageList->Add(CreateBmpString(bmp, wxT("1"))); // IMG_INTEGER m_imageList->Add(CreateBmpString(bmp, wxT("c"))); // IMG_CFUNCTION m_imageList->Add(wxArtProvider::GetIcon(wxART_NEW_DIR, wxART_TOOLBAR, wxSize(16,16))); // IMG_TABLE_OPEN *************** *** 111,116 **** // ----------------------------------------------------------------------- - m_typeColours[IMG_UNKNOWN] = wxColour(wxT("DARK TURQUOISE")); m_typeColours[IMG_NONE] = wxColour(wxT("DARK TURQUOISE")); m_typeColours[IMG_NIL] = wxColour(wxT("BLACK")); m_typeColours[IMG_BOOLEAN] = wxColour(wxT("FIREBRICK")); --- 114,119 ---- // ----------------------------------------------------------------------- m_typeColours[IMG_NONE] = wxColour(wxT("DARK TURQUOISE")); + m_typeColours[IMG_UNKNOWN] = wxColour(wxT("DARK TURQUOISE")); m_typeColours[IMG_NIL] = wxColour(wxT("BLACK")); m_typeColours[IMG_BOOLEAN] = wxColour(wxT("FIREBRICK")); *************** *** 122,125 **** --- 125,129 ---- m_typeColours[IMG_USERDATA] = wxColour(wxT("CORNFLOWER BLUE")); m_typeColours[IMG_THREAD] = wxColour(wxT("BLACK")); + m_typeColours[IMG_INTEGER] = wxColour(wxT("DARK ORCHID")); m_typeColours[IMG_CFUNCTION] = wxColour(wxT("FOREST GREEN")); m_typeColours[IMG_TABLE_OPEN] = wxColour(wxT("BLUE")); *************** *** 205,213 **** wxLC_REPORT|wxLC_SINGLE_SEL|wxLC_HRULES|wxLC_VRULES ); ! m_listCtrl->SetImageList(m_imageList, wxIMAGE_LIST_SMALL); ! m_listCtrl->InsertColumn(0, wxT("Name"), wxLIST_FORMAT_LEFT, -1); ! m_listCtrl->InsertColumn(1, wxT("Level"), wxLIST_FORMAT_LEFT, -1); ! m_listCtrl->InsertColumn(2, wxT("Type"), wxLIST_FORMAT_LEFT, -1); ! m_listCtrl->InsertColumn(3, wxT("Value"), wxLIST_FORMAT_LEFT, -1); int txt_width = 0, txt_height = 0; --- 209,218 ---- wxLC_REPORT|wxLC_SINGLE_SEL|wxLC_HRULES|wxLC_VRULES ); ! m_listCtrl->SetImageList(m_imageList, wxIMAGE_LIST_SMALL); ! m_listCtrl->InsertColumn(0, wxT("Name"), wxLIST_FORMAT_LEFT, -1); ! m_listCtrl->InsertColumn(1, wxT("Level"), wxLIST_FORMAT_LEFT, -1); ! m_listCtrl->InsertColumn(2, wxT("Key Type"), wxLIST_FORMAT_LEFT, -1); ! m_listCtrl->InsertColumn(3, wxT("Value Type"), wxLIST_FORMAT_LEFT, -1); ! m_listCtrl->InsertColumn(4, wxT("Value"), wxLIST_FORMAT_LEFT, -1); int txt_width = 0, txt_height = 0; *************** *** 215,223 **** m_listCtrl->GetTextExtent(wxT("WWWWWWWWWWWWWWWWWWWW"), &txt_width, &txt_height); m_listCtrl->SetColumnWidth(0, txt_width); ! m_listCtrl->SetColumnWidth(3, txt_width); // make it wide since it's the last m_listCtrl->GetTextExtent(wxT("555:5555"), &txt_width, &txt_height); m_listCtrl->SetColumnWidth(1, txt_width); m_listCtrl->GetTextExtent(wxT("Light User DataX"), &txt_width, &txt_height); m_listCtrl->SetColumnWidth(2, txt_width); // ----------------------------------------------------------------------- --- 220,229 ---- m_listCtrl->GetTextExtent(wxT("WWWWWWWWWWWWWWWWWWWW"), &txt_width, &txt_height); m_listCtrl->SetColumnWidth(0, txt_width); ! m_listCtrl->SetColumnWidth(4, txt_width); // make it wide since it's the last m_listCtrl->GetTextExtent(wxT("555:5555"), &txt_width, &txt_height); m_listCtrl->SetColumnWidth(1, txt_width); m_listCtrl->GetTextExtent(wxT("Light User DataX"), &txt_width, &txt_height); m_listCtrl->SetColumnWidth(2, txt_width); + m_listCtrl->SetColumnWidth(3, txt_width); // ----------------------------------------------------------------------- *************** *** 281,290 **** wxCHECK_MSG(dbgItem, IMG_UNKNOWN, wxT("Invalid wxLuaDebugItem")); ! int img = dbgItem->GetTypeN(); // now fix up the images for special cases if (dbgItem->GetFlagBit(WXLUA_DEBUGITEM_EXPANDED)) img = IMG_TABLE_OPEN; ! else if (dbgItem->GetType() == wxT("wxLuaData")) // our internal data structs img = IMG_TABLE; --- 287,314 ---- wxCHECK_MSG(dbgItem, IMG_UNKNOWN, wxT("Invalid wxLuaDebugItem")); ! //int img = WXLUAARG_TO_POSINDEX(dbgItem->GetValueType()); ! int img = IMG_NONE; ! ! switch (dbgItem->GetValueType()) ! { ! case WXLUAARG_None : img = IMG_NONE; break; ! case WXLUAARG_Unknown : img = IMG_UNKNOWN; break; ! case WXLUAARG_Nil : img = IMG_NIL; break; ! case WXLUAARG_Boolean : img = IMG_BOOLEAN; break; ! case WXLUAARG_LightUserData : img = IMG_LIGHTUSERDATA; break; ! case WXLUAARG_Number : img = IMG_NUMBER; break; ! case WXLUAARG_String : img = IMG_STRING; break; ! case WXLUAARG_Table : img = IMG_TABLE; break; ! case WXLUAARG_Function : img = IMG_LUAFUNCTION; break; ! case WXLUAARG_UserData : img = IMG_USERDATA; break; ! case WXLUAARG_Thread : img = IMG_THREAD; break; ! case WXLUAARG_Integer : img = IMG_INTEGER; break; ! case WXLUAARG_CFunction : img = IMG_CFUNCTION; break; ! } // now fix up the images for special cases if (dbgItem->GetFlagBit(WXLUA_DEBUGITEM_EXPANDED)) img = IMG_TABLE_OPEN; ! else if (dbgItem->GetValueType() == WXLUAARG_WXLUADATA) // our internal data structs img = IMG_TABLE; *************** *** 356,360 **** const wxLuaDebugItem *item = debugData.Item(n); m_stackEntries.Add(item->GetIndex()); ! wxString name(item->GetName()); if (n == count - 1) name += wxT(" (Globals)"); m_stackChoice->Append(name); --- 380,384 ---- const wxLuaDebugItem *item = debugData.Item(n); m_stackEntries.Add(item->GetIndex()); ! wxString name(item->GetKey()); if (n == count - 1) name += wxT(" (Globals)"); m_stackChoice->Append(name); *************** *** 381,386 **** // Add the locals, fake a debug item to get it setup right ! wxLuaDebugItem* localItem = new wxLuaDebugItem(_("Locals"), wxT("table"), ! wxString::Format(wxT("Count %d"), (int)debugData.GetCount()), wxT(""), LUA_NOREF, 0, WXLUA_DEBUGITEM_EXPANDED); wxLuaDebugData localData(true); // this deletes the items --- 405,410 ---- // Add the locals, fake a debug item to get it setup right ! wxLuaDebugItem* localItem = new wxLuaDebugItem(_("Locals"), WXLUAARG_Table, ! wxString::Format(wxT("Count %d"), (int)debugData.GetCount()), WXLUAARG_Table, wxT(""), LUA_NOREF, 0, WXLUA_DEBUGITEM_EXPANDED); wxLuaDebugData localData(true); // this deletes the items *************** *** 461,465 **** wxListItem info; info.SetId(lc_item+1); ! info.SetText(levelStr + item->GetName()); wxLuaStackListData* stkListData = new wxLuaStackListData(n, debugData); info.SetData(stkListData); // we must delete this --- 485,489 ---- wxListItem info; info.SetId(lc_item+1); ! info.SetText(levelStr + item->GetKey()); wxLuaStackListData* stkListData = new wxLuaStackListData(n, debugData); info.SetData(stkListData); // we must delete this *************** *** 468,472 **** if ((img == IMG_TABLE) || (img == IMG_TABLE_OPEN)) { ! wxTreeItemId id = m_treeCtrl->AppendItem(treeId, item->GetName(), -1, -1, new wxLuaStackTreeData(stkListData)); m_treeCtrl->SetItemHasChildren(id); stkListData->m_treeId = id; --- 492,496 ---- if ((img == IMG_TABLE) || (img == IMG_TABLE_OPEN)) { ! wxTreeItemId id = m_treeCtrl->AppendItem(treeId, item->GetKey(), -1, -1, new wxLuaStackTreeData(stkListData)); m_treeCtrl->SetItemHasChildren(id); stkListData->m_treeId = id; *************** *** 488,492 **** m_listCtrl->SetItem(lc_item, 1, wxString::Format(wxT("%d:%d"), level+1, n+1)); ! m_listCtrl->SetItem(lc_item, 2, item->GetType()); // generic listctrl doesn't like showing huge strings, nor \n --- 512,517 ---- m_listCtrl->SetItem(lc_item, 1, wxString::Format(wxT("%d:%d"), level+1, n+1)); ! m_listCtrl->SetItem(lc_item, 2, item->GetKeyTypeString()); ! m_listCtrl->SetItem(lc_item, 3, item->GetValueTypeString()); // generic listctrl doesn't like showing huge strings, nor \n *************** *** 495,499 **** value.Replace(wxT("\n"), wxT("\\n")); value.Replace(wxT("\r"), wxT("\\r")); ! m_listCtrl->SetItem(lc_item, 3, value); } --- 520,524 ---- value.Replace(wxT("\n"), wxT("\\n")); value.Replace(wxT("\r"), wxT("\\r")); ! m_listCtrl->SetItem(lc_item, 4, value); } *************** *** 521,528 **** // note: don't have spaces here since we use them to mark expanded levels ! wxLuaDebugItem* trackedItem = new wxLuaDebugItem(_("Tracked User Data"), wxT("wxLuaData"), wxString::Format(wxT("Count %d"), trackedCount), wxT(""), LUA_NOREF, 0); ! wxLuaDebugItem* callbackItem = new wxLuaDebugItem(_("wxEvent Callbacks"), wxT("wxLuaData"), wxString::Format(wxT("Count %d"), callbackCount), wxT(""), LUA_NOREF, 0); ! wxLuaDebugItem* windowItem = new wxLuaDebugItem(_("Top Level wxWindows"), wxT("wxLuaData"), wxString::Format(wxT("Count %d"), windowCount), wxT(""), LUA_NOREF, 0); ! wxLuaDebugItem* destroyItem = new wxLuaDebugItem(_("wxWindow Destroy List"), wxT("wxLuaData"), wxString::Format(wxT("Count %d"), destroyCount), wxT(""), LUA_NOREF, 0); wxLuaDebugData dataArr(true); // this deletes the items --- 546,553 ---- // note: don't have spaces here since we use them to mark expanded levels ! wxLuaDebugItem* trackedItem = new wxLuaDebugItem(_("Tracked User Data"), WXLUAARG_None, wxString::Format(wxT("Count %d"), trackedCount), WXLUAARG_WXLUADATA, wxT(""), LUA_NOREF, 0); ! wxLuaDebugItem* callbackItem = new wxLuaDebugItem(_("wxEvent Callbacks"), WXLUAARG_None, wxString::Format(wxT("Count %d"), callbackCount), WXLUAARG_WXLUADATA, wxT(""), LUA_NOREF, 0); ! wxLuaDebugItem* windowItem = new wxLuaDebugItem(_("Top Level wxWindows"), WXLUAARG_None, wxString::Format(wxT("Count %d"), windowCount), WXLUAARG_WXLUADATA, wxT(""), LUA_NOREF, 0); ! wxLuaDebugItem* destroyItem = new wxLuaDebugItem(_("wxWindow Destroy List"), WXLUAARG_None, wxString::Format(wxT("Count %d"), destroyCount), WXLUAARG_WXLUADATA, wxT(""), LUA_NOREF, 0); wxLuaDebugData dataArr(true); // this deletes the items *************** *** 814,818 **** // Check and block linked tables already shown, select it and return ! if (debugItem->GetType() == wxT("table")) { wxString val = debugItem->GetValue(); --- 839,843 ---- // Check and block linked tables already shown, select it and return ! if (debugItem->GetValueType() == WXLUAARG_Table) { wxString val = debugItem->GetValue(); *************** *** 846,864 **** // Check our special variables for the wxLuaState data if (m_wxlState.Ok() && ! ((debugItem->GetName() == _("Tracked User Data")) || ! (debugItem->GetName() == _("wxEvent Callbacks")) || ! (debugItem->GetName() == _("Top Level wxWindows")) || ! (debugItem->GetName() == _("wxWindow Destroy List")))) { wxLuaState wxlState(m_wxlState); wxArrayString strArr; ! if (debugItem->GetName() == _("Tracked User Data")) strArr = wxlState.GetTrackedObjectStrings(); ! else if (debugItem->GetName() == _("wxEvent Callbacks")) strArr = wxlState.GetTrackedCallbackStrings(); ! else if (debugItem->GetName() == _("Top Level wxWindows")) strArr = wxlState.GetTrackedWindowStrings(); ! else if (debugItem->GetName() == _("wxWindow Destroy List")) strArr = wxlState.GetTrackedWinDestroyCallbackStrings(); --- 871,889 ---- // Check our special variables for the wxLuaState data if (m_wxlState.Ok() && ! ((debugItem->GetKey() == _("Tracked User Data")) || ! (debugItem->GetKey() == _("wxEvent Callbacks")) || ! (debugItem->GetKey() == _("Top Level wxWindows")) || ! (debugItem->GetKey() == _("wxWindow Destroy List")))) { wxLuaState wxlState(m_wxlState); wxArrayString strArr; ! if (debugItem->GetKey() == _("Tracked User Data")) strArr = wxlState.GetTrackedObjectStrings(); ! else if (debugItem->GetKey() == _("wxEvent Callbacks")) strArr = wxlState.GetTrackedCallbackStrings(); ! else if (debugItem->GetKey() == _("Top Level wxWindows")) strArr = wxlState.GetTrackedWindowStrings(); ! else if (debugItem->GetKey() == _("wxWindow Destroy List")) strArr = wxlState.GetTrackedWinDestroyCallbackStrings(); *************** *** 870,874 **** for (n = 0; n < count; n++) { ! wxLuaDebugItem *item = new wxLuaDebugItem(strArr[n].BeforeLast(wxT(' ')), wxT(""), wxT("Count ")+strArr[n].AfterLast(wxT(' ')), wxT(""), LUA_NOREF, debugItem->GetIndex() + 1); dataArr.Add(item); } --- 895,899 ---- for (n = 0; n < count; n++) { ! wxLuaDebugItem *item = new wxLuaDebugItem(strArr[n].BeforeLast(wxT(' ')), WXLUAARG_None, wxT("Count ")+strArr[n].AfterLast(wxT(' ')), WXLUAARG_None, wxT(""), LUA_NOREF, debugItem->GetIndex() + 1); dataArr.Add(item); } Index: wxldebug.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluadebug/src/wxldebug.cpp,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** wxldebug.cpp 10 Aug 2007 01:41:08 -0000 1.45 --- wxldebug.cpp 8 Nov 2007 23:47:15 -0000 1.46 *************** *** 30,42 **** // wxLuaDebugItem // ---------------------------------------------------------------------------- ! wxLuaDebugItem::wxLuaDebugItem(const wxString &itemName, ! const wxString &itemType, ! const wxString &itemValue, const wxString &itemSource, int lua_ref, int idx, int flag) ! :m_itemName(itemName), m_itemType(itemType), ! m_itemValue(itemValue), m_itemSource(itemSource), m_lua_ref(lua_ref), m_index(idx), m_flag(flag) --- 30,42 ---- // wxLuaDebugItem // ---------------------------------------------------------------------------- ! wxLuaDebugItem::wxLuaDebugItem(const wxString &itemKey, int itemKeyType, ! const wxString &itemValue, int itemValueType, const wxString &itemSource, int lua_ref, int idx, int flag) ! :m_itemKey(itemKey), m_itemKeyType(itemKeyType), ! m_itemValue(itemValue), m_itemValueType(itemValueType), ! m_itemSource(itemSource), m_lua_ref(lua_ref), m_index(idx), m_flag(flag) *************** *** 45,50 **** wxLuaDebugItem::wxLuaDebugItem(const wxLuaDebugItem &dataItem) ! :m_itemName(dataItem.m_itemName), m_itemType(dataItem.m_itemType), ! m_itemValue(dataItem.m_itemValue), m_itemSource(dataItem.m_itemSource), m_lua_ref(dataItem.m_lua_ref), m_index(dataItem.m_index), m_flag(dataItem.m_flag) --- 45,51 ---- wxLuaDebugItem::wxLuaDebugItem(const wxLuaDebugItem &dataItem) ! :m_itemKey(dataItem.m_itemKey), m_itemKeyType(dataItem.m_itemKeyType), ! m_itemValue(dataItem.m_itemValue), m_itemValueType(dataItem.m_itemValueType), ! m_itemSource(dataItem.m_itemSource), m_lua_ref(dataItem.m_lua_ref), m_index(dataItem.m_index), m_flag(dataItem.m_flag) *************** *** 79,95 **** if (create) m_refData = new wxLuaDebugDataRefData; - - // Sanity check to make sure that Lua hasn't changed the items on us - wxCHECK_RET((WXLUA_DEBUGITEM_TNONE == WXLUA_DEBUGITEM_T_SHIFT + LUA_TNONE) || - (WXLUA_DEBUGITEM_TNIL == WXLUA_DEBUGITEM_T_SHIFT + LUA_TNIL) || - (WXLUA_DEBUGITEM_TBOOLEAN == WXLUA_DEBUGITEM_T_SHIFT + LUA_TBOOLEAN) || - (WXLUA_DEBUGITEM_TLIGHTUSERDATA == WXLUA_DEBUGITEM_T_SHIFT + LUA_TLIGHTUSERDATA) || - (WXLUA_DEBUGITEM_TNUMBER == WXLUA_DEBUGITEM_T_SHIFT + LUA_TNUMBER) || - (WXLUA_DEBUGITEM_TSTRING == WXLUA_DEBUGITEM_T_SHIFT + LUA_TSTRING) || - (WXLUA_DEBUGITEM_TTABLE == WXLUA_DEBUGITEM_T_SHIFT + LUA_TTABLE) || - (WXLUA_DEBUGITEM_TFUNCTION == WXLUA_DEBUGITEM_T_SHIFT + LUA_TFUNCTION) || - (WXLUA_DEBUGITEM_TUSERDATA == WXLUA_DEBUGITEM_T_SHIFT + LUA_TUSERDATA) || - (WXLUA_DEBUGITEM_TTHREAD == WXLUA_DEBUGITEM_T_SHIFT + LUA_TTHREAD), - wxT("Lua has changed the order of their types.")); } --- 80,83 ---- *************** *** 141,150 **** int wxLuaDebugData::SortFunction(wxLuaDebugItem *elem1, wxLuaDebugItem *elem2 ) { ! int ret = elem1->GetName().Cmp(elem2->GetName()); if (ret == 0) // can be true for unnamed "(*temporary)" vars { ! ret = elem1->GetType().Cmp(elem2->GetType()); if (ret == 0) ! ret = elem1->GetValue().Cmp(elem2->GetValue()); } --- 129,145 ---- int wxLuaDebugData::SortFunction(wxLuaDebugItem *elem1, wxLuaDebugItem *elem2 ) { ! int ret = elem1->GetKey().Cmp(elem2->GetKey()); ! if (ret == 0) // can be true for unnamed "(*temporary)" vars { ! ret = elem1->GetKeyType() - elem2->GetKeyType(); // shouldn't happen ! if (ret == 0) ! { ! ret = elem1->GetValueType() - elem2->GetValueType(); ! ! if (ret == 0) ! ret = elem1->GetValue().Cmp(elem2->GetValue()); ! } } *************** *** 184,188 **** name = wxString::Format(_("line %u"), currentLine); ! Add(new wxLuaDebugItem(name, wxT(""), wxT(""), source, LUA_NOREF, nIndex, 0)); count++; } --- 179,183 ---- name = wxString::Format(_("line %u"), currentLine); ! Add(new wxLuaDebugItem(name, WXLUAARG_None, wxT(""), WXLUAARG_None, source, LUA_NOREF, nIndex, 0)); count++; } *************** *** 213,222 **** //wxPrintf(wxString(lua_Debug_to_String(luaDebug) + wxT(" lua_getlocal :") + name + wxT("\n")).c_str()); ! wxString type; wxString value; wxString source(lua2wx(luaDebug.source)); ! int flag_type = WXLUA_DEBUGITEM_TUNKNOWN; ! GetTypeValue(wxlState, -1, type, value, &flag_type); int nRef = LUA_NOREF; --- 208,217 ---- //wxPrintf(wxString(lua_Debug_to_String(luaDebug) + wxT(" lua_getlocal :") + name + wxT("\n")).c_str()); ! int wxl_type = WXLUAARG_None; wxString value; wxString source(lua2wx(luaDebug.source)); ! int flag_type = 0; ! GetTypeValue(wxlState, -1, &wxl_type, value); int nRef = LUA_NOREF; *************** *** 236,240 **** lua_pop(L, 1); // remove variable value ! Add(new wxLuaDebugItem(name, type, value, source, nRef, 0, flag_type)); count++; --- 231,235 ---- lua_pop(L, 1); // remove variable value ! Add(new wxLuaDebugItem(name, WXLUAARG_None, value, wxl_type, source, nRef, 0, flag_type)); count++; *************** *** 255,269 **** int count = 0; ! wxString type; wxString value; wxString name; - int flag_type = WXLUA_DEBUGITEM_TUNKNOWN; if ((tableRef == -1) || (tableRef == LUA_GLOBALSINDEX)) { wxlState.GetGlobals(); ! GetTypeValue(wxlState, -1, type, value, &flag_type); int nRef = wxlua_tinsert(L, -1); ! Add(new wxLuaDebugItem(wxT("Globals"), wxT("table"), value, wxT(""), nRef, 0, WXLUA_DEBUGITEM_TTABLE|WXLUA_DEBUGITEM_LUAREFED)); references.Add(nRef); } --- 250,265 ---- int count = 0; ! int wxl_keytype = WXLUAARG_None; ! int wxl_valuetype = WXLUAARG_None; ! int flag_type = 0; wxString value; wxString name; if ((tableRef == -1) || (tableRef == LUA_GLOBALSINDEX)) { wxlState.GetGlobals(); ! GetTypeValue(wxlState, -1, &wxl_valuetype, value); int nRef = wxlua_tinsert(L, -1); ! Add(new wxLuaDebugItem(wxT("Globals"), WXLUAARG_None, value, WXLUAARG_Table, wxT(""), nRef, 0, WXLUA_DEBUGITEM_LUAREFED)); references.Add(nRef); } *************** *** 271,277 **** { wxlState.lua_PushValue(LUA_REGISTRYINDEX); ! GetTypeValue(wxlState, -1, type, value, &flag_type); int nRef = wxlua_tinsert(L, -1); ! Add(new wxLuaDebugItem(wxT("Lua Registry"), wxT("table"), value, wxT(""), nRef, 0, WXLUA_DEBUGITEM_TTABLE|WXLUA_DEBUGITEM_LUAREFED)); references.Add(nRef); } --- 267,273 ---- { wxlState.lua_PushValue(LUA_REGISTRYINDEX); ! GetTypeValue(wxlState, -1, &wxl_valuetype, value); int nRef = wxlua_tinsert(L, -1); ! Add(new wxLuaDebugItem(wxT("Lua Registry"), WXLUAARG_None, value, WXLUAARG_Table, wxT(""), nRef, 0, WXLUA_DEBUGITEM_LUAREFED)); references.Add(nRef); } *************** *** 288,294 **** { // get the index, just want the name=value, type is dummy here ! GetTypeValue(wxlState, -2, type, name); // get the type and value ! GetTypeValue(wxlState, -1, type, value, &flag_type); //wxPrintf(wxT("wxLuaDebugData::EnumerateTable %d type='%s' key='%s' val='%s'\n"), count, type.c_str(), name.c_str(), value.c_str()); --- 284,290 ---- { // get the index, just want the name=value, type is dummy here ! GetTypeValue(wxlState, -2, &wxl_keytype, name); // get the type and value ! GetTypeValue(wxlState, -1, &wxl_valuetype, value); //wxPrintf(wxT("wxLuaDebugData::EnumerateTable %d type='%s' key='%s' val='%s'\n"), count, type.c_str(), name.c_str(), value.c_str()); *************** *** 311,315 **** lua_pop(L, 1); ! Add(new wxLuaDebugItem(name, type, value, wxT(""), nRef, nIndex, flag_type)); count++; } --- 307,311 ---- lua_pop(L, 1); ! Add(new wxLuaDebugItem(name, wxl_keytype, value, wxl_valuetype, wxT(""), nRef, nIndex)); count++; } *************** *** 322,334 **** } ! int wxLuaDebugData::GetTypeValue(const wxLuaState& wxlState, int index, wxString& type, wxString& value, int* flag_type_) { wxCHECK_MSG(wxlState.Ok(), 0, wxT("Invalid wxLuaState")); ! lua_State* L = wxlState.GetLuaState(); ! int l_type = lua_type(L, index); ! int flag_type = WXLUA_DEBUGITEM_TUNKNOWN; ! ! type = wxlua_getwxluatypename(wxlua_getwxluatype(l_type)); switch (l_type) --- 318,328 ---- } ! int wxLuaDebugData::GetTypeValue(const wxLuaState& wxlState, int index, int* wxl_type_, wxString& value) { wxCHECK_MSG(wxlState.Ok(), 0, wxT("Invalid wxLuaState")); ! lua_State* L = wxlState.GetLuaState(); ! int l_type = lua_type(L, index); ! int wxl_type = wxlua_getwxluatype(l_type); switch (l_type) *************** *** 336,370 **** case LUA_TNONE: value = wxEmptyString; - flag_type = WXLUA_DEBUGITEM_TNONE; break; case LUA_TNIL: value = wxT("nil"); - flag_type = WXLUA_DEBUGITEM_TNIL; break; case LUA_TBOOLEAN: value = MakeBoolean(lua_toboolean(L, index)); - flag_type = WXLUA_DEBUGITEM_TBOOLEAN; break; case LUA_TLIGHTUSERDATA: value = GetUserDataInfo(wxlState, index, false); - flag_type = WXLUA_DEBUGITEM_TLIGHTUSERDATA; break; case LUA_TNUMBER: value = MakeNumber(lua_tonumber(L, index)); - flag_type = WXLUA_DEBUGITEM_TNUMBER; break; case LUA_TSTRING: value = lua2wx(lua_tostring(L, index)); - flag_type = WXLUA_DEBUGITEM_TSTRING; break; case LUA_TTABLE: value = GetTableInfo(wxlState, index); - flag_type = WXLUA_DEBUGITEM_TTABLE; break; --- 330,357 ---- *************** *** 372,383 **** if (lua_iscfunction(L, index)) { ! type = wxT("cfunction"); value.Printf(wxT("%p"), lua_tocfunction(L, index)); - flag_type = WXLUA_DEBUGITEM_TCFUNCTION; } else { value.Printf(wxT("%p"), lua_topointer(L, index)); - flag_type = WXLUA_DEBUGITEM_TFUNCTION; } break; --- 359,368 ---- if (lua_iscfunction(L, index)) { ! wxl_type = WXLUAARG_CFunction; value.Printf(wxT("%p"), lua_tocfunction(L, index)); } else { value.Printf(wxT("%p"), lua_topointer(L, index)); } break; *************** *** 385,404 **** case LUA_TUSERDATA: value = GetUserDataInfo(wxlState, index, true); - flag_type = WXLUA_DEBUGITEM_TUSERDATA; break; case LUA_TTHREAD: value.Printf(wxT("%p"), lua_topointer(L, index)); - flag_type = WXLUA_DEBUGITEM_TTHREAD; break; default : - type = wxT("Unknown Data Type?"); value = wxEmptyString; - flag_type = WXLUA_DEBUGITEM_TUNKNOWN; break; } ! if (flag_type_) *flag_type_ = flag_type; return l_type; --- 370,385 ---- case LUA_TUSERDATA: value = GetUserDataInfo(wxlState, index, true); break; case LUA_TTHREAD: value.Printf(wxT("%p"), lua_topointer(L, index)); break; default : value = wxEmptyString; break; } ! if (wxl_type_) *wxl_type_ = wxl_type; return l_type; *************** *** 560,582 **** while(lua_next(L, index) != 0) { ! wxString indexType, indexValue; ! wxString valueType, value; ! wxLuaDebugData::GetTypeValue(wxlState, -2, indexType, indexValue); ! wxLuaDebugData::GetTypeValue(wxlState, -1, valueType, value); ! wxString info = wxString::Format(wxT("%s%-32s\t%-15s\t%-20s\t%-10s"), ! indentStr.c_str(), ! indexValue.c_str(), ! indexType.c_str(), ! valueType.c_str(), ! value.c_str()); OutputMsg(info); if (tableArray.Index(value) == wxNOT_FOUND) { ! if (valueType == wxT("table")) { ! wxString tname = wxString::Format(wxT("%s.%s"), tablename.c_str(), indexValue.c_str()); tableArray.Add(value); int tableIndex = lua_gettop(L); --- 541,559 ---- while(lua_next(L, index) != 0) { ! int keyType = 0, valueType = 0; ! wxString key, value; ! wxLuaDebugData::GetTypeValue(wxlState, -2, &keyType, key); ! wxLuaDebugData::GetTypeValue(wxlState, -1, &valueType, value); ! wxString info = wxString::Format(wxT("%s%-32s\t%d\t%-20s\t%d"), ! indentStr.c_str(), key.c_str(), keyType, value.c_str(), valueType); OutputMsg(info); if (tableArray.Index(value) == wxNOT_FOUND) { ! if (valueType == WXLUAARG_Table) { ! wxString tname = wxString::Format(wxT("%s.%s"), tablename.c_str(), key.c_str()); tableArray.Add(value); int tableIndex = lua_gettop(L); *************** *** 617,623 **** //wxPrintf(wxT("Stack item %d of %d : type %d '%s'\n"), i, argCount, type, lua2wx(lua_typename(L, type)).c_str()); ! wxString type, value; ! int i_type = wxLuaDebugData::GetTypeValue(wxlState, i, type, value); ! OutputMsg(wxString::Format(wxT("item %d: i_type %d '%s' = '%s'\n"), i, i_type, type.c_str(), value.c_str())); } } --- 594,601 ---- //wxPrintf(wxT("Stack item %d of %d : type %d '%s'\n"), i, argCount, type, lua2wx(lua_typename(L, type)).c_str()); ! int wxl_type = 0; ! wxString value; ! int l_type = wxLuaDebugData::GetTypeValue(wxlState, i, &wxl_type, value); ! OutputMsg(wxString::Format(wxT("item %d: lua_type %d wxlua_type %d = '%s'\n"), i, l_type, wxl_type, value.c_str())); } } |
From: John L. <jr...@us...> - 2007-11-08 23:47:18
|
Update of /cvsroot/wxlua/wxLua/modules/wxluasocket/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv10188/wxLua/modules/wxluasocket/src Modified Files: wxlsock.cpp Log Message: Add storage for key and value datatype in wxLuaDebugItem and show it in the stack dialog Index: wxlsock.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluasocket/src/wxlsock.cpp,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** wxlsock.cpp 26 Jul 2007 18:56:40 -0000 1.31 --- wxlsock.cpp 8 Nov 2007 23:47:15 -0000 1.32 *************** *** 182,196 **** pMemory += sizeof(wxInt32); ! const char *pNamePtr = pMemory; ! pMemory += strlen(pNamePtr) + 1; ! const char *pTypePtr = pMemory; ! pMemory += strlen(pTypePtr) + 1; const char *pValuePtr = pMemory; pMemory += strlen(pValuePtr) + 1; const char *pSourcePtr = pMemory; ! wxLuaDebugItem *pItem = new wxLuaDebugItem(lua2wx(pNamePtr), ! lua2wx(pTypePtr), ! lua2wx(pValuePtr), lua2wx(pSourcePtr), nReference, --- 182,199 ---- pMemory += sizeof(wxInt32); ! wxInt32 keyType = *(wxInt32 *) pMemory; ! pMemory += sizeof(wxInt32); ! ! wxInt32 valueType = *(wxInt32 *) pMemory; ! pMemory += sizeof(wxInt32); ! ! const char *pKeyPtr = pMemory; ! pMemory += strlen(pKeyPtr) + 1; const char *pValuePtr = pMemory; pMemory += strlen(pValuePtr) + 1; const char *pSourcePtr = pMemory; ! wxLuaDebugItem *pItem = new wxLuaDebugItem(lua2wx(pKeyPtr), keyType, ! lua2wx(pValuePtr), valueType, lua2wx(pSourcePtr), nReference, *************** *** 257,272 **** const wxLuaDebugItem *item = debugData.Item(idx); ! wxLuaCharBuffer nameBuffer(item->GetName()); ! wxLuaCharBuffer typeBuffer(item->GetType()); wxLuaCharBuffer valueBuffer(item->GetValue()); wxLuaCharBuffer sourceBuffer(item->GetSource()); ! int nameLength = nameBuffer.Length() + 1; // add 1 for terminating \0 ! int typeLength = typeBuffer.Length() + 1; ! int valueLength = valueBuffer.Length() + 1; int sourceLength = sourceBuffer.Length() + 1; ! wxInt32 bufferLength = (3 * sizeof(wxInt32)) + ! nameLength + typeLength + valueLength + sourceLength; unsigned char *pBuffer = new unsigned char[bufferLength]; --- 260,273 ---- const wxLuaDebugItem *item = debugData.Item(idx); ! wxLuaCharBuffer keyBuffer(item->GetKey()); wxLuaCharBuffer valueBuffer(item->GetValue()); wxLuaCharBuffer sourceBuffer(item->GetSource()); ! int keyLength = keyBuffer.Length() + 1; // add 1 for terminating \0 ! int valueLength = valueBuffer.Length() + 1; int sourceLength = sourceBuffer.Length() + 1; ! wxInt32 bufferLength = (5 * sizeof(wxInt32)) + ! keyLength + valueLength + sourceLength; unsigned char *pBuffer = new unsigned char[bufferLength]; *************** *** 285,293 **** pMemory += sizeof(wxInt32); ! memcpy(pMemory, nameBuffer.GetData(), nameLength); ! pMemory += nameLength; ! memcpy(pMemory, typeBuffer.GetData(), typeLength); ! pMemory += typeLength; memcpy(pMemory, valueBuffer.GetData(), valueLength); --- 286,297 ---- pMemory += sizeof(wxInt32); ! *(wxInt32 *) pMemory = (wxInt32)item->GetKeyType(); ! pMemory += sizeof(wxInt32); ! *(wxInt32 *) pMemory = (wxInt32)item->GetValueType(); ! pMemory += sizeof(wxInt32); ! ! memcpy(pMemory, keyBuffer.GetData(), keyLength); ! pMemory += keyLength; memcpy(pMemory, valueBuffer.GetData(), valueLength); |
From: John L. <jr...@us...> - 2007-11-08 23:47:18
|
Update of /cvsroot/wxlua/wxLua/modules/wxluadebug/include In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv10188/wxLua/modules/wxluadebug/include Modified Files: wxldebug.h wxlstack.h Log Message: Add storage for key and value datatype in wxLuaDebugItem and show it in the stack dialog Index: wxldebug.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluadebug/include/wxldebug.h,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** wxldebug.h 7 Aug 2007 20:23:25 -0000 1.39 --- wxldebug.h 8 Nov 2007 23:47:15 -0000 1.40 *************** *** 19,47 **** // ---------------------------------------------------------------------------- ! // wxLuaDebugItem - // ---------------------------------------------------------------------------- enum wxLuaDebugItem_Type { - WXLUA_DEBUGITEM_T_SHIFT = 2, // items shifted +2 from LUA_TXXX - // See wxLuaDebugData constructor for check - - // NOTE: These MUST be in the same order as the wxLuaStackDialog's IMG_XXX enums - WXLUA_DEBUGITEM_TUNKNOWN = 0, // unset and invalid - WXLUA_DEBUGITEM_TNONE = 1, // LUA_TNONE - WXLUA_DEBUGITEM_TNIL = 2, // LUA_TNIL - WXLUA_DEBUGITEM_TBOOLEAN = 3, // LUA_TBOOLEAN - WXLUA_DEBUGITEM_TLIGHTUSERDATA = 4, // LUA_TLIGHTUSERDATA - WXLUA_DEBUGITEM_TNUMBER = 5, // LUA_TNUMBER - WXLUA_DEBUGITEM_TSTRING = 6, // LUA_TSTRING - WXLUA_DEBUGITEM_TTABLE = 7, // LUA_TTABLE - WXLUA_DEBUGITEM_TFUNCTION = 8, // LUA_TFUNCTION - WXLUA_DEBUGITEM_TUSERDATA = 9, // LUA_TUSERDATA - WXLUA_DEBUGITEM_TTHREAD = 10, // LUA_TTHREAD - WXLUA_DEBUGITEM_TCFUNCTION = 11, // LUA_TFUNCTION & lua_iscfunction, not a LUA_TXXX - - WXLUA_DEBUGITEM__TCOUNT = 12, // # of T items - WXLUA_DEBUGITEM__TMASK = 0x00ff, - WXLUA_DEBUGITEM_EXPANDABLE = 0x0200, // for wxLuaStackDialog WXLUA_DEBUGITEM_EXPANDED = 0x0400, // for wxLuaStackDialog --- 19,30 ---- // ---------------------------------------------------------------------------- ! // wxLuaDebugItem - A class to store an item from Lua for wxLuaDebugData ! // ! // It is typically used to store table[key] = value pair info. However it may ! // be used to store stack information as well. // ---------------------------------------------------------------------------- enum wxLuaDebugItem_Type { WXLUA_DEBUGITEM_EXPANDABLE = 0x0200, // for wxLuaStackDialog WXLUA_DEBUGITEM_EXPANDED = 0x0400, // for wxLuaStackDialog *************** *** 55,61 **** public: wxLuaDebugItem(const wxLuaDebugItem &debugDataItem); ! wxLuaDebugItem(const wxString &itemName, ! const wxString &itemType, ! const wxString &itemValue, const wxString &itemSource, int lua_ref, --- 38,43 ---- public: wxLuaDebugItem(const wxLuaDebugItem &debugDataItem); ! wxLuaDebugItem(const wxString &itemKey, int itemKeyType, ! const wxString &itemValue, int itemValueType, const wxString &itemSource, int lua_ref, *************** *** 63,75 **** int flag = 0); ! wxString GetName() const { return m_itemName; } ! wxString GetType() const { return m_itemType; } ! wxString GetValue() const { return m_itemValue; } ! wxString GetSource() const { return m_itemSource; } ! int GetReference() const { return m_lua_ref; } // ttag reference ! int GetIndex() const { return m_index; } // stack index or table level index ! int GetFlag() const { return m_flag; } // see wxLuaDebugItem_Type bool GetFlagBit(int mask) const { return WXLUA_HASBIT(m_flag, mask); } - int GetTypeN() const { return m_flag & WXLUA_DEBUGITEM__TMASK; } void SetFlag(int flag) { m_flag = flag; } --- 45,64 ---- int flag = 0); ! // The key has the typical meaning of the key in a Lua table ! wxString GetKey() const { return m_itemKey; } ! int GetKeyType() const { return m_itemKeyType; } ! wxString GetKeyTypeString() const { return wxlua_getwxluatypename(m_itemKeyType); } ! ! // The value has the typical meaning of the value for the key in a Lua table ! wxString GetValue() const { return m_itemValue; } ! int GetValueType() const { return m_itemValueType; } ! wxString GetValueTypeString() const { return wxlua_getwxluatypename(m_itemValueType); } ! ! wxString GetSource() const { return m_itemSource; } ! ! int GetReference() const { return m_lua_ref; } // ttag reference ! int GetIndex() const { return m_index; } // stack index or table level index ! int GetFlag() const { return m_flag; } // see wxLuaDebugItem_Type bool GetFlagBit(int mask) const { return WXLUA_HASBIT(m_flag, mask); } void SetFlag(int flag) { m_flag = flag; } *************** *** 80,92 **** wxString ToString() const { ! return wxString::Format(wxT("Name: '%s' Type: '%s' Value: '%s' Ref: %d Idx: %d Flag: %d HasSrc: %d"), ! m_itemName.c_str(), m_itemType.c_str(), m_itemValue.c_str(), m_lua_ref, m_index, m_flag, (int)!m_itemSource.IsEmpty()); } // implementation ! wxString m_itemName; ! wxString m_itemType; wxString m_itemValue; wxString m_itemSource; int m_lua_ref; --- 69,82 ---- wxString ToString() const { ! return wxString::Format(wxT("Key: '%s' KeyType: '%s' Value: '%s' ValueType: '%s' Ref: %d Idx: %d Flag: %d HasSrc: %d"), ! m_itemKey.c_str(), GetKeyTypeString().c_str(), m_itemValue.c_str(), GetValueTypeString().c_str(), m_lua_ref, m_index, m_flag, (int)!m_itemSource.IsEmpty()); } // implementation ! wxString m_itemKey; ! int m_itemKeyType; wxString m_itemValue; + int m_itemValueType; wxString m_itemSource; int m_lua_ref; *************** *** 144,151 **** // give a consistent feel to the display of Lua values. ! // Get a human readable string name of the lua_type(L, index), the ! // value at the index, and optionally the wxLuaDebugItem_Type flag type. ! // returns the value of lua_type ! static int GetTypeValue(const wxLuaState& wxlState, int index, wxString& type, wxString& value, int* type_flag = NULL); // Write the input number as either an int, uint, or as a double static wxString MakeNumber(double dnum); --- 134,140 ---- // give a consistent feel to the display of Lua values. ! // Get the WXLUAARG_XXX type of the lua_type(L, index) and the ! // value at the index, returns the value of lua_type ! static int GetTypeValue(const wxLuaState& wxlState, int index, int* wxl_type, wxString& value); // Write the input number as either an int, uint, or as a double static wxString MakeNumber(double dnum); Index: wxlstack.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluadebug/include/wxlstack.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** wxlstack.h 7 Aug 2007 20:23:25 -0000 1.6 --- wxlstack.h 8 Nov 2007 23:47:15 -0000 1.7 *************** *** 103,111 **** // Icon indexes for image list used in the listctrl - // NOTE: These MUST be in the same order as the wxLuaDebugItem_Type enums enum { - IMG_UNKNOWN, IMG_NONE, IMG_NIL, IMG_BOOLEAN, --- 103,110 ---- // Icon indexes for image list used in the listctrl enum { IMG_NONE, + IMG_UNKNOWN, IMG_NIL, IMG_BOOLEAN, *************** *** 117,120 **** --- 116,120 ---- IMG_USERDATA, IMG_THREAD, + IMG_INTEGER, IMG_CFUNCTION, |
From: John L. <jr...@us...> - 2007-11-08 05:41:25
|
Update of /cvsroot/wxlua/wxLua/samples In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv6888/samples Modified Files: wxluasudoku.wx.lua Log Message: Update for changes in wxLua, overloaded functions, fix printing Index: wxluasudoku.wx.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/samples/wxluasudoku.wx.lua,v retrieving revision 1.74 retrieving revision 1.75 diff -C2 -d -r1.74 -r1.75 *** wxluasudoku.wx.lua 26 Jul 2007 18:56:40 -0000 1.74 --- wxluasudoku.wx.lua 8 Nov 2007 05:41:21 -0000 1.75 *************** *** 54,58 **** function TableSetValue(value, atable, ...) if type(atable) ~= "table" then atable = {} end ! local t = atable -- t moves up levels through t local args = {...} for n = 1, #args-1 do --- 54,58 ---- function TableSetValue(value, atable, ...) if type(atable) ~= "table" then atable = {} end ! local t = atable -- t moves up levels through atable local args = {...} [...1390 lines suppressed...] local s = sudoku.GeneratePuzzle() ! s = sudoku.GeneratePuzzleDifficulty(35, s, true) sudoku.UpdateTable(s) ! local n, h = sudoku.FindAllNakedHiddenGroups(true, s) --TableDump(n) --- 5170,5182 ---- print(os.time()-t) end --[[ ! for i = 1, 1 do local s = sudoku.GeneratePuzzle() ! s = sudoku.GeneratePuzzleDifficulty(s, 35, true) sudoku.UpdateTable(s) ! local n, h = sudoku.FindAllNakedHiddenGroups(s, true) --TableDump(n) |
From: John L. <jr...@us...> - 2007-11-08 00:06:44
|
Update of /cvsroot/wxlua/wxLua/modules/wxbind/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv12286/wxLua/modules/wxbind/src Modified Files: wxaui_aui.cpp wxcore_gdi.cpp Log Message: A little more cleanup on genwxbind.lua to make it easier to follow Fix bool member code generation Index: wxcore_gdi.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxcore_gdi.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** wxcore_gdi.cpp 1 Aug 2007 19:15:35 -0000 1.3 --- wxcore_gdi.cpp 8 Nov 2007 00:06:39 -0000 1.4 *************** *** 15187,15192 **** // get this wxSplitterRenderParams *self = (wxSplitterRenderParams *) wxlState.GetUserDataType(1, s_wxluatag_wxSplitterRenderParams); ! // push the result number ! lua_pushnumber(L, self->isHotSensitive); // return the number of values return 1; --- 15187,15192 ---- // get this wxSplitterRenderParams *self = (wxSplitterRenderParams *) wxlState.GetUserDataType(1, s_wxluatag_wxSplitterRenderParams); ! // push the result flag ! lua_pushboolean(L, self->isHotSensitive); // return the number of values return 1; Index: wxaui_aui.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxaui_aui.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** wxaui_aui.cpp 1 Aug 2007 19:15:35 -0000 1.3 --- wxaui_aui.cpp 8 Nov 2007 00:06:38 -0000 1.4 *************** *** 258,263 **** // get this wxAuiNotebookPage *self = (wxAuiNotebookPage *) wxlState.GetUserDataType(1, s_wxluatag_wxAuiNotebookPage); ! // push the result number ! lua_pushnumber(L, self->active); // return the number of values return 1; --- 258,263 ---- // get this wxAuiNotebookPage *self = (wxAuiNotebookPage *) wxlState.GetUserDataType(1, s_wxluatag_wxAuiNotebookPage); ! // push the result flag ! lua_pushboolean(L, self->active); // return the number of values return 1; |
From: John L. <jr...@us...> - 2007-11-08 00:06:44
|
Update of /cvsroot/wxlua/wxLua/bindings In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv12286/wxLua/bindings Modified Files: genwxbind.lua readme.txt Log Message: A little more cleanup on genwxbind.lua to make it easier to follow Fix bool member code generation Index: readme.txt =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/readme.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** readme.txt 14 Feb 2006 16:52:36 -0000 1.2 --- readme.txt 8 Nov 2007 00:06:38 -0000 1.3 *************** *** 11,17 **** The lua program must have been previously compiled for this to work. MSW: run genwxbind.bat ! Unix: run make in the bindings/wxwidgets or bindings/wxstc dirs ! ! DO NOT EDIT the cpp files in modules/wxbind and modules/wxbindstc since any changes will be overwritten by the binding generator. You should make changes to the interface files and regenerate the bindings. --- 11,17 ---- The lua program must have been previously compiled for this to work. MSW: run genwxbind.bat ! Unix: run make in the bindings/ dir ! ! DO NOT EDIT the cpp files in modules/wxbind and modules/wxbindstc since any changes will be overwritten by the binding generator. You should make changes to the interface files and regenerate the bindings. Index: genwxbind.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/genwxbind.lua,v retrieving revision 1.148 retrieving revision 1.149 diff -C2 -d -r1.148 -r1.149 *** genwxbind.lua 7 Nov 2007 00:18:38 -0000 1.148 --- genwxbind.lua 8 Nov 2007 00:06:38 -0000 1.149 *************** *** 195,199 **** Abstract = abstract, Condition = nil, -- conditions for this data type, eg. wxLUA_USE_xxx ! Encapsulate = nil, -- Non wxObject derived class } end --- 195,199 ---- Abstract = abstract, Condition = nil, -- conditions for this data type, eg. wxLUA_USE_xxx ! ["%encapsulate"] = nil, -- Non wxObject derived class } [...1125 lines suppressed...] ! Condition = condition } --- 3837,3852 ---- local delMethodBinding = { ! LuaName = "delete", ! CFunctionName = funcName, ! Method = codeList, ! FuncType = "WXLUAMETHOD_METHOD", ! FuncMap = "{ "..funcName..", WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, "..overload_argListName.." }", ! FuncMapName = funcMapName, ! ArgArray = overload_argList, ! ArgArrayName = overload_argListName, ! ParamCount = 1, RequiredParamCount = 1, ! Map = " { \"delete\", WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, "..funcMapName..", 1, NULL },\n", ! Condition = condition } |
From: John L. <jr...@us...> - 2007-11-08 00:06:44
|
Update of /cvsroot/wxlua/wxLua/bindings/wxwidgets In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv12286/wxLua/bindings/wxwidgets Modified Files: wx_datatypes.lua Log Message: A little more cleanup on genwxbind.lua to make it easier to follow Fix bool member code generation Index: wx_datatypes.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/wx_datatypes.lua,v retrieving revision 1.86 retrieving revision 1.87 diff -C2 -d -r1.86 -r1.87 *** wx_datatypes.lua 7 Nov 2007 00:18:38 -0000 1.86 --- wx_datatypes.lua 8 Nov 2007 00:06:38 -0000 1.87 *************** *** 206,211 **** }, wxAboutDialogInfo = { Condition = "wxCHECK_VERSION(2,8,0) && wxUSE_ABOUTDLG && wxLUA_USE_wxAboutDialog", - Encapsulate = true, IsNumber = false, Name = "wxAboutDialogInfo", --- 206,211 ---- }, wxAboutDialogInfo = { + ["%encapsulate"] = true, [...1764 lines suppressed...] wxXmlNode = { + ["%encapsulate"] = true, Condition = "wxLUA_USE_wxXML && wxUSE_XML", IsNumber = false, Name = "wxXmlNode", *************** *** 4258,4263 **** }, wxXmlProperty = { Condition = "wxLUA_USE_wxXML && wxUSE_XML", - Encapsulate = true, IsNumber = false, Name = "wxXmlProperty", --- 4258,4263 ---- }, wxXmlProperty = { + ["%encapsulate"] = true, Condition = "wxLUA_USE_wxXML && wxUSE_XML", IsNumber = false, Name = "wxXmlProperty", |
From: John L. <jr...@us...> - 2007-11-07 00:18:42
|
Update of /cvsroot/wxlua/wxLua/bindings/wxwidgets In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv31794/wxLua/bindings/wxwidgets Modified Files: wx_datatypes.lua Log Message: Cleanup genwxbind.lua a little to make it easier to trace through it Index: wx_datatypes.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/wx_datatypes.lua,v retrieving revision 1.85 retrieving revision 1.86 diff -C2 -d -r1.85 -r1.86 *** wx_datatypes.lua 7 Aug 2007 20:23:25 -0000 1.85 --- wx_datatypes.lua 7 Nov 2007 00:18:38 -0000 1.86 *************** *** 29,4279 **** { BOOL = { - DefType = "number", IsNumber = true, Name = "BOOL", }, DWORD = { - DefType = "number", IsNumber = true, Name = "DWORD", [...8473 lines suppressed...] Condition = "wxLUA_USE_wxXML && wxUSE_XML", Encapsulate = true, IsNumber = false, Name = "wxXmlProperty", + ValueType = "class", }, wxXmlResource = { BaseClass = "wxObject", Condition = "wxLUA_USE_wxXRC && wxUSE_XRC", IsNumber = false, Name = "wxXmlResource", + ValueType = "class", }, wxXmlResourceFlags = { Condition = "wxLUA_USE_wxXRC && wxUSE_XRC", IsNumber = true, Name = "wxXmlResourceFlags", + ValueType = "enum", }, } |
From: John L. <jr...@us...> - 2007-11-07 00:18:42
|
Update of /cvsroot/wxlua/wxLua/bindings In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv31794/wxLua/bindings Modified Files: genwxbind.lua Log Message: Cleanup genwxbind.lua a little to make it easier to trace through it Index: genwxbind.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/genwxbind.lua,v retrieving revision 1.147 retrieving revision 1.148 diff -C2 -d -r1.147 -r1.148 *** genwxbind.lua 6 Aug 2007 01:46:32 -0000 1.147 --- genwxbind.lua 7 Nov 2007 00:18:38 -0000 1.148 *************** *** 185,194 **** -- Allocate a data type description table (int, double, class...) to dataTypeTable -- --------------------------------------------------------------------------- ! function AllocDataType(name, deftype, is_number, abstract) dataTypeTable[name] = { - DefType = deftype, -- number, enum, class, special (special handling) - -- determines how to handle the data type Name = name, -- typename, eg. void, bool, wxInt32 BaseClass = nil, -- the BaseClass of this, if this is a class IsNumber = is_number, -- can this data type be stored as a double (lua's number type) [...1821 lines suppressed...] -- Output Parsed Object table.insert(fileData, "// ---------------------------------------------------------------------------\n") ! table.insert(fileData, "// Bind "..string.sub(object.ObjType, 10).." "..object.Name.."\n") table.insert(fileData, "// ---------------------------------------------------------------------------\n\n") *************** *** 4893,4897 **** if override_fileTable then ! ReadOverrideFileTable(override_fileTable) end --- 4885,4891 ---- if override_fileTable then ! for i = 1, #override_fileTable do ! ReadOverrideFile(override_fileTable[i]) ! end end |
From: John L. <jr...@us...> - 2007-10-15 21:27:45
|
Update of /cvsroot/wxlua/wxLua/bindings/wxlua In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv9957/wxlua Modified Files: wxlua.i Log Message: Update comments for GetBindings() function Index: wxlua.i =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxlua/wxlua.i,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** wxlua.i 16 Jul 2007 19:34:15 -0000 1.7 --- wxlua.i 15 Oct 2007 21:27:42 -0000 1.8 *************** *** 118,123 **** // These items follow the structure below and ALL items are called as if they // were table members. ! // Example : print(wxlua.GetBindings()[1].binding.GetClassCount) ! // Example : print(wxlua.GetBindings()[1].binding.GetClassArray[1].methods[1].name) // Note: Use only '.' and NO () to make it a function call, also check to see // if the item exists first (unlike the example above)! --- 118,123 ---- // These items follow the structure below and ALL items are called as if they // were table members. ! // Example : print(wxlua.GetBindings()[1].GetClassCount) ! // Example : print(wxlua.GetBindings()[1].GetClassArray[1].methods[1].name) // Note: Use only '.' and NO () to make it a function call, also check to see // if the item exists first (unlike the example above)! |
From: John L. <jr...@us...> - 2007-10-12 02:47:59
|
Update of /cvsroot/wxlua/wxLua/art In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv22524/wxLua/art Modified Files: copy.xpm cut.xpm help.xpm new.xpm open.xpm paste.xpm play.xpm save.xpm saveall.xpm stop.xpm wxlua.xpm wxlualarge.xpm wxlualogo.xpm wxluasmall.xpm Log Message: Fix warning for gcc 4.2.2 char* should be const char* Index: new.xpm =================================================================== RCS file: /cvsroot/wxlua/wxLua/art/new.xpm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** new.xpm 1 Jun 2005 05:10:00 -0000 1.1 --- new.xpm 12 Oct 2007 02:47:50 -0000 1.2 *************** *** 1,4 **** /* XPM */ ! static char *new_xpm[] = { /* columns rows colors chars-per-pixel */ "16 15 3 1", --- 1,4 ---- /* XPM */ ! static const char *new_xpm[] = { /* columns rows colors chars-per-pixel */ "16 15 3 1", Index: paste.xpm =================================================================== RCS file: /cvsroot/wxlua/wxLua/art/paste.xpm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** paste.xpm 1 Jun 2005 05:10:00 -0000 1.1 --- paste.xpm 12 Oct 2007 02:47:50 -0000 1.2 *************** *** 1,4 **** /* XPM */ ! static char *paste_xpm[] = { /* columns rows colors chars-per-pixel */ "16 15 6 1", --- 1,4 ---- /* XPM */ ! static const char *paste_xpm[] = { /* columns rows colors chars-per-pixel */ "16 15 6 1", Index: copy.xpm =================================================================== RCS file: /cvsroot/wxlua/wxLua/art/copy.xpm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** copy.xpm 1 Jun 2005 05:09:59 -0000 1.1 --- copy.xpm 12 Oct 2007 02:47:50 -0000 1.2 *************** *** 1,4 **** /* XPM */ ! static char *copy_xpm[] = { /* columns rows colors chars-per-pixel */ "16 15 4 1", --- 1,4 ---- /* XPM */ ! static const char *copy_xpm[] = { /* columns rows colors chars-per-pixel */ "16 15 4 1", Index: help.xpm =================================================================== RCS file: /cvsroot/wxlua/wxLua/art/help.xpm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** help.xpm 1 Jun 2005 05:10:00 -0000 1.1 --- help.xpm 12 Oct 2007 02:47:50 -0000 1.2 *************** *** 1,4 **** /* XPM */ ! static char *help_xpm[] = { /* columns rows colors chars-per-pixel */ "16 15 4 1", --- 1,4 ---- /* XPM */ ! static const char *help_xpm[] = { /* columns rows colors chars-per-pixel */ "16 15 4 1", Index: wxlua.xpm =================================================================== RCS file: /cvsroot/wxlua/wxLua/art/wxlua.xpm,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** wxlua.xpm 1 Jun 2005 00:01:41 -0000 1.1.1.1 --- wxlua.xpm 12 Oct 2007 02:47:50 -0000 1.2 *************** *** 1,4 **** /* XPM */ ! static char * LUA_xpm[] = { "16 16 248 2", " c None", --- 1,4 ---- /* XPM */ ! static const char * LUA_xpm[] = { "16 16 248 2", " c None", Index: cut.xpm =================================================================== RCS file: /cvsroot/wxlua/wxLua/art/cut.xpm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** cut.xpm 1 Jun 2005 05:10:00 -0000 1.1 --- cut.xpm 12 Oct 2007 02:47:50 -0000 1.2 *************** *** 1,4 **** /* XPM */ ! static char *cut_xpm[] = { /* columns rows colors chars-per-pixel */ "16 15 3 1", --- 1,4 ---- /* XPM */ ! static const char *cut_xpm[] = { /* columns rows colors chars-per-pixel */ "16 15 3 1", Index: wxluasmall.xpm =================================================================== RCS file: /cvsroot/wxlua/wxLua/art/wxluasmall.xpm,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** wxluasmall.xpm 24 Dec 2006 11:17:11 -0000 1.4 --- wxluasmall.xpm 12 Oct 2007 02:47:50 -0000 1.5 *************** *** 1,4 **** /* XPM */ ! static char * wxLuaSmall_xpm[] = { "179 70 936 2", " c None", --- 1,4 ---- /* XPM */ ! static const char * wxLuaSmall_xpm[] = { "179 70 936 2", " c None", Index: open.xpm =================================================================== RCS file: /cvsroot/wxlua/wxLua/art/open.xpm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** open.xpm 1 Jun 2005 05:10:00 -0000 1.1 --- open.xpm 12 Oct 2007 02:47:50 -0000 1.2 *************** *** 1,4 **** /* XPM */ ! static char *open_xpm[] = { /* columns rows colors chars-per-pixel */ "16 15 5 1", --- 1,4 ---- /* XPM */ ! static const char *open_xpm[] = { /* columns rows colors chars-per-pixel */ "16 15 5 1", Index: saveall.xpm =================================================================== RCS file: /cvsroot/wxlua/wxLua/art/saveall.xpm,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** saveall.xpm 7 Mar 2006 12:08:45 -0000 1.2 --- saveall.xpm 12 Oct 2007 02:47:50 -0000 1.3 *************** *** 1,4 **** /* XPM */ ! static char * saveall_xpm[] = { "16 15 4 1", " c None", --- 1,4 ---- /* XPM */ ! static const char * saveall_xpm[] = { "16 15 4 1", " c None", Index: play.xpm =================================================================== RCS file: /cvsroot/wxlua/wxLua/art/play.xpm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** play.xpm 24 Nov 2005 06:38:17 -0000 1.1 --- play.xpm 12 Oct 2007 02:47:50 -0000 1.2 *************** *** 1,4 **** /* XPM */ ! static char *play_xpm[]={ "16 16 2 1", ". c None", --- 1,4 ---- /* XPM */ ! static const char *play_xpm[]={ "16 16 2 1", ". c None", Index: wxlualogo.xpm =================================================================== RCS file: /cvsroot/wxlua/wxLua/art/wxlualogo.xpm,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** wxlualogo.xpm 24 Dec 2006 11:17:11 -0000 1.3 --- wxlualogo.xpm 12 Oct 2007 02:47:50 -0000 1.4 *************** *** 1,4 **** /* XPM */ ! static char * wxlualogo_xpm[] = { "24 24 172 2", " c None", --- 1,4 ---- /* XPM */ ! static const char * wxlualogo_xpm[] = { "24 24 172 2", " c None", Index: wxlualarge.xpm =================================================================== RCS file: /cvsroot/wxlua/wxLua/art/wxlualarge.xpm,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** wxlualarge.xpm 24 Dec 2006 11:08:16 -0000 1.3 --- wxlualarge.xpm 12 Oct 2007 02:47:50 -0000 1.4 *************** *** 1,4 **** /* XPM */ ! static char *wxLuaLarge_xpm[] = { /* columns rows colors chars-per-pixel */ "371 145 257 2", --- 1,4 ---- /* XPM */ ! static const char *wxLuaLarge_xpm[] = { /* columns rows colors chars-per-pixel */ "371 145 257 2", Index: save.xpm =================================================================== RCS file: /cvsroot/wxlua/wxLua/art/save.xpm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** save.xpm 1 Jun 2005 05:10:00 -0000 1.1 --- save.xpm 12 Oct 2007 02:47:50 -0000 1.2 *************** *** 1,4 **** /* XPM */ ! static char *save_xpm[] = { /* columns rows colors chars-per-pixel */ "16 15 4 1", --- 1,4 ---- /* XPM */ ! static const char *save_xpm[] = { /* columns rows colors chars-per-pixel */ "16 15 4 1", Index: stop.xpm =================================================================== RCS file: /cvsroot/wxlua/wxLua/art/stop.xpm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** stop.xpm 24 Nov 2005 06:38:17 -0000 1.1 --- stop.xpm 12 Oct 2007 02:47:50 -0000 1.2 *************** *** 1,4 **** /* XPM */ ! static char *stop_xpm[]={ "16 16 3 1", ". c None", --- 1,4 ---- /* XPM */ ! static const char *stop_xpm[]={ "16 16 3 1", ". c None", |
From: John L. <jr...@us...> - 2007-09-04 22:21:17
|
Update of /cvsroot/wxlua/wxLua/modules/wxlua/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv19898/wxLua/modules/wxlua/src Modified Files: wxlstate.cpp Log Message: Some comment cleanup Document wxLuaState creation a little better Index: wxlstate.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlstate.cpp,v retrieving revision 1.134 retrieving revision 1.135 diff -C2 -d -r1.134 -r1.135 *** wxlstate.cpp 14 Aug 2007 13:42:15 -0000 1.134 --- wxlstate.cpp 4 Sep 2007 22:21:10 -0000 1.135 *************** *** 1327,1330 **** --- 1327,1332 ---- // NULL it's ref data. // Note: even though the lua_State is closed the pointer value is still good. + // The wxLuaState we pushed into the reg table is a light userdata so + // it doesn't get deleted. wxHashMapLuaState::iterator it = s_wxHashMapLuaState.find(m_lua_State); if (it != s_wxHashMapLuaState.end()) *************** *** 1499,1507 **** if (WXLUA_HASBIT(state_type, wxLUASTATE_GETSTATE)) { Ref(wxLuaStateRefData::GetLuaState(L)); - return Ok(); } ! ! // state_type == wxLUASTATE_USESTATE or wxLUASTATE_SETSTATE { m_refData = new wxLuaStateRefData(); --- 1501,1508 ---- if (WXLUA_HASBIT(state_type, wxLUASTATE_GETSTATE)) { + // returns an invalid, wxNullLuaState on failure Ref(wxLuaStateRefData::GetLuaState(L)); } ! else // state_type == wxLUASTATE_USESTATE or wxLUASTATE_SETSTATE { m_refData = new wxLuaStateRefData(); *************** *** 1510,1513 **** --- 1511,1516 ---- M_WXLSTATEDATA->m_lua_State_static = WXLUA_HASBIT(state_type, wxLUASTATE_STATICSTATE); + // Create a new state to push into Lua, the last wxLuaStateRefData will delete it. + // Note: we call SetRefData() so that we don't increase the ref count. wxLuaState* hashState = new wxLuaState(false); hashState->SetRefData(m_refData); *************** *** 1523,1527 **** // register handlers to send events RegisterFunction(wxlua_printFunction, "print"); - //RegisterFunction(wxlua_tracebackFunction, "debug.traceback"); // now register bindings --- 1526,1529 ---- |
From: John L. <jr...@us...> - 2007-09-04 22:21:15
|
Update of /cvsroot/wxlua/wxLua/docs In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv19898/wxLua/docs Modified Files: wxlua.html Log Message: Some comment cleanup Document wxLuaState creation a little better Index: wxlua.html =================================================================== RCS file: /cvsroot/wxlua/wxLua/docs/wxlua.html,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** wxlua.html 3 Aug 2007 14:29:09 -0000 1.33 --- wxlua.html 4 Sep 2007 22:21:10 -0000 1.34 *************** *** 279,310 **** printHi() do return end; print("hi") end</i> which can be useful for debugging functions.</li> </ul> ! </ul><blockquote> <pre>do<br> -- create a new local scope<br> local a = 2<br>end<br></pre></blockquote><ul> ! <li><b>if (bool) then ... elseif (bool) then ... else ... end</b></li> ! </ul><blockquote> <pre>local a, b, c = 1, 2, 3 -- can assign multiple values<br>a = 1; b = 2; c = 3 -- use ; for multiple lines of code on single line<br>a, b, c = 1, 2, 3 -- this works too<br>if (a == 1) and ((b <= 2) or (c ~= 3)) then <br> print(a+b/c) <br>elseif a == 2 then -- no parentheses necessary<br> print(a)<br>else<br> print(b)<br>end</pre></blockquote><ul> ! <ul> <li>There is no case statement, but a table[value] = function() ... end may be used to simulate one.</li> <blockquote> ! <pre>mycase = {}<br>mycase[1] = function() print("Hello #1") end<br>mycase[2] = function() print("Hello #2") end<br>...<br>if mycase[value] then<br> mycase[value]()<br>else<br> print("Unknown case value")<br>end</pre></blockquote> ! </ul> <li><b>while (bool) ... end</b></li> <ul> <li>Note : there is no <i>continue</i> keyword only <i>break</i></li> </ul> ! </ul><blockquote> <pre>function CheckA(val) if val == 5 then return true end end<br>local a = 1<br>while a < 10 do<br> print(a)<br> a = a + 1 -- no increment operator<br> if CheckA(a) then break end<br>end</pre></blockquote><ul> ! <ul> <li>You can make a "fake" continue by adding a while loop (doesn't print # 5). <br></li> </ul> ! </ul><blockquote><pre>local a = 1<br>while a < 10 do while true do<br> a = a + 1 -- no increment operator<br> if CheckA(a) then <br> break <br> else<br> print(a)<br> end<br>break end end</pre></blockquote><ul> ! <li><b>repeat ... until (bool)</b></li> <ul> <li>Note : there is no continue keyword only break</li> </ul> ! </ul><blockquote> <pre>local a = 1<br>repeat<br> local temp = a * 2<br> print(temp, type(temp))<br> a = a + 1 -- no increment operator<br>until a > 10</pre></blockquote><ul> ! <li><b>for var = init_value, end_value [, increment] do --- 279,307 ---- printHi() do return end; print("hi") end</i> which can be useful for debugging functions.</li> </ul> ! </ul><blockquote> <pre>do<br> -- create a new local scope<br> local a = 2<br>end<br></pre></blockquote><ul><li><b>if (bool) then ... elseif (bool) then ... else ... end</b></li> ! </ul><blockquote> <pre>local a, b, c = 1, 2, 3 -- can assign multiple values<br>a = 1; b = 2; c = 3 -- use ; for multiple lines of code on single line<br>a, b, c = 1, 2, 3 -- this works too<br>if (a == 1) and ((b <= 2) or (c ~= 3)) then <br> print(a+b/c) <br>elseif a == 2 then -- no parentheses necessary<br> print(a)<br>else<br> print(b)<br>end</pre></blockquote><ul><ul> ! <li>There is no case statement, but a table[value] = function() ... end may be used to simulate one.</li> <blockquote> ! <pre>mycase = {}<br>mycase[1] = function() print("Hello #1") end<br>mycase[2] = function() print("Hello #2") end<br>...<br>if mycase[value] then<br> mycase[value]()<br>else<br> print("Unknown case value")<br>end</pre></blockquote></ul> ! <li><b>while (bool) ... end</b></li> <ul> <li>Note : there is no <i>continue</i> keyword only <i>break</i></li> </ul> ! </ul><blockquote> <pre>function CheckA(val) if val == 5 then return true end end<br>local a = 1<br>while a < 10 do<br> print(a)<br> a = a + 1 -- no increment operator<br> if CheckA(a) then break end<br>end</pre></blockquote><ul><ul> ! <li>You can make a "fake" continue by adding a while loop (doesn't print # 5). <br></li> </ul> ! </ul><blockquote><pre>local a = 1<br>while a < 10 do while true do<br> a = a + 1 -- no increment operator<br> if CheckA(a) then <br> break <br> else<br> print(a)<br> end<br>break end end</pre></blockquote><ul><li><b>repeat ... until (bool)</b></li> <ul> <li>Note : there is no continue keyword only break</li> </ul> ! </ul><blockquote> <pre>local a = 1<br>repeat<br> local temp = a * 2<br> print(temp, type(temp))<br> a = a + 1 -- no increment operator<br>until a > 10</pre></blockquote><ul><li><b>for var = init_value, end_value [, increment] do *************** *** 317,322 **** it did before the loop. Copy the loop counter variable to a separate variable if you need to save it when breaking for example.</li> </ul> ! </ul><blockquote> <pre>local a = "hello"<br>for a = 1, 10 --[[, increment]] do -- optional increment value, else 1<br> local temp = a * 2<br> print(temp)<br>end<br>print(a) -- a == "hello" since loop counter variable is local to the loop<br></pre></blockquote><ul> ! <li><b>functions</b></li> <ul> <li>Input any number of values by value, tables are passed by --- 314,318 ---- it did before the loop. Copy the loop counter variable to a separate variable if you need to save it when breaking for example.</li> </ul> ! </ul><blockquote> <pre>local a = "hello"<br>for a = 1, 10 --[[, increment]] do -- optional increment value, else 1<br> local temp = a * 2<br> print(temp)<br>end<br>print(a) -- a == "hello" since loop counter variable is local to the loop<br></pre></blockquote><ul><li><b>functions</b></li> <ul> <li>Input any number of values by value, tables are passed by *************** *** 324,330 **** the value nil, extra inputs are discarded.</li> <li>Return values using the "return" keyword</li> <li>Not all return ! values need to be used and extra ones will be discarded. </li><ul><li>The symbol "_" is a valid variable name and is often used as a dummy variable to ! receive return values that you do not want.</li><ul style="font-style: italic;"><li>function GetNums() return 3, 4 end; local _, num2 = GetNums()</li></ul><li>You may also use the <span style="font-style: italic;">select(n, ...)</span> function to choose return values to use.</li></ul><li>Tables can be used as containers for input values to functions using the --- 320,329 ---- the value nil, extra inputs are discarded.</li> <li>Return values using the "return" keyword</li> <li>Not all return ! values need to be used and extra ones will be discarded. </li><ul><li>The ! symbol "_" is a valid variable name and is often used as a dummy variable to ! receive return values that you do not want.</li><ul style="font-style: italic;"><li>function GetNums() ! return 3, 4 end; local _, num2 = GetNums()</li></ul><li>You ! may also use the <span style="font-style: italic;">select(n, ...)</span> function to choose return values to use.</li></ul><li>Tables can be used as containers for input values to functions using the *************** *** 340,350 **** chosen using: <span style="font-style: italic;">local arg3 = select(3, ...)</span> </li><ul><li>Note ! <span style="font-style: italic;">select(n, ...)</span> returns all args after <span style="font-style: italic;">n</span>, but if the left hand side is a single variable the others are discarded. See above about using <span style="font-style: italic;">select()</span> to pick return values of a function as well.</li></ul></ul> ! </ul></ul><blockquote> <pre>function DoStuff(a, b, c)<br> a = b*c -- does not change global and/or input number a<br> local function Calc(a)<br> return a*2<br> end<br> <br> return Calc(a)*b*c -- or for multiple values "return a*b*c, a*b"<br>end<br>-- call function<br>a = 10<br>result = DoStuff(a, 1, 2)<br>-- can also put function into a table<br>stuff = {}<br>stuff.DoStuff = DoStuff<br>result = stuff.DoStuff(1, 2, 3)<br>print(a, result) -- "10, 72" since a is not changed</pre> ! </blockquote><h2 style="text-decoration: underline;"><a name="Bit_Library"></a>Bit Library</h2> wxLua automatically loads a library for manipulating --- 339,349 ---- chosen using: <span style="font-style: italic;">local arg3 = select(3, ...)</span> </li><ul><li>Note ! <span style="font-style: italic;">select(n, ...)</span> ! returns all args after <span style="font-style: italic;">n</span>, but if the left hand side is a single variable the others are discarded. See above about using <span style="font-style: italic;">select()</span> to pick return values of a function as well.</li></ul></ul> ! </ul></ul><blockquote> <pre>function DoStuff(a, b, c)<br> a = b*c -- does not change global and/or input number a<br> local function Calc(a)<br> return a*2<br> end<br> <br> return Calc(a)*b*c -- or for multiple values "return a*b*c, a*b"<br>end<br>-- call function<br>a = 10<br>result = DoStuff(a, 1, 2)<br>-- can also put function into a table<br>stuff = {}<br>stuff.DoStuff = DoStuff<br>result = stuff.DoStuff(1, 2, 3)<br>print(a, result) -- "10, 72" since a is not changed</pre></blockquote><h2 style="text-decoration: underline;"><a name="Bit_Library"></a>Bit Library</h2> wxLua automatically loads a library for manipulating *************** *** 416,420 **** The most common case where wxLua deviates from C++ is when values are passed by reference to a function to be ! changed, wxLua will return multiple values instead. Please see the <b><i>wxluaref.html</i></b> document that lists all the wxWidgets objects wrapped by wxLua and take --- 415,419 ---- The most common case where wxLua deviates from C++ is when values are passed by reference to a function to be ! changed; wxLua will return multiple values instead. Please see the <b><i>wxluaref.html</i></b> document that lists all the wxWidgets objects wrapped by wxLua and take *************** *** 917,921 **** mailing list.<br> <br>Why are the samples named <span style="font-style: italic;">sample.wx.lua</span>? ! To allow them to be colorized correctly in syntax hi-lighting editors, yet denote to people that they are for wxLua and must be run using a wxLua exectuable or the wxLua module. <br> --- 916,920 ---- mailing list.<br> <br>Why are the samples named <span style="font-style: italic;">sample.wx.lua</span>? ! To allow them to be colorized correctly in syntax hilighting editors, yet denote to people that they are for wxLua and must be run using a wxLua exectuable or the wxLua module. <br> *************** *** 1155,1159 **** Runs the program in the current notebook tab and outputs any print or error messages to ! the "Output" window.</li> <li><i>Stop wxLua Program</i> - Stops the currently running wxLua program. This only stops the program if Lua is --- 1154,1160 ---- Runs the program in the current notebook tab and outputs any print or error messages to ! the "Output" window. A new lua_State is created for each run and is ! accessible in the Output window until a new one is run.</li> <li><i>Stop ! wxLua Program</i> - Stops the currently running wxLua program. This only stops the program if Lua is *************** *** 1161,1165 **** created a top level window the wxWidgets event system runs in the background and calls the wxLuaState as necessary for event handling. ! This is why Lua is considered not running even though your programing is "running."</li> <li><i>Stack Tree</i> - Show the stack of the --- 1162,1167 ---- created a top level window the wxWidgets event system runs in the background and calls the wxLuaState as necessary for event handling. ! This is why Lua is considered to be not running even though your ! programing is "running."</li> <li><i>Stack Tree</i> - Show the stack of the *************** *** 1322,1327 **** two. Note that wxCharBuffer can be used as a const char* string directly without any casting.<br> ! <br>The core of wxLua is based upon a ref counted class called ! wxLuaState derived from the wxWidget's wxObject class. The wxLuaState class contains as a member of it's ref data the 'C' lua_State struct which is --- 1324,1329 ---- two. Note that wxCharBuffer can be used as a const char* string directly without any casting.<br> ! <br>The core of wxLua is based upon a ref counted wxLuaState ! class derived from the wxWidget's wxObject class. The wxLuaState class contains as a member of it's ref data the 'C' lua_State struct which is *************** *** 1358,1363 **** looking at bool wxLuaState::Create(wxEvtHandler *handler, wxWindowID id) in ! <i>wxLua/modules/wxlua/src/wxlstate.cpp</i>.<br> ! <ol> <li>The wxObject::m_refData is created as a new wxLuaStateRefData(). This ref data class contains a pointer to the lua_State struct and to a shared --- 1360,1373 ---- looking at bool wxLuaState::Create(wxEvtHandler *handler, wxWindowID id) in ! <i>wxLua/modules/wxlua/src/wxlstate.cpp</i>.<br><ol> ! <li>The ! lua_State ! is created using ! lua_open() and then the standard Lua libraries are loaded, base, table, ! string, ! math, and so on using luaL_openlibs(L) as well ! as luaopen_bit(L) to open the bit library we use. </li><li>The ! function wxLuaState::Create(L, wxLUASTATE_USESTATE) is called to finish ! setting up the lua_State.</li><ol><li>The wxObject::m_refData is created as a new wxLuaStateRefData(). This ref data class contains a pointer to the lua_State struct and to a shared *************** *** 1365,1397 **** this wxLuaState creates coroutines, each will have their own wxLuaStateRefData and associated lua_State, but they ! will all share the same wxLuaStateData class. </li> <li>The ! lua_State ! is created using ! lua_open() and then the standard Lua libraries are loaded, base, table, ! string, ! math, and so on using luaL_openlibs(L). The C lua_State is added to a hash table to allow looking up the owner wxLuaStateRefData when Lua calls the C wxLua ! binding functions with the lua_State as the only parameter. The ! wxLuaStateRefData is also pushed into the LUA_REGISTRYINDEX table as a lightuserdata using the ! "wxLuaStateRefData" key as a secondary means to find the wxLuaState ! "owner" of the lua_State.</li> <li>A wxLua registry is ! created in Lua's LUA_REGISTRYINDEX table with the ! "wxLuaReferences" key. Items in this table are unique integer keys used ! to identify the wxWidgets (or other) classes used as userdata ! in wxLua. It is also used to store references to data that are not to ! be ! garbage collected until the reference is released.</li> <li>We ! register a print() function for Lua to get the output of lua print() statements to send messages as wxLuaEvents, see ! wxEVT_LUA_PRINT. </li> <li>The bindings are registered by calling wxLuaState::RegisterBindings(true). </li> <ul> ! <li>Each binding that is loaded are copies of derived wxLuaBinding classes that are installed into a wxList when the wxLuaBinding_XXX_init() functions are called when the application is initialized (see above about the ! wxbind module). </li> <li>YOU MUST ALWAYS KEEP THE SAME BINDINGS AND KEEP THEM IN THE SAME ORDER THROUGHOUT THE LIFE OF YOUR WXLUASTATES. This is because --- 1375,1413 ---- this wxLuaState creates coroutines, each will have their own wxLuaStateRefData and associated lua_State, but they ! will all share the same wxLuaStateData class.</li><li>The ! wxLuaStateData constructor make a copy of the static binding list, ! wxLuaBinding::GetBindingList(), using wxLuaBinding::Clone() ! function so that the member variables of the wxLuaBindings are ! independent for each wxLuaState, however the binding data structs are ! not since they are too large to make full copies of them. The ! restriction imposed on the bindings by not copying them is that they ! have to be kept in the same order so long as any wxLuaStates exist so ! that the order of the tags (numerical references of the C++ classes) ! are maintained.</li><li>The ! C lua_State is added to a hash table to allow looking up the owner wxLuaStateRefData when Lua calls the C wxLua ! binding functions with the lua_State as the only parameter. A new ! wxLuaState with the wxLuaStateRefData set using wxObject::SetRefData(), ! which does not "ref" the data, but simply sets it, is used since we do ! not want an extra "ref". The ! same wxLuaState is pushed into the LUA_REGISTRYINDEX table as a lightuserdata using the ! wxlua_pushkey_wxLuaState() key as a secondary means to find the ! wxLuaState ! "owner" of the lua_State which will be used for coroutines since there ! is no way to determine when a coroutine (new lua_State) is created and ! then destroyed.</li></ol> <li>We ! register a print() function for Lua to get the output of Lua print() statements to send messages as wxLuaEvents, see ! wxEVT_LUA_PRINT.</li><li>The bindings are registered by calling wxLuaState::RegisterBindings(true). </li> <ul> ! </ul><ul><li>Each binding that is loaded are copies of derived wxLuaBinding classes that are installed into a wxList when the wxLuaBinding_XXX_init() functions are called when the application is initialized (see above about the ! wxbind module).</li></ul><ul><li>YOU ! MUST ALWAYS KEEP THE SAME BINDINGS AND KEEP THEM IN THE SAME ORDER THROUGHOUT THE LIFE OF YOUR WXLUASTATES. This is because *************** *** 1400,1411 **** any previously created wxLuaStates will lookup classes using the wrong overwritten ! tags.</li> </ul> <li>Each binding has ! wxLuaBinding::RegisterBinding(...) called for it.</li> <ul> ! <li>wxLuaBinding::RegisterFunctions(...) ! is called </li> <li>A "namespace" table in Lua (e.g. wx) is created if necessary and a tag in the wxLuaRegistry is associated with ! it.</li> <li>wxLuaBinding::RegisterGeneratedClasses() is ! called to actually push the bindings into Lua.</li> </ul> <li>At the end of creation a wxLuaEvent is sent with the wxEVT_LUA_CREATION event type.</li> --- 1416,1442 ---- any previously created wxLuaStates will lookup classes using the wrong overwritten ! tags.</li></ul><ol><li>Hash tables are created ! in Lua's LUA_REGISTRYINDEX table to store information that is ! tied to the lua_State, but should be hidden from the Lua script code.</li><ol><li>wxlua_pushkey_wxLuaReferences(L) : ! Items in this table are unique integer tags used ! to identify the wxWidgets (or other) classes used as userdata ! in wxLua. It is also used to store references to data that are not to ! be ! garbage collected until the reference is released.</li><li>wxlua_pushkey_wxLuaClasses(L) : A ! mapping between the C++ classnames to their wxLuaBindClass ! structs stored as lightuserdata.</li><li>wxlua_pushkey_wxLuaDerivedMethods(L) : ! Stores derived methods added to a userdata object in Lua. </li></ol><li>Each ! binding has ! wxLuaBinding::RegisterBinding(...) called for it.</li><ul><li>wxLuaBinding::RegisterFunctions(...) ! is called </li><li>A "namespace" table in Lua (e.g. wx) is created if necessary and a tag in the wxLuaRegistry is associated with ! it.</li><li>wxLuaBinding::RegisterGeneratedClasses() is ! called to actually push the bindings into Lua.</li></ul><li>Once ! all of the bindings have been installed we link ! together the wxLuaBindClass::baseclass pointers.</li><li>Now ! that the base classes are found, we can link together the ! wxLuaBindMethod::basemethod pointers to allow determining which ! overloaded function to call at run-time quickly.</li> </ol><li>At the end of creation a wxLuaEvent is sent with the wxEVT_LUA_CREATION event type.</li> *************** *** 1415,1423 **** that the wxLuaState creates and uses. There are C #defines, <i>void ! wxlua_pushkey_wxLuaReferences(L)</i> for example, to push the ! value of index to use.<br> <ul> <li>wxLuaReferences</li> <ul> <li>Tables indexed ! on the numeric "tags" that are used as metatables for the userdata pushed into Lua.</li> <ul> <li>The metatable for a class has these key value pairs</li> <ul> <li>"wxLuaBindClass" --- 1446,1458 ---- that the wxLuaState creates and uses. There are C #defines, <i>void ! wxlua_pushkey_wxLuaReferences(L)</i> ! for example, to push the ! value of index to use. The key is a light userdata, an int, because a ! pushing a string requires that it be hashed and was found to take a ! considerable amount of the total time of a function call.<br> <ul> <li>wxLuaReferences</li> <ul> <li>Tables indexed ! on the numeric "tags" generated by luaL_ref() that are used as ! metatables for the userdata pushed into Lua.</li> <ul> <li>The metatable for a class has these key value pairs</li> <ul> <li>"wxLuaBindClass" *************** *** 1430,1434 **** wxluabind__tostring_wxLuaBindClass(L)</li> </ul> </ul> <li>Or, references to objects we want to keep a ! handle to to avoid garbage collection by Lua .</li> </ul> <li>wxLuaClasses</li> <ul> <li>This is a table t[wxLuaBindClass.name] = --- 1465,1470 ---- wxluabind__tostring_wxLuaBindClass(L)</li> </ul> </ul> <li>Or, references to objects we want to keep a ! handle to to avoid garbage collection by Lua where the index is also ! generated by luaL_ref().</li> </ul> <li>wxLuaClasses</li> <ul> <li>This is a table t[wxLuaBindClass.name] = |
From: John L. <jr...@us...> - 2007-09-04 22:21:15
|
Update of /cvsroot/wxlua/wxLua/modules/wxlua/include In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv19898/wxLua/modules/wxlua/include Modified Files: wxlbind.h wxlstate.h Log Message: Some comment cleanup Document wxLuaState creation a little better Index: wxlbind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxlbind.h,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** wxlbind.h 7 Aug 2007 20:23:25 -0000 1.60 --- wxlbind.h 4 Sep 2007 22:21:10 -0000 1.61 *************** *** 61,64 **** --- 61,67 ---- #define WXLUAARG_Integer -11 + // Variables used in the wxLuaArgTag member of the wxLuaBindCFunc for + // common types. The binding generator will use these and generate others + // as specified in the bindings. extern WXDLLIMPEXP_DATA_WXLUA(int) s_wxluaarg_None; extern WXDLLIMPEXP_DATA_WXLUA(int) s_wxluaarg_Nil; *************** *** 74,83 **** // copies of wxlua arg tags for binding types that are used very often ! extern WXDLLIMPEXP_DATA_WXLUA(int) g_wxluatag_wxLuaFunction; // The Lua tag for wxLuaFunctions. ! extern WXDLLIMPEXP_DATA_WXLUA(int) g_wxluatag_NULL; // The Lua tag for NULL pointer ! extern WXDLLIMPEXP_DATA_WXLUA(int) g_wxluatag_wxEvent; // The Lua tag for wxEvents ! extern WXDLLIMPEXP_DATA_WXLUA(int) g_wxluatag_wxWindow; // The Lua tag for wxWindows ! extern WXDLLIMPEXP_DATA_WXLUA(int) g_wxluatag_wxString; // The Lua tag for wxStrings typedef int* wxLuaArgTag; // address of class tag (a pointer to it) --- 77,89 ---- // copies of wxlua arg tags for binding types that are used very often ! extern WXDLLIMPEXP_DATA_WXLUA(int) g_wxluatag_wxLuaFunction; // The Lua tag for wxLuaFunctions ! extern WXDLLIMPEXP_DATA_WXLUA(int) g_wxluatag_NULL; // The Lua tag for NULL pointer ! extern WXDLLIMPEXP_DATA_WXLUA(int) g_wxluatag_wxEvent; // The Lua tag for wxEvents ! extern WXDLLIMPEXP_DATA_WXLUA(int) g_wxluatag_wxWindow; // The Lua tag for wxWindows ! extern WXDLLIMPEXP_DATA_WXLUA(int) g_wxluatag_wxString; // The Lua tag for wxStrings + // ---------------------------------------------------------------------------- + // wxLuaBindCFunc and friends - Defines a single C func for a LUA method + // ---------------------------------------------------------------------------- typedef int* wxLuaArgTag; // address of class tag (a pointer to it) *************** *** 108,112 **** }; ! struct WXDLLIMPEXP_WXLUA wxLuaBindCFunc // defines a single C func for a LUA method { lua_CFunction func; // C function that implements the method or property --- 114,118 ---- }; ! struct WXDLLIMPEXP_WXLUA wxLuaBindCFunc { lua_CFunction func; // C function that implements the method or property *************** *** 120,124 **** }; ! struct WXDLLIMPEXP_WXLUA wxLuaBindMethod // defines a LUA method or property { const char *name; // name of the method or property --- 126,134 ---- }; ! // ---------------------------------------------------------------------------- ! // wxLuaBindMethod - Defines a LUA method or property ! // ---------------------------------------------------------------------------- ! ! struct WXDLLIMPEXP_WXLUA wxLuaBindMethod { const char *name; // name of the method or property *************** *** 131,135 **** }; ! struct WXDLLIMPEXP_WXLUA wxLuaBindDefine // defines a numeric define for wxLua { const char *name; // name --- 141,149 ---- }; ! // ---------------------------------------------------------------------------- ! // wxLuaBindDefine - Defines a numeric define for wxLua ! // ---------------------------------------------------------------------------- ! ! struct WXDLLIMPEXP_WXLUA wxLuaBindDefine { const char *name; // name *************** *** 139,143 **** extern WXDLLIMPEXP_DATA_WXLUA(wxLuaBindDefine) s_wxluadefineArray_None[1]; // = {{0,0}} ! struct WXDLLIMPEXP_WXLUA wxLuaBindString // defines a wxWidgets string for wxLua { const char *name; // name --- 153,161 ---- extern WXDLLIMPEXP_DATA_WXLUA(wxLuaBindDefine) s_wxluadefineArray_None[1]; // = {{0,0}} ! // ---------------------------------------------------------------------------- ! // wxLuaBindString - Defines a wxWidgets wxString for wxLua ! // ---------------------------------------------------------------------------- ! ! struct WXDLLIMPEXP_WXLUA wxLuaBindString { const char *name; // name *************** *** 145,149 **** }; ! struct WXDLLIMPEXP_WXLUA wxLuaBindEvent // defines a wxWidgets Event for wxLua { const char *name; // name of the event, e.g. "wxEVT_COMMAND_MENU_SELECTED" --- 163,171 ---- }; ! // ---------------------------------------------------------------------------- ! // wxLuaBindEvent - Defines a wxWidgets wxEvent for wxLua ! // ---------------------------------------------------------------------------- ! ! struct WXDLLIMPEXP_WXLUA wxLuaBindEvent { const char *name; // name of the event, e.g. "wxEVT_COMMAND_MENU_SELECTED" *************** *** 152,156 **** }; ! struct WXDLLIMPEXP_WXLUA wxLuaBindObject // Defines an object or pointer for wxLua { const char *name; // the name of the object or pointer --- 174,182 ---- }; ! // ---------------------------------------------------------------------------- ! // wxLuaBindEvent - Defines an object or pointer for wxLua ! // ---------------------------------------------------------------------------- ! ! struct WXDLLIMPEXP_WXLUA wxLuaBindObject { const char *name; // the name of the object or pointer *************** *** 160,164 **** }; ! struct WXDLLIMPEXP_WXLUA wxLuaBindClass // defines a LUA C++ class interface { const char *name; // name of the class --- 186,194 ---- }; ! // ---------------------------------------------------------------------------- ! // wxLuaBindClass - Defines a LUA C++ class interface ! // ---------------------------------------------------------------------------- ! ! struct WXDLLIMPEXP_WXLUA wxLuaBindClass { const char *name; // name of the class Index: wxlstate.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxlstate.h,v retrieving revision 1.93 retrieving revision 1.94 diff -C2 -d -r1.93 -r1.94 *** wxlstate.h 10 Aug 2007 21:23:39 -0000 1.93 --- wxlstate.h 4 Sep 2007 22:21:10 -0000 1.94 *************** *** 72,76 **** // // Note we do not push a human readable string for these because Lua always makes ! // a copy of the string and the copying takes a considerable amount of time // when benchmarked using valgrind. // ---------------------------------------------------------------------------- --- 72,76 ---- // // Note we do not push a human readable string for these because Lua always makes ! // a copy and hashes the string, this takes a considerable amount of time // when benchmarked using valgrind. // ---------------------------------------------------------------------------- *************** *** 449,453 **** // ----------------------------------------------------------------------- ! // Destroy the refed data (only closes Lua if this is the last refed state) // Note: if you have a top level window (wxFrame) open in Lua and exit the // C++ program your program will seem to "hang" because wxApp doesn't --- 449,455 ---- // ----------------------------------------------------------------------- ! // Destroy the refed data, use this instead of wxObject::UnRef(). ! // Only calls lua_close(L) if this is the last refed state and this was ! // created without the wxLUASTATE_STATICSTATE flag. // Note: if you have a top level window (wxFrame) open in Lua and exit the // C++ program your program will seem to "hang" because wxApp doesn't *************** *** 459,462 **** --- 461,466 ---- // Close the lua_State and if 'force' close all attached wxWindows // if !force then popup a dialog to ask if windows should be destroyed. + // Only calls lua_close(L) if this is the last refed state and this was + // created without the wxLUASTATE_STATICSTATE flag. bool CloseLuaState(bool force); // Are we currently being closed, the garbage collector is running, but *************** *** 519,523 **** // Try to compile the Lua program. Creates new lua_State to test for syntax ! // errors and sends error events. See LuaError() for errMsg and line_num. int CompileString(const wxString &script, const wxString& name = wxEmptyString, wxString* errMsg_ = NULL, int* line_num = NULL); --- 523,527 ---- // Try to compile the Lua program. Creates new lua_State to test for syntax ! // errors and sends error events. See wxLuaState::LuaError() for errMsg and line_num. int CompileString(const wxString &script, const wxString& name = wxEmptyString, wxString* errMsg_ = NULL, int* line_num = NULL); *************** *** 525,529 **** wxString* errMsg_ = NULL, int* line_num = NULL); ! // checks the status with CheckRunError and tries to get Lua's error string // from the top of the stack and sends a wxEVT_LUA_ERROR. // If the lua_State is NULL then use the internal one from this class. --- 529,533 ---- wxString* errMsg_ = NULL, int* line_num = NULL); ! // Checks the status with CheckRunError() and tries to get Lua's error string // from the top of the stack and sends a wxEVT_LUA_ERROR. // If the lua_State is NULL then use the internal one from this class. *************** *** 605,611 **** const wxLuaBindEvent* GetLuaEvent(wxEventType eventType) const; ! // Get the binding list used to initialize this class ! // you may add or remove bindings before creation, but not that ! // all wxLuaStates must have the same bindings in the same order! wxLuaBindingList* GetLuaBindingList() const; --- 609,616 ---- const wxLuaBindEvent* GetLuaEvent(wxEventType eventType) const; ! // Get the wxLuaBinding list of classes/objects installed into Lua. ! // You may add or remove bindings before the creation of any wxLuaStates ! // or once they have all been Destroy()ed. However, while any wxLuaStates ! // are created they must have the same bindings in the same order! wxLuaBindingList* GetLuaBindingList() const; |
From: John L. <jr...@us...> - 2007-08-24 06:37:55
|
Update of /cvsroot/wxlua/website In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv2047/website Modified Files: download.php Log Message: Update downloads Index: download.php =================================================================== RCS file: /cvsroot/wxlua/website/download.php,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** download.php 13 Aug 2007 22:27:49 -0000 1.27 --- download.php 24 Aug 2007 06:37:48 -0000 1.28 *************** *** 12,16 **** $latestversion="2.8.4.2"; ! $apsize="9.6"; // size of the wxlua-xxx.package file (in MB) $bundlesize="16.9"; // size of the wxlua-xxx.dmg file (in MB) --- 12,16 ---- $latestversion="2.8.4.2"; ! $apsize="9.6"; // size of the wxlua-xxx.package file (in MB) $bundlesize="16.9"; // size of the wxlua-xxx.dmg file (in MB) *************** *** 18,23 **** $dlllink="http://downloads.sourceforge.net/wxlua/wxLua-2.8.4.2-MSW-dll.zip?use_mirror=osdn"; ! $linuxlink="http://prdownloads.sourceforge.net/wxlua/wxlua-$latestversion-1.x86.package?download"; ! $maclink="http://prdownloads.sourceforge.net/wxlua/wxlua-$latestversion-tiger.dmg?download"; $gzlink="http://downloads.sourceforge.net/wxlua/wxLua-2.8.4.1.tar.gz?use_mirror=osdn"; --- 18,26 ---- $dlllink="http://downloads.sourceforge.net/wxlua/wxLua-2.8.4.2-MSW-dll.zip?use_mirror=osdn"; ! //$linuxlink="http://prdownloads.sourceforge.net/wxlua/wxlua-$latestversion-1.x86.package?download"; ! $linuxlink="http://downloads.sourceforge.net/wxlua/wxlua-2.8.0.0-1.x86.package?use_mirror=internap"; ! ! // $maclink="http://prdownloads.sourceforge.net/wxlua/wxlua-$latestversion-tiger.dmg?download"; ! $maclink="http://downloads.sourceforge.net/wxlua/wxlua-2.8.4.1-tiger.dmg?use_mirror=osdn"; $gzlink="http://downloads.sourceforge.net/wxlua/wxLua-2.8.4.1.tar.gz?use_mirror=osdn"; *************** *** 74,78 **** Instead, if you are interested to wxLua for scripting only, then go with the <strong>binaries</strong> !</p> ! <p><b>You can view all the downloads <a href="http://sourceforge.net/project/showfiles.php?group_id=140042">here<alt="Downloads"/></a>.</b></p> <div class="indented"> --- 77,81 ---- Instead, if you are interested to wxLua for scripting only, then go with the <strong>binaries</strong> !</p> ! <p><b>You can view a complete list of the downloads <a href="http://sourceforge.net/project/showfiles.php?group_id=140042">here<alt="Downloads"/></a>.</b></p> <div class="indented"> |
From: John L. <jr...@us...> - 2007-08-22 20:17:15
|
Update of /cvsroot/wxlua/wxLua/modules/wxbind/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv25335/wxLua/modules/wxbind/src Modified Files: wxxml_xml.cpp Log Message: Fix SF bug 1776184, XML binding crashes, by adding %gc and %ungc for functions that either take ownership or release a pointer. Index: wxxml_xml.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxxml_xml.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** wxxml_xml.cpp 1 Aug 2007 19:15:37 -0000 1.3 --- wxxml_xml.cpp 22 Aug 2007 20:17:09 -0000 1.4 *************** *** 32,36 **** static int LUACALL wxLua_wxXmlNode_AddChild(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxXmlNode_AddChild[1] = {{ wxLua_wxXmlNode_AddChild, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxXmlNode_AddChild }}; ! // void AddChild(wxXmlNode *child) static int LUACALL wxLua_wxXmlNode_AddChild(lua_State *L) { --- 32,36 ---- static int LUACALL wxLua_wxXmlNode_AddChild(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxXmlNode_AddChild[1] = {{ wxLua_wxXmlNode_AddChild, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxXmlNode_AddChild }}; ! // void AddChild(%ungc wxXmlNode *child) static int LUACALL wxLua_wxXmlNode_AddChild(lua_State *L) { *************** *** 38,41 **** --- 38,42 ---- // wxXmlNode child wxXmlNode * child = (wxXmlNode *)wxlState.GetUserDataType(2, s_wxluatag_wxXmlNode); + if (wxlState.IsTrackedObject(child)) wxlState.RemoveTrackedObject(child, wxLuaState::UNDELETE_OBJECT); // get this wxXmlNode * self = (wxXmlNode *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlNode); *************** *** 49,53 **** static int LUACALL wxLua_wxXmlNode_AddProperty1(lua_State *L); // static wxLuaBindCFunc s_wxluafunc_wxLua_wxXmlNode_AddProperty1[1] = {{ wxLua_wxXmlNode_AddProperty1, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxXmlNode_AddProperty1 }}; ! // void AddProperty(wxXmlProperty *prop) static int LUACALL wxLua_wxXmlNode_AddProperty1(lua_State *L) { --- 50,54 ---- static int LUACALL wxLua_wxXmlNode_AddProperty1(lua_State *L); // static wxLuaBindCFunc s_wxluafunc_wxLua_wxXmlNode_AddProperty1[1] = {{ wxLua_wxXmlNode_AddProperty1, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxXmlNode_AddProperty1 }}; ! // void AddProperty(%ungc wxXmlProperty *prop) static int LUACALL wxLua_wxXmlNode_AddProperty1(lua_State *L) { *************** *** 55,58 **** --- 56,60 ---- // wxXmlProperty prop wxXmlProperty * prop = (wxXmlProperty *)wxlState.GetUserDataType(2, s_wxluatag_wxXmlProperty); + if (wxlState.IsTrackedObject(prop)) wxlState.RemoveTrackedObject(prop, wxLuaState::UNDELETE_OBJECT); // get this wxXmlNode * self = (wxXmlNode *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlNode); *************** *** 300,304 **** static int LUACALL wxLua_wxXmlNode_InsertChild(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxXmlNode_InsertChild[1] = {{ wxLua_wxXmlNode_InsertChild, WXLUAMETHOD_METHOD, 3, 3, s_wxluatagArray_wxLua_wxXmlNode_InsertChild }}; ! // void InsertChild(wxXmlNode *child, wxXmlNode *before_node) static int LUACALL wxLua_wxXmlNode_InsertChild(lua_State *L) { --- 302,306 ---- static int LUACALL wxLua_wxXmlNode_InsertChild(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxXmlNode_InsertChild[1] = {{ wxLua_wxXmlNode_InsertChild, WXLUAMETHOD_METHOD, 3, 3, s_wxluatagArray_wxLua_wxXmlNode_InsertChild }}; ! // void InsertChild(%ungc wxXmlNode *child, wxXmlNode *before_node) static int LUACALL wxLua_wxXmlNode_InsertChild(lua_State *L) { *************** *** 308,311 **** --- 310,314 ---- // wxXmlNode child wxXmlNode * child = (wxXmlNode *)wxlState.GetUserDataType(2, s_wxluatag_wxXmlNode); + if (wxlState.IsTrackedObject(child)) wxlState.RemoveTrackedObject(child, wxLuaState::UNDELETE_OBJECT); // get this wxXmlNode * self = (wxXmlNode *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlNode); *************** *** 319,323 **** static int LUACALL wxLua_wxXmlNode_RemoveChild(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxXmlNode_RemoveChild[1] = {{ wxLua_wxXmlNode_RemoveChild, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxXmlNode_RemoveChild }}; ! // bool RemoveChild(wxXmlNode *child) static int LUACALL wxLua_wxXmlNode_RemoveChild(lua_State *L) { --- 322,327 ---- static int LUACALL wxLua_wxXmlNode_RemoveChild(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxXmlNode_RemoveChild[1] = {{ wxLua_wxXmlNode_RemoveChild, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxXmlNode_RemoveChild }}; ! // %override wxLua_wxXmlNode_RemoveChild ! // bool RemoveChild(%gc wxXmlNode *child) static int LUACALL wxLua_wxXmlNode_RemoveChild(lua_State *L) { *************** *** 330,333 **** --- 334,341 ---- // call RemoveChild returns = (self->RemoveChild(child)); + + if (returns && !wxlState.IsTrackedObject(child)) + wxlState.AddTrackedObject((long)child, new wxLua_wxObject_wxXmlNode(child)); + // push the result flag lua_pushboolean(L, returns); *************** *** 336,343 **** } static wxLuaArgTag s_wxluatagArray_wxLua_wxXmlNode_SetChildren[] = { &s_wxluatag_wxXmlNode, &s_wxluatag_wxXmlNode, NULL }; static int LUACALL wxLua_wxXmlNode_SetChildren(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxXmlNode_SetChildren[1] = {{ wxLua_wxXmlNode_SetChildren, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxXmlNode_SetChildren }}; ! // void SetChildren(wxXmlNode *child) static int LUACALL wxLua_wxXmlNode_SetChildren(lua_State *L) { --- 344,352 ---- } + static wxLuaArgTag s_wxluatagArray_wxLua_wxXmlNode_SetChildren[] = { &s_wxluatag_wxXmlNode, &s_wxluatag_wxXmlNode, NULL }; static int LUACALL wxLua_wxXmlNode_SetChildren(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxXmlNode_SetChildren[1] = {{ wxLua_wxXmlNode_SetChildren, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxXmlNode_SetChildren }}; ! // void SetChildren(%ungc wxXmlNode *child) static int LUACALL wxLua_wxXmlNode_SetChildren(lua_State *L) { *************** *** 345,348 **** --- 354,358 ---- // wxXmlNode child wxXmlNode * child = (wxXmlNode *)wxlState.GetUserDataType(2, s_wxluatag_wxXmlNode); + if (wxlState.IsTrackedObject(child)) wxlState.RemoveTrackedObject(child, wxLuaState::UNDELETE_OBJECT); // get this wxXmlNode * self = (wxXmlNode *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlNode); *************** *** 424,428 **** static int LUACALL wxLua_wxXmlNode_SetProperties(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxXmlNode_SetProperties[1] = {{ wxLua_wxXmlNode_SetProperties, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxXmlNode_SetProperties }}; ! // void SetProperties(wxXmlProperty *prop) static int LUACALL wxLua_wxXmlNode_SetProperties(lua_State *L) { --- 434,438 ---- static int LUACALL wxLua_wxXmlNode_SetProperties(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxXmlNode_SetProperties[1] = {{ wxLua_wxXmlNode_SetProperties, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxXmlNode_SetProperties }}; ! // void SetProperties(%ungc wxXmlProperty *prop) static int LUACALL wxLua_wxXmlNode_SetProperties(lua_State *L) { *************** *** 430,433 **** --- 440,444 ---- // wxXmlProperty prop wxXmlProperty * prop = (wxXmlProperty *)wxlState.GetUserDataType(2, s_wxluatag_wxXmlProperty); + if (wxlState.IsTrackedObject(prop)) wxlState.RemoveTrackedObject(prop, wxLuaState::UNDELETE_OBJECT); // get this wxXmlNode * self = (wxXmlNode *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlNode); *************** *** 474,477 **** --- 485,489 ---- static int LUACALL wxLua_wxXmlNode_constructor2(lua_State *L); // static wxLuaBindCFunc s_wxluafunc_wxLua_wxXmlNode_constructor2[1] = {{ wxLua_wxXmlNode_constructor2, WXLUAMETHOD_CONSTRUCTOR, 6, 6, s_wxluatagArray_wxLua_wxXmlNode_constructor2 }}; + // %override wxLua_wxXmlNode_constructor2 // wxXmlNode(wxXmlNode *parent, wxXmlNodeType type, const wxString& name, const wxString& content, wxXmlProperty *props, wxXmlNode *next) static int LUACALL wxLua_wxXmlNode_constructor2(lua_State *L) *************** *** 495,499 **** returns = new wxXmlNode(parent, type, name, content, props, next); // add to tracked memory list ! wxlState.AddTrackedObject((long)returns, new wxLua_wxObject_wxXmlNode((wxXmlNode *)returns)); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxXmlNode, returns); --- 507,512 ---- returns = new wxXmlNode(parent, type, name, content, props, next); // add to tracked memory list ! if (parent == NULL) ! wxlState.AddTrackedObject((long)returns, new wxLua_wxObject_wxXmlNode((wxXmlNode *)returns)); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxXmlNode, returns); *************** *** 502,509 **** } static wxLuaArgTag s_wxluatagArray_wxLua_wxXmlNode_constructor1[] = { &s_wxluaarg_Integer, &s_wxluaarg_String, &s_wxluaarg_String, NULL }; static int LUACALL wxLua_wxXmlNode_constructor1(lua_State *L); // static wxLuaBindCFunc s_wxluafunc_wxLua_wxXmlNode_constructor1[1] = {{ wxLua_wxXmlNode_constructor1, WXLUAMETHOD_CONSTRUCTOR, 2, 3, s_wxluatagArray_wxLua_wxXmlNode_constructor1 }}; ! // wxXmlNode(wxXmlNodeType type, const wxString& name, const wxString& content = wxEmptyString) static int LUACALL wxLua_wxXmlNode_constructor1(lua_State *L) { --- 515,523 ---- } + static wxLuaArgTag s_wxluatagArray_wxLua_wxXmlNode_constructor1[] = { &s_wxluaarg_Integer, &s_wxluaarg_String, &s_wxluaarg_String, NULL }; static int LUACALL wxLua_wxXmlNode_constructor1(lua_State *L); // static wxLuaBindCFunc s_wxluafunc_wxLua_wxXmlNode_constructor1[1] = {{ wxLua_wxXmlNode_constructor1, WXLUAMETHOD_CONSTRUCTOR, 2, 3, s_wxluatagArray_wxLua_wxXmlNode_constructor1 }}; ! // wxXmlNode(wxXmlNodeType type, const wxString& name, const wxString& content = "") static int LUACALL wxLua_wxXmlNode_constructor1(lua_State *L) { *************** *** 513,517 **** // get number of arguments int argCount = lua_gettop(L); ! // const wxString content = wxEmptyString const wxString content = (argCount >= 3 ? wxlState.GetwxStringType(3) : wxString(wxEmptyString)); // const wxString name --- 527,531 ---- // get number of arguments int argCount = lua_gettop(L); ! // const wxString content = "" const wxString content = (argCount >= 3 ? wxlState.GetwxStringType(3) : wxString(wxEmptyString)); // const wxString name *************** *** 1011,1015 **** static int LUACALL wxLua_wxXmlDocument_SetRoot(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxXmlDocument_SetRoot[1] = {{ wxLua_wxXmlDocument_SetRoot, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxXmlDocument_SetRoot }}; ! // void SetRoot(wxXmlNode *node); static int LUACALL wxLua_wxXmlDocument_SetRoot(lua_State *L) { --- 1025,1029 ---- static int LUACALL wxLua_wxXmlDocument_SetRoot(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxXmlDocument_SetRoot[1] = {{ wxLua_wxXmlDocument_SetRoot, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxXmlDocument_SetRoot }}; ! // void SetRoot(%ungc wxXmlNode *node); static int LUACALL wxLua_wxXmlDocument_SetRoot(lua_State *L) { *************** *** 1017,1020 **** --- 1031,1035 ---- // wxXmlNode node wxXmlNode * node = (wxXmlNode *)wxlState.GetUserDataType(2, s_wxluatag_wxXmlNode); + if (wxlState.IsTrackedObject(node)) wxlState.RemoveTrackedObject(node, wxLuaState::UNDELETE_OBJECT); // get this wxXmlDocument * self = (wxXmlDocument *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlDocument); |
From: John L. <jr...@us...> - 2007-08-22 20:17:15
|
Update of /cvsroot/wxlua/wxLua/bindings/wxwidgets In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv25335/wxLua/bindings/wxwidgets Modified Files: wxxml_override.hpp wxxml_xml.i Log Message: Fix SF bug 1776184, XML binding crashes, by adding %gc and %ungc for functions that either take ownership or release a pointer. Index: wxxml_xml.i =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/wxxml_xml.i,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** wxxml_xml.i 16 Jul 2007 19:34:27 -0000 1.1 --- wxxml_xml.i 22 Aug 2007 20:17:09 -0000 1.2 *************** *** 33,42 **** %class %delete %noclassinfo %encapsulate wxXmlNode wxXmlNode() ! wxXmlNode(wxXmlNodeType type, const wxString& name, const wxString& content = wxEmptyString) wxXmlNode(wxXmlNode *parent, wxXmlNodeType type, const wxString& name, const wxString& content, wxXmlProperty *props, wxXmlNode *next) ! void AddChild(wxXmlNode *child) ! void InsertChild(wxXmlNode *child, wxXmlNode *before_node) ! bool RemoveChild(wxXmlNode *child) void AddProperty(const wxString& name, const wxString& value) bool DeleteProperty(const wxString& name) --- 33,49 ---- %class %delete %noclassinfo %encapsulate wxXmlNode wxXmlNode() ! wxXmlNode(wxXmlNodeType type, const wxString& name, const wxString& content = "") ! ! // %override wxXmlNode::wxXmlNode(wxXmlNode *parent, wxXmlNodeType type, const wxString& name, const wxString& content, wxXmlProperty *props, wxXmlNode *next) ! // C++ Func: No change: if parent is not NULL, created node is not garbage collected. wxXmlNode(wxXmlNode *parent, wxXmlNodeType type, const wxString& name, const wxString& content, wxXmlProperty *props, wxXmlNode *next) ! void AddChild(%ungc wxXmlNode *child) ! void InsertChild(%ungc wxXmlNode *child, wxXmlNode *before_node) ! ! // %override bool RemoveChild(%gc wxXmlNode *child) ! // C++ Func: No change: only if child is removed will we garbage collect it ! bool RemoveChild(%gc wxXmlNode *child) ! void AddProperty(const wxString& name, const wxString& value) bool DeleteProperty(const wxString& name) *************** *** 60,66 **** void SetParent(wxXmlNode *parent) void SetNext(wxXmlNode *next) ! void SetChildren(wxXmlNode *child) ! void SetProperties(wxXmlProperty *prop) ! void AddProperty(wxXmlProperty *prop) %endclass --- 67,73 ---- void SetParent(wxXmlNode *parent) void SetNext(wxXmlNode *next) ! void SetChildren(%ungc wxXmlNode *child) ! void SetProperties(%ungc wxXmlProperty *prop) ! void AddProperty(%ungc wxXmlProperty *prop) %endclass *************** *** 97,101 **** wxString GetVersion() const; wxString GetFileEncoding() const; ! void SetRoot(wxXmlNode *node); void SetVersion(const wxString& version); void SetFileEncoding(const wxString& encoding); --- 104,108 ---- wxString GetVersion() const; wxString GetFileEncoding() const; ! void SetRoot(%ungc wxXmlNode *node); void SetVersion(const wxString& version); void SetFileEncoding(const wxString& encoding); Index: wxxml_override.hpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/wxxml_override.hpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** wxxml_override.hpp 16 Jul 2007 19:34:27 -0000 1.1 --- wxxml_override.hpp 22 Aug 2007 20:17:09 -0000 1.2 *************** *** 10,13 **** --- 10,67 ---- // ---------------------------------------------------------------------------- + %override wxLua_wxXmlNode_constructor2 + // wxXmlNode(wxXmlNode *parent, wxXmlNodeType type, const wxString& name, const wxString& content, wxXmlProperty *props, wxXmlNode *next) + static int LUACALL wxLua_wxXmlNode_constructor2(lua_State *L) + { + wxluabind_removetableforcall(L); + wxLuaState wxlState(L); + wxXmlNode *returns; + // wxXmlNode next + wxXmlNode * next = (wxXmlNode *)wxlState.GetUserDataType(6, s_wxluatag_wxXmlNode); + // wxXmlProperty props + wxXmlProperty * props = (wxXmlProperty *)wxlState.GetUserDataType(5, s_wxluatag_wxXmlProperty); + // const wxString content + const wxString content = wxlState.GetwxStringType(4); + // const wxString name + const wxString name = wxlState.GetwxStringType(3); + // wxXmlNodeType type + wxXmlNodeType type = (wxXmlNodeType)wxlua_getintegertype(L, 2); + // wxXmlNode parent + wxXmlNode * parent = (wxXmlNode *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlNode); + // call constructor + returns = new wxXmlNode(parent, type, name, content, props, next); + // add to tracked memory list + if (parent == NULL) + wxlState.AddTrackedObject((long)returns, new wxLua_wxObject_wxXmlNode((wxXmlNode *)returns)); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxXmlNode, returns); + + return 1; + } + %end + + %override wxLua_wxXmlNode_RemoveChild + // bool RemoveChild(%gc wxXmlNode *child) + static int LUACALL wxLua_wxXmlNode_RemoveChild(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // wxXmlNode child + wxXmlNode * child = (wxXmlNode *)wxlState.GetUserDataType(2, s_wxluatag_wxXmlNode); + // get this + wxXmlNode * self = (wxXmlNode *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlNode); + // call RemoveChild + returns = (self->RemoveChild(child)); + + if (returns && !wxlState.IsTrackedObject(child)) + wxlState.AddTrackedObject((long)child, new wxLua_wxObject_wxXmlNode(child)); + + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + %end + %override wxLua_wxXmlNode_GetPropValPtr // %rename GetPropValPtr bool GetPropVal(const wxString& propName, wxString *value) const; |
From: John L. <jr...@us...> - 2007-08-14 13:42:19
|
Update of /cvsroot/wxlua/wxLua/modules/luamodule/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv3043/wxLua/modules/luamodule/src Modified Files: luamodule.cpp Log Message: Fix ambiguous call to wxLuaState(...) in cansum.cpp A little cleanup for the wxluacan app Update luamodule.cpp to use new enums for wxLuaState(lua_State, ...) Nil the wxLuaState lookup in the registry table when the wxLuaState is closed Index: luamodule.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/luamodule/src/luamodule.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** luamodule.cpp 18 Jul 2007 02:41:33 -0000 1.6 --- luamodule.cpp 14 Aug 2007 13:42:15 -0000 1.7 *************** *** 125,129 **** WXLUA_IMPLEMENT_BIND_ALL ! s_wxlState.Create(L, WXLUASTATE_SETSTATE); s_wxlState.SetEventHandler((wxEvtHandler*)wxTheApp); } --- 125,129 ---- WXLUA_IMPLEMENT_BIND_ALL ! s_wxlState.Create(L, wxLUASTATE_USESTATE|wxLUASTATE_STATICSTATE); s_wxlState.SetEventHandler((wxEvtHandler*)wxTheApp); } |
From: John L. <jr...@us...> - 2007-08-14 13:42:19
|
Update of /cvsroot/wxlua/wxLua/docs In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv3043/wxLua/docs Modified Files: wxluaref.html Log Message: Fix ambiguous call to wxLuaState(...) in cansum.cpp A little cleanup for the wxluacan app Update luamodule.cpp to use new enums for wxLuaState(lua_State, ...) Nil the wxLuaState lookup in the registry table when the wxLuaState is closed Index: wxluaref.html =================================================================== RCS file: /cvsroot/wxlua/wxLua/docs/wxluaref.html,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** wxluaref.html 31 Jul 2007 21:16:40 -0000 1.42 --- wxluaref.html 14 Aug 2007 13:42:14 -0000 1.43 *************** *** 1874,1877 **** --- 1874,1887 ---- <td> <tr> + <td><a href="#wxLuaDebuggerEvent">wxLuaDebuggerEvent</a> + <td bgcolor=FFAAAA> + <td align="center" bgcolor=AAFFAA>X + <td> + <tr> + <td><a href="#wxLuaDebuggerServer">wxLuaDebuggerServer</a> + <td bgcolor=FFAAAA> + <td align="center" bgcolor=AAFFAA>X + <td> + <tr> <td><a href="#wxLuaHtmlWinTagEvent">wxLuaHtmlWinTagEvent</a> <td bgcolor=FFAAAA> *************** *** 1894,1897 **** --- 1904,1912 ---- <td> <tr> + <td><a href="#wxLuaState">wxLuaState</a> + <td bgcolor=FFAAAA> + <td align="center" bgcolor=AAFFAA>X + <td> + <tr> <td><a href="#wxLuaTreeItemData">wxLuaTreeItemData</a> <td bgcolor=FFAAAA> *************** *** 3397,3400 **** --- 3412,3417 ---- <a href="#wxLocaleInfo">wxLocaleInfo</a><br> <a href="#wxLocaleInitFlags">wxLocaleInitFlags</a><br> + <a href="#wxLuaMethod_Type">wxLuaMethod_Type</a><br> + <a href="#wxLuaObject_Type">wxLuaObject_Type</a><br> <a href="#wxMediaCtrlPlayerControls">wxMediaCtrlPlayerControls</a><br> <a href="#wxMediaState">wxMediaState</a><br> *************** *** 9082,9092 **** <font color=#990099><i>%function</i> <i>%rename</i> wxExecuteStdoutStderr long wxExecute(const <a href="#wxString">wxString</a>& command, <a href="#wxArrayString">wxArrayString</a>& output, <a href="#wxArrayString">wxArrayString</a>& errors, int flags = 0)</font><br> <font color=#AA0000><i>%function</i> void wxExit()</font><br> ! <font color=#AA0000><i>%function</i> int wxKill(long pid, <a href="#wxSignal">wxSignal</a> sig = wxSIGTERM, <a href="#wxKillError">wxKillError</a> *rc = NULL, int flags = 0)</font><br> <font color=#AA0000><i>%function</i> unsigned long wxGetProcessId()</font><br> <font color=#AA0000><i>%function</i> bool wxShell(const <a href="#wxString">wxString</a>& command = "")</font><br> <br> ! <font color=#009900>//<i>%define</i> wxSHUTDOWN_POWEROFF</font><br> ! <font color=#009900>//<i>%define</i> wxSHUTDOWN_REBOOT</font><br> ! <font color=#009900>//<i>%function</i> bool wxShutdown(wxShutdownFlags flags)</font><br> <br> <font color=#009900>// ---------------------------------------------------------------------------</font><br> --- 9099,9118 ---- <font color=#990099><i>%function</i> <i>%rename</i> wxExecuteStdoutStderr long wxExecute(const <a href="#wxString">wxString</a>& command, <a href="#wxArrayString">wxArrayString</a>& output, <a href="#wxArrayString">wxArrayString</a>& errors, int flags = 0)</font><br> <font color=#AA0000><i>%function</i> void wxExit()</font><br> ! <br> ! <font color=#BB0055><font color=#009900>// <i>%override</i> [int, <a href="#wxKillError">wxKillError</a> rc] wxKill(long pid, <a href="#wxSignal">wxSignal</a> sig = wxSIGTERM, int flags = 0)</font></font><br> ! <font color=#009900>// C++ Func: int wxKill(long pid, <a href="#wxSignal">wxSignal</a> sig = wxSIGTERM, <a href="#wxKillError">wxKillError</a> *rc = NULL, int flags = 0)</font><br> ! <font color=#AA0000><i>%function</i> int wxKill(long pid, <a href="#wxSignal">wxSignal</a> sig = wxSIGTERM, int flags = 0)</font><br> <font color=#AA0000><i>%function</i> unsigned long wxGetProcessId()</font><br> <font color=#AA0000><i>%function</i> bool wxShell(const <a href="#wxString">wxString</a>& command = "")</font><br> <br> ! <br> ! <b><font size=+1 color=#0066CC><i>%enum</i> <a name="wxShutdownFlags">wxShutdownFlags</a></font></b> ! <blockquote><font color=#0066CC> ! wxSHUTDOWN_POWEROFF<br> ! wxSHUTDOWN_REBOOT<br> ! </font> ! </blockquote><font color=#0066CC><i>%endenum</i></font><br> ! <br> ! <font color=#AA0000><i>%function</i> bool wxShutdown(wxShutdownFlags flags)</font><br> <br> <font color=#009900>// ---------------------------------------------------------------------------</font><br> *************** *** 15880,15884 **** bool Intersects(const <a href="#wxGBSizerItem">wxGBSizerItem</a>& other)<br> bool Intersects(const <a href="#wxGBPosition">wxGBPosition</a>& pos, const <a href="#wxGBSpan">wxGBSpan</a>& span)<br> ! void GetEndPos(int& row, int& col)<br> <a href="#wxGridBagSizer">wxGridBagSizer</a>* GetGBSizer() const<br> void SetGBSizer(<a href="#wxGridBagSizer">wxGridBagSizer</a>* sizer)<br> --- 15906,15914 ---- bool Intersects(const <a href="#wxGBSizerItem">wxGBSizerItem</a>& other)<br> bool Intersects(const <a href="#wxGBPosition">wxGBPosition</a>& pos, const <a href="#wxGBSpan">wxGBSpan</a>& span)<br> ! <br> ! <font color=#BB0055> <font color=#009900>// <i>%override</i> [row, col] wxGBSizerItem::GetEndPos()</font></font><br> ! <font color=#009900>// C++ Func: void GetEndPos(int& row, int& col)</font><br> ! void GetEndPos()<br> ! <br> <a href="#wxGridBagSizer">wxGridBagSizer</a>* GetGBSizer() const<br> void SetGBSizer(<a href="#wxGridBagSizer">wxGridBagSizer</a>* sizer)<br> *************** *** 24374,24378 **** <br> <font color=#009900>// ---------------------------------------------------------------------------</font><br> ! <font color=#009900>// wxLuaState</font><br> <br> <i>%include</i> "wxlua/include/wxlstate.h"<br> --- 24404,24408 ---- <br> <font color=#009900>// ---------------------------------------------------------------------------</font><br> ! <font color=#009900>// <a href="#wxLuaState">wxLuaState</a></font><br> <br> <i>%include</i> "wxlua/include/wxlstate.h"<br> *************** *** 24381,24386 **** <blockquote> <font color=#888888>/*<br> ! wxLuaState(bool create = false)<br> ! wxLuaState(<a href="#wxEvtHandler">wxEvtHandler</a> *handler, wxWindowID id = wxID_ANY)<br> <br> bool Ok() const<br> --- 24411,24416 ---- <blockquote> <font color=#888888>/*<br> ! <a href="#wxLuaState">wxLuaState</a>(bool create = false)<br> ! <a href="#wxLuaState">wxLuaState</a>(<a href="#wxEvtHandler">wxEvtHandler</a> *handler, wxWindowID id = wxID_ANY)<br> <br> bool Ok() const<br> *************** *** 24419,24423 **** <blockquote> <font color=#BB0055> <font color=#009900>// <i>%override</i> <a href="#wxLuaObject">wxLuaObject</a>(any value type)</font></font><br> ! <font color=#009900>// C++ Func: <a href="#wxLuaObject">wxLuaObject</a>(const wxLuaState& wxlState, int stack_idx = 1)</font><br> <font color=#009900>// Wrap the single value passed in with a <a href="#wxLuaObject">wxLuaObject</a></font><br> <a href="#wxLuaObject">wxLuaObject</a>()<br> --- 24449,24453 ---- <blockquote> <font color=#BB0055> <font color=#009900>// <i>%override</i> <a href="#wxLuaObject">wxLuaObject</a>(any value type)</font></font><br> ! <font color=#009900>// C++ Func: <a href="#wxLuaObject">wxLuaObject</a>(const <a href="#wxLuaState">wxLuaState</a>& wxlState, int stack_idx = 1)</font><br> <font color=#009900>// Wrap the single value passed in with a <a href="#wxLuaObject">wxLuaObject</a></font><br> <a href="#wxLuaObject">wxLuaObject</a>()<br> *************** *** 24475,24479 **** <b><font size=+1 color=#DD0000><i>%class</i> <i>%delete</i> <a name="wxLuaDebuggerServer">wxLuaDebuggerServer</a>, <a href="#wxEvtHandler">wxEvtHandler</a></font></b> <blockquote> ! wxLuaDebuggerServer(int portNumber)<br> <br> bool StartServer()<br> --- 24505,24509 ---- <b><font size=+1 color=#DD0000><i>%class</i> <i>%delete</i> <a name="wxLuaDebuggerServer">wxLuaDebuggerServer</a>, <a href="#wxEvtHandler">wxEvtHandler</a></font></b> <blockquote> ! <a href="#wxLuaDebuggerServer">wxLuaDebuggerServer</a>(int portNumber)<br> <br> bool StartServer()<br> *************** *** 24509,24513 **** <br> <font color=#009900>// ---------------------------------------------------------------------------</font><br> ! <font color=#009900>// wxLuaDebuggerEvent</font><br> <br> <b><font size=+1 color=#DD0000><i>%class</i> <i>%delete</i> <a name="wxLuaDebuggerEvent">wxLuaDebuggerEvent</a>, <a href="#wxEvent">wxEvent</a></font></b> --- 24539,24543 ---- <br> <font color=#009900>// ---------------------------------------------------------------------------</font><br> ! <font color=#009900>// <a href="#wxLuaDebuggerEvent">wxLuaDebuggerEvent</a></font><br> <br> <b><font size=+1 color=#DD0000><i>%class</i> <i>%delete</i> <a name="wxLuaDebuggerEvent">wxLuaDebuggerEvent</a>, <a href="#wxEvent">wxEvent</a></font></b> |
From: John L. <jr...@us...> - 2007-08-14 13:42:19
|
Update of /cvsroot/wxlua/wxLua/modules/wxlua/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv3043/wxLua/modules/wxlua/src Modified Files: wxlstate.cpp Log Message: Fix ambiguous call to wxLuaState(...) in cansum.cpp A little cleanup for the wxluacan app Update luamodule.cpp to use new enums for wxLuaState(lua_State, ...) Nil the wxLuaState lookup in the registry table when the wxLuaState is closed Index: wxlstate.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlstate.cpp,v retrieving revision 1.133 retrieving revision 1.134 diff -C2 -d -r1.133 -r1.134 *** wxlstate.cpp 10 Aug 2007 21:23:39 -0000 1.133 --- wxlstate.cpp 14 Aug 2007 13:42:15 -0000 1.134 *************** *** 1317,1332 **** ClearCallbacks(); ! ! if ((m_lua_State != NULL) && !m_lua_State_static) { UnRegisterBindings(); ! lua_close(m_lua_State); ! } ! // Clear out the wxLuaState we hashed, note it's not refed so we have ! // NULL it's ref data. ! // Note: even though the lua_State is closed the pointer value is still good. ! if (m_lua_State != NULL) ! { wxHashMapLuaState::iterator it = s_wxHashMapLuaState.find(m_lua_State); if (it != s_wxHashMapLuaState.end()) --- 1317,1330 ---- ClearCallbacks(); ! if (m_lua_State != NULL) { UnRegisterBindings(); ! ! if (!m_lua_State_static) ! lua_close(m_lua_State); ! // Clear out the wxLuaState we hashed, note it's not refed so we have ! // NULL it's ref data. ! // Note: even though the lua_State is closed the pointer value is still good. wxHashMapLuaState::iterator it = s_wxHashMapLuaState.find(m_lua_State); if (it != s_wxHashMapLuaState.end()) *************** *** 1386,1389 **** --- 1384,1391 ---- } + wxlua_pushkey_wxLuaState(m_lua_State); + lua_pushnil(m_lua_State); + lua_rawset(m_lua_State, LUA_REGISTRYINDEX); + wxlua_pushkey_wxLuaReferences(m_lua_State); lua_pushnil(m_lua_State); |
From: John L. <jr...@us...> - 2007-08-14 13:42:19
|
Update of /cvsroot/wxlua/wxLua/build/msvc6 In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv3043/wxLua/build/msvc6 Modified Files: wxLua.dsw Log Message: Fix ambiguous call to wxLuaState(...) in cansum.cpp A little cleanup for the wxluacan app Update luamodule.cpp to use new enums for wxLuaState(lua_State, ...) Nil the wxLuaState lookup in the registry table when the wxLuaState is closed Index: wxLua.dsw =================================================================== RCS file: /cvsroot/wxlua/wxLua/build/msvc6/wxLua.dsw,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** wxLua.dsw 16 Jul 2007 22:49:54 -0000 1.9 --- wxLua.dsw 14 Aug 2007 13:42:14 -0000 1.10 *************** *** 49,62 **** End Project Dependency Begin Project Dependency ! Project_Dep_Name mod_wxbindadv End Project Dependency Begin Project Dependency ! Project_Dep_Name mod_wxbindaui End Project Dependency Begin Project Dependency ! Project_Dep_Name mod_wxbindbase End Project Dependency Begin Project Dependency ! Project_Dep_Name mod_wxbindcore End Project Dependency Begin Project Dependency --- 49,65 ---- End Project Dependency Begin Project Dependency ! Project_Dep_Name mod_wxbindbase End Project Dependency Begin Project Dependency ! Project_Dep_Name mod_wxbindcore End Project Dependency Begin Project Dependency ! Project_Dep_Name mod_wxbindnet End Project Dependency Begin Project Dependency ! Project_Dep_Name mod_wxbindadv ! End Project Dependency ! Begin Project Dependency ! Project_Dep_Name mod_wxbindaui End Project Dependency Begin Project Dependency *************** *** 70,76 **** End Project Dependency Begin Project Dependency - Project_Dep_Name mod_wxbindnet - End Project Dependency - Begin Project Dependency Project_Dep_Name mod_wxbindstc End Project Dependency --- 73,76 ---- *************** *** 139,152 **** End Project Dependency Begin Project Dependency ! Project_Dep_Name mod_wxbindadv End Project Dependency Begin Project Dependency ! Project_Dep_Name mod_wxbindaui End Project Dependency Begin Project Dependency ! Project_Dep_Name mod_wxbindbase End Project Dependency Begin Project Dependency ! Project_Dep_Name mod_wxbindcore End Project Dependency Begin Project Dependency --- 139,155 ---- End Project Dependency Begin Project Dependency ! Project_Dep_Name mod_wxbindbase End Project Dependency Begin Project Dependency ! Project_Dep_Name mod_wxbindcore End Project Dependency Begin Project Dependency ! Project_Dep_Name mod_wxbindnet End Project Dependency Begin Project Dependency ! Project_Dep_Name mod_wxbindadv ! End Project Dependency ! Begin Project Dependency ! Project_Dep_Name mod_wxbindaui End Project Dependency Begin Project Dependency *************** *** 160,166 **** End Project Dependency Begin Project Dependency - Project_Dep_Name mod_wxbindnet - End Project Dependency - Begin Project Dependency Project_Dep_Name mod_wxbindstc End Project Dependency --- 163,166 ---- *************** *** 196,209 **** End Project Dependency Begin Project Dependency ! Project_Dep_Name mod_wxbindadv End Project Dependency Begin Project Dependency ! Project_Dep_Name mod_wxbindaui End Project Dependency Begin Project Dependency ! Project_Dep_Name mod_wxbindbase End Project Dependency Begin Project Dependency ! Project_Dep_Name mod_wxbindcore End Project Dependency Begin Project Dependency --- 196,212 ---- End Project Dependency Begin Project Dependency ! Project_Dep_Name mod_wxbindbase End Project Dependency Begin Project Dependency ! Project_Dep_Name mod_wxbindcore End Project Dependency Begin Project Dependency ! Project_Dep_Name mod_wxbindnet End Project Dependency Begin Project Dependency ! Project_Dep_Name mod_wxbindadv ! End Project Dependency ! Begin Project Dependency ! Project_Dep_Name mod_wxbindaui End Project Dependency Begin Project Dependency *************** *** 217,223 **** End Project Dependency Begin Project Dependency - Project_Dep_Name mod_wxbindnet - End Project Dependency - Begin Project Dependency Project_Dep_Name mod_wxbindstc End Project Dependency --- 220,223 ---- *************** *** 445,449 **** End Project Dependency Begin Project Dependency ! Project_Dep_Name mod_wxbind End Project Dependency Begin Project Dependency --- 445,458 ---- End Project Dependency Begin Project Dependency ! Project_Dep_Name mod_wxbindbase ! End Project Dependency ! Begin Project Dependency ! Project_Dep_Name mod_wxbindcore ! End Project Dependency ! Begin Project Dependency ! Project_Dep_Name mod_wxbindnet ! End Project Dependency ! Begin Project Dependency ! Project_Dep_Name mod_wxbindadv End Project Dependency Begin Project Dependency *************** *** 451,457 **** --- 460,481 ---- End Project Dependency Begin Project Dependency + Project_Dep_Name mod_wxbindgl + End Project Dependency + Begin Project Dependency + Project_Dep_Name mod_wxbindhtml + End Project Dependency + Begin Project Dependency + Project_Dep_Name mod_wxbindmedia + End Project Dependency + Begin Project Dependency Project_Dep_Name mod_wxbindstc End Project Dependency Begin Project Dependency + Project_Dep_Name mod_wxbindxml + End Project Dependency + Begin Project Dependency + Project_Dep_Name mod_wxbindxrc + End Project Dependency + Begin Project Dependency Project_Dep_Name mod_wxluadebug End Project Dependency |
From: John L. <jr...@us...> - 2007-08-14 13:42:19
|
Update of /cvsroot/wxlua/wxLua/apps/wxluacan/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv3043/wxLua/apps/wxluacan/src Modified Files: canlua.cpp canlua.h cansim.cpp cansim.h Log Message: Fix ambiguous call to wxLuaState(...) in cansum.cpp A little cleanup for the wxluacan app Update luamodule.cpp to use new enums for wxLuaState(lua_State, ...) Nil the wxLuaState lookup in the registry table when the wxLuaState is closed Index: cansim.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxluacan/src/cansim.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** cansim.cpp 16 Jul 2007 19:34:12 -0000 1.14 --- cansim.cpp 14 Aug 2007 13:42:13 -0000 1.15 *************** *** 1,4 **** /*! \file cansim.cpp ! \author XX Copyright: 2001-2004 (C) XX --- 1,4 ---- /*! \file cansim.cpp ! \author Klaas Holwerda Copyright: 2001-2004 (C) XX *************** *** 58,61 **** --- 58,65 ---- EVT_MENU( wxID_REDO, MyFrame::OnRedo) EVT_MENU( wxID_EXIT, MyFrame::OnQuit) + + EVT_LUA_PRINT (wxID_ANY, MyFrame::OnLua) + EVT_LUA_ERROR (wxID_ANY, MyFrame::OnLua) + EVT_LUA_DEBUG_HOOK (wxID_ANY, MyFrame::OnLua) END_EVENT_TABLE() *************** *** 77,82 **** SetIcon(wxICON(wxLuaSmall)); ! m_interp = wxLuaState(NULL, wxID_ANY); ! m_interp.SetEventHandler( &wxGetApp() ); //default 1000,1000 mapping --- 81,85 ---- SetIcon(wxICON(wxLuaSmall)); ! m_interp = wxLuaState(this, wxID_ANY); //default 1000,1000 mapping *************** *** 89,94 **** m_canvas->SetVirtualSize( 1000, 1000 ); m_canvas->SetScrollRate( 50, 50 ); ! m_canvas->SetBackgroundColour( wxColour( 223,234,251)); ! m_canvas->SetBackgroundBrush( wxBrush( wxColour( 30,174,171), wxCROSS_HATCH ) ); m_canvas->SetYaxis( false ); //true ); --- 92,97 ---- m_canvas->SetVirtualSize( 1000, 1000 ); m_canvas->SetScrollRate( 50, 50 ); ! m_canvas->SetBackgroundColour( wxColour(223, 234, 251) ); ! m_canvas->SetBackgroundBrush( wxBrush( wxColour(30, 174, 171), wxCROSS_HATCH ) ); m_canvas->SetYaxis( false ); //true ); *************** *** 96,102 **** m_canvas->SetMappingUpp( m_xOrigin, m_yOrigin, m_xScale, m_yScale ); wxlCanObjRect* rect = new wxlCanObjRect( 170, 170,200, -120 ); rect->SetPen(*wxGREEN_PEN); ! rect->SetBrush( wxBrush( wxColour( 70, 124,71) ) ); m_canvas->AddObject( rect ); --- 99,106 ---- m_canvas->SetMappingUpp( m_xOrigin, m_yOrigin, m_xScale, m_yScale ); + // Add some initial objects to the canvas wxlCanObjRect* rect = new wxlCanObjRect( 170, 170,200, -120 ); rect->SetPen(*wxGREEN_PEN); ! rect->SetBrush( wxBrush( wxColour(70, 124, 71) ) ); m_canvas->AddObject( rect ); *************** *** 280,294 **** } //------------------------------------------------------------------------------ // MyApp //------------------------------------------------------------------------------ ! BEGIN_EVENT_TABLE(MyApp, wxApp) ! EVT_LUA_PRINT (wxID_ANY, MyApp::OnLua) ! EVT_LUA_ERROR (wxID_ANY, MyApp::OnLua) ! EVT_LUA_DEBUG_HOOK (wxID_ANY, MyApp::OnLua) ! END_EVENT_TABLE() ! ! MyApp::MyApp() { } --- 284,304 ---- } + void MyFrame::OnLua( wxLuaEvent &event ) + { + if (event.GetEventType() == wxEVT_LUA_PRINT) + { + wxMessageBox(event.GetString(), wxT("maskpro")); + } + else if (event.GetEventType() == wxEVT_LUA_ERROR) + { + wxMessageBox(event.GetString(), wxT("maskpro")); + } + } + //------------------------------------------------------------------------------ // MyApp //------------------------------------------------------------------------------ ! MyApp::MyApp() : m_frame(NULL) { } *************** *** 301,305 **** wxLuaBinding_wxluacan_init(); ! m_frame = new MyFrame( NULL, -1, _T("LuaCan"), wxPoint(20,30), wxSize(600,440) ); m_frame->Show( true ); --- 311,315 ---- wxLuaBinding_wxluacan_init(); ! m_frame = new MyFrame( NULL, wxID_ANY, _T("LuaCan"), wxPoint(20,30), wxSize(600,440) ); m_frame->Show( true ); *************** *** 311,324 **** return 0; } - - void MyApp::OnLua( wxLuaEvent &event ) - { - if (event.GetEventType() == wxEVT_LUA_PRINT) - { - wxMessageBox(event.GetString(), wxT("maskpro")); - } - else if (event.GetEventType() == wxEVT_LUA_ERROR) - { - wxMessageBox(event.GetString(), wxT("maskpro")); - } - } --- 321,322 ---- Index: cansim.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxluacan/src/cansim.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** cansim.h 17 Dec 2006 10:47:07 -0000 1.5 --- cansim.h 14 Aug 2007 13:42:13 -0000 1.6 *************** *** 1,4 **** /*! \file canvas/samples/cansim/cansim.h ! \author XX Copyright: 2001-2004 (C) XX --- 1,4 ---- /*! \file canvas/samples/cansim/cansim.h ! \author Klaas Holwerda Copyright: 2001-2004 (C) XX *************** *** 92,95 **** --- 92,96 ---- void OnRunScript(wxCommandEvent& event); + void OnLua( wxLuaEvent &event ); double m_xScale; *************** *** 114,130 **** class MyApp: public wxApp { - DECLARE_EVENT_TABLE() - public: MyApp(); - virtual bool OnInit(); virtual int OnExit(); - - void OnLua( wxLuaEvent &event ); - MyFrame *m_frame; }; --- 115,125 ---- Index: canlua.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxluacan/src/canlua.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** canlua.h 21 Dec 2006 06:02:02 -0000 1.8 --- canlua.h 14 Aug 2007 13:42:13 -0000 1.9 *************** *** 45,49 **** wxlCanObj( double x = 0, double y = 0 ); ! ~wxlCanObj(); //! sets the position of the object relative to its parent object. --- 45,49 ---- wxlCanObj( double x = 0, double y = 0 ); ! virtual ~wxlCanObj(); //! sets the position of the object relative to its parent object. *************** *** 198,202 **** protected: ! virtual void DoUpdate( double WXUNUSED(absx), double WXUNUSED(absy) ); wxString m_script; --- 198,202 ---- protected: ! virtual void DoUpdate( double absx, double absy ); wxString m_script; Index: canlua.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxluacan/src/canlua.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** canlua.cpp 16 Jul 2007 19:34:12 -0000 1.12 --- canlua.cpp 14 Aug 2007 13:42:13 -0000 1.13 *************** *** 82,88 **** void wxlCanObj::Draw( wxDC& dc, double absx, double absy ) { ! if ( m_brush != wxNullBrush ) dc.SetBrush( m_brush ); ! if ( m_pen != wxNullPen ) dc.SetPen( m_pen ); --- 82,88 ---- void wxlCanObj::Draw( wxDC& dc, double absx, double absy ) { ! if ( m_brush.Ok() ) dc.SetBrush( m_brush ); ! if ( m_pen.Ok() ) dc.SetPen( m_pen ); *************** *** 159,166 **** yh = y - absy; ! double xmin = wxMin( 0 , m_w); ! double ymin = wxMin( 0 , m_h); ! double xmax = wxMax( 0 , m_w); ! double ymax = wxMax( 0 , m_h); // check if inside bounding box with positive margin --- 159,166 ---- yh = y - absy; ! double xmin = wxMin( 0, m_w); ! double ymin = wxMin( 0, m_h); ! double xmax = wxMax( 0, m_w); ! double ymax = wxMax( 0, m_h); // check if inside bounding box with positive margin |
From: John L. <jr...@us...> - 2007-08-13 22:27:55
|
Update of /cvsroot/wxlua/website In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv14673/website Modified Files: download.php Log Message: Update to 2.8.4.2 Index: download.php =================================================================== RCS file: /cvsroot/wxlua/website/download.php,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** download.php 2 Jul 2007 01:37:11 -0000 1.26 --- download.php 13 Aug 2007 22:27:49 -0000 1.27 *************** *** 1,135 **** ! <!-- $Id$ --> ! <?php ! $pagetitle="download"; ! $anchors_href=array("win", "linux", "mac", "sources", "snapshot", "browsesources"); ! $anchors_text=array("...for Windows", "...for Linux", "...for Macintosh", "Sources", ! "Nightly snapshot", "Browse sources"); ! include_once("header.inc.php"); ! ! ! // IMPORTANT: update these info when a new release is available! ! // ============================================================= ! $latestversion="2.8.4.1"; ! ! $apsize="9.6"; // size of the wxlua-xxx.package file (in MB) ! $bundlesize="16.9"; // size of the wxlua-xxx.dmg file (in MB) ! ! $winlink="http://downloads.sourceforge.net/wxlua/wxLua-2.8.4.1-MSW_bin.zip?use_mirror=osdn"; ! $dlllink="http://downloads.sourceforge.net/wxlua/wxLua-2.8.4.1-MSW_dll.zip?use_mirror=osdn"; ! ! $linuxlink="http://prdownloads.sourceforge.net/wxlua/wxlua-$latestversion-1.x86.package?download"; ! $maclink="http://prdownloads.sourceforge.net/wxlua/wxlua-$latestversion-tiger.dmg?download"; ! ! $gzlink="http://downloads.sourceforge.net/wxlua/wxLua-2.8.4.1.tar.gz?use_mirror=osdn"; ! ?> ! ! ! ! <div class="rightSideBar"> ! <p class="sideBarTitle">Latest version</p> ! <div class="sideBarText"> ! <p>Latest wxLua version is:<br/><br/> ! <strong>» <?php echo $latestversion; ?> «</strong><br/><br/> ! The change log for this and previous releases can be <a href="docs/changelog.txt">found here</a> ! </p> ! </div> ! ! <!-- ##### Platform detection code ##### --> ! <?php ! $platform = "Unknown"; ! $arch = "32 bit"; ! $useragent = $_SERVER['HTTP_USER_AGENT']; ! ! // useful for debugging... ! echo "<!-- " . $useragent . " -->"; ! ! if (strstr($useragent,'Win')) ! $platform='Windows'; ! else if (strstr($useragent,'Mac')) ! $platform='Macintosh'; ! else if (strstr($useragent,'Linux')) ! $platform='Linux'; ! else if (strstr($useragent,'Unix')) ! $platform='Unix'; ! ! if (strstr($useragent,'x86_64') || strstr($useragent,'x64') || ! strstr($useragent,'AMD64') || strstr($useragent,'IA64')) ! $arch='64 bit'; ! ! if ($platform != "Unknown") { ! ?> ! <p class="sideBarTitle">Which download?</p> ! <div class="sideBarText"> ! <p>Your platform has been detected as:<br/><br/><strong>» <?php echo $platform . ' ' . $arch; ?> «</strong></p> ! </div> ! <?php ! } ! ?> ! </div> ! <h1 class="first">Download wxLua...</h1> ! <p><strong>Sources or binaries?</strong> wxLua can be used both as <strong>external library by other ! C++ projects</strong> in need of a lua interpreter or as <strong>final application</strong> for those ! programmers who want to write applications entirely in lua.<br/><br/> ! So, if you are interested to wxLua as external, embeddable library you should download the <strong>source package</strong>.<br/> ! Instead, if you are interested to wxLua for scripting only, then go with the <strong>binaries</strong> !</p> <p><b>You can view all the downloads <a href="http://sourceforge.net/project/showfiles.php?group_id=140042">here<alt="Downloads"/></a>.</b></p> ! ! <div class="indented"> ! <h2 id="win">...for Windows</h2> ! <a href="<?php echo $winlink; ?>"><img src="images/win.png" alt="Windows download"/></a> ! <p><a href="<?php echo $winlink; ?>">Binary package</a> : self-contained; you won't need anything else.</p> ! <p>You may also want to download a <a href="<?php echo $dlllink; ?>">package</a> containing the ! DLLs required for using wxWidgets bindings as a <a href="http://lua-users.org/wiki/BuildingModules">Lua module</a>.</p> ! <p>For problems with installation, see the <a href="support.php">support page</a>.</p> ! </div> ! ! <div class="indented"> ! <h2 id="linux">...for Linux</h2> ! <a href="<?php echo $linuxlink; ?>"><img src="images/linux.png" alt="Linux download"/></a> ! <p><a href="<?php echo $linuxlink; ?>">Binary package</a> (autopackage for <strong>32 bit</strong> linuxes) ~ <?php echo $apsize; ?> MB: self-contained; you won't need anything else; click <a href="http://autopackage.org/docs/howto-install/">here</a> for quick info about installing autopackages.<br/> ! For problems with installation, see the <a href="support.php">support page</a>.</p> ! </div> ! ! <div class="indented"> ! <h2 id="mac">...for Macintosh</h2> ! <a href="<?php echo $maclink; ?>"><img src="images/macosx.png" alt="Macintosh download"/></a> ! <p><a href="<?php echo $maclink; ?>">Binary package</a> (Mac Bundle) ~ <?php echo $bundlesize; ?> MB: self-contained.<br/> ! For problems with installation, see the <a href="support.php">support page</a>.</p> ! </div> ! ! <div class="indented"> ! <h2 id="sources">Sources</h2> ! <p>Source packages are available in two formats which contain exactly the same things:</p> ! <ul> ! <li><a href="<?php echo $gzlink; ?>">Source package</a> (.tar.gz) </li> ! </ul> ! <p>See <a href="docs/install.html">install.html</a> for info about required libraries and how to compile and install them</p> ! </div> ! ! <div class="indented"> ! <h2 id="snapshot">Nightly snapshot</h2> ! <p>A nightly tarball (tar.gz) source package is created with Unix linefeeds (LF) for the sources, but DOS linefeeds (CRLF) for the build files for MSWindows compilers.<br/> ! This combination seems to work for most people. If not, you can use the programs dos2unix and unix2dos which are available for most systems.</p> ! <ul> ! <li>Browse <a href="http://wxlua.sourceforge.net/download/">wxLua_Snapshot_YYYY-MM-DD.tar.gz</a> source packages</li> ! </ul> ! </div> ! ! <div class="indented"> ! <h2 id="browsesources">Browse the source files online</h2> ! <p>The Sourceforge CVS repository or the source files used to create the nightly tarball can be browsed online as well:</p> ! <ul> ! <li>Browse the wxLua <a href="http://wxlua.cvs.sourceforge.net/wxlua/wxLua/">CVS repository</a> on Sourceforge</li> ! <li>Browse the wxLua source files <a href="http://wxlua.sourceforge.net/wxLua/">online</a></li> ! </ul> ! </div> ! ! <br/> ! <p><strong>NOTE</strong>: For bleeding edge versions of wxLua, which work for example with the latest wxWidgets CVS, you should ! checkout the wxLua CVS module using <a href="http://sourceforge.net/cvs/?group_id=140042">these instructions</a>.</p> ! ! <p><strong>NOTE 2</strong>: This page lists only the latest release of wxLua. If you are interested to previous releases visit ! the wxLua <a href="http://sourceforge.net/project/showfiles.php?group_id=140042">download page at SourceForge</a>.</p> ! <?php include_once("footer.inc.php"); ?> \ No newline at end of file --- 1,135 ---- ! <!-- $Id$ --> ! <?php ! $pagetitle="download"; ! $anchors_href=array("win", "linux", "mac", "sources", "snapshot", "browsesources"); ! $anchors_text=array("...for Windows", "...for Linux", "...for Macintosh", "Sources", ! "Nightly snapshot", "Browse sources"); ! include_once("header.inc.php"); ! ! ! // IMPORTANT: update these info when a new release is available! ! // ============================================================= ! $latestversion="2.8.4.2"; ! ! $apsize="9.6"; // size of the wxlua-xxx.package file (in MB) ! $bundlesize="16.9"; // size of the wxlua-xxx.dmg file (in MB) ! ! $winlink="http://downloads.sourceforge.net/wxlua/wxLua-2.8.4.2-MSW-bin.zip?use_mirror=osdn"; ! $dlllink="http://downloads.sourceforge.net/wxlua/wxLua-2.8.4.2-MSW-dll.zip?use_mirror=osdn"; ! ! $linuxlink="http://prdownloads.sourceforge.net/wxlua/wxlua-$latestversion-1.x86.package?download"; ! $maclink="http://prdownloads.sourceforge.net/wxlua/wxlua-$latestversion-tiger.dmg?download"; ! ! $gzlink="http://downloads.sourceforge.net/wxlua/wxLua-2.8.4.1.tar.gz?use_mirror=osdn"; ! ?> ! ! ! ! <div class="rightSideBar"> ! <p class="sideBarTitle">Latest version</p> ! <div class="sideBarText"> ! <p>Latest wxLua version is:<br/><br/> ! <strong>» <?php echo $latestversion; ?> «</strong><br/><br/> ! The change log for this and previous releases can be <a href="docs/changelog.txt">found here</a> ! </p> ! </div> ! ! <!-- ##### Platform detection code ##### --> ! <?php ! $platform = "Unknown"; ! $arch = "32 bit"; ! $useragent = $_SERVER['HTTP_USER_AGENT']; ! ! // useful for debugging... ! echo "<!-- " . $useragent . " -->"; ! ! if (strstr($useragent,'Win')) ! $platform='Windows'; ! else if (strstr($useragent,'Mac')) ! $platform='Macintosh'; ! else if (strstr($useragent,'Linux')) ! $platform='Linux'; ! else if (strstr($useragent,'Unix')) ! $platform='Unix'; ! ! if (strstr($useragent,'x86_64') || strstr($useragent,'x64') || ! strstr($useragent,'AMD64') || strstr($useragent,'IA64')) ! $arch='64 bit'; ! ! if ($platform != "Unknown") { ! ?> ! <p class="sideBarTitle">Which download?</p> ! <div class="sideBarText"> ! <p>Your platform has been detected as:<br/><br/><strong>» <?php echo $platform . ' ' . $arch; ?> «</strong></p> ! </div> ! <?php ! } ! ?> ! </div> ! <h1 class="first">Download wxLua...</h1> ! <p><strong>Sources or binaries?</strong> wxLua can be used both as <strong>external library by other ! C++ projects</strong> in need of a lua interpreter or as <strong>final application</strong> for those ! programmers who want to write applications entirely in lua.<br/><br/> ! So, if you are interested to wxLua as external, embeddable library you should download the <strong>source package</strong>.<br/> ! Instead, if you are interested to wxLua for scripting only, then go with the <strong>binaries</strong> !</p> <p><b>You can view all the downloads <a href="http://sourceforge.net/project/showfiles.php?group_id=140042">here<alt="Downloads"/></a>.</b></p> ! ! <div class="indented"> ! <h2 id="win">...for Windows</h2> ! <a href="<?php echo $winlink; ?>"><img src="images/win.png" alt="Windows download"/></a> ! <p><a href="<?php echo $winlink; ?>">Binary package</a> : self-contained; you won't need anything else.</p> ! <p>You may also want to download a <a href="<?php echo $dlllink; ?>">package</a> containing the ! DLLs required for using wxWidgets bindings as a <a href="http://lua-users.org/wiki/BuildingModules">Lua module</a>.</p> ! <p>For problems with installation, see the <a href="support.php">support page</a>.</p> ! </div> ! ! <div class="indented"> ! <h2 id="linux">...for Linux</h2> ! <a href="<?php echo $linuxlink; ?>"><img src="images/linux.png" alt="Linux download"/></a> ! <p><a href="<?php echo $linuxlink; ?>">Binary package</a> (autopackage for <strong>32 bit</strong> linuxes) ~ <?php echo $apsize; ?> MB: self-contained; you won't need anything else; click <a href="http://autopackage.org/docs/howto-install/">here</a> for quick info about installing autopackages.<br/> ! For problems with installation, see the <a href="support.php">support page</a>.</p> ! </div> ! ! <div class="indented"> ! <h2 id="mac">...for Macintosh</h2> ! <a href="<?php echo $maclink; ?>"><img src="images/macosx.png" alt="Macintosh download"/></a> ! <p><a href="<?php echo $maclink; ?>">Binary package</a> (Mac Bundle) ~ <?php echo $bundlesize; ?> MB: self-contained.<br/> ! For problems with installation, see the <a href="support.php">support page</a>.</p> ! </div> ! ! <div class="indented"> ! <h2 id="sources">Sources</h2> ! <p>Source packages are available in two formats which contain exactly the same things:</p> ! <ul> ! <li><a href="<?php echo $gzlink; ?>">Source package</a> (.tar.gz) </li> ! </ul> ! <p>See <a href="docs/install.html">install.html</a> for info about required libraries and how to compile and install them</p> ! </div> ! ! <div class="indented"> ! <h2 id="snapshot">Nightly snapshot</h2> ! <p>A nightly tarball (tar.gz) source package is created with Unix linefeeds (LF) for the sources, but DOS linefeeds (CRLF) for the build files for MSWindows compilers.<br/> ! This combination seems to work for most people. If not, you can use the programs dos2unix and unix2dos which are available for most systems.</p> ! <ul> ! <li>Browse <a href="http://wxlua.sourceforge.net/download/">wxLua_Snapshot_YYYY-MM-DD.tar.gz</a> source packages</li> ! </ul> ! </div> ! ! <div class="indented"> ! <h2 id="browsesources">Browse the source files online</h2> ! <p>The Sourceforge CVS repository or the source files used to create the nightly tarball can be browsed online as well:</p> ! <ul> ! <li>Browse the wxLua <a href="http://wxlua.cvs.sourceforge.net/wxlua/wxLua/">CVS repository</a> on Sourceforge</li> ! <li>Browse the wxLua source files <a href="http://wxlua.sourceforge.net/wxLua/">online</a></li> ! </ul> ! </div> ! ! <br/> ! <p><strong>NOTE</strong>: For bleeding edge versions of wxLua, which work for example with the latest wxWidgets CVS, you should ! checkout the wxLua CVS module using <a href="http://sourceforge.net/cvs/?group_id=140042">these instructions</a>.</p> ! ! <p><strong>NOTE 2</strong>: This page lists only the latest release of wxLua. If you are interested to previous releases visit ! the wxLua <a href="http://sourceforge.net/project/showfiles.php?group_id=140042">download page at SourceForge</a>.</p> ! <?php include_once("footer.inc.php"); ?> \ No newline at end of file |
From: John L. <jr...@us...> - 2007-08-10 21:23:46
|
Update of /cvsroot/wxlua/wxLua/modules/wxlua/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv23945/wxLua/modules/wxlua/src Modified Files: wxlstate.cpp Log Message: Streamline the creation of a wxLuaState Changed the enums WXLUASTATE_ATTACH/SETSTATE for clarity and completeness. Index: wxlstate.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlstate.cpp,v retrieving revision 1.132 retrieving revision 1.133 diff -C2 -d -r1.132 -r1.133 *** wxlstate.cpp 10 Aug 2007 01:41:08 -0000 1.132 --- wxlstate.cpp 10 Aug 2007 21:23:39 -0000 1.133 *************** *** 1325,1330 **** // Clear out the wxLuaState we hashed, note it's not refed so we have ! // NULL it's ref data. Note: even though the lua_State is closed the pointer ! // value is still good. if (m_lua_State != NULL) { --- 1325,1330 ---- // Clear out the wxLuaState we hashed, note it's not refed so we have ! // NULL it's ref data. ! // Note: even though the lua_State is closed the pointer value is still good. if (m_lua_State != NULL) { *************** *** 1440,1444 **** else if (wxlState) { ! return wxLuaState(*wxlState); } --- 1440,1444 ---- else if (wxlState) { ! return wxLuaState(*wxlState); // Ref it } *************** *** 1472,1505 **** { Destroy(); - m_refData = new wxLuaStateRefData(); - - M_WXLSTATEDATA->m_wxlStateData->m_evtHandler = handler; - M_WXLSTATEDATA->m_wxlStateData->m_id = id; lua_State* L = lua_open(); - M_WXLSTATEDATA->m_lua_State = L; - M_WXLSTATEDATA->m_lua_State_static = false; - // load some useful libraries, loads all of them luaL_openlibs(L); luaopen_bit(L); ! // track this newly created lua_State in our hashtable to help us ! // find the wxLuaStateRefData from the lua_State quickly ! wxLuaState* hashState = new wxLuaState(false); ! hashState->SetRefData(m_refData); ! wxLuaStateRefData::s_wxHashMapLuaState[L] = hashState; ! ! // Stick us into the lua_State - push key, value ! wxlua_pushkey_wxLuaState(L); ! lua_pushlightuserdata( L, (void*)hashState ); ! lua_rawset( L, LUA_REGISTRYINDEX ); // set the value ! ! // register handlers to send events ! RegisterFunction(wxlua_printFunction, "print"); ! //RegisterFunction(wxlua_tracebackFunction, "debug.traceback"); ! // now register bindings ! RegisterBindings(true); // alert people that we've been created so they can finish setting us up --- 1472,1485 ---- { Destroy(); lua_State* L = lua_open(); // load some useful libraries, loads all of them luaL_openlibs(L); luaopen_bit(L); ! bool ok = Create(L, wxLUASTATE_USESTATE); ! M_WXLSTATEDATA->m_wxlStateData->m_evtHandler = handler; ! M_WXLSTATEDATA->m_wxlStateData->m_id = id; // alert people that we've been created so they can finish setting us up *************** *** 1510,1528 **** } ! bool wxLuaState::Create(lua_State* L, wxLuaState_Type type) { wxCHECK_MSG(L != NULL, false, wxT("Invalid lua_State")); Destroy(); ! if (type == WXLUASTATE_ATTACH) { Ref(wxLuaStateRefData::GetLuaState(L)); return Ok(); } ! else if (type == WXLUASTATE_SETSTATE) { m_refData = new wxLuaStateRefData(); M_WXLSTATEDATA->m_lua_State = L; ! M_WXLSTATEDATA->m_lua_State_static = true; wxLuaState* hashState = new wxLuaState(false); --- 1490,1510 ---- } ! bool wxLuaState::Create(lua_State* L, int state_type) { wxCHECK_MSG(L != NULL, false, wxT("Invalid lua_State")); Destroy(); ! if (WXLUA_HASBIT(state_type, wxLUASTATE_GETSTATE)) { Ref(wxLuaStateRefData::GetLuaState(L)); return Ok(); } ! ! // state_type == wxLUASTATE_USESTATE or wxLUASTATE_SETSTATE { m_refData = new wxLuaStateRefData(); + M_WXLSTATEDATA->m_lua_State = L; ! M_WXLSTATEDATA->m_lua_State_static = WXLUA_HASBIT(state_type, wxLUASTATE_STATICSTATE); wxLuaState* hashState = new wxLuaState(false); *************** *** 1535,1554 **** lua_rawset( L, LUA_REGISTRYINDEX ); // set the value ! // register handlers to send events ! RegisterFunction(wxlua_printFunction, "print"); ! //RegisterFunction(wxlua_tracebackFunction, "debug.traceback"); ! ! // now register bindings ! RegisterBindings(true); ! return true; } ! m_refData = new wxLuaStateRefData(); ! ! M_WXLSTATEDATA->m_lua_State = L; ! M_WXLSTATEDATA->m_lua_State_static = true; ! ! return true; } --- 1517,1532 ---- lua_rawset( L, LUA_REGISTRYINDEX ); // set the value ! if (WXLUA_HASBIT(state_type, wxLUASTATE_USESTATE)) ! { ! // register handlers to send events ! RegisterFunction(wxlua_printFunction, "print"); ! //RegisterFunction(wxlua_tracebackFunction, "debug.traceback"); ! // now register bindings ! RegisterBindings(true); ! } } ! return Ok(); } |