1 #ifndef INCLUDE__BasicBlockWidget_hxx
2 #define INCLUDE__BasicBlockWidget_hxx
5 #include "disassembler/BasicBlock.hxx"
14 class BasicBlockWidget : public QObject, public QGraphicsItem
18 BasicBlockWidget(const QString& name, BasicBlock * block, Mainwindow * mainwindow);
20 void addItem(uint8_t* bytes, size_t num_bytes, QString line, const QString& href);
21 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
23 QRectF boundingRect() const;
24 std::array<QPointF, 3> getExits() const;
26 void mouseMoveEvent(QGraphicsSceneMouseEvent * event)
27 { QGraphicsItem::mouseMoveEvent(event); scene()->update(); }
29 QPointF getEntry() const
30 { return mapToScene(QPointF(width/2, 0)); }
32 void addPrevious(BasicBlockWidget * widget)
33 { previous.push_back(widget); }
35 void addNext(BasicBlockWidget * left, BasicBlockWidget * right)
36 { next[0] = left; next[1] = right; }
38 BasicBlockWidget ** getNext()
41 QString getName() const
44 uint32_t width, height;
46 std::unique_ptr<QGraphicsTextItem> _widget;
49 Mainwindow* mainwindow;
50 std::vector<BasicBlockWidget*> previous;
51 BasicBlockWidget* next[2];