mirror of
https://github.com/rizinorg/cutter.git
synced 2025-01-22 12:28:51 +00:00
3545f059f1
* Use QDockWidget::toggleViewAction instead of custom solution. * Improve new dock placement.
50 lines
1.1 KiB
C++
50 lines
1.1 KiB
C++
#ifndef MEMORYDOCKWIDGET_H
|
|
#define MEMORYDOCKWIDGET_H
|
|
|
|
#include "CutterDockWidget.h"
|
|
#include "core/Cutter.h"
|
|
|
|
#include <QAction>
|
|
|
|
class CutterSeekable;
|
|
|
|
/* Disassembly/Graph/Hexdump/Decompiler view priority */
|
|
enum class MemoryWidgetType { Disassembly, Graph, Hexdump, Decompiler };
|
|
|
|
class MemoryDockWidget : public CutterDockWidget
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
MemoryDockWidget(MemoryWidgetType type, MainWindow *parent);
|
|
~MemoryDockWidget() override {}
|
|
|
|
CutterSeekable *getSeekable() const;
|
|
|
|
bool tryRaiseMemoryWidget();
|
|
void raiseMemoryWidget();
|
|
MemoryWidgetType getType() const
|
|
{
|
|
return mType;
|
|
}
|
|
bool eventFilter(QObject *object, QEvent *event) override;
|
|
|
|
QVariantMap serializeViewProprties() override;
|
|
void deserializeViewProperties(const QVariantMap &properties) override;
|
|
private:
|
|
|
|
MemoryWidgetType mType;
|
|
|
|
public slots:
|
|
void updateWindowTitle();
|
|
|
|
protected:
|
|
CutterSeekable *seekable = nullptr;
|
|
QAction syncAction;
|
|
QMenu *dockMenu = nullptr;
|
|
|
|
virtual QString getWindowTitle() const = 0;
|
|
void contextMenuEvent(QContextMenuEvent *event) override;
|
|
};
|
|
|
|
#endif // MEMORYDOCKWIDGET_H
|