forked from aseprite/aseprite
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcmd_transaction.h
More file actions
45 lines (34 loc) · 1.14 KB
/
cmd_transaction.h
File metadata and controls
45 lines (34 loc) · 1.14 KB
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
// Aseprite
// Copyright (C) 2001-2015 David Capello
//
// This program is distributed under the terms of
// the End-User License Agreement for Aseprite.
#ifndef APP_CMD_TRANSACTION_H_INCLUDED
#define APP_CMD_TRANSACTION_H_INCLUDED
#pragma once
#include "app/cmd_sequence.h"
namespace app {
// Cmds created on each Transaction.
// The whole DocumentUndo contains a list of these CmdTransaction.
class CmdTransaction : public CmdSequence {
public:
CmdTransaction(const std::string& label,
bool changeSavedState, int* savedCounter);
void commit();
doc::SpritePosition spritePositionBeforeExecute() const { return m_spritePositionBefore; }
doc::SpritePosition spritePositionAfterExecute() const { return m_spritePositionAfter; }
protected:
void onExecute() override;
void onUndo() override;
void onRedo() override;
std::string onLabel() const override;
private:
doc::SpritePosition calcSpritePosition();
doc::SpritePosition m_spritePositionBefore;
doc::SpritePosition m_spritePositionAfter;
std::string m_label;
bool m_changeSavedState;
int* m_savedCounter;
};
} // namespace app
#endif