diff options
Diffstat (limited to 'files/config/suckless/st/st.h')
| -rw-r--r-- | files/config/suckless/st/st.h | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/files/config/suckless/st/st.h b/files/config/suckless/st/st.h index 99b4e2b..a611939 100644 --- a/files/config/suckless/st/st.h +++ b/files/config/suckless/st/st.h @@ -12,7 +12,7 @@ #define DEFAULT(a, b) (a) = (a) ? (a) : (b) #define LIMIT(x, a, b) (x) = (x) < (a) ? (a) : (x) > (b) ? (b) : (x) #define ATTRCMP(a, b) ((a).mode != (b).mode || (a).fg != (b).fg || \ - (a).bg != (b).bg) + (a).bg != (b).bg || (a).decor != (b).decor) #define TIMEDIFF(t1, t2) ((t1.tv_sec-t2.tv_sec)*1000 + \ (t1.tv_nsec-t2.tv_nsec)/1E6) #define MODBIT(x, set, bit) ((set) ? ((x) |= (bit)) : ((x) &= ~(bit))) @@ -20,6 +20,10 @@ #define TRUECOLOR(r,g,b) (1 << 24 | (r) << 16 | (g) << 8 | (b)) #define IS_TRUECOL(x) (1 << 24 & (x)) +// This decor color indicates that the fg color should be used. Note that it's +// not a 24-bit color because the 25-th bit is not set. +#define DECOR_DEFAULT_COLOR 0x0ffffff + enum glyph_attribute { ATTR_NULL = 0, ATTR_BOLD = 1 << 0, @@ -35,6 +39,7 @@ enum glyph_attribute { ATTR_WDUMMY = 1 << 10, ATTR_BOXDRAW = 1 << 11, ATTR_BOLD_FAINT = ATTR_BOLD | ATTR_FAINT, + ATTR_IMAGE = 1 << 14, }; enum selection_mode { @@ -43,6 +48,11 @@ enum selection_mode { SEL_READY = 2 }; +static inline void tsetimgrow(Glyph *g, uint32_t row) { + g->u.img.row = row; +} + + enum selection_type { SEL_REGULAR = 1, SEL_RECTANGULAR = 2 @@ -53,6 +63,14 @@ enum selection_snap { SNAP_LINE = 2 }; +enum underline_style { + UNDERLINE_STRAIGHT = 1, + UNDERLINE_DOUBLE = 2, + UNDERLINE_CURLY = 3, + UNDERLINE_DOTTED = 4, + UNDERLINE_DASHED = 5, +}; + typedef unsigned char uchar; typedef unsigned int uint; typedef unsigned long ulong; @@ -66,6 +84,7 @@ typedef struct { ushort mode; /* attribute flags */ uint32_t fg; /* foreground */ uint32_t bg; /* background */ + uint32_t decor; /* decoration (like underline) */ } Glyph; typedef Glyph *Line; @@ -108,6 +127,8 @@ void selextend(int, int, int, int); int selected(int, int); char *getsel(void); +Glyph getglyphat(int, int); + size_t utf8encode(Rune, char *); void *xmalloc(size_t); |
