cutter/src/widgets/VisualNavbar.h

67 lines
1.5 KiB
C
Raw Normal View History

#ifndef VISUALNAVBAR_H
#define VISUALNAVBAR_H
#include <QToolBar>
#include <QGraphicsScene>
#include "core/Cutter.h"
#include <rz_core.h>
#include <memory>
class MainWindow;
class QGraphicsView;
class VisualNavbar : public QToolBar
{
Q_OBJECT
2021-01-24 14:50:13 +00:00
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();
2018-07-06 16:00:26 +00:00
void fetchStats();
void drawSeekCursor();
void drawPCCursor();
void drawCursor(RVA addr, QColor color, QGraphicsRectItem *&graphicsItem);
void on_seekChanged(RVA addr);
private:
2021-01-24 14:50:13 +00:00
QGraphicsView *graphicsView;
QGraphicsScene *graphicsScene;
QGraphicsRectItem *seekGraphicsItem;
QGraphicsRectItem *PCGraphicsItem;
2021-01-24 14:50:13 +00:00
MainWindow *main;
std::unique_ptr<RzCoreAnalysisStats, decltype(&rz_core_analysis_stats_free)> stats;
2021-01-24 14:50:13 +00:00
unsigned int statsWidth = 0;
unsigned int previousWidth = 0;
2018-06-29 12:35:02 +00:00
QList<XToAddress> xToAddress;
2021-11-15 14:36:55 +00:00
bool blockTooltip;
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