diff options
| author | Paulb23 | 2018-04-02 12:41:44 +0100 |
|---|---|---|
| committer | Paulb23 | 2018-04-02 12:41:44 +0100 |
| commit | f7c727e6c34dccd3b36c37a1fb006715416fbcb6 (patch) | |
| tree | e6cf8830f726250e3e893842d32e9e4c618fd387 /editor/plugins/script_editor_plugin.h | |
| parent | 098c7ba4f9c49b472b9417819144378081996874 (diff) | |
| download | godot-f7c727e6c34dccd3b36c37a1fb006715416fbcb6.tar.gz godot-f7c727e6c34dccd3b36c37a1fb006715416fbcb6.tar.zst godot-f7c727e6c34dccd3b36c37a1fb006715416fbcb6.zip | |
Abstracted the syntax highlighter from text edit
Diffstat (limited to 'editor/plugins/script_editor_plugin.h')
| -rw-r--r-- | editor/plugins/script_editor_plugin.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/editor/plugins/script_editor_plugin.h b/editor/plugins/script_editor_plugin.h index bcc604d99..f94735108 100644 --- a/editor/plugins/script_editor_plugin.h +++ b/editor/plugins/script_editor_plugin.h @@ -80,6 +80,9 @@ protected: static void _bind_methods(); public: + virtual void add_syntax_highlighter(SyntaxHighlighter *p_highlighter) = 0; + virtual void set_syntax_highlighter(SyntaxHighlighter *p_highlighter) = 0; + virtual void apply_code() = 0; virtual Ref<Script> get_edited_script() const = 0; virtual Vector<String> get_functions() = 0; @@ -112,6 +115,7 @@ public: ScriptEditorBase() {} }; +typedef SyntaxHighlighter *(*CreateSyntaxHighlighterFunc)(); typedef ScriptEditorBase *(*CreateScriptEditorFunc)(const Ref<Script> &p_script); class EditorScriptCodeCompletionCache; @@ -214,12 +218,16 @@ class ScriptEditor : public PanelContainer { ToolButton *script_forward; enum { - SCRIPT_EDITOR_FUNC_MAX = 32 + SCRIPT_EDITOR_FUNC_MAX = 32, + SYNTAX_HIGHLIGHTER_FUNC_MAX = 32 }; static int script_editor_func_count; static CreateScriptEditorFunc script_editor_funcs[SCRIPT_EDITOR_FUNC_MAX]; + static int syntax_highlighters_func_count; + static CreateSyntaxHighlighterFunc syntax_highlighters_funcs[SYNTAX_HIGHLIGHTER_FUNC_MAX]; + struct ScriptHistory { Control *control; @@ -399,7 +407,9 @@ public: ScriptEditorDebugger *get_debugger() { return debugger; } void set_live_auto_reload_running_scripts(bool p_enabled); + static void register_create_syntax_highlighter_function(CreateSyntaxHighlighterFunc p_func); static void register_create_script_editor_function(CreateScriptEditorFunc p_func); + ScriptEditor(EditorNode *p_editor); ~ScriptEditor(); }; |
