1// Aseprite
2// Copyright (C) 2001-2018 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_REMOVE_FRAME_H_INCLUDED
8#define APP_CMD_REMOVE_FRAME_H_INCLUDED
9#pragma once
10
11#include "app/cmd.h"
12#include "app/cmd/with_sprite.h"
13#include "app/cmd_sequence.h"
14#include "doc/frame.h"
15
16namespace app {
17namespace cmd {
18 using namespace doc;
19
20 class RemoveFrame : public Cmd
21 , public WithSprite {
22 public:
23 RemoveFrame(Sprite* sprite, frame_t frame);
24
25 protected:
26 void onExecute() override;
27 void onUndo() override;
28 size_t onMemSize() const override {
29 return sizeof(*this) + m_seq.memSize();
30 }
31
32 private:
33 frame_t m_frame;
34 int m_frameDuration;
35 CmdSequence m_seq;
36 bool m_firstTime;
37 bool m_frameRemoved;
38 };
39
40} // namespace cmd
41} // namespace app
42
43#endif
44