[hackers] [st][PATCH 19/23] Migrate X-specific types into x.c

From: Devin J. Pohly <djpohly_AT_gmail.com>
Date: Sun, 24 Sep 2017 16:11:41 -0500

---
 st.h  | 36 ------------------------------------
 win.h |  5 -----
 x.c   | 37 +++++++++++++++++++++++++++++++++++++
 3 files changed, 37 insertions(+), 41 deletions(-)
diff --git a/st.h b/st.h
index c58f0ad..ad804ee 100644
--- a/st.h
+++ b/st.h
_AT_@ -124,21 +124,6 @@ typedef struct {
 	int *tabs;
 } Term;
 
-/* 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  */
-	char state; /* focus, redraw, visible */
-} TermWindow;
-
-typedef struct {
-	uint b;
-	uint mask;
-	char *s;
-} MouseShortcut;
-
 typedef struct {
 	int mode;
 	int type;
_AT_@ -169,23 +154,6 @@ typedef union {
 	const void *v;
 } Arg;
 
-typedef struct {
-	uint mod;
-	KeySym keysym;
-	void (*func)(const Arg *);
-	const Arg arg;
-} Shortcut;
-
-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;
-
 void die(const char *, ...);
 void redraw(void);
 
_AT_@ -267,10 +235,6 @@ extern unsigned int mouseshape;
 extern unsigned int mousefg;
 extern unsigned int mousebg;
 extern unsigned int defaultattr;
-extern MouseShortcut mshortcuts[];
-extern Shortcut shortcuts[];
-extern KeySym mappedkeys[];
-extern Key key[];
 extern size_t keylen;
 extern uint ignoremod;
 extern uint forceselmod;
diff --git a/win.h b/win.h
index 5e1f7fe..a632604 100644
--- a/win.h
+++ b/win.h
_AT_@ -1,10 +1,5 @@
 /* See LICENSE for license details. */
 
-/* X modifiers */
-#define XK_ANY_MOD    UINT_MAX
-#define XK_NO_MOD     0
-#define XK_SWITCH_MOD (1<<13)
-
 void draw(void);
 void drawregion(int, int, int, int);
 
diff --git a/x.c b/x.c
index ba2c162..858d044 100644
--- a/x.c
+++ b/x.c
_AT_@ -21,6 +21,11 @@ static char *argv0;
 #include "st.h"
 #include "win.h"
 
+/* X modifiers */
+#define XK_ANY_MOD    UINT_MAX
+#define XK_NO_MOD     0
+#define XK_SWITCH_MOD (1<<13)
+
 /* XEMBED messages */
 #define XEMBED_FOCUS_IN  4
 #define XEMBED_FOCUS_OUT 5
_AT_@ -28,6 +33,30 @@ static char *argv0;
 /* constants */
 #define ISO14755CMD		"dmenu -w %lu -p codepoint: </dev/null"
 
+/* 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;
+
 /* config.h for applying patches and the configuration. */
 #include "config.h"
 
_AT_@ -42,6 +71,14 @@ 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  */
+	char state; /* focus, redraw, visible */
+} TermWindow;
+
 typedef struct {
 	Display *dpy;
 	Colormap cmap;
-- 
2.14.1
Received on Sun Sep 24 2017 - 23:11:41 CEST

This archive was generated by hypermail 2.3.0 : Sun Sep 24 2017 - 23:25:56 CEST