mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-22 12:56:11 +00:00
ab27e09b91
Sometimes it is not necessary to include the whole Cutter.h file Hence, it's been splitted so you can include only what you require E.g. #include "core/CutterCommon.h" to have access to the common types
61 lines
1.4 KiB
C++
61 lines
1.4 KiB
C++
#ifndef VISUALNAVBAR_H
|
|
#define VISUALNAVBAR_H
|
|
|
|
#include <QToolBar>
|
|
#include <QGraphicsScene>
|
|
|
|
#include "core/Cutter.h"
|
|
|
|
class MainWindow;
|
|
class QGraphicsView;
|
|
|
|
class VisualNavbar : public QToolBar
|
|
{
|
|
Q_OBJECT
|
|
|
|
struct XToAddress {
|
|
double x_start;
|
|
double x_end;
|
|
RVA address_from;
|
|
RVA address_to;
|
|
};
|
|
|
|
public:
|
|
explicit VisualNavbar(MainWindow *main, QWidget *parent = nullptr);
|
|
|
|
public slots:
|
|
void paintEvent(QPaintEvent *event) override;
|
|
void updateGraphicsScene();
|
|
|
|
private slots:
|
|
void fetchAndPaintData();
|
|
void fetchStats();
|
|
void drawSeekCursor();
|
|
void drawPCCursor();
|
|
void drawCursor(RVA addr, QColor color, QGraphicsRectItem *&graphicsItem);
|
|
void on_seekChanged(RVA addr);
|
|
|
|
private:
|
|
QGraphicsView *graphicsView;
|
|
QGraphicsScene *graphicsScene;
|
|
QGraphicsRectItem *seekGraphicsItem;
|
|
QGraphicsRectItem *PCGraphicsItem;
|
|
MainWindow *main;
|
|
|
|
BlockStatistics stats;
|
|
unsigned int statsWidth = 0;
|
|
unsigned int previousWidth = 0;
|
|
|
|
QList<XToAddress> xToAddress;
|
|
|
|
RVA localXToAddress(double x);
|
|
double addressToLocalX(RVA address);
|
|
QList<QString> sectionsForAddress(RVA address);
|
|
QString toolTipForAddress(RVA address);
|
|
|
|
void mousePressEvent(QMouseEvent *event) override;
|
|
void mouseMoveEvent(QMouseEvent *event) override;
|
|
};
|
|
|
|
#endif // VISUALNAVBAR_H
|