-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHighlightTheme.h
More file actions
29 lines (22 loc) · 836 Bytes
/
Copy pathHighlightTheme.h
File metadata and controls
29 lines (22 loc) · 836 Bytes
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
#pragma once
#include <QHash>
#include <QTextCharFormat>
#include <cstdint>
namespace cold {
class HighlightTheme {
public:
HighlightTheme();
uint16_t scopeIdForTokenType(const QString& typeName) const;
uint16_t scopeIdForTokenIndex(int typeIndex, const QStringList& legendTypes) const;
QTextCharFormat formatForScopeId(uint16_t scopeId) const;
QTextCharFormat formatForToken(int typeIndex, uint32_t modifierBits,
const QStringList& legendTypes,
const QStringList& legendModifiers) const;
QHash<QString, uint16_t> typeToScopeMap() const;
private:
static void initFormats();
static QHash<uint16_t, QTextCharFormat> s_formats;
static bool s_initialized;
QHash<QString, uint16_t> m_typeToScope;
};
} // namespace cold