|
ginnOS
The reference: libc, the libraries and the kernel
|
icons from the icon packs (the format is in tools/icons/build.py). More...
#include "icon.h"#include <fcntl.h>#include <image.h>#include <stdlib.h>#include <string.h>#include <unistd.h>Macros | |
| #define | HEADER_SIZE 16 |
| #define | ENTRY_SIZE 48 |
| #define | COUNT_MAX 65536 |
| #define | SIDE_MAX 1024 |
Functions | |
| icon_set_t * | icon_set_open (const char *path) |
| open a pack file. | |
| icon_set_t * | icon_set_named (const char *name) |
| open a set by its name: ICON_DIR "<name>.pack". | |
| void | icon_set_close (icon_set_t *set) |
| bool | icon_set_is_mask (const icon_set_t *set) |
| true if the set is of masks (lucide), false if of colour images (tela). | |
| bool | icon_set_has (const icon_set_t *set, const char *name) |
| true if the set has an icon of exactly this name. | |
| icon_t * | icon_load (icon_set_t *set, const char *name, int32_t size, int32_t scale) |
| load an icon. | |
| void | icon_free (icon_t *icon) |
| void | icon_draw_mask (gfx_buffer_t *buf, const icon_t *icon, int32_t x, int32_t y, gfx_color_t color) |
| draw an icon in a colour: a mask's coverage, or a colour image's alpha. | |
| void | icon_draw (gfx_buffer_t *buf, const icon_t *icon, int32_t x, int32_t y, uint8_t opacity) |
| draw an icon as it is, with an opacity (255: opaque). | |
icons from the icon packs (the format is in tools/icons/build.py).
the index of a pack is read when it is opened; an image is read from the file and decompressed (zlib, through the image library) when it is loaded.
| #define HEADER_SIZE 16 |
| #define ENTRY_SIZE 48 |
| #define COUNT_MAX 65536 |
| #define SIDE_MAX 1024 |
| icon_set_t * icon_set_open | ( | const char * | path | ) |
open a pack file.
| icon_set_t * icon_set_named | ( | const char * | name | ) |
open a set by its name: ICON_DIR "<name>.pack".
| void icon_set_close | ( | icon_set_t * | set | ) |
| bool icon_set_is_mask | ( | const icon_set_t * | set | ) |
true if the set is of masks (lucide), false if of colour images (tela).
| bool icon_set_has | ( | const icon_set_t * | set, |
| const char * | name ) |
true if the set has an icon of exactly this name.
| icon_t * icon_load | ( | icon_set_t * | set, |
| const char * | name, | ||
| int32_t | size, | ||
| int32_t | scale ) |
load an icon.
a name the set does not have falls back as in the freedesktop icon naming spec: the last part after a dash is removed until a name is found (text-x-csrc, text-x, text), then "unknown".
| size | the icon size in points (16, 20, 24, 32, 48, 64, or any). |
| scale | 1 to 4 (2 for a 2x screen); the icon is size * scale pixels, at most 1024. |
| void icon_free | ( | icon_t * | icon | ) |
| void icon_draw_mask | ( | gfx_buffer_t * | buf, |
| const icon_t * | icon, | ||
| int32_t | x, | ||
| int32_t | y, | ||
| gfx_color_t | color ) |
draw an icon in a colour: a mask's coverage, or a colour image's alpha.
| void icon_draw | ( | gfx_buffer_t * | buf, |
| const icon_t * | icon, | ||
| int32_t | x, | ||
| int32_t | y, | ||
| uint8_t | opacity ) |
draw an icon as it is, with an opacity (255: opaque).
a mask is drawn in black.