icontheme.lookup

Lookup of icon themes and icons.

Note: All found icons are just paths. They are not verified to be valid images.

Members

Functions

findClosestIcon
string findClosestIcon(string iconName, uint size, IconThemes iconThemes, BaseDirs searchIconDirs, Exts extensions, Flag!"allowFallbackIcon" allowFallback)

Find icon closest of the size. It uses icon theme cache wherever possible. The first perfect match is used.

findClosestIcon
string findClosestIcon(string iconName, uint size, IconThemes iconThemes, BaseDirs searchIconDirs)

ditto, but with predefined extensions and fallback allowed.

findFallbackIcon
string findFallbackIcon(string iconName, BaseDirs searchIconDirs, Exts extensions)

Find fallback icon outside of icon themes. The first found is returned.

findIconTheme
auto findIconTheme(string themeName, Range searchIconDirs)

Find index.theme file by theme name.

findLargestIcon
string findLargestIcon(string iconName, IconThemes iconThemes, BaseDirs searchIconDirs, Exts extensions, Flag!"allowFallbackIcon" allowFallback)

Find icon of the largest size. It uses icon theme cache wherever possible.

findLargestIcon
string findLargestIcon(string iconName, IconThemes iconThemes, BaseDirs searchIconDirs)

ditto, but with predefined extensions and fallback allowed.

iconSizeDistance
uint iconSizeDistance(IconSubDir subdir, uint matchSize)

Distance between desired size and minimum or maximum size value supported by icon theme subdirectory.

iconThemePaths
auto iconThemePaths(Range searchIconDirs)

Find all icon themes in searchIconDirs. Note: You may want to skip icon themes duplicates if there're different versions of the index.theme file for the same theme.

isDirNothrow
bool isDirNothrow(string dir)
Undocumented in source. Be warned that the author may not have intended to support it.
isFileNothrow
bool isFileNothrow(string file)
Undocumented in source. Be warned that the author may not have intended to support it.
lookupFallbackIcon
auto lookupFallbackIcon(string iconName, BaseDirs searchIconDirs, Exts extensions)

Lookup icon alternatives beyond the icon themes. May be used as fallback lookup, if lookupIcon returned empty range.

lookupFallbackIcons
auto lookupFallbackIcons(BaseDirs searchIconDirs, Exts extensions)

Iterate over all icons out of icon themes.

lookupIcon
void lookupIcon(string iconName, IconThemes iconThemes, BaseDirs searchIconDirs, Exts extensions, OutputRange sink, Flag!"reverse" reverse)

Lookup icon alternatives in icon themes. It uses icon theme cache wherever it's loaded. If searched icon is found in some icon theme all subsequent themes are ignored.

lookupIconTheme
auto lookupIconTheme(string themeName, Range searchIconDirs)

Lookup index.theme files by theme name.

lookupThemeIcons
auto lookupThemeIcons(IconThemes iconThemes, BaseDirs searchIconDirs, Exts extensions)

Iterate over all icons in icon themes. iconThemes is usually the range of the main theme and themes it inherits from. Note: Usually if some icon was found in icon theme, it should be ignored in all subsequent themes, including sizes not presented in former theme. Use subdirFilter to filter icons by icontheme.file.IconSubDir thus decreasing the number of searchable items and allocations.

matchBestIcon
string matchBestIcon(Range alternatives, uint matchSize)

Find icon closest to the given size among given alternatives.

matchIconSize
bool matchIconSize(IconSubDir subdir, uint matchSize)

Check if matchSize belongs to subdir's size range.

openBaseThemes
IconThemeFile[] openBaseThemes(IconThemeFile iconTheme, Range searchIconDirs, string fallbackThemeName, IconThemeFile.IconThemeReadOptions options)

Recursively find all themes the given theme is inherited from.

openIconTheme
IconThemeFile openIconTheme(string themeName, Range searchIconDirs, IconThemeFile.IconThemeReadOptions options)

Find index.theme file for given theme and create instance of icontheme.file.IconThemeFile. The first found file will be used.

Manifest constants

defaultIconExtensions
enum defaultIconExtensions;

Default icon extensions. This array includes .png and .xpm. PNG is recommended format. XPM is kept for backward compatibility.

Structs

IconSearchResult
struct IconSearchResult(IconTheme)

Result of icon lookup.

See Also

Meta