Kage Studio 0.7.230612
A Simple Free and Open Source 2D Animation Software
Loading...
Searching...
No Matches
frame.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~2023 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#ifndef GTKMM_KAGE_FRAME_H
22 #define GTKMM_KAGE_FRAME_H
23
24 #include <vector>
25 #include "color.h"
26 #include "../vectordatamanager.h"
27
28 #include "../../util/string/stringhelper.h"
29
30 #include <gdkmm/color.h>
31
32 using namespace std;
33
34 class KageLayer; //forward declaration
35
36 class KageFrame {
37 unsigned int ID;
38 //================================
39 public:
40 enum extension {
45 };
46
47 static bool DEBUG_ON;
48 static bool mouseIsDown;
49
50 //Glib::RefPtr<Gdk::Window> window;
51
52 KageFrame(KageLayer *p_layer, unsigned p_layerID, unsigned int p_frameID);
53 virtual ~KageFrame();
54
55 bool isEmpty();
56 int data; //what's this for?
57 void setSelected(bool p_selected);
58 bool isSelected();
59 void setCurrent(bool p_current);
60 bool isCurrent();
62 void setFrameData(VectorDataManager p_vectorsData);
63 void setCode(bool p_newCode);
64 bool getCode();
65
66 unsigned int layerID; //which layer does it reside?
67 unsigned int frameID; //which frame among frames in a layer?
68 void setNull(bool p_null);
69 bool isNull();
70 void setExtension(KageFrame::extension p_extension);
72 void forceSetTween(unsigned int p_tween);
73 void setTween(unsigned int p_tween);
74 unsigned int getTween();
75
76 //void forceRender();
77
78 static bool _gotFocus;
79
80 vector<unsigned int> raiseSelectedShape(vector<unsigned int> p_selectedShapes);
81 vector<unsigned int> lowerSelectedShape(vector<unsigned int> p_selectedShapes);
82 vector<unsigned int> raiseToTopSelectedShape(vector<unsigned int> p_selectedShapes);
83 vector<unsigned int> lowerToBottomSelectedShape(vector<unsigned int> p_selectedShapes);
84 vector<unsigned int> groupSelectedShapes(vector<unsigned int> p_selectedShapes);
85 vector<unsigned int> ungroupSelectedShapes(vector<unsigned int> p_selectedShapes);
86 vector<unsigned int> duplicateShapes(vector<unsigned int> p_selectedShapes);
87 bool flipHorizontalSelectedShape(vector<unsigned int> p_selectedShapes);
88 bool flipVerticalSelectedShape(vector<unsigned int> p_selectedShapes);
89
90 bool recenterRotationPoint(vector<unsigned int> p_selectedShapes);
91
93 protected:
94 bool _null;
97 unsigned int _tweenX;
98 unsigned int _tweenY;
99
101
104 };
105
106#endif //GTKMM_KAGE_FRAME_H
Definition: frame.h:36
vector< unsigned int > groupSelectedShapes(vector< unsigned int > p_selectedShapes)
Definition: frame.cpp:172
KageLayer * _layer
Definition: frame.h:102
void addDataToFrame(VectorDataManager v)
Definition: frame.cpp:240
vector< unsigned int > lowerSelectedShape(vector< unsigned int > p_selectedShapes)
Definition: frame.cpp:138
VectorDataManager vectorsData
Definition: frame.h:103
bool recenterRotationPoint(vector< unsigned int > p_selectedShapes)
Definition: frame.cpp:229
static bool DEBUG_ON
Definition: frame.h:47
void setNull(bool p_null)
Definition: frame.cpp:56
unsigned int _tweenY
Definition: frame.h:98
bool _current
Definition: frame.h:96
void setTween(unsigned int p_tween)
Definition: frame.cpp:67
extension
Definition: frame.h:40
@ EXTENSION_NOT
Definition: frame.h:41
@ EXTENSION_MID
Definition: frame.h:43
@ EXTENSION_START
Definition: frame.h:42
@ EXTENSION_END
Definition: frame.h:44
void setExtension(KageFrame::extension p_extension)
Definition: frame.cpp:49
bool isEmpty()
Definition: frame.cpp:118
void setCode(bool p_newCode)
vector< unsigned int > raiseToTopSelectedShape(vector< unsigned int > p_selectedShapes)
Definition: frame.cpp:149
vector< unsigned int > raiseSelectedShape(vector< unsigned int > p_selectedShapes)
Definition: frame.cpp:127
vector< unsigned int > duplicateShapes(vector< unsigned int > p_selectedShapes)
Definition: frame.cpp:195
KageFrame::extension getExtension()
Definition: frame.cpp:52
vector< unsigned int > lowerToBottomSelectedShape(vector< unsigned int > p_selectedShapes)
Definition: frame.cpp:160
virtual ~KageFrame()
Definition: frame.cpp:38
vector< unsigned int > ungroupSelectedShapes(vector< unsigned int > p_selectedShapes)
Definition: frame.cpp:183
bool isNull()
Definition: frame.cpp:59
bool _selected
Definition: frame.h:95
void setCurrent(bool p_current)
Definition: frame.cpp:86
bool flipVerticalSelectedShape(vector< unsigned int > p_selectedShapes)
Definition: frame.cpp:218
unsigned int getTween()
Definition: frame.cpp:81
bool flipHorizontalSelectedShape(vector< unsigned int > p_selectedShapes)
Definition: frame.cpp:207
void setSelected(bool p_selected)
Definition: frame.cpp:42
void setFrameData(VectorDataManager p_vectorsData)
Definition: frame.cpp:106
static bool mouseIsDown
Definition: frame.h:48
int data
Definition: frame.h:56
unsigned int layerID
Definition: frame.h:66
unsigned int frameID
Definition: frame.h:67
KageFrame::extension _extension
Definition: frame.h:100
static bool _gotFocus
Definition: frame.h:78
bool _null
Definition: frame.h:94
bool getCode()
unsigned int _tweenX
Definition: frame.h:97
bool isSelected()
Definition: frame.cpp:45
VectorDataManager getFrameData()
Definition: frame.cpp:93
void forceSetTween(unsigned int p_tween)
Definition: frame.cpp:62
bool isCurrent()
Definition: frame.cpp:89
Definition: layer.h:39
Definition: vectordatamanager.h:37