script_language_extension.cpp 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  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. #include "script_language_extension.h"
  31. void ScriptExtension::_bind_methods() {
  32. GDVIRTUAL_BIND(_editor_can_reload_from_file);
  33. GDVIRTUAL_BIND(_placeholder_erased, "placeholder");
  34. GDVIRTUAL_BIND(_can_instantiate);
  35. GDVIRTUAL_BIND(_get_base_script);
  36. GDVIRTUAL_BIND(_get_global_name);
  37. GDVIRTUAL_BIND(_inherits_script, "script");
  38. GDVIRTUAL_BIND(_get_instance_base_type);
  39. GDVIRTUAL_BIND(_instance_create, "for_object");
  40. GDVIRTUAL_BIND(_placeholder_instance_create, "for_object");
  41. GDVIRTUAL_BIND(_instance_has, "object");
  42. GDVIRTUAL_BIND(_has_source_code);
  43. GDVIRTUAL_BIND(_get_source_code);
  44. GDVIRTUAL_BIND(_set_source_code, "code");
  45. GDVIRTUAL_BIND(_reload, "keep_state");
  46. GDVIRTUAL_BIND(_get_documentation);
  47. GDVIRTUAL_BIND(_has_method, "method");
  48. GDVIRTUAL_BIND(_get_method_info, "method");
  49. GDVIRTUAL_BIND(_is_tool);
  50. GDVIRTUAL_BIND(_is_valid);
  51. GDVIRTUAL_BIND(_get_language);
  52. GDVIRTUAL_BIND(_has_script_signal, "signal");
  53. GDVIRTUAL_BIND(_get_script_signal_list);
  54. GDVIRTUAL_BIND(_has_property_default_value, "property");
  55. GDVIRTUAL_BIND(_get_property_default_value, "property");
  56. GDVIRTUAL_BIND(_update_exports);
  57. GDVIRTUAL_BIND(_get_script_method_list);
  58. GDVIRTUAL_BIND(_get_script_property_list);
  59. GDVIRTUAL_BIND(_get_member_line, "member");
  60. GDVIRTUAL_BIND(_get_constants);
  61. GDVIRTUAL_BIND(_get_members);
  62. GDVIRTUAL_BIND(_is_placeholder_fallback_enabled);
  63. GDVIRTUAL_BIND(_get_rpc_config);
  64. }
  65. void ScriptLanguageExtension::_bind_methods() {
  66. GDVIRTUAL_BIND(_get_name);
  67. GDVIRTUAL_BIND(_init);
  68. GDVIRTUAL_BIND(_get_type);
  69. GDVIRTUAL_BIND(_get_extension);
  70. GDVIRTUAL_BIND(_finish);
  71. GDVIRTUAL_BIND(_get_reserved_words);
  72. GDVIRTUAL_BIND(_is_control_flow_keyword, "keyword");
  73. GDVIRTUAL_BIND(_get_comment_delimiters);
  74. GDVIRTUAL_BIND(_get_string_delimiters);
  75. GDVIRTUAL_BIND(_make_template, "template", "class_name", "base_class_name");
  76. GDVIRTUAL_BIND(_get_built_in_templates, "object");
  77. GDVIRTUAL_BIND(_is_using_templates);
  78. GDVIRTUAL_BIND(_validate, "script", "path", "validate_functions", "validate_errors", "validate_warnings", "validate_safe_lines");
  79. GDVIRTUAL_BIND(_validate_path, "path");
  80. GDVIRTUAL_BIND(_create_script);
  81. GDVIRTUAL_BIND(_has_named_classes);
  82. GDVIRTUAL_BIND(_supports_builtin_mode);
  83. GDVIRTUAL_BIND(_supports_documentation);
  84. GDVIRTUAL_BIND(_can_inherit_from_file);
  85. GDVIRTUAL_BIND(_find_function, "class_name", "function_name");
  86. GDVIRTUAL_BIND(_make_function, "class_name", "function_name", "function_args");
  87. GDVIRTUAL_BIND(_open_in_external_editor, "script", "line", "column");
  88. GDVIRTUAL_BIND(_overrides_external_editor);
  89. GDVIRTUAL_BIND(_complete_code, "code", "path", "owner");
  90. GDVIRTUAL_BIND(_lookup_code, "code", "symbol", "path", "owner");
  91. GDVIRTUAL_BIND(_auto_indent_code, "code", "from_line", "to_line");
  92. GDVIRTUAL_BIND(_add_global_constant, "name", "value");
  93. GDVIRTUAL_BIND(_add_named_global_constant, "name", "value");
  94. GDVIRTUAL_BIND(_remove_named_global_constant, "name");
  95. GDVIRTUAL_BIND(_thread_enter);
  96. GDVIRTUAL_BIND(_thread_exit);
  97. GDVIRTUAL_BIND(_debug_get_error);
  98. GDVIRTUAL_BIND(_debug_get_stack_level_count);
  99. GDVIRTUAL_BIND(_debug_get_stack_level_line, "level");
  100. GDVIRTUAL_BIND(_debug_get_stack_level_function, "level");
  101. GDVIRTUAL_BIND(_debug_get_stack_level_locals, "level", "max_subitems", "max_depth");
  102. GDVIRTUAL_BIND(_debug_get_stack_level_members, "level", "max_subitems", "max_depth");
  103. GDVIRTUAL_BIND(_debug_get_stack_level_instance, "level");
  104. GDVIRTUAL_BIND(_debug_get_globals, "max_subitems", "max_depth");
  105. GDVIRTUAL_BIND(_debug_parse_stack_level_expression, "level", "expression", "max_subitems", "max_depth");
  106. GDVIRTUAL_BIND(_debug_get_current_stack_info);
  107. GDVIRTUAL_BIND(_reload_all_scripts);
  108. GDVIRTUAL_BIND(_reload_tool_script, "script", "soft_reload");
  109. GDVIRTUAL_BIND(_get_recognized_extensions);
  110. GDVIRTUAL_BIND(_get_public_functions);
  111. GDVIRTUAL_BIND(_get_public_constants);
  112. GDVIRTUAL_BIND(_get_public_annotations);
  113. GDVIRTUAL_BIND(_profiling_start);
  114. GDVIRTUAL_BIND(_profiling_stop);
  115. GDVIRTUAL_BIND(_profiling_get_accumulated_data, "info_array", "info_max");
  116. GDVIRTUAL_BIND(_profiling_get_frame_data, "info_array", "info_max");
  117. GDVIRTUAL_BIND(_frame);
  118. GDVIRTUAL_BIND(_handles_global_class_type, "type");
  119. GDVIRTUAL_BIND(_get_global_class_name, "path");
  120. BIND_ENUM_CONSTANT(LOOKUP_RESULT_SCRIPT_LOCATION);
  121. BIND_ENUM_CONSTANT(LOOKUP_RESULT_CLASS);
  122. BIND_ENUM_CONSTANT(LOOKUP_RESULT_CLASS_CONSTANT);
  123. BIND_ENUM_CONSTANT(LOOKUP_RESULT_CLASS_PROPERTY);
  124. BIND_ENUM_CONSTANT(LOOKUP_RESULT_CLASS_METHOD);
  125. BIND_ENUM_CONSTANT(LOOKUP_RESULT_CLASS_SIGNAL);
  126. BIND_ENUM_CONSTANT(LOOKUP_RESULT_CLASS_ENUM);
  127. BIND_ENUM_CONSTANT(LOOKUP_RESULT_CLASS_TBD_GLOBALSCOPE);
  128. BIND_ENUM_CONSTANT(LOOKUP_RESULT_CLASS_ANNOTATION);
  129. BIND_ENUM_CONSTANT(LOOKUP_RESULT_MAX);
  130. BIND_ENUM_CONSTANT(LOCATION_LOCAL);
  131. BIND_ENUM_CONSTANT(LOCATION_PARENT_MASK);
  132. BIND_ENUM_CONSTANT(LOCATION_OTHER_USER_CODE);
  133. BIND_ENUM_CONSTANT(LOCATION_OTHER);
  134. BIND_ENUM_CONSTANT(CODE_COMPLETION_KIND_CLASS);
  135. BIND_ENUM_CONSTANT(CODE_COMPLETION_KIND_FUNCTION);
  136. BIND_ENUM_CONSTANT(CODE_COMPLETION_KIND_SIGNAL);
  137. BIND_ENUM_CONSTANT(CODE_COMPLETION_KIND_VARIABLE);
  138. BIND_ENUM_CONSTANT(CODE_COMPLETION_KIND_MEMBER);
  139. BIND_ENUM_CONSTANT(CODE_COMPLETION_KIND_ENUM);
  140. BIND_ENUM_CONSTANT(CODE_COMPLETION_KIND_CONSTANT);
  141. BIND_ENUM_CONSTANT(CODE_COMPLETION_KIND_NODE_PATH);
  142. BIND_ENUM_CONSTANT(CODE_COMPLETION_KIND_FILE_PATH);
  143. BIND_ENUM_CONSTANT(CODE_COMPLETION_KIND_PLAIN_TEXT);
  144. BIND_ENUM_CONSTANT(CODE_COMPLETION_KIND_MAX);
  145. }