Generated_Templates.h 58 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591
  1. // DO NOT EDIT. This file is generated
  2. #pragma once
  3. #include "../Precompiled.h"
  4. #include "../AngelScript/APITemplates.h"
  5. #include "../Core/Object.h"
  6. #include "../Resource/Resource.h"
  7. #include "../Scene/Component.h"
  8. #include "../AngelScript/Manual.h"
  9. namespace Urho3D
  10. {
  11. void FakeAddRef(void* ptr);
  12. void FakeReleaseRef(void* ptr);
  13. // explicit Component::Component(Context* context) | File: ../Scene/Component.h
  14. static Component* Component_Component_Context_template()
  15. {
  16. return new Component(GetScriptContext());
  17. }
  18. // void Object::UnsubscribeFromAllEventsExcept(const PODVector<StringHash>& exceptions, bool onlyUserData) | File: ../Core/Object.h
  19. static void Component_UnsubscribeFromAllEventsExcept_PODVectorStringHash_bool_template(Component* ptr, CScriptArray* exceptions, bool onlyUserData)
  20. {
  21. PODVector<StringHash> param0 = ArrayToPODVector<StringHash>(exceptions);
  22. ptr->UnsubscribeFromAllEventsExcept(param0, onlyUserData);
  23. }
  24. // void Object::UnsubscribeFromAllEventsExcept(const PODVector<StringHash>& exceptions, bool onlyUserData) | File: ../Core/Object.h
  25. static void Object_UnsubscribeFromAllEventsExcept_PODVectorStringHash_bool_template(Object* ptr, CScriptArray* exceptions, bool onlyUserData)
  26. {
  27. PODVector<StringHash> param0 = ArrayToPODVector<StringHash>(exceptions);
  28. ptr->UnsubscribeFromAllEventsExcept(param0, onlyUserData);
  29. }
  30. // explicit Resource::Resource(Context* context) | File: ../Resource/Resource.h
  31. static Resource* Resource_Resource_Context_template()
  32. {
  33. return new Resource(GetScriptContext());
  34. }
  35. // void Object::UnsubscribeFromAllEventsExcept(const PODVector<StringHash>& exceptions, bool onlyUserData) | File: ../Core/Object.h
  36. static void Resource_UnsubscribeFromAllEventsExcept_PODVectorStringHash_bool_template(Resource* ptr, CScriptArray* exceptions, bool onlyUserData)
  37. {
  38. PODVector<StringHash> param0 = ArrayToPODVector<StringHash>(exceptions);
  39. ptr->UnsubscribeFromAllEventsExcept(param0, onlyUserData);
  40. }
  41. template <class T> void RegisterComponent(asIScriptEngine* engine, const char* className)
  42. {
  43. // class Component | File: ../Scene/Component.h
  44. engine->RegisterObjectType(className, 0, asOBJ_REF);
  45. // void RefCounted::AddRef() | File: ../Container/RefCounted.h
  46. engine->RegisterObjectBehaviour(className, asBEHAVE_ADDREF, "void f()", asMETHODPR(T, AddRef, (), void), asCALL_THISCALL);
  47. // void Component::AddReplicationState(ComponentReplicationState* state) | File: ../Scene/Component.h
  48. // Error: type "ComponentReplicationState*" can not automatically bind
  49. // void Serializable::AllocateNetworkState() | File: ../Scene/Serializable.h
  50. engine->RegisterObjectMethod(className, "void AllocateNetworkState()", asMETHODPR(T, AllocateNetworkState, (), void), asCALL_THISCALL);
  51. // virtual void Serializable::ApplyAttributes() | File: ../Scene/Serializable.h
  52. engine->RegisterObjectMethod(className, "void ApplyAttributes()", asMETHODPR(T, ApplyAttributes, (), void), asCALL_THISCALL);
  53. // template<typename T> T* Object::Cast() | File: ../Core/Object.h
  54. // Not registered because template
  55. // template<typename T> const T* Object::Cast() const | File: ../Core/Object.h
  56. // Not registered because template
  57. // void Component::CleanupConnection(Connection* connection) | File: ../Scene/Component.h
  58. engine->RegisterObjectMethod(className, "void CleanupConnection(Connection@+)", asMETHODPR(T, CleanupConnection, (Connection*), void), asCALL_THISCALL);
  59. // explicit Component::Component(Context* context) | File: ../Scene/Component.h
  60. {
  61. String declFactory(String(className) + "@ f()");
  62. engine->RegisterObjectBehaviour(className, asBEHAVE_FACTORY, declFactory.CString(), asFUNCTION(Component_Component_Context_template), asCALL_CDECL);
  63. }
  64. // virtual void Component::DrawDebugGeometry(DebugRenderer* debug, bool depthTest) | File: ../Scene/Component.h
  65. engine->RegisterObjectMethod(className, "void DrawDebugGeometry(DebugRenderer@+, bool)", asMETHODPR(T, DrawDebugGeometry, (DebugRenderer*, bool), void), asCALL_THISCALL);
  66. // bool Animatable::GetAnimationEnabled() const | File: ../Scene/Animatable.h
  67. engine->RegisterObjectMethod(className, "bool GetAnimationEnabled() const", asMETHODPR(T, GetAnimationEnabled, () const, bool), asCALL_THISCALL);
  68. engine->RegisterObjectMethod(className, "bool get_animationEnabled() const", asMETHODPR(T, GetAnimationEnabled, () const, bool), asCALL_THISCALL);
  69. // Variant Serializable::GetAttribute(unsigned index) const | File: ../Scene/Serializable.h
  70. engine->RegisterObjectMethod(className, "Variant GetAttribute(uint) const", asMETHODPR(T, GetAttribute, (unsigned) const, Variant), asCALL_THISCALL);
  71. engine->RegisterObjectMethod(className, "Variant get_attributes(uint) const", asMETHODPR(T, GetAttribute, (unsigned) const, Variant), asCALL_THISCALL);
  72. // Variant Serializable::GetAttribute(const String& name) const | File: ../Scene/Serializable.h
  73. engine->RegisterObjectMethod(className, "Variant GetAttribute(const String&in) const", asMETHODPR(T, GetAttribute, (const String&) const, Variant), asCALL_THISCALL);
  74. // ValueAnimation* Animatable::GetAttributeAnimation(const String& name) const | File: ../Scene/Animatable.h
  75. engine->RegisterObjectMethod(className, "ValueAnimation@+ GetAttributeAnimation(const String&in) const", asMETHODPR(T, GetAttributeAnimation, (const String&) const, ValueAnimation*), asCALL_THISCALL);
  76. // float Animatable::GetAttributeAnimationSpeed(const String& name) const | File: ../Scene/Animatable.h
  77. engine->RegisterObjectMethod(className, "float GetAttributeAnimationSpeed(const String&in) const", asMETHODPR(T, GetAttributeAnimationSpeed, (const String&) const, float), asCALL_THISCALL);
  78. // float Animatable::GetAttributeAnimationTime(const String& name) const | File: ../Scene/Animatable.h
  79. engine->RegisterObjectMethod(className, "float GetAttributeAnimationTime(const String&in) const", asMETHODPR(T, GetAttributeAnimationTime, (const String&) const, float), asCALL_THISCALL);
  80. // WrapMode Animatable::GetAttributeAnimationWrapMode(const String& name) const | File: ../Scene/Animatable.h
  81. engine->RegisterObjectMethod(className, "WrapMode GetAttributeAnimationWrapMode(const String&in) const", asMETHODPR(T, GetAttributeAnimationWrapMode, (const String&) const, WrapMode), asCALL_THISCALL);
  82. // Variant Serializable::GetAttributeDefault(unsigned index) const | File: ../Scene/Serializable.h
  83. engine->RegisterObjectMethod(className, "Variant GetAttributeDefault(uint) const", asMETHODPR(T, GetAttributeDefault, (unsigned) const, Variant), asCALL_THISCALL);
  84. engine->RegisterObjectMethod(className, "Variant get_attributeDefaults(uint) const", asMETHODPR(T, GetAttributeDefault, (unsigned) const, Variant), asCALL_THISCALL);
  85. // Variant Serializable::GetAttributeDefault(const String& name) const | File: ../Scene/Serializable.h
  86. engine->RegisterObjectMethod(className, "Variant GetAttributeDefault(const String&in) const", asMETHODPR(T, GetAttributeDefault, (const String&) const, Variant), asCALL_THISCALL);
  87. // virtual const Vector<AttributeInfo>* Serializable::GetAttributes() const | File: ../Scene/Serializable.h
  88. // Error: type "const Vector<AttributeInfo>*" can not automatically bind
  89. // bool Object::GetBlockEvents() const | File: ../Core/Object.h
  90. engine->RegisterObjectMethod(className, "bool GetBlockEvents() const", asMETHODPR(T, GetBlockEvents, () const, bool), asCALL_THISCALL);
  91. // const String& Object::GetCategory() const | File: ../Core/Object.h
  92. engine->RegisterObjectMethod(className, "const String& GetCategory() const", asMETHODPR(T, GetCategory, () const, const String&), asCALL_THISCALL);
  93. engine->RegisterObjectMethod(className, "const String& get_category() const", asMETHODPR(T, GetCategory, () const, const String&), asCALL_THISCALL);
  94. // Component* Component::GetComponent(StringHash type) const | File: ../Scene/Component.h
  95. engine->RegisterObjectMethod(className, "Component@+ GetComponent(StringHash) const", asMETHODPR(T, GetComponent, (StringHash) const, Component*), asCALL_THISCALL);
  96. // template<class T> T* Component::GetComponent() const | File: ../Scene/Component.h
  97. // Not registered because template
  98. // void Component::GetComponents(PODVector<Component*>& dest, StringHash type) const | File: ../Scene/Component.h
  99. // Error: type "PODVector<Component*>&" can not automatically bind
  100. // template<class T> void Component::GetComponents(PODVector<T*>& dest) const | File: ../Scene/Component.h
  101. // Not registered because template
  102. // Context* Object::GetContext() const | File: ../Core/Object.h
  103. // Error: type "Context*" can not be returned
  104. // virtual void Component::GetDependencyNodes(PODVector<Node*>& dest) | File: ../Scene/Component.h
  105. // Error: type "PODVector<Node*>&" can not automatically bind
  106. // VariantMap& Object::GetEventDataMap() const | File: ../Core/Object.h
  107. engine->RegisterObjectMethod(className, "VariantMap& GetEventDataMap() const", asMETHODPR(T, GetEventDataMap, () const, VariantMap&), asCALL_THISCALL);
  108. // EventHandler* Object::GetEventHandler() const | File: ../Core/Object.h
  109. // Error: type "EventHandler*" can not automatically bind
  110. // Object* Object::GetEventSender() const | File: ../Core/Object.h
  111. engine->RegisterObjectMethod(className, "Object@+ GetEventSender() const", asMETHODPR(T, GetEventSender, () const, Object*), asCALL_THISCALL);
  112. // const Variant& Object::GetGlobalVar(StringHash key) const | File: ../Core/Object.h
  113. engine->RegisterObjectMethod(className, "const Variant& GetGlobalVar(StringHash) const", asMETHODPR(T, GetGlobalVar, (StringHash) const, const Variant&), asCALL_THISCALL);
  114. engine->RegisterObjectMethod(className, "const Variant& get_globalVar(StringHash) const", asMETHODPR(T, GetGlobalVar, (StringHash) const, const Variant&), asCALL_THISCALL);
  115. // const VariantMap& Object::GetGlobalVars() const | File: ../Core/Object.h
  116. engine->RegisterObjectMethod(className, "const VariantMap& GetGlobalVars() const", asMETHODPR(T, GetGlobalVars, () const, const VariantMap&), asCALL_THISCALL);
  117. engine->RegisterObjectMethod(className, "const VariantMap& get_globalVars() const", asMETHODPR(T, GetGlobalVars, () const, const VariantMap&), asCALL_THISCALL);
  118. // unsigned Component::GetID() const | File: ../Scene/Component.h
  119. engine->RegisterObjectMethod(className, "uint GetID() const", asMETHODPR(T, GetID, () const, unsigned), asCALL_THISCALL);
  120. engine->RegisterObjectMethod(className, "uint get_id() const", asMETHODPR(T, GetID, () const, unsigned), asCALL_THISCALL);
  121. // bool Serializable::GetInterceptNetworkUpdate(const String& attributeName) const | File: ../Scene/Serializable.h
  122. engine->RegisterObjectMethod(className, "bool GetInterceptNetworkUpdate(const String&in) const", asMETHODPR(T, GetInterceptNetworkUpdate, (const String&) const, bool), asCALL_THISCALL);
  123. // virtual const Vector<AttributeInfo>* Serializable::GetNetworkAttributes() const | File: ../Scene/Serializable.h
  124. // Error: type "const Vector<AttributeInfo>*" can not automatically bind
  125. // NetworkState* Serializable::GetNetworkState() const | File: ../Scene/Serializable.h
  126. // Error: type "NetworkState*" can not automatically bind
  127. // Node* Component::GetNode() const | File: ../Scene/Component.h
  128. engine->RegisterObjectMethod(className, "Node@+ GetNode() const", asMETHODPR(T, GetNode, () const, Node*), asCALL_THISCALL);
  129. engine->RegisterObjectMethod(className, "Node@+ get_node() const", asMETHODPR(T, GetNode, () const, Node*), asCALL_THISCALL);
  130. // unsigned Serializable::GetNumAttributes() const | File: ../Scene/Serializable.h
  131. engine->RegisterObjectMethod(className, "uint GetNumAttributes() const", asMETHODPR(T, GetNumAttributes, () const, unsigned), asCALL_THISCALL);
  132. engine->RegisterObjectMethod(className, "uint get_numAttributes() const", asMETHODPR(T, GetNumAttributes, () const, unsigned), asCALL_THISCALL);
  133. // unsigned Serializable::GetNumNetworkAttributes() const | File: ../Scene/Serializable.h
  134. engine->RegisterObjectMethod(className, "uint GetNumNetworkAttributes() const", asMETHODPR(T, GetNumNetworkAttributes, () const, unsigned), asCALL_THISCALL);
  135. // ObjectAnimation* Animatable::GetObjectAnimation() const | File: ../Scene/Animatable.h
  136. engine->RegisterObjectMethod(className, "ObjectAnimation@+ GetObjectAnimation() const", asMETHODPR(T, GetObjectAnimation, () const, ObjectAnimation*), asCALL_THISCALL);
  137. engine->RegisterObjectMethod(className, "ObjectAnimation@+ get_objectAnimation() const", asMETHODPR(T, GetObjectAnimation, () const, ObjectAnimation*), asCALL_THISCALL);
  138. // ResourceRef Animatable::GetObjectAnimationAttr() const | File: ../Scene/Animatable.h
  139. engine->RegisterObjectMethod(className, "ResourceRef GetObjectAnimationAttr() const", asMETHODPR(T, GetObjectAnimationAttr, () const, ResourceRef), asCALL_THISCALL);
  140. // Scene* Component::GetScene() const | File: ../Scene/Component.h
  141. engine->RegisterObjectMethod(className, "Scene@+ GetScene() const", asMETHODPR(T, GetScene, () const, Scene*), asCALL_THISCALL);
  142. // Object* Object::GetSubsystem(StringHash type) const | File: ../Core/Object.h
  143. engine->RegisterObjectMethod(className, "Object@+ GetSubsystem(StringHash) const", asMETHODPR(T, GetSubsystem, (StringHash) const, Object*), asCALL_THISCALL);
  144. // template<class T> T* Object::GetSubsystem() const | File: ../Core/Object.h
  145. // Not registered because template
  146. // virtual StringHash Object::GetType() const =0 | File: ../Core/Object.h
  147. engine->RegisterObjectMethod(className, "StringHash GetType() const", asMETHODPR(T, GetType, () const, StringHash), asCALL_THISCALL);
  148. engine->RegisterObjectMethod(className, "StringHash get_type() const", asMETHODPR(T, GetType, () const, StringHash), asCALL_THISCALL);
  149. // virtual const TypeInfo* Object::GetTypeInfo() const =0 | File: ../Core/Object.h
  150. // Error: type "TypeInfo" can not automatically bind bacause have @nobind mark
  151. // static const TypeInfo* Object::GetTypeInfoStatic() | File: ../Core/Object.h
  152. // Error: type "TypeInfo" can not automatically bind bacause have @nobind mark
  153. // virtual const String& Object::GetTypeName() const =0 | File: ../Core/Object.h
  154. engine->RegisterObjectMethod(className, "const String& GetTypeName() const", asMETHODPR(T, GetTypeName, () const, const String&), asCALL_THISCALL);
  155. engine->RegisterObjectMethod(className, "const String& get_typeName() const", asMETHODPR(T, GetTypeName, () const, const String&), asCALL_THISCALL);
  156. // bool Object::HasEventHandlers() const | File: ../Core/Object.h
  157. engine->RegisterObjectMethod(className, "bool HasEventHandlers() const", asMETHODPR(T, HasEventHandlers, () const, bool), asCALL_THISCALL);
  158. // bool Object::HasSubscribedToEvent(StringHash eventType) const | File: ../Core/Object.h
  159. engine->RegisterObjectMethod(className, "bool HasSubscribedToEvent(StringHash) const", asMETHODPR(T, HasSubscribedToEvent, (StringHash) const, bool), asCALL_THISCALL);
  160. // bool Object::HasSubscribedToEvent(Object* sender, StringHash eventType) const | File: ../Core/Object.h
  161. engine->RegisterObjectMethod(className, "bool HasSubscribedToEvent(Object@+, StringHash) const", asMETHODPR(T, HasSubscribedToEvent, (Object*, StringHash) const, bool), asCALL_THISCALL);
  162. // bool Component::IsEnabled() const | File: ../Scene/Component.h
  163. engine->RegisterObjectMethod(className, "bool IsEnabled() const", asMETHODPR(T, IsEnabled, () const, bool), asCALL_THISCALL);
  164. engine->RegisterObjectMethod(className, "bool get_enabled() const", asMETHODPR(T, IsEnabled, () const, bool), asCALL_THISCALL);
  165. // bool Component::IsEnabledEffective() const | File: ../Scene/Component.h
  166. engine->RegisterObjectMethod(className, "bool IsEnabledEffective() const", asMETHODPR(T, IsEnabledEffective, () const, bool), asCALL_THISCALL);
  167. engine->RegisterObjectMethod(className, "bool get_enabledEffective() const", asMETHODPR(T, IsEnabledEffective, () const, bool), asCALL_THISCALL);
  168. // bool Object::IsInstanceOf(StringHash type) const | File: ../Core/Object.h
  169. engine->RegisterObjectMethod(className, "bool IsInstanceOf(StringHash) const", asMETHODPR(T, IsInstanceOf, (StringHash) const, bool), asCALL_THISCALL);
  170. // bool Object::IsInstanceOf(const TypeInfo* typeInfo) const | File: ../Core/Object.h
  171. // Error: type "TypeInfo" can not automatically bind bacause have @nobind mark
  172. // template<typename T> bool Object::IsInstanceOf() const | File: ../Core/Object.h
  173. // Not registered because template
  174. // bool Component::IsReplicated() const | File: ../Scene/Component.h
  175. engine->RegisterObjectMethod(className, "bool IsReplicated() const", asMETHODPR(T, IsReplicated, () const, bool), asCALL_THISCALL);
  176. engine->RegisterObjectMethod(className, "bool get_replicated() const", asMETHODPR(T, IsReplicated, () const, bool), asCALL_THISCALL);
  177. // bool Serializable::IsTemporary() const | File: ../Scene/Serializable.h
  178. engine->RegisterObjectMethod(className, "bool IsTemporary() const", asMETHODPR(T, IsTemporary, () const, bool), asCALL_THISCALL);
  179. engine->RegisterObjectMethod(className, "bool get_temporary() const", asMETHODPR(T, IsTemporary, () const, bool), asCALL_THISCALL);
  180. // virtual bool Serializable::Load(Deserializer& source) | File: ../Scene/Serializable.h
  181. engine->RegisterObjectMethod(className, "bool Load(Deserializer&)", asMETHODPR(T, Load, (Deserializer&), bool), asCALL_THISCALL);
  182. // bool Animatable::LoadJSON(const JSONValue& source) override | File: ../Scene/Animatable.h
  183. engine->RegisterObjectMethod(className, "bool LoadJSON(const JSONValue&in)", asMETHODPR(T, LoadJSON, (const JSONValue&), bool), asCALL_THISCALL);
  184. // bool Animatable::LoadXML(const XMLElement& source) override | File: ../Scene/Animatable.h
  185. engine->RegisterObjectMethod(className, "bool LoadXML(const XMLElement&in)", asMETHODPR(T, LoadXML, (const XMLElement&), bool), asCALL_THISCALL);
  186. // void Component::MarkNetworkUpdate() override | File: ../Scene/Component.h
  187. engine->RegisterObjectMethod(className, "void MarkNetworkUpdate()", asMETHODPR(T, MarkNetworkUpdate, (), void), asCALL_THISCALL);
  188. // virtual void Object::OnEvent(Object* sender, StringHash eventType, VariantMap& eventData) | File: ../Core/Object.h
  189. engine->RegisterObjectMethod(className, "void OnEvent(Object@+, StringHash, VariantMap&)", asMETHODPR(T, OnEvent, (Object*, StringHash, VariantMap&), void), asCALL_THISCALL);
  190. // virtual void Serializable::OnGetAttribute(const AttributeInfo& attr, Variant& dest) const | File: ../Scene/Serializable.h
  191. engine->RegisterObjectMethod(className, "void OnGetAttribute(const AttributeInfo&in, Variant&) const", asMETHODPR(T, OnGetAttribute, (const AttributeInfo&, Variant&) const, void), asCALL_THISCALL);
  192. // virtual void Serializable::OnSetAttribute(const AttributeInfo& attr, const Variant& src) | File: ../Scene/Serializable.h
  193. engine->RegisterObjectMethod(className, "void OnSetAttribute(const AttributeInfo&in, const Variant&in)", asMETHODPR(T, OnSetAttribute, (const AttributeInfo&, const Variant&), void), asCALL_THISCALL);
  194. // virtual void Component::OnSetEnabled() | File: ../Scene/Component.h
  195. engine->RegisterObjectMethod(className, "void OnSetEnabled()", asMETHODPR(T, OnSetEnabled, (), void), asCALL_THISCALL);
  196. // void Component::PrepareNetworkUpdate() | File: ../Scene/Component.h
  197. engine->RegisterObjectMethod(className, "void PrepareNetworkUpdate()", asMETHODPR(T, PrepareNetworkUpdate, (), void), asCALL_THISCALL);
  198. // bool Serializable::ReadDeltaUpdate(Deserializer& source) | File: ../Scene/Serializable.h
  199. engine->RegisterObjectMethod(className, "bool ReadDeltaUpdate(Deserializer&)", asMETHODPR(T, ReadDeltaUpdate, (Deserializer&), bool), asCALL_THISCALL);
  200. // bool Serializable::ReadLatestDataUpdate(Deserializer& source) | File: ../Scene/Serializable.h
  201. engine->RegisterObjectMethod(className, "bool ReadLatestDataUpdate(Deserializer&)", asMETHODPR(T, ReadLatestDataUpdate, (Deserializer&), bool), asCALL_THISCALL);
  202. // RefCount* RefCounted::RefCountPtr() | File: ../Container/RefCounted.h
  203. // Error: type "RefCount*" can not automatically bind
  204. // int RefCounted::Refs() const | File: ../Container/RefCounted.h
  205. engine->RegisterObjectMethod(className, "int Refs() const", asMETHODPR(T, Refs, () const, int), asCALL_THISCALL);
  206. engine->RegisterObjectMethod(className, "int get_refs() const", asMETHODPR(T, Refs, () const, int), asCALL_THISCALL);
  207. // static void Animatable::RegisterObject(Context* context) | File: ../Scene/Animatable.h
  208. // Context can be used as firs parameter of constructors only
  209. // void RefCounted::ReleaseRef() | File: ../Container/RefCounted.h
  210. engine->RegisterObjectBehaviour(className, asBEHAVE_RELEASE, "void f()", asMETHODPR(T, ReleaseRef, (), void), asCALL_THISCALL);
  211. // void Component::Remove() | File: ../Scene/Component.h
  212. engine->RegisterObjectMethod(className, "void Remove()", asMETHODPR(T, Remove, (), void), asCALL_THISCALL);
  213. // void Animatable::RemoveAttributeAnimation(const String& name) | File: ../Scene/Animatable.h
  214. engine->RegisterObjectMethod(className, "void RemoveAttributeAnimation(const String&in)", asMETHODPR(T, RemoveAttributeAnimation, (const String&), void), asCALL_THISCALL);
  215. // void Serializable::RemoveInstanceDefault() | File: ../Scene/Serializable.h
  216. engine->RegisterObjectMethod(className, "void RemoveInstanceDefault()", asMETHODPR(T, RemoveInstanceDefault, (), void), asCALL_THISCALL);
  217. // void Animatable::RemoveObjectAnimation() | File: ../Scene/Animatable.h
  218. engine->RegisterObjectMethod(className, "void RemoveObjectAnimation()", asMETHODPR(T, RemoveObjectAnimation, (), void), asCALL_THISCALL);
  219. // void Serializable::ResetToDefault() | File: ../Scene/Serializable.h
  220. engine->RegisterObjectMethod(className, "void ResetToDefault()", asMETHODPR(T, ResetToDefault, (), void), asCALL_THISCALL);
  221. // bool Component::Save(Serializer& dest) const override | File: ../Scene/Component.h
  222. engine->RegisterObjectMethod(className, "bool Save(Serializer&) const", asMETHODPR(T, Save, (Serializer&) const, bool), asCALL_THISCALL);
  223. // virtual bool Serializable::SaveDefaultAttributes() const | File: ../Scene/Serializable.h
  224. engine->RegisterObjectMethod(className, "bool SaveDefaultAttributes() const", asMETHODPR(T, SaveDefaultAttributes, () const, bool), asCALL_THISCALL);
  225. // bool Component::SaveJSON(JSONValue& dest) const override | File: ../Scene/Component.h
  226. engine->RegisterObjectMethod(className, "bool SaveJSON(JSONValue&) const", asMETHODPR(T, SaveJSON, (JSONValue&) const, bool), asCALL_THISCALL);
  227. // bool Component::SaveXML(XMLElement& dest) const override | File: ../Scene/Component.h
  228. engine->RegisterObjectMethod(className, "bool SaveXML(XMLElement&) const", asMETHODPR(T, SaveXML, (XMLElement&) const, bool), asCALL_THISCALL);
  229. // void Object::SendEvent(StringHash eventType) | File: ../Core/Object.h
  230. engine->RegisterObjectMethod(className, "void SendEvent(StringHash)", asMETHODPR(T, SendEvent, (StringHash), void), asCALL_THISCALL);
  231. // void Object::SendEvent(StringHash eventType, VariantMap& eventData) | File: ../Core/Object.h
  232. engine->RegisterObjectMethod(className, "void SendEvent(StringHash, VariantMap&)", asMETHODPR(T, SendEvent, (StringHash, VariantMap&), void), asCALL_THISCALL);
  233. // template<typename... Args> void Object::SendEvent(StringHash eventType, Args... args) | File: ../Core/Object.h
  234. // Not registered because template
  235. // void Animatable::SetAnimationEnabled(bool enable) | File: ../Scene/Animatable.h
  236. engine->RegisterObjectMethod(className, "void SetAnimationEnabled(bool)", asMETHODPR(T, SetAnimationEnabled, (bool), void), asCALL_THISCALL);
  237. engine->RegisterObjectMethod(className, "void set_animationEnabled(bool)", asMETHODPR(T, SetAnimationEnabled, (bool), void), asCALL_THISCALL);
  238. // void Animatable::SetAnimationTime(float time) | File: ../Scene/Animatable.h
  239. engine->RegisterObjectMethod(className, "void SetAnimationTime(float)", asMETHODPR(T, SetAnimationTime, (float), void), asCALL_THISCALL);
  240. // bool Serializable::SetAttribute(unsigned index, const Variant& value) | File: ../Scene/Serializable.h
  241. engine->RegisterObjectMethod(className, "bool SetAttribute(uint, const Variant&in)", asMETHODPR(T, SetAttribute, (unsigned, const Variant&), bool), asCALL_THISCALL);
  242. engine->RegisterObjectMethod(className, "bool set_attributes(uint, const Variant&in)", asMETHODPR(T, SetAttribute, (unsigned, const Variant&), bool), asCALL_THISCALL);
  243. // bool Serializable::SetAttribute(const String& name, const Variant& value) | File: ../Scene/Serializable.h
  244. engine->RegisterObjectMethod(className, "bool SetAttribute(const String&in, const Variant&in)", asMETHODPR(T, SetAttribute, (const String&, const Variant&), bool), asCALL_THISCALL);
  245. // void Animatable::SetAttributeAnimation(const String& name, ValueAnimation* attributeAnimation, WrapMode wrapMode=WM_LOOP, float speed=1.0f) | File: ../Scene/Animatable.h
  246. engine->RegisterObjectMethod(className, "void SetAttributeAnimation(const String&in, ValueAnimation@+, WrapMode = WM_LOOP, float = 1.0f)", asMETHODPR(T, SetAttributeAnimation, (const String&, ValueAnimation*, WrapMode, float), void), asCALL_THISCALL);
  247. // void Animatable::SetAttributeAnimationSpeed(const String& name, float speed) | File: ../Scene/Animatable.h
  248. engine->RegisterObjectMethod(className, "void SetAttributeAnimationSpeed(const String&in, float)", asMETHODPR(T, SetAttributeAnimationSpeed, (const String&, float), void), asCALL_THISCALL);
  249. // void Animatable::SetAttributeAnimationTime(const String& name, float time) | File: ../Scene/Animatable.h
  250. engine->RegisterObjectMethod(className, "void SetAttributeAnimationTime(const String&in, float)", asMETHODPR(T, SetAttributeAnimationTime, (const String&, float), void), asCALL_THISCALL);
  251. // void Animatable::SetAttributeAnimationWrapMode(const String& name, WrapMode wrapMode) | File: ../Scene/Animatable.h
  252. engine->RegisterObjectMethod(className, "void SetAttributeAnimationWrapMode(const String&in, WrapMode)", asMETHODPR(T, SetAttributeAnimationWrapMode, (const String&, WrapMode), void), asCALL_THISCALL);
  253. // void Object::SetBlockEvents(bool block) | File: ../Core/Object.h
  254. engine->RegisterObjectMethod(className, "void SetBlockEvents(bool)", asMETHODPR(T, SetBlockEvents, (bool), void), asCALL_THISCALL);
  255. // void Component::SetEnabled(bool enable) | File: ../Scene/Component.h
  256. engine->RegisterObjectMethod(className, "void SetEnabled(bool)", asMETHODPR(T, SetEnabled, (bool), void), asCALL_THISCALL);
  257. engine->RegisterObjectMethod(className, "void set_enabled(bool)", asMETHODPR(T, SetEnabled, (bool), void), asCALL_THISCALL);
  258. // void Object::SetGlobalVar(StringHash key, const Variant& value) | File: ../Core/Object.h
  259. engine->RegisterObjectMethod(className, "void SetGlobalVar(StringHash, const Variant&in)", asMETHODPR(T, SetGlobalVar, (StringHash, const Variant&), void), asCALL_THISCALL);
  260. engine->RegisterObjectMethod(className, "void set_globalVar(StringHash, const Variant&in)", asMETHODPR(T, SetGlobalVar, (StringHash, const Variant&), void), asCALL_THISCALL);
  261. // void Serializable::SetInstanceDefault(bool enable) | File: ../Scene/Serializable.h
  262. engine->RegisterObjectMethod(className, "void SetInstanceDefault(bool)", asMETHODPR(T, SetInstanceDefault, (bool), void), asCALL_THISCALL);
  263. // void Serializable::SetInterceptNetworkUpdate(const String& attributeName, bool enable) | File: ../Scene/Serializable.h
  264. engine->RegisterObjectMethod(className, "void SetInterceptNetworkUpdate(const String&in, bool)", asMETHODPR(T, SetInterceptNetworkUpdate, (const String&, bool), void), asCALL_THISCALL);
  265. // void Animatable::SetObjectAnimation(ObjectAnimation* objectAnimation) | File: ../Scene/Animatable.h
  266. engine->RegisterObjectMethod(className, "void SetObjectAnimation(ObjectAnimation@+)", asMETHODPR(T, SetObjectAnimation, (ObjectAnimation*), void), asCALL_THISCALL);
  267. engine->RegisterObjectMethod(className, "void set_objectAnimation(ObjectAnimation@+)", asMETHODPR(T, SetObjectAnimation, (ObjectAnimation*), void), asCALL_THISCALL);
  268. // void Animatable::SetObjectAnimationAttr(const ResourceRef& value) | File: ../Scene/Animatable.h
  269. engine->RegisterObjectMethod(className, "void SetObjectAnimationAttr(const ResourceRef&in)", asMETHODPR(T, SetObjectAnimationAttr, (const ResourceRef&), void), asCALL_THISCALL);
  270. // void Serializable::SetTemporary(bool enable) | File: ../Scene/Serializable.h
  271. engine->RegisterObjectMethod(className, "void SetTemporary(bool)", asMETHODPR(T, SetTemporary, (bool), void), asCALL_THISCALL);
  272. engine->RegisterObjectMethod(className, "void set_temporary(bool)", asMETHODPR(T, SetTemporary, (bool), void), asCALL_THISCALL);
  273. // void Object::SubscribeToEvent(StringHash eventType, EventHandler* handler) | File: ../Core/Object.h
  274. // Error: type "EventHandler*" can not automatically bind
  275. // void Object::SubscribeToEvent(Object* sender, StringHash eventType, EventHandler* handler) | File: ../Core/Object.h
  276. // Error: type "EventHandler*" can not automatically bind
  277. // void Object::SubscribeToEvent(StringHash eventType, const std::function<void(StringHash, VariantMap&)>& function, void* userData=nullptr) | File: ../Core/Object.h
  278. // Error: type "const std::function<void(StringHash, VariantMap&)>&" can not automatically bind
  279. // void Object::SubscribeToEvent(Object* sender, StringHash eventType, const std::function<void(StringHash, VariantMap&)>& function, void* userData=nullptr) | File: ../Core/Object.h
  280. // Error: type "const std::function<void(StringHash, VariantMap&)>&" can not automatically bind
  281. // void Object::UnsubscribeFromAllEvents() | File: ../Core/Object.h
  282. engine->RegisterObjectMethod(className, "void UnsubscribeFromAllEvents()", asMETHODPR(T, UnsubscribeFromAllEvents, (), void), asCALL_THISCALL);
  283. // void Object::UnsubscribeFromAllEventsExcept(const PODVector<StringHash>& exceptions, bool onlyUserData) | File: ../Core/Object.h
  284. engine->RegisterObjectMethod(className, "void UnsubscribeFromAllEventsExcept(Array<StringHash>@+, bool)", asFUNCTION(Component_UnsubscribeFromAllEventsExcept_PODVectorStringHash_bool_template), asCALL_CDECL_OBJFIRST);
  285. // void Object::UnsubscribeFromEvent(StringHash eventType) | File: ../Core/Object.h
  286. engine->RegisterObjectMethod(className, "void UnsubscribeFromEvent(StringHash)", asMETHODPR(T, UnsubscribeFromEvent, (StringHash), void), asCALL_THISCALL);
  287. // void Object::UnsubscribeFromEvent(Object* sender, StringHash eventType) | File: ../Core/Object.h
  288. engine->RegisterObjectMethod(className, "void UnsubscribeFromEvent(Object@+, StringHash)", asMETHODPR(T, UnsubscribeFromEvent, (Object*, StringHash), void), asCALL_THISCALL);
  289. // void Object::UnsubscribeFromEvents(Object* sender) | File: ../Core/Object.h
  290. engine->RegisterObjectMethod(className, "void UnsubscribeFromEvents(Object@+)", asMETHODPR(T, UnsubscribeFromEvents, (Object*), void), asCALL_THISCALL);
  291. // int RefCounted::WeakRefs() const | File: ../Container/RefCounted.h
  292. engine->RegisterObjectMethod(className, "int WeakRefs() const", asMETHODPR(T, WeakRefs, () const, int), asCALL_THISCALL);
  293. engine->RegisterObjectMethod(className, "int get_weakRefs() const", asMETHODPR(T, WeakRefs, () const, int), asCALL_THISCALL);
  294. // void Serializable::WriteDeltaUpdate(Serializer& dest, const DirtyBits& attributeBits, unsigned char timeStamp) | File: ../Scene/Serializable.h
  295. engine->RegisterObjectMethod(className, "void WriteDeltaUpdate(Serializer&, const DirtyBits&in, uint8)", asMETHODPR(T, WriteDeltaUpdate, (Serializer&, const DirtyBits&, unsigned char), void), asCALL_THISCALL);
  296. // void Serializable::WriteInitialDeltaUpdate(Serializer& dest, unsigned char timeStamp) | File: ../Scene/Serializable.h
  297. engine->RegisterObjectMethod(className, "void WriteInitialDeltaUpdate(Serializer&, uint8)", asMETHODPR(T, WriteInitialDeltaUpdate, (Serializer&, unsigned char), void), asCALL_THISCALL);
  298. // void Serializable::WriteLatestDataUpdate(Serializer& dest, unsigned char timeStamp) | File: ../Scene/Serializable.h
  299. engine->RegisterObjectMethod(className, "void WriteLatestDataUpdate(Serializer&, uint8)", asMETHODPR(T, WriteLatestDataUpdate, (Serializer&, unsigned char), void), asCALL_THISCALL);
  300. #ifdef REGISTER_MANUAL_PART_Animatable
  301. REGISTER_MANUAL_PART_Animatable(T, className)
  302. #endif
  303. #ifdef REGISTER_MANUAL_PART_Serializable
  304. REGISTER_MANUAL_PART_Serializable(T, className)
  305. #endif
  306. #ifdef REGISTER_MANUAL_PART_Object
  307. REGISTER_MANUAL_PART_Object(T, className)
  308. #endif
  309. #ifdef REGISTER_MANUAL_PART_RefCounted
  310. REGISTER_MANUAL_PART_RefCounted(T, className)
  311. #endif
  312. #ifdef REGISTER_MANUAL_PART_Component
  313. REGISTER_MANUAL_PART_Component(T, className)
  314. #endif
  315. RegisterSubclass<Animatable, T>(engine, "Animatable", className);
  316. RegisterSubclass<Serializable, T>(engine, "Serializable", className);
  317. RegisterSubclass<Object, T>(engine, "Object", className);
  318. RegisterSubclass<RefCounted, T>(engine, "RefCounted", className);
  319. RegisterSubclass<Component, T>(engine, "Component", className);
  320. }
  321. template <class T> void RegisterObject(asIScriptEngine* engine, const char* className)
  322. {
  323. // class Object | File: ../Core/Object.h
  324. engine->RegisterObjectType(className, 0, asOBJ_REF);
  325. // void RefCounted::AddRef() | File: ../Container/RefCounted.h
  326. engine->RegisterObjectBehaviour(className, asBEHAVE_ADDREF, "void f()", asMETHODPR(T, AddRef, (), void), asCALL_THISCALL);
  327. // template<typename T> T* Object::Cast() | File: ../Core/Object.h
  328. // Not registered because template
  329. // template<typename T> const T* Object::Cast() const | File: ../Core/Object.h
  330. // Not registered because template
  331. // bool Object::GetBlockEvents() const | File: ../Core/Object.h
  332. engine->RegisterObjectMethod(className, "bool GetBlockEvents() const", asMETHODPR(T, GetBlockEvents, () const, bool), asCALL_THISCALL);
  333. // const String& Object::GetCategory() const | File: ../Core/Object.h
  334. engine->RegisterObjectMethod(className, "const String& GetCategory() const", asMETHODPR(T, GetCategory, () const, const String&), asCALL_THISCALL);
  335. engine->RegisterObjectMethod(className, "const String& get_category() const", asMETHODPR(T, GetCategory, () const, const String&), asCALL_THISCALL);
  336. // Context* Object::GetContext() const | File: ../Core/Object.h
  337. // Error: type "Context*" can not be returned
  338. // VariantMap& Object::GetEventDataMap() const | File: ../Core/Object.h
  339. engine->RegisterObjectMethod(className, "VariantMap& GetEventDataMap() const", asMETHODPR(T, GetEventDataMap, () const, VariantMap&), asCALL_THISCALL);
  340. // EventHandler* Object::GetEventHandler() const | File: ../Core/Object.h
  341. // Error: type "EventHandler*" can not automatically bind
  342. // Object* Object::GetEventSender() const | File: ../Core/Object.h
  343. engine->RegisterObjectMethod(className, "Object@+ GetEventSender() const", asMETHODPR(T, GetEventSender, () const, Object*), asCALL_THISCALL);
  344. // const Variant& Object::GetGlobalVar(StringHash key) const | File: ../Core/Object.h
  345. engine->RegisterObjectMethod(className, "const Variant& GetGlobalVar(StringHash) const", asMETHODPR(T, GetGlobalVar, (StringHash) const, const Variant&), asCALL_THISCALL);
  346. engine->RegisterObjectMethod(className, "const Variant& get_globalVar(StringHash) const", asMETHODPR(T, GetGlobalVar, (StringHash) const, const Variant&), asCALL_THISCALL);
  347. // const VariantMap& Object::GetGlobalVars() const | File: ../Core/Object.h
  348. engine->RegisterObjectMethod(className, "const VariantMap& GetGlobalVars() const", asMETHODPR(T, GetGlobalVars, () const, const VariantMap&), asCALL_THISCALL);
  349. engine->RegisterObjectMethod(className, "const VariantMap& get_globalVars() const", asMETHODPR(T, GetGlobalVars, () const, const VariantMap&), asCALL_THISCALL);
  350. // Object* Object::GetSubsystem(StringHash type) const | File: ../Core/Object.h
  351. engine->RegisterObjectMethod(className, "Object@+ GetSubsystem(StringHash) const", asMETHODPR(T, GetSubsystem, (StringHash) const, Object*), asCALL_THISCALL);
  352. // template<class T> T* Object::GetSubsystem() const | File: ../Core/Object.h
  353. // Not registered because template
  354. // virtual StringHash Object::GetType() const =0 | File: ../Core/Object.h
  355. engine->RegisterObjectMethod(className, "StringHash GetType() const", asMETHODPR(T, GetType, () const, StringHash), asCALL_THISCALL);
  356. engine->RegisterObjectMethod(className, "StringHash get_type() const", asMETHODPR(T, GetType, () const, StringHash), asCALL_THISCALL);
  357. // virtual const TypeInfo* Object::GetTypeInfo() const =0 | File: ../Core/Object.h
  358. // Error: type "TypeInfo" can not automatically bind bacause have @nobind mark
  359. // static const TypeInfo* Object::GetTypeInfoStatic() | File: ../Core/Object.h
  360. // Error: type "TypeInfo" can not automatically bind bacause have @nobind mark
  361. // virtual const String& Object::GetTypeName() const =0 | File: ../Core/Object.h
  362. engine->RegisterObjectMethod(className, "const String& GetTypeName() const", asMETHODPR(T, GetTypeName, () const, const String&), asCALL_THISCALL);
  363. engine->RegisterObjectMethod(className, "const String& get_typeName() const", asMETHODPR(T, GetTypeName, () const, const String&), asCALL_THISCALL);
  364. // bool Object::HasEventHandlers() const | File: ../Core/Object.h
  365. engine->RegisterObjectMethod(className, "bool HasEventHandlers() const", asMETHODPR(T, HasEventHandlers, () const, bool), asCALL_THISCALL);
  366. // bool Object::HasSubscribedToEvent(StringHash eventType) const | File: ../Core/Object.h
  367. engine->RegisterObjectMethod(className, "bool HasSubscribedToEvent(StringHash) const", asMETHODPR(T, HasSubscribedToEvent, (StringHash) const, bool), asCALL_THISCALL);
  368. // bool Object::HasSubscribedToEvent(Object* sender, StringHash eventType) const | File: ../Core/Object.h
  369. engine->RegisterObjectMethod(className, "bool HasSubscribedToEvent(Object@+, StringHash) const", asMETHODPR(T, HasSubscribedToEvent, (Object*, StringHash) const, bool), asCALL_THISCALL);
  370. // bool Object::IsInstanceOf(StringHash type) const | File: ../Core/Object.h
  371. engine->RegisterObjectMethod(className, "bool IsInstanceOf(StringHash) const", asMETHODPR(T, IsInstanceOf, (StringHash) const, bool), asCALL_THISCALL);
  372. // bool Object::IsInstanceOf(const TypeInfo* typeInfo) const | File: ../Core/Object.h
  373. // Error: type "TypeInfo" can not automatically bind bacause have @nobind mark
  374. // template<typename T> bool Object::IsInstanceOf() const | File: ../Core/Object.h
  375. // Not registered because template
  376. // virtual void Object::OnEvent(Object* sender, StringHash eventType, VariantMap& eventData) | File: ../Core/Object.h
  377. engine->RegisterObjectMethod(className, "void OnEvent(Object@+, StringHash, VariantMap&)", asMETHODPR(T, OnEvent, (Object*, StringHash, VariantMap&), void), asCALL_THISCALL);
  378. // RefCount* RefCounted::RefCountPtr() | File: ../Container/RefCounted.h
  379. // Error: type "RefCount*" can not automatically bind
  380. // int RefCounted::Refs() const | File: ../Container/RefCounted.h
  381. engine->RegisterObjectMethod(className, "int Refs() const", asMETHODPR(T, Refs, () const, int), asCALL_THISCALL);
  382. engine->RegisterObjectMethod(className, "int get_refs() const", asMETHODPR(T, Refs, () const, int), asCALL_THISCALL);
  383. // void RefCounted::ReleaseRef() | File: ../Container/RefCounted.h
  384. engine->RegisterObjectBehaviour(className, asBEHAVE_RELEASE, "void f()", asMETHODPR(T, ReleaseRef, (), void), asCALL_THISCALL);
  385. // void Object::SendEvent(StringHash eventType) | File: ../Core/Object.h
  386. engine->RegisterObjectMethod(className, "void SendEvent(StringHash)", asMETHODPR(T, SendEvent, (StringHash), void), asCALL_THISCALL);
  387. // void Object::SendEvent(StringHash eventType, VariantMap& eventData) | File: ../Core/Object.h
  388. engine->RegisterObjectMethod(className, "void SendEvent(StringHash, VariantMap&)", asMETHODPR(T, SendEvent, (StringHash, VariantMap&), void), asCALL_THISCALL);
  389. // template<typename... Args> void Object::SendEvent(StringHash eventType, Args... args) | File: ../Core/Object.h
  390. // Not registered because template
  391. // void Object::SetBlockEvents(bool block) | File: ../Core/Object.h
  392. engine->RegisterObjectMethod(className, "void SetBlockEvents(bool)", asMETHODPR(T, SetBlockEvents, (bool), void), asCALL_THISCALL);
  393. // void Object::SetGlobalVar(StringHash key, const Variant& value) | File: ../Core/Object.h
  394. engine->RegisterObjectMethod(className, "void SetGlobalVar(StringHash, const Variant&in)", asMETHODPR(T, SetGlobalVar, (StringHash, const Variant&), void), asCALL_THISCALL);
  395. engine->RegisterObjectMethod(className, "void set_globalVar(StringHash, const Variant&in)", asMETHODPR(T, SetGlobalVar, (StringHash, const Variant&), void), asCALL_THISCALL);
  396. // void Object::SubscribeToEvent(StringHash eventType, EventHandler* handler) | File: ../Core/Object.h
  397. // Error: type "EventHandler*" can not automatically bind
  398. // void Object::SubscribeToEvent(Object* sender, StringHash eventType, EventHandler* handler) | File: ../Core/Object.h
  399. // Error: type "EventHandler*" can not automatically bind
  400. // void Object::SubscribeToEvent(StringHash eventType, const std::function<void(StringHash, VariantMap&)>& function, void* userData=nullptr) | File: ../Core/Object.h
  401. // Error: type "const std::function<void(StringHash, VariantMap&)>&" can not automatically bind
  402. // void Object::SubscribeToEvent(Object* sender, StringHash eventType, const std::function<void(StringHash, VariantMap&)>& function, void* userData=nullptr) | File: ../Core/Object.h
  403. // Error: type "const std::function<void(StringHash, VariantMap&)>&" can not automatically bind
  404. // void Object::UnsubscribeFromAllEvents() | File: ../Core/Object.h
  405. engine->RegisterObjectMethod(className, "void UnsubscribeFromAllEvents()", asMETHODPR(T, UnsubscribeFromAllEvents, (), void), asCALL_THISCALL);
  406. // void Object::UnsubscribeFromAllEventsExcept(const PODVector<StringHash>& exceptions, bool onlyUserData) | File: ../Core/Object.h
  407. engine->RegisterObjectMethod(className, "void UnsubscribeFromAllEventsExcept(Array<StringHash>@+, bool)", asFUNCTION(Object_UnsubscribeFromAllEventsExcept_PODVectorStringHash_bool_template), asCALL_CDECL_OBJFIRST);
  408. // void Object::UnsubscribeFromEvent(StringHash eventType) | File: ../Core/Object.h
  409. engine->RegisterObjectMethod(className, "void UnsubscribeFromEvent(StringHash)", asMETHODPR(T, UnsubscribeFromEvent, (StringHash), void), asCALL_THISCALL);
  410. // void Object::UnsubscribeFromEvent(Object* sender, StringHash eventType) | File: ../Core/Object.h
  411. engine->RegisterObjectMethod(className, "void UnsubscribeFromEvent(Object@+, StringHash)", asMETHODPR(T, UnsubscribeFromEvent, (Object*, StringHash), void), asCALL_THISCALL);
  412. // void Object::UnsubscribeFromEvents(Object* sender) | File: ../Core/Object.h
  413. engine->RegisterObjectMethod(className, "void UnsubscribeFromEvents(Object@+)", asMETHODPR(T, UnsubscribeFromEvents, (Object*), void), asCALL_THISCALL);
  414. // int RefCounted::WeakRefs() const | File: ../Container/RefCounted.h
  415. engine->RegisterObjectMethod(className, "int WeakRefs() const", asMETHODPR(T, WeakRefs, () const, int), asCALL_THISCALL);
  416. engine->RegisterObjectMethod(className, "int get_weakRefs() const", asMETHODPR(T, WeakRefs, () const, int), asCALL_THISCALL);
  417. #ifdef REGISTER_MANUAL_PART_RefCounted
  418. REGISTER_MANUAL_PART_RefCounted(T, className)
  419. #endif
  420. #ifdef REGISTER_MANUAL_PART_Object
  421. REGISTER_MANUAL_PART_Object(T, className)
  422. #endif
  423. RegisterSubclass<RefCounted, T>(engine, "RefCounted", className);
  424. RegisterSubclass<Object, T>(engine, "Object", className);
  425. }
  426. template <class T> void RegisterResource(asIScriptEngine* engine, const char* className)
  427. {
  428. // class Resource | File: ../Resource/Resource.h
  429. engine->RegisterObjectType(className, 0, asOBJ_REF);
  430. // void RefCounted::AddRef() | File: ../Container/RefCounted.h
  431. engine->RegisterObjectBehaviour(className, asBEHAVE_ADDREF, "void f()", asMETHODPR(T, AddRef, (), void), asCALL_THISCALL);
  432. // virtual bool Resource::BeginLoad(Deserializer& source) | File: ../Resource/Resource.h
  433. engine->RegisterObjectMethod(className, "bool BeginLoad(Deserializer&)", asMETHODPR(T, BeginLoad, (Deserializer&), bool), asCALL_THISCALL);
  434. // template<typename T> T* Object::Cast() | File: ../Core/Object.h
  435. // Not registered because template
  436. // template<typename T> const T* Object::Cast() const | File: ../Core/Object.h
  437. // Not registered because template
  438. // virtual bool Resource::EndLoad() | File: ../Resource/Resource.h
  439. engine->RegisterObjectMethod(className, "bool EndLoad()", asMETHODPR(T, EndLoad, (), bool), asCALL_THISCALL);
  440. // AsyncLoadState Resource::GetAsyncLoadState() const | File: ../Resource/Resource.h
  441. engine->RegisterObjectMethod(className, "AsyncLoadState GetAsyncLoadState() const", asMETHODPR(T, GetAsyncLoadState, () const, AsyncLoadState), asCALL_THISCALL);
  442. // bool Object::GetBlockEvents() const | File: ../Core/Object.h
  443. engine->RegisterObjectMethod(className, "bool GetBlockEvents() const", asMETHODPR(T, GetBlockEvents, () const, bool), asCALL_THISCALL);
  444. // const String& Object::GetCategory() const | File: ../Core/Object.h
  445. engine->RegisterObjectMethod(className, "const String& GetCategory() const", asMETHODPR(T, GetCategory, () const, const String&), asCALL_THISCALL);
  446. engine->RegisterObjectMethod(className, "const String& get_category() const", asMETHODPR(T, GetCategory, () const, const String&), asCALL_THISCALL);
  447. // Context* Object::GetContext() const | File: ../Core/Object.h
  448. // Error: type "Context*" can not be returned
  449. // VariantMap& Object::GetEventDataMap() const | File: ../Core/Object.h
  450. engine->RegisterObjectMethod(className, "VariantMap& GetEventDataMap() const", asMETHODPR(T, GetEventDataMap, () const, VariantMap&), asCALL_THISCALL);
  451. // EventHandler* Object::GetEventHandler() const | File: ../Core/Object.h
  452. // Error: type "EventHandler*" can not automatically bind
  453. // Object* Object::GetEventSender() const | File: ../Core/Object.h
  454. engine->RegisterObjectMethod(className, "Object@+ GetEventSender() const", asMETHODPR(T, GetEventSender, () const, Object*), asCALL_THISCALL);
  455. // const Variant& Object::GetGlobalVar(StringHash key) const | File: ../Core/Object.h
  456. engine->RegisterObjectMethod(className, "const Variant& GetGlobalVar(StringHash) const", asMETHODPR(T, GetGlobalVar, (StringHash) const, const Variant&), asCALL_THISCALL);
  457. engine->RegisterObjectMethod(className, "const Variant& get_globalVar(StringHash) const", asMETHODPR(T, GetGlobalVar, (StringHash) const, const Variant&), asCALL_THISCALL);
  458. // const VariantMap& Object::GetGlobalVars() const | File: ../Core/Object.h
  459. engine->RegisterObjectMethod(className, "const VariantMap& GetGlobalVars() const", asMETHODPR(T, GetGlobalVars, () const, const VariantMap&), asCALL_THISCALL);
  460. engine->RegisterObjectMethod(className, "const VariantMap& get_globalVars() const", asMETHODPR(T, GetGlobalVars, () const, const VariantMap&), asCALL_THISCALL);
  461. // unsigned Resource::GetMemoryUse() const | File: ../Resource/Resource.h
  462. engine->RegisterObjectMethod(className, "uint GetMemoryUse() const", asMETHODPR(T, GetMemoryUse, () const, unsigned), asCALL_THISCALL);
  463. engine->RegisterObjectMethod(className, "uint get_memoryUse() const", asMETHODPR(T, GetMemoryUse, () const, unsigned), asCALL_THISCALL);
  464. // const String& Resource::GetName() const | File: ../Resource/Resource.h
  465. engine->RegisterObjectMethod(className, "const String& GetName() const", asMETHODPR(T, GetName, () const, const String&), asCALL_THISCALL);
  466. engine->RegisterObjectMethod(className, "const String& get_name() const", asMETHODPR(T, GetName, () const, const String&), asCALL_THISCALL);
  467. // StringHash Resource::GetNameHash() const | File: ../Resource/Resource.h
  468. engine->RegisterObjectMethod(className, "StringHash GetNameHash() const", asMETHODPR(T, GetNameHash, () const, StringHash), asCALL_THISCALL);
  469. // Object* Object::GetSubsystem(StringHash type) const | File: ../Core/Object.h
  470. engine->RegisterObjectMethod(className, "Object@+ GetSubsystem(StringHash) const", asMETHODPR(T, GetSubsystem, (StringHash) const, Object*), asCALL_THISCALL);
  471. // template<class T> T* Object::GetSubsystem() const | File: ../Core/Object.h
  472. // Not registered because template
  473. // virtual StringHash Object::GetType() const =0 | File: ../Core/Object.h
  474. engine->RegisterObjectMethod(className, "StringHash GetType() const", asMETHODPR(T, GetType, () const, StringHash), asCALL_THISCALL);
  475. engine->RegisterObjectMethod(className, "StringHash get_type() const", asMETHODPR(T, GetType, () const, StringHash), asCALL_THISCALL);
  476. // virtual const TypeInfo* Object::GetTypeInfo() const =0 | File: ../Core/Object.h
  477. // Error: type "TypeInfo" can not automatically bind bacause have @nobind mark
  478. // static const TypeInfo* Object::GetTypeInfoStatic() | File: ../Core/Object.h
  479. // Error: type "TypeInfo" can not automatically bind bacause have @nobind mark
  480. // virtual const String& Object::GetTypeName() const =0 | File: ../Core/Object.h
  481. engine->RegisterObjectMethod(className, "const String& GetTypeName() const", asMETHODPR(T, GetTypeName, () const, const String&), asCALL_THISCALL);
  482. engine->RegisterObjectMethod(className, "const String& get_typeName() const", asMETHODPR(T, GetTypeName, () const, const String&), asCALL_THISCALL);
  483. // unsigned Resource::GetUseTimer() | File: ../Resource/Resource.h
  484. engine->RegisterObjectMethod(className, "uint GetUseTimer()", asMETHODPR(T, GetUseTimer, (), unsigned), asCALL_THISCALL);
  485. engine->RegisterObjectMethod(className, "uint get_useTimer()", asMETHODPR(T, GetUseTimer, (), unsigned), asCALL_THISCALL);
  486. // bool Object::HasEventHandlers() const | File: ../Core/Object.h
  487. engine->RegisterObjectMethod(className, "bool HasEventHandlers() const", asMETHODPR(T, HasEventHandlers, () const, bool), asCALL_THISCALL);
  488. // bool Object::HasSubscribedToEvent(StringHash eventType) const | File: ../Core/Object.h
  489. engine->RegisterObjectMethod(className, "bool HasSubscribedToEvent(StringHash) const", asMETHODPR(T, HasSubscribedToEvent, (StringHash) const, bool), asCALL_THISCALL);
  490. // bool Object::HasSubscribedToEvent(Object* sender, StringHash eventType) const | File: ../Core/Object.h
  491. engine->RegisterObjectMethod(className, "bool HasSubscribedToEvent(Object@+, StringHash) const", asMETHODPR(T, HasSubscribedToEvent, (Object*, StringHash) const, bool), asCALL_THISCALL);
  492. // bool Object::IsInstanceOf(StringHash type) const | File: ../Core/Object.h
  493. engine->RegisterObjectMethod(className, "bool IsInstanceOf(StringHash) const", asMETHODPR(T, IsInstanceOf, (StringHash) const, bool), asCALL_THISCALL);
  494. // bool Object::IsInstanceOf(const TypeInfo* typeInfo) const | File: ../Core/Object.h
  495. // Error: type "TypeInfo" can not automatically bind bacause have @nobind mark
  496. // template<typename T> bool Object::IsInstanceOf() const | File: ../Core/Object.h
  497. // Not registered because template
  498. // bool Resource::Load(Deserializer& source) | File: ../Resource/Resource.h
  499. engine->RegisterObjectMethod(className, "bool Load(Deserializer&)", asMETHODPR(T, Load, (Deserializer&), bool), asCALL_THISCALL);
  500. // bool Resource::LoadFile(const String& fileName) | File: ../Resource/Resource.h
  501. engine->RegisterObjectMethod(className, "bool LoadFile(const String&in)", asMETHODPR(T, LoadFile, (const String&), bool), asCALL_THISCALL);
  502. engine->RegisterObjectMethod(className, "bool Load(const String&in)", asMETHODPR(T, LoadFile, (const String&), bool), asCALL_THISCALL);
  503. // virtual void Object::OnEvent(Object* sender, StringHash eventType, VariantMap& eventData) | File: ../Core/Object.h
  504. engine->RegisterObjectMethod(className, "void OnEvent(Object@+, StringHash, VariantMap&)", asMETHODPR(T, OnEvent, (Object*, StringHash, VariantMap&), void), asCALL_THISCALL);
  505. // RefCount* RefCounted::RefCountPtr() | File: ../Container/RefCounted.h
  506. // Error: type "RefCount*" can not automatically bind
  507. // int RefCounted::Refs() const | File: ../Container/RefCounted.h
  508. engine->RegisterObjectMethod(className, "int Refs() const", asMETHODPR(T, Refs, () const, int), asCALL_THISCALL);
  509. engine->RegisterObjectMethod(className, "int get_refs() const", asMETHODPR(T, Refs, () const, int), asCALL_THISCALL);
  510. // void RefCounted::ReleaseRef() | File: ../Container/RefCounted.h
  511. engine->RegisterObjectBehaviour(className, asBEHAVE_RELEASE, "void f()", asMETHODPR(T, ReleaseRef, (), void), asCALL_THISCALL);
  512. // void Resource::ResetUseTimer() | File: ../Resource/Resource.h
  513. engine->RegisterObjectMethod(className, "void ResetUseTimer()", asMETHODPR(T, ResetUseTimer, (), void), asCALL_THISCALL);
  514. // explicit Resource::Resource(Context* context) | File: ../Resource/Resource.h
  515. {
  516. String declFactory(String(className) + "@ f()");
  517. engine->RegisterObjectBehaviour(className, asBEHAVE_FACTORY, declFactory.CString(), asFUNCTION(Resource_Resource_Context_template), asCALL_CDECL);
  518. }
  519. // virtual bool Resource::Save(Serializer& dest) const | File: ../Resource/Resource.h
  520. engine->RegisterObjectMethod(className, "bool Save(Serializer&) const", asMETHODPR(T, Save, (Serializer&) const, bool), asCALL_THISCALL);
  521. // virtual bool Resource::SaveFile(const String& fileName) const | File: ../Resource/Resource.h
  522. engine->RegisterObjectMethod(className, "bool SaveFile(const String&in) const", asMETHODPR(T, SaveFile, (const String&) const, bool), asCALL_THISCALL);
  523. engine->RegisterObjectMethod(className, "bool Save(const String&in) const", asMETHODPR(T, SaveFile, (const String&) const, bool), asCALL_THISCALL);
  524. // void Object::SendEvent(StringHash eventType) | File: ../Core/Object.h
  525. engine->RegisterObjectMethod(className, "void SendEvent(StringHash)", asMETHODPR(T, SendEvent, (StringHash), void), asCALL_THISCALL);
  526. // void Object::SendEvent(StringHash eventType, VariantMap& eventData) | File: ../Core/Object.h
  527. engine->RegisterObjectMethod(className, "void SendEvent(StringHash, VariantMap&)", asMETHODPR(T, SendEvent, (StringHash, VariantMap&), void), asCALL_THISCALL);
  528. // template<typename... Args> void Object::SendEvent(StringHash eventType, Args... args) | File: ../Core/Object.h
  529. // Not registered because template
  530. // void Resource::SetAsyncLoadState(AsyncLoadState newState) | File: ../Resource/Resource.h
  531. engine->RegisterObjectMethod(className, "void SetAsyncLoadState(AsyncLoadState)", asMETHODPR(T, SetAsyncLoadState, (AsyncLoadState), void), asCALL_THISCALL);
  532. // void Object::SetBlockEvents(bool block) | File: ../Core/Object.h
  533. engine->RegisterObjectMethod(className, "void SetBlockEvents(bool)", asMETHODPR(T, SetBlockEvents, (bool), void), asCALL_THISCALL);
  534. // void Object::SetGlobalVar(StringHash key, const Variant& value) | File: ../Core/Object.h
  535. engine->RegisterObjectMethod(className, "void SetGlobalVar(StringHash, const Variant&in)", asMETHODPR(T, SetGlobalVar, (StringHash, const Variant&), void), asCALL_THISCALL);
  536. engine->RegisterObjectMethod(className, "void set_globalVar(StringHash, const Variant&in)", asMETHODPR(T, SetGlobalVar, (StringHash, const Variant&), void), asCALL_THISCALL);
  537. // void Resource::SetMemoryUse(unsigned size) | File: ../Resource/Resource.h
  538. engine->RegisterObjectMethod(className, "void SetMemoryUse(uint)", asMETHODPR(T, SetMemoryUse, (unsigned), void), asCALL_THISCALL);
  539. // void Resource::SetName(const String& name) | File: ../Resource/Resource.h
  540. engine->RegisterObjectMethod(className, "void SetName(const String&in)", asMETHODPR(T, SetName, (const String&), void), asCALL_THISCALL);
  541. engine->RegisterObjectMethod(className, "void set_name(const String&in)", asMETHODPR(T, SetName, (const String&), void), asCALL_THISCALL);
  542. // void Object::SubscribeToEvent(StringHash eventType, EventHandler* handler) | File: ../Core/Object.h
  543. // Error: type "EventHandler*" can not automatically bind
  544. // void Object::SubscribeToEvent(Object* sender, StringHash eventType, EventHandler* handler) | File: ../Core/Object.h
  545. // Error: type "EventHandler*" can not automatically bind
  546. // void Object::SubscribeToEvent(StringHash eventType, const std::function<void(StringHash, VariantMap&)>& function, void* userData=nullptr) | File: ../Core/Object.h
  547. // Error: type "const std::function<void(StringHash, VariantMap&)>&" can not automatically bind
  548. // void Object::SubscribeToEvent(Object* sender, StringHash eventType, const std::function<void(StringHash, VariantMap&)>& function, void* userData=nullptr) | File: ../Core/Object.h
  549. // Error: type "const std::function<void(StringHash, VariantMap&)>&" can not automatically bind
  550. // void Object::UnsubscribeFromAllEvents() | File: ../Core/Object.h
  551. engine->RegisterObjectMethod(className, "void UnsubscribeFromAllEvents()", asMETHODPR(T, UnsubscribeFromAllEvents, (), void), asCALL_THISCALL);
  552. // void Object::UnsubscribeFromAllEventsExcept(const PODVector<StringHash>& exceptions, bool onlyUserData) | File: ../Core/Object.h
  553. engine->RegisterObjectMethod(className, "void UnsubscribeFromAllEventsExcept(Array<StringHash>@+, bool)", asFUNCTION(Resource_UnsubscribeFromAllEventsExcept_PODVectorStringHash_bool_template), asCALL_CDECL_OBJFIRST);
  554. // void Object::UnsubscribeFromEvent(StringHash eventType) | File: ../Core/Object.h
  555. engine->RegisterObjectMethod(className, "void UnsubscribeFromEvent(StringHash)", asMETHODPR(T, UnsubscribeFromEvent, (StringHash), void), asCALL_THISCALL);
  556. // void Object::UnsubscribeFromEvent(Object* sender, StringHash eventType) | File: ../Core/Object.h
  557. engine->RegisterObjectMethod(className, "void UnsubscribeFromEvent(Object@+, StringHash)", asMETHODPR(T, UnsubscribeFromEvent, (Object*, StringHash), void), asCALL_THISCALL);
  558. // void Object::UnsubscribeFromEvents(Object* sender) | File: ../Core/Object.h
  559. engine->RegisterObjectMethod(className, "void UnsubscribeFromEvents(Object@+)", asMETHODPR(T, UnsubscribeFromEvents, (Object*), void), asCALL_THISCALL);
  560. // int RefCounted::WeakRefs() const | File: ../Container/RefCounted.h
  561. engine->RegisterObjectMethod(className, "int WeakRefs() const", asMETHODPR(T, WeakRefs, () const, int), asCALL_THISCALL);
  562. engine->RegisterObjectMethod(className, "int get_weakRefs() const", asMETHODPR(T, WeakRefs, () const, int), asCALL_THISCALL);
  563. #ifdef REGISTER_MANUAL_PART_Object
  564. REGISTER_MANUAL_PART_Object(T, className)
  565. #endif
  566. #ifdef REGISTER_MANUAL_PART_RefCounted
  567. REGISTER_MANUAL_PART_RefCounted(T, className)
  568. #endif
  569. #ifdef REGISTER_MANUAL_PART_Resource
  570. REGISTER_MANUAL_PART_Resource(T, className)
  571. #endif
  572. RegisterSubclass<Object, T>(engine, "Object", className);
  573. RegisterSubclass<RefCounted, T>(engine, "RefCounted", className);
  574. RegisterSubclass<Resource, T>(engine, "Resource", className);
  575. }
  576. }