You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-23 15:16:17 +00:00
Bring that Whole New World to the Old Continent too
Applies the clang-format style to the 2.1 branch as done for master in
5dbf1809c6.
This commit is contained in:
@@ -29,23 +29,23 @@
|
||||
#ifndef SCRIPT_EDITOR_PLUGIN_H
|
||||
#define SCRIPT_EDITOR_PLUGIN_H
|
||||
|
||||
#include "editor/code_editor.h"
|
||||
#include "editor/editor_help.h"
|
||||
#include "editor/editor_plugin.h"
|
||||
#include "editor/script_create_dialog.h"
|
||||
#include "scene/gui/item_list.h"
|
||||
#include "scene/gui/menu_button.h"
|
||||
#include "scene/gui/split_container.h"
|
||||
#include "scene/gui/tab_container.h"
|
||||
#include "scene/gui/text_edit.h"
|
||||
#include "scene/gui/menu_button.h"
|
||||
#include "scene/gui/tool_button.h"
|
||||
#include "scene/gui/tree.h"
|
||||
#include "scene/main/timer.h"
|
||||
#include "script_language.h"
|
||||
#include "editor/code_editor.h"
|
||||
#include "scene/gui/split_container.h"
|
||||
#include "scene/gui/item_list.h"
|
||||
#include "editor/editor_help.h"
|
||||
|
||||
class ScriptEditorQuickOpen : public ConfirmationDialog {
|
||||
|
||||
OBJ_TYPE(ScriptEditorQuickOpen,ConfirmationDialog )
|
||||
OBJ_TYPE(ScriptEditorQuickOpen, ConfirmationDialog)
|
||||
|
||||
LineEdit *search_box;
|
||||
Tree *search_options;
|
||||
@@ -53,67 +53,55 @@ class ScriptEditorQuickOpen : public ConfirmationDialog {
|
||||
|
||||
void _update_search();
|
||||
|
||||
void _sbox_input(const InputEvent& p_ie);
|
||||
void _sbox_input(const InputEvent &p_ie);
|
||||
Vector<String> functions;
|
||||
|
||||
|
||||
void _confirmed();
|
||||
void _text_changed(const String& p_newtext);
|
||||
void _text_changed(const String &p_newtext);
|
||||
|
||||
protected:
|
||||
|
||||
void _notification(int p_what);
|
||||
static void _bind_methods();
|
||||
public:
|
||||
|
||||
void popup(const Vector<String>& p_base,bool p_dontclear=false);
|
||||
public:
|
||||
void popup(const Vector<String> &p_base, bool p_dontclear = false);
|
||||
ScriptEditorQuickOpen();
|
||||
};
|
||||
|
||||
|
||||
class ScriptEditorDebugger;
|
||||
|
||||
class ScriptTextEditor : public CodeTextEditor {
|
||||
|
||||
OBJ_TYPE( ScriptTextEditor, CodeTextEditor );
|
||||
OBJ_TYPE(ScriptTextEditor, CodeTextEditor);
|
||||
|
||||
Ref<Script> script;
|
||||
|
||||
|
||||
Vector<String> functions;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
virtual void _validate_script();
|
||||
virtual void _code_complete_script(const String& p_code, List<String>* r_options);
|
||||
virtual void _code_complete_script(const String &p_code, List<String> *r_options);
|
||||
virtual void _load_theme_settings();
|
||||
void _notification(int p_what);
|
||||
static void _bind_methods();
|
||||
|
||||
|
||||
public:
|
||||
|
||||
virtual void apply_code();
|
||||
Ref<Script> get_edited_script() const;
|
||||
Vector<String> get_functions() ;
|
||||
void set_edited_script(const Ref<Script>& p_script);
|
||||
Vector<String> get_functions();
|
||||
void set_edited_script(const Ref<Script> &p_script);
|
||||
void reload_text();
|
||||
String get_name() ;
|
||||
Ref<Texture> get_icon() ;
|
||||
String get_name();
|
||||
Ref<Texture> get_icon();
|
||||
bool is_unsaved();
|
||||
ScriptTextEditor();
|
||||
|
||||
};
|
||||
|
||||
class EditorScriptCodeCompletionCache;
|
||||
|
||||
class ScriptEditor : public VBoxContainer {
|
||||
|
||||
OBJ_TYPE(ScriptEditor, VBoxContainer );
|
||||
|
||||
OBJ_TYPE(ScriptEditor, VBoxContainer);
|
||||
|
||||
EditorNode *editor;
|
||||
enum {
|
||||
@@ -169,14 +157,14 @@ class ScriptEditor : public VBoxContainer {
|
||||
WINDOW_MOVE_RIGHT,
|
||||
WINDOW_NEXT,
|
||||
WINDOW_PREV,
|
||||
WINDOW_SELECT_BASE=100
|
||||
WINDOW_SELECT_BASE = 100
|
||||
};
|
||||
|
||||
|
||||
enum ScriptSortBy {
|
||||
SORT_BY_NAME,
|
||||
SORT_BY_PATH,
|
||||
};
|
||||
|
||||
|
||||
enum ScriptListName {
|
||||
DISPLAY_NAME,
|
||||
DISPLAY_DIR_AND_NAME,
|
||||
@@ -205,7 +193,7 @@ class ScriptEditor : public VBoxContainer {
|
||||
GotoLineDialog *goto_line_dialog;
|
||||
ConfirmationDialog *erase_tab_confirm;
|
||||
ScriptCreateDialog *script_create_dialog;
|
||||
ScriptEditorDebugger* debugger;
|
||||
ScriptEditorDebugger *debugger;
|
||||
ToolButton *scripts_visible;
|
||||
|
||||
String current_theme;
|
||||
@@ -216,7 +204,6 @@ class ScriptEditor : public VBoxContainer {
|
||||
ToolButton *script_back;
|
||||
ToolButton *script_forward;
|
||||
|
||||
|
||||
struct ScriptHistory {
|
||||
|
||||
Control *control;
|
||||
@@ -228,7 +215,6 @@ class ScriptEditor : public VBoxContainer {
|
||||
Vector<ScriptHistory> history;
|
||||
int history_pos;
|
||||
|
||||
|
||||
EditorHelpIndex *help_index;
|
||||
|
||||
void _tab_changed(int p_which);
|
||||
@@ -239,12 +225,12 @@ class ScriptEditor : public VBoxContainer {
|
||||
|
||||
bool restoring_layout;
|
||||
|
||||
String _get_debug_tooltip(const String&p_text,Node *_ste);
|
||||
String _get_debug_tooltip(const String &p_text, Node *_ste);
|
||||
|
||||
void _resave_scripts(const String& p_str);
|
||||
void _resave_scripts(const String &p_str);
|
||||
void _reload_scripts();
|
||||
|
||||
bool _test_script_times_on_disk(Ref<Script> p_for_script=Ref<Script>());
|
||||
bool _test_script_times_on_disk(Ref<Script> p_for_script = Ref<Script>());
|
||||
|
||||
void _close_tab(int p_idx);
|
||||
|
||||
@@ -267,16 +253,16 @@ class ScriptEditor : public VBoxContainer {
|
||||
|
||||
int edit_pass;
|
||||
|
||||
void _add_callback(Object *p_obj, const String& p_function, const StringArray& p_args);
|
||||
void _res_saved_callback(const Ref<Resource>& p_res);
|
||||
void _add_callback(Object *p_obj, const String &p_function, const StringArray &p_args);
|
||||
void _res_saved_callback(const Ref<Resource> &p_res);
|
||||
|
||||
bool trim_trailing_whitespace_on_save;
|
||||
|
||||
void _trim_trailing_whitespace(TextEdit *tx);
|
||||
|
||||
void _goto_script_line2(int p_line);
|
||||
void _goto_script_line(REF p_script,int p_line);
|
||||
void _breaked(bool p_breaked,bool p_can_debug);
|
||||
void _goto_script_line(REF p_script, int p_line);
|
||||
void _breaked(bool p_breaked, bool p_can_debug);
|
||||
void _show_debugger(bool p_show);
|
||||
void _update_window_menu();
|
||||
void _script_created(Ref<Script> p_script);
|
||||
@@ -289,47 +275,47 @@ class ScriptEditor : public VBoxContainer {
|
||||
|
||||
void _script_selected(int p_idx);
|
||||
|
||||
void _find_scripts(Node* p_base, Node* p_current,Set<Ref<Script> >& used);
|
||||
void _find_scripts(Node *p_base, Node *p_current, Set<Ref<Script> > &used);
|
||||
|
||||
void _tree_changed();
|
||||
|
||||
void _script_split_dragged(float);
|
||||
|
||||
void _unhandled_input(const InputEvent& p_event);
|
||||
|
||||
void _unhandled_input(const InputEvent &p_event);
|
||||
|
||||
void _history_forward();
|
||||
void _history_back();
|
||||
|
||||
bool waiting_update_names;
|
||||
|
||||
void _help_class_open(const String& p_class);
|
||||
void _help_class_goto(const String& p_desc);
|
||||
void _help_class_open(const String &p_class);
|
||||
void _help_class_goto(const String &p_desc);
|
||||
void _update_history_arrows();
|
||||
void _go_to_tab(int p_idx);
|
||||
void _update_history_pos(int p_new_pos);
|
||||
void _update_script_colors();
|
||||
void _update_modified_scripts_for_external_editor(Ref<Script> p_for_script=Ref<Script>());
|
||||
void _update_modified_scripts_for_external_editor(Ref<Script> p_for_script = Ref<Script>());
|
||||
|
||||
int file_dialog_option;
|
||||
void _file_dialog_action(String p_file);
|
||||
|
||||
static ScriptEditor *script_editor;
|
||||
|
||||
protected:
|
||||
void _notification(int p_what);
|
||||
static void _bind_methods();
|
||||
public:
|
||||
|
||||
public:
|
||||
static ScriptEditor *get_singleton() { return script_editor; }
|
||||
|
||||
void ensure_focus_current();
|
||||
void apply_scripts() const;
|
||||
|
||||
void ensure_select_current();
|
||||
void edit(const Ref<Script>& p_script);
|
||||
void edit(const Ref<Script> &p_script);
|
||||
|
||||
Dictionary get_state() const;
|
||||
void set_state(const Dictionary& p_state);
|
||||
void set_state(const Dictionary &p_state);
|
||||
void clear();
|
||||
|
||||
void get_breakpoints(List<String> *p_breakpoints);
|
||||
@@ -342,15 +328,15 @@ public:
|
||||
void set_window_layout(Ref<ConfigFile> p_layout);
|
||||
void get_window_layout(Ref<ConfigFile> p_layout);
|
||||
|
||||
void set_scene_root_script( Ref<Script> p_script );
|
||||
void set_scene_root_script(Ref<Script> p_script);
|
||||
|
||||
bool script_go_to_method(Ref<Script> p_script, const String& p_method);
|
||||
bool script_go_to_method(Ref<Script> p_script, const String &p_method);
|
||||
|
||||
virtual void edited_scene_changed();
|
||||
|
||||
void close_builtin_scripts_from_scene(const String& p_scene);
|
||||
void close_builtin_scripts_from_scene(const String &p_scene);
|
||||
|
||||
void goto_help(const String& p_desc) { _help_class_goto(p_desc); }
|
||||
void goto_help(const String &p_desc) { _help_class_goto(p_desc); }
|
||||
|
||||
ScriptEditorDebugger *get_debugger() { return debugger; }
|
||||
void set_live_auto_reload_running_scripts(bool p_enabled);
|
||||
@@ -361,12 +347,12 @@ public:
|
||||
|
||||
class ScriptEditorPlugin : public EditorPlugin {
|
||||
|
||||
OBJ_TYPE( ScriptEditorPlugin, EditorPlugin );
|
||||
OBJ_TYPE(ScriptEditorPlugin, EditorPlugin);
|
||||
|
||||
ScriptEditor *script_editor;
|
||||
EditorNode *editor;
|
||||
public:
|
||||
|
||||
public:
|
||||
virtual String get_name() const { return "Script"; }
|
||||
bool has_main_screen() const { return true; }
|
||||
virtual void edit(Object *p_node);
|
||||
@@ -375,7 +361,7 @@ public:
|
||||
virtual void selected_notify();
|
||||
|
||||
Dictionary get_state() const;
|
||||
virtual void set_state(const Dictionary& p_state);
|
||||
virtual void set_state(const Dictionary &p_state);
|
||||
virtual void clear();
|
||||
|
||||
virtual void save_external_data();
|
||||
@@ -389,12 +375,10 @@ public:
|
||||
|
||||
virtual void get_breakpoints(List<String> *p_breakpoints);
|
||||
|
||||
|
||||
virtual void edited_scene_changed();
|
||||
|
||||
ScriptEditorPlugin(EditorNode *p_node);
|
||||
~ScriptEditorPlugin();
|
||||
|
||||
};
|
||||
|
||||
#endif // SCRIPT_EDITOR_PLUGIN_H
|
||||
|
||||
Reference in New Issue
Block a user