X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=x.c;h=d0acfee59b93daa1d8da851ad56a9666b8568bc3;hb=403c57ebb5b3745ff93e49b87e526c49dc59a5b9;hp=970d6dd8816750f9d66075d68163a7be59bfdf90;hpb=30683c70ab62fd37b5921cf72077b9aef2cb842e;p=st.git diff --git a/x.c b/x.c index 970d6dd..d0acfee 100644 --- a/x.c +++ b/x.c @@ -1,15 +1,14 @@ /* See LICENSE for license details. */ #include +#include #include #include -#include #include #include #include #include #include #include -#include #include #include #include @@ -75,6 +74,15 @@ typedef XftColor Color; typedef XftGlyphFontSpec GlyphFontSpec; /* 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 { Display *dpy; Colormap cmap; @@ -133,6 +141,8 @@ static int xgeommasktogravity(int); static void xinit(int, int); static void cresize(int, int); static void xresize(int, int); +static void xhints(void); +static int xloadcolor(int, const char *, Color *); static int xloadfont(Font *, FcPattern *); static void xloadfonts(char *, double); static void xunloadfont(Font *); @@ -1430,8 +1440,8 @@ xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og) /* draw the new one */ if (IS_SET(MODE_FOCUSED)) { switch (win.cursor) { - case 7: /* st extension: snowman */ - utf8decode("☃", &g.u, UTF_SIZ); + case 7: /* st extension: snowman (U+2603) */ + g.u = 0x2603; case 0: /* Blinking Block */ case 1: /* Blinking Block (Default) */ case 2: /* Steady Block */