File indexing completed on 2024-04-28 05:46:50

0001 /*****************************************************************************
0002  *   Copyright 2003 - 2010 Craig Drummond <craig.p.drummond@gmail.com>       *
0003  *   Copyright 2013 - 2015 Yichao Yu <yyc1992@gmail.com>                     *
0004  *                                                                           *
0005  *   This program is free software; you can redistribute it and/or modify    *
0006  *   it under the terms of the GNU Lesser General Public License as          *
0007  *   published by the Free Software Foundation; either version 2.1 of the    *
0008  *   License, or (at your option) version 3, or any later version accepted   *
0009  *   by the membership of KDE e.V. (or its successor approved by the         *
0010  *   membership of KDE e.V.), which shall act as a proxy defined in          *
0011  *   Section 6 of version 3 of the license.                                  *
0012  *                                                                           *
0013  *   This program is distributed in the hope that it will be useful,         *
0014  *   but WITHOUT ANY WARRANTY; without even the implied warranty of          *
0015  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU       *
0016  *   Lesser General Public License for more details.                         *
0017  *                                                                           *
0018  *   You should have received a copy of the GNU Lesser General Public        *
0019  *   License along with this library. If not,                                *
0020  *   see <http://www.gnu.org/licenses/>.                                     *
0021  *****************************************************************************/
0022 
0023 #define __QTC_UTILS_OPTIONS_INTERNAL__
0024 
0025 #include "options.h"
0026 #include "map.h"
0027 
0028 namespace QtCurve {
0029 namespace Config {
0030 
0031 #define DEF_LOAD_VALUE(type, body...)           \
0032     template<>                                  \
0033     QTC_EXPORT                                  \
0034     _QTC_CONFIG_DEF_LOAD_VALUE(type, str, def)  \
0035     {                                           \
0036         static const StrMap<type> map{body};    \
0037         return map.search(str, def);            \
0038     }                                           \
0039     QTC_CONFIG_DEF_LOAD_VALUE(type)
0040 
0041 DEF_LOAD_VALUE(Shading,
0042                {"simple", Shading::Simple},
0043                {"hsl", Shading::HSL},
0044                {"hsv", Shading::HSV},
0045                {"hcy", Shading::HCY});
0046 DEF_LOAD_VALUE(EScrollbar,
0047                {"kde", SCROLLBAR_KDE},
0048                {"windows", SCROLLBAR_WINDOWS},
0049                {"platinum", SCROLLBAR_PLATINUM},
0050                {"next", SCROLLBAR_NEXT},
0051                {"none", SCROLLBAR_NONE});
0052 DEF_LOAD_VALUE(EFrame,
0053                {"none", FRAME_NONE},
0054                {"plain", FRAME_PLAIN},
0055                {"line", FRAME_LINE},
0056                {"shaded", FRAME_SHADED},
0057                {"faded", FRAME_FADED});
0058 
0059 }
0060 }