Classes | |
class | UIContextNotification |
Interface used to receive notifications related to files and contexts. More... | |
class | UIContextHandler |
class | UIContext |
Functions | |
void | InitUIViews () |
void | InitUIActions () |
void | InitUIPlugins () |
void | SetCurrentUIPluginLoadOrder (BNPluginLoadOrder order) |
void | AddRequiredUIPluginDependency (const std::string &name) |
void | AddOptionalUIPluginDependency (const std::string &name) |
class UIContextNotification |
Interface used to receive notifications related to files and contexts.
Many notifications include the ability to modify the behavior of the context.
Public Member Functions | |
virtual | ~UIContextNotification () |
virtual void | OnContextOpen (UIContext *context) |
Callback after a UIContext is opened (eg MainWindow) | |
virtual void | OnContextClose (UIContext *context) |
Callback right before closing a UIContext. | |
virtual bool | OnBeforeOpenDatabase (UIContext *context, FileMetadataRef metadata) |
Callback before a database (specifically a database, not a raw file) is opened. | |
virtual bool | OnAfterOpenDatabase (UIContext *context, FileMetadataRef metadata, BinaryViewRef data) |
Callback after a database (specifically a database, not a raw file) is opened. | |
virtual void | OnAfterOpenProject (UIContext *context, ProjectRef project) |
Callback after a project is opened. | |
virtual bool | OnBeforeOpenProjectFile (UIContext *context, ProjectFileRef projectFile) |
Callback before a project file is opened. | |
virtual void | OnAfterOpenProjectFile (UIContext *context, ProjectFileRef projectFile, ViewFrame *frame) |
Callback after a project file is opened. | |
virtual bool | OnBeforeOpenFile (UIContext *context, FileContext *file) |
Callback before a file (raw or database) is opened (after OnAfterOpenDatabase if opening a database) | |
virtual void | OnAfterOpenFile (UIContext *context, FileContext *file, ViewFrame *frame) |
Callback after a file (raw or database) is opened. | |
virtual bool | OnBeforeSaveFile (UIContext *context, FileContext *file, ViewFrame *frame) |
Callback before a file is saved (either as a database or raw) | |
virtual void | OnAfterSaveFile (UIContext *context, FileContext *file, ViewFrame *frame) |
Callback after a file is saved (either as a database or raw) | |
virtual bool | OnBeforeCloseFile (UIContext *context, FileContext *file, ViewFrame *frame) |
Callback before a file is closed. | |
virtual void | OnAfterCloseFile (UIContext *context, FileContext *file, ViewFrame *frame) |
Callback after a file is closed. | |
virtual void | OnViewReplaced (UIContext *context, FileContext *file, ViewFrame *oldFrame, ViewFrame *newFrame) |
Callback after a ViewFrame is replaced in an open file (e.g. | |
virtual void | OnDataViewReplaced (UIContext *context, FileContext *file, BinaryViewRef oldData, BinaryViewRef newData) |
Callback after a BinaryView is replaced in an open file (e.g. | |
virtual void | OnViewChange (UIContext *context, ViewFrame *frame, const QString &type) |
Callback when the ui changes views. | |
virtual void | OnAddressChange (UIContext *context, ViewFrame *frame, View *view, const ViewLocation &location) |
Callback when the ui changes address. | |
virtual bool | GetNameForFile (UIContext *context, FileContext *file, QString &name) |
Callback to modify the displayed file name for a FileContext (eg in the window title or tab title) Note: Due to the out param &name, this is not usable from Python with PySide. | |
virtual bool | GetNameForPath (UIContext *context, const QString &path, QString &name) |
Callback to modify the displayed file name for a file path (eg in the new tab widget) Note: Due to the out param &name, this is not usable from Python with PySide. | |
virtual void | OnNewSelectionForXref (UIContext *context, ViewFrame *frame, View *view, const SelectionInfoForXref &selection) |
Callback when the ui changes selection and should update cross references. | |
virtual void | OnActionExecuted (UIContext *context, UIActionHandler *handler, const QString &name, const UIActionContext &ctx, std::function< void(const UIActionContext &)> &action) |
Callback when an action is executed, allowing plugins to intercept and modify the behavior of the action. | |
virtual void | OnContextMenuCreated (UIContext *context, View *view, Menu &menu) |
Callback when a context menu is created, allowing plugins to modify the menu, e.g., registering and adding new actions into it. | |
|
virtual |
|
inlinevirtual |
Callback after a UIContext is opened (eg MainWindow)
context | Opened context |
|
inlinevirtual |
Callback right before closing a UIContext.
context | Closing context |
|
inlinevirtual |
Callback before a database (specifically a database, not a raw file) is opened.
context | Context opening the database |
metadata | Object with info about the database file |
|
inlinevirtual |
Callback after a database (specifically a database, not a raw file) is opened.
context | Context which opened the database |
metadata | Object with info about the database file |
data | Raw data which is backed by the database |
|
inlinevirtual |
Callback after a project is opened.
context | Context which opened the project |
project | Project that was opened |
frame | ViewFrame constructed to display the project |
|
inlinevirtual |
Callback before a project file is opened.
context | Context opening the project file |
projectFile | Project file that is being opened |
|
inlinevirtual |
Callback after a project file is opened.
context | Context which opened the project file |
projectFile | Project file that was opened |
frame | ViewFrame constructed to display the project file |
|
inlinevirtual |
Callback before a file (raw or database) is opened (after OnAfterOpenDatabase if opening a database)
context | Context opening the file |
file | Context with the file and ui views |
|
inlinevirtual |
Callback after a file (raw or database) is opened.
context | Context which opened the file |
file | Context with the file and ui views |
frame | ViewFrame constructed to display the file |
|
inlinevirtual |
Callback before a file is saved (either as a database or raw)
context | Context which is saving the file |
file | Context with the file and ui views |
frame | ViewFrame for the file |
|
inlinevirtual |
Callback after a file is saved (either as a database or raw)
context | Context which saved the file |
file | Context with the file and ui views |
frame | ViewFrame for the file |
|
inlinevirtual |
Callback before a file is closed.
context | Context which is closing the file |
file | Context with the file and ui views |
frame | ViewFrame for the file |
|
inlinevirtual |
Callback after a file is closed.
context | Context which closed the file |
file | Context with the file and ui views |
frame | ViewFrame which former showed the file (will be deleted after this) |
|
inlinevirtual |
|
inlinevirtual |
Callback after a BinaryView is replaced in an open file (e.g.
on Rebase)
context | Context which replaced the view |
file | Context with the file and ui views |
oldData | Old BinaryView with that name |
newData | New BinaryView with that name |
|
inlinevirtual |
|
inlinevirtual |
Callback to modify the displayed file name for a FileContext (eg in the window title or tab title) Note: Due to the out param &name, this is not usable from Python with PySide.
context | Context which will display this name |
file | File whose name to get |
name | [Out] Name to be displayed |
|
inlinevirtual |
Callback to modify the displayed file name for a file path (eg in the new tab widget) Note: Due to the out param &name, this is not usable from Python with PySide.
context | Context which will display this name |
path | Path to file whose name to get |
name | [Out] Name to be displayed |
|
inlinevirtual |
Callback when the ui changes selection and should update cross references.
context | Context changing selection |
frame | ViewFrame which changed selection |
view | View that changed selection |
selection | New selection |
Reimplemented in CrossReferenceWidget, and StackView.
|
inlinevirtual |
Callback when an action is executed, allowing plugins to intercept and modify the behavior of the action.
Plugins may modify the `action` parameter and specify new behavior for the action to execute, which will happen immediately after all registered notifications have been notified.
The original behavior (potentially modified by another notification) can be executed by saving a copy of the value of `action` and calling it from within your modified value.
context | |
handler | |
name | |
ctx | |
action |
|
inlinevirtual |
Callback when a context menu is created, allowing plugins to modify the menu, e.g., registering and adding new actions into it.
This allow plugins to add new entries into the top-level context menu in a non-hacky way. However, it is advised that the plugin should only use this instead of PluginCommand::Register or similar APIs when it is necessary. Besides, if a plugins wishes to add multiple actions, it is better to put them as sub-menus under a single top-level entry, avoiding making the context menu crowded.
This only works for linear/graph/hex/types/stack view due to the way other views create the context menus.
context | |
view | |
menu |
class UIContextHandler |
Public Member Functions | |
virtual | ~UIContextHandler () |
virtual void | updateStatus ()=0 |
virtual void | notifyThemeChanged ()=0 |
virtual void | registerFileOpenMode (const QString &buttonName, const QString &description, const QString &action) |
|
virtual |
|
pure virtual |
|
pure virtual |
|
virtual |
class UIContext |
Public Member Functions | |
UIContext () | |
virtual | ~UIContext () |
virtual QMainWindow * | mainWindow ()=0 |
virtual void | releaseBinaryView (BinaryViewRef view) |
virtual void | viewChanged (ViewFrame *frame, const QString &type) |
virtual bool | navigateForBinaryView (BinaryViewRef view, uint64_t addr) |
virtual bool | navigateToType (const std::string &name, uint64_t offset=0)=0 |
Navigate to a named type in the context, optionally at a member offset. | |
virtual std::vector< std::pair< BinaryViewRef, QString > > | getAvailableBinaryViews ()=0 |
Get a list of all opened binary views, and their names. | |
virtual QWidget * | getTabForSessionId (uint64_t sessionId)=0 |
Gets the tab for for a given sessionId. | |
virtual QString | getTabNameForSessionId (uint64_t sessionId)=0 |
Gets the name of a tab for the given session. | |
virtual View * | getCurrentView ()=0 |
Get the currently visible View for the currently visible ViewFrame (if it exists) | |
virtual ViewFrame * | getCurrentViewFrame ()=0 |
Get the currently visible ViewFrame (if it exists) | |
virtual UIActionHandler * | getCurrentActionHandler ()=0 |
Get the current Action Handler for the focused widget. | |
virtual int | createTabForWidget (const QString &name, QWidget *widget)=0 |
Open a tab containing the given widget with the given name. | |
virtual void | splitToNewWindowAndNavigateToLocation (uint64_t location)=0 |
Open a new window with the same file context and Navigate to a given location. | |
virtual void | splitToNewTabAndNavigateToLocation (uint64_t location)=0 |
Open a new tab with the same file context and Navigate to a given location. | |
virtual void | openPane (Pane *pane, Qt::Orientation primaryDirection=Qt::Vertical)=0 |
Open a new pane in the active tab. | |
virtual QList< QWidget * > | getTabs ()=0 |
Get a list of all tabs as QWidgets. | |
virtual QWidget * | getTabForName (const QString &name)=0 |
Get the QWidget responsible for the tab with the given name. | |
virtual QWidget * | getTabForFile (FileContext *file)=0 |
Get the QWidget responsible for the tab with the given file. | |
virtual QString | getNameForTab (QWidget *tab)=0 |
Get the name of the tab with the given QWidget. | |
virtual void | activateTab (QWidget *tab)=0 |
Activate and make visible the tab with the given QWidget. | |
virtual void | closeTab (QWidget *tab, bool closeWindowIfLast=false)=0 |
Close the tab with the given QWidget. | |
virtual QWidget * | getCurrentTab ()=0 |
Get the QWidget in the currently open tab. | |
virtual QWidget * | createNewTab (bool focus=true)=0 |
virtual View * | getViewForTab (QWidget *tab)=0 |
Get the current View associated with the given QWidget, if it exists. | |
virtual ViewFrame * | getViewFrameForTab (QWidget *tab) const =0 |
Get the active ViewFrame associated with the given QWidget, if it exists. | |
virtual std::vector< ViewFrame * > | getAllViewFramesForTab (QWidget *tab) const =0 |
Get all ViewFrame instances associated with the given QWidget, if they exist. | |
virtual ProjectRef | getProject () |
virtual ProjectStatusWidget * | getProjectStatusWidget () |
virtual bool | openFilename (const QString &path, bool openOptions=false) |
virtual ProjectRef | openProject (const QString &path) |
virtual ViewFrame * | openFileContext (FileContext *file, const QString &forcedView="", bool addTab=true) |
virtual bool | openProjectFile (ProjectFileRef file, ExternalLocationRef loc=nullptr, bool openWithOptions=false) |
virtual void | recreateViewFrames (FileContext *file)=0 |
UIActionHandler * | globalActions () |
virtual UIActionHandler * | contentActionHandler ()=0 |
virtual Sidebar * | sidebar ()=0 |
virtual GlobalArea * | globalArea ()=0 |
void | NotifyOnContextOpen () |
void | NotifyOnContextClose () |
bool | NotifyOnBeforeOpenDatabase (FileMetadataRef metadata) |
bool | NotifyOnAfterOpenDatabase (FileMetadataRef metadata, BinaryViewRef data) |
void | NotifyOnAfterOpenProject (ProjectRef project) |
bool | NotifyOnBeforeOpenProjectFile (ProjectFileRef projectFile) |
void | NotifyOnAfterOpenProjectFile (ProjectFileRef projectFile, ViewFrame *frame) |
bool | NotifyOnBeforeOpenFile (FileContext *file) |
void | NotifyOnAfterOpenFile (FileContext *file, ViewFrame *frame) |
bool | NotifyOnBeforeSaveFile (FileContext *file, ViewFrame *frame) |
void | NotifyOnAfterSaveFile (FileContext *file, ViewFrame *frame) |
bool | NotifyOnBeforeCloseFile (FileContext *file, ViewFrame *frame) |
void | NotifyOnAfterCloseFile (FileContext *file, ViewFrame *frame) |
void | NotifyOnViewReplaced (FileContext *file, ViewFrame *oldFrame, ViewFrame *newFrame) |
void | NotifyOnDataViewReplaced (FileContext *file, BinaryViewRef oldView, BinaryViewRef newView) |
void | NotifyOnViewChange (ViewFrame *frame, const QString &type) |
void | NotifyOnAddressChange (ViewFrame *frame, View *view, const ViewLocation &location) |
void | updateCrossReferences (ViewFrame *frame, View *view, const SelectionInfoForXref &selection) |
void | NotifyOnActionExecuted (UIActionHandler *handler, const QString &name, const UIActionContext &ctx, std::function< void(const UIActionContext &)> &action) |
void | NotifyOnContextMenuCreated (View *view, Menu &menu) |
virtual void | findAll (const BinaryNinja::FindParameters ¶ms) |
QString | GetNameForFile (FileContext *file) |
Get the displayed name for a given file. | |
QString | GetNameForPath (const QString &path) |
Get the displayed name for a path to a file. | |
virtual QWidget * | fileContentsLockStatusWidget ()=0 |
void | associateAdditionalWindowWithContext (QWidget *window) |
Static Public Member Functions | |
static void | registerNotification (UIContextNotification *notification) |
Register an object to receive notifications of UIContext events. | |
static void | unregisterNotification (UIContextNotification *notification) |
Unregister an object from receiving notifications of UIContext events. | |
static void | deassociateAdditionalWindowWithContext (QWidget *window) |
static void | setHandler (UIContextHandler *handler) |
static QSize | getScaledWindowSize (int x, int y) |
static void | updateStatus () |
static void | notifyThemeChanged () |
static void | showPreview (QWidget *parent, PreviewWidget *preview, QPoint localPos, bool anchorAtPoint=false) |
static void | closePreview () |
static bool | sendPreviewWheelEvent (QWheelEvent *event) |
static void | closeOtherActiveModalWidget (QWidget *current) |
static void | registerFileOpenMode (const QString &buttonName, const QString &description, const QString &action) |
static UIContext * | contextForWidget (QWidget *widget) |
static UIContext * | activeContext () |
static std::set< UIContext * > | allContexts () |
static QWidget * | topLevelAt (const QPoint &pt, QWidget *ignoreWidget=nullptr) |
static QRect | placeNewTopLevelWindow (QScreen *screen, const QPoint &pos, QWidget *existingWidget) |
static ViewFrame * | currentViewFrameForWidget (QWidget *widget) |
Protected Member Functions | |
void | setupUIContext (QWidget *obj) |
UIContext::UIContext | ( | ) |
|
virtual |
|
protected |
|
pure virtual |
|
virtual |
|
virtual |
|
virtual |
|
pure virtual |
Navigate to a named type in the context, optionally at a member offset.
name | Name of type to which to navigate |
offset | Offset of member in type to which to navigate |
|
pure virtual |
Get a list of all opened binary views, and their names.
|
pure virtual |
Gets the tab for for a given sessionId.
|
pure virtual |
Gets the name of a tab for the given session.
|
pure virtual |
|
pure virtual |
|
pure virtual |
Get the current Action Handler for the focused widget.
|
pure virtual |
Open a tab containing the given widget with the given name.
name | Name for tab |
widget | Widget to display in the tab (optionally a ViewFrame) |
|
pure virtual |
Open a new window with the same file context and Navigate to a given location.
location |
|
pure virtual |
Open a new tab with the same file context and Navigate to a given location.
location |
|
pure virtual |
Open a new pane in the active tab.
pane | Pane widget to open |
primaryDirection | Primary axis for content in pane (determines default split direction) |
|
pure virtual |
Get a list of all tabs as QWidgets.
|
pure virtual |
Get the QWidget responsible for the tab with the given name.
name | Name of tab to get |
|
pure virtual |
Get the QWidget responsible for the tab with the given file.
file | File of tab to get |
|
pure virtual |
Get the name of the tab with the given QWidget.
tab | QWidget which is in a tab |
|
pure virtual |
Activate and make visible the tab with the given QWidget.
tab | QWidget which is in a tab |
|
pure virtual |
Close the tab with the given QWidget.
tab | QWidget which is in a tab |
closeWindowIfLast | If false, displays the new tab page if the widget was the last tab |
|
pure virtual |
Get the QWidget in the currently open tab.
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
virtual |
|
pure virtual |
|
inline |
|
pure virtual |
|
pure virtual |
|
pure virtual |
void UIContext::NotifyOnContextOpen | ( | ) |
void UIContext::NotifyOnContextClose | ( | ) |
bool UIContext::NotifyOnBeforeOpenDatabase | ( | FileMetadataRef | metadata | ) |
bool UIContext::NotifyOnAfterOpenDatabase | ( | FileMetadataRef | metadata, |
BinaryViewRef | data ) |
void UIContext::NotifyOnAfterOpenProject | ( | ProjectRef | project | ) |
bool UIContext::NotifyOnBeforeOpenProjectFile | ( | ProjectFileRef | projectFile | ) |
void UIContext::NotifyOnAfterOpenProjectFile | ( | ProjectFileRef | projectFile, |
ViewFrame * | frame ) |
bool UIContext::NotifyOnBeforeOpenFile | ( | FileContext * | file | ) |
void UIContext::NotifyOnAfterOpenFile | ( | FileContext * | file, |
ViewFrame * | frame ) |
bool UIContext::NotifyOnBeforeSaveFile | ( | FileContext * | file, |
ViewFrame * | frame ) |
void UIContext::NotifyOnAfterSaveFile | ( | FileContext * | file, |
ViewFrame * | frame ) |
bool UIContext::NotifyOnBeforeCloseFile | ( | FileContext * | file, |
ViewFrame * | frame ) |
void UIContext::NotifyOnAfterCloseFile | ( | FileContext * | file, |
ViewFrame * | frame ) |
void UIContext::NotifyOnViewReplaced | ( | FileContext * | file, |
ViewFrame * | oldFrame, | ||
ViewFrame * | newFrame ) |
void UIContext::NotifyOnDataViewReplaced | ( | FileContext * | file, |
BinaryViewRef | oldView, | ||
BinaryViewRef | newView ) |
void UIContext::NotifyOnViewChange | ( | ViewFrame * | frame, |
const QString & | type ) |
void UIContext::NotifyOnAddressChange | ( | ViewFrame * | frame, |
View * | view, | ||
const ViewLocation & | location ) |
void UIContext::updateCrossReferences | ( | ViewFrame * | frame, |
View * | view, | ||
const SelectionInfoForXref & | selection ) |
void UIContext::NotifyOnActionExecuted | ( | UIActionHandler * | handler, |
const QString & | name, | ||
const UIActionContext & | ctx, | ||
std::function< void(const UIActionContext &)> & | action ) |
|
virtual |
|
static |
Register an object to receive notifications of UIContext events.
notification | Object which will receive notifications |
|
static |
Unregister an object from receiving notifications of UIContext events.
notification | Object which will no longer receive notifications |
QString UIContext::GetNameForFile | ( | FileContext * | file | ) |
Get the displayed name for a given file.
file | File whose displayed name to get |
QString UIContext::GetNameForPath | ( | const QString & | path | ) |
Get the displayed name for a path to a file.
path | Path to file whose displayed name you want |
|
pure virtual |
void UIContext::associateAdditionalWindowWithContext | ( | QWidget * | window | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
void InitUIViews | ( | ) |
void InitUIActions | ( | ) |
void InitUIPlugins | ( | ) |
void SetCurrentUIPluginLoadOrder | ( | BNPluginLoadOrder | order | ) |
void AddRequiredUIPluginDependency | ( | const std::string & | name | ) |
void AddOptionalUIPluginDependency | ( | const std::string & | name | ) |