summaryrefslogtreecommitdiffstats
path: root/src/basic/glyph-util.h
blob: db8dbbff262933f18a27d61dbfdbc3f41d9cd2b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once

#include <errno.h>
#include <stdbool.h>

#include "macro.h"

typedef enum SpecialGlyph {
        SPECIAL_GLYPH_TREE_VERTICAL,
        SPECIAL_GLYPH_TREE_BRANCH,
        SPECIAL_GLYPH_TREE_RIGHT,
        SPECIAL_GLYPH_TREE_SPACE,
        SPECIAL_GLYPH_TREE_TOP,
        SPECIAL_GLYPH_VERTICAL_DOTTED,
        SPECIAL_GLYPH_HORIZONTAL_DOTTED,
        SPECIAL_GLYPH_HORIZONTAL_FAT,
        SPECIAL_GLYPH_TRIANGULAR_BULLET,
        SPECIAL_GLYPH_BLACK_CIRCLE,
        SPECIAL_GLYPH_WHITE_CIRCLE,
        SPECIAL_GLYPH_MULTIPLICATION_SIGN,
        SPECIAL_GLYPH_CIRCLE_ARROW,
        SPECIAL_GLYPH_BULLET,
        SPECIAL_GLYPH_MU,
        SPECIAL_GLYPH_CHECK_MARK,
        SPECIAL_GLYPH_CROSS_MARK,
        SPECIAL_GLYPH_LIGHT_SHADE,
        SPECIAL_GLYPH_DARK_SHADE,
        SPECIAL_GLYPH_FULL_BLOCK,
        SPECIAL_GLYPH_SIGMA,
        SPECIAL_GLYPH_ARROW_UP,
        SPECIAL_GLYPH_ARROW_DOWN,
        SPECIAL_GLYPH_ARROW_LEFT,
        SPECIAL_GLYPH_ARROW_RIGHT,
        SPECIAL_GLYPH_ELLIPSIS,
        SPECIAL_GLYPH_EXTERNAL_LINK,
        _SPECIAL_GLYPH_FIRST_EMOJI,
        SPECIAL_GLYPH_ECSTATIC_SMILEY = _SPECIAL_GLYPH_FIRST_EMOJI,
        SPECIAL_GLYPH_HAPPY_SMILEY,
        SPECIAL_GLYPH_SLIGHTLY_HAPPY_SMILEY,
        SPECIAL_GLYPH_NEUTRAL_SMILEY,
        SPECIAL_GLYPH_SLIGHTLY_UNHAPPY_SMILEY,
        SPECIAL_GLYPH_UNHAPPY_SMILEY,
        SPECIAL_GLYPH_DEPRESSED_SMILEY,
        SPECIAL_GLYPH_LOCK_AND_KEY,
        SPECIAL_GLYPH_TOUCH,
        SPECIAL_GLYPH_RECYCLING,
        SPECIAL_GLYPH_DOWNLOAD,
        SPECIAL_GLYPH_SPARKLES,
        SPECIAL_GLYPH_LOW_BATTERY,
        SPECIAL_GLYPH_WARNING_SIGN,
        SPECIAL_GLYPH_COMPUTER_DISK,
        SPECIAL_GLYPH_WORLD,
        SPECIAL_GLYPH_RED_CIRCLE,
        SPECIAL_GLYPH_YELLOW_CIRCLE,
        SPECIAL_GLYPH_BLUE_CIRCLE,
        SPECIAL_GLYPH_GREEN_CIRCLE,
        _SPECIAL_GLYPH_MAX,
        _SPECIAL_GLYPH_INVALID = -EINVAL,
} SpecialGlyph;

bool emoji_enabled(void);

const char *special_glyph_full(SpecialGlyph code, bool force_utf) _const_;

static inline const char *special_glyph(SpecialGlyph code) {
        return special_glyph_full(code, false);
}

static inline const char *special_glyph_check_mark(bool b) {
        return b ? special_glyph(SPECIAL_GLYPH_CHECK_MARK) : special_glyph(SPECIAL_GLYPH_CROSS_MARK);
}

static inline const char *special_glyph_check_mark_space(bool b) {
        return b ? special_glyph(SPECIAL_GLYPH_CHECK_MARK) : " ";
}