1 | // Aseprite |
2 | // Copyright (C) 2001-2016 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_ADD_PALETTE_H_INCLUDED |
8 | #define APP_CMD_ADD_PALETTE_H_INCLUDED |
9 | #pragma once |
10 | |
11 | #include "app/cmd.h" |
12 | #include "app/cmd/with_sprite.h" |
13 | #include "doc/frame.h" |
14 | |
15 | #include <sstream> |
16 | |
17 | namespace doc { |
18 | class Palette; |
19 | class Sprite; |
20 | } |
21 | |
22 | namespace app { |
23 | namespace cmd { |
24 | using namespace doc; |
25 | |
26 | class AddPalette : public Cmd |
27 | , public WithSprite { |
28 | public: |
29 | AddPalette(Sprite* sprite, Palette* pal); |
30 | |
31 | protected: |
32 | void onExecute() override; |
33 | void onUndo() override; |
34 | size_t onMemSize() const override { |
35 | return sizeof(*this) + m_size; |
36 | } |
37 | |
38 | private: |
39 | size_t m_size; |
40 | std::stringstream m_stream; |
41 | frame_t m_frame; |
42 | }; |
43 | |
44 | } // namespace cmd |
45 | } // namespace app |
46 | |
47 | #endif // CMD_ADD_PALETTE_H_INCLUDED |
48 | |