[comp.sources.x] v03i026: Ardent Window Manager, Patchlevel 9, Part10/12

mikew@wyse.wyse.com (Mike Wexler) (02/22/89)

Submitted-by: kmw@ardent (Ken Wallich)
Posting-number: Volume 3, Issue 26
Archive-name: awm2/part10

#! /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 10 (of 12)."
# Contents:  Bindings.c Error.c Focus.c Menu.c Raise.c Refresh.c
#   Restart.c StoreZap.c bitmaps/xterm.bm exp_path.c menus/dbug.h
#   menus/eventsave.c twm.awmrc
# Wrapped by mikew@wyse on Fri Feb 17 10:50:33 1989
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'Bindings.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Bindings.c'\"
else
echo shar: Extracting \"'Bindings.c'\" \(3728 characters\)
sed "s/^X//" >'Bindings.c' <<'END_OF_FILE'
X
X
X
X#ifndef lint
Xstatic char *rcsid_Bindings_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Bindings.c,v 1.1 89/01/23 15:33: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/*
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_FILE
if test 3728 -ne `wc -c <'Bindings.c'`; then
    echo shar: \"'Bindings.c'\" unpacked with wrong size!
fi
# end of 'Bindings.c'
fi
if test -f 'Error.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Error.c'\"
else
echo shar: Extracting \"'Error.c'\" \(3042 characters\)
sed "s/^X//" >'Error.c' <<'END_OF_FILE'
X
X
X
X#ifndef lint
Xstatic char *rcsid_Error_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Error.c,v 1.1 89/01/23 15:34:11 jkh Exp $";
X#endif	lint
X
X#include <signal.h>
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 * 1.3 -- Cleanup. Fixed bug.
X */
X
X#ifndef lint
Xstatic char *sccsid = "@(#)Error.c	3.8	1/24/86";
X#endif
X
X#ifdef titan
X#include <unistd.h>
X#endif
X
X#include "awm.h"
X
Xextern Boolean desktop_execd;
Xextern char execfile[];
X
X/*
X * Default error reporting routine.  Called when a random awm error
X * is encountered.
X */
XError(s)
Xchar *s;	/* Error description string */
X{
X    Entry("Error")
X
X    fprintf(stderr, "awm: %s\n", s);
X    if (!desktop_execd) {
X	 if (access(execfile, X_OK) == 0) {
X	      if (fork() == 0) {
X#ifdef SYSV
X		   setpgrp();
X#else
X		   setpgrp(0, getpid());
X#endif
X		   signal(SIGHUP, SIG_DFL);
X		   signal(SIGQUIT, SIG_DFL);
X		   signal(SIGINT, SIG_DFL);
X		   execl("/bin/sh", "sh", "-c", execfile, 0);
X		   _exit(127);
X	      }
X	      else
X		   desktop_execd = TRUE;
X	 }
X    }
X    Cleanup();
X    exit(1);
X}
X
Xvoid Warning(s)
Xchar *s;	/* Error description string */
X{
X    Entry("Warning")
X
X    fprintf(stderr, "awm: warning: %s\n", s);
X    Leave_void
X}
END_OF_FILE
if test 3042 -ne `wc -c <'Error.c'`; then
    echo shar: \"'Error.c'\" unpacked with wrong size!
fi
# end of 'Error.c'
fi
if test -f 'Focus.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Focus.c'\"
else
echo shar: Extracting \"'Focus.c'\" \(3290 characters\)
sed "s/^X//" >'Focus.c' <<'END_OF_FILE'
X
X
X
X#ifndef lint
Xstatic char *rcsid_Focus_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Focus.c,v 1.2 89/02/07 20:04:46 jkh Exp $";
X#endif	lint
X
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. Converted to X11.
X */
X
X#ifndef lint
Xstatic char *sccsid = "@(#)Focus.c	3.8	1/24/86";
X#endif
X
X#include "awm.h"
X
Xextern Window FocusWindow;
X
X/*ARGSUSED*/
XBoolean Focus(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     AwmInfoPtr awi;
X
X     Entry("Focus");
X
X     awi = GetAwmInfo(window);
X     if (awi)
X	  window = awi->client;
X     XSetInputFocus(dpy, window, RevertToPointerRoot, CurrentTime);
X     if (window != RootWindow(dpy, scr))
X	  FocusSetByUser = TRUE;
X     else
X	  FocusSetByUser = FALSE;
X     FocusSetByWM = FALSE;
X     FocusWindow = window;
X     Leave(FALSE)
X}
X
X/*ARGSUSED*/
XBoolean UnFocus(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("UnFocus");
X
X     XSetInputFocus(dpy, PointerRoot, RevertToPointerRoot, CurrentTime);
X     FocusSetByUser = FALSE;
X     FocusSetByWM = FALSE;
X     FocusWindow = RootWindow(dpy, scr);
X     Leave(FALSE)
X}
X
END_OF_FILE
if test 3290 -ne `wc -c <'Focus.c'`; then
    echo shar: \"'Focus.c'\" unpacked with wrong size!
fi
# end of 'Focus.c'
fi
if test -f 'Menu.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Menu.c'\"
else
echo shar: Extracting \"'Menu.c'\" \(4421 characters\)
sed "s/^X//" >'Menu.c' <<'END_OF_FILE'
X
X
X
X#ifndef lint
Xstatic char *rcsid_Menu_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Menu.c,v 1.3 89/02/07 22:39:41 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 * 1.2 -- Select_Window code fixed for icons.
X */
X
X#ifndef lint
Xstatic char *sccsid = "@(#)Menu.c	3.8	1/24/86";
X#endif
X
X#include "awm.h"
X
X/*ARGSUSED*/
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
X/*ARGSUSED*/
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     char *buff, *cmd;
X     int status, pid, w;
X     void (*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, getpid());
X	       signal(SIGHUP, SIG_DFL);
X	       signal(SIGQUIT, SIG_DFL);
X	       signal(SIGINT, SIG_DFL);
X	       execl("/bin/sh", "sh", "-c", cmd, 0);
X	       _exit(127);
X	  }
X	  istat = (void (*)())signal(SIGINT, SIG_IGN);
X	  qstat = (void (*)())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     XEvent event;
X     Window target_win, root;
X     int root_x, root_y, x2, y2;
X     unsigned int ptrmask;
X     AwmInfoPtr awi;
X     
X     Entry("Select_Window")
X	  
X     /* Make the target cursor */
X     if (XGrabPointer( dpy, RootWindow(dpy, scr),
X		      TRUE, (unsigned int) 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	       if (target_win != awi->icon)
X	       	     target_win = (awi->frame) ? awi->frame : awi->client;
X	  Snatched = FALSE;
X	  Leave(target_win)
X     }
X}
END_OF_FILE
if test 4421 -ne `wc -c <'Menu.c'`; then
    echo shar: \"'Menu.c'\" unpacked with wrong size!
fi
# end of 'Menu.c'
fi
if test -f 'Raise.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Raise.c'\"
else
echo shar: Extracting \"'Raise.c'\" \(3717 characters\)
sed "s/^X//" >'Raise.c' <<'END_OF_FILE'
X
X
X
X#ifndef lint
Xstatic char *rcsid_Raise_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Raise.c,v 1.2 89/02/07 21:23:28 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
X/*ARGSUSED*/
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_FILE
if test 3717 -ne `wc -c <'Raise.c'`; then
    echo shar: \"'Raise.c'\" unpacked with wrong size!
fi
# end of 'Raise.c'
fi
if test -f 'Refresh.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Refresh.c'\"
else
echo shar: Extracting \"'Refresh.c'\" \(4452 characters\)
sed "s/^X//" >'Refresh.c' <<'END_OF_FILE'
X
X
X
X#ifndef lint
Xstatic char *rcsid_Refresh_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Refresh.c,v 1.2 89/02/07 21:23:32 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
X/*ARGSUSED*/
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
X/*ARGSUSED*/
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			   (unsigned int) winfo.width, 
X			   (unsigned int) winfo.height, (unsigned int) 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_FILE
if test 4452 -ne `wc -c <'Refresh.c'`; then
    echo shar: \"'Refresh.c'\" unpacked with wrong size!
fi
# end of 'Refresh.c'
fi
if test -f 'Restart.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Restart.c'\"
else
echo shar: Extracting \"'Restart.c'\" \(5197 characters\)
sed "s/^X//" >'Restart.c' <<'END_OF_FILE'
X
X
X
X#ifndef lint
Xstatic char *rcsid_Restart_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/Restart.c,v 1.3 89/02/07 22:39: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 * 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
X/*ARGSUSED*/
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    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    XSync(dpy, 0); /* be paranoid */
X    execvp(*Argv, Argv, Environ);
X    fprintf(stderr, "awm: Restart failed!\n");
X    exit(1);
X}
X
X/*ARGSUSED*/
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     /*
X      * Be a careful boy scout.
X      */
X     XSync(dpy, 0);
X     XCloseDisplay(dpy);
X     exit(0);
X}
X
X/*ARGSUSED*/
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     unsigned int nwins;
X     AwmInfoPtr awi;
X
X     Entry("Cleanup");
X
X     if (XQueryTree(dpy, DefaultRootWindow(dpy), &junk, &junk, &windows,
X		    &nwins)) {
X	  int i;
X	  
X	  for (i = 0; i < (int)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	  if (nwins)
X	       XFree(windows);
X     }
X     Leave_void
X}
END_OF_FILE
if test 5197 -ne `wc -c <'Restart.c'`; then
    echo shar: \"'Restart.c'\" unpacked with wrong size!
fi
# end of 'Restart.c'
fi
if test -f 'StoreZap.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'StoreZap.c'\"
else
echo shar: Extracting \"'StoreZap.c'\" \(3788 characters\)
sed "s/^X//" >'StoreZap.c' <<'END_OF_FILE'
X
X
X
X#ifndef lint
Xstatic char *rcsid_StoreZap_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/StoreZap.c,v 1.1 89/01/23 15:34:55 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_FILE
if test 3788 -ne `wc -c <'StoreZap.c'`; then
    echo shar: \"'StoreZap.c'\" unpacked with wrong size!
fi
# end of 'StoreZap.c'
fi
if test -f 'bitmaps/xterm.bm' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'bitmaps/xterm.bm'\"
else
echo shar: Extracting \"'bitmaps/xterm.bm'\" \(3798 characters\)
sed "s/^X//" >'bitmaps/xterm.bm' <<'END_OF_FILE'
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_FILE
if test 3798 -ne `wc -c <'bitmaps/xterm.bm'`; then
    echo shar: \"'bitmaps/xterm.bm'\" unpacked with wrong size!
fi
# end of 'bitmaps/xterm.bm'
fi
if test -f 'exp_path.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'exp_path.c'\"
else
echo shar: Extracting \"'exp_path.c'\" \(3462 characters\)
sed "s/^X//" >'exp_path.c' <<'END_OF_FILE'
X
X
X
X#ifndef lint
Xstatic char *rcsid_exp_path_c = "$Header: /usr/graph2/X11.3/contrib/windowmgrs/awm/RCS/exp_path.c,v 1.2 89/02/07 21:24:42 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#if defined(PCS) || defined(titan)
X#include <unistd.h>
X#endif
X#include <pwd.h>
X#include <stdio.h>
X#include "awm.h"
X
X/*
X * WARNING: This code is obscure.
X * Modify at your Own Risk.
X */
Xchar *expand_file(s)
Xregister char *s;
X{
X     static char tmp[256], *cp, err[80];
X
X     Entry("expand_file")
X     
X     /* zero tmp */
X     tmp[0] = 0;
X     if (*s == '/')
X	  Leave(s)
X     if (*s == '~') {
X	  if (s[1] == '/') { /* It's $HOME */
X	       if (!(cp = (char *)getenv("HOME"))) {
X		    sprintf(err, "expand: Can't find $HOME!\n");
X		    yywarn(err);
X		    Leave(0)
X	       }
X	       strcpy(tmp, cp);
X	       strcat(tmp, s + 1);
X	       Leave(tmp)
X	  }
X	  else { /* it's another user */
X	       struct passwd *pwd;
X	       char uname[32];
X	       int i;
X
X	       for (i = 1; s[i] != '/'; i++)
X		    uname[i - 1] = s[i];
X	       uname[i] = '\0';
X	       pwd = getpwnam(uname);
X	       if (!pwd) {
X		    sprintf(err, "expand: user '%s' not found.\n", uname);
X		    yywarn(err);
X		    Leave(0)
X	       }
X	       strcpy(tmp, pwd->pw_dir);
X	       strcat(tmp, s + i);
X	       Leave(tmp)
X	  }
X     }
X     else
X	  Leave(s)
X}
X
Xchar *deblank(s)
Xregister char *s;
X{
X     Entry("deblank")
X
X     if (!s)
X	  Leave(s)
X     while (*s && (*s == ' ' || *s == '\t'))
X	  s++;
X     Leave(s)
X}
X
Xchar *expand_from_path(s)
Xregister char *s;
X{
X     char tmp[256], *tm;
X     int i, plen;
X
X     Entry("expand_from_path")
X
X     tmp[0] = '\0';
X     s = deblank(s);
X     if (!s || !*s)
X	  Leave(0)
X     s = expand_file(s);
X     if (!s)
X	  Leave(0)
X     if (!access(s, R_OK))
X	  Leave(s)
X     /*
X      * If it starts with a slash, we know it either expanded and couldn't
X      * be found, or that it started with a slash in the first place and
X      * just plain couldn't be found.
X      */
X     if (*s == '/')
X	  Leave(0)
X     /*
X      * At this stage we haven't found the file by name, so it's time to
X      * search the path.
X      */
X     if (!awmPath || !*awmPath)
X	  Leave(0)
X     plen = strlen(awmPath);
X     i = 0;
X     while (1) {
X	  int p, l;
X	  
X	  tmp[0] = '\0';
X	  while (i < plen && awmPath[i] == ' ' || awmPath[i] == '\t')
X	       i++;
X	  for (p = i; p < plen && awmPath[p] != ' ' && awmPath[p] != '\t'; p++)
X	       tmp[p - i] = awmPath[p];
X	  if (!*tmp)
X	       Leave(0)
X	  tmp[p - i] = '\0';
X	  i = p;
X	  tm = expand_file(tmp);
X	  if (!tm || !*tm)
X	       continue;
X	  l = strlen(tm);
X	  if (l < 1)
X	       continue;
X	  if (tm[l - 1] != '/') { /* append / if necessary */
X	       tm[l] = '/';
X	       tm[++l] = '\0';
X	  }
X	  strcat(tm, s);
X	  if (!access(tm, R_OK))
X	       Leave(tm)
X     }
X}
END_OF_FILE
if test 3462 -ne `wc -c <'exp_path.c'`; then
    echo shar: \"'exp_path.c'\" unpacked with wrong size!
fi
# end of 'exp_path.c'
fi
if test -f 'menus/dbug.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'menus/dbug.h'\"
else
echo shar: Extracting \"'menus/dbug.h'\" \(5217 characters\)
sed "s/^X//" >'menus/dbug.h' <<'END_OF_FILE'
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_FILE
if test 5217 -ne `wc -c <'menus/dbug.h'`; then
    echo shar: \"'menus/dbug.h'\" unpacked with wrong size!
fi
# end of 'menus/dbug.h'
fi
if test -f 'menus/eventsave.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'menus/eventsave.c'\"
else
echo shar: Extracting \"'menus/eventsave.c'\" \(3600 characters\)
sed "s/^X//" >'menus/eventsave.c' <<'END_OF_FILE'
X
X#ifndef lint
Xstatic char sccs_id[] = "@(#)eventsave.c	2.1 12/16/87  Siemens Corporate Research and Support, Inc.";
X#endif
X
X
X/* 
X  RTL Menu Package Version 1.0
X  by Joe Camaratta and Mike Berman, Siemens RTL, Princeton NJ, 1987
X
X  eventsave.c: saves/restores the X event queue
X*/
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
XCopyright 1987 by
X	Siemens Corporate Research and Support, Inc., Princeton, New Jersey
X
XPermission to use, copy, modify, and distribute this software
Xand its documentation for any purpose and without fee is
Xhereby granted, provided that the above copyright notice
Xappear in all copies and that both that copyright notice and
Xthis permission notice appear in supporting documentation, and
Xthat the name of Siemens not be used in advertising or
Xpublicity pertaining to distribution of the software without
Xspecific, written prior permission.  Siemens makes no
Xrepresentations about the suitability of this software for any
Xpurpose.  It is provided "as is" without express or implied
Xwarranty.
X
X*/
X
X#include <stdio.h>
X#include "dbug.h"
X#include "X11/Xlib.h"
X
X#include "eventstack.h"
X
X
Xvoid SaveEvents(display, Stack, mask)
X    Display *display;
X    struct Ev_q **Stack;
X    unsigned long mask;	 /* Save only events that match mask; */
X			 /* others remain on the event queue  */
X{
X    XEvent ev;
X    int Match = 1;
X
X    Entry("SaveEvents")
X
X    while (XPending(display) && Match)
X    {
X	if (XCheckMaskEvent(display, mask, &ev))
X	{
X	    DBUG_3("SaveEvents","Saving event type %d\n",ev.type);
X	    PushEvent(&ev, Stack);
X	}
X	else
X	    Match = False;
X    }
X    Leave_void
X}
X
Xvoid RestoreEvents(display, Stack)
X    Display *display;
X    struct Ev_q **Stack;    /* pointer to stack containing saved events */
X{
X    XEvent ev, *tmp;
X
X    Entry("RestoreEvents")
X    
X    while (!EventStackIsEmpty(Stack))
X    {
X	bcopy(&ev, tmp = PopEvent(Stack), sizeof(XEvent));
X	XPutBackEvent(display, &ev);
X	free(tmp);
X    }
X    XFlush(display);
X    Leave_void
X}
X
Xvoid DisposeEvents(display, mask)
X    Display *display;
X    unsigned long mask;	 /* dispose events that match mask */
X{
X    int Match = 1;
X    XEvent ev;
X    
X    Entry("DisposeEvents")
X
X    while (XPending(display) && Match)
X    {
X	if (XCheckMaskEvent(display, mask, &ev))
X	{
X	    DBUG_3("SaveEvents","Disposing event type %d\n",ev);
X	}
X	else
X	    Match = False;
X    }
X    Leave_void
X}
X	
Xvoid DiscardEventStore(Stack)
X    struct Ev_q **Stack;
X{
X    Entry("DiscardEventStack")
X    
X    while (!EventStackIsEmpty(Stack))
X    {
X	(void) free(PopEvent(Stack));
X    }
X    Leave_void
X}
X
Xvoid AddEventToStore(Stack, ev)
X    struct Ev_q **Stack;
X    XEvent ev;
X{
X    Entry("AddEventToStore")
X
X    PushEvent(&ev, Stack);
X    Leave_void
X}
X
X
Xvoid RemoveEventFromStore(Stack, ev)
X    struct Ev_q **Stack;
X    XEvent *ev;
X{
X     XEvent *tmp;
X     Entry("RemoveEventFromStore")
X
X    bcopy(ev, tmp = PopEvent(Stack), sizeof(XEvent));
X    free(tmp);
X    Leave_void
X}
END_OF_FILE
if test 3600 -ne `wc -c <'menus/eventsave.c'`; then
    echo shar: \"'menus/eventsave.c'\" unpacked with wrong size!
fi
# end of 'menus/eventsave.c'
fi
if test -f 'twm.awmrc' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'twm.awmrc'\"
else
echo shar: Extracting \"'twm.awmrc'\" \(1378 characters\)
sed "s/^X//" >'twm.awmrc' <<'END_OF_FILE'
X# $Source $
X# $Author $
X# $Header $
X#
X# This is a startup file for awm that produces a twm (using defaults)
X# lookalike (sort of) at the top level. Some semantics of resize and the icon
X# appearances are incompatable but will change in the near future.
X# The major difference in appearance you'll notice is the "bold"
X# appearance of the window. This is due to the fact that I use the "bold"
X# pixmap to tile the title window, I don't draw it on. I have to do this
X# since, unlike twm, any arbitrary number of gadgets (of any arbitrary size)
X# might be defined and it would be far too much trouble to try and draw
X# a tile in between all/some of them.
X#
X# Don't forget that you need to use twm.Xdefaults as well as this file.
X#
X
Xresetbindings
Xresetmenus
Xresetgadgets
X
Xgadget[0] = (twm.iconify.bm) ^ 1 | LeftGravity
Xgadget[1] = (twm.resize.bm) ^ 1 | RightGravity
Xgadget[2] = (twm.focus.bm) ^ 2 | RightGravity
X
X# FUNCTION	KEYS	CONTEXT		MOUSE BUTTON ACTIONS
Xf.move=			:title|icon:	middle motion
Xf.raise=		:title:		left down
Xf.raise=		:title:		left up
Xf.lower=		:title:		right down
Xf.iconify=		:g[0]:		left down
Xf.iconify=		:g[0]:		middle down
Xf.iconify=		:g[0]:		right down
Xf.iconify=		:icon:		left down
Xf.resize=		:g[1]:		left down
Xf.resize=		:g[1]:		middle down
Xf.resize=		:g[1]:		right down
Xf.focus=		:g[2]:		left down
Xf.focus=		:g[2]:		middle down
Xf.focus=		:g[2]:		right down
END_OF_FILE
if test 1378 -ne `wc -c <'twm.awmrc'`; then
    echo shar: \"'twm.awmrc'\" unpacked with wrong size!
fi
# end of 'twm.awmrc'
fi
echo shar: End of archive 10 \(of 12\).
cp /dev/null ark10isdone
MISSING=""
for I in 1 2 3 4 5 6 7 8 9 10 11 12 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 12 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
Moderator of comp.sources.x