7 #ifndef _FCITX_CONFIG_TYPENAME_H_ 8 #define _FCITX_CONFIG_TYPENAME_H_ 12 #include <type_traits> 15 #include <fcitx-utils/i18nstring.h> 17 #include <fcitx-utils/macros.h> 18 #include <fcitx-utils/semver.h> 22 #define FCITX_SPECIALIZE_TYPENAME(TYPE, NAME) \ 23 static inline std::string _FCITX_UNUSED_ configTypeNameHelper(TYPE *) { \ 27 FCITX_SPECIALIZE_TYPENAME(
bool,
"Boolean");
28 FCITX_SPECIALIZE_TYPENAME(
int,
"Integer");
29 FCITX_SPECIALIZE_TYPENAME(std::string,
"String");
30 FCITX_SPECIALIZE_TYPENAME(SemanticVersion,
"Version");
35 template <
typename T,
typename =
void>
37 static std::string
get() {
38 using ::fcitx::configTypeNameHelper;
39 return configTypeNameHelper(static_cast<T *>(
nullptr));
50 static std::string
get() {
return "Enum"; }
60 #endif // _FCITX_CONFIG_TYPENAME_H_
Color class for handling color.
Simple color class that represent a 64bit color.
Class to represent a key.