30#include <QPixmapCache>
35#include "bitmapimage.h"
36#include "canvaspainter.h"
37#include "overlaypainter.h"
38#include "preferencemanager.h"
39#include "selectionpainter.h"
40#include "camerapainter.h"
41#include "tiledbuffer.h"
64 void setEditor(
Editor* e) { mEditor = e; }
65 Editor* editor()
const {
return mEditor; }
67 void deleteSelection();
69 void applyTransformedSelection();
70 void cancelTransformedSelection();
72 void setEffect(SETTING e,
bool isOn);
74 LayerVisibility getLayerVisibility()
const {
return mLayerVisibility; }
75 qreal getCurveSmoothing()
const {
return mCurveSmoothingLevel; }
76 bool makeInvisible()
const {
return mMakeInvisible; }
120 void flipSelection(
bool flipVertical);
124 bool isMouseInUse()
const {
return mMouseInUse; }
125 bool isTabletInUse()
const {
return mTabletInUse; }
126 bool isPointerInUse()
const {
return mMouseInUse || mTabletInUse; }
129 void keyEventForSelection(
QKeyEvent* event);
132 void multiLayerOnionSkinChanged(
bool);
133 void selectionUpdated();
137 void setCurveSmoothing(
int);
138 void toggleThinLines();
139 void increaseLayerVisibilityIndex();
140 void decreaseLayerVisibilityIndex();
141 void setLayerVisibility(LayerVisibility visibility);
143 void updateToolCursor();
144 void paletteColorChanged(
QColor);
146 void showLayerNotVisibleWarning();
151 bool event(
QEvent *event)
override;
159 void keyReleaseEvent(
QKeyEvent*)
override;
166 void drawPen(
QPointF thePoint, qreal brushWidth,
QColor fillColor,
bool useAA =
true);
167 void drawPencil(
QPointF thePoint, qreal brushWidth, qreal fixedBrushFeather,
QColor fillColor, qreal opacity);
169 void blurBrush(
BitmapImage *bmiSource_,
QPointF srcPoint_,
QPointF thePoint_, qreal brushWidth_, qreal offset_, qreal opacity_);
170 void liquifyBrush(
BitmapImage *bmiSource_,
QPointF srcPoint_,
QPointF thePoint_, qreal brushWidth_, qreal offset_, qreal opacity_);
172 void paintBitmapBuffer();
173 void clearDrawingBuffer();
174 void setGaussianGradient(
QGradient &gradient,
QColor color, qreal opacity, qreal offset);
206 void prepOverlays(
int frame);
207 void prepCameraPainter(
int frame);
208 void prepCanvas(
int frame);
210 void settingUpdated(SETTING setting);
211 void paintSelectionVisuals(
QPainter &painter);
216 Editor* mEditor =
nullptr;
218 LayerVisibility mLayerVisibility = LayerVisibility::ALL;
219 bool mMakeInvisible =
false;
220 qreal mCurveSmoothingLevel = 0.0;
221 bool mMultiLayerOnionSkin =
false;
222 int mDeltaFactor = 1;
231 void tabletReleaseEventFired();
232 bool mMouseInUse =
false;
233 bool mTabletInUse =
false;
234 qreal mDevicePixelRatio = 1.;
237 void handleDoubleClick();
238 bool mIsFirstClick =
true;
239 int mDoubleClickMillis = 0;
241 const int DOUBLE_CLICK_THRESHOLD = 500;
242 QTimer* mDoubleClickTimer =
nullptr;
244 int mTabletReleaseMillisAgo;
245 const int MOUSE_FILTER_THRESHOLD = 200;
247 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