GrantleeTheme

colorscheme.cpp
1 /*
2  * Copyright (C) 2019 Volker Krause <[email protected]>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 
19 #include "colorscheme.h"
20 
21 #include <grantlee/metatype.h>
22 
23 #include <KColorScheme>
24 
25 #define PROP_IMPL(PROP, METHOD) if (QString::compare(property, QLatin1String(#PROP), Qt::CaseInsensitive) == 0) \
26  { return object.METHOD(KColorScheme::PROP).color(); }
27 #define BACKGROUND_PROP(PROP) PROP_IMPL(PROP, background)
28 #define FOREGROUND_PROP(PROP) PROP_IMPL(PROP, foreground)
29 #define DECORATION_PROP(PROP) PROP_IMPL(PROP, decoration)
30 
31 GRANTLEE_BEGIN_LOOKUP(KColorScheme)
32 BACKGROUND_PROP(NormalBackground)
33 BACKGROUND_PROP(AlternateBackground)
34 BACKGROUND_PROP(ActiveBackground)
35 BACKGROUND_PROP(LinkBackground)
36 BACKGROUND_PROP(VisitedBackground)
37 BACKGROUND_PROP(NegativeBackground)
38 BACKGROUND_PROP(NeutralBackground)
39 BACKGROUND_PROP(PositiveBackground)
40 
41 FOREGROUND_PROP(NormalText)
42 FOREGROUND_PROP(InactiveText)
43 FOREGROUND_PROP(ActiveText)
44 FOREGROUND_PROP(LinkText)
45 FOREGROUND_PROP(VisitedText)
46 FOREGROUND_PROP(NegativeText)
47 FOREGROUND_PROP(NeutralText)
48 FOREGROUND_PROP(PositiveText)
49 
50 DECORATION_PROP(FocusColor)
51 DECORATION_PROP(HoverColor)
52 
53 return {};
54 GRANTLEE_END_LOOKUP
55 
56 void ColorScheme::registerMetaType()
57 {
58  Grantlee::registerMetaType<KColorScheme>();
59 }
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sun Aug 9 2020 23:34:09 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.