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.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/include/swaybar/tray/icon.h b/include/swaybar/tray/icon.h
new file mode 100644
index 00000000..7a6c400c
--- /dev/null
+++ b/include/swaybar/tray/icon.h
@@ -0,0 +1,44 @@
1#ifndef _SWAYBAR_TRAY_ICON_H
2#define _SWAYBAR_TRAY_ICON_H
3
4#include "list.h"
5
6enum subdir_type {
7 THRESHOLD,
8 SCALABLE,
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 *
26
27 char *dir;
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);
43
44#endif