blob: 7dcb05a5ba6a91670e37d1f2aeaf045106bce575 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
#pragma once
#include <QAction>
#include <QToolBar>
#include <QPushButton>
#include <QIcon>
#include <QLabel>
#include <QPropertyAnimation>
#include "binaryninjaapi.h"
#include "sidebarwidget.h"
#include "uicontext.h"
class BINARYNINJAUIAPI WorkflowMonitorWidget : public SidebarWidget
{
Q_OBJECT
Q_PROPERTY(qreal dotBrightness READ dotBrightness WRITE setDotBrightness)
BinaryViewRef m_data;
FunctionRef m_function;
WorkflowRef m_workflow;
Menu* m_menu;
ContextMenuManager* m_contextMenuManager;
UIActionHandler m_actionHandler;
QToolBar* m_toolbar;
QAction* m_startAction;
QAction* m_haltAction;
QAction* m_stepAction;
QAction* m_resetAction;
QAction* m_toggleSuspendAction;
QAction* m_toggleLogAction;
QAction* m_topologyAction;
QPushButton* m_contextButton;
QLabel* m_contextLabel;
std::map<std::string, QIcon> m_iconCache;
std::map<std::string, QColor> m_colorCache;
std::string m_lastState;
QColor m_lastStatusColor;
QColor m_labelColor;
QLabel* m_currentActivity;
QLabel* m_statusIndicator;
QPropertyAnimation* m_dotAnimation;
qreal m_dotBrightness;
bool m_animationRunning;
virtual void contextMenuEvent(QContextMenuEvent*) override;
void updateToolbarActions(bool force = false);
void updateToolbarIcons();
void setupToolbar();
void setupActions();
void updateStatusIndicator();
qreal dotBrightness() const;
void setDotBrightness(qreal brightness);
public:
WorkflowMonitorWidget(BinaryViewRef data);
~WorkflowMonitorWidget();
void notifyRefresh() override;
void notifyFontChanged() override;
void notifyThemeChanged() override;
void notifyViewLocationChanged(View* view, const ViewLocation& viewLocation) override;
void startDotAnimation();
void stopDotAnimation();
};
class BINARYNINJAUIAPI WorkflowMonitorWidgetType : public SidebarWidgetType
{
public:
WorkflowMonitorWidgetType();
SidebarWidget* createWidget(ViewFrame* frame, BinaryViewRef data) override;
SidebarWidgetLocation defaultLocation() const override { return SidebarWidgetLocation::LeftReference; }
SidebarContextSensitivity contextSensitivity() const override { return PerViewTypeSidebarContext; }
};
|