1 | /**************************************************************************/ |
2 | /* script_language_extension.cpp */ |
3 | /**************************************************************************/ |
4 | /* This file is part of: */ |
5 | /* GODOT ENGINE */ |
6 | /* https://godotengine.org */ |
7 | /**************************************************************************/ |
8 | /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ |
9 | /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ |
10 | /* */ |
11 | /* Permission is hereby granted, free of charge, to any person obtaining */ |
12 | /* a copy of this software and associated documentation files (the */ |
13 | /* "Software"), to deal in the Software without restriction, including */ |
14 | /* without limitation the rights to use, copy, modify, merge, publish, */ |
15 | /* distribute, sublicense, and/or sell copies of the Software, and to */ |
16 | /* permit persons to whom the Software is furnished to do so, subject to */ |
17 | /* the following conditions: */ |
18 | /* */ |
19 | /* The above copyright notice and this permission notice shall be */ |
20 | /* included in all copies or substantial portions of the Software. */ |
21 | /* */ |
22 | /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ |
23 | /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ |
24 | /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ |
25 | /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ |
26 | /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ |
27 | /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ |
28 | /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ |
29 | /**************************************************************************/ |
30 | |
31 | #include "script_language_extension.h" |
32 | |
33 | void ScriptExtension::_bind_methods() { |
34 | GDVIRTUAL_BIND(_editor_can_reload_from_file); |
35 | GDVIRTUAL_BIND(_placeholder_erased, "placeholder" ); |
36 | |
37 | GDVIRTUAL_BIND(_can_instantiate); |
38 | GDVIRTUAL_BIND(_get_base_script); |
39 | GDVIRTUAL_BIND(_get_global_name); |
40 | GDVIRTUAL_BIND(_inherits_script, "script" ); |
41 | |
42 | GDVIRTUAL_BIND(_get_instance_base_type); |
43 | GDVIRTUAL_BIND(_instance_create, "for_object" ); |
44 | GDVIRTUAL_BIND(_placeholder_instance_create, "for_object" ); |
45 | |
46 | GDVIRTUAL_BIND(_instance_has, "object" ); |
47 | |
48 | GDVIRTUAL_BIND(_has_source_code); |
49 | GDVIRTUAL_BIND(_get_source_code); |
50 | |
51 | GDVIRTUAL_BIND(_set_source_code, "code" ); |
52 | GDVIRTUAL_BIND(_reload, "keep_state" ); |
53 | |
54 | GDVIRTUAL_BIND(_get_documentation); |
55 | GDVIRTUAL_BIND(_get_class_icon_path); |
56 | |
57 | GDVIRTUAL_BIND(_has_method, "method" ); |
58 | GDVIRTUAL_BIND(_get_method_info, "method" ); |
59 | |
60 | GDVIRTUAL_BIND(_is_tool); |
61 | GDVIRTUAL_BIND(_is_valid); |
62 | GDVIRTUAL_BIND(_get_language); |
63 | |
64 | GDVIRTUAL_BIND(_has_script_signal, "signal" ); |
65 | GDVIRTUAL_BIND(_get_script_signal_list); |
66 | |
67 | GDVIRTUAL_BIND(_has_property_default_value, "property" ); |
68 | GDVIRTUAL_BIND(_get_property_default_value, "property" ); |
69 | |
70 | GDVIRTUAL_BIND(_update_exports); |
71 | GDVIRTUAL_BIND(_get_script_method_list); |
72 | GDVIRTUAL_BIND(_get_script_property_list); |
73 | |
74 | GDVIRTUAL_BIND(_get_member_line, "member" ); |
75 | |
76 | GDVIRTUAL_BIND(_get_constants); |
77 | GDVIRTUAL_BIND(_get_members); |
78 | GDVIRTUAL_BIND(_is_placeholder_fallback_enabled); |
79 | |
80 | GDVIRTUAL_BIND(_get_rpc_config); |
81 | } |
82 | |
83 | void ScriptLanguageExtension::_bind_methods() { |
84 | GDVIRTUAL_BIND(_get_name); |
85 | GDVIRTUAL_BIND(_init); |
86 | GDVIRTUAL_BIND(_get_type); |
87 | GDVIRTUAL_BIND(_get_extension); |
88 | GDVIRTUAL_BIND(_finish); |
89 | |
90 | GDVIRTUAL_BIND(_get_reserved_words); |
91 | GDVIRTUAL_BIND(_is_control_flow_keyword, "keyword" ); |
92 | GDVIRTUAL_BIND(_get_comment_delimiters); |
93 | GDVIRTUAL_BIND(_get_string_delimiters); |
94 | GDVIRTUAL_BIND(_make_template, "template" , "class_name" , "base_class_name" ); |
95 | GDVIRTUAL_BIND(_get_built_in_templates, "object" ); |
96 | GDVIRTUAL_BIND(_is_using_templates); |
97 | GDVIRTUAL_BIND(_validate, "script" , "path" , "validate_functions" , "validate_errors" , "validate_warnings" , "validate_safe_lines" ); |
98 | |
99 | GDVIRTUAL_BIND(_validate_path, "path" ); |
100 | GDVIRTUAL_BIND(_create_script); |
101 | GDVIRTUAL_BIND(_has_named_classes); |
102 | GDVIRTUAL_BIND(_supports_builtin_mode); |
103 | GDVIRTUAL_BIND(_supports_documentation); |
104 | GDVIRTUAL_BIND(_can_inherit_from_file); |
105 | GDVIRTUAL_BIND(_find_function, "class_name" , "function_name" ); |
106 | GDVIRTUAL_BIND(_make_function, "class_name" , "function_name" , "function_args" ); |
107 | GDVIRTUAL_BIND(_open_in_external_editor, "script" , "line" , "column" ); |
108 | GDVIRTUAL_BIND(_overrides_external_editor); |
109 | |
110 | GDVIRTUAL_BIND(_complete_code, "code" , "path" , "owner" ); |
111 | GDVIRTUAL_BIND(_lookup_code, "code" , "symbol" , "path" , "owner" ); |
112 | GDVIRTUAL_BIND(_auto_indent_code, "code" , "from_line" , "to_line" ); |
113 | |
114 | GDVIRTUAL_BIND(_add_global_constant, "name" , "value" ); |
115 | GDVIRTUAL_BIND(_add_named_global_constant, "name" , "value" ); |
116 | GDVIRTUAL_BIND(_remove_named_global_constant, "name" ); |
117 | |
118 | GDVIRTUAL_BIND(_thread_enter); |
119 | GDVIRTUAL_BIND(_thread_exit); |
120 | GDVIRTUAL_BIND(_debug_get_error); |
121 | GDVIRTUAL_BIND(_debug_get_stack_level_count); |
122 | |
123 | GDVIRTUAL_BIND(_debug_get_stack_level_line, "level" ); |
124 | GDVIRTUAL_BIND(_debug_get_stack_level_function, "level" ); |
125 | GDVIRTUAL_BIND(_debug_get_stack_level_locals, "level" , "max_subitems" , "max_depth" ); |
126 | GDVIRTUAL_BIND(_debug_get_stack_level_members, "level" , "max_subitems" , "max_depth" ); |
127 | GDVIRTUAL_BIND(_debug_get_stack_level_instance, "level" ); |
128 | GDVIRTUAL_BIND(_debug_get_globals, "max_subitems" , "max_depth" ); |
129 | GDVIRTUAL_BIND(_debug_parse_stack_level_expression, "level" , "expression" , "max_subitems" , "max_depth" ); |
130 | |
131 | GDVIRTUAL_BIND(_debug_get_current_stack_info); |
132 | |
133 | GDVIRTUAL_BIND(_reload_all_scripts); |
134 | GDVIRTUAL_BIND(_reload_tool_script, "script" , "soft_reload" ); |
135 | |
136 | GDVIRTUAL_BIND(_get_recognized_extensions); |
137 | GDVIRTUAL_BIND(_get_public_functions); |
138 | GDVIRTUAL_BIND(_get_public_constants); |
139 | GDVIRTUAL_BIND(_get_public_annotations); |
140 | |
141 | GDVIRTUAL_BIND(_profiling_start); |
142 | GDVIRTUAL_BIND(_profiling_stop); |
143 | |
144 | GDVIRTUAL_BIND(_profiling_get_accumulated_data, "info_array" , "info_max" ); |
145 | GDVIRTUAL_BIND(_profiling_get_frame_data, "info_array" , "info_max" ); |
146 | |
147 | GDVIRTUAL_BIND(_frame); |
148 | |
149 | GDVIRTUAL_BIND(_handles_global_class_type, "type" ); |
150 | GDVIRTUAL_BIND(_get_global_class_name, "path" ); |
151 | |
152 | BIND_ENUM_CONSTANT(LOOKUP_RESULT_SCRIPT_LOCATION); |
153 | BIND_ENUM_CONSTANT(LOOKUP_RESULT_CLASS); |
154 | BIND_ENUM_CONSTANT(LOOKUP_RESULT_CLASS_CONSTANT); |
155 | BIND_ENUM_CONSTANT(LOOKUP_RESULT_CLASS_PROPERTY); |
156 | BIND_ENUM_CONSTANT(LOOKUP_RESULT_CLASS_METHOD); |
157 | BIND_ENUM_CONSTANT(LOOKUP_RESULT_CLASS_SIGNAL); |
158 | BIND_ENUM_CONSTANT(LOOKUP_RESULT_CLASS_ENUM); |
159 | BIND_ENUM_CONSTANT(LOOKUP_RESULT_CLASS_TBD_GLOBALSCOPE); |
160 | BIND_ENUM_CONSTANT(LOOKUP_RESULT_CLASS_ANNOTATION); |
161 | BIND_ENUM_CONSTANT(LOOKUP_RESULT_MAX); |
162 | |
163 | BIND_ENUM_CONSTANT(LOCATION_LOCAL); |
164 | BIND_ENUM_CONSTANT(LOCATION_PARENT_MASK); |
165 | BIND_ENUM_CONSTANT(LOCATION_OTHER_USER_CODE); |
166 | BIND_ENUM_CONSTANT(LOCATION_OTHER); |
167 | |
168 | BIND_ENUM_CONSTANT(CODE_COMPLETION_KIND_CLASS); |
169 | BIND_ENUM_CONSTANT(CODE_COMPLETION_KIND_FUNCTION); |
170 | BIND_ENUM_CONSTANT(CODE_COMPLETION_KIND_SIGNAL); |
171 | BIND_ENUM_CONSTANT(CODE_COMPLETION_KIND_VARIABLE); |
172 | BIND_ENUM_CONSTANT(CODE_COMPLETION_KIND_MEMBER); |
173 | BIND_ENUM_CONSTANT(CODE_COMPLETION_KIND_ENUM); |
174 | BIND_ENUM_CONSTANT(CODE_COMPLETION_KIND_CONSTANT); |
175 | BIND_ENUM_CONSTANT(CODE_COMPLETION_KIND_NODE_PATH); |
176 | BIND_ENUM_CONSTANT(CODE_COMPLETION_KIND_FILE_PATH); |
177 | BIND_ENUM_CONSTANT(CODE_COMPLETION_KIND_PLAIN_TEXT); |
178 | BIND_ENUM_CONSTANT(CODE_COMPLETION_KIND_MAX); |
179 | } |
180 | |