forked from aseprite/aseprite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdoc_observer.h
88 lines (67 loc) · 2.93 KB
/
doc_observer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
// Aseprite
// Copyright (C) 2018-2021 Igara Studio S.A.
// Copyright (C) 2001-2018 David Capello
//
// This program is distributed under the terms of
// the End-User License Agreement for Aseprite.
#ifndef APP_DOC_OBSERVER_H_INCLUDED
#define APP_DOC_OBSERVER_H_INCLUDED
#pragma once
namespace app {
class Doc;
class DocEvent;
class DocObserver {
public:
virtual ~DocObserver() { }
virtual void onCloseDocument(Doc* doc) { }
virtual void onFileNameChanged(Doc* doc) { }
// General update. If an observer receives this event, it's because
// anything in the document could be changed.
virtual void onGeneralUpdate(DocEvent& ev) { }
virtual void onColorSpaceChanged(DocEvent& ev) { }
virtual void onPixelFormatChanged(DocEvent& ev) { }
virtual void onPaletteChanged(DocEvent& ev) { }
virtual void onAddLayer(DocEvent& ev) { }
virtual void onAddFrame(DocEvent& ev) { }
virtual void onAddCel(DocEvent& ev) { }
virtual void onAddSlice(DocEvent& ev) { }
virtual void onAddTag(DocEvent& ev) { }
virtual void onBeforeRemoveLayer(DocEvent& ev) { }
virtual void onAfterRemoveLayer(DocEvent& ev) { }
// Called when a frame is removed. It's called after the frame was
// removed, and the sprite's total number of frames is modified.
virtual void onRemoveFrame(DocEvent& ev) { }
virtual void onRemoveTag(DocEvent& ev) { }
virtual void onBeforeRemoveCel(DocEvent& ev) { }
virtual void onAfterRemoveCel(DocEvent& ev) { }
virtual void onRemoveSlice(DocEvent& ev) { }
virtual void onSpriteSizeChanged(DocEvent& ev) { }
virtual void onSpriteTransparentColorChanged(DocEvent& ev) { }
virtual void onSpritePixelRatioChanged(DocEvent& ev) { }
virtual void onSpriteGridBoundsChanged(DocEvent& ev) { }
virtual void onLayerNameChange(DocEvent& ev) { }
virtual void onLayerOpacityChange(DocEvent& ev) { }
virtual void onLayerBlendModeChange(DocEvent& ev) { }
virtual void onLayerRestacked(DocEvent& ev) { }
virtual void onLayerMergedDown(DocEvent& ev) { }
virtual void onCelMoved(DocEvent& ev) { }
virtual void onCelCopied(DocEvent& ev) { }
virtual void onCelFrameChanged(DocEvent& ev) { }
virtual void onCelPositionChanged(DocEvent& ev) { }
virtual void onCelOpacityChange(DocEvent& ev) { }
virtual void onFrameDurationChanged(DocEvent& ev) { }
virtual void onImagePixelsModified(DocEvent& ev) { }
virtual void onSpritePixelsModified(DocEvent& ev) { }
virtual void onExposeSpritePixels(DocEvent& ev) { }
// When the number of total frames available is modified.
virtual void onTotalFramesChanged(DocEvent& ev) { }
// The selection has changed.
virtual void onSelectionChanged(DocEvent& ev) { }
virtual void onSelectionBoundariesChanged(DocEvent& ev) { }
// Tags
virtual void onTagChange(DocEvent& ev) { }
// Slices
virtual void onSliceNameChange(DocEvent& ev) { }
};
} // namespace app
#endif