2017-12-08 15:00:52 +00:00
|
|
|
#ifndef VISUALNAVBAR_H
|
|
|
|
#define VISUALNAVBAR_H
|
2017-03-29 10:18:37 +00:00
|
|
|
|
|
|
|
#include <QToolBar>
|
2017-12-08 09:55:47 +00:00
|
|
|
#include <QGraphicsScene>
|
2017-03-29 10:18:37 +00:00
|
|
|
|
2019-02-22 16:50:45 +00:00
|
|
|
#include "core/Cutter.h"
|
2017-12-07 23:41:15 +00:00
|
|
|
|
2022-05-30 11:01:55 +00:00
|
|
|
#include <rz_core.h>
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
2017-03-29 10:18:37 +00:00
|
|
|
class MainWindow;
|
2017-04-13 15:14:02 +00:00
|
|
|
class QGraphicsView;
|
2017-03-29 10:18:37 +00:00
|
|
|
|
2017-12-08 15:00:52 +00:00
|
|
|
class VisualNavbar : public QToolBar
|
2017-03-29 10:18:37 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
2021-01-24 14:50:13 +00:00
|
|
|
struct XToAddress
|
|
|
|
{
|
2017-12-07 23:41:15 +00:00
|
|
|
double x_start;
|
|
|
|
double x_end;
|
|
|
|
RVA address_from;
|
|
|
|
RVA address_to;
|
|
|
|
};
|
|
|
|
|
2017-03-29 10:18:37 +00:00
|
|
|
public:
|
2018-05-04 07:58:32 +00:00
|
|
|
explicit VisualNavbar(MainWindow *main, QWidget *parent = nullptr);
|
2017-03-29 10:18:37 +00:00
|
|
|
|
|
|
|
public slots:
|
2017-12-07 23:41:15 +00:00
|
|
|
void paintEvent(QPaintEvent *event) override;
|
2018-10-10 09:37:24 +00:00
|
|
|
void updateGraphicsScene();
|
2017-11-19 12:56:10 +00:00
|
|
|
|
|
|
|
private slots:
|
2017-12-07 23:41:15 +00:00
|
|
|
void fetchAndPaintData();
|
2018-07-06 16:00:26 +00:00
|
|
|
void fetchStats();
|
2019-01-12 09:02:07 +00:00
|
|
|
void drawSeekCursor();
|
|
|
|
void drawPCCursor();
|
|
|
|
void drawCursor(RVA addr, QColor color, QGraphicsRectItem *&graphicsItem);
|
2017-12-07 23:41:15 +00:00
|
|
|
void on_seekChanged(RVA addr);
|
2017-03-29 10:18:37 +00:00
|
|
|
|
|
|
|
private:
|
2021-01-24 14:50:13 +00:00
|
|
|
QGraphicsView *graphicsView;
|
|
|
|
QGraphicsScene *graphicsScene;
|
2019-01-12 09:02:07 +00:00
|
|
|
QGraphicsRectItem *seekGraphicsItem;
|
|
|
|
QGraphicsRectItem *PCGraphicsItem;
|
2021-01-24 14:50:13 +00:00
|
|
|
MainWindow *main;
|
2017-12-07 23:41:15 +00:00
|
|
|
|
2022-08-13 20:12:57 +00:00
|
|
|
UniquePtrC<RzCoreAnalysisStats, &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;
|
2017-12-09 23:22:16 +00:00
|
|
|
|
2017-12-08 12:21:24 +00:00
|
|
|
RVA localXToAddress(double x);
|
|
|
|
double addressToLocalX(RVA address);
|
2017-12-09 23:22:16 +00:00
|
|
|
QList<QString> sectionsForAddress(RVA address);
|
|
|
|
QString toolTipForAddress(RVA address);
|
|
|
|
|
2017-12-07 23:41:15 +00:00
|
|
|
void mousePressEvent(QMouseEvent *event) override;
|
2017-12-09 23:22:16 +00:00
|
|
|
void mouseMoveEvent(QMouseEvent *event) override;
|
2017-03-29 10:18:37 +00:00
|
|
|
};
|
|
|
|
|
2017-12-08 15:00:52 +00:00
|
|
|
#endif // VISUALNAVBAR_H
|