From f6e2976e166f7f533a618352a761504b8339db88 Mon Sep 17 00:00:00 2001 From: Glenn Smith Date: Tue, 16 Mar 2021 21:27:42 -0400 Subject: Make TypeView::getLinesForType static+public --- ui/typeview.h | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/ui/typeview.h b/ui/typeview.h index 40e41215..2d95a080 100644 --- a/ui/typeview.h +++ b/ui/typeview.h @@ -17,6 +17,27 @@ #define TYPE_VIEW_UPDATE_CHECK_INTERVAL 200 +enum BINARYNINJAUIAPI TypeDefinitionLineType +{ + TypedefLineType, + StructDefinitionLineType, + StructFieldLineType, + StructDefinitionEndLineType, + EnumDefinitionLineType, + EnumMemberLineType, + EnumDefinitionEndLineType, + PaddingLineType +}; + +struct BINARYNINJAUIAPI TypeDefinitionLine +{ + TypeDefinitionLineType lineType; + std::vector tokens; + TypeRef type, rootType; + uint64_t offset; + size_t fieldIndex; +}; + class BINARYNINJAUIAPI TypeViewHistoryEntry: public HistoryEntry { BinaryNinja::QualifiedName m_cursorType; @@ -56,27 +77,6 @@ class BINARYNINJAUIAPI TypeView: public QAbstractScrollArea, public View, public { Q_OBJECT - enum TypeDefinitionLineType - { - TypedefLineType, - StructDefinitionLineType, - StructFieldLineType, - StructDefinitionEndLineType, - EnumDefinitionLineType, - EnumMemberLineType, - EnumDefinitionEndLineType, - PaddingLineType - }; - - struct TypeDefinitionLine - { - TypeDefinitionLineType lineType; - std::vector tokens; - TypeRef type, rootType; - uint64_t offset; - size_t fieldIndex; - }; - struct TypeLineIndex { BinaryNinja::QualifiedName name; @@ -119,8 +119,6 @@ class BINARYNINJAUIAPI TypeView: public QAbstractScrollArea, public View, public void adjustSize(int width, int height); - std::vector getLinesForType(const std::string& name, const std::string& varName, size_t index, - TypeRef type, TypeRef parent); void refreshAllTypes(); void ensureCursorVisible(); void focusOnCursor(); @@ -204,6 +202,8 @@ public: virtual ArchitectureRef getOrAskForArchitecture(); + static std::vector getLinesForType(const std::string& name, const std::string& varName, size_t index, TypeRef type, TypeRef parent, int paddingCols); + protected: virtual void resizeEvent(QResizeEvent* event) override; virtual void paintEvent(QPaintEvent* event) override; -- cgit v1.3.1