Kage Studio 0.7.230428
A Simple Free and Open Source 2D Animation Software
Loading...
Searching...
No Matches
frameset.h
Go to the documentation of this file.
1/*
2 * Kage Studio - a simple free and open source vector-based 2D animation software
3 * Copyright (C) 2011~2022 Mj Mendoza IV
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18 * MA 02110-1301, USA. Or, see <https://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef GTKMM_KAGE_MANAGER_FRAME_H
23 #define GTKMM_KAGE_MANAGER_FRAME_H
24
25 #include <gtkmm/box.h>
26 #include "frame.h"
27 #include "frame_padding.h"
28
29 class KageFramesetManager; //forward declaration
30
31 class KageFrameset : public Gtk::HBox {
32 public:
33 KageFrameset(KageFramesetManager *p_fsm, unsigned int p_layerID, unsigned int p_frameCount);
34 virtual ~KageFrameset();
35 unsigned int getID();
36 bool selectAll(bool p_selectAll);
37 unsigned int getFrameCount();
38 bool addFrame();
39 void duplicateFrame();
40 void extendFrame();
41 bool removeFrame();
42 unsigned int getCurrentFrame();
43 void setCurrentFrame(unsigned int p_frame);
44 void setCurrentFrameByID(unsigned int p_frameID);
45 void focusFrame(unsigned int p_frame);
46
47 void removeAllFrames();
48
50 KageFrame *getFrameAt(unsigned int p_frame);
51 unsigned int getFrameNumberByID(unsigned int p_frameID);
52
53 void setSelected(KageFrame *p_frame);
54
55 vector<unsigned int> raiseSelectedShape(vector<unsigned int> p_selectedShapes);
56 vector<unsigned int> lowerSelectedShape(vector<unsigned int> p_selectedShapes);
57 vector<unsigned int> raiseToTopSelectedShape(vector<unsigned int> p_selectedShapes);
58 vector<unsigned int> lowerToBottomSelectedShape(vector<unsigned int> p_selectedShapes);
59 vector<unsigned int> groupSelectedShapes(vector<unsigned int> p_selectedShapes);
60 vector<unsigned int> ungroupSelectedShapes(vector<unsigned int> p_selectedShapes);
61 vector<unsigned int> duplicateShapes(vector<unsigned int> p_selectedShapes);
62 bool flipHorizontalSelectedShape(vector<unsigned int> p_selectedShapes);
63 bool flipVerticalSelectedShape(vector<unsigned int> p_selectedShapes);
64 bool doFlipVerticalSelectedShapeOn(unsigned int p_frameIndex, vector<unsigned int> p_selectedShapes);
65 bool doFlipVerticalSelectedShapeOnExtendedFrame(unsigned int p_frameIndex, vector<unsigned int> p_selectedShapes);
66
67 bool recenterRotationPoint(vector<unsigned int> p_selectedShapes);
68
69 bool addDataToFrame(VectorDataManager p_vectorsData);
70 bool setFrameData(VectorDataManager p_vectorsData);
71 VectorDataManager getFrameTweenData(unsigned int p_frameIndex);
73 VectorDataManager getFrameDataAt(unsigned int p_frame);
74 VectorDataManager getPreviousFrameData(unsigned int p_frameID);
75 bool setFrameDataToPreviousFrame(VectorDataManager p_vectorsData, unsigned int p_frameID);
76 bool addDataToPreviousFrame(VectorDataManager v, unsigned int p_frameID);
77
78 bool setPreviousFrameTween(unsigned int p_frameID, unsigned int p_tween);
79 bool setExtendedFrameTween(unsigned int p_frameID, unsigned int p_tween);
80 bool forceSetTween(unsigned int p_tween);
81 bool setTween(unsigned int p_tween);
82 unsigned int getTween();
83
85 bool switchToPreviousFrame(unsigned int p_frameID);
86 bool switchToNextFrame();
87 bool switchToNextFrame(unsigned int p_frameID);
88 bool isCurrentFrame(unsigned int p_frameID);
89 bool canReUseNextFrame();
90
92 protected:
93 unsigned int layerID;
94// unsigned int layerCtr;
95 unsigned int frameCtr;
96 std::vector<KageFrame*> _frames;
98
100 unsigned int _currentFrameID;
101 unsigned int _currentFrameIndex;
102
103 bool moveToLeft();
104 bool moveToLeftAt(unsigned int p_frame);
105 bool moveToLeftMost();
106 };
107#endif // GTKMM_KAGE_MANAGER_FRAME_H
forward declaration
Definition: frame.h:31
extension
is Frame extended or not. If extended which part? start/mid/end?
Definition: frame.h:34
Definition: frame_padding.h:28
Definition: frameset.h:31
bool doFlipVerticalSelectedShapeOn(unsigned int p_frameIndex, vector< unsigned int > p_selectedShapes)
Definition: frameset.cpp:668
bool moveToLeftMost()
Moves Current Frame to Left on indicated Frame.
Definition: frameset.cpp:327
KageFramesetManager * fsm
Definition: frameset.h:99
unsigned int _currentFrameIndex
Definition: frameset.h:101
VectorDataManager getFrameDataAt(unsigned int p_frame)
Definition: frameset.cpp:912
bool selectAll(bool p_selectAll)
Definition: frameset.cpp:425
KageFramesetManager * getFsm()
Definition: frameset.cpp:432
VectorDataManager getFrameData()
Definition: frameset.cpp:896
void setSelected(KageFrame *p_frame)
Definition: frameset.cpp:510
unsigned int getFrameNumberByID(unsigned int p_frameID)
Definition: frameset.cpp:495
vector< unsigned int > lowerSelectedShape(vector< unsigned int > p_selectedShapes)
Definition: frameset.cpp:545
bool setPreviousFrameTween(unsigned int p_frameID, unsigned int p_tween)
Called by KageFrame if KageFrame is Extended.
Definition: frameset.cpp:955
bool switchToPreviousFrame()
Definition: frameset.cpp:1042
unsigned int layerID
Definition: frameset.h:93
unsigned int getCurrentFrame()
Definition: frameset.cpp:468
bool addDataToPreviousFrame(VectorDataManager v, unsigned int p_frameID)
Called by KageFrame if KageFrame is Extended.
Definition: frameset.cpp:944
vector< unsigned int > lowerToBottomSelectedShape(vector< unsigned int > p_selectedShapes)
Definition: frameset.cpp:575
KageFramePadding frame_padding
Definition: frameset.h:97
bool setTween(unsigned int p_tween)
Definition: frameset.cpp:1005
vector< unsigned int > ungroupSelectedShapes(vector< unsigned int > p_selectedShapes)
Definition: frameset.cpp:606
void duplicateFrame()
Definition: frameset.cpp:104
VectorDataManager getPreviousFrameData(unsigned int p_frameID)
NOTE: "Frame" – NOT "frame ID".
Definition: frameset.cpp:922
vector< unsigned int > raiseSelectedShape(vector< unsigned int > p_selectedShapes)
Definition: frameset.cpp:530
bool removeFrame()
Definition: frameset.cpp:168
bool addFrame()
Definition: frameset.cpp:48
bool switchToNextFrame()
Called by KageFrame for navigating to Previous Frame.
Definition: frameset.cpp:1068
vector< unsigned int > groupSelectedShapes(vector< unsigned int > p_selectedShapes)
Definition: frameset.cpp:591
void focusFrame(unsigned int p_frame)
Definition: frameset.cpp:480
void setCurrentFrameByID(unsigned int p_frameID)
bool setExtendedFrameTween(unsigned int p_frameID, unsigned int p_tween)
Definition: frameset.cpp:966
KageFrame * getFrameAt(unsigned int p_frame)
Definition: frameset.cpp:487
virtual ~KageFrameset()
Definition: frameset.cpp:44
bool flipVerticalSelectedShape(vector< unsigned int > p_selectedShapes)
Definition: frameset.cpp:653
VectorDataManager getFrameTweenData(unsigned int p_frameIndex)
Definition: frameset.cpp:740
bool moveToLeftAt(unsigned int p_frame)
Moves Current Frame to Left.
Definition: frameset.cpp:307
vector< unsigned int > raiseToTopSelectedShape(vector< unsigned int > p_selectedShapes)
Definition: frameset.cpp:560
bool setFrameDataToPreviousFrame(VectorDataManager p_vectorsData, unsigned int p_frameID)
Called by KageFrame if KageFrame is Extended.
Definition: frameset.cpp:933
void extendFrame()
Definition: frameset.cpp:348
void setFrameExtension(KageFrame::extension p_extension)
Called by KageFramesetManager when duplicating Frame.
Definition: frameset.cpp:1121
std::vector< KageFrame * > _frames
Definition: frameset.h:96
unsigned int _currentFrameID
Definition: frameset.h:100
bool moveToLeft()
Definition: frameset.cpp:283
unsigned int getFrameCount()
Definition: frameset.cpp:421
unsigned int frameCtr
Definition: frameset.h:95
void removeAllFrames()
Definition: frameset.cpp:409
bool flipHorizontalSelectedShape(vector< unsigned int > p_selectedShapes)
Definition: frameset.cpp:638
unsigned int getID()
Definition: frameset.cpp:417
unsigned int getTween()
Definition: frameset.cpp:1023
bool addDataToFrame(VectorDataManager p_vectorsData)
Definition: frameset.cpp:704
bool canReUseNextFrame()
Called by KageFrame when rendering.
Definition: frameset.cpp:1103
bool doFlipVerticalSelectedShapeOnExtendedFrame(unsigned int p_frameIndex, vector< unsigned int > p_selectedShapes)
Definition: frameset.cpp:676
vector< unsigned int > duplicateShapes(vector< unsigned int > p_selectedShapes)
Definition: frameset.cpp:622
bool forceSetTween(unsigned int p_tween)
Definition: frameset.cpp:986
bool isCurrentFrame(unsigned int p_frameID)
Called by KageFrame for navigating to Next Frame.
Definition: frameset.cpp:1094
bool recenterRotationPoint(vector< unsigned int > p_selectedShapes)
Definition: frameset.cpp:688
void setCurrentFrame(unsigned int p_frame)
Definition: frameset.cpp:441
bool setFrameData(VectorDataManager p_vectorsData)
Definition: frameset.cpp:722
Definition: framesmanager.h:32
Definition: vectordatamanager.h:37