summaryrefslogtreecommitdiffstats
path: root/modules/mono/editor/bindings_generator.h
diff options
context:
space:
mode:
Diffstat (limited to 'modules/mono/editor/bindings_generator.h')
-rw-r--r--modules/mono/editor/bindings_generator.h73
1 files changed, 59 insertions, 14 deletions
diff --git a/modules/mono/editor/bindings_generator.h b/modules/mono/editor/bindings_generator.h
index cef8246032..5c266ed31f 100644
--- a/modules/mono/editor/bindings_generator.h
+++ b/modules/mono/editor/bindings_generator.h
@@ -472,43 +472,88 @@ class BindingsGenerator {
}
private:
+ static DocData::ClassDoc *_get_type_doc(TypeInterface &itype) {
+ String doc_name = itype.name.begins_with("_") ? itype.name.substr(1) : itype.name;
+ return &EditorHelp::get_doc_data()->class_list[doc_name];
+ }
+
static void _init_value_type(TypeInterface &itype) {
- itype.proxy_name = itype.name;
+ if (itype.proxy_name.is_empty()) {
+ itype.proxy_name = itype.name;
+ }
- itype.c_type = itype.name;
itype.cs_type = itype.proxy_name;
- itype.c_type_in = itype.proxy_name + "*";
- itype.c_type_out = itype.proxy_name;
- itype.class_doc = &EditorHelp::get_doc_data()->class_list[itype.proxy_name];
+ itype.c_type = itype.cs_type;
+ itype.c_type_in = itype.cs_type + "*";
+ itype.c_type_out = itype.cs_type;
+
+ itype.class_doc = _get_type_doc(itype);
+ }
+
+ static void _init_object_type(TypeInterface &itype, ClassDB::APIType p_api_type) {
+ if (itype.proxy_name.is_empty()) {
+ itype.proxy_name = itype.name;
+ }
+
+ if (itype.proxy_name.begins_with("_")) {
+ itype.proxy_name = itype.proxy_name.substr(1);
+ }
+
+ itype.api_type = p_api_type;
+ itype.is_object_type = true;
+
+ itype.class_doc = _get_type_doc(itype);
}
public:
- static TypeInterface create_value_type(const String &p_name) {
+ static TypeInterface create_value_type(const String &p_name, const String &p_proxy_name) {
TypeInterface itype;
itype.name = p_name;
- itype.cname = StringName(p_name);
+ itype.cname = p_name;
+ itype.proxy_name = p_proxy_name;
_init_value_type(itype);
return itype;
}
- static TypeInterface create_value_type(const StringName &p_name) {
+ static TypeInterface create_value_type(const StringName &p_cname, const String &p_proxy_name) {
TypeInterface itype;
- itype.name = p_name.operator String();
+ itype.name = p_cname;
+ itype.cname = p_cname;
+ itype.proxy_name = p_proxy_name;
+ _init_value_type(itype);
+ return itype;
+ }
+
+ static TypeInterface create_value_type(const String &p_name) {
+ TypeInterface itype;
+ itype.name = p_name;
itype.cname = p_name;
_init_value_type(itype);
return itype;
}
- static TypeInterface create_object_type(const StringName &p_cname, ClassDB::APIType p_api_type) {
+ static TypeInterface create_value_type(const StringName &p_cname) {
TypeInterface itype;
+ itype.name = p_cname;
+ itype.cname = p_cname;
+ _init_value_type(itype);
+ return itype;
+ }
+ static TypeInterface create_object_type(const StringName &p_cname, const String &p_proxy_name, ClassDB::APIType p_api_type) {
+ TypeInterface itype;
itype.name = p_cname;
itype.cname = p_cname;
- itype.proxy_name = itype.name.begins_with("_") ? itype.name.substr(1, itype.name.length()) : itype.name;
- itype.api_type = p_api_type;
- itype.is_object_type = true;
- itype.class_doc = &EditorHelp::get_doc_data()->class_list[itype.proxy_name];
+ itype.proxy_name = p_proxy_name;
+ _init_object_type(itype, p_api_type);
+ return itype;
+ }
+ static TypeInterface create_object_type(const StringName &p_cname, ClassDB::APIType p_api_type) {
+ TypeInterface itype;
+ itype.name = p_cname;
+ itype.cname = p_cname;
+ _init_object_type(itype, p_api_type);
return itype;
}