Kage Studio 0.7.230612
A Simple Free and Open Source 2D Animation Software
Loading...
Searching...
No Matches
layer.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~2022 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_LAYER_UI_H
23 #define GTKMM_KAGE_LAYER_UI_H
24
25 #include <gtkmm/drawingarea.h>
26 #include <gtkmm/entry.h>
27 #include <time.h>
28 #include "../../util/string/stringhelper.h"
29
30 class KageLayerManager;
31
32 class KageLayerUI : public Gtk::DrawingArea {
33 public:
34 static bool mouseIsDown;
35 static Glib::RefPtr<Gdk::Pixbuf> imageVISIBLE_TRUE;
36 static Glib::RefPtr<Gdk::Pixbuf> imageVISIBLE_FALSE;
37 static Glib::RefPtr<Gdk::Pixbuf> imageLOCKED_TRUE;
38 static Glib::RefPtr<Gdk::Pixbuf> imageLOCKED_FALSE;
39
40 Glib::RefPtr<Gdk::Window> window;
41
42 KageLayerUI(KageLayerManager *p_layerManager, unsigned p_layerID);
43 virtual ~KageLayerUI();
44
45 void setLabel(string p_label);
46 string getLabel();
47 void setSelected(bool p_selected);
48 bool isSelected();
49 void setFocus();
50 bool isVisible();
51 bool isLocked();
52 void toggleVisibility();
53 void toggleLock();
54
55 void setVisible(bool p_visible);
56 void setLock(bool p_lock);
57
58 unsigned int layerID;
59
60 void forceRender();
61 virtual bool invalidateToRender();
62 Gtk::Entry _txtLabel;
63 void txtLabel_onEnter();
64
65 void addEventsListener();
66 protected:
67 //Override default signal handler:
68 virtual bool on_expose_event(GdkEventExpose *e);
69 virtual bool on_key_press_event(GdkEventKey *e) override;
70 virtual bool on_event(GdkEvent *e) override;
71
72 bool on_draw(const Cairo::RefPtr<Cairo::Context>& cr) override;
73
76 bool _lock;
77 string _label;
78
80 };
81#endif // GTKMM_KAGE_LAYER_UI_H
Definition: layermanager.h:33
forward declaration
Definition: layer.h:32
void addEventsListener()
Definition: layer.cpp:64
bool _lock
Definition: layer.h:76
void toggleVisibility()
Definition: layer.cpp:261
bool isVisible()
Definition: layer.cpp:249
KageLayerManager * _layerManager
Definition: layer.h:79
virtual bool on_event(GdkEvent *e) override
Definition: layer.cpp:98
string _label
Definition: layer.h:77
bool on_draw(const Cairo::RefPtr< Cairo::Context > &cr) override
Definition: layer.cpp:175
void setSelected(bool p_selected)
Definition: layer.cpp:241
static Glib::RefPtr< Gdk::Pixbuf > imageLOCKED_FALSE
Definition: layer.h:38
bool _selected
Definition: layer.h:74
virtual ~KageLayerUI()
Definition: layer.cpp:60
static Glib::RefPtr< Gdk::Pixbuf > imageVISIBLE_FALSE
Definition: layer.h:36
void setVisible(bool p_visible)
Definition: layer.cpp:279
void toggleLock()
Definition: layer.cpp:270
static Glib::RefPtr< Gdk::Pixbuf > imageLOCKED_TRUE
Definition: layer.h:37
void txtLabel_onEnter()
Definition: layer.cpp:73
void setLabel(string p_label)
Definition: layer.cpp:234
string getLabel()
Definition: layer.cpp:238
void setLock(bool p_lock)
Definition: layer.cpp:284
virtual bool on_expose_event(GdkEventExpose *e)
Definition: layer.cpp:87
static Glib::RefPtr< Gdk::Pixbuf > imageVISIBLE_TRUE
Definition: layer.h:35
bool isSelected()
Definition: layer.cpp:245
void forceRender()
Definition: layer.cpp:144
Glib::RefPtr< Gdk::Window > window
Definition: layer.h:40
virtual bool invalidateToRender()
Definition: layer.cpp:152
bool _visible
Definition: layer.h:75
Gtk::Entry _txtLabel
Definition: layer.h:62
void setFocus()
Definition: layer.cpp:257
unsigned int layerID
Definition: layer.h:58
bool isLocked()
Definition: layer.cpp:253
static bool mouseIsDown
Definition: layer.h:34
virtual bool on_key_press_event(GdkEventKey *e) override
Definition: layer.cpp:78