context menus, document refactoring, fixes

This commit is contained in:
2025-10-26 00:10:44 -04:00
parent 87c2db2a77
commit fe9366f9ef
62 changed files with 2138 additions and 793 deletions

42
src/snapshots.h Normal file
View File

@@ -0,0 +1,42 @@
#pragma once
#include "anm2.h"
namespace anm2ed::snapshots
{
constexpr auto ACTION = "Action";
constexpr auto MAX = 100;
class Snapshot
{
public:
anm2::Anm2 anm2{};
anm2::Reference reference{};
std::string message = ACTION;
};
class SnapshotStack
{
public:
Snapshot snapshots[MAX];
int top{};
bool is_empty();
void push(Snapshot& snapshot);
Snapshot* pop();
void clear();
};
class Snapshots
{
public:
SnapshotStack undoStack{};
SnapshotStack redoStack{};
Snapshot* get();
void push(const anm2::Anm2&, anm2::Reference, const std::string&);
void undo(anm2::Anm2& anm2, anm2::Reference& reference, std::string&);
void redo(anm2::Anm2& anm2, anm2::Reference& reference, std::string&);
void reset();
};
}