1
1
#include < string>
2
+ #include < set>
3
+ #include < map>
2
4
#include < GDCore/PlatformDefinition/Project.h>
3
5
#include < GDCore/PlatformDefinition/Layout.h>
6
+ #include < GDCore/PlatformDefinition/Object.h>
7
+ #include < GDCore/PlatformDefinition/Variable.h>
8
+ #include < GDCore/PlatformDefinition/Automatism.h>
9
+ #include < GDCore/PlatformDefinition/VariablesContainer.h>
10
+ #include < GDCore/PlatformDefinition/Platform.h>
4
11
#include < GDCore/PlatformDefinition/InitialInstance.h>
5
12
#include < GDCore/PlatformDefinition/InitialInstancesContainer.h>
13
+ #include < GDCore/Serialization/SerializerElement.h>
14
+ #include < GDCore/Serialization/Serializer.h>
15
+
16
+ #include < GDCore/IDE/Dialogs/PropertyDescriptor.h>
17
+ #include < GDCore/IDE/Dialogs/ObjectListDialogsHelper.h>
18
+ #include < GDCore/IDE/TextFormatting.h>
19
+ #include < GDCore/IDE/InstructionSentenceFormatter.h>
20
+ #include < GDCore/IDE/EventsRefactorer.h>
21
+ #include < GDCore/IDE/ProjectResourcesAdder.h>
22
+ #include < GDCore/IDE/AbstractFileSystem.h>
23
+ #include < GDCore/IDE/ArbitraryResourceWorker.h>
24
+ #include < GDCore/IDE/MetadataProvider.h>
25
+ #include < GDCore/IDE/EventsParametersLister.h>
26
+ #include < GDCore/IDE/ArbitraryEventsWorker.h>
27
+
28
+ #include < GDJS/EventsCodeGenerator.h>
29
+ #include < GDCore/Events/Builtin/StandardEvent.h>
30
+ #include < GDCore/Events/Builtin/CommentEvent.h>
31
+ #include < GDCore/Events/Builtin/ForEachEvent.h>
32
+ #include < GDCore/Events/Builtin/WhileEvent.h>
33
+ #include < GDCore/Events/Builtin/RepeatEvent.h>
34
+ #include < GDCore/Events/Builtin/GroupEvent.h>
35
+
36
+ #include < GDCore/BuiltinExtensions/SpriteExtension/SpriteObject.h>
37
+ #include < GDCore/BuiltinExtensions/SpriteExtension/Animation.h>
38
+ #include < GDCore/BuiltinExtensions/SpriteExtension/Direction.h>
39
+ #include < GDCore/BuiltinExtensions/SpriteExtension/Sprite.h>
40
+
41
+ #include " ../../Extensions/TiledSpriteObject/TiledSpriteObject.h"
42
+ #include " ../../Extensions/TextObject/TextObject.h"
43
+
6
44
#include " ProjectHelper.h"
7
45
8
46
class InitialInstanceJSFunctorWrapper : public gd ::InitialInstanceFunctor {
@@ -17,17 +55,80 @@ class InitialInstanceJSFunctorWrapper : public gd::InitialInstanceFunctor {
17
55
};
18
56
};
19
57
20
- // Declares typedef for std::vector
58
+ // Declares typedef for std::vector and templatized types
21
59
typedef std::vector<std::string> VectorString;
60
+ typedef std::pair<std::string, gd::Variable> PairStringVariable;
61
+ typedef std::pair<std::string, TextFormatting> PairStringTextFormatting;
62
+ typedef std::vector<std::pair<std::string, TextFormatting>> VectorPairStringTextFormatting;
63
+ typedef std::map<std::string, std::string> MapStringString;
64
+ typedef std::map<std::string, gd::ExpressionMetadata> MapStringExpressionMetadata;
65
+ typedef std::map<std::string, gd::InstructionMetadata> MapStringInstructionMetadata;
66
+ typedef std::map<std::string, gd::EventMetadata> MapStringEventMetadata;
67
+ typedef std::map<std::string, gd::PropertyDescriptor> MapStringPropertyDescriptor;
68
+ typedef std::set<std::string> SetString;
69
+ typedef gd::Object gdObject; // To avoid clashing javascript Object in glue.js
22
70
23
71
// Customize some functions implementation thanks to WRAPPED_* macros
24
72
// The original names will be reconstructed in the js file (see postjs.js)
25
73
#define WRAPPED_set (a, b ) at(a) = b
74
+ #define WRAPPED_GetString (i ) at(i).first
75
+ #define WRAPPED_GetComment () com1
76
+ #define WRAPPED_SetComment (str ) com1 = str
77
+ #define WRAPPED_GetTextFormatting (i ) at(i).second
78
+ #define WRAPPED_GetName () first
79
+ #define WRAPPED_GetVariable () second
80
+
81
+ #define MAP_get (a ) find(a)->second;
82
+ #define MAP_set (key, value ) [key] = value
83
+ #define MAP_has (key ) find(key) != self->end ()
84
+
26
85
#define STATIC_CreateNewGDJSProject CreateNewGDJSProject
27
86
#define STATIC_InitializePlatforms InitializePlatforms
87
+ #define STATIC_ValidateObjectName ValidateObjectName
88
+ #define STATIC_ToJSON ToJSON
89
+ #define STATIC_FromJSON FromJSON
90
+ #define STATIC_IsObject IsObject
91
+ #define STATIC_Get Get
92
+ #define STATIC_AddAllMissingImages AddAllMissingImages
93
+ #define STATIC_GetAllUselessResources GetAllUselessResources
94
+ #define STATIC_RemoveAllUselessResources RemoveAllUselessResources
95
+ #define STATIC_HasCondition HasCondition
96
+ #define STATIC_HasAction HasAction
97
+ #define STATIC_HasObjectAction HasObjectAction
98
+ #define STATIC_HasObjectCondition HasObjectCondition
99
+ #define STATIC_HasAutomatismAction HasAutomatismAction
100
+ #define STATIC_HasAutomatismCondition HasAutomatismCondition
101
+ #define STATIC_HasExpression HasExpression
102
+ #define STATIC_HasObjectExpression HasObjectExpression
103
+ #define STATIC_HasAutomatismExpression HasAutomatismExpression
104
+ #define STATIC_HasStrExpression HasStrExpression
105
+ #define STATIC_HasObjectStrExpression HasObjectStrExpression
106
+ #define STATIC_HasAutomatismStrExpression HasAutomatismStrExpression
107
+ #define STATIC_RenameObjectInEvents RenameObjectInEvents
108
+ #define STATIC_RemoveObjectInEvents RemoveObjectInEvents
109
+ #define STATIC_ReplaceStringInEvents ReplaceStringInEvents
110
+ #define STATIC_GetAutomatismMetadata GetAutomatismMetadata
111
+ #define STATIC_GetObjectMetadata GetObjectMetadata
112
+ #define STATIC_GetActionMetadata GetActionMetadata
113
+ #define STATIC_GetConditionMetadata GetConditionMetadata
114
+ #define STATIC_GetExpressionMetadata GetExpressionMetadata
115
+ #define STATIC_GetObjectExpressionMetadata GetObjectExpressionMetadata
116
+ #define STATIC_GetAutomatismExpressionMetadata GetAutomatismExpressionMetadata
117
+ #define STATIC_GetStrExpressionMetadata GetStrExpressionMetadata
118
+ #define STATIC_GetObjectStrExpressionMetadata GetObjectStrExpressionMetadata
119
+ #define STATIC_GetAutomatismStrExpressionMetadata GetAutomatismStrExpressionMetadata
120
+ #define STATIC_GenerateSceneEventsCompleteCode GenerateSceneEventsCompleteCode
121
+
122
+ // We postfix some methods with "At" as Javacsript does not support overloading
123
+ #define GetLayoutAt GetLayout
124
+ #define GetLayerAt GetLayer
125
+ #define GetObjectAt GetObject
126
+ #define GetAt Get
127
+ #define GetEventAt GetEvent
128
+ #define RemoveEventAt RemoveEvent
28
129
29
- // We don't use prefix in .idl file to workaround a webidl_binder.py bug
30
- // that can't find in its list of interfaces a class which has a prefix.
130
+ // We don't use prefix in .idl file to workaround a webidl_binder.py bug
131
+ // that can't find in its list of interfaces a class which has a prefix.
31
132
using namespace gd ;
32
133
using namespace std ;
33
134
#include " glue.cpp"
0 commit comments