Module ida_kernwin :: Class simplecustviewer_t
[frames] | no frames]

Class simplecustviewer_t

object --+
         |
        simplecustviewer_t

The base class for implementing simple custom viewers

Nested Classes
  UI_Hooks_Trampoline
Instance Methods
 
__init__(self)
x.__init__(...) initializes x; see help(type(x)) for signature
 
__del__(self)
Destructor.
 
OnPopup(self, form, popup_handle)
Context menu popup is about to be shown.
 
Create(self, title)
Creates the custom view.
 
Close(self)
Destroys the view.
 
Show(self)
Shows an already created view.
 
Refresh(self)
 
RefreshCurrent(self)
Refreshes the current line only
 
Count(self)
Returns the number of lines in the view
 
GetSelection(self)
Returns the selected range or None
 
ClearLines(self)
Clears all the lines
 
AddLine(self, line, fgcolor=None, bgcolor=None)
Adds a colored line to the view
 
InsertLine(self, lineno, line, fgcolor=None, bgcolor=None)
Inserts a line in the given position
 
EditLine(self, lineno, line, fgcolor=None, bgcolor=None)
Edits an existing line.
 
PatchLine(self, lineno, offs, value)
Patches an existing line character at the given offset.
 
DelLine(self, lineno)
Deletes an existing line
 
GetLine(self, lineno)
Returns a line
 
GetCurrentWord(self, mouse=0)
Returns the current word
 
GetCurrentLine(self, mouse=0, notags=0)
Returns the current line.
 
GetPos(self, mouse=0)
Returns the current cursor or mouse position.
 
GetLineNo(self, mouse=0)
Calls GetPos() and returns the current line number or -1 on failure
 
Jump(self, lineno, x=0, y=0)
 
IsFocused(self)
Returns True if the current view is the focused view
 
GetWidget(self)
Return the TWidget underlying this view.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

__init__(self)
(Constructor)

 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

__del__(self)
(Destructor)

 

Destructor. It also frees the associated C++ object

OnPopup(self, form, popup_handle)

 

Context menu popup is about to be shown. Create items dynamically if you wish

Returns:
Boolean. True if you handled the event

Create(self, title)

 

Creates the custom view. This should be the first method called after instantiation

Parameters:
  • title - The title of the view
Returns:
Boolean whether it succeeds or fails. It may fail if a window with the same title is already open. In this case better close existing windows

Close(self)

 

Destroys the view. One has to call Create() afterwards. Show() can be called and it will call Create() internally.

Returns:
Boolean

Show(self)

 

Shows an already created view. It the view was close, then it will call Create() for you

Returns:
Boolean

GetSelection(self)

 

Returns the selected range or None

Returns:
  • tuple(x1, y1, x2, y2)
  • None if no selection

AddLine(self, line, fgcolor=None, bgcolor=None)

 

Adds a colored line to the view

Returns:
Boolean

InsertLine(self, lineno, line, fgcolor=None, bgcolor=None)

 

Inserts a line in the given position

Returns:
Boolean

EditLine(self, lineno, line, fgcolor=None, bgcolor=None)

 

Edits an existing line.

Returns:
Boolean

PatchLine(self, lineno, offs, value)

 

Patches an existing line character at the given offset. This is a low level function. You must know what you're doing

DelLine(self, lineno)

 

Deletes an existing line

Returns:
Boolean

GetLine(self, lineno)

 

Returns a line

Parameters:
  • lineno - The line number
Returns:
Returns a tuple (colored_line, fgcolor, bgcolor) or None

GetCurrentWord(self, mouse=0)

 

Returns the current word

Parameters:
  • mouse - Use mouse position or cursor position
Returns:
None if failed or a String containing the current word at mouse or cursor

GetCurrentLine(self, mouse=0, notags=0)

 

Returns the current line.

Parameters:
  • mouse - Current line at mouse pos
  • notags - If True then tag_remove() will be called before returning the line
Returns:
Returns the current line (colored or uncolored) or None on failure

GetPos(self, mouse=0)

 

Returns the current cursor or mouse position.

Parameters:
  • mouse - return mouse position
Returns:
Returns a tuple (lineno, x, y)

GetWidget(self)

 

Return the TWidget underlying this view.

Returns:
The TWidget underlying this view, or None.