| 
									
										
										
										
											2019-11-22 08:37:09 +01:00
										 |  |  | /*************************************************************************/ | 
					
						
							|  |  |  | /*  gd_mono_cache.h                                                      */ | 
					
						
							|  |  |  | /*************************************************************************/ | 
					
						
							|  |  |  | /*                       This file is part of:                           */ | 
					
						
							|  |  |  | /*                           GODOT ENGINE                                */ | 
					
						
							|  |  |  | /*                      https://godotengine.org                          */ | 
					
						
							|  |  |  | /*************************************************************************/ | 
					
						
							| 
									
										
										
										
											2022-01-03 21:27:34 +01:00
										 |  |  | /* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur.                 */ | 
					
						
							|  |  |  | /* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md).   */ | 
					
						
							| 
									
										
										
										
											2019-11-22 08:37:09 +01:00
										 |  |  | /*                                                                       */ | 
					
						
							|  |  |  | /* Permission is hereby granted, free of charge, to any person obtaining */ | 
					
						
							|  |  |  | /* a copy of this software and associated documentation files (the       */ | 
					
						
							|  |  |  | /* "Software"), to deal in the Software without restriction, including   */ | 
					
						
							|  |  |  | /* without limitation the rights to use, copy, modify, merge, publish,   */ | 
					
						
							|  |  |  | /* distribute, sublicense, and/or sell copies of the Software, and to    */ | 
					
						
							|  |  |  | /* permit persons to whom the Software is furnished to do so, subject to */ | 
					
						
							|  |  |  | /* the following conditions:                                             */ | 
					
						
							|  |  |  | /*                                                                       */ | 
					
						
							|  |  |  | /* The above copyright notice and this permission notice shall be        */ | 
					
						
							|  |  |  | /* included in all copies or substantial portions of the Software.       */ | 
					
						
							|  |  |  | /*                                                                       */ | 
					
						
							|  |  |  | /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,       */ | 
					
						
							|  |  |  | /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF    */ | 
					
						
							|  |  |  | /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ | 
					
						
							|  |  |  | /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY  */ | 
					
						
							|  |  |  | /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,  */ | 
					
						
							|  |  |  | /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE     */ | 
					
						
							|  |  |  | /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                */ | 
					
						
							|  |  |  | /*************************************************************************/ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-11-10 17:10:38 +01:00
										 |  |  | #ifndef GD_MONO_CACHE_H
 | 
					
						
							|  |  |  | #define GD_MONO_CACHE_H
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-12 20:23:05 +02:00
										 |  |  | #include <stdint.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include "../csharp_script.h"
 | 
					
						
							| 
									
										
										
										
											2022-02-27 21:57:30 +01:00
										 |  |  | #include "../interop_types.h"
 | 
					
						
							| 
									
										
										
										
											2021-09-12 20:23:05 +02:00
										 |  |  | #include "../mono_gc_handle.h"
 | 
					
						
							|  |  |  | #include "core/object/object.h"
 | 
					
						
							|  |  |  | #include "core/string/string_name.h"
 | 
					
						
							|  |  |  | #include "core/string/ustring.h"
 | 
					
						
							|  |  |  | #include "core/variant/callable.h"
 | 
					
						
							|  |  |  | #include "core/variant/dictionary.h"
 | 
					
						
							|  |  |  | #include "core/variant/variant.h"
 | 
					
						
							| 
									
										
										
										
											2019-11-10 17:10:38 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-12 20:21:15 +02:00
										 |  |  | class CSharpScript; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-11-10 17:10:38 +01:00
										 |  |  | namespace GDMonoCache { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-12 20:23:05 +02:00
										 |  |  | #ifdef WIN32
 | 
					
						
							|  |  |  | #define GD_CLR_STDCALL __stdcall
 | 
					
						
							|  |  |  | #else
 | 
					
						
							|  |  |  | #define GD_CLR_STDCALL
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-02-27 21:57:30 +01:00
										 |  |  | struct godotsharp_property_info { | 
					
						
							|  |  |  | 	godot_string_name name; // Not owned
 | 
					
						
							|  |  |  | 	godot_string hint_string; | 
					
						
							|  |  |  | 	Variant::Type type; | 
					
						
							|  |  |  | 	PropertyHint hint; | 
					
						
							|  |  |  | 	PropertyUsageFlags usage; | 
					
						
							|  |  |  | 	bool exported; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | struct godotsharp_property_def_val_pair { | 
					
						
							|  |  |  | 	godot_string_name name; // Not owned
 | 
					
						
							|  |  |  | 	godot_variant value; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-12 20:23:05 +02:00
										 |  |  | struct ManagedCallbacks { | 
					
						
							| 
									
										
										
										
											2022-02-27 21:57:30 +01:00
										 |  |  | 	using Callback_ScriptManagerBridge_GetPropertyInfoList_Add = void(GD_CLR_STDCALL *)(CSharpScript *p_script, const String *, godotsharp_property_info *p_props, int32_t p_count); | 
					
						
							|  |  |  | 	using Callback_ScriptManagerBridge_GetPropertyDefaultValues_Add = void(GD_CLR_STDCALL *)(CSharpScript *p_script, godotsharp_property_def_val_pair *p_def_vals, int32_t p_count); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-12 20:23:05 +02:00
										 |  |  | 	using FuncSignalAwaiter_SignalCallback = void(GD_CLR_STDCALL *)(GCHandleIntPtr, const Variant **, int32_t, bool *); | 
					
						
							|  |  |  | 	using FuncDelegateUtils_InvokeWithVariantArgs = void(GD_CLR_STDCALL *)(GCHandleIntPtr, const Variant **, uint32_t, const Variant *); | 
					
						
							|  |  |  | 	using FuncDelegateUtils_DelegateEquals = bool(GD_CLR_STDCALL *)(GCHandleIntPtr, GCHandleIntPtr); | 
					
						
							| 
									
										
										
										
											2022-05-28 04:56:46 +02:00
										 |  |  | 	using FuncDelegateUtils_TrySerializeDelegateWithGCHandle = bool(GD_CLR_STDCALL *)(GCHandleIntPtr, const Array *); | 
					
						
							|  |  |  | 	using FuncDelegateUtils_TryDeserializeDelegateWithGCHandle = bool(GD_CLR_STDCALL *)(const Array *, GCHandleIntPtr *); | 
					
						
							| 
									
										
										
										
											2021-09-12 20:23:05 +02:00
										 |  |  | 	using FuncScriptManagerBridge_FrameCallback = void(GD_CLR_STDCALL *)(); | 
					
						
							|  |  |  | 	using FuncScriptManagerBridge_CreateManagedForGodotObjectBinding = GCHandleIntPtr(GD_CLR_STDCALL *)(const StringName *, Object *); | 
					
						
							| 
									
										
										
										
											2022-02-27 21:57:30 +01:00
										 |  |  | 	using FuncScriptManagerBridge_CreateManagedForGodotObjectScriptInstance = bool(GD_CLR_STDCALL *)(const CSharpScript *, Object *, const Variant **, int32_t); | 
					
						
							| 
									
										
										
										
											2021-09-12 20:23:05 +02:00
										 |  |  | 	using FuncScriptManagerBridge_GetScriptNativeName = void(GD_CLR_STDCALL *)(const CSharpScript *, StringName *); | 
					
						
							|  |  |  | 	using FuncScriptManagerBridge_SetGodotObjectPtr = void(GD_CLR_STDCALL *)(GCHandleIntPtr, Object *); | 
					
						
							| 
									
										
										
										
											2022-02-27 21:57:30 +01:00
										 |  |  | 	using FuncScriptManagerBridge_RaiseEventSignal = void(GD_CLR_STDCALL *)(GCHandleIntPtr, const StringName *, const Variant **, int32_t, bool *); | 
					
						
							| 
									
										
										
										
											2021-09-12 20:23:05 +02:00
										 |  |  | 	using FuncScriptManagerBridge_ScriptIsOrInherits = bool(GD_CLR_STDCALL *)(const CSharpScript *, const CSharpScript *); | 
					
						
							|  |  |  | 	using FuncScriptManagerBridge_AddScriptBridge = bool(GD_CLR_STDCALL *)(const CSharpScript *, const String *); | 
					
						
							| 
									
										
										
										
											2022-02-27 21:57:36 +01:00
										 |  |  | 	using FuncScriptManagerBridge_GetOrCreateScriptBridgeForPath = void(GD_CLR_STDCALL *)(const String *, Ref<CSharpScript> *); | 
					
						
							| 
									
										
										
										
											2021-09-12 20:23:05 +02:00
										 |  |  | 	using FuncScriptManagerBridge_RemoveScriptBridge = void(GD_CLR_STDCALL *)(const CSharpScript *); | 
					
						
							| 
									
										
										
										
											2022-05-28 04:56:46 +02:00
										 |  |  | 	using FuncScriptManagerBridge_TryReloadRegisteredScriptWithClass = bool(GD_CLR_STDCALL *)(const CSharpScript *); | 
					
						
							| 
									
										
										
										
											2022-07-28 17:41:47 +02:00
										 |  |  | 	using FuncScriptManagerBridge_UpdateScriptClassInfo = void(GD_CLR_STDCALL *)(const CSharpScript *, bool *, Dictionary *, Dictionary *, Ref<CSharpScript> *); | 
					
						
							| 
									
										
										
										
											2021-09-12 20:23:05 +02:00
										 |  |  | 	using FuncScriptManagerBridge_SwapGCHandleForType = bool(GD_CLR_STDCALL *)(GCHandleIntPtr, GCHandleIntPtr *, bool); | 
					
						
							| 
									
										
										
										
											2022-02-27 21:57:30 +01:00
										 |  |  | 	using FuncScriptManagerBridge_GetPropertyInfoList = void(GD_CLR_STDCALL *)(CSharpScript *, Callback_ScriptManagerBridge_GetPropertyInfoList_Add); | 
					
						
							|  |  |  | 	using FuncScriptManagerBridge_GetPropertyDefaultValues = void(GD_CLR_STDCALL *)(CSharpScript *, Callback_ScriptManagerBridge_GetPropertyDefaultValues_Add); | 
					
						
							|  |  |  | 	using FuncCSharpInstanceBridge_Call = bool(GD_CLR_STDCALL *)(GCHandleIntPtr, const StringName *, const Variant **, int32_t, Callable::CallError *, Variant *); | 
					
						
							| 
									
										
										
										
											2021-09-12 20:23:05 +02:00
										 |  |  | 	using FuncCSharpInstanceBridge_Set = bool(GD_CLR_STDCALL *)(GCHandleIntPtr, const StringName *, const Variant *); | 
					
						
							|  |  |  | 	using FuncCSharpInstanceBridge_Get = bool(GD_CLR_STDCALL *)(GCHandleIntPtr, const StringName *, Variant *); | 
					
						
							|  |  |  | 	using FuncCSharpInstanceBridge_CallDispose = void(GD_CLR_STDCALL *)(GCHandleIntPtr, bool); | 
					
						
							|  |  |  | 	using FuncCSharpInstanceBridge_CallToString = void(GD_CLR_STDCALL *)(GCHandleIntPtr, String *, bool *); | 
					
						
							| 
									
										
										
										
											2021-12-28 23:25:16 +01:00
										 |  |  | 	using FuncCSharpInstanceBridge_HasMethodUnknownParams = bool(GD_CLR_STDCALL *)(GCHandleIntPtr, const StringName *); | 
					
						
							| 
									
										
										
										
											2022-05-28 04:56:46 +02:00
										 |  |  | 	using FuncCSharpInstanceBridge_SerializeState = void(GD_CLR_STDCALL *)(GCHandleIntPtr, const Dictionary *, const Dictionary *); | 
					
						
							|  |  |  | 	using FuncCSharpInstanceBridge_DeserializeState = void(GD_CLR_STDCALL *)(GCHandleIntPtr, const Dictionary *, const Dictionary *); | 
					
						
							| 
									
										
										
										
											2021-09-12 20:23:05 +02:00
										 |  |  | 	using FuncGCHandleBridge_FreeGCHandle = void(GD_CLR_STDCALL *)(GCHandleIntPtr); | 
					
						
							| 
									
										
										
										
											2022-02-27 21:57:39 +01:00
										 |  |  | 	using FuncDebuggingUtils_GetCurrentStackInfo = void(GD_CLR_STDCALL *)(Vector<ScriptLanguage::StackInfo> *); | 
					
						
							| 
									
										
										
										
											2021-12-28 23:25:16 +01:00
										 |  |  | 	using FuncDisposablesTracker_OnGodotShuttingDown = void(GD_CLR_STDCALL *)(); | 
					
						
							| 
									
										
										
										
											2022-02-27 21:57:39 +01:00
										 |  |  | 	using FuncGD_OnCoreApiAssemblyLoaded = void(GD_CLR_STDCALL *)(bool); | 
					
						
							| 
									
										
										
										
											2021-09-12 20:23:05 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	FuncSignalAwaiter_SignalCallback SignalAwaiter_SignalCallback; | 
					
						
							|  |  |  | 	FuncDelegateUtils_InvokeWithVariantArgs DelegateUtils_InvokeWithVariantArgs; | 
					
						
							|  |  |  | 	FuncDelegateUtils_DelegateEquals DelegateUtils_DelegateEquals; | 
					
						
							| 
									
										
										
										
											2022-05-28 04:56:46 +02:00
										 |  |  | 	FuncDelegateUtils_TrySerializeDelegateWithGCHandle DelegateUtils_TrySerializeDelegateWithGCHandle; | 
					
						
							|  |  |  | 	FuncDelegateUtils_TryDeserializeDelegateWithGCHandle DelegateUtils_TryDeserializeDelegateWithGCHandle; | 
					
						
							| 
									
										
										
										
											2021-09-12 20:23:05 +02:00
										 |  |  | 	FuncScriptManagerBridge_FrameCallback ScriptManagerBridge_FrameCallback; | 
					
						
							|  |  |  | 	FuncScriptManagerBridge_CreateManagedForGodotObjectBinding ScriptManagerBridge_CreateManagedForGodotObjectBinding; | 
					
						
							|  |  |  | 	FuncScriptManagerBridge_CreateManagedForGodotObjectScriptInstance ScriptManagerBridge_CreateManagedForGodotObjectScriptInstance; | 
					
						
							|  |  |  | 	FuncScriptManagerBridge_GetScriptNativeName ScriptManagerBridge_GetScriptNativeName; | 
					
						
							|  |  |  | 	FuncScriptManagerBridge_SetGodotObjectPtr ScriptManagerBridge_SetGodotObjectPtr; | 
					
						
							|  |  |  | 	FuncScriptManagerBridge_RaiseEventSignal ScriptManagerBridge_RaiseEventSignal; | 
					
						
							|  |  |  | 	FuncScriptManagerBridge_ScriptIsOrInherits ScriptManagerBridge_ScriptIsOrInherits; | 
					
						
							|  |  |  | 	FuncScriptManagerBridge_AddScriptBridge ScriptManagerBridge_AddScriptBridge; | 
					
						
							| 
									
										
										
										
											2022-02-27 21:57:36 +01:00
										 |  |  | 	FuncScriptManagerBridge_GetOrCreateScriptBridgeForPath ScriptManagerBridge_GetOrCreateScriptBridgeForPath; | 
					
						
							| 
									
										
										
										
											2021-09-12 20:23:05 +02:00
										 |  |  | 	FuncScriptManagerBridge_RemoveScriptBridge ScriptManagerBridge_RemoveScriptBridge; | 
					
						
							| 
									
										
										
										
											2022-05-28 04:56:46 +02:00
										 |  |  | 	FuncScriptManagerBridge_TryReloadRegisteredScriptWithClass ScriptManagerBridge_TryReloadRegisteredScriptWithClass; | 
					
						
							| 
									
										
										
										
											2021-09-12 20:23:05 +02:00
										 |  |  | 	FuncScriptManagerBridge_UpdateScriptClassInfo ScriptManagerBridge_UpdateScriptClassInfo; | 
					
						
							|  |  |  | 	FuncScriptManagerBridge_SwapGCHandleForType ScriptManagerBridge_SwapGCHandleForType; | 
					
						
							| 
									
										
										
										
											2022-02-27 21:57:30 +01:00
										 |  |  | 	FuncScriptManagerBridge_GetPropertyInfoList ScriptManagerBridge_GetPropertyInfoList; | 
					
						
							|  |  |  | 	FuncScriptManagerBridge_GetPropertyDefaultValues ScriptManagerBridge_GetPropertyDefaultValues; | 
					
						
							| 
									
										
										
										
											2021-09-12 20:23:05 +02:00
										 |  |  | 	FuncCSharpInstanceBridge_Call CSharpInstanceBridge_Call; | 
					
						
							|  |  |  | 	FuncCSharpInstanceBridge_Set CSharpInstanceBridge_Set; | 
					
						
							|  |  |  | 	FuncCSharpInstanceBridge_Get CSharpInstanceBridge_Get; | 
					
						
							|  |  |  | 	FuncCSharpInstanceBridge_CallDispose CSharpInstanceBridge_CallDispose; | 
					
						
							|  |  |  | 	FuncCSharpInstanceBridge_CallToString CSharpInstanceBridge_CallToString; | 
					
						
							| 
									
										
										
										
											2021-12-28 23:25:16 +01:00
										 |  |  | 	FuncCSharpInstanceBridge_HasMethodUnknownParams CSharpInstanceBridge_HasMethodUnknownParams; | 
					
						
							| 
									
										
										
										
											2022-05-28 04:56:46 +02:00
										 |  |  | 	FuncCSharpInstanceBridge_SerializeState CSharpInstanceBridge_SerializeState; | 
					
						
							|  |  |  | 	FuncCSharpInstanceBridge_DeserializeState CSharpInstanceBridge_DeserializeState; | 
					
						
							| 
									
										
										
										
											2021-09-12 20:23:05 +02:00
										 |  |  | 	FuncGCHandleBridge_FreeGCHandle GCHandleBridge_FreeGCHandle; | 
					
						
							| 
									
										
										
										
											2022-02-27 21:57:39 +01:00
										 |  |  | 	FuncDebuggingUtils_GetCurrentStackInfo DebuggingUtils_GetCurrentStackInfo; | 
					
						
							| 
									
										
										
										
											2021-12-28 23:25:16 +01:00
										 |  |  | 	FuncDisposablesTracker_OnGodotShuttingDown DisposablesTracker_OnGodotShuttingDown; | 
					
						
							| 
									
										
										
										
											2022-02-27 21:57:39 +01:00
										 |  |  | 	FuncGD_OnCoreApiAssemblyLoaded GD_OnCoreApiAssemblyLoaded; | 
					
						
							| 
									
										
										
										
											2019-11-10 17:10:38 +01:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-12 20:23:05 +02:00
										 |  |  | extern ManagedCallbacks managed_callbacks; | 
					
						
							|  |  |  | extern bool godot_api_cache_updated; | 
					
						
							| 
									
										
										
										
											2019-11-10 17:10:38 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-12 20:23:05 +02:00
										 |  |  | void update_godot_api_cache(const ManagedCallbacks &p_managed_callbacks); | 
					
						
							| 
									
										
										
										
											2019-11-10 17:10:38 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | } // namespace GDMonoCache
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-12-28 23:25:16 +01:00
										 |  |  | #undef GD_CLR_STDCALL
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-11-10 17:10:38 +01:00
										 |  |  | #endif // GD_MONO_CACHE_H
 |