rofi 1.7.7
|
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_get_ex (const uint32_t uid, cairo_surface_t **surface) |
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 325 of file rofi-icon-fetcher.c.
References free_wrapper(), and rofi_icon_fetcher_data.
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 443 of file rofi-icon-fetcher.c.
References rofi_icon_fetcher_data.
Referenced by _get_icon(), and _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 834 of file rofi-icon-fetcher.c.
References rofi_icon_fetcher_data, and IconFetcherEntry::surface.
Referenced by _get_icon(), _get_icon(), _get_icon(), dmenu_get_icon(), icon_draw(), mode_get_icon(), rofi_theme_get_image_inside(), and script_get_icon().
gboolean rofi_icon_fetcher_get_ex | ( | const uint32_t | uid, |
cairo_surface_t ** | surface ) |
uid | The unique id representing the matching request. |
surface | [out] The surface found. |
If the surface is used, the user should reference the surface.
Definition at line 844 of file rofi-icon-fetcher.c.
References IconFetcherEntry::query_done, rofi_icon_fetcher_data, and IconFetcherEntry::surface.
void rofi_icon_fetcher_init | ( | void | ) |
Initialize the icon fetcher.
Definition at line 273 of file rofi-icon-fetcher.c.
References config, rofi_icon_fetch_entry_free(), rofi_icon_fetcher_data, and rofi_icon_fetcher_load_thumbnailers().
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 790 of file rofi-icon-fetcher.c.
References _thread_state::callback, IconFetcherEntry::entry, _thread_state::free, IconFetcherEntry::hsize, IconFetcherNameEntry::name, _thread_state::priority, IconFetcherEntry::query_done, IconFetcherEntry::query_started, rofi_icon_fetch_thread_pool_entry_remove(), rofi_icon_fetcher_data, rofi_icon_fetcher_worker(), IconFetcherNameEntry::sizes, IconFetcherEntry::state, IconFetcherEntry::surface, tpool, IconFetcherEntry::uid, and IconFetcherEntry::wsize.
Referenced by _get_icon(), _get_icon(), _get_icon(), dmenu_get_icon(), icon_create(), mode_get_icon(), 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 746 of file rofi-icon-fetcher.c.
References _thread_state::callback, IconFetcherEntry::entry, _thread_state::free, IconFetcherEntry::hsize, IconFetcherNameEntry::name, _thread_state::priority, IconFetcherEntry::query_done, IconFetcherEntry::query_started, rofi_icon_fetch_thread_pool_entry_remove(), 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().