aboutsummaryrefslogtreecommitdiff
path: root/st.h
diff options
context:
space:
mode:
authorjack <[email protected]>2023-11-27 12:34:55 -0700
committerjack <[email protected]>2023-11-27 12:34:55 -0700
commit6809f2a1a81b70385d653a942ec673192daa41b7 (patch)
tree76ceaf65f1e0b4aa37bc852aad09a0ecb193d694 /st.h
parentcf34fd0adf148540a79ed6fe6444e1fc3260d2ea (diff)
downloadst-6809f2a1a81b70385d653a942ec673192daa41b7.tar.gz
st-6809f2a1a81b70385d653a942ec673192daa41b7.zip
initial
Diffstat (limited to 'st.h')
-rw-r--r--st.h45
1 files changed, 35 insertions, 10 deletions
diff --git a/st.h b/st.h
index 35e23c6..f64d44c 100644
--- a/st.h
+++ b/st.h
@@ -3,15 +3,17 @@
#include <stdint.h>
#include <sys/types.h>
+//#include <gd.h>
+#include <glib.h>
+
/* macros */
-#define MIN(a, b) ((a) < (b) ? (a) : (b))
-#define MAX(a, b) ((a) < (b) ? (b) : (a))
#define LEN(a) (sizeof(a) / sizeof(a)[0])
#define BETWEEN(x, a, b) ((a) <= (x) && (x) <= (b))
#define DIVCEIL(n, d) (((n) + ((d) - 1)) / (d))
#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 || \
+#define ATTRCMP(a, b) (((a).mode & (~ATTR_WRAP) & (~ATTR_LIGA)) != ((b).mode & (~ATTR_WRAP) & (~ATTR_LIGA)) || \
+ (a).fg != (b).fg || \
(a).bg != (b).bg)
#define TIMEDIFF(t1, t2) ((t1.tv_sec-t2.tv_sec)*1000 + \
(t1.tv_nsec-t2.tv_nsec)/1E6)
@@ -19,7 +21,6 @@
#define TRUECOLOR(r,g,b) (1 << 24 | (r) << 16 | (g) << 8 | (b))
#define IS_TRUECOL(x) (1 << 24 & (x))
-#define HISTSIZE 2000
enum glyph_attribute {
ATTR_NULL = 0,
@@ -34,13 +35,15 @@ enum glyph_attribute {
ATTR_WRAP = 1 << 8,
ATTR_WIDE = 1 << 9,
ATTR_WDUMMY = 1 << 10,
+ ATTR_BOXDRAW = 1 << 11,
+ ATTR_LIGA = 1 << 12,
ATTR_BOLD_FAINT = ATTR_BOLD | ATTR_FAINT,
};
enum drawing_mode {
- DRAW_NONE = 0,
- DRAW_BG = 1 << 0,
- DRAW_FG = 1 << 1,
+ DRAW_NONE = 0,
+ DRAW_BG = 1 << 0,
+ DRAW_FG = 1 << 1,
};
enum selection_mode {
@@ -81,19 +84,31 @@ typedef union {
uint ui;
float f;
const void *v;
- const char *s;
} Arg;
+typedef struct {
+ uint b;
+ uint mask;
+ void (*func)(const Arg *);
+ const Arg arg;
+} MouseKey;
+
void die(const char *, ...);
void redraw(void);
void draw(void);
+void externalpipe(const Arg *);
+void iso14755(const Arg *);
+void kscrolldown(const Arg *);
+void kscrollup(const Arg *);
+void newterm(const Arg *);
void printscreen(const Arg *);
void printsel(const Arg *);
void sendbreak(const Arg *);
void toggleprinter(const Arg *);
int tattrset(int);
+int tisaltscr(void);
void tnew(int, int);
void tresize(int, int);
void tsetdirtattr(int);
@@ -118,16 +133,26 @@ void *xmalloc(size_t);
void *xrealloc(void *, size_t);
char *xstrdup(const char *);
+int isboxdraw(Rune);
+ushort boxdrawindex(const Glyph *);
+#ifdef XFT_VERSION
+/* only exposed to x.c, otherwise we'll need Xft.h for the types */
+void boxdraw_xinit(Display *, Colormap, XftDraw *, Visual *);
+void drawboxes(int, int, int, int, XftColor *, XftColor *, const XftGlyphFontSpec *, int);
+#endif
+
/* config.h globals */
extern char *utmp;
-extern char *scroll;
extern char *stty_args;
extern char *vtiden;
extern wchar_t *worddelimiters;
extern int allowaltscreen;
-extern int allowwindowops;
extern char *termname;
extern unsigned int tabspaces;
extern unsigned int defaultfg;
extern unsigned int defaultbg;
extern unsigned int defaultcs;
+extern const int boxdraw, boxdraw_bold, boxdraw_braille;
+extern float alpha;
+extern MouseKey mkeys[];
+extern int ximspot_update_interval;