Kage Studio 0.7.230612
A Simple Free and Open Source 2D Animation Software
Loading...
Searching...
No Matches
assetmanager.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~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_ASSET_MANAGER_LAYER_H
23 #define GTKMM_KAGE_ASSET_MANAGER_LAYER_H
24
25 #include <gtkmm/box.h>
26 #include <gtkmm/label.h>
27 #include <gtkmm/button.h>
28 #include "asset.h"
29 #include "../../asset_rename.h"
30 #include "../../util/string/stringhelper.h"
31
32 class Kage;
33
34 class KageAssetManager : public Gtk::VBox {
35 public:
36 KageAssetManager(Kage *p_kage);
37 virtual ~KageAssetManager();
38 unsigned int assetCount();
39 unsigned int addAsset(Glib::ustring p_name = "");
40 void deleteAsset();
41 bool removeAllAssets();
42 void setSelected(KageAsset *p_asset);
44 unsigned int getCurrentAsset();
45 void setCurrentAsset(unsigned int p_asset);
46 void setCurrentAssetByID(unsigned int p_assetID);
47 void renderStage();
48
50 void setAssetType(KageAsset::AssetType p_assetType);
51
52 void render(unsigned int p_renderID);
53
54 void renameAsset(KageAsset *p_asset);
55 void renameAsset();
56 void setLabel(string p_label);
57 string getLabel();
58
59 bool moveToTop();
60 bool moveUp();
61 bool moveDown();
62 bool moveToBottom();
63
64 bool exists(string p_filePath);
65 void setAssetHash(string p_assetHash);
66
68 string getImagePathByID(unsigned int p_index);
69 string getImageByID(unsigned int p_id);
70
71 void renderLibrary(unsigned int p_ID);
72
74 protected:
75 unsigned int assetCtr;
76 std::vector<Gtk::Button*> labels;
77 std::vector<KageAsset*> assets;
78 unsigned int _currentAssetID;
79 unsigned int _currentAssetIndex;
80 };
81#endif // GTKMM_KAGE_ASSET_MANAGER_LAYER_H
forward declaration
Definition: asset.h:32
AssetType
Definition: asset.h:34
Definition: assetmanager.h:34
unsigned int assetCtr
Definition: assetmanager.h:75
string _KageStudioAsset
Definition: assetmanager.h:67
virtual ~KageAssetManager()
Definition: assetmanager.cpp:34
void renderLibrary(unsigned int p_ID)
Definition: assetmanager.cpp:215
void setAssetType(KageAsset::AssetType p_assetType)
Definition: assetmanager.cpp:183
void deleteAsset()
Definition: assetmanager.cpp:126
unsigned int _currentAssetID
Definition: assetmanager.h:78
void setCurrentAssetByID(unsigned int p_assetID)
Definition: assetmanager.cpp:319
unsigned int _currentAssetIndex
Definition: assetmanager.h:79
bool moveToTop()
Definition: assetmanager.cpp:437
void render(unsigned int p_renderID)
Definition: assetmanager.cpp:197
void setLabel(string p_label)
Sets the label of current active Asset.
Definition: assetmanager.cpp:404
void renderStage()
Definition: assetmanager.cpp:347
void setAssetHash(string p_assetHash)
Definition: assetmanager.cpp:562
void setCurrentAsset(unsigned int p_asset)
Definition: assetmanager.cpp:290
KageAsset::AssetType getAssetType()
Definition: assetmanager.cpp:167
KageAsset * getAsset()
Definition: assetmanager.cpp:253
std::vector< Gtk::Button * > labels
Definition: assetmanager.h:76
string getImageByID(unsigned int p_id)
Definition: assetmanager.cpp:605
void setSelected(KageAsset *p_asset)
Definition: assetmanager.cpp:231
bool exists(string p_filePath)
Definition: assetmanager.cpp:546
Kage * _kage
Definition: assetmanager.h:73
unsigned int getCurrentAsset()
Definition: assetmanager.cpp:272
bool moveToBottom()
Definition: assetmanager.cpp:520
bool moveDown()
Definition: assetmanager.cpp:491
string getImagePathByID(unsigned int p_index)
Definition: assetmanager.cpp:575
unsigned int addAsset(Glib::ustring p_name="")
Definition: assetmanager.cpp:40
string getLabel()
Definition: assetmanager.cpp:418
unsigned int assetCount()
Definition: assetmanager.cpp:361
void renameAsset()
Definition: assetmanager.cpp:379
std::vector< KageAsset * > assets
Definition: assetmanager.h:77
bool removeAllAssets()
Definition: assetmanager.cpp:218
bool moveUp()
Definition: assetmanager.cpp:462
Definition: kage.h:69