icontheme.lookup

Lookup of icon themes and icons.

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

Members

Aliases

defaultFallbackIconTheme
deprecated alias defaultFallbackIconTheme = defaultGenericIconTheme
findFallbackIcon
deprecated alias findFallbackIcon = findNonThemedIcon
Undocumented in source.
lookupFallbackIcon
deprecated alias lookupFallbackIcon = lookupNonThemedIcon
Undocumented in source.
lookupFallbackIcons
deprecated alias lookupFallbackIcons = lookupNonThemedIcons
Undocumented in source.

Functions

dirEntriesNothrow
InputRange!DirEntry dirEntriesNothrow(string path, SpanMode mode)
Undocumented in source. Be warned that the author may not have intended to support it.
findClosestIcon
string findClosestIcon(string iconName, uint desiredSize, IconThemes iconThemes, BaseDirs searchIconDirs, Exts extensions, Flag!"allowNonThemed" allowNonThemed)

Find icon of the closest size. It uses icon theme cache wherever possible. The first perfect match is used. This is similar to findClosestThemedIcon, but returns file path only and allows to search for non-themed icons.

findClosestIcon
deprecated string findClosestIcon(string iconName, uint desiredSize, IconThemes iconThemes, BaseDirs searchIconDirs, Exts extensions, Flag!"allowFallbackIcon" allowFallback)
Undocumented in source. Be warned that the author may not have intended to support it.
findClosestIcon
string findClosestIcon(string iconName, uint size, IconThemes iconThemes, BaseDirs searchIconDirs)

ditto, but with predefined extensions and non-themed icons allowed.

findClosestThemedIcon
auto findClosestThemedIcon(string iconName, uint desiredSize, IconThemes iconThemes, BaseDirs searchIconDirs, Exts extensions)

Find icon of the closest size. It uses icon theme cache wherever possible. The first perfect match is used. It searches only for icons in themes.

findClosestThemedIcon
auto findClosestThemedIcon(string iconName, uint size, IconThemes iconThemes, BaseDirs searchIconDirs)

ditto, but with predefined extensions.

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!"allowNonThemed" allowNonThemed)

Find icon of the largest size. It uses icon theme cache wherever possible. This is similar to findLargestThemedIcon, but returns file path only and allows to search for non-themed icons.

findLargestIcon
deprecated string findLargestIcon(string iconName, IconThemes iconThemes, BaseDirs searchIconDirs, Exts extensions, Flag!"allowFallbackIcon" allowFallback)
Undocumented in source. Be warned that the author may not have intended to support it.
findLargestIcon
string findLargestIcon(string iconName, IconThemes iconThemes, BaseDirs searchIconDirs)

ditto, but with predefined extensions and non-themed icons allowed.

findLargestThemedIcon
auto findLargestThemedIcon(string iconName, IconThemes iconThemes, BaseDirs searchIconDirs, Exts extensions)

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

findLargestThemedIcon
auto findLargestThemedIcon(string iconName, IconThemes iconThemes, BaseDirs searchIconDirs)

ditto, but with predefined extensions.

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

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

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.
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.

lookupNonThemedIcon
auto lookupNonThemedIcon(string iconName, BaseDirs searchIconDirs, Exts extensions)

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

lookupNonThemedIcons
auto lookupNonThemedIcons(BaseDirs searchIconDirs, Exts extensions)

Iterate over all icons out of icon themes.

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 genericThemeName, 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.

openThemeFamily
IconThemeFile[] openThemeFamily(IconThemeFile iconTheme, Range searchIconDirs, string genericThemeName, IconThemeFile.IconThemeReadOptions options)

Recursively find all themes the given theme is inherited from.

openThemeFamily
IconThemeFile[] openThemeFamily(string iconThemeName, Range searchIconDirs, string genericThemeName, IconThemeFile.IconThemeReadOptions options)

ditto, but firstly loads the given icon theme by name. Returns an empty array if theme specified by iconThemeName could not be loaded.

Manifest constants

defaultGenericIconTheme
enum defaultGenericIconTheme;

Convenient constant for the default icon theme name.

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