Kage Studio 0.7.230612
A Simple Free and Open Source 2D Animation Software
Loading...
Searching...
No Matches
library.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) 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
22#ifndef GTKMM_KAGE_LIBRARY_H
23 #define GTKMM_KAGE_LIBRARY_H
24
25 #include <gtkmm/drawingarea.h>
26 #include <time.h>
27 #include "../vectordatamanager.h"
28
29 class Kage;
30
31 class KageLibrary : public Gtk::DrawingArea {
32 protected:
34 public:
36 enum extension {
38 };
39
40 static bool DEBUG_ON;
41 static bool mouseIsDown;
42
43 static Glib::RefPtr<Gdk::Pixbuf> imageNULL;
44
45 Glib::RefPtr<Gdk::Window> window;
46
47 KageLibrary(Kage* p_kage);
48 virtual ~KageLibrary();
49
50 bool isEmpty();
51 int data; //what's this for?
52 void setSelected(bool p_selected);
53 bool isSelected();
55 void setFrameData(VectorDataManager p_vectorsData);
56 void setCode(bool p_newCode);
57 bool getCode();
58 void setFocus();
59
60 void setExtension(KageLibrary::extension p_extension);
62
63 void forceRender();
64 virtual bool invalidateToRender();
65
66 static bool _gotFocus;
67
68 vector<unsigned int> raiseSelectedShape(vector<unsigned int> p_selectedShapes);
69
70 bool recenterRotationPoint(vector<unsigned int> p_selectedShapes);
71
73
74 void render(unsigned int p_assetID);
75
76 void resetAssetID();
77 protected:
78 //Override default signal handler:
79 virtual bool on_expose_event(GdkEventExpose *e);
80 virtual bool on_key_press_event(GdkEventKey *e) override;
81 virtual bool on_event(GdkEvent *e) override;
82
83 bool on_draw(const Cairo::RefPtr<Cairo::Context>& cr) override;
84
85 Glib::ustring sCode;
86 bool _null;
87 unsigned int _tweenX;
88 unsigned int _tweenY;
91
93
94 unsigned int _renderAssetID;
95 };
96#endif // GTKMM_KAGE_LIBRARY_H
Definition: kage.h:69
forward declaration
Definition: library.h:31
void setFocus()
Definition: library.cpp:252
void addDataToFrame(VectorDataManager v)
Definition: library.cpp:260
void setSelected(bool p_selected)
Definition: library.cpp:218
unsigned int _tweenX
Definition: library.h:87
unsigned int _renderAssetID
Definition: library.h:94
virtual bool on_key_press_event(GdkEventKey *e) override
Definition: library.cpp:58
static bool DEBUG_ON
Definition: library.h:40
bool _null
Definition: library.h:86
void setCode(bool p_newCode)
bool isEmpty()
Definition: library.cpp:248
bool _selected
Definition: library.h:89
KageLibrary::extension getExtension()
Definition: library.cpp:230
unsigned int _tweenY
Definition: library.h:88
bool _current
Definition: library.h:90
virtual bool on_expose_event(GdkEventExpose *e)
Definition: library.cpp:64
void render(unsigned int p_assetID)
Definition: library.cpp:212
Kage * _kage
Definition: library.h:33
static Glib::RefPtr< Gdk::Pixbuf > imageNULL
Definition: library.h:43
extension
is Frame extended or not. If extended which part? start/mid/end?
Definition: library.h:36
@ EXTENSION_NOT
Definition: library.h:37
bool recenterRotationPoint(vector< unsigned int > p_selectedShapes)
int data
Definition: library.h:51
bool getCode()
virtual bool on_event(GdkEvent *e) override
Definition: library.cpp:75
VectorDataManager getFrameData()
Definition: library.cpp:235
virtual ~KageLibrary()
Definition: library.cpp:54
void resetAssetID()
Definition: library.cpp:263
vector< unsigned int > raiseSelectedShape(vector< unsigned int > p_selectedShapes)
Definition: library.cpp:256
static bool _gotFocus
Definition: library.h:66
virtual bool invalidateToRender()
Definition: library.cpp:120
VectorDataManager vectorsData
Definition: library.h:92
Glib::RefPtr< Gdk::Window > window
Definition: library.h:45
static bool mouseIsDown
Definition: library.h:41
bool on_draw(const Cairo::RefPtr< Cairo::Context > &cr) override
Definition: library.cpp:138
void setFrameData(VectorDataManager p_vectorsData)
Definition: library.cpp:244
void forceRender()
Definition: library.cpp:113
bool isSelected()
Definition: library.cpp:222
Glib::ustring sCode
Definition: library.h:85
void setExtension(KageLibrary::extension p_extension)
Definition: library.cpp:226
Definition: vectordatamanager.h:37