From: John L. <jr...@us...> - 2007-05-31 17:18:59
|
Update of /cvsroot/wxlua/wxLua/modules/wxluadebug/include In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv14219/wxLua/modules/wxluadebug/include Modified Files: wxldebug.h wxlstack.h Log Message: Huge changes, overloaded functions by default replace wx.wxNull with wx.NULL change WXLUA_VERSION and others with wxLUA_VERSION class member enums are part of class table static class member functions are part of class table %properties are generated on the fly ... and more, see docs/changelog.txt Index: wxldebug.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluadebug/include/wxldebug.h,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** wxldebug.h 23 May 2007 02:48:31 -0000 1.33 --- wxldebug.h 31 May 2007 17:18:54 -0000 1.34 *************** *** 19,36 **** // ---------------------------------------------------------------------------- ! // wxLuaDebugDataItem - // ---------------------------------------------------------------------------- ! class WXDLLIMPEXP_WXLUADEBUG wxLuaDebugDataItem : public wxTreeItemData { public: ! wxLuaDebugDataItem(const wxLuaDebugDataItem &debugDataItem); ! wxLuaDebugDataItem(const wxString &itemName, ! const wxString &itemType, ! const wxString &itemValue, ! const wxString &itemSource, ! int lua_ref, ! int idx = 0, ! bool expanded = false); wxString GetName() const { return m_itemName; } --- 19,61 ---- // ---------------------------------------------------------------------------- ! // 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_T_COUNT = 12, // # of T items ! WXLUA_DEBUGITEM_T_MASK = 0x00ff, ! ! WXLUA_DEBUGITEM_EXPANDED = 0x0200 ! }; ! ! class WXDLLIMPEXP_WXLUADEBUG wxLuaDebugItem { public: ! wxLuaDebugItem(const wxLuaDebugItem &debugDataItem); ! wxLuaDebugItem(const wxString &itemName, ! const wxString &itemType, ! const wxString &itemValue, ! const wxString &itemSource, ! int lua_ref, ! int idx = 0, ! int flag = 0); wxString GetName() const { return m_itemName; } *************** *** 39,52 **** wxString GetSource() const { return m_itemSource; } int GetReference() const { return m_lua_ref; } // ttag reference ! int GetIndex() const { return m_index; } ! bool GetExpanded() const { return m_expanded; } // expanded in stack dialog ! void SetExpanded(bool expanded) { m_expanded = expanded; } // Get a human readable string for debugging wxString ToString() const { ! return wxString::Format(wxT("Name: '%s' Type: '%s' Value: '%s' Ref: %d Idx: %d Expanded: %d HasSrc: %d"), ! m_itemName.c_str(), m_itemType.c_str(), m_itemValue.c_str(), m_lua_ref, m_index, (int)m_expanded, (int)!m_itemSource.IsEmpty()); } --- 64,80 ---- 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_T_MASK; } ! void SetFlag(int flag) { m_flag = flag; } ! void SetFlagBit(int bit, bool set) { m_flag = WXLUA_SETBIT(m_flag, bit, set); } // Get a human readable string for debugging 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()); } *************** *** 58,72 **** int m_lua_ref; int m_index; ! bool m_expanded; }; #if defined(WXMAKINGDLL_WXLUADEBUG) || defined(WXUSINGDLL) ! WX_DEFINE_SORTED_USER_EXPORTED_ARRAY(wxLuaDebugDataItem *, wxLuaDebugDataItemArray, WXDLLIMPEXP_WXLUADEBUG); #else ! WX_DEFINE_SORTED_ARRAY(wxLuaDebugDataItem *, wxLuaDebugDataItemArray); #endif // ---------------------------------------------------------------------------- ! // wxLuaDebugData - a wxObject ref counted container for a wxLuaDebugDataItemArray // The Ref data is always expected to exist and the destructor deletes the array items // ---------------------------------------------------------------------------- --- 86,100 ---- int m_lua_ref; int m_index; ! int m_flag; }; #if defined(WXMAKINGDLL_WXLUADEBUG) || defined(WXUSINGDLL) ! WX_DEFINE_SORTED_USER_EXPORTED_ARRAY(wxLuaDebugItem *, wxLuaDebugItemArray, WXDLLIMPEXP_WXLUADEBUG); #else ! WX_DEFINE_SORTED_ARRAY(wxLuaDebugItem *, wxLuaDebugItemArray); #endif // ---------------------------------------------------------------------------- ! // wxLuaDebugData - a wxObject ref counted container for a wxLuaDebugItemArray // The Ref data is always expected to exist and the destructor deletes the array items // ---------------------------------------------------------------------------- *************** *** 81,93 **** // Get the data array, please use safe array access functions if possible ! wxLuaDebugDataItemArray* GetArray(); ! const wxLuaDebugDataItemArray* GetArray() const; // wxArray functions mapped to the internal array w/ error checking ! // The wxLuaDebugDataItem items added must be created with 'new' and // will be deleted when this class is destroyed. size_t GetCount() const; ! wxLuaDebugDataItem* Item(size_t index) const; ! void Add(wxLuaDebugDataItem* item); // fill this with the stack entries for the wxLuaState --- 109,121 ---- // Get the data array, please use safe array access functions if possible ! wxLuaDebugItemArray* GetArray(); ! const wxLuaDebugItemArray* GetArray() const; // wxArray functions mapped to the internal array w/ error checking ! // The wxLuaDebugItem items added must be created with 'new' and // will be deleted when this class is destroyed. size_t GetCount() const; ! wxLuaDebugItem* Item(size_t index) const; ! void Add(wxLuaDebugItem* item); // fill this with the stack entries for the wxLuaState *************** *** 104,110 **** // give a consistent feel to the display of lua values. ! // Get a human readable string name 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, wxString& type, wxString& value); // Write the input number as either an int, uint, or as a double static wxString MakeNumber(double dnum); --- 132,139 ---- // 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); *************** *** 120,125 **** wxLuaDebugData Copy() const; ! // Sorting function for the wxLuaDebugDataItemArray, sorts by name ! static int SortFunction(wxLuaDebugDataItem *elem1, wxLuaDebugDataItem *elem2 ); //------------------------------------------------------------------------- --- 149,154 ---- wxLuaDebugData Copy() const; ! // Sorting function for the wxLuaDebugItemArray, sorts by name ! static int SortFunction(wxLuaDebugItem *elem1, wxLuaDebugItem *elem2 ); //------------------------------------------------------------------------- *************** *** 147,156 **** wxLuaCheckStack(lua_State* L, const wxString &msg); ~wxLuaCheckStack(); void TestStack(const wxString &msg); ! static void DumpGlobals(lua_State* L); ! static void DumpTable(lua_State* L, const wxString &tableName); ! static void DumpTable(lua_State* L, int index, const wxString& tablename, wxLuaStringToLongHashMap& dumpList, int indent); ! static void DumpStack(lua_State* L); private: --- 176,188 ---- wxLuaCheckStack(lua_State* L, const wxString &msg); ~wxLuaCheckStack(); + void TestStack(const wxString &msg); ! void DumpGlobals(); ! void DumpTable(const wxString &tableName); ! void DumpTable(int index, const wxString& tablename, wxLuaStringToLongHashMap& dumpList, int indent); ! void DumpStack(); ! ! void OutputMsg(const wxString& msg) const; private: Index: wxlstack.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluadebug/include/wxlstack.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** wxlstack.h 24 May 2007 00:59:46 -0000 1.1 --- wxlstack.h 31 May 2007 17:18:54 -0000 1.2 *************** *** 25,30 **** enum { ! ID_WXLUA_STACKDIALOG_COMBO = 2000, ! ID_WXLUA_STACKDIALOG_LISTCTRL }; --- 25,35 ---- enum { ! ID_WXLUA_STACK_CHOICE = 2000, ! ID_WXLUA_STACK_EXPAND_BUTTON, ! ID_WXLUA_STACK_FIND_COMBO, ! ID_WXLUA_STACK_FINDNEXT_BUTTON, ! ID_WXLUA_STACK_FINDPREV_BUTTON, ! ID_WXLUA_STACK_FINDCASE_CHECKBOX, ! ID_WXLUA_STACK_LISTCTRL }; *************** *** 57,79 **** // Icon indexes for image list used in the listctrl enum { IMG_UNKNOWN, ! IMG_TABLE, ! IMG_TABLE_OPEN, IMG_NIL, ! IMG_BOOL, IMG_NUMBER, IMG_STRING, ! IMG_CFUNCTION, IMG_LUAFUNCTION, IMG_USERDATA, ! IMG_LIGHTUSERDATA, ! IMG_THREAD }; // Draw the string centered in the bitmap virtual wxBitmap CreateBmpString(const wxBitmap& bmp, const wxString& s); ! virtual int SetupListItem(const wxLuaDebugDataItem *dbgItem, wxListItem& lItem); // Override these functions if you need to provide an alternate way to get --- 62,89 ---- // 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, ! IMG_LIGHTUSERDATA, IMG_NUMBER, IMG_STRING, ! IMG_TABLE, IMG_LUAFUNCTION, IMG_USERDATA, ! IMG_THREAD, ! IMG_CFUNCTION, ! ! IMG_TABLE_OPEN, ! IMG__COUNT }; // Draw the string centered in the bitmap virtual wxBitmap CreateBmpString(const wxBitmap& bmp, const wxString& s); ! // Set the image and color to use ! virtual int SetupListItem(const wxLuaDebugItem *dbgItem, wxListItem& lItem); // Override these functions if you need to provide an alternate way to get *************** *** 98,101 **** --- 108,114 ---- // implementation + void OnExpandButton(wxCommandEvent& event); + void OnFind(wxCommandEvent& event); + // Handle and set the stack from the stack combobox selection void OnSelectStack(wxCommandEvent &event); *************** *** 105,123 **** void OnAllItemsDeleted(wxListEvent &event); void OnItemActivated(wxListEvent &event); ! void ItemExpanding(long lc_item); protected: void DeleteAllListItemData(); ! wxListCtrl *m_listCtrl; ! wxComboBox *m_stackComboBox; // display stack entries ! int m_stack_sel; // current stack selection ! wxArrayInt m_stackEntries; // stack entry references ! wxLuaState m_wxlState; // lua_State to show stack for ! wxArrayInt m_luaReferences; // references from m_wxlState.tinsert ! wxImageList *m_imageList; // image list for listctrl private: --- 118,140 ---- void OnAllItemsDeleted(wxListEvent &event); void OnItemActivated(wxListEvent &event); ! bool ExpandItem(long lc_item, bool show_err_msg = true); protected: void DeleteAllListItemData(); ! wxListCtrl* m_listCtrl; ! wxChoice* m_stackChoice; // display stack entries ! int m_stack_sel; // current stack selection ! wxArrayInt m_stackEntries; // stack entry references ! wxComboBox* m_findComboBox; // Find string combobox ! wxCheckBox* m_findCaseCheckBox; // Find case sensitive ! wxLuaState m_wxlState; // lua_State to show stack for ! wxArrayInt m_luaReferences; // references from m_wxlState.tinsert ! ! wxImageList* m_imageList; // image list for listctrl ! wxColour m_typeColours[IMG__COUNT]; private: |