Expose Syntax highlighter for editor plugins

This commit is contained in:
Paulb23 2020-03-07 14:29:44 +00:00
parent 2f1080be9b
commit 156daddaaf
11 changed files with 71 additions and 19 deletions

View file

@ -236,14 +236,12 @@ class ScriptEditor : public PanelContainer {
enum {
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];
Vector<Ref<SyntaxHighlighter> > syntax_highlighters;
struct ScriptHistory {
Control *control;
@ -322,6 +320,7 @@ class ScriptEditor : public PanelContainer {
void _script_created(Ref<Script> p_script);
ScriptEditorBase *_get_current_editor() const;
Array _get_open_script_editors() const;
void _save_layout();
void _editor_settings_changed();
@ -441,7 +440,9 @@ public:
void set_live_auto_reload_running_scripts(bool p_enabled);
static void register_create_syntax_highlighter_function(CreateSyntaxHighlighterFunc p_func);
void register_syntax_highlighter(const Ref<SyntaxHighlighter> &p_syntax_highlighter);
void unregister_syntax_highlighter(const Ref<SyntaxHighlighter> &p_syntax_highlighter);
static void register_create_script_editor_function(CreateScriptEditorFunc p_func);
ScriptEditor(EditorNode *p_editor);