From 9e25ffa7c9209e682d2a3aabea5c6c815fe22cf0 Mon Sep 17 00:00:00 2001
From: Etienne Brateau <etienne.brateau@ensiie.fr>
Date: Wed, 20 Feb 2019 12:19:16 +0100
Subject: [PATCH] Rename screen into window

We are manipulating window and not screen so this is more comprehensive
---
 Makefile                       |  2 +-
 include/log_action.h           |  6 +--
 include/{screen.h => window.h} | 18 +++----
 src/box.c                      |  2 +-
 src/configreader.c             |  2 +-
 src/gate.c                     |  2 +-
 src/keyboard.c                 |  2 +-
 src/label.c                    |  2 +-
 src/libraryreader.c            |  2 +-
 src/log.c                      | 46 +++++++++---------
 src/logstuff.c                 |  9 ----
 src/pagereader.c               |  2 +-
 src/pagewriter.c               |  2 +-
 src/pen.c                      |  2 +-
 src/{screen.c => window.c}     | 85 ++++++++++++++++++----------------
 src/wire.c                     |  2 +-
 16 files changed, 91 insertions(+), 95 deletions(-)
 rename include/{screen.h => window.h} (92%)
 rename src/{screen.c => window.c} (96%)

diff --git a/Makefile b/Makefile
index 293244f..4137051 100644
--- a/Makefile
+++ b/Makefile
@@ -115,7 +115,7 @@ SIMOBJ = $(TARGET_DIR)/logcom.o $(DIGOBJ) $(ANAOBJ)
 TOOLOBJ = $(SIMOBJ) \
 	  $(TARGET_DIR)/label.o $(TARGET_DIR)/wire.o			\
 	  $(TARGET_DIR)/page.o $(TARGET_DIR)/gate.o			\
-	  $(TARGET_DIR)/screen.o $(TARGET_DIR)/node.o			\
+	  $(TARGET_DIR)/window.o $(TARGET_DIR)/node.o			\
 	  $(TARGET_DIR)/tool.o $(TARGET_DIR)/utils.o		\
 	  $(TARGET_DIR)/pagewriter.o $(TARGET_DIR)/pagereader.o	\
 	  $(TARGET_DIR)/configreader.o $(TARGET_DIR)/attrs.o \
diff --git a/include/log_action.h b/include/log_action.h
index 81523cf..c8eec80 100644
--- a/include/log_action.h
+++ b/include/log_action.h
@@ -89,7 +89,7 @@ typedef struct log_hooks_t
 	void (*centerstr) (int x, int y, char *s);
 	void (*clip) ();
 	void (*remcursor) ();
-	void (*clearscreen) ();
+	void (*clearwindow) ();
 	void (*setmode) (const char *s);
 	void (*getword) (char *buf, char *wrd);
 	void (*getint) (char *buf, long *i, long def);
@@ -113,7 +113,7 @@ typedef struct log_hooks_t
 	void (*beginerror) ();
 	void (*enderror) ();
 	void (*redraw) ();   /*redraw drawing area*/
-	void (*redrawscreen) ();   /*redraw entire screen*/
+	void (*redrawwindow) ();   /*redraw entire window*/
 	void (*change) (log_page *page);
 	void (*newgate) (log_grec **g, int gt);
 	void (*copygate) (log_grec *old, log_grec **g);
@@ -151,7 +151,7 @@ typedef struct log_hooks_t
 	void (*newattrs) (log_gattrrec **gattr, int numattrs, log_kattrrec *kattr);
 	void (*disposeattrs) (log_gattrrec **gattr, int numattrs, log_kattrrec *kattr);
 	void (*copyattrs) (log_gattrrec **gattr, log_gattrrec *oldattr, int numattrs, log_kattrrec *kattr);
-	void (*initscreen) ();
+	void (*initwindow) ();
 	void (*clearshowalpha) ();
 	void (*setupregion) (log_regrec **r, int pagenum);
 	void (*stamp) (long *i);
diff --git a/include/screen.h b/include/window.h
similarity index 92%
rename from include/screen.h
rename to include/window.h
index 5952ed9..6a255a9 100644
--- a/include/screen.h
+++ b/include/window.h
@@ -1,5 +1,5 @@
-#ifndef SCREEN_H
-#define SCREEN_H
+#ifndef WINDOW_H
+#define WINDOW_H
 
 #include "logdef.h"
 
@@ -7,9 +7,9 @@ void initcolormap();
 
 void plainxformcoords(log_grec *g, short *x, short *y);
 
-void initscreen();
+void initwindow();
 
-void initscreen2();
+void initwindow2();
 
 void noblink();
 
@@ -17,11 +17,11 @@ void clearalpha();
 
 void showalpha();
 
-void refrscreen1();
+void refrwindow1();
 
-void refrscreen();
+void refrwindow();
 
-void resize_screen();
+void resize_window();
 
 void showcatalog();
 
@@ -49,7 +49,7 @@ void udrawgatec(int x, int y, int g, int c);
 
 void drawgatec(int x, int y, int g, int c);
 
-void clearscreen();
+void clearwindow();
 
 void restorecursor();
 
@@ -131,6 +131,6 @@ void xorcursor();
 
 int hvline(short x1, short y1, short *x2, short *y2);
 
-void init_X_screen();
+void init_X_window();
 
 #endif
diff --git a/src/box.c b/src/box.c
index 8b74ccf..24ac6c4 100644
--- a/src/box.c
+++ b/src/box.c
@@ -1,6 +1,6 @@
 #include "box.h"
 #include "logglobals.h"
-#include "screen.h"
+#include "window.h"
 #include "log.h"
 #include "utils.h"
 #include "keyboard.h"
diff --git a/src/configreader.c b/src/configreader.c
index 995ed7e..153231f 100644
--- a/src/configreader.c
+++ b/src/configreader.c
@@ -4,7 +4,7 @@
 #include "graphics/newcrt.h"
 #include "utils/strings.h"
 #include "log.h"
-#include "screen.h"
+#include "window.h"
 #include "utils.h"
 #include "tool.h"
 
diff --git a/src/gate.c b/src/gate.c
index 581bdba..420fc92 100644
--- a/src/gate.c
+++ b/src/gate.c
@@ -4,7 +4,7 @@
 #include "logfont.h"
 #include "logglobals.h"
 #include "logstructs.h"
-#include "screen.h"
+#include "window.h"
 #include "utils.h"
 #include "node.h"
 #include "log.h"
diff --git a/src/keyboard.c b/src/keyboard.c
index 8261b4b..b83d9ad 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -4,7 +4,7 @@
 #include "logglobals.h"
 #include "logdef.h"
 #include "log.h"
-#include "screen.h"
+#include "window.h"
 #include "pen.h"
 
 /// Return TRUE if a key has been pressed (via keyboard or menu boxes).
diff --git a/src/label.c b/src/label.c
index 8c7326a..2269a34 100644
--- a/src/label.c
+++ b/src/label.c
@@ -10,7 +10,7 @@
 #include "logfont.h"
 #include "utils.h"
 #include "page.h"
-#include "screen.h"
+#include "window.h"
 #include "log.h"
 #include "keyboard.h"
 #include "pen.h"
diff --git a/src/libraryreader.c b/src/libraryreader.c
index 3721ee6..63ddd35 100644
--- a/src/libraryreader.c
+++ b/src/libraryreader.c
@@ -7,7 +7,7 @@
 #include "logdef.h"
 #include "logglobals.h"
 #include "log.h"
-#include "screen.h"
+#include "window.h"
 #include "swap.h"
 
 /** @brief Compare string S with template string T.
diff --git a/src/log.c b/src/log.c
index 90d1e0c..fab2e19 100644
--- a/src/log.c
+++ b/src/log.c
@@ -65,7 +65,7 @@
 #include "logglobals.h"
 
 #include "attrs.h"
-#include "screen.h"
+#include "window.h"
 #include "label.h"
 #include "gate.h"
 #include "wire.h"
@@ -1967,7 +1967,7 @@ void scroll()
 	remcursor();
 	gg.xoff += xoff0;
 	gg.yoff += yoff0;
-	refrscreen1();
+	refrwindow1();
 	xoff0 = 0;
 	yoff0 = 0;
 	TEMP = nk_testkey(0);
@@ -3433,14 +3433,14 @@ static void pastecommand(long movemode)
 				if (thepage != copybuf.pgnum)
 				{
 					newpage(copybuf.pgnum);
-					refrscreen1();
+					refrwindow1();
 				}
 				cutcopy(&deleted, copybuf.x1copy, copybuf.y1copy, copybuf.x2copy,
 						copybuf.y2copy, true, false);
 				if (thepage != copybuf.pgnum)
 				{
 					newpage(thepage);
-					refrscreen1();
+					refrwindow1();
 				}
 				clearbuf(&deleted);
 				pastebuf(&copybuf, gg.posx, gg.posy);
@@ -5579,7 +5579,7 @@ static void listlibrary()
 			exitflag = true;
 		}
 	} while (!exitflag);
-	clearscreen();
+	clearwindow();
 	m_graphics_on();
 	clearalpha();
 }
@@ -5764,7 +5764,7 @@ static void gatecatalog(int librmode)
 			pen();
 			if (done && gg.t.depressed && !oo && !gg.t.off && flag)
 			{
-				refrscreen();
+				refrwindow();
 				addgate(y0 * catwidth + x0 + 1, 0, NULL);
 			}
 		}
@@ -7503,14 +7503,14 @@ struct LOC_doshellescape {
 static void recov(struct LOC_doshellescape *LINK)
 {
 	nk_settransarray(nk_ktsupplied, &curkeytrans);
-	initscreen2();
+	initwindow2();
 
 	if (m_maxcolor != LINK->oldc)
 		initcolormap();
 
 	m_init_pen(tabletaddr);
 	initcolors();
-	refrscreen();
+	refrwindow();
 }
 
 
@@ -8624,7 +8624,7 @@ static void historycommand()
 	{
 		if (V.rflag)
 		{
-			clearscreen();
+			clearwindow();
 			movinghn = NULL;
 			pass();
 			gg.showpage = log_page_history;
@@ -9356,7 +9356,7 @@ if gg.t.y < 46 then y1 := 0; */
 		ENDTRY(try27);
 	}
 	clearfunc();
-	refrscreen();
+	refrwindow();
 }
 
 #undef catsize
@@ -10622,7 +10622,7 @@ void docnffunction()
 		{
 			initcolors();
 			if (gg.showpage > 0)
-				refrscreen();
+				refrwindow();
 		}
 		clearfunc();
 		return;
@@ -10984,12 +10984,12 @@ void dofunction()
 		else if (!strcmp(gg.func, "REFRESH"))
 		{
 			clearfunc();
-			refrscreen();
+			refrwindow();
 		}
 		else if (!strcmp(gg.func, "RESIZE"))
 		{
 			clearfunc();
-			resize_screen();
+			resize_window();
 		}
 		else if (!strcmp(gg.func, "REFR"))
 			scroll();
@@ -11210,7 +11210,7 @@ static void inithooks()
 	gg.hook.centerstr = centerstr2;
 	gg.hook.clip = clipon;
 	gg.hook.remcursor = remcursor;
-	gg.hook.clearscreen = clearscreen;
+	gg.hook.clearwindow = clearwindow;
 	gg.hook.setmode = log_setmode;
 	gg.hook.getword = getword;
 	gg.hook.getint = pgetint;
@@ -11233,8 +11233,8 @@ static void inithooks()
 	gg.hook.endbottom = endbottom;
 	gg.hook.beginerror = beginerror;
 	gg.hook.enderror = enderror;
-	gg.hook.redraw = refrscreen1;
-	gg.hook.redrawscreen = refrscreen;
+	gg.hook.redraw = refrwindow1;
+	gg.hook.redrawwindow = refrwindow;
 	gg.hook.change = chpage;
 	gg.hook.newgate = newgate;
 	gg.hook.copygate = copygate;
@@ -11271,7 +11271,7 @@ static void inithooks()
 	gg.hook.newattrs = newattrs;
 	gg.hook.disposeattrs = disposeattrs;
 	gg.hook.copyattrs = copyattrs;
-	gg.hook.initscreen = initscreen;
+	gg.hook.initwindow = initwindow;
 	gg.hook.clearshowalpha = clearshowalpha;
 	gg.hook.setupregion = setupregion;
 	gg.hook.stamp = stamp;
@@ -11310,7 +11310,7 @@ static void inithooks()
 
 /** @brief Initialize all variables.
 			Read basic gates from library.
-			Clear catalog screen.
+			Clear catalog window.
 			Initialize global data structures.
 */
 static void initialize()
@@ -11366,7 +11366,7 @@ static void initialize()
 
 	tabletaddr = 0;
 	gg.curstamp = 0;
-	initscreen2();
+	initwindow2();
 	initcolormap();
 	libptr = 0;
 	helpptr = 0;
@@ -11876,7 +11876,7 @@ static void initialize()
 		}
 	}
 	strlist_empty(&V.logmenu);
-	refrscreen();
+	refrwindow();
 	clearalpha();
 
 	/*shift-right*/
@@ -11931,7 +11931,7 @@ static void shownews()
 
 /** @brief Initialize.
 			Then Process pen: Add gates. Add wires and solder them.
-			Refresh screen when necessary.
+			Refresh window when necessary.
 			Process keyboard and menu areas.
 */
 int main(int argc, char * argv[])
@@ -11975,7 +11975,7 @@ int main(int argc, char * argv[])
 				goto _Ltry41;
 			}
 			if (gg.showpage <= 0)
-				refrscreen();
+				refrwindow();
 			m_graphics_on();
 			nc_cursor_off();
 			while (messages != NULL)
@@ -12202,7 +12202,7 @@ int main(int argc, char * argv[])
 		m_graphics_on();
 		clearalpha();
 		ENDTRY(try41);
-		refrscreen();
+		refrwindow();
 	} while (!pigsfly);
 	RECOVER2(try40,_Ltry40);
 	TRY(try42);
diff --git a/src/logstuff.c b/src/logstuff.c
index 3c9e097..bceeb05 100644
--- a/src/logstuff.c
+++ b/src/logstuff.c
@@ -124,15 +124,6 @@ void choose_log_cursor(int curs)
   }
 }
 
-
-
-
-void init_X_screen()
-{
-  setup_log_cursors();
-  choose_log_cursor(0);
-}
-
 void m_bunny(int x, int y)
 {
   m_colormode(m_xor);
diff --git a/src/pagereader.c b/src/pagereader.c
index 00f7937..144ac3e 100644
--- a/src/pagereader.c
+++ b/src/pagereader.c
@@ -7,7 +7,7 @@
 #include "node.h"
 #include "log.h"
 #include "page.h"
-#include "screen.h"
+#include "window.h"
 #include "tool.h"
 #include "utils.h"
 #include "box.h"
diff --git a/src/pagewriter.c b/src/pagewriter.c
index 8acde3d..4ad95a0 100644
--- a/src/pagewriter.c
+++ b/src/pagewriter.c
@@ -5,7 +5,7 @@
 #include <graphics/newcrt.h>
 #include <graphics/newci.h>
 #include "log.h"
-#include "screen.h"
+#include "window.h"
 #include "tool.h"
 #include "utils.h"
 #include "box.h"
diff --git a/src/pen.c b/src/pen.c
index 234b27d..bc62e0c 100644
--- a/src/pen.c
+++ b/src/pen.c
@@ -6,7 +6,7 @@
 #include "logglobals.h"
 #include "keyboard.h"
 #include "log.h"
-#include "screen.h"
+#include "window.h"
 
 short rabstate = 0;   ///< Rabbit recognizer state
 
diff --git a/src/screen.c b/src/window.c
similarity index 96%
rename from src/screen.c
rename to src/window.c
index 3e093d2..1649469 100644
--- a/src/screen.c
+++ b/src/window.c
@@ -38,7 +38,7 @@
 #include "logfont.h"
 #include "logstuff.h"
 #include "utils.h"
-#include "screen.h"
+#include "window.h"
 #include "node.h"
 #include "log.h"
 #include "box.h"
@@ -55,9 +55,9 @@ short chairy;  ///< Y position of crosshair
 int cursorflag;   ///< If cursor is displayed
 int prevcursorflag; ///< If cursor was displayed before operation began
 
-int chairflag;   ///< If crosshair is on screen
-int chairflag2;   ///< If crosshair will be on screen
-int rbandflag;   ///< If Rubber-band wire is on screen
+int chairflag;   ///< If crosshair is on window
+int chairflag2;   ///< If crosshair will be on window
+int rbandflag;   ///< If Rubber-band wire is on window
 
 static rablistrec rabtable[rabtabsize];   ///< Positions of rabbits
 
@@ -96,7 +96,7 @@ void fixcolormap()
 
 
 /// Initialize color graphics, graphics tablet, low-level flags & variables.
-void initscreen()
+void initwindow()
 {
 	cursorflag = false;
 	m_init_screen();
@@ -104,7 +104,7 @@ void initscreen()
 	m_setlinestyle(1L, 0xf0f0L);
 	m_setlinestyle(2L, 0xaaaaL);
 	m_setfont(logfont_lfont);
-	init_X_screen();
+	init_X_window();
 	onescreen = nc_alphashared();
 	eightcolors = (m_maxcolor <= 7);
 
@@ -112,7 +112,7 @@ void initscreen()
 	txdown = nc_curWindow->height - 1;
 	across = m_across;
 	down = m_down;
-	baseline = down - 53;   /* Position of baseline on screen */
+	baseline = down - 53;   /* Position of baseline on window */
 	line1 = down - 43;   /* Position of first text line in menu */
 	line2 = down - 23;   /* Position of second text line in menu */
 	histdown = down - 26;
@@ -131,9 +131,9 @@ void initscreen()
 }
 
 
-void initscreen2()
+void initwindow2()
 {
-	initscreen();
+	initwindow();
 	m_clear();
 	m_graphics_on();
 }
@@ -269,7 +269,7 @@ void centerstr2(int x, int y, char *s)
 }
 
 
-/// Draw a single digit at the specified position (screen coordinates).
+/// Draw a single digit at the specified position (window coordinates).
 void drawnum1(short x, short y, short n)
 {
 	char s[2];
@@ -281,7 +281,7 @@ void drawnum1(short x, short y, short n)
 }
 
 
-/// Draw a two-digit number at the specified position (screen coordinates).
+/// Draw a two-digit number at the specified position (window coordinates).
 void drawnum2(short x, short y, short n)
 {
 	char s[3];
@@ -343,7 +343,7 @@ void clipoff()
 	m_noclip();
 }
 
-/// Erase a rectangular area of the screen using screen coordinates.
+/// Erase a rectangular area of the window using window coordinates.
 void uerase(short x1, short y1, short x2, short y2)
 {
 	m_color((long)gg.color.backgr);
@@ -351,7 +351,7 @@ void uerase(short x1, short y1, short x2, short y2)
 }
 
 
-/// Erase a rectangular area of the screen using grid coordinates.
+/// Erase a rectangular area of the window using grid coordinates.
 void erase(short x1, short y1, short x2, short y2)
 {
 	m_color((long)gg.color.backgr);
@@ -359,7 +359,7 @@ void erase(short x1, short y1, short x2, short y2)
 }
 
 
-/// Make sure there are no rabbits on the screen.
+/// Make sure there are no rabbits on the window.
 void norabbits()
 {
 	short i;
@@ -377,7 +377,7 @@ void norabbits()
 }
 
 
-/// Draw a rabbit on the screen.
+/// Draw a rabbit on the window.
 void addrabbit()
 {
 	short i, j, rx, ry;
@@ -447,7 +447,7 @@ int hvline(short x1, short y1, short *x2, short *y2)
 	return Result;
 }
 
-/// Adjust screen coordinates so that they are aligned to the nearest grid point.
+/// Adjust window coordinates so that they are aligned to the nearest grid point.
 void fixxy(short *x, short *y)
 {
 	*x = (*x + gg.xoff + gg.hscale) / gg.scale * gg.scale - gg.xoff;
@@ -469,10 +469,10 @@ void crosshair(short x, short y)
 	chairflag2 = true;
 }
 
-/** @brief Draw the cursor on the screen.
+/** @brief Draw the cursor on the window.
 			The exact shape drawn depends upon the
 			current mode.
-			If the cursor is already on the screen, it
+			If the cursor is already on the window, it
 			is removed.
 
 	Possible cursors:
@@ -589,7 +589,7 @@ void xorcursor()
 }
 
 
-/// Used to remove cursor from screen while drawing graphics.
+/// Used to remove cursor from window while drawing graphics.
 void hidecursor()
 {
 	if (cursorflag)
@@ -620,7 +620,7 @@ void hidecursorrect_hook(long x1, long y1, long x2, long y2)
 		hidecursor_hook();
 }
 
-/// Position the cursor to a particular point (screen coordinates).
+/// Position the cursor to a particular point (window coordinates).
 void drawcursor(short x, short y)
 {
 	if (x != cursx || y != cursy || !cursorflag || cursortype != oldcursortype)
@@ -652,7 +652,7 @@ void drawcursor(short x, short y)
 	cursorhide = false;
 }
 
-/// Take the cursor off the screen.
+/// Take the cursor off the window.
 void remcursor()
 {
 	prevcursorflag = cursorflag;
@@ -670,8 +670,8 @@ void restorecursor()
 	cursorflag = prevcursorflag;
 }
 
-/// Clear the screen.
-void clearscreen()
+/// Clear the window.
+void clearwindow()
 {
 	remcursor();
 	m_noclip();
@@ -689,7 +689,7 @@ void clearscreen()
 void clearshowalpha()
 {
 	if (onescreen)
-		clearscreen();
+		clearwindow();
 	nc_printf("\f");
 	nk_gotoxy(0, 0);
 	noblink();
@@ -1178,7 +1178,7 @@ void plaindrawgatec(short x, short y, short g, short c)
 	hidecursor();
 }
 
-/// Draw a gate of specified color at a certain position (screen coordinates).
+/// Draw a gate of specified color at a certain position (window coordinates).
 void udrawgatec(int x, int y, int g, int c)
 {
 	short i, z, rxx, rxy, ryx, ryy;
@@ -1693,14 +1693,14 @@ void drawboxc0(short x1, short y1, short x2, short y2, short c)
 	m_linestyle(0L);
 }
 
-/// Draw a dashed box on the screen.
+/// Draw a dashed box on the window.
 void drawboxc(log_brec *b, short  c)
 {
 	drawboxc0(b->x1, b->y1, b->x2, b->y2, c);
 }
 
 
-/// Draw the printing markers on the screen.
+/// Draw the printing markers on the window.
 void drawmarkersc(short c)
 {
 	clipon();
@@ -1870,7 +1870,7 @@ void refrbaseline(int always)
 
 #define rtn             "REFRESH"
 
-/// Refresh the screen (does not clear, so may be used to "clean up" existing screen).
+/// Refresh the window (does not clear, so may be used to "clean up" existing window).
 void refresh()
 {
 	long x1, y1, x2, y2;
@@ -2032,7 +2032,7 @@ void refresh()
 
 #undef rtn
 
-/// Screen is messed up, so refresh it as soon as the user stops moving around.
+/// Window is messed up, so refresh it as soon as the user stops moving around.
 void refreshsoon()
 {
 	refrtimer0 = refrdelay;
@@ -2040,7 +2040,7 @@ void refreshsoon()
 	gg.refrflag = true;
 }
 
-/// Clear and redraw menu area of screen.
+/// Clear and redraw menu area of window.
 void refrmenu()
 {
 	short i, FORLIM;
@@ -2106,8 +2106,8 @@ void endbottom()
 	clearalpha();
 }
 
-/// Clear and redraw working area of screen.
-void refrscreen1()
+/// Clear and redraw working area of window.
+void refrwindow1()
 {
 	m_colormode((long)m_normal);
 	m_noclip();
@@ -2119,8 +2119,8 @@ void refrscreen1()
 }
 
 
-/// Clear and redraw entire screen.
-void refrscreen()
+/// Clear and redraw entire window.
+void refrwindow()
 {
 	gg.showpage = gg.curpage;
 	bottomcount = 0;
@@ -2129,24 +2129,24 @@ void refrscreen()
 	fixcolormap();
 	clearalpha();
 	refrmenu();
-	refrscreen1();
+	refrwindow1();
 	m_graphics_on();
 }
 
-void resize_screen()
+void resize_window()
 {
-	initscreen2();
-	initscreen();
+	initwindow2();
+	initwindow();
 }
 
-//// Switch screen to catalog (TRUE) or circuit (FALSE).
+//// Switch window to catalog (TRUE) or circuit (FALSE).
 void showcatalog()
 {
 	short i;
 	catboxrec *cb;
 	short x1, y1, x2, y2, FORLIM;
 
-	clearscreen();
+	clearwindow();
 	gg.showpage = log_page_cat;
 	FORLIM = maxkinds;
 	for (i = 1; i <= FORLIM; i++)
@@ -2179,4 +2179,9 @@ void showcatalog()
 	}
 }
 
+void init_X_window()
+{
+	setup_log_cursors();
+	choose_log_cursor(0);
+}
 
diff --git a/src/wire.c b/src/wire.c
index b5738c0..a5dfc6f 100644
--- a/src/wire.c
+++ b/src/wire.c
@@ -8,7 +8,7 @@
 #include "wire.h"
 #include "node.h"
 #include "log.h"
-#include "screen.h"
+#include "window.h"
 
 void fryhwire(log_hwrec *hw)
 {
-- 
GitLab