aboutsummaryrefslogtreecommitdiff
path: root/st.h
diff options
context:
space:
mode:
authorFederico Igne <git@federicoigne.com>2020-05-23 12:01:50 +0100
committerFederico Igne <git@federicoigne.com>2020-05-23 12:01:50 +0100
commit30faefe674c5048b7ffd31c98b1a2193c43c9fe2 (patch)
tree64aad31e5682624aef1c7538b2a9c63079fd5a3a /st.h
parent81df9b428bd0330af98db9c69ffe69b0441e00fd (diff)
downloadst-30faefe674c5048b7ffd31c98b1a2193c43c9fe2.tar.gz
st-30faefe674c5048b7ffd31c98b1a2193c43c9fe2.zip
Apply Ligatures patch
Homepage link: https://st.suckless.org/patches/ligatures/ Patch links: https://st.suckless.org/patches/ligatures/0.8.3/st-ligatures-boxdraw-20200430-0.8.3.diff https://st.suckless.org/patches/ligatures/0.8.3/st-ligatures-scrollback-20200430-0.8.3.diff Additional info: the patch was applied by mixing the two patches linked above in order to provide compatibility with both BoxDraw and Scrollback patches.
Diffstat (limited to 'st.h')
-rw-r--r--st.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/st.h b/st.h
index e9b3abe..70ebea0 100644
--- a/st.h
+++ b/st.h
@@ -4,17 +4,18 @@
4#include <sys/types.h> 4#include <sys/types.h>
5 5
6/* macros */ 6/* macros */
7#define MIN(a, b) ((a) < (b) ? (a) : (b)) 7#define MIN(a, b) ((a) < (b) ? (a) : (b))
8#define MAX(a, b) ((a) < (b) ? (b) : (a)) 8#define MAX(a, b) ((a) < (b) ? (b) : (a))
9#define LEN(a) (sizeof(a) / sizeof(a)[0]) 9#define LEN(a) (sizeof(a) / sizeof(a)[0])
10#define BETWEEN(x, a, b) ((a) <= (x) && (x) <= (b)) 10#define BETWEEN(x, a, b) ((a) <= (x) && (x) <= (b))
11#define DIVCEIL(n, d) (((n) + ((d) - 1)) / (d)) 11#define DIVCEIL(n, d) (((n) + ((d) - 1)) / (d))
12#define DEFAULT(a, b) (a) = (a) ? (a) : (b) 12#define DEFAULT(a, b) (a) = (a) ? (a) : (b)
13#define LIMIT(x, a, b) (x) = (x) < (a) ? (a) : (x) > (b) ? (b) : (x) 13#define LIMIT(x, a, b) (x) = (x) < (a) ? (a) : (x) > (b) ? (b) : (x)
14#define ATTRCMP(a, b) ((a).mode != (b).mode || (a).fg != (b).fg || \ 14#define ATTRCMP(a, b) (((a).mode & (~ATTR_WRAP) & (~ATTR_LIGA)) != ((b).mode & (~ATTR_WRAP) & (~ATTR_LIGA)) || \
15 (a).bg != (b).bg) 15 (a).fg != (b).fg || \
16 (a).bg != (b).bg)
16#define TIMEDIFF(t1, t2) ((t1.tv_sec-t2.tv_sec)*1000 + \ 17#define TIMEDIFF(t1, t2) ((t1.tv_sec-t2.tv_sec)*1000 + \
17 (t1.tv_nsec-t2.tv_nsec)/1E6) 18 (t1.tv_nsec-t2.tv_nsec)/1E6)
18#define MODBIT(x, set, bit) ((set) ? ((x) |= (bit)) : ((x) &= ~(bit))) 19#define MODBIT(x, set, bit) ((set) ? ((x) |= (bit)) : ((x) &= ~(bit)))
19 20
20#define TRUECOLOR(r,g,b) (1 << 24 | (r) << 16 | (g) << 8 | (b)) 21#define TRUECOLOR(r,g,b) (1 << 24 | (r) << 16 | (g) << 8 | (b))
@@ -34,6 +35,7 @@ enum glyph_attribute {
34 ATTR_WIDE = 1 << 9, 35 ATTR_WIDE = 1 << 9,
35 ATTR_WDUMMY = 1 << 10, 36 ATTR_WDUMMY = 1 << 10,
36 ATTR_BOXDRAW = 1 << 11, 37 ATTR_BOXDRAW = 1 << 11,
38 ATTR_LIGA = 1 << 12,
37 ATTR_BOLD_FAINT = ATTR_BOLD | ATTR_FAINT, 39 ATTR_BOLD_FAINT = ATTR_BOLD | ATTR_FAINT,
38}; 40};
39 41