]> git.siccegge.de Git - frida/frida.git/blob - src/gui/widgets/CFGScene.hxx
7cdc6d8fde2908f2911e7fd7b9bc97d81fa9ed94
[frida/frida.git] / src / gui / widgets / CFGScene.hxx
1 #ifndef INCLUDE__CFGScene_hxx
2 #define INCLUDE__CFGScene_hxx
3
4 #include "qt.hxx"
5 #include "BasicBlockWidget.hxx"
6
7 #include <vector>
8
9 class CFGScene : public QGraphicsScene {
10 public:
11 CFGScene(QWidget * parent = 0)
12 : QGraphicsScene(parent), highlightedBlock(NULL) {}
13
14 // Take special care when adding a BasicBlock to the scene as we
15 // need to draw arrows for it later on
16 void addItem(BasicBlockWidget* block) {
17 widgets.push_back(block);
18 QGraphicsScene::addItem(block);
19 }
20
21 virtual void drawBackground(QPainter* painter, const QRectF & rect);
22 void highlightBlock(BasicBlockWidget* block);
23 private:
24 std::vector<BasicBlockWidget*> widgets;
25
26 void drawLine(QPainter* painter, BasicBlockWidget * from, BasicBlockWidget * to,
27 int8_t side = 0);
28
29 void spaceWidgets();
30
31 BasicBlockWidget* highlightedBlock;
32 };
33
34 #endif