Dunst
Lightweight notification daemon
Loading...
Searching...
No Matches
icon-lookup.h File Reference

Recursive icon lookup in theme directories. More...

+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  icon_theme
 
struct  icon_theme_dir
 

Enumerations

enum  theme_dir_type { THEME_DIR_FIXED , THEME_DIR_SCALABLE , THEME_DIR_THRESHOLD }
 

Functions

int load_icon_theme (char *name)
 Load a theme with given name from a standard icon directory.
 
void add_default_theme (int theme_index)
 Add theme to the list of default themes.
 
char * find_icon_in_theme (const char *name, int theme_index, int size)
 Find icon of specified size in selected theme.
 
void set_default_theme (int theme_index)
 
char * find_icon_path (const char *name, int size)
 Find icon of specified size in the default theme or an inherited theme.
 
void free_all_themes (void)
 Free all icon themes.
 

Detailed Description

Recursive icon lookup in theme directories.

License
BSD-3-Clause

Definition in file icon-lookup.h.

Enumeration Type Documentation

◆ theme_dir_type

enum theme_dir_type

Definition at line 25 of file icon-lookup.h.

Function Documentation

◆ add_default_theme()

void add_default_theme ( int theme_index)

Add theme to the list of default themes.

The theme that's added first will be used first for lookup. After that the inherited themes will be used and only after that the next default theme will be used.

Parameters
theme_indexThe index of the theme as returned by load_icon_theme

Definition at line 234 of file icon-lookup.c.

◆ find_icon_in_theme()

char * find_icon_in_theme ( const char * name,
int theme_index,
int size )

Find icon of specified size in selected theme.

This function will not return icons that cannot be scaled to size according to index.theme.

Parameters
nameName of the icon or full path to it.
theme_indexIndex of the theme to use.
sizeSize of the icon.
Returns
The full path to the icon.
Return values
NULLif the icon cannot be found or is not readable.

Definition at line 251 of file icon-lookup.c.

◆ find_icon_path()

char * find_icon_path ( const char * name,
int size )

Find icon of specified size in the default theme or an inherited theme.

This function will not return icons that cannot be scaled to size according to index.theme.

Parameters
nameName of the icon or full path to it.
sizeSize of the icon.
Returns
The full path to the icon.
Return values
NULLif the icon cannot be found or is not readable.

Definition at line 308 of file icon-lookup.c.

◆ free_all_themes()

void free_all_themes ( void )

Free all icon themes.

Definition at line 218 of file icon-lookup.c.

◆ load_icon_theme()

int load_icon_theme ( char * name)

Load a theme with given name from a standard icon directory.

Don't call this function if the theme is already loaded.

Parameters
nameName of the directory in which the theme is located. Note that it is NOT the name of the theme as specified in index.theme.
Returns
The index of the theme, which can be used to set it as default.
Return values
-1if the icon theme cannot be loaded.

Definition at line 184 of file icon-lookup.c.