X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=st.h;h=1015fc6bdd0d1505288651e433db96c5ad21445b;hb=e0215d53770a9b6bc6e5d7b9a603ecd34dbd7100;hp=b5bc1b55aee4dd8eb9a86d192738fe38df1632de;hpb=a3beb626d2dae9d4d0883c7c8cb6ba58b0609105;p=st.git diff --git a/st.h b/st.h index b5bc1b5..1015fc6 100644 --- a/st.h +++ b/st.h @@ -1,8 +1,5 @@ /* See LICENSE for license details. */ -/* Arbitrary sizes */ -#define UTF_SIZ 4 - /* macros */ #define MIN(a, b) ((a) < (b) ? (a) : (b)) #define MAX(a, b) ((a) < (b) ? (b) : (a)) @@ -69,41 +66,6 @@ typedef struct { typedef Glyph *Line; -typedef struct { - Glyph attr; /* current char attributes */ - int x; - int y; - char state; -} TCursor; - -/* Purely graphic info */ -typedef struct { - int tw, th; /* tty width and height */ - int w, h; /* window width and height */ - int ch; /* char height */ - int cw; /* char width */ - int mode; /* window state/mode flags */ - int cursor; /* cursor style */ -} TermWindow; - -typedef struct { - int mode; - int type; - int snap; - /* - * Selection variables: - * nb – normalized coordinates of the beginning of the selection - * ne – normalized coordinates of the end of the selection - * ob – original coordinates of the beginning of the selection - * oe – original coordinates of the end of the selection - */ - struct { - int x, y; - } nb, ne, ob, oe; - - int alt; -} Selection; - typedef union { int i; uint ui; @@ -125,7 +87,8 @@ int tattrset(int); void tnew(int, int); void tresize(int, int); void tsetdirtattr(int); -void ttynew(char *, char *, char **); +void ttyhangup(void); +int ttynew(char *, char *, char *, char **); size_t ttyread(void); void ttyresize(int, int); void ttywrite(const char *, size_t, int); @@ -136,24 +99,16 @@ void selclear(void); void selinit(void); void selstart(int, int, int); void selextend(int, int, int, int); -void selnormalize(void); int selected(int, int); char *getsel(void); -size_t utf8decode(const char *, Rune *, size_t); size_t utf8encode(Rune, char *); void *xmalloc(size_t); void *xrealloc(void *, size_t); char *xstrdup(char *); -/* Globals */ -extern int cmdfd; -extern pid_t pid; -extern int oldbutton; - /* config.h globals */ -extern char *shell; extern char *utmp; extern char *stty_args; extern char *vtiden;