[olympic/studio] Move UndoCommand to its own file
This commit is contained in:
parent
acd93337d4
commit
cdbc2d6cc8
@ -13,5 +13,6 @@
|
|||||||
#include <studio/popup.hpp>
|
#include <studio/popup.hpp>
|
||||||
#include <studio/project.hpp>
|
#include <studio/project.hpp>
|
||||||
#include <studio/task.hpp>
|
#include <studio/task.hpp>
|
||||||
|
#include <studio/undocommand.hpp>
|
||||||
#include <studio/undostack.hpp>
|
#include <studio/undostack.hpp>
|
||||||
#include <studio/widget.hpp>
|
#include <studio/widget.hpp>
|
||||||
|
19
src/olympic/studio/modlib/include/studio/undocommand.hpp
Normal file
19
src/olympic/studio/modlib/include/studio/undocommand.hpp
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2016 - 2024 Gary Talent (gary@drinkingtea.net). All rights reserved.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
namespace studio {
|
||||||
|
|
||||||
|
class UndoCommand {
|
||||||
|
public:
|
||||||
|
virtual ~UndoCommand() noexcept = default;
|
||||||
|
virtual void redo() noexcept = 0;
|
||||||
|
virtual void undo() noexcept = 0;
|
||||||
|
[[nodiscard]]
|
||||||
|
virtual int commandId() const noexcept = 0;
|
||||||
|
virtual bool mergeWith(UndoCommand const*cmd) noexcept;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
@ -9,17 +9,9 @@
|
|||||||
#include <ox/std/memory.hpp>
|
#include <ox/std/memory.hpp>
|
||||||
#include <ox/std/vector.hpp>
|
#include <ox/std/vector.hpp>
|
||||||
|
|
||||||
namespace studio {
|
#include "undocommand.hpp"
|
||||||
|
|
||||||
class UndoCommand {
|
namespace studio {
|
||||||
public:
|
|
||||||
virtual ~UndoCommand() noexcept = default;
|
|
||||||
virtual void redo() noexcept = 0;
|
|
||||||
virtual void undo() noexcept = 0;
|
|
||||||
[[nodiscard]]
|
|
||||||
virtual int commandId() const noexcept = 0;
|
|
||||||
virtual bool mergeWith(UndoCommand const*cmd) noexcept;
|
|
||||||
};
|
|
||||||
|
|
||||||
class UndoStack {
|
class UndoStack {
|
||||||
private:
|
private:
|
||||||
|
Loading…
Reference in New Issue
Block a user