KSyntaxHighlighting
8 #include "kquicksyntaxhighlightingplugin.h"
9 #include "kquicksyntaxhighlighter.h"
10 #include "repositorywrapper.h"
12 #include <KSyntaxHighlighting/Definition>
13 #include <KSyntaxHighlighting/Repository>
14 #include <KSyntaxHighlighting/Theme>
22 static std::unique_ptr<Repository> s_instance;
24 s_instance = std::make_unique<Repository>();
26 return s_instance.get();
29 void KQuickSyntaxHighlightingPlugin::registerTypes(
const char *uri)
32 qRegisterMetaType<Definition>();
33 qRegisterMetaType<QVector<Definition>>();
34 qRegisterMetaType<Theme>();
35 qRegisterMetaType<QVector<Theme>>();
36 qmlRegisterType<KQuickSyntaxHighlighter>(uri, 1, 0,
"SyntaxHighlighter");
37 qmlRegisterUncreatableType<Definition>(uri, 1, 0,
"Definition", {});
38 qmlRegisterUncreatableType<Theme>(uri, 1, 0,
"Theme", {});
39 qmlRegisterSingletonType<RepositoryWrapper>(uri, 1, 0,
"Repository", [](
auto engine,
auto scriptEngine) {
42 auto repo =
new RepositoryWrapper;
43 repo->m_repository = defaultRepository();
Syntax highlighting repository.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Mar 26 2023 04:09:17 by
doxygen 1.8.17 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.