30#include <QPixmapCache>
34#include "bitmapimage.h"
35#include "canvaspainter.h"
36#include "overlaypainter.h"
37#include "preferencemanager.h"
38#include "selectionpainter.h"
39#include "camerapainter.h"
40#include "tiledbuffer.h"
63 void setEditor(
Editor* e) { mEditor = e; }
64 Editor* editor()
const {
return mEditor; }
66 void deleteSelection();
68 void applyTransformedSelection();
69 void cancelTransformedSelection();
71 void setEffect(SETTING e,
bool isOn);
73 LayerVisibility getLayerVisibility()
const {
return mLayerVisibility; }
74 qreal getCurveSmoothing()
const {
return mCurveSmoothingLevel; }
75 bool makeInvisible()
const {
return mMakeInvisible; }
119 void flipSelection(
bool flipVertical);
123 bool isMouseInUse()
const {
return mMouseInUse; }
124 bool isTabletInUse()
const {
return mTabletInUse; }
125 bool isPointerInUse()
const {
return mMouseInUse || mTabletInUse; }
128 void keyEventForSelection(
QKeyEvent* event);
131 void multiLayerOnionSkinChanged(
bool);
132 void selectionUpdated();
136 void setCurveSmoothing(
int);
137 void toggleThinLines();
138 void increaseLayerVisibilityIndex();
139 void decreaseLayerVisibilityIndex();
140 void setLayerVisibility(LayerVisibility visibility);
142 void updateToolCursor();
143 void paletteColorChanged(
QColor);
145 void showLayerNotVisibleWarning();
150 bool event(
QEvent *event)
override;
158 void keyReleaseEvent(
QKeyEvent*)
override;
165 void drawPen(
QPointF thePoint, qreal brushWidth,
QColor fillColor,
bool useAA =
true);
166 void drawPencil(
QPointF thePoint, qreal brushWidth, qreal fixedBrushFeather,
QColor fillColor, qreal opacity);
168 void blurBrush(
BitmapImage *bmiSource_,
QPointF srcPoint_,
QPointF thePoint_, qreal brushWidth_, qreal offset_, qreal opacity_);
169 void liquifyBrush(
BitmapImage *bmiSource_,
QPointF srcPoint_,
QPointF thePoint_, qreal brushWidth_, qreal offset_, qreal opacity_);
171 void paintBitmapBuffer();
172 void clearDrawingBuffer();
173 void setGaussianGradient(
QGradient &gradient,
QColor color, qreal opacity, qreal offset);
205 void prepOverlays(
int frame);
206 void prepCameraPainter(
int frame);
207 void prepCanvas(
int frame);
209 void settingUpdated(SETTING setting);
210 void paintSelectionVisuals(
QPainter &painter);
215 Editor* mEditor =
nullptr;
217 LayerVisibility mLayerVisibility = LayerVisibility::ALL;
218 bool mMakeInvisible =
false;
219 qreal mCurveSmoothingLevel = 0.0;
220 int mDeltaFactor = 1;
229 void tabletReleaseEventFired();
230 bool mMouseInUse =
false;
231 bool mTabletInUse =
false;
232 qreal mDevicePixelRatio = 1.;
235 void handleDoubleClick();
236 bool mIsFirstClick =
true;
237 int mDoubleClickMillis = 0;
239 const int DOUBLE_CLICK_THRESHOLD = 500;
240 QTimer* mDoubleClickTimer =
nullptr;
242 int mTabletReleaseMillisAgo;
243 const int MOUSE_FILTER_THRESHOLD = 200;
245 QTimer* mMouseFilterTimer =
nullptr;
void onScrubbed(int frameNumber)
Frame scrubbed, invalidate relevant cache.
void onToolPropertyUpdated(ToolType, ToolPropertyType)
Tool property updated, invalidate cache and frame if needed.
void onViewChanged()
View updated, invalidate relevant cache.
void onObjectLoaded()
Object updated, invalidate all cache.
void invalidateCacheForDirtyFrames()
invalidate cache for dirty keyframes.
void updateFrame()
Update frame.
void handleDrawingOnEmptyFrame()
Call this when starting to use a paint tool.
void invalidatePainterCaches()
Invalidate the layer pixmap and camera painter caches.
void invalidateOnionSkinsCacheAround(int frame)
invalidate onion skin cache around frame
void onSelectionChanged()
Selection was changed, keep cache.
void onOnionSkinTypeChanged()
Onion skin type changed, all frames will be affected.
void onFramesModified()
Multiple frames modified, invalidate cache for affected frames.
void onToolChanged(ToolType)
Tool changed, invalidate cache and frame if needed.
void onPlayStateChanged()
Playstate changed, invalidate relevant cache.
void invalidateAllCache()
Invalidate all cache.
void invalidateCacheForFrame(int frameNumber)
Invalidate cache for the given frame.
void onLayerChanged()
Layer changed, invalidate relevant cache.
void onFrameModified(int frameNumber)
Frame modified, invalidate cache for frame if any.
QObject * parent() const const