Path: blob/master/core/object/script_language_extension.cpp
9903 views
/**************************************************************************/1/* script_language_extension.cpp */2/**************************************************************************/3/* This file is part of: */4/* GODOT ENGINE */5/* https://godotengine.org */6/**************************************************************************/7/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */8/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */9/* */10/* Permission is hereby granted, free of charge, to any person obtaining */11/* a copy of this software and associated documentation files (the */12/* "Software"), to deal in the Software without restriction, including */13/* without limitation the rights to use, copy, modify, merge, publish, */14/* distribute, sublicense, and/or sell copies of the Software, and to */15/* permit persons to whom the Software is furnished to do so, subject to */16/* the following conditions: */17/* */18/* The above copyright notice and this permission notice shall be */19/* included in all copies or substantial portions of the Software. */20/* */21/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */22/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */23/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */24/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */25/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */26/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */27/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */28/**************************************************************************/2930#include "script_language_extension.h"3132void ScriptExtension::_bind_methods() {33GDVIRTUAL_BIND(_editor_can_reload_from_file);34GDVIRTUAL_BIND(_placeholder_erased, "placeholder");3536GDVIRTUAL_BIND(_can_instantiate);37GDVIRTUAL_BIND(_get_base_script);38GDVIRTUAL_BIND(_get_global_name);39GDVIRTUAL_BIND(_inherits_script, "script");4041GDVIRTUAL_BIND(_get_instance_base_type);42GDVIRTUAL_BIND(_instance_create, "for_object");43GDVIRTUAL_BIND(_placeholder_instance_create, "for_object");4445GDVIRTUAL_BIND(_instance_has, "object");4647GDVIRTUAL_BIND(_has_source_code);48GDVIRTUAL_BIND(_get_source_code);4950GDVIRTUAL_BIND(_set_source_code, "code");51GDVIRTUAL_BIND(_reload, "keep_state");5253GDVIRTUAL_BIND(_get_doc_class_name);54GDVIRTUAL_BIND(_get_documentation);55GDVIRTUAL_BIND(_get_class_icon_path);5657GDVIRTUAL_BIND(_has_method, "method");58GDVIRTUAL_BIND(_has_static_method, "method");5960GDVIRTUAL_BIND(_get_script_method_argument_count, "method");6162GDVIRTUAL_BIND(_get_method_info, "method");6364GDVIRTUAL_BIND(_is_tool);65GDVIRTUAL_BIND(_is_valid);66GDVIRTUAL_BIND(_is_abstract);67GDVIRTUAL_BIND(_get_language);6869GDVIRTUAL_BIND(_has_script_signal, "signal");70GDVIRTUAL_BIND(_get_script_signal_list);7172GDVIRTUAL_BIND(_has_property_default_value, "property");73GDVIRTUAL_BIND(_get_property_default_value, "property");7475GDVIRTUAL_BIND(_update_exports);76GDVIRTUAL_BIND(_get_script_method_list);77GDVIRTUAL_BIND(_get_script_property_list);7879GDVIRTUAL_BIND(_get_member_line, "member");8081GDVIRTUAL_BIND(_get_constants);82GDVIRTUAL_BIND(_get_members);83GDVIRTUAL_BIND(_is_placeholder_fallback_enabled);8485GDVIRTUAL_BIND(_get_rpc_config);86}8788void ScriptLanguageExtension::_bind_methods() {89GDVIRTUAL_BIND(_get_name);90GDVIRTUAL_BIND(_init);91GDVIRTUAL_BIND(_get_type);92GDVIRTUAL_BIND(_get_extension);93GDVIRTUAL_BIND(_finish);9495GDVIRTUAL_BIND(_get_reserved_words);96GDVIRTUAL_BIND(_is_control_flow_keyword, "keyword");97GDVIRTUAL_BIND(_get_comment_delimiters);98GDVIRTUAL_BIND(_get_doc_comment_delimiters);99GDVIRTUAL_BIND(_get_string_delimiters);100GDVIRTUAL_BIND(_make_template, "template", "class_name", "base_class_name");101GDVIRTUAL_BIND(_get_built_in_templates, "object");102GDVIRTUAL_BIND(_is_using_templates);103GDVIRTUAL_BIND(_validate, "script", "path", "validate_functions", "validate_errors", "validate_warnings", "validate_safe_lines");104105GDVIRTUAL_BIND(_validate_path, "path");106GDVIRTUAL_BIND(_create_script);107#ifndef DISABLE_DEPRECATED108GDVIRTUAL_BIND(_has_named_classes);109#endif110GDVIRTUAL_BIND(_supports_builtin_mode);111GDVIRTUAL_BIND(_supports_documentation);112GDVIRTUAL_BIND(_can_inherit_from_file);113GDVIRTUAL_BIND(_find_function, "function", "code");114GDVIRTUAL_BIND(_make_function, "class_name", "function_name", "function_args");115GDVIRTUAL_BIND(_can_make_function);116GDVIRTUAL_BIND(_open_in_external_editor, "script", "line", "column");117GDVIRTUAL_BIND(_overrides_external_editor);118GDVIRTUAL_BIND(_preferred_file_name_casing);119120GDVIRTUAL_BIND(_complete_code, "code", "path", "owner");121GDVIRTUAL_BIND(_lookup_code, "code", "symbol", "path", "owner");122GDVIRTUAL_BIND(_auto_indent_code, "code", "from_line", "to_line");123124GDVIRTUAL_BIND(_add_global_constant, "name", "value");125GDVIRTUAL_BIND(_add_named_global_constant, "name", "value");126GDVIRTUAL_BIND(_remove_named_global_constant, "name");127128GDVIRTUAL_BIND(_thread_enter);129GDVIRTUAL_BIND(_thread_exit);130GDVIRTUAL_BIND(_debug_get_error);131GDVIRTUAL_BIND(_debug_get_stack_level_count);132133GDVIRTUAL_BIND(_debug_get_stack_level_line, "level");134GDVIRTUAL_BIND(_debug_get_stack_level_function, "level");135GDVIRTUAL_BIND(_debug_get_stack_level_source, "level");136GDVIRTUAL_BIND(_debug_get_stack_level_locals, "level", "max_subitems", "max_depth");137GDVIRTUAL_BIND(_debug_get_stack_level_members, "level", "max_subitems", "max_depth");138GDVIRTUAL_BIND(_debug_get_stack_level_instance, "level");139GDVIRTUAL_BIND(_debug_get_globals, "max_subitems", "max_depth");140GDVIRTUAL_BIND(_debug_parse_stack_level_expression, "level", "expression", "max_subitems", "max_depth");141142GDVIRTUAL_BIND(_debug_get_current_stack_info);143144GDVIRTUAL_BIND(_reload_all_scripts);145GDVIRTUAL_BIND(_reload_scripts, "scripts", "soft_reload");146GDVIRTUAL_BIND(_reload_tool_script, "script", "soft_reload");147148GDVIRTUAL_BIND(_get_recognized_extensions);149GDVIRTUAL_BIND(_get_public_functions);150GDVIRTUAL_BIND(_get_public_constants);151GDVIRTUAL_BIND(_get_public_annotations);152153GDVIRTUAL_BIND(_profiling_start);154GDVIRTUAL_BIND(_profiling_stop);155GDVIRTUAL_BIND(_profiling_set_save_native_calls, "enable");156157GDVIRTUAL_BIND(_profiling_get_accumulated_data, "info_array", "info_max");158GDVIRTUAL_BIND(_profiling_get_frame_data, "info_array", "info_max");159160GDVIRTUAL_BIND(_frame);161162GDVIRTUAL_BIND(_handles_global_class_type, "type");163GDVIRTUAL_BIND(_get_global_class_name, "path");164165BIND_ENUM_CONSTANT(LOOKUP_RESULT_SCRIPT_LOCATION);166BIND_ENUM_CONSTANT(LOOKUP_RESULT_CLASS);167BIND_ENUM_CONSTANT(LOOKUP_RESULT_CLASS_CONSTANT);168BIND_ENUM_CONSTANT(LOOKUP_RESULT_CLASS_PROPERTY);169BIND_ENUM_CONSTANT(LOOKUP_RESULT_CLASS_METHOD);170BIND_ENUM_CONSTANT(LOOKUP_RESULT_CLASS_SIGNAL);171BIND_ENUM_CONSTANT(LOOKUP_RESULT_CLASS_ENUM);172BIND_ENUM_CONSTANT(LOOKUP_RESULT_CLASS_TBD_GLOBALSCOPE); // Deprecated.173BIND_ENUM_CONSTANT(LOOKUP_RESULT_CLASS_ANNOTATION);174BIND_ENUM_CONSTANT(LOOKUP_RESULT_LOCAL_CONSTANT);175BIND_ENUM_CONSTANT(LOOKUP_RESULT_LOCAL_VARIABLE);176BIND_ENUM_CONSTANT(LOOKUP_RESULT_MAX);177178BIND_ENUM_CONSTANT(LOCATION_LOCAL);179BIND_ENUM_CONSTANT(LOCATION_PARENT_MASK);180BIND_ENUM_CONSTANT(LOCATION_OTHER_USER_CODE);181BIND_ENUM_CONSTANT(LOCATION_OTHER);182183BIND_ENUM_CONSTANT(CODE_COMPLETION_KIND_CLASS);184BIND_ENUM_CONSTANT(CODE_COMPLETION_KIND_FUNCTION);185BIND_ENUM_CONSTANT(CODE_COMPLETION_KIND_SIGNAL);186BIND_ENUM_CONSTANT(CODE_COMPLETION_KIND_VARIABLE);187BIND_ENUM_CONSTANT(CODE_COMPLETION_KIND_MEMBER);188BIND_ENUM_CONSTANT(CODE_COMPLETION_KIND_ENUM);189BIND_ENUM_CONSTANT(CODE_COMPLETION_KIND_CONSTANT);190BIND_ENUM_CONSTANT(CODE_COMPLETION_KIND_NODE_PATH);191BIND_ENUM_CONSTANT(CODE_COMPLETION_KIND_FILE_PATH);192BIND_ENUM_CONSTANT(CODE_COMPLETION_KIND_PLAIN_TEXT);193BIND_ENUM_CONSTANT(CODE_COMPLETION_KIND_MAX);194}195196197