Kage Studio 0.7.230612
A Simple Free and Open Source 2D Animation Software
Loading...
Searching...
No Matches
layermanager.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_MANAGER_LAYER_H
23 #define GTKMM_KAGE_MANAGER_LAYER_H
24
25 #include <gtkmm/box.h>
26 #include <gtkmm/label.h>
27 #include <gtkmm/button.h>
28 #include "layer.h"
29 #include "../../layer_rename.h"
30
31 class Kage;
32
33 class KageLayerManager : public Gtk::VBox {
34 public:
35 KageLayerManager(Kage *p_kage);
36 virtual ~KageLayerManager();
37 unsigned int layerCount();
38 unsigned int addLayer(Glib::ustring p_name = "");
39 void deleteLayer();
40 bool removeAllLayers();
41 void setSelected(KageLayerUI *p_layer);
43 unsigned int getCurrentLayer();
44 void setCurrentLayer(unsigned int p_layer);
45 void setCurrentLayerByID(unsigned int p_layerID);
46 void renderStage();
47
48 void toggleLock();
49 bool isLayerLocked();
50 void setLock(bool p_lock);
51
52 void toggleVisibility();
53 bool isLayerVisible();
54 void setVisible(bool p_visible);
55
56 void renameLayer(KageLayerUI *p_layer);
57 void renameLayer();
58 void setLabel(string p_label);
59 string getLabel();
60
61 bool moveToTop();
62 bool moveUp();
63 bool moveDown();
64 bool moveToBottom();
65
66 protected:
68 unsigned int layerCtr;
69 std::vector<Gtk::Button*> labels;
70 std::vector<KageLayerUI*> layers;
71 unsigned int _currentLayerID;
72 unsigned int _currentLayerIndex;
73 };
74#endif // GTKMM_KAGE_MANAGER_LAYER_H
Definition: kage.h:69
Definition: layermanager.h:33
void setLock(bool p_lock)
Definition: layermanager.cpp:370
string getLabel()
Definition: layermanager.cpp:314
unsigned int layerCtr
Definition: layermanager.h:68
std::vector< KageLayerUI * > layers
Definition: layermanager.h:70
Kage * _kage
Definition: layermanager.h:67
unsigned int getCurrentLayer()
Definition: layermanager.cpp:173
unsigned int addLayer(Glib::ustring p_name="")
Definition: layermanager.cpp:34
void renameLayer()
Definition: layermanager.cpp:280
void setLabel(string p_label)
Definition: layermanager.cpp:300
void setSelected(KageLayerUI *p_layer)
Definition: layermanager.cpp:105
void toggleLock()
Definition: layermanager.cpp:341
bool moveDown()
Definition: layermanager.cpp:444
void setVisible(bool p_visible)
Definition: layermanager.cpp:356
unsigned int _currentLayerID
Definition: layermanager.h:71
bool moveUp()
Definition: layermanager.cpp:415
void setCurrentLayer(unsigned int p_layer)
Definition: layermanager.cpp:191
unsigned int layerCount()
Definition: layermanager.cpp:262
bool isLayerVisible()
Definition: layermanager.cpp:141
void setCurrentLayerByID(unsigned int p_layerID)
Definition: layermanager.cpp:220
bool moveToBottom()
Definition: layermanager.cpp:473
bool removeAllLayers()
Definition: layermanager.cpp:92
virtual ~KageLayerManager()
Definition: layermanager.cpp:30
unsigned int _currentLayerIndex
Definition: layermanager.h:72
void renderStage()
Definition: layermanager.cpp:248
bool moveToTop()
Definition: layermanager.cpp:390
KageLayerUI * getLayer()
Definition: layermanager.cpp:127
std::vector< Gtk::Button * > labels
Definition: layermanager.h:69
void deleteLayer()
Definition: layermanager.cpp:51
void toggleVisibility()
Definition: layermanager.cpp:327
bool isLayerLocked()
Definition: layermanager.cpp:154
forward declaration
Definition: layer.h:32