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")
102 Object* object()
const {
return mObject.get(); }
103 Status openObject(
const QString& strFilePath,
const std::function<
void(
int)>& progressChanged,
const std::function<
void(
int)>& progressRangeChanged);
108 void setScribbleArea(
ScribbleArea* pScirbbleArea) { mScribbleArea = pScirbbleArea; }
109 ScribbleArea* getScribbleArea() {
return mScribbleArea; }
111 int currentFrame()
const;
113 void setFps(
int fps);
115 int currentLayerIndex()
const {
return mCurrentLayerIndex; }
116 void setCurrentLayerIndex(
int i);
118 void scrubTo(
int frameNumber);
124 LayerVisibility layerVisibility();
126 qreal viewScaleInversed();
127 void deselectAll()
const;
128 void selectAll()
const;
130 void clipboardChanged();
147 void selectedFramesChanged();
149 void updateTimeLine()
const;
150 void updateTimeLineCached();
151 void updateLayerCount();
156 void fpsChanged(
int fps);
160 void needDisplayInfoNoTitle(
const QString& body);
162 void canCopyChanged(
bool enabled);
163 void canPasteChanged(
bool enabled);
178 void setModified(
int layerNumber,
int frameNumber);
180 void clearCurrentFrame();
183 Status importGIF(
const QString& filePath,
int numOfImages = 0);
186 void scrubNextKeyFrame();
187 void scrubPreviousKeyFrame();
189 void scrubBackward();
194 void switchVisibilityOfLayer(
int layerNumber);
195 void swapLayers(
int i,
int j);
196 bool canSwapLayers(
int layerIndexLeft,
int layerIndexRight)
const;
198 void backup(
const QString& undoText);
199 bool backup(
int layerNumber,
int frameNumber,
const QString& undoText);
212 void onCurrentLayerWillChange(
int index);
218 void pasteFromPreviousFrame();
221 bool canCopy()
const;
222 bool canPaste()
const;
224 void increaseLayerVisibilityIndex();
225 void decreaseLayerVisibilityIndex();
226 void flipSelection(
bool flipVertical);
227 void repositionImage(
QPoint transform,
int frame);
229 void clearTemporary();
232 void settingUpdated(SETTING);
234 void dontAskAutoSave(
bool b) { mAutosaveNeverAskAgain = b; }
235 bool autoSaveNeverAskAgain()
const {
return mAutosaveNeverAskAgain; }
236 void resetAutoSaveCounter();
242 void pasteToCanvas(
BitmapImage* bitmapImage,
int frameNumber);
243 void pasteToCanvas(
VectorImage* vectorImage,
int frameNumber);
244 void pasteToFrames();
246 bool canCopyBitmapImage(
BitmapImage* bitmapImage)
const;
247 bool canCopyFrames(
const Layer* layer)
const;
248 bool canCopyVectorImage(
const VectorImage* vectorImage)
const;
251 std::unique_ptr<Object> mObject;
254 int mCurrentLayerIndex = 0;
269 std::vector< BaseManager* > mAllManagers;
271 bool mIsAutosave =
true;
272 int mAutosaveNumber = 12;
273 int mAutosaveCounter = 0;
274 bool mAutosaveNeverAskAgain =
false;
276 void makeConnections();
277 KeyFrame* addKeyFrame(
int layerNumber,
int frameNumber);
282 void clearUndoStack();
283 void updateAutoSaveCounter();
284 int mLastModifiedFrame = -1;
285 int mLastModifiedLayer = -1;
ActiveFramePool implemented a LRU cache to keep tracking the most recent accessed key frames A key fr...
void updateFrame(int frameNumber)
Will call update() and update the canvas Only call this directly If you need the cache to be intact a...
void framesModified()
This should be emitted after modifying multiple frames.
void updateCurrentFrame()
Will call update() and update the canvas Only call this directly If you need the cache to be intact a...
void frameModified(int frameNumber)
This should be emitted after modifying the frame content.
void scrubbed(int frameNumber)
This should be emitted after scrubbing.
void sanitizeBackupElementsAfterLayerDeletion(int layerIndex)
Restores integrity of the backup elements after a layer has been deleted.
void setLayerVisibility(LayerVisibility visibility)
The visibility value should match any of the VISIBILITY enum values.
QObject * parent() const const