rofi  1.5.4
IconFetcher
Collaboration diagram for IconFetcher:

Functions

void rofi_icon_fetcher_init (void)
 
void rofi_icon_fetcher_destroy (void)
 
uint32_t rofi_icon_fetcher_query (const char *name, const int size)
 
cairo_surface_t * rofi_icon_fetcher_get (const uint32_t uid)
 

Detailed Description

Small helper of to fetch icons. This makes use of the 'view' threadpool.

Function Documentation

◆ rofi_icon_fetcher_destroy()

void rofi_icon_fetcher_destroy ( void  )

Destroy and free the memory used by the icon fetcher.

Definition at line 119 of file rofi-icon-fetcher.c.

References IconFetcher::icon_cache, IconFetcher::icon_cache_uid, rofi_icon_fetcher_data, and IconFetcher::xdg_context.

Referenced by cleanup().

Here is the caller graph for this function:

◆ rofi_icon_fetcher_get()

cairo_surface_t* rofi_icon_fetcher_get ( const uint32_t  uid)
Parameters
uidThe unique id representing the matching request.

If the surface is used, the user should reference the surface.

Returns
the surface with the icon, NULL when not found.

Definition at line 216 of file rofi-icon-fetcher.c.

References IconFetcher::icon_cache_uid, rofi_icon_fetcher_data, and IconFetcherEntry::surface.

Referenced by dmenu_get_icon(), icon_draw(), and script_get_icon().

Here is the caller graph for this function:

◆ rofi_icon_fetcher_init()

void rofi_icon_fetcher_init ( void  )

Initialize the icon fetcher.

Definition at line 99 of file rofi-icon-fetcher.c.

References config, IconFetcher::icon_cache, IconFetcher::icon_cache_uid, Settings::icon_theme, rofi_icon_fetch_entry_free(), rofi_icon_fetcher_data, and IconFetcher::xdg_context.

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rofi_icon_fetcher_query()

uint32_t rofi_icon_fetcher_query ( const char *  name,
const int  size 
)
Parameters
nameThe name of the icon to fetch.
sizeThe size of the icon to fetch.

Query the icon-theme for icon with name and size. The returned icon will be the best match for the requested size, it should still be resized to the actual size.

name can also be a full path, if prefixed with file://.

Returns
the uid identifying the request.

Definition at line 182 of file rofi-icon-fetcher.c.

References _thread_state::callback, IconFetcherEntry::entry, IconFetcher::icon_cache, IconFetcher::icon_cache_uid, IconFetcher::last_uid, IconFetcherNameEntry::name, rofi_icon_fetcher_data, rofi_icon_fetcher_worker(), IconFetcherEntry::size, IconFetcherNameEntry::sizes, IconFetcherEntry::state, IconFetcherEntry::surface, tpool, and IconFetcherEntry::uid.

Referenced by dmenu_get_icon(), icon_create(), and script_get_icon().

Here is the call graph for this function:
Here is the caller graph for this function: