summaryrefslogtreecommitdiffstats
path: root/core/extension/gdextension_interface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/extension/gdextension_interface.cpp')
-rw-r--r--core/extension/gdextension_interface.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/core/extension/gdextension_interface.cpp b/core/extension/gdextension_interface.cpp
index 12ef1772e3..21d34b6e0c 100644
--- a/core/extension/gdextension_interface.cpp
+++ b/core/extension/gdextension_interface.cpp
@@ -1071,6 +1071,20 @@ static void *gdextension_classdb_get_class_tag(GDExtensionConstStringNamePtr p_c
return class_info ? class_info->class_ptr : nullptr;
}
+static void gdextension_editor_add_plugin(GDExtensionConstStringNamePtr p_classname) {
+#ifdef TOOLS_ENABLED
+ const StringName classname = *reinterpret_cast<const StringName *>(p_classname);
+ GDExtensionEditorPlugins::add_extension_class(classname);
+#endif
+}
+
+static void gdextension_editor_remove_plugin(GDExtensionConstStringNamePtr p_classname) {
+#ifdef TOOLS_ENABLED
+ const StringName classname = *reinterpret_cast<const StringName *>(p_classname);
+ GDExtensionEditorPlugins::remove_extension_class(classname);
+#endif
+}
+
#define REGISTER_INTERFACE_FUNC(m_name) GDExtension::register_interface_function(#m_name, (GDExtensionInterfaceFunctionPtr)&gdextension_##m_name)
void gdextension_setup_interface() {
@@ -1199,6 +1213,8 @@ void gdextension_setup_interface() {
REGISTER_INTERFACE_FUNC(classdb_construct_object);
REGISTER_INTERFACE_FUNC(classdb_get_method_bind);
REGISTER_INTERFACE_FUNC(classdb_get_class_tag);
+ REGISTER_INTERFACE_FUNC(editor_add_plugin);
+ REGISTER_INTERFACE_FUNC(editor_remove_plugin);
}
#undef REGISTER_INTERFACE_FUNCTION