summaryrefslogtreecommitdiff
path: root/ui/reflectionview.h
blob: 1be8cc50325457b3fab67f76ddcce6892abd776a (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
#pragma once

#include <QtGui/QMouseEvent>
#include <QtGui/QPaintEvent>
#include <QtWidgets/QWidget>

#include "binaryninjaapi.h"
#include "dockhandler.h"
#include "uitypes.h"

class ContextMenuManager;
class DisassemblyContainer;
class FlowGraphWidget;
class Menu;
class ViewFrame;

class BINARYNINJAUIAPI ReflectionView: public QWidget, public DockContextHandler
{
	Q_OBJECT
	Q_INTERFACES(DockContextHandler)

	ViewFrame* m_frame;
	BinaryViewRef m_data;
	DisassemblyContainer* m_disassemblyContainer;
	std::map<BNFunctionGraphType, BNFunctionGraphType> m_ilMap;
	bool m_ilSync;
	bool m_locationSync;

	BNFunctionGraphType m_lastSrcILViewType = NormalFunctionGraph;
	BNFunctionGraphType m_lastTgtILViewType = NormalFunctionGraph;
	bool m_ilSyncOverride = false;

public:
	ReflectionView(ViewFrame* frame, BinaryViewRef data);
	~ReflectionView();

	FlowGraphWidget* getFlowGraphWidget();

	void toggleILSync();
	void toggleLocationSync();

	virtual void notifyFontChanged() override;
	virtual void notifyViewLocationChanged(View* view, const ViewLocation& viewLocation) override;
	virtual void notifyVisibilityChanged(bool visible) override;
	virtual bool shouldBeVisible(ViewFrame* frame) override;

protected:
	virtual void contextMenuEvent(QContextMenuEvent* event) override;
};