Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
theme_parser.h
Go to the documentation of this file.
1
10#ifndef THEME_PARSER_H
11#define THEME_PARSER_H
12
14
15#include <QFont>
16#include <QHash>
17#include <QJsonObject>
18#include <QList>
19#include <QString>
20
36{
37public:
42 struct Result {
44 QHash<ThemeManager::ThemeToken, ThemeColorPair> colors;
45 QList<ThemeColorPair> graphColors;
48 };
49
50 ThemeParser(const QHash<QString, ThemeSectionInfo> &sections,
51 const QHash<QString, ThemeManager::ThemeToken> &roleCache);
52
62 bool parse(const QString &internalName,
63 const QString &resourcePath,
64 Result &out);
65
66private:
67 static QByteArray stripJsoncComments(const QByteArray &jsonc);
68 static QColor parseColor(const QString &colorStr);
69 static ThemeColorPair parseColorPair(const QJsonObject &obj);
70 void parseSection(const QJsonObject &root,
71 const QString &sectionName,
72 const ThemeSectionInfo &sectionInfo,
73 const ThemeInfo &info,
74 QHash<ThemeManager::ThemeToken, ThemeColorPair> &out);
75 static QFont parseFontFamily(const QJsonObject &obj, QFont defaultFont);
76 void parseFonts(const QJsonObject &fontsObj, Result &out);
77
78 ThemeManager::ThemeToken stringToToken(const QString &token) const;
79
80 const QHash<QString, ThemeSectionInfo> &sections_;
81 const QHash<QString, ThemeManager::ThemeToken> &roleCache_;
82};
83
84#endif /* THEME_PARSER_H */
Definition theme_parser.h:36
Definition theme_manager.h:39
Definition theme_manager.h:26
Definition theme_parser.h:42
QFont regularFont
empty QFont if not set
Definition theme_parser.h:46
QFont monospaceFont
empty QFont if not set
Definition theme_parser.h:47
Definition theme_manager.h:34
Definition file-pcapng.h:57