aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/3rdparty/syntax-highlighting/src/lib/ansihighlighter.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/3rdparty/syntax-highlighting/src/lib/ansihighlighter.h')
-rw-r--r--src/libs/3rdparty/syntax-highlighting/src/lib/ansihighlighter.h34
1 files changed, 18 insertions, 16 deletions
diff --git a/src/libs/3rdparty/syntax-highlighting/src/lib/ansihighlighter.h b/src/libs/3rdparty/syntax-highlighting/src/lib/ansihighlighter.h
index ffb13f38f37..0942aa0242b 100644
--- a/src/libs/3rdparty/syntax-highlighting/src/lib/ansihighlighter.h
+++ b/src/libs/3rdparty/syntax-highlighting/src/lib/ansihighlighter.h
@@ -11,10 +11,11 @@
#include "ksyntaxhighlighting_export.h"
#include <QFlags>
-#include <QIODevice>
#include <QString>
-#include <memory>
+QT_BEGIN_NAMESPACE
+class QIODevice;
+QT_END_NAMESPACE
namespace KSyntaxHighlighting
{
@@ -29,24 +30,25 @@ public:
XTerm256Color,
};
- enum class TraceOption {
+ enum class Option {
NoOptions,
- Format = 1 << 0,
- Region = 1 << 1,
- Context = 1 << 2,
- StackSize = 1 << 3,
+ UseEditorBackground = 1 << 0,
+ Unbuffered = 1 << 1,
+
+ // Options that displays a useful visual aid for syntax creation
+ TraceFormat = 1 << 2,
+ TraceRegion = 1 << 3,
+ TraceContext = 1 << 4,
+ TraceStackSize = 1 << 5,
+ TraceAll = TraceFormat | TraceRegion | TraceContext | TraceStackSize,
};
- Q_DECLARE_FLAGS(TraceOptions, TraceOption)
+ Q_DECLARE_FLAGS(Options, Option)
AnsiHighlighter();
~AnsiHighlighter() override;
- void highlightFile(const QString &fileName,
- AnsiFormat format = AnsiFormat::TrueColor,
- bool useEditorBackground = true,
- TraceOptions traceOptions = TraceOptions());
- void
- highlightData(QIODevice *device, AnsiFormat format = AnsiFormat::TrueColor, bool useEditorBackground = true, TraceOptions traceOptions = TraceOptions());
+ void highlightFile(const QString &fileName, AnsiFormat format = AnsiFormat::TrueColor, Options options = Option::UseEditorBackground);
+ void highlightData(QIODevice *device, AnsiFormat format = AnsiFormat::TrueColor, Options options = Option::UseEditorBackground);
void setOutputFile(const QString &fileName);
void setOutputFile(FILE *fileHandle);
@@ -55,10 +57,10 @@ protected:
void applyFormat(int offset, int length, const Format &format) override;
private:
- std::unique_ptr<AnsiHighlighterPrivate> d;
+ Q_DECLARE_PRIVATE(AnsiHighlighter)
};
}
-Q_DECLARE_OPERATORS_FOR_FLAGS(KSyntaxHighlighting::AnsiHighlighter::TraceOptions)
+Q_DECLARE_OPERATORS_FOR_FLAGS(KSyntaxHighlighting::AnsiHighlighter::Options)
#endif // KSYNTAXHIGHLIGHTING_ANSIHIGHLIGHTER_H