From a46902ef8bbde08221ffd869054e206c0dfc2234 Mon Sep 17 00:00:00 2001 From: Glenn Smith Date: Mon, 24 May 2021 22:37:09 -0400 Subject: Updated examples and docs --- examples/uinotification/uinotification.cpp | 20 +++++++++++++++++++- examples/uinotification/uinotification.h | 2 ++ 2 files changed, 21 insertions(+), 1 deletion(-) (limited to 'examples') diff --git a/examples/uinotification/uinotification.cpp b/examples/uinotification/uinotification.cpp index f498db4c..d9eada8e 100644 --- a/examples/uinotification/uinotification.cpp +++ b/examples/uinotification/uinotification.cpp @@ -2,7 +2,8 @@ #include "uinotification.h" #include "filecontext.h" #include "viewframe.h" -#include +#include +#include using namespace BinaryNinja; @@ -92,6 +93,23 @@ void NotificationListener::OnAddressChange(UIContext* context, ViewFrame* frame, } +bool NotificationListener::GetNameForFile(UIContext* context, FileContext* file, QString& name) +{ + LogInfo("GetNameForFile"); + name = file->getFilename() + " Foo"; + return true; +} + + +bool NotificationListener::GetNameForPath(UIContext* context, const QString& path, QString& name) +{ + QFileInfo info(path); + LogInfo("GetNameForPath"); + name = info.baseName() + " Foo"; + return true; +} + + extern "C" { BN_DECLARE_UI_ABI_VERSION diff --git a/examples/uinotification/uinotification.h b/examples/uinotification/uinotification.h index 3a3231be..31ffbc34 100644 --- a/examples/uinotification/uinotification.h +++ b/examples/uinotification/uinotification.h @@ -18,6 +18,8 @@ public: virtual void OnAfterCloseFile(UIContext* context, FileContext* file, ViewFrame* frame) override; virtual void OnViewChange(UIContext* context, ViewFrame* frame, const QString& type) override; virtual void OnAddressChange(UIContext* context, ViewFrame* frame, View* view, const ViewLocation& location) override; + virtual bool GetNameForFile(UIContext* context, FileContext* file, QString& name) override; + virtual bool GetNameForPath(UIContext* context, const QString& path, QString& name) override; static void init(); }; \ No newline at end of file -- cgit v1.3.1