summaryrefslogtreecommitdiff
path: root/editor/doc
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2017-05-20 12:38:03 -0300
committerJuan Linietsky <reduzio@gmail.com>2017-05-20 17:05:38 -0300
commit5b3709d3096df737b8bb2344446be818b0389bfe (patch)
tree649a0989b1494f3c4687d59e503310f4e6bbeb40 /editor/doc
parent93f9a83062dbe74474a4a7928758c5cf5588238e (diff)
Removal of InputEvent as built-in Variant type..
this might cause bugs I haven't found yet..
Diffstat (limited to 'editor/doc')
-rw-r--r--editor/doc/doc_data.cpp128
-rw-r--r--editor/doc/doc_dump.cpp3
2 files changed, 55 insertions, 76 deletions
diff --git a/editor/doc/doc_data.cpp b/editor/doc/doc_data.cpp
index 75d8721756..6a79f99354 100644
--- a/editor/doc/doc_data.cpp
+++ b/editor/doc/doc_data.cpp
@@ -331,8 +331,7 @@ void DocData::generate(bool p_basic_types) {
default_arg_text = "NULL";
break;
}
- case Variant::INPUT_EVENT:
- case Variant::DICTIONARY:
+ case Variant::DICTIONARY: // 20
case Variant::ARRAY:
case Variant::_RID:
@@ -477,97 +476,78 @@ void DocData::generate(bool p_basic_types) {
if (i == Variant::OBJECT)
continue; //use the core type instead
- int loops = 1;
+ String cname = Variant::get_type_name(Variant::Type(i));
- if (i == Variant::INPUT_EVENT)
- loops = InputEvent::TYPE_MAX;
-
- for (int j = 0; j < loops; j++) {
-
- String cname = Variant::get_type_name(Variant::Type(i));
-
- if (i == Variant::INPUT_EVENT) {
- static const char *ie_type[InputEvent::TYPE_MAX] = {
- "", "Key", "MouseMotion", "MouseButton", "JoypadMotion", "JoypadButton", "ScreenTouch", "ScreenDrag", "Action"
- };
- cname += ie_type[j];
- }
-
- class_list[cname] = ClassDoc();
- ClassDoc &c = class_list[cname];
- c.name = cname;
- c.category = "Built-In Types";
-
- Variant::CallError cerror;
- Variant v = Variant::construct(Variant::Type(i), NULL, 0, cerror);
+ class_list[cname] = ClassDoc();
+ ClassDoc &c = class_list[cname];
+ c.name = cname;
+ c.category = "Built-In Types";
- if (i == Variant::INPUT_EVENT) {
- v.set("type", j);
- }
+ Variant::CallError cerror;
+ Variant v = Variant::construct(Variant::Type(i), NULL, 0, cerror);
- List<MethodInfo> method_list;
- v.get_method_list(&method_list);
- method_list.sort();
- Variant::get_constructor_list(Variant::Type(i), &method_list);
+ List<MethodInfo> method_list;
+ v.get_method_list(&method_list);
+ method_list.sort();
+ Variant::get_constructor_list(Variant::Type(i), &method_list);
- for (List<MethodInfo>::Element *E = method_list.front(); E; E = E->next()) {
+ for (List<MethodInfo>::Element *E = method_list.front(); E; E = E->next()) {
- MethodInfo &mi = E->get();
- MethodDoc method;
+ MethodInfo &mi = E->get();
+ MethodDoc method;
- method.name = mi.name;
+ method.name = mi.name;
- for (int i = 0; i < mi.arguments.size(); i++) {
+ for (int i = 0; i < mi.arguments.size(); i++) {
- ArgumentDoc arg;
- PropertyInfo pi = mi.arguments[i];
+ ArgumentDoc arg;
+ PropertyInfo pi = mi.arguments[i];
- arg.name = pi.name;
- //print_line("arg name: "+arg.name);
- if (pi.type == Variant::NIL)
- arg.type = "var";
- else
- arg.type = Variant::get_type_name(pi.type);
- int defarg = mi.default_arguments.size() - mi.arguments.size() + i;
- if (defarg >= 0)
- arg.default_value = mi.default_arguments[defarg];
-
- method.arguments.push_back(arg);
- }
+ arg.name = pi.name;
+ //print_line("arg name: "+arg.name);
+ if (pi.type == Variant::NIL)
+ arg.type = "var";
+ else
+ arg.type = Variant::get_type_name(pi.type);
+ int defarg = mi.default_arguments.size() - mi.arguments.size() + i;
+ if (defarg >= 0)
+ arg.default_value = mi.default_arguments[defarg];
- if (mi.return_val.type == Variant::NIL) {
- if (mi.return_val.name != "")
- method.return_type = "var";
+ method.arguments.push_back(arg);
+ }
- } else {
- method.return_type = Variant::get_type_name(mi.return_val.type);
- }
+ if (mi.return_val.type == Variant::NIL) {
+ if (mi.return_val.name != "")
+ method.return_type = "var";
- c.methods.push_back(method);
+ } else {
+ method.return_type = Variant::get_type_name(mi.return_val.type);
}
- List<PropertyInfo> properties;
- v.get_property_list(&properties);
- for (List<PropertyInfo>::Element *E = properties.front(); E; E = E->next()) {
+ c.methods.push_back(method);
+ }
+
+ List<PropertyInfo> properties;
+ v.get_property_list(&properties);
+ for (List<PropertyInfo>::Element *E = properties.front(); E; E = E->next()) {
- PropertyInfo pi = E->get();
- PropertyDoc property;
- property.name = pi.name;
- property.type = Variant::get_type_name(pi.type);
+ PropertyInfo pi = E->get();
+ PropertyDoc property;
+ property.name = pi.name;
+ property.type = Variant::get_type_name(pi.type);
- c.properties.push_back(property);
- }
+ c.properties.push_back(property);
+ }
- List<StringName> constants;
- Variant::get_numeric_constants_for_type(Variant::Type(i), &constants);
+ List<StringName> constants;
+ Variant::get_numeric_constants_for_type(Variant::Type(i), &constants);
- for (List<StringName>::Element *E = constants.front(); E; E = E->next()) {
+ for (List<StringName>::Element *E = constants.front(); E; E = E->next()) {
- ConstantDoc constant;
- constant.name = E->get();
- constant.value = itos(Variant::get_numeric_constant_value(Variant::Type(i), E->get()));
- c.constants.push_back(constant);
- }
+ ConstantDoc constant;
+ constant.name = E->get();
+ constant.value = itos(Variant::get_numeric_constant_value(Variant::Type(i), E->get()));
+ c.constants.push_back(constant);
}
}
diff --git a/editor/doc/doc_dump.cpp b/editor/doc/doc_dump.cpp
index 10cd29b814..79a8f79a7c 100644
--- a/editor/doc/doc_dump.cpp
+++ b/editor/doc/doc_dump.cpp
@@ -194,8 +194,7 @@ void DocDump::dump(const String &p_file) {
default_arg_text = Variant::get_type_name(default_arg.get_type()) + "(" + default_arg_text + ")";
break;
case Variant::OBJECT:
- case Variant::INPUT_EVENT:
- case Variant::DICTIONARY:
+ case Variant::DICTIONARY: // 20
case Variant::ARRAY:
case Variant::_RID: