From decwrl!ucbvax!tut.cis.ohio-state.edu!cs.utexas.edu!rutgers!aramis.rutgers.edu!dartagnan.rutgers.edu!mcgrew Wed Jun 14 07:09:03 PDT 1989
Article 22 of comp.sources.sun:
Path: decwrl!ucbvax!tut.cis.ohio-state.edu!cs.utexas.edu!rutgers!aramis.rutgers.edu!dartagnan.rutgers.edu!mcgrew
From: mcgrew@dartagnan.rutgers.edu (Charles Mcgrew)
Newsgroups: comp.sources.sun
Subject: v01i020:  Tooltool - a suntools user interface builder, Part 01/13
Message-ID: <Jun.7.00.01.01.1989.22896@dartagnan.rutgers.edu>
Date: 7 Jun 89 04:01:20 GMT
Organization: Rutgers Univ., New Brunswick, N.J.
Lines: 1501
Approved: mcgrew@aramis.rutgers.edu

Submitted-by: Chuck Musciano <chuck@trantor.harris-atd.com>
Posting-number: Volume 1, Issue 20
Archive-name: tooltool2.1c/part01

   This is version 2.1c of of Chuck Musciano's "tooltool".  The latest
version from the titan.rice.edu (so far as I know) is 2.0a.


							Charles


     Tooltool allows you to build relatively complex windowed user interfaces
for non-windowed applications using an English-like specification language.
Tooltool comes complete with an 80 page manual and several sample interface
specifications.

Chuck Musciano			ARPA  : chuck@trantor.harris-atd.com
Harris Corporation 		Usenet: ...!uunet!x102a!trantor!chuck
PO Box 37, MS 3A/1912		AT&T  : (407) 727-6131
Melbourne, FL 32902		FAX   : (407) 727-{5118,5227,4004}

#! /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 1 (of 13)."
# Contents:  MANIFEST Makefile README doc doc/Makefile emalloc.c
#   patchlevel.h samples samples/calc.tt samples/laserwriter.icon
#   samples/lpq.tt samples/news.icon samples/queue.c samples/rn.tt
#   samples/stopwatch.icon samples/top.icon samples/vt100
#   samples/vt100/Makefile samples/vt100/VTEM_README
#   samples/vt100/vt.icon samples/vt100/vtem.1 samples/vt100/vtem.h
#   selection.c tooltool.icon tooltool.man
# Wrapped by chuck@melmac on Thu Jun  1 10:39:25 1989
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'MANIFEST' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'MANIFEST'\"
else
echo shar: Extracting \"'MANIFEST'\" \(1891 characters\)
sed "s/^X//" >'MANIFEST' <<'END_OF_FILE'
X   File Name		Archive #	Description
X-----------------------------------------------------------
X MANIFEST                   1	This shipping list
X Makefile                   1	
X README                     1	
X actions.c                  4	
X doc                        1	
X doc/Makefile               1	
X doc/tooltool.uu.1         10	
X doc/tooltool.uu.2         12	
X doc/tooltool.uu.3         11	
X doc/tooltool.uu.4         13	
X doc/tooltool.uu.5          9	
X emalloc.c                  1	
X events.c                   4	
X expr.c                     5	
X func.c                     5	
X func_fix.c                 2	
X lex.c                      5	
X misc.c                     4	
X objects.c                  7	
X parse.y                    8	
X patchlevel.h               1	
X samples                    1	
X samples/README             2	
X samples/calc.tt            1	
X samples/keytool            6	
X samples/keytool.defaults.uu  2	
X samples/keytool.l          3	
X samples/keytool.r.14.uu    3	
X samples/laserwriter.icon   1	
X samples/lpq.tt             1	
X samples/lpq2.tt            2	
X samples/news.icon          1	
X samples/queue.c            1	
X samples/rn.tt              1	
X samples/stopwatch.icon     1	
X samples/stopwatch.tt       3	
X samples/top.icon           1	
X samples/top.tt             2	
X samples/vt100              1	
X samples/vt100/Makefile     1	
X samples/vt100/VTEM_README  1	
X samples/vt100/edtkeys.ras.uu  2	
X samples/vt100/newskeys.ras.uu  3	
X samples/vt100/out.c        7	
X samples/vt100/term.c       3	
X samples/vt100/vt.icon      1	
X samples/vt100/vt102tool.tt  2	
X samples/vt100/vtem.1       1	
X samples/vt100/vtem.c       2	
X samples/vt100/vtem.h       1	
X selection.c                1	
X symbols.c                  2	
X tooltool.c                 3	
X tooltool.h                 4	
X tooltool.icon              1	
X tooltool.man               1	
X windows.c                  6	
END_OF_FILE
if test 1891 -ne `wc -c <'MANIFEST'`; then
    echo shar: \"'MANIFEST'\" unpacked with wrong size!
fi
# end of 'MANIFEST'
fi
if test -f 'Makefile' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Makefile'\"
else
echo shar: Extracting \"'Makefile'\" \(1613 characters\)
sed "s/^X//" >'Makefile' <<'END_OF_FILE'
X# where you keep local executables
XBINDIR		= /usr/local/bin
X
X# man directory for local man pages (usually /usr/man/manl)
XMANDIR		= /usr/man/manl
XMANEXT		= l
X
X# command which will print things on a LaserWriter
XLPR		= /usr/ucb/lpr
XPRINTER		= lw
X
XWINDOW_LIB	= -lsuntool -lsunwindow -lpixrect
X
XOFILES	 	= actions.o emalloc.o events.o expr.o func.o func_fix.o misc.o \
X		  objects.o parse.o selection.o symbols.o tooltool.o windows.o
X
XOPTIONS		= -O
X
X.c.o:
X	cc $(OPTIONS) -c $<
X
X.y.o:
X	yacc $<
X	cc $(OPTIONS) -c -o $*.o y.tab.c
X	rm y.tab.c
X
Xtooltool: $(OFILES)
X	cc $(OPTIONS) -o tooltool $(OFILES) $(WINDOW_LIB) -lm
X
Xinstall: tooltool
X	cp tooltool $(BINDIR)
X	cp tooltool.man $(MANDIR)/tooltool.$(MANEXT)
X
Xmanual:
X	cd doc; make manual LPR="$(LPR)" PRINTER="$(PRINTER)"
X
Xshar:
X	cd doc/doc; make shar
X	rm -f MANIFEST*
X	makekit -s45k -oMANIFEST doc samples Makefile README *.[chy] *.icon *.man samples/* samples/vt100/* doc/Makefile doc/*.uu*
X
Xpatch: Makefile *.man *.[chy]
X	rm -f patch temp
X	-for i in Makefile *.man *.[chy] ; do \
X	   cp orig/$$i $${i}.orig ; \
X	   diff -c $${i}.orig $$i >>temp ; \
X	   rm $${i}.orig ; \
X	done
X	sed '/^No differences encountered/d' <temp >patch
X	rm temp
X
Xnewver:
X	for i in Makefile *.[chy] ; do \
X	   cp $$i orig/$$i ; \
X	done
X
Xclean:
X	rm -f *.o y.output tooltool core Part*
X
X#dependencies
X
Xactions.o: tooltool.h
X
Xemalloc.o: tooltool.h
X
Xevents.o: tooltool.h
X
Xexpr.o: tooltool.h
X
Xfunc.o: tooltool.h
X
Xfunc_fix.o: tooltool.h
X
Xmisc.o: tooltool.h
X
Xobjects.o: tooltool.h
X
Xparse.o: tooltool.h lex.c
X
Xselection.o: tooltool.h
X
Xsymbols.o: tooltool.h
X
Xtooltool.o: tooltool.h
X
Xwindows.o: tooltool.h
END_OF_FILE
if test 1613 -ne `wc -c <'Makefile'`; then
    echo shar: \"'Makefile'\" unpacked with wrong size!
fi
# end of 'Makefile'
fi
if test -f 'README' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'README'\"
else
echo shar: Extracting \"'README'\" \(4684 characters\)
sed "s/^X//" >'README' <<'END_OF_FILE'
X/************************************************************************/
X/*	Copyright 1988 by Chuck Musciano and Harris Corporation		*/
X/*									*/
X/*	Permission to use, copy, modify, and distribute this software	*/
X/*	and its documentation for any purpose and without fee is	*/
X/*	hereby granted, provided that the above copyright notice	*/
X/*	appear in all copies and that both that copyright notice and	*/
X/*	this permission notice appear in supporting documentation, and	*/
X/*	that the name of Chuck Musciano and Harris Corporation not be	*/
X/*	used in advertising or publicity pertaining to distribution	*/
X/*	of the software without specific, written prior permission.	*/
X/*	Chuck Musciano and Harris Corporation make no representations	*/
X/*	about the suitability of this software for any purpose.  It is	*/
X/*	provided "as is" without express or implied warranty.		*/
X/*									*/
X/*	The sale of any product based wholely or in part upon the 	*/
X/*	technology provided by tooltool is strictly forbidden without	*/
X/*	specific, prior written permission from Harris Corporation.	*/
X/*	Tooltool technology includes, but is not limited to, the source	*/
X/*	code, executable binary files, specification language, and	*/
X/*	sample specification files.					*/
X/************************************************************************/
X
X
X     Tooltool is a new way to create windowed applications.  Using existing
Xapplications, and a simple specification language, users can produce
Xwindowed tools with gadgets, mouse actions, and keyboard remapping without
Xhaving to learn or use the SunView programming interface.
X
X     To build tooltool, first check a few site dependencies in the Makefile
Xand in tooltool.c.  These dependencies are:
X
X	In Makefile:
X		BINDIR		Where the executable will go, normally
X				/usr/local/bin
X		MANDIR		Where the man page will go, normally
X				/usr/man/manl
X		MANEXT		The man page extension, usually 'l',
X				for local man pages.  You may want to
X				make MANDIR /usr/man/man1, in which case
X				MANEXT should be '1'.
X		LPR		The complete command you would use to
X				print something on your local LaserWriter.
X				Typically, this is /usr/ucb/lpr, but you
X				might need a different printer name than
X				the default.
X	In windows.c:
X		TOOLTOOL_ICON	Where the tooltool icon can be found.
X				Normally, it is in the directory that you
X				created tooltool in, but you might want to move
X				it to a more global place.  We keep all our
X				icons in /usr/local/images, for example.
X				Fix this path to match where you put the icon.
X
XYou can then build tooltool by typing "make tooltool".  If you wish to try out
Xthe sample applications, cd to samples, and type "../tooltool -f <file>.tt",
Xwhere <file>.tt is any of the .tt files in the directory.  See the README
Xin samples for more information.  When in samples, if you haven't installed
Xtooltool, you'll need to use "../tooltool" to invoke tooltool.
X
X     Tooltool comes with extensive documentation, which is printed by typing
X"make manual".  The manual will emerge from your LaserWriter.  It should print
Xon either a regular LaserWriter, LaserWriter Plus, or LaserWriter II NT or
XNTX.  If you have problems getting it to print, please send e-mail.  If you
Xdo not have a LaserWriter, I'll be glad to mail you hardcopy.  Just send
Xa request via e-mail or call me.
X
X     I think tooltool opens up a new world of easy application programming.
XI am very interested in seeing how others use tooltool, and any comments
Xor suggestions you may have.  If you send me your e-mail address, I will
Xkeep you up to date with bug fixes, patches, and enhancements.  If you
Xhave a good tooltool file, I'll be glad to distribute it to anyone who
Xrequests it.  In particular, I'd like to see tooltool specs for things
Xlike vi, gnuemacs, various games, and the like.  Bottom line: get on the
Xtooltool mailing list, and I'll keep you up to date as things progress.
X
X     Many thanks are due the tooltool betatesting team, who perservered
Xthrough early releases of this version while I frantically fixed all the
Xbugs.  The betatesting team was:
X
X	Ian Clowes			Ken Laprade
X	Paul J. Emerson			Andy Lord
X	Phill Everson			David Masterson
X	David Fickes			Neil Movold
X	David Forslund			Troy D. Spetz
X	Len Jacobs			Larry W. Virden
X	Orest Jarosiewicz		C. Philip Wood
X	Doug Johnson			Peter Windsor
X	Philip Kegelmeyer		Mitchell F. Wyle 	
X	Francis Kam
X
X     Please send all bugs, comments, requests, suggestions, and tooltool
Xfiles to:
X
X	Chuck Musciano
X	Advanced Technology Department
X	Harris Corporation
X	PO Box 37, MS 3A/1912
X	Melbourne, FL 32902
X
X	(407) 727-6131
X	ARPA: chuck@trantor.harris-atd.com
X
XI hope you find tooltool useful!
END_OF_FILE
if test 4684 -ne `wc -c <'README'`; then
    echo shar: \"'README'\" unpacked with wrong size!
fi
# end of 'README'
fi
if test ! -d 'doc' ; then
    echo shar: Creating directory \"'doc'\"
    mkdir 'doc'
fi
if test -f 'doc/Makefile' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'doc/Makefile'\"
else
echo shar: Extracting \"'doc/Makefile'\" \(257 characters\)
sed "s/^X//" >'doc/Makefile' <<'END_OF_FILE'
X.SUFFIXES:	.ps .uu
X
X.uu.ps:
X	uudecode $<
X	uncompress $*.ps.Z
X
Xmanual: tooltool.ps
X	$(LPR) -P$(PRINTER) -J"Tooltool Manual" tooltool.ps
X
Xtooltool.uu: tooltool.uu.1 tooltool.uu.2 tooltool.uu.3 tooltool.uu.4 tooltool.uu.5
X	cat tooltool.uu.[12345] >tooltool.uu
END_OF_FILE
if test 257 -ne `wc -c <'doc/Makefile'`; then
    echo shar: \"'doc/Makefile'\" unpacked with wrong size!
fi
# end of 'doc/Makefile'
fi
if test -f 'emalloc.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'emalloc.c'\"
else
echo shar: Extracting \"'emalloc.c'\" \(2541 characters\)
sed "s/^X//" >'emalloc.c' <<'END_OF_FILE'
X/************************************************************************/
X/*	Copyright 1988 by Chuck Musciano and Harris Corporation		*/
X/*									*/
X/*	Permission to use, copy, modify, and distribute this software	*/
X/*	and its documentation for any purpose and without fee is	*/
X/*	hereby granted, provided that the above copyright notice	*/
X/*	appear in all copies and that both that copyright notice and	*/
X/*	this permission notice appear in supporting documentation, and	*/
X/*	that the name of Chuck Musciano and Harris Corporation not be	*/
X/*	used in advertising or publicity pertaining to distribution	*/
X/*	of the software without specific, written prior permission.	*/
X/*	Chuck Musciano and Harris Corporation make no representations	*/
X/*	about the suitability of this software for any purpose.  It is	*/
X/*	provided "as is" without express or implied warranty.		*/
X/*									*/
X/*	The sale of any product based wholely or in part upon the 	*/
X/*	technology provided by tooltool is strictly forbidden without	*/
X/*	specific, prior written permission from Harris Corporation.	*/
X/*	Tooltool technology includes, but is not limited to, the source	*/
X/*	code, executable binary files, specification language, and	*/
X/*	sample specification files.					*/
X/************************************************************************/
X
X#include	"tooltool.h"
X
X#define		MIN_BUF_SIZE	32768
X
Xtypedef	struct	em_rec	em_data, *em_ptr;
X
Xstruct	em_rec	{int	size;
X		 int	remaining;
X		 char	*buf;
X		 em_ptr	next;
X		};
X
XPRIVATE	em_ptr	buf_list = NULL;
X
X/************************************************************************/
XEXPORT	char	*tt_emalloc(size)
X
Xint	size;
X
X{	em_ptr	em;
X	char	*p;
X
X	size = ((size + 3) & ~3);
X	for (em = buf_list; em; em = em->next)
X	   if (em->remaining >= size)
X	      break;
X	if (em == NULL) {
X	   em = (em_ptr) safe_malloc(sizeof(em_data));
X	   em->size = em->remaining = max(size, MIN_BUF_SIZE);
X	   em->buf = (char *) safe_malloc(em->size);
X	   em->next = buf_list;
X	   buf_list = em;
X	   }
X	p = em->buf + em->size - em->remaining;
X	em->remaining -= size;
X	return(p);
X}
X
X/************************************************************************/
XEXPORT	tt_reset_emalloc()
X
X{	em_ptr	em;
X
X	for (em = buf_list; em; em = em->next)
X	   em->remaining = em->size;
X}
X
X/************************************************************************/
XEXPORT	int	tt_is_temp(p)
X
Xchar	*p;
X
X{	em_ptr	em;
X
X	for (em = buf_list; em; em = em->next)
X	   if (p >= em->buf && p <= em->buf + em->size)
X	      return(TRUE);
X	return(FALSE);
X}
END_OF_FILE
if test 2541 -ne `wc -c <'emalloc.c'`; then
    echo shar: \"'emalloc.c'\" unpacked with wrong size!
fi
# end of 'emalloc.c'
fi
if test -f 'patchlevel.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'patchlevel.h'\"
else
echo shar: Extracting \"'patchlevel.h'\" \(1755 characters\)
sed "s/^X//" >'patchlevel.h' <<'END_OF_FILE'
X/************************************************************************/
X/*									*/
X/*	Tooltool Version 2.0 Patch History				*/
X/*									*/
X/*	Date	     Version	Comments				*/
X/*	01 Dec 88      2.0	Initial release				*/
X/*	25 Jan 89      2.0a	Small bug fixes:			*/
X/*				   Fixed ++ and -- when used with text	*/
X/*				   	fields.				*/
X/*				   Changed to use access(2) to deter-	*/
X/*				   	mine executability of applica-	*/
X/*				   	tion.				*/
X/*				   Fixed bug in computing mouse offsets	*/
X/*				   	when large fonts were used.	*/
X/*	02 Feb 89      2.1	Fixed bug in premature conversion of	*/
X/*				   strings to numbers.			*/
X/*				Added shift operators: >> and <<.	*/
X/*				Added assignment operators: +=, -=, *=,	*/
X/*				   /=, %=, &=, |=, and ^=.		*/
X/*				Readable, writable, and executable	*/
X/*				   intrinsic functions now use the	*/
X/*				   access(2) routine.			*/
X/*				Cleaned up scanning of punctuation.	*/
X/*				Fixed error message when EOF is hit.	*/
X/*				Fixed timeout while waiting for window	*/
X/*				   size to settle.			*/
X/*				Tooltool now searches your path for the	*/
X/*				   -f specification file.		*/
X/*				If the application is "", no applica-	*/
X/*				   tion window is created.		*/
X/*	18 Apr 89	2.1a	Fixed bug in scanning real numbers.	*/
X/*				Fixed initialization of text item 	*/
X/*				   actions.				*/
X/*				Fixed function key mapping bug, so that	*/
X/*				   all function keys map correctly with	*/
X/*				   or without a .ttyswrc file entry.	*/
X/*	25 Apr 89	2.1b	Fixed the handling of meta keys in the	*/
X/*				   function key fix.			*/
X/*									*/
X/*	 1 Jun 89	2.1c	Clarified wording of copyright notice.	*/
X/*									*/
X/************************************************************************/
END_OF_FILE
if test 1755 -ne `wc -c <'patchlevel.h'`; then
    echo shar: \"'patchlevel.h'\" unpacked with wrong size!
fi
# end of 'patchlevel.h'
fi
if test ! -d 'samples' ; then
    echo shar: Creating directory \"'samples'\"
    mkdir 'samples'
fi
if test -f 'samples/calc.tt' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'samples/calc.tt'\"
else
echo shar: Extracting \"'samples/calc.tt'\" \(1176 characters\)
sed "s/^X//" >'samples/calc.tt' <<'END_OF_FILE'
Xapplication "bc"
X   size 2 by 20 characters
X   label "<< Calculator >>"
Xgadgets
X   bottom
X   proportional
X   font "/usr/lib/fonts/fixedwidthfonts/screen.b.14"
X   button
X      normal	" Clear "	send "c\n";
X   end_button
X   button
X      normal	" Close "	close;
X      shift	" Quit "	exit;
X   end_button
X   button
X      normal	" 7 "		send "7";
X   end_button
X   button
X      normal	" 8 "		send "8";
X   end_button
X   button
X      normal	" 9 "		send "9";
X   end_button
X   button
X      normal	" / "		send "/";
X   end_button
X   button
X      normal	" 4 "		send "4";
X   end_button
X   button
X      normal	" 5 "		send "5";
X   end_button
X   button
X      normal	" 6 "		send "6";
X   end_button
X   button
X      normal	" X "		send "*";
X   end_button
X   button
X      normal	" 1 "		send "1";
X   end_button
X   button
X      normal	" 2 "		send "2";
X   end_button
X   button
X      normal	" 3 "		send "3";
X   end_button
X   button
X      normal	" - "		send "-";
X   end_button
X   button
X      normal	" 0 "		send "0";
X   end_button
X   button
X      normal	" . "		send ".";
X   end_button
X   button
X      normal	" = "		send "\n";
X   end_button
X   button
X      normal	" + "		send "+";
X   end_button
Xend_gadgets
END_OF_FILE
if test 1176 -ne `wc -c <'samples/calc.tt'`; then
    echo shar: \"'samples/calc.tt'\" unpacked with wrong size!
fi
# end of 'samples/calc.tt'
fi
if test -f 'samples/laserwriter.icon' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'samples/laserwriter.icon'\"
else
echo shar: Extracting \"'samples/laserwriter.icon'\" \(947 characters\)
sed "s/^X//" >'samples/laserwriter.icon' <<'END_OF_FILE'
X/* Format_version=1, Width=64, Height=30, Depth=1, Valid_bits_per_item=16
X */
X	0x888F,0xFFFF,0xFFFF,0xFFFC,0x2228,0x0000,0x0000,0x0006,
X	0x2228,0x0000,0x0000,0x0006,0x8888,0x0000,0x0000,0x0004,
X	0x8888,0x0000,0x0000,0x0004,0x222F,0xFFFF,0xFFFF,0xFFFE,
X	0x2229,0x0100,0x0000,0x0806,0x8889,0x0100,0x0000,0x0804,
X	0x8889,0x0100,0x0000,0x0804,0x2229,0x3D00,0x0000,0x0806,
X	0x2229,0x2500,0x0F00,0x0806,0x8889,0x3D00,0x0900,0x0804,
X	0x8889,0x3D00,0x0F00,0x0804,0x2229,0x3D00,0x0000,0x0806,
X	0x2229,0x0100,0x0000,0x0806,0x8889,0x0100,0x0000,0x0804,
X	0x8889,0x0100,0x0000,0x0808,0xE22F,0xFFFF,0xFFFF,0xF812,
X	0xFE2F,0x8000,0x0000,0x07E2,0x9FFF,0x8000,0x0000,0x0028,
X	0x8BFF,0x80FF,0xFFFF,0xF028,0x2222,0x8000,0x0000,0x0022,
X	0x2222,0x80FF,0xFFFF,0xF022,0x8888,0x8000,0x0000,0x0028,
X	0x8888,0x80FF,0xFFFF,0xF028,0x2222,0x8000,0x0000,0x0022,
X	0x2222,0x80FF,0xFFFF,0xF022,0x8888,0x8000,0x0000,0x0028,
X	0x8888,0xFFFF,0xFFFF,0xFFE8,0x2222,0x2FA2,0x2222,0x3E22
END_OF_FILE
if test 947 -ne `wc -c <'samples/laserwriter.icon'`; then
    echo shar: \"'samples/laserwriter.icon'\" unpacked with wrong size!
fi
# end of 'samples/laserwriter.icon'
fi
if test -f 'samples/lpq.tt' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'samples/lpq.tt'\"
else
echo shar: Extracting \"'samples/lpq.tt'\" \(701 characters\)
sed "s/^X//" >'samples/lpq.tt' <<'END_OF_FILE'
Xapplication "queue"
X   open send "b\n";
X   close send "e\n";
X   size 8 by 80 characters
X   icon "laserwriter.icon"
X   label "<< Print Queue Monitor >>"
Xgadgets
X   font "/usr/lib/fonts/fixedwidthfonts/screen.b.14"
X   align middle
X   button
X      normal	"Close"		close;
X      shift	"Exit"		send "q\n";
X   end_button
X   button
X      normal	"Start Polling"	send "b\n";
X   end_button
X   button
X      normal	"Stop Polling"	send "e\n";
X   end_button
X   slider interval
X      label "Interval:"
X      minimum 5
X      maximum 120
X      width 75
X      initial 10
X      range off
X      action send format("i%d\n", interval);
X   end_slider
Xend_gadgets
Xkeys
X   disable normal_keys
X   disable function_keys
Xend_keys
END_OF_FILE
if test 701 -ne `wc -c <'samples/lpq.tt'`; then
    echo shar: \"'samples/lpq.tt'\" unpacked with wrong size!
fi
# end of 'samples/lpq.tt'
fi
if test -f 'samples/news.icon' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'samples/news.icon'\"
else
echo shar: Extracting \"'samples/news.icon'\" \(1933 characters\)
sed "s/^X//" >'samples/news.icon' <<'END_OF_FILE'
X/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16
X */
X	0xFFFF,0xFFFF,0xFFFF,0xFFFF,0x8000,0x0000,0x0000,0x0001,
X	0x8000,0x1100,0x0000,0x0001,0x8404,0x1900,0x0000,0x2021,
X	0x8404,0x191C,0x4470,0x2021,0xAEAE,0x9522,0x4489,0x7575,
X	0x9F1F,0x1522,0x5480,0xF8F9,0x8E0E,0x133E,0x5470,0x7071,
X	0x8A0A,0x1320,0x5408,0x5051,0x9111,0x1122,0x5488,0x8889,
X	0x8000,0x111C,0x2870,0x0001,0x8000,0x0000,0x0000,0x0001,
X	0xFFFF,0xFFFF,0xFFFF,0xFFFF,0x8000,0x0000,0x0000,0x0001,
X	0x8EEA,0xEEAA,0x0077,0x4671,0x88AE,0xAAEA,0x0045,0x4541,
X	0x88AA,0xEEE4,0x0065,0x4571,0x88AA,0x8AA4,0x0045,0x4511,
X	0x8EEA,0x8AA4,0x0047,0x7671,0x8000,0x0000,0x0000,0x0001,
X	0x8EAE,0xEEEE,0xAE05,0x7571,0x8848,0x8884,0xA807,0x4541,
X	0x8C48,0xCEE4,0x4C07,0x6771,0x88A8,0x8224,0x4805,0x4711,
X	0x8EAE,0xEEEE,0x4E05,0x7571,0x8000,0x0000,0x0000,0x0001,
X	0x8EE4,0xCEAE,0x0742,0x5761,0x8A8A,0xA4E8,0x0545,0x7451,
X	0x8ECE,0xA4EA,0x0747,0x7651,0x8C8A,0xA4AA,0x0545,0x5451,
X	0x8AEA,0xCEAE,0x0775,0x5761,0x8000,0x0000,0x0000,0x0001,
X	0x8000,0x0000,0x0000,0x0001,0xBFFB,0xFFBF,0xFBFF,0xFFF9,
X	0x8002,0xAA80,0x0200,0x0009,0xBFFB,0x55BF,0xFB00,0x0009,
X	0x8002,0xAA80,0x0280,0x0009,0xBFFB,0x55BF,0xFA40,0x0009,
X	0x8002,0xAA80,0x0220,0x0009,0xBFFB,0x55BF,0xFA11,0x8009,
X	0x8002,0xAA80,0x020A,0x4009,0xBFFB,0x55BF,0xFA04,0x2009,
X	0x8002,0xAA80,0x0200,0x1009,0xBFFB,0x55BF,0xFA00,0x0809,
X	0x8002,0xAA80,0x0200,0x0589,0xBFFB,0x55BF,0xFA00,0x0249,
X	0x8002,0xAA80,0x0200,0x0029,0xBFFB,0x55BF,0xFA00,0x0019,
X	0x8003,0xFF80,0x0200,0x0009,0xBFF8,0x003F,0xFA00,0x0009,
X	0x8000,0x0000,0x0200,0x0009,0xBFFB,0xFFBF,0xFA00,0x0009,
X	0x8000,0x0000,0x0200,0x0009,0xBFFB,0xFFBF,0xFBFF,0xFFF9,
X	0x8000,0x0000,0x0000,0x0001,0xBFFB,0xFFBF,0xFBFF,0xFFF9,
X	0x8000,0x0000,0x0000,0x0001,0xBFFB,0xFFBF,0xFBFF,0xFFF9,
X	0x8000,0x0000,0x0000,0x0001,0xBFFB,0xFFBF,0xFBFF,0xFFF9,
X	0x8000,0x0000,0x0000,0x0001,0xBFFB,0xFFBF,0xFBFF,0xFFF9,
X	0x8000,0x0000,0x0000,0x0001,0xFFFF,0xFFFF,0xFFFF,0xFFFF
END_OF_FILE
if test 1933 -ne `wc -c <'samples/news.icon'`; then
    echo shar: \"'samples/news.icon'\" unpacked with wrong size!
fi
# end of 'samples/news.icon'
fi
if test -f 'samples/queue.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'samples/queue.c'\"
else
echo shar: Extracting \"'samples/queue.c'\" \(2397 characters\)
sed "s/^X//" >'samples/queue.c' <<'END_OF_FILE'
X#include	<stdio.h>
X#include	<signal.h>
X#include	<sgtty.h>
X#include	<sys/time.h>
X#include	<pwd.h>
X
X#define		strsave(s)	((char *) strcpy((char *) malloc(strlen(s) + 1), s))
X
X#define		CLEAR		"\014"
X#define		BOLD_ON		"\033[7m"
X#define		BOLD_OFF	"\033[m"
X
X#define		LPQ		"/usr/ucb/lpq"
X
Xstruct	itimerval	interval = {{10, 0}, {10, 0}};
Xstruct	itimerval	zero_timer = {{0, 0}, {0, 0}};
X
Xchar	*user_name;
X
Xchar	*strindex(source, target)
X
Xchar	*source;
Xchar	*target;
X
X{	register	int	len;
X
X	len = strlen(target);
X	for (; *source; source++)
X	   if (strncmp(source, target, len) == 0)
X	      return(source);
X	return(0);
X}
X
Xpoll()
X
X{	FILE	*f;
X	char	buf[256];
X	int	line;
X
X	if ((f = popen(LPQ, "r")) == NULL) {
X	   printf("%s%sCould not execute %s%s\n", CLEAR, BOLD_ON, LPQ, BOLD_OFF);
X	   return;
X	   }
X	printf(CLEAR);
X	for (line = 1; fgets(buf, 256, f) != NULL; line++)
X	   if (line <= 2 || strindex(buf, user_name))
X	      printf("%s%s%s", BOLD_ON, buf, BOLD_OFF);
X	   else
X	      printf(buf);
X	pclose(f);
X}
X
Xstart_timer()
X
X{
X	setitimer(ITIMER_REAL, &interval, NULL);
X}
X
Xstop_timer()
X
X{
X	setitimer(ITIMER_REAL, &zero_timer, NULL);
X}
X
Xmain()
X
X{	char	c;
X	int	i;
X	struct	sgttyb	tty, old_in, old_out;
X	struct	passwd	*pp;
X
X	pp = getpwuid(getuid());
X	user_name = strsave(pp->pw_name);
X
X	ioctl(0, TIOCGETP, &old_in);
X	tty = old_in;
X	tty.sg_flags |= CBREAK;
X	tty.sg_flags &= ~ECHO;
X	ioctl(0, TIOCSETP, &tty);
X
X	ioctl(1, TIOCGETP, &old_out);
X	tty = old_out;
X	tty.sg_flags |= CBREAK;
X	tty.sg_flags &= ~ECHO;
X	ioctl(1, TIOCSETP, &tty);
X
X	signal(SIGALRM, poll);
X	poll();
X	start_timer();
X	while ((c = getchar()) != EOF)
X	   switch (c) {
X	      case 'b' : start_timer();
X	      		 while (getchar() != '\n')
X	      		    ;
X	      		 break;
X	      case 'e' : stop_timer();
X	      		 while (getchar() != '\n')
X	      		    ;
X	      		 break;
X	      case 'i' : for (i = 0; (c = getchar()) != '\n'; )
X	      		    if (c >= '0' && c <= '9')
X	      		       i = i * 10 + c - '0';
X	      		 if (i == 0)
X	      		    break;
X	      		 interval.it_value.tv_sec = i;
X	      		 interval.it_value.tv_usec = 0;
X	      		 interval.it_interval.tv_sec = i;
X	      		 interval.it_interval.tv_usec = 0;
X	      		 start_timer();
X	      		 break;
X	      case 'q' : stop_timer();
X			 ioctl(0, TIOCSETP, &old_in);
X			 ioctl(1, TIOCSETP, &old_out);
X	      		 exit(0);
X	      }
X	ioctl(0, TIOCSETP, &old_in);
X	ioctl(1, TIOCSETP, &old_out);
X	exit(0);
X}
END_OF_FILE
if test 2397 -ne `wc -c <'samples/queue.c'`; then
    echo shar: \"'samples/queue.c'\" unpacked with wrong size!
fi
# end of 'samples/queue.c'
fi
if test -f 'samples/rn.tt' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'samples/rn.tt'\"
else
echo shar: Extracting \"'samples/rn.tt'\" \(1112 characters\)
sed "s/^X//" >'samples/rn.tt' <<'END_OF_FILE'
Xapplication "rn -m=s"
X   font "/usr/lib/fonts/fixedwidthfonts/screen.r.14"
X   size 36 by 80 characters
X   label "<< Newstool >>"
X   icon "news.icon"
Xgadgets
X   top
X   font "/usr/lib/fonts/fixedwidthfonts/screen.b.14"
X   button
X      normal	"Restart Article"		send "^R";
X      shift	"Decrypt Article"		send "^X";
X   end_button
X   button
X      normal	"Previous Article"		send "P";
X      shift	"Previous Unread Article"	send "p";
X   end_button
X   button
X      normal	"Kill Subject"			send "k";
X   end_button
X   button
X      normal	"Close"				close;
X      shift	"Quit"				send "q";
X   end_button
X   button
X      normal	"Subject List"			send "=";
X   end_button
X   button
X      normal	"Next Article"			send "N";
X      shift	"Next Unread Article"		send "n";
X   end_button
X   button
X      normal	"Same Subject"			send "^N";
X   end_button
X   menu "Others"
X      "Go to first unread article"		send "^";
X      "Go to last article"			send "$";
X      "Mark all articles read"			send "c";
X      "Reply via mail"				send "r";
X      "Reply, including article"		send "R";
X      "Unsubscribe"				send "u";
X   end_menu
Xend_gadgets
END_OF_FILE
if test 1112 -ne `wc -c <'samples/rn.tt'`; then
    echo shar: \"'samples/rn.tt'\" unpacked with wrong size!
fi
# end of 'samples/rn.tt'
fi
if test -f 'samples/stopwatch.icon' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'samples/stopwatch.icon'\"
else
echo shar: Extracting \"'samples/stopwatch.icon'\" \(1933 characters\)
sed "s/^X//" >'samples/stopwatch.icon' <<'END_OF_FILE'
X/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16
X */
X	0x8888,0x888F,0xF888,0x8888,0x8888,0x888A,0xA888,0x8888,
X	0x2222,0x222A,0xAA22,0x2222,0x2222,0x222A,0xAA22,0x2222,
X	0x8888,0x888F,0xF888,0x8888,0x8888,0x888A,0x2888,0x8888,
X	0x2222,0x2222,0x2222,0x2222,0x2222,0x2222,0x2222,0x2222,
X	0x8888,0x88BF,0xFC88,0x8888,0x8888,0x89FF,0xFF88,0x8888,
X	0x2222,0x2FE0,0x07F2,0x2222,0x2222,0x3F00,0x80FE,0x2222,
X	0x8888,0xF800,0x801E,0x8888,0x8889,0xE000,0x8007,0x8888,
X	0x2223,0xC000,0x8003,0xE222,0x2227,0x0000,0x8000,0xE222,
X	0x888E,0x0000,0x0000,0x7888,0x889C,0x0000,0x0000,0x3888,
X	0x2238,0x0000,0x0000,0x1E22,0x2271,0x0000,0x0000,0x8E22,
X	0x88E0,0x8000,0x0001,0x0688,0x88E0,0x4000,0x0002,0x0788,
X	0x23C0,0x2000,0x0004,0x03A2,0x2380,0x0000,0x0000,0x01A2,
X	0x8B80,0x0000,0x0000,0x01C8,0x8B00,0x0000,0x0000,0x00C8,
X	0x2300,0x0000,0x0000,0x00E2,0x2700,0x0000,0x0000,0x18E2,
X	0x8E00,0x0000,0x0000,0x6068,0x8E00,0x0000,0x0003,0x8068,
X	0x2E00,0x0000,0x000E,0x0072,0x2C00,0x0000,0x0078,0x0032,
X	0x8C00,0x0000,0x01C0,0x0038,0x8C00,0x0000,0x0F00,0x0038,
X	0x2C00,0x0000,0x3C00,0x0032,0x2DF0,0x0000,0xF000,0x0FB2,
X	0x8C00,0x0000,0xC000,0x0038,0x8C00,0x0000,0x0000,0x0038,
X	0x2C00,0x0000,0x0000,0x0032,0x2C00,0x0003,0xE000,0x0032,
X	0x8C00,0x000C,0x1800,0x0038,0x8E00,0x0010,0x0400,0x0078,
X	0x2600,0x0020,0x8200,0x0062,0x2600,0x0024,0x1200,0x0062,
X	0x8F00,0x0040,0x2100,0x00E8,0x8B00,0x0040,0x4100,0x00C8,
X	0x2300,0x0048,0x8900,0x00E2,0x2380,0x0040,0x0100,0x01E2,
X	0x8980,0x0040,0x0100,0x0188,0x89C0,0x2024,0x1204,0x0388,
X	0x22E0,0x4020,0x8202,0x0722,0x2260,0x8010,0x0401,0x0622,
X	0x88F1,0x000C,0x1800,0x8E88,0x88B8,0x0003,0xE000,0x1C88,
X	0x223C,0x0000,0x0000,0x3A22,0x222E,0x0000,0x0000,0x7222,
X	0x888F,0x0000,0x8000,0xE888,0x888B,0xC000,0x8003,0xC888,
X	0x2223,0xE000,0x8007,0xA222,0x2222,0x7800,0x801E,0x2222,
X	0x8888,0xBF00,0x80FC,0x8888,0x8888,0x8FE0,0x07F8,0x8888,
X	0x2222,0x23FF,0xFFA2,0x2222,0x2222,0x223F,0xFE22,0x2222
END_OF_FILE
if test 1933 -ne `wc -c <'samples/stopwatch.icon'`; then
    echo shar: \"'samples/stopwatch.icon'\" unpacked with wrong size!
fi
# end of 'samples/stopwatch.icon'
fi
if test -f 'samples/top.icon' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'samples/top.icon'\"
else
echo shar: Extracting \"'samples/top.icon'\" \(1933 characters\)
sed "s/^X//" >'samples/top.icon' <<'END_OF_FILE'
X/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16
X */
X	0x8888,0x8888,0x8888,0x8888,0x8888,0x8888,0x8888,0x8888,
X	0x2222,0x2222,0x2222,0x2222,0x2222,0x2222,0x2222,0x2222,
X	0x8888,0xFFFF,0xFFFF,0x8888,0x8889,0xFFFF,0xFFFF,0x8888,
X	0x2223,0xFFFF,0xFFFF,0xE222,0x2227,0xFFFF,0xFFFF,0xE222,
X	0x888F,0xFFFF,0xFFFF,0xF888,0x889F,0xFFFF,0xFFFF,0xF888,
X	0x223F,0xFFFF,0xFFFF,0xFA22,0x223F,0xFFFF,0xFFFF,0xFC22,
X	0x88C8,0x8888,0x8888,0x8A88,0x88E2,0x2222,0x2222,0x2288,
X	0x22C4,0x4444,0x4444,0x4522,0x2291,0x1111,0x1111,0x1122,
X	0x8988,0x8888,0x8888,0x8888,0x8922,0x2222,0x2222,0x2288,
X	0x2344,0x4444,0x4444,0x44A2,0x23FF,0xFFFF,0xFFFF,0xFFA2,
X	0x8B77,0x7777,0x7777,0x7748,0x8BDD,0xDDDD,0xDDDD,0xDDC8,
X	0x23BB,0xBBBB,0xBBBB,0xBBE2,0x22EE,0xEEEE,0xEEEE,0xEEE2,
X	0x8B77,0x7777,0x7777,0x7748,0x8BDD,0xDDDD,0xDDDD,0xDDC8,
X	0x23BB,0xBBBB,0xBBBB,0xBBE2,0x23FF,0xFFFF,0xFFFF,0xFFE2,
X	0x8AAA,0xAAAA,0xAAAA,0xAAC8,0x8955,0x5555,0x5555,0x5588,
X	0x23AA,0xAAAA,0xAAAA,0xAAA2,0x2355,0x5555,0x5555,0x55A2,
X	0x89AA,0xAAAA,0xAAAA,0xAA88,0x88D5,0x5555,0x5555,0x5588,
X	0x22AA,0xAAAA,0xAAAA,0xAB22,0x227F,0xFFFF,0xFFFF,0xFE22,
X	0x88C8,0x8888,0x8888,0x8A88,0x88A8,0x8888,0x8888,0x8C88,
X	0x2232,0x2222,0x2222,0x2A22,0x2232,0x2222,0x2222,0x2A22,
X	0x8888,0x8888,0x8888,0x9888,0x888C,0x8888,0x8888,0xA888,
X	0x2222,0x2222,0x2222,0x6222,0x2223,0xFFFF,0xFFFF,0xE222,
X	0x8889,0x0000,0x0000,0x8888,0x8888,0x8000,0x0001,0x8888,
X	0x2222,0x7FFF,0xFFFE,0x2222,0x2222,0x2000,0x0006,0x2222,
X	0x8888,0x9000,0x0008,0x8888,0x8888,0x8FFF,0xFFF8,0x8888,
X	0x2222,0x2400,0x0022,0x2222,0x2222,0x2200,0x0062,0x2222,
X	0x8888,0x89FF,0xFF88,0x8888,0x8888,0x8880,0x0188,0x8888,
X	0x2222,0x2240,0x0222,0x2222,0x2222,0x223F,0xFE22,0x2222,
X	0x8888,0x8890,0x0888,0x8888,0x8888,0x8888,0x1888,0x8888,
X	0x2222,0x2227,0xE222,0x2222,0x2222,0x2223,0xE222,0x2222,
X	0x8888,0x8889,0x8888,0x8888,0x8888,0x8889,0x8888,0x8888,
X	0x2222,0x2222,0x2222,0x2222,0x2222,0x2222,0x2222,0x2222
END_OF_FILE
if test 1933 -ne `wc -c <'samples/top.icon'`; then
    echo shar: \"'samples/top.icon'\" unpacked with wrong size!
fi
# end of 'samples/top.icon'
fi
if test ! -d 'samples/vt100' ; then
    echo shar: Creating directory \"'samples/vt100'\"
    mkdir 'samples/vt100'
fi
if test -f 'samples/vt100/Makefile' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'samples/vt100/Makefile'\"
else
echo shar: Extracting \"'samples/vt100/Makefile'\" \(2045 characters\)
sed "s/^X//" >'samples/vt100/Makefile' <<'END_OF_FILE'
X#
X#Here are the fields you may wish to change
X#
X# location of executable
XBINDIR =	/usr/local/bin
X# where do you store images?
XIMAGEDIR =	/usr/local/images
X# where do you want the manual pages to go?
XMANDIR = 	/usr/man/manl
X# select an extension for the manual pages 
X# that is, do you want /usr/man/manl/vtem.l or /usr/man/man1/vttool.1
XMAN =		l
X#
X# now for compiler flags
XCFLAGS =	-O
X#
X# the rest should be of little interest unless you are going to 
X# enhance/debug/mail  this program
X#
XVSOURCES = 	out.c term.c vtem.c
XVTEMFILES = 	${VSOURCES} vtem.h vtem.1
XVOBJECTS =	term.o out.o vtem.o
XIMAGES =	edtkeys.ras newskeys.ras vt.icon
XMISCFILES = 	VTEM_README Makefile vt102tool.tt edtkeys.ras.uu newskeys.ras.uu vt.icon
XSHAR = shar -c -v -p X
X
XCC=	/bin/cc
XLINTFLAGS = -DLINT
XLIBS =	-lsuntool -lsunwindow -lpixrect 
X
Xall:	vtem newskeys.ras edtkeys.ras
X
Xvtem:   ${VOBJECTS}
X	$(CC) $(CFLAGS) -o vtem ${VOBJECTS}  -ltermcap
X
X.c.o:   ; $(CC) $(CFLAGS) -c $*.c
X
Xedtkeys.ras:	edtkeys.ras.uu
X	uudecode edtkeys.ras.uu
X
Xnewskeys.ras:	newskeys.ras.uu
X	uudecode newskeys.ras.uu
X
Xinstall: all
X	install -s vtem $(BINDIR)/vtem
X	sed<vt102tool.tt >$(BINDIR)/vt102tool.tt -e 's=/usr/local/images=$(IMAGEDIR)='
X	cp $(IMAGES) $(IMAGEDIR)
X	cp vtem.1 ${MANDIR}/vtem.${MAN}
X
Xlint:
X	lint $(LINTFLAGS) $(SOURCES) -lc $(LIBS)
X
Xshar: vtem.shar
X	touch shar
Xvtem.shar: ${VTEMFILES} ${MISCFILES}
X	${SHAR} ${MISCFILES} ${VTEMFILES} >vtem.shar
X
Xclean:
X	rm -f core tags a.out ${VOBJECTS} vtem shar vtem.shar
X
Xdepend: 
X	@-grep '^#include' $(VSOURCES) | grep -v '<' | grep -v '../' | \
X	sed 's/:[^"]*"\([^"]*\)".*/: \1/' | sed 's/\.[cs]:/.o:/' | \
X	awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \
X	        else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \
X	               else rec = rec " " $$2 } } \
X	      END { print rec } ' >> makedep
X	echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep
X	echo '$$r makedep' >>eddep
X	echo 'w' >>eddep
X	cp Makefile Makefile.bak
X	ex - Makefile < eddep
X	rm eddep makedep
X
X
X# DO NOT DELETE THIS LINE -- make depend uses it
END_OF_FILE
if test 2045 -ne `wc -c <'samples/vt100/Makefile'`; then
    echo shar: \"'samples/vt100/Makefile'\" unpacked with wrong size!
fi
# end of 'samples/vt100/Makefile'
fi
if test -f 'samples/vt100/VTEM_README' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'samples/vt100/VTEM_README'\"
else
echo shar: Extracting \"'samples/vt100/VTEM_README'\" \(1524 characters\)
sed "s/^X//" >'samples/vt100/VTEM_README' <<'END_OF_FILE'
XVTEM is a termcap-based VT100 terminal emulator originally written by
XLeif Samuelsson (lsamuelsson@erisun) in December, 1985.  It has
Xbeen posted in various forms.  This shar file contains a major revision
Xof the package to support more complete VT100 emulation on a wider variety
Xof terminals.  Major changes to this version include:
X
X1/ emulates a VT52 (sort of), VT100, or VT102 depending on terminal
X   capabilities available in the termcap entry.
X2/ responds to terminal inquiries, e.g. VMS "set term/inquire".
X3/ fixes many bugs in the terminal emulation.  It now passes most of
X   the vttest test suite with the exception of graphic characters,
X   keyboard input, and double high/double wide lines.  On terminals
X   with less than 132 columns or limited standout capabilities it does
X   a reasonable job of displaying what it can.  Emulation is
X   approximately as good as (or slightly better than) ms-kermit with
X   an IBM mono video adapter.
X4/ supports VT102 emulation on terminals whose termcap entry includes
X   insert/delete character.
X5/ correctly outputs "ti" and "te" sequences (needed if run from a Sun
X   cmdtool to turn off scroll bar).
X   
XRevisions February 1989 by JQ Johnson <jqj@hogg.cc.uoregon.edu>.
X
XVTEM does not provide a VT100-style keypad.  However, under SunView it
Xcan be used with vttool or tooltool to provide such a mousable keypad.
X
XTo use with tooltool, give the command:
X	tooltool -f vt102tool.tt
X
XTooltool is available from Chuck Musciano, at trantor.harris-atd.com by 
Xanonymous ftp.
END_OF_FILE
if test 1524 -ne `wc -c <'samples/vt100/VTEM_README'`; then
    echo shar: \"'samples/vt100/VTEM_README'\" unpacked with wrong size!
fi
# end of 'samples/vt100/VTEM_README'
fi
if test -f 'samples/vt100/vt.icon' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'samples/vt100/vt.icon'\"
else
echo shar: Extracting \"'samples/vt100/vt.icon'\" \(1933 characters\)
sed "s/^X//" >'samples/vt100/vt.icon' <<'END_OF_FILE'
X/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16
X */
X	0xFFFF,0xFFFF,0xFFFF,0xFFFF,0x8000,0x0000,0x0000,0x0001,
X	0x8003,0xFFFF,0xFFFF,0xF801,0x8004,0x0000,0x0000,0x0601,
X	0x8004,0x7FFF,0xFFF8,0x0501,0x8004,0x8000,0x0004,0x0481,
X	0x8005,0x0000,0x0002,0x0441,0x8005,0x0000,0x0002,0x0421,
X	0x8005,0x0000,0x0002,0x0411,0x8005,0x0000,0x0002,0x0409,
X	0x8005,0x0000,0x0002,0x0409,0x8005,0x45F1,0x0C32,0x0409,
X	0x8005,0x4443,0x124A,0x0409,0x8005,0x4441,0x165A,0x0409,
X	0x8005,0x2841,0x1A6A,0x0409,0x8005,0x2841,0x124A,0x0409,
X	0x8005,0x1043,0x8C32,0x0409,0x8005,0x0000,0x0002,0x0409,
X	0x8005,0x0000,0x0002,0x0409,0x8005,0x0000,0x0002,0x0409,
X	0x8005,0x0000,0x0002,0x0409,0x8005,0x0000,0x0002,0x0409,
X	0x8005,0x0000,0x0002,0x0409,0x8005,0x0000,0x0002,0x0409,
X	0x8004,0x8000,0x0004,0x0409,0x8004,0x7FFF,0xFFF8,0x0409,
X	0x8004,0x0000,0x0000,0x0409,0x8004,0x0000,0x0000,0x0409,
X	0x8004,0x0000,0x0000,0x0409,0x8004,0x0000,0x0000,0x0409,
X	0x8004,0x0000,0x0000,0x0409,0x8004,0x0000,0x0000,0x0409,
X	0x8004,0x0000,0x0000,0x0409,0x8004,0x0000,0x0000,0x0409,
X	0x801F,0xFFFF,0xFFFF,0xFFF9,0x8020,0x0000,0x0000,0x0089,
X	0x8020,0x0000,0x0000,0x0109,0x8045,0x5555,0x5555,0x2909,
X	0x8080,0x0000,0x0000,0x0209,0x808A,0xAAAA,0xAAAA,0x5209,
X	0x8100,0x0000,0x0000,0x0409,0x8115,0x5555,0x5554,0xA409,
X	0x8200,0x0000,0x0000,0x0809,0x820D,0xFFFF,0xFFD8,0x0809,
X	0x8400,0x0000,0x0000,0x1009,0x87FF,0xFFFF,0xFFFF,0xFFF9,
X	0x8000,0x0000,0x0000,0x0001,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
X	0x8000,0x0000,0x0000,0x0001,0x8000,0x0000,0x0000,0x0001,
X	0x8000,0x0000,0x0000,0x0001,0x8000,0x0000,0x0000,0x0001,
X	0x8000,0x0000,0x0000,0x0001,0x8000,0x0000,0x0000,0x0001,
X	0x8000,0x0000,0x0000,0x0001,0x8000,0x0000,0x0000,0x0001,
X	0x8000,0x0000,0x0000,0x0001,0x8000,0x0000,0x0000,0x0001,
X	0x8000,0x0000,0x0000,0x0001,0x8000,0x0000,0x0000,0x0001,
X	0x8000,0x0000,0x0000,0x0001,0x8000,0x0000,0x0000,0x0001,
X	0x8000,0x0000,0x0000,0x0001,0xFFFF,0xFFFF,0xFFFF,0xFFFF
END_OF_FILE
if test 1933 -ne `wc -c <'samples/vt100/vt.icon'`; then
    echo shar: \"'samples/vt100/vt.icon'\" unpacked with wrong size!
fi
# end of 'samples/vt100/vt.icon'
fi
if test -f 'samples/vt100/vtem.1' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'samples/vt100/vtem.1'\"
else
echo shar: Extracting \"'samples/vt100/vtem.1'\" \(2404 characters\)
sed "s/^X//" >'samples/vt100/vtem.1' <<'END_OF_FILE'
X.TH VTEM 1 1989-05-09
X.\" $Header: /home/hogg/src/local/vt/RCS/vtem.1,v 1.2 89/05/09 11:01:24 jqj Exp $
X.\"
X.\" $Log:	vtem.1,v $
X.\" Revision 1.2  89/05/09  11:01:24  jqj
X.\" update for vtem version 1.2, e.g. VT102 support.  Also cleaned up man page.
X.\" 
X.\"
X.SH NAME
Xvtem \- a VT102 emulator based on termcap
X.SH SYNOPSIS
X.B vtem
X[
X.I command
X]
X.SH DESCRIPTION
X.LP
X.I vtem
Xruns on BSD4.2 and works by starting a sub-shell and then translating
Xoutput escape sequences.  Its function is limited by the capabilities
Xlisted in the termcap database and the capabilities of the actual
Xterminal that it is being run on.
X.LP
XIf arguments are given, then this command is passed to the shell, e.g.:
X
X	vtem telnet ibm
X
XThe emulator has been tested with Per Lindberg's excellent verifier ,
X.IR vttest ,
Xand has been found to give acceptable results on the following terminals:
X.br
X	Sun windows
X.br
X	PC-Kermit in h19 emulation mode.
X.br
X	VT100	(!)
X.LP
XOn a Sun, you can use the following Suntools rootmenu entry:
X.LP
X.nf
X"VT100 Tool" shelltool -Ww 80 -Wh 24 -Wl "VT100 Tool" vtem
X.fi
X.LP
XYou can also use 
X.I vttool 
Xor 
X.I tooltool 
Xto provide buttons for vtem.
X.SH BUGS
X.LP
XRelease 1.2 (jqj) of vtem has the following bugs and limitations:
X.LP
XRegion scroll will only work on terminals with
Xsr or al/dl capabilities.  On terminals without these capabilities,
X.I vtem
Xemulates a VT52.
X.LP
XOn terminals without delete and insert character (dc and either ic or im) 
Xcapabilities,
X.I vtem
Xemulates a VT100.  If these capabilities are present,
X.I vtem
Xemulates a VT102.
X.LP
XIt will never write in the last position of the screen,
Xbecause of the unpredictable behaviour of many terminals.
X.LP
XNo soft scroll.
X.LP
XThe display is truncated on the right at either the actual number of
Xcolumns on the screen or 80 (132 in 132 column mode), whichever is
Xless.  On normal 80-column displays, this implies that 132 column mode
Xis effectively useless.
X.LP
XInput is not translated, which means no function key emulation.
X(See vttool).
X.LP
XNo double height or double width lines.
X.LP
XNo alternate character set, meaning very limited graphics.
X.LP
XNo printer support.
X.LP
XNo settable answerback messages.
X.LP
XNo SETUP mode.
X.LP
XNo LEDs.
X.SH AUTHOR
X.LP
XOriginal author Leif Samuelsson, leif@erisun.UUCP or ..enea!erix!erisun!leif
X.LP
XModifications by Bruce G. Barnett, barnett@crd.ge.com, and JQ Johnson, jqj@oregon.uoregon.edu 
X
X
END_OF_FILE
if test 2404 -ne `wc -c <'samples/vt100/vtem.1'`; then
    echo shar: \"'samples/vt100/vtem.1'\" unpacked with wrong size!
fi
# end of 'samples/vt100/vtem.1'
fi
if test -f 'samples/vt100/vtem.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'samples/vt100/vtem.h'\"
else
echo shar: Extracting \"'samples/vt100/vtem.h'\" \(1542 characters\)
sed "s/^X//" >'samples/vt100/vtem.h' <<'END_OF_FILE'
X/*
X * vtem - A termcap driven VT100 emulator for BSD Unix
X *
X * $Header: /home/src/local/vttool/RCS/vtem.h,v 1.2 89/02/08 16:05:27 jqj Exp $
X *
X * Public domain software.
X * Written by Leif Samuelsson (lsamuelsson@erisun) in December, 1985
X * 
X * $Log:	vtem.h,v $
X * Revision 1.2  89/02/08  16:05:27  jqj
X * 1/ added enumerated type and terminal capabilities for VT102 support
X * 2/ redefined set_cursor to handle c values greater than CO [N.B. c is 
X *    now evaluated twice so don't do ``set_cursor(col++,row)'']
X * 
X */
X
X#include <stdio.h>
X#include <signal.h>
X#include <sys/types.h>
X#include <sys/time.h>
X#include <sys/stat.h>
X#include <sys/ioctl.h>
X
X#define FALSE 0
X#define TRUE 1
X
Xtypedef short Bool;
X
Xextern char *getenv();
Xextern putchar_x();
X
Xextern struct sgttyb oldb, newb;
Xextern struct tchars oldtchars, newtchars;
Xextern struct ltchars oldltchars, newltchars;
Xextern int oldlb, newlb, oldl, newl;
X
Xextern int master;
X
Xenum vt_terminal {VT52, VT100, VT102};
Xextern enum vt_terminal vttype;
X
Xextern Bool BS;
Xextern int CO, LI;
Xextern char  *AL, *BC, *BL, *CB, *CD, *CL, *CE, *CM, *CR, *CS, *DC,
X	*DL, *DO, *EI, *IC, *IM,
X	*KE, *KS, *MB, *MD, *ME, *MR, *ND, *NL, *SE, *SO, *SR, 
X	*TI, *TE, *UE, *UP, *US, *MAL, *MDL;
X
X#define tputs_x(s)		(tputs(s, 1, putchar_x))
X#define tputs_pad(s,pad)	(tputs(s, (pad), putchar_x))
X
X
X#define backspace()		(tputs_x(BC))
X#define clear_screen()		(tputs_pad(CL,LI))
X#define set_cursor(c, r)	(tputs_x(tgoto(CM, ((c)>=CO?CO-1:(c)), (r))))
X#define linefeed()		(tputs_x(NL))
X#define cr()			(tputs_x(CR))
END_OF_FILE
if test 1542 -ne `wc -c <'samples/vt100/vtem.h'`; then
    echo shar: \"'samples/vt100/vtem.h'\" unpacked with wrong size!
fi
# end of 'samples/vt100/vtem.h'
fi
if test -f 'selection.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'selection.c'\"
else
echo shar: Extracting \"'selection.c'\" \(2511 characters\)
sed "s/^X//" >'selection.c' <<'END_OF_FILE'
X/************************************************************************/
X/*	Copyright 1988 by Chuck Musciano and Harris Corporation		*/
X/*									*/
X/*	Permission to use, copy, modify, and distribute this software	*/
X/*	and its documentation for any purpose and without fee is	*/
X/*	hereby granted, provided that the above copyright notice	*/
X/*	appear in all copies and that both that copyright notice and	*/
X/*	this permission notice appear in supporting documentation, and	*/
X/*	that the name of Chuck Musciano and Harris Corporation not be	*/
X/*	used in advertising or publicity pertaining to distribution	*/
X/*	of the software without specific, written prior permission.	*/
X/*	Chuck Musciano and Harris Corporation make no representations	*/
X/*	about the suitability of this software for any purpose.  It is	*/
X/*	provided "as is" without express or implied warranty.		*/
X/*									*/
X/*	The sale of any product based wholely or in part upon the 	*/
X/*	technology provided by tooltool is strictly forbidden without	*/
X/*	specific, prior written permission from Harris Corporation.	*/
X/*	Tooltool technology includes, but is not limited to, the source	*/
X/*	code, executable binary files, specification language, and	*/
X/*	sample specification files.					*/
X/************************************************************************/
X
X#include	<stdio.h>
X#include	<sys/types.h>
X#include	<suntool/selection_svc.h>
X#include	<suntool/selection_attributes.h>
X
X#include	"tooltool.h"
X
XPRIVATE	Seln_result	read_proc();
X
XPRIVATE	char	*buf, *pos;
X
XEXPORT	char	*tt_get_selection(level)
X
Xint	level;
X
X{	Seln_client	client;
X	Seln_holder	holder;
X	Seln_rank	rank;
X	char		context = 0;
X
X	if (level == 1)
X	   rank = SELN_PRIMARY;
X	else if (level == 2)
X	   rank = SELN_SECONDARY;
X	else if (level == 3)
X	   rank = SELN_SHELF;
X	else
X	   return("");
X	holder = seln_inquire(rank);
X	if (holder.state == SELN_NONE)
X	   return("");
X	pos = buf = tt_emalloc(65536);
X	*buf = '\0';
X	seln_query(&holder, read_proc, &context, SELN_REQ_CONTENTS_ASCII, 0, 0);
X	return(buf);
X}
X
XPRIVATE	Seln_result	read_proc(buffer)
X
XSeln_request	*buffer;
X
X{	char	*reply;
X
X	if (buffer) {
X	   if (*buffer->requester.context == 0) {
X	      if (*((Seln_attribute *) buffer->data) != SELN_REQ_CONTENTS_ASCII)
X	         return(SELN_FAILED);
X	      reply = buffer->data + sizeof(Seln_attribute);
X	      *buffer->requester.context = 1;
X	      }
X	   else
X	      reply = buffer->data;
X	   strcpy(pos, reply);
X	   pos += strlen(reply);
X	   }
X	return(SELN_SUCCESS);
X}
END_OF_FILE
if test 2511 -ne `wc -c <'selection.c'`; then
    echo shar: \"'selection.c'\" unpacked with wrong size!
fi
# end of 'selection.c'
fi
if test -f 'tooltool.icon' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'tooltool.icon'\"
else
echo shar: Extracting \"'tooltool.icon'\" \(1933 characters\)
sed "s/^X//" >'tooltool.icon' <<'END_OF_FILE'
X/* Format_version=1, Width=64, Height=64, Depth=1, Valid_bits_per_item=16
X */
X	0xFFFF,0xFFFF,0xFFFF,0xFFFF,0x8000,0x0000,0x0000,0x0001,
X	0x8000,0x0000,0x0000,0x0001,0x8000,0x0000,0x0000,0x0001,
X	0x87FF,0xFFF0,0x0FFF,0xFFE1,0x8800,0x0008,0x1000,0x0011,
X	0x8BF8,0x0048,0x17F0,0x0091,0x8840,0x0048,0x1080,0x0091,
X	0x8840,0x0048,0x1080,0x0091,0x8847,0x1C48,0x108E,0x3891,
X	0x8848,0xA248,0x1091,0x4491,0x8848,0xA248,0x1091,0x4491,
X	0x8848,0xA248,0x1091,0x4491,0x8847,0x1C48,0x108E,0x3891,
X	0x8800,0x0008,0x1000,0x0011,0x87FF,0xFFF0,0x0FFF,0xFFE1,
X	0x8000,0x0000,0x0000,0x0001,0x8000,0x0000,0x0000,0x0001,
X	0x8000,0x0000,0x0000,0x0001,0xFFFF,0xFFFF,0xFFFF,0xFFFF,
X	0xFFFF,0xFFFF,0xFFFF,0xFFFF,0x8000,0x0000,0x0000,0x0001,
X	0x8000,0x0000,0x0000,0x0001,0x8000,0x0000,0x0000,0x0001,
X	0x8020,0x8181,0x81C2,0x0011,0x8020,0x8181,0x81C2,0x0011,
X	0x8FFF,0xFCFF,0xFFFF,0xFFE1,0x8FFF,0xFCFF,0xFFFF,0xFFE1,
X	0x8280,0x0000,0x0000,0x0001,0x8280,0x0000,0x0000,0x0001,
X	0x8000,0x0000,0x0000,0x0001,0x8000,0x0000,0x0000,0x0001,
X	0x8000,0x4004,0x0100,0x0001,0x8000,0x4004,0x0100,0x0001,
X	0x8FEF,0x7BDF,0xFFFC,0x0001,0x8FEF,0x7BDF,0xFFFC,0x0001,
X	0x8000,0x0800,0x0000,0x0001,0x8000,0x0800,0x0000,0x0001,
X	0x8000,0x0000,0x0000,0x0001,0x8000,0x0000,0x0000,0x0001,
X	0x8042,0x2000,0x0000,0x0001,0x8042,0x2000,0x0000,0x0001,
X	0x8FFF,0xBE00,0x0000,0x0001,0x8FFF,0xBE00,0x0000,0x0001,
X	0x8410,0x0400,0x0000,0x0001,0x8410,0x0400,0x0000,0x0001,
X	0x8000,0x0000,0x0000,0x0001,0x8000,0x0000,0x0000,0x0001,
X	0x8011,0x8000,0x0000,0x0001,0x8011,0x8000,0x0000,0x0001,
X	0x801F,0xF800,0x0000,0x0001,0x801F,0xF800,0x0000,0x0001,
X	0x8000,0x0000,0x0000,0x0001,0x8000,0x0000,0x0000,0x0001,
X	0x8000,0x0900,0x5298,0x0001,0x8000,0x0900,0x5298,0x0001,
X	0x801F,0xF8FF,0x7C70,0x0001,0x801F,0xF8FF,0x7C70,0x0001,
X	0x8000,0x0020,0x0000,0x0001,0x8000,0x0020,0x0000,0x0001,
X	0x8000,0x0000,0x0000,0x0001,0x8000,0x0000,0x0000,0x0001,
X	0x8000,0x0000,0x0000,0x0001,0xFFFF,0xFFFF,0xFFFF,0xFFFF
END_OF_FILE
if test 1933 -ne `wc -c <'tooltool.icon'`; then
    echo shar: \"'tooltool.icon'\" unpacked with wrong size!
fi
# end of 'tooltool.icon'
fi
if test -f 'tooltool.man' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'tooltool.man'\"
else
echo shar: Extracting \"'tooltool.man'\" \(791 characters\)
sed "s/^X//" >'tooltool.man' <<'END_OF_FILE'
X.TH TOOLTOOL 1 "28 March 1988"
X.SH NAME
Xtooltool \- create a windowed tool
X.SH SYNOPSIS
X\fBtooltool\fP [ \fB-f\fP \fIfile\fP ] [ \fIargs\fP ]
X.SH DESCRIPTION
XTooltool creates a windowed application based upon specifications read from
Xits standard input.  If \fB-f\fP is specified, the specifications are
Xread from the indicated \fIfile\fP.  The shell search path is used to
Xlocate \fIfile\fP if it is not a complete pathname.  Any \fIargs\fP are
Xpassed on to the windowed application.
X.LP
XThe details of the application specification are too numerous to mention
Xhere.  The user is referred to the \fITooltool User's Guide\fP for 
Xmore information.
X.SH AUTHOR
XChuck Musciano
X.br
XAdvanced Technology Department
X.br
XHarris Corporation
X.br
X(407) 727-6131
X.br
XARPA: chuck@trantor.harris-atd.com
X
END_OF_FILE
if test 791 -ne `wc -c <'tooltool.man'`; then
    echo shar: \"'tooltool.man'\" unpacked with wrong size!
fi
# end of 'tooltool.man'
fi
echo shar: End of archive 1 \(of 13\).
cp /dev/null ark1isdone
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


From decwrl!ucbvax!tut.cis.ohio-state.edu!rutgers!aramis.rutgers.edu!dartagnan.rutgers.edu!mcgrew Wed Jun 14 07:09:11 PDT 1989
Article 23 of comp.sources.sun:
Path: decwrl!ucbvax!tut.cis.ohio-state.edu!rutgers!aramis.rutgers.edu!dartagnan.rutgers.edu!mcgrew
From: mcgrew@dartagnan.rutgers.edu (Charles Mcgrew)
Newsgroups: comp.sources.sun
Subject: v01i021:  Tooltool - a suntools user interface builder, Part 02/13
Message-ID: <Jun.7.00.10.00.1989.23482@dartagnan.rutgers.edu>
Date: 7 Jun 89 04:10:03 GMT
Organization: Rutgers Univ., New Brunswick, N.J.
Lines: 1444
Approved: mcgrew@aramis.rutgers.edu

Submitted-by: Chuck Musciano <chuck@trantor.harris-atd.com>
Posting-number: Volume 1, Issue 21
Archive-name: tooltool2.1c/part02

#! /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 2 (of 13)."
# Contents:  func_fix.c samples/README samples/keytool.defaults.uu
#   samples/lpq2.tt samples/top.tt samples/vt100/edtkeys.ras.uu
#   samples/vt100/vt102tool.tt samples/vt100/vtem.c symbols.c
# Wrapped by chuck@melmac on Thu Jun  1 10:39:27 1989
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'func_fix.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'func_fix.c'\"
else
echo shar: Extracting \"'func_fix.c'\" \(5847 characters\)
sed "s/^X//" >'func_fix.c' <<'END_OF_FILE'
X/************************************************************************/
X/*	Copyright 1988 by Chuck Musciano and Harris Corporation		*/
X/*									*/
X/*	Permission to use, copy, modify, and distribute this software	*/
X/*	and its documentation for any purpose and without fee is	*/
X/*	hereby granted, provided that the above copyright notice	*/
X/*	appear in all copies and that both that copyright notice and	*/
X/*	this permission notice appear in supporting documentation, and	*/
X/*	that the name of Chuck Musciano and Harris Corporation not be	*/
X/*	used in advertising or publicity pertaining to distribution	*/
X/*	of the software without specific, written prior permission.	*/
X/*	Chuck Musciano and Harris Corporation make no representations	*/
X/*	about the suitability of this software for any purpose.  It is	*/
X/*	provided "as is" without express or implied warranty.		*/
X/*									*/
X/*	The sale of any product based wholely or in part upon the 	*/
X/*	technology provided by tooltool is strictly forbidden without	*/
X/*	specific, prior written permission from Harris Corporation.	*/
X/*	Tooltool technology includes, but is not limited to, the source	*/
X/*	code, executable binary files, specification language, and	*/
X/*	sample specification files.					*/
X/************************************************************************/
X
X#include	<stdio.h>
X
X#include	"tooltool.h"
X
X#define		advance_queue_ptr(q)	((q) = ((q) + 1) % MAX_EVENTS)
X
X#define		MAX_EVENTS		16
X
Xtypedef	struct	fk_data	fk_rec, *fk_ptr;
X
Xstruct	fk_data	{int	candidate;
X		 int	true_event;
X		 char	*expansion;
X		};
X
XPRIVATE	Event	event_queue[MAX_EVENTS];
XPRIVATE	Event	saved_event[MAX_EVENTS];
XPRIVATE	int	queue_head = 0;
XPRIVATE	int	queue_tail = 0;
XPRIVATE	int	state = 0;
X
XPRIVATE	fk_rec	func_key[] = {{TRUE, KEY_LEFT(2),   "\033[193z"},
X			      {TRUE, KEY_LEFT(3),   "\033[194z"},
X			      {TRUE, KEY_LEFT(4),   "\033[195z"},
X			      {TRUE, KEY_LEFT(5),   "\033[196z"},
X			      {TRUE, KEY_LEFT(6),   "\033[197z"},
X			      {TRUE, KEY_LEFT(7),   "\033[198z"},
X			      {TRUE, KEY_LEFT(8),   "\033[199z"},
X			      {TRUE, KEY_LEFT(9),   "\033[200z"},
X			      {TRUE, KEY_LEFT(10),  "\033[201z"},
X			      {TRUE, KEY_TOP(1),    "\033[224z"},
X			      {TRUE, KEY_TOP(2),    "\033[225z"},
X			      {TRUE, KEY_TOP(3),    "\033[226z"},
X			      {TRUE, KEY_TOP(4),    "\033[227z"},
X			      {TRUE, KEY_TOP(5),    "\033[228z"},
X			      {TRUE, KEY_TOP(6),    "\033[229z"},
X			      {TRUE, KEY_TOP(7),    "\033[230z"},
X			      {TRUE, KEY_TOP(8),    "\033[231z"},
X			      {TRUE, KEY_TOP(9),    "\033[232z"},
X			      {TRUE, KEY_RIGHT(1),  "\033[208z"},
X			      {TRUE, KEY_RIGHT(2),  "\033[209z"},
X			      {TRUE, KEY_RIGHT(3),  "\033[210z"},
X			      {TRUE, KEY_RIGHT(4),  "\033[211z"},
X			      {TRUE, KEY_RIGHT(5),  "\033[212z"},
X			      {TRUE, KEY_RIGHT(6),  "\033[213z"},
X			      {TRUE, KEY_RIGHT(7),  "\033[214z"},
X			      {TRUE, KEY_RIGHT(8),  "\033[215z"},
X			      {TRUE, KEY_RIGHT(9),  "\033[216z"},
X			      {TRUE, KEY_RIGHT(10), "\033[217z"},
X			      {TRUE, KEY_RIGHT(11), "\033[218z"},
X			      {TRUE, KEY_RIGHT(12), "\033[219z"},
X			      {TRUE, KEY_RIGHT(13), "\033[220z"},
X			      {TRUE, KEY_RIGHT(14), "\033[221z"},
X			      {TRUE, KEY_RIGHT(15), "\033[222z"},
X			      {NULL, NULL,          NULL}};
X
X/************************************************************************/
XPRIVATE	enqueue_event(event)
X
XEvent	*event;
X
X{
X	event_queue[queue_head] = *event;
X	if (advance_queue_ptr(queue_head) == queue_tail)
X	   abend("internal event queue overflow");
X}
X
X/************************************************************************/
XPRIVATE	Event	*dequeue_event()
X
X{	Event	*result;
X
X	if (queue_tail == queue_head)
X	   return(NULL);
X	result = &(event_queue[queue_tail]);
X	advance_queue_ptr(queue_tail);
X	return(result);
X}
X
X/************************************************************************/
XPRIVATE	reset_state_machine(enqueue_events)
X
Xint	enqueue_events;
X
X{	int	i;
X
X	if (enqueue_events)
X	   for (i = 0; i < state; i++)
X	      enqueue_event(&(saved_event[i]));
X	for (i = 0; func_key[i].expansion; i++)
X	   func_key[i].candidate = TRUE;
X	state = 0;
X}
X
X/************************************************************************/
XPRIVATE	advance_state_machine(event)
X
Xregister	Event	*event;
X
X{	register	int	candidates;
X	register	fk_ptr	last_match, key;
X
X	for (key = func_key, candidates = 0; key->expansion; key++)
X	   if (key->candidate && key->expansion[state] == event_id(event)) {
X	      candidates++;
X	      last_match = key;
X	      }
X	   else
X	      key->candidate = FALSE;
X	if (candidates == 0) {
X	   reset_state_machine(TRUE);
X	   enqueue_event(event);
X	   }
X	else if (candidates == 1 && last_match->expansion[state + 1] == '\0') {
X	   event_set_id(event, last_match->true_event);
X	   reset_state_machine(FALSE);
X	   enqueue_event(event);
X	   }
X	else {
X	   saved_event[state] = *event;
X	   if (++state >= MAX_EVENTS)
X	      abend("oveflowed internal event buffer");
X	   }
X}
X
X/************************************************************************/
XPRIVATE	Notify_value	function_check(win, event, arg, type)
X
XWindow	win;
XEvent	*event;
XNotify_arg	arg;
XNotify_event_type	type;
X
X{	Notify_value	result;
X
X	if (event_is_ascii(event) || event_is_meta(event))
X	   if (event_is_down(event))
X	      advance_state_machine(event);
X	   else
X	      reset_state_machine(TRUE);
X	else {
X	   reset_state_machine(TRUE);
X	   enqueue_event(event);
X	   }
X	while (event = dequeue_event())
X	   if ((result = notify_next_event_func(win, event, arg, type)) != NOTIFY_DONE)
X	      return(result);
X	return(NOTIFY_DONE);
X}
X
X/************************************************************************/
XEXPORT	init_function_fix(win)
X
XWindow	win;
X
X{
X	window_set(win, WIN_CONSUME_KBD_EVENT,  WIN_UP_ASCII_EVENTS, 0);
X	notify_interpose_event_func(win, function_check, NOTIFY_SAFE);
X}
END_OF_FILE
if test 5847 -ne `wc -c <'func_fix.c'`; then
    echo shar: \"'func_fix.c'\" unpacked with wrong size!
fi
# end of 'func_fix.c'
fi
if test -f 'samples/README' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'samples/README'\"
else
echo shar: Extracting \"'samples/README'\" \(4704 characters\)
sed "s/^X//" >'samples/README' <<'END_OF_FILE'
X     This directory contains several sample tooltool specifications
Xwhich you can use to help learn tooltool.  All files ending in ".tt"
Xare tooltool files.  The samples contained herein are:
X
X	lpq.tt
X	queue.c
X	laserwriter.icon
X		This specification uses a custom application (queue.c)
X		to show how a user could build a new windowed application
X		from scratch using a small C program and a tooltool
X		file.  Compile queue.c (using "cc -O -o queue queue.c")
X		and type "tooltool -f lpq.tt" to see the results.  Lpq.tt
X		creates a windowed print queue monitor which polls the
X		print queue.  Closing the window stops the polling, 
X		opening it restarts it, as do the buttons in the gadget
X		panel.  You can adjust the polling rate using the slider.
X
X	lpq2.tt
X	tty.c
X		This is another queue tool, but written with all the 
X		smarts in the tooltool file itself.  It uses /bin/cat
X		to write to the display.  This is a good example of
X		the new features in tooltool 2.0.
X
X	top.tt
X	top.icon
X		Top.tt turns the popular top command into a windowed
X		application.  Common top commands have been placed on 
X		buttons, and you can still type to top like you used to.
X
X	rn.tt
X	news.icon
X		This turns rn, the news reading program, into a windowed
X		news reading program.  Again, common commands are on
X		buttons, and less used commands are in a menu.  You can 
X		add to or change rn.tt to suit your own tastes, depending
X		on how you like to use rn.
X
X	calc.tt
X		This is the sample file discussed in the documentation.
X		It uses very few tooltool options, and serves as a simple
X		introductory example to tooltool.  You could jazz this up
X		with an icon, and some other buttons to perform other
X		arithmetic operations.
X
X	stopwatch.tt
X	stopwatch.icon
X		This creates a handy stopwatch tool, entirely within tooltool.
X		It can count up or down, can take a split time, and can be set
X		by clicking on the appropriate digits.  It offers tenth or
X		single second resolution.
X
X	keytool
X	keytool.l
X	keytool.r.14
X	keytool.defaults
X		Keytool is a different kind of tooltool application.  It is 
X		actually a shell script, which builds a specification for 
X		tooltool.  It is a good example of how to process command
X		line arguments for a tooltool application, and is a complex
X		example of using tooltool.  Basically, keytool lets you
X		reprogram your keyboard, save those definitions and have them
X		recalled when you next invoke keytool.  To define keys and mouse
X		actions, click shift-control-meta mouse right to see the
X		programming window.  Click on the key (and shift pattern)
X		you want to define, and type the definition.  A typical
X		invocation would be "keytool /bin/csh" to create a shell
X		window with programmable keys.  Since keytool is a shell
X		script, you invoke it directly, instead of using "tooltool -f
X		keytool".  Keytool is courtesy of Ken Laprade, here at Harris.
X		Try it!
X
X		Before using keytool, you must unpack the defaults and font
X		files by typing:
X		
X			uudecode keytool.defaults.uu
X			uudecode keytool.r.14.uu
X		
X		Then you can successfully run keytool.
X		
X		Note that keytool has its own special font, which you should
X		install in /usr/lib/fonts/fixedwidthfonts if you make keytool
X		an installed tool at your site.  Don't forget to fix up the
X		keytool reference to this font when you move it.  The same
X		goes for the keytool.defaults file, which we keep in 
X		/usr/local/lib.
X
X	vt100
X		This directory contains a complete vt100 emulator with a tooltool
X		wrapper.  See the VTEM_README file in this directory for more
X		information.  You'll need to create the emulator before you can use
X		it with tooltool; check the Makefile for the appropriate information.
X
XIn all of these files, references are made to icon files, font files, and
Xapplication names.  If you wish to make these samples real commands, you should
Xput the icons and associated files in a public place and modify the .tt 
Xfile accordingly.  At Harris, we put all .tt files in /usr/local/lib/tooltool,
Xand icons go in /usr/local/images.  The fonts used by these files are Sun
Xstandards, so that should be no problem.  Finally, you should create little
Xshell files to invoke tooltool transparently when the command name is typed:
X
X	lpqtool:
X		tooltool -f /usr/local/lib/tooltool/lpq.tt
X	   or
X	        tooltool -f /usr/local/lib/tooltool/lpq2.tt
X
X	toptool:
X		tooltool -f /usr/local/lib/tooltool/top.tt
X
X	newstool:
X		tooltool -f /usr/local/lib/tooltool/rn.tt
X
X	calctool:
X		tooltool -f /usr/local/lib/tooltool/calc.tt
X
X	stopwatchtool:
X		tooltool -f /usr/local/lib/tooltool/stopwatch.tt
X
X	supershelltool:
X		keytool /bin/csh
X
XOf course, replace /usr/local/lib/tooltool with the pathname of the place
Xyou keep the tooltool file.
END_OF_FILE
if test 4704 -ne `wc -c <'samples/README'`; then
    echo shar: \"'samples/README'\" unpacked with wrong size!
fi
# end of 'samples/README'
fi
if test -f 'samples/keytool.defaults.uu' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'samples/keytool.defaults.uu'\"
else
echo shar: Extracting \"'samples/keytool.defaults.uu'\" \(2823 characters\)
sed "s/^X//" >'samples/keytool.defaults.uu' <<'END_OF_FILE'
Xbegin 666 keytool.defaults
XM4T5005)!5$]2/0D*4%))34%260I,,@D8$PD5&!,)%1@3"2<G"1MJ?@DG)PDG
XM)PDG)PI,,PD8!@D;,1@&"1LQ& 8))R<)&VHM,1@&"2<G"2<G"2<G"DPT"1AB
XM"1AK"1AK"2<G"1MJ7@DG)PDG)PDG)PI,.0D;:@D;:G@)&VIX"2<G"2<G"2<G
XM"2<G"2<G"DPQ, D;* D;:G@)&VIX"2<G"2<G"2<G"2<G"2<G"D8Q"1MJ"1MJ
XM> D;:G@))R<))R<))R<))R<))R<*1C()&R@)&VIX"1MJ> DG)PDG)PDG)PDG
XM)PDG)PI&,PD;,PDG)PDG)PDG)PDG)PDG)PDG)PDG)PI&- D;:G<))R<))R<)
XM)R<))R<))R<))R<))R<*1C4)&VIX9PD8/0D8/0DG)PDG)PDG)PDG)PDG)PI&
XM-@D;*',)&RAS"1LH<PDG)PDG)PDG)PDG)PDG)PI&-PD;:GAQ( T)&VIX<2!L
XM87-T#0D;:GAQ(&QA<W0-"2<G"2<G"2<G"2<G"2<G"D8X"1D)&VIX;"!T#0D;
XM:GAL('0-"2<G"2<G"2<G"2<G"2<G"D8Y"1MJ>0D;:GAC(&0@#0D;:GAC(&0@
XM#0DG)PDG)PDG)PDG)PDG)PI2,0EY"7D)>0DG)PDG)PDG)PDG)PDG)PI2,@EB
XM"6()8@DG)PDG)PDG)PDG)PDG)PI2,PD!"0$) 0DG)PDG)PDG)PDG)PDG)PI2
XM- D-"0T)#0DG)PDG)PDG)PDG)PDG)PI2-0D@"2 )( DG)PDG)PDG)PDG)PDG
XM)PI2-@D%"04)!0DG)PDG)PDG)PDG)PDG)PI2-PD!"1@H"1@H"2<G"2<G"2<G
XM"2<G"2<G"E(X"1 )&VH\"1MJ/ DG)PDG)PDG)PDG)PDG)PI2.0D%"1@I"1@I
XM"2<G"2<G"2<G"2<G"2<G"E(Q, D""0$)&VH""2<G"2<G"2<G"2<G"2<G"E(Q
XM,0D$"1MJ9!MJ" D;:F0;:@@))R<)&VID"2<G"2<G"2<G"E(Q,@D&"04)&VH&
XM"2<G"2<G"2<G"2<G"2<G"E(Q,PD5&S,)&0D9"2<G"1LS"2<G"2<G"2<G"E(Q
XM- D."1MJ/@D;:CX))R<))R<))R<))R<))R<*4C$U"1@8"1MJ>0D;:GD))R<)
XM& T))R<))R<))R<*3$5&5 DG)PDG)PDG)PDG)PDG)PDG)PDG)PDG)PI-241$
XM3$4))R<))R<))R<))R<))R<))R<))R<))R<*4DE'2%0))R<))R<))R<))R<)
XM)R<))R<))R<))R<*4T5#3TY$05)9"DPR"1@3"148$PD5&!,))R<)&VI^"2<G
XM"2<G"2<G"DPS"1@&"1LQ& 8)&S$8!@DG)PD;:BTQ& 8))R<))R<))R<*3#0)
XM&&()&&L)&&L))R<)&VI>"2<G"2<G"2<G"DPY"1MJ"1MJ> D;:G@))R<))R<)
XM)R<))R<))R<*3#$P"1LH"1MJ> D;:G@))R<))R<))R<))R<))R<*1C$) 1MJ
XM7 @;:EP-&VHR" X) 2\J( 4@+RH@*B\."0%[( 4@>WT."2<G"2<G"2<G"2<G
XM"2<G"D8R"0$;:EP(&VI<#0X) 1MJ,P0%&VHV" X) 1MJ,@0%&VHS" X))R<)
XM)R<))R<))R<))R<*1C,) 1MJ7 @;:EP-(" ."0$O*B %("\J("HO#@D0!1D!
XM&VHQ&0DG)PDG)PDG)PDG)PDG)PI&- D;:EP) 0L9 0\9( D!+RH@!2 O*B J
XM+PX))R<))R<))R<))R<))R<*1C4)&VIX9PD8/0D8/0DG)PDG)PDG)PDG)PDG
XM)PI&-@D;*',)&RAS"1LH<PDG)PDG)PDG)PDG)PDG)PI&-PD;:GAQ( T)&VIX
XM<2!L87-T#0D;:GAQ(&QA<W0-"2<G"2<G"2<G"2<G"2<G"D8X"1D)&VIX;"!T
XM#0D;:GAL('0-"2<G"2<G"2<G"2<G"2<G"D8Y"1MJ>0D;:GAC(&0@#0D;:GAC
XM(&0@#0DG)PDG)PDG)PDG)PDG)PI2,0D;80D;80D;80DG)PDG)PDG)PDG)PDG
XM)PI2,@D;:G8)&VIV"1MJ=@DG)PDG)PDG)PDG)PDG)PI2,PD;:CP)&VH\"1MJ
XM/ DG)PDG)PDG)PDG)PDG)PI2- D;8 D;8 D;8 DG)PDG)PDG)PDG)PDG)PI2
XM-0D6"18)%@DG)PDG)PDG)PDG)PDG)PI2-@D;:CX)&VH^"1MJ/@DG)PDG)PDG
XM)PDG)PDG)PI2-PD!"1@H"1@H"2<G"2<G"2<G"2<G"2<G"E(X"1 )&VH\"1MJ
XM/ DG)PDG)PDG)PDG)PDG)PI2.0D%"1@I"1@I"2<G"2<G"2<G"2<G"2<G"E(Q
XM, D""0$)&VH""2<G"2<G"2<G"2<G"2<G"E(Q,0D$"1MJ9!MJ" D;:F0;:@@)
XM)R<)&VID"2<G"2<G"2<G"E(Q,@D&"04)&VH&"2<G"2<G"2<G"2<G"2<G"E(Q
XM,PD5&S,)&0D9"2<G"1LS"2<G"2<G"2<G"E(Q- D."1MJ/@D;:CX))R<))R<)
XM)R<))R<))R<*4C$U"1@8"1MJ>0D;:GD))R<)& T))R<))R<))R<*3$5&5 DG
XM)PDG)PDG)PDG)PD;-25C)6,))R<))R<))R<*34E$1$Q%"2<G"2<G"2<G"2<G
XK"2<G"2<G"2<G"2<G"E))1TA4"2<G"2<G"2<G"2<G"2<G"2<G"2<G"2<G"B<G
X 
Xend
END_OF_FILE
if test 2823 -ne `wc -c <'samples/keytool.defaults.uu'`; then
    echo shar: \"'samples/keytool.defaults.uu'\" unpacked with wrong size!
fi
# end of 'samples/keytool.defaults.uu'
fi
if test -f 'samples/lpq2.tt' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'samples/lpq2.tt'\"
else
echo shar: Extracting \"'samples/lpq2.tt'\" \(5436 characters\)
sed "s/^X//" >'samples/lpq2.tt' <<'END_OF_FILE'
X#define		TRUE		1
X#define		FALSE		0
X
X#define		HEIGHT		10
X
X#define		EMPTY_COUNT	6
X
X#define		CLEAR		"^L"
X#define		BOLD_ON		"\e[7m"
X#define		BOLD_OFF	"\e[m"
X
Xapplication "/bin/cat"
X   label "<< Print Queue Monitor >>"
X   size HEIGHT by 80 characters
X   icon "laserwriter.icon"
X   font "/usr/lib/fonts/fixedwidthfonts/screen.r.14"
X   initialize {
X      interval = active_interval;	/* set the timer rate for queue checking		*/
X      active = TRUE;			/* start out in active mode				*/
X      active_count = EMPTY_COUNT;	/* successive empty queues before we switch to idle	*/
X      delimiters = "\n";		/* to tokenize the output of lpq			*/
X      pr_name[0] = "lw";		/* define the printers we can access			*/
X      pr_name[1] = "lp";
X      pr_name[2] = "versatec";
X      close_on_idle = TRUE;		/* initial option choices				*/
X      close_option = 0;
X      open_on_active = FALSE;
X      open_option = 1;
X      remove idle_light;		/* initialize the main window display			*/
X      remove check_light;
X      remove remove_options_button;
X      display display_options_button;
X      }
X   open {
X      active = TRUE;
X      interval = active_interval;
X      display active_light;
X      remove idle_light;
X      active_count = EMPTY_COUNT;
X      }
X   close {
X      active = FALSE;
X      interval = idle_interval;
X      display idle_light;
X      remove active_light;
X      active_count = 0;
X      }
X   timer {
X      remove active_light;
X      remove idle_light;
X      display check_light;
X      queue = tokenize(output_of(format("lpq -P%s", pr_name[printer])));
X      remove check_light;
X      send CLEAR, BOLD_ON, queue[0], BOLD_OFF, "\n\n";
X      if (queue[0] == "no entries")
X         if (active)
X            if (--active_count == 0) {
X               active = FALSE;
X               display idle_light;
X               interval = idle_interval;
X               if (close_on_idle && is_open())
X                  close;
X               }
X            else
X               display active_light;
X         else
X            display idle_light;
X      else {
X         active = TRUE;
X         active_count = EMPTY_COUNT;
X         display active_light;
X         interval = active_interval;
X         if (open_on_active && !is_open())
X            open;
X         for (i = 1; i < HEIGHT - 1 && i < cardinality(queue); i++)
X            if (index(queue[i], user()))
X               send BOLD_ON, queue[i], BOLD_OFF, "\n";
X            else
X               send queue[i], "\n";
X         }
X      }
X
Xgadgets
X   top
X   align middle
X   font "/usr/lib/fonts/fixedwidthfonts/screen.b.14"
X   label active_light
X      at 49 4
X      "Active"
X   end_label
X   label idle_light
X      at 303 4
X      "Idle"
X   end_label
X   label check_light
X      at 529 4
X      "Checking"
X   end_label
X   button
X      at 4 24
X      normal "   Go Active   " /* spaces set size of all buttons */
X         { active = TRUE;
X     	   interval = active_interval;
X     	   remove idle_light;
X     	   display active_light;
X      	   active_count = EMPTY_COUNT;
X      	 }
X   end_button
X   button
X      at 249 24
X      normal "Go Idle"
X         { active = FALSE;
X      	   interval = idle_interval;
X      	   remove active_light;
X      	   display idle_light;
X      	   active_count = 0;
X      	   if (close_on_idle)
X      	      close;
X      	 }
X   end_button
X   button display_options_button
X      at 493 24
X      normal "Options"
X         display option_dialog;
X   end_button
X   button remove_options_button
X      at 493 24
X      normal "Remove Options"
X         remove option_dialog;
X   end_button
Xend_gadgets
X
Xdialog option_dialog
X   label "<< Print Queue Monitor Options >>"
X   size 24 by 92 characters
X   open {
X         remove display_options_button;
X         display remove_options_button;
X         }
X   close {
X         remove remove_options_button;
X         display display_options_button;
X         }
X   gadgets
X      align middle
X      font "/usr/lib/fonts/fixedwidthfonts/screen.b.14"
X      slider active_interval
X         at 4 78
X         label "Active Interval:"
X         value on 
X         range off
X         minimum 5
X         maximum 300
X         initial 10
X         width 100
X         action {
X            if (active)
X               interval = active_interval;
X            }
X      end_slider
X      slider idle_interval
X         at 4 116
X         label "Idle Interval:  "
X         value on 
X         range off
X         minimum 5
X         maximum 300
X         initial 60
X         width 100
X         action {
X            if (!active)
X               interval = idle_interval;
X            }
X      end_slider
X      choice printer
X         at 4 4
X         display vertical
X         label "Printer:"
X         "LaserWriter"		nothing;
X         "Line Printer"		nothing;
X         "Versatec Plotter"	nothing;
X      end_choice
X      label
X         at 320 4
X         "When the queue becomes active..."
X      end_label
X      choice open_option
X         at 345 24
X         display vertical
X         "Open the window"			open_on_active = TRUE;
X         "Do not change the window's status"	open_on_active = FALSE;
X      end_choice
X      label
X         at 320 78
X         "When the queue becomes idle..."
X      end_label
X      choice close_option
X         at 345 98
X         display vertical
X         "Close the window"			close_on_idle = TRUE;
X         "Do not change the window's status"	close_on_idle = FALSE;
X      end_choice
X   end_gadgets
Xend_dialog
X
Xkeys
X   disable normal_keys
X   disable function_keys
Xend_keys
END_OF_FILE
if test 5436 -ne `wc -c <'samples/lpq2.tt'`; then
    echo shar: \"'samples/lpq2.tt'\" unpacked with wrong size!
fi
# end of 'samples/lpq2.tt'
fi
if test -f 'samples/top.tt' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'samples/top.tt'\"
else
echo shar: Extracting \"'samples/top.tt'\" \(4324 characters\)
sed "s/^X//" >'samples/top.tt' <<'END_OF_FILE'
Xapplication "top"
X   size 16 by 80 characters
X   font "/usr/lib/fonts/fixedwidthfonts/screen.b.14"
X   icon "top.icon"
X   label "<< Top >>"
X   at 156 0
X   close "s1000\n"
X   open "s5\n"
Xgadgets
X   top
X   align middle
X   font "/usr/lib/fonts/fixedwidthfonts/screen.b.14"
X   button
X      normal	"Close"		close;
X      shift	"Exit"		send "q";
X   end_button
X   slider interval
X      label "Display Interval:"
X      range off
X      value on
X      initial 5
X      minimum 1
X      maximum 240
X      width 227
X      action send format("s%d\n", interval);
X   end_slider
X   button
X      normal	"Kill a Process"	display kill_process_dialog;
X   end_button
X   button
X      normal	" Change Process Priority "	display change_process_dialog;
X   end_button
X   button
X      normal	"Show Errors"	send "e";
X   end_button
Xend_gadgets
Xdialog kill_process_dialog
X   size 24 by 50 characters
X   gadgets
X      align middle
X      font "/usr/lib/fonts/fixedwidthfonts/screen.b.14"
X      label
X         "Enter the pid of the process to be killed"
X      end_label
X      button
X         normal	"OK"	{ if (verify(kill_pid, "0123456789")) {
X         		     send format("k%d\n", kill_pid);
X         		     remove kill_process_dialog;
X         		     }
X         		  else
X         		     popup invalid_pid;
X         		}
X      end_button
X      text kill_pid
X         label "Pid:"
X         font "/usr/lib/fonts/fixedwidthfonts/screen.r.14"
X         trigger "\n\r"
X         display 20
X         action { if (verify(kill_pid, "0123456789")) {
X         	     send format("k%d\n", kill_pid);
X         	     remove kill_process_dialog;
X         	     }
X         	  else
X         	     popup invalid_pid;
X         	}
X      end_text
X      button
X         normal "Cancel" remove kill_process_dialog;
X      end_button
X   end_gadgets
Xend_dialog
Xdialog change_process_dialog
X   size 24 by 60 characters
X   gadgets
X      align middle
X      font "/usr/lib/fonts/fixedwidthfonts/screen.b.14"
X      label
X         "Enter the pid of the process, and its new priority"
X      end_label
X      button
X         normal	"OK"	{ if (verify(change_pid, "0123456789"))
X         		     if (verify(priority, "-0123456789") && priority >= -20 && priority <= 20) {
X         		        send format("r%d %d\n", priority, change_pid);
X         		        remove change_process_dialog;
X         		        }
X         		     else
X         		        popup invalid_priority;
X         		  else
X         		     popup invalid_pid;
X         		}
X      end_button
X      text change_pid
X         label "Pid:"
X         font "/usr/lib/fonts/fixedwidthfonts/screen.r.14"
X         trigger "\n\r"
X         display 10
X         action { if (verify(change_pid, "0123456789"))
X         	     if (verify(priority, "-0123456789") && priority >= -20 && priority <= 20) {
X         	        send format("r%d %d\n", priority, change_pid);
X         	        remove change_process_dialog;
X         	        }
X         	     else
X         	        popup invalid_priority;
X         	  else
X         	     popup invalid_pid;
X         	}
X      end_text
X      text priority
X         label "Priority:"
X         font "/usr/lib/fonts/fixedwidthfonts/screen.r.14"
X         trigger "\n\r"
X         display 10
X         action { if (verify(change_pid, "0123456789"))
X         	     if (verify(priority, "-0123456789") && priority >= -20 && priority <= 20) {
X         	        send format("r%d %d\n", priority, change_pid);
X         	        remove change_process_dialog;
X         	        }
X         	     else
X         	        popup invalid_priority;
X         	  else
X         	     popup invalid_pid;
X         	}
X      end_text
X      button
X         normal "Cancel" remove change_process_dialog;
X      end_button
X   end_gadgets
Xend_dialog
Xdialog invalid_pid
X   gadgets
X      font "/usr/lib/fonts/fixedwidthfonts/screen.b.14"
X      align middle
X      ragged
X      label
X         "The specified pid is not valid   "
X      end_label
X      button
X         normal "  OK  " remove invalid_pid;
X      end_button
X   end_gadgets
Xend_dialog
Xdialog invalid_priority
X   gadgets
X      font "/usr/lib/fonts/fixedwidthfonts/screen.b.14"
X      align middle
X      ragged
X      label
X         "The specified priority is not valid   "
X      end_label
X      button
X         normal "  OK  " remove invalid_priority;
X      end_button
X   end_gadgets
Xend_dialog
END_OF_FILE
if test 4324 -ne `wc -c <'samples/top.tt'`; then
    echo shar: \"'samples/top.tt'\" unpacked with wrong size!
fi
# end of 'samples/top.tt'
fi
if test -f 'samples/vt100/edtkeys.ras.uu' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'samples/vt100/edtkeys.ras.uu'\"
else
echo shar: Extracting \"'samples/vt100/edtkeys.ras.uu'\" \(4440 characters\)
sed "s/^X//" >'samples/vt100/edtkeys.ras.uu' <<'END_OF_FILE'
Xbegin 644 edtkeys.ras
XM6:9JE0   +P   "$     0  #&     !                            
XM                                               /____________
XM_________________X (      !       (      !       ( (      ! 
XM      (      !       ( (      ! ';[CP ( ?S;? !!Y]P!P ( (    
XM  ! "1)!( ( )9*5 ! DD@ @ ( (      ! "1!!( ( (9*$ ! D@@ @ ( (
XM      ! #QQ!( ( .5$$ ! DX@ @ ( (      ! "1!!P ( (5$$ ! D@@ @
XM ( (      ! "1!!  ( (3*$ ! D@@ @ ( (      ! "1))  ( (3*$ ! D
XMDD D ( (      ! ';[[@ ( <Q;. !!Y]\!\ ( (      !       (     
XM !       ( (      !       (      !       ( ('QSQ\ !       ( 
XM     !       ( (,R9@V !       (      !       ( (,&9@V !     
XM  ( ?O\[X!#OG? '@( (,&9@V !       ( ,C$1L!!DB-@# ( (-V9@V ! 
XM      ( ,#&1L!!DR-@# ( (,V9@V !       ( /#'1L!!DZ-@# ( (,V1D
XMV !       ( ,#'QL!!D^-@# ( ('CC]\ !       ( ,#%QL!!DN-@# ( (
XM      !       ( ,#$QL!!DF-@#(( (      !       ( >/^3X! YR? '
XMX( (      !       (      !       ( (      !       (      !  
XM     ( (      !       (      !       ( /____________________
XM_________X (      !       (      !       ( (      !       ( 
XM     !       ( ( >,/? ! ![Y[X (&///YO!!Y]P#L ( ( )$1) ! ")**
XMH ("$DDLDA DD@!$ ( ( ),0( ! "!" @ (&$DD,DA D@@!$ ( ( )*0. ! 
XM!AR @ (%$DG*DA DX@!4 ( ( .*3( !  1" @ (%''$*DA D@@!4 ( ( (>1
XM( !  )" @ (/$$$)DA D@@ H ( ( (21) ! ")*(@ ()$$$IDA DDD H ( (
XM <S.? ! #SYQP (9N./XO!!Y]\ H ( (      !       (      !      
XM ( (      !       (      !       ( (      !       (      !  
XM     ( (      !       (      !       ( ('QV/.^! '[]X\ (!\_?/
XM !#OG? .X( (,R:)$;! #(PP8 ( V9-F !!DB-@$0( (,&;9D;! # PP8 ( 
XMV8-F !!DR-@%0( (,&;9T;! #PPP8 ( V>-F !!DZ-@%0( (,&;Y\;! # PP
XM8 ( \8/& !!D^-@'P( (,&:I<;! # PP8 ( V8,& !!DN-@"@( (,V2I,;! 
XM# PR9 ( V9,&0!!DF-@"@( ('CF/D^! 'C]^_ (!V_>/P! YR? "@( (    
XM  !       (      !       ( (      !       (      !       (P(
XM      !       (      !       (@(      !       (      !      
XM (@/_____________________________X@(      !       (      !  
XM     (@(      !       (      !       (@(&/=IGOA!XP]OMX(  ?V^
XM !!Y]P \ (D("$HLHDA D1$I(D(  BDJ ! DD@!$ (\(&$HLH$! DQ Q(D( 
XM @D( ! D@@!  ( (%$E*H'! XI Q(D(  @D( ! DX@!  ( (%$E*H$! DI I
XM(X(  @D( ! D@@!  ( (/$E)H$! EY I(@(  @D( ! D@@!  ( ()$B)HDA 
XME)$E(@(  BD( ! DDD!$ (\(9O"8G/A![,YLQP(  <8< !!Y]\ X ( (    
XM  !       (      !       ( (      !       (      !       (\(
XM/AS]_C! #\<^  (/CAY^_!#OG? #X(4(&R:U:B! "TF;  (&QC):9!!DB-@&
XM8(0(&V8P8V!  QF;  (&QS 88!!DR-@& (0('F8P8V!  QF;  (&S1P8>!!D
XMZ-@& (0(&V8P8^!  QF>  ('B0888!!D^-@& (0(&V8P8J!  QF8  (&'X88
XM8!!DN-@& (0(&V0P8J!  QD8  (&&:889!!DF-@&8(X(/CAX]C! !XX\  (/
XM.;P\_! YR? #P( (      !       (      !       ( (      !     
XM  (      !       ( (      !       (      !       ( (      ! 
XM      (      !       ( /_____________________________X (    
XM  !       (      !       ( (      !       (      !       (\(
XM [.>> !  'SG  ( /[,> !!\ @   (T( 19)) !  "62  ( 12$) ! D @  
XM (P( 11)) !  "$2  ( 02,) ! BQXQL (P( 51)) !  #D2  ( 0>*) ! Y
XM(A(T (P( 51.) !  "$2  ( 02*. ! A(AX@ (P( *1*) !  "$2  ( 02>*
XM ! A(A @ (P( *3)) !  "4R0 ( 122) ! E(A(@ (X( *.9> !  'SGP ( 
XM.[S9 !!_L8QP ( (      !       (      !       ( (      !     
XM  (      !       ( ( #YP\_!^?@'XYX(  /\YX! ]W?'@ ( ( &8QD9 ;
XM,@#),P(  #$3(!!DR-L@ (\(.V Y@8 ;, ##,P( =C&3 !!@R-L  ( (&F!H
XMX> ;/ #S,P( -#'1P! XR/'  ( (#&!(,8 ;, ##,P( &#'P8! ,R-A@ (\(
XM#&#\,8 ;, ##,P( &#%P8! ,R-A@ (0(%F;-,9 ;,@#+(R( +#$R8!!,R-I@
XM (0(-SW-X_ ^?@'YQ^( ;O^3P!!X<?/  (0(              (      !  
XM     (<(              (      !       (4(              (     
XM !       (0(      !       (      !       (P/________________
XM_____________X (      !       (      !         (      !     
XM  (      !         ( <?S? !       ('ON/GOA         ( ($9) ! 
XM      ((DD$HJA         ( ($9( !       (($$$("!         ( ($5
XM. !       (&'$'("!         ( ($5( !       (!$$$("!        P(
XM ($3( !       ( D$$("!        D( )$3) !       ((DDDHB!      
XM  D( ??Q? !       (//OOG'!        @(      !       (      !  
XM      @(      !       (      !        @( '/G^<!       (/GYY^
XM_!        D( )FS*(!       (&S+(RM!        D( 9FS#(!       (&
XMS# P,!         ( 9FSSH!       (&SQP\,!         ( 9GC#X!     
XM  ('C 8P,!         ( 9F#"X!       (&S 8P,!         ( 9&#*8! 
XM      (&S*8R,!        \( ./'_(!       (.W[Q^>!         (    
XM  !       (      !         (      !       (      !        ,(
XM      !       (      !        0(      !       (      !      
XM  0/_______       /_______        0                         
X%      3_
X 
Xend
END_OF_FILE
if test 4440 -ne `wc -c <'samples/vt100/edtkeys.ras.uu'`; then
    echo shar: \"'samples/vt100/edtkeys.ras.uu'\" unpacked with wrong size!
fi
# end of 'samples/vt100/edtkeys.ras.uu'
fi
if test -f 'samples/vt100/vt102tool.tt' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'samples/vt100/vt102tool.tt'\"
else
echo shar: Extracting \"'samples/vt100/vt102tool.tt'\" \(3707 characters\)
sed "s/^X//" >'samples/vt100/vt102tool.tt' <<'END_OF_FILE'
X/*
X * simple tooltool command file for creating a vt100 emulator with
X * standard VT100 keypad (plus a few from VT320), plus a keyboard template.
X * standard templates are provided for EDT and ANU News.  More could be
X * added.  This was a quick hack, and needs further work.
X * See also vttool, which is a standalone vtem wrapper providing similar
X * functionality.
X *
X * Last edit:  8 April 1989 by jqj@hogg.cc.uoregon.edu
X */
X
Xapplication "vtem"
X	label "vt102tool"
X	size 24 by 81 characters
X	initialize	{remove EDThelp;}
X	icon "/usr/local/images/vt.icon"
Xgadgets
X	/* place the keypad at the bottom */
X	bottom
X	align top
X	ragged
X	/* unfortunately, we are forced to hardwire the font */
X	/* since we are hardwiring the locations of buttons */
X	font "/usr/lib/fonts/fixedwidthfonts/screen.b.12"
X#define ROW_1	5
X#define ROW_2	30
X#define ROW_3	55
X#define ROW_4	80
X#define ROW_5	105
X#define COL_1	5
X#define COL_2	54
X#define COL_3	103
X#define COL_4	152
X#define COL_5	201
X#define COL_6	250
X#define COL_7	299
X#define COL_8	348
X#define COL_9	397		/* unused */
X#define COL_10	446		/* unused */
X
X    button PF1
X	at COL_1 ROW_1
X	normal "PF1"	send "\eOP";
X    end_button
X    button PF2
X	at COL_2 ROW_1
X	normal "PF2"	send "\eOQ";
X    end_button
X    button PF3
X	at COL_3 ROW_1
X	normal "PF3"	send "\eOR";
X    end_button
X    button PF4
X	at COL_4 ROW_1
X	normal "PF4"	send "\eOS";
X    end_button
X    button n7
X	at COL_1 ROW_2
X	normal "7"	send "\eOw";
X    end_button
X    button n8
X	at COL_2 ROW_2
X	normal "8"	send "\eOx";
X    end_button
X    button n9
X	at COL_3 ROW_2
X	normal "9"	send "\eOy";
X    end_button
X    button minus
X	at COL_4 ROW_2
X	normal "-"	send "\eOm";
X    end_button
X    button n4
X	at COL_1 ROW_3
X	normal "4"	send "\eOt";
X    end_button
X    button n5
X	at COL_2 ROW_3
X	normal "5"	send "\eOu";
X    end_button
X    button n6
X	at COL_3 ROW_3
X	normal "6"	send "\eOv";
X    end_button
X    button comma
X	at COL_4 ROW_3
X	normal ","	send "\eOl";
X    end_button
X    button n1
X	at COL_1 ROW_4
X	normal "1"	send "\eOq";
X    end_button
X    button n2
X	at COL_2 ROW_4
X	normal "2"	send "\eOr";
X    end_button
X    button n3
X	at COL_3 ROW_4
X	normal "3"	send "\eOs";
X    end_button
X    button ENTER
X	at COL_4 ROW_4
X	normal "Ent"	send "\eOM";
X    end_button
X    button n0
X	at COL_1 ROW_5
X	normal "0"	send "\eOp";
X    end_button
X    button period
X	at COL_3 ROW_5
X	normal "."	send "\eOn";
X    end_button
X    
X    /* some VT320 extended keys */
X    button FindKey
X	at COL_5 ROW_2
X	normal "Find"	send "\e[1~";
X    end_button
X    button InsertKey
X	at COL_6 ROW_2
X	normal "Ins."	send "\e[2~";
X    end_button
X    button RemoveKey
X	at COL_7 ROW_2
X	normal "Rem."	send "\e[3~";
X    end_button
X    button SelectKey
X	at COL_5 ROW_3
X	normal "Sel."	send "\e[4~";
X    end_button
X    button PrevScreenKey
X	at COL_6 ROW_3
X	normal "Prev"	send "\e[5~";
X    end_button
X    button NextScreenKey
X	at COL_7 ROW_3
X	normal "Next"	send "\e[6~";
X    end_button
X
X    /* arrow keys */
X    button uparrow
X	at COL_6 ROW_4
X	normal "\136"	send "\e[A";
X    end_button
X    button leftarrow
X	at COL_5 ROW_5
X	normal "<"	send "\e[D";
X    end_button
X    button rightarrow
X	at COL_7 ROW_5
X	normal ">"	send "\e[C";
X    end_button
X    button downarrow
X	at COL_6 ROW_5
X	normal "V"	send "\e[B";
X    end_button
X    
X    /* keypad templates.  Only one will be visible at a time. */
X    label NEWShelp
X        at COL_8 1
X	'/usr/local/images/newskeys.ras'
X    end_label
X    label EDThelp
X    	at COL_8 1
X    	'/usr/local/images/edtkeys.ras'
X    end_label
X    
X    choice helplabel
X        at COL_5 ROW_1
X        display cycle
X        label " help:"
X        "ANU News"	{remove EDThelp; display NEWShelp;}
X        "EDT"		{remove NEWShelp; display EDThelp;}
X    end_choice
X
Xend_gadgets
END_OF_FILE
if test 3707 -ne `wc -c <'samples/vt100/vt102tool.tt'`; then
    echo shar: \"'samples/vt100/vt102tool.tt'\" unpacked with wrong size!
fi
# end of 'samples/vt100/vt102tool.tt'
fi
if test -f 'samples/vt100/vtem.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'samples/vt100/vtem.c'\"
else
echo shar: Extracting \"'samples/vt100/vtem.c'\" \(4952 characters\)
sed "s/^X//" >'samples/vt100/vtem.c' <<'END_OF_FILE'
X/*
X * vtem - A termcap driven VT100 emulator for BSD Unix
X *
X * $Header: /home/src/local/vttool/vtem.c,v 1.2 89/02/07 14:20:13 jqj Exp $
X *
X * Public domain software.
X * Written by Leif Samuelsson (lsamuelsson@erisun) in December, 1985
X * 
X * History:
X *
X * $Log:	vtem.c,v $
X * Revision 1.2  89/02/07  14:20:13  jqj
X * Major revision of vtem to support more complete VT100 emulation.  Most
X * changes are to out.c.  Changes to this module include:
X * 1/ get termcap data before setupterm() so that TI gets called properly
X *    (needed for Sun cmdtool to turn off scroll bar).
X * 2/ support for varying TERM values (this may be a bad idea since old copies
X *    of /etc/termcap did not include a vt102 entry).
X * 
X * 1988-02-10	Version 1.1+gnu1+bgb - added ability to pass parameters
X *		to the shell process
X *
X * 1987-07-01	Version 1.1+gnu1.  Bug fixes for setting tabs in column
X *		81 (crashes when you run 'reset'), and for setting the
X *		environment variables TERM and TERMCAP.
X *
X * 1986-04-25	Version 1.1 posted to net.sources. This version contains
X *		bug fixes and some new code for simulating semi-graphics.
X *
X * 1986-01-30	Version 1.0 posted to mod.sources
X */
X
X#include "vtem.h"
X#include <sys/wait.h>
X#include <sys/param.h>
X
Xint master, slave, child;
Xchar linec, linen;
Xchar	arg_list[NCARGS];
Xchar	*Argv[4];
X
X/* suggestion from Marcus Moehrmann <marcus@fkihh.UUCP>
X   so this works witn SunOS 3.0 */
X#ifdef SUN30
X#define putenv(STRING) 1
X#endif
X
Xdone()
X{
Xunion wait status;
X
X	if (wait3(&status, WNOHANG, 0) != child)
X		return;
X	setupterm(0);
X	exit(0);
X}
X
Xmain(argc, argv)
X	int             argc;
X	char          **argv;
X{
X    int	i;
X    /* allocate enough space for the argument list */
X    /* - that is - Argv                            */
X    /* reserve two  parameters for the begining    */
X    /* first = tail of shell                       */
X    /* second = "-i"  -> interactive mode          */
X    /* third  = "-c"  -> argument list is command  */
X    /* forth - the string with one or more arguments */
X    /* NOTE - args 3 and 4 may be nil              */
X
X
X/* Argv[0] will be filled in later -see use of the tail variable */
X    if ( argc > 1 ) /* then we have to pass arguments to a subshell */ {
X	Argv[1] = "-c";
X	Argv[2] = arg_list;
X	for (i=1;i<argc;i++) {
X	    strcat(arg_list,*(argv+i)); strcat(arg_list," ");
X	}
X	Argv[3] = (char *) 0;
X    } else {
X	Argv[1] = "-i";
X	Argv[2] = (char *) 0;
X    }
X
X	/* Start three processes, one for input, one for output
X         * and one shell.
X         */
X	setup_master();
X	gettermtype();		/* do this before setupterm! */
X	setupterm(TRUE);
X	signal(SIGCHLD, done);
X	if (child = fork())
X	    handle_input();
X	else {
X	    if (fork())
X		handle_output();
X	    else
X		start_shell();
X	}
X}
X
Xhandle_input()
X{
Xchar buf[BUFSIZ];
Xint i;
X
X	while (i = read(0, buf, BUFSIZ))
X		write(master, buf, i);
X	setupterm(0);
X	exit(0);
X}
X
X
Xstart_shell()
X{
Xint t;
Xchar *term, *getenv(), *shell, *tail, *rindex();
X
X	switch (vttype) {
X	    case VT52:	term = "TERM=vt52"; break;
X	    default:
X	    case VT100:	term = "TERM=vt100"; break;
X	    case VT102:	term = "TERM=vt102"; break;
X	}
X	if (0 != putenv(term))
X		fprintf(stderr, "Set terminal type to \"%s\" manually.\r\n",
X			term);
X	term = getenv("TERMCAP");
X	if (term && term[0] != '/') {
X		/* TERMCAP contains a termcap entry for the old terminal
X		 * type.  Kill it.  We would not have to do this if termcap
X		 * didn't have the bug that if TERMCAP is specified and
X		 * the TERM value is not found in it, /etc/termcap is not
X		 * searched.
X		 */
X		if (0 != putenv("TERMCAP="))
X			fprintf(stderr, "Unset TERMCAP manually.\r\n");
X	}
X			
X	/* Then fork the shell
X	 */
X	if ((shell = getenv("SHELL")) == (char *) 0)
X	    shell = "/bin/sh";
X	if ((tail = rindex(shell, '/')) == (char *) 0)
X	    tail = "sh";
X	else
X	    tail++;
X	if ((t = open("/dev/tty", 2)) >= 0) {
X	    ioctl(t, TIOCNOTTY, (char *)0);
X	    close(t);
X	}
X	setup_slave();
X	close(master);
X	dup2(slave, 0);
X	dup2(slave, 1);
X	dup2(slave, 2);
X	close(slave);
X/* now construct an array for exec */
X        Argv[0] = tail;
X        execv(shell, Argv );
X	perror(shell);
X	fail();
X}
X
Xfail()
X{
X	kill(0, SIGTERM);
X	setupterm(0);
X	exit(0);
X}
X
X
Xsetup_master()
X{
Xchar line[11];
X
X    for (linec = 'p'; linec <= 's'; linec++) {
X	sprintf(line, "/dev/pty%c0", linec);
X	if (access(line, 0) != 0)
X	    break;
X	for (linen = 0; linen < 16; linen++) {
X	    sprintf(line, "/dev/pty%c%1x", linec, linen);
X	    master = open(line, 2);
X	    if (master >= 0) {
X		return;
X	    }
X	}
X    }
X    fprintf(stderr, "Can't find a pty\n");
X    fail();
X}
X
Xsetup_slave()
X{
Xchar line[11];
X
X    sprintf(line, "/dev/tty%c%1x", linec, linen);
X    slave = open(line, 2);
X    if (slave < 0) {
X	perror(line);
X	fail();
X    }
X    ioctl(slave, TIOCSETP, (char *)&oldb);
X    ioctl(slave, TIOCSETC, (char *)&oldtchars);
X    ioctl(slave, TIOCSLTC, (char *)&oldltchars);
X    ioctl(slave, TIOCLSET, (char *)&oldlb);
X    ioctl(slave, TIOCSETD, (char *)&oldl);
X}
END_OF_FILE
if test 4952 -ne `wc -c <'samples/vt100/vtem.c'`; then
    echo shar: \"'samples/vt100/vtem.c'\" unpacked with wrong size!
fi
# end of 'samples/vt100/vtem.c'
fi
if test -f 'symbols.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'symbols.c'\"
else
echo shar: Extracting \"'symbols.c'\" \(3946 characters\)
sed "s/^X//" >'symbols.c' <<'END_OF_FILE'
X/************************************************************************/
X/*	Copyright 1988 by Chuck Musciano and Harris Corporation		*/
X/*									*/
X/*	Permission to use, copy, modify, and distribute this software	*/
X/*	and its documentation for any purpose and without fee is	*/
X/*	hereby granted, provided that the above copyright notice	*/
X/*	appear in all copies and that both that copyright notice and	*/
X/*	this permission notice appear in supporting documentation, and	*/
X/*	that the name of Chuck Musciano and Harris Corporation not be	*/
X/*	used in advertising or publicity pertaining to distribution	*/
X/*	of the software without specific, written prior permission.	*/
X/*	Chuck Musciano and Harris Corporation make no representations	*/
X/*	about the suitability of this software for any purpose.  It is	*/
X/*	provided "as is" without express or implied warranty.		*/
X/*									*/
X/*	The sale of any product based wholely or in part upon the 	*/
X/*	technology provided by tooltool is strictly forbidden without	*/
X/*	specific, prior written permission from Harris Corporation.	*/
X/*	Tooltool technology includes, but is not limited to, the source	*/
X/*	code, executable binary files, specification language, and	*/
X/*	sample specification files.					*/
X/************************************************************************/
X
X#include	<stdio.h>
X#include	<ctype.h>
X#include	<sys/types.h>
X#include	<sys/dir.h>
X#include	<pwd.h>
X
X#include	<suntool/sunview.h>
X#include	<suntool/icon_load.h>
X
X#include	"tooltool.h"
X
XPRIVATE	s_ptr	symbols = NULL;
X
X/************************************************************************/
XPRIVATE	s_ptr	create_symbol(name, sp)
X
Xchar	*name;
Xs_ptr	*sp;
X
X{
X	while (*sp)
X	   if (strcmp(name, (*sp)->name) < 0)
X	      sp = &((*sp)->left);
X	   else
X	      sp = &((*sp)->right);
X	*sp = (s_ptr) safe_malloc(sizeof(s_data));
X	(*sp)->name = strsave(name);
X	(*sp)->kind = SYMBOL_SYMBOL;
X	(*sp)->gadget = NULL;
X	(*sp)->dialog = NULL;
X	(*sp)->left = NULL;
X	(*sp)->right = NULL;
X	(*sp)->value = (v_ptr) safe_malloc(sizeof(v_data));
X	(*sp)->value->kind = V_NOTHING;
X	(*sp)->value->number = 0.0;
X	(*sp)->value->str = "";
X	(*sp)->value->value = NULL;
X	(*sp)->value->left = NULL;
X	(*sp)->value->right = NULL;
X	(*sp)->value->index = NULL;
X	return(*sp);
X}
X	
X/************************************************************************/
XEXPORT	s_ptr	tt_find_symbol(name)
X
Xchar	*name;
X
X{	s_ptr	s;
X	int	i;
X
X	for (s = symbols; s; )
X	   if ((i = strcmp(name, s->name)) == 0)
X	      break;
X	   else if (i < 0)
X	      s = s->left;
X	   else
X	      s = s->right;
X	if (s == NULL)
X	   s = create_symbol(name, &symbols);
X	return(s);
X}
X
X/************************************************************************/
XEXPORT	v_ptr	tt_get_value(s)
X
Xs_ptr	s;
X
X{	v_ptr	v;
X	static	char	buf[20];
X
X	if (s == NULL)
X	   return(NULL);
X	else if (s->kind == SYMBOL_SYMBOL)
X	   return(s->value);
X	else if (s->kind == SYMBOL_DIALOG)
X	   abend("attempted to get value of dialog box %s", s->name);
X	else {
X	   switch (s->gadget->kind) {
X	      case GADGET_TEXT   : v = tt_string_result(panel_get(s->gadget->panel_item, PANEL_VALUE));
X	   			   break;
X	      case GADGET_CHOICE : 
X	      case GADGET_SLIDER : v = tt_int_result(panel_get(s->gadget->panel_item, PANEL_VALUE));
X	   			   break;
X/*	      case GADGET_LABEL  : v = tt_string_result(panel_get(s->gadget->panel_item, PANEL_LABEL_STRING));
X	      			   break;*/
X	      default		 : v = tt_int_result(0);
X	      }
X	   v->kind |= V_GADGET;
X	   v->gadget = s->gadget;
X	   return(v);
X	   }
X}
X
X/************************************************************************/
XEXPORT	tt_make_intrinsic_symbols()
X
X{	s_ptr	interval;
X
X	tt_mouse_x = tt_find_symbol("mouse_x");
X	tt_mouse_y = tt_find_symbol("mouse_y");
X	interval = tt_find_symbol("interval");
X	interval->value->kind |= V_INTERVAL;
X	tt_delimiters = tt_find_symbol("delimiters");
X	tt_delimiters->value->kind = 0;
X	tt_delimiters->value->str = " \t\n\r\"'";
X}
END_OF_FILE
if test 3946 -ne `wc -c <'symbols.c'`; then
    echo shar: \"'symbols.c'\" unpacked with wrong size!
fi
# end of 'symbols.c'
fi
echo shar: End of archive 2 \(of 13\).
cp /dev/null ark2isdone
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


Chuck Musciano			ARPA  : chuck@trantor.harris-atd.com
Harris Corporation 		Usenet: ...!uunet!x102a!trantor!chuck
PO Box 37, MS 3A/1912		AT&T  : (407) 727-6131
Melbourne, FL 32902		FAX   : (407) 727-{5118,5227,4004}


