X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=x.c;h=04e2e053b9f4a505c5fe2fa255d4ed6a9806cfce;hb=323d38da20c8a1d295ab1dbc0fc7ce947ef824e1;hp=03555d139069469650b5929fd382913098853868;hpb=75c9a0ee1d232a1a177746d97a13cf92b03da44a;p=st.git diff --git a/x.c b/x.c index 03555d1..04e2e05 100644 --- a/x.c +++ b/x.c @@ -20,6 +20,30 @@ static char *argv0; #include "st.h" #include "win.h" +/* types used in config.h */ +typedef struct { + uint mod; + KeySym keysym; + void (*func)(const Arg *); + const Arg arg; +} Shortcut; + +typedef struct { + uint b; + uint mask; + char *s; +} MouseShortcut; + +typedef struct { + KeySym k; + uint mask; + char *s; + /* three valued logic variables: 0 indifferent, 1 on, -1 off */ + signed char appkey; /* application keypad */ + signed char appcursor; /* application cursor */ + signed char crlf; /* crlf mode */ +} Key; + /* function definitions used in config.h */ static void clipcopy(const Arg *); static void clippaste(const Arg *); @@ -163,6 +187,7 @@ static void (*handler[LASTEvent])(XEvent *) = { static DC dc; static XWindow xw; static XSelection xsel; +static TermWindow win; enum window_state { WIN_VISIBLE = 1, @@ -1591,6 +1616,16 @@ xsetpointermotion(int set) XChangeWindowAttributes(xw.dpy, xw.win, CWEventMask, &xw.attrs); } +int +xsetcursor(int cursor) +{ + DEFAULT(cursor, 1); + if (!BETWEEN(cursor, 0, 6)) + return 1; + win.cursor = cursor; + return 0; +} + void xseturgency(int add) {