Kage Studio 0.7.240121
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~2024 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
29
30 #include <gdkmm/color.h>
31
32 class KageLayer; //forward declaration
33
34 class KageFrame {
35 public:
42
43 static bool DEBUG_ON;
44 static bool mouseIsDown;
45
46 //Glib::RefPtr<Gdk::Window> window;
47
48 KageFrame(KageLayer *p_layer, unsigned int p_frameID);
49 KageFrame operator=(const KageFrame &p_frame);
50 virtual ~KageFrame();
51
52 bool isEmpty();
53 int data; //what's this for?
54 void setSelected(bool p_selected);
55 bool isSelected();
56 void setCurrent(bool p_current);
57 bool isCurrent();
59 void setFrameData(VectorDataManager p_vectorsData);
60 void setCode(bool p_newCode);
61 bool getCode();
62
63 unsigned int frameID; //which frame among frames in a layer?
64 void setNull(bool p_null);
65 bool isNull();
66 void setExtension(KageFrame::extension p_extension);
68 void forceSetTween(unsigned int p_tween);
69 void setTween(unsigned int p_tween);
70 unsigned int getTween();
71
72 //void forceRender();
73
74 static bool _gotFocus;
75
76 std::vector<unsigned int> raiseSelectedShape(std::vector<unsigned int> p_selectedShapes);
77 std::vector<unsigned int> lowerSelectedShape(std::vector<unsigned int> p_selectedShapes);
78 std::vector<unsigned int> raiseToTopSelectedShape(std::vector<unsigned int> p_selectedShapes);
79 std::vector<unsigned int> lowerToBottomSelectedShape(std::vector<unsigned int> p_selectedShapes);
80 std::vector<unsigned int> groupSelectedShapes(std::vector<unsigned int> p_selectedShapes);
81 std::vector<unsigned int> ungroupSelectedShapes(std::vector<unsigned int> p_selectedShapes);
82 std::vector<unsigned int> duplicateShapes(std::vector<unsigned int> p_selectedShapes);
83 bool flipHorizontalSelectedShape(std::vector<unsigned int> p_selectedShapes);
84 bool flipVerticalSelectedShape(std::vector<unsigned int> p_selectedShapes);
85
86 bool recenterRotationPoint(std::vector<unsigned int> p_selectedShapes);
87
89 std::vector<VectorData> copySelectedShapes(std::vector<unsigned int> p_selectedShapes);
90 std::vector<unsigned int> pasteSelectedShapes(std::vector<VectorData> p_copiedShapes);
91 bool deleteSelectedShapes(std::vector<unsigned int> p_selectedShapes);
92
93 bool _null;
96 unsigned int _tweenX;
97 unsigned int _tweenY;
98
100
103
104 static unsigned int _mouseLocationShapeIndex;
105 };
106
107#endif //GTKMM_KAGE_FRAME_H
KageFrame(KageLayer *p_layer, unsigned int p_frameID)
Definition frame.cpp:26
std::vector< unsigned int > lowerToBottomSelectedShape(std::vector< unsigned int > p_selectedShapes)
Definition frame.cpp:194
KageLayer * _layer
Definition frame.h:101
KageFrame operator=(const KageFrame &p_frame)
Definition frame.cpp:37
bool recenterRotationPoint(std::vector< unsigned int > p_selectedShapes)
Definition frame.cpp:263
void addDataToFrame(VectorDataManager v)
Definition frame.cpp:274
VectorDataManager vectorsData
Definition frame.h:102
std::vector< unsigned int > groupSelectedShapes(std::vector< unsigned int > p_selectedShapes)
Definition frame.cpp:206
static bool DEBUG_ON
Definition frame.h:43
void setNull(bool p_null)
Definition frame.cpp:90
std::vector< unsigned int > pasteSelectedShapes(std::vector< VectorData > p_copiedShapes)
Definition frame.cpp:296
unsigned int _tweenY
Definition frame.h:97
std::vector< unsigned int > raiseToTopSelectedShape(std::vector< unsigned int > p_selectedShapes)
Definition frame.cpp:183
std::vector< unsigned int > duplicateShapes(std::vector< unsigned int > p_selectedShapes)
Definition frame.cpp:229
bool _current
Definition frame.h:95
static unsigned int _mouseLocationShapeIndex
Definition frame.h:104
void setTween(unsigned int p_tween)
Definition frame.cpp:101
extension
Definition frame.h:36
@ EXTENSION_NOT
Definition frame.h:37
@ EXTENSION_MID
Definition frame.h:39
@ EXTENSION_START
Definition frame.h:38
@ EXTENSION_END
Definition frame.h:40
void setExtension(KageFrame::extension p_extension)
Definition frame.cpp:83
std::vector< unsigned int > lowerSelectedShape(std::vector< unsigned int > p_selectedShapes)
Definition frame.cpp:172
bool isEmpty()
Definition frame.cpp:152
void setCode(bool p_newCode)
std::vector< VectorData > copySelectedShapes(std::vector< unsigned int > p_selectedShapes)
Definition frame.cpp:286
KageFrame::extension getExtension()
Definition frame.cpp:86
bool deleteSelectedShapes(std::vector< unsigned int > p_selectedShapes)
Definition frame.cpp:306
virtual ~KageFrame()
Definition frame.cpp:71
bool isNull()
Definition frame.cpp:93
bool _selected
Definition frame.h:94
std::vector< unsigned int > raiseSelectedShape(std::vector< unsigned int > p_selectedShapes)
Definition frame.cpp:161
void setCurrent(bool p_current)
Definition frame.cpp:120
unsigned int getTween()
Definition frame.cpp:115
void setSelected(bool p_selected)
Definition frame.cpp:76
void setFrameData(VectorDataManager p_vectorsData)
Definition frame.cpp:140
static bool mouseIsDown
Definition frame.h:44
int data
Definition frame.h:53
unsigned int frameID
Definition frame.h:63
KageFrame::extension _extension
Definition frame.h:99
static bool _gotFocus
Definition frame.h:74
bool _null
Definition frame.h:93
bool flipVerticalSelectedShape(std::vector< unsigned int > p_selectedShapes)
Definition frame.cpp:252
std::vector< unsigned int > ungroupSelectedShapes(std::vector< unsigned int > p_selectedShapes)
Definition frame.cpp:217
bool getCode()
bool flipHorizontalSelectedShape(std::vector< unsigned int > p_selectedShapes)
Definition frame.cpp:241
unsigned int _tweenX
Definition frame.h:96
bool isSelected()
Definition frame.cpp:79
VectorDataManager getFrameData()
Definition frame.cpp:127
void forceSetTween(unsigned int p_tween)
Definition frame.cpp:96
bool isCurrent()
Definition frame.cpp:123
Definition layer.h:37
Definition vectordatamanager.h:35