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_SET_LAYER_OPACITY_H_INCLUDED
8#define APP_CMD_SET_LAYER_OPACITY_H_INCLUDED
9#pragma once
10
11#include "app/cmd.h"
12#include "app/cmd/with_layer.h"
13
14namespace doc {
15 class LayerImage;
16}
17
18namespace app {
19namespace cmd {
20 using namespace doc;
21
22 class SetLayerOpacity : public Cmd
23 , public WithLayer {
24 public:
25 SetLayerOpacity(LayerImage* layer, int opacity);
26
27 protected:
28 void onExecute() override;
29 void onUndo() override;
30 void onFireNotifications() override;
31 size_t onMemSize() const override {
32 return sizeof(*this);
33 }
34
35 private:
36 int m_oldOpacity;
37 int m_newOpacity;
38 };
39
40} // namespace cmd
41} // namespace app
42
43#endif
44