diff options
| author | Devin J. Pohly <djpohly@gmail.com> | 2017-11-06 17:57:45 -0600 |
|---|---|---|
| committer | Devin J. Pohly <djpohly@gmail.com> | 2018-02-25 21:53:24 -0600 |
| commit | 323d38da20c8a1d295ab1dbc0fc7ce947ef824e1 (patch) | |
| tree | 713288818320ae09fa67cc3b5032f67418a1d702 | |
| parent | 416dd257274fd334be082b1138338adffa3e2d5e (diff) | |
| download | st-323d38da20c8a1d295ab1dbc0fc7ce947ef824e1.tar.gz st-323d38da20c8a1d295ab1dbc0fc7ce947ef824e1.zip | |
Make win variable internal to x.c
There was only a single reference to the `win` variable in st.c, so
exporting that to x.c allows us to rid ourselves of another extern.
Signed-off-by: Devin J. Pohly <djpohly@gmail.com>
| -rw-r--r-- | st.c | 6 | ||||
| -rw-r--r-- | st.h | 1 | ||||
| -rw-r--r-- | win.h | 1 | ||||
| -rw-r--r-- | x.c | 11 |
4 files changed, 13 insertions, 6 deletions
| @@ -170,7 +170,6 @@ static char *base64dec(const char *); | |||
| 170 | static ssize_t xwrite(int, const char *, size_t); | 170 | static ssize_t xwrite(int, const char *, size_t); |
| 171 | 171 | ||
| 172 | /* Globals */ | 172 | /* Globals */ |
| 173 | TermWindow win; | ||
| 174 | Term term; | 173 | Term term; |
| 175 | Selection sel; | 174 | Selection sel; |
| 176 | int cmdfd; | 175 | int cmdfd; |
| @@ -1683,11 +1682,8 @@ csihandle(void) | |||
| 1683 | case ' ': | 1682 | case ' ': |
| 1684 | switch (csiescseq.mode[1]) { | 1683 | switch (csiescseq.mode[1]) { |
| 1685 | case 'q': /* DECSCUSR -- Set Cursor Style */ | 1684 | case 'q': /* DECSCUSR -- Set Cursor Style */ |
| 1686 | DEFAULT(csiescseq.arg[0], 1); | 1685 | if (xsetcursor(csiescseq.arg[0])) |
| 1687 | if (!BETWEEN(csiescseq.arg[0], 0, 6)) { | ||
| 1688 | goto unknown; | 1686 | goto unknown; |
| 1689 | } | ||
| 1690 | win.cursor = csiescseq.arg[0]; | ||
| 1691 | break; | 1687 | break; |
| 1692 | default: | 1688 | default: |
| 1693 | goto unknown; | 1689 | goto unknown; |
| @@ -201,7 +201,6 @@ void *xrealloc(void *, size_t); | |||
| 201 | char *xstrdup(char *); | 201 | char *xstrdup(char *); |
| 202 | 202 | ||
| 203 | /* Globals */ | 203 | /* Globals */ |
| 204 | extern TermWindow win; | ||
| 205 | extern Term term; | 204 | extern Term term; |
| 206 | extern Selection sel; | 205 | extern Selection sel; |
| 207 | extern int cmdfd; | 206 | extern int cmdfd; |
| @@ -14,5 +14,6 @@ void xhints(void); | |||
| 14 | void xloadcols(void); | 14 | void xloadcols(void); |
| 15 | int xsetcolorname(int, const char *); | 15 | int xsetcolorname(int, const char *); |
| 16 | void xsettitle(char *); | 16 | void xsettitle(char *); |
| 17 | int xsetcursor(int); | ||
| 17 | void xsetpointermotion(int); | 18 | void xsetpointermotion(int); |
| 18 | void xsetsel(char *, Time); | 19 | void xsetsel(char *, Time); |
| @@ -187,6 +187,7 @@ static void (*handler[LASTEvent])(XEvent *) = { | |||
| 187 | static DC dc; | 187 | static DC dc; |
| 188 | static XWindow xw; | 188 | static XWindow xw; |
| 189 | static XSelection xsel; | 189 | static XSelection xsel; |
| 190 | static TermWindow win; | ||
| 190 | 191 | ||
| 191 | enum window_state { | 192 | enum window_state { |
| 192 | WIN_VISIBLE = 1, | 193 | WIN_VISIBLE = 1, |
| @@ -1615,6 +1616,16 @@ xsetpointermotion(int set) | |||
| 1615 | XChangeWindowAttributes(xw.dpy, xw.win, CWEventMask, &xw.attrs); | 1616 | XChangeWindowAttributes(xw.dpy, xw.win, CWEventMask, &xw.attrs); |
| 1616 | } | 1617 | } |
| 1617 | 1618 | ||
| 1619 | int | ||
| 1620 | xsetcursor(int cursor) | ||
| 1621 | { | ||
| 1622 | DEFAULT(cursor, 1); | ||
| 1623 | if (!BETWEEN(cursor, 0, 6)) | ||
| 1624 | return 1; | ||
| 1625 | win.cursor = cursor; | ||
| 1626 | return 0; | ||
| 1627 | } | ||
| 1628 | |||
| 1618 | void | 1629 | void |
| 1619 | xseturgency(int add) | 1630 | xseturgency(int add) |
| 1620 | { | 1631 | { |
