2018-06-09 17:13:57 +00:00
|
|
|
#ifndef ROFI_ICON_FETCHER_H
|
|
|
|
#define ROFI_ICON_FETCHER_H
|
|
|
|
|
|
|
|
#include <glib.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <cairo.h>
|
|
|
|
|
2018-06-12 09:10:46 +00:00
|
|
|
/**
|
|
|
|
* @defgroup ICONFETCHER IconFetcher
|
|
|
|
* @ingroup HELPERS
|
|
|
|
*
|
|
|
|
* Small helper of to fetch icons. This makes use of the 'view' threadpool.
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Initialize the icon fetcher.
|
|
|
|
*/
|
2018-06-09 17:13:57 +00:00
|
|
|
void rofi_icon_fetcher_init ( void );
|
|
|
|
|
2018-06-12 09:10:46 +00:00
|
|
|
/**
|
|
|
|
* Destroy and free the memory used by the icon fetcher.
|
|
|
|
*/
|
2018-06-09 17:13:57 +00:00
|
|
|
void rofi_icon_fetcher_destroy ( void );
|
|
|
|
|
2018-06-12 09:10:46 +00:00
|
|
|
/**
|
|
|
|
* @param name The name of the icon to fetch.
|
|
|
|
* @param 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://.
|
|
|
|
*
|
|
|
|
* @returns the uid identifying the request.
|
|
|
|
*/
|
2018-06-09 17:13:57 +00:00
|
|
|
uint32_t rofi_icon_fetcher_query ( const char *name, const int size );
|
|
|
|
|
2018-06-12 09:10:46 +00:00
|
|
|
/**
|
|
|
|
* @param uid The 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.
|
|
|
|
*/
|
2018-06-09 17:13:57 +00:00
|
|
|
cairo_surface_t * rofi_icon_fetcher_get ( const uint32_t uid );
|
|
|
|
|
2018-06-12 09:10:46 +00:00
|
|
|
/* @} */
|
2018-06-09 17:13:57 +00:00
|
|
|
#endif // ROFI_ICON_FETCHER_H
|