-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMemTable.h
99 lines (94 loc) · 3.1 KB
/
MemTable.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#ifndef MEMTABLE_H
#define MEMTABLE_H
#include <QWidget>
#include "QTableView"
#include "QAction"
#include "modeler.h"
#include "QPoint"
#define MINIMUMINSERTCOMBO (16)
class MemTable : public QTableView
{
Q_OBJECT
void setupConnections();
bool flipped = false;
modeler * model;
mem_loc_t * copied;
QModelIndex savedCurrentFocusIndex = QModelIndex();
void selectedClickOptions(const QPoint &pos, QMenu *clickMenu);
void saveSettings();
/** put a row into the spot where target is, shifting the below
* @brief insertRow
* @param target
*/
void insertRow(mem_addr_t target);
/** setupWarnings
* \todo DO
*/
void setupWarnings();
public:
MemTable(modeler *model, QWidget *parent = 0);
void setupActions();
void selectRange(mem_addr_t begin, int32_t end);
/** Usually, when one hides or shows an object, the internal focus of that object shifts.
* This results in seemingly random behavior, which is not what the user will expect.
*
* This function hides the MemTable, first recording the index which is in focus.
*/
void hide();
/** Usually, when one hides or shows an object, the internal focus of that object shifts.
* This results in seemingly random behavior, which is not what the user will expect.
*
* This function shows the MemTable, but, after doing so, resets the focused index
*/
void show();
void setFlipped(bool upIsDown);
void setButtonText(QString st);
void requestKick();
public slots:
void showClickOptions(const QPoint &pos);
void scrollToRow(val_t row);
void handleInsertRow();
void handleCopy();
void handlePasteOver();
void scrollToSelected();
void handleCut();
void kick();
/**
* @brief goForward
*
* This is similar to the re/undo function, but instead of reverting the code to a future
* state, it instead brings the view of the code to a future state.
*/
void goForward();
void goBackward();
void changeDataDisplay(mem_addr_t row);
private slots:
void setCut();
void setCopied();
void swap();
/** Takes the selected indexes and shifts them up by one.
* \param makeAgreement decides if the code is modified to keep pointers
* intact.
*/
void shiftUp(bool makeAgreement = true);
/** Takes the selected indexes and shifts them up by one.
* \param makeAgreement decides if the code is modified to keep pointers
* intact.
*/
void shiftDown(bool makeAgreement = true);
void fastShiftDown(bool makeAgreement = true );
/** For when possible connections in data are to be disregarded when moved,
* this function calls for the data to be shifted down 'as is.'
*/
void shiftDownBrute();
/** For when possible connections in data are to be disregarded when moved,
* this function calls for the data to be shifted up 'as is.'
*/
void shiftUpBrute();
void paste(bool makeAgreement = true);
void pasteBrute();
void insertAbove();
void insertBelow();
void fastShiftUp(bool makeAgreement = true);
};
#endif // MEMTABLE_H