Kage Studio 0.7.230612
A Simple Free and Open Source 2D Animation Software
Loading...
Searching...
No Matches
document.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/*Project
22 Info
23 Name
24 Width
25 Height
26 BG Color
27 Assets
28 asset01 Image
29 asset02 Image
30 asset03 SceneID
31 Scene01
32 layer01
33 frame01
34 data Move X Y
35 data Line X Y
36 data Color
37 frame02
38 data Move X Y
39 data Line X Y
40 data Asset ID
41 layer02
42 ...
43 Scene02
44 ...
45 Scene03
46 layer01
47 frame01
48 data Move X Y
49 data Line X Y
50 data Color
51 frame02
52 ...
53 layer02
54 ...
55 layer03
56 ...
57*/
58#ifndef GTKMM_KAGE_DOCUMENT_H
59 #define GTKMM_KAGE_DOCUMENT_H
60
61 #include <vector>
62 #include "data/color.h"
63 #include "./data/scene.h"
64
65 #include "../util/string/stringhelper.h"
66
67 #include <gdkmm/color.h>
68 class Kage; //forward declaration
69
70 using namespace std;
72 public:
73 string _name;
74 double _width; //made double for zoom
75 double _height; //ditto
77 unsigned int _fps;
78
80 virtual ~KageProject();
81 string toString();
82 };
83
85 protected:
86 bool _saved;
87 unsigned int _activeSceneID;
88 public:
91
92 KageDocument(Kage *p_kage);
93 KageDocument(Kage *p_kage, KageProject p_project);
94 virtual ~KageDocument();
95 void setProjectInformation(KageProject p_project);
96 unsigned int openScene(string p_filepath);
97 bool saveScene(unsigned int p_sceneID);
98 bool openProject();
99 bool saveProject();
100 bool isSaved();
101
106 };
107
108 struct Asset {
109 unsigned int ID;
111 string Path;
112 string Name;
113 };
114 //TODO: each instance of asset will reference to this
115 vector<Asset> Assets;
116
117 //TODO: each Scene will be saved as separate KSF file
118 vector<KageScene> Scenes;
119 static unsigned int ACTIVE_SCENE;
120
121 unsigned int getActiveSceneID();
122 unsigned int getActiveLayerID();
123 unsigned int getActiveFrameID();
124
125 unsigned int frameCount();
126 void setCurrentFrame(unsigned int p_frame);
127 };
128#endif //GTKMM_KAGE_DOCUMENT_H
Definition: color.h:28
Definition: document.h:84
bool openProject()
Definition: document.cpp:76
bool isSaved()
Definition: document.cpp:97
unsigned int openScene(string p_filepath)
Definition: document.cpp:57
unsigned int getActiveLayerID()
Definition: document.cpp:104
unsigned int frameCount()
Definition: document.cpp:131
void setProjectInformation(KageProject p_project)
Definition: document.cpp:49
bool _saved
Definition: document.h:86
vector< Asset > Assets
Definition: document.h:115
unsigned int _activeSceneID
Definition: document.h:87
bool saveScene(unsigned int p_sceneID)
Kage Document will contain several scenes. This will allow saving one Scene to be saved each time.
Definition: document.cpp:70
virtual ~KageDocument()
Definition: document.cpp:44
Kage * _kage
Definition: document.h:90
unsigned int getActiveFrameID()
Definition: document.cpp:107
static unsigned int ACTIVE_SCENE
Definition: document.h:119
void setCurrentFrame(unsigned int p_frame)
Definition: document.cpp:135
vector< KageScene > Scenes
Definition: document.h:118
AssetType
Definition: document.h:102
@ ASSET_KAGE
Definition: document.h:105
@ ASSET_IMAGE
Definition: document.h:103
@ ASSET_VIDEO
Definition: document.h:104
KageProject Project
Definition: document.h:89
bool saveProject()
Definition: document.cpp:80
unsigned int getActiveSceneID()
Definition: document.cpp:101
Definition: kage.h:69
Definition: document.h:71
double _height
Definition: document.h:75
double _width
Definition: document.h:74
KageProject()
Definition: document.cpp:111
string _name
Definition: document.h:73
string toString()
Definition: document.cpp:123
unsigned int _fps
Definition: document.h:77
virtual ~KageProject()
Definition: document.cpp:119
ColorData _backgroundColor
Definition: document.h:76
Definition: document.h:108
string Name
Definition: document.h:112
unsigned int ID
Definition: document.h:109
string Path
Definition: document.h:111
AssetType Type
Definition: document.h:110