GrantleeTheme

colorscheme.cpp
1 /*
2  * SPDX-FileCopyrightText: 2019 Volker Krause <[email protected]>
3  *
4  * SPDX-License-Identifier: LGPL-2.1-or-later
5  */
6 
7 #include "colorscheme.h"
8 
9 #include <grantlee/metatype.h>
10 
11 #include <KColorScheme>
12 
13 #define PROP_IMPL(PROP, METHOD) \
14  if (QString::compare(property, QLatin1String(#PROP), Qt::CaseInsensitive) == 0) { \
15  return object.METHOD(KColorScheme::PROP).color(); \
16  }
17 #define BACKGROUND_PROP(PROP) PROP_IMPL(PROP, background)
18 #define FOREGROUND_PROP(PROP) PROP_IMPL(PROP, foreground)
19 #define DECORATION_PROP(PROP) PROP_IMPL(PROP, decoration)
20 
21 GRANTLEE_BEGIN_LOOKUP(KColorScheme)
22 BACKGROUND_PROP(NormalBackground)
23 BACKGROUND_PROP(AlternateBackground)
24 BACKGROUND_PROP(ActiveBackground)
25 BACKGROUND_PROP(LinkBackground)
26 BACKGROUND_PROP(VisitedBackground)
27 BACKGROUND_PROP(NegativeBackground)
28 BACKGROUND_PROP(NeutralBackground)
29 BACKGROUND_PROP(PositiveBackground)
30 
31 FOREGROUND_PROP(NormalText)
32 FOREGROUND_PROP(InactiveText)
33 FOREGROUND_PROP(ActiveText)
34 FOREGROUND_PROP(LinkText)
35 FOREGROUND_PROP(VisitedText)
36 FOREGROUND_PROP(NegativeText)
37 FOREGROUND_PROP(NeutralText)
38 FOREGROUND_PROP(PositiveText)
39 
40 DECORATION_PROP(FocusColor)
41 DECORATION_PROP(HoverColor)
42 
43 return {};
44 GRANTLEE_END_LOOKUP
45 
46 void ColorScheme::registerMetaType()
47 {
48  Grantlee::registerMetaType<KColorScheme>();
49 }
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Thu May 13 2021 23:17:15 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.