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