summaryrefslogtreecommitdiff
path: root/fluid/CodeEditor.h
diff options
context:
space:
mode:
authorerco77 <erco@seriss.com>2020-11-01 12:48:52 -0800
committerGitHub <noreply@github.com>2020-11-01 12:48:52 -0800
commit2b1a2fe8dde181e99c9787163f528cc79d663a3a (patch)
treee1d71466fcb75f772133e59e990db94f3e05fe45 /fluid/CodeEditor.h
parent1761523c9e730ca7ac635be91d4e56d7ff77beab (diff)
parentdab049a2bd701658d5354fc6d829c058edae1352 (diff)
Merge pull request #150 from erco77/master
Rewrite fluid CodeEditor syntax highlighting for issue #135
Diffstat (limited to 'fluid/CodeEditor.h')
-rw-r--r--fluid/CodeEditor.h28
1 files changed, 13 insertions, 15 deletions
diff --git a/fluid/CodeEditor.h b/fluid/CodeEditor.h
index e865ac63e..bf4b7b499 100644
--- a/fluid/CodeEditor.h
+++ b/fluid/CodeEditor.h
@@ -1,7 +1,7 @@
//
// Code editor widget for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2010 by Bill Spitzak and others.
+// Copyright 1998-2020 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -15,29 +15,28 @@
//
#ifndef CodeEditor_h
-# define CodeEditor_h
+#define CodeEditor_h
//
// Include necessary headers...
//
-# include <stdio.h>
-# include <stdlib.h>
-# include <string.h>
-# include <ctype.h>
-# include <FL/Fl.H>
-# include <FL/Fl_Text_Buffer.H>
-# include <FL/Fl_Text_Editor.H>
-
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <FL/Fl.H>
+#include <FL/Fl_Text_Buffer.H>
+#include <FL/Fl_Text_Editor.H>
+#include "StyleParse.h"
class CodeEditor : public Fl_Text_Editor {
- static Fl_Text_Display::Style_Table_Entry styletable[];
- static const char * const code_keywords[];
- static const char * const code_types[];
+ friend class StyleParse;
+ static Fl_Text_Display::Style_Table_Entry styletable[];
// 'style_parse()' - Parse text and produce style data.
- static void style_parse(const char *text, char *style, int length);
+ static void style_parse(const char *tbuff, char *sbuff, int len, char style);
// 'style_unfinished_cb()' - Update unfinished styles.
static void style_unfinished_cb(int, void*);
@@ -57,7 +56,6 @@ class CodeEditor : public Fl_Text_Editor {
// attempt to make the fluid code editor widget honour textsize setting
void textsize(Fl_Fontsize s);
-
};
class CodeViewer : public CodeEditor {