TypeEditor Class Reference

Classes

struct  SavedCursorPosition
 

Signals

void typeNameNavigated (const std::string &typeName)
 
void currentTypeUpdated (const BinaryNinja::QualifiedName &typeName)
 
void currentTypeDeleted (const BinaryNinja::QualifiedName &typeName)
 
void currentTypeNameUpdated (const BinaryNinja::QualifiedName &typeName)
 
- Signals inherited from TokenizedTextWidget
void sizeChanged (int cols, int rows)
 
void visibleChanged (int leftCol, int topRow)
 
void linesChanged ()
 
void selectionChanged (const TokenizedTextWidgetCursorPosition &begin, const TokenizedTextWidgetCursorPosition &end)
 
void tokenLeftClicked (const TokenizedTextWidgetCursorPosition &position)
 
void tokenRightClicked (const TokenizedTextWidgetCursorPosition &position)
 
void tokenDoubleClicked (const TokenizedTextWidgetCursorPosition &position)
 
void tokenOtherClicked (const TokenizedTextWidgetCursorPosition &position, Qt::MouseButton button)
 
void tokenHovered (const TokenizedTextWidgetCursorPosition &position)
 
void lineLeftClicked (size_t lineIndex)
 
void lineRightClicked (size_t lineIndex)
 
void lineDoubleClicked (size_t lineIndex)
 
void lineOtherClicked (size_t lineIndex, Qt::MouseButton button)
 
void lineHovered (size_t lineIndex)
 

Public Member Functions

 TypeEditor (QWidget *parent)
 
void bindActions ()
 
PlatformRef platform () const
 
void setPlatform (PlatformRef platform)
 
std::optional< BinaryViewRefbinaryView () const
 
void setBinaryView (std::optional< BinaryViewRef > binaryView)
 
std::optional< std::reference_wrapper< const BinaryNinja::TypeContainer > > typeContainer () const
 
void setTypeContainer (std::optional< BinaryNinja::TypeContainer > container)
 
std::vector< BinaryNinja::QualifiedNametypeNames () const
 
void setTypeNames (const std::vector< BinaryNinja::QualifiedName > &names)
 
int selectedLineCount () const
 
std::unordered_set< size_t > selectedLineStarts () const
 
int selectedRootTypeCount () const
 
std::unordered_set< BinaryNinja::QualifiedNameselectedRootTypes () const
 
std::optional< size_t > firstWrappedLineIndexForLineIndex (size_t lineIndex) const
 
std::optional< size_t > lastWrappedLineIndexForLineIndex (size_t lineIndex) const
 
std::optional< std::reference_wrapper< const BinaryNinja::TypeDefinitionLine > > typeLineAtIndex (size_t lineIndex) const
 
std::optional< std::reference_wrapper< const BinaryNinja::TypeDefinitionLine > > typeLineAtPosition (const TokenizedTextWidgetCursorPosition &position) const
 
std::optional< BinaryNinja::QualifiedNamerootTypeNameAtIndex (size_t lineIndex) const
 
std::optional< BinaryNinja::QualifiedNamerootTypeNameAtPosition (const TokenizedTextWidgetCursorPosition &position) const
 
std::optional< TypeRefrootTypeAtIndex (size_t lineIndex) const
 
std::optional< TypeRefrootTypeAtPosition (const TokenizedTextWidgetCursorPosition &position) const
 
std::optional< uint64_t > offsetAtIndex (size_t lineIndex) const
 
std::optional< uint64_t > offsetAtPosition (const TokenizedTextWidgetCursorPosition &position) const
 
std::optional< int64_t > relativeOffsetAtPosition (const TokenizedTextWidgetCursorPosition &position) const
 
std::optional< TokenizedTextWidgetCursorPositionfirstPositionForOffset (const BinaryNinja::QualifiedName &name, uint64_t offset) const
 
std::optional< TokenizedTextWidgetCursorPositionlastPositionForOffset (const BinaryNinja::QualifiedName &name, uint64_t offset) const
 
void selectOffsetRange (const BinaryNinja::QualifiedName &name, uint64_t start, uint64_t end)
 
SavedCursorPosition saveCursorPosition () const
 
void restoreCursorPosition (const SavedCursorPosition &position)
 
bool canCreateAllMembersForStructure ()
 
void createAllMembersForStructure ()
 
bool canCreateCurrentMemberForStructure ()
 
void createCurrentMemberForStructure ()
 
bool canRename ()
 
void rename ()
 
void renameRoot ()
 
void renameMember ()
 
bool canUndefine ()
 
void undefine ()
 
void undefineRoots ()
 
void undefineMembers ()
 
bool canAppendField ()
 
void appendField ()
 
bool canCreateArray ()
 
void createArray ()
 
bool canChangeType ()
 
void changeType ()
 
void changeTypeRoot ()
 
void changeTypeAddMember (bool atEnd=false)
 
void changeTypeMember ()
 
bool canChangeTypeMembers ()
 
void changeTypeMembers (TypeRef newType)
 
bool canSetStructureSize ()
 
void setStructureSize ()
 
bool canAddUserXref ()
 
void addUserXref ()
 
bool canMakePointer ()
 
void makePointer ()
 
bool canMakeCString ()
 
void makeCString ()
 
bool canMakeUTF16String ()
 
void makeUTF16String ()
 
bool canMakeUTF32String ()
 
void makeUTF32String ()
 
bool canCycleIntegerSize ()
 
void cycleIntegerSize ()
 
bool canCycleFloatSize ()
 
void cycleFloatSize ()
 
bool canInvertIntegerSize ()
 
void invertIntegerSize ()
 
bool canMakeInt8 ()
 
void makeInt8 ()
 
bool canMakeInt16 ()
 
void makeInt16 ()
 
bool canMakeInt32 ()
 
void makeInt32 ()
 
bool canMakeInt64 ()
 
void makeInt64 ()
 
bool canMakeFloat32 ()
 
void makeFloat32 ()
 
bool canMakeFloat64 ()
 
void makeFloat64 ()
 
bool canGoToAddress (bool selecting)
 
void goToAddress (bool selecting)
 
void toggleWrapLines ()
 
void toggleShowInherited ()
 
std::string getDebugText ()
 
- Public Member Functions inherited from TokenizedTextWidget
 TokenizedTextWidget (QWidget *parent, const std::vector< BinaryNinja::LinearDisassemblyLine > &lines=std::vector< BinaryNinja::LinearDisassemblyLine >())
 
virtual ~TokenizedTextWidget ()
 
void bindActions ()
 
QFont font () const
 
void setFont (const QFont &font)
 
DisassemblySettingsRef settings ()
 
const DisassemblySettingsRefsettings () const
 
int topLineIndex () const
 
int leftmostCharIndex () const
 
int visibleColumnCount () const
 
int visibleRowCount () const
 
int contentsColumnCount () const
 
int contentsRowCount () const
 
bool hasSelection () const
 
TokenizedTextWidgetSelectionStyle selectionStyle () const
 
TokenizedTextWidgetCursorPosition selectionBegin () const
 
TokenizedTextWidgetCursorPosition selectionEnd () const
 
TokenizedTextWidgetCursorPosition selectionBase () const
 
TokenizedTextWidgetCursorPosition cursorPosition () const
 
bool forceLineSelect () const
 
void setForceLineSelect (bool value)
 
void setSelection (TokenizedTextWidgetCursorPosition base, TokenizedTextWidgetCursorPosition cursor, TokenizedTextWidgetSelectionStyle mode)
 
void setCursorPosition (TokenizedTextWidgetCursorPosition newPosition, bool selecting, bool cursorKeys, bool evenIfNoChange)
 
void moveCursorHorizontal (int count, bool allTheWay, bool selecting, bool cursorKeys)
 
void moveCursorVertical (int count, bool allTheWay, bool selecting, bool cursorKeys)
 
bool autoScrollHorizontal () const
 
void setAutoScrollHorizontal (bool value)
 
bool autoScrollVertical () const
 
void setAutoScrollVertical (bool value)
 
HighlightTokenState highlightTokenState ()
 
UIActionHandleractionHandler ()
 
virtual UIActionContext actionContext ()
 
MenucontextMenu ()
 
void showContextMenu ()
 
void left (size_t count, bool selecting)
 
void right (size_t count, bool selecting)
 
void leftToWord (bool selecting)
 
void rightToWord (bool selecting)
 
void up (bool selecting)
 
void down (bool selecting)
 
void pageUp (bool selecting)
 
void pageDown (bool selecting)
 
void moveToStartOfLine (bool selecting)
 
void moveToEndOfLine (bool selecting)
 
void moveToStartOfView (bool selecting)
 
void moveToEndOfView (bool selecting)
 
void selectAll ()
 
void selectNone ()
 
void scrollLines (int count)
 
void scrollLineToVisible (int lineIndex)
 
void scrollLineToTop (int lineIndex)
 
void scrollChars (int count)
 
void scrollCharToVisible (int charIndex)
 
void scrollCharToLeftmost (int charIndex)
 
void copy () const
 
std::string selectedText () const
 
const std::vector< BinaryNinja::LinearDisassemblyLine > & lines () const
 
std::optional< std::reference_wrapper< const BinaryNinja::LinearDisassemblyLine > > lineAtPosition (const TokenizedTextWidgetCursorPosition &position) const
 
std::optional< std::reference_wrapper< const BinaryNinja::InstructionTextToken > > tokenAtPosition (const TokenizedTextWidgetCursorPosition &position) const
 
std::optional< char > charAtPosition (const TokenizedTextWidgetCursorPosition &position) const
 
void clearLines ()
 
void setLines (const std::vector< BinaryNinja::LinearDisassemblyLine > &lines, bool resetScroll=true)
 
void setLines (const std::vector< BinaryNinja::DisassemblyTextLine > &lines, bool resetScroll=true)
 
void setLines (const std::vector< BinaryNinja::TypeDefinitionLine > &lines, bool resetScroll=true)
 
int lineCopyStyles (size_t lineIndex) const
 
void setLineCopyStyles (size_t lineIndex, int styles)
 
int tokenCopyStyles (size_t lineIndex, size_t tokenIndex) const
 
void setTokenCopyStyles (size_t lineIndex, size_t tokenIndex, int styles)
 
bool tokenSelectLineTarget (size_t lineIndex, size_t tokenIndex) const
 
void setTokenSelectLineTarget (size_t lineIndex, size_t tokenIndex, bool selectLineTarget)
 

Static Public Member Functions

static void registerActions ()
 

Additional Inherited Members

- Protected Member Functions inherited from TokenizedTextWidget
virtual void updateMetadata (const std::vector< BinaryNinja::LinearDisassemblyLine > &lines, int &width, int &height)
 
virtual void resizeEvent (QResizeEvent *event) override
 
virtual void paintEvent (QPaintEvent *event) override
 
virtual void wheelEvent (QWheelEvent *event) override
 
virtual void mousePressEvent (QMouseEvent *event) override
 
virtual void mouseMoveEvent (QMouseEvent *event) override
 
virtual void mouseDoubleClickEvent (QMouseEvent *event) override
 
virtual void leaveEvent (QEvent *event) override
 
virtual void focusInEvent (QFocusEvent *event) override
 
virtual void focusOutEvent (QFocusEvent *event) override
 
virtual void contextMenuEvent (QContextMenuEvent *event) override
 

Class Documentation

◆ TypeEditor::SavedCursorPosition

struct TypeEditor::SavedCursorPosition
Class Members
bool restoreCursor
bool restoreTop
TokenizedTextWidgetSelectionStyle style
PositionData cursor
PositionData base
PositionData top

Constructor & Destructor Documentation

◆ TypeEditor()

TypeEditor::TypeEditor ( QWidget *  parent)

Member Function Documentation

◆ registerActions()

static void TypeEditor::registerActions ( )
static

◆ bindActions()

void TypeEditor::bindActions ( )

◆ platform()

PlatformRef TypeEditor::platform ( ) const
inline

◆ setPlatform()

void TypeEditor::setPlatform ( PlatformRef  platform)
inline

◆ binaryView()

std::optional< BinaryViewRef > TypeEditor::binaryView ( ) const
inline

◆ setBinaryView()

void TypeEditor::setBinaryView ( std::optional< BinaryViewRef binaryView)
inline

◆ typeContainer()

std::optional< std::reference_wrapper< const BinaryNinja::TypeContainer > > TypeEditor::typeContainer ( ) const

◆ setTypeContainer()

void TypeEditor::setTypeContainer ( std::optional< BinaryNinja::TypeContainer container)

◆ typeNames()

std::vector< BinaryNinja::QualifiedName > TypeEditor::typeNames ( ) const
inline

◆ setTypeNames()

void TypeEditor::setTypeNames ( const std::vector< BinaryNinja::QualifiedName > &  names)

◆ selectedLineCount()

int TypeEditor::selectedLineCount ( ) const

◆ selectedLineStarts()

std::unordered_set< size_t > TypeEditor::selectedLineStarts ( ) const

◆ selectedRootTypeCount()

int TypeEditor::selectedRootTypeCount ( ) const

◆ selectedRootTypes()

std::unordered_set< BinaryNinja::QualifiedName > TypeEditor::selectedRootTypes ( ) const

◆ firstWrappedLineIndexForLineIndex()

std::optional< size_t > TypeEditor::firstWrappedLineIndexForLineIndex ( size_t  lineIndex) const

◆ lastWrappedLineIndexForLineIndex()

std::optional< size_t > TypeEditor::lastWrappedLineIndexForLineIndex ( size_t  lineIndex) const

◆ typeLineAtIndex()

std::optional< std::reference_wrapper< const BinaryNinja::TypeDefinitionLine > > TypeEditor::typeLineAtIndex ( size_t  lineIndex) const

◆ typeLineAtPosition()

std::optional< std::reference_wrapper< const BinaryNinja::TypeDefinitionLine > > TypeEditor::typeLineAtPosition ( const TokenizedTextWidgetCursorPosition position) const

◆ rootTypeNameAtIndex()

std::optional< BinaryNinja::QualifiedName > TypeEditor::rootTypeNameAtIndex ( size_t  lineIndex) const

◆ rootTypeNameAtPosition()

std::optional< BinaryNinja::QualifiedName > TypeEditor::rootTypeNameAtPosition ( const TokenizedTextWidgetCursorPosition position) const

◆ rootTypeAtIndex()

std::optional< TypeRef > TypeEditor::rootTypeAtIndex ( size_t  lineIndex) const

◆ rootTypeAtPosition()

std::optional< TypeRef > TypeEditor::rootTypeAtPosition ( const TokenizedTextWidgetCursorPosition position) const

◆ offsetAtIndex()

std::optional< uint64_t > TypeEditor::offsetAtIndex ( size_t  lineIndex) const

◆ offsetAtPosition()

std::optional< uint64_t > TypeEditor::offsetAtPosition ( const TokenizedTextWidgetCursorPosition position) const

◆ relativeOffsetAtPosition()

std::optional< int64_t > TypeEditor::relativeOffsetAtPosition ( const TokenizedTextWidgetCursorPosition position) const

◆ firstPositionForOffset()

std::optional< TokenizedTextWidgetCursorPosition > TypeEditor::firstPositionForOffset ( const BinaryNinja::QualifiedName name,
uint64_t  offset 
) const

◆ lastPositionForOffset()

std::optional< TokenizedTextWidgetCursorPosition > TypeEditor::lastPositionForOffset ( const BinaryNinja::QualifiedName name,
uint64_t  offset 
) const

◆ selectOffsetRange()

void TypeEditor::selectOffsetRange ( const BinaryNinja::QualifiedName name,
uint64_t  start,
uint64_t  end 
)

◆ saveCursorPosition()

SavedCursorPosition TypeEditor::saveCursorPosition ( ) const

◆ restoreCursorPosition()

void TypeEditor::restoreCursorPosition ( const SavedCursorPosition position)

◆ canCreateAllMembersForStructure()

bool TypeEditor::canCreateAllMembersForStructure ( )

◆ createAllMembersForStructure()

void TypeEditor::createAllMembersForStructure ( )

◆ canCreateCurrentMemberForStructure()

bool TypeEditor::canCreateCurrentMemberForStructure ( )

◆ createCurrentMemberForStructure()

void TypeEditor::createCurrentMemberForStructure ( )

◆ canRename()

bool TypeEditor::canRename ( )

◆ rename()

void TypeEditor::rename ( )

◆ renameRoot()

void TypeEditor::renameRoot ( )

◆ renameMember()

void TypeEditor::renameMember ( )

◆ canUndefine()

bool TypeEditor::canUndefine ( )

◆ undefine()

void TypeEditor::undefine ( )

◆ undefineRoots()

void TypeEditor::undefineRoots ( )

◆ undefineMembers()

void TypeEditor::undefineMembers ( )

◆ canAppendField()

bool TypeEditor::canAppendField ( )

◆ appendField()

void TypeEditor::appendField ( )

◆ canCreateArray()

bool TypeEditor::canCreateArray ( )

◆ createArray()

void TypeEditor::createArray ( )

◆ canChangeType()

bool TypeEditor::canChangeType ( )

◆ changeType()

void TypeEditor::changeType ( )

◆ changeTypeRoot()

void TypeEditor::changeTypeRoot ( )

◆ changeTypeAddMember()

void TypeEditor::changeTypeAddMember ( bool  atEnd = false)

◆ changeTypeMember()

void TypeEditor::changeTypeMember ( )

◆ canChangeTypeMembers()

bool TypeEditor::canChangeTypeMembers ( )

◆ changeTypeMembers()

void TypeEditor::changeTypeMembers ( TypeRef  newType)

◆ canSetStructureSize()

bool TypeEditor::canSetStructureSize ( )

◆ setStructureSize()

void TypeEditor::setStructureSize ( )

◆ canAddUserXref()

bool TypeEditor::canAddUserXref ( )

◆ addUserXref()

void TypeEditor::addUserXref ( )

◆ canMakePointer()

bool TypeEditor::canMakePointer ( )

◆ makePointer()

void TypeEditor::makePointer ( )

◆ canMakeCString()

bool TypeEditor::canMakeCString ( )

◆ makeCString()

void TypeEditor::makeCString ( )

◆ canMakeUTF16String()

bool TypeEditor::canMakeUTF16String ( )

◆ makeUTF16String()

void TypeEditor::makeUTF16String ( )

◆ canMakeUTF32String()

bool TypeEditor::canMakeUTF32String ( )

◆ makeUTF32String()

void TypeEditor::makeUTF32String ( )

◆ canCycleIntegerSize()

bool TypeEditor::canCycleIntegerSize ( )

◆ cycleIntegerSize()

void TypeEditor::cycleIntegerSize ( )

◆ canCycleFloatSize()

bool TypeEditor::canCycleFloatSize ( )

◆ cycleFloatSize()

void TypeEditor::cycleFloatSize ( )

◆ canInvertIntegerSize()

bool TypeEditor::canInvertIntegerSize ( )

◆ invertIntegerSize()

void TypeEditor::invertIntegerSize ( )

◆ canMakeInt8()

bool TypeEditor::canMakeInt8 ( )

◆ makeInt8()

void TypeEditor::makeInt8 ( )

◆ canMakeInt16()

bool TypeEditor::canMakeInt16 ( )

◆ makeInt16()

void TypeEditor::makeInt16 ( )

◆ canMakeInt32()

bool TypeEditor::canMakeInt32 ( )

◆ makeInt32()

void TypeEditor::makeInt32 ( )

◆ canMakeInt64()

bool TypeEditor::canMakeInt64 ( )

◆ makeInt64()

void TypeEditor::makeInt64 ( )

◆ canMakeFloat32()

bool TypeEditor::canMakeFloat32 ( )

◆ makeFloat32()

void TypeEditor::makeFloat32 ( )

◆ canMakeFloat64()

bool TypeEditor::canMakeFloat64 ( )

◆ makeFloat64()

void TypeEditor::makeFloat64 ( )

◆ canGoToAddress()

bool TypeEditor::canGoToAddress ( bool  selecting)

◆ goToAddress()

void TypeEditor::goToAddress ( bool  selecting)

◆ toggleWrapLines()

void TypeEditor::toggleWrapLines ( )

◆ toggleShowInherited()

void TypeEditor::toggleShowInherited ( )

◆ getDebugText()

std::string TypeEditor::getDebugText ( )

◆ typeNameNavigated

void TypeEditor::typeNameNavigated ( const std::string &  typeName)
signal

◆ currentTypeUpdated

void TypeEditor::currentTypeUpdated ( const BinaryNinja::QualifiedName typeName)
signal

◆ currentTypeDeleted

void TypeEditor::currentTypeDeleted ( const BinaryNinja::QualifiedName typeName)
signal

◆ currentTypeNameUpdated

void TypeEditor::currentTypeNameUpdated ( const BinaryNinja::QualifiedName typeName)
signal