Add EditorContext, refactor utils, add system managers

This commit is contained in:
scawful
2024-11-19 23:10:23 -05:00
parent 0b9f7ee6fa
commit 21314702e8
27 changed files with 191 additions and 154 deletions

View File

@@ -0,0 +1,32 @@
#ifndef YAZE_APP_EDITOR_SYSTEM_HISTORY_MANAGER_H
#define YAZE_APP_EDITOR_SYSTEM_HISTORY_MANAGER_H
#include <cstddef>
#include <stack>
#include <vector>
namespace yaze {
namespace app {
namespace editor {
// System history manager, undo and redo.
class HistoryManager {
public:
HistoryManager() = default;
~HistoryManager() = default;
void Add(const char* data);
void Undo();
void Redo();
private:
std::vector<const char*> history_;
std::stack<const char*> undo_;
std::stack<const char*> redo_;
};
} // namespace editor
} // namespace app
} // namespace yaze
#endif // YAZE_APP_EDITOR_SYSTEM_HISTORY_MANAGER_H