Kage Studio 0.7.230612
A Simple Free and Open Source 2D Animation Software
Loading...
Searching...
No Matches
timeline.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_TIMELINE_H
23 #define GTKMM_KAGE_TIMELINE_H
24
25 #include <gtkmm/drawingarea.h>
26 #include <time.h>
27 #include "../vectordatamanager.h"
28 #include "../data/point.h"
29
30 class Kage;
31
32 class KageTimeline : public Gtk::DrawingArea {
33 public:
34 static bool mouseIsDown;
35
36 static Glib::RefPtr<Gdk::Pixbuf> imageNULL;
37 static Glib::RefPtr<Gdk::Pixbuf> imageNULL_CUR;
38 static Glib::RefPtr<Gdk::Pixbuf> imageNULL_X;
39 static Glib::RefPtr<Gdk::Pixbuf> imageNULL_X_CUR;
40 static Glib::RefPtr<Gdk::Pixbuf> imageBLANK;
41 static Glib::RefPtr<Gdk::Pixbuf> imageBLANK_CUR;
42 static Glib::RefPtr<Gdk::Pixbuf> imageBLANK_CUR_SEL;
43 static Glib::RefPtr<Gdk::Pixbuf> imageBLANK_CUR_TWN;
44 static Glib::RefPtr<Gdk::Pixbuf> imageBLANK_CUR_SEL_TWN;
45 static Glib::RefPtr<Gdk::Pixbuf> imageBLANK_SEL;
46 static Glib::RefPtr<Gdk::Pixbuf> imageBLANK_SEL_TWN;
47 static Glib::RefPtr<Gdk::Pixbuf> imageBLANK_TWN;
48 static Glib::RefPtr<Gdk::Pixbuf> imageBLANK_X;
49 static Glib::RefPtr<Gdk::Pixbuf> imageBLANK_X_CUR;
50 static Glib::RefPtr<Gdk::Pixbuf> imageBLANK_X_CUR_SEL;
51 static Glib::RefPtr<Gdk::Pixbuf> imageBLANK_X_CUR_TWN;
52 static Glib::RefPtr<Gdk::Pixbuf> imageBLANK_X_CUR_SEL_TWN;
53 static Glib::RefPtr<Gdk::Pixbuf> imageBLANK_X_SEL;
54 static Glib::RefPtr<Gdk::Pixbuf> imageBLANK_X_SEL_TWN;
55 static Glib::RefPtr<Gdk::Pixbuf> imageBLANK_X_TWN;
56 static Glib::RefPtr<Gdk::Pixbuf> imageDRAWN;
57 static Glib::RefPtr<Gdk::Pixbuf> imageDRAWN_CUR;
58 static Glib::RefPtr<Gdk::Pixbuf> imageDRAWN_CUR_SEL;
59 static Glib::RefPtr<Gdk::Pixbuf> imageDRAWN_CUR_TWN;
60 static Glib::RefPtr<Gdk::Pixbuf> imageDRAWN_CUR_SEL_TWN;
61 static Glib::RefPtr<Gdk::Pixbuf> imageDRAWN_SEL;
62 static Glib::RefPtr<Gdk::Pixbuf> imageDRAWN_SEL_TWN;
63 static Glib::RefPtr<Gdk::Pixbuf> imageDRAWN_TWN;
64 static Glib::RefPtr<Gdk::Pixbuf> imageDRAWN_X;
65 static Glib::RefPtr<Gdk::Pixbuf> imageDRAWN_X_CUR;
66 static Glib::RefPtr<Gdk::Pixbuf> imageDRAWN_X_CUR_SEL;
67 static Glib::RefPtr<Gdk::Pixbuf> imageDRAWN_X_CUR_TWN;
68 static Glib::RefPtr<Gdk::Pixbuf> imageDRAWN_X_CUR_SEL_TWN;
69 static Glib::RefPtr<Gdk::Pixbuf> imageDRAWN_X_SEL;
70 static Glib::RefPtr<Gdk::Pixbuf> imageDRAWN_X_SEL_TWN;
71 static Glib::RefPtr<Gdk::Pixbuf> imageDRAWN_X_TWN;
72 protected:
74 public:
75 static bool DEBUG_ON;
76
77 Glib::RefPtr<Gdk::Window> window;
78
79 KageTimeline(Kage* p_kage);
80 virtual ~KageTimeline();
81
82 void setSelected(bool p_selected);
83 bool isSelected();
85 void setFrameData(VectorDataManager p_vectorsData);
86 void setFocus();
87
88 void forceRender();
89 virtual bool invalidateToRender();
90
91 static bool _gotFocus;
92
93 vector<unsigned int> raiseSelectedShape(vector<unsigned int> p_selectedShapes);
94
96 protected:
97 //Override default signal handler:
98 virtual bool on_expose_event(GdkEventExpose *e);
99 virtual bool on_key_press_event(GdkEventKey *e) override;
100 virtual bool on_event(GdkEvent *e) override;
101
102 bool on_draw(const Cairo::RefPtr<Cairo::Context>& cr) override;
103
104 bool _null;
105 unsigned int _tweenX;
106 unsigned int _tweenY;
109
111
114 };
115#endif // GTKMM_KAGE_LIBRARY_H
Definition: kage.h:69
forward declaration
Definition: timeline.h:32
unsigned int _tweenY
Definition: timeline.h:106
static Glib::RefPtr< Gdk::Pixbuf > imageDRAWN_X_TWN
Definition: timeline.h:71
static Glib::RefPtr< Gdk::Pixbuf > imageBLANK_X_SEL_TWN
Definition: timeline.h:54
VectorDataManager getFrameData()
Definition: timeline.cpp:493
virtual bool on_key_press_event(GdkEventKey *e) override
Definition: timeline.cpp:93
PointData draw2
Definition: timeline.h:113
void addDataToFrame(VectorDataManager v)
Definition: timeline.cpp:514
virtual bool invalidateToRender()
Definition: timeline.cpp:185
static Glib::RefPtr< Gdk::Pixbuf > imageDRAWN_CUR_SEL
Definition: timeline.h:58
static Glib::RefPtr< Gdk::Pixbuf > imageDRAWN_CUR_SEL_TWN
Definition: timeline.h:60
static Glib::RefPtr< Gdk::Pixbuf > imageBLANK_X_TWN
Definition: timeline.h:55
static Glib::RefPtr< Gdk::Pixbuf > imageNULL_X
Definition: timeline.h:38
static Glib::RefPtr< Gdk::Pixbuf > imageDRAWN_X_CUR_SEL_TWN
Definition: timeline.h:68
void forceRender()
Definition: timeline.cpp:178
static Glib::RefPtr< Gdk::Pixbuf > imageBLANK_CUR_TWN
Definition: timeline.h:43
static Glib::RefPtr< Gdk::Pixbuf > imageBLANK_X_SEL
Definition: timeline.h:53
static Glib::RefPtr< Gdk::Pixbuf > imageDRAWN_X
Definition: timeline.h:64
static Glib::RefPtr< Gdk::Pixbuf > imageDRAWN_CUR
Definition: timeline.h:57
static Glib::RefPtr< Gdk::Pixbuf > imageBLANK_CUR
Definition: timeline.h:41
static Glib::RefPtr< Gdk::Pixbuf > imageDRAWN_X_CUR_SEL
Definition: timeline.h:66
static Glib::RefPtr< Gdk::Pixbuf > imageDRAWN_X_SEL
Definition: timeline.h:69
static Glib::RefPtr< Gdk::Pixbuf > imageBLANK_SEL_TWN
Definition: timeline.h:46
PointData draw1
Definition: timeline.h:112
static bool mouseIsDown
Definition: timeline.h:34
static Glib::RefPtr< Gdk::Pixbuf > imageBLANK_X_CUR_SEL
Definition: timeline.h:50
static Glib::RefPtr< Gdk::Pixbuf > imageNULL
Definition: timeline.h:36
static Glib::RefPtr< Gdk::Pixbuf > imageDRAWN_TWN
Definition: timeline.h:63
static Glib::RefPtr< Gdk::Pixbuf > imageBLANK_TWN
Definition: timeline.h:47
void setFrameData(VectorDataManager p_vectorsData)
Definition: timeline.cpp:502
bool on_draw(const Cairo::RefPtr< Cairo::Context > &cr) override
Definition: timeline.cpp:203
unsigned int _tweenX
Definition: timeline.h:105
virtual ~KageTimeline()
Definition: timeline.cpp:88
static Glib::RefPtr< Gdk::Pixbuf > imageBLANK
Definition: timeline.h:40
Glib::RefPtr< Gdk::Window > window
Definition: timeline.h:77
bool isSelected()
Definition: timeline.cpp:489
static Glib::RefPtr< Gdk::Pixbuf > imageBLANK_X
Definition: timeline.h:48
static Glib::RefPtr< Gdk::Pixbuf > imageDRAWN_X_CUR_TWN
Definition: timeline.h:67
bool _selected
Definition: timeline.h:107
static Glib::RefPtr< Gdk::Pixbuf > imageBLANK_X_CUR_TWN
Definition: timeline.h:51
VectorDataManager vectorsData
Definition: timeline.h:110
void setSelected(bool p_selected)
Definition: timeline.cpp:485
vector< unsigned int > raiseSelectedShape(vector< unsigned int > p_selectedShapes)
Definition: timeline.cpp:510
static Glib::RefPtr< Gdk::Pixbuf > imageNULL_CUR
Definition: timeline.h:37
void setFocus()
Definition: timeline.cpp:506
static Glib::RefPtr< Gdk::Pixbuf > imageBLANK_X_CUR_SEL_TWN
Definition: timeline.h:52
static Glib::RefPtr< Gdk::Pixbuf > imageBLANK_SEL
Definition: timeline.h:45
static Glib::RefPtr< Gdk::Pixbuf > imageBLANK_CUR_SEL_TWN
Definition: timeline.h:44
Kage * _kage
Definition: timeline.h:73
bool _current
Definition: timeline.h:108
static Glib::RefPtr< Gdk::Pixbuf > imageDRAWN
Definition: timeline.h:56
static Glib::RefPtr< Gdk::Pixbuf > imageDRAWN_SEL
Definition: timeline.h:61
static Glib::RefPtr< Gdk::Pixbuf > imageBLANK_X_CUR
Definition: timeline.h:49
static Glib::RefPtr< Gdk::Pixbuf > imageNULL_X_CUR
Definition: timeline.h:39
static Glib::RefPtr< Gdk::Pixbuf > imageBLANK_CUR_SEL
Definition: timeline.h:42
static bool _gotFocus
Definition: timeline.h:91
static Glib::RefPtr< Gdk::Pixbuf > imageDRAWN_SEL_TWN
Definition: timeline.h:62
static bool DEBUG_ON
Definition: timeline.h:75
virtual bool on_event(GdkEvent *e) override
Definition: timeline.cpp:117
static Glib::RefPtr< Gdk::Pixbuf > imageDRAWN_CUR_TWN
Definition: timeline.h:59
virtual bool on_expose_event(GdkEventExpose *e)
Definition: timeline.cpp:106
static Glib::RefPtr< Gdk::Pixbuf > imageDRAWN_X_CUR
Definition: timeline.h:65
static Glib::RefPtr< Gdk::Pixbuf > imageDRAWN_X_SEL_TWN
Definition: timeline.h:70
bool _null
Definition: timeline.h:104
Definition: point.h:27
Definition: vectordatamanager.h:37