2022-03-26 15:48:43 +00:00
|
|
|
/**************************************************************************/
|
|
|
|
/* script_language_extension.cpp */
|
|
|
|
/**************************************************************************/
|
|
|
|
/* This file is part of: */
|
|
|
|
/* GODOT ENGINE */
|
|
|
|
/* https://godotengine.org */
|
|
|
|
/**************************************************************************/
|
|
|
|
/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
|
|
|
|
/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
|
|
|
|
/* */
|
|
|
|
/* 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. */
|
|
|
|
/**************************************************************************/
|
|
|
|
|
|
|
|
#include "script_language_extension.h"
|
|
|
|
|
|
|
|
void ScriptExtension::_bind_methods() {
|
|
|
|
GDVIRTUAL_BIND(_editor_can_reload_from_file);
|
|
|
|
GDVIRTUAL_BIND(_placeholder_erased, "placeholder");
|
|
|
|
|
|
|
|
GDVIRTUAL_BIND(_can_instantiate);
|
|
|
|
GDVIRTUAL_BIND(_get_base_script);
|
2023-02-16 03:32:04 +00:00
|
|
|
GDVIRTUAL_BIND(_get_global_name);
|
2022-03-26 15:48:43 +00:00
|
|
|
GDVIRTUAL_BIND(_inherits_script, "script");
|
|
|
|
|
|
|
|
GDVIRTUAL_BIND(_get_instance_base_type);
|
|
|
|
GDVIRTUAL_BIND(_instance_create, "for_object");
|
|
|
|
GDVIRTUAL_BIND(_placeholder_instance_create, "for_object");
|
|
|
|
|
|
|
|
GDVIRTUAL_BIND(_instance_has, "object");
|
|
|
|
|
|
|
|
GDVIRTUAL_BIND(_has_source_code);
|
|
|
|
GDVIRTUAL_BIND(_get_source_code);
|
|
|
|
|
|
|
|
GDVIRTUAL_BIND(_set_source_code, "code");
|
|
|
|
GDVIRTUAL_BIND(_reload, "keep_state");
|
|
|
|
|
|
|
|
GDVIRTUAL_BIND(_get_documentation);
|
2023-08-24 10:49:20 +00:00
|
|
|
GDVIRTUAL_BIND(_get_class_icon_path);
|
2022-03-26 15:48:43 +00:00
|
|
|
|
|
|
|
GDVIRTUAL_BIND(_has_method, "method");
|
2023-10-04 04:54:03 +00:00
|
|
|
GDVIRTUAL_BIND(_has_static_method, "method");
|
2024-01-28 14:16:09 +00:00
|
|
|
|
|
|
|
GDVIRTUAL_BIND(_get_script_method_argument_count, "method");
|
|
|
|
|
2022-03-26 15:48:43 +00:00
|
|
|
GDVIRTUAL_BIND(_get_method_info, "method");
|
|
|
|
|
|
|
|
GDVIRTUAL_BIND(_is_tool);
|
|
|
|
GDVIRTUAL_BIND(_is_valid);
|
2023-05-23 16:25:34 +00:00
|
|
|
GDVIRTUAL_BIND(_is_abstract);
|
2022-03-26 15:48:43 +00:00
|
|
|
GDVIRTUAL_BIND(_get_language);
|
|
|
|
|
|
|
|
GDVIRTUAL_BIND(_has_script_signal, "signal");
|
|
|
|
GDVIRTUAL_BIND(_get_script_signal_list);
|
|
|
|
|
2022-08-16 23:23:51 +00:00
|
|
|
GDVIRTUAL_BIND(_has_property_default_value, "property");
|
2022-03-26 15:48:43 +00:00
|
|
|
GDVIRTUAL_BIND(_get_property_default_value, "property");
|
|
|
|
|
|
|
|
GDVIRTUAL_BIND(_update_exports);
|
|
|
|
GDVIRTUAL_BIND(_get_script_method_list);
|
|
|
|
GDVIRTUAL_BIND(_get_script_property_list);
|
|
|
|
|
|
|
|
GDVIRTUAL_BIND(_get_member_line, "member");
|
|
|
|
|
|
|
|
GDVIRTUAL_BIND(_get_constants);
|
|
|
|
GDVIRTUAL_BIND(_get_members);
|
|
|
|
GDVIRTUAL_BIND(_is_placeholder_fallback_enabled);
|
|
|
|
|
2022-07-12 21:12:42 +00:00
|
|
|
GDVIRTUAL_BIND(_get_rpc_config);
|
2022-03-26 15:48:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void ScriptLanguageExtension::_bind_methods() {
|
|
|
|
GDVIRTUAL_BIND(_get_name);
|
|
|
|
GDVIRTUAL_BIND(_init);
|
|
|
|
GDVIRTUAL_BIND(_get_type);
|
|
|
|
GDVIRTUAL_BIND(_get_extension);
|
|
|
|
GDVIRTUAL_BIND(_finish);
|
|
|
|
|
|
|
|
GDVIRTUAL_BIND(_get_reserved_words);
|
|
|
|
GDVIRTUAL_BIND(_is_control_flow_keyword, "keyword");
|
|
|
|
GDVIRTUAL_BIND(_get_comment_delimiters);
|
2023-02-05 09:01:01 +00:00
|
|
|
GDVIRTUAL_BIND(_get_doc_comment_delimiters);
|
2022-03-26 15:48:43 +00:00
|
|
|
GDVIRTUAL_BIND(_get_string_delimiters);
|
|
|
|
GDVIRTUAL_BIND(_make_template, "template", "class_name", "base_class_name");
|
|
|
|
GDVIRTUAL_BIND(_get_built_in_templates, "object");
|
|
|
|
GDVIRTUAL_BIND(_is_using_templates);
|
|
|
|
GDVIRTUAL_BIND(_validate, "script", "path", "validate_functions", "validate_errors", "validate_warnings", "validate_safe_lines");
|
|
|
|
|
|
|
|
GDVIRTUAL_BIND(_validate_path, "path");
|
|
|
|
GDVIRTUAL_BIND(_create_script);
|
2023-09-12 08:52:43 +00:00
|
|
|
#ifndef DISABLE_DEPRECATED
|
2022-03-26 15:48:43 +00:00
|
|
|
GDVIRTUAL_BIND(_has_named_classes);
|
2023-09-12 08:52:43 +00:00
|
|
|
#endif
|
2022-03-26 15:48:43 +00:00
|
|
|
GDVIRTUAL_BIND(_supports_builtin_mode);
|
|
|
|
GDVIRTUAL_BIND(_supports_documentation);
|
|
|
|
GDVIRTUAL_BIND(_can_inherit_from_file);
|
2023-12-26 11:24:56 +00:00
|
|
|
GDVIRTUAL_BIND(_find_function, "function", "code");
|
2022-03-26 15:48:43 +00:00
|
|
|
GDVIRTUAL_BIND(_make_function, "class_name", "function_name", "function_args");
|
2024-02-04 18:08:41 +00:00
|
|
|
GDVIRTUAL_BIND(_can_make_function);
|
2022-03-26 15:48:43 +00:00
|
|
|
GDVIRTUAL_BIND(_open_in_external_editor, "script", "line", "column");
|
|
|
|
GDVIRTUAL_BIND(_overrides_external_editor);
|
2023-06-11 16:23:48 +00:00
|
|
|
GDVIRTUAL_BIND(_preferred_file_name_casing);
|
2022-03-26 15:48:43 +00:00
|
|
|
|
|
|
|
GDVIRTUAL_BIND(_complete_code, "code", "path", "owner");
|
|
|
|
GDVIRTUAL_BIND(_lookup_code, "code", "symbol", "path", "owner");
|
|
|
|
GDVIRTUAL_BIND(_auto_indent_code, "code", "from_line", "to_line");
|
|
|
|
|
|
|
|
GDVIRTUAL_BIND(_add_global_constant, "name", "value");
|
|
|
|
GDVIRTUAL_BIND(_add_named_global_constant, "name", "value");
|
|
|
|
GDVIRTUAL_BIND(_remove_named_global_constant, "name");
|
|
|
|
|
|
|
|
GDVIRTUAL_BIND(_thread_enter);
|
|
|
|
GDVIRTUAL_BIND(_thread_exit);
|
|
|
|
GDVIRTUAL_BIND(_debug_get_error);
|
|
|
|
GDVIRTUAL_BIND(_debug_get_stack_level_count);
|
|
|
|
|
|
|
|
GDVIRTUAL_BIND(_debug_get_stack_level_line, "level");
|
|
|
|
GDVIRTUAL_BIND(_debug_get_stack_level_function, "level");
|
2024-01-02 19:07:10 +00:00
|
|
|
GDVIRTUAL_BIND(_debug_get_stack_level_source, "level");
|
2022-03-26 15:48:43 +00:00
|
|
|
GDVIRTUAL_BIND(_debug_get_stack_level_locals, "level", "max_subitems", "max_depth");
|
|
|
|
GDVIRTUAL_BIND(_debug_get_stack_level_members, "level", "max_subitems", "max_depth");
|
|
|
|
GDVIRTUAL_BIND(_debug_get_stack_level_instance, "level");
|
|
|
|
GDVIRTUAL_BIND(_debug_get_globals, "max_subitems", "max_depth");
|
|
|
|
GDVIRTUAL_BIND(_debug_parse_stack_level_expression, "level", "expression", "max_subitems", "max_depth");
|
|
|
|
|
|
|
|
GDVIRTUAL_BIND(_debug_get_current_stack_info);
|
|
|
|
|
|
|
|
GDVIRTUAL_BIND(_reload_all_scripts);
|
2024-08-18 03:45:22 +00:00
|
|
|
GDVIRTUAL_BIND(_reload_scripts, "scripts", "soft_reload");
|
2022-03-26 15:48:43 +00:00
|
|
|
GDVIRTUAL_BIND(_reload_tool_script, "script", "soft_reload");
|
|
|
|
|
|
|
|
GDVIRTUAL_BIND(_get_recognized_extensions);
|
|
|
|
GDVIRTUAL_BIND(_get_public_functions);
|
|
|
|
GDVIRTUAL_BIND(_get_public_constants);
|
2022-07-04 15:56:34 +00:00
|
|
|
GDVIRTUAL_BIND(_get_public_annotations);
|
2022-03-26 15:48:43 +00:00
|
|
|
|
|
|
|
GDVIRTUAL_BIND(_profiling_start);
|
|
|
|
GDVIRTUAL_BIND(_profiling_stop);
|
2023-03-05 12:37:11 +00:00
|
|
|
GDVIRTUAL_BIND(_profiling_set_save_native_calls, "enable");
|
2022-03-26 15:48:43 +00:00
|
|
|
|
|
|
|
GDVIRTUAL_BIND(_profiling_get_accumulated_data, "info_array", "info_max");
|
|
|
|
GDVIRTUAL_BIND(_profiling_get_frame_data, "info_array", "info_max");
|
|
|
|
|
|
|
|
GDVIRTUAL_BIND(_frame);
|
|
|
|
|
|
|
|
GDVIRTUAL_BIND(_handles_global_class_type, "type");
|
|
|
|
GDVIRTUAL_BIND(_get_global_class_name, "path");
|
|
|
|
|
|
|
|
BIND_ENUM_CONSTANT(LOOKUP_RESULT_SCRIPT_LOCATION);
|
|
|
|
BIND_ENUM_CONSTANT(LOOKUP_RESULT_CLASS);
|
|
|
|
BIND_ENUM_CONSTANT(LOOKUP_RESULT_CLASS_CONSTANT);
|
|
|
|
BIND_ENUM_CONSTANT(LOOKUP_RESULT_CLASS_PROPERTY);
|
|
|
|
BIND_ENUM_CONSTANT(LOOKUP_RESULT_CLASS_METHOD);
|
2022-05-12 13:07:05 +00:00
|
|
|
BIND_ENUM_CONSTANT(LOOKUP_RESULT_CLASS_SIGNAL);
|
2022-03-26 15:48:43 +00:00
|
|
|
BIND_ENUM_CONSTANT(LOOKUP_RESULT_CLASS_ENUM);
|
|
|
|
BIND_ENUM_CONSTANT(LOOKUP_RESULT_CLASS_TBD_GLOBALSCOPE);
|
2022-07-04 15:56:34 +00:00
|
|
|
BIND_ENUM_CONSTANT(LOOKUP_RESULT_CLASS_ANNOTATION);
|
2022-03-26 15:48:43 +00:00
|
|
|
BIND_ENUM_CONSTANT(LOOKUP_RESULT_MAX);
|
|
|
|
|
2022-03-08 14:03:36 +00:00
|
|
|
BIND_ENUM_CONSTANT(LOCATION_LOCAL);
|
|
|
|
BIND_ENUM_CONSTANT(LOCATION_PARENT_MASK);
|
|
|
|
BIND_ENUM_CONSTANT(LOCATION_OTHER_USER_CODE);
|
|
|
|
BIND_ENUM_CONSTANT(LOCATION_OTHER);
|
|
|
|
|
2022-03-26 15:48:43 +00:00
|
|
|
BIND_ENUM_CONSTANT(CODE_COMPLETION_KIND_CLASS);
|
|
|
|
BIND_ENUM_CONSTANT(CODE_COMPLETION_KIND_FUNCTION);
|
|
|
|
BIND_ENUM_CONSTANT(CODE_COMPLETION_KIND_SIGNAL);
|
|
|
|
BIND_ENUM_CONSTANT(CODE_COMPLETION_KIND_VARIABLE);
|
|
|
|
BIND_ENUM_CONSTANT(CODE_COMPLETION_KIND_MEMBER);
|
|
|
|
BIND_ENUM_CONSTANT(CODE_COMPLETION_KIND_ENUM);
|
|
|
|
BIND_ENUM_CONSTANT(CODE_COMPLETION_KIND_CONSTANT);
|
|
|
|
BIND_ENUM_CONSTANT(CODE_COMPLETION_KIND_NODE_PATH);
|
|
|
|
BIND_ENUM_CONSTANT(CODE_COMPLETION_KIND_FILE_PATH);
|
|
|
|
BIND_ENUM_CONSTANT(CODE_COMPLETION_KIND_PLAIN_TEXT);
|
|
|
|
BIND_ENUM_CONSTANT(CODE_COMPLETION_KIND_MAX);
|
|
|
|
}
|