summaryrefslogtreecommitdiff
path: root/src/highlighter.h
blob: a6e2dc3df9855408c16dc7f9ca93e273931e9963 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef HIGHLIGHTER_H_
#define HIGHLIGHTER_H_

#include <QSyntaxHighlighter>

class Highlighter : public QSyntaxHighlighter
{
public:
	enum state_e {NORMAL=-1,QUOTE,COMMENT};
	enum mode_e {NORMAL_MODE, ERROR_MODE};
	mode_e mode;

	QStringList operators;
	QStringList KeyWords;
	QStringList Primitives3D;
	QStringList Primitives2D;
	QStringList Transforms;
	QStringList Imports;
	QTextCharFormat ErrorStyle;
	QTextCharFormat OperatorStyle;
	QTextCharFormat CommentStyle;
	QTextCharFormat QuoteStyle;
	QTextCharFormat KeyWordStyle;
	QTextCharFormat PrimitiveStyle3D;
	QTextCharFormat PrimitiveStyle2D;
	QTextCharFormat TransformStyle;
	QTextCharFormat ImportStyle;
	Highlighter(QTextDocument *parent, mode_e mode);
	void highlightBlock(const QString &text);
};

#endif
contact: Jan Huwald // Impressum