aboutsummaryrefslogtreecommitdiffstats
path: root/include/swaybar/tray/icon.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/swaybar/tray/icon.h')
-rw-r--r--include/swaybar/tray/icon.h52
1 files changed, 40 insertions, 12 deletions
diff --git a/include/swaybar/tray/icon.h b/include/swaybar/tray/icon.h
index 1cc6ff9c..7a6c400c 100644
--- a/include/swaybar/tray/icon.h
+++ b/include/swaybar/tray/icon.h
@@ -1,16 +1,44 @@
1#ifndef _SWAYBAR_ICON_H 1#ifndef _SWAYBAR_TRAY_ICON_H
2#define _SWAYBAR_ICON_H 2#define _SWAYBAR_TRAY_ICON_H
3 3
4#include <stdint.h> 4#include "list.h"
5#include <stdbool.h>
6#include <client/cairo.h>
7 5
8/** 6enum subdir_type {
9 * Returns the image found by `name` that is closest to `size` 7 THRESHOLD,
10 */ 8 SCALABLE,
11cairo_surface_t *find_icon(const char *name, int size); 9 FIXED
10};
11
12struct icon_theme_subdir {
13 char *name;
14 int size;
15 enum subdir_type type;
16 int max_size;
17 int min_size;
18 int threshold;
19};
20
21struct icon_theme {
22 char *name;
23 char *comment;
24 char *inherits;
25 list_t *directories; // char *
12 26
13/* Struct used internally only */ 27 char *dir;
14struct subdir; 28 list_t *subdirs; // struct icon_theme_subdir *
29};
30
31void init_themes(list_t **themes, list_t **basedirs);
32void finish_themes(list_t *themes, list_t *basedirs);
33
34/*
35 * Finds an icon of a specified size given a list of themes and base directories.
36 * If the icon is found, the pointers min_size & max_size are set to minimum &
37 * maximum size that the icon can be scaled to, respectively.
38 * Returns: path of icon (which should be freed), or NULL if the icon is not found.
39 */
40char *find_icon(list_t *themes, list_t *basedirs, char *name, int size,
41 char *theme, int *min_size, int *max_size);
42char *find_icon_in_dir(char *name, char *dir, int *min_size, int *max_size);
15 43
16#endif /* _SWAYBAR_ICON_H */ 44#endif