changeset 24:2fca87529974

move to new layout
author ng0 <ng0@n0.is>
date Sat, 13 Apr 2019 18:19:26 +0000
parents a56940622c2e
children faf79bdca8d7
files .gitignore Beep.c Bindings.c CircleDown.c CircleUp.c Cursors.c Error.c Focus.c GetButton.c GridBox.c Iconify.c Icons.c Kill.c Lower.c Makefile Makefile.old Menu.c Move.c MoveOpaque.c NewIconify.c Pause.c Push.c Raise.c Refresh.c Resize.c Restart.c RubberBand.c StoreBox.c StoreZap.c X11/copyright.h XError.c caddr.h colormap.c doc/uwm.1 doc/uwmrc.5 globals.c gram.y lex.l src/Beep.c src/Bindings.c src/CircleDown.c src/CircleUp.c src/Cursors.c src/Error.c src/Focus.c src/GetButton.c src/GridBox.c src/Iconify.c src/Icons.c src/Kill.c src/Lower.c src/Menu.c src/Move.c src/MoveOpaque.c src/NewIconify.c src/Pause.c src/Push.c src/Raise.c src/Refresh.c src/Resize.c src/Restart.c src/RubberBand.c src/StoreBox.c src/StoreZap.c src/X11/copyright.h src/XError.c src/caddr.h src/colormap.c src/globals.c src/gram.y src/lex.l src/uwm.c src/uwm.h src/windowinfo.c src/y.tab.h uwm.c uwm.h windowinfo.c y.tab.c y.tab.h
diffstat 78 files changed, 11373 insertions(+), 8606 deletions(-) [+]
line wrap: on
line diff
--- a/.gitignore	Mon Sep 17 20:51:55 2018 +0000
+++ b/.gitignore	Sat Apr 13 18:19:26 2019 +0000
@@ -2,3 +2,6 @@
 *.s
 *.o
 uwm
+*~
+build.log
+.gdbinit
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Beep.c	Sat Apr 13 18:19:26 2019 +0000
@@ -0,0 +1,68 @@
+#ifndef lint
+static char *rcsid_Beep_c = "$XConsortium: Beep.c,v 1.5 88/09/06 17:27:24 jim Exp $";
+#endif	/* lint */
+
+/*
+ * Copyright 1985, 1986, 1987, 1988, 1989 by the
+ * Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  M.I.T. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ */
+
+#include <stdbool.h>
+
+/*
+ * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+ *
+ *                         All Rights Reserved
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Digital Equipment
+ * Corporation not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior permission.
+ *
+ *
+ * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+
+
+/*
+ * MODIFICATION HISTORY
+ *
+ * 000 -- M. Gancarz, DEC Ultrix Engineering Group
+ */
+
+#ifndef lint
+static char *sccsid = "@(#)Beep.c	3.8	1/24/86";
+#endif
+
+#include "uwm.h"
+
+bool Beep(window, mask, button, x, y)
+Window window;                          /* Event window. */
+int mask;                               /* Button/key mask. */
+int button;                             /* Button event detail. */
+int x, y;                               /* Event mouse position. */
+{
+	XBell(dpy, VOLUME_PERCENTAGE(Volume));
+	return(FALSE);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Bindings.c	Sat Apr 13 18:19:26 2019 +0000
@@ -0,0 +1,128 @@
+#ifndef lint
+static char *rcsid_Bindings_c = "$XConsortium: Bindings.c,v 1.15 88/09/22 16:08:10 jim Exp $";
+#endif
+
+/*
+ * Copyright 1985, 1986, 1987, 1988, 1989 by the
+ * Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  M.I.T. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ */
+
+/*
+ * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+ *
+ *                         All Rights Reserved
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Digital Equipment
+ * Corporation not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior permission.
+ *
+ *
+ * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+
+
+/*
+ * MODIFICATION HISTORY
+ *
+ * 000 -- M. Gancarz, DEC Ultrix Engineering Group
+ */
+
+#ifndef lint
+static char *sccsid = "@(#)Bindings.c	3.8	1/24/86";
+#endif
+
+/*
+ * Bindings.c 	Default bindings for the X window manager 'uwm'
+ *
+ * Note: Any changes to this file should also be added to the file
+ * /usr/new/lib/X/uwm/default.uwmrc to keep users informed as to the bindings
+ * contained herein.
+ */
+
+char *
+DefaultBindings[] =
+{
+	"resetbindings;resetvariables;resetmenus;noautoselect;delta=5;freeze",
+	"grid;zap;pushabsolute;push=1;hiconpad=5;viconpad=5;hmenupad=3;vmenupad=0",
+	"iconfont=fixed;menufont=fixed;resizefont=fixed;volume=0;noresizerelative",
+	"f.newiconify=m:w|i:delta l",
+	"f.raise=m:w|i:delta l",
+	"f.lower=m:w|i:l u",
+	"f.raise=m:w:m d",
+	"f.resize=m:w:delta m",
+	"f.iconify=m:i:m u",
+	"f.raise=m:w|i:r d",
+	"f.move=m:w|i:delta r",
+	"f.circledown=m:r:l d",
+	"f.circleup=m:r:r d",
+	"f.circledown=m|s::l d",
+	"f.menu=:r:m d:\"WindowOps\"",
+	"f.menu=m|s::m d:\"WindowOps\"",
+	"f.menu=m|s::m d:\"Preferences\"",
+	"f.circleup=m|s::r d",
+	"f.iconify=m|c:w|i:l d",
+	"f.newiconify=m|l:w|i:l d",
+	"f.raise=m|l:w|i:l u",
+	"f.pushright=m|l:w|i:r d",
+	"f.pushleft=m|c:w|i:r d",
+	"f.pushup=m|l:w|i:m d",
+	"f.pushdown=m|c:w|i:m d",
+	"menu=\"WindowOps\"{",
+	"New Window:!\"xterm&\"",
+	"RefreshScreen:f.refresh",
+	"Redraw:f.redraw",
+	"Move:f.move",
+	"Resize:f.resize",
+	"Lower:f.lower",
+	"Raise:f.raise",
+	"CircUp:f.circleup",
+	"CircDown:f.circledown",
+	"AutoIconify:f.iconify",
+	"LowerIconify:f.newiconify",
+	"NewIconify:f.newiconify",
+	"Focus:f.focus",
+	"Freeze:f.pause",
+	"UnFreeze:f.continue",
+	"Restart:f.restart",
+	"\" \":f.beep",
+	"KillWindow:f.kill",
+	"\" \":f.beep",
+	"Exit:f.exit",
+	"}",
+	"menu=\"Preferences\"{",
+	"Bell Loud:!\"xset b 7&\"",
+	"Bell Normal:!\"xset b 3&\"",
+	"Bell Off:!\"xset b off&\"",
+	"Click Loud:!\"xset c 8&\"",
+	"Click Soft:!\"xset c on&\"",
+	"Click Off:!\"xset c off&\"",
+	"Lock On:!\"xset l on&\"",
+	"Lock Off:!\"xset l off&\"",
+	"Mouse Fast:!\"xset m 4 2&\"",
+	"Mouse Normal:!\"xset m 2 5&\"",
+	"Mouse Slow:!\"xset m 1 1&\"",
+	"}",
+	0	/* Must NOT be removed. */
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/CircleDown.c	Sat Apr 13 18:19:26 2019 +0000
@@ -0,0 +1,69 @@
+#ifndef lint
+static char *rcsid_CircleDown_c = "$XConsortium: CircleDown.c,v 1.5 88/09/06 17:27:30 jim Exp $";
+#endif	/* lint */
+
+/*
+ * Copyright 1985, 1986, 1987, 1988, 1989 by the
+ * Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  M.I.T. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ */
+
+/*
+ * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+ *
+ *                         All Rights Reserved
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Digital Equipment
+ * Corporation not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior permission.
+ *
+ *
+ * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+
+
+/*
+ * MODIFICATION HISTORY
+ *
+ * 000 -- M. Gancarz, DEC Ultrix Engineering Group
+ * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group,
+    Western Software Lab. Converted to X11.
+ */
+
+#ifndef lint
+static char *sccsid = "@(#)CircleDown.c	3.8	1/24/86";
+#endif
+
+#include "uwm.h"
+#include <stdbool.h>
+
+bool CircleDown(window, mask, button, x, y)
+Window window;                          /* Event window. */
+int mask;                               /* Button/key mask. */
+int button;                             /* Button event detail. */
+int x, y;                               /* Event mouse position. */
+{
+	XCirculateSubwindowsDown(dpy, RootWindow(dpy, scr));
+	return(FALSE);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/CircleUp.c	Sat Apr 13 18:19:26 2019 +0000
@@ -0,0 +1,69 @@
+#ifndef lint
+static char *rcsid_CircleUp_c = "$XConsortium: CircleUp.c,v 1.5 88/09/06 17:27:36 jim Exp $";
+#endif	/* lint */
+
+/*
+ * Copyright 1985, 1986, 1987, 1988, 1989 by the
+ * Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  M.I.T. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ */
+
+/*
+ * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+ *
+ *                         All Rights Reserved
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Digital Equipment
+ * Corporation not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior permission.
+ *
+ *
+ * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+
+
+/*
+ * MODIFICATION HISTORY
+ *
+ * 000 -- M. Gancarz, DEC Ultrix Engineering Group
+ * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group,
+    Western Software Lab. Converted to X11.
+ */
+
+#ifndef lint
+static char *sccsid = "@(#)CircleUp.c	3.8	1/24/86";
+#endif
+
+#include "uwm.h"
+#include <stdbool.h>
+
+bool CircleUp(window, mask, button, x, y)
+Window window;                          /* Event window. */
+int mask;                               /* Button/key mask. */
+int button;                             /* Button event detail. */
+int x, y;                        	/* Event mouse position. */
+{
+	XCirculateSubwindowsUp(dpy, RootWindow(dpy, scr));
+	return(FALSE);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Cursors.c	Sat Apr 13 18:19:26 2019 +0000
@@ -0,0 +1,130 @@
+#ifndef lint
+static char *rcsid_StoreCursors_c = "$XConsortium: Cursors.c,v 1.6 88/09/06 17:27:45 jim Exp $";
+#endif	/* lint */
+
+/*
+ * Copyright 1985, 1986, 1987, 1988, 1989 by the
+ * Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  M.I.T. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ */
+
+/*
+ * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+ *
+ *                         All Rights Reserved
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Digital Equipment
+ * Corporation not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior permission.
+ *
+ *
+ * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+
+
+/*
+ * MODIFICATION HISTORY
+ *
+ * 000 -- M. Gancarz, DEC Ultrix Engineering Group
+ * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group
+ *        Convert to X11
+ */
+
+#ifndef lint
+static char *sccsid = "@(#)StoreCursors.c	3.8	1/24/86";
+#endif
+
+#include "uwm.h"
+#include <X11/cursorfont.h>
+
+/*
+ * Store all the cursors into global variables.
+ */
+int StoreCursors()
+{
+    /*
+     * Main uwm cursor and movement cursor.
+     */
+    ArrowCrossCursor = XCreateFontCursor(dpy, XC_fleur);
+    if (ArrowCrossCursor == FAILURE) {
+	Error("StoreCursors -> Unable to store ArrowCrossCursor.");
+    }
+
+    /*
+     * Text cursor used in icons.
+     */
+    TextCursor = XCreateFontCursor(dpy, XC_top_left_arrow);
+    if (TextCursor == FAILURE) {
+	Error("StoreCursors -> Unable to store TextCursor.");
+    }
+
+    /*
+     * Icon cursor used to iconify windows.
+     */
+    IconCursor = XCreateFontCursor(dpy, XC_icon);	
+    if (IconCursor == FAILURE) {
+	Error("StoreCursors -> Unable to store IconCursor.");
+    }
+
+    /*
+     * Menu cursor.
+     */
+    MenuCursor = XCreateFontCursor(dpy, XC_sb_left_arrow);
+    if (MenuCursor == FAILURE) {
+	Error("StoreCursors -> Unable to store MenuCursor.");
+    }
+
+    /*
+     * Left button main cursor.
+     */
+    LeftButtonCursor = XCreateFontCursor(dpy, XC_leftbutton);	
+    if (LeftButtonCursor == FAILURE) {
+	Error("StoreCursors -> Unable to store LeftButtonCursor.");
+    }
+
+    /*
+     * Middle button main cursor.
+     */
+    MiddleButtonCursor = XCreateFontCursor(dpy, XC_middlebutton);	
+    if (MiddleButtonCursor == FAILURE) {
+	Error("StoreCursors -> Unable to store MiddleButtonCursor.");
+    }
+
+    /*
+     * Right button main cursor.
+     */
+    RightButtonCursor = XCreateFontCursor(dpy, XC_rightbutton);	
+    if (RightButtonCursor == FAILURE) {
+	Error("StoreCursors -> Unable to store RightButtonCursor.");
+    }
+
+    /*
+     * Targer cursor used to identify a window for an action.
+     */
+    TargetCursor = XCreateFontCursor(dpy, XC_hand2);	
+    if (TargetCursor == FAILURE) {
+	Error("StoreCursors -> Unable to store TargetCursor.");
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Error.c	Sat Apr 13 18:19:26 2019 +0000
@@ -0,0 +1,74 @@
+#ifndef lint
+static char *rcsid_Error_c = "$XConsortium: Error.c,v 1.5 88/09/06 17:27:51 jim Exp $";
+#endif	/* lint */
+
+/*
+ * Copyright 1985, 1986, 1987, 1988, 1989 by the
+ * Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  M.I.T. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ */
+
+#include <stdlib.h>
+
+/*
+ * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+ *
+ *                         All Rights Reserved
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Digital Equipment
+ * Corporation not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior permission.
+ *
+ *
+ * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+
+
+/*
+ * MODIFICATION HISTORY
+ *
+ * 000 -- M. Gancarz, DEC Ultrix Engineering Group
+ */
+
+#ifndef lint
+static char *sccsid = "@(#)Error.c	3.8	1/24/86";
+#endif
+
+#include "uwm.h"
+/*
+ * Default error reporting routine.  Called when a random uwm error
+ * is encountered.
+ */
+Error(s)
+char *s;	/* Error description string */
+{
+    fprintf(stderr, "uwm: %s\n", s);
+    exit(1);
+}
+
+Warning(s)
+char *s;	/* Error description string */
+{
+    fprintf(stderr, "uwm: warning: %s\n", s);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Focus.c	Sat Apr 13 18:19:26 2019 +0000
@@ -0,0 +1,70 @@
+#ifndef lint
+static char *rcsid_Focus_c = "$XConsortium: Focus.c,v 1.5 88/09/06 17:28:01 jim Exp $";
+#endif	/* lint */
+
+/*
+ * Copyright 1985, 1986, 1987, 1988, 1989 by the
+ * Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  M.I.T. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ */
+
+/*
+ * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+ *
+ *                         All Rights Reserved
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Digital Equipment
+ * Corporation not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior permission.
+ *
+ *
+ * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+
+
+/*
+ * MODIFICATION HISTORY
+ *
+ * 000 -- M. Gancarz, DEC Ultrix Engineering Group
+ * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group,
+    Western Software Lab. Converted to X11.
+ */
+
+#ifndef lint
+static char *sccsid = "@(#)Focus.c	3.8	1/24/86";
+#endif
+
+#include "uwm.h"
+#include <stdbool.h>
+
+bool Focus(window, mask, button, x, y)
+Window window;                          /* Event window. */
+int mask;                               /* Button/key mask. */
+int button;                           /* Button event detail. */
+int x, y;                               /* Event mouse position. */
+{
+    XSetInputFocus(dpy, window, RevertToParent, CurrentTime);
+    FocusSetByUser = TRUE;
+    return(FALSE);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/GetButton.c	Sat Apr 13 18:19:26 2019 +0000
@@ -0,0 +1,514 @@
+#ifndef lint
+static char *rcsid_GetButton_c = "$XConsortium: GetButton.c,v 1.38 88/10/23 12:08:12 jim Exp $";
+#endif	/* lint */
+
+/*
+ * Copyright 1985, 1986, 1987, 1988, 1989 by the
+ * Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  M.I.T. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ */
+
+#include <stdlib.h>
+#include <stdbool.h>
+
+/*
+ * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+ *
+ *                         All Rights Reserved
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Digital Equipment
+ * Corporation not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior permission.
+ *
+ *
+ * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+
+
+/*
+ * MODIFICATION HISTORY
+ *
+ * 000 -- M. Gancarz, DEC Ultrix Engineering Group
+ * 001 -- L. Guarino Reid, DEC Ultrix Engineering Group, Western Software Lab
+ *	  February 16, 1987
+ *	  Add EnterWindow, LeaveWindow, and MouseMotion as recognized
+ *	  uwm buttons for uwm menus. Add bug fixes to prevent mem faults
+ *	  if icon_str is NULL.
+ * 002 -- L. Guarino Reid, DEC Ultrix Engineering Group
+ *	  April 16, 1987
+ *	  Convert to X11
+ */
+
+#ifndef lint
+static char *sccsid = "@(#)GetButton.c	3.8	1/24/86";
+#endif
+/*
+ *	GetButton - This subroutine is used by the Ultrix Window Manager (uwm)
+ *	to acquire button events.  It waits for a button event to occur
+ *	and handles all event traffic in the interim.
+ *
+ *	File:		GetButton.c
+ */
+
+#include "uwm.h"
+#include <X11/Xatom.h>
+
+#define ICONSTR	(icon_str ? icon_str : "")
+
+bool GetButton(button_event)
+    XEvent *button_event;	/* Button event packet. */
+{
+#define STRLEN 50
+    XKeyPressedEvent *kp_event;	/* Key pressed event. */
+    char *icon_str;		/* Icon's name string. */
+    register int icon_str_len;	/* Icon name string lenght.  */
+    register int key_char;	/* Key press character code. */
+    register int icon_x;	/* Icon window X coordinate. */
+    register int icon_y;	/* Icon window Y coordinate. */
+    register int icon_w;	/* Icon window width. */
+    register int icon_h;	/* Icon window height. */    
+    int status;			/* Routine call return status. */
+    Window icon;		/* Icon window. */
+    Window appl;		/* Application window. */
+    XWindowAttributes icon_info;	/* Icon window info structure. */
+    char kbd_str[STRLEN];              /* Keyboard string. */
+    int nbytes;                 /* Keyboard string length. */
+    int i;                      /* Iteration counter. */
+
+
+    /*
+     * Get next event from input queue and store it in the event packet
+     * passed to GetButton.
+     */
+    XNextEvent(dpy, button_event);
+
+    processInterestEvent (button_event);
+
+    /*
+     * The event occured on the root window, check for substructure
+     * changes. Otherwise, it must be a mouse button event. 
+     */
+    if (((XAnyEvent *)button_event)->window == RootWindow(dpy, scr)) {
+
+	switch (button_event->type) {
+
+	  case CreateNotify:
+		(void) getWindowInfo (((XCreateWindowEvent *) button_event)->window);
+	  case 0:
+	  case UnmapNotify:
+	  case ReparentNotify:
+	  case ConfigureNotify:
+	  case ColormapNotify:
+	  case GravityNotify:
+	  case MapNotify:
+	  case EnterNotify:
+	  case LeaveNotify:
+	  case CirculateNotify: return(FALSE);
+
+	  case MappingNotify:
+		XRefreshKeyboardMapping (button_event);
+		return (FALSE);
+	  	
+	  case MapRequest: 
+	        CheckMap(((XMapEvent *)button_event)->window);
+		return(FALSE);
+
+	  case ConfigureRequest: 
+	        Configure((XConfigureEvent *)button_event);
+		return(FALSE);
+
+	  case CirculateRequest: 
+	        Circulate((XCirculateEvent *)button_event);
+		return(FALSE);
+
+	  case DestroyNotify:
+		deleteWindowInfo (((XDestroyWindowEvent *)button_event)->window);
+	        RemoveIcon(((XDestroyWindowEvent *)button_event)->window);
+		return(FALSE);
+
+	  case FocusIn: 
+		if (((XFocusInEvent *)button_event)->detail
+		    == NotifyPointerRoot) {
+    	            if (FocusSetByUser) {
+       	                XSetInputFocus(dpy, PointerRoot, None, CurrentTime);
+                        FocusSetByUser = FALSE;
+		    }
+		}
+		return (FALSE);
+
+          case FocusOut:
+		if (((XFocusOutEvent *)button_event)->detail
+		    == NotifyPointerRoot) {
+                    if (!FocusSetByUser) {
+   	                XSetInputFocus(dpy, PointerRoot, None, CurrentTime);
+		    }
+		}
+		return (FALSE);
+
+	  case ButtonPress:
+	  case ButtonRelease:
+		return(TRUE);
+
+	  default: 
+	    printf("uwm internal error: unexpected event on Root Window\n");
+	    return(FALSE); 
+	}
+    }
+
+    /*
+     * If the event type is EnterWindow, LeaveWindow, or MouseMoved,
+     * we are processing a menu. 
+     * If the event type is ButtonPress or ButtonRelease,
+     * we have a button event.      */
+    switch (button_event->type) {
+       case EnterNotify:
+       case LeaveNotify: 
+       case MotionNotify: 
+       case ButtonPress: 
+       case ButtonRelease: 
+	return(TRUE); 
+       case 0:
+        return(FALSE);
+       default: break;
+    }
+
+    /*
+     * Ok, if the event is not on the root window it might be an event on
+     * one of the icons owned by uwm.
+     */
+    icon = ((XAnyEvent *)button_event)->window;
+
+     /*
+     * Find out current information about the icon window.
+     */
+    status = XGetWindowAttributes(dpy, icon, &icon_info);
+    if (status == FAILURE) return(FALSE);
+    /*
+     * Get the name of the window associated with the icon and
+     * determine its length.
+     */
+    icon_x = icon_info.x;
+    icon_y = icon_info.y;
+    if (!IsIcon(icon, icon_x, icon_y, FALSE, &appl)) return(FALSE);
+
+    /*
+     * If the event is an UnmapWindow event or a ConfigureNotify event,
+     * then return FALSE.
+     */
+    if (button_event->type == MapNotify || 
+        button_event->type == UnmapNotify ||
+        button_event->type == CreateNotify ||
+        button_event->type == ReparentNotify ||
+        button_event->type == GravityNotify ||
+        button_event->type == CirculateNotify ||
+	button_event->type == ColormapNotify ||
+        button_event->type == ConfigureNotify)
+        return(FALSE);
+
+    /*
+     * Initialize the icon name variables.
+     */
+    icon_str = GetIconName(appl);
+    icon_str_len = icon_str ? strlen(icon_str) : 0;
+
+    /*
+     * If the event is a window exposure event and the icon's name string
+     * is not of zero length, simply repaint the text in the icon window
+     * and return FALSE.
+     */
+    if (button_event->type == Expose && (!Freeze || Frozen == 0)) {
+	int desired_width = XTextWidth (IFontInfo, ICONSTR, strlen (ICONSTR)) +
+			    (HIconPad << 1);
+	int desired_height = (IFontInfo->ascent + IFontInfo->descent + 
+			      (VIconPad << 1));
+
+        if (icon_info.width != desired_width || 
+	    icon_info.height != desired_height) {
+	    XWarpPointer (dpy, icon, icon, 0,0,0,0, (desired_width - HIconPad),
+			  (desired_height >> 1));
+	    XResizeWindow (dpy, icon, desired_width, desired_height);
+	}
+	XClearWindow(dpy, icon);
+        if (icon_str_len != 0) {
+            XDrawImageString(dpy, icon,
+                     IconGC, HIconPad, VIconPad+IFontInfo->ascent,
+                     icon_str, icon_str_len);
+	    /*
+	     * Remember to free the icon name string.
+	     */
+	    free(icon_str);
+        }
+	return(FALSE);
+    }
+
+    if (button_event->type != KeyPress) return (FALSE);
+    
+    /*
+     * If we have gotten this far event can only be a key pressed event.
+     */
+    kp_event = (XKeyPressedEvent *) button_event;
+
+    /* 
+     * We convert the key pressed event to ascii.
+     */
+    #if 0
+    nbytes = XLookupString(kp_event, kbd_str, STRLEN, NULL);
+    #else
+    nbytes = XLookupString(kp_event, kbd_str, STRLEN, NULL, NULL);
+    #endif
+    /*
+     * If kbd_str is a "non-string", then don't do anything.
+     */
+    if (nbytes == 0) {
+        if (icon_str) free(icon_str);
+        return(FALSE);
+    }
+    for (i = 0; i < nbytes; i++) {
+        key_char = kbd_str[i];
+        /*
+         * If the key was <DELETE>, then delete a character from the end of
+         * the name, return FALSE.
+         *
+         * If the key was <CTRL-U>, then wipe out the entire window name
+         * and return FALSE.
+         *
+         * All other ctrl keys are squashed and we return FALSE.
+         *
+         * All printable characters are appended to the window's name, which
+         * may have to be grown to allow for the extra length.
+         */
+        if (key_char == '\177' || key_char == '\b') {
+            /*
+             * <DELETE>
+             */
+            if (icon_str_len > 0) {
+		icon_str_len--;
+		icon_str[icon_str_len] = '\0';
+	    }
+        }
+        else if (key_char == '\025') {
+            /*
+             * <CTRL-U>
+             */
+            if (icon_str_len > 0) {
+		icon_str_len = 0;
+		icon_str[0] = '\0';
+	    }
+        }
+        else if (key_char < IFontInfo->min_char_or_byte2 ||
+                 key_char > IFontInfo->max_char_or_byte2) {
+            /*
+             * Any other random (non-printable) key; ignore it.
+             */
+	    /* do nothing */ ;
+        }
+        else {
+            /*
+             * ASCII Alphanumerics.
+             */
+	    if (icon_str == NULL)
+	    	icon_str = (char *) malloc (icon_str_len + 2);
+	    else
+	    	icon_str = (char *)realloc(icon_str, (icon_str_len + 2));
+            if (icon_str == NULL) {
+                errno = ENOMEM;
+                Error("GetButton -> Realloc of window name string memory failed.");
+            }
+            icon_str[icon_str_len] = key_char;
+            icon_str[icon_str_len + 1] = '\0';
+            icon_str_len += 1;
+        }
+    }
+
+    /*
+     * Now that we have changed the size of the icon we have to reconfigure
+     * it so that everything looks good.  Oh yes, don't forget to move the
+     * mouse so that it stays in the window!
+     */
+
+    /*
+     * Set the window name to the new string.
+     */
+    XSetIconName(dpy, appl, ICONSTR);
+
+    /*
+     * Determine the new icon window configuration.
+     */
+    icon_h = IFontInfo->ascent + IFontInfo->descent + (VIconPad << 1);
+    icon_w = XTextWidth(IFontInfo, ICONSTR, strlen(ICONSTR)) + (HIconPad << 1);
+    if (icon_w == 0) {
+        icon_w = icon_h;
+    }
+
+    if (icon_x < 0) icon_x = 0;
+    if (icon_y < 0) icon_y = 0;
+    if (icon_x - 1 + icon_w + (IBorderWidth << 1) > ScreenWidth) {
+	icon_x = ScreenWidth - icon_w - (IBorderWidth << 1) + 1;
+    }
+    if (icon_y - 1 + icon_h + (IBorderWidth << 1) > ScreenHeight) {
+	icon_y = ScreenHeight - icon_h - (IBorderWidth << 1) + 1;
+    }
+
+    XMoveResizeWindow (dpy, icon, icon_x, icon_y, icon_w, icon_h);
+    XWarpPointer (dpy, None, icon, 0, 0, 0, 0, 
+    		  (icon_w - HIconPad), (icon_h >> 1));
+
+    /* 
+     * Free the local storage and return FALSE.
+     */
+    if (icon_str) free(icon_str);
+    return(FALSE);
+}
+
+int
+CheckMap(window)
+Window window;
+{
+    XSizeHints sizehints;
+    XWMHints *wmhints;
+    int winx, winy, winw, winh;
+    int x, y, w, h;
+    XWMHints *XGetWMHints();
+    Window transient_for;
+    bool configureit = False;
+    Window jW;
+    int border_width, j;
+
+    clear_x_errors();
+    /*
+     * Gather info about the event window.
+     */
+    XGetGeometry (dpy, window, &jW, &winx, &winy, &winw, &winh, 
+    		  &border_width, &j);
+    if (x_error_occurred) return;
+
+    /* if it's a transient window, we won't rubber-band
+     * note that this call always sets transient_for.
+     */
+    if (XGetTransientForHint( dpy, window, &transient_for )) {
+	x = winx; y = winy; w = winw; h = winh;
+    }
+    else {
+	bool usewindowgeom = True;
+	WindowInfo *wi;
+
+	if ((wmhints = XGetWMHints(dpy, window)) &&
+	    (wmhints->flags&StateHint) &&
+	    (wmhints->initial_state == IconicState)) {
+	    /* window will remain created size -- no rubberbanding */
+	    /* note that Iconify only uses its first argument */
+	    Iconify(window, 0, 0, 0, 0);
+	    if (wmhints) free ((char *) wmhints);
+	    return;
+	}
+	if (wmhints) free ((char *) wmhints);
+
+	wi = getWindowInfo (window);
+	sizehints.flags = 0; 
+        if (XGetSizeHints(dpy, window, &sizehints, XA_WM_NORMAL_HINTS)) {
+	    if (wi) {
+		if ((bcmp ((char *)&sizehints, (char *)&(wi->stashedhints),
+		    sizeof (XSizeHints)) != 0)) {
+		    wi->stashedhints = sizehints;
+		    usewindowgeom = False;
+	        }			     /* else hints haven't changed */
+	    } else {
+		usewindowgeom = False;
+	    }
+	}					/* else there are no hints */
+	CheckConsistency(&sizehints);
+
+	if (usewindowgeom) {
+	    sizehints.x = winx;
+	    sizehints.y = winy;
+	    sizehints.width = winw;
+	    sizehints.height = winh;
+	    if (wi && wi->been_mapped) {
+		sizehints.flags = (USPosition | USSize);
+	    }
+	}
+
+	AskUser(dpy, scr, window, &x, &y, &w, &h, &sizehints);
+	if (x != winx || y != winy || w != winw || h != winh)
+	  configureit = True;
+
+	if (wi) wi->been_mapped = True;
+
+    }
+
+    if (configureit)
+      XMoveResizeWindow(dpy, window, x, y, w, h);
+
+    XMapRaised(dpy, window);
+}
+
+int
+Configure(event)
+XConfigureRequestEvent *event;
+{
+  XWindowChanges values;
+  
+  values.x = event->x;
+  values.y = event->y;
+  values.width = event->width;
+  values.height = event->height;
+  values.border_width = event->border_width;
+  values.stack_mode = event->detail;
+  values.sibling = event->above;
+
+  XConfigureWindow(event->display, event->window, event->value_mask, &values);
+}
+
+int
+Circulate(event)
+XCirculateEvent *event;
+{
+  if (event->place == PlaceOnTop)
+   XRaiseWindow(event->display, event->window);
+  else
+   XLowerWindow(event->display, event->window);
+}
+
+int
+ProcessRequests(box, num_vectors)
+XSegment *box;
+int num_vectors;
+{
+	XEvent event;
+
+	XPeekEvent(dpy, &event);
+	switch (event.type) {
+
+	case MapRequest:
+	case ConfigureRequest:
+	case CirculateRequest:
+
+	    DrawBox();
+	    GetButton(&event);
+	    DrawBox();
+	    return TRUE;
+	}
+	return FALSE;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/GridBox.c	Sat Apr 13 18:19:26 2019 +0000
@@ -0,0 +1,165 @@
+#ifndef lint
+static char *rcsid_StoreGridBox_c = "$XConsortium: GridBox.c,v 1.4 88/09/06 17:28:06 jim Exp $";
+#endif	/* lint */
+
+/*
+ * Copyright 1985, 1986, 1987, 1988, 1989 by the
+ * Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  M.I.T. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ */
+
+/*
+ * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+ *
+ *                         All Rights Reserved
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Digital Equipment
+ * Corporation not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior permission.
+ *
+ *
+ * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+
+
+/*
+ * MODIFICATION HISTORY
+ *
+ * 000 -- M. Gancarz, DEC Ultrix Engineering Group
+ * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group,
+    Western Software Lab. Converted to X11.
+ */
+
+#ifndef lint
+static char *sccsid = "@(#)StoreGridBox.c	3.8	1/24/86";
+#endif
+/*
+ *	StoreGridBox - This subroutine is used by the X Window Manager (xwm)
+ *	to store the vertices for the movement resize grid and box in a
+ *	vertex list.
+ */
+
+#include "uwm.h"
+
+/*
+ * Store the vertices for the movement resize grid and box in a vertex list.
+ */
+int StoreGridBox(box, ulx, uly, lrx, lry)
+register XSegment box[];
+int ulx;			/* Upper left X coordinate. */
+int uly;			/* Upper left Y coordinate. */
+int lrx;			/* Lower right X coordinate. */
+int lry;			/* Lower right Y coordinate. */
+{
+    register int xthird, ythird;
+    int x1third, y1third;
+    int x2third, y2third;
+
+    /*
+     * Xor in.
+     */
+    box[0].x1 = ulx; box[0].y1 = uly;
+    box[0].x2 = lrx; box[0].y2 = uly;
+
+    box[1].x1 = lrx; box[1].y1 = uly;
+    box[1].x2 = lrx; box[1].y2 = lry;
+
+    box[2].x1 = lrx; box[2].y1 = lry;
+    box[2].x2 = ulx; box[2].y2 = lry;
+
+    box[3].x1 = ulx; box[3].y1 = lry;
+    box[3].x2 = ulx; box[3].y2 = uly;
+
+
+    /*
+     * These are the X and Y calculations for the parts of the grid that
+     * are dependent on the division by 3 calculations.
+     */
+
+    /*
+     * Y dimension third.
+     */
+    ythird = (lry - uly) / 3;
+    y1third = uly + ythird;
+    y2third = y1third + ythird;
+   
+    /*
+     * X dimension third.
+     */
+    xthird = (lrx - ulx) / 3;
+    x1third = ulx + xthird;
+    x2third = x1third + xthird;
+
+    box[4].x1 = x1third; box[4].y1 = lry;
+    box[4].x2 = x1third; box[4].y2 = uly;
+
+    box[5].x1 = x2third; box[5].y1 = lry;
+    box[5].x2 = x2third; box[5].y2 = uly;
+
+    box[6].x1 = ulx; box[6].y1 = y1third;
+    box[6].x2 = lrx; box[6].y2 = y1third;
+
+    box[7].x1 = ulx; box[7].y1 = y2third;
+    box[7].x2 = lrx; box[7].y2 = y2third;
+
+    /*
+     * Do not erase if we're freezing the screen.
+     */
+    if (Freeze)
+        return(8);
+
+    /*
+     * From here on we're retracing the segments to clear the
+     * grid using GXxor.
+     */
+    box[8].x1 = ulx; box[8].y1 = uly;
+    box[8].x2 = lrx; box[8].y2 = uly;
+
+    box[9].x1 = lrx; box[9].y1 = uly;
+    box[9].x2 = lrx; box[9].y2 = lry;
+
+    box[10].x1 = lrx; box[10].y1 = lry;
+    box[10].x2 = ulx; box[10].y2 = lry;
+
+    box[11].x1 = ulx; box[11].y1 = lry;
+    box[11].x2 = ulx; box[11].y2 = uly;
+
+    box[12].x1 = x1third; box[12].y1 = lry;
+    box[12].x2 = x1third; box[12].y2 = uly;
+
+    box[13].x1 = x2third; box[13].y1 = lry;
+    box[13].x2 = x2third; box[13].y2 = uly;
+
+    box[14].x1 = ulx; box[14].y1 = y1third;
+    box[14].x2 = lrx; box[14].y2 = y1third;
+
+    box[15].x1 = ulx; box[15].y1 = y2third;
+    box[15].x2 = lrx; box[15].y2 = y2third;
+
+
+    /*
+     * Total number of segments is 16.
+     */
+    return(16);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Iconify.c	Sat Apr 13 18:19:26 2019 +0000
@@ -0,0 +1,235 @@
+/* $XConsortium: Iconify.c,v 1.3 88/09/06 17:28:08 jim Exp $ */
+/*
+ * Copyright 1985, 1986, 1987, 1988, 1989 by the
+ * Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  M.I.T. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ */
+
+/*
+ * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+ *
+ *                         All Rights Reserved
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Digital Equipment
+ * Corporation not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior permission.
+ *
+ *
+ * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+
+ 
+/*
+ * MODIFICATION HISTORY
+ *
+ * 000 -- M. Gancarz, DEC Ultrix Engineering Group
+ * 001 -- R. Kittell, DEC Storage A/D May 20, 1986
+ *  Add optional warp of mouse to the upper right corner on de-iconify,
+ *  and to the icon center on iconify.
+ * 002 -- Loretta Guarino Reid, DEC Ultrix Engineering Group,
+ *  Western Software Lab. Port to X11.
+ */
+ 
+#ifndef lint
+static char *sccsid = "%W%	%G%";
+#endif
+ 
+#include "uwm.h"
+#include <stdbool.h>
+ 
+bool Iconify(window, mask, button, x, y)
+Window window;                          /* Event window. */
+int mask;                               /* Button/key mask. */
+int button;                             /* Button event detail. */
+int x, y;                               /* Event mouse position. */
+{
+    XWindowAttributes window_info;	/* Event window info. */
+    XWindowAttributes assoc_info;	/* Associated window info. */
+    int mse_x, mse_y;			/* Mouse X and Y coordinates. */
+    int sub_win_x, sub_win_y;		/* relative Mouse coordinates. */
+    int icon_x, icon_y;			/* Icon U. L. X and Y coordinates. */
+    int icon_w, icon_h;			/* Icon width and height. */
+    int icon_bdr;			/* Icon border width. */
+    int num_vectors;			/* Number of vectors in zap buffer. */
+    int mmask;				/* Mouse state */
+    Window root;			/* Mouse root window. */
+    Window assoc;			/* Associated window. */
+    Window sub_win;			/* Mouse position sub-window. */
+    XSegment zap[MAX_ZAP_VECTORS];	/* Zap effect vertex buffer. */
+    bool iconifying;			/* Are we iconifying? */
+ 
+    /*
+     * Do not try to iconify the root window.
+     */
+    if (window == RootWindow(dpy, scr))
+        return(FALSE);
+ 
+    /*
+     * Clear the vector buffer.
+     */
+    if (Zap) bzero(zap, sizeof(zap));
+ 
+    /*
+     * Get the mouse cursor position in case we must put a new
+     * icon there.
+     */
+    XQueryPointer(dpy, RootWindow(dpy, scr), &root, &sub_win, 
+    	&mse_x, &mse_y, &sub_win_x, &sub_win_y, &mmask);
+ 
+    /*
+     * Gather info about the window.
+     */
+    status = XGetWindowAttributes(dpy, window, &window_info);
+    if (status == FAILURE) return(FALSE);
+ 
+    /*
+     * If the event window is an icon, de-iconify it and return.
+     */
+    if (IsIcon(window, mse_x, mse_y, TRUE, &assoc)) {
+ 
+ 
+        /*
+         * Gather info about the assoc window.
+         */
+        status = XGetWindowAttributes(dpy, assoc, &assoc_info);
+        if (status == FAILURE) return(FALSE);
+ 
+        /*
+         * Store the zap vector buffer.
+         */
+        if (Zap) {
+                num_vectors = StoreZap(
+                    zap,
+                    assoc_info.x - 1,
+                    assoc_info.y - 1,
+                    assoc_info.x + assoc_info.width +
+                        (assoc_info.border_width << 1),
+                    assoc_info.y + assoc_info.height +
+                        (assoc_info.border_width << 1),
+                    window_info.x - 1,
+                    window_info.y - 1,
+                    window_info.x + window_info.width +
+                        (window_info.border_width << 1),
+                    window_info.y + window_info.height +
+                        (window_info.border_width << 1));
+        }
+ 
+        /*
+         * Map the window and synchronize.
+         */
+        XMapRaised(dpy, assoc);
+	XRemoveFromSaveSet(dpy, assoc);
+ 
+            if (Zap) {
+                /*
+                 * Draw the zap lines.
+                 */
+                DrawZap();
+            }
+ 
+        /*
+         * Unmap the icon window.
+         */
+        XUnmapWindow(dpy, window);
+ 
+	/*
+	 * Optionally warp the mouse to the upper right corner of the
+         *  window.
+         */
+        if (WarpOnDeIconify) {
+	    status = XGetWindowAttributes (dpy, assoc, &assoc_info);
+            if (status == FAILURE) return(FALSE);
+	    status = XWarpPointer (dpy, None, assoc, 
+	    			 0, 0, 0, 0,
+				 assoc_info.width >= 7 ?
+                                 assoc_info.width - 7 : assoc_info.width / 2,
+                                 assoc_info.height >= 10 ? 10 :
+                                 assoc_info.height / 2);
+            if (status == FAILURE) return(FALSE);
+	}
+    }
+    else {
+        /*
+         * We have an icon window; all we have to do is
+         * map it.
+         */
+        status = XGetWindowAttributes(dpy, assoc, &assoc_info);
+        if (status == FAILURE) return(FALSE);
+        icon_x = assoc_info.x;
+        icon_y = assoc_info.y;
+        icon_w = assoc_info.width;
+        icon_h = assoc_info.height;
+	icon_bdr = assoc_info.border_width;
+ 
+        if (Zap) {
+        /*
+         * Store the zap effect vectors.
+         */
+        num_vectors = StoreZap(
+            zap,
+            window_info.x - 1,
+            window_info.y - 1,
+            window_info.x + window_info.width + (window_info.border_width << 1),
+            window_info.y + window_info.height + (window_info.border_width << 1),
+            icon_x - 1,
+            icon_y - 1,
+            icon_x + icon_w + (icon_bdr << 1),
+            icon_y + icon_h + (icon_bdr << 1)
+        );
+        }
+ 
+        /*
+         * Map the icon window.
+         */
+        XMapWindow(dpy, assoc);
+ 
+        if (Zap) {
+        /*
+         * Draw zap lines from the window to its icon.
+         */
+            DrawZap();
+            DrawZap();
+        }
+ 
+        /*
+         * Unmap the event window.
+         */
+	XAddToSaveSet(dpy, window);
+        XUnmapWindow(dpy, window);
+ 
+	/*
+	 * Optionally warp the mouse to the icon center.
+         */
+        if (WarpOnIconify) {
+            status = XGetWindowAttributes(dpy, assoc, &assoc_info);
+            if (status == FAILURE) return(FALSE);
+	    status = XWarpPointer (dpy, None, assoc, 
+	    			 0, 0, 0, 0,
+				 assoc_info.width / 2, assoc_info.height / 2);
+            if (status == FAILURE) return(FALSE);
+	}
+ 
+    }
+    return(TRUE);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Icons.c	Sat Apr 13 18:19:26 2019 +0000
@@ -0,0 +1,341 @@
+/* $XConsortium: Icons.c,v 1.13 89/04/22 12:11:20 rws Exp $ */
+/*
+ * Copyright 1985, 1986, 1987, 1988, 1989 by the
+ * Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  M.I.T. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ */
+
+#include <stdlib.h>
+#include <stdbool.h>
+#include <stdio.h>
+
+/*
+ * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+ *
+ *                         All Rights Reserved
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Digital Equipment
+ * Corporation not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior permission.
+ *
+ *
+ * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+
+ 
+/*
+ * MODIFICATION HISTORY
+ *
+ * 000 -- L. Guarino Reid, DEC Ultrix Engineering Group
+ */
+ 
+#ifndef lint
+static char *sccsid = "%W%	%G%";
+#endif
+ 
+#include "uwm.h"
+#include <X11/Xatom.h>
+#ifdef SHAPE
+#include <X11/extensions/shape.h>
+#endif
+
+typedef struct _windowList {
+  struct _windowList *next;
+  Window window;
+  Window icon;
+  bool own;
+  Pixmap pixmap;
+} WindowListRec, *WindowList;
+  
+WindowList Icons = NULL;
+
+
+/* the client should pass us a bitmap (single-plane pixmap with background=0
+ * and foreground = 1).  It is our responsibility to convert it to a pixmap
+ * of the appropriate depth for a window tile and also color it with the
+ * appropriate background and foreground pixels.
+ *
+ * we'll use the (global) IconGC for the fore/background pixels.
+ */
+
+static Pixmap MakePixmapFromBitmap( bitmap, width_return, height_return )
+Pixmap bitmap;
+unsigned int *width_return, *height_return;
+{
+    Pixmap tile;
+    Window junkW;
+    int junk, width, height;
+
+    if (!XGetGeometry( dpy, bitmap, &junkW, &junk, &junk,
+		      &width, &height, &junk, &junk )) {
+        Warning( "client passed invalid pixmap for icon." );
+	return ( NULL );
+    }
+
+    tile = XCreatePixmap( dpy, RootWindow(dpy, scr), width, height,
+			  DefaultDepth(dpy, scr) );
+
+    /* use the IconGC's foreground & background, so we don't have to
+     * create another (and add yet another user configuration option.
+     * someday this may need to be split out.
+     */
+    XCopyPlane( dpy, bitmap, tile, IconGC, 0, 0, width, height, 0, 0, 1 );
+
+    if (width_return)  *width_return = width;
+    if (height_return) *height_return = height;
+
+    return( tile );
+}
+
+
+char *
+GetIconName(window)
+Window window;
+{
+    char *name;
+
+    if (XGetIconName( dpy, window, &name )) return( name );
+
+    if (XFetchName( dpy, window, &name )) return( name );
+
+    return( NULL );
+}
+
+bool IsIcon(icon, x, y, mousePositioned, assoc)
+Window icon;
+Window *assoc;
+{
+  WindowList ptr;
+  Window MakeIcon();
+
+  for (ptr = Icons; ptr; ptr = ptr->next) {
+    if (ptr->icon == icon) {
+      if (assoc) *assoc = ptr->window; 
+      return(TRUE);
+    }
+    if (ptr->window == icon) {
+      if (assoc) *assoc = ptr->icon; 
+      return(FALSE);
+    }
+  }
+  if (assoc) *assoc = MakeIcon(icon, x, y, mousePositioned);
+  return(FALSE);
+}
+
+
+RemoveIcon(window)
+Window window;
+{
+  WindowList ptr, ptr1;
+
+  for (ptr = Icons; ptr; ptr = ptr->next) 
+    if (ptr->window == window) {
+      if (ptr->own) {
+	  XDestroyWindow(dpy, ptr->icon);
+	  if (ptr->pixmap != IBackground) XFreePixmap(dpy, ptr->pixmap);
+      }
+      break;
+    }
+  if (ptr) {
+    if (ptr==Icons) Icons = Icons->next;
+    else 
+      for (ptr1 = Icons; ptr1->next; ptr1 = ptr1->next) 
+        if (ptr1->next == ptr) {
+          ptr1->next = ptr->next;
+	  break;
+        };
+    free(ptr);
+    }
+}
+
+GetDefaultSize(window, icon_w, icon_h)
+Window window;
+int *icon_w, *icon_h;
+{
+    char *name;				/* Event window name. */
+
+          /*
+           * Determine the size of the icon window.
+           */ 
+          name = GetIconName(window);
+          *icon_h = IFontInfo->ascent + IFontInfo->descent;
+          if (name) {
+	    *icon_w = XTextWidth(IFontInfo, name, strlen(name));
+            if (*icon_w == 0)
+              *icon_w = *icon_h;
+	  } else 
+	    *icon_w = *icon_h;
+     }
+
+Window MakeIcon(window, x, y, mousePositioned)
+Window window;                          /* associated window. */
+int x, y;                               /* Event mouse position. */
+bool mousePositioned;
+{
+    Window icon;			/* icon window. */
+    int icon_x, icon_y;			/* Icon U. L. X and Y coordinates. */
+    int icon_w, icon_h;			/* Icon width and height. */
+    int icon_bdr;			/* Icon border width. */
+    int mask;				/* Icon event mask */
+    int depth;				/* for XGetGeometry */
+    int dummy_event, dummy_error;       /* See XShapeQueryExtension() call. */
+    XSetWindowAttributes iconValues;	/* for icon window creation */
+    XWMHints *wmhints;			/* see if icon position provided */
+    XWMHints *XGetWMHints();
+    Window AddIcon();
+ 
+   iconValues.background_pixmap = IBackground;
+   mask = (KeyPressMask|ExposureMask|StructureNotifyMask);
+   /*
+    * Process window manager hints.
+    */ 
+    if (wmhints = XGetWMHints(dpy, window)) {
+      if (wmhints->flags&IconWindowHint) {
+	  Window iw = wmhints->icon_window;
+	  free ((char *) wmhints);
+          return (AddIcon(window, iw, FALSE, 
+	  	  (StructureNotifyMask), (Pixmap)NULL));
+      } else if (wmhints->flags&IconPixmapHint) { 
+          iconValues.background_pixmap =
+	      MakePixmapFromBitmap( wmhints->icon_pixmap, &icon_w, &icon_h );
+	  if (iconValues.background_pixmap)
+	      mask = (StructureNotifyMask);
+	  else {
+	      iconValues.background_pixmap = IBackground;
+	      wmhints->flags &= ~IconPixmapHint;
+	      GetDefaultSize(window, &icon_w, &icon_h);
+	  }
+      }
+      else GetDefaultSize(window, &icon_w, &icon_h);
+    }
+    else GetDefaultSize(window, &icon_w, &icon_h);
+
+     /*
+      * Fix up sizes by padding.
+      */ 
+    if (!wmhints || !(wmhints->flags&(IconPixmapHint|IconWindowHint))) {
+      icon_w += (HIconPad << 1);
+      icon_h += (VIconPad << 1);
+    }
+
+     /*
+      * Set the icon border attributes.
+      */ 
+    if (!wmhints || !(wmhints->flags&IconWindowHint)) {
+      icon_bdr = IBorderWidth;
+      iconValues.border_pixel = IBorder;
+    }
+ 
+    if (wmhints && (wmhints->flags&IconPositionHint)) {
+         icon_x = wmhints->icon_x;
+	 icon_y = wmhints->icon_y;
+    } else {
+      if (mousePositioned) {
+        /*
+         * Determine the coordinates of the icon window;
+         * normalize so that we don't lose the icon off the
+         * edge of the screen.
+         */
+        icon_x = x - (icon_w >> 1) + 1;
+        if (icon_x < 0) icon_x = 0;
+        icon_y = y - (icon_h >> 1) + 1;
+        if (icon_y < 0) icon_y = 0;
+        if ((icon_x - 1 + icon_w + (icon_bdr << 1)) > ScreenWidth) {
+           icon_x = ScreenWidth - icon_w - (icon_bdr << 1) + 1;
+        }
+        if ((icon_y - 1 + icon_h + (icon_bdr << 1)) > ScreenHeight) {
+           icon_y = ScreenHeight - icon_h - (icon_bdr << 1) + 1;
+        }
+      }
+      else {
+        icon_x = x + (icon_w >> 1);
+        icon_y = y + (icon_h >> 1);
+      }
+        
+    }
+
+   /*
+    * Create the icon window.
+    */
+   icon = XCreateWindow(
+                dpy, RootWindow(dpy, scr),
+                icon_x, icon_y,
+                icon_w, icon_h,
+                icon_bdr, 0, CopyFromParent, CopyFromParent,
+		CWBorderPixel+CWBackPixmap, &iconValues);
+
+#ifdef SHAPE
+   if (iconValues.background_pixmap != IBackground
+       && (wmhints->flags & IconMaskHint)
+#if 0
+       && XShapeQueryExtension(dpy)
+#else           
+       && XShapeQueryExtension(dpy, &dummy_event, &dummy_error)
+#endif
+           ){
+           XSetWindowBorderWidth(dpy, icon, 0);
+           XShapeCombineMask(dpy, icon, ShapeBounding, 0, 0, wmhints->icon_mask,
+                             ShapeSet);
+   }
+#endif
+
+   if (wmhints) free ((char *) wmhints);
+
+   return(AddIcon(window, icon, TRUE, mask, iconValues.background_pixmap));
+ 
+}
+
+Window AddIcon(window, icon, own, mask, background)
+Window window, icon;
+bool own;
+int mask;
+Pixmap background;
+{
+  WindowList ptr;
+
+   if (icon == NULL) return(NULL);
+   /*
+    * Use the text cursor whenever the mouse is in the icon window.
+    */
+   XDefineCursor(dpy, icon, TextCursor);
+    
+   /*
+    * Select "key pressed", "window exposure" and "unmap window"
+    * events for the icon window.
+    */
+   uwmExpressInterest (icon, mask);
+    
+    /*
+     * Set the event window's icon window to be the new icon window.
+     */
+    ptr = (WindowList) malloc(sizeof(WindowListRec));
+    ptr->window = window;
+    ptr->icon = icon;
+    ptr->own = own;
+    ptr->pixmap = background;
+    ptr->next = Icons;
+    Icons = ptr;
+
+    return(icon);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Kill.c	Sat Apr 13 18:19:26 2019 +0000
@@ -0,0 +1,35 @@
+/* $XConsortium: Kill.c,v 1.2 88/09/06 17:28:26 jim Exp $ */
+
+/*
+ * Copyright 1985, 1986, 1987, 1988, 1989 by the
+ * Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  M.I.T. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ */
+#include "uwm.h"
+#include <stdbool.h>
+
+bool
+Kill(window, mask, button, x, y)
+Window window;                          /* Event window. */
+int mask;                               /* Button/key mask. */
+int button;                             /* Button event detail. */
+int x, y;                               /* Event mouse position. */
+{
+	Window *assoc;
+
+	if (IsIcon(window, x, y, TRUE, &assoc))
+		XKillClient(dpy, assoc);
+	else
+		XKillClient(dpy, window);
+	return FALSE ;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Lower.c	Sat Apr 13 18:19:26 2019 +0000
@@ -0,0 +1,71 @@
+#ifndef lint
+static char *rcsid_Lower_c = "$XConsortium: Lower.c,v 1.4 88/09/06 17:28:13 jim Exp $";
+#endif	/* lint */
+
+/*
+ * Copyright 1985, 1986, 1987, 1988, 1989 by the
+ * Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  M.I.T. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ */
+
+/*
+ * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+ *
+ *                         All Rights Reserved
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Digital Equipment
+ * Corporation not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior permission.
+ *
+ *
+ * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+/*
+ * MODIFICATION HISTORY
+ *
+ * 000 -- M. Gancarz, DEC Ultrix Engineering Group
+ * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group,
+    Western Software Lab. Convert to X11.
+ */
+
+#ifndef lint
+static char *sccsid = "@(#)Lower.c	3.8	1/24/86";
+#endif
+
+#include "uwm.h"
+#include <stdbool.h>
+
+bool Lower(window, mask, button, x, y)
+Window window;				/* Event window. */
+int mask;				/* Button/key mask. */
+int button;				/* Button event detail. */
+int x, y;				/* Event mouse position. */
+{
+    /*
+     * If the window is not the root window, lower the window and return.
+     */
+    if (window != RootWindow(dpy, scr))
+        XLowerWindow(dpy, window);
+    return(FALSE);
+}
--- a/Makefile	Mon Sep 17 20:51:55 2018 +0000
+++ b/Makefile	Sat Apr 13 18:19:26 2019 +0000
@@ -29,299 +29,28 @@
 
 # site:  $XConsortium: site.def,v 1.21 89/12/06 11:46:50 jim Exp $
 
-            SHELL = /bin/sh
-
-              TOP = .
-      CURRENT_DIR = .
-
-               AR = ar cq
-  BOOTSTRAPCFLAGS =
-               CC = gcc
-
-         COMPRESS = compress
-              CPP = /lib/cpp $(STD_CPP_DEFINES)
-    PREPROCESSCMD = gcc -E $(STD_CPP_DEFINES)
-          INSTALL = install
-               LD = ld
-             LINT = \:
-      LINTLIBFLAG = -o
-         LINTOPTS = -ax
-               LN = ln -s
-             MAKE = make
-               MV = mv
-               CP = cp
-           RANLIB = /bin/true
-  RANLIBINSTFLAGS =
-               RM = rm -f
-     STD_INCLUDES =
-  STD_CPP_DEFINES = -DSUNSYSV -DSYSV -DUSE_USG_PTYS -DSOLARIS
-      STD_DEFINES = -DSUNSYSV -DSYSV -DUSE_USG_PTYS -DSOLARIS
- EXTRA_LOAD_FLAGS =
-#  EXTRA_LIBRARIES = -lsocket /usr/athena/lib/libresolv.a -lnsl -lc /usr/ucblib/libucb.a -lelf -ldl
-  EXTRA_LIBRARIES = -lnsl -lc -ldl
-             TAGS = ctags
-
-           MFLAGS = -$(MAKEFLAGS)
-
-    PROTO_DEFINES =
-
-     INSTPGMFLAGS =  -s
-
-     INSTSCRFLAGS =
-     INSTBINFLAGS = -m 0755
-     INSTUIDFLAGS = -o root -m 4755
-     INSTLIBFLAGS = -m 0664
-     INSTINCFLAGS = -m 0444
-     INSTMANFLAGS = -m 0444
-     INSTDATFLAGS = -m 0444
-    INSTKMEMFLAGS = -g kmem -m 2755
-
-          DESTDIR =
-
-     TOP_INCLUDES = -I$(INCROOT)
-
-      CDEBUGFLAGS = -O
-        CCOPTIONS =
-      COMPATFLAGS =
-         PICFLAGS = -pic
-
-      ALLINCLUDES = $(STD_INCLUDES) $(TOP_INCLUDES) $(INCLUDES) $(EXTRA_INCLUDES)
-       ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(PROTO_DEFINES) $(DEFINES) $(COMPATFLAGS)
-           CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(ALLDEFINES)
-           CFLAGS += -Wall -g -ansi -pedantic
-        LINTFLAGS = $(LINTOPTS) -DLINT $(ALLDEFINES)
-
-           LDLIBS = $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
-
-        LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS) -L$(USRLIBDIR)
-        LDOPTIONS += `pkg-config --libs x11 xft xrandr fontconfig`
-
-   LDCOMBINEFLAGS = -X -r
-
-        MACROFILE = sun.cf
-           RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut
-
-    IMAKE_DEFINES =
-
-         "/mit/yandros/lib/X11/config" = $(CONFIGDIR)
-        IMAKE_CMD = $(IMAKE) -DUseInstalled -I$("/mit/yandros/lib/X11/config") $(IMAKE_DEFINES)
-
-     ICONFIGFILES = $("/mit/yandros/lib/X11/config")/Imake.tmpl $("/mit/yandros/lib/X11/config")/Imake.rules \
-			$("/mit/yandros/lib/X11/config")/Project.tmpl $("/mit/yandros/lib/X11/config")/site.def \
-			$("/mit/yandros/lib/X11/config")/$(MACROFILE) $(EXTRA_ICONFIGFILES)
-
-###########################################################################
-# X Window System Build Parameters
-# $XConsortium: Project.tmpl,v 1.68 90/07/03 12:14:47 rws Exp $
-
-###########################################################################
-# X Window System make variables; this need to be coordinated with rules
-# $XConsortium: Project.tmpl,v 1.68 90/07/03 12:14:47 rws Exp $
-
-          PATHSEP = /
-        USRLIBDIR = $(DESTDIR)/usr/athena/lib
-           BINDIR = $(DESTDIR)/usr/athena/bin
-          INCROOT = $(DESTDIR)/usr/athena/include
-     BUILDINCROOT = $(TOP)
-      BUILDINCDIR = $(BUILDINCROOT)/X11
-      BUILDINCTOP = ..
-           INCDIR = $(INCROOT)/X11
-           ADMDIR = $(DESTDIR)/usr/adm
-           LIBDIR = $(DESTDIR)/usr/athena/lib/X11
-        CONFIGDIR = "/mit/yandros/lib/X11/config"
-       LINTLIBDIR = $(USRLIBDIR)/lint
-
-          FONTDIR = $(LIBDIR)/fonts
-         XINITDIR = $(LIBDIR)/xinit
-           XDMDIR = $(LIBDIR)/xdm
-           AWMDIR = $(LIBDIR)/awm
-           TWMDIR = $(LIBDIR)/twm
-           GWMDIR = $(LIBDIR)/gwm
-          MANPATH = $(DESTDIR)/usr/athena/man
-    MANSOURCEPATH = $(MANPATH)/man
-           MANDIR = $(MANSOURCEPATH)1
-        LIBMANDIR = $(MANSOURCEPATH)3
-      XAPPLOADDIR = $(LIBDIR)/app-defaults
-
-       FONTCFLAGS = -t
-
-     INSTAPPFLAGS = $(INSTDATFLAGS)
-
-            IMAKE = imake
-           DEPEND = makedepend
-              RGB = rgb
-            FONTC = bdftosnf
-        MKFONTDIR = mkfontdir
-        MKDIRHIER = /bin/sh $(BINDIR)/mkdirhier
+PROG=		uwm
+SRCS=		globals.c Beep.c Bindings.c CircleDown.c CircleUp.c\
+		Cursors.c Focus.c GetButton.c  GridBox.c Iconify.c\
+		Icons.c Kill.c Lower.c\
+		Menu.c Move.c MoveOpaque.c NewIconify.c Pause.c\
+		Push.c Error.c\
+		Raise.c Refresh.c Resize.c Restart.c RubberBand.c\
+		StoreBox.c \
+		StoreZap.c XError.c uwm.c colormap.c windowinfo.c
+CPPFLAGS+=	-I. -I${.CURDIR} -I/usr/X11R7/include
+YHEADER=
+LDADD+=		-lX11
+DPADD+=		${LIBL}
+# OBJS=		gram.o lex.o globals.o Beep.o Bindings.o\
+# 		CircleDown.o CircleUp.o\
+# 		Cursors.o Focus.o GetButton.o GridBox.o Iconify.o\
+# 		Icons.o Kill.o \
+# 		Lower.o\
+# 		Menu.o Move.o MoveOpaque.o NewIconify.o Pause.o\
+# 		Push.o Error.o\
+# 		Raise.o Refresh.o Resize.o Restart.o RubberBand.o\
+# 		StoreBox.o \
+# 		StoreZap.o XError.o uwm.o colormap.o windowinfo.o
 
-        CONFIGSRC = /mit/yandros/lib/X11/config
-        CLIENTSRC = $(TOP)/clients
-          DEMOSRC = $(TOP)/demos
-           LIBSRC = $(TOP)/lib
-          FONTSRC = $(TOP)/fonts
-       INCLUDESRC = $(TOP)/X11
-        SERVERSRC = $(TOP)/server
-          UTILSRC = $(TOP)/util
-        SCRIPTSRC = $(UTILSRC)/scripts
-       EXAMPLESRC = $(TOP)/examples
-       CONTRIBSRC = $(TOP)/../contrib
-           DOCSRC = $(TOP)/doc
-           RGBSRC = $(TOP)/rgb
-        DEPENDSRC = $(UTILSRC)/makedepend
-         IMAKESRC = $(CONFIGSRC)
-         XAUTHSRC = $(LIBSRC)/Xau
-          XLIBSRC = $(LIBSRC)/X
-           XMUSRC = $(LIBSRC)/Xmu
-       TOOLKITSRC = $(LIBSRC)/Xt
-       AWIDGETSRC = $(LIBSRC)/Xaw
-       OLDXLIBSRC = $(LIBSRC)/oldX
-      XDMCPLIBSRC = $(LIBSRC)/Xdmcp
-      BDFTOSNFSRC = $(FONTSRC)/bdftosnf
-     MKFONTDIRSRC = $(FONTSRC)/mkfontdir
-     EXTENSIONSRC = $(TOP)/extensions
-
-  DEPEXTENSIONLIB = $(USRLIBDIR)/libXext.a
-     EXTENSIONLIB =  -lXext
-
-          DEPXLIB = $(DEPEXTENSIONLIB) $(USRLIBDIR)/libX11.a
-             XLIB = $(EXTENSIONLIB)  -lX11
-
-      DEPXAUTHLIB = $(USRLIBDIR)/libXau.a
-         XAUTHLIB =  -lXau
-
-        DEPXMULIB = $(USRLIBDIR)/libXmu.a
-           XMULIB =  -lXmu
-
-       DEPOLDXLIB = $(USRLIBDIR)/liboldX.a
-          OLDXLIB =  -loldX
-
-      DEPXTOOLLIB = $(USRLIBDIR)/libXt.a
-         XTOOLLIB =  -lXt
-
-        DEPXAWLIB = $(USRLIBDIR)/libXaw.a
-           XAWLIB =  -lXaw
-
- LINTEXTENSIONLIB = $(LINTLIBDIR)/llib-lXext.ln
-         LINTXLIB = $(LINTLIBDIR)/llib-lX11.ln
-          LINTXMU = $(LINTLIBDIR)/llib-lXmu.ln
-        LINTXTOOL = $(LINTLIBDIR)/llib-lXt.ln
-          LINTXAW = $(LINTLIBDIR)/llib-lXaw.ln
-
-#          DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
-	  DEPLIBS = #
-
-         DEPLIBS1 = $(DEPLIBS)
-         DEPLIBS2 = $(DEPLIBS)
-         DEPLIBS3 = $(DEPLIBS)
-
-###########################################################################
-# Imake rules for building libraries, programs, scripts, and data files
-# rules:  $XConsortium: Imake.rules,v 1.70 90/05/04 16:57:30 keith Exp $
-
-###########################################################################
-# start of Imakefile
-
-        DEFINES = -DSYSFILE=\"$(UWMDIR)$(PATHSEP)system.uwmrc\" -DSHAPE
-LOCAL_LIBRARIES = $(EXTENSIONLIB) $(XLIB)
-#  SYS_LIBRARIES = -ll
-  SYS_LIBRARIES = -lfl
-      OTHERSRCS = src/gram.y src/lex.l
-         YFLAGS = -d
-
-SRCS=	src/globals.c src/Beep.c src/Bindings.c src/CircleDown.c src/CircleUp.c\
-	src/Cursors.c src/Focus.c src/GetButton.c  src/GridBox.c src/Iconify.c\
-	src/Icons.c src/Kill.c src/Lower.c\
-	src/Menu.c src/Move.c src/MoveOpaque.c src/NewIconify.c src/Pause.c\
-	src/Push.c src/Error.c\
-	src/Raise.c src/Refresh.c src/Resize.c src/Restart.c src/RubberBand.c\
-	src/StoreBox.c \
-	src/StoreZap.c src/XError.c src/uwm.c src/colormap.c src/windowinfo.c
-
-OBJS=	src/gram.o src/lex.o src/globals.o src/Beep.o src/Bindings.o\
-	src/CircleDown.o src/CircleUp.o\
-	src/Cursors.o src/Focus.o src/GetButton.o src/GridBox.o src/Iconify.o\
-	src/Icons.o src/Kill.o \
-	src/Lower.o\
-	src/Menu.o src/Move.o src/MoveOpaque.o src/NewIconify.o src/Pause.o\
-	src/Push.o src/Error.o\
-	src/Raise.o src/Refresh.o src/Resize.o src/Restart.o src/RubberBand.o\
-	src/StoreBox.o \
-	src/StoreZap.o src/XError.o src/uwm.o src/colormap.o src/windowinfo.o
-
- PROGRAM = uwm
-
-all:: uwm
-
-uwm: $(OBJS) $(DEPLIBS)
-	$(RM) $@
-	$(CC) -o $@ $(OBJS) $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS)
-
-saber_uwm:
-	#load $(ALLDEFINES) $(SRCS) -L$(USRLIBDIR) $(LOCAL_LIBRARIES) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
-
-osaber_uwm:
-	#load $(ALLDEFINES) $(OBJS) -L$(USRLIBDIR) $(LOCAL_LIBRARIES) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
-
-install:: uwm
-	$(INSTALL) -c $(INSTPGMFLAGS)   uwm $(BINDIR)
-
-install.man:: uwm.man
-	$(INSTALL) -c $(INSTMANFLAGS) uwm.man $(MANDIR)/uwm.1
-
-depend::
-	$(DEPEND) -s "# DO NOT DELETE" -- $(ALLDEFINES) -- $(SRCS)
-
-lint:
-	$(LINT) $(LINTFLAGS) $(SRCS) $(LINTLIBS)
-lint1:
-	$(LINT) $(LINTFLAGS) $(FILE) $(LINTLIBS)
-
-clean::
-	$(RM) $(PROGRAM)
-
-clean::
-	$(RM) src/y.tab.h src/y.tab.c src/lex.yy.c
-
-gram.o: src/uwm.h
-
-###########################################################################
-# common rules for all Makefiles - do not edit
-
-emptyrule::
-
-clean::
-	$(RM_CMD) \#*
-
-Makefile::
-	-@if [ -f Makefile ]; then \
-	echo "	$(RM) Makefile.bak; $(MV) Makefile Makefile.bak"; \
-	$(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \
-	else exit 0; fi
-	$(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR)
-
-tags::
-	$(TAGS) -w *.[ch]
-	$(TAGS) -xw *.[ch] > TAGS
-
-saber:
-	#load $(ALLDEFINES) $(SRCS)
-
-osaber:
-	#load $(ALLDEFINES) $(OBJS)
-
-###########################################################################
-# empty rules for directories that do not have SUBDIRS - do not edit
-
-install::
-	@echo "install in $(CURRENT_DIR) done"
-
-install.man::
-	@echo "install.man in $(CURRENT_DIR) done"
-
-Makefiles::
-
-includes::
-
-###########################################################################
-# dependencies generated by makedepend
-
+.include <bsd.prog.mk>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Makefile.old	Sat Apr 13 18:19:26 2019 +0000
@@ -0,0 +1,328 @@
+# Makefile generated by imake - do not edit!
+# $XConsortium: imake.c,v 1.86 93/10/11 12:12:36 rws Exp $
+
+###########################################################################
+# Makefile generated from "Imake.tmpl" and <Imakefile>
+# $XConsortium: Imake.tmpl,v 1.77 89/12/18 17:01:37 jim Exp $
+#
+# Platform-specific parameters may be set in the appropriate .cf
+# configuration files.  Site-wide parameters may be set in the file
+# site.def.  Full rebuilds are recommended if any parameters are changed.
+#
+# If your C preprocessor doesn't define any unique symbols, you'll need
+# to set BOOTSTRAPCFLAGS when rebuilding imake (usually when doing
+# "make Makefile", "make Makefiles", or "make World").
+#
+# If you absolutely can't get imake to work, you'll need to set the
+# variables at the top of each Makefile as well as the dependencies at the
+# bottom (makedepend will do this automatically).
+#
+
+###########################################################################
+# platform-specific configuration parameters - edit sun.cf to change
+
+# platform:  $XConsortium: sun.cf,v 1.38 89/12/23 16:10:10 jim Exp $
+# operating system:  SunOS 5.1
+
+###########################################################################
+# site-specific configuration parameters - edit site.def to change
+
+# site:  $XConsortium: site.def,v 1.21 89/12/06 11:46:50 jim Exp $
+
+            SHELL = /bin/sh
+
+              TOP = .
+      CURRENT_DIR = .
+
+               AR = ar cq
+  BOOTSTRAPCFLAGS =
+               CC ?= ${CC:cc}
+
+         COMPRESS = compress
+              CPP = /lib/cpp $(STD_CPP_DEFINES)
+    PREPROCESSCMD = gcc -E $(STD_CPP_DEFINES)
+          INSTALL = install
+               LD = ld
+             LINT = \:
+      LINTLIBFLAG = -o
+         LINTOPTS = -ax
+               LN = ln -s
+             MAKE = make
+               MV = mv
+               CP = cp
+           RANLIB = /bin/true
+  RANLIBINSTFLAGS =
+               RM = rm -f
+     STD_INCLUDES =
+  STD_CPP_DEFINES = -DSUNSYSV -DSYSV -DUSE_USG_PTYS -DSOLARIS
+      STD_DEFINES = -DSUNSYSV -DSYSV -DUSE_USG_PTYS -DSOLARIS
+ EXTRA_LOAD_FLAGS =
+#  EXTRA_LIBRARIES = -lsocket /usr/athena/lib/libresolv.a -lnsl -lc /usr/ucblib/libucb.a -lelf -ldl
+  EXTRA_LIBRARIES = -lnsl -lc -ldl
+             TAGS = ctags
+
+           MFLAGS = -$(MAKEFLAGS)
+
+    PROTO_DEFINES =
+
+     INSTPGMFLAGS =  -s
+
+     INSTSCRFLAGS =
+     INSTBINFLAGS = -m 0755
+     INSTUIDFLAGS = -o root -m 4755
+     INSTLIBFLAGS = -m 0664
+     INSTINCFLAGS = -m 0444
+     INSTMANFLAGS = -m 0444
+     INSTDATFLAGS = -m 0444
+    INSTKMEMFLAGS = -g kmem -m 2755
+
+          DESTDIR =
+
+     TOP_INCLUDES = -I$(INCROOT)
+
+      CDEBUGFLAGS = -O
+        CCOPTIONS =
+      COMPATFLAGS =
+         PICFLAGS = -pic
+
+      ALLINCLUDES = $(STD_INCLUDES) $(TOP_INCLUDES) $(INCLUDES) $(EXTRA_INCLUDES)
+       ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(PROTO_DEFINES) $(DEFINES) $(COMPATFLAGS)
+           CFLAGS = $(CDEBUGFLAGS) $(CCOPTIONS) $(ALLDEFINES)
+           CFLAGS += -Wall -g -ansi -pedantic
+        LINTFLAGS = $(LINTOPTS) -DLINT $(ALLDEFINES)
+
+           LDLIBS = $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
+
+        LDOPTIONS = $(CDEBUGFLAGS) $(CCOPTIONS) -L$(USRLIBDIR)
+        LDOPTIONS += `pkg-config --libs x11 xft xrandr fontconfig`
+
+   LDCOMBINEFLAGS = -X -r
+
+        MACROFILE = sun.cf
+           RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a .emacs_* tags TAGS make.log MakeOut
+
+    IMAKE_DEFINES =
+
+         "/mit/yandros/lib/X11/config" = $(CONFIGDIR)
+        IMAKE_CMD = $(IMAKE) -DUseInstalled -I$("/mit/yandros/lib/X11/config") $(IMAKE_DEFINES)
+
+     ICONFIGFILES = $("/mit/yandros/lib/X11/config")/Imake.tmpl $("/mit/yandros/lib/X11/config")/Imake.rules \
+			$("/mit/yandros/lib/X11/config")/Project.tmpl $("/mit/yandros/lib/X11/config")/site.def \
+			$("/mit/yandros/lib/X11/config")/$(MACROFILE) $(EXTRA_ICONFIGFILES)
+
+###########################################################################
+# X Window System Build Parameters
+# $XConsortium: Project.tmpl,v 1.68 90/07/03 12:14:47 rws Exp $
+
+###########################################################################
+# X Window System make variables; this need to be coordinated with rules
+# $XConsortium: Project.tmpl,v 1.68 90/07/03 12:14:47 rws Exp $
+
+          PATHSEP = /
+        USRLIBDIR = $(DESTDIR)/usr/athena/lib
+           BINDIR = $(DESTDIR)/usr/athena/bin
+          INCROOT = $(DESTDIR)/usr/athena/include
+     BUILDINCROOT = $(TOP)
+      BUILDINCDIR = $(BUILDINCROOT)/X11
+      BUILDINCTOP = ..
+           INCDIR = $(INCROOT)/X11
+           ADMDIR = $(DESTDIR)/usr/adm
+           LIBDIR = $(DESTDIR)/usr/athena/lib/X11
+        CONFIGDIR = "/mit/yandros/lib/X11/config"
+       LINTLIBDIR = $(USRLIBDIR)/lint
+
+          FONTDIR = $(LIBDIR)/fonts
+         XINITDIR = $(LIBDIR)/xinit
+           XDMDIR = $(LIBDIR)/xdm
+           AWMDIR = $(LIBDIR)/awm
+           TWMDIR = $(LIBDIR)/twm
+           GWMDIR = $(LIBDIR)/gwm
+          MANPATH = $(DESTDIR)/usr/athena/man
+    MANSOURCEPATH = $(MANPATH)/man
+           MANDIR = $(MANSOURCEPATH)1
+        LIBMANDIR = $(MANSOURCEPATH)3
+      XAPPLOADDIR = $(LIBDIR)/app-defaults
+
+       FONTCFLAGS = -t
+
+     INSTAPPFLAGS = $(INSTDATFLAGS)
+
+            IMAKE = imake
+           DEPEND = makedepend
+              RGB = rgb
+            FONTC = bdftosnf
+        MKFONTDIR = mkfontdir
+        MKDIRHIER = /bin/sh $(BINDIR)/mkdirhier
+
+        CONFIGSRC = /mit/yandros/lib/X11/config
+        CLIENTSRC = $(TOP)/clients
+          DEMOSRC = $(TOP)/demos
+           LIBSRC = $(TOP)/lib
+          FONTSRC = $(TOP)/fonts
+       INCLUDESRC = $(TOP)/X11
+        SERVERSRC = $(TOP)/server
+          UTILSRC = $(TOP)/util
+        SCRIPTSRC = $(UTILSRC)/scripts
+       EXAMPLESRC = $(TOP)/examples
+       CONTRIBSRC = $(TOP)/../contrib
+           DOCSRC = $(TOP)/doc
+           RGBSRC = $(TOP)/rgb
+        DEPENDSRC = $(UTILSRC)/makedepend
+         IMAKESRC = $(CONFIGSRC)
+         XAUTHSRC = $(LIBSRC)/Xau
+          XLIBSRC = $(LIBSRC)/X
+           XMUSRC = $(LIBSRC)/Xmu
+       TOOLKITSRC = $(LIBSRC)/Xt
+       AWIDGETSRC = $(LIBSRC)/Xaw
+       OLDXLIBSRC = $(LIBSRC)/oldX
+      XDMCPLIBSRC = $(LIBSRC)/Xdmcp
+      BDFTOSNFSRC = $(FONTSRC)/bdftosnf
+     MKFONTDIRSRC = $(FONTSRC)/mkfontdir
+     EXTENSIONSRC = $(TOP)/extensions
+
+  DEPEXTENSIONLIB = $(USRLIBDIR)/libXext.a
+     EXTENSIONLIB =  -lXext
+
+          DEPXLIB = $(DEPEXTENSIONLIB) $(USRLIBDIR)/libX11.a
+             XLIB = $(EXTENSIONLIB)  -lX11
+
+      DEPXAUTHLIB = $(USRLIBDIR)/libXau.a
+         XAUTHLIB =  -lXau
+
+        DEPXMULIB = $(USRLIBDIR)/libXmu.a
+           XMULIB =  -lXmu
+
+       DEPOLDXLIB = $(USRLIBDIR)/liboldX.a
+          OLDXLIB =  -loldX
+
+      DEPXTOOLLIB = $(USRLIBDIR)/libXt.a
+         XTOOLLIB =  -lXt
+
+        DEPXAWLIB = $(USRLIBDIR)/libXaw.a
+           XAWLIB =  -lXaw
+
+ LINTEXTENSIONLIB = $(LINTLIBDIR)/llib-lXext.ln
+         LINTXLIB = $(LINTLIBDIR)/llib-lX11.ln
+          LINTXMU = $(LINTLIBDIR)/llib-lXmu.ln
+        LINTXTOOL = $(LINTLIBDIR)/llib-lXt.ln
+          LINTXAW = $(LINTLIBDIR)/llib-lXaw.ln
+
+#          DEPLIBS = $(DEPXAWLIB) $(DEPXMULIB) $(DEPXTOOLLIB) $(DEPXLIB)
+#	  DEPLIBS = #
+
+         DEPLIBS1 = $(DEPLIBS)
+         DEPLIBS2 = $(DEPLIBS)
+         DEPLIBS3 = $(DEPLIBS)
+
+###########################################################################
+# Imake rules for building libraries, programs, scripts, and data files
+# rules:  $XConsortium: Imake.rules,v 1.70 90/05/04 16:57:30 keith Exp $
+
+###########################################################################
+# start of Imakefile
+
+        DEFINES = -DSYSFILE=\"$(UWMDIR)$(PATHSEP)system.uwmrc\" -DSHAPE
+LOCAL_LIBRARIES = $(EXTENSIONLIB) $(XLIB)
+#  SYS_LIBRARIES = -ll
+  SYS_LIBRARIES = -lfl
+      OTHERSRCS = gram.y lex.l
+         YFLAGS = -d
+
+SRCS=	globals.c Beep.c Bindings.c CircleDown.c CircleUp.c\
+	Cursors.c Focus.c GetButton.c  GridBox.c Iconify.c\
+	Icons.c Kill.c Lower.c\
+	Menu.c Move.c MoveOpaque.c NewIconify.c Pause.c\
+	Push.c Error.c\
+	Raise.c Refresh.c Resize.c Restart.c RubberBand.c\
+	StoreBox.c \
+	StoreZap.c XError.c uwm.c colormap.c windowinfo.c
+
+OBJS=	gram.o lex.o globals.o Beep.o Bindings.o\
+	CircleDown.o CircleUp.o\
+	Cursors.o Focus.o GetButton.o GridBox.o Iconify.o\
+	Icons.o Kill.o \
+	Lower.o\
+	Menu.o Move.o MoveOpaque.o NewIconify.o Pause.o\
+	Push.o Error.o\
+	Raise.o Refresh.o Resize.o Restart.o RubberBand.o\
+	StoreBox.o \
+	StoreZap.o XError.o uwm.o colormap.o windowinfo.o
+
+PROG=	uwm
+.include <bsd.prog.mk>
+
+all:: uwm
+
+uwm: $(OBJS) $(DEPLIBS)
+	$(RM) $@
+	$(CC) -o $@ $(OBJS) $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS)
+
+saber_uwm:
+	#load $(ALLDEFINES) $(SRCS) -L$(USRLIBDIR) $(LOCAL_LIBRARIES) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
+
+osaber_uwm:
+	#load $(ALLDEFINES) $(OBJS) -L$(USRLIBDIR) $(LOCAL_LIBRARIES) $(SYS_LIBRARIES) $(EXTRA_LIBRARIES)
+
+install:: uwm
+	$(INSTALL) -c $(INSTPGMFLAGS)   uwm $(BINDIR)
+
+install.man:: uwm.man
+	$(INSTALL) -c $(INSTMANFLAGS) uwm.man $(MANDIR)/uwm.1
+
+depend::
+	$(DEPEND) -s "# DO NOT DELETE" -- $(ALLDEFINES) -- $(SRCS)
+
+lint:
+	$(LINT) $(LINTFLAGS) $(SRCS) $(LINTLIBS)
+lint1:
+	$(LINT) $(LINTFLAGS) $(FILE) $(LINTLIBS)
+
+clean::
+	$(RM) $(PROG)
+
+clean::
+	$(RM) y.tab.h y.tab.c lex.yy.c
+
+gram.o: uwm.h
+
+###########################################################################
+# common rules for all Makefiles - do not edit
+
+emptyrule::
+
+clean::
+	$(RM_CMD) \#*
+
+Makefile::
+	-@if [ -f Makefile ]; then \
+	echo "	$(RM) Makefile.bak; $(MV) Makefile Makefile.bak"; \
+	$(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \
+	else exit 0; fi
+	$(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR)
+
+tags::
+	$(TAGS) -w *.[ch]
+	$(TAGS) -xw *.[ch] > TAGS
+
+saber:
+	#load $(ALLDEFINES) $(SRCS)
+
+osaber:
+	#load $(ALLDEFINES) $(OBJS)
+
+###########################################################################
+# empty rules for directories that do not have SUBDIRS - do not edit
+
+install::
+	@echo "install in $(CURRENT_DIR) done"
+
+install.man::
+	@echo "install.man in $(CURRENT_DIR) done"
+
+Makefiles::
+
+includes::
+
+###########################################################################
+# dependencies generated by makedepend
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Menu.c	Sat Apr 13 18:19:26 2019 +0000
@@ -0,0 +1,751 @@
+#ifndef lint
+static char *rcsid_Menu_c = "$XConsortium: Menu.c,v 1.25 88/09/30 11:41:11 jim Exp $";
+#endif	/* lint */
+
+/*
+ * Copyright 1985, 1986, 1987, 1988, 1989 by the
+ * Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  M.I.T. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ */
+
+/*
+ * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+ *
+ *                         All Rights Reserved
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Digital Equipment
+ * Corporation not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior permission.
+ *
+ *
+ * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+
+
+/*
+ * MODIFICATION HISTORY
+ *
+ * 000 -- M. Gancarz, DEC Ultrix Engineering Group
+ * 001 -- L. Guarino Reid, DEC Ultrix Engineering Group, Western Software Lab
+ *	  February 16, 1987
+ *	  Change menu implementation so that it uses EnterWindow, LeaveWindow,
+ *	  and MouseMotion events to track the mouse, instead of polling.
+ * 002 -- L. Guarino Reid, DEC Ultrix Engineering Group, Western Software Lab
+ *	  April 30, 1987. Convert to X11.
+ * 003 -- L. Guarino Reid, DEC Ultrix Engineering Group, Western Software Lab
+ *	  June 18, 1987. Change call to system to handle signals move smoothly.
+ */
+
+#ifndef lint
+static char *sccsid = "@(#)Menu.c	3.8	1/24/86";
+#endif
+
+#include <signal.h>
+#include "uwm.h"
+#include <stdlib.h>
+#include <sys/wait.h>
+#include <stdbool.h>
+
+bool alternateGC = True;	/* true if only 2 colors are used */
+
+#define DisplayLine(w, pane, width, height, str, fg, bg, inv) \
+         if (alternateGC) { \
+	     if (inv) \
+	         XFillRectangle(dpy, w, MenuInvGC, 0, pane, width, height); \
+	     else \
+                 XDrawString(dpy, w, MenuGC, HMenuPad, pane + VMenuPad + MFontInfo->ascent, str, strlen(str)); \
+         } else { \
+             XSetForeground(dpy, MenuGC, bg); \
+	     XFillRectangle(dpy, w, MenuGC, 0, pane, width, height); \
+             XSetForeground(dpy, MenuGC, fg); \
+             XDrawString(dpy, w, MenuGC, HMenuPad, pane + VMenuPad + MFontInfo->ascent, str, strlen(str)); \
+         }
+
+/*
+ * HP-UX does have vfork, but A/UX doesn't
+ */
+#if (defined(SYSV) || defined(macII)) && !defined(hpux)
+#define vfork() fork()
+#endif
+
+#ifdef X_NOT_STDC_ENV
+char *malloc();
+#endif
+
+static void AdjustMaxColors(int pixel);
+
+/* the following procedure is a copy of the implementation of system, 
+ * modified to reset the handling of SIGINT, SIGQUIT, and SIGHUP before
+ * exec-ing
+ */
+execute(s)
+char *s;
+{
+	int status, pid, w;
+	register int (*istat)(), (*qstat)();
+	char **oldenviron;
+	extern char **environ, **newenviron;
+
+#ifdef SIGCHLD
+	/*
+	 * Children are now handled in uwm.c, but make sure
+	 * uwm blocks :-) for compatibility with other systems.
+	 */
+
+	signal(SIGCHLD, SIG_DFL);
+#endif
+	
+	oldenviron = environ;
+	environ = newenviron;
+	if ((pid = vfork()) == 0) {
+		signal(SIGINT, SIG_DFL);
+		signal(SIGQUIT, SIG_DFL);
+		signal(SIGHUP, SIG_DFL);
+		execl("/bin/sh", "sh", "-c", s, 0);
+		_exit(127);
+	}
+	environ = oldenviron;
+
+	/* 
+	 * The following cast is necessary because newer compilers declare
+	 * signal() to be (void (*)()) whereas old ones use (int (*)()).
+	 */
+	istat = (int (*)()) signal(SIGINT, SIG_IGN);
+	qstat = (int (*)()) signal(SIGQUIT, SIG_IGN);
+	while ((w = wait(&status)) != pid && w != -1)
+		;
+	if (w == -1)
+		status = -1;
+	signal(SIGINT, istat);
+	signal(SIGQUIT, qstat);
+	return(status);
+}
+
+bool Menu(window, mask, button, x, y, menu)
+Window window;				/* Event window. */
+int mask;				/* Button/key mask. */
+int button;				/* Button event detail. */
+int x, y;				/* Event mouse position. */
+MenuInfo *menu;
+{
+    XEvent button_event;		/* Button event packet. */
+    int event_x, event_y;		/* location of button event */
+    bool func_stat;			/* Function status return. */
+    Window sub_window;			/* Current subwindow. */
+    int cur_item = 0;			/* Current menu item. */
+    int hi_lite = 0;			/* Current highlighted item. */
+    int i;				/* Iteration counter. */
+    int hlfg, hlbg;			/* Hi-liter pixels. */
+    MenuLine *ml;			/* Menu lines pointer. */
+    char *hlname;			/* Pointer to hi-liter name. */
+    char *strbuf;			/* String buffer for IsTextNL. */
+    bool checkMotion = TRUE;		/* To Restore Cursor Position */
+    int funcbutton;			/* function button for window select */
+
+    /*
+     * Change the cursor.
+     */
+    XChangeActivePointerGrab(dpy, EVENTMASK, MenuCursor, CurrentTime);
+
+    /*
+     * Map the menu.
+     */
+    MapMenu(menu, x, y);
+    if (Autoselect) {
+        event_x = (menu->width >> 2) * 3;
+        event_y = (menu->iheight >> 1) * 3;
+        XWarpPointer(dpy, None, menu->w, 0, 0, 0, 0, event_x, event_y);
+	goto hilite;
+    }
+    else {
+        XWarpPointer(dpy, None, menu->w, 0, 0, 0, 0, 
+    		(menu->width >> 2) * 3, menu->iheight >> 1);
+        XFlush(dpy);
+    }
+
+    /*
+     * Main loop.
+     */
+    while (TRUE) {
+
+        /*
+         *  Get next event for menu.
+         */
+        if (!GetButton(&button_event)) continue;
+	switch (button_event.type) {
+
+            case LeaveNotify:
+	        /*
+	         * If the mouse has moved out of the menu sideways, abort
+	         * the menu operation. Reset the cursor and unmap the menu.
+		 * An extraneous LeaveNotify can come through if you are
+		 * popping up menu from a menu. If you moved the cursor toward
+		 * the edge of the original menu without going outside and
+		 * the new menu is smaller in width than the old menu, the
+		 * new menu will pop up and then disappear.
+	         */
+		if (((XAnyEvent *)&button_event)->window == menu->w) {
+			event_x = ((XLeaveWindowEvent * )&button_event)->x;
+	       		event_y = ((XLeaveWindowEvent * )&button_event)->y;
+			if (event_x < 0 || event_x > menu->width) {
+            		   ResetCursor(button);
+			   UnmapMenu(menu);
+          	  	   return(FALSE);
+        		}
+		}
+		goto hilite;
+
+            case EnterNotify:
+	        event_x = ((XEnterWindowEvent * )&button_event)->x;
+	        event_y = ((XEnterWindowEvent * )&button_event)->y;
+		goto hilite;
+            case MotionNotify:
+		{
+	        event_x = ((XPointerMovedEvent * )&button_event)->x;
+	        event_y = ((XPointerMovedEvent * )&button_event)->y;
+		if ((checkMotion == TRUE) &&
+		    ((event_x != (menu->width >> 2) * 3) ||
+		     (event_y != (menu->iheight >> 1))))
+		   checkMotion = FALSE;	 /* Mouse Has Moved From Top Pane */
+hilite:
+        	/*
+         	* If the mouse has moved below or above the menu, but is still
+         	* within the same vertical plane, then simply adjust the values
+         	* so the user doesn't fall off the edge.
+         	*/
+        	if (event_y >= menu->height) 
+		  event_y = menu->height - 1;
+        	else if (event_y < 0) 
+		  event_y = 0;
+		  
+        	/*
+         	* If the mouse has moved to another item in the menu,
+         	* highlight the new item.
+         	*/
+        	cur_item = event_y / menu->iheight;
+        	if (cur_item != hi_lite) {
+
+            	/*
+             	* Remove highlighting on old item.
+             	*/
+            	if (hi_lite) {
+                	DisplayLine(menu->w, hi_lite * menu->iheight,
+                            menu->width, menu->iheight, hlname,
+                            hlfg, hlbg, 1);
+			XFlush(dpy);
+            	}
+
+           	/*
+             	* Highlight new item.
+             	*/
+            	hi_lite = cur_item;
+            	if (cur_item) {
+                	for(i = 1, ml = menu->line; ml; i++, ml = ml->next) {
+                    		if (i == cur_item) break;
+               	 	}
+                	DisplayLine(menu->w, cur_item * menu->iheight,
+                            menu->width, menu->iheight, ml->name,
+                            menu->hlfg.pixel, menu->hlbg.pixel, 1);
+/*                	XSetForeground(dpy, MenuGC, menu->hlfg.pixel );
+			XDrawRectangle(dpy, menu->w, MenuGC, 1, 
+				cur_item * menu->iheight + 1, 
+				menu->width - 3, menu->iheight - 3);
+*/
+			XFlush(dpy);
+             		hlfg = ml->fg.pixel;
+            		hlbg = ml->bg.pixel;
+            		hlname = ml->name;
+            	}
+		}
+        	break;
+
+            case ButtonRelease:
+	        /* have we released the invoking button? */
+	        if (((XButtonReleasedEvent *)&button_event)->button == button) {
+		    /*
+		     * If no item was selected, 
+		     * close the menu, reset the pointer's position and return
+		     */
+		    if (!cur_item) {
+			/* If Needed Reset The Cursor Position */
+			if (checkMotion == TRUE)
+			  XWarpPointer (dpy, None, RootWindow(dpy, scr),
+					0, 0, 0, 0, x, y);
+		         ResetCursor(button);
+			 UnmapMenu(menu);
+		         return(TRUE);
+		     }
+
+		     /*
+		      * Get a pointer to the menu line selected.
+		      */
+		     --cur_item;
+		     for(i = 0, ml = menu->line; ml; i++, ml = ml->next) {
+		         if (i == cur_item) break;
+		     }
+
+		     /*
+		      * Perform the selected menu line action.
+		      */
+		     switch (ml->type) {
+
+		         case IsShellCommand:
+		             UnmapMenu(menu);
+		             execute(ml->text);
+		             break;
+
+		         case IsText:
+		             UnmapMenu(menu);
+		             XStoreBytes(dpy, ml->text, strlen(ml->text));
+		             break;
+
+		         case IsTextNL:
+		             UnmapMenu(menu);
+		             strbuf = (char *)malloc(strlen(ml->text) + 2);
+		             strcpy(strbuf, ml->text);
+		             strcat(strbuf, "\n");
+		             XStoreBytes(dpy, strbuf, strlen(strbuf));
+		             free(strbuf);
+		             break;
+
+		         case IsUwmFunction:
+			     /* change cursor and grab next button event
+			      * to select the target window */
+			     if (XGrabPointer( dpy, RootWindow(dpy, scr),
+					       TRUE, EVENTMASK, GrabModeAsync,
+					       GrabModeAsync, None,
+					       TargetCursor, CurrentTime )
+				   != GrabSuccess )
+			         Error( "Could not grab pointer" );
+		             funcbutton = GetContext (&sub_window,
+						      &event_x, &event_y);
+		             UnmapMenu(menu);
+		             if (sub_window != menu->w)
+			       func_stat =
+		                 (*ml->func) (sub_window, mask, funcbutton,
+					      event_x, event_y);
+			     else func_stat = FALSE;
+			     if (!func_stat) {
+			       /* eat the next ButtonRelease */
+			       while (TRUE) {
+				   if (GetButton(&button_event) &&
+				       button_event.type == ButtonRelease)
+				     break;
+			       }
+			     }
+			     XUngrabPointer( dpy, CurrentTime );
+		             break;
+
+		         case IsImmFunction:
+		             UnmapMenu(menu);
+ 		            (*ml->func) (
+			      sub_window, mask, button, event_x, 
+			      event_y);
+		             break;
+		 
+		         case IsMenuFunction:
+		             while (TRUE) {
+		                if (!GetButton(&button_event)) continue;
+		                if (button_event.type != ButtonPress) continue;
+		                if ((((XButtonPressedEvent *)&button_event)->state != mask) 
+				 || (((XButtonPressedEvent *)&button_event)->button != button)) 
+				 {
+		                     UnmapMenu(menu);
+		                     return(TRUE);
+		                 }
+		                 break;
+		             }
+		             UnmapMenu(menu);
+		             func_stat = 
+			     	Menu(menu->w, mask, button, x, y, ml->menu);
+		             return(func_stat);
+		             break;
+
+		         default:
+ 		            Error("Menu -> Internal type error.");
+		     }
+		     return(TRUE);
+		  
+                 } 
+		 /* else a different button was released. Fall through: */
+            default:
+                    /*
+                     * Some other button event occurred, so abort the menu
+                     * operation.
+                     */
+		    ResetCursor(button);
+		    /* If Needed Reset The Cursor Position */
+		    if (checkMotion == TRUE)
+		      XWarpPointer (dpy, None, RootWindow(dpy, scr),
+				    0, 0, 0, 0, x, y);
+                    UnmapMenu(menu);
+                    return(TRUE);
+		
+	}
+     }
+  }
+}
+
+
+/*
+ * Create the menu windows for later use.
+ */
+CreateMenus()
+{
+    MenuLink *ptr;
+
+    /*
+     * If MaxColors isn't set, then jam it to an impossibly high
+     * number.
+     */
+    if (MaxColors == 0)
+        MaxColors = 25000;
+
+    for(ptr = Menus; ptr; ptr = ptr->next)
+        InitMenu(ptr->menu);
+}
+
+/*
+ * Initialize a menu.
+ */
+InitMenu(menu)
+MenuInfo *menu;
+{
+    MenuLine *ml;		/* Menu lines pointer. */
+    int width;			/* Width of an item name. */
+    int maxwidth;		/* Maximum width of item names. */
+    int len;			/* Length of an item name. */
+    int count = 1;		/* Number of items + 1 for name. */
+    XSetWindowAttributes attr;
+
+    /*
+     * Determine the name of the longest menu item.
+     */
+    maxwidth = XTextWidth(MFontInfo, menu->name, strlen(menu->name));
+    if (maxwidth == 0)
+        Error("InitMenu -> Couldn't get length of menu name");
+
+    for(ml = menu->line; ml; ml = ml->next) {
+        if ((len = strlen(ml->name)) == 0)
+            break;
+        width = XTextWidth(MFontInfo, ml->name, strlen(ml->name));
+        if (width == 0) 
+	  Error("InitMenu -> Couldn't get length of menu item name");
+        if (width > maxwidth) maxwidth = width;
+        count++;
+    }
+
+    /*
+     * Get the color cells for the menu items.
+     */
+    GetMenuColors(menu);
+
+    /*
+     * Stash the menu parameters in the menu info structure.
+     */
+    menu->iheight = MFontInfo->ascent + MFontInfo->descent + (VMenuPad << 1);
+    menu->height = menu->iheight * count;
+    menu->width = maxwidth + (HMenuPad << 1);
+    menu->image = NULL;
+
+    /*
+     * Create the menu window.
+     */
+    attr.border_pixel = MBorder;
+    /*
+     * SaveUnders Enabled If The Server Supports It
+     */
+    attr.save_under = DoesSaveUnders( DefaultScreenOfDisplay( dpy ) );
+    /*
+     * We want enter, leave, and mouse motion events for menus.
+     */
+    attr.event_mask = ( EnterWindowMask | LeaveWindowMask | PointerMotionMask );
+    /*
+     * Define a cursor for the window
+     */
+    attr.cursor = MenuCursor;
+    menu->w = XCreateWindow( dpy, RootWindow( dpy, scr ),
+			     0, 0,
+			     menu->width, menu->height,
+			     MBorderWidth,
+			     DefaultDepth( dpy, scr ),
+			     InputOutput,
+			     DefaultVisual( dpy, scr ),
+	CWBorderPixel | CWSaveUnder | CWEventMask | CWCursor,
+			     &attr );
+
+    uwmExpressInterest (menu->w, attr.event_mask);
+
+    if (menu->w == NULL) Error("InitMenu -> Couldn't create menu window");
+
+    /*
+     * For monochrome servers, we *do* want to set a background pixel
+     */
+    if (alternateGC) {
+	XSetWindowBackground( dpy, menu->w, MBackground );
+    }
+
+    /*
+     * Store the window name.
+     */
+    XStoreName(dpy, menu->w, menu->name);
+
+}
+
+/*
+ * Map a menu.
+ */
+MapMenu(menu, x, y)
+MenuInfo *menu;
+int x, y;
+{
+    int item;
+    Window w;
+    MenuLine *ml;
+    XWindowChanges values;
+
+    w = menu->w;
+
+    /*
+     * Move the menu into place, normalizing the coordinates, if necessary;
+     * then map it.
+     */
+    x -= (menu->width >> 1);
+    if (x < 0) x = 0;
+    else if (x + menu->width >= ScreenWidth)
+        x = ScreenWidth - menu->width - (MBorderWidth << 1);
+    if (y < 0) y = 0;
+    else if (y + menu->height >= ScreenHeight)
+        y = ScreenHeight - menu->height - (MBorderWidth << 1);
+    values.x = x;
+    values.y = y;
+    values.stack_mode = Above;
+    XConfigureWindow(dpy, w, CWX|CWY|CWStackMode, &values);
+
+    /*
+     * Map the window and draw the text items.
+     */
+    XMapWindow(dpy, w);
+    DisplayLine(w, 0, menu->width, menu->iheight, menu->name,
+                menu->bg.pixel, menu->fg.pixel, 0);
+
+    if (alternateGC) {
+        XFillRectangle(dpy, menu->w, MenuInvGC, 0, 0,
+		       menu->width, menu->iheight);
+        XDrawRectangle(dpy, menu->w, MenuInvGC, 1, 1,
+		       menu->width - 3, menu->iheight - 3);
+    } else {
+        XSetForeground(dpy, MenuGC, menu->bg.pixel );
+        XDrawRectangle(dpy, menu->w, MenuGC, 1, 1, menu->width - 3, 
+		       menu->iheight - 3);
+    }
+
+    item = menu->iheight;
+    for(ml = menu->line; ml; ml = ml->next) {
+        DisplayLine(w, item, menu->width, menu->iheight, ml->name,
+                    ml->fg.pixel, ml->bg.pixel, 0);
+        item += menu->iheight;
+    }
+
+    /*
+     * Position the mouse cursor in the menu header (or in the first item
+     * if "autoselect" is set).
+     */
+
+    XFlush(dpy);
+}
+
+/*
+ * Unmap a menu, restoring the contents of the screen underneath
+ * if necessary. (Restore portion is a future.)
+ */
+UnmapMenu(menu)
+MenuInfo *menu;
+{
+    /*
+     * Unmap and flush.
+     */
+    XUnmapWindow(dpy, menu->w);
+    XFlush(dpy);
+}
+
+/*
+ * Get the context for invoking a window manager function; return the button
+ * pressed.
+ */
+int GetContext(w, x, y)
+Window *w;
+int *x, *y;
+{
+    XEvent button_event;  /* Button input event. */
+
+    while (TRUE) {
+
+        /*
+         * Get the next mouse button event.  Spin our wheels until
+         * a button event is returned (ie. GetButton == TRUE).
+         * Note that mouse events within an icon window are handled
+         * in the "GetButton" function or by the icon's owner if
+         * it is not uwm.
+         */
+        if (!GetButton(&button_event)) continue;
+
+        /*
+         * If the button event received is not a ButtonPress event
+         * then continue until we find one.
+         */
+        if (button_event.type != ButtonPress) continue;
+
+        /*
+         * Okay, determine the event window and mouse coordinates.
+         */
+        status = XTranslateCoordinates(dpy, 
+				    RootWindow(dpy, scr), 
+				    RootWindow(dpy, scr),
+                                    ((XButtonPressedEvent *)&button_event)->x, 
+                                    ((XButtonPressedEvent *)&button_event)->y, 
+                                    x, y,
+                                    w);
+
+        if (status == FAILURE) continue;
+
+        if (*w == 0)
+            *w = RootWindow(dpy, scr);
+
+        return (((XButtonPressedEvent *) &button_event)->button);
+    }
+}
+
+/*
+ * Get the color cells for a menu.  This function is slightly brain-damaged
+ * in that once MaxColors <= 1, then it refuses to even try to allocate any
+ * more colors, even though the colors may have already been allocated.  It
+ * probably ought to be done right someday.
+ */
+GetMenuColors(menu)
+MenuInfo *menu;
+{
+    register MenuLine *ml;		/* Menu lines pointer. */
+
+    /*
+     * If we have more than 2 colors available, then attempt to get
+     * the color map entries requested by the user.
+     * Otherwise, default to standard black and white.
+     *
+     * The boolean "alternateGC" is true iff we can use just two colors.
+     */
+
+    if (DisplayCells(dpy, scr) > 2) {
+        /*
+         * Get the menu header colors first.
+         */
+        if (!(menu->foreground && menu->background && MaxColors > 1 &&
+              XParseColor(dpy, DefaultColormap(dpy, scr), menu->foreground, &menu->fg) &&
+              XAllocColor(dpy, DefaultColormap(dpy, scr), &menu->fg) &&
+              XParseColor(dpy, DefaultColormap(dpy, scr), menu->background, &menu->bg) &&
+              XAllocColor(dpy, DefaultColormap(dpy, scr), &menu->bg))) {
+            menu->fg.pixel = MTextForeground;
+            menu->bg.pixel = MTextBackground;
+        } else {
+            AdjustMaxColors(menu->fg.pixel);
+            AdjustMaxColors(menu->bg.pixel);
+	    alternateGC = False;	/* since we just allocated colors */
+        }
+
+        /*
+         * Get the menu highlight colors.
+         */
+        if (!(menu->fghighlight && menu->bghighlight && MaxColors > 1 &&
+              XParseColor(
+	        dpy, DefaultColormap(dpy, scr), menu->fghighlight, &menu->hlfg) &&
+              XAllocColor(dpy, DefaultColormap(dpy, scr), &menu->hlfg) &&
+              XParseColor(
+	        dpy, DefaultColormap(dpy, scr), menu->bghighlight, &menu->hlbg) &&
+              XAllocColor(dpy, DefaultColormap(dpy, scr), &menu->hlbg))) {
+            menu->hlfg.pixel = MTextBackground;
+            menu->hlbg.pixel = MTextForeground;
+        } else {
+            AdjustMaxColors(menu->hlfg.pixel);
+            AdjustMaxColors(menu->hlbg.pixel);
+	    alternateGC = False;
+        }
+
+        /*
+         * Get the menu item colors.
+         */
+        for(ml = menu->line; ml; ml = ml->next) {
+            if (!(ml->foreground && ml->background && MaxColors > 1 &&
+                  XParseColor(dpy, DefaultColormap(dpy, scr), ml->foreground, &ml->fg) &&
+                  XAllocColor(dpy, DefaultColormap(dpy, scr), &ml->fg) &&
+                  XParseColor(dpy, DefaultColormap(dpy, scr), ml->background, &ml->bg) &&
+                  XAllocColor(dpy, DefaultColormap(dpy, scr), &ml->bg))) {
+                ml->fg.pixel = MTextForeground;
+                ml->bg.pixel = MTextBackground;
+            } else {
+                AdjustMaxColors(ml->fg.pixel);
+                AdjustMaxColors(ml->bg.pixel);
+            }
+        }
+
+    } else {
+
+        /*
+         * Only 2 colors available, so default to standard black and white.
+         */
+        menu->fg.pixel = MTextForeground;
+        menu->bg.pixel = MTextBackground;
+        menu->hlfg.pixel = MTextBackground;
+        menu->hlbg.pixel = MTextForeground;
+        for(ml = menu->line; ml; ml = ml->next) {
+            ml->fg.pixel = MTextForeground;
+            ml->bg.pixel = MTextBackground;
+        }
+    }
+}
+
+/*
+ * Decrement "MaxColors" if this pixel value has never been used in a
+ * menu before.
+ */
+AdjustMaxColors(pixel)
+int pixel;
+{
+    register MenuLink *mptr;
+    register MenuLine *lptr;
+    int count = 0;
+
+    for(mptr = Menus; mptr; mptr = mptr->next) {
+        if (mptr->menu->fg.pixel == pixel) ++count;
+        if (mptr->menu->bg.pixel == pixel) ++count;
+        if (mptr->menu->hlfg.pixel == pixel) ++count;
+        if (mptr->menu->hlbg.pixel == pixel) ++count;
+        for(lptr = mptr->menu->line; lptr; lptr = lptr->next) {
+            if (lptr->fg.pixel == pixel) ++count;
+            if (lptr->bg.pixel == pixel) ++count;
+        }
+        if (count > 1) return;
+    }
+    --MaxColors;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Move.c	Sat Apr 13 18:19:26 2019 +0000
@@ -0,0 +1,265 @@
+#ifndef lint
+static char *rcsid_Move_c = "$XConsortium: Move.c,v 1.13 88/10/22 15:21:16 jim Exp $";
+#endif	/* lint */
+
+/*
+ * Copyright 1985, 1986, 1987, 1988, 1989 by the
+ * Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  M.I.T. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ */
+
+/*
+ * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+ *
+ *                         All Rights Reserved
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Digital Equipment
+ * Corporation not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior permission.
+ *
+ *
+ * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+/*
+ * MODIFICATION HISTORY
+ *
+ * 000 -- M. Gancarz, DEC Ultrix Engineering Group
+ * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group, 
+ *	  Western Software Lab. Port to X11
+ */
+
+#ifndef lint
+static char *sccsid = "@(#)Move.c	3.8	1/24/86";
+#endif
+
+#include "uwm.h"
+#include <stdbool.h>
+
+bool Move(window, mask, button, x, y)
+Window window;				/* Event window. */
+int mask;				/* Button/key mask. */
+int button;				/* Button event detail. */
+int x, y;				/* Event mouse position. */
+{
+    register int prev_x;		/* Previous event window X location. */
+    register int prev_y;		/* Previous event window Y location. */
+    XWindowAttributes window_info;	/* Event window information. */
+    int cur_x;				/* Current event window X location. */
+    int cur_y;				/* Current event window Y location. */
+    int root_x;				/* Root window X location. */
+    int root_y;				/* Root window Y location. */
+    int ulx, uly;			/* Event window upper left X and Y. */
+    int lrx, lry;			/* Event window lower right X and Y. */
+    int init_ulx, init_uly;		/* Init window upper left X and Y. */
+    int init_lrx, init_lry;		/* Init window lower right X and Y. */
+    int num_vectors;			/* Number of vectors in box. */
+    int ptrmask;			/* state of ptr when queried */
+    Window sub_window;			/* Query mouse event sub-window. */
+    Window root;			/* Query mouse event root. */
+    XEvent button_event;		/* Button event packet. */
+    XSegment box[MAX_BOX_VECTORS];	/* Box vertex buffer. */
+    XSegment zap[MAX_ZAP_VECTORS];	/* Zap effect verted buffer. */
+
+    /*
+     * Do not try to move the root window.
+     */
+    if (window == RootWindow(dpy, scr))
+        return(FALSE);
+
+    /*
+     * Change the cursor.
+     */
+    XChangeActivePointerGrab(dpy, EVENTMASK, ArrowCrossCursor, CurrentTime);
+
+    /*
+     * Clear the vector buffers.
+     */
+    bzero(box, sizeof(box));
+    if (Zap) bzero(zap, sizeof(zap));
+    
+    /*
+     * Gather info on the event window.
+     */
+    status = XGetWindowAttributes(dpy, window, &window_info);
+    if (status == FAILURE) return(FALSE);
+
+    /*
+     * Initialize movement variables.
+     */
+    init_ulx = ulx = window_info.x;
+    init_uly = uly = window_info.y;
+    init_lrx = lrx = window_info.x + window_info.width +
+                     (window_info.border_width << 1) - 1;
+    init_lry = lry = window_info.y + window_info.height +
+                     (window_info.border_width << 1) - 1;
+
+    /*
+     * Store the box.
+     */
+    if (Grid)
+        num_vectors = StoreGridBox(box, ulx, uly, lrx, lry);
+    else num_vectors = StoreBox(box, ulx, uly, lrx, lry);
+
+    /*
+     * Initialize the previous location variables.
+     */
+    prev_x = x;
+    prev_y = y;
+
+    /*
+     * Freeze the server, if requested by the user.
+     * This results in a solid box instead of a flickering one.
+     */
+    if (Freeze) XGrabServer(dpy);
+
+    /*
+     * Process any pending exposure events before drawing the box.
+     */
+    while (QLength(dpy) > 0) {
+        XPeekEvent(dpy, &button_event);
+        if (((XAnyEvent *)&button_event)->window == RootWindow(dpy, scr) &&
+		(button_event.type == ButtonPress ||
+			button_event.type == ButtonRelease))
+            break;
+        GetButton(&button_event);
+    }
+
+    /*
+     * Now draw the box.
+     */
+    DrawBox();
+    Frozen = window;
+
+    /*
+     * Main loop.
+     */
+    while (TRUE) {
+
+    	/*
+	 * Check to see if we have a change in mouse button status.
+	 * This is how we get out of this "while" loop.
+	 */
+	if (XPending(dpy) && !ProcessRequests(box, num_vectors) && GetButton(&button_event)) {
+	    /*
+	     * Process the pending events, this sequence is the only
+	     * way out of the loop and the routine.
+	     */
+
+            if ((button_event.type != ButtonPress) && 
+	        (button_event.type != ButtonRelease)) {
+                continue; /* spurious menu event... */
+            }
+
+            /*
+             * If we froze the server, then erase the last lines drawn.
+             */
+            if (Freeze) {
+                DrawBox();
+                Frozen = (Window)0;
+                XUngrabServer(dpy);
+            }
+
+	    if ((button_event.type == ButtonRelease) &&
+		(((XButtonReleasedEvent *)&button_event)->button == button)) {
+
+		/*
+		 * The button was released, so move the window.
+		 */
+
+		if (Zap) {
+                    num_vectors = StoreZap(zap,
+                                           init_ulx, init_uly,
+                                           init_lrx, init_lry,
+                                           ulx, uly,
+                                           lrx, lry);
+                    DrawZap();
+                    DrawZap();
+                }
+		XMoveWindow(dpy, window, ulx, uly);
+		return(TRUE);
+	    }
+	    else {
+
+		/*
+		 * Some other button event occured, this aborts the
+		 * current operation.
+		 */
+
+		ResetCursor(button);
+		return(TRUE);
+	    }
+	}
+
+        /*
+         * Take care of all the little things that have changed.
+         */
+        XQueryPointer(dpy, 
+		      RootWindow(dpy, scr), &root,  &sub_window,
+		      &root_x, &root_y, &cur_x, &cur_y, &ptrmask);
+        if ((cur_x != prev_x) || (cur_y != prev_y)) {
+
+            /*
+             * If we've frozen the server, then erase the old box first!
+             */
+            if (Freeze)
+                DrawBox();
+
+            /*
+             * Box position has changed.
+             */
+            ulx += cur_x - prev_x;
+            uly += cur_y - prev_y;
+            lrx += cur_x - prev_x;
+            lry += cur_y - prev_y;
+
+            /*
+             * Box needs to be restored.
+             */
+            if (Grid)
+                num_vectors = StoreGridBox(box, ulx, uly, lrx, lry);
+            else num_vectors = StoreBox(box, ulx, uly, lrx, lry);
+
+
+            /*
+             * Draw the new box.
+             */
+            if (Freeze)
+                DrawBox();
+    	}
+
+    	/* 
+    	 * Save old box position.
+    	 */
+    	prev_x = cur_x;
+    	prev_y = cur_y;
+
+        /*
+         * If server is not frozen, then draw the "flicker" box.
+         */
+        if (!Freeze) {
+            DrawBox();
+            DrawBox();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MoveOpaque.c	Sat Apr 13 18:19:26 2019 +0000
@@ -0,0 +1,153 @@
+#ifndef lint
+static char *rcsid_MoveOpaque_c = "$XConsortium: MoveOpaque.c,v 1.12 88/10/22 15:20:54 jim Exp $";
+#endif	/* lint */
+
+/*
+ * Copyright 1985, 1986, 1987, 1988, 1989 by the
+ * Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  M.I.T. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ */
+
+/*
+ * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+ *
+ *                         All Rights Reserved
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Digital Equipment
+ * Corporation not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior permission.
+ *
+ *
+ * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+
+
+/*
+ * MODIFICATION HISTORY
+ *
+ * 000 -- M. Gancarz, DEC Ultrix Engineering Group
+ * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group,
+    Western Software Lab. Convert to X11.
+ */
+
+#ifndef lint
+static char *sccsid = "@(#)MoveOpaque.c	1.7	1/24/86";
+#endif
+
+#include "uwm.h"
+#include <X11/Xatom.h>
+#include <stdbool.h>
+
+bool MoveOpaque(window, mask, button, x, y)
+Window window;				/* Event window. */
+int mask;				/* Button/key mask. */
+int button;				/* Button event detail. */
+int x, y;				/* Event mouse position. */
+{
+    int prev_x, prev_y;			/* Previous mouse location. */
+    int cur_x, cur_y;			/* Current mouse location. */
+    int win_x, win_y;			/* Current window location. */
+    int root_x;				/* Root window X location. */
+    int root_y;				/* Root window Y location. */
+    int ptrmask;			/* state of ptr when queried */
+    XWindowAttributes window_info;	/* Event window information. */
+    Window sub_window;			/* Query mouse event sub-window. */
+    Window root;			/* Query mouse event root. */
+    XEvent button_event;		/* Button event packet. */
+
+    /*
+     * Do not try to move the root window.
+     */
+    if (window == RootWindow(dpy, scr))
+        return(FALSE);
+
+    /*
+     * Change the cursor.
+     */
+    XChangeActivePointerGrab(dpy, EVENTMASK, ArrowCrossCursor, CurrentTime);
+
+    /*
+     * Gather info on the event window.
+     */
+    status = XGetWindowAttributes(dpy, window, &window_info);
+    if (status == FAILURE) return(FALSE);
+
+    /*
+     * Initialize movement variables.
+     */
+    prev_x = cur_x = x;
+    prev_y = cur_y = y;
+    win_x = window_info.x;
+    win_y = window_info.y;
+
+    /*
+     * Main loop.
+     */
+    while (TRUE) {
+
+        XQueryPointer(dpy, RootWindow(dpy, scr), 
+		&root, &sub_window, &root_x, &root_y, &cur_x, &cur_y, 
+		&ptrmask);
+
+    	/*
+	 * Check to see if we have a change in mouse button status.
+	 * This is how we get out of this "while" loop.
+	 */
+	if (XCheckMaskEvent(dpy,
+			    ButtonPressMask|ButtonReleaseMask,
+			    &button_event)) {
+	    XButtonEvent *be = (XButtonEvent *) &button_event;
+
+	    /*
+	     * If the button event was something other than the
+             * release of the original button pressed, then move the
+             * window back to where it was originally.
+	     */
+            if ((button_event.type != ButtonRelease) || 
+	        (be->button != button)) {
+                ResetCursor(button);
+		XMoveWindow(dpy, window, window_info.x, window_info.y);
+	    } else {
+		win_x += (be->x_root - prev_x);
+		win_y += (be->y_root - prev_y);
+		XMoveWindow (dpy, window, win_x, win_y);
+	    }
+
+            return(TRUE);
+	}
+	
+        /*
+         * Take care of all the little things that have changed; 
+         * i.e., move the window, if necessary.
+         */
+        if ((cur_x != prev_x) || (cur_y != prev_y)) {
+            win_x += (cur_x - prev_x);
+            win_y += (cur_y - prev_y);
+            XMoveWindow(dpy, window, win_x, win_y);
+    	    prev_x = cur_x;
+    	    prev_y = cur_y;
+    	}
+    }
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/NewIconify.c	Sat Apr 13 18:19:26 2019 +0000
@@ -0,0 +1,353 @@
+/*
+ * Copyright 1985, 1986, 1987, 1988, 1989 by the
+ * Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  M.I.T. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ */
+
+/*
+ * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+ *
+ *                         All Rights Reserved
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Digital Equipment
+ * Corporation not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior permission.
+ *
+ *
+ * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+/*
+ * MODIFICATION HISTORY
+ *
+ * 000 -- M. Gancarz, DEC Ultrix Engineering Group
+ * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group,
+ *  Western Software Lab. Port to X11.
+ */
+
+#ifndef lint
+static char *sccsid = "%W%	%G%";
+#endif
+
+#include "uwm.h"
+#include <stdbool.h>
+
+bool NewIconify(window, mask, button, x, y)
+Window window;                          /* Event window. */
+int mask;                               /* Button/key mask. */
+int button;                             /* Button event detail. */
+int x, y;                               /* Event mouse position. */
+{
+    XWindowAttributes window_info;	/* Event window info. */
+    XWindowAttributes icon_info;	/* Icon window info. */
+    char *name;				/* Event window name. */
+    int mse_x, mse_y;			/* Mouse X and Y coordinates. */
+    int icon_x, icon_y;			/* Icon U. L. X and Y coordinates. */
+    int icon_w, icon_h;			/* Icon width and height. */
+    int icon_bdr;			/* Icon border width. */
+    int prev_x;				/* Previous event window X location. */
+    int prev_y;				/* Previous event window Y location. */
+    int cur_x;				/* Current event window X location. */
+    int cur_y;				/* Current event window Y location. */
+    int root_x;				/* Root window X location. */
+    int root_y;				/* Root window Y location. */
+    int ulx, uly;			/* Event window upper left X and Y. */
+    int lrx, lry;			/* Event window lower right X and Y. */
+    int init_ulx, init_uly;		/* Init window upper left X and Y. */
+    int init_lrx, init_lry;		/* Init window lower right X and Y. */
+    int num_vectors;			/* Number of vectors in box. */
+    int status;				/* Routine call return status. */
+    int ptrmask;			/* pointer query state. */
+    Window root;			/* Mouse root window. */
+    Window icon;			/* Icon window. */
+    Window sub_win;			/* Mouse position sub-window. */
+    XEvent button_event;		/* Button event packet. */
+    XSegment box[MAX_BOX_VECTORS];	/* Box vertex buffer. */
+    XSegment zap[MAX_ZAP_VECTORS];	/* Zap effect vertex buffer. */
+    bool iconifying;			/* Are we iconifying? */
+
+    /*
+     * Do not lower or iconify the root window.
+     */
+    if (window == RootWindow(dpy, scr))
+        return(FALSE);
+
+    /*
+     * Change the cursor to the icon cursor.
+     */
+    XChangeActivePointerGrab(dpy, EVENTMASK, ArrowCrossCursor, CurrentTime);
+
+    /*
+     * Clear the vector buffers.
+     */
+    bzero(box, sizeof(box));
+    if (Zap) bzero(zap, sizeof(zap));
+    
+    /*
+     * Get info on the event window.
+     */
+    status = XGetWindowAttributes(dpy, window, &window_info);
+    if (status == FAILURE) return(FALSE);
+
+    /*
+     * Are we iconifying or de-iconifying?
+     */
+    if (!IsIcon(window, x, y, FALSE, &icon)) {
+
+        /*
+         * Window => Icon (Iconifying).
+         */
+        /*
+         * If an icon window doesn't exist for the event window, then
+         * make one.
+         */
+        iconifying = TRUE;
+    }
+    else {
+
+        /*
+         * Icon => Window (DeIconifying).
+         */
+
+        /*
+         * We call the normal window the "icon" window only to simplify
+         * the code later on in the function.
+         */
+        iconifying = FALSE;
+    }
+    /*
+     * Get info on the icon window.
+     */
+    status = XGetWindowAttributes(dpy, icon, &icon_info);
+    if (status == FAILURE) return(FALSE);
+
+    /*
+     * Determine the height, width, and borderwidth of the icon.
+     */
+    icon_h = icon_info.height;
+    icon_w = icon_info.width;
+    icon_bdr = icon_info.border_width;
+
+
+    /*
+     * Initialize the movement variables.
+     */
+    init_ulx = ulx = x - (icon_w >> 1) - icon_bdr;
+    init_uly = uly = y - (icon_h >> 1) - icon_bdr;
+    init_lrx = lrx = x + (icon_w >> 1) + icon_bdr - 1;
+    init_lry = lry = y + (icon_h >> 1) + icon_bdr - 1;
+    prev_x = x;
+    prev_y = y;
+
+
+    /*
+     * Store the box.
+     */
+    if (Grid)
+        num_vectors = StoreGridBox(box, ulx, uly, lrx, lry);
+    else num_vectors = StoreBox(box, ulx, uly, lrx, lry);
+
+    /*
+     * Freeze the server, if requested by the user.
+     * This results in a solid box instead of a flickering one.
+     */
+    if (Freeze)
+        XGrabServer(dpy);
+
+    /*
+     * Process any outstanding events before drawing the box.
+     */
+    while (QLength(dpy) > 0) {
+        XPeekEvent(dpy, &button_event);
+        if (((XAnyEvent *)&button_event)->window == RootWindow(dpy, scr) &&
+	    (button_event.type == ButtonPress || 
+	     button_event.type == ButtonRelease))
+            break;
+        GetButton(&button_event);
+    }
+
+    /*
+     * Draw the box.
+     */
+    DrawBox();
+    if (Freeze)
+        Frozen = window;
+
+    /*
+     * We spin our wheels here looking for mouse movement or a change
+     * in the status of the buttons.
+     */
+    while (TRUE) {
+
+	/*
+	 * Check to see if we have a change in mouse button status.
+	 * This is how we get out of this "while" loop.
+	 */
+	if (XPending(dpy) && !ProcessRequests(box, num_vectors) && GetButton(&button_event)) {
+            /*
+             * Process the pending events, this sequence is the only
+             * way out of the loop and the routine.
+             */
+
+            if ((button_event.type != ButtonPress) && 
+	        (button_event.type != ButtonRelease)) {
+                continue; /* spurious menu event... */
+            }
+
+            /*
+             * If we froze the server, then erase the last lines drawn.
+             */
+            if (Freeze) {
+                DrawBox();
+                Frozen = (Window)0;
+                XUngrabServer(dpy);
+            }
+
+            /*
+             * Save the mouse cursor location.
+             */
+	    if (button_event.type == ButtonPress ||
+	        button_event.type == ButtonRelease) {
+	    	mse_x = ((XButtonEvent *)&button_event)->x;
+	    	mse_y = ((XButtonEvent *)&button_event)->y;
+	    	break;
+	    }
+	}
+	else {
+	    /*
+	     * Continue to track the mouse until we get a change
+             * in button status.
+	     */
+            XQueryPointer(dpy, RootWindow(dpy, scr), 
+	    	&root, &sub_win, &root_x, &root_y, &cur_x, &cur_y, 
+		&ptrmask);
+
+            /*
+             * If the mouse has moved, then make sure the box follows it.
+             */
+            if ((cur_x != prev_x) || (cur_y != prev_y)) {
+
+                /*
+                 * If we've frozen the server, then erase the old box first!
+                 */
+                if (Freeze)
+                    DrawBox();
+    
+                /*
+                 * Set the new box position.
+                 */
+                ulx += cur_x - prev_x;
+                uly += cur_y - prev_y;
+                lrx += cur_x - prev_x;
+                lry += cur_y - prev_y;
+    
+                /*
+                 * Calculate the vectors for the new box.
+                 */
+                if (Grid)
+                    num_vectors = StoreGridBox(box, ulx, uly, lrx, lry);
+                else num_vectors = StoreBox(box, ulx, uly, lrx, lry);
+    
+                /*
+                 * Draw the new box.
+                 */
+                if (Freeze)
+                    DrawBox();
+            }
+
+            /*
+             * Save the old box position.
+             */
+            prev_x = cur_x;
+            prev_y = cur_y;
+
+            /*
+             * If server is not frozen, then draw the "flicker" box.
+             */
+            if (!Freeze) {
+                DrawBox();
+                DrawBox();
+            }
+	}
+    }
+
+    /*
+     * If the button is not a button release of the same button pressed,
+     * then abort the operation.
+     */
+    if ((button_event.type != ButtonRelease) ||
+        (((XButtonReleasedEvent *)&button_event)->button != button)) {
+	    ResetCursor(button);
+	    return(TRUE);
+    }
+
+    /*
+     * If we are here we have committed to iconifying/deiconifying.
+     */
+
+    /*
+     * Determine the coordinates of the icon or window;
+     * normalize the window or icon coordinates if the user so desires.
+     */
+    icon_x = mse_x - (icon_w >> 1) - icon_bdr;
+    icon_y = mse_y - (icon_h >> 1) - icon_bdr;
+    if ((NIcon && iconifying) || (NWindow && !iconifying)) {
+        if (icon_x < 0) icon_x = 0;
+        if (icon_y < 0) icon_y = 0;
+        if ((icon_x - 1 + icon_w + (icon_bdr << 1)) > ScreenWidth) {
+            icon_x = ScreenWidth - icon_w - (icon_bdr << 1) + 1;
+        }
+        if ((icon_y - 1 + icon_h + (icon_bdr << 1)) > ScreenHeight) {
+            icon_y = ScreenHeight - icon_h - (icon_bdr << 1) + 1;
+        }
+    }
+
+    /*
+     * Move the window into place.
+     */
+    XMoveWindow(dpy, icon, icon_x, icon_y);
+
+    /*
+     * Map the icon window.
+     */
+    XMapRaised(dpy, icon);
+    if (!iconifying) XRemoveFromSaveSet(dpy, icon);
+
+    if (Zap) {
+        num_vectors = StoreZap(zap, window_info.x, window_info.y,
+                               window_info.x + window_info.width +
+                               (window_info.border_width << 1),
+                               window_info.y + window_info.height +
+                               (window_info.border_width << 1),
+                               ulx, uly, lrx, lry);
+        DrawZap();
+        DrawZap();
+    }
+
+    /*
+     * Unmap the event window.
+     */
+    if (iconifying) XAddToSaveSet(dpy, window);
+    XUnmapWindow(dpy, window);
+    return(TRUE);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Pause.c	Sat Apr 13 18:19:26 2019 +0000
@@ -0,0 +1,79 @@
+#ifndef lint
+static char *rcsid_Pause_c = "$XConsortium: Pause.c,v 1.4 88/09/06 17:28:29 jim Exp $";
+#endif	/* lint */
+
+/*
+ * Copyright 1985, 1986, 1987, 1988, 1989 by the
+ * Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  M.I.T. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ */
+
+/*
+ * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+ *
+ *                         All Rights Reserved
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Digital Equipment
+ * Corporation not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior permission.
+ *
+ *
+ * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+
+
+/*
+ * MODIFICATION HISTORY
+ *
+ * 000 -- M. Gancarz, DEC Ultrix Engineering Group
+ * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group,
+    Western Software Lab. Convert to X11.
+ */
+
+#ifndef lint
+static char *sccsid = "@(#)Pause.c	3.8	1/24/86";
+#endif
+
+#include "uwm.h"
+#include <stdbool.h>
+
+bool Pause(window, mask, button, x, y)
+Window window;                          /* Event window. */
+int mask;                               /* Button/key mask. */
+int button;                           /* Button event detail. */
+int x, y;                               /* Event mouse position. */
+{
+    XGrabServer(dpy);
+    return(FALSE);
+}
+
+bool Continue(window, mask, button, x, y)
+Window window;                          /* Event window. */
+int mask;                               /* Button/key mask. */
+int button;                           /* Button event detail. */
+int x, y;                               /* Event mouse position. */
+{
+    XUngrabServer(dpy);
+    return(FALSE);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Push.c	Sat Apr 13 18:19:26 2019 +0000
@@ -0,0 +1,172 @@
+#ifndef lint
+static char *rcsid_Push_c = "$XConsortium: Push.c,v 1.4 88/09/06 17:28:36 jim Exp $";
+#endif	/* lint */
+
+/*
+ * Copyright 1985, 1986, 1987, 1988, 1989 by the
+ * Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  M.I.T. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ */
+
+/*
+ * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+ *
+ *                         All Rights Reserved
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Digital Equipment
+ * Corporation not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior permission.
+ *
+ *
+ * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+ 
+
+/*
+ * MODIFICATION HISTORY
+ *
+ * 000 -- M. Gancarz, DEC Ultrix Engineering Group
+ * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group,
+    Western Software Lab. Convert to X11.
+ */
+
+#ifndef lint
+static char *sccsid = "@(#)Push.c	3.8	1/24/86";
+#endif
+
+#include "uwm.h"
+#include <stdbool.h>
+
+#define PUSH_DOWN	1
+#define PUSH_UP		2
+#define PUSH_LEFT	3
+#define PUSH_RIGHT	4
+
+extern bool PushAll();
+
+bool PushDown(window, mask, button, x, y)
+Window window;				/* Event window. */
+int mask;				/* Button/key mask. */
+int button;				/* Button event detail. */
+int x, y;				/* Event mouse position. */
+{
+    return(PushAll(window, PUSH_DOWN));
+}
+
+bool PushUp(window, mask, button, x, y)
+Window window;				/* Event window. */
+int mask;				/* Button/key mask. */
+int button;				/* Button event detail. */
+int x, y;				/* Event mouse position. */
+{
+    return(PushAll(window, PUSH_UP));
+}
+
+bool PushLeft(window, mask, button, x, y)
+Window window;				/* Event window. */
+int mask;				/* Button/key mask. */
+int button;				/* Button event detail. */
+int x, y;				/* Event mouse position. */
+{
+    return(PushAll(window, PUSH_LEFT));
+}
+
+bool PushRight(window, mask, button, x, y)
+Window window;				/* Event window. */
+int mask;				/* Button/key mask. */
+int button;				/* Button event detail. */
+int x, y;				/* Event mouse position. */
+{
+    return(PushAll(window, PUSH_RIGHT));
+}
+
+bool PushAll(w, direction)
+Window w;
+int direction;
+{
+    XWindowAttributes winfo;			/* Event window information. */
+    XWindowAttributes rinfo;			/* Root window information. */
+    int xofs, yofs;			/* Movement offsets. */
+    int x, y;				/* New window position. */
+
+    /*
+     * Do not try to move the root window.
+     */
+    if (w == RootWindow(dpy, scr))
+        return(FALSE);
+
+    /*
+     * Gather info on the event window.
+     */
+    status = XGetWindowAttributes(dpy, w, &winfo);
+    if (status == FAILURE) return(FALSE);
+
+    /*
+     * Calculate the movement offsets.
+     */
+    switch(direction) {
+    case PUSH_DOWN:
+        xofs = 0;
+        yofs = Push ? (winfo.height / Pushval) : Pushval;
+        break;
+    case PUSH_UP:
+        xofs = 0;
+        yofs = 0 - (Push ? (winfo.height / Pushval) : Pushval);
+        break;
+    case PUSH_LEFT:
+        xofs = 0 - (Push ? (winfo.width / Pushval) : Pushval);
+        yofs = 0;
+        break;
+    case PUSH_RIGHT:
+        xofs = Push ? (winfo.width / Pushval) : Pushval;
+        yofs = 0;
+        break;
+    }
+
+    /*
+     * Calculate the new window position.
+     */
+    x = winfo.x + xofs;
+    y = winfo.y + yofs;
+
+    /*
+     * Normalize the new window coordinates so we don't
+     * lose the window off the edge of the screen.
+     */
+    if (x < (0 - winfo.width + CURSOR_WIDTH - (winfo.border_width << 1)))
+        x = 0 - winfo.width + CURSOR_WIDTH - (winfo.border_width << 1);
+    if (y < (0 - winfo.height + CURSOR_HEIGHT - (winfo.border_width << 1)))
+        y = 0 - winfo.height + CURSOR_HEIGHT - (winfo.border_width << 1);
+    if (x > (ScreenWidth - CURSOR_WIDTH))
+        x = ScreenWidth - CURSOR_WIDTH;
+    if (y > (ScreenHeight - CURSOR_HEIGHT))
+        y = ScreenHeight - CURSOR_HEIGHT;
+
+    /*
+     * Move the window into place.
+     */
+    XMoveWindow(dpy, w, x, y);
+
+    return(FALSE);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Raise.c	Sat Apr 13 18:19:26 2019 +0000
@@ -0,0 +1,90 @@
+/* $XConsortium: Raise.c,v 1.2 88/09/06 17:28:38 jim Exp $ */
+
+/*
+ * Copyright 1985, 1986, 1987, 1988, 1989 by the
+ * Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  M.I.T. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ */
+
+/*
+ * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+ *
+ *                         All Rights Reserved
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Digital Equipment
+ * Corporation not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior permission.
+ *
+ *
+ * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+ 
+/*
+ * MODIFICATION HISTORY
+ *
+ * 000 -- M. Gancarz, DEC Ultrix Engineering Group
+ * 001 -- R. Kittell, DEC Storage A/D May 19, 1986
+ *  Optionally warp mouse to upper right corner of window after raise.
+ * 002 -- Loretta Guarino Reid, DEC Ultrix Engineering Group
+ *  Western Software Lab. Convert to X11.
+ */
+ 
+#ifndef lint
+static char *sccsid = "@(#)Raise.c	3.8	1/24/86";
+#endif
+ 
+#include "uwm.h"
+#include <stdbool.h>
+
+bool Raise(window, mask, button, x, y)
+Window window;                          /* Event window. */
+int mask;                               /* Button/key mask. */
+int button;                           /* Button event detail. */
+int x, y;                               /* Event mouse position. */
+ 
+{
+XWindowAttributes winfo;			/* Window details for warp */
+int status;
+ 
+    /*
+     * If the window is not the root window, raise the window and return.
+     */
+    if (window != RootWindow(dpy, scr)) {
+        XRaiseWindow(dpy, window);
+	/*
+	 * Optionally warp the mouse to the upper left corner of the window.
+	 */
+	if (WarpOnRaise) {
+	    status = XGetWindowAttributes (dpy, window, &winfo);
+            if (status == FAILURE) return(FALSE);
+ 
+	    status = XWarpPointer (dpy, None, window, 
+	    		 0, 0, 0, 0,
+			 winfo.width >= 7 ? winfo.width - 7 : winfo.width / 2,
+                         winfo.height >= 10 ? 10 : winfo.height / 2);
+            if (status == FAILURE) return(FALSE);
+        }
+    }
+    return(FALSE);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Refresh.c	Sat Apr 13 18:19:26 2019 +0000
@@ -0,0 +1,99 @@
+#ifndef lint
+static char *rcsid_Refresh_c = "$XConsortium: Refresh.c,v 1.5 88/09/06 17:28:39 jim Exp $";
+#endif	/* lint */
+
+/*
+ * Copyright 1985, 1986, 1987, 1988, 1989 by the
+ * Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  M.I.T. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ */
+
+/*
+ * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+ *
+ *                         All Rights Reserved
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Digital Equipment
+ * Corporation not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior permission.
+ *
+ *
+ * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+ 
+
+/*
+ * MODIFICATION HISTORY
+ *
+ * 000 -- M. Gancarz, DEC Ultrix Engineering Group
+ * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group,
+    Western Software Lab. Convert to X11.
+ */
+
+#ifndef lint
+static char *sccsid = "@(#)Refresh.c	3.8	1/24/86";
+#endif
+
+#include "uwm.h"
+#include <stdbool.h>
+
+bool Refresh(window, mask, button, x, y)
+Window window;                          /* Event window. */
+int mask;                               /* Button/key mask. */
+int button;                           /* Button event detail. */
+int x, y;                               /* Event mouse position. */
+{
+    return( Redraw(RootWindow(dpy,scr), mask, button, x, y) );
+}
+
+
+
+bool Redraw(window, mask, button, x, y)
+Window window;                          /* Event window. */
+int mask;                               /* Button/key mask. */
+int button;                             /* Button event detail. */
+int x, y;                               /* Event mouse position. */
+{
+    XWindowAttributes winfo;		/* window info. */
+    Window w;				/* Refresh window. */
+
+    /*
+     * Get info on the target window.
+     */
+    status = XGetWindowAttributes(dpy, window, &winfo);
+    if (status == FAILURE) Error("Refresh -> Can't query target window.");
+
+    /*
+     * Create and map a window which covers the target window, then destroy it.
+     */
+    if ((w = XCreateSimpleWindow(dpy, window, 0, 0, 
+    			   winfo.width, winfo.height, 0,
+                           (Pixmap) 0, (Pixmap) 0)) == NULL)
+        Error("Refresh -> Can't create refresh window.");
+    XMapWindow(dpy, w);
+    XDestroyWindow(dpy, w);
+    XFlush(dpy);
+
+    return(FALSE);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Resize.c	Sat Apr 13 18:19:26 2019 +0000
@@ -0,0 +1,545 @@
+#ifndef lint
+static char *rcsid_Resize_c = "$XConsortium: Resize.c,v 1.33 89/01/10 12:13:13 jim Exp $";
+#endif	/* lint */
+
+/*
+ * Copyright 1985, 1986, 1987, 1988, 1989 by the
+ * Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  M.I.T. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ */
+
+/*
+ * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+ *
+ *                         All Rights Reserved
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Digital Equipment
+ * Corporation not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior permission.
+ *
+ *
+ * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+
+
+/*
+ * MODIFICATION HISTORY
+ *
+ * 000 -- M. Gancarz, DEC Ultrix Engineering Group
+ * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group
+ *        Convert to X11
+ */
+
+#ifndef lint
+static char *sccsid = "@(#)Resize.c	3.8	1/24/86";
+#endif
+
+#include "uwm.h"
+#include <X11/Xatom.h>
+#include <stdlib.h>
+#include <stdbool.h>
+
+#define max(a,b) ( (a) > (b) ? (a) : (b) )
+#define min(a,b) ( (a) > (b) ? (b) : (a) )
+#define makemult(a, b) ((b==1) ? (a) : (((int)((a) / (b))) * (b)) )
+
+#define LARGEST_DIMENSION 0xffff	/* largest unsigned 16 bit number */
+
+bool Resize(window, mask, button, x0, y0)
+Window window;                          /* Event window. */
+int mask;                               /* Button/key mask. */
+int button;                             /* Button event detail. */
+int x0, y0;                             /* Event mouse position; root coords */
+{
+    XWindowAttributes window_info;	/* Event window info. */
+    int x1, y1;                         /* fixed box corner   */
+    int x2, y2;                         /* moving box corner   */
+    int x, y;
+    int xinc, yinc;
+    int minwidth, minheight;
+    int maxwidth, maxheight;
+    int defwidth, defheight;
+    int ox, oy;				/* which quadrant of window */
+    int pop_x, pop_y;			/* location of pop window */
+    int hsize, vsize;			/* dynamic size */
+    int delta;				
+    int root_x, root_y;			/* root window coordinates */
+    int ptrmask;			/* pointer status word */
+    int num_vectors;			/* Number of vectors to XDraw. */
+    Window assoc;			/* Window represented by the icon. */
+    Window sub_win;			/* Mouse query sub window. */
+    Window root;			/* Root query window. */
+    XEvent button_event;		/* Button event packet. */
+    XSegment box[MAX_BOX_VECTORS];	/* Box drawing vertex buffer. */
+    XSegment zap[MAX_ZAP_VECTORS];	/* Zap drawing vertex buffer. */
+    bool stop;				/* Should the window stop changing? */
+    XSizeHints sizehints;
+    XWindowChanges values;
+    int width_offset, height_offset;	/* to subtract if resize increments */
+    int x_offset, y_offset;		/* add to pointer to get anchor */
+    int two_borders;			/* border_width * 2 */
+    int bw;				/* shorthand for border_width */
+    int Rhsize, Rvsize;			/* real versions of size */
+
+    /*
+     * Do nothing if the event window is the root window.
+     */
+    if (window == RootWindow(dpy, scr))
+        return(FALSE);
+
+    /*
+     * Gather info about the event window.
+     */
+    status = XGetWindowAttributes(dpy, window, &window_info);
+    if (status == FAILURE) return(FALSE);
+
+    /*
+     * Do not resize an icon window (NULL for assoc means don't create too). 
+     */
+    if (IsIcon(window, 0, 0, FALSE, NULL))
+        return(FALSE);
+
+    /*
+     * (x0,y0) are in root window coordinates and correspond to where the user
+     * pressed the button that started this action.  window_info.(x,y) are
+     * in root coordinates and represent the upper left, OUTER corner of the
+     * window.  we really want to allow the user to drag out the window WITH
+     * its border.
+     */
+
+    bw = window_info.border_width;
+    two_borders = (bw * 2);
+
+    /*
+     * Clear the vector buffers.
+     */
+    bzero(box, sizeof(box));
+    if (Zap) bzero(zap, sizeof(zap));
+
+    /*
+     * If we are here then we have a resize operation in progress.
+     */
+
+    /*
+     * Turn on the resize cursor.
+     */
+    XChangeActivePointerGrab(dpy, EVENTMASK, ArrowCrossCursor, CurrentTime);
+
+    /*
+     * calculate fixed point (x1, y1) and varying point (x2, y2) for the
+     * inside of the window
+     */
+
+    hsize = defwidth = window_info.width; 
+    vsize = defheight = window_info.height;
+    x1 = window_info.x + window_info.border_width;
+    y1 = window_info.y + window_info.border_width;
+    x2 = x1 + hsize;
+    y2 = y1 + vsize;
+
+    /*
+     * Get the event window resize hint.
+     */
+    sizehints.flags = 0;
+    XGetSizeHints(dpy, window, &sizehints, XA_WM_NORMAL_HINTS); 
+    CheckConsistency(&sizehints);
+
+    /* until there are better WM_HINTS, we'll assume that the client's
+     * minimum width and height are the appropriate offsets to subtract
+     * when resizing with an explicit resize increment.
+     */
+    if (sizehints.flags&PMinSize && sizehints.flags&PResizeInc) {
+        width_offset = sizehints.min_width;
+        height_offset = sizehints.min_height;
+    } else
+        width_offset = height_offset = 0;
+
+    /*
+     * decide what resize mode we are in. Always rubberband if window
+     * is too small.
+     */
+    if (window_info.width > 2 && window_info.height > 2) {
+      ox = ((x0 - window_info.x) * 3) / (window_info.width + two_borders);
+      oy = ((y0 - window_info.y) * 3) / (window_info.height + two_borders);
+      if ((ox + oy) & 1) {
+	if (ox & 1) {
+	    /* fix up size hints so that we will never change width */
+	    sizehints.min_width = sizehints.max_width = window_info.width;
+	    if ((sizehints.flags&PMinSize) == 0) {
+	      sizehints.min_height = 0;
+	      sizehints.flags |= PMinSize;
+	    }
+	    if ((sizehints.flags&PMaxSize) == 0) {
+	      sizehints.max_height = LARGEST_DIMENSION;
+	      sizehints.flags |= PMaxSize;
+	    }
+	}
+	if (oy & 1) {
+	    /* fix up size hints so that we will never change height */
+	    sizehints.min_height = sizehints.max_height = window_info.height;
+	    if ((sizehints.flags&PMinSize)==0) {
+	      sizehints.min_width = 0;
+	      sizehints.flags |= PMinSize;
+	    }
+	    if ((sizehints.flags&PMaxSize)==0) {
+	      sizehints.max_width = LARGEST_DIMENSION;
+	      sizehints.flags |= PMaxSize;
+	    }
+	}
+      }
+    }
+    else ox = oy = 2;
+
+    /*
+     * bump locations and sizes to get outside dimensions from inside
+     */
+
+    x1 -= bw;
+    y1 -= bw;
+    x2 += bw;
+    y2 += bw;
+    hsize += two_borders;
+    vsize += two_borders;
+    width_offset += two_borders;
+    height_offset += two_borders;
+
+    /* change fixed point to one that shouldn't move */
+    if (oy == 0) { 
+	y = y1; y1 = y2; y2 = y;
+    }
+    if (ox == 0) { 
+	x = x1; x1 = x2; x2 = x;
+    }
+
+    if (sizehints.flags&PMinSize) {
+        minwidth = sizehints.min_width;
+        minheight = sizehints.min_height;
+    } else {
+        minwidth = 0;
+        minheight = 0;
+    }
+    minwidth += two_borders;
+    minheight += two_borders;
+
+    if (sizehints.flags&PMaxSize) {
+        maxwidth = max(sizehints.max_width + two_borders, minwidth);
+        maxheight = max(sizehints.max_height + two_borders, minheight);
+    } else {
+	maxwidth = LARGEST_DIMENSION;
+	maxheight = LARGEST_DIMENSION;
+    }
+
+    if (sizehints.flags&PResizeInc) {
+        xinc = sizehints.width_inc;
+        yinc = sizehints.height_inc;
+    } else {
+        xinc = 1;
+        yinc = 1;
+    }
+
+    switch (ox) {
+        case 0: pop_x = x1 - PWidth; break;
+        case 1: pop_x = x1 + (hsize-PWidth)/2; break;
+        case 2: pop_x = x1; break;
+    }
+    switch (oy) {
+        case 0: pop_y = y1 - PHeight; break;
+        case 1: pop_y = y1 + (vsize-PHeight)/2; break;
+        case 2: pop_y = y1; break;
+     }
+    values.x = pop_x;
+    values.y = pop_y;
+    values.stack_mode = Above;
+    XConfigureWindow(dpy, Pop, CWX|CWY|CWStackMode, &values);
+    XMapWindow(dpy, Pop);
+
+    if (Grid) {
+    	num_vectors = StoreGridBox(
+	    box,
+	    MIN(x1, x2), MIN(y1, y2),
+	    MAX(x1, x2), MAX(y1, y2)
+	);
+    }
+    else {
+    	num_vectors = StoreBox(
+	    box,
+	    MIN(x1, x2), MIN(y1, y2),
+	    MAX(x1, x2), MAX(y1, y2)
+	);
+    }
+
+    /*
+     * If we freeze the server, then we will draw solid
+     * lines instead of flickering ones during resizing.
+     */
+    if (Freeze) XGrabServer(dpy);
+
+    /*
+     * Process any pending exposure events before drawing the box.
+     */
+    while (QLength(dpy) > 0) {
+        XPeekEvent(dpy, &button_event);
+        if (((XAnyEvent *)&button_event)->window == RootWindow(dpy, scr) &&
+	    (button_event.type == ButtonPress || 
+	     button_event.type == ButtonRelease))
+             break;
+        GetButton(&button_event);
+    }
+
+    if (ResizeRelative) {
+	x_offset = x2 - x0;
+	y_offset = y2 - y0;
+    } else {
+	x_offset = y_offset = 0;
+    }
+
+    /*
+     * Now draw the box.
+     */
+    DrawBox();
+    Frozen = window;
+
+    stop = FALSE;
+    x = -1; y = -1;
+
+    while (!stop) {
+	if (x != x2 || y != y2) {
+	
+	    x = x2; y = y2;
+	    
+            /*
+             * If we've frozen the server, then erase
+             * the old box.
+             */
+            if (Freeze)
+                DrawBox();
+
+	    if (Grid) {
+	    	num_vectors = StoreGridBox(
+		    box,
+		    MIN(x1, x), MIN(y1, y),
+		    MAX(x1, x), MAX(y1, y)
+		);
+	    }
+	    else {
+	    	num_vectors = StoreBox(
+		    box,
+		    MIN(x1, x), MIN(y1, y),
+		    MAX(x1, x), MAX(y1, y)
+		);
+	    }
+
+            if (Freeze)
+                DrawBox();
+
+	    {
+	        int Hsize = (hsize - width_offset) / xinc;
+		int Vsize = (vsize - height_offset) / yinc;
+		int pos = 5;
+		int n, digits;
+
+		n = digits = 0;
+		if (Hsize > 999) {
+		    PText[0] = (n = (Hsize / 1000)) + '0';
+		    Hsize -= n * 1000; n = 0; digits++;
+		} else {
+		    PText[0] = ' ';
+		}
+		if (Hsize > 99 || digits) {
+		    PText[1] = (n = (Hsize / 100)) + '0';
+		    Hsize -= n * 100; n = 0; digits++;
+		} else {
+		    PText[1] = ' ';
+		}
+		if (Hsize > 9 || digits) {
+		    PText[2] = (n = (Hsize / 10)) + '0';
+		    Hsize -= n * 10; n = 0; digits++;
+		} else {
+		    PText[2] = ' ';
+		}
+		PText[3] = Hsize + '0';
+
+		n = digits = 0;
+		if (Vsize > 999) {
+		    PText[pos++] = (n = (Vsize / 1000)) + '0';
+		    Vsize -= n * 1000; n = 0; digits++;
+		} 
+		if (Vsize > 99 || digits) {
+		    PText[pos++] = (n = (Vsize / 100)) + '0';
+		    Vsize -= n * 100; n = 0; digits++;
+		} 
+		if (Vsize > 9 || digits) {
+		    PText[pos++] = (n = (Vsize / 10)) + '0';
+		    Vsize -= n * 10; n = 0; digits++;
+		} 
+		PText[pos++] = Vsize + '0';
+
+		while (pos < PTEXT_LENGTH) PText[pos++] = ' ';
+	    }
+
+	    /*
+	     * If the font is not fixed width we have to
+	     * clear the window to guarantee that the characters
+	     * that were there before are erased.
+	     */
+	    if (!(PFontInfo->per_char)) XClearWindow(dpy, Pop);
+	    XDrawImageString(
+	        dpy, Pop, PopGC,
+	        PPadding, PPadding+PFontInfo->ascent,
+	        PText, PTextSize);
+	}
+
+        if (!Freeze) {
+            DrawBox();
+            DrawBox();
+        }
+
+	if (XPending(dpy) && !ProcessRequests(box, num_vectors) && GetButton(&button_event)) {
+
+            if ((button_event.type != ButtonPress) && 
+	        (button_event.type != ButtonRelease)) {
+                continue; /* spurious menu event... */
+            }
+
+            if (Freeze) {
+                DrawBox();
+                Frozen = (Window)0;
+                XUngrabServer(dpy);
+            }
+
+	    if ((button_event.type == ButtonRelease) &&
+                (((XButtonReleasedEvent *)&button_event)->button == button)){
+		x2 = ((XButtonReleasedEvent *)&button_event)->x + x_offset;
+		y2 = ((XButtonReleasedEvent *)&button_event)->y + y_offset;
+		stop = TRUE;
+	    }
+	    else {
+		XUnmapWindow(dpy, Pop);
+		ResetCursor(button);
+		return(TRUE);
+	    }
+	}
+	else {
+	    XQueryPointer(dpy, RootWindow(dpy, scr), &root, 
+	    		&sub_win, &root_x, &root_y, &x2, &y2, &ptrmask);
+	    x2 += x_offset;		/* get to anchor point */
+	    y2 += y_offset;
+	    root_x += x_offset;
+	    root_y += y_offset;
+	}
+
+
+	hsize = max(min(abs (x2 - x1), maxwidth), minwidth);
+	hsize = makemult(hsize-minwidth, xinc)+minwidth;
+	Rhsize = hsize - two_borders;
+ 
+	vsize = max(min(abs(y2 - y1), maxheight), minheight);
+	vsize = makemult(vsize-minheight, yinc)+minheight; 
+	Rvsize = vsize - two_borders;
+
+	if (sizehints.flags & PAspect) {
+            if ((Rhsize * sizehints.max_aspect.y > 
+	          Rvsize * sizehints.max_aspect.x)) {
+	       delta = makemult( 
+			 (Rhsize*sizehints.max_aspect.y /
+		         sizehints.max_aspect.x)
+			  - Rvsize, 
+		       yinc); 
+	       if ((vsize+delta <= maxheight))  vsize += delta;
+	       else {
+	         delta = makemult(Rhsize - 
+		     (sizehints.max_aspect.x * Rvsize/sizehints.max_aspect.y), 
+		     xinc);
+		 if (hsize-delta >= minwidth) hsize -= delta; 
+	       }
+            }  
+            if (Rhsize * sizehints.min_aspect.y < Rvsize * 
+		    sizehints.min_aspect.x) {
+	       delta = makemult( 
+		        (sizehints.min_aspect.x * 
+			  Rvsize/sizehints.min_aspect.y) - Rhsize, 
+	 	        xinc);
+	       if (hsize+delta <= maxwidth) hsize += delta;
+	       else {
+	         delta = makemult(
+		       Rvsize - 
+		         (Rhsize*sizehints.min_aspect.y /
+			 sizehints.min_aspect.x), 
+		       yinc); 
+	         if ((vsize-delta >= minheight))  vsize -= delta; 
+	       }
+	    }
+ 		  
+      }
+      if (ox == 0)
+ 	x2 = x1 - hsize;
+      else
+	x2 = x1 + hsize;
+
+      if (oy == 0)
+	y2 = y1 - vsize;
+      else
+    	y2 = y1 + vsize;
+	    
+    }
+    if (x2 < x1) {
+       x = x1; x1 = x2; x2 = x;
+    }
+    if (y2 < y1) {
+        y = y1; y1 = y2; y2 = y;
+    }
+    if ((x1!=window_info.x) || (y1 != window_info.y) || 
+        (Rhsize != window_info.width) ||
+        (Rvsize != window_info.height)) {
+        XMoveResizeWindow(dpy, window, x1, y1, Rhsize, Rvsize);
+    }
+    XUnmapWindow(dpy, Pop);
+    return(TRUE);
+}
+
+CheckConsistency(hints)
+XSizeHints *hints;
+{
+  if (hints->min_height < 0) hints->min_height = 0;
+  if (hints->min_width < 0)  hints->min_width = 0;
+
+  if (hints->max_height <= 0 || hints->max_width <= 0)
+      hints->flags &= ~PMaxSize;
+
+  hints->min_height = min(LARGEST_DIMENSION, hints->min_height);
+  hints->min_width =  min(LARGEST_DIMENSION,  hints->min_width);
+
+  hints->max_height = min(LARGEST_DIMENSION, hints->max_height);
+  hints->max_width =  min(LARGEST_DIMENSION,  hints->max_width);
+
+  if ((hints->flags&PMinSize) && (hints->flags&PMaxSize) && 
+   ((hints->min_height > hints->max_height) ||
+    (hints->min_width > hints->max_width)))
+	hints->flags &= ~(PMinSize|PMaxSize);
+
+  if ((hints->flags&PAspect) && 
+   (hints->min_aspect.x * hints->max_aspect.y > 
+     hints->max_aspect.x * hints->min_aspect.y))
+	hints->flags &= ~(PAspect);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Restart.c	Sat Apr 13 18:19:26 2019 +0000
@@ -0,0 +1,96 @@
+/*
+ * Copyright 1985, 1986, 1987, 1988, 1989 by the
+ * Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  M.I.T. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ */
+
+/*
+ * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+ *
+ *                         All Rights Reserved
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Digital Equipment
+ * Corporation not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior permission.
+ *
+ *
+ * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+/*
+ * MODIFICATION HISTORY
+ *
+ * 000 -- M. Gancarz, DEC Ultrix Engineering Group
+ * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group,
+    Western Software Lab. Convert to X11.
+ */
+
+#ifndef lint
+static char *sccsid = "%W%	%G%";
+#endif
+
+#include <stdlib.h>
+#include "uwm.h"
+#include <stdbool.h>
+
+bool Restart(window, mask, button, x, y)
+Window window;                          /* Event window. */
+int mask;                               /* Button/key mask. */
+int button;                           /* Button event detail. */
+int x, y;                               /* Event mouse position. */
+{
+	XButtonEvent button_event;
+	int percentage;
+	int i;
+
+	percentage = VOLUME_PERCENTAGE(Volume);
+	XBell(dpy, percentage);
+	XBell(dpy, percentage);
+	XSync (dpy, 0);
+	/*
+	 * Gag, rely on operating system to close connection because we don't
+	 * to mess ourselves up in case the exec fails.
+	 */
+#if 0
+	execvp(*Argv, Argv, Environ);
+#else
+	execvp(*Argv, Argv);
+#endif
+	for (i = 0; i < 4; i++)
+	{
+		XBell(dpy, percentage);
+		percentage += 10;
+		if (percentage > 100) percentage = 100;
+	}
+	XSync (dpy, 0);
+	fprintf(stderr, "%s:  Restart failed!\n", *Argv);
+}
+
+bool Quit(window, mask, button, x, y)
+Window window;                          /* Event window. */
+int mask;                               /* Button/key mask. */
+int button;                           /* Button event detail. */
+int x, y;                               /* Event mouse position. */
+{
+	exit(0);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/RubberBand.c	Sat Apr 13 18:19:26 2019 +0000
@@ -0,0 +1,467 @@
+/* $XConsortium: RubberBand.c,v 1.33 88/10/22 15:19:00 jim Exp $ */
+/* derived from XCreateTerm.c */
+
+/*
+ * Copyright 1985, 1986, 1987, 1988, 1989 by the
+ * Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  M.I.T. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ */
+#include <stdlib.h>
+
+/*
+ * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+ *
+ *                         All Rights Reserved
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Digital Equipment
+ * Corporation not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior permission.
+ *
+ *
+ * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+/*
+ * MODIFICATION HISTORY
+ *
+ * 000 -- Loretta Guarino Reid, DEC Ultrix Engineering Group
+ * 001 -- Ralph R. Swick, DEC/MIT Project Athena
+ *	  tailor to uwm; use global resources created by uwm
+ */
+
+#include "uwm.h"
+#include <stdbool.h>
+#include <X11/cursorfont.h>
+
+#define max(a,b) ( (a) > (b) ? (a) : (b) )
+#define min(a,b) ( (a) > (b) ? (b) : (a) )
+#define abs(a) ( (a) > 0 ? (a) : -(a))
+#define makemult(a, b) ((b==1) ? (a) : (((int)((a) / (b))) * (b)) )
+
+#define LARGEST_DIMENSION 0xffff	/* largest unsigned 16 bit number */
+
+#define DCOUNT 2
+#define PCOUNT 1 + (4 * 2 * DCOUNT)
+
+#define BW	PBorderWidth		/* pop-up window border width */
+#define IBW	PPadding		/* internal border width for pop-up */
+
+void AskUser(Display *dpy, int scr, Window window, int *x, int *y, int *width, int *height, XSizeHints *hints)
+	{
+	/* XFontStruct *pfont; */
+#define pfont	PFontInfo		/* text font for pop-up */
+	Cursor ur, ul, ll, lr;          /* cursors for rubber banding    */
+	int change_cursor = FALSE;
+        int current_cursor;
+        char *text;			/* text for prompt string       */
+        int nz;                         /* count where zeros are        */
+        int popw, poph;                 /* width and height of prompt window*/
+        /* int pfore, pback; */         /* prompt foreground and background */
+#define pbord	 PBorder
+#define pback	 PTextBackground
+#define pfore	 PTextForeground
+	/* GC popGC, invertGC; */
+	/* XGCValues xgc; */
+#define popGC	 PopGC
+#define invertGC DrawGC
+        int x1, y1;                     /* location of mouse            */
+        int x2, y2;                     /* other corner of box          */
+        int rootx, rooty, mask;         /* for XQueryPointer          */
+	Window root, subw;		/* for XQueryPointer */
+        int xa = -1, ya = -1, xb = -1, yb = -1;
+        int xinc = 1, yinc = 1;
+        int minwidth, minheight;
+        int maxwidth, maxheight;
+        int defwidth, defheight;
+        int chosen = -1;
+        int stop;
+        int changed;
+        int dx, dy;
+	int delta;
+	XPoint box[PCOUNT];
+        int hsize, vsize;
+        XEvent e;                 /* someplace to put the event   */
+        int events;                     /* what events we want.             */
+        Window pop;                     /* pop up prompt window         */
+	int i;
+	char *name;
+	bool free_name;
+	int width_offset, height_offset; /* to subtract if resize increments */
+	XSetWindowAttributes attr;	/* for setting save unders flag */
+	int border_width;		/* width of border around window */
+	int two_borders;		/* twice border_width */
+	int Rhsize, Rvsize, Rdx, Rdy;	/* real sizes */
+
+	if (hints->flags & USPosition) {
+	  *x = hints->x;
+	  *y = hints->y;
+	  *width = hints->width;
+	  *height = hints->height;
+          if (hints->flags & PMinSize) {
+	      if (*width < hints->min_width) *width = hints->min_width;
+	      if (*height < hints->min_height) *height = hints->min_height;
+	  }
+	  return;
+	}
+
+	free_name = False;		/* kludge for broken XFetchNames */
+        if (!XFetchName(dpy, window, &name)) {	/* if failure */
+	    name = "unnamed window";
+	} else if (!name) {			/* if success but no name */
+	    name = "";
+	} else {				/* if has name */
+	    free_name = True;
+	}
+
+	ur = XCreateFontCursor(dpy, XC_ur_angle);
+	ul = XCreateFontCursor(dpy, XC_ul_angle);
+	ll = XCreateFontCursor(dpy, XC_ll_angle);
+	lr = XCreateFontCursor(dpy, XC_lr_angle);
+	current_cursor = ul;
+
+	events = ButtonPressMask | ButtonReleaseMask;
+	/* pfont = XLoadQueryFont(dpy, "fixed"); */
+
+	/* 
+	 * go get the mouse as soon as you can 
+	 */
+
+	while (1) {
+	        int res;
+		if ((res = XGrabPointer (dpy, RootWindow(dpy, scr), FALSE, events, 
+		  GrabModeAsync, GrabModeAsync, None, ul, CurrentTime )) == 
+		    GrabSuccess)
+		  break;
+		sleep (1);
+	}
+	nz = strlen(name);		/* compute number of characters */
+	text = (char *)malloc (nz + 13);
+	(void) strcpy(text, name);
+	(void) strcat(text, ": 0000x0000");
+	nz += 11;
+	popw = XTextWidth (pfont, text, nz) + 2 * IBW;
+	poph = pfont->ascent+pfont->descent + 2 * IBW;
+
+	/* pfore = WhitePixel(dpy, scr);
+	 * pback = BlackPixel(dpy, scr);
+         * xgc.foreground = pfore;
+         * xgc.background = pback;
+	 * xgc.font = pfont->fid;
+	 * popGC = XCreateGC(dpy, RootWindow(dpy, scr),
+	 *    GCForeground+GCBackground+GCFont, &xgc);
+	 * xgc.function = GXinvert;
+	 * xgc.subwindow_mode = IncludeInferiors;
+	 * invertGC = XCreateGC(dpy, RootWindow(dpy, scr),
+	 *   GCForeground+GCBackground+GCFont+GCFunction+GCSubwindowMode, &xgc);
+	 */
+
+	pop = XCreateSimpleWindow(dpy, RootWindow(dpy, scr), 
+		0, 0, popw, poph, BW, pbord, pback);
+	attr.save_under = True;
+	attr.event_mask = (VisibilityChangeMask | ExposureMask);
+	XChangeWindowAttributes (dpy, pop, (CWSaveUnder | CWEventMask), &attr);
+	XMapWindow (dpy, pop);
+
+	/*
+	 * get the current size and border width to use as defaults
+	 */
+	{
+	    Window root;
+	    unsigned int dummyint;
+
+	    XGetGeometry (dpy, window, &root, &dummyint, &dummyint,
+			  &defwidth, &defheight, &border_width, &dummyint);
+	    two_borders = border_width * 2;
+	}
+
+	if (hints->flags&PMinSize) {
+	  minwidth = hints->min_width;
+	  minheight = hints->min_height;
+	} else {
+	  minwidth = 0;
+	  minheight = 0;
+	}
+	minwidth += two_borders;
+	minheight += two_borders;
+
+	if (hints->flags&PMaxSize) {
+	  maxwidth = max(hints->max_width+two_borders, minwidth);
+	  maxheight = max(hints->max_height+two_borders, minheight);
+	} else {
+	  maxwidth = LARGEST_DIMENSION;
+	  maxheight = LARGEST_DIMENSION;
+	}
+	if (hints->flags&PResizeInc) {
+	  xinc = hints->width_inc;
+	  yinc = hints->height_inc;
+	}
+	if (xinc <= 0) xinc = 1;
+	if (yinc <= 0) yinc = 1;
+
+	if (hints->flags&PSize || hints->flags&USSize) {
+	  defwidth = hints->width;
+	  defheight = hints->height;
+	} else if (hints->flags&PMinSize) {
+	  defwidth = hints->min_width;
+	  defheight = hints->min_height;
+	} else if (hints->flags&PMaxSize) {
+	  defwidth = hints->max_width;
+	  defheight = hints->max_height;
+        }
+	defwidth += two_borders;
+	defheight += two_borders;
+
+      /* until there are better WM_HINTS, we'll assume that the client's
+       * minimum width and height are the appropriate offsets to subtract
+       * when resizing with an explicit resize increment.
+       */
+      if (hints->flags&PMinSize && hints->flags&PResizeInc) {
+	  width_offset = hints->min_width;
+	  height_offset = hints->min_height;
+      } else
+	  width_offset = height_offset = 0;
+
+	width_offset += two_borders;
+	height_offset += two_borders;
+
+	XQueryPointer (dpy, RootWindow(dpy, scr), &root, &subw, 
+	  &rootx, &rooty, &x1, &y1, &mask);
+	hsize = defwidth;		/* already includes border_width */
+	vsize = defheight;		/* already includes border_width */
+	x2 = x1+hsize; 
+	y2 = y1+vsize;
+	stop = FALSE;
+	changed = TRUE;
+
+	while (stop == FALSE) {
+	    if ( (xb != max (x1, x2)) || (yb != max (y1, y2))
+		||(xa != min (x1, x2)) || (ya != min (y1, y2)) ) {
+		xa = min (x1, x2);
+		ya = min (y1, y2);
+		xb = max (x1, x2);
+		yb = max (y1, y2);
+		for ( i = 0; i < PCOUNT; i += 4) {
+                    box[i].x = xa; box[i].y = ya;
+                    if (i+1 == PCOUNT) break;
+                    box[i+1].x = xb; box[i+1].y = ya;
+                    box[i+2].x = xb; box[i+2].y = yb;
+                    box[i+3].x = xa; box[i+3].y = yb;
+                }
+	    }
+	    if (XPending (dpy) &&
+		XCheckWindowEvent (dpy, pop, ~NoEventMask, &e)) {
+		switch (e.type) {
+		  case VisibilityNotify:
+		    if (((XVisibilityEvent *)&e)->state != 
+		        VisibilityUnobscured) 
+		      XRaiseWindow (dpy, pop);
+		    continue;		/* go to top of while loop */
+		  case Expose:
+		    changed = TRUE;
+		    break;		/* but go to next if statement */
+		  default:
+		    break;		/* ignore it */
+		}
+	    }
+	    if (changed) {
+	        int Hsize = (hsize - width_offset) / xinc;
+		int Vsize = (vsize - height_offset) / yinc;
+		int pos = 4;
+		int n, digits;
+
+		/* text consists of strcat (name, ": 0000x0000"), nz = len */
+
+		changed = FALSE;
+		n = digits = 0;
+		if (Hsize > 999) {
+		    text[nz - 9] = (n = (Hsize / 1000)) + '0';
+		    Hsize -= n * 1000; n = 0; digits++;
+		} else {
+		    text[nz - 9] = ' ';
+		}
+		if (Hsize > 99 || digits) {
+		    text[nz - 8] = (n = (Hsize / 100)) + '0';
+		    Hsize -= n * 100; n = 0; digits++;
+		} else {
+		    text[nz - 8] = ' ';
+		}
+		if (Hsize > 9 || digits) {
+		    text[nz - 7] = (n = (Hsize / 10)) + '0';
+		    Hsize -= n * 10; n = 0; digits++;
+		} else {
+		    text[nz - 7] = ' ';
+		}
+		text[nz - 6] = Hsize + '0';
+
+		n = digits = 0;
+		if (Vsize > 999) {
+		    text[nz - pos--] = (n = (Vsize / 1000)) + '0';
+		    Vsize -= n * 1000; n = 0; digits++;
+		} 
+		if (Vsize > 99 || digits) {
+		    text[nz - pos--] = (n = (Vsize / 100)) + '0';
+		    Vsize -= n * 100; n = 0; digits++;
+		} 
+		if (Vsize > 9 || digits) {
+		    text[nz - pos--] = (n = (Vsize / 10)) + '0';
+		    Vsize -= n * 10; n = 0; digits++;
+		} 
+		text[nz - pos--] = Vsize + '0';
+
+		while (pos > 0) text[nz - pos--] = ' ';
+
+		XDrawImageString(dpy, pop, popGC, IBW, IBW+pfont->ascent,
+			text, nz);
+	    }
+	    XDrawLines (dpy, RootWindow(dpy, scr), invertGC, box, PCOUNT, 
+			CoordModeOrigin);
+            if (XPending(dpy) &&
+		XCheckMaskEvent(dpy, ButtonPressMask|ButtonReleaseMask, &e)) {
+                if ((chosen < 0) && (e.type == ButtonPress)) {
+			x1 = x2 = ((XButtonEvent *)&e)->x;
+                        y1 = y2 = ((XButtonEvent *)&e)->y;
+                        chosen = ((XButtonEvent *)&e)->button;
+			if (chosen == Button2)
+				change_cursor = TRUE;
+                }
+                else if ((e.type == ButtonRelease) &&
+                        ((((XButtonEvent *)&e)->button) == chosen)) {
+                	x2 = ((XButtonEvent *)&e)->x;
+                	y2 = ((XButtonEvent *)&e)->y;
+                        stop = TRUE;
+                }
+		else
+                        XQueryPointer (dpy, RootWindow(dpy, scr), &root, 
+			  &subw, &rootx, &rooty, &x2, &y2, &mask);
+            }
+            else        XQueryPointer (dpy, RootWindow(dpy, scr), &root, 
+	    		  &subw, &rootx, &rooty, &x2, &y2, &mask);
+	    if (change_cursor) {
+                if ((x2 >= x1) && (y2 >= y1) &&
+                    current_cursor != lr) {
+                    XChangeActivePointerGrab (dpy, events, lr, CurrentTime );
+                    current_cursor = lr;
+               }
+                else if ((x2 >= x1) && (y2 < y1) &&
+                         current_cursor != ur) {
+                    XChangeActivePointerGrab (dpy, events, ur, CurrentTime );
+                    current_cursor = ur;
+                }
+                else if ((x2 < x1) && (y2 >= y1) &&
+                         current_cursor != ll) {
+                    XChangeActivePointerGrab (dpy, events, ll, CurrentTime );
+                    current_cursor = ll;
+                }
+                else if ((x2 < x1) && (y2 < y1) &&
+                         (current_cursor != ul)) {
+                    XChangeActivePointerGrab (dpy, events, ul, CurrentTime );
+                    current_cursor = ul;
+                }
+	    }
+	    if (chosen != Button2) {
+		x1 = x2;
+		y1 = y2;
+		if (chosen >= 0) {
+			x2 = defwidth;
+			if (chosen == Button1)
+				y2 = defheight;
+			else
+				y2 = (DisplayHeight(dpy, scr) - y1);
+			x2 = x1 + x2;
+			y2 = y1 + y2;
+		} else {
+		    x2 = x1 + defwidth;
+		    y2 = y1 + defheight;
+		}
+	    }
+
+	    dx = max(min(abs (x2 - x1), maxwidth), minwidth);
+	    dx = makemult(dx-minwidth, xinc)+minwidth; 
+	    Rdx = dx - two_borders;
+
+	    dy = max(min(abs(y2 - y1), maxheight), minheight);
+	    dy = makemult(dy-minheight, yinc)+minheight; 
+	    Rdy = dy - two_borders;
+	    
+	    if (hints->flags & PAspect) {
+                if ((Rdx * hints->max_aspect.y > Rdy * hints->max_aspect.x)) {
+		   delta = makemult( 
+		       (Rdx*hints->max_aspect.y/hints->max_aspect.x) - Rdy, 
+		       yinc); 
+		   if ((dy+delta) <= maxheight)  dy += delta;
+		   else {
+		     delta = makemult(
+		        Rdx - hints->max_aspect.x * Rdy/hints->max_aspect.y, 
+			xinc);
+		     if ((dx-delta) >= minwidth) dx -= delta;
+		   }
+		}
+                if (Rdx * hints->min_aspect.y < Rdy * hints->min_aspect.x) {
+		   delta = makemult( 
+		        (hints->min_aspect.x * Rdy/hints->min_aspect.y) - Rdx,
+			xinc);
+		   if (dx+delta <= maxwidth) dx += delta;
+		   else {
+		     delta = makemult(
+		       Rdy - (Rdx*hints->min_aspect.y / hints->min_aspect.x), 
+		       yinc); 
+		     if ((dy-delta) >= minheight) dy -= delta;
+		   }
+		}
+		  
+	    }
+
+	    if (dx != hsize) {
+	    	hsize = dx;
+		changed = TRUE;
+	    }
+	    if (dy != vsize) {
+	    	vsize = dy;
+		changed = TRUE;
+	    }
+	    if (x2 < x1)
+		x2 = x1 - dx;
+	    else
+		x2 = x1 + dx;
+
+	    if (y2 < y1)
+		y2 = y1 - dy;
+	    else
+	    	y2 = y1 + dy;
+	}
+	XUngrabPointer(dpy, CurrentTime);
+
+	XDestroyWindow (dpy, pop);
+	/* XFreeFont(dpy, pfont); */
+	XFreeCursor (dpy, ur);
+	XFreeCursor (dpy, ul);
+	XFreeCursor (dpy, lr);
+	XFreeCursor (dpy, ll);
+	if (free_name) free(name);
+	free(text);
+	*x = min(x1, x2);
+	*y = min(y1, y2);
+	*width = hsize - two_borders;
+	*height = vsize - two_borders;
+	XSync(dpy, False);
+	}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/StoreBox.c	Sat Apr 13 18:19:26 2019 +0000
@@ -0,0 +1,117 @@
+#ifndef lint
+static char *rcsid_StoreBox_c = "$XConsortium: StoreBox.c,v 1.4 88/09/06 17:28:43 jim Exp $";
+#endif	/* lint */
+
+/*
+ * Copyright 1985, 1986, 1987, 1988, 1989 by the
+ * Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  M.I.T. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ */
+
+/*
+ * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+ *
+ *                         All Rights Reserved
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Digital Equipment
+ * Corporation not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior permission.
+ *
+ *
+ * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+ 
+
+/*
+ * MODIFICATION HISTORY
+ *
+ * 000 -- M. Gancarz, DEC Ultrix Engineering Group
+ * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group,
+    Western Software Lab. Convert to X11.
+ */
+
+#ifndef lint
+static char *sccsid = "@(#)StoreBox.c	3.8	1/24/86";
+#endif
+/*
+ *	StoreBox - This subroutine is used by the X Window Manager (xwm)
+ *	to store the vertices for the resize / movement box in a vertex list.
+ */
+
+#include "uwm.h"
+
+/*
+ * Store the vertices for the resize movement box in a vertex list.
+ */
+int StoreBox(box, ulx, uly, lrx, lry)
+register XSegment box[];
+int ulx;			/* Upper left X coordinate. */
+int uly;			/* Upper left Y coordinate. */
+int lrx;			/* Lower right X coordinate. */
+int lry;			/* Lower right Y coordinate. */
+{
+    /*
+     * Xor in.
+     */
+
+    box[0].x1 = ulx; box[0].y1 = uly;
+    box[0].x2 = lrx; box[0].y2 = uly;
+
+    box[1].x1 = lrx; box[1].y1 = uly;
+    box[1].x2 = lrx; box[1].y2 = lry;
+
+    box[2].x1 = lrx; box[2].y1 = lry;
+    box[2].x2 = ulx; box[2].y2 = lry;
+
+    box[3].x1 = ulx; box[3].y1 = lry;
+    box[3].x2 = ulx; box[3].y2 = uly;
+
+
+    /*
+     * If we freeze the screen, don't bother to xor out.
+     */
+    if (Freeze)
+        return(4);
+
+    /*
+     * Xor out.
+     */
+    box[4].x1 = ulx; box[4].y1 = uly;
+    box[4].x2 = lrx; box[4].y2 = uly;
+
+    box[5].x1 = lrx; box[5].y1 = uly;
+    box[5].x2 = lrx; box[5].y2 = lry;
+
+    box[6].x1 = lrx; box[6].y1 = lry;
+    box[6].x2 = ulx; box[6].y2 = lry;
+
+    box[7].x1 = ulx; box[7].y1 = lry;
+    box[7].x2 = ulx; box[7].y2 = uly;
+
+
+    /*
+     * Total number of vertices is 8.
+     */
+    return(8);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/StoreZap.c	Sat Apr 13 18:19:26 2019 +0000
@@ -0,0 +1,113 @@
+#ifndef lint
+static char *rcsid_StoreZap_c = "$XConsortium: StoreZap.c,v 1.4 88/09/06 17:28:44 jim Exp $";
+#endif	/* lint */
+
+/*
+ * Copyright 1985, 1986, 1987, 1988, 1989 by the
+ * Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  M.I.T. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ */
+
+/*
+ * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+ *
+ *                         All Rights Reserved
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Digital Equipment
+ * Corporation not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior permission.
+ *
+ *
+ * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+ 
+
+/*
+ * MODIFICATION HISTORY
+ *
+ * 000 -- M. Gancarz, DEC Ultrix Engineering Group
+ * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group,
+    Western Software Lab. Convert to X11.
+ */
+
+#ifndef lint
+static char *sccsid = "@(#)StoreZap.c	3.8	1/24/86";
+#endif
+/*
+ *	StoreZap - This subroutine is used by the X Window Manager (xwm)
+ *	to store the vertices for the iconify, uniconify zap.
+ *
+ */
+
+#include "uwm.h"
+
+/*
+ * Store the vertices for the zap effect.
+ */
+int StoreZap(zap, ulx_1, uly_1, lrx_1, lry_1, ulx_2, uly_2, lrx_2, lry_2)
+    register XSegment zap[];
+    int ulx_1;		/* From window, upper left X coordinate. */
+    int uly_1;		/* From window, upper left Y coordinate. */
+    int lrx_1;		/* From window, lower right X coordinate. */
+    int lry_1;		/* From window, lower right Y coordinate. */
+    int ulx_2;		/* To window, upper left X coordinate. */
+    int uly_2;		/* To window, upper left Y coordinate. */
+    int lrx_2;		/* To window, lower right X coordinate. */
+    int lry_2;		/* To window, lower right Y coordinate. */
+{
+
+    /*
+     * Xor in.
+     */
+    zap[0].x1 = ulx_1;	zap[0].y1 = uly_1;
+    zap[0].x2 = ulx_2;	zap[0].y2 = uly_2;
+
+    zap[1].x1 = lrx_1;	zap[1].y1 = uly_1;
+    zap[1].x2 = lrx_2;	zap[1].y2 = uly_2;
+
+    zap[2].x1 = lrx_1;	zap[2].y1 = lry_1;
+    zap[2].x2 = lrx_2;	zap[2].y2 = lry_2;
+
+    zap[3].x1 = ulx_1;	zap[3].y1 = lry_1;
+    zap[3].x2 = ulx_2;	zap[3].y2 = lry_2;
+
+    /*
+     * Xor out.
+     */
+    zap[4].x1 = ulx_1;	zap[4].y1 = uly_1;
+    zap[4].x2 = ulx_2;	zap[4].y2 = uly_2;
+
+    zap[5].x1 = lrx_1;	zap[5].y1 = uly_1;
+    zap[5].x2 = lrx_2;	zap[5].y2 = uly_2;
+
+    zap[6].x1 = lrx_1;	zap[6].y1 = lry_1;
+    zap[6].x2 = lrx_2;	zap[6].y2 = lry_2;
+
+    zap[7].x1 = ulx_1;	zap[7].y1 = lry_1;
+    zap[7].x2 = ulx_2;	zap[7].y2 = lry_2;
+    /*
+     * Total number of vertices is 8.
+     */
+    return(8);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/X11/copyright.h	Sat Apr 13 18:19:26 2019 +0000
@@ -0,0 +1,15 @@
+/*
+ * Copyright 1985, 1986, 1987, 1988, 1989 by the
+ * Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  M.I.T. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/XError.c	Sat Apr 13 18:19:26 2019 +0000
@@ -0,0 +1,76 @@
+#ifndef lint
+static char *rcsid_XError_c = "$XConsortium: XError.c,v 1.7 88/09/22 10:53:35 jim Exp $";
+#endif
+
+/*
+ * Copyright 1985, 1986, 1987, 1988, 1989 by the
+ * Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  M.I.T. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ */
+
+/*
+ * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+ *
+ *                         All Rights Reserved
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Digital Equipment
+ * Corporation not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior permission.
+ *
+ *
+ * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+ 
+
+/*
+ * MODIFICATION HISTORY
+ *
+ * 000 -- M. Gancarz, DEC Ultrix Engineering Group
+ */
+
+#ifndef lint
+static char *sccsid = "@(#)XError.c	3.8	1/24/86";
+#endif
+
+#include "uwm.h"
+
+int XError(dpy, rep)
+Display *dpy;
+XErrorEvent *rep;
+{
+#ifdef DEBUG
+	char buffer[BUFSIZ];
+	XGetErrorText(dpy, rep->error_code, buffer, BUFSIZ);
+	fprintf(stderr, "uwm: X error occurred during a uwm operation.\n");
+	fprintf(stderr, "     Description: '%s'\n", buffer);
+	fprintf(stderr, "     Request code: %d\n", rep->request_code);
+	fprintf(stderr, "     Request function: %d\n", rep->func);
+	fprintf(stderr, "     Request window 0x%x\n", rep->window);
+	fprintf(stderr, "     Error Serial #%d\n", rep->serial);
+	fprintf(stderr, "     Current serial #%d\n", dpy->request);
+#endif
+	x_error_occurred = TRUE;
+	last_error_event = *rep;
+	return (0);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/caddr.h	Sat Apr 13 18:19:26 2019 +0000
@@ -0,0 +1,1 @@
+typedef void * caddr_t;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/colormap.c	Sat Apr 13 18:19:26 2019 +0000
@@ -0,0 +1,370 @@
+/* $XConsortium: colormap.c,v 1.4 88/10/20 12:14:19 jim Exp $ */
+
+/*
+ * Copyright 1985, 1986, 1987, 1988, 1989 by the
+ * Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  M.I.T. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ */
+
+#include <stdlib.h>
+#include <stdbool.h>
+#include "uwm.h"
+
+static void installColormap (Colormap colormap);
+
+bool	focusPointerRoot;
+
+Window
+getMouse ()
+{
+	Window root, child;
+	int root_x, root_y, x, y;
+	unsigned int mask;
+
+	XQueryPointer (dpy, RootWindow (dpy, scr), &root, &child, &root_x, &root_y, &x, &y, &mask);
+	return child ? child : root;
+}
+
+initColormap ()
+{
+	Colormap	*colormaps;
+	int		ncolormaps;
+	int		i;
+	extern int	initColormapTrack (), colormapTrack ();
+	
+	colormaps = XListInstalledColormaps (dpy, RootWindow (dpy, scr), &ncolormaps);
+	for (i = 0; i < ncolormaps; i++)
+		noteInstalledColormap (colormaps[i]);
+	expressWindowInterest (initColormapTrack, colormapTrack);
+	focusPointerRoot = TRUE;
+}
+
+initColormapTrack (wi, wa)
+	WindowInfo		*wi;
+	XWindowAttributes	*wa;
+{
+	if (wa)
+	{
+		wi->colormap = wa->colormap;
+		wi->event_mask |= EnterWindowMask|LeaveWindowMask|ColormapChangeMask|FocusChangeMask;
+		wi->in_window = FALSE;
+		noteWindowAttached (wi->window, wi->colormap);
+		if (getMouse () == wi->window)
+		{
+			wi->in_window = TRUE;
+			installColormap (wi->colormap);
+		}
+	}
+	else
+	{
+		wi->event_mask &= ~EnterWindowMask|LeaveWindowMask|ColormapChangeMask|FocusChangeMask;
+		if (wi->in_window)
+			uninstallColormap (wi->colormap);
+		noteWindowUnattached (wi->window, wi->colormap);
+	}
+}
+
+colormapTrack (wi, ev)
+	WindowInfo	*wi;
+	XAnyEvent	*ev;
+{
+	XColormapEvent	*cev;
+	XCrossingEvent	*eev;
+	XFocusChangeEvent	*fev;
+
+	switch (ev->type)
+	{
+	case ColormapNotify:
+		cev = (XColormapEvent *) ev;
+		switch (cev->state)
+		{
+		case ColormapInstalled:
+			noteInstalledColormap (cev->colormap);
+			break;
+		case ColormapUninstalled:
+			noteUninstalledColormap (cev->colormap);
+			break;
+		}
+		if (cev->new)
+		{
+			if (wi->in_window)
+			{
+#ifdef DEBUG
+				printf ("reset colormap ");
+#endif /* DEBUG */
+				uninstallColormap (wi->colormap);
+				wi->colormap = cev->colormap;
+#ifdef DEBUG
+				printf ("reset colormap ");
+#endif /* DEBUG */
+				installColormap (wi->colormap);
+			}
+			else
+				wi->colormap = cev->colormap;
+		}
+		break;
+	case FocusIn:
+		fev = (XFocusChangeEvent *) ev;
+		switch (fev->detail)
+		{
+		case NotifyInferior:	/* might be root */
+			if (fev->window != RootWindow (dpy, scr))
+				break;
+			goto focusIn;
+		case NotifyNonlinearVirtual:	/* don't want root */
+			if (fev->window == RootWindow (dpy, scr))
+				break;
+		case NotifyNonlinear:	/* might be root */
+		case NotifyVirtual:	/* can't be root */
+		case NotifyAncestor:
+		case NotifyPointer:
+		focusIn:
+			if (fev->window == RootWindow (dpy, scr))
+				focusPointerRoot = TRUE;
+#ifdef DEBUG
+			printf ("FocusIn ");
+#endif /* DEBUG */
+			wi->in_window = TRUE;
+			installColormap (wi->colormap);
+			break;
+		case NotifyPointerRoot:
+			focusPointerRoot = TRUE;
+			break;
+		case NotifyDetailNone:
+			XSetInputFocus (dpy, PointerRoot, RevertToPointerRoot, CurrentTime);
+			break;
+		}
+		break;
+	case FocusOut:
+		fev = (XFocusChangeEvent *) ev;
+		switch (fev->detail)
+		{
+		case NotifyInferior:	/* might be root */
+			if (fev->window != RootWindow (dpy, scr))
+				break;
+		case NotifyNonlinearVirtual:	/* don't want root */
+		case NotifyNonlinear:	/* might be root */
+		case NotifyVirtual:	/* can't be root */
+		case NotifyAncestor:
+		case NotifyPointer:
+			if (fev->window == RootWindow (dpy, scr))
+				focusPointerRoot = FALSE;
+#ifdef DEBUG
+			printf ("FocusOut %x %d ", fev->window, fev->detail);
+#endif /* DEBUG */
+			wi->in_window = FALSE;
+			uninstallColormap (wi->colormap);
+			break;
+		case NotifyPointerRoot:
+			focusPointerRoot = FALSE;
+			break;
+		case NotifyDetailNone:
+			break;
+		}
+		break;
+		/*
+		 * simulate focusin/focusout events in pointer root mode
+		 */
+	case EnterNotify:
+		eev = (XCrossingEvent *) ev;
+		if (eev->mode != NotifyGrab && focusPointerRoot)
+		{
+			switch (eev->detail) {
+			case NotifyInferior:
+				if (eev->window != RootWindow (dpy, scr))
+					break;
+				goto enter;
+			case NotifyNonlinearVirtual:
+				if (eev->window == RootWindow (dpy, scr))
+					break;
+			case NotifyVirtual:
+			case NotifyAncestor:
+			case NotifyNonlinear:
+			enter:
+				wi->in_window = TRUE;
+#ifdef DEBUG
+				printf ("EnterNotify %6x %2d ", eev->window, eev->detail);
+#endif /* DEBUG */
+				installColormap (wi->colormap);
+			}
+		}
+		break;
+	case LeaveNotify:
+		eev = (XCrossingEvent *) ev;
+		if (eev->mode != NotifyGrab && focusPointerRoot) {
+			switch (eev->detail) {
+			case NotifyInferior:
+				if (eev->window != RootWindow (dpy, scr))
+					break;
+			case NotifyNonlinearVirtual:
+			case NotifyVirtual:
+			case NotifyAncestor:
+			case NotifyNonlinear:
+				wi->in_window = FALSE;
+#ifdef DEBUG
+				printf ("LeaveNotify %6x %2d ", eev->window, eev->detail);
+#endif /* DEBUG */
+				uninstallColormap (wi->colormap);
+				break;
+			}
+		}
+		break;
+	}
+}
+
+struct colormapInfo {
+	struct colormapInfo	*next;
+	Colormap		colormap;
+	int			window_count;	/* number of windows using this colormap */
+	bool			actual;
+	bool			desired;
+};
+
+static struct colormapInfo	*colormaps;
+
+static struct colormapInfo *
+lookupColormap (colormap)
+	Colormap	colormap;
+{
+	struct colormapInfo	*ci;
+
+	for (ci = colormaps; ci; ci=ci->next)
+		if (ci->colormap == colormap)
+			return ci;
+	ci = (struct colormapInfo *) malloc (sizeof (*ci));
+	ci->actual = FALSE;
+	ci->desired = FALSE;
+	ci->window_count = 0;
+	ci->next = colormaps;
+	ci->colormap = colormap;
+	colormaps = ci;
+	return ci;
+}
+
+deleteColormap (colormap)
+	Colormap	colormap;
+{
+	struct colormapInfo	*ci, *prev;
+
+	prev = 0;
+	for (ci = colormaps; ci; ci=ci->next) {
+		if (ci->colormap == colormap) {
+			if (prev)
+				prev->next = ci->next;
+			else
+				colormaps = ci->next;
+			free ((char *) ci);
+			break;
+		}
+		prev = ci;
+	}
+}
+
+noteWindowAttached (window, colormap)
+	Window	window;
+	Colormap	colormap;
+{
+	struct colormapInfo	*ci;
+
+	ci = lookupColormap (colormap);
+	ci->window_count++;
+}
+
+noteWindowUnattached (window, colormap)
+	Window	window;
+	Colormap	colormap;
+{
+	struct colormapInfo	*ci;
+
+	ci = lookupColormap (colormap);
+	if (--ci->window_count == 0)
+		deleteColormap (colormap);
+}
+    
+noteInstalledColormap (colormap)
+	Colormap	colormap;
+{
+	struct colormapInfo	*ci;
+
+	ci = lookupColormap (colormap);
+	if (!ci->actual)
+#ifdef DEBUG
+		printf ("note installed %x %d %s %s\n", colormap, ci->window_count,
+			ci->actual  ? "installed" : "uninstalled",
+			ci->desired ? "desired" : "not desired");
+#endif /* DEBUG */
+	ci->actual = TRUE;
+	/* any random colormaps don't get installed  */
+	if (ci->window_count == 0) {
+		for (ci = colormaps; ci; ci=ci->next)
+			if (ci->desired)
+				XInstallColormap (dpy, ci->colormap);
+	}
+}
+
+noteUninstalledColormap (colormap)
+	Colormap	colormap;
+{
+	struct colormapInfo	*ci;
+
+	ci = lookupColormap (colormap);
+	if (ci->actual)
+#ifdef DEBUG
+		printf ("note uninstalled %x %d %s %s\n", colormap, ci->window_count,
+			ci->actual  ? "installed" : "uninstalled",
+			ci->desired ? "desired" : "not desired");
+#endif /* DEBUG */
+	ci->actual = FALSE;
+	if (ci->desired)
+		XInstallColormap (dpy, colormap);
+}
+
+static void installColormap (Colormap colormap)
+{
+	struct colormapInfo	*ci;
+
+	for (ci = colormaps; ci; ci=ci->next)
+		if (ci->desired) {
+#ifdef DEBUG
+			printf ("apparently lost uninstall event for colormap %x\n", ci->colormap);
+#endif /* DEBUG */
+			return;
+		}
+
+	ci = lookupColormap (colormap);
+#ifdef DEBUG
+	printf ("install %x %d %s %s\n", ci->colormap, ci->window_count,
+		ci->actual  ? "installed" : "uninstalled",
+		ci->desired ? "desired" : "not desired");
+#endif /* DEBUG */
+	if (ci->desired)
+		return;
+	ci->desired = TRUE;
+	if (!ci->actual)
+		XInstallColormap (dpy, colormap);
+}
+
+uninstallColormap (colormap)
+	Colormap	colormap;
+{
+	struct colormapInfo	*ci;
+
+	ci = lookupColormap (colormap);
+	if (ci->desired)
+#ifdef DEBUG
+		printf ("uninstall %x %d %s %s\n", ci->colormap, ci->window_count,
+			ci->actual  ? "installed" : "uninstalled",
+			ci->desired ? "desired" : "not desired");
+#endif /* DEBUG */
+	ci->desired = FALSE;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/globals.c	Sat Apr 13 18:19:26 2019 +0000
@@ -0,0 +1,291 @@
+/* $XConsortium: globals.c,v 1.12 88/09/22 10:53:29 jim Exp $ */
+
+/*
+ * Copyright 1985, 1986, 1987, 1988, 1989 by the
+ * Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  M.I.T. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ */
+
+/*
+ * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+ *
+ *                         All Rights Reserved
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Digital Equipment
+ * Corporation not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior permission.
+ *
+ *
+ * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+ 
+/*
+ * MODIFICATION HISTORY
+ *
+ * 000 -- M. Gancarz, DEC Ultrix Engineering Group
+ * 001 -- R. Kittell, DEC Storage A/D May 19, 1986
+ *  Added global vars for warp options.
+ * 002 -- Loretta Guarino Reid, DEC Ultrix Engineering Group 
+ *  Western Software Lab. April 17, 1987
+ *  Convert to X11
+ */
+ 
+#ifndef lint
+static char *sccsid = "%W%	%G%";
+#endif
+/*
+ * globals.c - window manager global data
+ *
+ */
+ 
+#include "uwm.h"
+#include <stdbool.h>
+#include <stdint.h>
+ 
+Window Pop;			/* Pop up dimension display window. */
+Window Frozen;			/* Contains window id of "gridded" window. */
+XFontStruct *IFontInfo;		/* Icon text font information. */
+XFontStruct *PFontInfo;		/* Pop-up text font information. */
+XFontStruct *MFontInfo;		/* Menu text font information. */
+Pixmap GrayPixmap;		/* Gray pixmap. */
+Pixel IBorder;			/* Icon window border pixmap. */
+Pixmap IBackground;		/* Icon window background pixmap. */
+Pixel PBorder;			/* Pop-Up Window border pixmap. */
+Pixel PBackground;		/* Pop-up Window background pixmap. */
+Pixel MBorder;			/* Menu Window border pixmap. */
+Pixel MBackground;		/* Menu Window background pixmap. */
+Cursor ArrowCrossCursor;	/* Arrow cross cursor. */
+Cursor TextCursor;		/* Text cursor used in icon windows. */
+Cursor IconCursor;		/* Icon Cursor. */
+Cursor MenuCursor;		/* Menu cursor. */
+Cursor MenuMaskCursor;		/* Menu mask cursor. */
+Cursor LeftButtonCursor;	/* Left button main cursor. */
+Cursor MiddleButtonCursor;	/* Middle button main cursor. */
+Cursor RightButtonCursor;	/* Right button main cursor. */
+Cursor TargetCursor;		/* Target (select-a-window) cursor. */
+int ScreenWidth;		/* Display screen width. */
+int ScreenHeight;		/* Display screen height. */
+int ITextForeground;		/* Icon window text forground color. */
+int ITextBackground;		/* Icon window text background color. */
+int IBorderWidth;		/* Icon window border width. */
+int PTextForeground;		/* Pop-up window text forground color. */
+int PTextBackground;		/* Pop-up window text background color. */
+int MTextForeground;		/* Menu window text forground color. */
+int MTextBackground;		/* Menu window text background color. */
+int PWidth;			/* Pop-up window width. */
+int PHeight;			/* Pop-up window height. */
+int PBorderWidth;		/* Pop-up window border width. */
+int PPadding;			/* Pop-up window padding. */
+int MBorderWidth;		/* Menu window border width. */
+int MPadding;			/* Menu window padding. */
+int Delay;			/* Delay between clicks of a double click. */
+int Delta;			/* Mouse movement slop. */
+int HIconPad;			/* Icon horizontal padding. */
+int VIconPad;			/* Icon vertical padding. */
+int HMenuPad;			/* Menu horizontal padding. */
+int VMenuPad;			/* Menu vertical padding. */
+int MaxColors;			/* Maximum number of colors to use. */
+int Pushval = 5;		/* Number of pixels to push window by. */
+int Volume;			/* Audible alarm volume. */
+int status;			/* Routine return status. */
+int Maxfd;			/* Maximum file descriptors for select(2). */
+MenuLink *Menus;		/* Linked list of menus. */
+GC  IconGC;             	/* graphics context for icon */
+GC  PopGC;  	           	/* graphics context for pop */
+GC  MenuGC;             	/* graphics context for menu */
+GC  MenuInvGC;             	/* graphics context for menu background */
+GC  DrawGC;             	/* graphics context for drawing */
+Binding *Blist;			/* Button/key binding list. */
+ 
+bool Autoselect;		/* Warp mouse to default menu selection? */
+bool Freeze;			/* Freeze server during move/resize? */
+bool Grid;			/* Should the m/r box contain a 9 seg. grid. */
+bool NWindow;           	 /* Normalize windows? */
+bool NIcon;             	 /* Normalize icons? */
+bool Push;			/* Relative=TRUE, Absolute=FALSE. */
+bool ResizeRelative;		/* resizes should be relative to window edge */
+bool Reverse;			/* Reverse video? */
+bool Zap;			/* Should the the zap effect be used. */
+bool WarpOnRaise;               /* Warp to upper right corner on raise. */
+bool WarpOnIconify;             /* Warp to icon center on iconify. */
+bool WarpOnDeIconify;           /* Warp to upper right corner on de-iconify. */
+bool FocusSetByUser;            /* True if f.focus called */
+ 
+char PText[PTEXT_LENGTH] = INIT_PTEXT;	/* Pop-up window dummy text. */
+int PTextSize = PTEXT_LENGTH;	/* Pop-up window dummy text size. */
+ 
+int Lineno = 1;			/* Line count for parser. */
+bool Startup_File_Error = FALSE;/* Startup file error flag. */
+char Startup_File[NAME_LEN] = "";/* Startup file name. */
+char IFontName[NAME_LEN];	/* Icon font name. */
+char PFontName[NAME_LEN];	/* Pop-up font name. */
+char MFontName[NAME_LEN];	/* Menu font name. */
+char PBackgroundName[NAME_LEN];	/* name of color to use for popup */
+char PForegroundName[NAME_LEN];	/* name of color to use for popup */
+char PBorderColor[NAME_LEN];	/* name of color to use for popup */
+char **Argv;			/* Pointer to command line parameters. */
+char **Environ;			/* Pointer to environment. */
+
+int scr;
+Display *dpy;
+ 
+/*
+ * Keyword lookup table for parser.
+ */
+Keyword KeywordTable[] = {
+    { "autoselect",	IsBoolTrue,	&Autoselect,0,0,0 },
+    { "background",	IsString,	0,0,PBackgroundName, 0},
+    { "bordercolor",	IsString,	0,0,PBorderColor, 0},
+    { "borderwidth",	IsNumeric,	0,&PBorderWidth,0,0},
+    { "delay",		IsNumeric,	0,&Delay,0,0 },
+    { "delta",		IsNumeric,	0,&Delta,0,0 },
+    { "foreground",	IsString,	0,0,PForegroundName, 0},
+    { "freeze",		IsBoolTrue,	&Freeze,0,0,0 },
+    { "iconfont",	IsString,	0,0,IFontName,0 },
+    { "f.beep",		IsQuitFunction,	0,0,0,Beep },
+    { "f.circledown",	IsQuitFunction,	0,0,0,CircleDown },
+    { "f.circleup",	IsQuitFunction,	0,0,0,CircleUp },
+    { "f.continue",	IsQuitFunction,	0,0,0,Continue },
+    { "f.exit",		IsQuitFunction,	0,0,0,Quit },
+    { "f.focus",	IsFunction,	0,0,0,Focus },
+    { "f.iconify",	IsFunction,	0,0,0,Iconify },
+    { "f.kill",		IsFunction,	0,0,0,Kill },
+    { "f.lower",	IsFunction,	0,0,0,Lower },
+    { "f.menu",		IsMenuMap,	0,0,0,Menu },
+    { "f.move",		IsDownFunction,	0,0,0,Move },
+    { "f.moveopaque",	IsDownFunction,	0,0,0,MoveOpaque },
+    { "f.newiconify",	IsDownFunction,	0,0,0,NewIconify },
+    { "f.pause",	IsQuitFunction,	0,0,0,Pause },
+    { "f.pushdown",	IsFunction,	0,0,0,PushDown },
+    { "f.pushleft",	IsFunction,	0,0,0,PushLeft },
+    { "f.pushright",	IsFunction,	0,0,0,PushRight },
+    { "f.pushup",	IsFunction,	0,0,0,PushUp },
+    { "f.raise",	IsFunction,	0,0,0,Raise },
+    { "f.redraw",	IsFunction,	0,0,0,Redraw },
+    { "f.refresh",	IsQuitFunction,	0,0,0,Refresh },
+    { "f.resize",	IsDownFunction,	0,0,0,Resize },
+    { "f.restart",	IsQuitFunction,	0,0,0,Restart },
+    { "grid",		IsBoolTrue,	&Grid,0,0,0 },
+    { "hiconpad",	IsNumeric,	0,&HIconPad,0,0 },
+    { "hmenupad",	IsNumeric,	0,&HMenuPad,0,0 },
+    { "iborderwidth",	IsNumeric,	0,&IBorderWidth,0,0 },
+    { "maxcolors",	IsNumeric,	0,&MaxColors,0,0 },
+    { "mborderwidth",	IsNumeric,	0,&MBorderWidth,0,0 },
+    { "menu",		IsMenu,		0,0,0,0 },
+    { "menufont",	IsString,	0,0,MFontName,0 },
+    { "noautoselect",	IsBoolFalse,	&Autoselect,0,0,0 },
+    { "nofreeze",	IsBoolFalse,	&Freeze,0,0,0 },
+    { "nogrid",		IsBoolFalse,	&Grid,0,0,0 },
+    { "nonormali",	IsBoolFalse,	&NIcon,0,0,0 },
+    { "nonormalw",	IsBoolFalse,	&NWindow,0,0,0 },
+    { "noresizerelative",	IsBoolFalse,	&ResizeRelative,0,0,0 },
+    { "noreverse",	IsBoolFalse,	&Reverse,0,0,0 },
+    { "normali",	IsBoolTrue,	&NIcon,0,0,0 },
+    { "normalw",	IsBoolTrue,	&NWindow,0,0,0 },
+    { "nowarpdi",	IsBoolFalse,	&WarpOnDeIconify,0,0,0 },
+    { "nowarpi",	IsBoolFalse,	&WarpOnIconify,0,0,0 },
+    { "nowarpr",	IsBoolFalse,	&WarpOnRaise,0,0,0 },
+    { "nozap",		IsBoolFalse,	&Zap,0,0,0 },
+    { "push",		IsNumeric,	0,&Pushval,0,0 },
+    { "pushabsolute",	IsBoolFalse,	&Push,0,0,0 },
+    { "pushrelative",	IsBoolTrue,	&Push,0,0,0 },
+    { "resetbindings",	IsParser,	0,0,0,ResetBindings },
+    { "resetmenus",	IsParser,	0,0,0,ResetMenus },
+    { "resetvariables",	IsParser,	0,0,0,ResetVariables },
+    { "resizefont",	IsString,	0,0,PFontName,0 },
+    { "resizerelative",	IsBoolTrue,	&ResizeRelative,0,0,0 },
+    { "reverse",	IsBoolTrue,	&Reverse,0,0,0 },
+    { "viconpad",	IsNumeric,	0,&VIconPad,0,0 },
+    { "vmenupad",	IsNumeric,	0,&VMenuPad,0,0 },
+    { "volume",		IsNumeric,	0,&Volume,0,0 },
+    { "warpdi",		IsBoolTrue,	&WarpOnDeIconify,0,0,0 },
+    { "warpi",		IsBoolTrue,	&WarpOnIconify,0,0,0 },
+    { "warpr",		IsBoolTrue,	&WarpOnRaise,0,0,0 },
+    { "zap",		IsBoolTrue,	&Zap,0,0,0 },
+    { NULL,		(uintptr_t) NULL,		NULL,NULL,NULL,NULL }
+};
+ 
+/*
+ * Key expression table for parser.
+ */
+KeyExpr KeyExprTbl[] = {
+    { "ctrl", ControlMask },
+    { "c", ControlMask },
+    { "lock", LockMask },
+    { "l", LockMask },
+    { "shift", ShiftMask },
+    { "s", ShiftMask },
+    { "meta", Mod1Mask },
+    { "m", Mod1Mask },
+    { "mod1", Mod1Mask },
+    { "1", Mod1Mask },
+    { "mod2", Mod2Mask },
+    { "2", Mod2Mask },
+    { "mod3", Mod3Mask },
+    { "3", Mod3Mask },
+    { "mod4", Mod4Mask },
+    { "4", Mod4Mask },
+    { "mod5", Mod5Mask },
+    { "5", Mod5Mask },
+    { NULL, (uintptr_t) NULL }
+};
+ 
+/*
+ * Context expression table for parser.
+ */
+ContExpr ContExprTbl[] = {
+    { "icon", ICON },
+    { "i", ICON },
+    { "root", ROOT },
+    { "r", ROOT },
+    { "window", WINDOW },
+    { "w", WINDOW },
+    { NULL, (uintptr_t) NULL }
+};
+ 
+/*
+ * Button expression table for parser.
+ */
+ButtonModifier ButtModTbl[] = {
+    { "left", LeftMask },
+    { "leftbutton", LeftMask },
+    { "l", LeftMask },
+    { "middle", MiddleMask },
+    { "middlebutton", MiddleMask },
+    { "m", MiddleMask },
+    { "right", RightMask },
+    { "rightbutton", RightMask },
+    { "r", RightMask },
+    { "move", DeltaMotion },
+    { "motion", DeltaMotion },
+    { "delta", DeltaMotion },
+    { "down", ButtonDown },
+    { "d", ButtonDown },
+    { "up", ButtonUp },
+    { "u", ButtonUp },
+    { NULL, (uintptr_t) NULL }
+};
+ 
+bool x_error_occurred = FALSE;
+XErrorEvent last_error_event;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gram.y	Sat Apr 13 18:19:26 2019 +0000
@@ -0,0 +1,863 @@
+/* $XConsortium: gram.y,v 1.4 89/01/10 12:14:51 jim Exp $ */
+
+
+/*
+ * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+ *
+ *                         All Rights Reserved
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Digital Equipment
+ * Corporation not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior permission.
+ *
+ *
+ * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+
+/*
+ * MODIFICATION HISTORY
+ *
+ * 000 -- M. Gancarz, DEC Ultrix Engineering Group
+ * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group
+ *  Western Software Lab. Convert to X11.
+ */
+
+%{
+#ifndef lint
+static char *sccsid = "@(#)gram.y	3.8	1/24/86";
+#endif
+
+/*
+ * Copyright 1985, 1986, 1987, 1988, 1989 by the
+ * Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  M.I.T. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ */
+
+#include <stdlib.h>
+#include <stdbool.h>
+#include "uwm.h"
+
+extern char* strconcat(char* s1, char* s2);
+extern MenuLine* AllocMenuLine(void);
+extern MenuLine* StashMenuLine(int type, char* string);
+extern MenuInfo* stashmenuinfo(char* name, MenuLine* line, char* colors[]);
+extern MenuLink* stashmenulink(MenuInfo* menuinfo);
+extern MenuLine* appendmenuline(MenuLine* list, MenuLine* line);
+extern MenuLink* appendmenulink(MenuLink* list, MenuLink* link);
+ 
+/*
+ * Values returned by complex expression parser.
+ */
+#define C_STRING	1	/* IsString. */
+#define C_MENU		2	/* IsMenu. */
+#define C_MAP		3	/* IsMap. */
+#define C_MENUMAP	4	/* IsMenuMap. */
+
+static int ki;				/* Keyword index. */
+static int bkmask;			/* Button/key mask. */
+static int cmask;			/* Context mask. */
+static char msg[BUFSIZ];		/* Error message buffer. */
+static char *menu_name;			/* Menu name. */
+static MenuInfo *menu_info;		/* Menu info. */
+static MenuLine *ml_ptr;		/* Temporary menu line pointer. */
+static char *hcolors[4];		/* Color values used in menu hdrs. */
+static char *mcolors[2];		/* Color values used in menus. */
+MenuLink *menu_link;			/* Temporary menu link pointer. */
+
+#ifdef X_NOT_STDC_ENV
+ char *calloc();
+ char *malloc();
+#endif
+ 
+%}
+
+%union {
+    char *sval;
+    int ival;
+    short shval;
+    struct _menuline *mlval;
+    struct _menuinfo *mival;
+    char **cval;
+}
+
+%token NL
+%token <sval> STRING
+%token <ival> COMMENT
+%type <ival> keyword
+%type <ival> compexpr
+%type <ival> keyexpr
+%type <ival> kmask
+%type <ival> contexpr
+%type <ival> contmask
+%type <ival> buttmodexpr
+%type <ival> buttmodifier
+%type <ival> buttexpr
+%type <sval> menuname
+%type <sval> strings
+%type <sval> color
+%type <cval> color2
+%type <cval> color4
+%type <mlval> menuexpr
+%type <mlval> menulist
+%type <mlval> menuline
+%type <mlval> menuaction
+
+%%	/* beginning of rules section */
+
+input:	|	input command
+	|	input error command { yyerrok; }
+	;
+
+command:	boolvar term
+	|	expr term
+	|	COMMENT	{ Lineno++; }
+	|	term
+	;
+
+term:		NL	{ Lineno++; }
+	|	';'
+	;
+
+expr:		keyword '=' compexpr
+			{
+			    switch (KeywordTable[$1].type) {
+			        case IsString:
+			            if ($3 == C_STRING) {
+			                strcpy(KeywordTable[$1].sptr,
+			                        $<sval>2);
+			            } else {
+			                yyerror("illegal construct");
+			            }
+			            free($<sval>2);
+			            break;
+			        case IsNumeric:
+			            if ($3 == C_STRING) {
+			                *(KeywordTable[$1].nptr) =
+			                                   y_atoi($<sval>2);
+			            } else yyerror("illegal construct");
+			            free($<sval>2);
+			            break;
+			        case IsBoolTrue:
+			        case IsBoolFalse:
+			            yyerror("illegal value assignment");
+			            break;
+			        case IsQuitFunction:
+			        case IsFunction:
+			            if ($3 == C_MAP) {
+			                bindtofunc($1, bkmask, cmask, NULL);
+			            } else yyerror("illegal construct");
+			            break;
+			        case IsDownFunction:
+			            if (bkmask & ButtonUp) {
+			                sprintf(msg,
+			                        "cannot bind %s to button up",
+			                        KeywordTable[$1].name);
+			                yyerror(msg);
+			            }
+			            if ($3 == C_MAP) {
+			                bindtofunc($1, bkmask, cmask, NULL);
+			            } else yyerror("illegal construct");
+			            break;
+			        case IsMenuMap:
+			            if (bkmask & ButtonUp) {
+			                sprintf(msg,
+			                        "cannot bind %s to button up",
+			                        KeywordTable[$1].name);
+			                yyerror(msg);
+			            }
+			            if ($3 == C_MENUMAP) {
+			                bindtofunc($1, bkmask, cmask, menu_name);
+			            } else yyerror("illegal construct");
+			            break;
+			        case IsMenu:
+			            if ($3 == C_MENU) {
+			                menu_info = stashmenuinfo(menu_name, ml_ptr, hcolors);
+			                menu_link = stashmenulink(menu_info);
+			                Menus = appendmenulink(Menus, menu_link);
+			            } else yyerror("illegal menu construct");
+			            break;
+			        default:
+			            yyerror("internal binding error");
+			            break;
+			    }
+			}
+	;
+
+compexpr:	keyexpr ':' contexpr ':' buttexpr
+			{
+			    $$ = C_MAP;
+			    bkmask = $1 | $5;
+			    cmask = $3;
+			}
+	|	keyexpr ':' contexpr ':' buttexpr ':' menuname
+			{
+			    $$ = C_MENUMAP;
+			    bkmask = $1 | $5;
+			    cmask = $3;
+			    menu_name = $7;
+			}
+	|	STRING color4 menuexpr
+			{
+			    $$ = C_MENU;
+			    menu_name = $1;
+			    ml_ptr = $3;
+			}
+	|	STRING
+			{ $$ = C_STRING; }
+	;
+
+boolvar:	STRING
+			{
+			    ki = keywordlookup(yylval.sval);
+			    switch (KeywordTable[ki].type) {
+			    case IsBoolTrue:
+			        *(KeywordTable[ki].bptr) = TRUE;
+			        break;
+			    case IsBoolFalse:
+			        *(KeywordTable[ki].bptr) = FALSE;
+			        break;
+			    case IsParser:
+			        (*KeywordTable[ki].fptr)();
+			        break;
+			    default:
+			        yyerror("keyword error");
+			    }
+			}
+	;
+
+keyword:	STRING	{
+			    $$ = keywordlookup(yylval.sval);
+			}
+	;
+
+keyexpr:	/* empty */
+			{ $$ = 0; }
+	|	kmask
+			{ $$ = $1; }
+	|	kmask '|' keyexpr
+			{ $$ = $1 | $3; }
+	;
+
+contexpr:	/* empty */
+			{ $$ = ROOT | WINDOW | ICON; }
+	|	contmask
+			{ $$ = $1; }
+	|	contmask '|' contexpr
+			{ $$ = $1 | $3; }
+	;
+
+buttexpr:	buttmodexpr
+			{ $$ = CheckButtonState($1); }
+	;
+
+kmask:		STRING { $$ = keyexprlookup(yylval.sval); }
+
+contmask:	STRING { $$ = contexprlookup(yylval.sval); }
+
+buttmodexpr: 	buttmodifier
+			{ $$ = $1; }
+	|	buttmodexpr buttmodifier
+			{ $$ = $1 | $2; }
+	;
+
+buttmodifier:	STRING
+			{ $$ = buttexprlookup(yylval.sval); }
+	;
+
+menuname:	STRING
+			{ $$ = $1; }
+	;
+
+menuexpr:	'{' menulist '}'
+			{ $$ = $2; }
+	;
+
+menulist:	menuline
+			{ $$ = $1; }
+	|	menulist menuline
+			{ $$ = appendmenuline($1, $2); }
+	|	menulist COMMENT
+			{
+			    Lineno++;
+			    $$ = $1;
+			}
+	|	COMMENT
+			{
+			    Lineno++;
+			    $$ = NULL;
+			}
+	|	term
+			{ $$ = NULL; }
+	|	menulist term
+			{ $$ = $1; }
+	|	error term
+			{
+			  $$ = NULL;
+			  yyerrok;
+			}
+	;
+
+menuline:	strings ':' color2 menuaction term
+			{
+			    $4->name = $1;
+			    $4->foreground = mcolors[0];
+			    $4->background = mcolors[1];
+			    $$ = $4;
+			}
+	;
+
+menuaction:	STRING
+			{
+			    ki = keywordlookup(yylval.sval);
+			    if ((ki != -1) &&
+			        (KeywordTable[ki].type != IsFunction) &&
+			        (KeywordTable[ki].type != IsQuitFunction) &&
+			        (KeywordTable[ki].type != IsDownFunction)) {
+			        sprintf(msg,
+			                "menu action \"%s\" not a function",
+				        KeywordTable[ki].name);
+			        yyerror(msg);
+			    }
+			    ml_ptr = AllocMenuLine();
+			    if (KeywordTable[ki].type == IsQuitFunction)
+			        ml_ptr->type = IsImmFunction;
+			    else ml_ptr->type = IsUwmFunction;
+			    ml_ptr->func = KeywordTable[ki].fptr;
+			    $$ = ml_ptr;
+			}
+	|	STRING ':' menuname
+			{
+			    ki = keywordlookup($1);
+			    if (ki != -1 &&
+			        KeywordTable[ki].type != IsMenuMap) {
+			        sprintf(msg,
+			               "menu action \"%s\" not a menu function",
+				        KeywordTable[ki].name);
+			        yyerror(msg);
+			    }
+			    ml_ptr = AllocMenuLine();
+			    ml_ptr->type = IsMenuFunction;
+			    ml_ptr->text = $3;
+			    $$ = ml_ptr;
+			}
+	|	'!' strings
+			{
+			    $$ = StashMenuLine(IsShellCommand, $2);
+			}
+	|	'^' strings
+			{
+			    $$ = StashMenuLine(IsTextNL, $2);
+			}
+	|	'|' strings
+			{
+			    $$ = StashMenuLine(IsText, $2);
+			}
+	;
+
+strings:	STRING	{ $$ = yylval.sval; }
+	|	strings STRING
+			{ $$ = strconcat($1, $2); }
+	;
+
+color4:		'(' color ':' color ':' color ':' color ')'
+			{
+			    hcolors[0] = $2;
+			    hcolors[1] = $4;
+			    hcolors[2] = $6;
+			    hcolors[3] = $8;
+			    $$ = hcolors;
+			}
+	|	/* empty */
+			{
+			    hcolors[0] = NULL;
+			    hcolors[1] = NULL;
+			    hcolors[2] = NULL;
+			    hcolors[3] = NULL;
+			    $$ = hcolors;
+			}
+	;
+
+color2:		'(' color ':' color ')' ':'
+			{
+			    mcolors[0] = $2;
+			    mcolors[1] = $4;
+			    $$ = mcolors;
+			}
+	|	/* empty */
+			{
+			    mcolors[0] = NULL;
+			    mcolors[1] = NULL;
+			    $$ = mcolors;
+			}
+	;
+
+color:		STRING	{ $$ = yylval.sval; }
+	|	/* empty */	{ $$ = NULL; }
+	;
+%%
+
+/*
+ * Look up a string in the keyword table and return its index, else
+ * return -1.
+ */
+keywordlookup(string)
+char *string;
+{
+    int i;
+
+    for (i = 0; KeywordTable[i].name; i++) {
+        if (!strcmp(KeywordTable[i].name, string)) {
+            free(string);
+            return(i);
+        }
+    }
+    sprintf(msg,"keyword error: \"%s\"", string);
+    yyerror(msg);
+    free(string);
+    return(-1);
+}
+
+/*
+ * Look up a string in the key expression table and return its mask, else
+ * return -1.
+ */
+int keyexprlookup(string)
+char *string;
+{
+    int i;
+
+    for (i = 0; KeyExprTbl[i].name; i++) {
+        if (!strcmp(KeyExprTbl[i].name, string)) {
+            free(string);
+            return(KeyExprTbl[i].mask);
+        }
+    }
+    sprintf(msg,"key expression error: \"%s\"", string);
+    yyerror(msg);
+    free(string);
+    return(-1);
+}
+
+/*
+ * Look up a string in the context expression table and return its mask, else
+ * return -1.
+ */
+contexprlookup(string)
+char *string;
+{
+    int i;
+
+    for (i = 0; ContExprTbl[i].name; i++) {
+        if (!strcmp(ContExprTbl[i].name, string)) {
+            free(string);
+            return(ContExprTbl[i].mask);
+        }
+    }
+    sprintf(msg,"context expression error: \"%s\"", string);
+    yyerror(msg);
+    free(string);
+    return(-1);
+}
+/*
+ * Look up a string in the button expression table and return its mask, else
+ * return -1.
+ */
+buttexprlookup(string)
+char *string;
+{
+    int i;
+
+    for (i = 0; ButtModTbl[i].name; i++) {
+        if (!strcmp(ButtModTbl[i].name, string)) {
+            free(string);
+            return(ButtModTbl[i].mask);
+        }
+    }
+    sprintf(msg,"button modifier error: \"%s\"", string);
+    yyerror(msg);
+    free(string);
+    return(-1);
+}
+
+/*
+ * Scan a string and return an integer.  Report an error if any
+ * non-numeric characters are found.
+ */
+y_atoi(s)
+char *s;
+{
+    int n = 0;
+
+    while (*s) {
+        if (*s >= '0' && *s <= '9')
+            n = 10 * n + *s - '0';
+        else {
+            yyerror("non-numeric argument");
+            return(-1);
+        }
+        s++;
+    }
+    return(n);
+}
+
+/*
+ * Append s2 to s1, extending s1 as necessary.
+ */
+char *
+strconcat(s1, s2)
+char *s1, *s2;
+{
+    char *p;
+
+    p = malloc(strlen(s1) + strlen(s2) + 2);
+    sprintf(p, "%s %s", s1, s2);
+    free(s1);
+    free(s2);
+    s1 = p;
+    return(s1);
+}
+
+/*
+ * Check a button expression for errors.
+ */
+int
+CheckButtonState(expr)
+int expr;
+{
+    /*
+     * Check for one (and only one) button.
+     */
+    switch (expr & (LeftMask | MiddleMask | RightMask)) {
+    case 0:
+        yyerror("no button specified");
+        break;
+    case LeftMask:
+        break;
+    case MiddleMask:
+        break;
+    case RightMask:
+        break;
+    default:
+        yyerror("more than one button specified");
+    }
+
+    /*
+     * Check for one (and only one) up/down/motion modifier.
+     */
+    switch (expr & (ButtonUp | ButtonDown | DeltaMotion)) {
+    case 0:
+        yyerror("no button action specified");
+        break;
+    case ButtonUp:
+        break;
+    case ButtonDown:
+        break;
+    case DeltaMotion:
+        break;
+    default:
+        yyerror("only one of up/down/motion may be specified");
+    }
+    return(expr);
+}
+
+/*
+ * Bind button/key/context to a function.
+ */
+bindtofunc(index, mask, context, name)
+int index;		/* Index into keyword table. */
+int mask;		/* Button/key/modifier mask. */
+int context;		/* ROOT, WINDOW, or ICON. */
+char *name;		/* Menu, if needed. */
+{
+    if (context & ROOT)
+        setbinding(ROOT, index, mask, name);
+    if (context & ICON)
+        setbinding(ICON, index, mask, name);
+    if (context & WINDOW)
+        setbinding(WINDOW, index, mask, name);
+}
+
+/*
+ * Allocate a Binding type and return a pointer.
+ */
+Binding *
+AllocBinding()
+{
+    Binding *ptr;
+
+    if (!(ptr = (Binding *)calloc(1, sizeof(Binding)))) {
+        fprintf(stderr, "Can't allocate binding--out of space\n");
+        exit(1);
+    }
+    return(ptr);
+}
+
+/*
+ * Stash the data in a Binding.
+ */
+setbinding(cont, i, m, mname)
+int cont;		/* Context: ROOT, WINDOW, or ICON. */
+int i;			/* Keyword table index. */
+int m;		/* Key/button/modifier mask. */
+char *mname;		/* Pointer to menu name, if needed. */
+{
+    Binding *ptr;
+
+    ptr = AllocBinding();
+    ptr->context = cont;
+    ptr->mask = m;
+    ptr->func = KeywordTable[i].fptr;
+    ptr->menuname = mname;
+
+    switch (m & (LeftMask | MiddleMask | RightMask)) {
+    case LeftMask:
+        ptr->button = LeftButton;
+        break;
+    case MiddleMask:
+        ptr->button = MiddleButton;
+        break;
+    case RightMask:
+        ptr->button = RightButton;
+        break;
+    }
+    appendbinding(ptr);
+}
+
+/*
+ * Append a Binding to the Bindings list.
+ */
+appendbinding(binding)
+Binding *binding;
+{
+    Binding *ptr;
+
+    if (Blist == NULL)
+        Blist = binding;
+    else {
+        for(ptr = Blist; ptr->next; ptr = ptr->next) /* NULL */;
+        ptr->next = binding;
+        ptr = ptr->next;
+        ptr->next = NULL;
+    }
+}
+
+/*
+ * Allocate a menu line and return a pointer.
+ */
+MenuLine *
+AllocMenuLine()
+{
+    MenuLine *ptr;
+
+    if (!(ptr = (MenuLine *)calloc(1, sizeof(MenuLine)))) {
+        fprintf(stderr, "Can't allocate menu line--out of space\n");
+        exit(1);
+    }
+    return(ptr);
+}
+
+/*
+ * Allocate a MenuInfo structure and return a pointer.
+ */
+MenuInfo *
+AllocMenuInfo()
+{
+    MenuInfo *ptr;
+
+    if (!(ptr = (MenuInfo *)calloc(1, sizeof(MenuInfo)))) {
+        fprintf(stderr, "Can't allocate menu storage--out of space\n");
+        exit(1);
+    }
+    return(ptr);
+}
+
+/*
+ * Allocate a MenuLink structure and return a pointer.
+ */
+MenuLink *
+AllocMenuLink()
+{
+    MenuLink *ptr;
+
+    if (!(ptr = (MenuLink *)calloc(1, sizeof(MenuLink)))) {
+        fprintf(stderr, "Can't allocate menu linked list storage--out of space\n");
+        exit(1);
+    }
+    return(ptr);
+}
+
+/*
+ * Stash the data in a menu line.
+ */
+MenuLine *
+StashMenuLine(type, string)
+int type;
+char *string;
+{
+    MenuLine *ptr;
+
+    ptr = AllocMenuLine();
+    ptr->type = type;
+    ptr->text = string;
+    return(ptr);
+}
+
+/*
+ * Stash menu data in a MenuInfo structure;
+ */
+MenuInfo *
+stashmenuinfo(name, line, colors)
+char *name;
+MenuLine *line;
+char *colors[];
+{
+    MenuInfo *ptr;
+
+    ptr = AllocMenuInfo();
+    ptr->name = name;
+    ptr->line = line;
+    ptr->foreground = colors[1];
+    ptr->background = colors[0];
+    ptr->fghighlight = colors[2];
+    ptr->bghighlight = colors[3];
+    return(ptr);
+}
+
+/*
+ * Stash menu info data in a MenuLink structure;
+ */
+MenuLink *
+stashmenulink(menuinfo)
+MenuInfo *menuinfo;
+{
+    MenuLink *ptr;
+
+    ptr = AllocMenuLink();
+    ptr->next = NULL;
+    ptr->menu = menuinfo;
+    return(ptr);
+}
+
+/*
+ * Append a menu line to a linked list of menu lines.
+ */
+MenuLine *
+appendmenuline(list, line)
+MenuLine *list;
+MenuLine *line;
+{
+    MenuLine *ptr;
+
+    if (list == NULL)
+        list = line;
+    else {
+        for(ptr = list; ptr->next; ptr = ptr->next) /* NULL */;
+        ptr->next = line;
+        ptr = ptr->next;
+        ptr->next = NULL;
+    }
+    return(list);
+}
+
+/*
+ * Append a menu to a linked list of menus.
+ */
+MenuLink *
+appendmenulink(list, link)
+MenuLink *list;
+MenuLink *link;
+{
+    MenuLink *ptr;
+
+    if (list == NULL)
+        list = link;
+    else {
+        for(ptr = list; ptr->next; ptr = ptr->next) /* NULL */;
+        ptr->next = link;
+        ptr = ptr->next;
+        ptr->next = NULL;
+    }
+    return(list);
+}
+
+/*
+ * Reset all previous bindings and free the space allocated to them.
+ */
+bool ResetBindings()
+{
+    Binding *ptr, *nextptr;
+
+    for(ptr = Blist; ptr; ptr = nextptr) {
+        if(ptr->menuname) free(ptr->menuname);
+        nextptr = ptr->next;
+        free(ptr);
+    }
+    Blist = NULL;
+}
+
+/*
+ * De-allocate all menus.
+ */
+bool ResetMenus()
+{
+    MenuLink *mptr, *next_mptr;
+    register MenuLine *lptr, *next_lptr;
+
+    for(mptr = Menus; mptr; mptr = next_mptr) {
+        free(mptr->menu->name);
+        for(lptr = mptr->menu->line; lptr; lptr = next_lptr) {
+            free(lptr->name);
+            if (lptr->text) free(lptr->text);
+            next_lptr = lptr->next;
+            free(lptr);
+        }
+        next_mptr = mptr->next;
+        free(mptr);
+    }
+    Menus = NULL;
+}
+
+/*
+ * Set all numeric variables to zero and all boolean variables to FALSE.
+ */
+bool ResetVariables()
+{
+    register int i;
+
+    for (i = 0; KeywordTable[i].name; i++) {
+        switch (KeywordTable[i].type) {
+        case IsBoolTrue:
+        case IsBoolFalse:
+            *(KeywordTable[i].bptr) = FALSE;
+            break;
+        case IsNumeric:
+            *(KeywordTable[i].nptr) = 0;
+            break;
+        default:
+            break;
+        }
+    }
+    SetVarDefaults();
+    LoadXDefaults();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lex.l	Sat Apr 13 18:19:26 2019 +0000
@@ -0,0 +1,91 @@
+%{
+
+#include "X11/copyright.h"
+
+/*
+ * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
+ *
+ *                         All Rights Reserved
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted,
+ * provided that the above copyright notice appear in all copies and that
+ * both that copyright notice and this permission notice appear in
+ * supporting documentation, and that the name of Digital Equipment
+ * Corporation not be used in advertising or publicity pertaining to
+ * distribution of the software without specific, written prior permission.
+ *
+ *
+ * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
+ * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
+ * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
+ * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+ * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+ 
+
+
+/*
+ * MODIFICATION HISTORY
+ *
+ * 000 -- M. Gancarz, DEC Ultrix Engineering Group
+ */
+
+#ifndef lint
+static char *sccsid = "@(#)lex.l	3.8	1/24/86";
+#endif
+
+#include "y.tab.h"
+#include <stdlib.h>
+#include <X11/Xos.h>
+
+char *dequote();
+char *stash();
+
+%}
+W	[ \t]+
+%%
+
+^[ \t]*#.*\n			{ return(COMMENT); }	/* Comments. */
+{W}				{ ; }	/* Whitespace. */
+[^ \"\t\n=\^\!\|\(\)\{\}:;]+	{ yylval.sval=stash(yytext);return(STRING); }
+\"[^\"\n]*\"			{ yylval.sval=stash(dequote(yytext));
+				  return(STRING); }
+\n				{ return(NL); }
+.				{ return(*yytext); }
+
+%%
+
+/*
+ * Remove the quotes enclosing a quoted string.
+ */
+char *
+dequote(s)
+char *s;
+{
+    char *p;
+
+    ++s;
+    p = rindex(s, '"');
+    *p = '\0';
+    return(s);
+}
+
+/*
+ * Save string away in memory and return a pointer to it.  If
+ * no space could be found, quit with a fatal error.
+ */
+char *stash(s)
+char *s;
+{
+    char *ptr;
+
+    ptr = malloc(strlen(s) + 1);
+    if (ptr == NULL) {
+        Error("out of space");
+    }
+    return(strcpy(ptr, s));
+}
--- a/src/Beep.c	Mon Sep 17 20:51:55 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-#ifndef lint
-static char *rcsid_Beep_c = "$XConsortium: Beep.c,v 1.5 88/09/06 17:27:24 jim Exp $";
-#endif	/* lint */
-
-#include "X11/copyright.h"
-#include <stdbool.h>
-
-/*
- * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
- *
- *                         All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of Digital Equipment
- * Corporation not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior permission.
- *
- *
- * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-
-
-/*
- * MODIFICATION HISTORY
- *
- * 000 -- M. Gancarz, DEC Ultrix Engineering Group
- */
-
-#ifndef lint
-static char *sccsid = "@(#)Beep.c	3.8	1/24/86";
-#endif
-
-#include "uwm.h"
-
-bool Beep(window, mask, button, x, y)
-Window window;                          /* Event window. */
-int mask;                               /* Button/key mask. */
-int button;                           /* Button event detail. */
-int x, y;                               /* Event mouse position. */
-{
-	XBell(dpy, VOLUME_PERCENTAGE(Volume));
-	return(FALSE);
-}
--- a/src/Bindings.c	Mon Sep 17 20:51:55 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,112 +0,0 @@
-#ifndef lint
-static char *rcsid_Bindings_c = "$XConsortium: Bindings.c,v 1.15 88/09/22 16:08:10 jim Exp $";
-#endif	lint
-
-#include "X11/copyright.h"
-
-/*
- * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
- *
- *                         All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of Digital Equipment
- * Corporation not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior permission.
- *
- *
- * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-
-
-/*
- * MODIFICATION HISTORY
- *
- * 000 -- M. Gancarz, DEC Ultrix Engineering Group
- */
-
-#ifndef lint
-static char *sccsid = "@(#)Bindings.c	3.8	1/24/86";
-#endif
-
-/*
- * Bindings.c 	Default bindings for the X window manager 'uwm'
- *
- * Note: Any changes to this file should also be added to the file
- * /usr/new/lib/X/uwm/default.uwmrc to keep users informed as to the bindings
- * contained herein.
- */
-
-char *DefaultBindings[] = {
-"resetbindings;resetvariables;resetmenus;noautoselect;delta=5;freeze",
-"grid;zap;pushabsolute;push=1;hiconpad=5;viconpad=5;hmenupad=3;vmenupad=0",
-"iconfont=fixed;menufont=fixed;resizefont=fixed;volume=0;noresizerelative",
-"f.newiconify=m:w|i:delta l",
-"f.raise=m:w|i:delta l",
-"f.lower=m:w|i:l u",
-"f.raise=m:w:m d",
-"f.resize=m:w:delta m",
-"f.iconify=m:i:m u",
-"f.raise=m:w|i:r d",
-"f.move=m:w|i:delta r",
-"f.circledown=m:r:l d",
-"f.circleup=m:r:r d",
-"f.circledown=m|s::l d",
-"f.menu=:r:m d:\"WindowOps\"",
-"f.menu=m|s::m d:\"WindowOps\"",
-"f.menu=m|s::m d:\"Preferences\"",
-"f.circleup=m|s::r d",
-"f.iconify=m|c:w|i:l d",
-"f.newiconify=m|l:w|i:l d",
-"f.raise=m|l:w|i:l u",
-"f.pushright=m|l:w|i:r d",
-"f.pushleft=m|c:w|i:r d",
-"f.pushup=m|l:w|i:m d",
-"f.pushdown=m|c:w|i:m d",
-"menu=\"WindowOps\"{",
-"New Window:!\"xterm&\"",
-"RefreshScreen:f.refresh",
-"Redraw:f.redraw",
-"Move:f.move",
-"Resize:f.resize",
-"Lower:f.lower",
-"Raise:f.raise",
-"CircUp:f.circleup",
-"CircDown:f.circledown",
-"AutoIconify:f.iconify",
-"LowerIconify:f.newiconify",
-"NewIconify:f.newiconify",
-"Focus:f.focus",
-"Freeze:f.pause",
-"UnFreeze:f.continue",
-"Restart:f.restart",
-"\" \":f.beep",
-"KillWindow:f.kill",
-"\" \":f.beep",
-"Exit:f.exit",
-"}",
-"menu=\"Preferences\"{",
-"Bell Loud:!\"xset b 7&\"",
-"Bell Normal:!\"xset b 3&\"",
-"Bell Off:!\"xset b off&\"",
-"Click Loud:!\"xset c 8&\"",
-"Click Soft:!\"xset c on&\"",
-"Click Off:!\"xset c off&\"",
-"Lock On:!\"xset l on&\"",
-"Lock Off:!\"xset l off&\"",
-"Mouse Fast:!\"xset m 4 2&\"",
-"Mouse Normal:!\"xset m 2 5&\"",
-"Mouse Slow:!\"xset m 1 1&\"",
-"}",
-0	/* Must NOT be removed. */
-};
--- a/src/CircleDown.c	Mon Sep 17 20:51:55 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-#ifndef lint
-static char *rcsid_CircleDown_c = "$XConsortium: CircleDown.c,v 1.5 88/09/06 17:27:30 jim Exp $";
-#endif	/* lint */
-
-#include "X11/copyright.h"
-
-/*
- * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
- *
- *                         All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of Digital Equipment
- * Corporation not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior permission.
- *
- *
- * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-
-
-/*
- * MODIFICATION HISTORY
- *
- * 000 -- M. Gancarz, DEC Ultrix Engineering Group
- * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group,
-    Western Software Lab. Converted to X11.
- */
-
-#ifndef lint
-static char *sccsid = "@(#)CircleDown.c	3.8	1/24/86";
-#endif
-
-#include "uwm.h"
-
-Bool CircleDown(window, mask, button, x, y)
-Window window;                          /* Event window. */
-int mask;                               /* Button/key mask. */
-int button;                           /* Button event detail. */
-int x, y;                               /* Event mouse position. */
-{
-	XCirculateSubwindowsDown(dpy, RootWindow(dpy, scr));
-	return(FALSE);
-}
--- a/src/CircleUp.c	Mon Sep 17 20:51:55 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-#ifndef lint
-static char *rcsid_CircleUp_c = "$XConsortium: CircleUp.c,v 1.5 88/09/06 17:27:36 jim Exp $";
-#endif	/* lint */
-
-#include "X11/copyright.h"
-
-/*
- * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
- *
- *                         All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of Digital Equipment
- * Corporation not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior permission.
- *
- *
- * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-
-
-/*
- * MODIFICATION HISTORY
- *
- * 000 -- M. Gancarz, DEC Ultrix Engineering Group
- * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group,
-    Western Software Lab. Converted to X11.
- */
-
-#ifndef lint
-static char *sccsid = "@(#)CircleUp.c	3.8	1/24/86";
-#endif
-
-#include "uwm.h"
-
-Bool CircleUp(window, mask, button, x, y)
-Window window;                          /* Event window. */
-int mask;                               /* Button/key mask. */
-int button;                           /* Button event detail. */
-int x, y;                        	/* Event mouse position. */
-{
-	XCirculateSubwindowsUp(dpy, RootWindow(dpy, scr));
-	return(FALSE);
-}
--- a/src/Cursors.c	Mon Sep 17 20:51:55 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,116 +0,0 @@
-#ifndef lint
-static char *rcsid_StoreCursors_c = "$XConsortium: Cursors.c,v 1.6 88/09/06 17:27:45 jim Exp $";
-#endif	/* lint */
-
-#include "X11/copyright.h"
-
-/*
- * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
- *
- *                         All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of Digital Equipment
- * Corporation not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior permission.
- *
- *
- * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-
-
-/*
- * MODIFICATION HISTORY
- *
- * 000 -- M. Gancarz, DEC Ultrix Engineering Group
- * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group
- *        Convert to X11
- */
-
-#ifndef lint
-static char *sccsid = "@(#)StoreCursors.c	3.8	1/24/86";
-#endif
-
-#include "uwm.h"
-#include <X11/cursorfont.h>
-
-/*
- * Store all the cursors into global variables.
- */
-int StoreCursors()
-{
-    /*
-     * Main uwm cursor and movement cursor.
-     */
-    ArrowCrossCursor = XCreateFontCursor(dpy, XC_fleur);
-    if (ArrowCrossCursor == FAILURE) {
-	Error("StoreCursors -> Unable to store ArrowCrossCursor.");
-    }
-
-    /*
-     * Text cursor used in icons.
-     */
-    TextCursor = XCreateFontCursor(dpy, XC_top_left_arrow);
-    if (TextCursor == FAILURE) {
-	Error("StoreCursors -> Unable to store TextCursor.");
-    }
-
-    /*
-     * Icon cursor used to iconify windows.
-     */
-    IconCursor = XCreateFontCursor(dpy, XC_icon);	
-    if (IconCursor == FAILURE) {
-	Error("StoreCursors -> Unable to store IconCursor.");
-    }
-
-    /*
-     * Menu cursor.
-     */
-    MenuCursor = XCreateFontCursor(dpy, XC_sb_left_arrow);
-    if (MenuCursor == FAILURE) {
-	Error("StoreCursors -> Unable to store MenuCursor.");
-    }
-
-    /*
-     * Left button main cursor.
-     */
-    LeftButtonCursor = XCreateFontCursor(dpy, XC_leftbutton);	
-    if (LeftButtonCursor == FAILURE) {
-	Error("StoreCursors -> Unable to store LeftButtonCursor.");
-    }
-
-    /*
-     * Middle button main cursor.
-     */
-    MiddleButtonCursor = XCreateFontCursor(dpy, XC_middlebutton);	
-    if (MiddleButtonCursor == FAILURE) {
-	Error("StoreCursors -> Unable to store MiddleButtonCursor.");
-    }
-
-    /*
-     * Right button main cursor.
-     */
-    RightButtonCursor = XCreateFontCursor(dpy, XC_rightbutton);	
-    if (RightButtonCursor == FAILURE) {
-	Error("StoreCursors -> Unable to store RightButtonCursor.");
-    }
-
-    /*
-     * Targer cursor used to identify a window for an action.
-     */
-    TargetCursor = XCreateFontCursor(dpy, XC_hand2);	
-    if (TargetCursor == FAILURE) {
-	Error("StoreCursors -> Unable to store TargetCursor.");
-    }
-}
-
--- a/src/Error.c	Mon Sep 17 20:51:55 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +0,0 @@
-#ifndef lint
-static char *rcsid_Error_c = "$XConsortium: Error.c,v 1.5 88/09/06 17:27:51 jim Exp $";
-#endif	/* lint */
-
-#include "X11/copyright.h"
-#include <stdlib.h>
-
-/*
- * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
- *
- *                         All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of Digital Equipment
- * Corporation not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior permission.
- *
- *
- * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-
-
-/*
- * MODIFICATION HISTORY
- *
- * 000 -- M. Gancarz, DEC Ultrix Engineering Group
- */
-
-#ifndef lint
-static char *sccsid = "@(#)Error.c	3.8	1/24/86";
-#endif
-
-#include "uwm.h"
-/*
- * Default error reporting routine.  Called when a random uwm error
- * is encountered.
- */
-Error(s)
-char *s;	/* Error description string */
-{
-    fprintf(stderr, "uwm: %s\n", s);
-    exit(1);
-}
-
-Warning(s)
-char *s;	/* Error description string */
-{
-    fprintf(stderr, "uwm: warning: %s\n", s);
-}
--- a/src/Focus.c	Mon Sep 17 20:51:55 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-#ifndef lint
-static char *rcsid_Focus_c = "$XConsortium: Focus.c,v 1.5 88/09/06 17:28:01 jim Exp $";
-#endif	/* lint */
-
-#include "X11/copyright.h"
-
-/*
- * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
- *
- *                         All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of Digital Equipment
- * Corporation not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior permission.
- *
- *
- * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-
-
-/*
- * MODIFICATION HISTORY
- *
- * 000 -- M. Gancarz, DEC Ultrix Engineering Group
- * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group,
-    Western Software Lab. Converted to X11.
- */
-
-#ifndef lint
-static char *sccsid = "@(#)Focus.c	3.8	1/24/86";
-#endif
-
-#include "uwm.h"
-
-Bool Focus(window, mask, button, x, y)
-Window window;                          /* Event window. */
-int mask;                               /* Button/key mask. */
-int button;                           /* Button event detail. */
-int x, y;                               /* Event mouse position. */
-{
-    XSetInputFocus(dpy, window, RevertToParent, CurrentTime);
-    FocusSetByUser = TRUE;
-    return(FALSE);
-}
--- a/src/GetButton.c	Mon Sep 17 20:51:55 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,495 +0,0 @@
-#ifndef lint
-static char *rcsid_GetButton_c = "$XConsortium: GetButton.c,v 1.38 88/10/23 12:08:12 jim Exp $";
-#endif	/* lint */
-
-#include "X11/copyright.h"
-#include <stdlib.h>
-
-/*
- * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
- *
- *                         All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of Digital Equipment
- * Corporation not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior permission.
- *
- *
- * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-
-
-/*
- * MODIFICATION HISTORY
- *
- * 000 -- M. Gancarz, DEC Ultrix Engineering Group
- * 001 -- L. Guarino Reid, DEC Ultrix Engineering Group, Western Software Lab
- *	  February 16, 1987
- *	  Add EnterWindow, LeaveWindow, and MouseMotion as recognized
- *	  uwm buttons for uwm menus. Add bug fixes to prevent mem faults
- *	  if icon_str is NULL.
- * 002 -- L. Guarino Reid, DEC Ultrix Engineering Group
- *	  April 16, 1987
- *	  Convert to X11
- */
-
-#ifndef lint
-static char *sccsid = "@(#)GetButton.c	3.8	1/24/86";
-#endif
-/*
- *	GetButton - This subroutine is used by the Ultrix Window Manager (uwm)
- *	to acquire button events.  It waits for a button event to occur
- *	and handles all event traffic in the interim.
- *
- *	File:		GetButton.c
- */
-
-#include "uwm.h"
-#include <X11/Xatom.h>
-
-#define ICONSTR	(icon_str ? icon_str : "")
-
-Bool GetButton(button_event)
-    XEvent *button_event;	/* Button event packet. */
-{
-#define STRLEN 50
-    XKeyPressedEvent *kp_event;	/* Key pressed event. */
-    char *icon_str;		/* Icon's name string. */
-    register int icon_str_len;	/* Icon name string lenght.  */
-    register int key_char;	/* Key press character code. */
-    register int icon_x;	/* Icon window X coordinate. */
-    register int icon_y;	/* Icon window Y coordinate. */
-    register int icon_w;	/* Icon window width. */
-    register int icon_h;	/* Icon window height. */    
-    int status;			/* Routine call return status. */
-    Window icon;		/* Icon window. */
-    Window appl;		/* Application window. */
-    XWindowAttributes icon_info;	/* Icon window info structure. */
-    char kbd_str[STRLEN];              /* Keyboard string. */
-    int nbytes;                 /* Keyboard string length. */
-    int i;                      /* Iteration counter. */
-
-
-    /*
-     * Get next event from input queue and store it in the event packet
-     * passed to GetButton.
-     */
-    XNextEvent(dpy, button_event);
-
-    processInterestEvent (button_event);
-
-    /*
-     * The event occured on the root window, check for substructure
-     * changes. Otherwise, it must be a mouse button event. 
-     */
-    if (((XAnyEvent *)button_event)->window == RootWindow(dpy, scr)) {
-
-	switch (button_event->type) {
-
-	  case CreateNotify:
-		(void) getWindowInfo (((XCreateWindowEvent *) button_event)->window);
-	  case 0:
-	  case UnmapNotify:
-	  case ReparentNotify:
-	  case ConfigureNotify:
-	  case ColormapNotify:
-	  case GravityNotify:
-	  case MapNotify:
-	  case EnterNotify:
-	  case LeaveNotify:
-	  case CirculateNotify: return(FALSE);
-
-	  case MappingNotify:
-		XRefreshKeyboardMapping (button_event);
-		return (FALSE);
-	  	
-	  case MapRequest: 
-	        CheckMap(((XMapEvent *)button_event)->window);
-		return(FALSE);
-
-	  case ConfigureRequest: 
-	        Configure((XConfigureEvent *)button_event);
-		return(FALSE);
-
-	  case CirculateRequest: 
-	        Circulate((XCirculateEvent *)button_event);
-		return(FALSE);
-
-	  case DestroyNotify:
-		deleteWindowInfo (((XDestroyWindowEvent *)button_event)->window);
-	        RemoveIcon(((XDestroyWindowEvent *)button_event)->window);
-		return(FALSE);
-
-	  case FocusIn: 
-		if (((XFocusInEvent *)button_event)->detail
-		    == NotifyPointerRoot) {
-    	            if (FocusSetByUser) {
-       	                XSetInputFocus(dpy, PointerRoot, None, CurrentTime);
-                        FocusSetByUser = FALSE;
-		    }
-		}
-		return (FALSE);
-
-          case FocusOut:
-		if (((XFocusOutEvent *)button_event)->detail
-		    == NotifyPointerRoot) {
-                    if (!FocusSetByUser) {
-   	                XSetInputFocus(dpy, PointerRoot, None, CurrentTime);
-		    }
-		}
-		return (FALSE);
-
-	  case ButtonPress:
-	  case ButtonRelease:
-		return(TRUE);
-
-	  default: 
-	    printf("uwm internal error: unexpected event on Root Window\n");
-	    return(FALSE); 
-	}
-    }
-
-    /*
-     * If the event type is EnterWindow, LeaveWindow, or MouseMoved,
-     * we are processing a menu. 
-     * If the event type is ButtonPress or ButtonRelease,
-     * we have a button event.      */
-    switch (button_event->type) {
-       case EnterNotify:
-       case LeaveNotify: 
-       case MotionNotify: 
-       case ButtonPress: 
-       case ButtonRelease: 
-	return(TRUE); 
-       case 0:
-        return(FALSE);
-       default: break;
-    }
-
-    /*
-     * Ok, if the event is not on the root window it might be an event on
-     * one of the icons owned by uwm.
-     */
-    icon = ((XAnyEvent *)button_event)->window;
-
-     /*
-     * Find out current information about the icon window.
-     */
-    status = XGetWindowAttributes(dpy, icon, &icon_info);
-    if (status == FAILURE) return(FALSE);
-    /*
-     * Get the name of the window associated with the icon and
-     * determine its length.
-     */
-    icon_x = icon_info.x;
-    icon_y = icon_info.y;
-    if (!IsIcon(icon, icon_x, icon_y, FALSE, &appl)) return(FALSE);
-
-    /*
-     * If the event is an UnmapWindow event or a ConfigureNotify event,
-     * then return FALSE.
-     */
-    if (button_event->type == MapNotify || 
-        button_event->type == UnmapNotify ||
-        button_event->type == CreateNotify ||
-        button_event->type == ReparentNotify ||
-        button_event->type == GravityNotify ||
-        button_event->type == CirculateNotify ||
-	button_event->type == ColormapNotify ||
-        button_event->type == ConfigureNotify)
-        return(FALSE);
-
-    /*
-     * Initialize the icon name variables.
-     */
-    icon_str = GetIconName(appl);
-    icon_str_len = icon_str ? strlen(icon_str) : 0;
-
-    /*
-     * If the event is a window exposure event and the icon's name string
-     * is not of zero length, simply repaint the text in the icon window
-     * and return FALSE.
-     */
-    if (button_event->type == Expose && (!Freeze || Frozen == 0)) {
-	int desired_width = XTextWidth (IFontInfo, ICONSTR, strlen (ICONSTR)) +
-			    (HIconPad << 1);
-	int desired_height = (IFontInfo->ascent + IFontInfo->descent + 
-			      (VIconPad << 1));
-
-        if (icon_info.width != desired_width || 
-	    icon_info.height != desired_height) {
-	    XWarpPointer (dpy, icon, icon, 0,0,0,0, (desired_width - HIconPad),
-			  (desired_height >> 1));
-	    XResizeWindow (dpy, icon, desired_width, desired_height);
-	}
-	XClearWindow(dpy, icon);
-        if (icon_str_len != 0) {
-            XDrawImageString(dpy, icon,
-                     IconGC, HIconPad, VIconPad+IFontInfo->ascent,
-                     icon_str, icon_str_len);
-	    /*
-	     * Remember to free the icon name string.
-	     */
-	    free(icon_str);
-        }
-	return(FALSE);
-    }
-
-    if (button_event->type != KeyPress) return (FALSE);
-    
-    /*
-     * If we have gotten this far event can only be a key pressed event.
-     */
-    kp_event = (XKeyPressedEvent *) button_event;
-
-    /* 
-     * We convert the key pressed event to ascii.
-     */
-    #if 0
-    nbytes = XLookupString(kp_event, kbd_str, STRLEN, NULL);
-    #else
-    nbytes = XLookupString(kp_event, kbd_str, STRLEN, NULL, NULL);
-    #endif
-    /*
-     * If kbd_str is a "non-string", then don't do anything.
-     */
-    if (nbytes == 0) {
-        if (icon_str) free(icon_str);
-        return(FALSE);
-    }
-    for (i = 0; i < nbytes; i++) {
-        key_char = kbd_str[i];
-        /*
-         * If the key was <DELETE>, then delete a character from the end of
-         * the name, return FALSE.
-         *
-         * If the key was <CTRL-U>, then wipe out the entire window name
-         * and return FALSE.
-         *
-         * All other ctrl keys are squashed and we return FALSE.
-         *
-         * All printable characters are appended to the window's name, which
-         * may have to be grown to allow for the extra length.
-         */
-        if (key_char == '\177' || key_char == '\b') {
-            /*
-             * <DELETE>
-             */
-            if (icon_str_len > 0) {
-		icon_str_len--;
-		icon_str[icon_str_len] = '\0';
-	    }
-        }
-        else if (key_char == '\025') {
-            /*
-             * <CTRL-U>
-             */
-            if (icon_str_len > 0) {
-		icon_str_len = 0;
-		icon_str[0] = '\0';
-	    }
-        }
-        else if (key_char < IFontInfo->min_char_or_byte2 ||
-                 key_char > IFontInfo->max_char_or_byte2) {
-            /*
-             * Any other random (non-printable) key; ignore it.
-             */
-	    /* do nothing */ ;
-        }
-        else {
-            /*
-             * ASCII Alphanumerics.
-             */
-	    if (icon_str == NULL)
-	    	icon_str = (char *) malloc (icon_str_len + 2);
-	    else
-	    	icon_str = (char *)realloc(icon_str, (icon_str_len + 2));
-            if (icon_str == NULL) {
-                errno = ENOMEM;
-                Error("GetButton -> Realloc of window name string memory failed.");
-            }
-            icon_str[icon_str_len] = key_char;
-            icon_str[icon_str_len + 1] = '\0';
-            icon_str_len += 1;
-        }
-    }
-
-    /*
-     * Now that we have changed the size of the icon we have to reconfigure
-     * it so that everything looks good.  Oh yes, don't forget to move the
-     * mouse so that it stays in the window!
-     */
-
-    /*
-     * Set the window name to the new string.
-     */
-    XSetIconName(dpy, appl, ICONSTR);
-
-    /*
-     * Determine the new icon window configuration.
-     */
-    icon_h = IFontInfo->ascent + IFontInfo->descent + (VIconPad << 1);
-    icon_w = XTextWidth(IFontInfo, ICONSTR, strlen(ICONSTR)) + (HIconPad << 1);
-    if (icon_w == 0) {
-        icon_w = icon_h;
-    }
-
-    if (icon_x < 0) icon_x = 0;
-    if (icon_y < 0) icon_y = 0;
-    if (icon_x - 1 + icon_w + (IBorderWidth << 1) > ScreenWidth) {
-	icon_x = ScreenWidth - icon_w - (IBorderWidth << 1) + 1;
-    }
-    if (icon_y - 1 + icon_h + (IBorderWidth << 1) > ScreenHeight) {
-	icon_y = ScreenHeight - icon_h - (IBorderWidth << 1) + 1;
-    }
-
-    XMoveResizeWindow (dpy, icon, icon_x, icon_y, icon_w, icon_h);
-    XWarpPointer (dpy, None, icon, 0, 0, 0, 0, 
-    		  (icon_w - HIconPad), (icon_h >> 1));
-
-    /* 
-     * Free the local storage and return FALSE.
-     */
-    if (icon_str) free(icon_str);
-    return(FALSE);
-}
-
-CheckMap(window)
-Window window;
-{
-    XSizeHints sizehints;
-    XWMHints *wmhints;
-    int winx, winy, winw, winh;
-    int x, y, w, h;
-    XWMHints *XGetWMHints();
-    Window transient_for;
-    Bool configureit = False;
-    Window jW;
-    int border_width, j;
-
-    clear_x_errors();
-    /*
-     * Gather info about the event window.
-     */
-    XGetGeometry (dpy, window, &jW, &winx, &winy, &winw, &winh, 
-    		  &border_width, &j);
-    if (x_error_occurred) return;
-
-    /* if it's a transient window, we won't rubber-band
-     * note that this call always sets transient_for.
-     */
-    if (XGetTransientForHint( dpy, window, &transient_for )) {
-	x = winx; y = winy; w = winw; h = winh;
-    }
-    else {
-	Bool usewindowgeom = True;
-	WindowInfo *wi;
-
-	if ((wmhints = XGetWMHints(dpy, window)) &&
-	    (wmhints->flags&StateHint) &&
-	    (wmhints->initial_state == IconicState)) {
-	    /* window will remain created size -- no rubberbanding */
-	    /* note that Iconify only uses its first argument */
-	    Iconify(window, 0, 0, 0, 0);
-	    if (wmhints) free ((char *) wmhints);
-	    return;
-	}
-	if (wmhints) free ((char *) wmhints);
-
-	wi = getWindowInfo (window);
-	sizehints.flags = 0; 
-        if (XGetSizeHints(dpy, window, &sizehints, XA_WM_NORMAL_HINTS)) {
-	    if (wi) {
-		if ((bcmp ((char *)&sizehints, (char *)&(wi->stashedhints),
-		    sizeof (XSizeHints)) != 0)) {
-		    wi->stashedhints = sizehints;
-		    usewindowgeom = False;
-	        }			     /* else hints haven't changed */
-	    } else {
-		usewindowgeom = False;
-	    }
-	}					/* else there are no hints */
-	CheckConsistency(&sizehints);
-
-	if (usewindowgeom) {
-	    sizehints.x = winx;
-	    sizehints.y = winy;
-	    sizehints.width = winw;
-	    sizehints.height = winh;
-	    if (wi && wi->been_mapped) {
-		sizehints.flags = (USPosition | USSize);
-	    }
-	}
-
-	AskUser(dpy, scr, window, &x, &y, &w, &h, &sizehints);
-	if (x != winx || y != winy || w != winw || h != winh)
-	  configureit = True;
-
-	if (wi) wi->been_mapped = True;
-
-    }
-
-    if (configureit)
-      XMoveResizeWindow(dpy, window, x, y, w, h);
-
-    XMapRaised(dpy, window);
-}
-
-Configure(event)
-XConfigureRequestEvent *event;
-{
-  XWindowChanges values;
-  
-  values.x = event->x;
-  values.y = event->y;
-  values.width = event->width;
-  values.height = event->height;
-  values.border_width = event->border_width;
-  values.stack_mode = event->detail;
-  values.sibling = event->above;
-
-  XConfigureWindow(event->display, event->window, event->value_mask, &values);
-}
-
-Circulate(event)
-XCirculateEvent *event;
-{
-  if (event->place == PlaceOnTop)
-   XRaiseWindow(event->display, event->window);
-  else
-   XLowerWindow(event->display, event->window);
-}
-
-int
-ProcessRequests(box, num_vectors)
-XSegment *box;
-int num_vectors;
-{
-	XEvent event;
-
-	XPeekEvent(dpy, &event);
-	switch (event.type) {
-
-	case MapRequest:
-	case ConfigureRequest:
-	case CirculateRequest:
-
-	    DrawBox();
-	    GetButton(&event);
-	    DrawBox();
-	    return TRUE;
-	}
-	return FALSE;
-}
-
--- a/src/GridBox.c	Mon Sep 17 20:51:55 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,151 +0,0 @@
-#ifndef lint
-static char *rcsid_StoreGridBox_c = "$XConsortium: GridBox.c,v 1.4 88/09/06 17:28:06 jim Exp $";
-#endif	/* lint */
-
-#include "X11/copyright.h"
-
-/*
- * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
- *
- *                         All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of Digital Equipment
- * Corporation not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior permission.
- *
- *
- * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-
-
-/*
- * MODIFICATION HISTORY
- *
- * 000 -- M. Gancarz, DEC Ultrix Engineering Group
- * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group,
-    Western Software Lab. Converted to X11.
- */
-
-#ifndef lint
-static char *sccsid = "@(#)StoreGridBox.c	3.8	1/24/86";
-#endif
-/*
- *	StoreGridBox - This subroutine is used by the X Window Manager (xwm)
- *	to store the vertices for the movement resize grid and box in a
- *	vertex list.
- */
-
-#include "uwm.h"
-
-/*
- * Store the vertices for the movement resize grid and box in a vertex list.
- */
-int StoreGridBox(box, ulx, uly, lrx, lry)
-register XSegment box[];
-int ulx;			/* Upper left X coordinate. */
-int uly;			/* Upper left Y coordinate. */
-int lrx;			/* Lower right X coordinate. */
-int lry;			/* Lower right Y coordinate. */
-{
-    register int xthird, ythird;
-    int x1third, y1third;
-    int x2third, y2third;
-
-    /*
-     * Xor in.
-     */
-    box[0].x1 = ulx; box[0].y1 = uly;
-    box[0].x2 = lrx; box[0].y2 = uly;
-
-    box[1].x1 = lrx; box[1].y1 = uly;
-    box[1].x2 = lrx; box[1].y2 = lry;
-
-    box[2].x1 = lrx; box[2].y1 = lry;
-    box[2].x2 = ulx; box[2].y2 = lry;
-
-    box[3].x1 = ulx; box[3].y1 = lry;
-    box[3].x2 = ulx; box[3].y2 = uly;
-
-
-    /*
-     * These are the X and Y calculations for the parts of the grid that
-     * are dependent on the division by 3 calculations.
-     */
-
-    /*
-     * Y dimension third.
-     */
-    ythird = (lry - uly) / 3;
-    y1third = uly + ythird;
-    y2third = y1third + ythird;
-   
-    /*
-     * X dimension third.
-     */
-    xthird = (lrx - ulx) / 3;
-    x1third = ulx + xthird;
-    x2third = x1third + xthird;
-
-    box[4].x1 = x1third; box[4].y1 = lry;
-    box[4].x2 = x1third; box[4].y2 = uly;
-
-    box[5].x1 = x2third; box[5].y1 = lry;
-    box[5].x2 = x2third; box[5].y2 = uly;
-
-    box[6].x1 = ulx; box[6].y1 = y1third;
-    box[6].x2 = lrx; box[6].y2 = y1third;
-
-    box[7].x1 = ulx; box[7].y1 = y2third;
-    box[7].x2 = lrx; box[7].y2 = y2third;
-
-    /*
-     * Do not erase if we're freezing the screen.
-     */
-    if (Freeze)
-        return(8);
-
-    /*
-     * From here on we're retracing the segments to clear the
-     * grid using GXxor.
-     */
-    box[8].x1 = ulx; box[8].y1 = uly;
-    box[8].x2 = lrx; box[8].y2 = uly;
-
-    box[9].x1 = lrx; box[9].y1 = uly;
-    box[9].x2 = lrx; box[9].y2 = lry;
-
-    box[10].x1 = lrx; box[10].y1 = lry;
-    box[10].x2 = ulx; box[10].y2 = lry;
-
-    box[11].x1 = ulx; box[11].y1 = lry;
-    box[11].x2 = ulx; box[11].y2 = uly;
-
-    box[12].x1 = x1third; box[12].y1 = lry;
-    box[12].x2 = x1third; box[12].y2 = uly;
-
-    box[13].x1 = x2third; box[13].y1 = lry;
-    box[13].x2 = x2third; box[13].y2 = uly;
-
-    box[14].x1 = ulx; box[14].y1 = y1third;
-    box[14].x2 = lrx; box[14].y2 = y1third;
-
-    box[15].x1 = ulx; box[15].y1 = y2third;
-    box[15].x2 = lrx; box[15].y2 = y2third;
-
-
-    /*
-     * Total number of segments is 16.
-     */
-    return(16);
-}
--- a/src/Iconify.c	Mon Sep 17 20:51:55 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,220 +0,0 @@
-/* $XConsortium: Iconify.c,v 1.3 88/09/06 17:28:08 jim Exp $ */
-#include "X11/copyright.h"
-
-/*
- * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
- *
- *                         All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of Digital Equipment
- * Corporation not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior permission.
- *
- *
- * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-
- 
-/*
- * MODIFICATION HISTORY
- *
- * 000 -- M. Gancarz, DEC Ultrix Engineering Group
- * 001 -- R. Kittell, DEC Storage A/D May 20, 1986
- *  Add optional warp of mouse to the upper right corner on de-iconify,
- *  and to the icon center on iconify.
- * 002 -- Loretta Guarino Reid, DEC Ultrix Engineering Group,
- *  Western Software Lab. Port to X11.
- */
- 
-#ifndef lint
-static char *sccsid = "%W%	%G%";
-#endif
- 
-#include "uwm.h"
- 
-Bool Iconify(window, mask, button, x, y)
-Window window;                          /* Event window. */
-int mask;                               /* Button/key mask. */
-int button;                             /* Button event detail. */
-int x, y;                               /* Event mouse position. */
-{
-    XWindowAttributes window_info;	/* Event window info. */
-    XWindowAttributes assoc_info;	/* Associated window info. */
-    int mse_x, mse_y;			/* Mouse X and Y coordinates. */
-    int sub_win_x, sub_win_y;		/* relative Mouse coordinates. */
-    int icon_x, icon_y;			/* Icon U. L. X and Y coordinates. */
-    int icon_w, icon_h;			/* Icon width and height. */
-    int icon_bdr;			/* Icon border width. */
-    int num_vectors;			/* Number of vectors in zap buffer. */
-    int mmask;				/* Mouse state */
-    Window root;			/* Mouse root window. */
-    Window assoc;			/* Associated window. */
-    Window sub_win;			/* Mouse position sub-window. */
-    XSegment zap[MAX_ZAP_VECTORS];	/* Zap effect vertex buffer. */
-    Bool iconifying;			/* Are we iconifying? */
- 
-    /*
-     * Do not try to iconify the root window.
-     */
-    if (window == RootWindow(dpy, scr))
-        return(FALSE);
- 
-    /*
-     * Clear the vector buffer.
-     */
-    if (Zap) bzero(zap, sizeof(zap));
- 
-    /*
-     * Get the mouse cursor position in case we must put a new
-     * icon there.
-     */
-    XQueryPointer(dpy, RootWindow(dpy, scr), &root, &sub_win, 
-    	&mse_x, &mse_y, &sub_win_x, &sub_win_y, &mmask);
- 
-    /*
-     * Gather info about the window.
-     */
-    status = XGetWindowAttributes(dpy, window, &window_info);
-    if (status == FAILURE) return(FALSE);
- 
-    /*
-     * If the event window is an icon, de-iconify it and return.
-     */
-    if (IsIcon(window, mse_x, mse_y, TRUE, &assoc)) {
- 
- 
-        /*
-         * Gather info about the assoc window.
-         */
-        status = XGetWindowAttributes(dpy, assoc, &assoc_info);
-        if (status == FAILURE) return(FALSE);
- 
-        /*
-         * Store the zap vector buffer.
-         */
-        if (Zap) {
-                num_vectors = StoreZap(
-                    zap,
-                    assoc_info.x - 1,
-                    assoc_info.y - 1,
-                    assoc_info.x + assoc_info.width +
-                        (assoc_info.border_width << 1),
-                    assoc_info.y + assoc_info.height +
-                        (assoc_info.border_width << 1),
-                    window_info.x - 1,
-                    window_info.y - 1,
-                    window_info.x + window_info.width +
-                        (window_info.border_width << 1),
-                    window_info.y + window_info.height +
-                        (window_info.border_width << 1));
-        }
- 
-        /*
-         * Map the window and synchronize.
-         */
-        XMapRaised(dpy, assoc);
-	XRemoveFromSaveSet(dpy, assoc);
- 
-            if (Zap) {
-                /*
-                 * Draw the zap lines.
-                 */
-                DrawZap();
-            }
- 
-        /*
-         * Unmap the icon window.
-         */
-        XUnmapWindow(dpy, window);
- 
-	/*
-	 * Optionally warp the mouse to the upper right corner of the
-         *  window.
-         */
-        if (WarpOnDeIconify) {
-	    status = XGetWindowAttributes (dpy, assoc, &assoc_info);
-            if (status == FAILURE) return(FALSE);
-	    status = XWarpPointer (dpy, None, assoc, 
-	    			 0, 0, 0, 0,
-				 assoc_info.width >= 7 ?
-                                 assoc_info.width - 7 : assoc_info.width / 2,
-                                 assoc_info.height >= 10 ? 10 :
-                                 assoc_info.height / 2);
-            if (status == FAILURE) return(FALSE);
-	}
-    }
-    else {
-        /*
-         * We have an icon window; all we have to do is
-         * map it.
-         */
-        status = XGetWindowAttributes(dpy, assoc, &assoc_info);
-        if (status == FAILURE) return(FALSE);
-        icon_x = assoc_info.x;
-        icon_y = assoc_info.y;
-        icon_w = assoc_info.width;
-        icon_h = assoc_info.height;
-	icon_bdr = assoc_info.border_width;
- 
-        if (Zap) {
-        /*
-         * Store the zap effect vectors.
-         */
-        num_vectors = StoreZap(
-            zap,
-            window_info.x - 1,
-            window_info.y - 1,
-            window_info.x + window_info.width + (window_info.border_width << 1),
-            window_info.y + window_info.height + (window_info.border_width << 1),
-            icon_x - 1,
-            icon_y - 1,
-            icon_x + icon_w + (icon_bdr << 1),
-            icon_y + icon_h + (icon_bdr << 1)
-        );
-        }
- 
-        /*
-         * Map the icon window.
-         */
-        XMapWindow(dpy, assoc);
- 
-        if (Zap) {
-        /*
-         * Draw zap lines from the window to its icon.
-         */
-            DrawZap();
-            DrawZap();
-        }
- 
-        /*
-         * Unmap the event window.
-         */
-	XAddToSaveSet(dpy, window);
-        XUnmapWindow(dpy, window);
- 
-	/*
-	 * Optionally warp the mouse to the icon center.
-         */
-        if (WarpOnIconify) {
-            status = XGetWindowAttributes(dpy, assoc, &assoc_info);
-            if (status == FAILURE) return(FALSE);
-	    status = XWarpPointer (dpy, None, assoc, 
-	    			 0, 0, 0, 0,
-				 assoc_info.width / 2, assoc_info.height / 2);
-            if (status == FAILURE) return(FALSE);
-	}
- 
-    }
-    return(TRUE);
-}
--- a/src/Icons.c	Mon Sep 17 20:51:55 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,324 +0,0 @@
-/* $XConsortium: Icons.c,v 1.13 89/04/22 12:11:20 rws Exp $ */
-#include "X11/copyright.h"
-#include <stdlib.h>
-
-/*
- * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
- *
- *                         All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of Digital Equipment
- * Corporation not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior permission.
- *
- *
- * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-
- 
-/*
- * MODIFICATION HISTORY
- *
- * 000 -- L. Guarino Reid, DEC Ultrix Engineering Group
- */
- 
-#ifndef lint
-static char *sccsid = "%W%	%G%";
-#endif
- 
-#include "uwm.h"
-#include <X11/Xatom.h>
-#ifdef SHAPE
-#include <X11/extensions/shape.h>
-#endif
-
-typedef struct _windowList {
-  struct _windowList *next;
-  Window window;
-  Window icon;
-  Bool own;
-  Pixmap pixmap;
-} WindowListRec, *WindowList;
-  
-WindowList Icons = NULL;
-
-
-/* the client should pass us a bitmap (single-plane pixmap with background=0
- * and foreground = 1).  It is our responsibility to convert it to a pixmap
- * of the appropriate depth for a window tile and also color it with the
- * appropriate background and foreground pixels.
- *
- * we'll use the (global) IconGC for the fore/background pixels.
- */
-
-static Pixmap MakePixmapFromBitmap( bitmap, width_return, height_return )
-Pixmap bitmap;
-unsigned int *width_return, *height_return;
-{
-    Pixmap tile;
-    Window junkW;
-    int junk, width, height;
-
-    if (!XGetGeometry( dpy, bitmap, &junkW, &junk, &junk,
-		      &width, &height, &junk, &junk )) {
-        Warning( "client passed invalid pixmap for icon." );
-	return( NULL );
-    }
-
-    tile = XCreatePixmap( dpy, RootWindow(dpy, scr), width, height,
-			  DefaultDepth(dpy, scr) );
-
-    /* use the IconGC's foreground & background, so we don't have to
-     * create another (and add yet another user configuration option.
-     * someday this may need to be split out.
-     */
-    XCopyPlane( dpy, bitmap, tile, IconGC, 0, 0, width, height, 0, 0, 1 );
-
-    if (width_return)  *width_return = width;
-    if (height_return) *height_return = height;
-
-    return( tile );
-}
-
-
-char *
-GetIconName(window)
-Window window;
-{
-    char *name;
-
-    if (XGetIconName( dpy, window, &name )) return( name );
-
-    if (XFetchName( dpy, window, &name )) return( name );
-
-    return( NULL );
-}
-
-Bool IsIcon(icon, x, y, mousePositioned, assoc)
-Window icon;
-Window *assoc;
-{
-  WindowList ptr;
-  Window MakeIcon();
-
-  for (ptr = Icons; ptr; ptr = ptr->next) {
-    if (ptr->icon == icon) {
-      if (assoc) *assoc = ptr->window; 
-      return(TRUE);
-    }
-    if (ptr->window == icon) {
-      if (assoc) *assoc = ptr->icon; 
-      return(FALSE);
-    }
-  }
-  if (assoc) *assoc = MakeIcon(icon, x, y, mousePositioned);
-  return(FALSE);
-}
-
-
-RemoveIcon(window)
-Window window;
-{
-  WindowList ptr, ptr1;
-
-  for (ptr = Icons; ptr; ptr = ptr->next) 
-    if (ptr->window == window) {
-      if (ptr->own) {
-	  XDestroyWindow(dpy, ptr->icon);
-	  if (ptr->pixmap != IBackground) XFreePixmap(dpy, ptr->pixmap);
-      }
-      break;
-    }
-  if (ptr) {
-    if (ptr==Icons) Icons = Icons->next;
-    else 
-      for (ptr1 = Icons; ptr1->next; ptr1 = ptr1->next) 
-        if (ptr1->next == ptr) {
-          ptr1->next = ptr->next;
-	  break;
-        };
-    free(ptr);
-    }
-}
-
-GetDefaultSize(window, icon_w, icon_h)
-Window window;
-int *icon_w, *icon_h;
-{
-    char *name;				/* Event window name. */
-
-          /*
-           * Determine the size of the icon window.
-           */ 
-          name = GetIconName(window);
-          *icon_h = IFontInfo->ascent + IFontInfo->descent;
-          if (name) {
-	    *icon_w = XTextWidth(IFontInfo, name, strlen(name));
-            if (*icon_w == 0)
-              *icon_w = *icon_h;
-	  } else 
-	    *icon_w = *icon_h;
-     }
-
-Window MakeIcon(window, x, y, mousePositioned)
-Window window;                          /* associated window. */
-int x, y;                               /* Event mouse position. */
-Bool mousePositioned;
-{
-    Window icon;			/* icon window. */
-    int icon_x, icon_y;			/* Icon U. L. X and Y coordinates. */
-    int icon_w, icon_h;			/* Icon width and height. */
-    int icon_bdr;			/* Icon border width. */
-    int mask;				/* Icon event mask */
-    int depth;				/* for XGetGeometry */
-    int dummy_event, dummy_error;       /* See XShapeQueryExtension() call. */
-    XSetWindowAttributes iconValues;	/* for icon window creation */
-    XWMHints *wmhints;			/* see if icon position provided */
-    XWMHints *XGetWMHints();
-    Window AddIcon();
- 
-   iconValues.background_pixmap = IBackground;
-   mask = (KeyPressMask|ExposureMask|StructureNotifyMask);
-   /*
-    * Process window manager hints.
-    */ 
-    if (wmhints = XGetWMHints(dpy, window)) {
-      if (wmhints->flags&IconWindowHint) {
-	  Window iw = wmhints->icon_window;
-	  free ((char *) wmhints);
-          return (AddIcon(window, iw, FALSE, 
-	  	  (StructureNotifyMask), (Pixmap)NULL));
-      } else if (wmhints->flags&IconPixmapHint) { 
-          iconValues.background_pixmap =
-	      MakePixmapFromBitmap( wmhints->icon_pixmap, &icon_w, &icon_h );
-	  if (iconValues.background_pixmap)
-	      mask = (StructureNotifyMask);
-	  else {
-	      iconValues.background_pixmap = IBackground;
-	      wmhints->flags &= ~IconPixmapHint;
-	      GetDefaultSize(window, &icon_w, &icon_h);
-	  }
-      }
-      else GetDefaultSize(window, &icon_w, &icon_h);
-    }
-    else GetDefaultSize(window, &icon_w, &icon_h);
-
-     /*
-      * Fix up sizes by padding.
-      */ 
-    if (!wmhints || !(wmhints->flags&(IconPixmapHint|IconWindowHint))) {
-      icon_w += (HIconPad << 1);
-      icon_h += (VIconPad << 1);
-    }
-
-     /*
-      * Set the icon border attributes.
-      */ 
-    if (!wmhints || !(wmhints->flags&IconWindowHint)) {
-      icon_bdr = IBorderWidth;
-      iconValues.border_pixel = IBorder;
-    }
- 
-    if (wmhints && (wmhints->flags&IconPositionHint)) {
-         icon_x = wmhints->icon_x;
-	 icon_y = wmhints->icon_y;
-    } else {
-      if (mousePositioned) {
-        /*
-         * Determine the coordinates of the icon window;
-         * normalize so that we don't lose the icon off the
-         * edge of the screen.
-         */
-        icon_x = x - (icon_w >> 1) + 1;
-        if (icon_x < 0) icon_x = 0;
-        icon_y = y - (icon_h >> 1) + 1;
-        if (icon_y < 0) icon_y = 0;
-        if ((icon_x - 1 + icon_w + (icon_bdr << 1)) > ScreenWidth) {
-           icon_x = ScreenWidth - icon_w - (icon_bdr << 1) + 1;
-        }
-        if ((icon_y - 1 + icon_h + (icon_bdr << 1)) > ScreenHeight) {
-           icon_y = ScreenHeight - icon_h - (icon_bdr << 1) + 1;
-        }
-      }
-      else {
-        icon_x = x + (icon_w >> 1);
-        icon_y = y + (icon_h >> 1);
-      }
-        
-    }
-
-   /*
-    * Create the icon window.
-    */
-   icon = XCreateWindow(
-                dpy, RootWindow(dpy, scr),
-                icon_x, icon_y,
-                icon_w, icon_h,
-                icon_bdr, 0, CopyFromParent, CopyFromParent,
-		CWBorderPixel+CWBackPixmap, &iconValues);
-
-#ifdef SHAPE
-   if (iconValues.background_pixmap != IBackground
-       && (wmhints->flags & IconMaskHint)
-#if 0
-       && XShapeQueryExtension(dpy)
-#else           
-       && XShapeQueryExtension(dpy, &dummy_event, &dummy_error)
-#endif
-           ){
-           XSetWindowBorderWidth(dpy, icon, 0);
-           XShapeCombineMask(dpy, icon, ShapeBounding, 0, 0, wmhints->icon_mask,
-                             ShapeSet);
-   }
-#endif
-
-   if (wmhints) free ((char *) wmhints);
-
-   return(AddIcon(window, icon, TRUE, mask, iconValues.background_pixmap));
- 
-}
-
-Window AddIcon(window, icon, own, mask, background)
-Window window, icon;
-Bool own;
-int mask;
-Pixmap background;
-{
-  WindowList ptr;
-
-   if (icon == NULL) return(NULL);
-   /*
-    * Use the text cursor whenever the mouse is in the icon window.
-    */
-   XDefineCursor(dpy, icon, TextCursor);
-    
-   /*
-    * Select "key pressed", "window exposure" and "unmap window"
-    * events for the icon window.
-    */
-   uwmExpressInterest (icon, mask);
-    
-    /*
-     * Set the event window's icon window to be the new icon window.
-     */
-    ptr = (WindowList) malloc(sizeof(WindowListRec));
-    ptr->window = window;
-    ptr->icon = icon;
-    ptr->own = own;
-    ptr->pixmap = background;
-    ptr->next = Icons;
-    Icons = ptr;
-
-    return(icon);
-}
--- a/src/Kill.c	Mon Sep 17 20:51:55 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-/* $XConsortium: Kill.c,v 1.2 88/09/06 17:28:26 jim Exp $ */
-
-#include "X11/copyright.h"
-
-#include "uwm.h"
-
-Bool
-Kill(window, mask, button, x, y)
-Window window;                          /* Event window. */
-int mask;                               /* Button/key mask. */
-int button;                             /* Button event detail. */
-int x, y;                               /* Event mouse position. */
-{
-    Window *assoc;
-
-    if (IsIcon(window, x, y, TRUE, &assoc))
-        XKillClient(dpy, assoc);
-    else
-        XKillClient(dpy, window);
-    return FALSE ;
-}
--- a/src/Lower.c	Mon Sep 17 20:51:55 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-#ifndef lint
-static char *rcsid_Lower_c = "$XConsortium: Lower.c,v 1.4 88/09/06 17:28:13 jim Exp $";
-#endif	/* lint */
-
-#include "X11/copyright.h"
-
-/*
- * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
- *
- *                         All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of Digital Equipment
- * Corporation not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior permission.
- *
- *
- * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * MODIFICATION HISTORY
- *
- * 000 -- M. Gancarz, DEC Ultrix Engineering Group
- * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group,
-    Western Software Lab. Convert to X11.
- */
-
-#ifndef lint
-static char *sccsid = "@(#)Lower.c	3.8	1/24/86";
-#endif
-
-#include "uwm.h"
-
-Bool Lower(window, mask, button, x, y)
-Window window;				/* Event window. */
-int mask;				/* Button/key mask. */
-int button;				/* Button event detail. */
-int x, y;				/* Event mouse position. */
-{
-    /*
-     * If the window is not the root window, lower the window and return.
-     */
-    if (window != RootWindow(dpy, scr))
-        XLowerWindow(dpy, window);
-    return(FALSE);
-}
--- a/src/Menu.c	Mon Sep 17 20:51:55 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,721 +0,0 @@
-#ifndef lint
-static char *rcsid_Menu_c = "$XConsortium: Menu.c,v 1.25 88/09/30 11:41:11 jim Exp $";
-#endif	/* lint */
-
-#include "X11/copyright.h"
-
-/*
- * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
- *
- *                         All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of Digital Equipment
- * Corporation not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior permission.
- *
- *
- * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-
-
-/*
- * MODIFICATION HISTORY
- *
- * 000 -- M. Gancarz, DEC Ultrix Engineering Group
- * 001 -- L. Guarino Reid, DEC Ultrix Engineering Group, Western Software Lab
- *	  February 16, 1987
- *	  Change menu implementation so that it uses EnterWindow, LeaveWindow,
- *	  and MouseMotion events to track the mouse, instead of polling.
- * 002 -- L. Guarino Reid, DEC Ultrix Engineering Group, Western Software Lab
- *	  April 30, 1987. Convert to X11.
- * 003 -- L. Guarino Reid, DEC Ultrix Engineering Group, Western Software Lab
- *	  June 18, 1987. Change call to system to handle signals move smoothly.
- */
-
-#ifndef lint
-static char *sccsid = "@(#)Menu.c	3.8	1/24/86";
-#endif
-
-#include <signal.h>
-#include "uwm.h"
-#include <stdlib.h>
-#include <sys/wait.h>
-
-Bool alternateGC = True;	/* true if only 2 colors are used */
-
-#define DisplayLine(w, pane, width, height, str, fg, bg, inv) \
-         if (alternateGC) { \
-	     if (inv) \
-	         XFillRectangle(dpy, w, MenuInvGC, 0, pane, width, height); \
-	     else \
-                 XDrawString(dpy, w, MenuGC, HMenuPad, pane + VMenuPad + MFontInfo->ascent, str, strlen(str)); \
-         } else { \
-             XSetForeground(dpy, MenuGC, bg); \
-	     XFillRectangle(dpy, w, MenuGC, 0, pane, width, height); \
-             XSetForeground(dpy, MenuGC, fg); \
-             XDrawString(dpy, w, MenuGC, HMenuPad, pane + VMenuPad + MFontInfo->ascent, str, strlen(str)); \
-         }
-
-/*
- * HP-UX does have vfork, but A/UX doesn't
- */
-#if (defined(SYSV) || defined(macII)) && !defined(hpux)
-#define vfork() fork()
-#endif
-
-/* the following procedure is a copy of the implementation of system, 
- * modified to reset the handling of SIGINT, SIGQUIT, and SIGHUP before
- * exec-ing
- */
-execute(s)
-char *s;
-{
-	int status, pid, w;
-	register int (*istat)(), (*qstat)();
-	char **oldenviron;
-	extern char **environ, **newenviron;
-
-	oldenviron = environ;
-	environ = newenviron;
-	if ((pid = vfork()) == 0) {
-		signal(SIGINT, SIG_DFL);
-		signal(SIGQUIT, SIG_DFL);
-		signal(SIGHUP, SIG_DFL);
-		execl("/bin/sh", "sh", "-c", s, 0);
-		_exit(127);
-	}
-	environ = oldenviron;
-
-	/* 
-	 * The following cast is necessary because newer compilers declare
-	 * signal() to be (void (*)()) whereas old ones use (int (*)()).
-	 */
-	istat = (int (*)()) signal(SIGINT, SIG_IGN);
-	qstat = (int (*)()) signal(SIGQUIT, SIG_IGN);
-	while ((w = wait(&status)) != pid && w != -1)
-		;
-	if (w == -1)
-		status = -1;
-	signal(SIGINT, istat);
-	signal(SIGQUIT, qstat);
-	return(status);
-}
-
-Bool Menu(window, mask, button, x, y, menu)
-Window window;				/* Event window. */
-int mask;				/* Button/key mask. */
-int button;				/* Button event detail. */
-int x, y;				/* Event mouse position. */
-MenuInfo *menu;
-{
-    XEvent button_event;		/* Button event packet. */
-    int event_x, event_y;		/* location of button event */
-    Bool func_stat;			/* Function status return. */
-    Window sub_window;			/* Current subwindow. */
-    int cur_item = 0;			/* Current menu item. */
-    int hi_lite = 0;			/* Current highlighted item. */
-    int i;				/* Iteration counter. */
-    int hlfg, hlbg;			/* Hi-liter pixels. */
-    MenuLine *ml;			/* Menu lines pointer. */
-    char *hlname;			/* Pointer to hi-liter name. */
-    char *strbuf;			/* String buffer for IsTextNL. */
-    Bool checkMotion = TRUE;		/* To Restore Cursor Position */
-    int funcbutton;			/* function button for window select */
-
-    /*
-     * Change the cursor.
-     */
-    XChangeActivePointerGrab(dpy, EVENTMASK, MenuCursor, CurrentTime);
-
-    /*
-     * Map the menu.
-     */
-    MapMenu(menu, x, y);
-    if (Autoselect) {
-        event_x = (menu->width >> 2) * 3;
-        event_y = (menu->iheight >> 1) * 3;
-        XWarpPointer(dpy, None, menu->w, 0, 0, 0, 0, event_x, event_y);
-	goto hilite;
-    }
-    else {
-        XWarpPointer(dpy, None, menu->w, 0, 0, 0, 0, 
-    		(menu->width >> 2) * 3, menu->iheight >> 1);
-        XFlush(dpy);
-    }
-
-    /*
-     * Main loop.
-     */
-    while (TRUE) {
-
-        /*
-         *  Get next event for menu.
-         */
-        if (!GetButton(&button_event)) continue;
-	switch (button_event.type) {
-
-            case LeaveNotify:
-	        /*
-	         * If the mouse has moved out of the menu sideways, abort
-	         * the menu operation. Reset the cursor and unmap the menu.
-		 * An extraneous LeaveNotify can come through if you are
-		 * popping up menu from a menu. If you moved the cursor toward
-		 * the edge of the original menu without going outside and
-		 * the new menu is smaller in width than the old menu, the
-		 * new menu will pop up and then disappear.
-	         */
-		if (((XAnyEvent *)&button_event)->window == menu->w) {
-			event_x = ((XLeaveWindowEvent * )&button_event)->x;
-	       		event_y = ((XLeaveWindowEvent * )&button_event)->y;
-			if (event_x < 0 || event_x > menu->width) {
-            		   ResetCursor(button);
-			   UnmapMenu(menu);
-          	  	   return(FALSE);
-        		}
-		}
-		goto hilite;
-
-            case EnterNotify:
-	        event_x = ((XEnterWindowEvent * )&button_event)->x;
-	        event_y = ((XEnterWindowEvent * )&button_event)->y;
-		goto hilite;
-            case MotionNotify:
-		{
-	        event_x = ((XPointerMovedEvent * )&button_event)->x;
-	        event_y = ((XPointerMovedEvent * )&button_event)->y;
-		if ((checkMotion == TRUE) &&
-		    ((event_x != (menu->width >> 2) * 3) ||
-		     (event_y != (menu->iheight >> 1))))
-		   checkMotion = FALSE;	 /* Mouse Has Moved From Top Pane */
-hilite:
-        	/*
-         	* If the mouse has moved below or above the menu, but is still
-         	* within the same vertical plane, then simply adjust the values
-         	* so the user doesn't fall off the edge.
-         	*/
-        	if (event_y >= menu->height) 
-		  event_y = menu->height - 1;
-        	else if (event_y < 0) 
-		  event_y = 0;
-		  
-        	/*
-         	* If the mouse has moved to another item in the menu,
-         	* highlight the new item.
-         	*/
-        	cur_item = event_y / menu->iheight;
-        	if (cur_item != hi_lite) {
-
-            	/*
-             	* Remove highlighting on old item.
-             	*/
-            	if (hi_lite) {
-                	DisplayLine(menu->w, hi_lite * menu->iheight,
-                            menu->width, menu->iheight, hlname,
-                            hlfg, hlbg, 1);
-			XFlush(dpy);
-            	}
-
-           	/*
-             	* Highlight new item.
-             	*/
-            	hi_lite = cur_item;
-            	if (cur_item) {
-                	for(i = 1, ml = menu->line; ml; i++, ml = ml->next) {
-                    		if (i == cur_item) break;
-               	 	}
-                	DisplayLine(menu->w, cur_item * menu->iheight,
-                            menu->width, menu->iheight, ml->name,
-                            menu->hlfg.pixel, menu->hlbg.pixel, 1);
-/*                	XSetForeground(dpy, MenuGC, menu->hlfg.pixel );
-			XDrawRectangle(dpy, menu->w, MenuGC, 1, 
-				cur_item * menu->iheight + 1, 
-				menu->width - 3, menu->iheight - 3);
-*/
-			XFlush(dpy);
-             		hlfg = ml->fg.pixel;
-            		hlbg = ml->bg.pixel;
-            		hlname = ml->name;
-            	}
-		}
-        	break;
-
-            case ButtonRelease:
-	        /* have we released the invoking button? */
-	        if (((XButtonReleasedEvent *)&button_event)->button == button) {
-		    /*
-		     * If no item was selected, 
-		     * close the menu, reset the pointer's position and return
-		     */
-		    if (!cur_item) {
-			/* If Needed Reset The Cursor Position */
-			if (checkMotion == TRUE)
-			  XWarpPointer (dpy, None, RootWindow(dpy, scr),
-					0, 0, 0, 0, x, y);
-		         ResetCursor(button);
-			 UnmapMenu(menu);
-		         return(TRUE);
-		     }
-
-		     /*
-		      * Get a pointer to the menu line selected.
-		      */
-		     --cur_item;
-		     for(i = 0, ml = menu->line; ml; i++, ml = ml->next) {
-		         if (i == cur_item) break;
-		     }
-
-		     /*
-		      * Perform the selected menu line action.
-		      */
-		     switch (ml->type) {
-
-		         case IsShellCommand:
-		             UnmapMenu(menu);
-		             execute(ml->text);
-		             break;
-
-		         case IsText:
-		             UnmapMenu(menu);
-		             XStoreBytes(dpy, ml->text, strlen(ml->text));
-		             break;
-
-		         case IsTextNL:
-		             UnmapMenu(menu);
-		             strbuf = (char *)malloc(strlen(ml->text) + 2);
-		             strcpy(strbuf, ml->text);
-		             strcat(strbuf, "\n");
-		             XStoreBytes(dpy, strbuf, strlen(strbuf));
-		             free(strbuf);
-		             break;
-
-		         case IsUwmFunction:
-			     /* change cursor and grab next button event
-			      * to select the target window */
-			     if (XGrabPointer( dpy, RootWindow(dpy, scr),
-					       TRUE, EVENTMASK, GrabModeAsync,
-					       GrabModeAsync, None,
-					       TargetCursor, CurrentTime )
-				   != GrabSuccess )
-			         Error( "Could not grab pointer" );
-		             funcbutton = GetContext (&sub_window,
-						      &event_x, &event_y);
-		             UnmapMenu(menu);
-		             if (sub_window != menu->w)
-			       func_stat =
-		                 (*ml->func) (sub_window, mask, funcbutton,
-					      event_x, event_y);
-			     else func_stat = FALSE;
-			     if (!func_stat) {
-			       /* eat the next ButtonRelease */
-			       while (TRUE) {
-				   if (GetButton(&button_event) &&
-				       button_event.type == ButtonRelease)
-				     break;
-			       }
-			     }
-			     XUngrabPointer( dpy, CurrentTime );
-		             break;
-
-		         case IsImmFunction:
-		             UnmapMenu(menu);
- 		            (*ml->func) (
-			      sub_window, mask, button, event_x, 
-			      event_y);
-		             break;
-		 
-		         case IsMenuFunction:
-		             while (TRUE) {
-		                if (!GetButton(&button_event)) continue;
-		                if (button_event.type != ButtonPress) continue;
-		                if ((((XButtonPressedEvent *)&button_event)->state != mask) 
-				 || (((XButtonPressedEvent *)&button_event)->button != button)) 
-				 {
-		                     UnmapMenu(menu);
-		                     return(TRUE);
-		                 }
-		                 break;
-		             }
-		             UnmapMenu(menu);
-		             func_stat = 
-			     	Menu(menu->w, mask, button, x, y, ml->menu);
-		             return(func_stat);
-		             break;
-
-		         default:
- 		            Error("Menu -> Internal type error.");
-		     }
-		     return(TRUE);
-		  
-                 } 
-		 /* else a different button was released. Fall through: */
-            default:
-                    /*
-                     * Some other button event occurred, so abort the menu
-                     * operation.
-                     */
-		    ResetCursor(button);
-		    /* If Needed Reset The Cursor Position */
-		    if (checkMotion == TRUE)
-		      XWarpPointer (dpy, None, RootWindow(dpy, scr),
-				    0, 0, 0, 0, x, y);
-                    UnmapMenu(menu);
-                    return(TRUE);
-		
-	}
-     }
-  }
-}
-
-
-/*
- * Create the menu windows for later use.
- */
-CreateMenus()
-{
-    MenuLink *ptr;
-
-    /*
-     * If MaxColors isn't set, then jam it to an impossibly high
-     * number.
-     */
-    if (MaxColors == 0)
-        MaxColors = 25000;
-
-    for(ptr = Menus; ptr; ptr = ptr->next)
-        InitMenu(ptr->menu);
-}
-
-/*
- * Initialize a menu.
- */
-InitMenu(menu)
-MenuInfo *menu;
-{
-    MenuLine *ml;		/* Menu lines pointer. */
-    int width;			/* Width of an item name. */
-    int maxwidth;		/* Maximum width of item names. */
-    int len;			/* Length of an item name. */
-    int count = 1;		/* Number of items + 1 for name. */
-    XSetWindowAttributes attr;
-
-    /*
-     * Determine the name of the longest menu item.
-     */
-    maxwidth = XTextWidth(MFontInfo, menu->name, strlen(menu->name));
-    if (maxwidth == 0)
-        Error("InitMenu -> Couldn't get length of menu name");
-
-    for(ml = menu->line; ml; ml = ml->next) {
-        if ((len = strlen(ml->name)) == 0)
-            break;
-        width = XTextWidth(MFontInfo, ml->name, strlen(ml->name));
-        if (width == 0) 
-	  Error("InitMenu -> Couldn't get length of menu item name");
-        if (width > maxwidth) maxwidth = width;
-        count++;
-    }
-
-    /*
-     * Get the color cells for the menu items.
-     */
-    GetMenuColors(menu);
-
-    /*
-     * Stash the menu parameters in the menu info structure.
-     */
-    menu->iheight = MFontInfo->ascent + MFontInfo->descent + (VMenuPad << 1);
-    menu->height = menu->iheight * count;
-    menu->width = maxwidth + (HMenuPad << 1);
-    menu->image = NULL;
-
-    /*
-     * Create the menu window.
-     */
-    attr.border_pixel = MBorder;
-    /*
-     * SaveUnders Enabled If The Server Supports It
-     */
-    attr.save_under = DoesSaveUnders( DefaultScreenOfDisplay( dpy ) );
-    /*
-     * We want enter, leave, and mouse motion events for menus.
-     */
-    attr.event_mask = ( EnterWindowMask | LeaveWindowMask | PointerMotionMask );
-    /*
-     * Define a cursor for the window
-     */
-    attr.cursor = MenuCursor;
-    menu->w = XCreateWindow( dpy, RootWindow( dpy, scr ),
-			     0, 0,
-			     menu->width, menu->height,
-			     MBorderWidth,
-			     DefaultDepth( dpy, scr ),
-			     InputOutput,
-			     DefaultVisual( dpy, scr ),
-	CWBorderPixel | CWSaveUnder | CWEventMask | CWCursor,
-			     &attr );
-
-    uwmExpressInterest (menu->w, attr.event_mask);
-
-    if (menu->w == NULL) Error("InitMenu -> Couldn't create menu window");
-
-    /*
-     * For monochrome servers, we *do* want to set a background pixel
-     */
-    if (alternateGC) {
-	XSetWindowBackground( dpy, menu->w, MBackground );
-    }
-
-    /*
-     * Store the window name.
-     */
-    XStoreName(dpy, menu->w, menu->name);
-
-}
-
-/*
- * Map a menu.
- */
-MapMenu(menu, x, y)
-MenuInfo *menu;
-int x, y;
-{
-    int item;
-    Window w;
-    MenuLine *ml;
-    XWindowChanges values;
-
-    w = menu->w;
-
-    /*
-     * Move the menu into place, normalizing the coordinates, if necessary;
-     * then map it.
-     */
-    x -= (menu->width >> 1);
-    if (x < 0) x = 0;
-    else if (x + menu->width >= ScreenWidth)
-        x = ScreenWidth - menu->width - (MBorderWidth << 1);
-    if (y < 0) y = 0;
-    else if (y + menu->height >= ScreenHeight)
-        y = ScreenHeight - menu->height - (MBorderWidth << 1);
-    values.x = x;
-    values.y = y;
-    values.stack_mode = Above;
-    XConfigureWindow(dpy, w, CWX|CWY|CWStackMode, &values);
-
-    /*
-     * Map the window and draw the text items.
-     */
-    XMapWindow(dpy, w);
-    DisplayLine(w, 0, menu->width, menu->iheight, menu->name,
-                menu->bg.pixel, menu->fg.pixel, 0);
-
-    if (alternateGC) {
-        XFillRectangle(dpy, menu->w, MenuInvGC, 0, 0,
-		       menu->width, menu->iheight);
-        XDrawRectangle(dpy, menu->w, MenuInvGC, 1, 1,
-		       menu->width - 3, menu->iheight - 3);
-    } else {
-        XSetForeground(dpy, MenuGC, menu->bg.pixel );
-        XDrawRectangle(dpy, menu->w, MenuGC, 1, 1, menu->width - 3, 
-		       menu->iheight - 3);
-    }
-
-    item = menu->iheight;
-    for(ml = menu->line; ml; ml = ml->next) {
-        DisplayLine(w, item, menu->width, menu->iheight, ml->name,
-                    ml->fg.pixel, ml->bg.pixel, 0);
-        item += menu->iheight;
-    }
-
-    /*
-     * Position the mouse cursor in the menu header (or in the first item
-     * if "autoselect" is set).
-     */
-
-    XFlush(dpy);
-}
-
-/*
- * Unmap a menu, restoring the contents of the screen underneath
- * if necessary. (Restore portion is a future.)
- */
-UnmapMenu(menu)
-MenuInfo *menu;
-{
-    /*
-     * Unmap and flush.
-     */
-    XUnmapWindow(dpy, menu->w);
-    XFlush(dpy);
-}
-
-/*
- * Get the context for invoking a window manager function; return the button
- * pressed.
- */
-int GetContext(w, x, y)
-Window *w;
-int *x, *y;
-{
-    XEvent button_event;  /* Button input event. */
-
-    while (TRUE) {
-
-        /*
-         * Get the next mouse button event.  Spin our wheels until
-         * a button event is returned (ie. GetButton == TRUE).
-         * Note that mouse events within an icon window are handled
-         * in the "GetButton" function or by the icon's owner if
-         * it is not uwm.
-         */
-        if (!GetButton(&button_event)) continue;
-
-        /*
-         * If the button event received is not a ButtonPress event
-         * then continue until we find one.
-         */
-        if (button_event.type != ButtonPress) continue;
-
-        /*
-         * Okay, determine the event window and mouse coordinates.
-         */
-        status = XTranslateCoordinates(dpy, 
-				    RootWindow(dpy, scr), 
-				    RootWindow(dpy, scr),
-                                    ((XButtonPressedEvent *)&button_event)->x, 
-                                    ((XButtonPressedEvent *)&button_event)->y, 
-                                    x, y,
-                                    w);
-
-        if (status == FAILURE) continue;
-
-        if (*w == 0)
-            *w = RootWindow(dpy, scr);
-
-        return (((XButtonPressedEvent *) &button_event)->button);
-    }
-}
-
-/*
- * Get the color cells for a menu.  This function is slightly brain-damaged
- * in that once MaxColors <= 1, then it refuses to even try to allocate any
- * more colors, even though the colors may have already been allocated.  It
- * probably ought to be done right someday.
- */
-GetMenuColors(menu)
-MenuInfo *menu;
-{
-    register MenuLine *ml;		/* Menu lines pointer. */
-
-    /*
-     * If we have more than 2 colors available, then attempt to get
-     * the color map entries requested by the user.
-     * Otherwise, default to standard black and white.
-     *
-     * The boolean "alternateGC" is true iff we can use just two colors.
-     */
-
-    if (DisplayCells(dpy, scr) > 2) {
-        /*
-         * Get the menu header colors first.
-         */
-        if (!(menu->foreground && menu->background && MaxColors > 1 &&
-              XParseColor(dpy, DefaultColormap(dpy, scr), menu->foreground, &menu->fg) &&
-              XAllocColor(dpy, DefaultColormap(dpy, scr), &menu->fg) &&
-              XParseColor(dpy, DefaultColormap(dpy, scr), menu->background, &menu->bg) &&
-              XAllocColor(dpy, DefaultColormap(dpy, scr), &menu->bg))) {
-            menu->fg.pixel = MTextForeground;
-            menu->bg.pixel = MTextBackground;
-        } else {
-            AdjustMaxColors(menu->fg.pixel);
-            AdjustMaxColors(menu->bg.pixel);
-	    alternateGC = False;	/* since we just allocated colors */
-        }
-
-        /*
-         * Get the menu highlight colors.
-         */
-        if (!(menu->fghighlight && menu->bghighlight && MaxColors > 1 &&
-              XParseColor(
-	        dpy, DefaultColormap(dpy, scr), menu->fghighlight, &menu->hlfg) &&
-              XAllocColor(dpy, DefaultColormap(dpy, scr), &menu->hlfg) &&
-              XParseColor(
-	        dpy, DefaultColormap(dpy, scr), menu->bghighlight, &menu->hlbg) &&
-              XAllocColor(dpy, DefaultColormap(dpy, scr), &menu->hlbg))) {
-            menu->hlfg.pixel = MTextBackground;
-            menu->hlbg.pixel = MTextForeground;
-        } else {
-            AdjustMaxColors(menu->hlfg.pixel);
-            AdjustMaxColors(menu->hlbg.pixel);
-	    alternateGC = False;
-        }
-
-        /*
-         * Get the menu item colors.
-         */
-        for(ml = menu->line; ml; ml = ml->next) {
-            if (!(ml->foreground && ml->background && MaxColors > 1 &&
-                  XParseColor(dpy, DefaultColormap(dpy, scr), ml->foreground, &ml->fg) &&
-                  XAllocColor(dpy, DefaultColormap(dpy, scr), &ml->fg) &&
-                  XParseColor(dpy, DefaultColormap(dpy, scr), ml->background, &ml->bg) &&
-                  XAllocColor(dpy, DefaultColormap(dpy, scr), &ml->bg))) {
-                ml->fg.pixel = MTextForeground;
-                ml->bg.pixel = MTextBackground;
-            } else {
-                AdjustMaxColors(ml->fg.pixel);
-                AdjustMaxColors(ml->bg.pixel);
-            }
-        }
-
-    } else {
-
-        /*
-         * Only 2 colors available, so default to standard black and white.
-         */
-        menu->fg.pixel = MTextForeground;
-        menu->bg.pixel = MTextBackground;
-        menu->hlfg.pixel = MTextBackground;
-        menu->hlbg.pixel = MTextForeground;
-        for(ml = menu->line; ml; ml = ml->next) {
-            ml->fg.pixel = MTextForeground;
-            ml->bg.pixel = MTextBackground;
-        }
-    }
-}
-
-/*
- * Decrement "MaxColors" if this pixel value has never been used in a
- * menu before.
- */
-AdjustMaxColors(pixel)
-int pixel;
-{
-    register MenuLink *mptr;
-    register MenuLine *lptr;
-    int count = 0;
-
-    for(mptr = Menus; mptr; mptr = mptr->next) {
-        if (mptr->menu->fg.pixel == pixel) ++count;
-        if (mptr->menu->bg.pixel == pixel) ++count;
-        if (mptr->menu->hlfg.pixel == pixel) ++count;
-        if (mptr->menu->hlbg.pixel == pixel) ++count;
-        for(lptr = mptr->menu->line; lptr; lptr = lptr->next) {
-            if (lptr->fg.pixel == pixel) ++count;
-            if (lptr->bg.pixel == pixel) ++count;
-        }
-        if (count > 1) return;
-    }
-    --MaxColors;
-}
-
--- a/src/Move.c	Mon Sep 17 20:51:55 2018 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,250 +0,0 @@
-#ifndef lint
-static char *rcsid_Move_c = "$XConsortium: Move.c,v 1.13 88/10/22 15:21:16 jim Exp $";
-#endif	/* lint */
-
-#include "X11/copyright.h"
-
-/*
- * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
- *
- *                         All Rights Reserved
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of Digital Equipment
- * Corporation not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior permission.
- *
- *
- * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
- * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
- * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
- * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-/*
- * MODIFICATION HISTORY
- *
- * 000 -- M. Gancarz, DEC Ultrix Engineering Group
- * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group, 
- *	  Western Software Lab. Port to X11
- */
-
-#ifndef lint
-static char *sccsid = "@(#)Move.c	3.8	1/24/86";
-#endif
-
-#include "uwm.h"
-
-Bool Move(window, mask, button, x, y)
-Window window;				/* Event window. */
-int mask;				/* Button/key mask. */
-int button;				/* Button event detail. */
-int x, y;				/* Event mouse position. */
-{
-    register int prev_x;		/* Previous event window X location. */
-    register int prev_y;		/* Previous event window Y location. */
-    XWindowAttributes window_info;	/* Event window information. */
-    int cur_x;				/* Current event window X location. */
-    int cur_y;				/* Current event window Y location. */
-    int root_x;				/* Root window X location. */
-    int root_y;				/* Root window Y location. */
-    int ulx, uly;			/* Event window upper left X and Y. */
-    int lrx, lry;			/* Event window lower right X and Y. */
-    int init_ulx, init_uly;		/* Init window upper left X and Y. */
-    int init_lrx, init_lry;		/* Init window lower right X and Y. */
-    int num_vectors;			/* Number of vectors in box. */
-    int ptrmask;			/* state of ptr when queried */
-    Window sub_window;			/* Query mouse event sub-window. */
-    Window root;			/* Query mouse event root. */
-    XEvent button_event;		/* Button event packet. */
-    XSegment box[MAX_BOX_VECTORS];	/* Box vertex buffer. */
-    XSegment zap[MAX_ZAP_VECTORS];	/* Zap effect verted buffer. */
-
-    /*
-     * Do not try to move the root window.
-     */
-    if (window == RootWindow(dpy, scr))
-        return(FALSE);
-
-    /*
-     * Change the cursor.
-     */
-    XChangeActivePointerGrab(dpy, EVENTMASK, ArrowCrossCursor, CurrentTime);
-
-    /*
-     * Clear the vector buffers.
-     */
-    bzero(box, sizeof(box));
-    if (Zap) bzero(zap, sizeof(zap));
-    
-    /*
-     * Gather info on the event window.
-     */
-    status = XGetWindowAttributes(dpy, window, &window_info);
-