7 #ifndef _FCITX_UTILS_ICONTHEME_H_ 8 #define _FCITX_UTILS_ICONTHEME_H_ 14 #include <fcitx-config/enum.h> 15 #include <fcitx-config/rawconfig.h> 16 #include <fcitx-utils/i18nstring.h> 17 #include <fcitx-utils/macros.h> 18 #include <fcitx-utils/misc.h> 20 #include <fcitx/fcitxcore_export.h> 29 class IconThemeDirectoryPrivate;
30 class IconThemePrivate;
33 FCITX_CONFIG_ENUM(IconThemeDirectoryType, Fixed, Scalable, Threshold);
40 FCITX_DECLARE_READ_ONLY_PROPERTY(std::string, path);
41 FCITX_DECLARE_READ_ONLY_PROPERTY(
int, size);
42 FCITX_DECLARE_READ_ONLY_PROPERTY(
int, scale);
43 FCITX_DECLARE_READ_ONLY_PROPERTY(std::string, context);
44 FCITX_DECLARE_READ_ONLY_PROPERTY(IconThemeDirectoryType, type);
45 FCITX_DECLARE_READ_ONLY_PROPERTY(
int, maxSize);
46 FCITX_DECLARE_READ_ONLY_PROPERTY(
int, minSize);
47 FCITX_DECLARE_READ_ONLY_PROPERTY(
int, threshold);
49 bool matchesSize(
int iconsize,
int iconscale)
const;
50 int sizeDistance(
int iconsize,
int iconscale)
const;
53 std::unique_ptr<IconThemeDirectoryPrivate> d_ptr;
63 :
IconTheme(std::string(name), standardPath) {}
70 FCITX_DECLARE_VIRTUAL_DTOR_MOVE(
IconTheme);
73 FCITXCORE_DEPRECATED std::string findIcon(
74 const std::string &iconName,
unsigned int desiredSize,
int scale = 1,
75 const std::vector<std::string> &extensions = {
".svg",
".png",
".xpm"});
76 FCITXCORE_DEPRECATED std::string
77 findIcon(
const std::string &iconName,
unsigned int desiredSize,
79 const std::vector<std::string> &extensions = {
".svg",
".png",
83 findIconPath(
const std::string &iconName,
unsigned int desiredSize,
85 const std::vector<std::string> &extensions = {
".svg",
".png",
87 static std::string defaultIconThemeName();
89 FCITX_DECLARE_READ_ONLY_PROPERTY(std::string, internalName);
90 FCITX_DECLARE_READ_ONLY_PROPERTY(
I18NString, name);
91 FCITX_DECLARE_READ_ONLY_PROPERTY(
I18NString, comment);
92 FCITX_DECLARE_READ_ONLY_PROPERTY(std::vector<IconTheme>, inherits);
93 FCITX_DECLARE_READ_ONLY_PROPERTY(std::vector<IconThemeDirectory>,
95 FCITX_DECLARE_READ_ONLY_PROPERTY(std::vector<IconThemeDirectory>,
97 FCITX_DECLARE_READ_ONLY_PROPERTY(std::string, example);
100 static std::string iconName(
const std::string &icon,
101 bool inFlatpak = isInFlatpak());
109 std::unique_ptr<IconThemePrivate> d_ptr;
114 #endif // _FCITX_UTILS_ICONTHEME_H_ static const StandardPaths & global()
Return the global instance of StandardPath.
New Utility classes to handle application specific path.
A implementation of freedesktop.org icont specification.
Utility class to open, locate, list files based on XDG standard.