Changeset View
Changeset View
Standalone View
Standalone View
plugins/dockers/animation/timeline_frames_view.h
Context not available. | |||||
27 | class KisAction; | 27 | class KisAction; | ||
---|---|---|---|---|---|
28 | class TimelineWidget; | 28 | class TimelineWidget; | ||
29 | 29 | | |||
30 | enum TimelineDirection : short | ||||
31 | { | ||||
32 | LEFT = -1, | ||||
33 | BEFORE = -1, | ||||
34 | | ||||
35 | RIGHT = 1, | ||||
36 | AFTER = 1 | ||||
37 | }; | ||||
38 | | ||||
30 | class KRITAANIMATIONDOCKER_EXPORT TimelineFramesView : public QTableView | 39 | class KRITAANIMATIONDOCKER_EXPORT TimelineFramesView : public QTableView | ||
31 | { | 40 | { | ||
32 | Q_OBJECT | 41 | Q_OBJECT | ||
42 | | ||||
33 | public: | 43 | public: | ||
34 | TimelineFramesView(QWidget *parent); | 44 | TimelineFramesView(QWidget *parent); | ||
35 | ~TimelineFramesView() override; | 45 | ~TimelineFramesView() override; | ||
Context not available. | |||||
40 | 50 | | |||
41 | void setShowInTimeline(KisAction *action); | 51 | void setShowInTimeline(KisAction *action); | ||
42 | 52 | | |||
43 | void setActionManager( KisActionManager * actionManager); | 53 | void setActionManager(KisActionManager *actionManager); | ||
44 | 54 | | |||
45 | public Q_SLOTS: | 55 | public Q_SLOTS: | ||
46 | void slotSelectionChanged(); | 56 | void slotSelectionChanged(); | ||
Context not available. | |||||
61 | void slotRemoveLayer(); | 71 | void slotRemoveLayer(); | ||
62 | void slotLayerContextMenuRequested(const QPoint &globalPos); | 72 | void slotLayerContextMenuRequested(const QPoint &globalPos); | ||
63 | 73 | | |||
64 | // New, Copy, Insert and Remove Frames | 74 | // New, Insert and Remove Frames | ||
65 | void slotNewFrame(); | 75 | void slotAddBlankFrame(); | ||
66 | void slotCopyFrame(); | 76 | void slotAddDuplicateFrame(); | ||
67 | | ||||
68 | void slotInsertKeyframesLeft(int count = 1, int timing = 1, bool forceEntireColumn = false); | | |||
69 | void slotInsertKeyframesRight(int count = 1, int timing = 1, bool forceEntireColumn = false); | | |||
70 | 77 | | |||
71 | void slotInsertKeyframesLeftCustom(); | 78 | void slotInsertKeyframeLeft() {insertKeyframes(1, 1, TimelineDirection::LEFT, false);} | ||
72 | void slotInsertKeyframesRightCustom(); | 79 | void slotInsertKeyframeRight() {insertKeyframes(1, 1, TimelineDirection::RIGHT, false);} | ||
73 | 80 | | |||
74 | void slotRemoveFrame(bool forceEntireColumn = false, bool needsOffset = false); | 81 | void slotInsertKeyframeColumnLeft() {insertKeyframes(1, 1, TimelineDirection::LEFT, true);} | ||
75 | void slotRemoveFramesAndShift(bool forceEntireColumn = false); | 82 | void slotInsertKeyframeColumnRight() {insertKeyframes(1, 1, TimelineDirection::RIGHT, true);} | ||
76 | 83 | | |||
77 | void slotInsertColumnsLeft(int count = 1, int timing = 1); | 84 | void slotInsertMultipleKeyframes() {insertMultipleKeyframes(false);} | ||
78 | void slotInsertColumnsLeftCustom(); | 85 | void slotInsertMultipleKeyframeColumns() {insertMultipleKeyframes(true);} | ||
79 | 86 | | |||
80 | void slotInsertColumnsRight(int count = 1, int timing = 1); | 87 | void slotRemoveSelectedFrames(bool forceEntireColumn = false, bool needsOffset = false); | ||
81 | void slotInsertColumnsRightCustom(); | 88 | void slotRemoveSelectedFramesAndShift() {slotRemoveSelectedFrames(false, true);} | ||
82 | 89 | | |||
83 | void slotRemoveColumns(); | 90 | void slotRemoveSelectedColumns() {slotRemoveSelectedFrames(true);} | ||
84 | void slotRemoveColumnsAndShift(); | 91 | void slotRemoveSelectedColumnsAndShift() {slotRemoveSelectedFrames(true, true);} | ||
85 | 92 | | |||
86 | void slotInsertHoldFrames(int count = 1, bool forceEntireColumn = false); | 93 | void slotInsertHoldFrame() {insertOrRemoveHoldFrames(1);} | ||
87 | void slotRemoveHoldFrames(int count = 1, bool forceEntireColumn = false); | 94 | void slotRemoveHoldFrame() {insertOrRemoveHoldFrames(-1);} | ||
88 | 95 | | |||
89 | void slotInsertHoldFramesCustom(); | 96 | void slotInsertHoldFrameColumn() {insertOrRemoveHoldFrames(1,true);} | ||
90 | void slotRemoveHoldFramesCustom(); | 97 | void slotRemoveHoldFrameColumn() {insertOrRemoveHoldFrames(-1,true);} | ||
91 | 98 | | |||
92 | void slotInsertHoldColumns(int count = 1); | 99 | void slotInsertMultipleHoldFrames() {insertOrRemoveMultipleHoldFrames(true);} | ||
93 | void slotRemoveHoldColumns(int count = 1); | 100 | void slotRemoveMultipleHoldFrames() {insertOrRemoveMultipleHoldFrames(false);} | ||
94 | 101 | | |||
95 | void slotInsertHoldColumnsCustom(); | 102 | void slotInsertMultipleHoldFrameColumns() {insertOrRemoveMultipleHoldFrames(true, true);} | ||
96 | void slotRemoveHoldColumnsCustom(); | 103 | void slotRemoveMultipleHoldFrameColumns() {insertOrRemoveMultipleHoldFrames(false, true);} | ||
97 | 104 | | |||
98 | void slotMirrorFrames(bool forceEntireColumn = false); | 105 | void slotMirrorFrames(bool forceEntireColumn = false); | ||
99 | void slotMirrorColumns(); | 106 | void slotMirrorColumns() {slotMirrorFrames(true);} | ||
100 | 107 | | |||
101 | // Copy-paste | 108 | // Copy-paste | ||
102 | void slotCopyFrames(bool forceEntireColumn = false); | 109 | void slotCopyFrames() {cutCopyImpl(false, true);} | ||
103 | void slotCutFrames(bool forceEntireColumn = false); | 110 | void slotCutFrames() {cutCopyImpl(false, false);} | ||
104 | void slotPasteFrames(bool forceEntireColumn = false); | | |||
105 | 111 | | |||
106 | void slotCopyColumns(); | 112 | void slotCopyColumns() {cutCopyImpl(true, true);} | ||
107 | void slotCutColumns(); | 113 | void slotCutColumns() {cutCopyImpl(true, false);} | ||
108 | void slotPasteColumns(); | 114 | | ||
115 | void slotPasteFrames(bool forceEntireColumn = false); | ||||
116 | void slotPasteColumns() {slotPasteFrames(true);} | ||||
109 | 117 | | |||
110 | void slotReselectCurrentIndex(); | 118 | void slotReselectCurrentIndex(); | ||
111 | 119 | | |||
Context not available. | |||||
128 | 136 | | |||
129 | private: | 137 | private: | ||
130 | void setFramesPerSecond(int fps); | 138 | void setFramesPerSecond(int fps); | ||
139 | | ||||
131 | void calculateSelectionMetrics(int &minColumn, int &maxColumn, QSet<int> &rows) const; | 140 | void calculateSelectionMetrics(int &minColumn, int &maxColumn, QSet<int> &rows) const; | ||
132 | 141 | | |||
133 | void insertFramesImpl(int insertAtColumn, int count, int timing, QSet<int> rows, bool forceEntireColumn); | 142 | void insertKeyframes(int count = 1, int timing = 1, | ||
143 | TimelineDirection direction = TimelineDirection::LEFT, bool forceEntireColumn = false); | ||||
144 | void insertMultipleKeyframes(bool forceEntireColumn = false); | ||||
145 | | ||||
146 | void insertOrRemoveHoldFrames(int count, bool forceEntireColumn = false); | ||||
147 | void insertOrRemoveMultipleHoldFrames(bool insertion, bool forceEntireColumn = false); | ||||
148 | | ||||
149 | void cutCopyImpl(bool forceEntireColumn, bool copy); | ||||
134 | 150 | | |||
135 | void createFrameEditingMenuActions(QMenu *menu, bool addFrameCreationActions); | 151 | void createFrameEditingMenuActions(QMenu *menu, bool addFrameCreationActions); | ||
136 | 152 | | |||
137 | QModelIndexList calculateSelectionSpan(bool forceEntireColumn, bool editableOnly = true) const; | 153 | QModelIndexList calculateSelectionSpan(bool forceEntireColumn, bool editableOnly = true) const; | ||
138 | void cutCopyImpl(bool forceEntireColumn, bool copy); | | |||
139 | 154 | | |||
140 | int defaultNumberOfFramesToAdd() const; | 155 | int defaultNumberOfFramesToAdd() const; | ||
141 | void setDefaultNumberOfFramesToAdd(int value) const; | 156 | void setDefaultNumberOfFramesToAdd(int value) const; | ||
Context not available. |