diff options
author | Devin J. Pohly <djpohly@gmail.com> | 2018-02-24 16:32:20 -0600 |
---|---|---|
committer | Devin J. Pohly <djpohly@gmail.com> | 2018-02-25 21:56:26 -0600 |
commit | e0215d53770a9b6bc6e5d7b9a603ecd34dbd7100 (patch) | |
tree | b696b3fa2c69270a198c3bcc1e0a289b12b3538c /x.c | |
parent | 30683c70ab62fd37b5921cf72077b9aef2cb842e (diff) | |
download | st-e0215d53770a9b6bc6e5d7b9a603ecd34dbd7100.tar.gz st-e0215d53770a9b6bc6e5d7b9a603ecd34dbd7100.zip |
Reduce visibility wherever possible
When possible, declare functions/variables static and move struct
definitions out of headers. In order to allow utf8decode to become
internal, use codepoint for DECSCUSR extension directly.
Signed-off-by: Devin J. Pohly <djpohly@gmail.com>
Diffstat (limited to 'x.c')
-rw-r--r-- | x.c | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -76,6 +76,15 @@ typedef XftGlyphFontSpec GlyphFontSpec; | |||
76 | 76 | ||
77 | /* Purely graphic info */ | 77 | /* Purely graphic info */ |
78 | typedef struct { | 78 | typedef struct { |
79 | int tw, th; /* tty width and height */ | ||
80 | int w, h; /* window width and height */ | ||
81 | int ch; /* char height */ | ||
82 | int cw; /* char width */ | ||
83 | int mode; /* window state/mode flags */ | ||
84 | int cursor; /* cursor style */ | ||
85 | } TermWindow; | ||
86 | |||
87 | typedef struct { | ||
79 | Display *dpy; | 88 | Display *dpy; |
80 | Colormap cmap; | 89 | Colormap cmap; |
81 | Window win; | 90 | Window win; |
@@ -133,6 +142,8 @@ static int xgeommasktogravity(int); | |||
133 | static void xinit(int, int); | 142 | static void xinit(int, int); |
134 | static void cresize(int, int); | 143 | static void cresize(int, int); |
135 | static void xresize(int, int); | 144 | static void xresize(int, int); |
145 | static void xhints(void); | ||
146 | static int xloadcolor(int, const char *, Color *); | ||
136 | static int xloadfont(Font *, FcPattern *); | 147 | static int xloadfont(Font *, FcPattern *); |
137 | static void xloadfonts(char *, double); | 148 | static void xloadfonts(char *, double); |
138 | static void xunloadfont(Font *); | 149 | static void xunloadfont(Font *); |
@@ -1430,8 +1441,8 @@ xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og) | |||
1430 | /* draw the new one */ | 1441 | /* draw the new one */ |
1431 | if (IS_SET(MODE_FOCUSED)) { | 1442 | if (IS_SET(MODE_FOCUSED)) { |
1432 | switch (win.cursor) { | 1443 | switch (win.cursor) { |
1433 | case 7: /* st extension: snowman */ | 1444 | case 7: /* st extension: snowman (U+2603) */ |
1434 | utf8decode("☃", &g.u, UTF_SIZ); | 1445 | g.u = 0x2603; |
1435 | case 0: /* Blinking Block */ | 1446 | case 0: /* Blinking Block */ |
1436 | case 1: /* Blinking Block (Default) */ | 1447 | case 1: /* Blinking Block (Default) */ |
1437 | case 2: /* Steady Block */ | 1448 | case 2: /* Steady Block */ |