-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMemWindow.h
66 lines (55 loc) · 1.57 KB
/
MemWindow.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
#ifndef MEMWINDOW_H
#define MEMWINDOW_H
#include <QWidget>
#include "MemTable.h"
#include "modeler.h"
#include "QPushButton"
#include "QLineEdit"
#include "QLabel"
#include "BetterScrollbar.h"
#include "computer.h"
#include "FollowButton.h"
#include <map>
#define CLEARONGOTO (true)
#define CLEAR(INPUT) if(CLEARONGOTO)INPUT->clear();
class MemWindow : public QWidget
{
Q_OBJECT
bool flipped;
std::map<QString, uint16_t> labelDict;
MemTable* View;
HighlightScrollBar* Scroll;
QLabel* Label;
QLineEdit* Input;
QPushButton* GotoButton;
FollowButton* SpecialButton;
reg_t SpecialReg=PC;
/*
* SR-Follow Feature
*
* There is a special action that the user can evoke from the program.
*
* By double clicking the PCButton, the table goes into a 'follow mode'
* where the view will track the line of code pointed to by the PC reg,
* allowing for easy view of how the program is going and sparing them
* the tedium of having to hit the aforementioned button whenever the
* program counter moves too far.
*
*/
bool followmode=false;
int getScrollOffset(val_t row, bool *ok);
void setupInput();
public:
explicit MemWindow(modeler* model, HighlightScrollBar *scroll, QWidget *parent = nullptr,QString* buttonName = new QString("PC"));
MemTable* getMemView();
void setFlipped(bool upIsDown);
signals:
public slots:
void kick();
void handleTracking();
void setSpecialReg(reg_t reg);
private slots:
void handleSRPress();
void handleGotoPress();
};
#endif // MEMWINDOW_H