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, |