24#include "pencilerror.h"
27#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
28Q_MOC_INCLUDE(
"colormanager.h")
29Q_MOC_INCLUDE("toolmanager.h")
30Q_MOC_INCLUDE("layermanager.h")
31Q_MOC_INCLUDE("playbackmanager.h")
32Q_MOC_INCLUDE("viewmanager.h")
33Q_MOC_INCLUDE("preferencemanager.h")
34Q_MOC_INCLUDE("selectionmanager.h")
35Q_MOC_INCLUDE("soundmanager.h")
36Q_MOC_INCLUDE("overlaymanager.h")
37Q_MOC_INCLUDE("clipboardmanager.h")
38Q_MOC_INCLUDE("undoredomanager.h")
107 Object* object()
const {
return mObject.get(); }
108 Status openObject(
const QString& strFilePath,
const std::function<
void(
int)>& progressChanged,
const std::function<
void(
int)>& progressRangeChanged);
113 void setScribbleArea(
ScribbleArea* pScirbbleArea) { mScribbleArea = pScirbbleArea; }
114 ScribbleArea* getScribbleArea() {
return mScribbleArea; }
116 int currentFrame()
const;
118 void setFps(
int fps);
120 int currentLayerIndex()
const {
return mCurrentLayerIndex; }
121 void setCurrentLayerIndex(
int i);
123 void scrubTo(
int frameNumber);
129 LayerVisibility layerVisibility();
131 qreal viewScaleInversed();
132 void deselectAll()
const;
133 void selectAll()
const;
135 void clipboardChanged();
147 void selectedFramesChanged();
149 void updateTimeLine()
const;
150 void updateTimeLineCached();
151 void updateLayerCount();
155 void fpsChanged(
int fps);
159 void needDisplayInfoNoTitle(
const QString& body);
161 void canCopyChanged(
bool enabled);
162 void canPasteChanged(
bool enabled);
171 void setModified(
int layerNumber,
int frameNumber);
173 void clearCurrentFrame();
176 Status importAnimatedImage(
const QString& filePath,
int frameSpacing,
const std::function<
void (
int)>& progressChanged,
const std::function<
bool ()>& wasCanceled);
178 void scrubNextKeyFrame();
179 void scrubPreviousKeyFrame();
181 void scrubBackward();
202 void switchVisibilityOfLayer(
int layerNumber);
203 void swapLayers(
int i,
int j);
204 bool canSwapLayers(
int layerIndexLeft,
int layerIndexRight)
const;
206 void backup(
const QString& undoText);
207 bool backup(
int layerNumber,
int frameNumber,
const QString& undoText);
209 void onCurrentLayerWillChange(
int index);
213 void pasteFromPreviousFrame();
216 bool canCopy()
const;
217 bool canPaste()
const;
219 void increaseLayerVisibilityIndex();
220 void decreaseLayerVisibilityIndex();
221 void flipSelection(
bool flipVertical);
222 void repositionImage(
QPoint transform,
int frame);
224 void clearTemporary();
227 void settingUpdated(SETTING);
229 void dontAskAutoSave(
bool b) { mAutosaveNeverAskAgain = b; }
230 bool autoSaveNeverAskAgain()
const {
return mAutosaveNeverAskAgain; }
231 void resetAutoSaveCounter();
237 void pasteToCanvas(
BitmapImage* bitmapImage,
int frameNumber);
238 void pasteToCanvas(
VectorImage* vectorImage,
int frameNumber);
239 void pasteToFrames();
241 bool canCopyBitmapImage(
BitmapImage* bitmapImage)
const;
242 bool canCopyFrames(
const Layer* layer)
const;
243 bool canCopyVectorImage(
const VectorImage* vectorImage)
const;
246 std::unique_ptr<Object> mObject;
249 int mCurrentLayerIndex = 0;
265 std::vector< BaseManager* > mAllManagers;
267 bool mIsAutosave =
true;
268 int mAutosaveNumber = 12;
269 int mAutosaveCounter = 0;
270 bool mAutosaveNeverAskAgain =
false;
272 void makeConnections();
276 void updateAutoSaveCounter();
ActiveFramePool implemented a LRU cache to keep tracking the most recent accessed key frames A key fr...
void framesModified()
This should be emitted after modifying multiple frames.
KeyFrame * addNewKey()
Attempts to create a new keyframe at the current frame and layer.
void frameModified(int frameNumber)
This should be emitted after modifying the frame content.
void updateFrame()
Will call update() and update the canvas Only call this directly If you need the cache to be intact a...
void scrubbed(int frameNumber)
This should be emitted after scrubbing.
void setLayerVisibility(LayerVisibility visibility)
The visibility value should match any of the VISIBILITY enum values.
KeyFrame * addKeyFrame(int layerNumber, int frameIndex)
Attempts to create a new keyframe at the given position and layer.
QObject * parent() const const