18#ifndef TIMELINECELLS_H
19#define TIMELINECELLS_H
23#include "layercamera.h"
26enum class LayerVisibility;
37enum class TIMELINE_CELL_TYPE
51 static int getOffsetX() {
return mOffsetX; }
52 static int getOffsetY() {
return mOffsetY; }
53 int getLayerHeight()
const {
return mLayerHeight; }
55 int getFrameLength()
const {
return mFrameLength; }
56 int getFrameSize()
const {
return mFrameSize; }
58 void setFrameLength(
int n) { mFrameLength = n; }
59 void setFrameSize(
int size);
60 void clearCache() {
delete mCache; mCache =
nullptr; }
62 bool didDetachLayer()
const;
67 void mouseMovedY(
int);
68 void lengthChanged(
int);
69 void offsetChanged(
int);
70 void selectionChanged();
71 void insertNewKeyFrame();
75 void updateFrame(
int frameNumber);
76 void hScrollChange(
int);
77 void vScrollChange(
int);
78 void onScrollingVerticallyStopped();
79 void setMouseMoveY(
int x);
82 bool event(
QEvent *event)
override;
87 void mouseReleaseEvent(
QMouseEvent* event)
override;
88 void mouseDoubleClickEvent(
QMouseEvent* event)
override;
91 void loadSetting(SETTING setting);
94 int getLayerNumber(
int y)
const;
95 int getInbetweenLayerNumber(
int y)
const;
96 int getLayerY(
int layerNumber)
const;
97 int getFrameX(
int frameNumber)
const;
98 int getFrameNumber(
int x)
const;
100 void onDidLeaveWidget();
102 bool trackScrubber();
105 void paintOnionSkin(
QPainter& painter)
const;
106 void paintLayerGutter(
QPainter& painter)
const;
109 void paintCurrentFrameBorder(
QPainter& painter,
int recLeft,
int recTop,
int recWidth,
int recHeight)
const;
110 void paintFrameCursorOnCurrentLayer(
QPainter& painter,
int recTop,
int recWidth,
int recHeight)
const;
111 void paintSelectedFrames(
QPainter& painter,
const Layer* layer,
const int layerIndex)
const;
112 void paintLabel(
QPainter& painter,
const Layer* layer,
int x,
int y,
int height,
int width,
bool selected, LayerVisibility layerVisibility)
const;
114 void paintHighlightedFrame(
QPainter& painter,
int framePos,
int recTop,
int recWidth,
int recHeight)
const;
116 void editLayerProperties(
Layer* layer)
const;
117 void editLayerProperties(
LayerCamera *layer)
const;
118 void editLayerName(
Layer* layer)
const;
124 TIMELINE_CELL_TYPE mType;
127 bool mRedrawContent =
false;
128 bool mDrawFrameNumber =
true;
129 bool mbShortScrub =
false;
130 int mFrameLength = 1;
133 bool mScrubbing =
false;
134 bool mHighlightFrameEnabled =
false;
135 int mHighlightedFrame = -1;
136 int mLayerHeight = 20;
140 int mCurrentLayerNumber = 0;
141 int mLastScrubFrame = 0;
145 int mStartLayerNumber = -1;
146 int mStartFrameNumber = 0;
147 int mLastFrameNumber = -1;
152 int mFrameOffset = 0;
153 int mLayerOffset = 0;
156 bool mScrollingVertically =
false;
158 bool mCanMoveFrame =
false;
159 bool mMovingFrames =
false;
161 bool mCanBoxSelect =
false;
162 bool mBoxSelecting =
false;
164 bool mClickSelecting =
false;
166 int mFramePosMoveX = 0;
167 int mLayerPosMoveY = 0;
170 int mMousePressX = 0;
172 const static int mOffsetX = 0;
173 const static int mOffsetY = 20;
174 const static int mLayerDetachThreshold = 5;
QObject * parent() const const