Game Develop Core: Platform.h Source File

| Game Develop Core Core library for developing platforms and tools compatible with Game Develop.

- Main Page
- Modules
- Classes

- File List
- File Members

All Classes Files Functions Variables Typedefs Enumerations Macros Groups Pages
Platform.h
Go to the documentation of this file.
1
6 #ifndef GDCORE_PLATFORM_H
7 #define GDCORE_PLATFORM_H
8 #include <boost/shared_ptr.hpp>
9 #include <vector>
10 #include <string>
11 #include <map>
12 #include "GDCore/PlatformDefinition/ChangesNotifier.h"
13 #include "GDCore/PlatformDefinition/LayoutEditorPreviewer.h"
14 namespace gd { class InstructionsMetadataHolder; }
15 namespace gd { class Project; }
16 namespace gd { class Object; }
17 namespace gd { class Automatism; }
18 namespace gd { class AutomatismMetadata; }
19 namespace gd { class ObjectMetadata; }
20 namespace gd { class BaseEvent; }
21 namespace gd { class AutomatismsSharedData; }
22 namespace gd { class PlatformExtension; }
23 namespace gd { class LayoutEditorCanvas; }
24 namespace gd { class ProjectExporter; }
25
26 typedef void (*DestroyFunPtr)(gd::Object*);
27 typedef gd::Object * (*CreateFunPtr)(std::string name);
28
29 namespace gd
30 {
31
37 class GD_CORE_API Platform
38 {
39 public:
40 Platform();
41 virtual ~Platform();
42
46 virtual std::string GetName() const { return "Unnamed platform"; }
47
51 virtual std::string GetFullName() const { return "Unnamed platform"; }
52
53 #if defined(GD_IDE_ONLY)
54
57 virtual std::string GetSubtitle() const { return ""; }
58
62 virtual std::string GetDescription() const { return ""; }
63
67 virtual std::string GetIcon() const { return ""; }
68 #endif
69
70
74
83 virtual std::string GetExtensionCreateFunctionName() { return ""; }
84
92 virtual std::string GetExtensionDestroyFunctionName() { return ""; }
93
99 virtual bool AddExtension(boost::shared_ptr<PlatformExtension> extension);
100
104 bool IsExtensionLoaded(const std::string & name) const;
105
110 boost::shared_ptr<PlatformExtension> GetExtension(const std::string & name) const;
111
116 const std::vector < boost::shared_ptr<gd::PlatformExtension> > & GetAllPlatformExtensions() const { return extensionsLoaded; };
117
119
123
128 boost::shared_ptr<gd::Object> CreateObject(std::string type, const std::string & name) const;
129
133 gd::Automatism* CreateAutomatism(const std::string & type) const;
134
138 boost::shared_ptr<gd::AutomatismsSharedData> CreateAutomatismSharedDatas(const std::string & type) const;
139
140 #if defined(GD_IDE_ONLY)
141
144 boost::shared_ptr<gd::BaseEvent> CreateEvent(const std::string & type) const;
145
147
148
152
160 virtual ChangesNotifier & GetChangesNotifier() const { return defaultEmptyChangesNotifier; };
162
167
169 #if !defined(GD_NO_WX_GUI)
170
176 virtual boost::shared_ptr<gd::LayoutEditorPreviewer> GetLayoutPreviewer(gd::LayoutEditorCanvas & editor) const;
177 #endif
178
185 virtual boost::shared_ptr<gd::ProjectExporter> GetProjectExporter() const;
187
192 virtual void OnIDEClosed() {};
193
197 virtual void OnIDEInitialized() {};
198
199 #endif
200
201 private:
202
203 std::vector < boost::shared_ptr<PlatformExtension> > extensionsLoaded;
204 std::map < std::string, CreateFunPtr > creationFunctionTable;
205 std::map < std::string, DestroyFunPtr > destroyFunctionTable;
206
207 #if defined(GD_IDE_ONLY)
208 static ChangesNotifier defaultEmptyChangesNotifier;
209 #endif
210 };
211
212 }
213
214 #endif // GDCORE_PLATFORM_H