forked from aseprite/aseprite
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocument_observer.h
More file actions
73 lines (53 loc) · 2.49 KB
/
document_observer.h
File metadata and controls
73 lines (53 loc) · 2.49 KB
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
// Aseprite Document Library
// Copyright (c) 2001-2015 David Capello
//
// This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information.
#ifndef DOC_DOCUMENT_OBSERVER_H_INCLUDED
#define DOC_DOCUMENT_OBSERVER_H_INCLUDED
#pragma once
namespace doc {
class Document;
class DocumentEvent;
class DocumentObserver {
public:
virtual ~DocumentObserver() { }
virtual void onFileNameChanged(Document* doc) { }
// General update. If an observer receives this event, it's because
// anything in the document could be changed.
virtual void onGeneralUpdate(DocumentEvent& ev) { }
virtual void onPixelFormatChanged(DocumentEvent& ev) { }
virtual void onAddLayer(DocumentEvent& ev) { }
virtual void onAddFrame(DocumentEvent& ev) { }
virtual void onAddCel(DocumentEvent& ev) { }
virtual void onBeforeRemoveLayer(DocumentEvent& ev) { }
virtual void onAfterRemoveLayer(DocumentEvent& 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(DocumentEvent& ev) { }
virtual void onRemoveCel(DocumentEvent& ev) { }
virtual void onSpriteSizeChanged(DocumentEvent& ev) { }
virtual void onSpriteTransparentColorChanged(DocumentEvent& ev) { }
virtual void onLayerNameChange(DocumentEvent& ev) { }
virtual void onLayerOpacityChange(DocumentEvent& ev) { }
virtual void onLayerBlendModeChange(DocumentEvent& ev) { }
virtual void onLayerRestacked(DocumentEvent& ev) { }
virtual void onLayerMergedDown(DocumentEvent& ev) { }
virtual void onCelMoved(DocumentEvent& ev) { }
virtual void onCelCopied(DocumentEvent& ev) { }
virtual void onCelFrameChanged(DocumentEvent& ev) { }
virtual void onCelPositionChanged(DocumentEvent& ev) { }
virtual void onCelOpacityChange(DocumentEvent& ev) { }
virtual void onFrameDurationChanged(DocumentEvent& ev) { }
virtual void onImagePixelsModified(DocumentEvent& ev) { }
virtual void onSpritePixelsModified(DocumentEvent& ev) { }
virtual void onExposeSpritePixels(DocumentEvent& ev) { }
// When the number of total frames available is modified.
virtual void onTotalFramesChanged(DocumentEvent& ev) { }
// The selection has changed.
virtual void onSelectionChanged(DocumentEvent& ev) { }
// Called to destroy the observable. (Here you could call "delete this".)
virtual void dispose() { }
};
} // namespace doc
#endif