summaryrefslogtreecommitdiff
path: root/tools/editor/plugins/script_text_editor.h
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2016-08-02 19:11:05 -0300
committerJuan Linietsky <reduzio@gmail.com>2016-08-02 19:11:05 -0300
commitad313097ebcb2a0c02c956fdf74a6610c3f7c9a8 (patch)
tree2c02ecaaa80bfdcf01e4061f27b808e748cdc580 /tools/editor/plugins/script_text_editor.h
parent221cb58382ae34d4f91d9923fd979a328feabace (diff)
WIP visual scripting, not working yet but you can check out stuff
Diffstat (limited to 'tools/editor/plugins/script_text_editor.h')
-rw-r--r--tools/editor/plugins/script_text_editor.h112
1 files changed, 112 insertions, 0 deletions
diff --git a/tools/editor/plugins/script_text_editor.h b/tools/editor/plugins/script_text_editor.h
new file mode 100644
index 0000000000..6b2cea5bad
--- /dev/null
+++ b/tools/editor/plugins/script_text_editor.h
@@ -0,0 +1,112 @@
+#ifndef SCRIPT_TEXT_EDITOR_H
+#define SCRIPT_TEXT_EDITOR_H
+
+#include "script_editor_plugin.h"
+
+
+class ScriptTextEditor : public ScriptEditorBase {
+
+ OBJ_TYPE( ScriptTextEditor, ScriptEditorBase );
+
+ CodeTextEditor *code_editor;
+
+ Ref<Script> script;
+
+
+ Vector<String> functions;
+
+ HBoxContainer *edit_hb;
+
+ MenuButton *edit_menu;
+ MenuButton *search_menu;
+
+ GotoLineDialog *goto_line_dialog;
+ ScriptEditorQuickOpen *quick_open;
+
+ enum {
+ EDIT_UNDO,
+ EDIT_REDO,
+ EDIT_CUT,
+ EDIT_COPY,
+ EDIT_PASTE,
+ EDIT_SELECT_ALL,
+ EDIT_COMPLETE,
+ EDIT_AUTO_INDENT,
+ EDIT_TRIM_TRAILING_WHITESAPCE,
+ EDIT_TOGGLE_COMMENT,
+ EDIT_MOVE_LINE_UP,
+ EDIT_MOVE_LINE_DOWN,
+ EDIT_INDENT_RIGHT,
+ EDIT_INDENT_LEFT,
+ EDIT_CLONE_DOWN,
+ SEARCH_FIND,
+ SEARCH_FIND_NEXT,
+ SEARCH_FIND_PREV,
+ SEARCH_REPLACE,
+ SEARCH_LOCATE_FUNCTION,
+ SEARCH_GOTO_LINE,
+ DEBUG_TOGGLE_BREAKPOINT,
+ DEBUG_REMOVE_ALL_BREAKPOINTS,
+ DEBUG_GOTO_NEXT_BREAKPOINT,
+ DEBUG_GOTO_PREV_BREAKPOINT,
+ HELP_CONTEXTUAL,
+ };
+
+
+protected:
+
+
+ static void _code_complete_scripts(void* p_ud,const String& p_code, List<String>* r_options);
+ void _breakpoint_toggled(int p_row);
+
+ //no longer virtual
+ void _validate_script();
+ void _code_complete_script(const String& p_code, List<String>* r_options);
+ void _load_theme_settings();
+
+ void _notification(int p_what);
+ static void _bind_methods();
+
+ void _edit_option(int p_op);
+
+ void _goto_line(int p_line) { goto_line(p_line); }
+public:
+
+ virtual void apply_code();
+ virtual Ref<Script> get_edited_script() const;
+ virtual Vector<String> get_functions() ;
+ virtual void set_edited_script(const Ref<Script>& p_script);
+ virtual void reload_text();
+ virtual String get_name() ;
+ virtual Ref<Texture> get_icon() ;
+ virtual bool is_unsaved();
+
+ virtual Variant get_edit_state();
+ virtual void set_edit_state(const Variant& p_state);
+ virtual void ensure_focus();
+ virtual void trim_trailing_whitespace();
+ virtual void tag_saved_version();
+
+ virtual void goto_line(int p_line);
+
+ virtual void reload(bool p_soft);
+ virtual void get_breakpoints(List<int> *p_breakpoints);
+
+ virtual void add_callback(const String& p_function,StringArray p_args);
+ virtual void update_settings();
+ virtual bool goto_method(const String& p_method);
+
+ virtual void set_tooltip_request_func(String p_method,Object* p_obj);
+
+ Control *get_edit_menu();
+
+ static void register_editor();
+
+ ScriptTextEditor();
+
+};
+
+
+
+
+#endif // SCRIPT_TEXT_EDITOR_H