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 bool isLayerPaintable()
const;
74 void setEffect(SETTING e,
bool isOn);
76 LayerVisibility getLayerVisibility()
const {
return mLayerVisibility; }
77 qreal getCurveSmoothing()
const {
return mCurveSmoothingLevel; }
78 bool makeInvisible()
const {
return mMakeInvisible; }
122 void flipSelection(
bool flipVertical);
126 bool isMouseInUse()
const {
return mMouseInUse; }
127 bool isTabletInUse()
const {
return mTabletInUse; }
128 bool isPointerInUse()
const {
return mMouseInUse || mTabletInUse; }
131 void keyEventForSelection(
QKeyEvent* event);
134 void multiLayerOnionSkinChanged(
bool);
135 void selectionUpdated();
139 void setCurveSmoothing(
int);
140 void toggleThinLines();
141 void increaseLayerVisibilityIndex();
142 void decreaseLayerVisibilityIndex();
143 void setLayerVisibility(LayerVisibility visibility);
145 void updateToolCursor();
146 void paletteColorChanged(
QColor);
148 void showLayerNotVisibleWarning();
153 bool event(
QEvent *event)
override;
161 void keyReleaseEvent(
QKeyEvent*)
override;
168 void drawPen(
QPointF thePoint, qreal brushWidth,
QColor fillColor,
bool useAA =
true);
169 void drawPencil(
QPointF thePoint, qreal brushWidth, qreal fixedBrushFeather,
QColor fillColor, qreal opacity);
171 void blurBrush(
BitmapImage *bmiSource_,
QPointF srcPoint_,
QPointF thePoint_, qreal brushWidth_, qreal offset_, qreal opacity_);
172 void liquifyBrush(
BitmapImage *bmiSource_,
QPointF srcPoint_,
QPointF thePoint_, qreal brushWidth_, qreal offset_, qreal opacity_);
174 void paintBitmapBuffer();
175 void clearDrawingBuffer();
176 void setGaussianGradient(
QGradient &gradient,
QColor color, qreal opacity, qreal offset);
208 void prepOverlays(
int frame);
209 void prepCameraPainter(
int frame);
210 void prepCanvas(
int frame);
212 void settingUpdated(SETTING setting);
213 void paintSelectionVisuals(
QPainter &painter);
218 Editor* mEditor =
nullptr;
220 LayerVisibility mLayerVisibility = LayerVisibility::ALL;
221 bool mMakeInvisible =
false;
222 qreal mCurveSmoothingLevel = 0.0;
223 bool mMultiLayerOnionSkin =
false;
224 int mDeltaFactor = 1;
233 void tabletReleaseEventFired();
234 bool mMouseInUse =
false;
235 bool mTabletInUse =
false;
236 qreal mDevicePixelRatio = 1.;
239 void handleDoubleClick();
240 bool mIsFirstClick =
true;
241 int mDoubleClickMillis = 0;
243 const int DOUBLE_CLICK_THRESHOLD = 500;
244 QTimer* mDoubleClickTimer =
nullptr;
246 int mTabletReleaseMillisAgo;
247 const int MOUSE_FILTER_THRESHOLD = 200;
249 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