Notification images loading.
More...
#include <cairo.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "notification.h"
Go to the source code of this file.
|
| cairo_surface_t * | gdk_pixbuf_to_cairo_surface (GdkPixbuf *pixbuf) |
| |
| GdkPixbuf * | get_pixbuf_from_file (const char *filename, char **id, int min_size, int max_size, double scale) |
| | Retrieve an icon by its full filepath, scaled according to settings.
|
| |
| int | get_icon_width (cairo_surface_t *icon, double scale) |
| | Get the unscaled icon width.
|
| |
| int | get_icon_height (cairo_surface_t *icon, double scale) |
| | Get the unscaled icon height, see get_icon_width.
|
| |
| char * | get_path_from_icon_name (const char *iconname, int size) |
| | Retrieve a path from an icon name.
|
| |
| GdkPixbuf * | icon_get_for_data (GVariant *data, char **id, double dpi_scale, int min_size, int max_size) |
| | Convert a GVariant like described in GdkPixbuf, scaled according to settings.
|
| |
Notification images loading.
- Copyright
- Copyright 2018-2026 Dunst contributors
- License
- BSD-3-Clause
Definition in file icon.h.
◆ gdk_pixbuf_to_cairo_surface()
| cairo_surface_t * gdk_pixbuf_to_cairo_surface |
( |
GdkPixbuf * | pixbuf | ) |
|
◆ get_icon_height()
| int get_icon_height |
( |
cairo_surface_t * | icon, |
|
|
double | scale ) |
Get the unscaled icon height, see get_icon_width.
Definition at line 95 of file icon.c.
◆ get_icon_width()
| int get_icon_width |
( |
cairo_surface_t * | icon, |
|
|
double | scale ) |
Get the unscaled icon width.
If scale is 2 for example, the icon will render in twice the size, but get_icon_width still returns the same size as when scale is 1.
Definition at line 91 of file icon.c.
◆ get_path_from_icon_name()
| char * get_path_from_icon_name |
( |
const char * | iconname, |
|
|
int | size ) |
Retrieve a path from an icon name.
- Parameters
-
| iconname | A string describing a file:// URL, an arbitary filename or an icon name, which then gets searched for in the settings.icon_path |
| size | Size of the icon to look for. This is only used when recursive icon lookup is enabled. |
- Returns
- a newly allocated string with the icon path
- Return values
-
| NULL | file does not exist, not readable, etc.. |
Definition at line 249 of file icon.c.
◆ get_pixbuf_from_file()
| GdkPixbuf * get_pixbuf_from_file |
( |
const char * | filename, |
|
|
char ** | id, |
|
|
int | min_size, |
|
|
int | max_size, |
|
|
double | scale ) |
Retrieve an icon by its full filepath, scaled according to settings.
- Parameters
-
| filename | A string representing a readable file path |
| id | (necessary) A unique identifier of the returned pixbuf. Only filled, if the return value is non-NULL. |
| min_size | An iteger representing the desired minimum unscaled icon size. |
| max_size | An iteger representing the desired maximum unscaled icon size. |
| scale | An integer representing the output dpi scaling. |
- Returns
- an instance of
GdkPixbuf
- Return values
-
| NULL | file does not exist, not readable, etc.. |
Definition at line 213 of file icon.c.
◆ icon_get_for_data()
| GdkPixbuf * icon_get_for_data |
( |
GVariant * | data, |
|
|
char ** | id, |
|
|
double | dpi_scale, |
|
|
int | min_size, |
|
|
int | max_size ) |
Convert a GVariant like described in GdkPixbuf, scaled according to settings.
The returned id will be a unique identifier. To check if two given GdkPixbufs are equal, it's sufficient to just compare the id strings.
- Parameters
-
| data | A GVariant in the format "(iiibii@ay)" filled with values like described in the notification spec. |
| id | (necessary) A unique identifier of the returned pixbuf. Only filled, if the return value is non-NULL. |
| dpi_scale | An integer representing the output dpi scaling. |
| min_size | An integer representing the desired minimum unscaled icon size. |
| max_size | An integer representing the desired maximum unscaled icon size. |
- Returns
- an instance of
GdkPixbuf derived from the GVariant
- Return values
-
| NULL | GVariant parameter nulled, invalid or in wrong format |
Definition at line 313 of file icon.c.