[comp.sources.x] v00i004: Ardent Window Manager

mikew@wyse.wyse.com (Mike Wexler) (08/10/88)

Submitted-by: jkh@ardent (Jordan Hubbard)
Posting-number: Volume 0, Issue 4
Archive-name: awm/part03

#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of archive 3 (of 13)."
# Contents:  awm/Bindings.c awm/Cursors.c awm/Menu.c awm/Raise.c
#   awm/Refresh.c awm/Restart.c awm/StoreBox.c awm/StoreZap.c
#   awm/XRdBitFD.c awm/bitmaps/xterm.bm awm/menus/dbug.h
# Wrapped by mikew@wyse on Mon Aug  8 12:01:42 1988
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f awm/Bindings.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"awm/Bindings.c\"
else
echo shar: Extracting \"awm/Bindings.c\" \(3702 characters\)
sed "s/^X//" >awm/Bindings.c <<'END_OF_awm/Bindings.c'
X#ident   "%W% %G%"
X
X
X
X#ifndef lint
Xstatic char *rcsid_Bindings_c = "$Header: Bindings.c,v 1.1 88/06/15 15:30:22 jkh Exp $";
X#endif	lint
X
X#include "X11/copyright.h"
X/*
X *
X * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca.
X *
X * Copyright 1987 by Jordan Hubbard.
X *
X *
X *                         All Rights Reserved
X *
X * Permission to use, copy, modify, and distribute this software and its
X * documentation for any purpose and without fee is hereby granted,
X * provided that the above copyright notice appear in all copies and that
X * both that copyright notice and this permission notice appear in
X * supporting documentation, and that the name of Ardent Computer
X * Corporation or Jordan Hubbard not be used in advertising or publicity
X * pertaining to distribution of the software without specific, written
X * prior permission.
X *
X */
X
X/*
X * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
X *
X *                         All Rights Reserved
X *
X * Permission to use, copy, modify, and distribute this software and its
X * documentation for any purpose and without fee is hereby granted,
X * provided that the above copyright notice appear in all copies and that
X * both that copyright notice and this permission notice appear in
X * supporting documentation, and that the name of Digital Equipment
X * Corporation not be used in advertising or publicity pertaining to
X * distribution of the software without specific, written prior permission.
X *
X *
X * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
X * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
X * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
X * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
X * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
X * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
X * SOFTWARE.
X */
X
X
X
X/*
X * MODIFICATION HISTORY
X *
X * 000 -- M. Gancarz, DEC Ultrix Engineering Group
X */
X
X#ifndef lint
Xstatic char *sccsid = "@(#)Bindings.c	3.8	1/24/86";
X#endif
X
X/*
X * Bindings.c 	Default bindings for the X window manager 'awm'
X *
X * Note: Any changes to this file should also be added to the file
X * /usr/new/lib/X/awm/default.awmrc to keep users informed as to the bindings
X * contained herein.
X */
X
Xchar *DefaultBindings[] = {
X"menu=\"WindowOps\"{",
X"New Window:!\"xterm&\"",
X"RefreshScreen:f.refresh",
X"Redraw:f.redraw",
X"Move:f.move",
X"Resize:f.resize",
X"Lower:f.lower",
X"Raise:f.raise",
X"CircUp:f.circleup",
X"CircDown:f.circledown",
X"AutoIconify:f.iconify",
X"LowerIconify:f.newiconify",
X"NewIconify:f.newiconify",
X"Focus:f.focus",
X"Freeze:f.pause",
X"UnFreeze:f.continue",
X"Restart:f.restart",
X"}",
X"menu=\"Preferences\"{",
X"Bell Loud:!\"xset b 7&\"",
X"Bell Normal:!\"xset b 3&\"",
X"Bell Off:!\"xset b off&\"",
X"Click Loud:!\"xset c 8&\"",
X"Click Soft:!\"xset c on&\"",
X"Click Off:!\"xset c off&\"",
X"Lock On:!\"xset l on&\"",
X"Lock Off:!\"xset l off&\"",
X"Mouse Fast:!\"xset m 4 2&\"",
X"Mouse Normal:!\"xset m 2 5&\"",
X"Mouse Slow:!\"xset m 1 1&\"",
X"}",
X"f.newiconify=m:w|i:delta l",
X"f.raise=m:w|i:delta l",
X"f.lower=m:w|i:l u",
X"f.raise=m:w:m d",
X"f.resize=m:w:delta m",
X"f.iconify=m:i:m u",
X"f.raise=m:w|i:r d",
X"f.move=m:w|i:delta r",
X"f.circledown=m:r:l d",
X"f.circleup=m:r:r d",
X"f.circledown=m|s::l d",
X"f.menu=:r:m d:\"WindowOps\"",
X"f.menu=m|s::m d:\"WindowOps\"",
X"f.menu=m|s::m d:\"Preferences\"",
X"f.circleup=m|s::r d",
X"f.iconify=m|c:w|i:l d",
X"f.newiconify=m|l:w|i:l d",
X"f.raise=m|l:w|i:l u",
X"f.pushright=m|l:w|i:r d",
X"f.pushleft=m|c:w|i:r d",
X"f.pushup=m|l:w|i:m d",
X"f.pushdown=m|c:w|i:m d",
X0	/* Must NOT be removed. */
X};
END_OF_awm/Bindings.c
if test 3702 -ne `wc -c <awm/Bindings.c`; then
    echo shar: \"awm/Bindings.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f awm/Cursors.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"awm/Cursors.c\"
else
echo shar: Extracting \"awm/Cursors.c\" \(3888 characters\)
sed "s/^X//" >awm/Cursors.c <<'END_OF_awm/Cursors.c'
X#ident   "%W% %G%"
X
X
X
X#ifndef lint
Xstatic char *rcsid_StoreCursors_c = "$Header: Cursors.c,v 1.1 88/06/15 15:21:52 jkh Exp $";
X#endif	lint
X
X#include "X11/copyright.h"
X/*
X *
X * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca.
X *
X * Copyright 1987 by Jordan Hubbard.
X *
X *
X *                         All Rights Reserved
X *
X * Permission to use, copy, modify, and distribute this software and its
X * documentation for any purpose and without fee is hereby granted,
X * provided that the above copyright notice appear in all copies and that
X * both that copyright notice and this permission notice appear in
X * supporting documentation, and that the name of Ardent Computer
X * Corporation or Jordan Hubbard not be used in advertising or publicity
X * pertaining to distribution of the software without specific, written
X * prior permission.
X *
X */
X
X/*
X * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
X *
X *                         All Rights Reserved
X *
X * Permission to use, copy, modify, and distribute this software and its
X * documentation for any purpose and without fee is hereby granted,
X * provided that the above copyright notice appear in all copies and that
X * both that copyright notice and this permission notice appear in
X * supporting documentation, and that the name of Digital Equipment
X * Corporation not be used in advertising or publicity pertaining to
X * distribution of the software without specific, written prior permission.
X *
X *
X * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
X * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
X * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
X * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
X * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
X * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
X * SOFTWARE.
X */
X
X
X
X/*
X * MODIFICATION HISTORY
X *
X * 000 -- M. Gancarz, DEC Ultrix Engineering Group
X * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group
X *        Convert to X11
X */
X
X#ifndef lint
Xstatic char *sccsid = "@(#)StoreCursors.c	3.8	1/24/86";
X#endif
X
X#include "awm.h"
X#include "X11/cursorfont.h"
X
X/*
X * Store all the cursors into global variables.
X */
XStoreCursors()
X{
X    Entry("StoreCursors")
X
X    /*
X     * Main awm cursor and movement cursor.
X     */
X    ArrowCrossCursor = XCreateFontCursor(dpy, XC_fleur);
X    if (ArrowCrossCursor == FAILURE) {
X	Error("StoreCursors -> Unable to store ArrowCrossCursor.");
X    }
X
X    /*
X     * Text cursor used in icons.
X     */
X    TextCursor = XCreateFontCursor(dpy, XC_xterm);	
X    if (TextCursor == FAILURE) {
X	Error("StoreCursors -> Unable to store TextCursor.");
X    }
X
X    /*
X     * Icon cursor used to iconify windows.
X     */
X    IconCursor = XCreateFontCursor(dpy, XC_icon);	
X    if (IconCursor == FAILURE) {
X	Error("StoreCursors -> Unable to store IconCursor.");
X    }
X
X    /*
X     * Left button main cursor.
X     */
X    LeftButtonCursor = XCreateFontCursor(dpy, XC_leftbutton);	
X    if (LeftButtonCursor == FAILURE) {
X	Error("StoreCursors -> Unable to store LeftButtonCursor.");
X    }
X
X    /*
X     * Middle button main cursor.
X     */
X    MiddleButtonCursor = XCreateFontCursor(dpy, XC_middlebutton);	
X    if (MiddleButtonCursor == FAILURE) {
X	Error("StoreCursors -> Unable to store MiddleButtonCursor.");
X    }
X
X    /*
X     * Right button main cursor.
X     */
X    RightButtonCursor = XCreateFontCursor(dpy, XC_rightbutton);	
X    if (RightButtonCursor == FAILURE) {
X	Error("StoreCursors -> Unable to store RightButtonCursor.");
X    }
X
X    /*
X     * Targer cursor used to identify a window for an action.
X     */
X    TargetCursor = XCreateFontCursor(dpy, XC_circle);	
X    if (TargetCursor == FAILURE) {
X	Error("StoreCursors -> Unable to store TargetCursor.");
X    }
X    Leave(0)
X}
X
END_OF_awm/Cursors.c
if test 3888 -ne `wc -c <awm/Cursors.c`; then
    echo shar: \"awm/Cursors.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f awm/Menu.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"awm/Menu.c\"
else
echo shar: Extracting \"awm/Menu.c\" \(4280 characters\)
sed "s/^X//" >awm/Menu.c <<'END_OF_awm/Menu.c'
X#ident   "%W% %G%"
X
X
X
X#ifndef lint
Xstatic char *rcsid_Menu_c = "$Header: Menu.c,v 1.1 88/06/15 15:08:09 jkh Exp $";
X#endif	lint
X
X#include "X11/copyright.h"
X/*
X *
X * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca.
X *
X * Copyright 1987 by Jordan Hubbard.
X *
X *
X *                         All Rights Reserved
X *
X * Permission to use, copy, modify, and distribute this software and its
X * documentation for any purpose and without fee is hereby granted,
X * provided that the above copyright notice appear in all copies and that
X * both that copyright notice and this permission notice appear in
X * supporting documentation, and that the name of Ardent Computer
X * Corporation or Jordan Hubbard not be used in advertising or publicity
X * pertaining to distribution of the software without specific, written
X * prior permission.
X *
X */
X
X#include <signal.h>
X#include "X11/cursorfont.h"
X
X/*
X * MODIFICATION HISTORY
X *
X * 000 -- J.Hubbard, Ardent Computer.
X * 	This file bears little resemblance to its former namesake.
X *	Because of massive changes to support RTL menus, the Menu()
X *      function is now little more than a bootstrap for RTL.
X */
X
X#ifndef lint
Xstatic char *sccsid = "@(#)Menu.c	3.8	1/24/86";
X#endif
X
X#include "awm.h"
X
XBoolean DoMenu(window, mask, button, x, y, menu)
XWindow window;				/* Event window. */
Xint mask;				/* Button/key mask. */
Xint button;				/* Button event detail. */
Xint x, y;				/* Event mouse position. */
XRTLMenu menu;
X{
X     RTLPoint pos;
X     
X     Entry("DoMenu")
X	  
X     pos.x = x;
X     pos.y = y;
X     if (!menu)
X	Leave(FALSE)
X     RTLMenu_Enter(menu, button, 0, window, pos);
X     Leave(TRUE)
X}
X
XBoolean DoAction(window, mask, button, x, y, menu, action)
XWindow window;				/* Event window. */
Xint mask;				/* Button/key mask. */
Xint button;				/* Button event detail. */
Xint x, y;				/* Event mouse position. */
XRTLMenu menu;
XActionLine *action;
X{
X     Boolean *tmp;
X     char *buff, *cmd;
X     int status, pid, w;
X     register int (*istat)(), (*qstat)();
X
X     Entry("DoAction")
X
X     switch(action->type) {
X     case IsText:
X	  XStoreBytes(dpy, action->text, strlen(action->text));
X	  break;
X
X     case IsTextNL:
X	  buff = (char *)malloc(strlen(action->text) + 2);
X	  strcpy(buff, action->text);
X	  strcat(buff, "\n");
X	  XStoreBytes(dpy, buff, strlen(buff));
X	  free(buff);
X	  break;
X
X     case IsShellCommand:
X	  cmd = action->text;
X	  if ((pid = fork()) == 0) {
X	       setpgrp(0, 0);
X	       signal(SIGHUP, SIG_IGN);
X	       signal(SIGQUIT, SIG_IGN);
X	       signal(SIGINT, SIG_IGN);
X	       execl("/bin/sh", "sh", "-c", cmd, 0);
X	       _exit(127);
X	  }
X	  istat = signal(SIGINT, SIG_IGN);
X	  qstat = signal(SIGQUIT, SIG_IGN);
X	  while ((w = wait(&status)) != pid && w != -1);
X	  if (w == -1)
X	       status = -1;
X	  signal(SIGINT, istat);
X	  signal(SIGQUIT, qstat);
X	  break;
X
X     default:
X	  fprintf(stderr, "awm: Warning: Unknown action type %d (%s) invoked\n",
X		  action->type, action->text);
X	  break;
X     }
X}
X
X/*
X * Routine to let user select a window using the mouse
X */
X
XWindow Select_Window(x, y, button)
Xint *x, *y, *button;
X{
X     int status;
X     Cursor cursor;
X     XEvent event;
X     Window target_win, root;
X     int root_x, root_y, x2, y2, ptrmask;
X     AwmInfoPtr awi;
X     
X     Entry("Select_Window")
X	  
X     /* Make the target cursor */
X     if (XGrabPointer( dpy, RootWindow(dpy, scr),
X		      TRUE, EVENTMASK, GrabModeAsync,
X		      GrabModeAsync, None,
X		      TargetCursor, CurrentTime )
X	 != GrabSuccess ) {
X	  fprintf(stderr, "awm (Select_Window): Can't grab the mouse.");
X	  Leave(RootWindow(dpy, scr))
X     }
X     Snatched = TRUE;
X     /* Select a window */
X     while (TRUE) {
X	  XPeekEvent(dpy, &event);
X	  if (event.type != ButtonPress) {
X	       GetButton(&event);
X	       continue;
X	  }
X          XNextEvent(dpy, &event);
X	  XQueryPointer(dpy, RootWindow(dpy, scr), &root,
X			&target_win, &root_x, &root_y, &x2, &y2, &ptrmask);
X
X	  *x = root_x;
X	  *y = root_y;
X	  *button = event.xbutton.button;
X	  if (target_win == 0)
X	       target_win = event.xbutton.window;
X	  XUngrabPointer(dpy, CurrentTime);      /* Done with pointer */
X	  if (awi = GetAwmInfo(target_win))
X	       target_win = (awi->frame) ? awi->frame : awi->client;
X	  Snatched = FALSE;
X	  Leave(target_win)
X     }
X}
END_OF_awm/Menu.c
if test 4280 -ne `wc -c <awm/Menu.c`; then
    echo shar: \"awm/Menu.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f awm/Raise.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"awm/Raise.c\"
else
echo shar: Extracting \"awm/Raise.c\" \(3678 characters\)
sed "s/^X//" >awm/Raise.c <<'END_OF_awm/Raise.c'
X#ident   "%W% %G%"
X
X
X
X#ifndef lint
Xstatic char *rcsid_Raise_c = "$Header: Raise.c,v 1.1 88/06/15 15:24:56 jkh Exp $";
X#endif  lint
X
X#include "X11/copyright.h"
X/*
X *
X * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca.
X *
X * Copyright 1987 by Jordan Hubbard.
X *
X *
X *                         All Rights Reserved
X *
X * Permission to use, copy, modify, and distribute this software and its
X * documentation for any purpose and without fee is hereby granted,
X * provided that the above copyright notice appear in all copies and that
X * both that copyright notice and this permission notice appear in
X * supporting documentation, and that the name of Ardent Computer
X * Corporation or Jordan Hubbard not be used in advertising or publicity
X * pertaining to distribution of the software without specific, written
X * prior permission.
X *
X */
X
X/*
X * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
X *
X *                         All Rights Reserved
X *
X * Permission to use, copy, modify, and distribute this software and its
X * documentation for any purpose and without fee is hereby granted,
X * provided that the above copyright notice appear in all copies and that
X * both that copyright notice and this permission notice appear in
X * supporting documentation, and that the name of Digital Equipment
X * Corporation not be used in advertising or publicity pertaining to
X * distribution of the software without specific, written prior permission.
X *
X *
X * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
X * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
X * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
X * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
X * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
X * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
X * SOFTWARE.
X */
X
X
X/*
X * MODIFICATION HISTORY
X *
X * 000 -- M. Gancarz, DEC Ultrix Engineering Group
X * 001 -- R. Kittell, DEC Storage A/D May 19, 1986
X *  Optionally warp mouse to upper right corner of window after raise.
X * 002 -- Loretta Guarino Reid, DEC Ultrix Engineering Group
X *  Western Software Lab. Convert to X11.
X * 003 -- Jordan Hubbard, Ardent Computer
X *  Changed for awm.
X */
X
X#include "awm.h"
X
XBoolean Raise(window, mask, button, x, y)
XWindow window;                          /* Event window. */
Xint mask;                               /* Button/key mask. */
Xint button;           	                /* Button event detail. */
Xint x, y;                               /* Event mouse position. */
X
X{
X     XWindowAttributes winfo;			/* Window details for warp */
X     AwmInfoPtr awi;
X     int status, vpoint;
X     
X     Entry("Raise")
X     
X     /*
X      * If the window is not the root window, raise the window and return.
X      */
X
X     awi = GetAwmInfo(window);
X     if (!awi)
X	  Leave(FALSE)
X     if (window != RootWindow(dpy, scr)) {
X	  window = awi->frame ? awi->frame : awi->client;
X	  XRaiseWindow(dpy, window);
X	  if (awi->frame)
X	       vpoint = 10 + titleHeight + 2;
X	  else
X	       vpoint = 10;
X	  /*
X	   * Optionally warp the mouse to the upper left corner of the window.
X	   */
X	  if (WarpOnRaise) {
X	       status = XGetWindowAttributes (dpy, window, &winfo);
X	       if (status == FAILURE)
X		    Leave(FALSE)
X	       
X	       status = XWarpPointer (dpy, None, window, 
X				      0, 0, 0, 0,
X				      winfo.width >= 7 ? winfo.width - 7 :
X				      winfo.width / 2,
X				      winfo.height >= vpoint ? vpoint :
X				      winfo.height / 2);
X	       if (status == FAILURE)
X		    Leave(FALSE)
X	  }
X     }
X     Leave(FALSE)
X}
END_OF_awm/Raise.c
if test 3678 -ne `wc -c <awm/Raise.c`; then
    echo shar: \"awm/Raise.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f awm/Refresh.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"awm/Refresh.c\"
else
echo shar: Extracting \"awm/Refresh.c\" \(4348 characters\)
sed "s/^X//" >awm/Refresh.c <<'END_OF_awm/Refresh.c'
X#ident   "%W% %G%"
X
X
X
X#ifndef lint
Xstatic char *rcsid_Refresh_c = "$Header: Refresh.c,v 1.1 88/06/15 15:29:10 jkh Exp $";
X#endif	lint
X
X#include "X11/copyright.h"
X/*
X *
X * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca.
X *
X * Copyright 1987 by Jordan Hubbard.
X *
X *
X *                         All Rights Reserved
X *
X * Permission to use, copy, modify, and distribute this software and its
X * documentation for any purpose and without fee is hereby granted,
X * provided that the above copyright notice appear in all copies and that
X * both that copyright notice and this permission notice appear in
X * supporting documentation, and that the name of Ardent Computer
X * Corporation or Jordan Hubbard not be used in advertising or publicity
X * pertaining to distribution of the software without specific, written
X * prior permission.
X *
X */
X
X/*
X * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
X *
X *                         All Rights Reserved
X *
X * Permission to use, copy, modify, and distribute this software and its
X * documentation for any purpose and without fee is hereby granted,
X * provided that the above copyright notice appear in all copies and that
X * both that copyright notice and this permission notice appear in
X * supporting documentation, and that the name of Digital Equipment
X * Corporation not be used in advertising or publicity pertaining to
X * distribution of the software without specific, written prior permission.
X *
X *
X * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
X * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
X * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
X * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
X * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
X * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
X * SOFTWARE.
X */
X
X 
X
X/*
X * MODIFICATION HISTORY
X *
X * 000 -- M. Gancarz, DEC Ultrix Engineering Group
X * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group,
X *  Western Software Lab. Convert to X11.
X * 002 -- Jordan Hubbard, Ardent Computer
X *  Changes for awm.
X */
X
X#include "awm.h"
X
XBoolean Refresh(window, mask, button, x, y)
XWindow window;                          /* Event window. */
Xint mask;                               /* Button/key mask. */
Xint button;                           /* Button event detail. */
Xint x, y;                               /* Event mouse position. */
X{
X    Entry("Refresh")
X
X#ifdef titan
X    XTitanReset(dpy);
X#endif /* titan */
X    Leave( Redraw(RootWindow(dpy,scr), mask, button, x, y) )
X}
X
X
X
XBoolean Redraw(window, mask, button, x, y)
XWindow window;                          /* Event window. */
Xint mask;                               /* Button/key mask. */
Xint button;                             /* Button event detail. */
Xint x, y;                               /* Event mouse position. */
X{
X    XWindowAttributes winfo;		/* window info. */
X    XSetWindowAttributes swa;		/* New window info */
X    Window w;				/* Refresh window. */
X
X    Entry("Redraw")
X
X    /*
X     * Get info on the target window.
X     */
X    status = XGetWindowAttributes(dpy, window, &winfo);
X    if (status == FAILURE)
X	 Error("Refresh -> Can't query target window.");
X    /*
X     * Create and map a window which covers the target window, then destroy it.
X     */
X    swa.override_redirect = TRUE;
X    swa.background_pixel = 0;
X
X    /*
X     * What we have here is a failure to communicate. This window should
X     * more properly be created as a subwindow of "window", but
X     * when we do that, all events (Create, Map, Destroy) get reported
X     * as coming from "window", not the newly created one. This is
X     * very nasty when the DestroyNotify is received. For now, we'll
X     * create it on the RootWindow and take the chance of generating an
X     * expose on an overlapping window.
X     */
X    if ((w = XCreateWindow(dpy, RootWindow(dpy, scr), winfo.x, winfo.y, 
X			   winfo.width, winfo.height, 0,
X			   DefaultDepth(dpy, scr),
X			   CopyFromParent,
X			   DefaultVisual(dpy, scr),
X			   (CWOverrideRedirect | CWBackPixel),
X			   &swa)) == NULL)
X	 Error("Refresh -> Can't create refresh window.");
X    XMapWindow(dpy, w);
X    XDestroyWindow(dpy, w);
X    XFlush(dpy);
X    Leave(FALSE)
X}
END_OF_awm/Refresh.c
if test 4348 -ne `wc -c <awm/Refresh.c`; then
    echo shar: \"awm/Refresh.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f awm/Restart.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"awm/Restart.c\"
else
echo shar: Extracting \"awm/Restart.c\" \(5018 characters\)
sed "s/^X//" >awm/Restart.c <<'END_OF_awm/Restart.c'
X#ident   "%W% %G%"
X
X
X
X#ifndef lint
Xstatic char *rcsid_Restart_c = "$Header: Restart.c,v 1.2 88/07/23 17:24:56 jkh Exp $";
X#endif  lint
X
X#include "X11/copyright.h"
X/*
X *
X * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca.
X *
X * Copyright 1987 by Jordan Hubbard.
X *
X *
X *                         All Rights Reserved
X *
X * Permission to use, copy, modify, and distribute this software and its
X * documentation for any purpose and without fee is hereby granted,
X * provided that the above copyright notice appear in all copies and that
X * both that copyright notice and this permission notice appear in
X * supporting documentation, and that the name of Ardent Computer
X * Corporation or Jordan Hubbard not be used in advertising or publicity
X * pertaining to distribution of the software without specific, written
X * prior permission.
X *
X */
X
X/*
X * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
X *
X *                         All Rights Reserved
X *
X * Permission to use, copy, modify, and distribute this software and its
X * documentation for any purpose and without fee is hereby granted,
X * provided that the above copyright notice appear in all copies and that
X * both that copyright notice and this permission notice appear in
X * supporting documentation, and that the name of Digital Equipment
X * Corporation not be used in advertising or publicity pertaining to
X * distribution of the software without specific, written prior permission.
X *
X *
X * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
X * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
X * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
X * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
X * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
X * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
X * SOFTWARE.
X */
X
X/*
X * MODIFICATION HISTORY
X *
X * 000 -- M. Gancarz, DEC Ultrix Engineering Group
X * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group,
X    Western Software Lab. Convert to X11.
X * 002 -- Jordan Hubbard, U.C. Berkeley. Titlebar cleanup code.
X */
X
X#include "awm.h"
X#include "X11/Xutil.h"
X
Xextern XContext AwmContext;
X
XBoolean Restart(window, mask, button, x, y)
XWindow window;                          /* Event window. */
Xint mask;                               /* Button/key mask. */
Xint button;                             /* Button event detail. */
Xint x, y;                               /* Event mouse position. */
X{
X    XButtonEvent button_event;
X
X    Entry("Restart")
X
X    XFreeFont(dpy, IFontInfo);
X    XFreeFont(dpy, PFontInfo);
X    XBell(dpy, VOLUME_PERCENTAGE(Volume));
X    XBell(dpy, VOLUME_PERCENTAGE(Volume));
X    XFlush(dpy);
X    Cleanup();
X    execvp(*Argv, Argv, Environ);
X    fprintf(stderr, "awm: Restart failed!\n");
X    exit(1);
X}
X
XBoolean Quit(window, mask, button, x, y)
XWindow window;                          /* Event window. */
Xint mask;                               /* Button/key mask. */
Xint button;                             /* Button event detail. */
Xint x, y;                               /* Event mouse position. */
X{
X     Entry("Quit")
X
X     Cleanup();
X     exit(0);
X}
X
XBoolean DestroyClient(window, mask, button, x, y)
XWindow window;
Xint mask;
Xint x, y;
X{
X     AwmInfoPtr awi;
X
X     Entry("DestroyClient")
X
X     if (window == RootWindow(dpy, scr))
X		Leave(FALSE)
X     awi = GetAwmInfo(window);
X     /*
X      * If it's a titled window or an icon (we don't want to nuke ourselves)
X      * we should get the client for it. We assume the subsequent destroy
X      * notify will tell us to reclaim our resources.
X      */
X     window = awi->client;
X     XKillClient(dpy, window);
X     Leave(TRUE)
X}
X
X/*
X * Put any necessary cleanup code here, it will be invoked when awm exits
X * or restarts. Currently just checks for title bar resources.
X */
XCleanup()
X{
X     Window junk, *windows;
X     int nwins;
X     AwmInfoPtr awi;
X
X     Entry("Cleanup");
X
X     if (XQueryTree(dpy, DefaultRootWindow(dpy), &junk, &junk, &windows, &nwins)
X	 != BadWindow) {
X	  unsigned int i;
X	  
X	  for (i = 0; i < nwins; i++) {
X	       XWindowAttributes xwa;
X	       int bw;
X
X	       awi = GetAwmInfo(windows[i]);
X	       if (!awi)
X		    continue;
X	       bw = awi->border_width;
X	       if (awi->state & ST_ICON)
X		    XMapWindow(dpy, awi->client);
X	       RemoveIcon(windows[i]);
X	       XGetWindowAttributes(dpy, awi->frame, &xwa);
X	       if (PushDown == FALSE) {
X		    if (awi->attrs & AT_TITLE)
X			 xwa.y += (titleHeight + 2);
X		    else if (awi->attrs & AT_BORDER)
X			 xwa.y += BContext;
X	       }
X	       if (awi->attrs & AT_BORDER)
X		    xwa.x -= (BContext + (bw ? bw : 1));
X	       XReparentWindow(dpy, awi->client, RootWindow(dpy, scr),
X			       xwa.x, xwa.y);
X	       XRemoveFromSaveSet(dpy, awi->client);
X	       XSetWindowBorderWidth(dpy, awi->client, awi->border_width);
X	       free(awi);
X	  }
X	  XFree(windows);
X     }
X     Leave_void
X}
END_OF_awm/Restart.c
if test 5018 -ne `wc -c <awm/Restart.c`; then
    echo shar: \"awm/Restart.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f awm/StoreBox.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"awm/StoreBox.c\"
else
echo shar: Extracting \"awm/StoreBox.c\" \(5215 characters\)
sed "s/^X//" >awm/StoreBox.c <<'END_OF_awm/StoreBox.c'
X#ident   "%W% %G%"
X
X
X
X#ifndef lint
Xstatic char *rcsid_StoreBox_c = "$Header: StoreBox.c,v 1.1 88/06/15 15:21:43 jkh Exp $";
X#endif	lint
X
X#include "X11/copyright.h"
X/*
X *
X * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca.
X *
X * Copyright 1987 by Jordan Hubbard.
X *
X *
X *                         All Rights Reserved
X *
X * Permission to use, copy, modify, and distribute this software and its
X * documentation for any purpose and without fee is hereby granted,
X * provided that the above copyright notice appear in all copies and that
X * both that copyright notice and this permission notice appear in
X * supporting documentation, and that the name of Ardent Computer
X * Corporation or Jordan Hubbard not be used in advertising or publicity
X * pertaining to distribution of the software without specific, written
X * prior permission.
X *
X */
X
X/*
X * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
X *
X *                         All Rights Reserved
X *
X * Permission to use, copy, modify, and distribute this software and its
X * documentation for any purpose and without fee is hereby granted,
X * provided that the above copyright notice appear in all copies and that
X * both that copyright notice and this permission notice appear in
X * supporting documentation, and that the name of Digital Equipment
X * Corporation not be used in advertising or publicity pertaining to
X * distribution of the software without specific, written prior permission.
X *
X *
X * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
X * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
X * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
X * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
X * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
X * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
X * SOFTWARE.
X */
X
X
X
X/*
X * MODIFICATION HISTORY
X *
X * 000 -- M. Gancarz, DEC Ultrix Engineering Group
X * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group,
X Western Software Lab. Convert to X11.
X * 002 -- Jordan Hubbard, Ardent Computer
X *  Additional boxes for titled windows.
X */
X
X/*
X *	StoreBox - This subroutine is used by the X Window Manager (xwm)
X *	to store the vertices for the resize / movement box in a vertex list.
X */
X
X#include "awm.h"
X
X/*
X * Store the vertices for the resize movement box (on a titled window)
X * in a vertex list.
X */
Xint StoreTitleBox(box, ulx, uly, lrx, lry)
Xregister XSegment box[];
Xint ulx;			/* Upper left X coordinate. */
Xint uly;			/* Upper left Y coordinate. */
Xint lrx;			/* Lower right X coordinate. */
Xint lry;			/* Lower right Y coordinate. */
X{
X     Entry("StoreTitleBox");
X     
X     /*
X      * Xor in.
X      */
X     
X     box[0].x1 = ulx; box[0].y1 = uly;
X     box[0].x2 = lrx; box[0].y2 = uly;
X
X     box[1].x1 = ulx; box[1].y1 = uly + titleHeight + 2;
X     box[1].x2 = lrx; box[1].y2 = uly + titleHeight + 2;
X     
X     box[2].x1 = lrx; box[2].y1 = uly;
X     box[2].x2 = lrx; box[2].y2 = lry;
X     
X     box[3].x1 = lrx; box[3].y1 = lry;
X     box[3].x2 = ulx; box[3].y2 = lry;
X     
X     box[4].x1 = ulx; box[4].y1 = lry;
X     box[4].x2 = ulx; box[4].y2 = uly;
X
X     
X     /*
X      * If we freeze the screen, don't bother to xor out.
X      */
X     if (Freeze)
X	  Leave(5)
X     
X     /*
X      * Xor out.
X      */
X     box[4].x1 = ulx; box[4].y1 = uly;
X     box[4].x2 = lrx; box[4].y2 = uly;
X     
X     box[5].x1 = ulx; box[5].y1 = uly + titleHeight + 2;
X     box[5].x2 = lrx; box[5].y2 = uly + titleHeight + 2;
X     
X     box[6].x1 = lrx; box[6].y1 = uly;
X     box[6].x2 = lrx; box[6].y2 = lry;
X     
X     box[7].x1 = lrx; box[7].y1 = lry;
X     box[7].x2 = ulx; box[7].y2 = lry;
X     
X     box[8].x1 = ulx; box[8].y1 = lry;
X     box[8].x2 = ulx; box[8].y2 = uly;
X     
X     
X     /*
X      * Total number of vertices is 9.
X      */
X     Leave(9)
X}
X
X/*
X * Store the vertices for the resize movement box in a vertex list.
X */
Xint StoreBox(box, ulx, uly, lrx, lry)
Xregister XSegment box[];
Xint ulx;			/* Upper left X coordinate. */
Xint uly;			/* Upper left Y coordinate. */
Xint lrx;			/* Lower right X coordinate. */
Xint lry;			/* Lower right Y coordinate. */
X{
X     Entry("StoreBox");
X     
X     /*
X      * Xor in.
X      */
X     
X     box[0].x1 = ulx; box[0].y1 = uly;
X     box[0].x2 = lrx; box[0].y2 = uly;
X     
X     box[1].x1 = lrx; box[1].y1 = uly;
X     box[1].x2 = lrx; box[1].y2 = lry;
X     
X     box[2].x1 = lrx; box[2].y1 = lry;
X     box[2].x2 = ulx; box[2].y2 = lry;
X     
X     box[3].x1 = ulx; box[3].y1 = lry;
X     box[3].x2 = ulx; box[3].y2 = uly;
X     
X     
X     /*
X      * If we freeze the screen, don't bother to xor out.
X      */
X     if (Freeze)
X	  Leave(4)
X     
X     /*
X      * Xor out.
X      */
X     box[4].x1 = ulx; box[4].y1 = uly;
X     box[4].x2 = lrx; box[4].y2 = uly;
X     
X     box[5].x1 = lrx; box[5].y1 = uly;
X     box[5].x2 = lrx; box[5].y2 = lry;
X     
X     box[6].x1 = lrx; box[6].y1 = lry;
X     box[6].x2 = ulx; box[6].y2 = lry;
X     
X     box[7].x1 = ulx; box[7].y1 = lry;
X     box[7].x2 = ulx; box[7].y2 = uly;
X     
X     
X     /*
X      * Total number of vertices is 8.
X      */
X     Leave(8)
X}
END_OF_awm/StoreBox.c
if test 5215 -ne `wc -c <awm/StoreBox.c`; then
    echo shar: \"awm/StoreBox.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f awm/StoreZap.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"awm/StoreZap.c\"
else
echo shar: Extracting \"awm/StoreZap.c\" \(3762 characters\)
sed "s/^X//" >awm/StoreZap.c <<'END_OF_awm/StoreZap.c'
X#ident   "%W% %G%"
X
X
X
X#ifndef lint
Xstatic char *rcsid_StoreZap_c = "$Header: StoreZap.c,v 1.1 88/06/15 08:21:46 jkh Exp $";
X#endif	lint
X
X#include "X11/copyright.h"
X/*
X *
X * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca.
X *
X * Copyright 1987 by Jordan Hubbard.
X *
X *
X *                         All Rights Reserved
X *
X * Permission to use, copy, modify, and distribute this software and its
X * documentation for any purpose and without fee is hereby granted,
X * provided that the above copyright notice appear in all copies and that
X * both that copyright notice and this permission notice appear in
X * supporting documentation, and that the name of Ardent Computer
X * Corporation or Jordan Hubbard not be used in advertising or publicity
X * pertaining to distribution of the software without specific, written
X * prior permission.
X *
X */
X
X/*
X * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
X *
X *                         All Rights Reserved
X *
X * Permission to use, copy, modify, and distribute this software and its
X * documentation for any purpose and without fee is hereby granted,
X * provided that the above copyright notice appear in all copies and that
X * both that copyright notice and this permission notice appear in
X * supporting documentation, and that the name of Digital Equipment
X * Corporation not be used in advertising or publicity pertaining to
X * distribution of the software without specific, written prior permission.
X *
X *
X * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
X * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
X * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
X * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
X * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
X * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
X * SOFTWARE.
X */
X
X 
X
X/*
X * MODIFICATION HISTORY
X *
X * 000 -- M. Gancarz, DEC Ultrix Engineering Group
X * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group,
X    Western Software Lab. Convert to X11.
X */
X
X/*
X *	StoreZap - This subroutine is used by the X Window Manager (xwm)
X *	to store the vertices for the iconify, uniconify zap.
X *
X */
X
X#include "awm.h"
X
X/*
X * Store the vertices for the zap effect.
X */
Xint StoreZap(zap, ulx_1, uly_1, lrx_1, lry_1, ulx_2, uly_2, lrx_2, lry_2)
X    register XSegment zap[];
X    int ulx_1;		/* From window, upper left X coordinate. */
X    int uly_1;		/* From window, upper left Y coordinate. */
X    int lrx_1;		/* From window, lower right X coordinate. */
X    int lry_1;		/* From window, lower right Y coordinate. */
X    int ulx_2;		/* To window, upper left X coordinate. */
X    int uly_2;		/* To window, upper left Y coordinate. */
X    int lrx_2;		/* To window, lower right X coordinate. */
X    int lry_2;		/* To window, lower right Y coordinate. */
X{
X
X    Entry("StoreZap")
X
X    /*
X     * Xor in.
X     */
X    zap[0].x1 = ulx_1;	zap[0].y1 = uly_1;
X    zap[0].x2 = ulx_2;	zap[0].y2 = uly_2;
X
X    zap[1].x1 = lrx_1;	zap[1].y1 = uly_1;
X    zap[1].x2 = lrx_2;	zap[1].y2 = uly_2;
X
X    zap[2].x1 = lrx_1;	zap[2].y1 = lry_1;
X    zap[2].x2 = lrx_2;	zap[2].y2 = lry_2;
X
X    zap[3].x1 = ulx_1;	zap[3].y1 = lry_1;
X    zap[3].x2 = ulx_2;	zap[3].y2 = lry_2;
X
X    /*
X     * Xor out.
X     */
X    zap[4].x1 = ulx_1;	zap[4].y1 = uly_1;
X    zap[4].x2 = ulx_2;	zap[4].y2 = uly_2;
X
X    zap[5].x1 = lrx_1;	zap[5].y1 = uly_1;
X    zap[5].x2 = lrx_2;	zap[5].y2 = uly_2;
X
X    zap[6].x1 = lrx_1;	zap[6].y1 = lry_1;
X    zap[6].x2 = lrx_2;	zap[6].y2 = lry_2;
X
X    zap[7].x1 = ulx_1;	zap[7].y1 = lry_1;
X    zap[7].x2 = ulx_2;	zap[7].y2 = lry_2;
X    /*
X     * Total number of vertices is 8.
X     */
X    Leave(8)
X}
END_OF_awm/StoreZap.c
if test 3762 -ne `wc -c <awm/StoreZap.c`; then
    echo shar: \"awm/StoreZap.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f awm/XRdBitFD.c -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"awm/XRdBitFD.c\"
else
echo shar: Extracting \"awm/XRdBitFD.c\" \(3904 characters\)
sed "s/^X//" >awm/XRdBitFD.c <<'END_OF_awm/XRdBitFD.c'
X#ident   "%W% %G%"
X
X
X
X#ifndef lint
Xstatic char *rcsid_XRdBitFD_c = "$Header: XRdBitFD.c,v 1.1 88/06/15 15:26:00 jkh Exp $";
X#endif  lint
X
X#include "X11/copyright.h"
X/*
X *
X * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca.
X *
X * Copyright 1987 by Jordan Hubbard.
X *
X *
X *                         All Rights Reserved
X *
X * Permission to use, copy, modify, and distribute this software and its
X * documentation for any purpose and without fee is hereby granted,
X * provided that the above copyright notice appear in all copies and that
X * both that copyright notice and this permission notice appear in
X * supporting documentation, and that the name of Ardent Computer
X * Corporation or Jordan Hubbard not be used in advertising or publicity
X * pertaining to distribution of the software without specific, written
X * prior permission.
X *
X */
X
X/* Copyright, 1988, Massachusetts Institute of Theology */
X
X#include "copyright.h"
X
X#include "Xos.h"
X#include "X11/Xlib.h"
X#include "X11/Xutil.h"
X#include "Xlibint.h"
X#include <stdio.h>
X
X#define MAX_LINE 1000
X
Xint XReadBitmapFileData(filename, width, height, data, x_hot, y_hot)
X     char *filename;
X     unsigned int *width, *height;   /* RETURNED */
X     char **data;        /* RETURNED */
X     int *x_hot, *y_hot;    /* RETURNED */
X{
X  FILE *stream;
X  char *bits = 0;
X  char *ptr;
X  char line[MAX_LINE];
X  int size, bytes;
X  char name_and_type[MAX_LINE];
X  char *type;
X  int value;
X  int version10p;
X  int padding;
X  int bytes_per_line;
X  unsigned int ww = 0;
X  unsigned int hh = 0;
X  int hx = -1;
X  int hy = -1;
X
X  if (!filename || !(stream = fopen(filename, "r")))
X    return(BitmapOpenFailed);
X
X  for (;;) {
X    if (!fgets(line, MAX_LINE, stream))
X      break;
X    if (strlen(line) == MAX_LINE-1) {
X      fclose(stream);
X      return(BitmapFileInvalid);
X    }
X
X    if (sscanf(line, "#define %s %d", name_and_type, &value) == 2) {
X      if (!(type = rindex(name_and_type, '_')))
X	type = name_and_type;
X      else
X	type++;
X      if (!strcmp("width", type))
X	ww=(unsigned int) value;
X      if (!strcmp("height", type))
X	hh=(unsigned int) value;
X      if (!strcmp("hot", type)) {
X	if (type--==name_and_type || type--==name_and_type)
X	  continue;
X	if (!strcmp("x_hot", type))
X	  hx = value;
X	if (!strcmp("y_hot", type))
X	  hy = value;
X      }
X      continue;
X    }
X    
X    if (sscanf(line, "static short %s = {", name_and_type) == 1)
X      version10p = 1;
X    else if (sscanf(line, "static unsigned char %s = {", name_and_type) == 1)
X      version10p = 0;
X    else if (sscanf(line, "static char %s = {", name_and_type) == 1)
X      version10p = 0;
X    else continue;
X
X    if (!(type = rindex(name_and_type, '_')))
X      type = name_and_type;
X    else
X      type++;
X    if (strcmp("bits[]", type))
X      continue;
X    
X    if (!ww || !hh) {
X      fclose(stream);
X      return(BitmapFileInvalid);
X    }
X
X    padding = 0;
X    if ((ww % 16) && ((ww % 16) < 9) && version10p)
X      padding = 1;
X
X    bytes_per_line = (ww+7)/8 + padding;
X    
X    size = bytes_per_line * hh;
X    bits = (char *) Xmalloc( size );
X    if (!bits) {
X      fclose(stream);
X      return(BitmapNoMemory);
X    }
X
X    if (version10p)
X      for (bytes=0, ptr=bits; bytes<size; (bytes += 2)) {
X	if (fscanf(stream, " 0x%x%*[,}]%*[ \n]", &value) != 1) {
X	  Xfree(bits);
X	  fclose(stream);
X	  return(BitmapFileInvalid);
X	}
X	*(ptr++) = value & 0xff;
X	if (!padding || ((bytes+2) % bytes_per_line))
X	  *(ptr++) = value >> 8;
X      }
X    else
X      for (bytes=0, ptr=bits; bytes<size; bytes++, ptr++) {
X	if (fscanf(stream, " 0x%x%*[,}]%*[ \n]", &value) != 1) {
X	  Xfree(bits);
X	  fclose(stream);
X	  return(BitmapFileInvalid);
X	}
X	*ptr=value;
X      }
X    
X  }
X
X  if (!bits) {
X    fclose(stream);
X    return(BitmapFileInvalid);
X  }
X  *data = bits;
X  *width = ww;
X  *height = hh;
X
X  if (x_hot)
X    *x_hot = hx;
X  if (y_hot)
X    *y_hot = hy;
X
X  fclose(stream);
X  return(BitmapSuccess);
X}
END_OF_awm/XRdBitFD.c
if test 3904 -ne `wc -c <awm/XRdBitFD.c`; then
    echo shar: \"awm/XRdBitFD.c\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f awm/bitmaps/xterm.bm -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"awm/bitmaps/xterm.bm\"
else
echo shar: Extracting \"awm/bitmaps/xterm.bm\" \(3798 characters\)
sed "s/^X//" >awm/bitmaps/xterm.bm <<'END_OF_awm/bitmaps/xterm.bm'
X/*****************************************************************************/
X/**       Copyright 1988 by Evans & Sutherland Computer Corporation,        **/
X/**                          Salt Lake City, Utah                           **/
X/**                                                                         **/
X/**                           All Rights Reserved                           **/
X/**                                                                         **/
X/**    Permission to use, copy, modify, and distribute this software and    **/
X/**    its documentation  for  any  purpose  and  without  fee is hereby    **/
X/**    granted, provided that the above copyright notice appear  in  all    **/
X/**    copies and that both  that  copyright  notice  and  this  permis-    **/
X/**    sion  notice appear in supporting  documentation,  and  that  the    **/
X/**    name  of Evans & Sutherland  not be used in advertising or publi-    **/
X/**    city pertaining to distribution  of the software without  specif-    **/
X/**    ic, written prior permission.                                        **/
X/**                                                                         **/
X/**    EVANS  & SUTHERLAND  DISCLAIMS  ALL  WARRANTIES  WITH  REGARD  TO    **/
X/**    THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILI-    **/
X/**    TY AND FITNESS, IN NO EVENT SHALL EVANS &  SUTHERLAND  BE  LIABLE    **/
X/**    FOR  ANY  SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY  DAM-    **/
X/**    AGES  WHATSOEVER RESULTING FROM  LOSS OF USE,  DATA  OR  PROFITS,    **/
X/**    WHETHER   IN  AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS    **/
X/**    ACTION, ARISING OUT OF OR IN  CONNECTION  WITH  THE  USE  OR PER-    **/
X/**    FORMANCE OF THIS SOFTWARE.                                           **/
X/*****************************************************************************/
X
X#define xterm_width 48
X#define xterm_height 48
Xstatic char xterm_bits[] = {
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x00,
X   0x20, 0x00, 0x00, 0x00, 0x00, 0x03, 0x20, 0xfe, 0xff, 0xff, 0x1f, 0x05,
X   0x20, 0x01, 0x00, 0x00, 0x20, 0x09, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x11,
X   0xa0, 0xfc, 0xff, 0x00, 0x40, 0x21, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x21,
X   0xa0, 0xfc, 0x01, 0x00, 0x40, 0x21, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x21,
X   0xa0, 0xfc, 0xff, 0x3f, 0x40, 0x21, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x21,
X   0xa0, 0xfc, 0x03, 0x00, 0x40, 0x21, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x21,
X   0xa0, 0xfc, 0xff, 0x01, 0x40, 0x21, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x21,
X   0xa0, 0xfc, 0x00, 0x00, 0x40, 0x21, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x21,
X   0xa0, 0x00, 0x00, 0x00, 0x40, 0x21, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x21,
X   0xa0, 0x00, 0x00, 0x00, 0x40, 0x21, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x21,
X   0xa0, 0x00, 0x00, 0x00, 0x40, 0x21, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x21,
X   0xa0, 0x00, 0x00, 0x00, 0x40, 0x21, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x11,
X   0xa0, 0x00, 0x00, 0x00, 0x40, 0x11, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x09,
X   0xa0, 0x00, 0x00, 0x00, 0x40, 0x09, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x05,
X   0x20, 0x01, 0x00, 0x00, 0x20, 0x05, 0x20, 0xfe, 0xff, 0xff, 0x1f, 0x03,
X   0x20, 0x00, 0x00, 0x00, 0x00, 0x03, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x00,
X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
X   0xc0, 0xff, 0xff, 0xff, 0xff, 0x03, 0x20, 0x00, 0x00, 0x00, 0x00, 0x03,
X   0xa0, 0xaa, 0xaa, 0xaa, 0x2a, 0x03, 0x10, 0x00, 0x00, 0x00, 0x80, 0x02,
X   0x50, 0x55, 0x55, 0x55, 0x95, 0x02, 0x08, 0x00, 0x00, 0x00, 0x40, 0x02,
X   0xa8, 0xaa, 0xaa, 0xaa, 0x4a, 0x02, 0x04, 0x00, 0x00, 0x00, 0x20, 0x01,
X   0xb4, 0xff, 0xff, 0xff, 0xad, 0x00, 0x02, 0x00, 0x00, 0x00, 0x50, 0x00,
X   0xfe, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
END_OF_awm/bitmaps/xterm.bm
if test 3798 -ne `wc -c <awm/bitmaps/xterm.bm`; then
    echo shar: \"awm/bitmaps/xterm.bm\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f awm/menus/dbug.h -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"awm/menus/dbug.h\"
else
echo shar: Extracting \"awm/menus/dbug.h\" \(5236 characters\)
sed "s/^X//" >awm/menus/dbug.h <<'END_OF_awm/menus/dbug.h'
X#ident   "%W% %G%"
X
X/************************************************************************
X *									*
X *			Copyright (c) 1984, Fred Fish			*
X *			    All Rights Reserved				*
X *									*
X *	This software and/or documentation is released into the		*
X *	public domain for personal, non-commercial use only.		*
X *	Limited rights to use, modify, and redistribute are hereby	*
X *	granted for non-commercial purposes, provided that all		*
X *	copyright notices remain intact and all changes are clearly	*
X *	documented.  The author makes no warranty of any kind with	*
X *	respect to this product and explicitly disclaims any implied	*
X *	warranties of merchantability or fitness for any particular	*
X *	purpose.							*
X *									*
X ************************************************************************
X */
X
X
X/*
X *  FILE
X *
X *	dbug.h    user include file for programs using the dbug package
X *
X *  SYNOPSIS
X *
X *	#include <local/dbug.h>
X *
X *  SCCS ID
X *
X *	@(#)dbug.h	1.6 10/3/85
X *
X *  DESCRIPTION
X *
X *	Programs which use the dbug package must include this file.
X *	It contains the appropriate macros to call support routines
X *	in the dbug runtime library.
X *
X *	To disable compilation of the macro expansions define the
X *	preprocessor symbol "DBUG_OFF".  This will result in null
X *	macros expansions so that the resulting code will be smaller
X *	and faster.  (The difference may be smaller than you think
X *	so this step is recommended only when absolutely necessary).
X *	In general, tradeoffs between space and efficiency are
X *	decided in favor of efficiency since space is seldom a
X *	problem on the new machines).
X *
X *	All externally visible symbol names follow the pattern
X *	"_db_xxx..xx_" to minimize the possibility of a dbug package
X *	symbol colliding with a user defined symbol.
X *	
X *	Because the C preprocessor will not accept macros with a variable
X *	number of arguments, there are separate DBUG_<N> macros for
X *	cases N = {0,1,...NMAX}.  NMAX is currently 5.
X *
X *  AUTHOR
X *
X *	Fred Fish
X *	(Currently employed by UniSoft Systems, Berkeley, Ca.)
X *	(415) 644-1230  ext 242
X *	ucbvax!unisoft!fnf  or  dual!unisoft!fnf
X *
X */
X
X
X/*
X *	Internally used dbug variables which must be global.
X */
X
X/* This gets the debugging package already being used by uwm */
X
X#include "../support.h"
X
X#ifndef DBUG_OFF
X    extern int _db_on_;			/* TRUE if debug currently enabled */
X    extern FILE *_db_fp_;		/* Current debug output stream */
X    extern char *_db_process_;		/* Name of current process */
X    extern int _db_keyword_ ();		/* Accept/reject keyword */
X    extern void _db_push_ ();		/* Push state, set up new state */
X    extern void _db_pop_ ();		/* Pop previous debug state */
X    extern void _db_enter_ ();		/* New user function entered */
X    extern void _db_return_ ();		/* User function return */
X    extern void _db_printf_ ();		/* Print debug output */
X    extern void _db_setjmp_ ();		/* Save debugger environment */
X    extern void _db_longjmp_ ();	/* Restore debugger environment */
X# endif
X
X
X/*
X *	These macros provide a user interface into functions in the
X *	dbug runtime support library.  They isolate users from changes
X *	in the MACROS and/or runtime support.
X *
X *	The symbols "__LINE__" and "__FILE__" are expanded by the
X *	preprocessor to the current source file line number and file
X *	name respectively.
X *
X *	WARNING ---  Because the DBUG_ENTER macro allocates space on
X *	the user function's stack, it must precede any executable
X *	statements in the user function.
X *
X */
X
X# ifdef DBUG_OFF
X#    define DBUG_ENTER(a1)
X#    define DBUG_RETURN(a1) return(a1)
X#    define DBUG_VOID_RETURN return
X#    define DBUG_EXECUTE(keyword,a1)
X#    define DBUG_2(keyword,format)
X#    define DBUG_3(keyword,format,a1)
X#    define DBUG_4(keyword,format,a1,a2)
X#    define DBUG_5(keyword,format,a1,a2,a3)
X#    define DBUG_PUSH(a1)
X#    define DBUG_POP()
X#    define DBUG_PROCESS(a1)
X#    define DBUG_FILE (stderr)
X#    define DBUG_SETJMP setjmp
X#    define DBUG_LONGJMP longjmp
X# else
X#    define DBUG_ENTER(a) \
X	auto char *_db_func_, *_db_file_; \
X	int _db_level_; \
X	_db_enter_ (a,__FILE__,__LINE__,&_db_func_,&_db_file_,&_db_level_)
X#    define DBUG_LEAVE \
X	(_db_return_ (__LINE__, &_db_func_, &_db_file_, &_db_level_))
X#    define DBUG_RETURN(a1) return (DBUG_LEAVE, (a1))
X/*   define DBUG_RETURN(a1) {DBUG_LEAVE; return(a1);}  Alternate form */
X#    define DBUG_VOID_RETURN {DBUG_LEAVE; return;}
X#    define DBUG_EXECUTE(keyword,a1) \
X	if (_db_on_) {if (_db_keyword_ (keyword)) { a1; }}
X#    define DBUG_2(keyword,format) \
X	if (_db_on_) {_db_printf_ (__LINE__, keyword, format);}
X#    define DBUG_3(keyword,format,a1) \
X	if (_db_on_) {_db_printf_ (__LINE__, keyword, format, a1);}
X#    define DBUG_4(keyword,format,a1,a2) \
X	if (_db_on_) {_db_printf_ (__LINE__, keyword, format, a1, a2);}
X#    define DBUG_5(keyword,format,a1,a2,a3) \
X	if (_db_on_) {_db_printf_ (__LINE__, keyword, format, a1, a2, a3);}
X#    define DBUG_PUSH(a1) _db_push_ (a1)
X#    define DBUG_POP() _db_pop_ ()
X#    define DBUG_PROCESS(a1) (_db_process_ = a1)
X#    define DBUG_FILE (_db_fp_)
X#    define DBUG_SETJMP(a1) (_db_setjmp_ (), setjmp (a1))
X#    define DBUG_LONGJMP(a1,a2) (_db_longjmp_ (), longjmp (a1, a2))
X# endif
END_OF_awm/menus/dbug.h
if test 5236 -ne `wc -c <awm/menus/dbug.h`; then
    echo shar: \"awm/menus/dbug.h\" unpacked with wrong size!
fi
# end of overwriting check
fi
echo shar: End of archive 3 \(of 13\).
cp /dev/null ark3isdone
MISSING=""
for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 13 archives.
    rm -f ark[1-9]isdone ark[1-9][0-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0
Mike Wexler(wyse!mikew)    Phone: (408)433-1000 x1330