rofi
1.7.0
|
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) |
uint32_t | rofi_icon_fetcher_query_advanced (const char *name, const int wsize, const int hsize) |
cairo_surface_t * | rofi_icon_fetcher_get (const uint32_t uid) |
gboolean | rofi_icon_fetcher_file_is_image (const char *const path) |
Small helper of to fetch icons. This makes use of the 'view' threadpool.
void rofi_icon_fetcher_destroy | ( | void | ) |
Destroy and free the memory used by the icon fetcher.
Definition at line 147 of file rofi-icon-fetcher.c.
References free_wrapper(), IconFetcher::icon_cache, IconFetcher::icon_cache_uid, rofi_icon_fetcher_data, IconFetcher::supported_extensions, and IconFetcher::xdg_context.
Referenced by cleanup().
gboolean rofi_icon_fetcher_file_is_image | ( | const char *const | path | ) |
path | the image path to check. |
Checks if a file is a supported image. (by looking at extension).
Definition at line 263 of file rofi-icon-fetcher.c.
References rofi_icon_fetcher_data, and IconFetcher::supported_extensions.
Referenced by _get_icon().
cairo_surface_t* rofi_icon_fetcher_get | ( | const uint32_t | uid | ) |
uid | The unique id representing the matching request. |
If the surface is used, the user should reference the surface.
Definition at line 415 of file rofi-icon-fetcher.c.
References IconFetcher::icon_cache_uid, rofi_icon_fetcher_data, and IconFetcherEntry::surface.
Referenced by _get_icon(), dmenu_get_icon(), fallback_icon(), icon_draw(), rofi_theme_get_image_inside(), and script_get_icon().
void rofi_icon_fetcher_init | ( | void | ) |
Initialize the icon fetcher.
Definition at line 109 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, IconFetcher::supported_extensions, and IconFetcher::xdg_context.
Referenced by main().
uint32_t rofi_icon_fetcher_query | ( | const char * | name, |
const int | size | ||
) |
name | The name of the icon to fetch. |
size | The 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://.
Definition at line 378 of file rofi-icon-fetcher.c.
References _thread_state::callback, IconFetcherEntry::entry, IconFetcherEntry::hsize, IconFetcher::icon_cache, IconFetcher::icon_cache_uid, IconFetcher::last_uid, IconFetcherNameEntry::name, rofi_icon_fetcher_data, rofi_icon_fetcher_worker(), IconFetcherNameEntry::sizes, IconFetcherEntry::state, IconFetcherEntry::surface, tpool, IconFetcherEntry::uid, and IconFetcherEntry::wsize.
Referenced by _get_icon(), dmenu_get_icon(), fallback_icon(), icon_create(), and script_get_icon().
uint32_t rofi_icon_fetcher_query_advanced | ( | const char * | name, |
const int | wsize, | ||
const int | hsize | ||
) |
name | The name of the icon to fetch. |
wsize | The width of the icon to fetch. |
hsize | The height 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. For icons it will take the min of wsize and hsize.
name can also be a full path, if prefixed with file://.
Definition at line 341 of file rofi-icon-fetcher.c.
References _thread_state::callback, IconFetcherEntry::entry, IconFetcherEntry::hsize, IconFetcher::icon_cache, IconFetcher::icon_cache_uid, IconFetcher::last_uid, IconFetcherNameEntry::name, rofi_icon_fetcher_data, rofi_icon_fetcher_worker(), IconFetcherNameEntry::sizes, IconFetcherEntry::state, IconFetcherEntry::surface, tpool, IconFetcherEntry::uid, and IconFetcherEntry::wsize.
Referenced by rofi_theme_get_image_inside().