X-Git-Url: https://git.siccegge.de//index.cgi?p=frida%2Ffrida.git;a=blobdiff_plain;f=src%2Fgui%2Fwidgets%2FBasicBlockWidget.hxx;h=7c402c0a663bb4f89d8b0216ce6280aee5e752a6;hp=5d23d9b65f69995e7009398f769ad758be2044d2;hb=98e46099f6366309366ea54fc4b97fd5cb383fa7;hpb=083a8802e608a69d622ff5cda5d21ff61e289a85 diff --git a/src/gui/widgets/BasicBlockWidget.hxx b/src/gui/widgets/BasicBlockWidget.hxx index 5d23d9b..7c402c0 100644 --- a/src/gui/widgets/BasicBlockWidget.hxx +++ b/src/gui/widgets/BasicBlockWidget.hxx @@ -1,23 +1,29 @@ #ifndef INCLUDE__BasicBlockWidget_hxx #define INCLUDE__BasicBlockWidget_hxx -#include "gui/qt.hxx" -#include "disassembler/BasicBlock.hxx" +#include "qt.hxx" #include #include #include #include #include +#include + +#include "disassembler/Instruction.hxx" class Mainwindow; +class CustomQGraphicsTextItem; +class BasicBlock; +class RenameFunctionEvent; +class ChangeCommentEvent; class BasicBlockWidget : public QObject, public QGraphicsItem { Q_OBJECT + friend class CustomQGraphicsTextItem; public: BasicBlockWidget(const QString& name, BasicBlock * block, Mainwindow * mainwindow); - void addItem(uint8_t* bytes, size_t num_bytes, QString line, const QString& href); void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); QRectF boundingRect() const; @@ -40,15 +46,32 @@ public: QString getName() const { return name; } + + QColor setColor(const QColor& newColor) { + QColor lastcolor = currentColor; + currentColor = newColor; + return lastcolor; + } + + const QColor defaultColor = QColor(0xcc, 0xcc, 0xff, 0xff); + const QColor highlightColor = QColor(0xff, 0x99, 0xff, 0xff); private: + void updateFunctionName(RenameFunctionEvent* event); + void populateWidget(); + void changeCommentHandler(ChangeCommentEvent* event); + QString formatComments(Instruction* inst); + uint32_t width, height; QString name; + QColor currentColor; std::unique_ptr _widget; QTextTable* _table; BasicBlock* block; + std::vector instructions; Mainwindow* mainwindow; std::vector previous; BasicBlockWidget* next[2]; + log4cxx::LoggerPtr logger; }; #endif