29 #ifndef SCRIPT_LANGUAGE_H 30 #define SCRIPT_LANGUAGE_H 48 static int _language_count;
49 static bool scripting_enabled;
52 static void set_scripting_enabled(
bool p_enabled);
53 static bool is_scripting_enabled();
54 static int get_language_count();
58 static void init_languages();
73 void _notification(
int p_what);
74 static void _bind_methods();
80 virtual bool can_instance()
const=0;
82 virtual StringName get_instance_base_type()
const=0;
84 virtual bool instance_has(
const Object *p_this)
const=0;
87 virtual bool has_source_code()
const=0;
88 virtual String get_source_code()
const=0;
89 virtual void set_source_code(
const String& p_code)=0;
90 virtual Error reload()=0;
92 virtual bool is_tool()
const=0;
94 virtual String get_node_type()
const=0;
98 virtual bool has_script_signal(
const StringName& p_signal)
const=0;
101 virtual bool get_property_default_value(
const StringName& p_property,
Variant& r_value)
const=0;
103 virtual void update_exports() {}
114 virtual Variant::Type get_property_type(
const StringName& p_name,
bool *r_is_valid=NULL)
const=0;
119 virtual bool has_method(
const StringName& p_method)
const=0;
122 virtual void call_multilevel(
const StringName& p_method,VARIANT_ARG_LIST);
123 virtual void call_multilevel(
const StringName& p_method,
const Variant** p_args,
int p_argcount);
124 virtual void call_multilevel_reversed(
const StringName& p_method,
const Variant** p_args,
int p_argcount);
125 virtual void notification(
int p_notification)=0;
139 virtual RES get_cached_resource(
const String& p_path)=0;
150 virtual String get_name()
const=0;
153 virtual void init()=0;
154 virtual String get_type()
const=0;
155 virtual String get_extension()
const=0;
156 virtual Error execute_file(
const String& p_path) =0;
157 virtual void finish()=0;
160 virtual void get_reserved_words(
List<String> *p_words)
const=0;
161 virtual void get_comment_delimiters(
List<String> *p_delimiters)
const=0;
162 virtual void get_string_delimiters(
List<String> *p_delimiters)
const=0;
163 virtual String get_template(
const String& p_class_name,
const String& p_base_class_name)
const=0;
164 virtual bool validate(
const String& p_script,
int &r_line_error,
int &r_col_error,
String& r_test_error,
const String& p_path=
"",
List<String> *r_functions=NULL)
const=0;
165 virtual Script *create_script()
const=0;
166 virtual bool has_named_classes()
const=0;
167 virtual int find_function(
const String& p_function,
const String& p_code)
const=0;
170 virtual void auto_indent_code(
String& p_code,
int p_from_line,
int p_to_line)
const=0;
171 virtual void add_global_constant(
const StringName& p_variable,
const Variant& p_value)=0;
175 virtual String debug_get_error()
const=0;
176 virtual int debug_get_stack_level_count()
const=0;
177 virtual int debug_get_stack_level_line(
int p_level)
const=0;
178 virtual String debug_get_stack_level_function(
int p_level)
const=0;
179 virtual String debug_get_stack_level_source(
int p_level)
const=0;
180 virtual void debug_get_stack_level_locals(
int p_level,
List<String> *p_locals,
List<Variant> *p_values,
int p_max_subitems=-1,
int p_max_depth=-1)=0;
181 virtual void debug_get_stack_level_members(
int p_level,
List<String> *p_members,
List<Variant> *p_values,
int p_max_subitems=-1,
int p_max_depth=-1)=0;
182 virtual void debug_get_globals(
List<String> *p_locals,
List<Variant> *p_values,
int p_max_subitems=-1,
int p_max_depth=-1)=0;
183 virtual String debug_parse_stack_level_expression(
int p_level,
const String& p_expression,
int p_max_subitems=-1,
int p_max_depth=-1)=0;
194 virtual void get_recognized_extensions(
List<String> *p_extensions)
const=0;
198 virtual void frame();
203 extern uint8_t script_encryption_key[32];
217 virtual Variant::Type get_property_type(
const StringName& p_name,
bool *r_is_valid=NULL)
const;
220 virtual bool has_method(
const StringName& p_method)
const {
return false; }
225 virtual void notification(
int p_notification) {}
228 virtual Ref<Script> get_script()
const {
return script; }
232 Object *get_owner() {
return owner; }
253 typedef void (*RequestSceneTreeMessageFunc)(
void *);
258 void (*node_path_func)(
void *,
const NodePath &p_path,
int p_id);
259 void (*res_path_func)(
void *,
const String &p_path,
int p_id);
261 void (*node_set_func)(
void *,
int p_id,
const StringName& p_prop,
const Variant& p_value);
262 void (*node_set_res_func)(
void *,
int p_id,
const StringName& p_prop,
const String& p_value);
263 void (*node_call_func)(
void *,
int p_id,
const StringName& p_method,VARIANT_ARG_DECLARE);
264 void (*res_set_func)(
void *,
int p_id,
const StringName& p_prop,
const Variant& p_value);
265 void (*res_set_res_func)(
void *,
int p_id,
const StringName& p_prop,
const String& p_value);
266 void (*res_call_func)(
void *,
int p_id,
const StringName& p_method,VARIANT_ARG_DECLARE);
267 void (*root_func)(
void*,
const NodePath& p_scene_path,
const String& p_scene_from);
269 void (*tree_create_node_func)(
void*,
const NodePath& p_parent,
const String& p_type,
const String& p_name);
270 void (*tree_instance_node_func)(
void*,
const NodePath& p_parent,
const String& p_path,
const String& p_name);
271 void (*tree_remove_node_func)(
void*,
const NodePath& p_at);
272 void (*tree_remove_and_keep_node_func)(
void*,
const NodePath& p_at,ObjectID p_keep_id);
273 void (*tree_restore_node_func)(
void*,ObjectID p_id,
const NodePath& p_at,
int p_at_pos);
274 void (*tree_duplicate_node_func)(
void*,
const NodePath& p_at,
const String& p_new_name);
275 void (*tree_reparent_node_func)(
void*,
const NodePath& p_at,
const NodePath& p_new_place,
const String& p_new_name,
int p_at_pos);
281 _FORCE_INLINE_
static ScriptDebugger * get_singleton() {
return singleton; }
282 void set_lines_left(
int p_left);
283 int get_lines_left()
const;
285 void set_depth(
int p_depth);
286 int get_depth()
const;
288 String breakpoint_find_source(
const String& p_source)
const;
289 void insert_breakpoint(
int p_line,
const StringName& p_source);
290 void remove_breakpoint(
int p_line,
const StringName& p_source);
291 bool is_breakpoint(
int p_line,
const StringName& p_source)
const;
292 bool is_breakpoint_line(
int p_line)
const;
293 void clear_breakpoints();
296 virtual void debug(
ScriptLanguage *p_script,
bool p_can_continue=
true)=0;
297 virtual void idle_poll();
298 virtual void line_poll();
304 virtual void send_message(
const String& p_message,
const Array& p_args)=0;
306 virtual bool is_remote()
const {
return false; }
307 virtual void request_quit() {}
309 virtual void set_request_scene_tree_message_func(RequestSceneTreeMessageFunc p_func,
void *p_udata) {}
Definition: script_language.h:147
Definition: string_db.h:48
Definition: script_language.h:242
Definition: script_language.h:134
Definition: script_language.h:205
Definition: resource.h:89
Definition: script_language.h:109
Definition: script_language.h:255
Definition: script_language.h:185
Definition: script_language.h:41
Definition: variant.h:379
Definition: script_language.h:66