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; }
116 void flipSelection(
bool flipVertical);
120 bool isMouseInUse()
const {
return mMouseInUse; }
121 bool isTabletInUse()
const {
return mTabletInUse; }
122 bool isPointerInUse()
const {
return mMouseInUse || mTabletInUse; }
125 void keyEventForSelection(
QKeyEvent* event);
128 void multiLayerOnionSkinChanged(
bool);
129 void selectionUpdated();
131 void requestFocus(
QWidget* widget);
135 void setCurveSmoothing(
int);
136 void toggleThinLines();
137 void increaseLayerVisibilityIndex();
138 void decreaseLayerVisibilityIndex();
139 void setLayerVisibility(LayerVisibility visibility);
141 void updateToolCursor();
142 void paletteColorChanged(
QColor);
144 void showLayerNotVisibleWarning();
149 bool event(
QEvent *event)
override;
157 void keyReleaseEvent(
QKeyEvent*)
override;
164 void drawPen(
QPointF thePoint, qreal brushWidth,
QColor fillColor,
bool useAA =
true);
165 void drawPencil(
QPointF thePoint, qreal brushWidth, qreal fixedBrushFeather,
QColor fillColor, qreal opacity);
167 void blurBrush(
BitmapImage *bmiSource_,
QPointF srcPoint_,
QPointF thePoint_, qreal brushWidth_, qreal offset_, qreal opacity_);
168 void liquifyBrush(
BitmapImage *bmiSource_,
QPointF srcPoint_,
QPointF thePoint_, qreal brushWidth_, qreal offset_, qreal opacity_);
170 void paintBitmapBuffer();
171 void clearDrawingBuffer();
172 void setGaussianGradient(
QGradient &gradient,
QColor color, qreal opacity, qreal offset);
204 void prepOverlays(
int frame);
205 void prepCameraPainter(
int frame);
206 void prepCanvas(
int frame);
208 void settingUpdated(SETTING setting);
209 void paintSelectionVisuals(
QPainter &painter);
214 Editor* mEditor =
nullptr;
216 LayerVisibility mLayerVisibility = LayerVisibility::ALL;
217 bool mMakeInvisible =
false;
218 qreal mCurveSmoothingLevel = 0.0;
219 int mDeltaFactor = 1;
228 void tabletReleaseEventFired();
229 bool mMouseInUse =
false;
230 bool mTabletInUse =
false;
231 qreal mDevicePixelRatio = 1.;
234 void handleDoubleClick();
235 bool mIsFirstClick =
true;
236 int mDoubleClickMillis = 0;
238 const int DOUBLE_CLICK_THRESHOLD = 500;
239 QTimer* mDoubleClickTimer =
nullptr;
241 int mTabletReleaseMillisAgo;
242 const int MOUSE_FILTER_THRESHOLD = 200;
243 bool mTabletHasEntered =
false;
245 QTimer* mMouseFilterTimer =
nullptr;
void onScrubbed(int frameNumber)
Frame scrubbed, invalidate relevant cache.
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