26 #include "pencilerror.h"
27 #include "pencildef.h"
28 #include "objectdata.h"
63 void createWorkingDir();
64 void deleteWorkingDir()
const;
65 void setWorkingDir(
const QString& path);
66 void createDefaultLayers();
68 QString filePath()
const {
return mFilePath; }
69 void setFilePath(
QString strFileName) { mFilePath = strFileName; }
71 QString workingDir()
const {
return mWorkingDirPath; }
73 QString dataDir()
const {
return mDataDirPath; }
74 void setDataDir(
QString dirPath) { mDataDirPath = dirPath; }
76 QString mainXMLFile()
const {
return mMainXMLFile; }
77 void setMainXMLFile(
QString file) { mMainXMLFile = file; }
80 bool loadXML(
QDomElement element, ProgressCallback progressForward);
82 void paintImage(
QPainter& painter,
int frameNumber,
bool background,
bool antialiasing)
const;
88 void setColor(
int index,
QColor newColor);
89 void setColorRef(
int index,
ColorRef newColorRef);
91 void movePaletteColor(
int start,
int end);
92 void moveVectorColor(
int start,
int end);
95 void addColorAtIndex(
int index,
ColorRef newColor);
96 void removeColor(
int index);
97 bool isColorInUse(
int index);
98 void renameColor(
int i,
QString text);
99 int getColorCount() {
return mPalette.
size(); }
100 bool importPalette(
QString filePath);
101 void importPaletteGPL(
QFile& file);
102 void importPalettePencil(
QFile& file);
103 void openPalette(
QString filePath);
105 bool exportPalette(
const QString& filePath)
const;
106 void exportPaletteGPL(
QFile& file)
const;
107 void exportPalettePencil(
QFile& file)
const;
110 void loadDefaultPalette();
117 int getLayerCount()
const;
118 Layer* getLayer(
int i)
const;
119 Layer* findLayerByName(
QString strName, Layer::LAYER_TYPE type = Layer::UNDEFINED)
const;
120 Layer* takeLayer(
int layerId);
122 bool swapLayers(
int i,
int j);
123 void deleteLayer(
int i);
124 void deleteLayer(
Layer*);
125 bool addLayer(
Layer* layer);
128 std::vector<T*> getLayersByType()
const
130 std::vector<T*> result;
131 for (
Layer* layer : mLayers)
133 T* t =
dynamic_cast<T*
>(layer);
142 bool transparency,
bool exportKeyframesOnly,
const QString& layerName,
bool antialiasing,
QProgressDialog* progress,
int progressMax)
const;
143 bool exportX(
int frameStart,
int frameEnd,
QTransform view,
QSize exportSize,
QString filePath,
bool antialiasing);
146 void modification() { modified =
true; }
147 bool isModified() {
return modified; }
148 void setModified(
bool b) { modified = b; }
150 int getUniqueLayerID();
155 int totalKeyFrameCount()
const;
156 void updateActiveFrames(
int frame)
const;
157 void setActiveFramePoolSize(
int sizeInMB);
160 void layerViewChanged();
161 void paletteImported();
172 bool modified =
false;
176 std::unique_ptr<ObjectData> mData;
177 mutable std::unique_ptr<ActiveFramePool> mActiveFramePool;
void append(const T &value)
ActiveFramePool implemented a LRU cache to keep tracking the most recent accessed key frames A key fr...
QObject * parent() const const