-
Notifications
You must be signed in to change notification settings - Fork 0
/
log.h
41 lines (37 loc) · 815 Bytes
/
log.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
#ifndef LOG_H
#define LOG_H
#include <stdlib.h>
#include <QImage>
#include <vector>
struct Commit {
QImage before;
QString info;
Commit(QImage image, QString str)
: before(image)
, info(str){}
};
class Log
{
public:
Log();
~Log();
QImage redo();
QImage undo(QImage *curImg);
QString getRedoMsg();
QString getUndoMsg();
void commit(QImage image, QString str);
bool redoEnabled();
bool undoEnabled();
void clear();
private:
std::vector<Commit *> commits;
int curPos; //目前所处的位置
QImage imgFinalState;
void freeCommits(int i);
void addCommit(Commit *commit);
QImage getImgBeforeOperation();
QImage getImgAfterOperation();
QString getLastOperation();
QString getNextOperation();
};
#endif // LOG_H