1 // Aseprite 2 // Copyright (C) 2001-2015 David Capello 3 // 4 // This program is distributed under the terms of 5 // the End-User License Agreement for Aseprite. 6 7 #ifndef APP_CMD_SEQUENCE_H_INCLUDED 8 #define APP_CMD_SEQUENCE_H_INCLUDED 9 #pragma once 10 11 #include "app/cmd.h" 12 13 #include <vector> 14 15 namespace app { 16 17 class CmdSequence : public Cmd { 18 public: 19 CmdSequence(); 20 ~CmdSequence(); 21 22 void add(Cmd* cmd); 23 24 protected: 25 void onExecute() override; 26 void onUndo() override; 27 void onRedo() override; 28 size_t onMemSize() const override; 29 30 // Helper to create a CmdSequence in the same onExecute() member 31 // function. 32 void executeAndAdd(Cmd* cmd); 33 34 private: 35 std::vector<Cmd*> m_cmds; 36 }; 37 38 } // namespace app 39 40 #endif 41