Kage Studio 0.7.240121
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-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
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:
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 setFocus();
57
58 void setExtension(KageLibrary::extension p_extension);
60
61 void forceRender();
62 virtual bool invalidateToRender();
63
64 static bool _gotFocus;
65
66 std::vector<unsigned int> raiseSelectedShape(std::vector<unsigned int> p_selectedShapes);
67
68 bool recenterRotationPoint(std::vector<unsigned int> p_selectedShapes);
69
71
72 void render(unsigned int p_assetID);
73
74 void resetAssetID();
75
76 unsigned int _renderAssetID;
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#endif // GTKMM_KAGE_LIBRARY_H
Definition kage.h:74
void setFocus()
Definition library.cpp:259
void addDataToFrame(VectorDataManager v)
Definition library.cpp:267
void setSelected(bool p_selected)
Definition library.cpp:225
unsigned int _tweenX
Definition library.h:87
unsigned int _renderAssetID
Definition library.h:76
bool recenterRotationPoint(std::vector< unsigned int > p_selectedShapes)
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
bool isEmpty()
Definition library.cpp:255
bool _selected
Definition library.h:89
KageLibrary::extension getExtension()
Definition library.cpp:237
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:219
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
int data
Definition library.h:51
virtual bool on_event(GdkEvent *e) override
Definition library.cpp:75
VectorDataManager getFrameData()
Definition library.cpp:242
KageLibrary(Kage *p_kage)
Definition library.cpp:37
virtual ~KageLibrary()
Definition library.cpp:54
void resetAssetID()
Definition library.cpp:270
static bool _gotFocus
Definition library.h:64
virtual bool invalidateToRender()
Definition library.cpp:122
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:140
void setFrameData(VectorDataManager p_vectorsData)
Definition library.cpp:251
void forceRender()
Definition library.cpp:116
bool isSelected()
Definition library.cpp:229
std::vector< unsigned int > raiseSelectedShape(std::vector< unsigned int > p_selectedShapes)
Definition library.cpp:263
Glib::ustring sCode
Definition library.h:85
void setExtension(KageLibrary::extension p_extension)
Definition library.cpp:233
Definition vectordatamanager.h:35