Check-in [6f5109a8b4]
Overview
SHA1:6f5109a8b400c784a762915195f72f8ad9be727c
Date: 2011-09-09 13:30:21
User: rkeene
Comment:Added ctk project
Timelines: family | ancestors | descendants | both | trunk
Downloads: Tarball | ZIP archive
Other Links: files | file ages | folders | manifest
Tags And Properties
Context
2011-09-09
13:45
[e327ead7cb] Updated to produce libctk.so (user: rkeene, tags: trunk)
13:30
[6f5109a8b4] Added ctk project (user: rkeene, tags: trunk)
13:30
[a5ca606bbf] initial empty check-in (user: rkeene, tags: trunk)
Changes

Added Makefile.in version [41aed597d9].

            1  +#
            2  +# This file is a Makefile for CTk.  If it has the name "Makefile.in"
            3  +# then it is a template for a Makefile;  to generate the actual Makefile,
            4  +# run "./configure", which is a configuration script generated by the
            5  +# "autoconf" program (constructs like "@foo@" will get replaced in the
            6  +# actual Makefile.
            7  +#
            8  +# @(#) $Id: ctk.shar,v 1.50 1996/01/15 14:47:16 andrewm Exp andrewm $
            9  +
           10  +# Current CTk version;  used in various names.
           11  +
           12  +VERSION = 8.0
           13  +
           14  +#----------------------------------------------------------------
           15  +# Things you can change to personalize the Makefile for your own
           16  +# site (you can make these changes in either Makefile.in or
           17  +# Makefile, but changes to Makefile will get lost if you re-run
           18  +# the configuration script).
           19  +#----------------------------------------------------------------
           20  +
           21  +# Default top-level directories in which to install architecture-
           22  +# specific files (exec_prefix) and machine-independent files such
           23  +# as scripts (prefix).  The values specified here may be overridden
           24  +# at configure-time with the --exec-prefix and --prefix options
           25  +# to the "configure" script.
           26  +
           27  +prefix =	@prefix@
           28  +exec_prefix =	@exec_prefix@
           29  +
           30  +# The following definition can be set to non-null for special systems
           31  +# like AFS with replication.  It allows the pathnames used for installation
           32  +# to be different than those used for actually reference files at
           33  +# run-time.  INSTALL_ROOT is prepended to $prefix and $exec_prefix
           34  +# when installing files.
           35  +INSTALL_ROOT =
           36  +
           37  +# Directory from which applications will reference the library of Tcl
           38  +# scripts (note: you can set the CTK_LIBRARY environment variable at
           39  +# run-time to override the compiled-in location):
           40  +CTK_LIBRARY =		$(prefix)/lib/ctk$(VERSION)
           41  +
           42  +# Path name to use when installing library scripts:
           43  +SCRIPT_INSTALL_DIR =	$(INSTALL_ROOT)$(CTK_LIBRARY)
           44  +
           45  +# Directory in which to install the archive libctk.a:
           46  +LIB_INSTALL_DIR =	$(INSTALL_ROOT)$(exec_prefix)/lib
           47  +
           48  +# Directory in which to install the program cwish:
           49  +BIN_INSTALL_DIR =	$(INSTALL_ROOT)$(exec_prefix)/bin
           50  +
           51  +# Directory from which the program cwish should be referenced by scripts:
           52  +BIN_DIR =		$(exec_prefix)/bin
           53  +
           54  +# Directory in which to install the include file ctk.h:
           55  +INCLUDE_INSTALL_DIR =	$(INSTALL_ROOT)$(prefix)/include
           56  +
           57  +# Top-level directory for manual entries:
           58  +MAN_INSTALL_DIR =	$(INSTALL_ROOT)$(prefix)/man
           59  +
           60  +# Directory in which to install manual entry for cwish:
           61  +MAN1_INSTALL_DIR =	$(MAN_INSTALL_DIR)/man1
           62  +
           63  +# Libraries to use when linking:  must include at least the
           64  +# appropriate version of Tcl for this version of CTk, curses,
           65  +# and the math library (in that order).  It is (hopefully) filled
           66  +# in properly by the configure script.
           67  +LIBS = @LIBS@
           68  +
           69  +# To change the compiler switches, for example to change from -O
           70  +# to -g, change the following line:
           71  +CFLAGS = -O
           72  +
           73  +# Linker options (-L/.../lib) necessary to find the TCL
           74  +# and curses libraries (if any).  It is (hopefully) filled in
           75  +# properly by the configure script.
           76  +LDFLAGS =		@LDFLAGS@
           77  +
           78  +# Preprocessor options (-I/.../include) necessary to find the TCL
           79  +# and curses header files (if any).  It is (hopefully) filled in
           80  +# properly by the configure script.
           81  +CPPFLAGS =		@CPPFLAGS@
           82  +
           83  +# Preprocessor definitions.  It should be filled in properly by the
           84  +# configure script, but if configure did not find the curses library
           85  +# then you may have to add some definitions by hand.  The curses
           86  +# definitions are:
           87  +#
           88  +#   -DUSE_NCURSES_H=1	Curses include file is called "ncurses.h"
           89  +#   -DHAVE_CURS_SET=1	Curses package supports the curs_set() function
           90  +#   -DHAVE_SET_TERM=1	Curses package supports the set_term() function
           91  +#   -DHAVE_BEEP=1	Curses package supports the beep() function
           92  +#   -DHAVE_KEYPAD=1	Curses package supports the keypad() function
           93  +AC_FLAGS =		@DEFS@
           94  +
           95  +# To turn off the security checks that disallow incoming sends when
           96  +# the X server appears to be insecure, reverse the comments on the
           97  +# following lines:
           98  +SECURITY_FLAGS =
           99  +#SECURITY_FLAGS = -DTK_NO_SECURITY
          100  +
          101  +# To disable ANSI-C procedure prototypes reverse the comment characters
          102  +# on the following lines:
          103  +PROTO_FLAGS =
          104  +#PROTO_FLAGS = -DNO_PROTOTYPE
          105  +
          106  +# To enable memory debugging reverse the comment characters on the following
          107  +# lines.  Warning:  if you enable memory debugging, you must do it
          108  +# *everywhere*, including all the code that calls Tcl, and you must use
          109  +# ckalloc and ckfree everywhere instead of malloc and free.
          110  +MEM_DEBUG_FLAGS =
          111  +#MEM_DEBUG_FLAGS = -DTCL_MEM_DEBUG
          112  +
          113  +# Some versions of make, like SGI's, use the following variable to
          114  +# determine which shell to use for executing commands:
          115  +SHELL =		/bin/sh
          116  +
          117  +# CTk used to let the configure script choose which program to use
          118  +# for installing, but there are just too many different versions of
          119  +# "install" around;  better to use the install-sh script that comes
          120  +# with the distribution, which is slower but guaranteed to work.
          121  +
          122  +INSTALL = @srcdir@/install-sh -c
          123  +
          124  +#----------------------------------------------------------------
          125  +# The information below is modified by the configure script when
          126  +# Makefile is generated from Makefile.in.  You shouldn't normally
          127  +# modify any of this stuff by hand.
          128  +#----------------------------------------------------------------
          129  +
          130  +INSTALL_PROGRAM =	@INSTALL_PROGRAM@
          131  +INSTALL_DATA =		@INSTALL_DATA@
          132  +RANLIB =		@RANLIB@
          133  +SRC_DIR =		@srcdir@
          134  +VPATH =			@srcdir@
          135  +
          136  +#----------------------------------------------------------------
          137  +# The information below should be usable as is.  The configure
          138  +# script won't modify it and you shouldn't need to modify it
          139  +# either.
          140  +#----------------------------------------------------------------
          141  +
          142  +
          143  +CC =		@CC@
          144  +CC_SWITCHES =	${CFLAGS} ${CPPFLAGS} -I${SRC_DIR} \
          145  +${AC_FLAGS} ${PROTO_FLAGS} ${SECURITY_FLAGS} ${MEM_DEBUG_FLAGS} \
          146  +-DCTK_LIBRARY=\"${CTK_LIBRARY}\"
          147  +
          148  +WIDGOBJS = tkButton.o tkEntry.o tkFrame.o tkListbox.o \
          149  +	tkMenu.o tkMenubutton.o tkScrollbar.o
          150  +
          151  +TEXTOBJS = tkText.o tkTextBTree.o tkTextDisp.o tkTextIndex.o \
          152  +	tkTextMark.o tkTextTag.o
          153  +
          154  +OBJS = ctkDisplay.o ctkRegion.o tkAppInit.o tkArgv.o tkBind.o tkCmds.o \
          155  +	tkConfig.o tkFocus.o tkFont.o tkGeometry.o tkGet.o \
          156  +	tkMain.o tkOption.o tkPack.o tkPlace.o tkPreserve.o tkUtil.o \
          157  +	tkWindow.o tkXEvent.o \
          158  +	$(WIDGOBJS) $(TEXTOBJS)
          159  +
          160  +SRCS = ctkDisplay.c ctkRegion.c tkAppInit.c tkArgv.c tkBind.c tkButton.c \
          161  +	tkCmds.c tkConfig.c tkEntry.c tkFocus.c tkFont.c tkFrame.c \
          162  +	tkGeometry.c tkGet.c tkListbox.c tkMain.c tkMenu.c tkMenubutton.c \
          163  +	tkOption.c tkPack.c tkPlace.c tkPreserve.c tkScrollbar.c tkText.c \
          164  +	tkTextBTree.c tkTextDisp.c tkTextIndex.c tkTextMark.c tkTextTag.c \
          165  +	tkUtil.c tkWindow.c tkXEvent.c
          166  +
          167  +HDRS = default.h keyCodes.h ks_names.h patchlevel.h tk.h tkInt.h \
          168  +	tkPort.h tkText.h
          169  +
          170  +DEMOPROGS = widget
          171  +
          172  +all: libctk.a cwish$(VERSION)
          173  +
          174  +libctk.a: $(OBJS)
          175  +	rm -f libctk.a
          176  +	ar cr libctk.a $(OBJS)
          177  +	$(RANLIB) libctk.a
          178  +
          179  +cwish$(VERSION): tkAppInit.o libctk.a
          180  +	$(CC) $(CC_SWITCHES) tkAppInit.o libctk.a $(LDFLAGS) $(LIBS) -o cwish$(VERSION)
          181  +
          182  +configInfo: Makefile
          183  +	@rm -f configInfo
          184  +	@echo "# Definitions and libraries needed to build Tk applications" >> configInfo
          185  +	@echo "# (generated by the configure script):" >> configInfo
          186  +	@echo "TK_CC_SWITCHES = ${AC_FLAGS} ${MEM_DEBUG_FLAGS}" >> configInfo
          187  +	@echo "TK_LIBS = @LIBS@" >> configInfo
          188  +
          189  +install: install-binaries install-libraries install-demos install-man
          190  +
          191  +install-binaries: libctk.a cwish$(VERSION)
          192  +	@for i in $(LIB_INSTALL_DIR) $(BIN_INSTALL_DIR) ; \
          193  +	    do \
          194  +	    if [ ! -d $$i ] ; then \
          195  +		echo "Making directory $$i"; \
          196  +		mkdir $$i; \
          197  +		chmod 755 $$i; \
          198  +		else true; \
          199  +		fi; \
          200  +	    done;
          201  +	@echo "Installing libctk.a"
          202  +	@$(INSTALL_DATA) libctk.a $(LIB_INSTALL_DIR)
          203  +	@$(RANLIB) $(LIB_INSTALL_DIR)/libctk.a
          204  +	@echo "Installing cwish$(VERSION)"
          205  +	@$(INSTALL_PROGRAM) cwish$(VERSION) $(BIN_INSTALL_DIR)
          206  +
          207  +install-libraries:
          208  +	@for i in $(INSTALL_ROOT)$(prefix)/lib $(INCLUDE_INSTALL_DIR) \
          209  +		$(SCRIPT_INSTALL_DIR) ; \
          210  +	    do \
          211  +	    if [ ! -d $$i ] ; then \
          212  +		echo "Making directory $$i"; \
          213  +		mkdir $$i; \
          214  +		chmod 755 $$i; \
          215  +		else true; \
          216  +		fi; \
          217  +	    done;
          218  +	@echo "Installing ctk.h"
          219  +	@$(INSTALL_DATA) $(SRC_DIR)/tk.h $(INCLUDE_INSTALL_DIR)/ctk.h
          220  +	for i in $(SRC_DIR)/library/*.tcl $(SRC_DIR)/library/tclIndex; \
          221  +	    do \
          222  +	    echo "Installing $$i"; \
          223  +	    $(INSTALL_DATA) $$i $(SCRIPT_INSTALL_DIR); \
          224  +	    done;
          225  +
          226  +install-demos:
          227  +	@for i in $(INSTALL_ROOT)$(prefix)/lib $(SCRIPT_INSTALL_DIR) \
          228  +		$(SCRIPT_INSTALL_DIR)/demos; \
          229  +	    do \
          230  +	    if [ ! -d $$i ] ; then \
          231  +		echo "Making directory $$i"; \
          232  +		mkdir $$i; \
          233  +		chmod 755 $$i; \
          234  +		else true; \
          235  +		fi; \
          236  +	    done;
          237  +	@cd $(SRC_DIR)/library/demos; for i in *; \
          238  +	    do \
          239  +	    if [ -f $$i ] ; then \
          240  +		echo "Installing library/demos/$$i"; \
          241  +		sed -e '1 s|/usr/local/bin/cwish|$(BIN_DIR)/cwish$(VERSION)|' \
          242  +			$$i > $(SCRIPT_INSTALL_DIR)/demos/$$i; \
          243  +	    fi; \
          244  +	    done;
          245  +	@for i in $(DEMOPROGS); \
          246  +	    do \
          247  +	    chmod 755 $(SCRIPT_INSTALL_DIR)/demos/$$i; \
          248  +	    done;
          249  +
          250  +install-man:
          251  +	@for i in $(MAN_INSTALL_DIR) $(MAN1_INSTALL_DIR); \
          252  +	    do \
          253  +	    if [ ! -d $$i ] ; then \
          254  +		echo "Making directory $$i"; \
          255  +		mkdir $$i; \
          256  +		chmod 755 $$i; \
          257  +		else true; \
          258  +		fi; \
          259  +	    done;
          260  +	@for i in *.1; \
          261  +	    do \
          262  +	    echo "Installing doc/$$i"; \
          263  +	    $(INSTALL_DATA) $$i $(MAN1_INSTALL_DIR); \
          264  +	    done;
          265  +
          266  +Makefile: $(SRC_DIR)/Makefile.in
          267  +	$(SHELL) config.status
          268  +
          269  +clean:
          270  +	rm -f *.a *.o core errs *~ \#* TAGS *.E a.out errors tktest cwish$(VERSION) \
          271  +		config.info
          272  +
          273  +distclean: clean
          274  +	rm -f Makefile config.status
          275  +
          276  +depend:
          277  +	makedepend -- $(CC_SWITCHES) -- $(SRCS)
          278  +
          279  +.c.o:
          280  +	$(CC) -c $(CC_SWITCHES) $<
          281  +
          282  +#
          283  +# Target to check for proper usage of UCHAR macro.
          284  +#
          285  +
          286  +checkuchar:
          287  +	-egrep isalnum\|isalpha\|iscntrl\|isdigit\|islower\|isprint\|ispunct\|isspace\|isupper\|isxdigit $(SRCS) | grep -v UCHAR
          288  +
          289  +#
          290  +# Target to make sure that only symbols with "Tk" or "Ctk" prefixes are
          291  +# exported.
          292  +#
          293  +
          294  +checkexports: libctk.a
          295  +	-nm -p libctk.a | awk '$$2 ~ /[TDB]/ { print $$3 }' | sort -n | grep -v '^[Cc]?[Tt]k'
          296  +
          297  +#
          298  +# Target to create a proper Tk distribution from information in the
          299  +# master source directory.  DISTDIR must be defined to indicate where
          300  +# to put the distribution.
          301  +#
          302  +
          303  +configure: configure.in
          304  +	autoconf
          305  +dist:   configure
          306  +	rm -rf $(DISTDIR)
          307  +	mkdir $(DISTDIR)
          308  +	cp license.terms Makefile.in $(DISTDIR)
          309  +	chmod 664 $(DISTDIR)/Makefile.in
          310  +	cp -p $(SRCS) $(HDRS) $(DISTDIR)
          311  +	mkdir $(DISTDIR)/compat
          312  +	cp -p license.terms compat/unistd.h compat/stdlib.h $(DISTDIR)/compat
          313  +	cp -p README README.TERM ToDo changes porting.notes *.1 $(DISTDIR)
          314  +	cp -p configure configure.in install-sh $(DISTDIR)
          315  +	chmod 775 $(DISTDIR)/configure $(DISTDIR)/configure.in
          316  +	chmod +x $(DISTDIR)/install-sh
          317  +	mkdir $(DISTDIR)/library
          318  +	cp -p license.terms library/*.tcl library/tclIndex $(DISTDIR)/library
          319  +	mkdir $(DISTDIR)/library/demos
          320  +	cp -pr library/demos/widget library/demos/README \
          321  +		license.terms $(DISTDIR)/library/demos
          322  +
          323  +mci_args:
          324  +	@echo ctk README README.TERM ToDo changes porting.notes license.terms \
          325  +		Makefile.in configure.in install-sh \
          326  +		$(SRCS) $(HDRS) compat library
          327  +		
          328  +# DO NOT DELETE THIS LINE -- make depend depends on it.

Added README version [0ea106f566].

            1  +The CTk Toolkit
            2  +
            3  +by Martin Andrews
            4  +andrewm@ccfadm.eeg.ccf.org
            5  +
            6  +@(#) $Id: ctk.shar,v 1.50 1996/01/15 14:47:16 andrewm Exp andrewm $
            7  +
            8  +1. Introduction
            9  +----------------
           10  +
           11  +This directory contains the sources for CTk, a curses port of John
           12  +Ousterhout's Tk toolkit for X11.  The information here corresponds to
           13  +CTk 4.0.  CTk 4.0 is based on Tk 4.0p3. Like Tk 4.0p3, it is designed
           14  +to work with Tcl 7.4p3 and may not work with other releases of Tcl.
           15  +
           16  +Using CTk, applications with a modern GUI-ish interface can be created
           17  +for character terminals.  These same applications, without modification,
           18  +can provide a real GUI interface by using Tk.  Thus, sites with an
           19  +embedded base of character terminals (and a small capital budget) can
           20  +smoothly migrate to GUI applications.
           21  +
           22  +2. Documentation
           23  +----------------
           24  +
           25  +There is a man page for cwish (cwish(1)) explaining execution options
           26  +for the CTk shell.  For script writing, the Tk Documentation, along with the
           27  +list of differences in section 5 of this document should be enough to get
           28  +started.
           29  +
           30  +3. Compiling and installing CTk
           31  +-------------------------------
           32  +
           33  +CTk requires TCL and a System V curses package (CTk will build
           34  +with BSD curses but has at least one display glitch and many
           35  +missing features - see porting.notes for more information).
           36  +Unlike Tk, you do not need the source for Tcl to build CTk.
           37  +Only the Tcl 7.4 library and include file (tcl.h) are necessary.
           38  +If your system does not have a System V compatible curses,
           39  +there is a free version, ncurses, available in GNU archives
           40  +(for instance ftp://prep.ai.mit.edu/pub/gnu).
           41  +
           42  +CTk builds cleanly on the three systems I have easy access to:
           43  +
           44  +    486 PC running Linux 1.1.54 using gcc 2.58 and ncurses 1.8.5
           45  +
           46  +    HP 9000/835 running HP-UX 9.04 using optional ANSI C compiler and
           47  +    ncurses 1.8.6 or using K&R C compiler and hp curses (old system V,
           48  +    not very pretty)
           49  +
           50  +    Sun 4c running Sun OS 4.13 using System V compiler (/usr/5bin/cc)
           51  +    and System V curses
           52  +
           53  +Perform the following steps to compile and install CTk:
           54  +
           55  +    (a) Type "./configure" in this directory.  This runs a configuration
           56  +	script created by GNU autoconf, which configures CTk for your
           57  +	system and creates a Makefile.  If you are using ncurses, and
           58  +	the library is named "libncurses" instead of "libcurses" give
           59  +	the "-with-ncurses" option to configure.  Also, if Tcl or curses
           60  +	are not installed in the standard search path, you can use
           61  +	"-with-libdirs=" and "-with-incdirs=" to add directories to
           62  +	the library and header search path, respectively (use the
           63  +	directives once, the argument can be a list of space separated
           64  +	directories).  For more details on using configure, check out
           65  +	the autoconf documentation (not included here).
           66  +
           67  +    (b) Type "make".  This will create a library archive called "libctk.a"
           68  +	and an interpreter application called "cwish" that allows you to type
           69  +	Tcl commands interactively or execute script files.
           70  +
           71  +    (c) If the make fails then you'll have to personalize the Makefile
           72  +        for your site or possibly modify the distribution in other ways.
           73  +	First check the file "porting.notes" to see if there are hints
           74  +	for compiling on your system.  If you need to modify Makefile,
           75  +	there are comments at the beginning of it that describe the things
           76  +	you might want to change and how to change them.
           77  +	
           78  +    (d) Type "make install" to install CTk's binaries and script files in
           79  +        standard places.  In the default configuration, information will
           80  +	be installed in /usr/local so you'll need write permission on
           81  +	this directory.  If you'd like to use a default installation
           82  +	directory, you can change the "exec_prefix" and "prefix" definitions
           83  +	in the Makefile.
           84  +
           85  +    (e) At this point you can play with Tcl by invoking the "cwish"
           86  +	program and typing Tcl commands.  However, if you haven't installed
           87  +	CTk then you'll first need to set your CTK_LIBRARY environment
           88  +	variable to hold the full path name of the "library" subdirectory.
           89  +
           90  +I am interested in receiving information on changes required to
           91  +build CTk on your platform.
           92  +
           93  +4. Test suite
           94  +-------------
           95  +
           96  +Next release.  (Really.)
           97  +
           98  +5. Getting started
           99  +------------------
          100  +
          101  +It is now easy to run cwish interactively.  If you have not
          102  +installed cwish set the CTK_LIBRARY environment variable to
          103  +the path of the library directory, then try:
          104  +
          105  +    cwish
          106  +
          107  +This will start cwish, and then pop-up a command dialog window where
          108  +you can enter TCL commands.  You can bring up this dialog at any time
          109  +by pressing <Control-C>.
          110  +
          111  +You can also try out a simple demo of the cwish widgets with:
          112  +
          113  +    cwish library/demos/stuff
          114  +
          115  +There are other demos in the library/demos directory including a
          116  +crude port of the Tk widget demo (warning it is easy for the focus
          117  +to get lost - if so press Ctrl+C to get the command dialog and
          118  +type "exit" there).
          119  +
          120  +Key bindings are very nearly the same as for Tk (which is very nearly
          121  +the same as Motif).  This may be unfamiliar to people used to common
          122  +Unix curses applications (elm, lynx, ..).  I decided to stick with the
          123  +Tk binding for two reasons:
          124  +
          125  +1)  Less confusion for users that switch between Tk and CTk
          126  +    versions of an application.
          127  +
          128  +2)  Easier to incorporate updates from Tk.
          129  +
          130  +Here is a quick summary of the key bindings for those unfamiliar
          131  +with Motif (or Microsoft Windows):
          132  +
          133  +    <Space> activates/selects a widget
          134  +    <Tab> moves focus to next the widget
          135  +    <Shift-Tab> moves focus to the prior widget
          136  +    <Return> activates the default button in a dialog
          137  +    Arrow keys move the cursor within a widget
          138  +    <F10> moves focus to the first menu
          139  +    <Escape> closes a menu without making a selection
          140  +
          141  +Your terminal or terminfo entry may not support all the keys (like
          142  +<Shift-Tab>).  See README.TERM for tips on configuring terminfo
          143  +entries for CTk.
          144  +
          145  +6. Summary of differences between CTk 4.0b1 and Tk 4.0
          146  +--------------------------------------------------------
          147  +
          148  +The following commands are not available in CTk:
          149  +
          150  +    canvas
          151  +    clipboard
          152  +    message
          153  +    image
          154  +    scale
          155  +    selection
          156  +    send
          157  +
          158  +The wm command is severely crippled.
          159  +
          160  +None of the widgets support the scan method.
          161  +
          162  +The text widget does not support tag bindings: "text tag bind".
          163  +
          164  +The text widget does not support embedded windows "text window".
          165  +
          166  +The -tearoff option for menu widgets can create a tearoff entry,
          167  +but the entry doesn't work (and I don't know if there is any point
          168  +in making it work).
          169  +
          170  +Many configuration options (like -background and -foreground) cannot
          171  +be modified.  Attempts to set the unsupported options will silently
          172  +be ignored.  Querying the options with cget will return a fixed
          173  +?reasonable? value.  The unsupported options are:
          174  +
          175  +    -activebackground
          176  +    -activeborderwidth
          177  +    -activerelief
          178  +    -background
          179  +    -bg
          180  +    -bitmap
          181  +    -borderwidth (supported by widgets, not by text tags)
          182  +    -colormap
          183  +    -cursor
          184  +    -disabledforeground
          185  +    -exportselection
          186  +    -fg
          187  +    -font
          188  +    -foreground
          189  +    -highlightcolor
          190  +    -highlightbackground
          191  +    -highlightthickness
          192  +    -image
          193  +    -insertbackground
          194  +    -insertborderwidth
          195  +    -insertofftime
          196  +    -insertontime
          197  +    -insertwidth
          198  +    -indicatoron
          199  +    -jump
          200  +    -relief
          201  +    -repeatdelay
          202  +    -repeatinterval
          203  +    -screen
          204  +    -selectbackground
          205  +    -selectborderwidth
          206  +    -selectcolor
          207  +    -selectforeground
          208  +    -selectimage
          209  +    -setgrid
          210  +    -tearoff
          211  +    -troughcolor
          212  +    -visual
          213  +
          214  +And a lot more I forgot to mention.
          215  +
          216  +7. Support and bug fixes
          217  +------------------------
          218  +
          219  +Send bug reports and suggestions for improvements to:
          220  +
          221  +    Martin Andrews
          222  +    andrewm@ccfadm.eeg.ccf.org
          223  +
          224  +When reporting bugs, please provide a short cwish script that I can
          225  +use to reproduce the bug.  Make sure that the script runs with a
          226  +bare-bones cwish and doesn't depend on any extensions.  Also, please
          227  +include three additional pieces of information with the script:
          228  +
          229  +    (a) how do I use the script to make the problem happen (e.g.
          230  +	what keys do you press, in what order)?
          231  +    (b) what happens when you do these things (presumably this is
          232  +        undesirable)?
          233  +    (c) what did you expect to happen instead?
          234  +
          235  +For general problems with using Tk or Tcl, try posting to the
          236  +comp.lang.tcl Usenet newsgroup.
          237  +
          238  +8. Release organization
          239  +---------------------------
          240  +
          241  +Each CTk release is identified by two numbers separated by a dot, e.g.
          242  +3.2 or 3.3.  These numbers match the release number of the corresponding
          243  +Tk release.  Suffixes for alpha, beta, and patch releases (aX, bX, and pX
          244  +respectively) are numbered independent of Tk.

Added README.TERM version [df37418102].

            1  +README.TERM
            2  +		    Terminfo Notes for the CTk Toolkit
            3  +
            4  +This file contains hints for setting up terminfo entries for use with CTk.
            5  +It assumes the reader already understands how to write terminfo entries
            6  +(as much as anyone really understands this black art).  See the manual
            7  +page, terminfo(4), for general information on terminfo.
            8  +
            9  +@(#) $Id: ctk.shar,v 1.50 1996/01/15 14:47:16 andrewm Exp andrewm $
           10  +
           11  +Special Keys
           12  +------------
           13  +
           14  +CTk tries to map the curses key codes to X-11 keycodes and hence to
           15  +Tk key names.  This mapping (in reverse) is shown below:
           16  +
           17  +	Tk Name		Capname
           18  +	-------		-------
           19  +	BackSpace	kbs
           20  +	Begin		kbeg
           21  +	Cancel		kcan
           22  +	Clear		kclr
           23  +	Delete		kdch1
           24  +	Shift-Delete	kdl1
           25  +	Down		kcud1
           26  +	End		kend
           27  +	End		kfnd
           28  +	Control-End	kll
           29  +	Execute		kcmd
           30  +	F1		kf1
           31  +	F10		kf10
           32  +	F2		kf2
           33  +	F3		kf3
           34  +	F4		kf4
           35  +	F5		kf5
           36  +	F6		kf6
           37  +	F7		kf7
           38  +	F8		kf8
           39  +	F9		kf9
           40  +	Help		khlp
           41  +	Home		khome
           42  +	Insert		kich1
           43  +	Insert		kmir
           44  +	Shift-Insert	kil1
           45  +	Left		kcub1
           46  +	Menu		kopt
           47  +	Next		knp
           48  +	Pause		kspd
           49  +	Print		kprt
           50  +	Prior		kpp
           51  +	Redo		krdo
           52  +	Return		kent
           53  +	Right		kcuf1
           54  +	Select		kslt
           55  +	Tab		knxt
           56  +	Shift-Tab	kcbt
           57  +	Shift-Tab	kprv
           58  +	Undo		kund
           59  +	Up		kcuu1
           60  +
           61  +In addition the following special keys can be generated by control
           62  +keys (therefore, you cannot receive a <Control-h> event):
           63  +
           64  +	Tk Name		Control Key
           65  +	-------		-----------
           66  +	Backspace	<Control-H>
           67  +	Tab		<Control-I>
           68  +	Return		<Control-M>
           69  +
           70  +Other control keys are passed as the appropriate key press with the
           71  +Control Modifier set.
           72  +
           73  +
           74  +Display Attributes
           75  +------------------
           76  +
           77  +CTk uses the following terminfo display attributes: standout (the focus),
           78  +reverse (selected), underline (entry widgets), bold (button widgets),
           79  +and dim (inactive widgets).  CTk does not try to use combinations of
           80  +attributes (for example: bold-underline) so you do not need to
           81  +define the "sgr" capability.  If an attribute is not defined the item
           82  +is displayed as plain text.
           83  +
           84  +If possible, each of the attributes should have a unique appearance
           85  +(standout = bold is very bad, because a button will not change appearance
           86  +when it has the focus).  Following the ncurses recommendation that
           87  +standout should "represent a good, high contrast, easy-on-the-eyes,
           88  +format" I define standout as reverse-dim.
           89  +
           90  +
           91  +Custom CTk Terminfo Entries
           92  +---------------------------
           93  +
           94  +If you find that the terminal definition you want for CTk conflicts with
           95  +what you want normally.  You can create the CTk entry with an alternate
           96  +name (like vt100-tk) and then set the environment variable CTK_TERM
           97  +to this alternate entry.  CTK_TERM is by CTk in preference to the TERM
           98  +environment variable.

Added ToDo version [cca7cd243f].

            1  +This file contains a list of bugs to fix and minor feature changes
            2  +needed in the Tk toolkit.  The list is ordered by the time when the
            3  +idea for the change first arose;  no priority should be inferred from
            4  +the order.
            5  +
            6  +@(#) $Id: ctk.shar,v 1.50 1996/01/15 14:47:16 andrewm Exp andrewm $
            7  +
            8  +1. Add option to turn off background fill on window visibility
            9  +changes (only frame and toplevel widgets need it).
           10  +
           11  +2. Implement embedded windows for text widget.
           12  +
           13  +3. Fix cursor display in text widgets (occasionally off the right edge
           14  +of the screen).
           15  +
           16  +5. Implement remaining methods of wm command.
           17  +
           18  +7.  Add bindings for entry and text selection (ones that can be
           19  +generated from a character terminal).
           20  +
           21  +8. Support color?  Handy for PC consoles with too little oomph for X.
           22  +(And for people with VT320 terminals - but does anyone really have
           23  +them?)
           24  +
           25  +9. Add message and scale widgets.
           26  +
           27  +10. Add do-nothing variants of all remaining unsupported Tk commands?
           28  +
           29  +11. Implement remaining text display attributes (only underline works) -
           30  +would some way of mapping the attributes to available terminal attributes.
           31  +
           32  +18. Extend command dialog to include menu of complete window management
           33  +operations.
           34  +
           35  +23. Modify tkFont.c so that display of ISO-??? characters is reasonable
           36  +(map characters with diacritics to characters without).
           37  +
           38  +24. Can't use -geometry option because "wm" is defined in time - either
           39  +move forward Tk_AppInit, or make "wm" a C command.
           40  +
           41  +25. Add "ctk exec" command to execute an interactive command on win's
           42  +display. (e.g. "ctk exec . vi myfile")
           43  +
           44  +26. Call delscreen() after endwin() on systems that define delscreen().
           45  +(SysVR4 curses seem to need it to free up resources - but HP curses
           46  +doesn't define delscreen())

Added changes version [7270e73338].

            1  +Changes made since ctk8.0 was initially released are summarized below:
            2  +
            3  +Changed the 'configure' command to recognize tcl8.0
            4  +Changed the Makefile.in to build cwish$(VERSION) instead of cwish
            5  +
            6  +This file summarizes all changes made to CTk since version 4.0a1 was
            7  +released on March 12, 1995.  Changes that aren't backward compatible
            8  +are marked specially.
            9  + 
           10  +@(#) $Id: ctk.shar,v 1.50 1996/01/15 14:47:16 andrewm Exp andrewm $
           11  +
           12  +$Log: ctk.shar,v $
           13  +# Revision 1.50  1996/01/15  14:47:16  andrewm
           14  +# More portability glitches (needed to reset interpreter result
           15  +# in TkEntryInsert routines).
           16  +#
           17  +# Revision 1.49  1996/01/13  18:31:51  andrewm
           18  +# Dumb typos in tkCmds.c - found when build under SunOS.
           19  +#
           20  +# Revision 1.48  1995/12/21  19:31:05  andrewm
           21  +# Added "ctk redraw" command.
           22  +#
           23  +# Revision 1.47  1995/12/20  22:22:00  andrewm
           24  +# (bug fix) made ctkDisplay.c 8-bit clean (wasn't casting char
           25  +# to unsigned char) - thanks Jan Vlcek.
           26  +#
           27  +# Revision 1.46  1995/12/20  21:13:04  andrewm
           28  +# Incorporate changes from Tk4.0 patch 3 (tk4.0p3).
           29  +#
           30  +# Revision 1.45  1995/12/20  16:28:09  andrewm
           31  +# Incorporate changes from tk4.0 patch 2.
           32  +#
           33  +# Revision 1.44  1995/12/04  19:57:27  andrewm
           34  +# (bug fix) tkListbox.c - display cursor even when active row is not
           35  +# visible (put it in the top left corner).
           36  +#
           37  +# (feature change) tkListbox.c - no longer display "*" next to selected
           38  +# items - rely on display attribute instead.
           39  +#
           40  +# (feature change) listbox.tcl - Left and Right now scroll by pages
           41  +# instead of characters.
           42  +#
           43  +# Revision 1.43  1995/12/04  19:19:52  andrewm
           44  +# bug fix - forgot to change var name when pasting code into tk_popup.
           45  +#
           46  +# Revision 1.42  1995/11/19  17:07:16  andrewm
           47  +# Incorporate changes from Tk4.0 patch 1.
           48  +#
           49  +# Revision 1.41  1995/11/17  15:35:49  andrewm
           50  +# Drop use of A_INVIS in ctkDisplay.c - those styles should never be
           51  +# drawn anyway - and most terms don't support it (and it screws up
           52  +# out terminal session manager).
           53  +#
           54  +# Revision 1.40  1995/11/06  13:31:19  andrewm
           55  +# Change TK_PATCH_LEVEL to CTK_PATCH_LEVEL and tcl variable tk_patchLevel
           56  +# with ctk_patchLevel.  Only version numbers track between Tk and CTk -
           57  +# and this make for an easy way to tell when you are using CTk.
           58  +#
           59  +# Add Tk_RestackWindow() and pull stacking arguments out of Tk_Map() -
           60  +# now raise and lower commands use Tk_RestackWindow instead of Ctk_Map
           61  +# (because they should not map unmapped windows).
           62  +#
           63  +# The CTk menu now underlines the X in Exit (not the E).
           64  +#
           65  +# Revision 1.39  1995/08/31  19:48:54  andrewm
           66  +# Make sure that all uses of ckalloc/ckfree are with (char *) pointers
           67  +# (cast when necessary).
           68  +#
           69  +# Install as version 4.0 - don't need a different library for each patch.
           70  +#
           71  +# Revision 1.38  1995/08/25  20:38:47  andrewm
           72  +# bug fix - finally track down glitch that caused some slaves to not
           73  +# be mapped - backwards logic in tkGeometry.c.
           74  +#
           75  +# aesthetics - tk_dialog now uses a simpler appearance for the default
           76  +# button (add [] to label instead of an enclosing frame).
           77  +#
           78  +# Revision 1.37  1995/08/25  18:41:19  andrewm
           79  +# Change tkFindMenu to that it only finds menubuttons that do not
           80  +# have an indicator (otherwise the F10 key will fire menus of
           81  +# options buttons).
           82  +#
           83  +# Add exit to Ctk menu.
           84  +#
           85  +# Revision 1.36  1995/08/24  17:50:35  andrewm
           86  +# Add compatibilty info to tk.h to simplify porting of Tk extensions
           87  +# to ctk (BLT table was easy!).
           88  +#
           89  +# Revision 1.35  1995/08/22  19:48:01  andrewm
           90  +# Fix bug when destroying all windows from within a command from
           91  +# an event binding (could core dump).
           92  +#
           93  +# Revision 1.34  1995/08/22  17:31:37  andrewm
           94  +# Add ability for multi-column (wrapped) menus.
           95  +#
           96  +# Change menu button indicator to "^" (was "=").
           97  +#
           98  +# Revision 1.33  1995/08/21  21:39:57  andrewm
           99  +# More logical key fixes - no longer bind directly to "space" - instead
          100  +# bind to Select, and remap space to Select.
          101  +#
          102  +# Make Return a do-what-I-want key instead of the dialog closure key
          103  +# (which is now Execute).
          104  +#
          105  +# Curses Enter/Send key now maps to KP_Enter, not Return.
          106  +#
          107  +# Revision 1.32  1995/08/21  20:47:50  andrewm
          108  +# Remove root window from name table after creating "." window -
          109  +# otherwise user can reference the root, which can cause core dumps.
          110  +#
          111  +# Change bindings to use logical key names only - then central
          112  +# ctk.tcl binds other keys to generate logical key events.
          113  +#
          114  +# Add ctk_event command (ala testevent).
          115  +#
          116  +# Revision 1.31  1995/08/21  14:52:49  andrewm
          117  +# Fix foolish change to text/entry insertion - back to Insert procefdure
          118  +# returning a boolean.
          119  +#
          120  +# Revision 1.30  1995/08/21  13:30:49  andrewm
          121  +# Pull out the menu traversal by matching first label character - decide
          122  +# it better belongs in a library.
          123  +#
          124  +# Revision 1.29  1995/08/18  21:58:02  andrewm
          125  +# Modify bindings within menu to activate entries by pressing the first
          126  +# letter of their label.
          127  +#
          128  +# Revision 1.28  1995/08/18  19:56:34  andrewm
          129  +# Rewite the tkEntryInsert and tkEntrySeeInsert procedures in C.
          130  +# Not sure if the payoff is worth it this time.
          131  +#
          132  +# Revision 1.27  1995/08/18  14:15:35  andrewm
          133  +# Rewrite the tk_focusNext and tk_focusPrev procedures in C, because
          134  +# their overhead was annoying on loaded server machines - particularly
          135  +# if you overshoot a widget and have not Shift-Tab on your terminal!
          136  +
          137  +--- ctk4.0b1 Released ---
          138  +
          139  +# Revision 1.26  1995/07/25  14:07:28  andrewm
          140  +# (new feature) Add some of the Tk demos - begin fixing them for CTk.
          141  +#
          142  +# Clean up documentation for CTk 4.0b1 release.
          143  +#
          144  +# Revision 1.25  1995/07/21  21:19:00  andrewm
          145  +# (bug fix) fixes for non-ANSI compiler (SunOs).
          146  +#
          147  +# Revision 1.24  1995/07/20  21:26:44  andrewm
          148  +# (new feature) add -with-libdirs and -with-incdirs directives for
          149  +# configure.
          150  +#
          151  +# (new feature) unsupported Tk commands are now passed to a "ctk_unsupported"
          152  +# command - if this command is not defined then the command is ignored.
          153  +#
          154  +# Revision 1.23  1995/07/20  18:05:00  andrewm
          155  +# (bug fix) tkListbox.c - don't let cursor scroll horizontally with contents
          156  +# of listbox.
          157  +#
          158  +# Revision 1.22  1995/07/20  16:20:50  andrewm
          159  +# Fill in cwish man page.
          160  +# Include configuration changes from Tk4.0
          161  +#
          162  +# Revision 1.21  1995/07/19  21:24:09  andrewm
          163  +# (feature change, bug fix) Include Tk4.0 changes to the (C)Tk library files.
          164  +#
          165  +# Revision 1.20  1995/07/18  21:38:55  andrewm
          166  +# (bug fix, new feature, changed feature) Incorporate changes from Tk4.0b4
          167  +# and Tk4.0 (final release).
          168  +#
          169  +# (feature change) tkListbox.c - selected items in listbox are now
          170  +# highlighted for the entire width of the listbox.
          171  +#
          172  +# Revision 1.19  1995/07/17  12:38:47  andrewm
          173  +# (feature change) ctk.tcl - go back to activating menubar buttons
          174  +# with unshifted alpha characters.
          175  +#
          176  +# Revision 1.18  1995/07/14  15:45:38  andrewm
          177  +# (new feature) updgrade tkMain.c and tkAppInit.c to work with tcl7.4 (final)
          178  +#
          179  +# Revision 1.17  1995/07/11  22:08:19  andrewm
          180  +# (new feature) tkFocus.c - now try to pass focus to the topmost visible
          181  +# toplevel when focus is lost (focus window destroyed).
          182  +#
          183  +# Revision 1.16  1995/07/11  20:54:02  andrewm
          184  +# (bug fix) wm.tcl - fix several references to "winfo" that should be "info".
          185  +#
          186  +# Revision 1.15  1995/07/11  20:33:19  andrewm
          187  +# (new feature) tkFocus.c - added local focus maintenance, so that
          188  +# each top-level remembers the last child to have the focus.
          189  +#
          190  +# Revision 1.14  1995/07/11  19:25:12  andrewm
          191  +# (new feature) added binding for F2 to pass focus to next top level -
          192  +# really just a stop gap till I write a real window manager for CTk.
          193  +#
          194  +# Revision 1.13  1995/07/11  18:13:53  andrewm
          195  +# (bug fix) tkCmds.c - "winfo children" no longer reports "." as
          196  +# a child of itself.
          197  +#
          198  +# Revision 1.12  1995/07/10  13:29:17  andrewm
          199  +# add -borderwidth to list of unsupported options (its not supported
          200  +# for text tags).
          201  +#
          202  +# Revision 1.11  1995/06/24  23:45:13  andrewm
          203  +# (new feature) add list of values for unsupported options - return this
          204  +# value when "cget" is attempted on the option.
          205  +#
          206  +# Revision 1.10  1995/06/24  17:04:58  andrewm
          207  +# (bug fix) tkWindow.c: change initialization in Tk_CreateMainWindow()
          208  +# so that .ctkdefaults can be processed (used to cause a crash).
          209  +# Also set default geometry for "." to 20x10.
          210  +#
          211  +# Revision 1.9  1995/06/24  15:58:50  andrewm
          212  +# (new feature) ctkDisplay.c: display open fails if device is not a tty.
          213  +#
          214  +# Revision 1.8  1995/06/23  20:57:00  andrewm
          215  +# (bug fix) tkTextDisp.c - Fix a prior fix in TkTextSetYView() when
          216  +# adjusting just a little below the current window (could cause a
          217  +# core dump).
          218  +#
          219  +# Revision 1.7  1995/06/23  13:26:46  andrewm
          220  +# (feature change) frames/toplevels no longer highlight when they
          221  +# have the focus (it was a waste).
          222  +#
          223  +# (feature change) menus default to "-tearoff 0"  (should remove support
          224  +# for -tearoff, it has no practical use in ctk - the torn off menu
          225  +# would be less convenient than the original).
          226  +#
          227  +# Revision 1.6  1995/06/11  22:44:11  andrewm
          228  +# (bug fix) fix bug where bottom of text widget would not be cleared
          229  +# when lines were removed (also remove some superfluous code) tkTextDisp.c
          230  +#
          231  +# Revision 1.5  1995/06/11  22:08:24  andrewm
          232  +# use curses KEY_ constants in keyCodes.h (used to be hard-coded).
          233  +#
          234  +# Revision 1.4  1995/06/11  21:29:42  andrewm
          235  +# (bug fix) wm procedure now sets -relx/-rely so that geometry can be
          236  +# changed without withdrawing the window.
          237  +#
          238  +# (feature change) Traversal to menubutton via shortcut now only happens
          239  +# with shifted alpha characters.
          240  +#
          241  +# Revision 1.3  1995/06/11  14:36:39  andrewm
          242  +# Display focus/insertion point using terminal cursor (instead of inverted
          243  +# text) - faster and better appearance.
          244  +#
          245  +# Revision 1.2  1995/05/28  14:55:30  andrewm
          246  +# (new feature) sweeping changes, add tkOption.c, to support
          247  +# "option" command.
          248  +
          249  +5/5/95 (bug fix) Modify command.tcl so that commands are evaluated
          250  +in a global context.
          251  +
          252  +--- ctk4.0a2 Released ---
          253  +
          254  +5/4/95 (bug fix) Modify configure.in to check for gettimeofday() -
          255  +if it doesn't exist add the socket library (for SCO).
          256  +
          257  +5/4/95 (new feature) Modify ctkDisplay.c so that the environment
          258  +variable CTK_TERM can override the TERM environment variable (to
          259  +allow terminal definitions customized for CTk).
          260  +
          261  +5/3/95 (new feature) Add ctkDialog for interactive cwish sessions.  Modify
          262  +tkMain.c so that it calls ctkDialog instead of reading commands from
          263  +stdin when the user doesn't redirect the display.
          264  +
          265  +5/3/95 (feature change) Modify tkCmds.c so that widget bindings come before
          266  +class bindings.  (Patch from Dr. Ousterhout.)
          267  +*** POTENTIAL INCOMPATIBILITY ***
          268  +
          269  +4/22/95 (bug fix) Modify tkFont.c and and tkTextDisp.c so that cursor
          270  +is drawn in entry and text widgets when the insertion point is in front
          271  +of a tab character.
          272  +
          273  +4/22/95 (new feature) Add scrollbar.tcl for scrollbar keyboard bindings and
          274  +modify tkScrollbar.c to highlight when the scrollbar has the focus.
          275  +(But scrollbars default to "-takefocus 0".)
          276  +
          277  +4/22/95 (feature change) Modify tkMain.c and tkWindow.c to change
          278  +the environment variable that specifies display terminal to CTK_DISPLAY
          279  +(CWISH_DISPLAY will still work but it is deprecated and support for it
          280  +will eventually be removed).
          281  +*** POTENTIAL INCOMPATIBILITY ***
          282  +
          283  +4/22/95 (feature change) Modify listbox.tcl so that PageUp and PageDown
          284  +key bindings change the active element.
          285  +
          286  +4/6/95 (many fixes & features) Incorporate tk4.0b3 changes.
          287  +*** POTENTIAL INCOMPATIBILITY ***
          288  +
          289  +3/23/95 (bug fix) Modified tkWindow so that Tk_CreateMainWindow()
          290  +will not pass a null argument (screen) to the "frame" command -
          291  +this was the real cause of the NULL dereference I tried to fix on
          292  +3/20/95 - undo that first fix.
          293  +
          294  +3/21/95 (new feature) Modify tkFrame.c, tkListbox.c, tkText.c, and
          295  +tkTextDisp.c to highlight the border of frame, listbox, and text
          296  +widgets when they have the focus.
          297  +
          298  +3/20/95 (bug fix) Modified tkConfig.c so that DoConfig() wouldn't
          299  +dereference a NULL value (thanks Peter da Silva).
          300  +
          301  +3/20/95 (bug fix) Modified tkWindow.c to destroy top-level children of
          302  +main window (missed them before, and therefore wouldn't close display).
          303  +
          304  +3/15/95 (new feature) Modify ctkDisplay.c to put terminals in raw mode
          305  +so that interrupt, quit, etc are passed as keys instead of generating
          306  +signals.
          307  +
          308  +3/13/95 (bug fix) Modified tkTextMark.c to no longer dump core when the
          309  +insert mark wraps across lines (put back InsertUndisplayProc() - why
          310  +I removed it in the first place I have no idea).
          311  +
          312  +9/20/96 (port) Port ctk to tcl7.6: event handling (remove from ctk, call
          313  +tcl's), channel handling. Should be better to reorganize code and
          314  +merge in tk4.2 as another platform (Curses) -- Juanjo <jjciarla@raiz.uncu.edu.ar>
          315  +
          316  +7/16/97 (port) Port ctk to tcl8.0: change ctk.tcl to expect a higher version of tcl/tk.
          317  +Still needs "grid" and a number of other enhancements. Michael (mschwart@nyx.net)

Added compat/license.terms version [20dbc90f96].

            1  +This software is copyrighted by the Regents of the University of
            2  +California, Sun Microsystems, Inc., Cleveland Clinic Foundation, and
            3  +other parties.  The following terms apply to all files associated with
            4  +the software unless explicitly disclaimed in individual files.
            5  +
            6  +The authors hereby grant permission to use, copy, modify, distribute,
            7  +and license this software and its documentation for any purpose, provided
            8  +that existing copyright notices are retained in all copies and that this
            9  +notice is included verbatim in any distributions. No written agreement,
           10  +license, or royalty fee is required for any of the authorized uses.
           11  +Modifications to this software may be copyrighted by their authors
           12  +and need not follow the licensing terms described here, provided that
           13  +the new terms are clearly indicated on the first page of each file where
           14  +they apply.
           15  +
           16  +IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY
           17  +FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
           18  +ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY
           19  +DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE
           20  +POSSIBILITY OF SUCH DAMAGE.
           21  +
           22  +THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
           23  +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
           24  +FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.  THIS SOFTWARE
           25  +IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE
           26  +NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
           27  +MODIFICATIONS.
           28  +
           29  +RESTRICTED RIGHTS: Use, duplication or disclosure by the government
           30  +is subject to the restrictions as set forth in subparagraph (c) (1) (ii)
           31  +of the Rights in Technical Data and Computer Software Clause as DFARS
           32  +252.227-7013 and FAR 52.227-19.

Added compat/stdlib.h version [42e9f287b0].

            1  +/*
            2  + * stdlib.h --
            3  + *
            4  + *	Declares facilities exported by the "stdlib" portion of
            5  + *	the C library.  This file isn't complete in the ANSI-C
            6  + *	sense;  it only declares things that are needed by Tcl.
            7  + *	This file is needed even on many systems with their own
            8  + *	stdlib.h (e.g. SunOS) because not all stdlib.h files
            9  + *	declare all the procedures needed here (such as strtod).
           10  + *
           11  + * Copyright (c) 1991 The Regents of the University of California.
           12  + * Copyright (c) 1994 Sun Microsystems, Inc.
           13  + *
           14  + * See the file "license.terms" for information on usage and redistribution
           15  + * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
           16  + *
           17  + * @(#) stdlib.h 1.9 94/12/17 16:26:20
           18  + */
           19  +
           20  +#ifndef _STDLIB
           21  +#define _STDLIB
           22  +
           23  +#include <tcl.h>
           24  +
           25  +extern void		abort _ANSI_ARGS_((void));
           26  +extern double		atof _ANSI_ARGS_((CONST char *string));
           27  +extern int		atoi _ANSI_ARGS_((CONST char *string));
           28  +extern long		atol _ANSI_ARGS_((CONST char *string));
           29  +extern char *		calloc _ANSI_ARGS_((unsigned int numElements,
           30  +			    unsigned int size));
           31  +extern void		exit _ANSI_ARGS_((int status));
           32  +extern int		free _ANSI_ARGS_((char *blockPtr));
           33  +extern char *		getenv _ANSI_ARGS_((CONST char *name));
           34  +extern char *		malloc _ANSI_ARGS_((unsigned int numBytes));
           35  +extern void		qsort _ANSI_ARGS_((VOID *base, int n, int size,
           36  +			    int (*compar)(CONST VOID *element1, CONST VOID
           37  +			    *element2)));
           38  +extern char *		realloc _ANSI_ARGS_((char *ptr, unsigned int numBytes));
           39  +extern double		strtod _ANSI_ARGS_((CONST char *string, char **endPtr));
           40  +extern long		strtol _ANSI_ARGS_((CONST char *string, char **endPtr,
           41  +			    int base));
           42  +extern unsigned long	strtoul _ANSI_ARGS_((CONST char *string,
           43  +			    char **endPtr, int base));
           44  +
           45  +#endif /* _STDLIB */

Added compat/unistd.h version [77d6f9a81b].

            1  +/*
            2  + * unistd.h --
            3  + *
            4  + *      Macros, CONSTants and prototypes for Posix conformance.
            5  + *
            6  + * Copyright 1989 Regents of the University of California
            7  + * Permission to use, copy, modify, and distribute this
            8  + * software and its documentation for any purpose and without
            9  + * fee is hereby granted, provided that the above copyright
           10  + * notice appear in all copies.  The University of California
           11  + * makes no representations about the suitability of this
           12  + * software for any purpose.  It is provided "as is" without
           13  + * express or implied warranty.
           14  + *
           15  + * @(#) unistd.h 1.5 94/12/17 16:26:27
           16  + */
           17  +
           18  +#ifndef _UNISTD
           19  +#define _UNISTD
           20  +
           21  +#include <sys/types.h>
           22  +#ifndef _TCL
           23  +#   include "tcl.h"
           24  +#endif
           25  +
           26  +#ifndef NULL
           27  +#define NULL    0
           28  +#endif
           29  +
           30  +/* 
           31  + * Strict POSIX stuff goes here.  Extensions go down below, in the 
           32  + * ifndef _POSIX_SOURCE section.
           33  + */
           34  +
           35  +extern void _exit _ANSI_ARGS_((int status));
           36  +extern int access _ANSI_ARGS_((CONST char *path, int mode));
           37  +extern int chdir _ANSI_ARGS_((CONST char *path));
           38  +extern int chown _ANSI_ARGS_((CONST char *path, uid_t owner, gid_t group));
           39  +extern int close _ANSI_ARGS_((int fd));
           40  +extern int dup _ANSI_ARGS_((int oldfd));
           41  +extern int dup2 _ANSI_ARGS_((int oldfd, int newfd));
           42  +extern int execl _ANSI_ARGS_((CONST char *path, ...));
           43  +extern int execle _ANSI_ARGS_((CONST char *path, ...));
           44  +extern int execlp _ANSI_ARGS_((CONST char *file, ...));
           45  +extern int execv _ANSI_ARGS_((CONST char *path, char **argv));
           46  +extern int execve _ANSI_ARGS_((CONST char *path, char **argv, char **envp));
           47  +extern int execvp _ANSI_ARGS_((CONST char *file, char **argv));
           48  +extern pid_t fork _ANSI_ARGS_((void));
           49  +extern char *getcwd _ANSI_ARGS_((char *buf, size_t size));
           50  +extern gid_t getegid _ANSI_ARGS_((void));
           51  +extern uid_t geteuid _ANSI_ARGS_((void));
           52  +extern gid_t getgid _ANSI_ARGS_((void));
           53  +extern int getgroups _ANSI_ARGS_((int bufSize, int *buffer));
           54  +extern pid_t getpid _ANSI_ARGS_((void));
           55  +extern uid_t getuid _ANSI_ARGS_((void));
           56  +extern int isatty _ANSI_ARGS_((int fd));
           57  +extern long lseek _ANSI_ARGS_((int fd, long offset, int whence));
           58  +extern int pipe _ANSI_ARGS_((int *fildes));
           59  +extern int read _ANSI_ARGS_((int fd, char *buf, size_t size));
           60  +extern int setgid _ANSI_ARGS_((gid_t group));
           61  +extern int setuid _ANSI_ARGS_((uid_t user));
           62  +extern unsigned sleep _ANSI_ARGS_ ((unsigned seconds));
           63  +extern char *ttyname _ANSI_ARGS_((int fd));
           64  +extern int unlink _ANSI_ARGS_((CONST char *path));
           65  +extern int write _ANSI_ARGS_((int fd, CONST char *buf, size_t size));
           66  +
           67  +#ifndef	_POSIX_SOURCE
           68  +extern char *crypt _ANSI_ARGS_((CONST char *, CONST char *));
           69  +extern int fchown _ANSI_ARGS_((int fd, uid_t owner, gid_t group));
           70  +extern int flock _ANSI_ARGS_((int fd, int operation));
           71  +extern int ftruncate _ANSI_ARGS_((int fd, unsigned long length));
           72  +extern int readlink _ANSI_ARGS_((CONST char *path, char *buf, int bufsize));
           73  +extern int setegid _ANSI_ARGS_((gid_t group));
           74  +extern int seteuid _ANSI_ARGS_((uid_t user));
           75  +extern int setreuid _ANSI_ARGS_((int ruid, int euid));
           76  +extern int symlink _ANSI_ARGS_((CONST char *, CONST char *));
           77  +extern int ttyslot _ANSI_ARGS_((void));
           78  +extern int truncate _ANSI_ARGS_((CONST char *path, unsigned long length));
           79  +extern int vfork _ANSI_ARGS_((void));
           80  +#endif /* _POSIX_SOURCE */
           81  +
           82  +#endif /* _UNISTD */
           83  +

Added config.cache version [ea5daa1b42].

            1  +# This file is a shell script that caches the results of configure
            2  +# tests run on this system so they can be shared between configure
            3  +# scripts and configure runs.  It is not useful on other systems.
            4  +# If it contains results you don't want to keep, you may remove or edit it.
            5  +#
            6  +# By default, configure uses ./config.cache as the cache file,
            7  +# creating it if it does not exist already.  You can give configure
            8  +# the --cache-file=FILE option to use a different cache file; that is
            9  +# what configure does when it calls configure scripts in
           10  +# subdirectories, so they share the cache.
           11  +# Giving --cache-file=/dev/null disables caching, for debugging configure.
           12  +# config.status only pays attention to the cache file if you give it the
           13  +# --recheck option to rerun configure.
           14  +#
           15  +ac_cv_c_cross=${ac_cv_c_cross='no'}
           16  +ac_cv_func_BSDgettimeofday=${ac_cv_func_BSDgettimeofday='no'}
           17  +ac_cv_func_beep=${ac_cv_func_beep='yes'}
           18  +ac_cv_func_curs_set=${ac_cv_func_curs_set='yes'}
           19  +ac_cv_func_gettimeofday=${ac_cv_func_gettimeofday='yes'}
           20  +ac_cv_func_keypad=${ac_cv_func_keypad='yes'}
           21  +ac_cv_func_memmove=${ac_cv_func_memmove='yes'}
           22  +ac_cv_func_set_term=${ac_cv_func_set_term='yes'}
           23  +ac_cv_func_sin=${ac_cv_func_sin='no'}
           24  +ac_cv_func_strtod=${ac_cv_func_strtod='yes'}
           25  +ac_cv_header_limits_h=${ac_cv_header_limits_h='yes'}
           26  +ac_cv_header_stdc=${ac_cv_header_stdc='yes'}
           27  +ac_cv_header_unistd_h=${ac_cv_header_unistd_h='yes'}
           28  +ac_cv_lib_curses=${ac_cv_lib_curses='yes'}
           29  +ac_cv_lib_ieee=${ac_cv_lib_ieee='yes'}
           30  +ac_cv_lib_tcl8_2=${ac_cv_lib_tcl8_2='no'}
           31  +ac_cv_path_install=${ac_cv_path_install=''/usr/bin/ginstall -c''}
           32  +ac_cv_prog_CPP=${ac_cv_prog_CPP=''cc -E''}
           33  +ac_cv_prog_RANLIB=${ac_cv_prog_RANLIB='ranlib'}
           34  +ac_cv_type_mode_t=${ac_cv_type_mode_t='yes'}
           35  +ac_cv_type_pid_t=${ac_cv_type_pid_t='yes'}
           36  +ac_cv_type_size_t=${ac_cv_type_size_t='yes'}
           37  +ac_cv_type_uid_t=${ac_cv_type_uid_t='yes'}

Added config.log version [242d0fd3a2].

            1  +This file contains any messages produced by compilers while
            2  +running configure, to aid debugging if configure makes a mistake.
            3  +
            4  +cc -E
            5  +cc -E
            6  +cc -E
            7  +cc -c conftest.c
            8  +cc -E
            9  +cc -E
           10  +cc -E
           11  +cc -o conftest conftest.c
           12  +cc -E
           13  +cc -E
           14  +cc -E
           15  +cc -o conftest conftest.c
           16  +configure: In function 'main':
           17  +configure:1009: warning: incompatible implicit declaration of built-in function 'exit'
           18  +cc -E
           19  +cc -E
           20  +cc -E
           21  +cc -E
           22  +cc -o conftest conftest.c -lcurses
           23  +cc -E
           24  +cc -o conftest conftest.c -lcurses
           25  +cc -o conftest conftest.c -lcurses
           26  +cc -o conftest conftest.c -lcurses
           27  +cc -o conftest conftest.c -lcurses
           28  +cc -c conftest.c
           29  +cc -c conftest.c
           30  +configure: In function 't':
           31  +configure:1428: error: 'FILE' has no member named '_cnt'
           32  +cc -c conftest.c
           33  +configure: In function 't':
           34  +configure:1444: error: 'FILE' has no member named '__cnt'
           35  +cc -c conftest.c
           36  +configure: In function 't':
           37  +configure:1461: error: 'FILE' has no member named '_r'
           38  +cc -c conftest.c
           39  +configure: In function 't':
           40  +configure:1478: error: 'FILE' has no member named 'readCount'
           41  +cc -c conftest.c
           42  +configure: In function 't':
           43  +configure:1501: error: 'FILE' has no member named '_gptr'
           44  +configure:1501: error: 'FILE' has no member named '_egptr'
           45  +cc -c conftest.c
           46  +cc -o conftest conftest.c -lcurses
           47  +configure:1572: warning: conflicting types for built-in function 'sin'
           48  +/tmp/ccYH09hj.o: In function `t':
           49  +conftest.c:(.text+0x20): undefined reference to `sin'
           50  +collect2: ld returned 1 exit status
           51  +cc -o conftest conftest.c -lieee -lm -lcurses
           52  +cc -o conftest conftest.c -lieee -lm -lcurses
           53  +cc -o conftest conftest.c -lieee -lm -lcurses
           54  +configure:1708: warning: conflicting types for built-in function 'memmove'
           55  +cc -o conftest conftest.c -lieee -lm -lcurses
           56  +configure: In function 'main':
           57  +configure:1766: warning: incompatible implicit declaration of built-in function 'exit'
           58  +configure:1768: warning: incompatible implicit declaration of built-in function 'exit'
           59  +cc -o conftest conftest.c -lieee -lm -lcurses
           60  +/tmp/cc6XWPiP.o: In function `t':
           61  +conftest.c:(.text+0x20): undefined reference to `BSDgettimeofday'
           62  +collect2: ld returned 1 exit status
           63  +cc -E
           64  +cc -o conftest conftest.c -lieee -lm -lcurses
           65  +cc -o conftest conftest.c -lieee -lm -lcurses
           66  +configure: In function 'main':
           67  +configure:1935: warning: incompatible implicit declaration of built-in function 'exit'
           68  +configure:1937: warning: incompatible implicit declaration of built-in function 'exit'
           69  +cc -o conftest conftest.c -ltcl8.2 -lieee -lm -lcurses
           70  +/usr/lib/gcc/i486-slackware-linux/4.3.3/../../../../i486-slackware-linux/bin/ld: cannot find -ltcl8.2
           71  +collect2: ld returned 1 exit status
           72  +cc -E

Added configure version [3b129ddf7f].

            1  +#! /bin/sh
            2  +
            3  +# Guess values for system-dependent variables and create Makefiles.
            4  +# Generated automatically using autoconf version 2.7 
            5  +# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
            6  +#
            7  +# This configure script is free software; the Free Software Foundation
            8  +# gives unlimited permission to copy, distribute and modify it.
            9  +
           10  +# Defaults:
           11  +ac_help=
           12  +ac_default_prefix=/usr/local
           13  +# Any additions from configure.in:
           14  +ac_help="$ac_help
           15  +  --with-ncurses   use ncurses library instead of curses"
           16  +ac_help="$ac_help
           17  +  --with-libdirs   directories to add to library search path"
           18  +ac_help="$ac_help
           19  +  --with-incdirs   directories to add to include search path"
           20  +
           21  +# Initialize some variables set by options.
           22  +# The variables have the same names as the options, with
           23  +# dashes changed to underlines.
           24  +build=NONE
           25  +cache_file=./config.cache
           26  +exec_prefix=NONE
           27  +host=NONE
           28  +no_create=
           29  +nonopt=NONE
           30  +no_recursion=
           31  +prefix=NONE
           32  +program_prefix=NONE
           33  +program_suffix=NONE
           34  +program_transform_name=s,x,x,
           35  +silent=
           36  +site=
           37  +srcdir=
           38  +target=NONE
           39  +verbose=
           40  +x_includes=NONE
           41  +x_libraries=NONE
           42  +bindir='${exec_prefix}/bin'
           43  +sbindir='${exec_prefix}/sbin'
           44  +libexecdir='${exec_prefix}/libexec'
           45  +datadir='${prefix}/share'
           46  +sysconfdir='${prefix}/etc'
           47  +sharedstatedir='${prefix}/com'
           48  +localstatedir='${prefix}/var'
           49  +libdir='${exec_prefix}/lib'
           50  +includedir='${prefix}/include'
           51  +oldincludedir='/usr/include'
           52  +infodir='${prefix}/info'
           53  +mandir='${prefix}/man'
           54  +
           55  +# Initialize some other variables.
           56  +subdirs=
           57  +MFLAGS= MAKEFLAGS=
           58  +
           59  +ac_prev=
           60  +for ac_option
           61  +do
           62  +
           63  +  # If the previous option needs an argument, assign it.
           64  +  if test -n "$ac_prev"; then
           65  +    eval "$ac_prev=\$ac_option"
           66  +    ac_prev=
           67  +    continue
           68  +  fi
           69  +
           70  +  case "$ac_option" in
           71  +  -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
           72  +  *) ac_optarg= ;;
           73  +  esac
           74  +
           75  +  # Accept the important Cygnus configure options, so we can diagnose typos.
           76  +
           77  +  case "$ac_option" in
           78  +
           79  +  -bindir | --bindir | --bindi | --bind | --bin | --bi)
           80  +    ac_prev=bindir ;;
           81  +  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
           82  +    bindir="$ac_optarg" ;;
           83  +
           84  +  -build | --build | --buil | --bui | --bu)
           85  +    ac_prev=build ;;
           86  +  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
           87  +    build="$ac_optarg" ;;
           88  +
           89  +  -cache-file | --cache-file | --cache-fil | --cache-fi \
           90  +  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
           91  +    ac_prev=cache_file ;;
           92  +  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
           93  +  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
           94  +    cache_file="$ac_optarg" ;;
           95  +
           96  +  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
           97  +    ac_prev=datadir ;;
           98  +  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
           99  +  | --da=*)
          100  +    datadir="$ac_optarg" ;;
          101  +
          102  +  -disable-* | --disable-*)
          103  +    ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
          104  +    # Reject names that are not valid shell variable names.
          105  +    if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
          106  +      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
          107  +    fi
          108  +    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
          109  +    eval "enable_${ac_feature}=no" ;;
          110  +
          111  +  -enable-* | --enable-*)
          112  +    ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
          113  +    # Reject names that are not valid shell variable names.
          114  +    if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
          115  +      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
          116  +    fi
          117  +    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
          118  +    case "$ac_option" in
          119  +      *=*) ;;
          120  +      *) ac_optarg=yes ;;
          121  +    esac
          122  +    eval "enable_${ac_feature}='$ac_optarg'" ;;
          123  +
          124  +  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
          125  +  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
          126  +  | --exec | --exe | --ex)
          127  +    ac_prev=exec_prefix ;;
          128  +  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
          129  +  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
          130  +  | --exec=* | --exe=* | --ex=*)
          131  +    exec_prefix="$ac_optarg" ;;
          132  +
          133  +  -gas | --gas | --ga | --g)
          134  +    # Obsolete; use --with-gas.
          135  +    with_gas=yes ;;
          136  +
          137  +  -help | --help | --hel | --he)
          138  +    # Omit some internal or obsolete options to make the list less imposing.
          139  +    # This message is too long to be a string in the A/UX 3.1 sh.
          140  +    cat << EOF
          141  +Usage: configure [options] [host]
          142  +Options: [defaults in brackets after descriptions]
          143  +Configuration:
          144  +  --cache-file=FILE       cache test results in FILE
          145  +  --help                  print this message
          146  +  --no-create             do not create output files
          147  +  --quiet, --silent       do not print \`checking...' messages
          148  +  --version               print the version of autoconf that created configure
          149  +Directory and file names:
          150  +  --prefix=PREFIX         install architecture-independent files in PREFIX
          151  +                          [$ac_default_prefix]
          152  +  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
          153  +                          [same as prefix]
          154  +  --bindir=DIR            user executables in DIR [EPREFIX/bin]
          155  +  --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
          156  +  --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
          157  +  --datadir=DIR           read-only architecture-independent data in DIR
          158  +                          [PREFIX/share]
          159  +  --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
          160  +  --sharedstatedir=DIR    modifiable architecture-independent data in DIR
          161  +                          [PREFIX/com]
          162  +  --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
          163  +  --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
          164  +  --includedir=DIR        C header files in DIR [PREFIX/include]
          165  +  --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
          166  +  --infodir=DIR           info documentation in DIR [PREFIX/info]
          167  +  --mandir=DIR            man documentation in DIR [PREFIX/man]
          168  +  --srcdir=DIR            find the sources in DIR [configure dir or ..]
          169  +  --program-prefix=PREFIX prepend PREFIX to installed program names
          170  +  --program-suffix=SUFFIX append SUFFIX to installed program names
          171  +  --program-transform-name=PROGRAM
          172  +                          run sed PROGRAM on installed program names
          173  +EOF
          174  +    cat << EOF
          175  +Host type:
          176  +  --build=BUILD           configure for building on BUILD [BUILD=HOST]
          177  +  --host=HOST             configure for HOST [guessed]
          178  +  --target=TARGET         configure for TARGET [TARGET=HOST]
          179  +Features and packages:
          180  +  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
          181  +  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
          182  +  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
          183  +  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
          184  +  --x-includes=DIR        X include files are in DIR
          185  +  --x-libraries=DIR       X library files are in DIR
          186  +EOF
          187  +    if test -n "$ac_help"; then
          188  +      echo "--enable and --with options recognized:$ac_help"
          189  +    fi
          190  +    exit 0 ;;
          191  +
          192  +  -host | --host | --hos | --ho)
          193  +    ac_prev=host ;;
          194  +  -host=* | --host=* | --hos=* | --ho=*)
          195  +    host="$ac_optarg" ;;
          196  +
          197  +  -includedir | --includedir | --includedi | --included | --include \
          198  +  | --includ | --inclu | --incl | --inc)
          199  +    ac_prev=includedir ;;
          200  +  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
          201  +  | --includ=* | --inclu=* | --incl=* | --inc=*)
          202  +    includedir="$ac_optarg" ;;
          203  +
          204  +  -infodir | --infodir | --infodi | --infod | --info | --inf)
          205  +    ac_prev=infodir ;;
          206  +  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
          207  +    infodir="$ac_optarg" ;;
          208  +
          209  +  -libdir | --libdir | --libdi | --libd)
          210  +    ac_prev=libdir ;;
          211  +  -libdir=* | --libdir=* | --libdi=* | --libd=*)
          212  +    libdir="$ac_optarg" ;;
          213  +
          214  +  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
          215  +  | --libexe | --libex | --libe)
          216  +    ac_prev=libexecdir ;;
          217  +  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
          218  +  | --libexe=* | --libex=* | --libe=*)
          219  +    libexecdir="$ac_optarg" ;;
          220  +
          221  +  -localstatedir | --localstatedir | --localstatedi | --localstated \
          222  +  | --localstate | --localstat | --localsta | --localst \
          223  +  | --locals | --local | --loca | --loc | --lo)
          224  +    ac_prev=localstatedir ;;
          225  +  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
          226  +  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
          227  +  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
          228  +    localstatedir="$ac_optarg" ;;
          229  +
          230  +  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
          231  +    ac_prev=mandir ;;
          232  +  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
          233  +    mandir="$ac_optarg" ;;
          234  +
          235  +  -nfp | --nfp | --nf)
          236  +    # Obsolete; use --without-fp.
          237  +    with_fp=no ;;
          238  +
          239  +  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
          240  +  | --no-cr | --no-c)
          241  +    no_create=yes ;;
          242  +
          243  +  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
          244  +  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
          245  +    no_recursion=yes ;;
          246  +
          247  +  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
          248  +  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
          249  +  | --oldin | --oldi | --old | --ol | --o)
          250  +    ac_prev=oldincludedir ;;
          251  +  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
          252  +  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
          253  +  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
          254  +    oldincludedir="$ac_optarg" ;;
          255  +
          256  +  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
          257  +    ac_prev=prefix ;;
          258  +  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
          259  +    prefix="$ac_optarg" ;;
          260  +
          261  +  -program-prefix | --program-prefix | --program-prefi | --program-pref \
          262  +  | --program-pre | --program-pr | --program-p)
          263  +    ac_prev=program_prefix ;;
          264  +  -program-prefix=* | --program-prefix=* | --program-prefi=* \
          265  +  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
          266  +    program_prefix="$ac_optarg" ;;
          267  +
          268  +  -program-suffix | --program-suffix | --program-suffi | --program-suff \
          269  +  | --program-suf | --program-su | --program-s)
          270  +    ac_prev=program_suffix ;;
          271  +  -program-suffix=* | --program-suffix=* | --program-suffi=* \
          272  +  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
          273  +    program_suffix="$ac_optarg" ;;
          274  +
          275  +  -program-transform-name | --program-transform-name \
          276  +  | --program-transform-nam | --program-transform-na \
          277  +  | --program-transform-n | --program-transform- \
          278  +  | --program-transform | --program-transfor \
          279  +  | --program-transfo | --program-transf \
          280  +  | --program-trans | --program-tran \
          281  +  | --progr-tra | --program-tr | --program-t)
          282  +    ac_prev=program_transform_name ;;
          283  +  -program-transform-name=* | --program-transform-name=* \
          284  +  | --program-transform-nam=* | --program-transform-na=* \
          285  +  | --program-transform-n=* | --program-transform-=* \
          286  +  | --program-transform=* | --program-transfor=* \
          287  +  | --program-transfo=* | --program-transf=* \
          288  +  | --program-trans=* | --program-tran=* \
          289  +  | --progr-tra=* | --program-tr=* | --program-t=*)
          290  +    program_transform_name="$ac_optarg" ;;
          291  +
          292  +  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
          293  +  | -silent | --silent | --silen | --sile | --sil)
          294  +    silent=yes ;;
          295  +
          296  +  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
          297  +    ac_prev=sbindir ;;
          298  +  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
          299  +  | --sbi=* | --sb=*)
          300  +    sbindir="$ac_optarg" ;;
          301  +
          302  +  -sharedstatedir | --sharedstatedir | --sharedstatedi \
          303  +  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
          304  +  | --sharedst | --shareds | --shared | --share | --shar \
          305  +  | --sha | --sh)
          306  +    ac_prev=sharedstatedir ;;
          307  +  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
          308  +  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
          309  +  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
          310  +  | --sha=* | --sh=*)
          311  +    sharedstatedir="$ac_optarg" ;;
          312  +
          313  +  -site | --site | --sit)
          314  +    ac_prev=site ;;
          315  +  -site=* | --site=* | --sit=*)
          316  +    site="$ac_optarg" ;;
          317  +
          318  +  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
          319  +    ac_prev=srcdir ;;
          320  +  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
          321  +    srcdir="$ac_optarg" ;;
          322  +
          323  +  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
          324  +  | --syscon | --sysco | --sysc | --sys | --sy)
          325  +    ac_prev=sysconfdir ;;
          326  +  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
          327  +  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
          328  +    sysconfdir="$ac_optarg" ;;
          329  +
          330  +  -target | --target | --targe | --targ | --tar | --ta | --t)
          331  +    ac_prev=target ;;
          332  +  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
          333  +    target="$ac_optarg" ;;
          334  +
          335  +  -v | -verbose | --verbose | --verbos | --verbo | --verb)
          336  +    verbose=yes ;;
          337  +
          338  +  -version | --version | --versio | --versi | --vers)
          339  +    echo "configure generated by autoconf version 2.7"
          340  +    exit 0 ;;
          341  +
          342  +  -with-* | --with-*)
          343  +    ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
          344  +    # Reject names that are not valid shell variable names.
          345  +    if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
          346  +      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
          347  +    fi
          348  +    ac_package=`echo $ac_package| sed 's/-/_/g'`
          349  +    case "$ac_option" in
          350  +      *=*) ;;
          351  +      *) ac_optarg=yes ;;
          352  +    esac
          353  +    eval "with_${ac_package}='$ac_optarg'" ;;
          354  +
          355  +  -without-* | --without-*)
          356  +    ac_package=`echo $ac_option|sed -e 's/-*without-//'`
          357  +    # Reject names that are not valid shell variable names.
          358  +    if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
          359  +      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
          360  +    fi
          361  +    ac_package=`echo $ac_package| sed 's/-/_/g'`
          362  +    eval "with_${ac_package}=no" ;;
          363  +
          364  +  --x)
          365  +    # Obsolete; use --with-x.
          366  +    with_x=yes ;;
          367  +
          368  +  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
          369  +  | --x-incl | --x-inc | --x-in | --x-i)
          370  +    ac_prev=x_includes ;;
          371  +  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
          372  +  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
          373  +    x_includes="$ac_optarg" ;;
          374  +
          375  +  -x-libraries | --x-libraries | --x-librarie | --x-librari \
          376  +  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
          377  +    ac_prev=x_libraries ;;
          378  +  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
          379  +  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
          380  +    x_libraries="$ac_optarg" ;;
          381  +
          382  +  -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
          383  +    ;;
          384  +
          385  +  *)
          386  +    if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
          387  +      echo "configure: warning: $ac_option: invalid host type" 1>&2
          388  +    fi
          389  +    if test "x$nonopt" != xNONE; then
          390  +      { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
          391  +    fi
          392  +    nonopt="$ac_option"
          393  +    ;;
          394  +
          395  +  esac
          396  +done
          397  +
          398  +if test -n "$ac_prev"; then
          399  +  { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
          400  +fi
          401  +
          402  +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
          403  +
          404  +# File descriptor usage:
          405  +# 0 standard input
          406  +# 1 file creation
          407  +# 2 errors and warnings
          408  +# 3 some systems may open it to /dev/tty
          409  +# 4 used on the Kubota Titan
          410  +# 6 checking for... messages and results
          411  +# 5 compiler messages saved in config.log
          412  +if test "$silent" = yes; then
          413  +  exec 6>/dev/null
          414  +else
          415  +  exec 6>&1
          416  +fi
          417  +exec 5>./config.log
          418  +
          419  +echo "\
          420  +This file contains any messages produced by compilers while
          421  +running configure, to aid debugging if configure makes a mistake.
          422  +" 1>&5
          423  +
          424  +# Strip out --no-create and --no-recursion so they do not pile up.
          425  +# Also quote any args containing shell metacharacters.
          426  +ac_configure_args=
          427  +for ac_arg
          428  +do
          429  +  case "$ac_arg" in
          430  +  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
          431  +  | --no-cr | --no-c) ;;
          432  +  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
          433  +  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
          434  +  *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
          435  +  ac_configure_args="$ac_configure_args '$ac_arg'" ;;
          436  +  *) ac_configure_args="$ac_configure_args $ac_arg" ;;
          437  +  esac
          438  +done
          439  +
          440  +# NLS nuisances.
          441  +# Only set LANG and LC_ALL to C if already set.
          442  +# These must not be set unconditionally because not all systems understand
          443  +# e.g. LANG=C (notably SCO).
          444  +if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
          445  +if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
          446  +
          447  +# confdefs.h avoids OS command line length limits that DEFS can exceed.
          448  +rm -rf conftest* confdefs.h
          449  +# AIX cpp loses on an empty file, so make sure it contains at least a newline.
          450  +echo > confdefs.h
          451  +
          452  +# A filename unique to this package, relative to the directory that
          453  +# configure is in, which we can look for to find out if srcdir is correct.
          454  +ac_unique_file=tk.h
          455  +
          456  +# Find the source files, if location was not specified.
          457  +if test -z "$srcdir"; then
          458  +  ac_srcdir_defaulted=yes
          459  +  # Try the directory containing this script, then its parent.
          460  +  ac_prog=$0
          461  +  ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
          462  +  test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
          463  +  srcdir=$ac_confdir
          464  +  if test ! -r $srcdir/$ac_unique_file; then
          465  +    srcdir=..
          466  +  fi
          467  +else
          468  +  ac_srcdir_defaulted=no
          469  +fi
          470  +if test ! -r $srcdir/$ac_unique_file; then
          471  +  if test "$ac_srcdir_defaulted" = yes; then
          472  +    { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
          473  +  else
          474  +    { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
          475  +  fi
          476  +fi
          477  +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
          478  +
          479  +# Prefer explicitly selected file to automatically selected ones.
          480  +if test -z "$CONFIG_SITE"; then
          481  +  if test "x$prefix" != xNONE; then
          482  +    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
          483  +  else
          484  +    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
          485  +  fi
          486  +fi
          487  +for ac_site_file in $CONFIG_SITE; do
          488  +  if test -r "$ac_site_file"; then
          489  +    echo "loading site script $ac_site_file"
          490  +    . "$ac_site_file"
          491  +  fi
          492  +done
          493  +
          494  +if test -r "$cache_file"; then
          495  +  echo "loading cache $cache_file"
          496  +  . $cache_file
          497  +else
          498  +  echo "creating cache $cache_file"
          499  +  > $cache_file
          500  +fi
          501  +
          502  +ac_ext=c
          503  +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
          504  +ac_cpp='echo $CPP $CPPFLAGS 1>&5;
          505  +$CPP $CPPFLAGS'
          506  +ac_compile='echo ${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5;
          507  +${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5 2>&5'
          508  +ac_link='echo ${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5;
          509  +${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5 2>&5'
          510  +
          511  +if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
          512  +  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
          513  +  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
          514  +    ac_n= ac_c='
          515  +' ac_t='	'
          516  +  else
          517  +    ac_n=-n ac_c= ac_t=
          518  +  fi
          519  +else
          520  +  ac_n= ac_c='\c' ac_t=
          521  +fi
          522  +
          523  +
          524  +
          525  +# @(#) $Id: ctk.shar,v 1.48 1995/12/21 19:31:05 andrewm Exp andrewm $
          526  +
          527  +# Check whether --with-ncurses or --without-ncurses was given.
          528  +if test "${with_ncurses+set}" = set; then
          529  +  withval="$with_ncurses"
          530  +  :
          531  +else
          532  +  with_ncurses=no
          533  +fi
          534  +
          535  +# Check whether --with-libdirs or --without-libdirs was given.
          536  +if test "${with_libdirs+set}" = set; then
          537  +  withval="$with_libdirs"
          538  +  :
          539  +fi
          540  +
          541  +# Check whether --with-incdirs or --without-incdirs was given.
          542  +if test "${with_incdirs+set}" = set; then
          543  +  withval="$with_incdirs"
          544  +  :
          545  +fi
          546  +
          547  +
          548  +for ldir in $with_libdirs ;do
          549  +    LDFLAGS="$LDFLAGS -L$ldir"
          550  +done
          551  +for idir in $with_incdirs ;do
          552  +    CPPFLAGS="$CPPFLAGS -I$idir"
          553  +done
          554  +
          555  +ac_aux_dir=
          556  +for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
          557  +  if test -f $ac_dir/install-sh; then
          558  +    ac_aux_dir=$ac_dir
          559  +    ac_install_sh="$ac_aux_dir/install-sh -c"
          560  +    break
          561  +  elif test -f $ac_dir/install.sh; then
          562  +    ac_aux_dir=$ac_dir
          563  +    ac_install_sh="$ac_aux_dir/install.sh -c"
          564  +    break
          565  +  fi
          566  +done
          567  +if test -z "$ac_aux_dir"; then
          568  +  { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
          569  +fi
          570  +ac_config_guess=$ac_aux_dir/config.guess
          571  +ac_config_sub=$ac_aux_dir/config.sub
          572  +ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
          573  +
          574  +# Find a good install program.  We prefer a C program (faster),
          575  +# so one script is as good as another.  But avoid the broken or
          576  +# incompatible versions:
          577  +# SysV /etc/install, /usr/sbin/install
          578  +# SunOS /usr/etc/install
          579  +# IRIX /sbin/install
          580  +# AIX /bin/install
          581  +# AFS /usr/afsws/bin/install, which mishandles nonexistent args
          582  +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
          583  +# ./install, which can be erroneously created by make from ./install.sh.
          584  +echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
          585  +if test -z "$INSTALL"; then
          586  +if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
          587  +  echo $ac_n "(cached) $ac_c" 1>&6
          588  +else
          589  +    IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
          590  +  for ac_dir in $PATH; do
          591  +    # Account for people who put trailing slashes in PATH elements.
          592  +    case "$ac_dir/" in
          593  +    /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
          594  +    *)
          595  +      # OSF1 and SCO ODT 3.0 have their own names for install.
          596  +      for ac_prog in ginstall installbsd scoinst install; do
          597  +        if test -f $ac_dir/$ac_prog; then
          598  +	  if test $ac_prog = install &&
          599  +            grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
          600  +	    # AIX install.  It has an incompatible calling convention.
          601  +	    # OSF/1 installbsd also uses dspmsg, but is usable.
          602  +	    :
          603  +	  else
          604  +	    ac_cv_path_install="$ac_dir/$ac_prog -c"
          605  +	    break 2
          606  +	  fi
          607  +	fi
          608  +      done
          609  +      ;;
          610  +    esac
          611  +  done
          612  +  IFS="$ac_save_ifs"
          613  +
          614  +fi
          615  +  if test "${ac_cv_path_install+set}" = set; then
          616  +    INSTALL="$ac_cv_path_install"
          617  +  else
          618  +    # As a last resort, use the slow shell script.  We don't cache a
          619  +    # path for INSTALL within a source directory, because that will
          620  +    # break other packages using the cache if that directory is
          621  +    # removed, or if the path is relative.
          622  +    INSTALL="$ac_install_sh"
          623  +  fi
          624  +fi
          625  +echo "$ac_t""$INSTALL" 1>&6
          626  +
          627  +# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
          628  +# It thinks the first close brace ends the variable substitution.
          629  +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
          630  +
          631  +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
          632  +
          633  +# Extract the first word of "ranlib", so it can be a program name with args.
          634  +set dummy ranlib; ac_word=$2
          635  +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
          636  +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
          637  +  echo $ac_n "(cached) $ac_c" 1>&6
          638  +else
          639  +  if test -n "$RANLIB"; then
          640  +  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
          641  +else
          642  +  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
          643  +  for ac_dir in $PATH; do
          644  +    test -z "$ac_dir" && ac_dir=.
          645  +    if test -f $ac_dir/$ac_word; then
          646  +      ac_cv_prog_RANLIB="ranlib"
          647  +      break
          648  +    fi
          649  +  done
          650  +  IFS="$ac_save_ifs"
          651  +  test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
          652  +fi
          653  +fi
          654  +RANLIB="$ac_cv_prog_RANLIB"
          655  +if test -n "$RANLIB"; then
          656  +  echo "$ac_t""$RANLIB" 1>&6
          657  +else
          658  +  echo "$ac_t""no" 1>&6
          659  +fi
          660  +
          661  +if test "x$prefix" = xNONE; then
          662  +echo $ac_n "checking for prefix by ""... $ac_c" 1>&6
          663  +# Extract the first word of "cwish", so it can be a program name with args.
          664  +set dummy cwish; ac_word=$2
          665  +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
          666  +if eval "test \"`echo '$''{'ac_cv_path_CWISH'+set}'`\" = set"; then
          667  +  echo $ac_n "(cached) $ac_c" 1>&6
          668  +else
          669  +  case "$CWISH" in
          670  +  /*)
          671  +  ac_cv_path_CWISH="$CWISH" # Let the user override the test with a path.
          672  +  ;;
          673  +  *)
          674  +  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
          675  +  for ac_dir in $PATH; do
          676  +    test -z "$ac_dir" && ac_dir=.
          677  +    if test -f $ac_dir/$ac_word; then
          678  +      ac_cv_path_CWISH="$ac_dir/$ac_word"
          679  +      break
          680  +    fi
          681  +  done
          682  +  IFS="$ac_save_ifs"
          683  +  ;;
          684  +esac
          685  +fi
          686  +CWISH="$ac_cv_path_CWISH"
          687  +if test -n "$CWISH"; then
          688  +  echo "$ac_t""$CWISH" 1>&6
          689  +else
          690  +  echo "$ac_t""no" 1>&6
          691  +fi
          692  +
          693  +  if test -n "$ac_cv_path_CWISH"; then
          694  +    prefix=`echo $ac_cv_path_CWISH|sed 's%/[^/][^/]*//*[^/][^/]*$%%'`
          695  +  fi
          696  +fi
          697  +
          698  +CC=${CC-cc}
          699  +
          700  +echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
          701  +# On Suns, sometimes $CPP names a directory.
          702  +if test -n "$CPP" && test -d "$CPP"; then
          703  +  CPP=
          704  +fi
          705  +if test -z "$CPP"; then
          706  +if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
          707  +  echo $ac_n "(cached) $ac_c" 1>&6
          708  +else
          709  +    # This must be in double quotes, not single quotes, because CPP may get
          710  +  # substituted into the Makefile and "${CC-cc}" will confuse make.
          711  +  CPP="${CC-cc} -E"
          712  +  # On the NeXT, cc -E runs the code through the compiler's parser,
          713  +  # not just through cpp.
          714  +  cat > conftest.$ac_ext <<EOF
          715  +#line 716 "configure"
          716  +#include "confdefs.h"
          717  +#include <assert.h>
          718  +Syntax Error
          719  +EOF
          720  +eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
          721  +ac_err=`grep -v '^ *+' conftest.out`
          722  +if test -z "$ac_err"; then
          723  +  :
          724  +else
          725  +  echo "$ac_err" >&5
          726  +  rm -rf conftest*
          727  +  CPP="${CC-cc} -E -traditional-cpp"
          728  +  cat > conftest.$ac_ext <<EOF
          729  +#line 730 "configure"
          730  +#include "confdefs.h"
          731  +#include <assert.h>
          732  +Syntax Error
          733  +EOF
          734  +eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
          735  +ac_err=`grep -v '^ *+' conftest.out`
          736  +if test -z "$ac_err"; then
          737  +  :
          738  +else
          739  +  echo "$ac_err" >&5
          740  +  rm -rf conftest*
          741  +  CPP=/lib/cpp
          742  +fi
          743  +rm -f conftest*
          744  +fi
          745  +rm -f conftest*
          746  +  ac_cv_prog_CPP="$CPP"
          747  +fi
          748  +  CPP="$ac_cv_prog_CPP"
          749  +else
          750  +  ac_cv_prog_CPP="$CPP"
          751  +fi
          752  +echo "$ac_t""$CPP" 1>&6
          753  +
          754  +for ac_hdr in unistd.h limits.h
          755  +do
          756  +ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
          757  +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
          758  +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
          759  +  echo $ac_n "(cached) $ac_c" 1>&6
          760  +else
          761  +  cat > conftest.$ac_ext <<EOF
          762  +#line 763 "configure"
          763  +#include "confdefs.h"
          764  +#include <$ac_hdr>
          765  +EOF
          766  +eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
          767  +ac_err=`grep -v '^ *+' conftest.out`
          768  +if test -z "$ac_err"; then
          769  +  rm -rf conftest*
          770  +  eval "ac_cv_header_$ac_safe=yes"
          771  +else
          772  +  echo "$ac_err" >&5
          773  +  rm -rf conftest*
          774  +  eval "ac_cv_header_$ac_safe=no"
          775  +fi
          776  +rm -f conftest*
          777  +fi
          778  +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
          779  +  echo "$ac_t""yes" 1>&6
          780  +    ac_tr_hdr=HAVE_`echo $ac_hdr | tr 'abcdefghijklmnopqrstuvwxyz./\055' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ___'`
          781  +  cat >> confdefs.h <<EOF
          782  +#define $ac_tr_hdr 1
          783  +EOF
          784  + 
          785  +else
          786  +  echo "$ac_t""no" 1>&6
          787  +fi
          788  +done
          789  +
          790  +
          791  +#--------------------------------------------------------------------
          792  +#	Include sys/select.h if it exists and if it supplies things
          793  +#	that appear to be useful and aren't already in sys/types.h.
          794  +#	This appears to be true only on the RS/6000 under AIX.  Some
          795  +#	systems like OSF/1 have a sys/select.h that's of no use, and
          796  +#	other systems like SCO UNIX have a sys/select.h that's
          797  +#	pernicious.  If "fd_set" isn't defined anywhere then set a
          798  +#	special flag.
          799  +#--------------------------------------------------------------------
          800  +
          801  +echo $ac_n "checking fd_set and sys/select""... $ac_c" 1>&6
          802  +cat > conftest.$ac_ext <<EOF
          803  +#line 804 "configure"
          804  +#include "confdefs.h"
          805  +#include <sys/types.h>
          806  +int main() { return 0; }
          807  +int t() {
          808  +fd_set readMask, writeMask;
          809  +; return 0; }
          810  +EOF
          811  +if eval $ac_compile; then
          812  +  rm -rf conftest*
          813  +  tk_ok=yes
          814  +else
          815  +  rm -rf conftest*
          816  +  tk_ok=no
          817  +fi
          818  +rm -f conftest*
          819  +
          820  +if test $tk_ok = no; then
          821  +    cat > conftest.$ac_ext <<EOF
          822  +#line 823 "configure"
          823  +#include "confdefs.h"
          824  +#include <sys/select.h>
          825  +EOF
          826  +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
          827  +  egrep "fd_mask" >/dev/null 2>&1; then
          828  +  rm -rf conftest*
          829  +  tk_ok=yes
          830  +fi
          831  +rm -f conftest*
          832  +
          833  +    if test $tk_ok = yes; then
          834  +	cat >> confdefs.h <<\EOF
          835  +#define HAVE_SYS_SELECT_H 1
          836  +EOF
          837  +
          838  +    fi
          839  +fi
          840  +echo "$ac_t""$tk_ok" 1>&6
          841  +if test $tk_ok = no; then
          842  +    cat >> confdefs.h <<\EOF
          843  +#define NO_FD_SET 1
          844  +EOF
          845  +
          846  +fi
          847  +
          848  +#--------------------------------------------------------------------
          849  +#	Supply a substitute for stdlib.h if it doesn't define strtol,
          850  +#	strtoul, or strtod (which it doesn't in some versions of SunOS).
          851  +#--------------------------------------------------------------------
          852  +
          853  +echo $ac_n "checking stdlib.h""... $ac_c" 1>&6
          854  +cat > conftest.$ac_ext <<EOF
          855  +#line 856 "configure"
          856  +#include "confdefs.h"
          857  +#include <stdlib.h>
          858  +EOF
          859  +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
          860  +  egrep "strtol" >/dev/null 2>&1; then
          861  +  rm -rf conftest*
          862  +  tk_ok=yes
          863  +else
          864  +  rm -rf conftest*
          865  +  tk_ok=no
          866  +fi
          867  +rm -f conftest*
          868  +
          869  +cat > conftest.$ac_ext <<EOF
          870  +#line 871 "configure"
          871  +#include "confdefs.h"
          872  +#include <stdlib.h>
          873  +EOF
          874  +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
          875  +  egrep "strtoul" >/dev/null 2>&1; then
          876  +  :
          877  +else
          878  +  rm -rf conftest*
          879  +  tk_ok=no
          880  +fi
          881  +rm -f conftest*
          882  +
          883  +cat > conftest.$ac_ext <<EOF
          884  +#line 885 "configure"
          885  +#include "confdefs.h"
          886  +#include <stdlib.h>
          887  +EOF
          888  +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
          889  +  egrep "strtod" >/dev/null 2>&1; then
          890  +  :
          891  +else
          892  +  rm -rf conftest*
          893  +  tk_ok=no
          894  +fi
          895  +rm -f conftest*
          896  +
          897  +if test $tk_ok = no; then
          898  +    cat >> confdefs.h <<\EOF
          899  +#define NO_STDLIB_H 1
          900  +EOF
          901  +
          902  +fi
          903  +echo "$ac_t""$tk_ok" 1>&6
          904  +
          905  +#--------------------------------------------------------------------
          906  +#	Check for various typedefs and provide substitutes if
          907  +#	they don't exist.
          908  +#--------------------------------------------------------------------
          909  +
          910  +# If we cannot run a trivial program, we must be cross compiling.
          911  +echo $ac_n "checking whether cross-compiling""... $ac_c" 1>&6
          912  +if eval "test \"`echo '$''{'ac_cv_c_cross'+set}'`\" = set"; then
          913  +  echo $ac_n "(cached) $ac_c" 1>&6
          914  +else
          915  +  if test "$cross_compiling" = yes; then
          916  +  ac_cv_c_cross=yes
          917  +else
          918  +cat > conftest.$ac_ext <<EOF
          919  +#line 920 "configure"
          920  +#include "confdefs.h"
          921  +main(){return(0);}
          922  +EOF
          923  +eval $ac_link
          924  +if test -s conftest && (./conftest; exit) 2>/dev/null; then
          925  +  ac_cv_c_cross=no
          926  +else
          927  +  ac_cv_c_cross=yes
          928  +fi
          929  +fi
          930  +rm -fr conftest*
          931  +fi
          932  +
          933  +echo "$ac_t""$ac_cv_c_cross" 1>&6
          934  +cross_compiling=$ac_cv_c_cross
          935  +
          936  +echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
          937  +if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
          938  +  echo $ac_n "(cached) $ac_c" 1>&6
          939  +else
          940  +  cat > conftest.$ac_ext <<EOF
          941  +#line 942 "configure"
          942  +#include "confdefs.h"
          943  +#include <stdlib.h>
          944  +#include <stdarg.h>
          945  +#include <string.h>
          946  +#include <float.h>
          947  +EOF
          948  +eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
          949  +ac_err=`grep -v '^ *+' conftest.out`
          950  +if test -z "$ac_err"; then
          951  +  rm -rf conftest*
          952  +  ac_cv_header_stdc=yes
          953  +else
          954  +  echo "$ac_err" >&5
          955  +  rm -rf conftest*
          956  +  ac_cv_header_stdc=no
          957  +fi
          958  +rm -f conftest*
          959  +
          960  +if test $ac_cv_header_stdc = yes; then
          961  +  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
          962  +cat > conftest.$ac_ext <<EOF
          963  +#line 964 "configure"
          964  +#include "confdefs.h"
          965  +#include <string.h>
          966  +EOF
          967  +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
          968  +  egrep "memchr" >/dev/null 2>&1; then
          969  +  :
          970  +else
          971  +  rm -rf conftest*
          972  +  ac_cv_header_stdc=no
          973  +fi
          974  +rm -f conftest*
          975  +
          976  +fi
          977  +
          978  +if test $ac_cv_header_stdc = yes; then
          979  +  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
          980  +cat > conftest.$ac_ext <<EOF
          981  +#line 982 "configure"
          982  +#include "confdefs.h"
          983  +#include <stdlib.h>
          984  +EOF
          985  +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
          986  +  egrep "free" >/dev/null 2>&1; then
          987  +  :
          988  +else
          989  +  rm -rf conftest*
          990  +  ac_cv_header_stdc=no
          991  +fi
          992  +rm -f conftest*
          993  +
          994  +fi
          995  +
          996  +if test $ac_cv_header_stdc = yes; then
          997  +  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
          998  +if test "$cross_compiling" = yes; then
          999  +  :
         1000  +else
         1001  +cat > conftest.$ac_ext <<EOF
         1002  +#line 1003 "configure"
         1003  +#include "confdefs.h"
         1004  +#include <ctype.h>
         1005  +#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
         1006  +#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
         1007  +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
         1008  +int main () { int i; for (i = 0; i < 256; i++)
         1009  +if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
         1010  +exit (0); }
         1011  +
         1012  +EOF
         1013  +eval $ac_link
         1014  +if test -s conftest && (./conftest; exit) 2>/dev/null; then
         1015  +  :
         1016  +else
         1017  +  ac_cv_header_stdc=no
         1018  +fi
         1019  +fi
         1020  +rm -fr conftest*
         1021  +fi
         1022  +fi
         1023  +
         1024  +echo "$ac_t""$ac_cv_header_stdc" 1>&6
         1025  +if test $ac_cv_header_stdc = yes; then
         1026  +  cat >> confdefs.h <<\EOF
         1027  +#define STDC_HEADERS 1
         1028  +EOF
         1029  +
         1030  +fi
         1031  +
         1032  +echo $ac_n "checking for mode_t""... $ac_c" 1>&6
         1033  +if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then
         1034  +  echo $ac_n "(cached) $ac_c" 1>&6
         1035  +else
         1036  +  cat > conftest.$ac_ext <<EOF
         1037  +#line 1038 "configure"
         1038  +#include "confdefs.h"
         1039  +#include <sys/types.h>
         1040  +#if STDC_HEADERS
         1041  +#include <stdlib.h>
         1042  +#endif
         1043  +EOF
         1044  +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
         1045  +  egrep "mode_t" >/dev/null 2>&1; then
         1046  +  rm -rf conftest*
         1047  +  ac_cv_type_mode_t=yes
         1048  +else
         1049  +  rm -rf conftest*
         1050  +  ac_cv_type_mode_t=no
         1051  +fi
         1052  +rm -f conftest*
         1053  +
         1054  +fi
         1055  +echo "$ac_t""$ac_cv_type_mode_t" 1>&6
         1056  +if test $ac_cv_type_mode_t = no; then
         1057  +  cat >> confdefs.h <<\EOF
         1058  +#define mode_t int
         1059  +EOF
         1060  +
         1061  +fi
         1062  +
         1063  +echo $ac_n "checking for pid_t""... $ac_c" 1>&6
         1064  +if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then
         1065  +  echo $ac_n "(cached) $ac_c" 1>&6
         1066  +else
         1067  +  cat > conftest.$ac_ext <<EOF
         1068  +#line 1069 "configure"
         1069  +#include "confdefs.h"
         1070  +#include <sys/types.h>
         1071  +#if STDC_HEADERS
         1072  +#include <stdlib.h>
         1073  +#endif
         1074  +EOF
         1075  +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
         1076  +  egrep "pid_t" >/dev/null 2>&1; then
         1077  +  rm -rf conftest*
         1078  +  ac_cv_type_pid_t=yes
         1079  +else
         1080  +  rm -rf conftest*
         1081  +  ac_cv_type_pid_t=no
         1082  +fi
         1083  +rm -f conftest*
         1084  +
         1085  +fi
         1086  +echo "$ac_t""$ac_cv_type_pid_t" 1>&6
         1087  +if test $ac_cv_type_pid_t = no; then
         1088  +  cat >> confdefs.h <<\EOF
         1089  +#define pid_t int
         1090  +EOF
         1091  +
         1092  +fi
         1093  +
         1094  +echo $ac_n "checking for size_t""... $ac_c" 1>&6
         1095  +if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
         1096  +  echo $ac_n "(cached) $ac_c" 1>&6
         1097  +else
         1098  +  cat > conftest.$ac_ext <<EOF
         1099  +#line 1100 "configure"
         1100  +#include "confdefs.h"
         1101  +#include <sys/types.h>
         1102  +#if STDC_HEADERS
         1103  +#include <stdlib.h>
         1104  +#endif
         1105  +EOF
         1106  +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
         1107  +  egrep "size_t" >/dev/null 2>&1; then
         1108  +  rm -rf conftest*
         1109  +  ac_cv_type_size_t=yes
         1110  +else
         1111  +  rm -rf conftest*
         1112  +  ac_cv_type_size_t=no
         1113  +fi
         1114  +rm -f conftest*
         1115  +
         1116  +fi
         1117  +echo "$ac_t""$ac_cv_type_size_t" 1>&6
         1118  +if test $ac_cv_type_size_t = no; then
         1119  +  cat >> confdefs.h <<\EOF
         1120  +#define size_t unsigned
         1121  +EOF
         1122  +
         1123  +fi
         1124  +
         1125  +echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6
         1126  +if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then
         1127  +  echo $ac_n "(cached) $ac_c" 1>&6
         1128  +else
         1129  +  cat > conftest.$ac_ext <<EOF
         1130  +#line 1131 "configure"
         1131  +#include "confdefs.h"
         1132  +#include <sys/types.h>
         1133  +EOF
         1134  +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
         1135  +  egrep "uid_t" >/dev/null 2>&1; then
         1136  +  rm -rf conftest*
         1137  +  ac_cv_type_uid_t=yes
         1138  +else
         1139  +  rm -rf conftest*
         1140  +  ac_cv_type_uid_t=no
         1141  +fi
         1142  +rm -f conftest*
         1143  +
         1144  +fi
         1145  +
         1146  +echo "$ac_t""$ac_cv_type_uid_t" 1>&6
         1147  +if test $ac_cv_type_uid_t = no; then
         1148  +  cat >> confdefs.h <<\EOF
         1149  +#define uid_t int
         1150  +EOF
         1151  +
         1152  +  cat >> confdefs.h <<\EOF
         1153  +#define gid_t int
         1154  +EOF
         1155  +
         1156  +fi
         1157  +
         1158  +
         1159  +#--------------------------------------------------------------------
         1160  +#	Locate the curses header files and the curses library
         1161  +#	archive.
         1162  +#--------------------------------------------------------------------
         1163  +
         1164  +got_it=no
         1165  +if test $with_ncurses = yes; then
         1166  +    echo $ac_n "checking for -lncurses""... $ac_c" 1>&6
         1167  +ac_lib_var=`echo ncurses | tr '.-/+' '___p'`
         1168  +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
         1169  +  echo $ac_n "(cached) $ac_c" 1>&6
         1170  +else
         1171  +  ac_save_LIBS="$LIBS"
         1172  +LIBS="-lncurses  $LIBS"
         1173  +cat > conftest.$ac_ext <<EOF
         1174  +#line 1175 "configure"
         1175  +#include "confdefs.h"
         1176  +
         1177  +int main() { return 0; }
         1178  +int t() {
         1179  +initscr()
         1180  +; return 0; }
         1181  +EOF
         1182  +if eval $ac_link; then
         1183  +  rm -rf conftest*
         1184  +  eval "ac_cv_lib_$ac_lib_var=yes"
         1185  +else
         1186  +  rm -rf conftest*
         1187  +  eval "ac_cv_lib_$ac_lib_var=no"
         1188  +fi
         1189  +rm -f conftest*
         1190  +LIBS="$ac_save_LIBS"
         1191  +
         1192  +fi
         1193  +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
         1194  +  echo "$ac_t""yes" 1>&6
         1195  +  LIBS="$LIBS -lncurses"; got_it=yes
         1196  +else
         1197  +  echo "$ac_t""no" 1>&6
         1198  +fi
         1199  +
         1200  +else
         1201  +    echo $ac_n "checking for -lcurses""... $ac_c" 1>&6
         1202  +ac_lib_var=`echo curses | tr '.-/+' '___p'`
         1203  +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
         1204  +  echo $ac_n "(cached) $ac_c" 1>&6
         1205  +else
         1206  +  ac_save_LIBS="$LIBS"
         1207  +LIBS="-lcurses  $LIBS"
         1208  +cat > conftest.$ac_ext <<EOF
         1209  +#line 1210 "configure"
         1210  +#include "confdefs.h"
         1211  +
         1212  +int main() { return 0; }
         1213  +int t() {
         1214  +initscr()
         1215  +; return 0; }
         1216  +EOF
         1217  +if eval $ac_link; then
         1218  +  rm -rf conftest*
         1219  +  eval "ac_cv_lib_$ac_lib_var=yes"
         1220  +else
         1221  +  rm -rf conftest*
         1222  +  eval "ac_cv_lib_$ac_lib_var=no"
         1223  +fi
         1224  +rm -f conftest*
         1225  +LIBS="$ac_save_LIBS"
         1226  +
         1227  +fi
         1228  +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
         1229  +  echo "$ac_t""yes" 1>&6
         1230  +  LIBS="$LIBS -lcurses"; got_it=yes
         1231  +else
         1232  +  echo "$ac_t""no" 1>&6
         1233  +unset ac_cv_lib_curses
         1234  +	    echo $ac_n "checking for -lcurses""... $ac_c" 1>&6
         1235  +ac_lib_var=`echo curses | tr '.-/+' '___p'`
         1236  +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
         1237  +  echo $ac_n "(cached) $ac_c" 1>&6
         1238  +else
         1239  +  ac_save_LIBS="$LIBS"
         1240  +LIBS="-lcurses -ltermcap $LIBS"
         1241  +cat > conftest.$ac_ext <<EOF
         1242  +#line 1243 "configure"
         1243  +#include "confdefs.h"
         1244  +
         1245  +int main() { return 0; }
         1246  +int t() {
         1247  +initscr()
         1248  +; return 0; }
         1249  +EOF
         1250  +if eval $ac_link; then
         1251  +  rm -rf conftest*
         1252  +  eval "ac_cv_lib_$ac_lib_var=yes"
         1253  +else
         1254  +  rm -rf conftest*
         1255  +  eval "ac_cv_lib_$ac_lib_var=no"
         1256  +fi
         1257  +rm -f conftest*
         1258  +LIBS="$ac_save_LIBS"
         1259  +
         1260  +fi
         1261  +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
         1262  +  echo "$ac_t""yes" 1>&6
         1263  +  LIBS="$LIBS -lcurses -ltermcap"; got_it=yes
         1264  +else
         1265  +  echo "$ac_t""no" 1>&6
         1266  +fi
         1267  + 
         1268  +fi
         1269  +
         1270  +fi
         1271  +if test $got_it = no; then
         1272  +    echo "configure: warning: couldn't find curses library archive" 1>&2
         1273  +    echo "configure: warning: will not be able to properly determine curses capabilities" 1>&2
         1274  +fi
         1275  +
         1276  +echo $ac_n "checking curses header file""... $ac_c" 1>&6
         1277  +got_it=no
         1278  +if test $with_ncurses = yes; then
         1279  +    cat > conftest.$ac_ext <<EOF
         1280  +#line 1281 "configure"
         1281  +#include "confdefs.h"
         1282  +#include <ncurses.h>
         1283  +EOF
         1284  +eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
         1285  +ac_err=`grep -v '^ *+' conftest.out`
         1286  +if test -z "$ac_err"; then
         1287  +  rm -rf conftest*
         1288  +  got_it=ncurses.h; cat >> confdefs.h <<\EOF
         1289  +#define USE_NCURSES_H 1
         1290  +EOF
         1291  +
         1292  +else
         1293  +  echo "$ac_err" >&5
         1294  +fi
         1295  +rm -f conftest*
         1296  +fi
         1297  +if test $got_it = no; then
         1298  +    cat > conftest.$ac_ext <<EOF
         1299  +#line 1300 "configure"
         1300  +#include "confdefs.h"
         1301  +#include <curses.h>
         1302  +EOF
         1303  +eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
         1304  +ac_err=`grep -v '^ *+' conftest.out`
         1305  +if test -z "$ac_err"; then
         1306  +  rm -rf conftest*
         1307  +  got_it=curses.h
         1308  +else
         1309  +  echo "$ac_err" >&5
         1310  +fi
         1311  +rm -f conftest*
         1312  +fi
         1313  +if test $got_it = no; then
         1314  +    echo "configure: warning: couldn't find curses include file" 1>&2
         1315  +fi
         1316  +echo "$ac_t""$got_it" 1>&6
         1317  +
         1318  +#--------------------------------------------------------------------
         1319  +#	Check the curses library features.
         1320  +#--------------------------------------------------------------------
         1321  +
         1322  +for ac_func in curs_set set_term beep keypad
         1323  +do
         1324  +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
         1325  +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
         1326  +  echo $ac_n "(cached) $ac_c" 1>&6
         1327  +else
         1328  +  cat > conftest.$ac_ext <<EOF
         1329  +#line 1330 "configure"
         1330  +#include "confdefs.h"
         1331  +/* System header to define __stub macros and hopefully few prototypes,
         1332  +    which can conflict with char $ac_func(); below.  */
         1333  +#include <assert.h>
         1334  +/* Override any gcc2 internal prototype to avoid an error.  */
         1335  +char $ac_func();
         1336  +
         1337  +int main() { return 0; }
         1338  +int t() {
         1339  +
         1340  +/* The GNU C library defines this for functions which it implements
         1341  +    to always fail with ENOSYS.  Some functions are actually named
         1342  +    something starting with __ and the normal name is an alias.  */
         1343  +#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
         1344  +choke me
         1345  +#else
         1346  +$ac_func();
         1347  +#endif
         1348  +
         1349  +; return 0; }
         1350  +EOF
         1351  +if eval $ac_link; then
         1352  +  rm -rf conftest*
         1353  +  eval "ac_cv_func_$ac_func=yes"
         1354  +else
         1355  +  rm -rf conftest*
         1356  +  eval "ac_cv_func_$ac_func=no"
         1357  +fi
         1358  +rm -f conftest*
         1359  +
         1360  +fi
         1361  +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
         1362  +  echo "$ac_t""yes" 1>&6
         1363  +    ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
         1364  +  cat >> confdefs.h <<EOF
         1365  +#define $ac_tr_func 1
         1366  +EOF
         1367  + 
         1368  +else
         1369  +  echo "$ac_t""no" 1>&6
         1370  +fi
         1371  +done
         1372  +
         1373  +
         1374  +#--------------------------------------------------------------------
         1375  +#	Check to see whether the system supports the matherr function
         1376  +#	and its associated type "struct exception".
         1377  +#--------------------------------------------------------------------
         1378  +
         1379  +echo $ac_n "checking matherr support""... $ac_c" 1>&6
         1380  +cat > conftest.$ac_ext <<EOF
         1381  +#line 1382 "configure"
         1382  +#include "confdefs.h"
         1383  +#include <math.h>
         1384  +int main() { return 0; }
         1385  +int t() {
         1386  +
         1387  +struct exception x;
         1388  +x.type = DOMAIN;
         1389  +x.type = SING;
         1390  +
         1391  +; return 0; }
         1392  +EOF
         1393  +if eval $ac_compile; then
         1394  +  rm -rf conftest*
         1395  +  tk_ok=yes
         1396  +else
         1397  +  rm -rf conftest*
         1398  +  tk_ok=no
         1399  +fi
         1400  +rm -f conftest*
         1401  +
         1402  +echo "$ac_t""$tk_ok" 1>&6
         1403  +if test $tk_ok = yes; then
         1404  +    cat >> confdefs.h <<\EOF
         1405  +#define NEED_MATHERR 1
         1406  +EOF
         1407  +
         1408  +fi
         1409  +
         1410  +#--------------------------------------------------------------------
         1411  +#	Figure out how to find out whether a FILE structure contains
         1412  +#	buffered readable data.  Some known names for the count field:
         1413  +#		_cnt:		Most UNIX systems
         1414  +#		__cnt:		HPUX
         1415  +#		_r:		BSD
         1416  +#		readCount:	Sprite
         1417  +#	Or, in GNU libc there are two fields, _gptr and _egptr, which
         1418  +#	have to be compared.
         1419  +#--------------------------------------------------------------------
         1420  +
         1421  +echo $ac_n "checking count field in FILE structures""... $ac_c" 1>&6
         1422  +cat > conftest.$ac_ext <<EOF
         1423  +#line 1424 "configure"
         1424  +#include "confdefs.h"
         1425  +#include <stdio.h>
         1426  +int main() { return 0; }
         1427  +int t() {
         1428  +FILE *f = stdin; f->_cnt = 0;
         1429  +; return 0; }
         1430  +EOF
         1431  +if eval $ac_compile; then
         1432  +  rm -rf conftest*
         1433  +  fcnt="_cnt"
         1434  +fi
         1435  +rm -f conftest*
         1436  +
         1437  +if test "$fcnt" = ""; then
         1438  +    cat > conftest.$ac_ext <<EOF
         1439  +#line 1440 "configure"
         1440  +#include "confdefs.h"
         1441  +#include <stdio.h>
         1442  +int main() { return 0; }
         1443  +int t() {
         1444  +FILE *f = stdin; f->__cnt = 0;
         1445  +; return 0; }
         1446  +EOF
         1447  +if eval $ac_compile; then
         1448  +  rm -rf conftest*
         1449  +  fcnt="__cnt"
         1450  +fi
         1451  +rm -f conftest*
         1452  +
         1453  +fi
         1454  +if test "$fcnt" = ""; then
         1455  +    cat > conftest.$ac_ext <<EOF
         1456  +#line 1457 "configure"
         1457  +#include "confdefs.h"
         1458  +#include <stdio.h>
         1459  +int main() { return 0; }
         1460  +int t() {
         1461  +FILE *f = stdin; f->_r = 0;
         1462  +; return 0; }
         1463  +EOF
         1464  +if eval $ac_compile; then
         1465  +  rm -rf conftest*
         1466  +  fcnt="_r"
         1467  +fi
         1468  +rm -f conftest*
         1469  +
         1470  +fi
         1471  +if test "$fcnt" = ""; then
         1472  +    cat > conftest.$ac_ext <<EOF
         1473  +#line 1474 "configure"
         1474  +#include "confdefs.h"
         1475  +#include <stdio.h>
         1476  +int main() { return 0; }
         1477  +int t() {
         1478  +FILE *f = stdin; f->readCount = 0;
         1479  +; return 0; }
         1480  +EOF
         1481  +if eval $ac_compile; then
         1482  +  rm -rf conftest*
         1483  +  fcnt="readCount"
         1484  +fi
         1485  +rm -f conftest*
         1486  +
         1487  +fi
         1488  +if test "$fcnt" != ""; then
         1489  +    cat >> confdefs.h <<EOF
         1490  +#define TK_FILE_COUNT $fcnt
         1491  +EOF
         1492  +
         1493  +fi
         1494  +if test "$fcnt" = ""; then
         1495  +    cat > conftest.$ac_ext <<EOF
         1496  +#line 1497 "configure"
         1497  +#include "confdefs.h"
         1498  +#include <stdio.h>
         1499  +int main() { return 0; }
         1500  +int t() {
         1501  +FILE *f = stdin; f->_gptr = f->_egptr;
         1502  +; return 0; }
         1503  +EOF
         1504  +if eval $ac_compile; then
         1505  +  rm -rf conftest*
         1506  +  tk_ok=yes
         1507  +else
         1508  +  rm -rf conftest*
         1509  +  tk_ok=no
         1510  +fi
         1511  +rm -f conftest*
         1512  +
         1513  +    if test $tk_ok = yes; then
         1514  +	cat >> confdefs.h <<\EOF
         1515  +#define TK_FILE_GPTR 1
         1516  +EOF
         1517  +
         1518  +	fcnt="_gptr/_egptr"
         1519  +    fi
         1520  +fi
         1521  +if test "$fcnt" = ""; then
         1522  +    cat > conftest.$ac_ext <<EOF
         1523  +#line 1524 "configure"
         1524  +#include "confdefs.h"
         1525  +#include <stdio.h>
         1526  +int main() { return 0; }
         1527  +int t() {
         1528  +FILE *f = stdin; f->_IO_read_ptr = f->_IO_read_end;
         1529  +; return 0; }
         1530  +EOF
         1531  +if eval $ac_compile; then
         1532  +  rm -rf conftest*
         1533  +  tk_ok=yes
         1534  +else
         1535  +  rm -rf conftest*
         1536  +  tk_ok=no
         1537  +fi
         1538  +rm -f conftest*
         1539  +
         1540  +    if test $tk_ok = yes; then
         1541  +	cat >> confdefs.h <<\EOF
         1542  +#define TK_FILE_READ_PTR 1
         1543  +EOF
         1544  +
         1545  +	fcnt="_IO_read_ptr/_IO_read_end"
         1546  +    fi
         1547  +fi
         1548  +if test "$fcnt" = ""; then
         1549  +    echo "$ac_t""not found; must supply TkReadDataPending procedure" 1>&6
         1550  +else
         1551  +    echo "$ac_t"""$fcnt"" 1>&6
         1552  +fi
         1553  +
         1554  +#--------------------------------------------------------------------
         1555  +#	On a few very rare systems, all of the libm.a stuff is
         1556  +#	already in libc.a.  Set compiler flags accordingly.
         1557  +#	Also, Linux requires the "ieee" library for math to
         1558  +#	work right (and it must appear before "-lm").
         1559  +#--------------------------------------------------------------------
         1560  +
         1561  +echo $ac_n "checking for sin""... $ac_c" 1>&6
         1562  +if eval "test \"`echo '$''{'ac_cv_func_sin'+set}'`\" = set"; then
         1563  +  echo $ac_n "(cached) $ac_c" 1>&6
         1564  +else
         1565  +  cat > conftest.$ac_ext <<EOF
         1566  +#line 1567 "configure"
         1567  +#include "confdefs.h"
         1568  +/* System header to define __stub macros and hopefully few prototypes,
         1569  +    which can conflict with char sin(); below.  */
         1570  +#include <assert.h>
         1571  +/* Override any gcc2 internal prototype to avoid an error.  */
         1572  +char sin();
         1573  +
         1574  +int main() { return 0; }
         1575  +int t() {
         1576  +
         1577  +/* The GNU C library defines this for functions which it implements
         1578  +    to always fail with ENOSYS.  Some functions are actually named
         1579  +    something starting with __ and the normal name is an alias.  */
         1580  +#if defined (__stub_sin) || defined (__stub___sin)
         1581  +choke me
         1582  +#else
         1583  +sin();
         1584  +#endif
         1585  +
         1586  +; return 0; }
         1587  +EOF
         1588  +if eval $ac_link; then
         1589  +  rm -rf conftest*
         1590  +  eval "ac_cv_func_sin=yes"
         1591  +else
         1592  +  rm -rf conftest*
         1593  +  eval "ac_cv_func_sin=no"
         1594  +fi
         1595  +rm -f conftest*
         1596  +
         1597  +fi
         1598  +if eval "test \"`echo '$ac_cv_func_'sin`\" = yes"; then
         1599  +  echo "$ac_t""yes" 1>&6
         1600  +  :
         1601  +else
         1602  +  echo "$ac_t""no" 1>&6
         1603  +LIBS="-lm $LIBS"
         1604  +fi
         1605  +
         1606  +echo $ac_n "checking for -lieee""... $ac_c" 1>&6
         1607  +ac_lib_var=`echo ieee | tr '.-/+' '___p'`
         1608  +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
         1609  +  echo $ac_n "(cached) $ac_c" 1>&6
         1610  +else
         1611  +  ac_save_LIBS="$LIBS"
         1612  +LIBS="-lieee  $LIBS"
         1613  +cat > conftest.$ac_ext <<EOF
         1614  +#line 1615 "configure"
         1615  +#include "confdefs.h"
         1616  +
         1617  +int main() { return 0; }
         1618  +int t() {
         1619  +main()
         1620  +; return 0; }
         1621  +EOF
         1622  +if eval $ac_link; then
         1623  +  rm -rf conftest*
         1624  +  eval "ac_cv_lib_$ac_lib_var=yes"
         1625  +else
         1626  +  rm -rf conftest*
         1627  +  eval "ac_cv_lib_$ac_lib_var=no"
         1628  +fi
         1629  +rm -f conftest*
         1630  +LIBS="$ac_save_LIBS"
         1631  +
         1632  +fi
         1633  +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
         1634  +  echo "$ac_t""yes" 1>&6
         1635  +  LIBS="-lieee $LIBS"
         1636  +else
         1637  +  echo "$ac_t""no" 1>&6
         1638  +fi
         1639  +
         1640  +
         1641  +#--------------------------------------------------------------------
         1642  +#	Apparently SCO requires -lsocket for the gettimeofday()
         1643  +#	function.
         1644  +#--------------------------------------------------------------------
         1645  +
         1646  +echo $ac_n "checking for gettimeofday""... $ac_c" 1>&6
         1647  +if eval "test \"`echo '$''{'ac_cv_func_gettimeofday'+set}'`\" = set"; then
         1648  +  echo $ac_n "(cached) $ac_c" 1>&6
         1649  +else
         1650  +  cat > conftest.$ac_ext <<EOF
         1651  +#line 1652 "configure"
         1652  +#include "confdefs.h"
         1653  +/* System header to define __stub macros and hopefully few prototypes,
         1654  +    which can conflict with char gettimeofday(); below.  */
         1655  +#include <assert.h>
         1656  +/* Override any gcc2 internal prototype to avoid an error.  */
         1657  +char gettimeofday();
         1658  +
         1659  +int main() { return 0; }
         1660  +int t() {
         1661  +
         1662  +/* The GNU C library defines this for functions which it implements
         1663  +    to always fail with ENOSYS.  Some functions are actually named
         1664  +    something starting with __ and the normal name is an alias.  */
         1665  +#if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
         1666  +choke me
         1667  +#else
         1668  +gettimeofday();
         1669  +#endif
         1670  +
         1671  +; return 0; }
         1672  +EOF
         1673  +if eval $ac_link; then
         1674  +  rm -rf conftest*
         1675  +  eval "ac_cv_func_gettimeofday=yes"
         1676  +else
         1677  +  rm -rf conftest*
         1678  +  eval "ac_cv_func_gettimeofday=no"
         1679  +fi
         1680  +rm -f conftest*
         1681  +
         1682  +fi
         1683  +if eval "test \"`echo '$ac_cv_func_'gettimeofday`\" = yes"; then
         1684  +  echo "$ac_t""yes" 1>&6
         1685  +  :
         1686  +else
         1687  +  echo "$ac_t""no" 1>&6
         1688  +LIBS="-lsocket $LIBS"
         1689  +fi
         1690  +
         1691  +
         1692  +#--------------------------------------------------------------------
         1693  +#	If this system doesn't have a memmove procedure, use memcpy
         1694  +#	instead.
         1695  +#--------------------------------------------------------------------
         1696  +
         1697  +echo $ac_n "checking for memmove""... $ac_c" 1>&6
         1698  +if eval "test \"`echo '$''{'ac_cv_func_memmove'+set}'`\" = set"; then
         1699  +  echo $ac_n "(cached) $ac_c" 1>&6
         1700  +else
         1701  +  cat > conftest.$ac_ext <<EOF
         1702  +#line 1703 "configure"
         1703  +#include "confdefs.h"
         1704  +/* System header to define __stub macros and hopefully few prototypes,
         1705  +    which can conflict with char memmove(); below.  */
         1706  +#include <assert.h>
         1707  +/* Override any gcc2 internal prototype to avoid an error.  */
         1708  +char memmove();
         1709  +
         1710  +int main() { return 0; }
         1711  +int t() {
         1712  +
         1713  +/* The GNU C library defines this for functions which it implements
         1714  +    to always fail with ENOSYS.  Some functions are actually named
         1715  +    something starting with __ and the normal name is an alias.  */
         1716  +#if defined (__stub_memmove) || defined (__stub___memmove)
         1717  +choke me
         1718  +#else
         1719  +memmove();
         1720  +#endif
         1721  +
         1722  +; return 0; }
         1723  +EOF
         1724  +if eval $ac_link; then
         1725  +  rm -rf conftest*
         1726  +  eval "ac_cv_func_memmove=yes"
         1727  +else
         1728  +  rm -rf conftest*
         1729  +  eval "ac_cv_func_memmove=no"
         1730  +fi
         1731  +rm -f conftest*
         1732  +
         1733  +fi
         1734  +if eval "test \"`echo '$ac_cv_func_'memmove`\" = yes"; then
         1735  +  echo "$ac_t""yes" 1>&6
         1736  +  :
         1737  +else
         1738  +  echo "$ac_t""no" 1>&6
         1739  +cat >> confdefs.h <<\EOF
         1740  +#define memmove memcpy
         1741  +EOF
         1742  +
         1743  +fi
         1744  +
         1745  +
         1746  +#--------------------------------------------------------------------
         1747  +#	Figure out whether "char" is unsigned.  If so, set a
         1748  +#	#define.
         1749  +#--------------------------------------------------------------------
         1750  +
         1751  +echo $ac_n "checking type of "char"""... $ac_c" 1>&6
         1752  +if test "$cross_compiling" = yes; then
         1753  +    { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
         1754  +else
         1755  +cat > conftest.$ac_ext <<EOF
         1756  +#line 1757 "configure"
         1757  +#include "confdefs.h"
         1758  +
         1759  +int main()
         1760  +{
         1761  +    char c;
         1762  +    int i;
         1763  +    c = 0377;
         1764  +    i = c;
         1765  +    if (i == -1) {
         1766  +	exit(0);
         1767  +    }
         1768  +    exit(1);
         1769  +}
         1770  +EOF
         1771  +eval $ac_link
         1772  +if test -s conftest && (./conftest; exit) 2>/dev/null; then
         1773  +  tk_signed=1
         1774  +else
         1775  +  tk_signed=0
         1776  +fi
         1777  +fi
         1778  +rm -fr conftest*
         1779  +if test $tk_signed = 0; then
         1780  +    cat >> confdefs.h <<\EOF
         1781  +#define CHAR_UNSIGNED 1
         1782  +EOF
         1783  +
         1784  +    echo "$ac_t""unsigned" 1>&6
         1785  +else
         1786  +    echo "$ac_t""signed" 1>&6
         1787  +fi
         1788  +
         1789  +#--------------------------------------------------------------------
         1790  +#	SGI systems don't use the BSD form of the gettimeofday function,
         1791  +#	but they have a BSDgettimeofday function that can be used instead.
         1792  +#
         1793  +#	Also, check for the existence of a gettimeofday declaration,
         1794  +#	to tkPort.h can declare it if it isn't already declared.
         1795  +#--------------------------------------------------------------------
         1796  +
         1797  +echo $ac_n "checking for BSDgettimeofday""... $ac_c" 1>&6
         1798  +if eval "test \"`echo '$''{'ac_cv_func_BSDgettimeofday'+set}'`\" = set"; then
         1799  +  echo $ac_n "(cached) $ac_c" 1>&6
         1800  +else
         1801  +  cat > conftest.$ac_ext <<EOF
         1802  +#line 1803 "configure"
         1803  +#include "confdefs.h"
         1804  +/* System header to define __stub macros and hopefully few prototypes,
         1805  +    which can conflict with char BSDgettimeofday(); below.  */
         1806  +#include <assert.h>
         1807  +/* Override any gcc2 internal prototype to avoid an error.  */
         1808  +char BSDgettimeofday();
         1809  +
         1810  +int main() { return 0; }
         1811  +int t() {
         1812  +
         1813  +/* The GNU C library defines this for functions which it implements
         1814  +    to always fail with ENOSYS.  Some functions are actually named
         1815  +    something starting with __ and the normal name is an alias.  */
         1816  +#if defined (__stub_BSDgettimeofday) || defined (__stub___BSDgettimeofday)
         1817  +choke me
         1818  +#else
         1819  +BSDgettimeofday();
         1820  +#endif
         1821  +
         1822  +; return 0; }
         1823  +EOF
         1824  +if eval $ac_link; then
         1825  +  rm -rf conftest*
         1826  +  eval "ac_cv_func_BSDgettimeofday=yes"
         1827  +else
         1828  +  rm -rf conftest*
         1829  +  eval "ac_cv_func_BSDgettimeofday=no"
         1830  +fi
         1831  +rm -f conftest*
         1832  +
         1833  +fi
         1834  +if eval "test \"`echo '$ac_cv_func_'BSDgettimeofday`\" = yes"; then
         1835  +  echo "$ac_t""yes" 1>&6
         1836  +  cat >> confdefs.h <<\EOF
         1837  +#define HAVE_BSDGETTIMEOFDAY 1
         1838  +EOF
         1839  +
         1840  +else
         1841  +  echo "$ac_t""no" 1>&6
         1842  +fi
         1843  +
         1844  +echo $ac_n "checking for gettimeofday declaration""... $ac_c" 1>&6
         1845  +cat > conftest.$ac_ext <<EOF
         1846  +#line 1847 "configure"
         1847  +#include "confdefs.h"
         1848  +#include <sys/time.h>
         1849  +EOF
         1850  +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
         1851  +  egrep "gettimeofday" >/dev/null 2>&1; then
         1852  +  rm -rf conftest*
         1853  +  echo "$ac_t""present" 1>&6
         1854  +else
         1855  +  rm -rf conftest*
         1856  +  
         1857  +    echo "$ac_t""missing" 1>&6
         1858  +    cat >> confdefs.h <<\EOF
         1859  +#define GETTOD_NOT_DECLARED 1
         1860  +EOF
         1861  +
         1862  +
         1863  +fi
         1864  +rm -f conftest*
         1865  +
         1866  +
         1867  +#--------------------------------------------------------------------
         1868  +#	Under Solaris 2.4, strtod returns the wrong value for the
         1869  +#	terminating character under some conditions.  Check for this
         1870  +#	and if the problem exists use a substitute procedure
         1871  +#	"fixstrtod" (provided by Tcl) that corrects the error.
         1872  +#--------------------------------------------------------------------
         1873  +
         1874  +echo $ac_n "checking for strtod""... $ac_c" 1>&6
         1875  +if eval "test \"`echo '$''{'ac_cv_func_strtod'+set}'`\" = set"; then
         1876  +  echo $ac_n "(cached) $ac_c" 1>&6
         1877  +else
         1878  +  cat > conftest.$ac_ext <<EOF
         1879  +#line 1880 "configure"
         1880  +#include "confdefs.h"
         1881  +/* System header to define __stub macros and hopefully few prototypes,
         1882  +    which can conflict with char strtod(); below.  */
         1883  +#include <assert.h>
         1884  +/* Override any gcc2 internal prototype to avoid an error.  */
         1885  +char strtod();
         1886  +
         1887  +int main() { return 0; }
         1888  +int t() {
         1889  +
         1890  +/* The GNU C library defines this for functions which it implements
         1891  +    to always fail with ENOSYS.  Some functions are actually named
         1892  +    something starting with __ and the normal name is an alias.  */
         1893  +#if defined (__stub_strtod) || defined (__stub___strtod)
         1894  +choke me
         1895  +#else
         1896  +strtod();
         1897  +#endif
         1898  +
         1899  +; return 0; }
         1900  +EOF
         1901  +if eval $ac_link; then
         1902  +  rm -rf conftest*
         1903  +  eval "ac_cv_func_strtod=yes"
         1904  +else
         1905  +  rm -rf conftest*
         1906  +  eval "ac_cv_func_strtod=no"
         1907  +fi
         1908  +rm -f conftest*
         1909  +
         1910  +fi
         1911  +if eval "test \"`echo '$ac_cv_func_'strtod`\" = yes"; then
         1912  +  echo "$ac_t""yes" 1>&6
         1913  +  tk_strtod=1
         1914  +else
         1915  +  echo "$ac_t""no" 1>&6
         1916  +tk_strtod=0
         1917  +fi
         1918  +
         1919  +if test "$tk_strtod" = 1; then
         1920  +    echo $ac_n "checking for Solaris 2.4 strtod bug""... $ac_c" 1>&6
         1921  +    if test "$cross_compiling" = yes; then
         1922  +    { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
         1923  +else
         1924  +cat > conftest.$ac_ext <<EOF
         1925  +#line 1926 "configure"
         1926  +#include "confdefs.h"
         1927  +
         1928  +	extern double strtod();
         1929  +	int main()
         1930  +	{
         1931  +	    char *string = "NaN";
         1932  +	    char *term;
         1933  +	    strtod(string, &term);
         1934  +	    if ((term != string) && (term[-1] == 0)) {
         1935  +		exit(1);
         1936  +	    }
         1937  +	    exit(0);
         1938  +	}
         1939  +EOF
         1940  +eval $ac_link
         1941  +if test -s conftest && (./conftest; exit) 2>/dev/null; then
         1942  +  echo "$ac_t""ok" 1>&6
         1943  +else
         1944  +  
         1945  +	    echo "$ac_t""buggy" 1>&6
         1946  +	    cat >> confdefs.h <<\EOF
         1947  +#define strtod fixstrtod
         1948  +EOF
         1949  +
         1950  +	
         1951  +fi
         1952  +fi
         1953  +rm -fr conftest*
         1954  +fi
         1955  +
         1956  +#--------------------------------------------------------------------
         1957  +#	Locate the Tcl header files and the Tcl library
         1958  +#	archive.
         1959  +#--------------------------------------------------------------------
         1960  +
         1961  +echo $ac_n "checking for -ltcl8.2""... $ac_c" 1>&6
         1962  +ac_lib_var=`echo tcl8.2 | tr '.-/+' '___p'`
         1963  +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
         1964  +  echo $ac_n "(cached) $ac_c" 1>&6
         1965  +else
         1966  +  ac_save_LIBS="$LIBS"
         1967  +LIBS="-ltcl8.2  $LIBS"
         1968  +cat > conftest.$ac_ext <<EOF
         1969  +#line 1970 "configure"
         1970  +#include "confdefs.h"
         1971  +
         1972  +int main() { return 0; }
         1973  +int t() {
         1974  +Tcl_Init()
         1975  +; return 0; }
         1976  +EOF
         1977  +if eval $ac_link; then
         1978  +  rm -rf conftest*
         1979  +  eval "ac_cv_lib_$ac_lib_var=yes"
         1980  +else
         1981  +  rm -rf conftest*
         1982  +  eval "ac_cv_lib_$ac_lib_var=no"
         1983  +fi
         1984  +rm -f conftest*
         1985  +LIBS="$ac_save_LIBS"
         1986  +
         1987  +fi
         1988  +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
         1989  +  echo "$ac_t""yes" 1>&6
         1990  +  LIBS="-ltcl8.2 $LIBS"; got_it=yes
         1991  +else
         1992  +  echo "$ac_t""no" 1>&6
         1993  +echo "configure: warning: couldn't find tcl8.2 library archive" 1>&2 
         1994  +fi
         1995  +
         1996  +cat > conftest.$ac_ext <<EOF
         1997  +#line 1998 "configure"
         1998  +#include "confdefs.h"
         1999  +#include "tcl.h"
         2000  +EOF
         2001  +eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
         2002  +ac_err=`grep -v '^ *+' conftest.out`
         2003  +if test -z "$ac_err"; then
         2004  +  :
         2005  +else
         2006  +  echo "$ac_err" >&5
         2007  +  rm -rf conftest*
         2008  +  echo "configure: warning: couldn't find tcl include file" 1>&2 
         2009  +fi
         2010  +rm -f conftest*
         2011  +
         2012  +trap '' 1 2 15
         2013  +cat > confcache <<\EOF
         2014  +# This file is a shell script that caches the results of configure
         2015  +# tests run on this system so they can be shared between configure
         2016  +# scripts and configure runs.  It is not useful on other systems.
         2017  +# If it contains results you don't want to keep, you may remove or edit it.
         2018  +#
         2019  +# By default, configure uses ./config.cache as the cache file,
         2020  +# creating it if it does not exist already.  You can give configure
         2021  +# the --cache-file=FILE option to use a different cache file; that is
         2022  +# what configure does when it calls configure scripts in
         2023  +# subdirectories, so they share the cache.
         2024  +# Giving --cache-file=/dev/null disables caching, for debugging configure.
         2025  +# config.status only pays attention to the cache file if you give it the
         2026  +# --recheck option to rerun configure.
         2027  +#
         2028  +EOF
         2029  +# Ultrix sh set writes to stderr and can't be redirected directly,
         2030  +# and sets the high bit in the cache file unless we assign to the vars.
         2031  +(set) 2>&1 |
         2032  +  sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=\${\1='\2'}/p" \
         2033  +  >> confcache
         2034  +if cmp -s $cache_file confcache; then
         2035  +  :
         2036  +else
         2037  +  if test -w $cache_file; then
         2038  +    echo "updating cache $cache_file"
         2039  +    cat confcache > $cache_file
         2040  +  else
         2041  +    echo "not updating unwritable cache $cache_file"
         2042  +  fi
         2043  +fi
         2044  +rm -f confcache
         2045  +
         2046  +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
         2047  +
         2048  +test "x$prefix" = xNONE && prefix=$ac_default_prefix
         2049  +# Let make expand exec_prefix.
         2050  +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
         2051  +
         2052  +# Any assignment to VPATH causes Sun make to only execute
         2053  +# the first set of double-colon rules, so remove it if not needed.
         2054  +# If there is a colon in the path, we need to keep it.
         2055  +if test "x$srcdir" = x.; then
         2056  +  ac_vpsub='/^[ 	]*VPATH[ 	]*=[^:]*$/d'
         2057  +fi
         2058  +
         2059  +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
         2060  +
         2061  +# Transform confdefs.h into DEFS.
         2062  +# Protect against shell expansion while executing Makefile rules.
         2063  +# Protect against Makefile macro expansion.
         2064  +cat > conftest.defs <<\EOF
         2065  +s%#define \([A-Za-z_][A-Za-z0-9_]*\) \(.*\)%-D\1=\2%g
         2066  +s%[ 	`~#$^&*(){}\\|;'"<>?]%\\&%g
         2067  +s%\[%\\&%g
         2068  +s%\]%\\&%g
         2069  +s%\$%$$%g
         2070  +EOF
         2071  +DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '`
         2072  +rm -f conftest.defs
         2073  +
         2074  +
         2075  +# Without the "./", some shells look in PATH for config.status.
         2076  +: ${CONFIG_STATUS=./config.status}
         2077  +
         2078  +echo creating $CONFIG_STATUS
         2079  +rm -f $CONFIG_STATUS
         2080  +cat > $CONFIG_STATUS <<EOF
         2081  +#! /bin/sh
         2082  +# Generated automatically by configure.
         2083  +# Run this file to recreate the current configuration.
         2084  +# This directory was configured as follows,
         2085  +# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
         2086  +#
         2087  +# $0 $ac_configure_args
         2088  +#
         2089  +# Compiler output produced by configure, useful for debugging
         2090  +# configure, is in ./config.log if it exists.
         2091  +
         2092  +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
         2093  +for ac_option
         2094  +do
         2095  +  case "\$ac_option" in
         2096  +  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
         2097  +    echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
         2098  +    exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
         2099  +  -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
         2100  +    echo "$CONFIG_STATUS generated by autoconf version 2.7"
         2101  +    exit 0 ;;
         2102  +  -help | --help | --hel | --he | --h)
         2103  +    echo "\$ac_cs_usage"; exit 0 ;;
         2104  +  *) echo "\$ac_cs_usage"; exit 1 ;;
         2105  +  esac
         2106  +done
         2107  +
         2108  +ac_given_srcdir=$srcdir
         2109  +ac_given_INSTALL="$INSTALL"
         2110  +
         2111  +trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
         2112  +EOF
         2113  +cat >> $CONFIG_STATUS <<EOF
         2114  +
         2115  +# Protect against being on the right side of a sed subst in config.status.
         2116  +sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
         2117  + s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
         2118  +$ac_vpsub
         2119  +$extrasub
         2120  +s%@CFLAGS@%$CFLAGS%g
         2121  +s%@CPPFLAGS@%$CPPFLAGS%g
         2122  +s%@CXXFLAGS@%$CXXFLAGS%g
         2123  +s%@DEFS@%$DEFS%g
         2124  +s%@LDFLAGS@%$LDFLAGS%g
         2125  +s%@LIBS@%$LIBS%g
         2126  +s%@exec_prefix@%$exec_prefix%g
         2127  +s%@prefix@%$prefix%g
         2128  +s%@program_transform_name@%$program_transform_name%g
         2129  +s%@bindir@%$bindir%g
         2130  +s%@sbindir@%$sbindir%g
         2131  +s%@libexecdir@%$libexecdir%g
         2132  +s%@datadir@%$datadir%g
         2133  +s%@sysconfdir@%$sysconfdir%g
         2134  +s%@sharedstatedir@%$sharedstatedir%g
         2135  +s%@localstatedir@%$localstatedir%g
         2136  +s%@libdir@%$libdir%g
         2137  +s%@includedir@%$includedir%g
         2138  +s%@oldincludedir@%$oldincludedir%g
         2139  +s%@infodir@%$infodir%g
         2140  +s%@mandir@%$mandir%g
         2141  +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
         2142  +s%@INSTALL_DATA@%$INSTALL_DATA%g
         2143  +s%@RANLIB@%$RANLIB%g
         2144  +s%@CWISH@%$CWISH%g
         2145  +s%@CC@%$CC%g
         2146  +s%@CPP@%$CPP%g
         2147  +
         2148  +CEOF
         2149  +EOF
         2150  +cat >> $CONFIG_STATUS <<EOF
         2151  +
         2152  +CONFIG_FILES=\${CONFIG_FILES-"Makefile"}
         2153  +EOF
         2154  +cat >> $CONFIG_STATUS <<\EOF
         2155  +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
         2156  +  # Support "outfile[:infile]", defaulting infile="outfile.in".
         2157  +  case "$ac_file" in
         2158  +  *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'`
         2159  +       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
         2160  +  *) ac_file_in="${ac_file}.in" ;;
         2161  +  esac
         2162  +
         2163  +  # Adjust relative srcdir, etc. for subdirectories.
         2164  +
         2165  +  # Remove last slash and all that follows it.  Not all systems have dirname.
         2166  +  ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
         2167  +  if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
         2168  +    # The file is in a subdirectory.
         2169  +    test ! -d "$ac_dir" && mkdir "$ac_dir"
         2170  +    ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
         2171  +    # A "../" for each directory in $ac_dir_suffix.
         2172  +    ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
         2173  +  else
         2174  +    ac_dir_suffix= ac_dots=
         2175  +  fi
         2176  +
         2177  +  case "$ac_given_srcdir" in
         2178  +  .)  srcdir=.
         2179  +      if test -z "$ac_dots"; then top_srcdir=.
         2180  +      else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
         2181  +  /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
         2182  +  *) # Relative path.
         2183  +    srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
         2184  +    top_srcdir="$ac_dots$ac_given_srcdir" ;;
         2185  +  esac
         2186  +
         2187  +  case "$ac_given_INSTALL" in
         2188  +  [/$]*) INSTALL="$ac_given_INSTALL" ;;
         2189  +  *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
         2190  +  esac
         2191  +  echo creating "$ac_file"
         2192  +  rm -f "$ac_file"
         2193  +  configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
         2194  +  case "$ac_file" in
         2195  +  *Makefile*) ac_comsub="1i\\
         2196  +# $configure_input" ;;
         2197  +  *) ac_comsub= ;;
         2198  +  esac
         2199  +  sed -e "$ac_comsub
         2200  +s%@configure_input@%$configure_input%g
         2201  +s%@srcdir@%$srcdir%g
         2202  +s%@top_srcdir@%$top_srcdir%g
         2203  +s%@INSTALL@%$INSTALL%g
         2204  +" -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file
         2205  +fi; done
         2206  +rm -f conftest.subs
         2207  +
         2208  +
         2209  +
         2210  +exit 0
         2211  +EOF
         2212  +chmod +x $CONFIG_STATUS
         2213  +rm -fr confdefs* $ac_clean_files
         2214  +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
         2215  +

Added configure.in version [43ffbc82cf].

            1  +dnl	This file is an input file used by the GNU "autoconf" program to
            2  +dnl	generate the file "configure", which is run during Tk installation
            3  +dnl	to configure the system for the local environment.
            4  +AC_INIT(tk.h)
            5  +
            6  +# @(#) $Id: ctk.shar,v 1.50 1996/01/15 14:47:16 andrewm Exp andrewm $
            7  +
            8  +AC_ARG_WITH(ncurses,
            9  +	[  --with-ncurses   use ncurses library instead of curses],
           10  +	, [with_ncurses=no])
           11  +AC_ARG_WITH(libdirs,
           12  +	[  --with-libdirs   directories to add to library search path])
           13  +AC_ARG_WITH(incdirs,
           14  +	[  --with-incdirs   directories to add to include search path])
           15  +
           16  +for ldir in $with_libdirs ;do
           17  +    LDFLAGS="$LDFLAGS -L$ldir"
           18  +done
           19  +for idir in $with_incdirs ;do
           20  +    CPPFLAGS="$CPPFLAGS -I$idir"
           21  +done
           22  +
           23  +AC_PROG_INSTALL
           24  +AC_PROG_RANLIB
           25  +AC_PREFIX(cwish)
           26  +CC=${CC-cc}
           27  +AC_SUBST(CC)
           28  +AC_HAVE_HEADERS(unistd.h limits.h)
           29  +
           30  +#--------------------------------------------------------------------
           31  +#	Include sys/select.h if it exists and if it supplies things
           32  +#	that appear to be useful and aren't already in sys/types.h.
           33  +#	This appears to be true only on the RS/6000 under AIX.  Some
           34  +#	systems like OSF/1 have a sys/select.h that's of no use, and
           35  +#	other systems like SCO UNIX have a sys/select.h that's
           36  +#	pernicious.  If "fd_set" isn't defined anywhere then set a
           37  +#	special flag.
           38  +#--------------------------------------------------------------------
           39  +
           40  +AC_MSG_CHECKING([fd_set and sys/select])
           41  +AC_TRY_COMPILE([#include <sys/types.h>],
           42  +	[fd_set readMask, writeMask;], tk_ok=yes, tk_ok=no)
           43  +if test $tk_ok = no; then
           44  +    AC_HEADER_EGREP(fd_mask, sys/select.h, tk_ok=yes)
           45  +    if test $tk_ok = yes; then
           46  +	AC_DEFINE(HAVE_SYS_SELECT_H)
           47  +    fi
           48  +fi
           49  +AC_MSG_RESULT($tk_ok)
           50  +if test $tk_ok = no; then
           51  +    AC_DEFINE(NO_FD_SET)
           52  +fi
           53  +
           54  +#--------------------------------------------------------------------
           55  +#	Supply a substitute for stdlib.h if it doesn't define strtol,
           56  +#	strtoul, or strtod (which it doesn't in some versions of SunOS).
           57  +#--------------------------------------------------------------------
           58  +
           59  +AC_MSG_CHECKING(stdlib.h)
           60  +AC_HEADER_EGREP(strtol, stdlib.h, tk_ok=yes, tk_ok=no)
           61  +AC_HEADER_EGREP(strtoul, stdlib.h, , tk_ok=no)
           62  +AC_HEADER_EGREP(strtod, stdlib.h, , tk_ok=no)
           63  +if test $tk_ok = no; then
           64  +    AC_DEFINE(NO_STDLIB_H)
           65  +fi
           66  +AC_MSG_RESULT($tk_ok)
           67  +
           68  +#--------------------------------------------------------------------
           69  +#	Check for various typedefs and provide substitutes if
           70  +#	they don't exist.
           71  +#--------------------------------------------------------------------
           72  +
           73  +AC_MODE_T
           74  +AC_PID_T
           75  +AC_SIZE_T
           76  +AC_UID_T
           77  +
           78  +#--------------------------------------------------------------------
           79  +#	Locate the curses header files and the curses library
           80  +#	archive.
           81  +#--------------------------------------------------------------------
           82  +
           83  +got_it=no
           84  +if test $with_ncurses = yes; then
           85  +    AC_CHECK_LIB(ncurses, initscr,
           86  +	    [LIBS="$LIBS -lncurses"; got_it=yes])
           87  +else
           88  +    AC_CHECK_LIB(curses, initscr,
           89  +	    [LIBS="$LIBS -lcurses"; got_it=yes],
           90  +	    [unset ac_cv_lib_curses
           91  +	    AC_CHECK_LIB(curses, initscr,
           92  +		    [LIBS="$LIBS -lcurses -ltermcap"; got_it=yes],
           93  +		    ,
           94  +		    [-ltermcap])] )
           95  +fi
           96  +if test $got_it = no; then
           97  +    AC_MSG_WARN(couldn't find curses library archive)
           98  +    AC_MSG_WARN(will not be able to properly determine curses capabilities)
           99  +fi
          100  +
          101  +AC_MSG_CHECKING([curses header file])
          102  +got_it=no
          103  +if test $with_ncurses = yes; then
          104  +    AC_TRY_CPP([#include <ncurses.h>],
          105  +	    [got_it=ncurses.h; AC_DEFINE(USE_NCURSES_H)])
          106  +fi
          107  +if test $got_it = no; then
          108  +    AC_TRY_CPP([#include <curses.h>], got_it=curses.h)
          109  +fi
          110  +if test $got_it = no; then
          111  +    AC_MSG_WARN(couldn't find curses include file)
          112  +fi
          113  +AC_MSG_RESULT($got_it)
          114  +
          115  +#--------------------------------------------------------------------
          116  +#	Check the curses library features.
          117  +#--------------------------------------------------------------------
          118  +
          119  +AC_HAVE_FUNCS(curs_set set_term beep keypad)
          120  +
          121  +#--------------------------------------------------------------------
          122  +#	Check to see whether the system supports the matherr function
          123  +#	and its associated type "struct exception".
          124  +#--------------------------------------------------------------------
          125  +
          126  +AC_MSG_CHECKING([matherr support])
          127  +AC_TRY_COMPILE([#include <math.h>], [
          128  +struct exception x;
          129  +x.type = DOMAIN;
          130  +x.type = SING;
          131  +], tk_ok=yes, tk_ok=no)
          132  +AC_MSG_RESULT($tk_ok)
          133  +if test $tk_ok = yes; then
          134  +    AC_DEFINE(NEED_MATHERR)
          135  +fi
          136  +
          137  +#--------------------------------------------------------------------
          138  +#	Figure out how to find out whether a FILE structure contains
          139  +#	buffered readable data.  Some known names for the count field:
          140  +#		_cnt:		Most UNIX systems
          141  +#		__cnt:		HPUX
          142  +#		_r:		BSD
          143  +#		readCount:	Sprite
          144  +#	Or, in GNU libc there are two fields, _gptr and _egptr, which
          145  +#	have to be compared.
          146  +#--------------------------------------------------------------------
          147  +
          148  +AC_MSG_CHECKING([count field in FILE structures])
          149  +AC_TRY_COMPILE([#include <stdio.h>],
          150  +	[FILE *f = stdin; f->_cnt = 0;], fcnt="_cnt", )
          151  +if test "$fcnt" = ""; then
          152  +    AC_TRY_COMPILE([#include <stdio.h>],
          153  +	[FILE *f = stdin; f->__cnt = 0;], fcnt="__cnt", )
          154  +fi
          155  +if test "$fcnt" = ""; then
          156  +    AC_TRY_COMPILE([#include <stdio.h>],
          157  +	[FILE *f = stdin; f->_r = 0;], fcnt="_r", )
          158  +fi
          159  +if test "$fcnt" = ""; then
          160  +    AC_TRY_COMPILE([#include <stdio.h>],
          161  +	[FILE *f = stdin; f->readCount = 0;], fcnt="readCount", )
          162  +fi
          163  +if test "$fcnt" != ""; then
          164  +    AC_DEFINE_UNQUOTED(TK_FILE_COUNT, $fcnt)
          165  +fi
          166  +if test "$fcnt" = ""; then
          167  +    AC_TRY_COMPILE([#include <stdio.h>],
          168  +	[FILE *f = stdin; f->_gptr = f->_egptr;],
          169  +	tk_ok=yes, tk_ok=no)
          170  +    if test $tk_ok = yes; then
          171  +	AC_DEFINE(TK_FILE_GPTR)
          172  +	fcnt="_gptr/_egptr"
          173  +    fi
          174  +fi
          175  +if test "$fcnt" = ""; then
          176  +    AC_TRY_COMPILE([#include <stdio.h>],
          177  +	[FILE *f = stdin; f->_IO_read_ptr = f->_IO_read_end;],
          178  +	tk_ok=yes, tk_ok=no)
          179  +    if test $tk_ok = yes; then
          180  +	AC_DEFINE(TK_FILE_READ_PTR)
          181  +	fcnt="_IO_read_ptr/_IO_read_end"
          182  +    fi
          183  +fi
          184  +if test "$fcnt" = ""; then
          185  +    AC_MSG_RESULT([not found; must supply TkReadDataPending procedure])
          186  +else
          187  +    AC_MSG_RESULT("$fcnt")
          188  +fi
          189  +
          190  +#--------------------------------------------------------------------
          191  +#	On a few very rare systems, all of the libm.a stuff is
          192  +#	already in libc.a.  Set compiler flags accordingly.
          193  +#	Also, Linux requires the "ieee" library for math to
          194  +#	work right (and it must appear before "-lm").
          195  +#--------------------------------------------------------------------
          196  +
          197  +AC_CHECK_FUNC(sin, , [LIBS="-lm $LIBS"])
          198  +AC_CHECK_LIB(ieee, main, [LIBS="-lieee $LIBS"])
          199  +
          200  +#--------------------------------------------------------------------
          201  +#	Apparently SCO requires -lsocket for the gettimeofday()
          202  +#	function.
          203  +#--------------------------------------------------------------------
          204  +
          205  +AC_CHECK_FUNC(gettimeofday, , [LIBS="-lsocket $LIBS"])
          206  +
          207  +#--------------------------------------------------------------------
          208  +#	If this system doesn't have a memmove procedure, use memcpy
          209  +#	instead.
          210  +#--------------------------------------------------------------------
          211  +
          212  +AC_CHECK_FUNC(memmove, , [AC_DEFINE(memmove, memcpy)])
          213  +
          214  +#--------------------------------------------------------------------
          215  +#	Figure out whether "char" is unsigned.  If so, set a
          216  +#	#define.
          217  +#--------------------------------------------------------------------
          218  +
          219  +AC_MSG_CHECKING(type of "char")
          220  +AC_TRY_RUN([
          221  +int main()
          222  +{
          223  +    char c;
          224  +    int i;
          225  +    c = 0377;
          226  +    i = c;
          227  +    if (i == -1) {
          228  +	exit(0);
          229  +    }
          230  +    exit(1);
          231  +}], tk_signed=1, tk_signed=0)
          232  +if test $tk_signed = 0; then
          233  +    AC_DEFINE(CHAR_UNSIGNED)
          234  +    AC_MSG_RESULT(unsigned)
          235  +else
          236  +    AC_MSG_RESULT(signed)
          237  +fi
          238  +
          239  +#--------------------------------------------------------------------
          240  +#	SGI systems don't use the BSD form of the gettimeofday function,
          241  +#	but they have a BSDgettimeofday function that can be used instead.
          242  +#
          243  +#	Also, check for the existence of a gettimeofday declaration,
          244  +#	to tkPort.h can declare it if it isn't already declared.
          245  +#--------------------------------------------------------------------
          246  +
          247  +AC_CHECK_FUNC(BSDgettimeofday, AC_DEFINE(HAVE_BSDGETTIMEOFDAY))
          248  +AC_MSG_CHECKING([for gettimeofday declaration])
          249  +AC_EGREP_HEADER(gettimeofday, sys/time.h, AC_MSG_RESULT(present), [
          250  +    AC_MSG_RESULT(missing)
          251  +    AC_DEFINE(GETTOD_NOT_DECLARED)
          252  +])
          253  +
          254  +#--------------------------------------------------------------------
          255  +#	Under Solaris 2.4, strtod returns the wrong value for the
          256  +#	terminating character under some conditions.  Check for this
          257  +#	and if the problem exists use a substitute procedure
          258  +#	"fixstrtod" (provided by Tcl) that corrects the error.
          259  +#--------------------------------------------------------------------
          260  +
          261  +AC_CHECK_FUNC(strtod, tk_strtod=1, tk_strtod=0)
          262  +if test "$tk_strtod" = 1; then
          263  +    AC_MSG_CHECKING([for Solaris 2.4 strtod bug])
          264  +    AC_TRY_RUN([
          265  +	extern double strtod();
          266  +	int main()
          267  +	{
          268  +	    char *string = "NaN";
          269  +	    char *term;
          270  +	    strtod(string, &term);
          271  +	    if ((term != string) && (term[-1] == 0)) {
          272  +		exit(1);
          273  +	    }
          274  +	    exit(0);
          275  +	}], AC_MSG_RESULT(ok), [
          276  +	    AC_MSG_RESULT(buggy)
          277  +	    AC_DEFINE(strtod, fixstrtod)
          278  +	])
          279  +fi
          280  +
          281  +#--------------------------------------------------------------------
          282  +#	Locate the Tcl header files and the Tcl library
          283  +#	archive.
          284  +#--------------------------------------------------------------------
          285  +
          286  +AC_CHECK_LIB(tcl, Tcl_Init, [LIBS="-ltcl8.0 $LIBS"; got_it=yes],
          287  +    [AC_MSG_WARN(couldn't find tcl8.0 library archive)] )
          288  +AC_TRY_CPP([#include "tcl.h"], ,
          289  +    [AC_MSG_WARN(couldn't find tcl include file)] )
          290  +
          291  +AC_OUTPUT(Makefile)

Added ctk.tcl version [e5557e7784].

            1  +#! /usr/bin/env tclsh
            2  +
            3  +load ./libctk.so Tk
            4  +
            5  +namespace eval ::pkcs11_getfile {}
            6  +unset -nocomplain ::pkcs11_getfile::pkcs11file
            7  +
            8  +# Curses Tk lacks a "tk_getOpenFile" dialog, we create a simple input dialog
            9  +toplevel .pkcs11_getfile
           10  +label .pkcs11_getfile.lblInput -text "Please enter the pathname to a working PKCS#11 Module"
           11  +entry .pkcs11_getfile.entInput
           12  +button .pkcs11_getfile.btnOK -text "OK" -command {
           13  +	set ::pkcs11_getfile::pkcs11file [.pkcs11_getfile.entInput get]
           14  +
           15  +	destroy .pkcs11_getfile
           16  +}
           17  +button .pkcs11_getfile.btnCancel -text "Cancel" -command {
           18  +	destroy .pkcs11_getfile
           19  +
           20  +	set ::pkcs11_getfile::pkcs11file ""
           21  +}
           22  +
           23  +pack .pkcs11_getfile.lblInput
           24  +pack .pkcs11_getfile.entInput
           25  +pack .pkcs11_getfile.btnOK .pkcs11_getfile.btnCancel
           26  +
           27  +focus .pkcs11_getfile.entInput
           28  +
           29  +tkwait variable ::pkcs11_getfile::pkcs11file
           30  +set pkcs11file $::pkcs11_getfile::pkcs11file
           31  +

Added ctkDisplay.c version [3bae6f7cbc].

            1  +/* 
            2  + * ctkDisplay.c (CTk) --
            3  + *
            4  + *	CTK display functions (hides all curses functions).
            5  + *
            6  + * Copyright (c) 1994-1995 Cleveland Clinic Foundation
            7  + *
            8  + * See the file "license.terms" for information on usage and redistribution
            9  + * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
           10  + *
           11  + * @(#) $Id: ctk.shar,v 1.50 1996/01/15 14:47:16 andrewm Exp andrewm $
           12  + */
           13  +
           14  +#include "tkPort.h"
           15  +#include "tkInt.h"
           16  +#include <sys/times.h>
           17  +#ifdef USE_NCURSES_H
           18  +#   include <ncurses.h>
           19  +#else
           20  +#   include <curses.h>
           21  +#endif
           22  +
           23  +#ifdef CLK_TCK
           24  +#   define MS_PER_CLOCK	(1000.0/CLK_TCK)
           25  +#elif defined HZ
           26  +#   define MS_PER_CLOCK	(1000.0/HZ)
           27  +#else
           28  +    /*
           29  +     * If all else fails, assume 60 clock ticks per second -
           30  +     * hope that is okay!
           31  +     */
           32  +#   define MS_PER_CLOCK	(1000.0/60)
           33  +#endif
           34  +
           35  +/*
           36  + * Definitions for weak curses implementations.
           37  + */
           38  +
           39  +#ifndef ACS_ULCORNER
           40  +/*
           41  + * This curses does not define the alternate character set constants.
           42  + * Define them locally.
           43  + */
           44  +#   define ACS_ULCORNER    '+'
           45  +#   define ACS_LLCORNER    '+'
           46  +#   define ACS_URCORNER    '+'
           47  +#   define ACS_LRCORNER    '+'
           48  +#   define ACS_HLINE       '-'
           49  +#   define ACS_VLINE       '|'
           50  +#   define ACS_PLUS        '+'
           51  +#endif /* ACS_ULCORNER */
           52  +
           53  +#ifndef HAVE_CURS_SET
           54  +/*
           55  + * Don't have curs_set() function - ignore it.
           56  + *
           57  + * The cursor gets pretty annoying, but haven't found any other
           58  + * way to turn it off.
           59  + */
           60  +#   define curs_set(mode)	((void) 0)
           61  +#endif
           62  +
           63  +#ifndef A_STANDOUT
           64  +    typedef int chtype;
           65  +#   define attrset(attr)	((attr) ? standout() : standend())
           66  +#   define A_STANDOUT	1
           67  +#   define A_INVIS	0
           68  +#   define A_NORMAL	0
           69  +#   define A_UNDERLINE	0
           70  +#   define A_REVERSE	0
           71  +#   define A_DIM	0
           72  +#   define A_BOLD	0
           73  +#   define A_DIM	0
           74  +#   define A_BOLD	0
           75  +#   define A_REVERSE	0
           76  +#endif
           77  +
           78  +#ifdef HAVE_SET_TERM
           79  +#   define SetDisplay(dispPtr) \
           80  +	if (curDispPtr != (dispPtr)) \
           81  +	set_term((SCREEN *) (curDispPtr = (dispPtr))->display)
           82  +#else
           83  +#   define SetDisplay(dispPtr)		((void) 0)
           84  +#   define newterm(type, outPtr, inPtr)	initscr()
           85  +#endif
           86  +
           87  +#ifndef HAVE_KEYPAD
           88  +#   define keypad(win, flag)		((void) 0)
           89  +#endif
           90  +
           91  +#ifndef HAVE_BEEP
           92  +#   define beep()			((void) 0)
           93  +#endif
           94  +
           95  +/*
           96  + * Macros for the most often used curses operations.  This
           97  + * will hopefully help if someone wants to convert to a different
           98  + * terminal I/O library (like DOS BIOS?).
           99  + */
          100  +#define Move(x,y)		move(y,x)
          101  +#define PutChar(ch)		addch(ch)
          102  +#define SetStyle(style)		attrset(styleAttributes[style])
          103  +
          104  +
          105  +/*
          106  + * TextInfo - client data passed to DrawTextSpan() when drawing text.
          107  + */
          108  +typedef struct {
          109  +    char *str;		/* String being drawn. */
          110  +    int left;		/* Absolute X coordinate to draw first character
          111  +    			 * of string at. */
          112  +} TextInfo;
          113  +
          114  +/*
          115  + * Curses attributes that correspond to CTk styles.
          116  + * This definition must be modified in concert with
          117  + * the Ctk_Style definition in tk.h
          118  + */
          119  +chtype styleAttributes[] = {
          120  +    A_NORMAL, A_NORMAL, A_UNDERLINE, A_REVERSE, A_DIM, A_BOLD,
          121  +    A_DIM, A_BOLD, A_STANDOUT, A_REVERSE
          122  +};
          123  +
          124  +/*
          125  + * Current display for input/output.  Changed by SetDisplay().
          126  + */
          127  +
          128  +TkDisplay *curDispPtr = NULL;
          129  +
          130  +/*
          131  + * The data structure and hash table below are used to map from
          132  + * raw keycodes (curses) to keysyms and modifier masks.
          133  + */
          134  +
          135  +typedef struct {
          136  +    int code;			/* Curses key code. */
          137  +    KeySym sym;			/* Key sym. */
          138  +    int modMask;		/* Modifiers. */
          139  +} KeyCodeInfo;
          140  +
          141  +static KeyCodeInfo keyCodeArray[] = {
          142  +#include "keyCodes.h"
          143  +    {0, 0, 0}
          144  +};
          145  +static Tcl_HashTable keyCodeTable;	/* Hashed form of above structure. */
          146  +
          147  +/*
          148  + * Forward declarations of static functions.
          149  + */
          150  +
          151  +static void		TermFileProc _ANSI_ARGS_((ClientData clientData,
          152  +			    int mask));
          153  +static void		RefreshDisplay _ANSI_ARGS_((TkDisplay *dispPtr));
          154  +static void		DrawTextSpan _ANSI_ARGS_((int left, int right, int y,
          155  +			    ClientData data));
          156  +static void		FillSpan _ANSI_ARGS_((int left, int right, int y,
          157  +			    ClientData data));
          158  +
          159  +
          160  +
          161  +/*
          162  + *--------------------------------------------------------------
          163  + *
          164  + * CtkDisplayInit --
          165  + *
          166  + *	Opens a connection to terminal with specified name,
          167  + *	and stores terminal information in the display
          168  + *	structure pointed to by `dispPtr'.
          169  + *
          170  + * Results:
          171  + *	Standard TCL result.
          172  + *
          173  + * Side effects:
          174  + *	The screen is cleared, and all sorts of I/O options
          175  + *	are set appropriately for a full-screen application.
          176  + *
          177  + *--------------------------------------------------------------
          178  + */
          179  +
          180  +int
          181  +CtkDisplayInit(interp, dispPtr, termName)
          182  +    Tcl_Interp *interp;
          183  +    TkDisplay *dispPtr;
          184  +    char *termName;
          185  +{
          186  +    char *type;
          187  +    int length;
          188  +    FILE *outPtr;
          189  +
          190  +    int fd;			/* For the return value of Tcl_GetChannelHandle */
          191  +    /* The Tcl_File is no longer needed, since Channels now subsume their work */
          192  +
          193  +    static int initialized = 0;
          194  +
          195  +    if (!initialized) {
          196  +	register KeyCodeInfo *codePtr;
          197  +	register Tcl_HashEntry *hPtr;
          198  +	int dummy;
          199  +
          200  +	initialized = 1;
          201  +	Tcl_InitHashTable(&keyCodeTable, TCL_ONE_WORD_KEYS);
          202  +	for (codePtr = keyCodeArray; codePtr->code != 0; codePtr++) {
          203  +	    hPtr = Tcl_CreateHashEntry(&keyCodeTable,
          204  +	    	    (char *) codePtr->code, &dummy);
          205  +	    Tcl_SetHashValue(hPtr, (ClientData) codePtr);
          206  +	}
          207  +    }
          208  +
          209  +    type = strchr(termName, ':');
          210  +    if (type == NULL) {
          211  +    	length = strlen(termName);
          212  +    	type = getenv("CTK_TERM");
          213  +	if (!type) type = getenv("TERM");
          214  +    } else {
          215  +	length = type - termName;
          216  +	type++;
          217  +    }
          218  +    dispPtr->type = (char *) ckalloc((unsigned) strlen(type) + 1);
          219  +    strcpy(dispPtr->type, type);
          220  +
          221  +    dispPtr->name = (char *) ckalloc((unsigned) (length+1));
          222  +    strncpy(dispPtr->name, termName, length);
          223  +    dispPtr->name[length] = '\0';
          224  +
          225  +    if (strcmp(dispPtr->name, "tty") == 0) {
          226  +	dispPtr->chan = Tcl_GetStdChannel(TCL_STDIN);
          227  +    } else {
          228  +#ifdef HAVE_SET_TERM
          229  +	dispPtr->chan = HAVE_SET_TERM ? Tcl_OpenFileChannel(interp, dispPtr->name, 
          230  +							    "r+", 0) : NULL;
          231  +#else
          232  +	dispPtr->chan = NULL;
          233  +#endif
          234  +        if (dispPtr->chan == NULL) {
          235  +	    Tcl_AppendResult(interp, "couldn't connect to device \"",
          236  +		    dispPtr->name, "\"", (char *) NULL);
          237  +	    goto error;
          238  +	}
          239  +    }
          240  +    if ( Tcl_GetChannelHandle(dispPtr->chan, TCL_READABLE, &(dispPtr->fd) ) != TCL_OK )
          241  +    {
          242  +    	Tcl_AppendResult(interp, "couldn't get device handle for device \"",
          243  +    		dispPtr->name, "\"", (char *) NULL);
          244  +        goto error;
          245  +    }
          246  +    
          247  +    if (!isatty(dispPtr->fd)) {
          248  +	Tcl_AppendResult(interp, "display device \"", dispPtr->name,
          249  +		"\" is not a tty", (char *) NULL);
          250  +	goto error;
          251  +    }
          252  +    if (dispPtr->fd == 0) {
          253  +	dispPtr->inPtr = stdin;
          254  +	outPtr = stdout;
          255  +    } else {
          256  +	dispPtr->inPtr = fdopen(dispPtr->fd, "r+");
          257  +	outPtr = dispPtr->inPtr;
          258  +    }
          259  +
          260  +    dispPtr->display =
          261  +	    (ClientData) newterm(dispPtr->type, outPtr, dispPtr->inPtr);
          262  +    SetDisplay(dispPtr);
          263  +    raw();
          264  +    nonl();
          265  +    noecho();
          266  +    keypad(stdscr, TRUE);
          267  +
          268  +    Tcl_CreateChannelHandler(dispPtr->chan, TCL_READABLE,
          269  +    	    TermFileProc, (ClientData) dispPtr);
          270  +    return TCL_OK;
          271  +
          272  +error:
          273  +    ckfree(dispPtr->name);
          274  +    dispPtr->name = NULL;
          275  +    ckfree(dispPtr->type);
          276  +    dispPtr->type = NULL;
          277  +    return TCL_ERROR;
          278  +}
          279  +
          280  +/*
          281  + *--------------------------------------------------------------
          282  + *
          283  + * CtkDisplayEnd --
          284  + *
          285  + *	Ends CTk's use of terminal.
          286  + *
          287  + * Results:
          288  + *	None.
          289  + *
          290  + * Side effects:
          291  + *	The terminal is restored to line mode.
          292  + *
          293  + *--------------------------------------------------------------
          294  + */
          295  +
          296  +void
          297  +CtkDisplayEnd(dispPtr)
          298  +    TkDisplay *dispPtr;
          299  +{
          300  +    SetDisplay(dispPtr);
          301  +    curs_set(1);
          302  +    endwin();
          303  +
          304  +    Tcl_DeleteChannelHandler(dispPtr->chan,
          305  +		TermFileProc, (ClientData) dispPtr);
          306  +    if (dispPtr->inPtr != stdin) {
          307  +    	fclose(dispPtr->inPtr);
          308  +    }
          309  +    ckfree(dispPtr->name);
          310  +    ckfree(dispPtr->type);
          311  +}
          312  +
          313  +/*
          314  + *--------------------------------------------------------------
          315  + *
          316  + * Ctk_DisplayFlush --
          317  + *
          318  + *	Flushes all output to the specified display.  If dispPtr
          319  + *	is NULL then output to all connected displays is flushed.
          320  + *
          321  + * Results:
          322  + *	None.
          323  + *
          324  + * Side effects:
          325  + *	The terminal display is updated.
          326  + *
          327  + *--------------------------------------------------------------
          328  + */
          329  +
          330  +void
          331  +Ctk_DisplayFlush(dispPtr)
          332  +    TkDisplay *dispPtr;
          333  +{
          334  +    if (dispPtr) {
          335  +	RefreshDisplay(dispPtr);
          336  +    } else {
          337  +    	for (dispPtr = tkDisplayList;
          338  +    		dispPtr != (TkDisplay*) NULL;
          339  +    		dispPtr = dispPtr->nextPtr) {
          340  +	    RefreshDisplay(dispPtr);
          341  +	}
          342  +    }
          343  +}
          344  +
          345  +/*
          346  + *--------------------------------------------------------------
          347  + *
          348  + * Ctk_DisplayRedraw --
          349  + *
          350  + *	Force a complete redraw of the specified display.
          351  + *
          352  + * Results:
          353  + *	None.
          354  + *
          355  + * Side effects:
          356  + *	The entire terminal display is redrawn.
          357  + *
          358  + *--------------------------------------------------------------
          359  + */
          360  +
          361  +void
          362  +Ctk_DisplayRedraw(dispPtr)
          363  +    TkDisplay *dispPtr;
          364  +{
          365  +    SetDisplay(dispPtr);
          366  +    clearok(stdscr, 1);
          367  +}
          368  +
          369  +/*
          370  + *--------------------------------------------------------------
          371  + *
          372  + * Ctk_SetCursor --
          373  + *
          374  + *	Postions display cursor in window at specified (local)
          375  + *	coordinates.
          376  + *
          377  + * Results:
          378  + *	None.
          379  + *
          380  + * Side effects:
          381  + *	Modifies window's display structure.
          382  + *--------------------------------------------------------------
          383  + */
          384  +
          385  +void
          386  +Ctk_SetCursor(winPtr, x, y)
          387  +    TkWindow *winPtr;
          388  +    int x, y;
          389  +{
          390  +    TkDisplay *dispPtr = Tk_Display(winPtr);
          391  +    dispPtr->cursorPtr = winPtr;
          392  +    dispPtr->cursorX = x;
          393  +    dispPtr->cursorY = y;
          394  +}
          395  +
          396  +static void
          397  +RefreshDisplay(dispPtr)
          398  +    TkDisplay *dispPtr;
          399  +{
          400  +    TkWindow *winPtr = dispPtr->cursorPtr;
          401  +    int x, y;
          402  +    int visible = 0;
          403  +
          404  +    SetDisplay(dispPtr);
          405  +    if (CtkIsDisplayed(winPtr)) {
          406  +	/*
          407  +	 * Convert to absolute screen coordinates
          408  +	 */
          409  +	x = dispPtr->cursorX + winPtr->absLeft;
          410  +	y = dispPtr->cursorY + winPtr->absTop;
          411  +	if (y >= winPtr->maskRect.top
          412  +		&& y < winPtr->maskRect.bottom
          413  +		&& x >= winPtr->maskRect.left
          414  +		&& x < winPtr->maskRect.right
          415  +		&& CtkPointInRegion(x, y, winPtr->clipRgn) ) {
          416  +	    Move(x, y);
          417  +	    visible = 1;
          418  +	}
          419  +    }
          420  +    curs_set(visible);
          421  +    refresh();
          422  +}
          423  +
          424  +/*
          425  + *--------------------------------------------------------------
          426  + *
          427  + * CtkDisplayBell --
          428  + *
          429  + *	Flushes all output to the terminal (otherwise drawing
          430  + *	may be buffered).
          431  + *
          432  + * Results:
          433  + *	None.
          434  + *
          435  + * Side effects:
          436  + *	The terminal display is updated.
          437  + *
          438  + *--------------------------------------------------------------
          439  + */
          440  +
          441  +void
          442  +CtkDisplayBell(dispPtr)
          443  +    TkDisplay *dispPtr;
          444  +{
          445  +    SetDisplay(dispPtr);
          446  +    beep();
          447  +}
          448  +
          449  +/*
          450  + *--------------------------------------------------------------
          451  + *
          452  + * Ctk_DisplayWidth --
          453  + * Ctk_DisplayHeight --
          454  + *
          455  + *	Get geometry of terminal.
          456  + *
          457  + * Results:
          458  + *	Size (width/height respectively) of terminal.
          459  + *
          460  + * Side effects:
          461  + *	None.
          462  + *
          463  + *--------------------------------------------------------------
          464  + */
          465  +
          466  +int
          467  +Ctk_DisplayWidth(dispPtr)
          468  +    TkDisplay *dispPtr;
          469  +{
          470  +    SetDisplay(dispPtr);
          471  +    return COLS;
          472  +}
          473  +
          474  +int
          475  +Ctk_DisplayHeight(dispPtr)
          476  +    TkDisplay *dispPtr;
          477  +{
          478  +    SetDisplay(dispPtr);
          479  +    return LINES;
          480  +}
          481  +
          482  +/*
          483  + *--------------------------------------------------------------
          484  + *
          485  + * TermFileProc --
          486  + *
          487  + *	File handler for a terminal.
          488  + *
          489  + * Results:
          490  + *	Returns TK_FILE_HANDLED if any events were processed.
          491  + *	Otherwise returns TCL_READABLE.
          492  + *
          493  + * Side effects:
          494  + *	Dispatches events (invoking event handlers).
          495  + *
          496  + *--------------------------------------------------------------
          497  + */
          498  +
          499  +static void
          500  +TermFileProc(clientData, mask)
          501  +    ClientData clientData;
          502  +    int mask;
          503  +{
          504  +    TkDisplay *dispPtr = (TkDisplay *) clientData;
          505  +    Ctk_Event event;
          506  +    struct tms timesBuf;
          507  +    Tcl_HashEntry *hPtr;
          508  +    KeyCodeInfo *codePtr;
          509  +    int key;
          510  +
          511  +    if ((mask & TCL_READABLE) == TCL_READABLE) {
          512  +	SetDisplay(dispPtr);
          513  +
          514  +	key = getch();
          515  +	hPtr = Tcl_FindHashEntry(&keyCodeTable, (char *) key);
          516  +	if (hPtr) {
          517  +	    codePtr = (KeyCodeInfo *) Tcl_GetHashValue(hPtr);
          518  +	    event.u.key.sym = codePtr->sym;
          519  +	    event.u.key.state = codePtr->modMask;
          520  +	} else {
          521  +	    event.u.key.sym = key;
          522  +	    event.u.key.state = 0;
          523  +	}
          524  +	event.type = CTK_KEY_EVENT;
          525  +	event.window = dispPtr->focusPtr;
          526  +	event.u.key.time = (unsigned long) (times(&timesBuf)*MS_PER_CLOCK);
          527  +	Tk_HandleEvent(&event);
          528  +    }
          529  +}
          530  +
          531  +/*
          532  + *--------------------------------------------------------------
          533  + *
          534  + * Ctk_DrawCharacter --
          535  + *
          536  + *	Display a single character in a view.
          537  + *
          538  + * Results:
          539  + *	None.
          540  + *
          541  + * Side effects:
          542  + *	Character is output to the terminal.
          543  + *
          544  + *--------------------------------------------------------------
          545  + */
          546  +
          547  +void
          548  +Ctk_DrawCharacter(winPtr, x, y, style, character)
          549  +    TkWindow *winPtr;		/* Window to draw into. */
          550  +    int x,y;			/* Position, relative to view, to
          551  +    				 * start draw at. */
          552  +    Ctk_Style style;		/* Style to draw character in. */
          553  +    int character;		/* Character to draw. */
          554  +{
          555  +    if (!CtkIsDisplayed(winPtr)) {
          556  +	return;
          557  +    }
          558  +
          559  +    /*
          560  +     * Convert to absolute screen coordinates
          561  +     */
          562  +    y += winPtr->absTop;
          563  +    x += winPtr->absLeft;
          564  +
          565  +    if (y >= winPtr->clipRect.top
          566  +    	    && y < winPtr->clipRect.bottom
          567  +    	    && x >= winPtr->clipRect.left
          568  +    	    && x < winPtr->clipRect.right
          569  +	    && CtkPointInRegion(x, y, winPtr->clipRgn) ) {
          570  +	SetDisplay(winPtr->dispPtr);
          571  +	SetStyle(style);
          572  +	Move(x, y);
          573  +	PutChar(character);
          574  +    }
          575  +}
          576  +
          577  +/*
          578  + *--------------------------------------------------------------
          579  + *
          580  + * Ctk_DrawString --
          581  + *
          582  + *	Display `length' characters from `str' into `winPtr'
          583  + *	at position (`x',`y') in specified `style'.  If `length'
          584  + *	is -1 then draw till a null character is reached.
          585  + *
          586  + * Results:
          587  + *	None.
          588  + *
          589  + * Side effects:
          590  + *	Characters are output to the terminal.
          591  + *
          592  + *--------------------------------------------------------------
          593  + */
          594  +
          595  +void
          596  +Ctk_DrawString(winPtr, x, y, style, str, length)
          597  +    TkWindow *winPtr;		/* Window to draw into. */
          598  +    int x,y;			/* Position, relative to view, to
          599  +    				 * start drawing. */
          600  +    Ctk_Style style;		/* Style to draw characters in. */
          601  +    char *str;			/* Points to characters to be drawn. */
          602  +    int length;			/* Number of characters from str
          603  +    				 * to draw, or -1 to draw till NULL
          604  +    				 * termination. */
          605  +{
          606  +    int strLeft, strRight;
          607  +    TextInfo text_info;
          608  +
          609  +    if (!CtkIsDisplayed(winPtr)) {
          610  +	return;
          611  +    }
          612  +
          613  +    /*
          614  +     * Convert to absolute screen coordinates
          615  +     */
          616  +    y += winPtr->absTop;
          617  +    if (y < winPtr->clipRect.top || y > winPtr->clipRect.bottom) {
          618  +	return;
          619  +    }
          620  +    x += winPtr->absLeft;
          621  +
          622  +    if (length == -1) {
          623  +	length = strlen(str);
          624  +    }
          625  +    strLeft = x;
          626  +    strRight = x+length;
          627  +    CtkIntersectSpans(&strLeft, &strRight,
          628  +	    winPtr->clipRect.left, winPtr->clipRect.right);
          629  +    if (CtkSpanIsEmpty(strLeft, strRight))  return;
          630  +
          631  +    SetDisplay(winPtr->dispPtr);
          632  +    SetStyle(style);
          633  +    text_info.str = str;
          634  +    text_info.left = x;
          635  +    CtkForEachIntersectingSpan(DrawTextSpan, (ClientData) &text_info,
          636  +	    strLeft, strRight, y, winPtr->clipRgn);
          637  +}
          638  +
          639  +/*
          640  + *--------------------------------------------------------------
          641  + *
          642  + * DrawTextSpan --
          643  + *
          644  + *	Called by ForEachSpan() or ForEachIntersectingSpan()
          645  + *	to draw a segment of a string.
          646  + *
          647  + * Results:
          648  + *	None.
          649  + *
          650  + * Side effects:
          651  + *	Characters are output to the terminal.
          652  + *
          653  + *--------------------------------------------------------------
          654  + */
          655  +
          656  +static void
          657  +DrawTextSpan(left, right, y, data)
          658  +    int left;			/* X coordinate to start drawing. */
          659  +    int right;			/* X coordinate to stop drawing (this
          660  +    				 * position is not drawn into). */
          661  +    int y;			/* Y coordinate to draw at. */
          662  +    ClientData data;		/* Points at TextInfo structure. */
          663  +{
          664  +    char *charPtr = ((TextInfo*) data)->str + left - ((TextInfo*) data)->left;
          665  +    int x;
          666  +
          667  +    Move(left, y);
          668  +    for (x=left; x < right; x++) {
          669  +	PutChar(UCHAR(*charPtr++));
          670  +    }
          671  +}
          672  +
          673  +/*
          674  + *--------------------------------------------------------------
          675  + *
          676  + * Ctk_ClearWindow --
          677  + *
          678  + *	Fill view with its background (as defined by
          679  + *	winPtr->fillStyle and winPtr->fillChar).
          680  + *
          681  + * Results:
          682  + *	None.
          683  + *
          684  + * Side effects:
          685  + *	Characters are output to the terminal.
          686  + *
          687  + *--------------------------------------------------------------
          688  + */
          689  +
          690  +void
          691  +Ctk_ClearWindow(winPtr)
          692  +    TkWindow * winPtr;	/* Window to clear. */
          693  +{
          694  +    int left = winPtr->clipRect.left;
          695  +    int right = winPtr->clipRect.right;
          696  +    int y;
          697  +
          698  +    if (winPtr->fillStyle == CTK_INVISIBLE_STYLE || (!CtkIsDisplayed(winPtr))
          699  +    	    || CtkSpanIsEmpty(left, right)) {
          700  +	return;
          701  +    }
          702  +
          703  +    SetDisplay(winPtr->dispPtr);
          704  +    SetStyle(winPtr->fillStyle);
          705  +    for (y=winPtr->clipRect.top; y < winPtr->clipRect.bottom; y++) {
          706  +	CtkForEachIntersectingSpan(
          707  +	    FillSpan, (ClientData) winPtr->fillChar,
          708  +	    left, right, y,
          709  +	    winPtr->clipRgn);
          710  +    }
          711  +}
          712  +
          713  +/*
          714  + *--------------------------------------------------------------
          715  + *
          716  + * CtkFillRegion --
          717  + *
          718  + *	Fills in a region with the specified character and style.
          719  + *	Region is in absolute screen coordinates.  No clipping is
          720  + *	performed.
          721  + *
          722  + * Results:
          723  + *	None.
          724  + *
          725  + * Side effects:
          726  + *	Characters are output to the terminal.
          727  + *
          728  + *--------------------------------------------------------------
          729  + */
          730  +
          731  +void
          732  +CtkFillRegion(dispPtr, rgnPtr, fillStyle, fillChar)
          733  +    TkDisplay *dispPtr;
          734  +    CtkRegion *rgnPtr;
          735  +    Ctk_Style fillStyle;
          736  +    int fillChar;
          737  +{
          738  +    SetDisplay(dispPtr);
          739  +    SetStyle(fillStyle);
          740  +    CtkForEachSpan(FillSpan, (ClientData) fillChar, rgnPtr);
          741  +}
          742  +
          743  +/*
          744  + *--------------------------------------------------------------
          745  + *
          746  + * Ctk_FillRect --
          747  + *
          748  + *	Draw a rectangle filled with the specified character
          749  + *	and style in `winPtr' at relative coordinates (x1,y1)
          750  + *	to (x2-1,y2-1).
          751  + *
          752  + * Results:
          753  + *	None.
          754  + *
          755  + * Side effects:
          756  + *	Characters are output to the terminal.
          757  + *
          758  + *--------------------------------------------------------------
          759  + */
          760  +
          761  +void
          762  +Ctk_FillRect(winPtr, x1, y1, x2, y2, fillStyle, fillChar)
          763  +    TkWindow *winPtr;
          764  +    int x1;
          765  +    int y1;
          766  +    int x2;
          767  +    int y2;
          768  +    Ctk_Style fillStyle;
          769  +    int fillChar;
          770  +{
          771  +    Ctk_Rect rect;
          772  +    int y;
          773  +
          774  +    if (!CtkIsDisplayed(winPtr)) {
          775  +	return;
          776  +    }
          777  +    CtkSetRect(&rect, x1, y1, x2, y2);
          778  +    CtkMoveRect(&rect, winPtr->absLeft, winPtr->absTop);
          779  +    CtkIntersectRects(&rect, &winPtr->clipRect);
          780  +    if ( CtkSpanIsEmpty(rect.left, rect.right) ) {
          781  +	return;
          782  +    }
          783  +    SetDisplay(winPtr->dispPtr);
          784  +    SetStyle(fillStyle);
          785  +    for (y=rect.top; y < rect.bottom; y++)
          786  +    {
          787  +	CtkForEachIntersectingSpan( FillSpan, (ClientData) fillChar,
          788  +		rect.left, rect.right, y, winPtr->clipRgn);
          789  +    }
          790  +}
          791  +
          792  +/*
          793  + *--------------------------------------------------------------
          794  + *
          795  + * FillSpan --
          796  + *
          797  + *	Called by ForEachSpan() or ForEachIntersectingSpan()
          798  + *	to fill a span with the same character.
          799  + *
          800  + * Results:
          801  + *	None.
          802  + *
          803  + * Side effects:
          804  + *	Characters are output to the terminal.
          805  + *
          806  + *--------------------------------------------------------------
          807  + */
          808  +
          809  +static void
          810  +FillSpan(left, right, y, data)
          811  +    int left;			/* X coordinate to start filling. */
          812  +    int right;			/* X coordinate to stop filling (this
          813  +    				 * position is not draw into). */
          814  +    int y;			/* Y coordinate to draw at. */
          815  +    ClientData data;		/* Character to draw. */
          816  +{
          817  +    int x;
          818  +
          819  +    Move(left, y);
          820  +    for (x=left; x < right; x++) {
          821  +	PutChar((int) data);
          822  +    }
          823  +}
          824  +
          825  +/*
          826  + *--------------------------------------------------------------
          827  + *
          828  + * Ctk_DrawRect --
          829  + *
          830  + *	Draw outline of rectangle with line drawing characters
          831  + *	and the specified style in `winPtr' at relative
          832  + *	coordinates (x1,y1) to (x2,y2).
          833  + *
          834  + * Results:
          835  + *	None.
          836  + *
          837  + * Side effects:
          838  + *	Characters are output to the terminal.
          839  + *
          840  + *--------------------------------------------------------------
          841  + */
          842  +
          843  +void
          844  +Ctk_DrawRect(winPtr, x1, y1, x2, y2, lineStyle)
          845  +    TkWindow *winPtr;
          846  +    int x1;
          847  +    int y1;
          848  +    int x2;
          849  +    int y2;
          850  +    Ctk_Style lineStyle;
          851  +{
          852  +    Ctk_Rect *clipRectPtr = &winPtr->clipRect;
          853  +    int left;
          854  +    int right;
          855  +    int top;
          856  +    int bottom;
          857  +    int y;
          858  +
          859  +    if (!CtkIsDisplayed(winPtr) || x1 > x2 || y1 > y2) {
          860  +	return;
          861  +    }
          862  +    SetDisplay(winPtr->dispPtr);
          863  +    SetStyle(lineStyle);
          864  +
          865  +    Ctk_DrawCharacter(winPtr, x1, y1, lineStyle, ACS_ULCORNER);
          866  +    Ctk_DrawCharacter(winPtr, x2, y1, lineStyle, ACS_URCORNER);
          867  +    Ctk_DrawCharacter(winPtr, x1, y2, lineStyle, ACS_LLCORNER);
          868  +    Ctk_DrawCharacter(winPtr, x2, y2, lineStyle, ACS_LRCORNER);
          869  +
          870  +    /* Convert to screen coordinates */
          871  +    x1 += winPtr->absLeft;
          872  +    x2 += winPtr->absLeft;
          873  +    y1 += winPtr->absTop;
          874  +    y2 += winPtr->absTop;
          875  +
          876  +    /*
          877  +     *	Draw horizontal lines.
          878  +     */
          879  +    left = x1+1;
          880  +    right = x2;
          881  +    CtkIntersectSpans(&left, &right, clipRectPtr->left, clipRectPtr->right);
          882  +    if (!CtkSpanIsEmpty(left, right)) {
          883  +	if ((clipRectPtr->top <= y1) && (clipRectPtr->bottom > y1)) {
          884  +	    CtkForEachIntersectingSpan(
          885  +		FillSpan, (ClientData) ACS_HLINE,
          886  +		left, right, y1,
          887  +		winPtr->clipRgn);
          888  +	}
          889  +	if ((clipRectPtr->top <= y2) && (clipRectPtr->bottom > y2)) {
          890  +	    CtkForEachIntersectingSpan(
          891  +		FillSpan, (ClientData) ACS_HLINE,
          892  +		left, right, y2,
          893  +		winPtr->clipRgn);
          894  +	}
          895  +    }
          896  +
          897  +    /*
          898  +     *	Draw vertical lines.
          899  +     */
          900  +    top = y1 + 1;
          901  +    bottom = y2;
          902  +    CtkIntersectSpans(&top, &bottom, clipRectPtr->top, clipRectPtr->bottom);
          903  +    if ((clipRectPtr->left <= x1) && (clipRectPtr->right > x1)) {
          904  +	for (y=top; y < bottom; y++) {
          905  +	    if (CtkPointInRegion(x1, y, winPtr->clipRgn)) {
          906  +		Move(x1, y);
          907  +		PutChar(ACS_VLINE);
          908  +	    }
          909  +	}
          910  +    }
          911  +    if ((clipRectPtr->left <= x2) && (clipRectPtr->right > x2)) {
          912  +	for (y=top; y < bottom; y++) {
          913  +	    if (CtkPointInRegion(x2, y, winPtr->clipRgn)) {
          914  +		Move(x2, y);
          915  +		PutChar(ACS_VLINE);
          916  +	    }
          917  +	}
          918  +    }
          919  +}

Added ctkRegion.c version [5e9c5af08b].

            1  +/* 
            2  + * ctkRegion.c (CTk) --
            3  + *
            4  + *	Geometry manipulation routines - regions (free form 2-D shapes),
            5  + *	rectangles, and spans (horizontal segments).
            6  + *
            7  + *	Beware, some of theses routines have special constraints that
            8  + *	are not obvious from their title.  Be sure to examine headers
            9  + *	for constraints.
           10  + *
           11  + * Copyright (c) 1994-1995 Cleveland Clinic Foundation
           12  + *
           13  + * See the file "license.terms" for information on usage and redistribution
           14  + * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
           15  + *
           16  + * @(#) $Id: ctk.shar,v 1.50 1996/01/15 14:47:16 andrewm Exp andrewm $
           17  + */
           18  +
           19  +#include "tkPort.h"
           20  +#include "tkInt.h"
           21  +
           22  +/*
           23  + * Notes on Geometry Types.
           24  + *
           25  + * Spans -
           26  + *	Horizontal line segment.  Between left point (inclusive)
           27  + *	and right point (exclusive).  Any span with right <= left
           28  + *	is considered empty.
           29  + *
           30  + * Rectangles -
           31  + *	Analogous to spans top and left points are include,
           32  + *	and right and bottom points are excluded from area
           33  + *	rectangle.  Any rectangle with right <= left or
           34  + *	bottom <= top is considered empty.
           35  + *
           36  + * Region -
           37  + *	Free form area.  Contents of structure are opaque.
           38  + *	!!! Vertical bounds of region cannot increase !!!
           39  + *	The rectangle used with CtkCreateRegion() must have the
           40  + *	maximum top and bottom for the region (the rectangle
           41  + *	may still be empty if right <= left).
           42  + */
           43  +
           44  +/*
           45  + *  Limits for x and y coordinates
           46  + *  (choose these to work with systems where int is 16-bit).
           47  + */
           48  +#define COORD_MAX           32767
           49  +#define COORD_MIN           -32768
           50  +
           51  +
           52  +/*
           53  + * Component of a region
           54  + */
           55  +typedef struct {
           56  +    int left;
           57  +    int right;
           58  +    int next;           /* Index of next span */
           59  +} RegionSpan;
           60  +#define NO_SPAN (-1)    /* Invalid index (indicates end of span list) */
           61  +
           62  +struct CtkRegion {
           63  +    int top;
           64  +    int bottom;
           65  +    int free;
           66  +    int num_spans;
           67  +    RegionSpan *spans;
           68  +};
           69  +
           70  +#define CopySpan(dst, src) (memcpy((dst), (src), sizeof(RegionSpan)))
           71  +#define FreeSpan(rgnPtr, index) \
           72  +	((rgnPtr)->spans[(index)].next \
           73  +	= (rgnPtr)->free, (rgnPtr)->free = (index))
           74  +
           75  +/*
           76  + * Private Function Declarations
           77  + */
           78  +static void	PseudoUnionSpans _ANSI_ARGS_((int *leftPtr, int *rightPtr,
           79  +		    int left2, int right2));
           80  +static int	DeleteSpan _ANSI_ARGS_((CtkRegion * rgnPtr, int index,
           81  +		    int priorIndex));
           82  +static void	AppendSpan _ANSI_ARGS_((CtkRegion * rgnPtr, int index,
           83  +		    int left, int right));
           84  +static void	PrependSpan _ANSI_ARGS_((CtkRegion * rgnPtr, int index,
           85  +		    int left, int right));
           86  +static int	AllocSpan _ANSI_ARGS_((CtkRegion * rgnPtr));
           87  +static void	MergeSpan _ANSI_ARGS_((CtkRegion * rgnPtr, int left,
           88  +		    int right, int y));
           89  +
           90  +
           91  +/*
           92  + *----------------------------------------------------------------------
           93  + *
           94  + * CtkIntersectSpans -- compute intersection of 2 spans
           95  + *
           96  + *	Compute the intersection of the span (*leftPtr,*rightPtr)
           97  + *	and the span (left2,right2).
           98  + *
           99  + * Results:
          100  + *	Stores the resulting span in `leftPtr' and `rightPtr'.
          101  + *
          102  + * Side effects:
          103  + *	None.
          104  + *
          105  + *----------------------------------------------------------------------
          106  + */
          107  +
          108  +void
          109  +CtkIntersectSpans(leftPtr, rightPtr, left2, right2)
          110  +    int *leftPtr;
          111  +    int *rightPtr;
          112  +    int left2;
          113  +    int right2;
          114  +{
          115  +    if (*leftPtr < left2)  *leftPtr = left2;
          116  +    if (*rightPtr > right2)  *rightPtr = right2;
          117  +}
          118  +
          119  +/*
          120  + *----------------------------------------------------------------------
          121  + *
          122  + * PseudoUnionSpans -- compute union of 2 spans
          123  + *
          124  + *	Compute the union of the span (*leftPtr,*rightPtr)
          125  + *	and the span (left2,right2).  Assumes that the spans overlap.
          126  + *	If they don't, the result will contain the area between the
          127  + *	spans also.  (A real union would have to be capable of
          128  + *	returning two disjoint spans.)
          129  + *
          130  + * Results:
          131  + *	Stores the resulting span in `leftPtr' and `rightPtr'.
          132  + *
          133  + * Side effects:
          134  + *	None.
          135  + *
          136  + *----------------------------------------------------------------------
          137  + */
          138  +
          139  +static void
          140  +PseudoUnionSpans(leftPtr, rightPtr, left2, right2)
          141  +    int *leftPtr;
          142  +    int *rightPtr;
          143  +    int left2;
          144  +    int right2;
          145  +{
          146  +    if (*leftPtr > left2)  *leftPtr = left2;
          147  +    if (*rightPtr < right2)  *rightPtr = right2;
          148  +}
          149  +
          150  +/*
          151  + *----------------------------------------------------------------------
          152  + *
          153  + * CtkSpanMinusSpan - compute difference of 2 spans
          154  + *
          155  + *	Substract span (subL, subR) from span (srcL, srcR).
          156  + *	(Find segment(s) in first span that do not overlap with
          157  + *	second span.)
          158  + *
          159  + * Results:
          160  + *	Returns the number of resultin spans (0-2).
          161  + *	Stores the resulting span(s) in remsL[] and remsR[].
          162  + *
          163  + * Side effects:
          164  + *	None.
          165  + *
          166  + *----------------------------------------------------------------------
          167  + */
          168  +
          169  +int
          170  +CtkSpanMinusSpan(srcL, srcR, subL, subR, remsL, remsR)
          171  +    int srcL;
          172  +    int srcR;
          173  +    int subL;
          174  +    int subR;
          175  +    int *remsL;
          176  +    int *remsR;
          177  +{
          178  +    int numRems = 0;
          179  +
          180  +    if (srcR <= subL || srcL >= subR)  return (numRems);
          181  +    if (srcL < subL) {
          182  +	remsL[numRems] = srcL;
          183  +	remsR[numRems] = subL;
          184  +	numRems += 1;
          185  +    }
          186  +    if (srcR > subR) {
          187  +	remsL[numRems] = subR;
          188  +	remsR[numRems] = srcR;
          189  +	numRems += 1;
          190  +    }
          191  +    return (numRems);
          192  +
          193  +}
          194  +
          195  +/*
          196  + *----------------------------------------------------------------------
          197  + *
          198  + * CtkIntersectRects -- compute intersection of two rectangles
          199  + *
          200  + *	Computer overlap between rectangles pointed to by
          201  + *	r1Ptr and r2Ptr.
          202  + *
          203  + * Results:
          204  + *	Stores clipped down rectangle in `r1Ptr'.
          205  + *
          206  + * Side effects:
          207  + *	None.
          208  + *
          209  + *----------------------------------------------------------------------
          210  + */
          211  +
          212  +void
          213  +CtkIntersectRects(r1Ptr, r2Ptr)
          214  +    Ctk_Rect * r1Ptr;
          215  +    CONST Ctk_Rect * r2Ptr;
          216  +{
          217  +
          218  +    if (r1Ptr->left < r2Ptr->left)  r1Ptr->left = r2Ptr->left;
          219  +    if (r1Ptr->top < r2Ptr->top)  r1Ptr->top = r2Ptr->top;
          220  +    if (r1Ptr->right > r2Ptr->right)  r1Ptr->right = r2Ptr->right;
          221  +    if (r1Ptr->bottom > r2Ptr->bottom)  r1Ptr->bottom = r2Ptr->bottom;
          222  +
          223  +}
          224  +
          225  +/*
          226  + *----------------------------------------------------------------------
          227  + *
          228  + * CtkCreateRegion -- create a new region
          229  + *
          230  + *	Create a new region and initialize it to the area of
          231  + *	`rect'.
          232  + *
          233  + * Results:
          234  + *	Returns pointer to new region.
          235  + *
          236  + * Side effects:
          237  + *	None.
          238  + *
          239  + *----------------------------------------------------------------------
          240  + */
          241  +
          242  +CtkRegion *
          243  +CtkCreateRegion(rect)
          244  +    Ctk_Rect * rect;
          245  +{
          246  +    CtkRegion * rgnPtr;
          247  +    int i;
          248  +    rgnPtr = (CtkRegion *) ckalloc(sizeof(CtkRegion));
          249  +
          250  +    rgnPtr->top = rect->top;
          251  +    rgnPtr->bottom = rect->bottom;
          252  +    rgnPtr->free = NO_SPAN;
          253  +    rgnPtr->num_spans = rgnPtr->bottom - rgnPtr->top;
          254  +    if (rgnPtr->num_spans <= 0) {
          255  +    	rgnPtr->num_spans = 0;
          256  +    	rgnPtr->spans = (RegionSpan *) NULL;
          257  +    } else {
          258  +	rgnPtr->spans = (RegionSpan *)
          259  +		ckalloc(rgnPtr->num_spans * sizeof(RegionSpan));
          260  +	for (i=0; i < rgnPtr->num_spans; i++) {
          261  +	    rgnPtr->spans[i].left = rect->left;
          262  +	    rgnPtr->spans[i].right = rect->right;
          263  +	    rgnPtr->spans[i].next = NO_SPAN;
          264  +	}
          265  +    }
          266  +    return rgnPtr;
          267  +}
          268  +
          269  +/*
          270  + *----------------------------------------------------------------------
          271  + *
          272  + * CtkDestroyRegion - release resources held by a region
          273  + *
          274  + *	Free resources for a region - region may not be referenced
          275  + *	again.
          276  + *
          277  + * Results:
          278  + *	None.
          279  + *
          280  + * Side effects:
          281  + *	Memory is freed.
          282  + *
          283  + *----------------------------------------------------------------------
          284  + */
          285  +
          286  +void
          287  +CtkDestroyRegion(rgnPtr)
          288  +    CtkRegion *rgnPtr;
          289  +{
          290  +    if (rgnPtr->spans) {
          291  +	ckfree((char *) rgnPtr->spans);
          292  +    }
          293  +    ckfree((char *) rgnPtr);
          294  +}
          295  +
          296  +/*
          297  + *----------------------------------------------------------------------
          298  + *
          299  + * CtkRegionMinusRect - remove rectangular area from region
          300  + *
          301  + *	Substract area of rectangle `rectPtr' from region `rgnPtr'.
          302  + *
          303  + * Results:
          304  + *	If `wantInter', returns the intersection of the region and
          305  + *	the rectangle (as a new region - use CtkDestroyRegion() to
          306  + *	get rid of it).
          307  + *	Otherwise, returns NULL.
          308  + *
          309  + * Side effects:
          310  + *	Contents of `rgnPtr' is changed.
          311  + *
          312  + *----------------------------------------------------------------------
          313  + */
          314  +
          315  +CtkRegion *
          316  +CtkRegionMinusRect(rgnPtr, rectPtr, wantInter)
          317  +    CtkRegion *rgnPtr;
          318  +    Ctk_Rect *rectPtr;
          319  +    int wantInter;
          320  +{
          321  +    int itop = rectPtr->top;
          322  +    int ibottom = rectPtr->bottom;
          323  +    RegionSpan *spans = rgnPtr->spans;
          324  +    int y;
          325  +    int idx;
          326  +    int lastIdx;
          327  +    int rems;
          328  +    int newLefts[2];
          329  +    int newRights[2];
          330  +    Ctk_Rect emptyRect;
          331  +    CtkRegion * intersection = NULL;
          332  +
          333  +    CtkIntersectSpans(&itop, &ibottom, rgnPtr->top, rgnPtr->bottom);
          334  +    if (wantInter) {
          335  +	emptyRect.left = 0;
          336  +	emptyRect.top = itop;
          337  +	emptyRect.right = 0;
          338  +	emptyRect.bottom = ibottom;
          339  +	intersection = (CtkRegion *) CtkCreateRegion(&emptyRect);
          340  +    }
          341  +
          342  +    for (y = itop; y < ibottom; y++) {
          343  +	lastIdx = NO_SPAN;
          344  +	idx = y - rgnPtr->top;
          345  +	while (idx != NO_SPAN) {
          346  +	    if (spans[idx].left >= rectPtr->right) {
          347  +		/*
          348  +		 * Remaining spans on this line are right of `rectPtr'
          349  +		 */
          350  +		break;
          351  +	    }
          352  +	    if (spans[idx].right <= rectPtr->left) {
          353  +		/*
          354  +		 * No overlap
          355  +		 */
          356  +		lastIdx = idx;
          357  +		idx = spans[idx].next;
          358  +	    } else {
          359  +		/*
          360  +		 * Rect and span overlap
          361  +		 */
          362  +		rems = CtkSpanMinusSpan(
          363  +		    spans[idx].left, spans[idx].right,
          364  +		    rectPtr->left, rectPtr->right,
          365  +		    newLefts, newRights);
          366  +		if (wantInter) {
          367  +		    CtkIntersectSpans(
          368  +			&spans[idx].left, &spans[idx].right,
          369  +			rectPtr->left, rectPtr->right );
          370  +		    MergeSpan(intersection,
          371  +			spans[idx].left, spans[idx].right, y);
          372  +		}
          373  +		switch (rems) {
          374  +		case 0:
          375  +		    idx = DeleteSpan(rgnPtr, idx, lastIdx);
          376  +		    break;
          377  +		case 1:
          378  +		    spans[idx].left = newLefts[0];
          379  +		    spans[idx].right = newRights[0];
          380  +		    lastIdx = idx;
          381  +		    idx = spans[idx].next;
          382  +		    break;
          383  +		case 2:
          384  +		    spans[idx].left = newLefts[0];
          385  +		    spans[idx].right = newRights[0];
          386  +		    AppendSpan(rgnPtr, idx, newLefts[1], newRights[1]);
          387  +		    spans = rgnPtr->spans;
          388  +		    lastIdx = spans[idx].next;
          389  +		    idx = spans[lastIdx].next;
          390  +		    break;
          391  +		}
          392  +	    }
          393  +	} /* for (idx) */
          394  +    } /* for (y) */
          395  +    return intersection;
          396  +}
          397  +
          398  +/*
          399  + *----------------------------------------------------------------------
          400  + *
          401  + * CtkUnionRegions - merge one region into another
          402  + *
          403  + *	Computes the union of the regions `rgn1Ptr' and `rgn2Ptr',
          404  + *	and stores it in `rgn1Ptr'.
          405  + *	!!! The union cannot increase the top and bottom of `rgn1' !!!
          406  + *
          407  + * Results:
          408  + *	None.
          409  + *
          410  + * Side effects:
          411  + *	`rgn1Ptr' was is (possibly) expanded.
          412  + *
          413  + *----------------------------------------------------------------------
          414  + */
          415  +
          416  +void
          417  +CtkUnionRegions(rgn1Ptr, rgn2Ptr)
          418  +    CtkRegion *rgn1Ptr;
          419  +    CtkRegion *rgn2Ptr;
          420  +{
          421  +    RegionSpan *spans2 = rgn2Ptr->spans;
          422  +    int top2 = rgn2Ptr->top;
          423  +    int bottom2 = rgn2Ptr->bottom;
          424  +    int y;
          425  +    int idx;
          426  +
          427  +    for (y = top2; y < bottom2; y++) {
          428  +	idx = y - top2;
          429  +	if (spans2[idx].left >= spans2[idx].right) {
          430  +	    /* Empty scan line */
          431  +	    continue;
          432  +	}
          433  +	/*
          434  +	 * Could eventually expand (repack) region 1 here,
          435  +	 * if line is not within the vertical bounds of the
          436  +	 * first region.
          437  +	 */
          438  +	while (idx != NO_SPAN) {
          439  +	    MergeSpan(rgn1Ptr, spans2[idx].left, spans2[idx].right, y);
          440  +	    idx = spans2[idx].next;
          441  +	}
          442  +    }
          443  +}
          444  +
          445  +/*
          446  + *----------------------------------------------------------------------
          447  + *
          448  + * CtkForEachSpan -- perform function on every span in a region
          449  + *
          450  + *	Executes function `spanProcPtr' for each span in region.
          451  + *	Passes `clientData' and the span as arguments to `spanProcPtr'.
          452  + *
          453  + * Results:
          454  + *	None.
          455  + *
          456  + * Side effects:
          457  + *	`spanProcPtr' is executed.
          458  + *
          459  + *----------------------------------------------------------------------
          460  + */
          461  +
          462  +void
          463  +CtkForEachSpan(spanProcPtr, clientData, rgnPtr)
          464  +    CtkSpanProc *spanProcPtr;
          465  +    ClientData clientData;
          466  +    CtkRegion *rgnPtr;
          467  +{
          468  +    RegionSpan *spans = rgnPtr->spans;
          469  +    int top = rgnPtr->top;
          470  +    int bottom = rgnPtr->bottom;
          471  +    int y;
          472  +    int idx;
          473  +
          474  +    for (y = top; y < bottom; y++) {
          475  +	idx = y - top;
          476  +	if (spans[idx].left >= spans[idx].right) {
          477  +	    /* Empty scan line */
          478  +	    continue;
          479  +	}
          480  +	while (idx != NO_SPAN) {
          481  +	    (*spanProcPtr)(spans[idx].left, spans[idx].right, y, clientData);
          482  +	    idx = spans[idx].next;
          483  +	}
          484  +    }
          485  +}
          486  +
          487  +/*
          488  + *----------------------------------------------------------------------
          489  + *
          490  + * CtkForEachIntersectingSpan -- perform function on region/span intersection
          491  + *
          492  + *	Computes the intersection of region `rgnPtr' and the
          493  + *	span `left',`right' at vertical position `y'.  Executes
          494  + *	function `spanProcPtr' for each span in the intersection.
          495  + *	Passes `clientData' and the span as arguments to `spanProcPtr'.
          496  + *
          497  + * Results:
          498  + *	None.
          499  + *
          500  + * Side effects:
          501  + *	`spanProcPtr' is executed.
          502  + *
          503  + *----------------------------------------------------------------------
          504  + */
          505  +
          506  +void
          507  +CtkForEachIntersectingSpan(spanProcPtr, clientData, left, right, y, rgnPtr)
          508  +    CtkSpanProc *spanProcPtr;
          509  +    ClientData clientData;
          510  +    int left;
          511  +    int right;
          512  +    int y;
          513  +    CtkRegion *rgnPtr;
          514  +{
          515  +    RegionSpan *spans = rgnPtr->spans;
          516  +    int idx;
          517  +    int ileft;
          518  +    int iright;
          519  +
          520  +    if (y < rgnPtr->top || y >= rgnPtr->bottom)  return;
          521  +
          522  +    for (idx = y - rgnPtr->top; idx != NO_SPAN; idx = spans[idx].next) {
          523  +	if (spans[idx].left >= right)  break;
          524  +	if (spans[idx].right > left) {
          525  +	    /*
          526  +	     * Spans overlap.
          527  +	     */
          528  +	    ileft = spans[idx].left;
          529  +	    iright = spans[idx].right;
          530  +	    CtkIntersectSpans(&ileft, &iright, left, right);
          531  +	    (*spanProcPtr)(ileft, iright, y, clientData);
          532  +	}
          533  +    } /* for (idx) */
          534  +}
          535  +
          536  +/*
          537  + *----------------------------------------------------------------------
          538  + *
          539  + * CtkPointInRegion -- check if point is contained in region
          540  + *
          541  + *	Check if point (x,y) is in the region `rgnPtr'.
          542  + *
          543  + * Results:
          544  + *	Returns 1 if point is in region, otherwise returns 0.
          545  + *
          546  + * Side effects:
          547  + *	None.
          548  + *
          549  + *----------------------------------------------------------------------
          550  + */
          551  +
          552  +int
          553  +CtkPointInRegion(x, y, rgnPtr)
          554  +    int x, y;
          555  +    CtkRegion *rgnPtr;
          556  +{
          557  +    RegionSpan *spans = rgnPtr->spans;
          558  +    int idx;
          559  +
          560  +    if (y >= rgnPtr->top && y < rgnPtr->bottom) {
          561  +	for (idx = y - rgnPtr->top; idx != NO_SPAN; idx = spans[idx].next) {
          562  +	    if (spans[idx].left > x)  break;
          563  +	    if (spans[idx].right > x) {
          564  +		return 1;
          565  +	    }
          566  +	}
          567  +    }
          568  +    return 0;
          569  +}
          570  +
          571  +/*
          572  + *----------------------------------------------------------------------
          573  + *
          574  + * CtkRegionGetRect -- compute enclosing rectangle of a region
          575  + *
          576  + *	Compute the smallest rectangle that will enclose the
          577  + *	area of `rgnPtr'.
          578  + *
          579  + * Results:
          580  + *	Stores the resulting rectangle in `rectPtr'.
          581  + *
          582  + * Side effects:
          583  + *	None.
          584  + *
          585  + *----------------------------------------------------------------------
          586  + */
          587  +
          588  +void
          589  +CtkRegionGetRect(rgnPtr, rectPtr)
          590  +    CtkRegion *rgnPtr;
          591  +    Ctk_Rect *rectPtr;
          592  +{
          593  +    RegionSpan *spans = rgnPtr->spans;
          594  +    int top = rgnPtr->top;
          595  +    int numLines = rgnPtr->bottom - top;
          596  +    int topLine;           /* Index of top non-empty scan line */
          597  +    int bottomLine;        /* Index of bottom non-empty scan line */
          598  +    int left = COORD_MAX;
          599  +    int right = COORD_MIN;
          600  +    int line;
          601  +    int i;
          602  +
          603  +    for (topLine = 0; topLine < numLines; topLine++) {
          604  +	if (spans[topLine].left < spans[topLine].right) {
          605  +	    /* Non-empty scan line */
          606  +	    break;
          607  +	}
          608  +    }
          609  +    for (bottomLine = numLines-1 ; bottomLine >= topLine; bottomLine--) {
          610  +	if (spans[bottomLine].left < spans[bottomLine].right) {
          611  +	    /* Non-empty scan line */
          612  +	    break;
          613  +	}
          614  +    }
          615  +    bottomLine++;
          616  +
          617  +    for (line = topLine; line < bottomLine; line++)
          618  +    {
          619  +	if (spans[line].left < spans[line].right) {
          620  +	    /*
          621  +	     *	Non-empty scan line, if it goes outside the current
          622  +	     *	left and right bounds, then expand the bounds.
          623  +	     */
          624  +	    if (spans[line].left < left) {
          625  +		left = spans[line].left;
          626  +	    }
          627  +	    for (i = line; spans[i].next != NO_SPAN; i++);
          628  +	    if (spans[i].right > right) {
          629  +		right = spans[i].right;
          630  +	    }
          631  +	}
          632  +    }
          633  +
          634  +    if (left < right && topLine < bottomLine) {
          635  +	CtkSetRect(rectPtr, left, top+topLine, right, top+bottomLine);
          636  +    } else {
          637  +	CtkSetRect(rectPtr, 0, 0, 0, 0);
          638  +    }
          639  +}
          640  +
          641  +/*
          642  + *----------------------------------------------------------------------
          643  + *
          644  + * DeleteSpan -- remove a span from a region
          645  + *
          646  + *	Removes the span at `index' from `rgnPtr'.  `priorIndex'
          647  + *	must point to the preceding span, or be NO_SPAN if this
          648  + *	is the first span of a line.
          649  + *
          650  + * Results:
          651  + *	Index of the next span (one after the deleted one).
          652  + *
          653  + * Side effects:
          654  + *	The span at the specified index is removed, unless it is the
          655  + *	first span of scan line in which case is is set to empty.
          656  + *
          657  + *----------------------------------------------------------------------
          658  + */
          659  +
          660  +static int
          661  +DeleteSpan(rgnPtr, index, priorIndex)
          662  +    CtkRegion *rgnPtr;
          663  +    int index;
          664  +    int priorIndex;
          665  +{
          666  +    int nextIndex = rgnPtr->spans[index].next;
          667  +
          668  +    if (priorIndex == NO_SPAN) {
          669  +	if (nextIndex == NO_SPAN) {
          670  +	    rgnPtr->spans[index].left = rgnPtr->spans[index].right;
          671  +	} else {
          672  +	    CopySpan(&rgnPtr->spans[index], &rgnPtr->spans[nextIndex]);
          673  +	    FreeSpan(rgnPtr, nextIndex);
          674  +	    nextIndex = index;
          675  +	}
          676  +    } else {
          677  +	rgnPtr->spans[priorIndex].next = nextIndex;
          678  +	FreeSpan(rgnPtr, index);
          679  +    }
          680  +    return nextIndex;
          681  +}
          682  +
          683  +/*
          684  + *----------------------------------------------------------------------
          685  + *
          686  + * AppendSpan -- add a span to a region
          687  + *
          688  + *	Adds span `left',`right' to region `rgnPtr'
          689  + *	after the span at `index'.
          690  + *
          691  + * Results:
          692  + *	None.
          693  + *
          694  + * Side effects:
          695  + *	Changes contents of `rgnPtr'.
          696  + *	!!! May change the value of rgnPtr->spans !!!
          697  + *
          698  + *----------------------------------------------------------------------
          699  + */
          700  +
          701  +static void
          702  +AppendSpan(rgnPtr, index, left, right)
          703  +    CtkRegion * rgnPtr;
          704  +    int index;
          705  +    int left;
          706  +    int right;
          707  +{
          708  +    int newIndex = AllocSpan(rgnPtr);
          709  +    RegionSpan *spans = rgnPtr->spans;
          710  +
          711  +    spans[newIndex].left = left;
          712  +    spans[newIndex].right = right;
          713  +    spans[newIndex].next = spans[index].next;
          714  +    spans[index].next = newIndex;
          715  +}
          716  +
          717  +/*
          718  + *----------------------------------------------------------------------
          719  + *
          720  + * PrependSpan -- add a span to a region
          721  + *
          722  + *	Adds span `left',`right' to region `rgnPtr'
          723  + *	before the span at `index'.
          724  + *
          725  + * Results:
          726  + *	None.
          727  + *
          728  + * Side effects:
          729  + *	Changes contents of `rgnPtr'.
          730  + *	!!! May change the value of rgnPtr->spans !!!
          731  + *
          732  + *----------------------------------------------------------------------
          733  + */
          734  +
          735  +static void
          736  +PrependSpan(rgnPtr, index, left, right)
          737  +    CtkRegion * rgnPtr;
          738  +    int index;
          739  +    int left;
          740  +    int right;
          741  +{
          742  +    int newIndex = AllocSpan(rgnPtr);
          743  +    RegionSpan *spans = rgnPtr->spans;
          744  +
          745  +    CopySpan(&spans[newIndex], &spans[index]);
          746  +    spans[index].left = left;
          747  +    spans[index].right = right;
          748  +    spans[index].next = newIndex;
          749  +    
          750  +}
          751  +
          752  +/*
          753  + *----------------------------------------------------------------------
          754  + *
          755  + * AllocSpan -- get a new span for a region
          756  + *
          757  + *	Allocates another span for region `rgnPtr'.
          758  + *
          759  + * Results:
          760  + *	Returns index of new span.
          761  + *
          762  + * Side effects:
          763  + *	!!! May change the value of rgnPtr->spans !!!
          764  + *
          765  + *----------------------------------------------------------------------
          766  + */
          767  +
          768  +static int
          769  +AllocSpan(rgnPtr)
          770  +    CtkRegion * rgnPtr;
          771  +{
          772  +    int i;
          773  +    int old_num;
          774  +    int new_num;
          775  +
          776  +    if (rgnPtr->free == NO_SPAN) {
          777  +	/*
          778  +	 *  No spans in free list, allocate some more.
          779  +	 */
          780  +	old_num = rgnPtr->num_spans;
          781  +	new_num = old_num + 20;
          782  +	rgnPtr->spans = (RegionSpan *)
          783  +	    ckrealloc((char *) rgnPtr->spans, (new_num)*sizeof(RegionSpan));
          784  +	rgnPtr->num_spans = new_num;
          785  +
          786  +	/*
          787  +	 *  Add the new spans (except one) to the regions free list.
          788  +	 */
          789  +	for (i=old_num+1; i < new_num; i++) {
          790  +	    rgnPtr->spans[i-1].next = i;
          791  +	}
          792  +	rgnPtr->spans[new_num-1].next = NO_SPAN;
          793  +	rgnPtr->free = old_num+1;
          794  +
          795  +	/*
          796  +	 * Return the remaining new span.
          797  +	 */
          798  +	return (old_num);
          799  +    } else {
          800  +	/*
          801  +	 *  Spans in free list, return one.
          802  +	 */
          803  +	i = rgnPtr->free;
          804  +	rgnPtr->free = rgnPtr->spans[rgnPtr->free].next;
          805  +	return (i);
          806  +    }
          807  +}
          808  +
          809  +/*
          810  + *----------------------------------------------------------------------
          811  + *
          812  + * MergeSpan -- union a span into a region
          813  + *
          814  + *	Computes the union of region `rgnPtr' and span `left',`right'
          815  + *	at line y, and stores it in `rgnPtr'.
          816  + *	!!! `y' must be within rgnPtr->top and rgnPtr->bottom !!!
          817  + *
          818  + * Results:
          819  + *	None.
          820  + *
          821  + * Side effects:
          822  + *	(Possibly) expands the region `rgnPtr'.
          823  + *
          824  + *----------------------------------------------------------------------
          825  + */
          826  +
          827  +static void
          828  +MergeSpan(rgnPtr, left, right, y)
          829  +    CtkRegion * rgnPtr;
          830  +    int left;
          831  +    int right;
          832  +    int y;
          833  +{
          834  +    RegionSpan *spans = rgnPtr->spans;
          835  +    int idx = y - rgnPtr->top;
          836  +    int lastIdx = NO_SPAN;
          837  +    int mergeIdx = NO_SPAN;
          838  +
          839  +    if (y < rgnPtr->top || y > rgnPtr->bottom) {
          840  +    	panic("Merge span (y=%d) outside of regions vertical bounds (%d-%d)",
          841  +    		y, rgnPtr->top, rgnPtr->bottom);
          842  +    }
          843  +
          844  +    if (spans[idx].left >= spans[idx].right) {
          845  +	/*
          846  +	 *  Empty scan line, replace it with the new span.
          847  +	 */
          848  +	spans[idx].left = left;
          849  +	spans[idx].right = right;
          850  +	return;
          851  +    }
          852  +
          853  +    while (idx != NO_SPAN) {
          854  +	if (spans[idx].right >= left) {
          855  +	    /*
          856  +	     *	This spans is not left of the merge span.
          857  +	     */
          858  +
          859  +	    if (spans[idx].left > right)  break; /* right of merge */
          860  +
          861  +	    if (mergeIdx == NO_SPAN) {
          862  +		PseudoUnionSpans(
          863  +		    &spans[idx].left, &spans[idx].right, left, right);
          864  +		mergeIdx = idx;
          865  +	    } else {
          866  +		if (spans[mergeIdx].right < spans[idx].right) {
          867  +		    spans[mergeIdx].right = spans[idx].right;
          868  +		}
          869  +		idx = DeleteSpan(rgnPtr, idx, lastIdx);
          870  +		continue;
          871  +	    }
          872  +	}
          873  +    
          874  +	lastIdx = idx;
          875  +	idx = spans[idx].next;
          876  +    }
          877  +
          878  +    if (mergeIdx == NO_SPAN) {
          879  +	/*
          880  +	 *  No merge performed, append merge span to scan line.
          881  +	 */
          882  +	if (lastIdx == NO_SPAN) {
          883  +	    PrependSpan(rgnPtr, idx, left, right);
          884  +	} else {
          885  +	    AppendSpan(rgnPtr, lastIdx, left, right);
          886  +	}
          887  +    }
          888  +}

Added cwish.1 version [25fb337e9c].

            1  +.\" -*- cwish -*-
            2  +.de TQ
            3  +.br
            4  +.ns
            5  +.TP \\$1
            6  +..
            7  +.TH CWISH 1 "25 July 1995" "Cwish Version 4.0"
            8  +.SH NAME
            9  +cwish \- curses windowing shell
           10  +.SH SYNOPSIS
           11  +.B cwish
           12  +[
           13  +.I fileName
           14  +]
           15  +[
           16  +.IR arg \|.\|.\|.\|
           17  +]
           18  +.SH DESCRIPTION
           19  +\fBCwish\fR is a Tcl shell with the CTk toolkit extension added.
           20  +The CTk toolkit is a port of the X11 Tk toolkit to curses.
           21  +\fBCwish\fR creates a main window and then processes Tcl commands
           22  +from a file, standard input or a dialog window.
           23  +.PP
           24  +If \fBcwish\fR is invoked with an initial \fIfileName\fR argument
           25  +(cannot begin with ``\-''),
           26  +then \fIfileName\fR is treated as the name of a script file.
           27  +\fBCwish\fR will evaluate the script in \fIfileName\fR (which
           28  +presumably creates a user interface), then it will respond to events
           29  +until all windows have been deleted.
           30  +Commands will not be read from standard input.
           31  +.PP
           32  +If \fIfileName\fR is not specified then \fBcwish\fR runs interactively.
           33  +First, if there exists a file \fB.wishrc\fR in the home directory of
           34  +the user, \fBcwish\fR evaluates the file as a Tcl script.
           35  +If the display has not been redirected
           36  +(via the \fB-display\fR option or \fBCTK_DISPLAY\fR environment variable),
           37  +then a command dialog is displayed and \fBcwish\fR processes events
           38  +until all windows have been deleted.
           39  +Otherwise, \fBcwish\fR reads Tcl commands interactively from standard input.
           40  +It will continue processing commands until all windows have been
           41  +deleted or until end-of-file is reached on standard input.
           42  +
           43  +.SH OPTIONS
           44  +.PP
           45  +\fBCwish\fR automatically processes the following command-line options:
           46  +.IP "\fB\-display \fIdevice\fR[:\fItype\fR]" 20
           47  +Display device (and terminal type) on which to display window.
           48  +If type is not specified then terminal type is defined by the
           49  +\fBTERM\fR enviroment variable.
           50  +.IP "\fB\-geometry \fIgeometry\fR" 20
           51  +Initial geometry to use for window.  If this option is specified, its
           52  +value is stored in the \fBgeometry\fR global variable of the application's
           53  +Tcl interpreter.
           54  +.IP "\fB\-name \fIname\fR" 20
           55  +Use \fIname\fR as the title to be displayed in the window, and
           56  +as the name of the application for processing options
           57  +in the .ctkdefaults file.
           58  +.IP "\fB\-\|\-\fR" 20
           59  +Pass all remaining arguments through to the script's \fBargv\fR
           60  +variable without interpreting them.
           61  +This provides a mechanism for passing arguments such as \fB\-name\fR
           62  +to a script instead of having \fBcwish\fR interpret them.
           63  +.PP
           64  +Any other command-line arguments besides these are passed through
           65  +to the application using the \fBargc\fR and \fBargv\fR variables
           66  +described later.
           67  +
           68  +.SH "APPLICATION NAME AND CLASS"
           69  +.PP
           70  +The name and class for an application are used for specifying options
           71  +with a .ctkdefaults file
           72  +(analogous to a .Xdefaults file).
           73  +The application name is taken from the \fB\-name\fR option,
           74  +if it is specified;
           75  +otherwise it is taken from \fIfileName\fR, if it is specified,
           76  +or from the command name by which \fBcwish\fR was invoked.
           77  +In the last two cases, if the name contains a ``/''
           78  +character, then only the characters after the last slash are used
           79  +as the application name.
           80  +The class of the application is the same as its name
           81  +except that the first letter is capitalized.
           82  +
           83  +.SH "VARIABLES"
           84  +.PP
           85  +\fBCwish\fR sets the following Tcl variables:
           86  +.TP 15
           87  +\fBargc\fR
           88  +Contains a count of the number of \fIarg\fR arguments (0 if none),
           89  +not including the options described above.
           90  +.TP 15
           91  +\fBargv\fR
           92  +Contains a Tcl list whose elements are the \fIarg\fR arguments
           93  +that follow a \fB\-\|\-\fR option or don't match any of the
           94  +options described in OPTIONS above, in order, or an empty string
           95  +if there are no such arguments.
           96  +.TP 15
           97  +\fBargv0\fR
           98  +Contains \fIfileName\fR if it was specified.
           99  +Otherwise, contains the name by which \fBcwish\fR was invoked.
          100  +.TP 15
          101  +\fBgeometry\fR
          102  +If the \fB\-geometry\fR option is specified, \fBcwish\fR copies its
          103  +value into this variable.  If the variable still exists after
          104  +\fIfileName\fR has been evaluated, \fBcwish\fR uses the value of
          105  +the variable in a \fBwm geometry\fR command to set the main
          106  +window's geometry.
          107  +.TP 15
          108  +\fBtcl_interactive\fR
          109  +Contains 1 if \fBcwish\fR is reading commands interactively (\fIfileName\fR
          110  +was not specified and standard input is a terminal-like
          111  +device), 0 otherwise.
          112  +
          113  +.SH "SCRIPT FILES"
          114  +.PP
          115  +If you create a Tcl script in a file whose first line is
          116  +.nf
          117  +
          118  +\fB#!/usr/local/bin/cwish\fR
          119  +
          120  +.fi
          121  +then you can invoke the script file directly from your shell if
          122  +you mark it as executable.
          123  +This assumes that \fBcwish\fR has been installed in the default
          124  +location in /usr/local/bin;  if it's installed somewhere else
          125  +then you'll have to modify the above line to match.
          126  +Many UNIX systems do not allow the \fB#!\fR line to exceed about
          127  +30 characters in length, so be sure that the \fBcwish\fR executable
          128  +can be accessed with a short file name.
          129  +.PP
          130  +An even better approach is to start your script files with the
          131  +following three lines:
          132  +.nf
          133  +
          134  +\fB#!/bin/sh
          135  +# the next line restarts using cwish \e
          136  +exec cwish "$0" "$@"\fR
          137  +
          138  +.fi
          139  +This approach has three advantages over the approach in the previous
          140  +paragraph.  First, the location of the \fBcwish\fR binary doesn't have
          141  +to be hard-wired into the script:  it can be anywhere in your shell
          142  +search path.  Second, it gets around the 30-character file name limit
          143  +in the previous approach.
          144  +Third, this approach will work even if \fBcwish\fR is
          145  +itself a shell script (this is done on some systems in order to
          146  +handle multiple architectures or operating systems:  the \fBcwish\fR
          147  +script selects one of several binaries to run).  The three lines
          148  +cause both \fBsh\fR and \fBcwish\fR to process the script, but the
          149  +\fBexec\fR is only executed by \fBsh\fR.
          150  +\fBsh\fR processes the script first;  it treats the second
          151  +line as a comment and executes the third line.
          152  +The \fBexec\fR statement cause the shell to stop processing and
          153  +instead to start up \fBcwish\fR to reprocess the entire script.
          154  +When \fBcwish\fR starts up, it treats all three lines as comments,
          155  +since the backslash at the end of the second line causes the third
          156  +line to be treated as part of the comment on the second line.
          157  +.PP
          158  +If your system does not have Tk installed, you may want to link
          159  +cwish to plain "wish" so that scripts written for the Tk windowing
          160  +shell will invoke cwish.  Beware that most Tk scripts require some
          161  +modification to be usable with CTk.
          162  +
          163  +.SH "ENVIRONMENT VARIABLES"
          164  +.IP CTK_DISPLAY 20
          165  +Define this variable to display to a device other than standard input/output.
          166  +The device can be followed by :\fIterm\fR to set the terminal type
          167  +for the device.
          168  +.IP CTK_LIBRARY 20
          169  +Define this variable to override the CTK_LIBRARY path
          170  +that was compiled into the cwish binary.
          171  +.IP CTK_TERM 20
          172  +Define this variable to override the value of the \fBTERM\fR
          173  +enviroment variable.
          174  +.IP TERM 20
          175  +Defines the type of terminal for the standard input and output device.
          176  +
          177  +.SH AUTHOR
          178  +Martin Andrews <andrewm@ccfadm.eeg.ccf.org>
          179  +
          180  +.SH BUGS
          181  +Report bugs to andrewm@ccfadm.eeg.ccf.org.
          182  +Include a complete, self-contained example
          183  +that will allow the bug to be reproduced,
          184  +and say which version of CTk and Tcl you are using.
          185  +
          186  +.SH "SEE ALSO"
          187  +.BR tclsh (1)

Added default.h version [83d592c8ef].

            1  +/*
            2  + * default.h (CTk) --
            3  + *
            4  + *	This file defines the defaults for all options for all of
            5  + *	the CTk widgets.
            6  + *
            7  + * Copyright (c) 1991-1994 The Regents of the University of California.
            8  + * Copyright (c) 1994 Sun Microsystems, Inc.
            9  + * Copyright (c) 1994-1995 Cleveland Clinic Foundation
           10  + *
           11  + * See the file "license.terms" for information on usage and redistribution
           12  + * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
           13  + *
           14  + * @(#) $Id: ctk.shar,v 1.50 1996/01/15 14:47:16 andrewm Exp andrewm $
           15  + */
           16  +
           17  +#ifndef _DEFAULT
           18  +#define _DEFAULT
           19  +
           20  +/*
           21  + * Defaults for labels, buttons, checkbuttons, and radiobuttons:
           22  + */
           23  +
           24  +#define DEF_BUTTON_ANCHOR		"center"
           25  +#define DEF_BUTTON_BORDER_WIDTH		"0"
           26  +#define DEF_BUTTON_COMMAND		""
           27  +#define DEF_BUTTON_HEIGHT		"-1"
           28  +#define DEF_BUTTON_INDICATOR		"1"
           29  +#define DEF_BUTTON_JUSTIFY		"center"
           30  +#define DEF_BUTTON_OFF_VALUE		"0"
           31  +#define DEF_BUTTON_ON_VALUE		"1"
           32  +#define DEF_BUTTON_PADX			"0"
           33  +#define DEF_BUTTON_PADY			"0"
           34  +#define DEF_BUTTON_STATE		"normal"
           35  +#define DEF_LABEL_TAKE_FOCUS		"0"
           36  +#define DEF_BUTTON_TAKE_FOCUS		(char *) NULL
           37  +#define DEF_BUTTON_TEXT			" "
           38  +#define DEF_BUTTON_TEXT_VARIABLE	""
           39  +#define DEF_BUTTON_UNDERLINE		"-1"
           40  +#define DEF_BUTTON_VALUE		""
           41  +#define DEF_BUTTON_WIDTH		"-1"
           42  +#define DEF_BUTTON_WRAP_LENGTH		"0"
           43  +#define DEF_RADIOBUTTON_VARIABLE	"selectedButton"
           44  +#define DEF_CHECKBUTTON_VARIABLE	""
           45  +
           46  +/*
           47  + * Defaults for entries:
           48  + */
           49  +
           50  +#define DEF_ENTRY_BORDER_WIDTH		"0"
           51  +#define DEF_ENTRY_JUSTIFY		"left"
           52  +#define DEF_ENTRY_SCROLL_COMMAND	""
           53  +#define DEF_ENTRY_SHOW			(char *) NULL
           54  +#define DEF_ENTRY_STATE			"normal"
           55  +#define DEF_ENTRY_TAKE_FOCUS		(char *) NULL
           56  +#define DEF_ENTRY_TEXT_VARIABLE		""
           57  +#define DEF_ENTRY_WIDTH			"20"
           58  +
           59  +/*
           60  + * Defaults for frames:
           61  + */
           62  +
           63  +#define DEF_FRAME_BORDER_WIDTH		"0"
           64  +#define DEF_FRAME_CLASS			"Frame"
           65  +#define DEF_FRAME_HEIGHT		"0"
           66  +#define DEF_FRAME_TAKE_FOCUS		"0"
           67  +#define DEF_FRAME_WIDTH			"0"
           68  +
           69  +/*
           70  + * Defaults for listboxes:
           71  + */
           72  +
           73  +#define DEF_LISTBOX_BORDER_WIDTH	"1"
           74  +#define DEF_LISTBOX_HEIGHT		"10"
           75  +#define DEF_LISTBOX_SCROLL_COMMAND	""
           76  +#define DEF_LISTBOX_SELECT_MODE		"browse"
           77  +#define DEF_LISTBOX_TAKE_FOCUS		(char *) NULL
           78  +#define DEF_LISTBOX_WIDTH		"20"
           79  +
           80  +/*
           81  + * Defaults for individual entries of menus:
           82  + */
           83  +
           84  +#define DEF_MENU_ENTRY_ACCELERATOR	(char *) NULL
           85  +#define DEF_MENU_ENTRY_COMMAND		(char *) NULL
           86  +#define DEF_MENU_ENTRY_INDICATOR	"1"
           87  +#define DEF_MENU_ENTRY_LABEL		(char *) NULL
           88  +#define DEF_MENU_ENTRY_MENU		(char *) NULL
           89  +#define DEF_MENU_ENTRY_OFF_VALUE	"0"
           90  +#define DEF_MENU_ENTRY_ON_VALUE		"1"
           91  +#define DEF_MENU_ENTRY_STATE		"normal"
           92  +#define DEF_MENU_ENTRY_VALUE		(char *) NULL
           93  +#define DEF_MENU_ENTRY_CHECK_VARIABLE	(char *) NULL
           94  +#define DEF_MENU_ENTRY_RADIO_VARIABLE	"selectedButton"
           95  +#define DEF_MENU_ENTRY_UNDERLINE	"-1"
           96  +
           97  +/*
           98  + * Defaults for menus overall:
           99  + */
          100  +
          101  +#define DEF_MENU_BORDER_WIDTH		"1"
          102  +#define DEF_MENU_POST_COMMAND		""
          103  +#define DEF_MENU_TAKE_FOCUS		"0"
          104  +#define DEF_MENU_TEAROFF		"0"
          105  +
          106  +/*
          107  + * Defaults for menubuttons:
          108  + */
          109  +
          110  +#define DEF_MENUBUTTON_ANCHOR		"center"
          111  +#define DEF_MENUBUTTON_BORDER_WIDTH	"0"
          112  +#define DEF_MENUBUTTON_HEIGHT		"-1"
          113  +#define DEF_MENUBUTTON_INDICATOR	"0"
          114  +#define DEF_MENUBUTTON_JUSTIFY		"center"
          115  +#define DEF_MENUBUTTON_MENU		""
          116  +#define DEF_MENUBUTTON_PADX		"0"
          117  +#define DEF_MENUBUTTON_PADY		"0"
          118  +#define DEF_MENUBUTTON_STATE		"normal"
          119  +#define DEF_MENUBUTTON_TAKE_FOCUS	(char *) NULL
          120  +#define DEF_MENUBUTTON_TEXT		" "
          121  +#define DEF_MENUBUTTON_TEXT_VARIABLE	""
          122  +#define DEF_MENUBUTTON_UNDERLINE	"-1"
          123  +#define DEF_MENUBUTTON_WIDTH		"-1"
          124  +#define DEF_MENUBUTTON_WRAP_LENGTH	"0"
          125  +
          126  +/*
          127  + * Defaults for scrollbars:
          128  + */
          129  +
          130  +#define DEF_SCROLLBAR_BORDER_WIDTH	"0"
          131  +#define DEF_SCROLLBAR_COMMAND		""
          132  +#define DEF_SCROLLBAR_ORIENT		"vertical"
          133  +#define DEF_SCROLLBAR_TAKE_FOCUS	"0"
          134  +#define DEF_SCROLLBAR_WIDTH		"1"
          135  +
          136  +/*
          137  + * Defaults for texts:
          138  + */
          139  +
          140  +#define DEF_TEXT_BORDER_WIDTH		"1"
          141  +#define DEF_TEXT_HEIGHT			"10"
          142  +#define DEF_TEXT_PADX			"0"
          143  +#define DEF_TEXT_PADY			"0"
          144  +#define DEF_TEXT_SPACING1		"0"
          145  +#define DEF_TEXT_SPACING2		"0"
          146  +#define DEF_TEXT_SPACING3		"0"
          147  +#define DEF_TEXT_STATE			"normal"
          148  +#define DEF_TEXT_TABS			""
          149  +#define DEF_TEXT_TAKE_FOCUS		(char *) NULL
          150  +#define DEF_TEXT_WIDTH			"40"
          151  +#define DEF_TEXT_WRAP			"char"
          152  +#define DEF_TEXT_XSCROLL_COMMAND	""
          153  +#define DEF_TEXT_YSCROLL_COMMAND	""
          154  +
          155  +/*
          156  + * Defaults for toplevels (most of the defaults for frames also apply
          157  + * to toplevels):
          158  + */
          159  +
          160  +#define DEF_TOPLEVEL_BORDER_WIDTH	"1"
          161  +#define DEF_TOPLEVEL_CLASS		"Toplevel"
          162  +#define DEF_TOPLEVEL_SCREEN		""
          163  +#define DEF_TOPLEVEL_TITLE		(char *) NULL
          164  +
          165  +
          166  +#endif /* _DEFAULT */

Added install-sh version [b087e5c4b9].

            1  +#!/bin/sh
            2  +
            3  +#
            4  +# install - install a program, script, or datafile
            5  +# This comes from X11R5; it is not part of GNU.
            6  +#
            7  +# $XConsortium: install.sh,v 1.2 89/12/18 14:47:22 jim Exp $
            8  +#
            9  +# This script is compatible with the BSD install script, but was written
           10  +# from scratch.
           11  +#
           12  +
           13  +
           14  +# set DOITPROG to echo to test this script
           15  +
           16  +# Don't use :- since 4.3BSD and earlier shells don't like it.
           17  +doit="${DOITPROG-}"
           18  +
           19  +
           20  +# put in absolute paths if you don't have them in your path; or use env. vars.
           21  +
           22  +mvprog="${MVPROG-mv}"
           23  +cpprog="${CPPROG-cp}"
           24  +chmodprog="${CHMODPROG-chmod}"
           25  +chownprog="${CHOWNPROG-chown}"
           26  +chgrpprog="${CHGRPPROG-chgrp}"
           27  +stripprog="${STRIPPROG-strip}"
           28  +rmprog="${RMPROG-rm}"
           29  +
           30  +instcmd="$mvprog"
           31  +chmodcmd=""
           32  +chowncmd=""
           33  +chgrpcmd=""
           34  +stripcmd=""
           35  +rmcmd="$rmprog -f"
           36  +mvcmd="$mvprog"
           37  +src=""
           38  +dst=""
           39  +
           40  +while [ x"$1" != x ]; do
           41  +    case $1 in
           42  +	-c) instcmd="$cpprog"
           43  +	    shift
           44  +	    continue;;
           45  +
           46  +	-m) chmodcmd="$chmodprog $2"
           47  +	    shift
           48  +	    shift
           49  +	    continue;;
           50  +
           51  +	-o) chowncmd="$chownprog $2"
           52  +	    shift
           53  +	    shift
           54  +	    continue;;
           55  +
           56  +	-g) chgrpcmd="$chgrpprog $2"
           57  +	    shift
           58  +	    shift
           59  +	    continue;;
           60  +
           61  +	-s) stripcmd="$stripprog"
           62  +	    shift
           63  +	    continue;;
           64  +
           65  +	*)  if [ x"$src" = x ]
           66  +	    then
           67  +		src=$1
           68  +	    else
           69  +		dst=$1
           70  +	    fi
           71  +	    shift
           72  +	    continue;;
           73  +    esac
           74  +done
           75  +
           76  +if [ x"$src" = x ]
           77  +then
           78  +	echo "install:  no input file specified"
           79  +	exit 1
           80  +fi
           81  +
           82  +if [ x"$dst" = x ]
           83  +then
           84  +	echo "install:  no destination specified"
           85  +	exit 1
           86  +fi
           87  +
           88  +
           89  +# If destination is a directory, append the input filename; if your system
           90  +# does not like double slashes in filenames, you may need to add some logic
           91  +
           92  +if [ -d $dst ]
           93  +then
           94  +	dst="$dst"/`basename $src`
           95  +fi
           96  +
           97  +# Make a temp file name in the proper directory.
           98  +
           99  +dstdir=`dirname $dst`
          100  +dsttmp=$dstdir/#inst.$$#
          101  +
          102  +# Move or copy the file name to the temp name
          103  +
          104  +$doit $instcmd $src $dsttmp
          105  +
          106  +# and set any options; do chmod last to preserve setuid bits
          107  +
          108  +if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; fi
          109  +if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; fi
          110  +if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; fi
          111  +if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; fi
          112  +
          113  +# Now rename the file to the real destination.
          114  +
          115  +$doit $rmcmd $dst
          116  +$doit $mvcmd $dsttmp $dst
          117  +
          118  +
          119  +exit 0

Added interp_violation.out version [396cf32bf5].

            1  +tkCmds.c:	    (char *) NULL) == TCL_OK  && interp->result[0] != '\0') {
            2  +tkCmds.c:	if (interp->result[1] == '\0') {
            3  +tkCmds.c:	    if (interp->result[0] == '1') {
            4  +tkCmds.c:	    } else if (interp->result[0] == '0') {
            5  +tkCmds.c:	if (interp->result[0] == 'd'
            6  +tkCmds.c:		&& strcmp(interp->result, "disabled") == 0) goto nofocus;
            7  +tkCmds.c:    if (strstr(interp->result, "Key"))  goto focus;
            8  +tkCmds.c:    if (strstr(interp->result, "Focus"))  goto focus;
            9  +tkCmds.c:    if (strstr(interp->result, "Key"))  goto focus;
           10  +tkCmds.c:    if (strstr(interp->result, "Focus"))  goto focus;
           11  +tkEvent.c:    char *errorMsg;		/* The error message (interp->result when
           12  +tkEvent.c:    errPtr->errorMsg = (char *) ckalloc((unsigned) (strlen(interp->result)
           13  +tkEvent.c:    strcpy(errPtr->errorMsg, interp->result);
           14  +tkEvent.c:	    if (strcmp(interp->result, "\"tkerror\" is an invalid command name or ambiguous abbreviation") == 0) {
           15  +tkEvent.c:		fprintf(stderr, "    Error in tkerror: %s\n", interp->result);
           16  +tkFrame.c:		    placeArgv[1], interp->result);
           17  +tkMain.c:	fprintf(stderr, "%s\n", interp->result);
           18  +tkMain.c:	fprintf(stderr, "%s\n", interp->result);
           19  +tkMain.c:	    fprintf(stderr, "%s\n", interp->result);
           20  +tkMain.c:            Tcl_Write(errChannel, interp->result, -1);
           21  +tkMain.c:                    Tcl_Write(errChannel, interp->result, -1);
           22  +tkMain.c:                            Tcl_Write(errChannel, interp->result, -1);
           23  +tkMain.c:    if (*interp->result != 0) {
           24  +tkMain.c:	    puts(interp->result);
           25  +tkMain.c:	    fprintf(stderr, "%s\n", interp->result);
           26  +tkText.c:	TkTextPrintIndex(&index1, interp->result);
           27  +tkText.c:	    TkTextPrintIndex(&index, interp->result);

Added keyCodes.h version [26cded1ec0].

            1  +/*
            2  + * keyCodes.h (CTk) --
            3  + *
            4  + *	This file defines the mapping from curses key codes to
            5  + *	to X11 keysyms and modifier masks.
            6  + *
            7  + * Copyright (c) 1995 Cleveland Clinic Foundation
            8  + *
            9  + * See the file "license.terms" for information on usage and redistribution
           10  + * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
           11  + *
           12  + * @(#) $Header: /usrs/andrewm/work/RCS/ctk.shar,v 1.50 1996/01/15 14:47:16 andrewm Exp andrewm $
           13  + */
           14  +
           15  +    { 0001, 0x0061, ControlMask },	/* Control-A */
           16  +    { 0002, 0x0062, ControlMask },	/* Control-B */
           17  +    { 0003, 0x0063, ControlMask },	/* Control-C */
           18  +    { 0004, 0x0064, ControlMask },	/* Control-D */
           19  +    { 0005, 0x0065, ControlMask },	/* Control-E */
           20  +    { 0006, 0x0066, ControlMask },	/* Control-F */
           21  +    { 0007, 0x0067, ControlMask },	/* Control-G */
           22  +    { 0010, 0xFF08, 0 },		/* Backspace (Control-H) */
           23  +    { 0177, 0xFF08, 0 },		/* Backspace (Control-?) */
           24  +    { 0011, 0xFF09, 0 },		/* Tab (Control-I) */
           25  +    { 0012, 0x006A, ControlMask },	/* Control-J */
           26  +    { 0013, 0x006B, ControlMask },	/* Control-K */
           27  +    { 0014, 0x006C, ControlMask },	/* Control-L */
           28  +    { 0015, 0xFF0D, 0 },		/* Carriage Return (Control-M) */
           29  +    { 0016, 0x006E, ControlMask },	/* Control-N */
           30  +    { 0017, 0x006F, ControlMask },	/* Control-O */
           31  +    { 0020, 0x0070, ControlMask },	/* Control-P */
           32  +    { 0021, 0x0071, ControlMask },	/* Control-Q */
           33  +    { 0022, 0x0072, ControlMask },	/* Control-R */
           34  +    { 0023, 0x0073, ControlMask },	/* Control-S */
           35  +    { 0024, 0x0074, ControlMask },	/* Control-T */
           36  +    { 0025, 0x0075, ControlMask },	/* Control-U */
           37  +    { 0026, 0x0076, ControlMask },	/* Control-V */
           38  +    { 0027, 0x0077, ControlMask },	/* Control-W */
           39  +    { 0030, 0x0078, ControlMask },	/* Control-X */
           40  +    { 0031, 0x0079, ControlMask },	/* Control-Y */
           41  +    { 0032, 0x007A, ControlMask },	/* Control-Z */
           42  +    { 0033, 0xFF1B, 0 },		/* Escape (deprecated) */
           43  +#ifdef KEY_BREAK
           44  +    { KEY_BREAK, 0xFF6B, 0 },		/* Break key (unreliable) */
           45  +#endif
           46  +#ifdef KEY_DOWN
           47  +    { KEY_DOWN, 0xFF54, 0 },		/* Down */
           48  +#endif
           49  +#ifdef KEY_UP
           50  +    { KEY_UP, 0xFF52, 0 },		/* Up */
           51  +#endif
           52  +#ifdef KEY_LEFT
           53  +    { KEY_LEFT, 0xFF51, 0 },		/* Left */
           54  +#endif
           55  +#ifdef KEY_RIGHT
           56  +    { KEY_RIGHT, 0xFF53, 0 },		/* Right */
           57  +#endif
           58  +#ifdef KEY_HOME
           59  +    { KEY_HOME, 0xFF50, 0 },		/* Home key (upward+left arrow) */
           60  +#endif
           61  +#ifdef KEY_BACKSPACE
           62  +    { KEY_BACKSPACE, 0xFF08, 0 },	/* backspace (unreliable) */
           63  +#endif
           64  +#ifdef KEY_F
           65  +    { KEY_F(1), 0xFFBE, 0 },		/* F1 */
           66  +    { KEY_F(2), 0xFFBF, 0 },		/* F2 */
           67  +    { KEY_F(3), 0xFFC0, 0 },		/* F3 */
           68  +    { KEY_F(4), 0xFFC1, 0 },		/* F4 */
           69  +    { KEY_F(5), 0xFFC2, 0 },		/* F5 */
           70  +    { KEY_F(6), 0xFFC3, 0 },		/* F6 */
           71  +    { KEY_F(7), 0xFFC4, 0 },		/* F7 */
           72  +    { KEY_F(8), 0xFFC5, 0 },		/* F8 */
           73  +    { KEY_F(9), 0xFFC6, 0 },		/* F9 */
           74  +    { KEY_F(10), 0xFFC7, 0 },		/* F10 */
           75  +#endif
           76  +#ifdef KEY_DL
           77  +    { KEY_DL, 0xFFFF, ShiftMask },	/* Delete line */
           78  +#endif
           79  +#ifdef KEY_IL
           80  +    { KEY_IL, 0xFF63, ShiftMask },	/* Insert line */
           81  +#endif
           82  +#ifdef KEY_DC
           83  +    { KEY_DC, 0xFFFF, 0 },		/* Delete character */
           84  +#endif
           85  +#ifdef KEY_IC
           86  +    { KEY_IC, 0xFF63, 0 },		/* Insert character/mode */
           87  +#endif
           88  +#ifdef KEY_EIC
           89  +    { KEY_EIC, 0xFF63, 0 },		/* Exit insert mode */
           90  +#endif
           91  +#ifdef KEY_CLEAR
           92  +    { KEY_CLEAR, 0xFF0B, 0 },		/* Clear screen */
           93  +#endif
           94  +#ifdef KEY_NPAGE
           95  +    { KEY_NPAGE, 0xFF56, 0 },		/* Next page */
           96  +#endif
           97  +#ifdef KEY_PPAGE
           98  +    { KEY_PPAGE, 0xFF55, 0 },		/* Previous page */
           99  +#endif
          100  +#ifdef KEY_ENTER
          101  +    { KEY_ENTER, 0xFF8D, 0 },		/* Enter or send (unreliable) */
          102  +#endif
          103  +#ifdef KEY_PRINT
          104  +    { KEY_PRINT, 0xFF61, 0 },		/* Print or copy */
          105  +#endif
          106  +#ifdef KEY_LL
          107  +    { KEY_LL, 0xFF57, ControlMask },	/* home down or bottom (lower left) */
          108  +#endif
          109  +#ifdef KEY_BTAB
          110  +    { KEY_BTAB, 0xFF09, ShiftMask },	/* Back tab */
          111  +#endif
          112  +#ifdef KEY_BEG
          113  +    { KEY_BEG, 0xFF58, 0 },		/* beg(inning) key */
          114  +#endif
          115  +#ifdef KEY_CANCEL
          116  +    { KEY_CANCEL, 0xFF69, 0 },		/* cancel key */
          117  +#endif
          118  +#ifdef KEY_COMMAND
          119  +    { KEY_COMMAND, 0xFF62, 0 },		/* cmd (command) key */
          120  +#endif
          121  +#ifdef KEY_END
          122  +    { KEY_END, 0xFF57, 0 },		/* End key */
          123  +#endif
          124  +#ifdef KEY_FIND
          125  +    { KEY_FIND, 0xFF68, 0 },		/* Find key */
          126  +#endif
          127  +#ifdef KEY_HELP
          128  +    { KEY_HELP, 0xFF6A, 0 },		/* Help key */
          129  +#endif
          130  +#ifdef KEY_NEXT
          131  +    { KEY_NEXT, 0xFF09, 0 },		/* Next object key */
          132  +#endif
          133  +#ifdef KEY_OPTIONS
          134  +    { KEY_OPTIONS, 0xFF67, 0 },		/* Options key */
          135  +#endif
          136  +#ifdef KEY_PREVIOUS
          137  +    { KEY_PREVIOUS, 0xFF09, ShiftMask },/* Previous object key */
          138  +#endif
          139  +#ifdef KEY_REDO
          140  +    { KEY_REDO, 0xFF66, 0 },		/* Redo key */
          141  +#endif
          142  +#ifdef KEY_SELECT
          143  +    { KEY_SELECT, 0xFF60, 0 },		/* Select key */
          144  +#endif
          145  +#ifdef KEY_SUSPEND
          146  +    { KEY_SUSPEND, 0xFF13, 0 },		/* Suspend key */
          147  +#endif
          148  +#ifdef KEY_UNDO
          149  +    { KEY_UNDO, 0xFF65, 0 },		/* Undo key */
          150  +#endif

Added ks_names.h version [22ac970e54].

            1  +/*
            2  + * This file is generated from $(INCLUDESRC)/keysymdef.h.  Do not edit.
            3  + */
            4  +{ "BackSpace", 0xFF08 },
            5  +{ "Tab", 0xFF09 },
            6  +{ "Linefeed", 0xFF0A },
            7  +{ "Clear", 0xFF0B },
            8  +{ "Return", 0xFF0D },
            9  +{ "Pause", 0xFF13 },
           10  +{ "Escape", 0xFF1B },
           11  +{ "Delete", 0xFFFF },
           12  +{ "Multi_key", 0xFF20 },
           13  +{ "Kanji", 0xFF21 },
           14  +{ "Home", 0xFF50 },
           15  +{ "Left", 0xFF51 },
           16  +{ "Up", 0xFF52 },
           17  +{ "Right", 0xFF53 },
           18  +{ "Down", 0xFF54 },
           19  +{ "Prior", 0xFF55 },
           20  +{ "Next", 0xFF56 },
           21  +{ "End", 0xFF57 },
           22  +{ "Begin", 0xFF58 },
           23  +{ "Select", 0xFF60 },
           24  +{ "Print", 0xFF61 },
           25  +{ "Execute", 0xFF62 },
           26  +{ "Insert", 0xFF63 },
           27  +{ "Undo", 0xFF65 },
           28  +{ "Redo", 0xFF66 },
           29  +{ "Menu", 0xFF67 },
           30  +{ "Find", 0xFF68 },
           31  +{ "Cancel", 0xFF69 },
           32  +{ "Help", 0xFF6A },
           33  +{ "Break", 0xFF6B },
           34  +{ "Mode_switch", 0xFF7E },
           35  +{ "script_switch", 0xFF7E },
           36  +{ "Num_Lock", 0xFF7F },
           37  +{ "KP_Space", 0xFF80 },
           38  +{ "KP_Tab", 0xFF89 },
           39  +{ "KP_Enter", 0xFF8D },
           40  +{ "KP_F1", 0xFF91 },
           41  +{ "KP_F2", 0xFF92 },
           42  +{ "KP_F3", 0xFF93 },
           43  +{ "KP_F4", 0xFF94 },
           44  +{ "KP_Equal", 0xFFBD },
           45  +{ "KP_Multiply", 0xFFAA },
           46  +{ "KP_Add", 0xFFAB },
           47  +{ "KP_Separator", 0xFFAC },
           48  +{ "KP_Subtract", 0xFFAD },
           49  +{ "KP_Decimal", 0xFFAE },
           50  +{ "KP_Divide", 0xFFAF },
           51  +{ "KP_0", 0xFFB0 },
           52  +{ "KP_1", 0xFFB1 },
           53  +{ "KP_2", 0xFFB2 },
           54  +{ "KP_3", 0xFFB3 },
           55  +{ "KP_4", 0xFFB4 },
           56  +{ "KP_5", 0xFFB5 },
           57  +{ "KP_6", 0xFFB6 },
           58  +{ "KP_7", 0xFFB7 },
           59  +{ "KP_8", 0xFFB8 },
           60  +{ "KP_9", 0xFFB9 },
           61  +{ "F1", 0xFFBE },
           62  +{ "F2", 0xFFBF },
           63  +{ "F3", 0xFFC0 },
           64  +{ "F4", 0xFFC1 },
           65  +{ "F5", 0xFFC2 },
           66  +{ "F6", 0xFFC3 },
           67  +{ "F7", 0xFFC4 },
           68  +{ "F8", 0xFFC5 },
           69  +{ "F9", 0xFFC6 },
           70  +{ "F10", 0xFFC7 },
           71  +{ "F11", 0xFFC8 },
           72  +{ "L1", 0xFFC8 },
           73  +{ "F12", 0xFFC9 },
           74  +{ "L2", 0xFFC9 },
           75  +{ "F13", 0xFFCA },
           76  +{ "L3", 0xFFCA },
           77  +{ "F14", 0xFFCB },
           78  +{ "L4", 0xFFCB },
           79  +{ "F15", 0xFFCC },
           80  +{ "L5", 0xFFCC },
           81  +{ "F16", 0xFFCD },
           82  +{ "L6", 0xFFCD },
           83  +{ "F17", 0xFFCE },
           84  +{ "L7", 0xFFCE },
           85  +{ "F18", 0xFFCF },
           86  +{ "L8", 0xFFCF },
           87  +{ "F19", 0xFFD0 },
           88  +{ "L9", 0xFFD0 },
           89  +{ "F20", 0xFFD1 },
           90  +{ "L10", 0xFFD1 },
           91  +{ "F21", 0xFFD2 },
           92  +{ "R1", 0xFFD2 },
           93  +{ "F22", 0xFFD3 },
           94  +{ "R2", 0xFFD3 },
           95  +{ "F23", 0xFFD4 },
           96  +{ "R3", 0xFFD4 },
           97  +{ "F24", 0xFFD5 },
           98  +{ "R4", 0xFFD5 },
           99  +{ "F25", 0xFFD6 },
          100  +{ "R5", 0xFFD6 },
          101  +{ "F26", 0xFFD7 },
          102  +{ "R6", 0xFFD7 },
          103  +{ "F27", 0xFFD8 },
          104  +{ "R7", 0xFFD8 },
          105  +{ "F28", 0xFFD9 },
          106  +{ "R8", 0xFFD9 },
          107  +{ "F29", 0xFFDA },
          108  +{ "R9", 0xFFDA },
          109  +{ "F30", 0xFFDB },
          110  +{ "R10", 0xFFDB },
          111  +{ "F31", 0xFFDC },
          112  +{ "R11", 0xFFDC },
          113  +{ "F32", 0xFFDD },
          114  +{ "R12", 0xFFDD },
          115  +{ "R13", 0xFFDE },
          116  +{ "F33", 0xFFDE },
          117  +{ "F34", 0xFFDF },
          118  +{ "R14", 0xFFDF },
          119  +{ "F35", 0xFFE0 },
          120  +{ "R15", 0xFFE0 },
          121  +{ "Shift_L", 0xFFE1 },
          122  +{ "Shift_R", 0xFFE2 },
          123  +{ "Control_L", 0xFFE3 },
          124  +{ "Control_R", 0xFFE4 },
          125  +{ "Caps_Lock", 0xFFE5 },
          126  +{ "Shift_Lock", 0xFFE6 },
          127  +{ "Meta_L", 0xFFE7 },
          128  +{ "Meta_R", 0xFFE8 },
          129  +{ "Alt_L", 0xFFE9 },
          130  +{ "Alt_R", 0xFFEA },
          131  +{ "Super_L", 0xFFEB },
          132  +{ "Super_R", 0xFFEC },
          133  +{ "Hyper_L", 0xFFED },
          134  +{ "Hyper_R", 0xFFEE },
          135  +{ "space", 0x020 },
          136  +{ "exclam", 0x021 },
          137  +{ "quotedbl", 0x022 },
          138  +{ "numbersign", 0x023 },
          139  +{ "dollar", 0x024 },
          140  +{ "percent", 0x025 },
          141  +{ "ampersand", 0x026 },
          142  +{ "quoteright", 0x027 },
          143  +{ "parenleft", 0x028 },
          144  +{ "parenright", 0x029 },
          145  +{ "asterisk", 0x02a },
          146  +{ "plus", 0x02b },
          147  +{ "comma", 0x02c },
          148  +{ "minus", 0x02d },
          149  +{ "period", 0x02e },
          150  +{ "slash", 0x02f },
          151  +{ "0", 0x030 },
          152  +{ "1", 0x031 },
          153  +{ "2", 0x032 },
          154  +{ "3", 0x033 },
          155  +{ "4", 0x034 },
          156  +{ "5", 0x035 },
          157  +{ "6", 0x036 },
          158  +{ "7", 0x037 },
          159  +{ "8", 0x038 },
          160  +{ "9", 0x039 },
          161  +{ "colon", 0x03a },
          162  +{ "semicolon", 0x03b },
          163  +{ "less", 0x03c },
          164  +{ "equal", 0x03d },
          165  +{ "greater", 0x03e },
          166  +{ "question", 0x03f },
          167  +{ "at", 0x040 },
          168  +{ "A", 0x041 },
          169  +{ "B", 0x042 },
          170  +{ "C", 0x043 },
          171  +{ "D", 0x044 },
          172  +{ "E", 0x045 },
          173  +{ "F", 0x046 },
          174  +{ "G", 0x047 },
          175  +{ "H", 0x048 },
          176  +{ "I", 0x049 },
          177  +{ "J", 0x04a },
          178  +{ "K", 0x04b },
          179  +{ "L", 0x04c },
          180  +{ "M", 0x04d },
          181  +{ "N", 0x04e },
          182  +{ "O", 0x04f },
          183  +{ "P", 0x050 },
          184  +{ "Q", 0x051 },
          185  +{ "R", 0x052 },
          186  +{ "S", 0x053 },
          187  +{ "T", 0x054 },
          188  +{ "U", 0x055 },
          189  +{ "V", 0x056 },
          190  +{ "W", 0x057 },
          191  +{ "X", 0x058 },
          192  +{ "Y", 0x059 },
          193  +{ "Z", 0x05a },
          194  +{ "bracketleft", 0x05b },
          195  +{ "backslash", 0x05c },
          196  +{ "bracketright", 0x05d },
          197  +{ "asciicircum", 0x05e },
          198  +{ "underscore", 0x05f },
          199  +{ "quoteleft", 0x060 },
          200  +{ "a", 0x061 },
          201  +{ "b", 0x062 },
          202  +{ "c", 0x063 },
          203  +{ "d", 0x064 },
          204  +{ "e", 0x065 },
          205  +{ "f", 0x066 },
          206  +{ "g", 0x067 },
          207  +{ "h", 0x068 },
          208  +{ "i", 0x069 },
          209  +{ "j", 0x06a },
          210  +{ "k", 0x06b },
          211  +{ "l", 0x06c },
          212  +{ "m", 0x06d },
          213  +{ "n", 0x06e },
          214  +{ "o", 0x06f },
          215  +{ "p", 0x070 },
          216  +{ "q", 0x071 },
          217  +{ "r", 0x072 },
          218  +{ "s", 0x073 },
          219  +{ "t", 0x074 },
          220  +{ "u", 0x075 },
          221  +{ "v", 0x076 },
          222  +{ "w", 0x077 },
          223  +{ "x", 0x078 },
          224  +{ "y", 0x079 },
          225  +{ "z", 0x07a },
          226  +{ "braceleft", 0x07b },
          227  +{ "bar", 0x07c },
          228  +{ "braceright", 0x07d },
          229  +{ "asciitilde", 0x07e },
          230  +{ "nobreakspace", 0x0a0 },
          231  +{ "exclamdown", 0x0a1 },
          232  +{ "cent", 0x0a2 },
          233  +{ "sterling", 0x0a3 },
          234  +{ "currency", 0x0a4 },
          235  +{ "yen", 0x0a5 },
          236  +{ "brokenbar", 0x0a6 },
          237  +{ "section", 0x0a7 },
          238  +{ "diaeresis", 0x0a8 },
          239  +{ "copyright", 0x0a9 },
          240  +{ "ordfeminine", 0x0aa },
          241  +{ "guillemotleft", 0x0ab },
          242  +{ "notsign", 0x0ac },
          243  +{ "hyphen", 0x0ad },
          244  +{ "registered", 0x0ae },
          245  +{ "macron", 0x0af },
          246  +{ "degree", 0x0b0 },
          247  +{ "plusminus", 0x0b1 },
          248  +{ "twosuperior", 0x0b2 },
          249  +{ "threesuperior", 0x0b3 },
          250  +{ "acute", 0x0b4 },
          251  +{ "mu", 0x0b5 },
          252  +{ "paragraph", 0x0b6 },
          253  +{ "periodcentered", 0x0b7 },
          254  +{ "cedilla", 0x0b8 },
          255  +{ "onesuperior", 0x0b9 },
          256  +{ "masculine", 0x0ba },
          257  +{ "guillemotright", 0x0bb },
          258  +{ "onequarter", 0x0bc },
          259  +{ "onehalf", 0x0bd },
          260  +{ "threequarters", 0x0be },
          261  +{ "questiondown", 0x0bf },
          262  +{ "Agrave", 0x0c0 },
          263  +{ "Aacute", 0x0c1 },
          264  +{ "Acircumflex", 0x0c2 },
          265  +{ "Atilde", 0x0c3 },
          266  +{ "Adiaeresis", 0x0c4 },
          267  +{ "Aring", 0x0c5 },
          268  +{ "AE", 0x0c6 },
          269  +{ "Ccedilla", 0x0c7 },
          270  +{ "Egrave", 0x0c8 },
          271  +{ "Eacute", 0x0c9 },
          272  +{ "Ecircumflex", 0x0ca },
          273  +{ "Ediaeresis", 0x0cb },
          274  +{ "Igrave", 0x0cc },
          275  +{ "Iacute", 0x0cd },
          276  +{ "Icircumflex", 0x0ce },
          277  +{ "Idiaeresis", 0x0cf },
          278  +{ "Eth", 0x0d0 },
          279  +{ "Ntilde", 0x0d1 },
          280  +{ "Ograve", 0x0d2 },
          281  +{ "Oacute", 0x0d3 },
          282  +{ "Ocircumflex", 0x0d4 },
          283  +{ "Otilde", 0x0d5 },
          284  +{ "Odiaeresis", 0x0d6 },
          285  +{ "multiply", 0x0d7 },
          286  +{ "Ooblique", 0x0d8 },
          287  +{ "Ugrave", 0x0d9 },
          288  +{ "Uacute", 0x0da },
          289  +{ "Ucircumflex", 0x0db },
          290  +{ "Udiaeresis", 0x0dc },
          291  +{ "Yacute", 0x0dd },
          292  +{ "Thorn", 0x0de },
          293  +{ "ssharp", 0x0df },
          294  +{ "agrave", 0x0e0 },
          295  +{ "aacute", 0x0e1 },
          296  +{ "acircumflex", 0x0e2 },
          297  +{ "atilde", 0x0e3 },
          298  +{ "adiaeresis", 0x0e4 },
          299  +{ "aring", 0x0e5 },
          300  +{ "ae", 0x0e6 },
          301  +{ "ccedilla", 0x0e7 },
          302  +{ "egrave", 0x0e8 },
          303  +{ "eacute", 0x0e9 },
          304  +{ "ecircumflex", 0x0ea },
          305  +{ "ediaeresis", 0x0eb },
          306  +{ "igrave", 0x0ec },
          307  +{ "iacute", 0x0ed },
          308  +{ "icircumflex", 0x0ee },
          309  +{ "idiaeresis", 0x0ef },
          310  +{ "eth", 0x0f0 },
          311  +{ "ntilde", 0x0f1 },
          312  +{ "ograve", 0x0f2 },
          313  +{ "oacute", 0x0f3 },
          314  +{ "ocircumflex", 0x0f4 },
          315  +{ "otilde", 0x0f5 },
          316  +{ "odiaeresis", 0x0f6 },
          317  +{ "division", 0x0f7 },
          318  +{ "oslash", 0x0f8 },
          319  +{ "ugrave", 0x0f9 },
          320  +{ "uacute", 0x0fa },
          321  +{ "ucircumflex", 0x0fb },
          322  +{ "udiaeresis", 0x0fc },
          323  +{ "yacute", 0x0fd },
          324  +{ "thorn", 0x0fe },
          325  +{ "ydiaeresis", 0x0ff },
          326  +{ "Aogonek", 0x1a1 },
          327  +{ "breve", 0x1a2 },
          328  +{ "Lstroke", 0x1a3 },
          329  +{ "Lcaron", 0x1a5 },
          330  +{ "Sacute", 0x1a6 },
          331  +{ "Scaron", 0x1a9 },
          332  +{ "Scedilla", 0x1aa },
          333  +{ "Tcaron", 0x1ab },
          334  +{ "Zacute", 0x1ac },
          335  +{ "Zcaron", 0x1ae },
          336  +{ "Zabovedot", 0x1af },
          337  +{ "aogonek", 0x1b1 },
          338  +{ "ogonek", 0x1b2 },
          339  +{ "lstroke", 0x1b3 },
          340  +{ "lcaron", 0x1b5 },
          341  +{ "sacute", 0x1b6 },
          342  +{ "caron", 0x1b7 },
          343  +{ "scaron", 0x1b9 },
          344  +{ "scedilla", 0x1ba },
          345  +{ "tcaron", 0x1bb },
          346  +{ "zacute", 0x1bc },
          347  +{ "doubleacute", 0x1bd },
          348  +{ "zcaron", 0x1be },
          349  +{ "zabovedot", 0x1bf },
          350  +{ "Racute", 0x1c0 },
          351  +{ "Abreve", 0x1c3 },
          352  +{ "Cacute", 0x1c6 },
          353  +{ "Ccaron", 0x1c8 },
          354  +{ "Eogonek", 0x1ca },
          355  +{ "Ecaron", 0x1cc },
          356  +{ "Dcaron", 0x1cf },
          357  +{ "Nacute", 0x1d1 },
          358  +{ "Ncaron", 0x1d2 },
          359  +{ "Odoubleacute", 0x1d5 },
          360  +{ "Rcaron", 0x1d8 },
          361  +{ "Uring", 0x1d9 },
          362  +{ "Udoubleacute", 0x1db },
          363  +{ "Tcedilla", 0x1de },
          364  +{ "racute", 0x1e0 },
          365  +{ "abreve", 0x1e3 },
          366  +{ "cacute", 0x1e6 },
          367  +{ "ccaron", 0x1e8 },
          368  +{ "eogonek", 0x1ea },
          369  +{ "ecaron", 0x1ec },
          370  +{ "dcaron", 0x1ef },
          371  +{ "nacute", 0x1f1 },
          372  +{ "ncaron", 0x1f2 },
          373  +{ "odoubleacute", 0x1f5 },
          374  +{ "udoubleacute", 0x1fb },
          375  +{ "rcaron", 0x1f8 },
          376  +{ "uring", 0x1f9 },
          377  +{ "tcedilla", 0x1fe },
          378  +{ "abovedot", 0x1ff },
          379  +{ "Hstroke", 0x2a1 },
          380  +{ "Hcircumflex", 0x2a6 },
          381  +{ "Iabovedot", 0x2a9 },
          382  +{ "Gbreve", 0x2ab },
          383  +{ "Jcircumflex", 0x2ac },
          384  +{ "hstroke", 0x2b1 },
          385  +{ "hcircumflex", 0x2b6 },
          386  +{ "idotless", 0x2b9 },
          387  +{ "gbreve", 0x2bb },
          388  +{ "jcircumflex", 0x2bc },
          389  +{ "Cabovedot", 0x2c5 },
          390  +{ "Ccircumflex", 0x2c6 },
          391  +{ "Gabovedot", 0x2d5 },
          392  +{ "Gcircumflex", 0x2d8 },
          393  +{ "Ubreve", 0x2dd },
          394  +{ "Scircumflex", 0x2de },
          395  +{ "cabovedot", 0x2e5 },
          396  +{ "ccircumflex", 0x2e6 },
          397  +{ "gabovedot", 0x2f5 },
          398  +{ "gcircumflex", 0x2f8 },
          399  +{ "ubreve", 0x2fd },
          400  +{ "scircumflex", 0x2fe },
          401  +{ "kappa", 0x3a2 },
          402  +{ "Rcedilla", 0x3a3 },
          403  +{ "Itilde", 0x3a5 },
          404  +{ "Lcedilla", 0x3a6 },
          405  +{ "Emacron", 0x3aa },
          406  +{ "Gcedilla", 0x3ab },
          407  +{ "Tslash", 0x3ac },
          408  +{ "rcedilla", 0x3b3 },
          409  +{ "itilde", 0x3b5 },
          410  +{ "lcedilla", 0x3b6 },
          411  +{ "emacron", 0x3ba },
          412  +{ "gacute", 0x3bb },
          413  +{ "tslash", 0x3bc },
          414  +{ "ENG", 0x3bd },
          415  +{ "eng", 0x3bf },
          416  +{ "Amacron", 0x3c0 },
          417  +{ "Iogonek", 0x3c7 },
          418  +{ "Eabovedot", 0x3cc },
          419  +{ "Imacron", 0x3cf },
          420  +{ "Ncedilla", 0x3d1 },
          421  +{ "Omacron", 0x3d2 },
          422  +{ "Kcedilla", 0x3d3 },
          423  +{ "Uogonek", 0x3d9 },
          424  +{ "Utilde", 0x3dd },
          425  +{ "Umacron", 0x3de },
          426  +{ "amacron", 0x3e0 },
          427  +{ "iogonek", 0x3e7 },
          428  +{ "eabovedot", 0x3ec },
          429  +{ "imacron", 0x3ef },
          430  +{ "ncedilla", 0x3f1 },
          431  +{ "omacron", 0x3f2 },
          432  +{ "kcedilla", 0x3f3 },
          433  +{ "uogonek", 0x3f9 },
          434  +{ "utilde", 0x3fd },
          435  +{ "umacron", 0x3fe },
          436  +{ "overline", 0x47e },
          437  +{ "kana_fullstop", 0x4a1 },
          438  +{ "kana_openingbracket", 0x4a2 },
          439  +{ "kana_closingbracket", 0x4a3 },
          440  +{ "kana_comma", 0x4a4 },
          441  +{ "kana_middledot", 0x4a5 },
          442  +{ "kana_WO", 0x4a6 },
          443  +{ "kana_a", 0x4a7 },
          444  +{ "kana_i", 0x4a8 },
          445  +{ "kana_u", 0x4a9 },
          446  +{ "kana_e", 0x4aa },
          447  +{ "kana_o", 0x4ab },
          448  +{ "kana_ya", 0x4ac },
          449  +{ "kana_yu", 0x4ad },
          450  +{ "kana_yo", 0x4ae },
          451  +{ "kana_tu", 0x4af },
          452  +{ "prolongedsound", 0x4b0 },
          453  +{ "kana_A", 0x4b1 },
          454  +{ "kana_I", 0x4b2 },
          455  +{ "kana_U", 0x4b3 },
          456  +{ "kana_E", 0x4b4 },
          457  +{ "kana_O", 0x4b5 },
          458  +{ "kana_KA", 0x4b6 },
          459  +{ "kana_KI", 0x4b7 },
          460  +{ "kana_KU", 0x4b8 },
          461  +{ "kana_KE", 0x4b9 },
          462  +{ "kana_KO", 0x4ba },
          463  +{ "kana_SA", 0x4bb },
          464  +{ "kana_SHI", 0x4bc },
          465  +{ "kana_SU", 0x4bd },
          466  +{ "kana_SE", 0x4be },
          467  +{ "kana_SO", 0x4bf },
          468  +{ "kana_TA", 0x4c0 },
          469  +{ "kana_TI", 0x4c1 },
          470  +{ "kana_TU", 0x4c2 },
          471  +{ "kana_TE", 0x4c3 },
          472  +{ "kana_TO", 0x4c4 },
          473  +{ "kana_NA", 0x4c5 },
          474  +{ "kana_NI", 0x4c6 },
          475  +{ "kana_NU", 0x4c7 },
          476  +{ "kana_NE", 0x4c8 },
          477  +{ "kana_NO", 0x4c9 },
          478  +{ "kana_HA", 0x4ca },
          479  +{ "kana_HI", 0x4cb },
          480  +{ "kana_HU", 0x4cc },
          481  +{ "kana_HE", 0x4cd },
          482  +{ "kana_HO", 0x4ce },
          483  +{ "kana_MA", 0x4cf },
          484  +{ "kana_MI", 0x4d0 },
          485  +{ "kana_MU", 0x4d1 },
          486  +{ "kana_ME", 0x4d2 },
          487  +{ "kana_MO", 0x4d3 },
          488  +{ "kana_YA", 0x4d4 },
          489  +{ "kana_YU", 0x4d5 },
          490  +{ "kana_YO", 0x4d6 },
          491  +{ "kana_RA", 0x4d7 },
          492  +{ "kana_RI", 0x4d8 },
          493  +{ "kana_RU", 0x4d9 },
          494  +{ "kana_RE", 0x4da },
          495  +{ "kana_RO", 0x4db },
          496  +{ "kana_WA", 0x4dc },
          497  +{ "kana_N", 0x4dd },
          498  +{ "voicedsound", 0x4de },
          499  +{ "semivoicedsound", 0x4df },
          500  +{ "kana_switch", 0xFF7E },
          501  +{ "Arabic_comma", 0x5ac },
          502  +{ "Arabic_semicolon", 0x5bb },
          503  +{ "Arabic_question_mark", 0x5bf },
          504  +{ "Arabic_hamza", 0x5c1 },
          505  +{ "Arabic_maddaonalef", 0x5c2 },
          506  +{ "Arabic_hamzaonalef", 0x5c3 },
          507  +{ "Arabic_hamzaonwaw", 0x5c4 },
          508  +{ "Arabic_hamzaunderalef", 0x5c5 },
          509  +{ "Arabic_hamzaonyeh", 0x5c6 },
          510  +{ "Arabic_alef", 0x5c7 },
          511  +{ "Arabic_beh", 0x5c8 },
          512  +{ "Arabic_tehmarbuta", 0x5c9 },
          513  +{ "Arabic_teh", 0x5ca },
          514  +{ "Arabic_theh", 0x5cb },
          515  +{ "Arabic_jeem", 0x5cc },
          516  +{ "Arabic_hah", 0x5cd },
          517  +{ "Arabic_khah", 0x5ce },
          518  +{ "Arabic_dal", 0x5cf },
          519  +{ "Arabic_thal", 0x5d0 },
          520  +{ "Arabic_ra", 0x5d1 },
          521  +{ "Arabic_zain", 0x5d2 },
          522  +{ "Arabic_seen", 0x5d3 },
          523  +{ "Arabic_sheen", 0x5d4 },
          524  +{ "Arabic_sad", 0x5d5 },
          525  +{ "Arabic_dad", 0x5d6 },
          526  +{ "Arabic_tah", 0x5d7 },
          527  +{ "Arabic_zah", 0x5d8 },
          528  +{ "Arabic_ain", 0x5d9 },
          529  +{ "Arabic_ghain", 0x5da },
          530  +{ "Arabic_tatweel", 0x5e0 },
          531  +{ "Arabic_feh", 0x5e1 },
          532  +{ "Arabic_qaf", 0x5e2 },
          533  +{ "Arabic_kaf", 0x5e3 },
          534  +{ "Arabic_lam", 0x5e4 },
          535  +{ "Arabic_meem", 0x5e5 },
          536  +{ "Arabic_noon", 0x5e6 },
          537  +{ "Arabic_heh", 0x5e7 },
          538  +{ "Arabic_waw", 0x5e8 },
          539  +{ "Arabic_alefmaksura", 0x5e9 },
          540  +{ "Arabic_yeh", 0x5ea },
          541  +{ "Arabic_fathatan", 0x5eb },
          542  +{ "Arabic_dammatan", 0x5ec },
          543  +{ "Arabic_kasratan", 0x5ed },
          544  +{ "Arabic_fatha", 0x5ee },
          545  +{ "Arabic_damma", 0x5ef },
          546  +{ "Arabic_kasra", 0x5f0 },
          547  +{ "Arabic_shadda", 0x5f1 },
          548  +{ "Arabic_sukun", 0x5f2 },
          549  +{ "Arabic_switch", 0xFF7E },
          550  +{ "Serbian_dje", 0x6a1 },
          551  +{ "Macedonia_gje", 0x6a2 },
          552  +{ "Cyrillic_io", 0x6a3 },
          553  +{ "Ukranian_je", 0x6a4 },
          554  +{ "Macedonia_dse", 0x6a5 },
          555  +{ "Ukranian_i", 0x6a6 },
          556  +{ "Ukranian_yi", 0x6a7 },
          557  +{ "Serbian_je", 0x6a8 },
          558  +{ "Serbian_lje", 0x6a9 },
          559  +{ "Serbian_nje", 0x6aa },
          560  +{ "Serbian_tshe", 0x6ab },
          561  +{ "Macedonia_kje", 0x6ac },
          562  +{ "Byelorussian_shortu", 0x6ae },
          563  +{ "Serbian_dze", 0x6af },
          564  +{ "numerosign", 0x6b0 },
          565  +{ "Serbian_DJE", 0x6b1 },
          566  +{ "Macedonia_GJE", 0x6b2 },
          567  +{ "Cyrillic_IO", 0x6b3 },
          568  +{ "Ukranian_JE", 0x6b4 },
          569  +{ "Macedonia_DSE", 0x6b5 },
          570  +{ "Ukranian_I", 0x6b6 },
          571  +{ "Ukranian_YI", 0x6b7 },
          572  +{ "Serbian_JE", 0x6b8 },
          573  +{ "Serbian_LJE", 0x6b9 },
          574  +{ "Serbian_NJE", 0x6ba },
          575  +{ "Serbian_TSHE", 0x6bb },
          576  +{ "Macedonia_KJE", 0x6bc },
          577  +{ "Byelorussian_SHORTU", 0x6be },
          578  +{ "Serbian_DZE", 0x6bf },
          579  +{ "Cyrillic_yu", 0x6c0 },
          580  +{ "Cyrillic_a", 0x6c1 },
          581  +{ "Cyrillic_be", 0x6c2 },
          582  +{ "Cyrillic_tse", 0x6c3 },
          583  +{ "Cyrillic_de", 0x6c4 },
          584  +{ "Cyrillic_ie", 0x6c5 },
          585  +{ "Cyrillic_ef", 0x6c6 },
          586  +{ "Cyrillic_ghe", 0x6c7 },
          587  +{ "Cyrillic_ha", 0x6c8 },
          588  +{ "Cyrillic_i", 0x6c9 },
          589  +{ "Cyrillic_shorti", 0x6ca },
          590  +{ "Cyrillic_ka", 0x6cb },
          591  +{ "Cyrillic_el", 0x6cc },
          592  +{ "Cyrillic_em", 0x6cd },
          593  +{ "Cyrillic_en", 0x6ce },
          594  +{ "Cyrillic_o", 0x6cf },
          595  +{ "Cyrillic_pe", 0x6d0 },
          596  +{ "Cyrillic_ya", 0x6d1 },
          597  +{ "Cyrillic_er", 0x6d2 },
          598  +{ "Cyrillic_es", 0x6d3 },
          599  +{ "Cyrillic_te", 0x6d4 },
          600  +{ "Cyrillic_u", 0x6d5 },
          601  +{ "Cyrillic_zhe", 0x6d6 },
          602  +{ "Cyrillic_ve", 0x6d7 },
          603  +{ "Cyrillic_softsign", 0x6d8 },
          604  +{ "Cyrillic_yeru", 0x6d9 },
          605  +{ "Cyrillic_ze", 0x6da },
          606  +{ "Cyrillic_sha", 0x6db },
          607  +{ "Cyrillic_e", 0x6dc },
          608  +{ "Cyrillic_shcha", 0x6dd },
          609  +{ "Cyrillic_che", 0x6de },
          610  +{ "Cyrillic_hardsign", 0x6df },
          611  +{ "Cyrillic_YU", 0x6e0 },
          612  +{ "Cyrillic_A", 0x6e1 },
          613  +{ "Cyrillic_BE", 0x6e2 },
          614  +{ "Cyrillic_TSE", 0x6e3 },
          615  +{ "Cyrillic_DE", 0x6e4 },
          616  +{ "Cyrillic_IE", 0x6e5 },
          617  +{ "Cyrillic_EF", 0x6e6 },
          618  +{ "Cyrillic_GHE", 0x6e7 },
          619  +{ "Cyrillic_HA", 0x6e8 },
          620  +{ "Cyrillic_I", 0x6e9 },
          621  +{ "Cyrillic_SHORTI", 0x6ea },
          622  +{ "Cyrillic_KA", 0x6eb },
          623  +{ "Cyrillic_EL", 0x6ec },
          624  +{ "Cyrillic_EM", 0x6ed },
          625  +{ "Cyrillic_EN", 0x6ee },
          626  +{ "Cyrillic_O", 0x6ef },
          627  +{ "Cyrillic_PE", 0x6f0 },
          628  +{ "Cyrillic_YA", 0x6f1 },
          629  +{ "Cyrillic_ER", 0x6f2 },
          630  +{ "Cyrillic_ES", 0x6f3 },
          631  +{ "Cyrillic_TE", 0x6f4 },
          632  +{ "Cyrillic_U", 0x6f5 },
          633  +{ "Cyrillic_ZHE", 0x6f6 },
          634  +{ "Cyrillic_VE", 0x6f7 },
          635  +{ "Cyrillic_SOFTSIGN", 0x6f8 },
          636  +{ "Cyrillic_YERU", 0x6f9 },
          637  +{ "Cyrillic_ZE", 0x6fa },
          638  +{ "Cyrillic_SHA", 0x6fb },
          639  +{ "Cyrillic_E", 0x6fc },
          640  +{ "Cyrillic_SHCHA", 0x6fd },
          641  +{ "Cyrillic_CHE", 0x6fe },
          642  +{ "Cyrillic_HARDSIGN", 0x6ff },
          643  +{ "Greek_ALPHAaccent", 0x7a1 },
          644  +{ "Greek_EPSILONaccent", 0x7a2 },
          645  +{ "Greek_ETAaccent", 0x7a3 },
          646  +{ "Greek_IOTAaccent", 0x7a4 },
          647  +{ "Greek_IOTAdiaeresis", 0x7a5 },
          648  +{ "Greek_IOTAaccentdiaeresis", 0x7a6 },
          649  +{ "Greek_OMICRONaccent", 0x7a7 },
          650  +{ "Greek_UPSILONaccent", 0x7a8 },
          651  +{ "Greek_UPSILONdieresis", 0x7a9 },
          652  +{ "Greek_UPSILONaccentdieresis", 0x7aa },
          653  +{ "Greek_OMEGAaccent", 0x7ab },
          654  +{ "Greek_alphaaccent", 0x7b1 },
          655  +{ "Greek_epsilonaccent", 0x7b2 },
          656  +{ "Greek_etaaccent", 0x7b3 },
          657  +{ "Greek_iotaaccent", 0x7b4 },
          658  +{ "Greek_iotadieresis", 0x7b5 },
          659  +{ "Greek_iotaaccentdieresis", 0x7b6 },
          660  +{ "Greek_omicronaccent", 0x7b7 },
          661  +{ "Greek_upsilonaccent", 0x7b8 },
          662  +{ "Greek_upsilondieresis", 0x7b9 },
          663  +{ "Greek_upsilonaccentdieresis", 0x7ba },
          664  +{ "Greek_omegaaccent", 0x7bb },
          665  +{ "Greek_ALPHA", 0x7c1 },
          666  +{ "Greek_BETA", 0x7c2 },
          667  +{ "Greek_GAMMA", 0x7c3 },
          668  +{ "Greek_DELTA", 0x7c4 },
          669  +{ "Greek_EPSILON", 0x7c5 },
          670  +{ "Greek_ZETA", 0x7c6 },
          671  +{ "Greek_ETA", 0x7c7 },
          672  +{ "Greek_THETA", 0x7c8 },
          673  +{ "Greek_IOTA", 0x7c9 },
          674  +{ "Greek_KAPPA", 0x7ca },
          675  +{ "Greek_LAMBDA", 0x7cb },
          676  +{ "Greek_MU", 0x7cc },
          677  +{ "Greek_NU", 0x7cd },
          678  +{ "Greek_XI", 0x7ce },
          679  +{ "Greek_OMICRON", 0x7cf },
          680  +{ "Greek_PI", 0x7d0 },
          681  +{ "Greek_RHO", 0x7d1 },
          682  +{ "Greek_SIGMA", 0x7d2 },
          683  +{ "Greek_TAU", 0x7d4 },
          684  +{ "Greek_UPSILON", 0x7d5 },
          685  +{ "Greek_PHI", 0x7d6 },
          686  +{ "Greek_CHI", 0x7d7 },
          687  +{ "Greek_PSI", 0x7d8 },
          688  +{ "Greek_OMEGA", 0x7d9 },
          689  +{ "Greek_alpha", 0x7e1 },
          690  +{ "Greek_beta", 0x7e2 },
          691  +{ "Greek_gamma", 0x7e3 },
          692  +{ "Greek_delta", 0x7e4 },
          693  +{ "Greek_epsilon", 0x7e5 },
          694  +{ "Greek_zeta", 0x7e6 },
          695  +{ "Greek_eta", 0x7e7 },
          696  +{ "Greek_theta", 0x7e8 },
          697  +{ "Greek_iota", 0x7e9 },
          698  +{ "Greek_kappa", 0x7ea },
          699  +{ "Greek_lambda", 0x7eb },
          700  +{ "Greek_mu", 0x7ec },
          701  +{ "Greek_nu", 0x7ed },
          702  +{ "Greek_xi", 0x7ee },
          703  +{ "Greek_omicron", 0x7ef },
          704  +{ "Greek_pi", 0x7f0 },
          705  +{ "Greek_rho", 0x7f1 },
          706  +{ "Greek_sigma", 0x7f2 },
          707  +{ "Greek_finalsmallsigma", 0x7f3 },
          708  +{ "Greek_tau", 0x7f4 },
          709  +{ "Greek_upsilon", 0x7f5 },
          710  +{ "Greek_phi", 0x7f6 },
          711  +{ "Greek_chi", 0x7f7 },
          712  +{ "Greek_psi", 0x7f8 },
          713  +{ "Greek_omega", 0x7f9 },
          714  +{ "Greek_switch", 0xFF7E },
          715  +{ "leftradical", 0x8a1 },
          716  +{ "topleftradical", 0x8a2 },
          717  +{ "horizconnector", 0x8a3 },
          718  +{ "topintegral", 0x8a4 },
          719  +{ "botintegral", 0x8a5 },
          720  +{ "vertconnector", 0x8a6 },
          721  +{ "topleftsqbracket", 0x8a7 },
          722  +{ "botleftsqbracket", 0x8a8 },
          723  +{ "toprightsqbracket", 0x8a9 },
          724  +{ "botrightsqbracket", 0x8aa },
          725  +{ "topleftparens", 0x8ab },
          726  +{ "botleftparens", 0x8ac },
          727  +{ "toprightparens", 0x8ad },
          728  +{ "botrightparens", 0x8ae },
          729  +{ "leftmiddlecurlybrace", 0x8af },
          730  +{ "rightmiddlecurlybrace", 0x8b0 },
          731  +{ "topleftsummation", 0x8b1 },
          732  +{ "botleftsummation", 0x8b2 },
          733  +{ "topvertsummationconnector", 0x8b3 },
          734  +{ "botvertsummationconnector", 0x8b4 },
          735  +{ "toprightsummation", 0x8b5 },
          736  +{ "botrightsummation", 0x8b6 },
          737  +{ "rightmiddlesummation", 0x8b7 },
          738  +{ "lessthanequal", 0x8bc },
          739  +{ "notequal", 0x8bd },
          740  +{ "greaterthanequal", 0x8be },
          741  +{ "integral", 0x8bf },
          742  +{ "therefore", 0x8c0 },
          743  +{ "variation", 0x8c1 },
          744  +{ "infinity", 0x8c2 },
          745  +{ "nabla", 0x8c5 },
          746  +{ "approximate", 0x8c8 },
          747  +{ "similarequal", 0x8c9 },
          748  +{ "ifonlyif", 0x8cd },
          749  +{ "implies", 0x8ce },
          750  +{ "identical", 0x8cf },
          751  +{ "radical", 0x8d6 },
          752  +{ "includedin", 0x8da },
          753  +{ "includes", 0x8db },
          754  +{ "intersection", 0x8dc },
          755  +{ "union", 0x8dd },
          756  +{ "logicaland", 0x8de },
          757  +{ "logicalor", 0x8df },
          758  +{ "partialderivative", 0x8ef },
          759  +{ "function", 0x8f6 },
          760  +{ "leftarrow", 0x8fb },
          761  +{ "uparrow", 0x8fc },
          762  +{ "rightarrow", 0x8fd },
          763  +{ "downarrow", 0x8fe },
          764  +{ "blank", 0x9df },
          765  +{ "soliddiamond", 0x9e0 },
          766  +{ "checkerboard", 0x9e1 },
          767  +{ "ht", 0x9e2 },
          768  +{ "ff", 0x9e3 },
          769  +{ "cr", 0x9e4 },
          770  +{ "lf", 0x9e5 },
          771  +{ "nl", 0x9e8 },
          772  +{ "vt", 0x9e9 },
          773  +{ "lowrightcorner", 0x9ea },
          774  +{ "uprightcorner", 0x9eb },
          775  +{ "upleftcorner", 0x9ec },
          776  +{ "lowleftcorner", 0x9ed },
          777  +{ "crossinglines", 0x9ee },
          778  +{ "horizlinescan1", 0x9ef },
          779  +{ "horizlinescan3", 0x9f0 },
          780  +{ "horizlinescan5", 0x9f1 },
          781  +{ "horizlinescan7", 0x9f2 },
          782  +{ "horizlinescan9", 0x9f3 },
          783  +{ "leftt", 0x9f4 },
          784  +{ "rightt", 0x9f5 },
          785  +{ "bott", 0x9f6 },
          786  +{ "topt", 0x9f7 },
          787  +{ "vertbar", 0x9f8 },
          788  +{ "emspace", 0xaa1 },
          789  +{ "enspace", 0xaa2 },
          790  +{ "em3space", 0xaa3 },
          791  +{ "em4space", 0xaa4 },
          792  +{ "digitspace", 0xaa5 },
          793  +{ "punctspace", 0xaa6 },
          794  +{ "thinspace", 0xaa7 },
          795  +{ "hairspace", 0xaa8 },
          796  +{ "emdash", 0xaa9 },
          797  +{ "endash", 0xaaa },
          798  +{ "signifblank", 0xaac },
          799  +{ "ellipsis", 0xaae },
          800  +{ "doubbaselinedot", 0xaaf },
          801  +{ "onethird", 0xab0 },
          802  +{ "twothirds", 0xab1 },
          803  +{ "onefifth", 0xab2 },
          804  +{ "twofifths", 0xab3 },
          805  +{ "threefifths", 0xab4 },
          806  +{ "fourfifths", 0xab5 },
          807  +{ "onesixth", 0xab6 },
          808  +{ "fivesixths", 0xab7 },
          809  +{ "careof", 0xab8 },
          810  +{ "figdash", 0xabb },
          811  +{ "leftanglebracket", 0xabc },
          812  +{ "decimalpoint", 0xabd },
          813  +{ "rightanglebracket", 0xabe },
          814  +{ "marker", 0xabf },
          815  +{ "oneeighth", 0xac3 },
          816  +{ "threeeighths", 0xac4 },
          817  +{ "fiveeighths", 0xac5 },
          818  +{ "seveneighths", 0xac6 },
          819  +{ "trademark", 0xac9 },
          820  +{ "signaturemark", 0xaca },
          821  +{ "trademarkincircle", 0xacb },
          822  +{ "leftopentriangle", 0xacc },
          823  +{ "rightopentriangle", 0xacd },
          824  +{ "emopencircle", 0xace },
          825  +{ "emopenrectangle", 0xacf },
          826  +{ "leftsinglequotemark", 0xad0 },
          827  +{ "rightsinglequotemark", 0xad1 },
          828  +{ "leftdoublequotemark", 0xad2 },
          829  +{ "rightdoublequotemark", 0xad3 },
          830  +{ "prescription", 0xad4 },
          831  +{ "minutes", 0xad6 },
          832  +{ "seconds", 0xad7 },
          833  +{ "latincross", 0xad9 },
          834  +{ "hexagram", 0xada },
          835  +{ "filledrectbullet", 0xadb },
          836  +{ "filledlefttribullet", 0xadc },
          837  +{ "filledrighttribullet", 0xadd },
          838  +{ "emfilledcircle", 0xade },
          839  +{ "emfilledrect", 0xadf },
          840  +{ "enopencircbullet", 0xae0 },
          841  +{ "enopensquarebullet", 0xae1 },
          842  +{ "openrectbullet", 0xae2 },
          843  +{ "opentribulletup", 0xae3 },
          844  +{ "opentribulletdown", 0xae4 },
          845  +{ "openstar", 0xae5 },
          846  +{ "enfilledcircbullet", 0xae6 },
          847  +{ "enfilledsqbullet", 0xae7 },
          848  +{ "filledtribulletup", 0xae8 },
          849  +{ "filledtribulletdown", 0xae9 },
          850  +{ "leftpointer", 0xaea },
          851  +{ "rightpointer", 0xaeb },
          852  +{ "club", 0xaec },
          853  +{ "diamond", 0xaed },
          854  +{ "heart", 0xaee },
          855  +{ "maltesecross", 0xaf0 },
          856  +{ "dagger", 0xaf1 },
          857  +{ "doubledagger", 0xaf2 },
          858  +{ "checkmark", 0xaf3 },
          859  +{ "ballotcross", 0xaf4 },
          860  +{ "musicalsharp", 0xaf5 },
          861  +{ "musicalflat", 0xaf6 },
          862  +{ "malesymbol", 0xaf7 },
          863  +{ "femalesymbol", 0xaf8 },
          864  +{ "telephone", 0xaf9 },
          865  +{ "telephonerecorder", 0xafa },
          866  +{ "phonographcopyright", 0xafb },
          867  +{ "caret", 0xafc },
          868  +{ "singlelowquotemark", 0xafd },
          869  +{ "doublelowquotemark", 0xafe },
          870  +{ "cursor", 0xaff },
          871  +{ "leftcaret", 0xba3 },
          872  +{ "rightcaret", 0xba6 },
          873  +{ "downcaret", 0xba8 },
          874  +{ "upcaret", 0xba9 },
          875  +{ "overbar", 0xbc0 },
          876  +{ "downtack", 0xbc2 },
          877  +{ "upshoe", 0xbc3 },
          878  +{ "downstile", 0xbc4 },
          879  +{ "underbar", 0xbc6 },
          880  +{ "jot", 0xbca },
          881  +{ "quad", 0xbcc },
          882  +{ "uptack", 0xbce },
          883  +{ "circle", 0xbcf },
          884  +{ "upstile", 0xbd3 },
          885  +{ "downshoe", 0xbd6 },
          886  +{ "rightshoe", 0xbd8 },
          887  +{ "leftshoe", 0xbda },
          888  +{ "lefttack", 0xbdc },
          889  +{ "righttack", 0xbfc },
          890  +{ "hebrew_aleph", 0xce0 },
          891  +{ "hebrew_beth", 0xce1 },
          892  +{ "hebrew_gimmel", 0xce2 },
          893  +{ "hebrew_daleth", 0xce3 },
          894  +{ "hebrew_he", 0xce4 },
          895  +{ "hebrew_waw", 0xce5 },
          896  +{ "hebrew_zayin", 0xce6 },
          897  +{ "hebrew_het", 0xce7 },
          898  +{ "hebrew_teth", 0xce8 },
          899  +{ "hebrew_yod", 0xce9 },
          900  +{ "hebrew_finalkaph", 0xcea },
          901  +{ "hebrew_kaph", 0xceb },
          902  +{ "hebrew_lamed", 0xcec },
          903  +{ "hebrew_finalmem", 0xced },
          904  +{ "hebrew_mem", 0xcee },
          905  +{ "hebrew_finalnun", 0xcef },
          906  +{ "hebrew_nun", 0xcf0 },
          907  +{ "hebrew_samekh", 0xcf1 },
          908  +{ "hebrew_ayin", 0xcf2 },
          909  +{ "hebrew_finalpe", 0xcf3 },
          910  +{ "hebrew_pe", 0xcf4 },
          911  +{ "hebrew_finalzadi", 0xcf5 },
          912  +{ "hebrew_zadi", 0xcf6 },
          913  +{ "hebrew_kuf", 0xcf7 },
          914  +{ "hebrew_resh", 0xcf8 },
          915  +{ "hebrew_shin", 0xcf9 },
          916  +{ "hebrew_taf", 0xcfa },
          917  +{ "Hebrew_switch", 0xFF7E },

Added library/bgerror.tcl version [d04a471dc9].

            1  +# bgerror.tcl --
            2  +#
            3  +# This file contains a default version of the bgerror procedure.  It
            4  +# posts a dialog box with the error message and gives the user a chance
            5  +# to see a more detailed stack trace.
            6  +#
            7  +# SCCS: @(#) bgerror.tcl 1.9 96/05/02 10:17:11
            8  +#
            9  +# Copyright (c) 1992-1994 The Regents of the University of California.
           10  +# Copyright (c) 1994-1995 Sun Microsystems, Inc.
           11  +#
           12  +# See the file "license.terms" for information on usage and redistribution
           13  +# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
           14  +
           15  +# The following declaration servers no purpose other than to generate
           16  +# a tclIndex entry for "tkerror".  Since tkerror and bgerror are hard-wired
           17  +# by the Tcl interpreter to be synonyms, the definition of tkerror is
           18  +# immediately overridden when bgerror is defined.
           19  +
           20  +proc tkerror {} {}
           21  +
           22  +# bgerror --
           23  +# This is the default version of bgerror.  It posts a dialog box containing
           24  +# the error message and gives the user a chance to ask to see a stack
           25  +# trace.
           26  +# Arguments:
           27  +# err -                        The error message.
           28  +
           29  +proc bgerror err {
           30  +    global errorInfo
           31  +    set info $errorInfo
           32  +    set button [tk_dialog .bgerrorDialog "Error in Tcl Script" \
           33  +           "Error: $err" error 0 OK "Skip Messages" "Stack Trace"]
           34  +    if {$button == 0} {
           35  +       return
           36  +    } elseif {$button == 1} {
           37  +       return -code break
           38  +    }
           39  +
           40  +    set w .bgerrorTrace
           41  +    catch {destroy $w}
           42  +    toplevel $w -class ErrorTrace
           43  +    wm minsize $w 1 1
           44  +    wm title $w "Stack Trace for Error"
           45  +    wm iconname $w "Stack Trace"
           46  +    button $w.ok -text OK -command "destroy $w"
           47  +    text $w.text -relief sunken -bd 2 -yscrollcommand "$w.scroll set" \
           48  +           -setgrid true -width 60 -height 20
           49  +    scrollbar $w.scroll -relief sunken -command "$w.text yview"
           50  +    pack $w.ok -side bottom -padx 3m -pady 2m
           51  +    pack $w.scroll -side right -fill y
           52  +    pack $w.text -side left -expand yes -fill both
           53  +    $w.text insert 0.0 $info
           54  +    $w.text mark set insert 0.0
           55  +
           56  +    # Center the window on the screen.
           57  +
           58  +    wm withdraw $w
           59  +    update idletasks
           60  +    set x [expr [winfo screenwidth $w]/2 - [winfo reqwidth $w]/2 \
           61  +           - [winfo vrootx [winfo parent $w]]]
           62  +    set y [expr [winfo screenheight $w]/2 - [winfo reqheight $w]/2 \
           63  +           - [winfo vrooty [winfo parent $w]]]
           64  +    wm geom $w +$x+$y
           65  +    wm deiconify $w
           66  +
           67  +    # Be sure to release any grabs that might be present on the
           68  +    # screen, since they could make it impossible for the user
           69  +    # to interact with the stack trace.
           70  +
           71  +    if {[grab current .] != ""} {
           72  +       grab release [grab current .]
           73  +    }
           74  +}
           75  +

Added library/button.tcl version [ac61fcef05].

            1  +# button.tcl --
            2  +#
            3  +# This file defines the default bindings for Tk label, button,
            4  +# checkbutton, and radiobutton widgets and provides procedures
            5  +# that help in implementing those bindings.
            6  +#
            7  +# @(#) $Id: ctk.shar,v 1.50 1996/01/15 14:47:16 andrewm Exp andrewm $
            8  +#
            9  +# Copyright (c) 1992-1994 The Regents of the University of California.
           10  +# Copyright (c) 1994 Sun Microsystems, Inc.
           11  +# Copyright (c) 1995 Cleveland Clinic Foundation
           12  +#
           13  +# See the file "license.terms" for information on usage and redistribution
           14  +# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
           15  +#
           16  +
           17  +#-------------------------------------------------------------------------
           18  +# The code below creates the default class bindings for buttons.
           19  +#-------------------------------------------------------------------------
           20  +
           21  +bind Button <Select> {
           22  +    tkButtonInvoke %W
           23  +}
           24  +bind Button <Return> {
           25  +    if !$tk_strictMotif {
           26  +	tkButtonInvoke %W
           27  +    }
           28  +}
           29  +
           30  +bind Checkbutton <Select> {
           31  +    tkCheckRadioInvoke %W
           32  +}
           33  +bind Button <Return> {
           34  +    if !$tk_strictMotif {
           35  +	tkCheckRadioInvoke %W
           36  +    }
           37  +}
           38  +
           39  +bind Radiobutton <Select> {
           40  +    tkCheckRadioInvoke %W
           41  +}
           42  +bind Button <Return> {
           43  +    if !$tk_strictMotif {
           44  +	tkCheckRadioInvoke %W
           45  +    }
           46  +}
           47  +
           48  +# tkButtonInvoke --
           49  +# The procedure below is called when a button is invoked through
           50  +# the keyboard.  It simulate a press of the button via the mouse.
           51  +#
           52  +# Arguments:
           53  +# w -		The name of the widget.
           54  +
           55  +proc tkButtonInvoke w {
           56  +    if {[$w cget -state] != "disabled"} {
           57  +	set oldState [$w cget -state]
           58  +	$w configure -state active
           59  +	update idletasks
           60  +	after 100
           61  +	$w configure -state $oldState
           62  +	uplevel #0 [list $w invoke]
           63  +    }
           64  +}
           65  +
           66  +# tkCheckRadioInvoke --
           67  +# The procedure below is invoked when the mouse button is pressed in
           68  +# a checkbutton or radiobutton widget, or when the widget is invoked
           69  +# through the keyboard.  It invokes the widget if it
           70  +# isn't disabled.
           71  +#
           72  +# Arguments:
           73  +# w -		The name of the widget.
           74  +
           75  +proc tkCheckRadioInvoke w {
           76  +    if {[$w cget -state] != "disabled"} {
           77  +	uplevel #0 [list $w invoke]
           78  +    }
           79  +}

Added library/command.tcl version [d6fcf183f1].

            1  +# command.tcl --
            2  +#
            3  +# This file defines the CTk command dialog procedure.
            4  +#
            5  +# @(#) $Id: ctk.shar,v 1.50 1996/01/15 14:47:16 andrewm Exp andrewm $
            6  +#
            7  +# Copyright (c) 1995 Cleveland Clinic Foundation
            8  +#
            9  +# See the file "license.terms" for information on usage and redistribution
           10  +# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
           11  +#
           12  +
           13  +proc ctk_menu {} {
           14  +    if ![winfo exists .ctkMenu] {
           15  +	menu .ctkMenu
           16  +	.ctkMenu add command -label "Command.." -underline 0 -command ctkDialog
           17  +	.ctkMenu add command -label "Next" -underline 0\
           18  +		-command {ctkNextTop [focus]}
           19  +	.ctkMenu add command -label "Redraw" -underline 0\
           20  +		-command {ctk redraw .ctkMenu}
           21  +	.ctkMenu add command -label "Exit" -underline 1 -command exit
           22  +    }
           23  +    tk_popup .ctkMenu 0 0 0
           24  +}
           25  +
           26  +proc ctkDialog {} {ctkCommand .ctkDlg}
           27  +
           28  +# ctkCommand --
           29  +#
           30  +proc ctkCommand w {
           31  +    if [winfo exists $w] {
           32  +    	wm deiconify $w
           33  +	raise $w
           34  +    } else {
           35  +	toplevel $w -class Dialog -width 30 -height 10
           36  +	wm title $w Command
           37  +	entry $w.entry
           38  +	text $w.output -state disabled -takefocus 1
           39  +	button $w.close -command "destroy $w" -text Close
           40  +
           41  +	pack $w.entry -side top -fill x
           42  +	pack $w.output -side top -fill both -expand 1
           43  +	pack $w.close -side bottom
           44  +
           45  +	bind $w.entry <Return> "ctkCommandRun $w; break"
           46  +	bind $w <Cancel> "destroy $w"
           47  +    }
           48  +    focus $w.entry
           49  +    tkwait window $w
           50  +}
           51  +
           52  +proc ctkCommandRun w {
           53  +    global errorInfo
           54  +    set code [catch {uplevel #0 [$w.entry get]} result]
           55  +    $w.output configure -state normal
           56  +    $w.output delete 1.0 end
           57  +    $w.output insert 1.0 $result
           58  +    if $code  { $w.output insert end "\n----\n$errorInfo" }
           59  +    $w.output mark set insert 1.0
           60  +    $w.output configure -state disabled
           61  +    $w.entry delete 0 end
           62  +}

Added library/ctk.tcl version [5990ac50c5].

            1  +# ctk.tcl --
            2  +#
            3  +# Initialization script normally executed in the interpreter for each
            4  +# CTk-based application.  Arranges class bindings for widgets.
            5  +#
            6  +# @(#) $Id: ctk.shar,v 1.50 1996/01/15 14:47:16 andrewm Exp andrewm $
            7  +#
            8  +# Copyright (c) 1992-1994 The Regents of the University of California.
            9  +# Copyright (c) 1994-1995 Sun Microsystems, Inc.
           10  +# Copyright (c) 1995 Cleveland Clinic Foundation
           11  +#
           12  +# See the file "license.terms" for information on usage and redistribution
           13  +# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
           14  +
           15  +# Insist on running with compatible versions of Tcl and Tk.
           16  +
           17  +scan [info tclversion] "%d.%d" a b
           18  +if {$a != 8} {
           19  +    error "wrong version of Tcl loaded ([info tclversion]): need 8.x"
           20  +}
           21  +scan $tk_version "%d.%d" a b
           22  +if {($a != 8) || ($b < 0)} {
           23  +    error "wrong version of Tk loaded ($tk_version): need 8.x"
           24  +}
           25  +if {$tk_port != "curses"} {
           26  +    error "wrong port of Tk loaded ($tk_port): need curses"
           27  +}
           28  +unset a b
           29  +
           30  +# Add Tk's directory to the end of the auto-load search path:
           31  +
           32  +lappend auto_path $tk_library
           33  +
           34  +# Turn off strict Motif look and feel as a default.
           35  +
           36  +set tk_strictMotif 0
           37  +
           38  +# ctk_unsupported --
           39  +# This procedure is invoked when a Tk command that is not implemented
           40  +# by Ctk is invoked.
           41  +#
           42  +# Arguments:
           43  +# cmd -		command that was invoked
           44  +
           45  +proc ctk_unsupported cmd {
           46  +    catch {tkerror "Unsupported Tk command: $cmd"}
           47  +}
           48  +
           49  +# tkScreenChanged --
           50  +# This procedure is invoked by the binding mechanism whenever the
           51  +# "current" screen is changing.  The procedure does two things.
           52  +# First, it uses "upvar" to make global variable "tkPriv" point at an
           53  +# array variable that holds state for the current display.  Second,
           54  +# it initializes the array if it didn't already exist.
           55  +#
           56  +# Arguments:
           57  +# screen -		The name of the new screen.
           58  +
           59  +proc tkScreenChanged screen {
           60  +    set disp [file rootname $screen]
           61  +    uplevel #0 upvar #0 tkPriv.$disp tkPriv
           62  +    global tkPriv
           63  +    if [info exists tkPriv] {
           64  +	set tkPriv(screen) $screen
           65  +	return
           66  +    }
           67  +    set tkPriv(afterId) {}
           68  +    set tkPriv(buttons) 0
           69  +    set tkPriv(buttonWindow) {}
           70  +    set tkPriv(dragging) 0
           71  +    set tkPriv(focus) {}
           72  +    set tkPriv(grab) {}
           73  +    set tkPriv(grabType) {}
           74  +    set tkPriv(inMenubutton) {}
           75  +    set tkPriv(initMouse) {}
           76  +    set tkPriv(listboxPrev) {}
           77  +    set tkPriv(mouseMoved) 0
           78  +    set tkPriv(oldGrab) {}
           79  +    set tkPriv(popup) {}
           80  +    set tkPriv(postedMb) {}
           81  +    set tkPriv(screen) $screen
           82  +    set tkPriv(selectMode) char
           83  +    set tkPriv(window) {}
           84  +}
           85  +
           86  +# Do initial setup for tkPriv, so that it is always bound to something
           87  +# (otherwise, if someone references it, it may get set to a non-upvar-ed
           88  +# value, which will cause trouble later).
           89  +
           90  +tkScreenChanged [winfo screen .]
           91  +
           92  +# ----------------------------------------------------------------------
           93  +# Read in files that define all of the class bindings.
           94  +# ----------------------------------------------------------------------
           95  +
           96  +source $tk_library/button.tcl
           97  +source $tk_library/entry.tcl
           98  +source $tk_library/listbox.tcl
           99  +source $tk_library/menu.tcl
          100  +source $tk_library/scrollbar.tcl
          101  +source $tk_library/text.tcl
          102  +
          103  +# ----------------------------------------------------------------------
          104  +# Default bindings for keyboard traversal.
          105  +# ----------------------------------------------------------------------
          106  +
          107  +bind all <Tab> {focus [tk_focusNext %W]}
          108  +bind all <Shift-Tab> {focus [tk_focusPrev %W]}
          109  +
          110  +bind all <Control-c> ctk_menu
          111  +bind all <Escape> {ctk_event %W KeyPress -key Cancel}
          112  +bind all <KP_Enter> {ctk_event %W KeyPress -key Execute}
          113  +bind all <space> {ctk_event %W KeyPress -key Select}
          114  +
          115  +bind all <F1> {ctk_event %W KeyPress -key Help}
          116  +bind all <F2> {ctk_event %W KeyPress -key Execute}
          117  +bind all <F3> {ctk_event %W KeyPress -key Menu}
          118  +bind all <F4> {ctk_event %W KeyPress -key Cancel}

Added library/demos/README version [30d7e149ad].

            1  +This directory contains a collection of programs to demonstrate
            2  +the features of the CTk toolkit.  The programs are all scripts for
            3  +"cwish", a windowing shell.  If cwish has been installed in /usr/local
            4  +then you can invoke any of the programs in this directory just
            5  +by typing its file name to your command shell.  Otherwise invoke
            6  +wish with the file as its first argument, e.g., "cwish hello".
            7  +The rest of this file contains a brief description of each program.
            8  +
            9  +@(#) $Id: ctk.shar,v 1.50 1996/01/15 14:47:16 andrewm Exp andrewm $
           10  +
           11  +stuff -		Chaotic demonstration of the widgets currently available
           12  +		in the CTk library.
           13  +
           14  +hello -		Creates a single button;  if you click on it, a message
           15  +		is typed and the application terminates.
           16  +
           17  +widget -	Rough port of Tk's widget demo.  Still has lots of holes.
           18  +		Most of the .tcl files are scripts for individual demos
           19  +		available through the "widget" program.
           20  +
           21  +rolodex -	A mock-up of a simple rolodex application.  It has much of
           22  +		the user interface for such an application but no back-end
           23  +		database.  This program was written in response to Tom
           24  +		LaStrange's toolkit benchmark challenge.

Added library/demos/bind.tcl version [69efe4b618].

            1  +# bind.tcl --
            2  +#
            3  +# This demonstration script creates a text widget with bindings set
            4  +# up for hypertext-like effects.
            5  +#
            6  +# @(#) bind.tcl 1.1 95/05/26 15:56:25
            7  +
            8  +set w .bind
            9  +catch {destroy $w}
           10  +toplevel $w
           11  +wm title $w "Text Demonstration - Tag Bindings"
           12  +wm iconname $w "bind"
           13  +positionWindow $w
           14  +
           15  +frame $w.buttons
           16  +pack  $w.buttons -side bottom -expand y -fill x -pady 2m
           17  +button $w.buttons.dismiss -text Dismiss -command "destroy $w"
           18  +button $w.buttons.code -text "See Code" -command "showCode $w"
           19  +pack $w.buttons.dismiss $w.buttons.code -side left -expand 1
           20  +
           21  +text $w.text -yscrollcommand "$w.scroll set" -setgrid true \
           22  +	-width 60 -height 24 -font $font -wrap word
           23  +scrollbar $w.scroll -command "$w.text yview"
           24  +pack $w.scroll -side right -fill y
           25  +pack $w.text -expand yes -fill both
           26  +
           27  +# Set up display styles.
           28  +
           29  +if {[winfo depth $w] > 1} {
           30  +    set bold "-background #43ce80 -relief raised -borderwidth 1"
           31  +    set normal "-background {} -relief flat"
           32  +} else {
           33  +    set bold "-foreground white -background black"
           34  +    set normal "-foreground {} -background {}"
           35  +}
           36  +
           37  +# Add text to widget.
           38  +
           39  +$w.text insert 0.0 {\
           40  +The same tag mechanism that controls display styles in text widgets can also be used to associate Tcl commands with regions of text, so that mouse or keyboard actions on the text cause particular Tcl commands to be invoked.  For example, in the text below the descriptions of the canvas demonstrations have been tagged.  When you move the mouse over a demo description the description lights up, and when you press button 1 over a description then that particular demonstration is invoked.
           41  +
           42  +}
           43  +$w.text insert end \
           44  +{1. Samples of all the different types of items that can be created in canvas widgets.} d1
           45  +$w.text insert end \n\n
           46  +$w.text insert end \
           47  +{2. A simple two-dimensional plot that allows you to adjust the positions of the data points.} d2
           48  +$w.text insert end \n\n
           49  +$w.text insert end \
           50  +{3. Anchoring and justification modes for text items.} d3
           51  +$w.text insert end \n\n
           52  +$w.text insert end \
           53  +{4. An editor for arrow-head shapes for line items.} d4
           54  +$w.text insert end \n\n
           55  +$w.text insert end \
           56  +{5. A ruler with facilities for editing tab stops.} d5
           57  +$w.text insert end \n\n
           58  +$w.text insert end \
           59  +{6. A grid that demonstrates how canvases can be scrolled.} d6
           60  +
           61  +# Create bindings for tags.
           62  +
           63  +foreach tag {d1 d2 d3 d4 d5 d6} {
           64  +    $w.text tag bind $tag <Any-Enter> "$w.text tag configure $tag $bold"
           65  +    $w.text tag bind $tag <Any-Leave> "$w.text tag configure $tag $normal"
           66  +}
           67  +$w.text tag bind d1 <1> {source $tk_library/demos/items.tcl}
           68  +$w.text tag bind d2 <1> {source $tk_library/demos/plot.tcl}
           69  +$w.text tag bind d3 <1> {source $tk_library/demos/ctext.tcl}
           70  +$w.text tag bind d4 <1> {source $tk_library/demos/arrow.tcl}
           71  +$w.text tag bind d5 <1> {source $tk_library/demos/ruler.tcl}
           72  +$w.text tag bind d6 <1> {source $tk_library/demos/cscroll.tcl}
           73  +
           74  +$w.text mark set insert 0.0
           75  +$w.text configure -state disabled

Added library/demos/button.tcl version [f572aca518].

            1  +# button.tcl --
            2  +#
            3  +# This demonstration script creates a toplevel window containing
            4  +# several button widgets.
            5  +#
            6  +# @(#) button.tcl 1.1 95/05/26 15:56:26
            7  +
            8  +set w .button
            9  +catch {destroy $w}
           10  +toplevel $w
           11  +wm title $w "Button Demonstration"
           12  +wm iconname $w "button"
           13  +positionWindow $w
           14  +
           15  +label $w.msg -font $font -wraplength 4i -justify left -text "If you click on any of the four buttons below, the background of the button area will change to the color indicated in the button.  You can press Tab to move among the buttons, then press Space to invoke the current button."
           16  +pack $w.msg -side top
           17  +
           18  +frame $w.buttons
           19  +pack  $w.buttons -side bottom -expand y -fill x -pady 2m
           20  +button $w.buttons.dismiss -text Dismiss -command "destroy $w"
           21  +button $w.buttons.code -text "See Code" -command "showCode $w"
           22  +pack $w.buttons.dismiss $w.buttons.code -side left -expand 1
           23  +
           24  +button $w.b1 -text "Peach Puff" -width 10 \
           25  +	-command "$w config -bg PeachPuff1"
           26  +button $w.b2 -text "Light Blue" -width 10 \
           27  +	-command "$w config -bg LightBlue1"
           28  +button $w.b3 -text "Sea Green" -width 10 \
           29  +	-command "$w config -bg SeaGreen2"
           30  +button $w.b4 -text "Yellow" -width 10 \
           31  +	-command "$w config -bg Yellow1"
           32  +pack $w.b1 $w.b2 $w.b3 $w.b4 -side top -expand yes -pady 2

Added library/demos/check.tcl version [771bcfb014].

            1  +# check.tcl --
            2  +#
            3  +# This demonstration script creates a toplevel window containing
            4  +# several checkbuttons.
            5  +#
            6  +# @(#) check.tcl 1.1 95/05/26 15:56:26
            7  +
            8  +set w .check
            9  +catch {destroy $w}
           10  +toplevel $w
           11  +wm title $w "Checkbutton Demonstration"
           12  +wm iconname $w "check"
           13  +positionWindow $w
           14  +
           15  +label $w.msg -font $font -wraplength 4i -justify left -text "Three checkbuttons are displayed below.  If you click on a button, it will toggle the button's selection state and set a Tcl variable to a value indicating the state of the checkbutton.  Click the \"See Variables\" button to see the current values of the variables."
           16  +pack $w.msg -side top
           17  +
           18  +frame $w.buttons
           19  +pack  $w.buttons -side bottom -expand y -fill x -pady 2m
           20  +button $w.buttons.dismiss -text Dismiss -command "destroy $w"
           21  +button $w.buttons.code -text "See Code" -command "showCode $w"
           22  +button $w.buttons.vars -text "See Variables"  \
           23  +	-command "showVars $w.dialog wipers brakes sober"
           24  +pack $w.buttons.dismiss $w.buttons.code $w.buttons.vars -side left -expand 1
           25  +
           26  +checkbutton $w.b1 -text "Wipers OK" -variable wipers -relief flat
           27  +checkbutton $w.b2 -text "Brakes OK" -variable brakes -relief flat
           28  +checkbutton $w.b3 -text "Driver Sober" -variable sober -relief flat
           29  +pack $w.b1 $w.b2 $w.b3 -side top -pady 2 -anchor w

Added library/demos/cscroll.tcl version [a91f682b47].

            1  +# cscroll.tcl --
            2  +#
            3  +# This demonstration script creates a simple canvas that can be
            4  +# scrolled in two dimensions.
            5  +#
            6  +# @(#) cscroll.tcl 1.1 95/05/26 15:56:27
            7  +
            8  +set w .cscroll
            9  +catch {destroy $w}
           10  +toplevel $w
           11  +wm title $w "Scrollable Canvas Demonstration"
           12  +wm iconname $w "cscroll"
           13  +positionWindow $w
           14  +set c $w.c
           15  +
           16  +label $w.msg -font $font -wraplength 4i -justify left -text "This window displays a canvas widget that can be scrolled either using the scrollbars or by dragging with button 2 in the canvas.  If you click button 1 on one of the rectangles, its indices will be printed on stdout."
           17  +pack $w.msg -side top
           18  +
           19  +frame $w.buttons
           20  +pack  $w.buttons -side bottom -expand y -fill x -pady 2m
           21  +button $w.buttons.dismiss -text Dismiss -command "destroy $w"
           22  +button $w.buttons.code -text "See Code" -command "showCode $w"
           23  +pack $w.buttons.dismiss $w.buttons.code -side left -expand 1
           24  +
           25  +scrollbar $w.hscroll -orient horiz -command "$c xview"
           26  +pack $w.hscroll -side bottom -fill x
           27  +scrollbar $w.vscroll -command "$c yview"
           28  +pack $w.vscroll -side right -fill y
           29  +
           30  +canvas $c -relief sunken -borderwidth 2 -scrollregion {-11c -11c 50c 20c} \
           31  +	-xscrollcommand "$w.hscroll set" \
           32  +	-yscrollcommand "$w.vscroll set"
           33  +pack $c -expand yes -fill both
           34  +
           35  +set bg [lindex [$c config -bg] 4]
           36  +for {set i 0} {$i < 20} {incr i} {
           37  +    set x [expr {-10 + 3*$i}]
           38  +    for {set j 0; set y -10} {$j < 10} {incr j; incr y 3} {
           39  +	$c create rect ${x}c ${y}c [expr $x+2]c [expr $y+2]c \
           40  +		-outline black -fill $bg -tags rect
           41  +	$c create text [expr $x+1]c [expr $y+1]c -text "$i,$j" \
           42  +	    -anchor center -tags text
           43  +    }
           44  +}
           45  +
           46  +$c bind all <Any-Enter> "scrollEnter $c"
           47  +$c bind all <Any-Leave> "scrollLeave $c"
           48  +$c bind all <1> "scrollButton $c"
           49  +bind $c <2> "$c scan mark %x %y"
           50  +bind $c <B2-Motion> "$c scan dragto %x %y"
           51  +
           52  +proc scrollEnter canvas {
           53  +    global oldFill
           54  +    set id [$canvas find withtag current]
           55  +    if {[lsearch [$canvas gettags current] text] >= 0} {
           56  +	set id [expr $id-1]
           57  +    }
           58  +    set oldFill [lindex [$canvas itemconfig $id -fill] 4]
           59  +    if {[winfo depth $canvas] > 1} {
           60  +	$canvas itemconfigure $id -fill SeaGreen1
           61  +    } else {
           62  +	$canvas itemconfigure $id -fill black
           63  +	$canvas itemconfigure [expr $id+1] -fill white
           64  +    }
           65  +}
           66  +
           67  +proc scrollLeave canvas {
           68  +    global oldFill
           69  +    set id [$canvas find withtag current]
           70  +    if {[lsearch [$canvas gettags current] text] >= 0} {
           71  +	set id [expr $id-1]
           72  +    }
           73  +    $canvas itemconfigure $id -fill $oldFill
           74  +    $canvas itemconfigure [expr $id+1] -fill black
           75  +}
           76  +
           77  +proc scrollButton canvas {
           78  +    global oldFill
           79  +    set id [$canvas find withtag current]
           80  +    if {[lsearch [$canvas gettags current] text] < 0} {
           81  +	set id [expr $id+1]
           82  +    }
           83  +    puts stdout "You buttoned at [lindex [$canvas itemconf $id -text] 4]"
           84  +}

Added library/demos/ctext.tcl version [771631e9de].

            1  +# ctext.tcl --
            2  +#
            3  +# This demonstration script creates a canvas widget with a text
            4  +# item that can be edited and reconfigured in various ways.
            5  +#
            6  +# @(#) ctext.tcl 1.1 95/05/26 15:56:28
            7  +
            8  +set w .ctext
            9  +catch {destroy $w}
           10  +toplevel $w
           11  +wm title $w "Canvas Text Demonstration"
           12  +wm iconname $w "Text"
           13  +positionWindow $w
           14  +set c $w.c
           15  +
           16  +label $w.msg -font $font -wraplength 5i -justify left -text "This window displays a string of text to demonstrate the text facilities of canvas widgets.  You can click in the boxes to adjust the position of the text relative to its positioning point or change its justification.  The text also supports the following simple bindings for editing:
           17  +  1. You can point, click, and type.
           18  +  2. You can also select with button 1.
           19  +  3. You can copy the selection to the mouse position with button 2.
           20  +  4. Backspace and Control+h delete the character just before the
           21  +  insertion cursor.
           22  +  5. Delete deletes the character just after the insertion cursor. "
           23  +pack $w.msg -side top
           24  +
           25  +frame $w.buttons
           26  +pack  $w.buttons -side bottom -expand y -fill x -pady 2m
           27  +button $w.buttons.dismiss -text Dismiss -command "destroy $w"
           28  +button $w.buttons.code -text "See Code" -command "showCode $w"
           29  +pack $w.buttons.dismiss $w.buttons.code -side left -expand 1
           30  +
           31  +canvas $c -relief flat -borderwidth 0 -width 500 -height 400
           32  +pack $w.c -side top -expand yes -fill both
           33  +
           34  +set textFont -*-Helvetica-Medium-R-Normal--*-240-*-*-*-*-*-*
           35  +
           36  +$c create rectangle 245 195 255 205 -outline black -fill red
           37  +
           38  +# First, create the text item and give it bindings so it can be edited.
           39  +
           40  +$c addtag text withtag [$c create text 250 200 -text "This is just a string of text to demonstrate the text facilities of canvas widgets. You can point, click, and type.  You can also select and then delete with Control-d." -width 440 -anchor n -font -*-Helvetica-Medium-R-Normal--*-240-*-*-*-*-*-* -justify left]
           41  +$c bind text <1> "textB1Press $c %x %y"
           42  +$c bind text <B1-Motion> "textB1Move $c %x %y"
           43  +$c bind text <Shift-1> "$c select adjust current @%x,%y"
           44  +$c bind text <Shift-B1-Motion> "textB1Move $c %x %y"
           45  +$c bind text <KeyPress> "textInsert $c %A"
           46  +$c bind text <Return> "textInsert $c \\n"
           47  +$c bind text <Control-h> "textBs $c"
           48  +$c bind text <BackSpace> "textBs $c"
           49  +$c bind text <Delete> "textDel $c"
           50  +$c bind text <2> "textPaste $c @%x,%y" 
           51  +
           52  +# Next, create some items that allow the text's anchor position
           53  +# to be edited.
           54  +
           55  +proc mkTextConfig {w x y option value color} {
           56  +    set item [$w create rect [expr $x] [expr $y] [expr $x+30] [expr $y+30] \
           57  +	    -outline black -fill $color -width 1]
           58  +    $w bind $item <1> "$w itemconf text $option $value"
           59  +    $w addtag config withtag $item
           60  +}
           61  +
           62  +set x 50
           63  +set y 50
           64  +set color LightSkyBlue1
           65  +mkTextConfig $c $x $y -anchor se $color
           66  +mkTextConfig $c [expr $x+30] [expr $y] -anchor s $color
           67  +mkTextConfig $c [expr $x+60] [expr $y] -anchor sw $color
           68  +mkTextConfig $c [expr $x] [expr $y+30] -anchor e $color
           69  +mkTextConfig $c [expr $x+30] [expr $y+30] -anchor center $color
           70  +mkTextConfig $c [expr $x+60] [expr $y+30] -anchor w $color
           71  +mkTextConfig $c [expr $x] [expr $y+60] -anchor ne $color
           72  +mkTextConfig $c [expr $x+30] [expr $y+60] -anchor n $color
           73  +mkTextConfig $c [expr $x+60] [expr $y+60] -anchor nw $color
           74  +set item [$c create rect [expr $x+40] [expr $y+40] [expr $x+50] [expr $y+50] \
           75  +	-outline black -fill red]
           76  +$c bind $item <1> "$c itemconf text -anchor center"
           77  +$c create text [expr $x+45] [expr $y-5] -text {Text Position} -anchor s \
           78  +	-font -*-times-medium-r-normal--*-240-*-*-*-*-*-* -fill brown
           79  +
           80  +# Lastly, create some items that allow the text's justification to be
           81  +# changed.
           82  +
           83  +set x 350
           84  +set y 50
           85  +set color SeaGreen2
           86  +mkTextConfig $c $x $y -justify left $color
           87  +mkTextConfig $c [expr $x+30] [expr $y] -justify center $color
           88  +mkTextConfig $c [expr $x+60] [expr $y] -justify right $color
           89  +$c create text [expr $x+45] [expr $y-5] -text {Justification} -anchor s \
           90  +	-font -*-times-medium-r-normal--*-240-*-*-*-*-*-* -fill brown
           91  +
           92  +$c bind config <Enter> "textEnter $c"
           93  +$c bind config <Leave> "$c itemconf current -fill \$textConfigFill"
           94  +
           95  +set textConfigFill {}
           96  +
           97  +proc textEnter {w} {
           98  +    global textConfigFill
           99  +    set textConfigFill [lindex [$w itemconfig current -fill] 4]
          100  +    $w itemconfig current -fill black
          101  +}
          102  +
          103  +proc textInsert {w string} {
          104  +    if {$string == ""} {
          105  +	return
          106  +    }
          107  +    catch {$w dchars text sel.first sel.last}
          108  +    $w insert text insert $string
          109  +}
          110  +
          111  +proc textPaste {w pos} {
          112  +    catch {
          113  +	$w insert text $pos [selection get]
          114  +    }
          115  +}
          116  +
          117  +proc textB1Press {w x y} {
          118  +    $w icursor current @$x,$y
          119  +    $w focus current
          120  +    focus $w
          121  +    $w select from current @$x,$y
          122  +}
          123  +
          124  +proc textB1Move {w x y} {
          125  +    $w select to current @$x,$y
          126  +}
          127  +
          128  +proc textBs {w} {
          129  +    if ![catch {$w dchars text sel.first sel.last}] {
          130  +	return
          131  +    }
          132  +    set char [expr {[$w index text insert] - 1}]
          133  +    if {$char >= 0} {$w dchar text $char}
          134  +}
          135  +
          136  +proc textDel {w} {
          137  +    if ![catch {$w dchars text sel.first sel.last}] {
          138  +	return
          139  +    }
          140  +    $w dchars text insert
          141  +}

Added library/demos/dialog1.tcl version [9da1811cda].

            1  +# dialog1.tcl --
            2  +#
            3  +# This demonstration script creates a dialog box with a local grab.
            4  +#
            5  +# @(#) dialog1.tcl 1.1 95/05/26 15:56:28
            6  +
            7  +after idle {.dialog1.msg configure -wraplength 4i}
            8  +set i [tk_dialog .dialog1 "Dialog with local grab" {This is a modal dialog box.  It uses Tk's "grab" command to create a "local grab" on the dialog box.  The grab prevents any pointer-related events from getting to any other windows in the application until you have answered the dialog by invoking one of the buttons below.  However, you can still interact with other applications.} \
            9  +info 0 OK Cancel {Show Code}]
           10  +
           11  +switch $i {
           12  +    0 {puts "You pressed OK"}
           13  +    1 {puts "You pressed Cancel"}
           14  +    2 {showCode .dialog1}
           15  +}

Added library/demos/dialog2.tcl version [a2171a97fb].

            1  +# dialog2.tcl --
            2  +#
            3  +# This demonstration script creates a dialog box with a global grab.
            4  +#
            5  +# @(#) dialog2.tcl 1.1 95/05/26 15:56:29
            6  +
            7  +after idle {
            8  +    .dialog2.msg configure -wraplength 4i
            9  +}
           10  +after 100 {
           11  +    grab -global .dialog2
           12  +}
           13  +set i [tk_dialog .dialog2 "Dialog with local grab" {This dialog box uses a global grab, so it prevents you from interacting with anything on your display until you invoke one of the buttons below.  Global grabs are almost always a bad idea; don't use them unless you're truly desperate.} warning 0 OK Cancel {Show Code}]
           14  +
           15  +switch $i {
           16  +    0 {puts "You pressed OK"}
           17  +    1 {puts "You pressed Cancel"}
           18  +    2 {showCode .dialog2}
           19  +}

Added library/demos/entry1.tcl version [555763a697].

            1  +# entry1.tcl --
            2  +#
            3  +# This demonstration script creates several entry widgets without
            4  +# scrollbars.
            5  +#
            6  +# @(#) entry1.tcl 1.1 95/05/26 15:56:29
            7  +
            8  +set w .entry1
            9  +catch {destroy $w}
           10  +toplevel $w
           11  +wm title $w "Entry Demonstration (no scrollbars)"
           12  +wm iconname $w "entry1"
           13  +positionWindow $w
           14  +
           15  +label $w.msg -font $font -wraplength 5i -justify left -text "Three different entries are displayed below.  You can add characters by pointing, clicking and typing.  The normal Motif editing characters are supported, along with many Emacs bindings.  For example, Backspace and Control-h delete the character to the left of the insertion cursor and Delete and Control-d delete the chararacter to the right of the insertion cursor.  For entries that are too large to fit in the window all at once, you can scan through the entries by dragging with mouse button2 pressed."
           16  +pack $w.msg -side top
           17  +
           18  +frame $w.buttons
           19  +pack  $w.buttons -side bottom -expand y -fill x -pady 2m
           20  +button $w.buttons.dismiss -text Dismiss -command "destroy $w"
           21  +button $w.buttons.code -text "See Code" -command "showCode $w"
           22  +pack $w.buttons.dismiss $w.buttons.code -side left -expand 1
           23  +
           24  +entry $w.e1 -relief sunken
           25  +entry $w.e2 -relief sunken
           26  +entry $w.e3 -relief sunken
           27  +pack $w.e1 $w.e2 $w.e3 -side top -pady 5 -padx 10 -fill x
           28  +
           29  +$w.e1 insert 0 "Initial value"
           30  +$w.e2 insert end "This entry contains a long value, much too long "
           31  +$w.e2 insert end "to fit in the window at one time, so long in fact "
           32  +$w.e2 insert end "that you'll have to scan or scroll to see the end."

Added library/demos/entry2.tcl version [e4e7ca3ada].

            1  +# entry2.tcl --
            2  +#
            3  +# This demonstration script is the same as the entry1.tcl script
            4  +# except that it creates scrollbars for the entries.
            5  +#
            6  +# @(#) entry2.tcl 1.1 95/05/26 15:56:30
            7  +
            8  +set w .entry2
            9  +catch {destroy $w}
           10  +toplevel $w
           11  +wm title $w "Entry Demonstration (with scrollbars)"
           12  +wm iconname $w "entry2"
           13  +positionWindow $w
           14  +
           15  +label $w.msg -font $font -wraplength 5i -justify left -text "Three different entries are displayed below, with a scrollbar for each entry.  You can add characters by pointing, clicking and typing.  The normal Motif editing characters are supported, along with many Emacs bindings.  For example, Backspace and Control-h delete the character to the left of the insertion cursor and Delete and Control-d delete the chararacter to the right of the insertion cursor.  For entries that are too large to fit in the window all at once, you can scan through the entries with the scrollbars, or by dragging with mouse button2 pressed."
           16  +pack $w.msg -side top
           17  +
           18  +frame $w.buttons
           19  +pack  $w.buttons -side bottom -expand y -fill x -pady 2m
           20  +button $w.buttons.dismiss -text Dismiss -command "destroy $w"
           21  +button $w.buttons.code -text "See Code" -command "showCode $w"
           22  +pack $w.buttons.dismiss $w.buttons.code -side left -expand 1
           23  +
           24  +frame $w.frame -borderwidth 10
           25  +pack $w.frame -side top -fill x -expand 1
           26  +
           27  +entry $w.frame.e1 -relief sunken -xscrollcommand "$w.frame.s1 set"
           28  +scrollbar $w.frame.s1 -relief sunken -orient horiz -command \
           29  +	"$w.frame.e1 xview"
           30  +frame $w.frame.spacer1 -width 20 -height 10
           31  +entry $w.frame.e2 -relief sunken -xscrollcommand "$w.frame.s2 set"
           32  +scrollbar $w.frame.s2 -relief sunken -orient horiz -command \
           33  +	"$w.frame.e2 xview"
           34  +frame $w.frame.spacer2 -width 20 -height 10
           35  +entry $w.frame.e3 -relief sunken -xscrollcommand "$w.frame.s3 set"
           36  +scrollbar $w.frame.s3 -relief sunken -orient horiz -command \
           37  +	"$w.frame.e3 xview"
           38  +pack $w.frame.e1 $w.frame.s1 $w.frame.spacer1 $w.frame.e2 $w.frame.s2 \
           39  +	$w.frame.spacer2 $w.frame.e3 $w.frame.s3 -side top -fill x
           40  +
           41  +$w.frame.e1 insert 0 "Initial value"
           42  +$w.frame.e2 insert end "This entry contains a long value, much too long "
           43  +$w.frame.e2 insert end "to fit in the window at one time, so long in fact "
           44  +$w.frame.e2 insert end "that you'll have to scan or scroll to see the end."

Added library/demos/form.tcl version [1adbafb3e8].

            1  +# form.tcl --
            2  +#
            3  +# This demonstration script creates a simple form with a bunch
            4  +# of entry widgets.
            5  +#
            6  +# @(#) form.tcl 1.2 95/06/15 13:01:43
            7  +
            8  +set w .form
            9  +catch {destroy $w}
           10  +toplevel $w
           11  +wm title $w "Form Demonstration"
           12  +wm iconname $w "form"
           13  +positionWindow $w
           14  +
           15  +label $w.msg -font $font -wraplength 4i -justify left -text "This window contains a simple form where you can type in the various entries and use tabs to move circularly between the entries."
           16  +pack $w.msg -side top
           17  +
           18  +frame $w.buttons
           19  +pack  $w.buttons -side bottom -expand y -fill x -pady 2m
           20  +button $w.buttons.dismiss -text Dismiss -command "destroy $w"
           21  +button $w.buttons.code -text "See Code" -command "showCode $w"
           22  +pack $w.buttons.dismiss $w.buttons.code -side left -expand 1
           23  +
           24  +foreach i {f1 f2 f3 f4 f5} {
           25  +    frame $w.$i -bd 2
           26  +    entry $w.$i.entry -relief sunken -width 40
           27  +    label $w.$i.label
           28  +    pack $w.$i.entry -side right
           29  +    pack $w.$i.label -side left
           30  +}
           31  +$w.f1.label config -text Name:
           32  +$w.f2.label config -text Address:
           33  +$w.f5.label config -text Phone:
           34  +pack $w.msg $w.f1 $w.f2 $w.f3 $w.f4 $w.f5 -side top -fill x
           35  +bind $w <Return> "destroy $w"
           36  +focus $w.f1.entry

Added library/demos/hello version [cd1b9c5652].

            1  +#!/bin/sh
            2  +# the next line restarts using wish \
            3  +exec cwish "$0" "$@"
            4  +
            5  +# hello --
            6  +# Simple Tk script to create a button that prints "Hello, world".
            7  +# Click on the button to terminate the program.
            8  +#
            9  +# @(#) hello 1.3 95/05/26 16:20:52
           10  +# 
           11  +# The first line below creates the button, and the second line
           12  +# asks the packer to shrink-wrap the application's main window
           13  +# around the button.
           14  +
           15  +button .hello -text "Hello, world" -command {
           16  +    puts stdout "Hello, world"; destroy .
           17  +}
           18  +pack .hello
           19  +focus .hello

Added library/demos/items.tcl version [f59a6a7f69].

            1  +# items.tcl --
            2  +#
            3  +# This demonstration script creates a canvas that displays the
            4  +# canvas item types.
            5  +#
            6  +# @(#) items.tcl 1.3 95/06/25 15:47:20
            7  +
            8  +set w .items
            9  +catch {destroy $w}
           10  +toplevel $w
           11  +wm title $w "Canvas Item Demonstration"
           12  +wm iconname $w "Items"
           13  +positionWindow $w
           14  +set c $w.frame.c
           15  +
           16  +label $w.msg -font $font -wraplength 5i -justify left -text "This window contains a canvas widget with examples of the various kinds of items supported by canvases.  The following operations are supported:\n  Button-1 drag:\tmoves item under pointer.\n  Button-2 drag:\trepositions view.\n  Button-3 drag:\tstrokes out area.\n  Ctrl+f:\t\tprints items under area."
           17  +pack $w.msg -side top
           18  +
           19  +frame $w.buttons
           20  +pack  $w.buttons -side bottom -expand y -fill x -pady 2m
           21  +button $w.buttons.dismiss -text Dismiss -command "destroy $w"
           22  +button $w.buttons.code -text "See Code" -command "showCode $w"
           23  +pack $w.buttons.dismiss $w.buttons.code -side left -expand 1
           24  +
           25  +frame $w.frame
           26  +pack $w.frame -side top -fill both -expand yes
           27  +
           28  +canvas $c -scrollregion {0c 0c 30c 24c} -width 15c -height 10c \
           29  +	-relief sunken -borderwidth 2 \
           30  +	-xscrollcommand "$w.frame.hscroll set" \
           31  +	-yscrollcommand "$w.frame.vscroll set"
           32  +scrollbar $w.frame.vscroll -command "$c yview"
           33  +scrollbar $w.frame.hscroll -orient horiz -command "$c xview"
           34  +pack $w.frame.hscroll -side bottom -fill x
           35  +pack $w.frame.vscroll -side right -fill y
           36  +pack $c -in $w.frame -expand yes -fill both
           37  +
           38  +# Display a 3x3 rectangular grid.
           39  +
           40  +$c create rect 0c 0c 30c 24c -width 2
           41  +$c create line 0c 8c 30c 8c -width 2
           42  +$c create line 0c 16c 30c 16c -width 2
           43  +$c create line 10c 0c 10c 24c -width 2
           44  +$c create line 20c 0c 20c 24c -width 2
           45  +
           46  +set font1 -Adobe-Helvetica-Medium-R-Normal--*-120-*-*-*-*-*-*
           47  +set font2 -Adobe-Helvetica-Bold-R-Normal--*-240-*-*-*-*-*-*
           48  +if {[winfo depth $c] > 1} {
           49  +    set blue DeepSkyBlue3
           50  +    set red red
           51  +    set bisque bisque3
           52  +    set green SeaGreen3
           53  +} else {
           54  +    set blue black
           55  +    set red black
           56  +    set bisque black
           57  +    set green black
           58  +}
           59  +
           60  +# Set up demos within each of the areas of the grid.
           61  +
           62  +$c create text 5c .2c -text Lines -anchor n
           63  +$c create line 1c 1c 3c 1c 1c 4c 3c 4c -width 2m -fill $blue \
           64  +	-cap butt -join miter -tags item
           65  +$c create line 4.67c 1c 4.67c 4c -arrow last -tags item
           66  +$c create line 6.33c 1c 6.33c 4c -arrow both -tags item
           67  +$c create line 5c 6c 9c 6c 9c 1c 8c 1c 8c 4.8c 8.8c 4.8c 8.8c 1.2c \
           68  +	8.2c 1.2c 8.2c 4.6c 8.6c 4.6c 8.6c 1.4c 8.4c 1.4c 8.4c 4.4c \
           69  +	-width 3 -fill $red -tags item
           70  +$c create line 1c 5c 7c 5c 7c 7c 9c 7c -width .5c \
           71  +	-stipple @$tk_library/demos/images/grey.25 \
           72  +	-arrow both -arrowshape {15 15 7} -tags item
           73  +$c create line 1c 7c 1.75c 5.8c 2.5c 7c 3.25c 5.8c 4c 7c -width .5c \
           74  +	-cap round -join round -tags item
           75  +
           76  +$c create text 15c .2c -text "Curves (smoothed lines)" -anchor n
           77  +$c create line 11c 4c 11.5c 1c 13.5c 1c 14c 4c -smooth on \
           78  +	-fill $blue -tags item
           79  +$c create line 15.5c 1c 19.5c 1.5c 15.5c 4.5c 19.5c 4c -smooth on \
           80  +	-arrow both -width 3 -tags item
           81  +$c create line 12c 6c 13.5c 4.5c 16.5c 7.5c 18c 6c \
           82  +	16.5c 4.5c 13.5c 7.5c 12c 6c -smooth on -width 3m -cap round \
           83  +	-stipple @$tk_library/demos/images/grey.25 -fill $red -tags item
           84  +
           85  +$c create text 25c .2c -text Polygons -anchor n
           86  +$c create polygon 21c 1.0c 22.5c 1.75c 24c 1.0c 23.25c 2.5c \
           87  +	24c 4.0c 22.5c 3.25c 21c 4.0c 21.75c 2.5c -fill $green \
           88  +	-outline black -width 4 -tags item
           89  +$c create polygon 25c 4c 25c 4c 25c 1c 26c 1c 27c 4c 28c 1c \
           90  +	29c 1c 29c 4c 29c 4c -fill $red -smooth on -tags item
           91  +$c create polygon 22c 4.5c 25c 4.5c 25c 6.75c 28c 6.75c \
           92  +	28c 5.25c 24c 5.25c 24c 6.0c 26c 6c 26c 7.5c 22c 7.5c \
           93  +	-stipple @$tk_library/demos/images/grey.25 \
           94  +	-outline black -tags item
           95  +
           96  +$c create text 5c 8.2c -text Rectangles -anchor n
           97  +$c create rectangle 1c 9.5c 4c 12.5c -outline $red -width 3m -tags item
           98  +$c create rectangle 0.5c 13.5c 4.5c 15.5c -fill $green -tags item
           99  +$c create rectangle 6c 10c 9c 15c -outline {} \
          100  +	-stipple @$tk_library/demos/images/grey.25 -fill $blue -tags item
          101  +
          102  +$c create text 15c 8.2c -text Ovals -anchor n
          103  +$c create oval 11c 9.5c 14c 12.5c -outline $red -width 3m -tags item
          104  +$c create oval 10.5c 13.5c 14.5c 15.5c -fill $green -tags item
          105  +$c create oval 16c 10c 19c 15c -outline {} \
          106  +	-stipple @$tk_library/demos/images/grey.25 -fill $blue -tags item
          107  +
          108  +$c create text 25c 8.2c -text Text -anchor n
          109  +$c create rectangle 22.4c 8.9c 22.6c 9.1c
          110  +$c create text 22.5c 9c -anchor n -font $font1 -width 4c \
          111  +	-text "A short string of text, word-wrapped, justified left, and anchored north (at the top).  The rectangles show the anchor points for each piece of text." -tags item
          112  +$c create rectangle 25.4c 10.9c 25.6c 11.1c
          113  +$c create text 25.5c 11c -anchor w -font $font1 -fill $blue \
          114  +	-text "Several lines,\n each centered\nindividually,\nand all anchored\nat the left edge." \
          115  +	-justify center -tags item
          116  +$c create rectangle 24.9c 13.9c 25.1c 14.1c
          117  +$c create text 25c 14c -font $font2 -anchor c -fill $red \
          118  +	-stipple @$tk_library/demos/images/grey.5 \
          119  +	-text "Stippled characters" -tags item
          120  +
          121  +$c create text 5c 16.2c -text Arcs -anchor n
          122  +$c create arc 0.5c 17c 7c 20c -fill $green -outline black \
          123  +	-start 45 -extent 270 -style pieslice -tags item
          124  +$c create arc 6.5c 17c 9.5c 20c -width 4m -style arc \
          125  +	-outline $blue -start -135 -extent 270 \
          126  +	-outlinestipple @$tk_library/demos/images/grey.25 -tags item
          127  +$c create arc 0.5c 20c 9.5c 24c -width 4m -style pieslice \
          128  +	-fill {} -outline $red -start 225 -extent -90 -tags item
          129  +$c create arc 5.5c 20.5c 9.5c 23.5c -width 4m -style chord \
          130  +	-fill $blue -outline {} -start 45 -extent 270  -tags item
          131  +
          132  +$c create text 15c 16.2c -text Bitmaps -anchor n
          133  +$c create bitmap 13c 20c -bitmap @$tk_library/demos/images/face -tags item
          134  +$c create bitmap 17c 18.5c \
          135  +	-bitmap @$tk_library/demos/images/noletters -tags item
          136  +$c create bitmap 17c 21.5c \
          137  +	-bitmap @$tk_library/demos/images/letters -tags item
          138  +
          139  +$c create text 25c 16.2c -text Windows -anchor n
          140  +button $c.button -text "Press Me" -command "butPress $c $red"
          141  +$c create window 21c 18c -window $c.button -anchor nw -tags item
          142  +entry $c.entry -width 20 -relief sunken
          143  +$c.entry insert end "Edit this text"
          144  +$c create window 21c 21c -window $c.entry -anchor nw -tags item
          145  +scale $c.scale -from 0 -to 100 -length 6c -sliderlength .4c \
          146  +	-width .5c -tickinterval 0
          147  +$c create window 28.5c 17.5c -window $c.scale -anchor n -tags item
          148  +$c create text 21c 17.9c -text Button: -anchor sw
          149  +$c create text 21c 20.9c -text Entry: -anchor sw
          150  +$c create text 28.5c 17.4c -text Scale: -anchor s
          151  +
          152  +# Set up event bindings for canvas:
          153  +
          154  +$c bind item <Any-Enter> "itemEnter $c"
          155  +$c bind item <Any-Leave> "itemLeave $c"
          156  +bind $c <2> "$c scan mark %x %y"
          157  +bind $c <B2-Motion> "$c scan dragto %x %y"
          158  +bind $c <3> "itemMark $c %x %y"
          159  +bind $c <B3-Motion> "itemStroke $c %x %y"
          160  +bind $c <Control-f> "itemsUnderArea $c"
          161  +bind $c <1> "itemStartDrag $c %x %y"
          162  +bind $c <B1-Motion> "itemDrag $c %x %y"
          163  +
          164  +# Utility procedures for highlighting the item under the pointer:
          165  +
          166  +proc itemEnter {c} {
          167  +    global restoreCmd
          168  +
          169  +    if {[winfo depth $c] == 1} {
          170  +	set restoreCmd {}
          171  +	return
          172  +    }
          173  +    set type [$c type current]
          174  +    if {$type == "window"} {
          175  +	set restoreCmd {}
          176  +	return
          177  +    }
          178  +    if {$type == "bitmap"} {
          179  +	set bg [lindex [$c itemconf current -background] 4]
          180  +	set restoreCmd [list $c itemconfig current -background $bg]
          181  +	$c itemconfig current -background SteelBlue2
          182  +	return
          183  +    }
          184  +    set fill [lindex [$c itemconfig current -fill] 4]
          185  +    if {(($type == "rectangle") || ($type == "oval") || ($type == "arc"))
          186  +	    && ($fill == "")} {
          187  +	set outline [lindex [$c itemconfig current -outline] 4]
          188  +	set restoreCmd "$c itemconfig current -outline $outline"
          189  +	$c itemconfig current -outline SteelBlue2
          190  +    } else {
          191  +	set restoreCmd "$c itemconfig current -fill $fill"
          192  +	$c itemconfig current -fill SteelBlue2
          193  +    }
          194  +}
          195  +
          196  +proc itemLeave {c} {
          197  +    global restoreCmd
          198  +
          199  +    eval $restoreCmd
          200  +}
          201  +
          202  +# Utility procedures for stroking out a rectangle and printing what's
          203  +# underneath the rectangle's area.
          204  +
          205  +proc itemMark {c x y} {
          206  +    global areaX1 areaY1
          207  +    set areaX1 [$c canvasx $x]
          208  +    set areaY1 [$c canvasy $y]
          209  +    $c delete area
          210  +}
          211  +
          212  +proc itemStroke {c x y} {
          213  +    global areaX1 areaY1 areaX2 areaY2
          214  +    set x [$c canvasx $x]
          215  +    set y [$c canvasy $y]
          216  +    if {($areaX1 != $x) && ($areaY1 != $y)} {
          217  +	$c delete area
          218  +	$c addtag area withtag [$c create rect $areaX1 $areaY1 $x $y \
          219  +		-outline black]
          220  +	set areaX2 $x
          221  +	set areaY2 $y
          222  +    }
          223  +}
          224  +
          225  +proc itemsUnderArea {c} {
          226  +    global areaX1 areaY1 areaX2 areaY2
          227  +    set area [$c find withtag area]
          228  +    set items ""
          229  +    foreach i [$c find enclosed $areaX1 $areaY1 $areaX2 $areaY2] {
          230  +	if {[lsearch [$c gettags $i] item] != -1} {
          231  +	    lappend items $i
          232  +	}
          233  +    }
          234  +    puts stdout "Items enclosed by area: $items"
          235  +    set items ""
          236  +    foreach i [$c find overlapping $areaX1 $areaY1 $areaX2 $areaY2] {
          237  +	if {[lsearch [$c gettags $i] item] != -1} {
          238  +	    lappend items $i
          239  +	}
          240  +    }
          241  +    puts stdout "Items overlapping area: $items"
          242  +}
          243  +
          244  +set areaX1 0
          245  +set areaY1 0
          246  +set areaX2 0
          247  +set areaY2 0
          248  +
          249  +# Utility procedures to support dragging of items.
          250  +
          251  +proc itemStartDrag {c x y} {
          252  +    global lastX lastY
          253  +    set lastX [$c canvasx $x]
          254  +    set lastY [$c canvasy $y]
          255  +}
          256  +
          257  +proc itemDrag {c x y} {
          258  +    global lastX lastY
          259  +    set x [$c canvasx $x]
          260  +    set y [$c canvasy $y]
          261  +    $c move current [expr $x-$lastX] [expr $y-$lastY]
          262  +    set lastX $x
          263  +    set lastY $y
          264  +}
          265  +
          266  +# Procedure that's invoked when the button embedded in the canvas
          267  +# is invoked.
          268  +
          269  +proc butPress {w color} {
          270  +    set i [$w create text 25c 18.1c -text "Ouch!!" -fill $color -anchor n]
          271  +    after 500 "$w delete $i"
          272  +}

Added library/demos/label.tcl version [16fc6cd5dc].

            1  +# label.tcl --
            2  +#
            3  +# This demonstration script creates a toplevel window containing
            4  +# several label widgets.
            5  +#
            6  +# @(#) label.tcl 1.1 95/05/26 15:56:33
            7  +
            8  +set w .label
            9  +catch {destroy $w}
           10  +toplevel $w
           11  +wm title $w "Label Demonstration"
           12  +wm iconname $w "label"
           13  +positionWindow $w
           14  +
           15  +label $w.msg -font $font -wraplength 4i -justify left -text "Five labels are displayed below: three textual ones on the left, and a bitmap label and a text label on the right.  Labels are pretty boring because you can't do anything with them."
           16  +pack $w.msg -side top
           17  +
           18  +frame $w.buttons
           19  +pack  $w.buttons -side bottom -expand y -fill x -pady 2m
           20  +button $w.buttons.dismiss -text Dismiss -command "destroy $w"
           21  +button $w.buttons.code -text "See Code" -command "showCode $w"
           22  +pack $w.buttons.dismiss $w.buttons.code -side left -expand 1
           23  +
           24  +frame $w.left
           25  +frame $w.right
           26  +pack $w.left $w.right -side left -expand yes -padx 10 -pady 10 -fill both
           27  +
           28  +label $w.left.l1 -text "First label"
           29  +label $w.left.l2 -text "Second label, raised" -relief raised
           30  +label $w.left.l3 -text "Third label, sunken" -relief sunken
           31  +pack $w.left.l1 $w.left.l2 $w.left.l3 -side top -expand yes -pady 2 -anchor w
           32  +
           33  +label $w.right.bitmap -bitmap @$tk_library/demos/images/face \
           34  +	-borderwidth 2 -relief sunken
           35  +label $w.right.caption -text "Tcl/Tk Proprietor"
           36  +pack $w.right.bitmap $w.right.caption -side top

Added library/demos/license.terms version [20dbc90f96].

            1  +This software is copyrighted by the Regents of the University of
            2  +California, Sun Microsystems, Inc., Cleveland Clinic Foundation, and
            3  +other parties.  The following terms apply to all files associated with
            4  +the software unless explicitly disclaimed in individual files.
            5  +
            6  +The authors hereby grant permission to use, copy, modify, distribute,
            7  +and license this software and its documentation for any purpose, provided
            8  +that existing copyright notices are retained in all copies and that this
            9  +notice is included verbatim in any distributions. No written agreement,
           10  +license, or royalty fee is required for any of the authorized uses.
           11  +Modifications to this software may be copyrighted by their authors
           12  +and need not follow the licensing terms described here, provided that
           13  +the new terms are clearly indicated on the first page of each file where
           14  +they apply.
           15  +
           16  +IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY
           17  +FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
           18  +ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY
           19  +DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE
           20  +POSSIBILITY OF SUCH DAMAGE.
           21  +
           22  +THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
           23  +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
           24  +FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.  THIS SOFTWARE
           25  +IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE
           26  +NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
           27  +MODIFICATIONS.
           28  +
           29  +RESTRICTED RIGHTS: Use, duplication or disclosure by the government
           30  +is subject to the restrictions as set forth in subparagraph (c) (1) (ii)
           31  +of the Rights in Technical Data and Computer Software Clause as DFARS
           32  +252.227-7013 and FAR 52.227-19.

Added library/demos/menu.tcl version [374dcf04a8].

            1  +# menu.tcl --
            2  +#
            3  +# This demonstration script creates a window with a bunch of menus
            4  +# and cascaded menus.
            5  +#
            6  +# @(#) menu.tcl 1.2 95/05/26 17:14:08
            7  +
            8  +set w .menu
            9  +catch {destroy $w}
           10  +toplevel $w
           11  +wm title $w "Menu Demonstration"
           12  +wm iconname $w "menu"
           13  +positionWindow $w
           14  +
           15  +frame $w.menu -relief raised -bd 2
           16  +pack $w.menu -side top -fill x
           17  +
           18  +label $w.msg -font $font -wraplength 4i -justify left -text "This window contains a collection of menus and cascaded menus.  You can post a menu from the keyboard by typing Alt+x, where \"x\" is the character underlined on the menu.  You can then traverse among the menus using the arrow keys.  When a menu is posted, you can invoke the current entry by typing space, or you can invoke any entry by typing its underlined character.  If a menu entry has an accelerator, you can invoke the entry without posting the menu just by typing the accelerator."
           19  +pack $w.msg -side top
           20  +
           21  +frame $w.buttons
           22  +pack  $w.buttons -side bottom -expand y -fill x -pady 2m
           23  +button $w.buttons.dismiss -text Dismiss -command "destroy $w"
           24  +button $w.buttons.code -text "See Code" -command "showCode $w"
           25  +pack $w.buttons.dismiss $w.buttons.code -side left -expand 1
           26  +
           27  +set m $w.menu.file.m
           28  +menubutton $w.menu.file -text "File" -menu $m -underline 0
           29  +menu $m
           30  +$m add command -label "Open ..." -command {error "this is just a demo: no action has been defined for the \"Open ...\" entry"}
           31  +$m add command -label "New" -command {error "this is just a demo: no action has been defined for the \"New\" entry"}
           32  +$m add command -label "Save" -command {error "this is just a demo: no action has been defined for the \"Save\" entry"}
           33  +$m add command -label "Save As ..." -command {error "this is just a demo: no action has been defined for the \"Save As ...\" entry"}
           34  +$m add separator
           35  +$m add command -label "Print Setup ..." -command {error "this is just a demo: no action has been defined for the \"Print Setup ...\" entry"}
           36  +$m add command -label "Print ..." -command {error "this is just a demo: no action has been defined for the \"Print ...\" entry"}
           37  +$m add separator
           38  +$m add command -label "Quit" -command "destroy $w"
           39  +
           40  +set m $w.menu.basic.m
           41  +menubutton $w.menu.basic -text "Basic" -menu $m -underline 0
           42  +menu $m
           43  +$m add command -label "Long entry that does nothing"
           44  +foreach i {a b c d e f g} {
           45  +    $m add command -label "Print letter \"$i\"" -underline 14 \
           46  +	    -accelerator Meta+$i -command "puts $i"
           47  +    bind $w <Meta-$i> "puts $i"
           48  +}
           49  +
           50  +set m $w.menu.cascade.m
           51  +menubutton $w.menu.cascade -text "Cascades" -menu $m -underline 0
           52  +menu $m
           53  +$m add command -label "Print hello" \
           54  +	-command {puts stdout "Hello"} -accelerator Control+a -underline 6
           55  +bind . <Control-a> {puts stdout "Hello"}
           56  +$m add command -label "Print goodbye" -command {\
           57  +    puts stdout "Goodbye"} -accelerator Control+b -underline 6
           58  +bind . <Control-b> {puts stdout "Goodbye"}
           59  +$m add cascade -label "Check buttons" \
           60  +	-menu $w.menu.cascade.m.check -underline 0
           61  +$m add cascade -label "Radio buttons" \
           62  +	-menu $w.menu.cascade.m.radio -underline 0
           63  +
           64  +set m $w.menu.cascade.m.check
           65  +menu $m
           66  +$m add check -label "Oil checked" -variable oil
           67  +$m add check -label "Transmission checked" -variable trans
           68  +$m add check -label "Brakes checked" -variable brakes
           69  +$m add check -label "Lights checked" -variable lights
           70  +$m add separator
           71  +$m add command -label "Show current values" \
           72  +    -command "showVars $w.menu.cascade.dialog oil trans brakes lights"
           73  +$m invoke 1
           74  +$m invoke 3
           75  +
           76  +set m $w.menu.cascade.m.radio
           77  +menu $m
           78  +$m add radio -label "10 point" -variable pointSize -value 10
           79  +$m add radio -label "14 point" -variable pointSize -value 14
           80  +$m add radio -label "18 point" -variable pointSize -value 18
           81  +$m add radio -label "24 point" -variable pointSize -value 24
           82  +$m add radio -label "32 point" -variable pointSize -value 32
           83  +$m add sep
           84  +$m add radio -label "Roman" -variable style -value roman
           85  +$m add radio -label "Bold" -variable style -value bold
           86  +$m add radio -label "Italic" -variable style -value italic
           87  +$m add sep
           88  +$m add command -label "Show current values" \
           89  +	-command "showVars $w.menu.cascade.dialog pointSize style"
           90  +$m invoke 1
           91  +$m invoke 7
           92  +
           93  +set m $w.menu.icon.m
           94  +menubutton $w.menu.icon -text "Icons" -menu $m -underline 0
           95  +menu $m
           96  +$m add command -bitmap @$tk_library/demos/images/pattern \
           97  +    -command {
           98  +	tk_dialog .pattern {Bitmap Menu Entry} {The menu entry you invoked displays a bitmap rather than a text string.  Other than this, it is just like any other menu entry.} {} 0 OK
           99  +}
          100  +foreach i {info questhead error} {
          101  +    $m add command -bitmap $i -command "puts {You invoked the $i bitmap}"
          102  +}
          103  +
          104  +set m $w.menu.more.m
          105  +menubutton $w.menu.more -text "More" -menu $m -underline 0
          106  +menu $m
          107  +foreach i {{An entry} {Another entry} {Does nothing} {Does almost nothing} {Make life meaningful}} {
          108  +    $m add command -label $i -command [list puts "You invoked \"$i\""]
          109  +}
          110  +
          111  +set m $w.menu.colors.m
          112  +menubutton $w.menu.colors -text "Colors" -menu $m -underline 1
          113  +menu $m
          114  +foreach i {red orange yellow green blue} {
          115  +    $m add command -label $i -background $i \
          116  +	    -command [list puts "You invoked \"$i\""]
          117  +}
          118  +
          119  +pack $w.menu.file $w.menu.basic $w.menu.cascade $w.menu.icon $w.menu.more \
          120  +	$w.menu.colors -side left

Added library/demos/puzzle.tcl version [5d1025c314].

            1  +# puzzle.tcl --
            2  +#
            3  +# This demonstration script creates a 15-puzzle game using a collection
            4  +# of buttons.
            5  +#
            6  +# @(#) puzzle.tcl 1.2 95/06/02 10:52:41
            7  +
            8  +# puzzleSwitch --
            9  +# This procedure is invoked when the user clicks on a particular button;
           10  +# if the button is next to the empty space, it moves the button into th
           11  +# empty space.
           12  +
           13  +proc puzzleSwitch {w num} {
           14  +    global xpos ypos
           15  +    if {(($ypos($num) >= ($ypos(space) - .01))
           16  +	    && ($ypos($num) <= ($ypos(space) + .01))
           17  +	    && ($xpos($num) >= ($xpos(space) - .26))
           18  +	    && ($xpos($num) <= ($xpos(space) + .26)))
           19  +	    || (($xpos($num) >= ($xpos(space) - .01))
           20  +	    && ($xpos($num) <= ($xpos(space) + .01))
           21  +	    && ($ypos($num) >= ($ypos(space) - .26))
           22  +	    && ($ypos($num) <= ($ypos(space) + .26)))} {
           23  +	set tmp $xpos(space)
           24  +	set xpos(space) $xpos($num)
           25  +	set xpos($num) $tmp
           26  +	set tmp $ypos(space)
           27  +	set ypos(space) $ypos($num)
           28  +	set ypos($num) $tmp
           29  +	place $w.frame.$num -relx $xpos($num) -rely $ypos($num)
           30  +    }
           31  +}
           32  +
           33  +set w .puzzle
           34  +catch {destroy $w}
           35  +toplevel $w
           36  +wm title $w "15-Puzzle Demonstration"
           37  +wm iconname $w "15-Puzzle"
           38  +positionWindow $w
           39  +
           40  +label $w.msg -font $font -wraplength 4i -justify left -text "A 15-puzzle appears below as a collection of buttons.  Click on any of the pieces next to the space, and that piece will slide over the space.  Continue this until the pieces are arranged in numerical order from upper-left to lower-right."
           41  +pack $w.msg -side top
           42  +
           43  +frame $w.buttons
           44  +pack  $w.buttons -side bottom -expand y -fill x -pady 2m
           45  +button $w.buttons.dismiss -text Dismiss -command "destroy $w"
           46  +button $w.buttons.code -text "See Code" -command "showCode $w"
           47  +pack $w.buttons.dismiss $w.buttons.code -side left -expand 1
           48  +
           49  +# Special trick: select a darker color for the space by creating a
           50  +# scrollbar widget and using its trough color.
           51  +
           52  +scrollbar $w.s
           53  +frame $w.frame -width 5i -height 5i -borderwidth 1m -relief sunken \
           54  +	-bg [$w.s cget -troughcolor]
           55  +pack $w.frame -side top -pady 1m -padx 1m
           56  +destroy $w.s
           57  +
           58  +set order {3 1 6 2 5 7 15 13 4 11 8 9 14 10 12}
           59  +for {set i 0} {$i < 15} {set i [expr $i+1]} {
           60  +    set num [lindex $order $i]
           61  +    set xpos($num) [expr ($i%4)*.25]
           62  +    set ypos($num) [expr ($i/4)*.25]
           63  +    button $w.frame.$num -relief raised -text $num -highlightthickness 0 \
           64  +	    -command "puzzleSwitch $w $num"
           65  +    place $w.frame.$num -relx $xpos($num) -rely $ypos($num) \
           66  +	-relwidth .25 -relheight .25
           67  +}
           68  +set xpos(space) .75
           69  +set ypos(space) .75
           70  +focus $w.frame.3

Added library/demos/radio.tcl version [628d294b02].

            1  +# radio.tcl --
            2  +#
            3  +# This demonstration script creates a toplevel window containing
            4  +# several radiobutton widgets.
            5  +#
            6  +# @(#) radio.tcl 1.2 95/06/15 13:01:37
            7  +
            8  +set w .radio
            9  +catch {destroy $w}
           10  +toplevel $w
           11  +wm title $w "Radiobutton Demonstration"
           12  +wm iconname $w "radio"
           13  +positionWindow $w
           14  +label $w.msg -font $font -wraplength 5i -justify left -text "Two groups of radiobuttons are displayed below.  If you click on a button then the button will become selected exclusively among all the buttons in its group.  A Tcl variable is associated with each group to indicate which of the group's buttons is selected.  Click the \"See Variables\" button to see the current values of the variables."
           15  +pack $w.msg -side top
           16  +
           17  +frame $w.buttons
           18  +pack  $w.buttons -side bottom -expand y -fill x -pady 2m
           19  +button $w.buttons.dismiss -text Dismiss -command "destroy $w"
           20  +button $w.buttons.code -text "See Code" -command "showCode $w"
           21  +button $w.buttons.vars -text "See Variables"  \
           22  +	-command "showVars $w.dialog size color"
           23  +pack $w.buttons.dismiss $w.buttons.code $w.buttons.vars -side left -expand 1
           24  +
           25  +frame $w.left
           26  +frame $w.right
           27  +pack $w.left $w.right -side left -expand yes  -pady .5c -padx .5c
           28  +
           29  +foreach i {10 12 18 24} {
           30  +    radiobutton $w.left.b$i -text "Point Size $i" -variable size \
           31  +	    -relief flat -value $i
           32  +    pack $w.left.b$i  -side top -pady 2 -anchor w
           33  +}
           34  +
           35  +foreach color {Red Green Blue Yellow Orange Purple} {
           36  +    set lower [string tolower $color]
           37  +    radiobutton $w.right.$lower -text $color -variable color \
           38  +	    -relief flat -value $lower
           39  +    pack $w.right.$lower -side top -pady 2 -anchor w
           40  +}

Added library/demos/rolodex version [2ef981f1ef].

            1  +#!/bin/sh
            2  +# the next line restarts using wish \
            3  +exec cwish "$0" "$@"
            4  +
            5  +# rolodex --
            6  +# This script was written as an entry in Tom LaStrange's rolodex
            7  +# benchmark.  It creates something that has some of the look and
            8  +# feel of a rolodex program, although it's lifeless and doesn't
            9  +# actually do the rolodex application.
           10  +#
           11  +# @(#) rolodex 1.4 95/05/26 16:20:55
           12  +
           13  +foreach i [winfo child .] {
           14  +    catch {destroy $i}
           15  +}
           16  +
           17  +#------------------------------------------
           18  +# Phase 0: create the front end.
           19  +#------------------------------------------
           20  +
           21  +frame .frame -relief flat
           22  +pack .frame -side top -fill y -anchor center
           23  +
           24  +set names {{} Name: Address: {} {} {Home Phone:} {Work Phone:} Fax:}
           25  +foreach i {1 2 3 4 5 6 7} {
           26  +    frame .frame.$i
           27  +    pack .frame.$i -side top -pady 1m -anchor e
           28  +
           29  +    label .frame.$i.label -text [lindex $names $i] -anchor e
           30  +    entry .frame.$i.entry -width 30 -relief sunken
           31  +    pack .frame.$i.entry .frame.$i.label -side right
           32  +}
           33  +
           34  +frame .buttons
           35  +pack .buttons -side bottom -pady 1m -anchor center
           36  +button .buttons.clear -text Clear
           37  +button .buttons.add -text Add
           38  +button .buttons.search -text Search
           39  +button .buttons.delete -text "Delete ..."
           40  +pack .buttons.clear .buttons.add .buttons.search .buttons.delete \
           41  +	-side left -padx 2
           42  +
           43  +#------------------------------------------
           44  +# Phase 1: Add menus, dialog boxes
           45  +#------------------------------------------
           46  +
           47  +frame .menu -relief raised -borderwidth 1
           48  +pack .menu -before .frame -side top -fill x
           49  +
           50  +menubutton .menu.file -text "File" -menu .menu.file.m -underline 0
           51  +menu .menu.file.m
           52  +.menu.file.m add command -label "Load ..." -command fileAction -underline 0
           53  +.menu.file.m add command -label "Exit" -command {destroy .} -underline 0
           54  +pack .menu.file -side left
           55  +
           56  +menubutton .menu.help -text "Help" -menu .menu.help.m -underline 0
           57  +menu .menu.help.m
           58  +pack .menu.help -side right
           59  +
           60  +proc deleteAction {} {
           61  +    if {[tk_dialog .delete {Confirm Action} {Are you sure?} {} 0  Cancel]
           62  +	    == 0} {
           63  +	clearAction
           64  +    }
           65  +}
           66  +.buttons.delete config -command deleteAction
           67  +
           68  +proc fileAction {} {
           69  +    tk_dialog .fileSelection {File Selection} {This is a dummy file selection dialog box, which is used because there isn't a good file selection dialog built into Tk yet.} {} 0 OK
           70  +    puts stderr {dummy file name}
           71  +}
           72  +
           73  +#------------------------------------------
           74  +# Phase 3: Print contents of card
           75  +#------------------------------------------
           76  +
           77  +proc addAction {} {
           78  +    global names
           79  +    foreach i {1 2 3 4 5 6 7} {
           80  +	puts stderr [format "%-12s %s" [lindex $names $i] [.frame.$i.entry get]]
           81  +    }
           82  +}
           83  +.buttons.add config -command addAction
           84  +
           85  +#------------------------------------------
           86  +# Phase 4: Miscellaneous other actions
           87  +#------------------------------------------
           88  +
           89  +proc clearAction {} {
           90  +    foreach i {1 2 3 4 5 6 7} {
           91  +	.frame.$i.entry delete 0 end
           92  +    }
           93  +}
           94  +.buttons.clear config -command clearAction
           95  +
           96  +proc fillCard {} {
           97  +    clearAction
           98  +    .frame.1.entry insert 0 "John Ousterhout"
           99  +    .frame.2.entry insert 0 "CS Division, Department of EECS"
          100  +    .frame.3.entry insert 0 "University of California"
          101  +    .frame.4.entry insert 0 "Berkeley, CA 94720"
          102  +    .frame.5.entry insert 0 "private"
          103  +    .frame.6.entry insert 0 "510-642-0865"
          104  +    .frame.7.entry insert 0 "510-642-5775"
          105  +}
          106  +.buttons.search config -command "addAction; fillCard"
          107  +
          108  +#----------------------------------------------------
          109  +# Phase 5: Accelerators, mnemonics, command-line info
          110  +#----------------------------------------------------
          111  +
          112  +.buttons.clear config -text "Clear ^C"
          113  +bind . <Control-c> clearAction
          114  +.buttons.add config -text "Add ^A"
          115  +bind . <Control-a> addAction
          116  +.buttons.search config -text "Search ^S"
          117  +bind . <Control-s> "addAction; fillCard"
          118  +.buttons.delete config -text "Delete... ^D"
          119  +bind . <Control-d> deleteAction
          120  +
          121  +.menu.file.m entryconfig 1 -accel ^F
          122  +bind . <Control-f> fileAction
          123  +.menu.file.m entryconfig 2 -accel ^Q
          124  +bind . <Control-q> {destroy .}
          125  +
          126  +focus .frame.1.entry
          127  +
          128  +#----------------------------------------------------
          129  +# Phase 6: help
          130  +#----------------------------------------------------
          131  +
          132  +proc Help {topic {x 0} {y 0}} {
          133  +    global helpTopics helpCmds
          134  +    if {$topic == ""} return
          135  +    while {[info exists helpCmds($topic)]} {
          136  +	set topic [eval $helpCmds($topic)]
          137  +    }
          138  +    if [info exists helpTopics($topic)] {
          139  +	set msg $helpTopics($topic)
          140  +    } else {
          141  +	set msg "Sorry, but no help is available for this topic"
          142  +    }
          143  +    tk_dialog .help {Rolodex Help} "Information on $topic:\n\n$msg" \
          144  +	    {} 0 OK
          145  +}
          146  +
          147  +proc getMenuTopic {w x y} {
          148  +    return $w.[$w index @[expr $y-[winfo rooty $w]]]
          149  +}
          150  +
          151  +bind . <Any-F1> {Help [winfo containing %X %Y] %X %Y}
          152  +bind . <Any-Help> {Help [winfo containing %X %Y] %X %Y}
          153  +
          154  +# Help text and commands follow:
          155  +
          156  +set helpTopics(.menu.file) {This is the "file" menu.  It can be used to invoke some overall operations on the rolodex applications, such as loading a file or exiting.}
          157  +
          158  +set helpCmds(.menu.file.m) {getMenuTopic $topic $x $y}
          159  +set helpTopics(.menu.file.m.0) {The "Load" entry in the "File" menu posts a dialog box that you can use to select a rolodex file}
          160  +set helpTopics(.menu.file.m.1) {The "Exit" entry in the "File" menu causes the rolodex application to terminate}
          161  +set helpCmds(.menu.file.m.none) {set topic ".menu.file"}
          162  +
          163  +set helpTopics(.frame.1.entry) {In this field of the rolodex entry you should type the person's name}
          164  +set helpTopics(.frame.2.entry) {In this field of the rolodex entry you should type the first line of the person's address}
          165  +set helpTopics(.frame.3.entry) {In this field of the rolodex entry you should type the second line of the person's address}
          166  +set helpTopics(.frame.4.entry) {In this field of the rolodex entry you should type the third line of the person's address}
          167  +set helpTopics(.frame.5.entry) {In this field of the rolodex entry you should type the person's home phone number, or "private" if the person doesn't want his or her number publicized}
          168  +set helpTopics(.frame.6.entry) {In this field of the rolodex entry you should type the person's work phone number}
          169  +set helpTopics(.frame.7.entry) {In this field of the rolodex entry you should type the phone number for the person's FAX machine}
          170  +
          171  +set helpCmds(.frame.1.label) {set topic .frame.1.entry}
          172  +set helpCmds(.frame.2.label) {set topic .frame.2.entry}
          173  +set helpCmds(.frame.3.label) {set topic .frame.3.entry}
          174  +set helpCmds(.frame.4.label) {set topic .frame.4.entry}
          175  +set helpCmds(.frame.5.label) {set topic .frame.5.entry}
          176  +set helpCmds(.frame.6.label) {set topic .frame.6.entry}
          177  +set helpCmds(.frame.7.label) {set topic .frame.7.entry}
          178  +
          179  +set helpTopics(context) {Unfortunately, this application doesn't support context-sensitive help in the usual way, because when this demo was written Tk didn't have a grab mechanism and this is needed for context-sensitive help.  Instead, you can achieve much the same effect by simply moving the mouse over the window you're curious about and pressing the Help or F1 keys.  You can do this anytime.}
          180  +set helpTopics(help) {This application provides only very crude help.  Besides the entries in this menu, you can get help on individual windows by moving the mouse cursor over the window and pressing the Help or F1 keys.}
          181  +set helpTopics(window) {This window is a dummy rolodex application created as part of Tom LaStrange's toolkit benchmark.  It doesn't really do anything useful except to demonstrate a few features of the Tk toolkit.}
          182  +set helpTopics(keys) "The following accelerator keys are defined for this application (in addition to those already available for the entry windows):\n\nCtrl+A:\t\tAdd\nCtrl+C:\t\tClear\nCtrl+D:\t\tDelete\nCtrl+F:\t\tEnter file name\nCtrl+Q:\t\tExit application (quit)\nCtrl+S:\t\tSearch (dummy operation)"
          183  +set helpTopics(version) {This is version 1.0.}
          184  +
          185  +# Entries in "Help" menu
          186  +
          187  +.menu.help.m add command -label "On Context..." -command {Help context} \
          188  +	-underline 3
          189  +.menu.help.m add command -label "On Help..." -command {Help help} \
          190  +	-underline 3
          191  +.menu.help.m add command -label "On Window..." -command {Help window} \
          192  +	-underline 3
          193  +.menu.help.m add command -label "On Keys..." -command {Help keys} \
          194  +	-underline 3
          195  +.menu.help.m add command -label "On Version..." -command {Help version}  \
          196  +	-underline 3

Added library/demos/ruler.tcl version [be87d4b55c].

            1  +# ruler.tcl --
            2  +#
            3  +# This demonstration script creates a canvas widget that displays a ruler
            4  +# with tab stops that can be set, moved, and deleted.
            5  +#
            6  +# @(#) ruler.tcl 1.1 95/05/26 15:56:37
            7  +
            8  +# rulerMkTab --
            9  +# This procedure creates a new triangular polygon in a canvas to
           10  +# represent a tab stop.
           11  +#
           12  +# Arguments:
           13  +# c -		The canvas window.
           14  +# x, y -	Coordinates at which to create the tab stop.
           15  +
           16  +proc rulerMkTab {c x y} {
           17  +    upvar #0 demo_rulerInfo v
           18  +    $c create polygon $x $y [expr $x+$v(size)] [expr $y+$v(size)] \
           19  +	    [expr $x-$v(size)] [expr $y+$v(size)]
           20  +}
           21  +
           22  +set w .ruler
           23  +global tk_library
           24  +catch {destroy $w}
           25  +toplevel $w
           26  +wm title $w "Ruler Demonstration"
           27  +wm iconname $w "ruler"
           28  +positionWindow $w
           29  +set c $w.c
           30  +
           31  +label $w.msg -font $font -wraplength 5i -justify left -text "This canvas widget shows a mock-up of a ruler.  You can create tab stops by dragging them out of the well to the right of the ruler.  You can also drag existing tab stops.  If you drag a tab stop far enough up or down so that it turns dim, it will be deleted when you release the mouse button."
           32  +pack $w.msg -side top
           33  +
           34  +frame $w.buttons
           35  +pack  $w.buttons -side bottom -expand y -fill x -pady 2m
           36  +button $w.buttons.dismiss -text Dismiss -command "destroy $w"
           37  +button $w.buttons.code -text "See Code" -command "showCode $w"
           38  +pack $w.buttons.dismiss $w.buttons.code -side left -expand 1
           39  +
           40  +canvas $c -width 14.8c -height 2.5c
           41  +pack $w.c -side top -fill x
           42  +
           43  +set demo_rulerInfo(grid) .25c
           44  +set demo_rulerInfo(left) [winfo fpixels $c 1c]
           45  +set demo_rulerInfo(right) [winfo fpixels $c 13c]
           46  +set demo_rulerInfo(top) [winfo fpixels $c 1c]
           47  +set demo_rulerInfo(bottom) [winfo fpixels $c 1.5c]
           48  +set demo_rulerInfo(size) [winfo fpixels $c .2c]
           49  +set demo_rulerInfo(normalStyle) "-fill black"
           50  +if {[winfo depth $c] > 1} {
           51  +    set demo_rulerInfo(activeStyle) "-fill red -stipple {}"
           52  +    set demo_rulerInfo(deleteStyle) \
           53  +	    "-stipple @$tk_library/demos/images/grey.25 -fill red"
           54  +} else {
           55  +    set demo_rulerInfo(activeStyle) "-fill black -stipple {}"
           56  +    set demo_rulerInfo(deleteStyle) \
           57  +	    "-stipple @$tk_library/demos/images/grey.25 -fill black"
           58  +}
           59  +
           60  +$c create line 1c 0.5c 1c 1c 13c 1c 13c 0.5c -width 1
           61  +for {set i 0} {$i < 12} {incr i} {
           62  +    set x [expr $i+1]
           63  +    $c create line ${x}c 1c ${x}c 0.6c -width 1
           64  +    $c create line $x.25c 1c $x.25c 0.8c -width 1
           65  +    $c create line $x.5c 1c $x.5c 0.7c -width 1
           66  +    $c create line $x.75c 1c $x.75c 0.8c -width 1
           67  +    $c create text $x.15c .75c -text $i -anchor sw
           68  +}
           69  +$c addtag well withtag [$c create rect 13.2c 1c 13.8c 0.5c \
           70  +	-outline black -fill [lindex [$c config -bg] 4]]
           71  +$c addtag well withtag [rulerMkTab $c [winfo pixels $c 13.5c] \
           72  +	[winfo pixels $c .65c]]
           73  +
           74  +$c bind well <1> "rulerNewTab $c %x %y"
           75  +$c bind tab <1> "rulerSelectTab $c %x %y"
           76  +bind $c <B1-Motion> "rulerMoveTab $c %x %y"
           77  +bind $c <Any-ButtonRelease-1> "rulerReleaseTab $c"
           78  +
           79  +# rulerNewTab --
           80  +# Does all the work of creating a tab stop, including creating the
           81  +# triangle object and adding tags to it to give it tab behavior.
           82  +#
           83  +# Arguments:
           84  +# c -		The canvas window.
           85  +# x, y -	The coordinates of the tab stop.
           86  +
           87  +proc rulerNewTab {c x y} {
           88  +    upvar #0 demo_rulerInfo v
           89  +    $c addtag active withtag [rulerMkTab $c $x $y]
           90  +    $c addtag tab withtag active
           91  +    set v(x) $x
           92  +    set v(y) $y
           93  +    rulerMoveTab $c $x $y
           94  +}
           95  +
           96  +# rulerSelectTab --
           97  +# This procedure is invoked when mouse button 1 is pressed over
           98  +# a tab.  It remembers information about the tab so that it can
           99  +# be dragged interactively.
          100  +#
          101  +# Arguments:
          102  +# c -		The canvas widget.
          103  +# x, y -	The coordinates of the mouse (identifies the point by
          104  +#		which the tab was picked up for dragging).
          105  +
          106  +proc rulerSelectTab {c x y} {
          107  +    upvar #0 demo_rulerInfo v
          108  +    set v(x) [$c canvasx $x $v(grid)]
          109  +    set v(y) [expr $v(top)+2]
          110  +    $c addtag active withtag current
          111  +    eval "$c itemconf active $v(activeStyle)"
          112  +    $c raise active
          113  +}
          114  +
          115  +# rulerMoveTab --
          116  +# This procedure is invoked during mouse motion events to drag a tab.
          117  +# It adjusts the position of the tab, and changes its appearance if
          118  +# it is about to be dragged out of the ruler.
          119  +#
          120  +# Arguments:
          121  +# c -		The canvas widget.
          122  +# x, y -	The coordinates of the mouse.
          123  +
          124  +proc rulerMoveTab {c x y} {
          125  +    upvar #0 demo_rulerInfo v
          126  +    if {[$c find withtag active] == ""} {
          127  +	return
          128  +    }
          129  +    set cx [$c canvasx $x $v(grid)]
          130  +    set cy [$c canvasy $y]
          131  +    if {$cx < $v(left)} {
          132  +	set cx $v(left)
          133  +    }
          134  +    if {$cx > $v(right)} {
          135  +	set cx $v(right)
          136  +    }
          137  +    if {($cy >= $v(top)) && ($cy <= $v(bottom))} {
          138  +	set cy [expr $v(top)+2]
          139  +	eval "$c itemconf active $v(activeStyle)"
          140  +    } else {
          141  +	set cy [expr $cy-$v(size)-2]
          142  +	eval "$c itemconf active $v(deleteStyle)"
          143  +    }
          144  +    $c move active [expr $cx-$v(x)] [expr $cy-$v(y)]
          145  +    set v(x) $cx
          146  +    set v(y) $cy
          147  +}
          148  +
          149  +# rulerReleaseTab --
          150  +# This procedure is invoked during button release events that end
          151  +# a tab drag operation.  It deselects the tab and deletes the tab if
          152  +# it was dragged out of the ruler.
          153  +#
          154  +# Arguments:
          155  +# c -		The canvas widget.
          156  +# x, y -	The coordinates of the mouse.
          157  +
          158  +proc rulerReleaseTab c {
          159  +    upvar #0 demo_rulerInfo v
          160  +    if {[$c find withtag active] == {}} {
          161  +	return
          162  +    }
          163  +    if {$v(y) != [expr $v(top)+2]} {
          164  +	$c delete active
          165  +    } else {
          166  +	eval "$c itemconf active $v(normalStyle)"
          167  +	$c dtag active
          168  +    }
          169  +}

Added library/demos/sayings.tcl version [4ec96a731d].

            1  +# sayings.tcl --
            2  +#
            3  +# This demonstration script creates a listbox that can be scrolled
            4  +# both horizontally and vertically.  It displays a collection of
            5  +# well-known sayings.
            6  +#
            7  +# @(#) sayings.tcl 1.1 95/05/26 15:56:38
            8  +
            9  +set w .sayings
           10  +catch {destroy $w}
           11  +toplevel $w
           12  +wm title $w "Listbox Demonstration (well-known sayings)"
           13  +wm iconname $w "sayings"
           14  +positionWindow $w
           15  +
           16  +label $w.msg -font $font -wraplength 4i -justify left -text "The listbox below contains a collection of well-known sayings.  You can scan the list using either of the scrollbars or by dragging in the listbox window with button 2 pressed."
           17  +pack $w.msg -side top
           18  +
           19  +frame $w.buttons
           20  +pack  $w.buttons -side bottom -expand y -fill x -pady 2m
           21  +button $w.buttons.dismiss -text Dismiss -command "destroy $w"
           22  +button $w.buttons.code -text "See Code" -command "showCode $w"
           23  +pack $w.buttons.dismiss $w.buttons.code -side left -expand 1
           24  +
           25  +frame $w.frame -borderwidth 10
           26  +pack $w.frame -side top -expand yes -fill y
           27  +
           28  +scrollbar $w.frame.yscroll -command "$w.frame.list yview"
           29  +scrollbar $w.frame.xscroll -orient horizontal \
           30  +	-command "$w.frame.list xview"
           31  +listbox $w.frame.list -width 20 -height 10 -setgrid 1 \
           32  +	-yscroll "$w.frame.yscroll set" -xscroll "$w.frame.xscroll set"
           33  +pack $w.frame.yscroll -side right -fill y
           34  +pack $w.frame.xscroll -side bottom -fill x
           35  +pack $w.frame.list -expand yes -fill y
           36  +
           37  +$w.frame.list insert 0 "Waste not, want not" "Early to bed and early to rise makes a man healthy, wealthy, and wise" "Ask not what your country can do for you, ask what you can do for your country" "I shall return" "NOT" "A picture is worth a thousand words" "User interfaces are hard to build" "Thou shalt not steal" "A penny for your thoughts" "Fool me once, shame on you;  fool me twice, shame on me" "Every cloud has a silver lining" "Where there's smoke there's fire" "It takes one to know one" "Curiosity killed the cat" "Take this job and shove it" "Up a creek without a paddle" "I'm mad as hell and I'm not going to take it any more" "An apple a day keeps the doctor away" "Don't look a gift horse in the mouth"

Added library/demos/search.tcl version [85b27376bf].

            1  +# search.tcl --
            2  +#
            3  +# This demonstration script creates a collection of widgets that
            4  +# allow you to load a file into a text widget, then perform searches
            5  +# on that file.
            6  +#
            7  +# @(#) search.tcl 1.2 95/06/21 09:17:11
            8  +
            9  +# textLoadFile --
           10  +# This procedure below loads a file into a text widget, discarding
           11  +# the previous contents of the widget. Tags for the old widget are
           12  +# not affected, however.
           13  +#
           14  +# Arguments:
           15  +# w -		The window into which to load the file.  Must be a
           16  +#		text widget.
           17  +# file -	The name of the file to load.  Must be readable.
           18  +
           19  +proc textLoadFile {w file} {
           20  +    set f [open $file]
           21  +    $w delete 1.0 end
           22  +    while {![eof $f]} {
           23  +	$w insert end [read $f 10000]
           24  +    }
           25  +    close $f
           26  +}
           27  +
           28  +# textSearch --
           29  +# Search for all instances of a given string in a text widget and
           30  +# apply a given tag to each instance found.
           31  +#
           32  +# Arguments:
           33  +# w -		The window in which to search.  Must be a text widget.
           34  +# string -	The string to search for.  The search is done using
           35  +#		exact matching only;  no special characters.
           36  +# tag -		Tag to apply to each instance of a matching string.
           37  +
           38  +proc textSearch {w string tag} {
           39  +    $w tag remove search 0.0 end
           40  +    if {$string == ""} {
           41  +	return
           42  +    }
           43  +    set cur 1.0
           44  +    while 1 {
           45  +	set cur [$w search -count length $string $cur end]
           46  +	if {$cur == ""} {
           47  +	    break
           48  +	}
           49  +	$w tag add $tag $cur "$cur + $length char"
           50  +	set cur [$w index "$cur + $length char"]
           51  +    }
           52  +}
           53  +
           54  +# textToggle --
           55  +# This procedure is invoked repeatedly to invoke two commands at
           56  +# periodic intervals.  It normally reschedules itself after each
           57  +# execution but if an error occurs (e.g. because the window was
           58  +# deleted) then it doesn't reschedule itself.
           59  +#
           60  +# Arguments:
           61  +# cmd1 -	Command to execute when procedure is called.
           62  +# sleep1 -	Ms to sleep after executing cmd1 before executing cmd2.
           63  +# cmd2 -	Command to execute in the *next* invocation of this
           64  +#		procedure.
           65  +# sleep2 -	Ms to sleep after executing cmd2 before executing cmd1 again.
           66  +
           67  +proc textToggle {cmd1 sleep1 cmd2 sleep2} {
           68  +    catch {
           69  +	eval $cmd1
           70  +	after $sleep1 [list textToggle $cmd2 $sleep2 $cmd1 $sleep1]
           71  +    }
           72  +}
           73  +
           74  +set w .search
           75  +catch {destroy $w}
           76  +toplevel $w
           77  +wm title $w "Text Demonstration - Search and Highlight"
           78  +wm iconname $w "search"
           79  +positionWindow $w
           80  +
           81  +frame $w.buttons
           82  +pack  $w.buttons -side bottom -expand y -fill x -pady 2m
           83  +button $w.buttons.dismiss -text Dismiss -command "destroy $w"
           84  +button $w.buttons.code -text "See Code" -command "showCode $w"
           85  +pack $w.buttons.dismiss $w.buttons.code -side left -expand 1
           86  +
           87  +frame $w.file
           88  +label $w.file.label -text "File name:" -width 13 -anchor w
           89  +entry $w.file.entry -width 40 -textvariable fileName
           90  +button $w.file.button -text "Load File" \
           91  +	-command "textLoadFile $w.text \$fileName"
           92  +pack $w.file.label $w.file.entry -side left
           93  +pack $w.file.button -side left -pady 5 -padx 10
           94  +bind $w.file.entry <Return> "
           95  +    textLoadFile $w.text \$fileName
           96  +    focus $w.string.entry
           97  +"
           98  +focus $w.file.entry
           99  +
          100  +frame $w.string
          101  +label $w.string.label -text "Search string:" -width 13 -anchor w
          102  +entry $w.string.entry -width 40 -textvariable searchString
          103  +button $w.string.button -text "Highlight" \
          104  +	-command "textSearch $w.text \$searchString search"
          105  +pack $w.string.label $w.string.entry -side left
          106  +pack $w.string.button -side left -pady 5 -padx 10
          107  +bind $w.string.entry <Return> "textSearch $w.text \$searchString search"
          108  +
          109  +text $w.text -yscrollcommand "$w.scroll set" -setgrid true
          110  +scrollbar $w.scroll -command "$w.text yview"
          111  +pack $w.file $w.string -side top -fill x
          112  +pack $w.scroll -side right -fill y
          113  +pack $w.text -expand yes -fill both
          114  +
          115  +# Set up display styles for text highlighting.
          116  +
          117  +if {[winfo depth $w] > 1} {
          118  +    textToggle "$w.text tag configure search -background \
          119  +	    #ce5555 -foreground white" 800 "$w.text tag configure \
          120  +	    search -background {} -foreground {}" 200
          121  +} else {
          122  +    textToggle "$w.text tag configure search -background \
          123  +	    black -foreground white" 800 "$w.text tag configure \
          124  +	    search -background {} -foreground {}" 200
          125  +}
          126  +$w.text insert 1.0 \
          127  +{This window demonstrates how to use the tagging facilities in text
          128  +widgets to implement a searching mechanism.  First, type a file name
          129  +in the top entry, then type <Return> or click on "Load File".  Then
          130  +type a string in the lower entry and type <Return> or click on
          131  +"Load File".  This will cause all of the instances of the string to
          132  +be tagged with the tag "search", and it will arrange for the tag's
          133  +display attributes to change to make all of the strings blink.}
          134  +$w.text mark set insert 0.0
          135  +
          136  +set fileName ""
          137  +set searchString ""

Added library/demos/states.tcl version [99ae71d85d].

            1  +# states.tcl --
            2  +#
            3  +# This demonstration script creates a listbox widget that displays
            4  +# the names of the 50 states in the United States of America.
            5  +#
            6  +# @(#) states.tcl 1.1 95/05/26 15:56:39
            7  +
            8  +set w .states
            9  +catch {destroy $w}
           10  +toplevel $w
           11  +wm title $w "Listbox Demonstration (50 states)"
           12  +wm iconname $w "states"
           13  +positionWindow $w
           14  +
           15  +label $w.msg -font $font -wraplength 4i -justify left -text "A listbox containing the 50 states is displayed below, along with a scrollbar.  You can scan the list either using the scrollbar or by scanning.  To scan, press button 2 in the widget and drag up or down."
           16  +pack $w.msg -side top
           17  +
           18  +frame $w.buttons
           19  +pack  $w.buttons -side bottom -expand y -fill x -pady 2m
           20  +button $w.buttons.dismiss -text Dismiss -command "destroy $w"
           21  +button $w.buttons.code -text "See Code" -command "showCode $w"
           22  +pack $w.buttons.dismiss $w.buttons.code -side left -expand 1
           23  +
           24  +frame $w.frame -borderwidth .5c
           25  +pack $w.frame -side top -expand yes -fill y
           26  +
           27  +scrollbar $w.frame.scroll -command "$w.frame.list yview"
           28  +listbox $w.frame.list -yscroll "$w.frame.scroll set" -setgrid 1 -height 12
           29  +pack $w.frame.scroll -side right -fill y
           30  +pack $w.frame.list -side left -expand 1 -fill both
           31  +
           32  +$w.frame.list insert 0 Alabama Alaska Arizona Arkansas California \
           33  +    Colorado Connecticut Delaware Florida Georgia Hawaii Idaho Illinois \
           34  +    Indiana Iowa Kansas Kentucky Louisiana Maine Maryland \
           35  +    Massachusetts Michigan Minnesota Mississippi Missouri \
           36  +    Montana Nebraska Nevada "New Hampshire" "New Jersey" "New Mexico" \
           37  +    "New York" "North Carolina" "North Dakota" \
           38  +    Ohio Oklahoma Oregon Pennsylvania "Rhode Island" \
           39  +    "South Carolina" "South Dakota" \
           40  +    Tennessee Texas Utah Vermont Virginia Washington \
           41  +    "West Virginia" Wisconsin Wyoming

Added library/demos/stuff version [e1d38e4b07].

            1  +#!/usr/local/bin/cwish
            2  +#
            3  +# widget --
            4  +#
            5  +#	Test out CTk widgets.
            6  +#
            7  +
            8  +proc dialog {} {
            9  +    toplevel .panel
           10  +    listbox .panel.files -selectmode multiple -height 15 \
           11  +    	-yscrollcommand ".panel.scroll set"
           12  +    pack .panel.files -side left
           13  +    scrollbar .panel.scroll -command ".panel.files yview"
           14  +    pack .panel.scroll -side left -fill y
           15  +    foreach file [lsort [glob *]] {
           16  +    	.panel.files insert end $file
           17  +    }
           18  +    button .panel.ok -text OK -command {
           19  +    	set label OK
           20  +    	destroy .panel
           21  +    }
           22  +    button .panel.cancel -text Cancel -command {
           23  +    	set label Cancel
           24  +    	destroy .panel
           25  +    }
           26  +    pack .panel.ok -side left
           27  +    pack .panel.cancel -side right
           28  +
           29  +    set prior [focus]
           30  +    grab set .panel
           31  +    focus .panel.ok
           32  +    tkwait window .panel
           33  +    catch {focus $prior}
           34  +}
           35  +
           36  +#
           37  +# Create the menu bar
           38  +#
           39  +frame .menu
           40  +pack .menu -side top -fill x
           41  +
           42  +menubutton .menu.file -text "File" -menu .menu.file.m -underline 0
           43  +menu .menu.file.m
           44  +.menu.file.m add command -label "Open.." -underline 0
           45  +.menu.file.m add command -label "Close" -underline 0
           46  +.menu.file.m add command -label "Print" -underline 0
           47  +.menu.file.m add cascade -label "More" -underline 0 -menu .menu.file.m.more
           48  +.menu.file.m add cascade -label "More2" -underline 4 -menu .menu.file.m.more2
           49  +.menu.file.m add command -label "Exit" -underline 0 -command exit
           50  +menu .menu.file.m.more
           51  +.menu.file.m.more add radiobutton -label "I" -variable more -value 1
           52  +.menu.file.m.more add radiobutton -label "II" -variable more -value 2
           53  +.menu.file.m.more add radiobutton -label "III" -variable more -value 3
           54  +.menu.file.m.more add radiobutton -label "IV" -variable more -value 4
           55  +menu .menu.file.m.more2
           56  +.menu.file.m.more2 add radiobutton -label "A" -variable more2 -value 1
           57  +.menu.file.m.more2 add radiobutton -label "B" -variable more2 -value 2
           58  +.menu.file.m.more2 add radiobutton -label "C" -variable more2 -value 3
           59  +.menu.file.m.more2 add radiobutton -label "D" -variable more2 -value 4
           60  +
           61  +menubutton .menu.edit -text "Edit" -menu .menu.edit.m -underline 0
           62  +menu .menu.edit.m
           63  +.menu.edit.m add command -label "Undo" -underline 0
           64  +.menu.edit.m add separator
           65  +.menu.edit.m add command -label "Cut" -underline 2
           66  +.menu.edit.m add command -label "Copy" -underline 0
           67  +.menu.edit.m add command -label "Paste" -underline 0
           68  +
           69  +pack .menu.file .menu.edit -side left
           70  +
           71  +#
           72  +# Some buttons
           73  +#
           74  +button .hi -text hello -command dialog
           75  +label .junk -text "args: $argv"
           76  +tk_optionMenu .option stooges Larry Curly Moe Shemp
           77  +button .bye -text "Goodbye Cruel World" -underline 0 -wraplength 1i \
           78  +	-command exit -borderwidth 2m
           79  +button .unpack -text Unpack -command {pack forget .font}
           80  +button .pack -text Pack -command {pack .font -after .pack}
           81  +pack .hi .junk .option .bye .unpack .pack
           82  +
           83  +#
           84  +# A radio box
           85  +#
           86  +frame .font
           87  +pack .font
           88  +radiobutton .times -text Times -variable font -value times -anchor w
           89  +radiobutton .helvetica -text Helvetica -variable font -value helvetica -anchor w
           90  +radiobutton .courier -text Courier -variable font -value courier -anchor w
           91  +radiobutton .symbol -text Symbol -variable font -value symbol -anchor w
           92  +pack .times .helvetica .courier .symbol -in .font -side top -fill x
           93  +label .fontlabel -textvariable font
           94  +pack .fontlabel -in .font -side top
           95  +set font times
           96  +
           97  +#
           98  +# And an entry field
           99  +#
          100  +frame .field
          101  +label .label -text "Entry:"
          102  +entry .entry -width 20 -justify center
          103  +label .copy
          104  +pack .label .entry .copy -in .field -side left
          105  +
          106  +#
          107  +# A text widget
          108  +#
          109  +frame .src
          110  +text .src.text -yscrollcommand ".src.scroll set" -wrap none -width 40 -height 15
          111  +scrollbar .src.scroll -command ".src.text yview" -takefocus 1
          112  +pack .src.scroll -side right -fill y
          113  +pack .src.text -side left
          114  +.src.text delete 1.0 end
          115  +set f [open /etc/passwd]
          116  +while {![eof $f]} {
          117  +    .src.text insert end [read $f 1000]
          118  +}
          119  +close $f
          120  +.src.text tag add head 1.0 3.end
          121  +.src.text tag configure head -underline 1
          122  +.src.text mark set insert 1.0
          123  +
          124  +pack .font .field .src -side left
          125  +
          126  +
          127  +focus .hi

Added library/demos/style.tcl version [e12ef5295c].

            1  +# style.tcl --
            2  +#
            3  +# This demonstration script creates a text widget that illustrates the
            4  +# various display styles that may be set for tags.
            5  +#
            6  +# @(#) style.tcl 1.2 95/06/15 13:17:04
            7  +
            8  +set w .style
            9  +catch {destroy $w}
           10  +toplevel $w
           11  +wm title $w "Text Demonstration - Display Styles"
           12  +wm iconname $w "style"
           13  +positionWindow $w
           14  +
           15  +frame $w.buttons
           16  +pack  $w.buttons -side bottom -expand y -fill x -pady 2m
           17  +button $w.buttons.dismiss -text Dismiss -command "destroy $w"
           18  +button $w.buttons.code -text "See Code" -command "showCode $w"
           19  +pack $w.buttons.dismiss $w.buttons.code -side left -expand 1
           20  +
           21  +text $w.text -yscrollcommand "$w.scroll set" -setgrid true \
           22  +	-width 70 -height 32 -wrap word
           23  +scrollbar $w.scroll -command "$w.text yview"
           24  +pack $w.scroll -side right -fill y
           25  +pack $w.text -expand yes -fill both
           26  +
           27  +# Set up display styles
           28  +
           29  +$w.text tag configure bold -font -*-Courier-Bold-O-Normal--*-120-*-*-*-*-*-*
           30  +$w.text tag configure big -font -*-Courier-Bold-R-Normal--*-140-*-*-*-*-*-*
           31  +$w.text tag configure verybig -font \
           32  +	-*-Helvetica-Bold-R-Normal--*-240-*-*-*-*-*-*
           33  +if {[winfo depth $w] > 1} {
           34  +    $w.text tag configure color1 -background #a0b7ce
           35  +    $w.text tag configure color2 -foreground red
           36  +    $w.text tag configure raised -relief raised -borderwidth 1
           37  +    $w.text tag configure sunken -relief sunken -borderwidth 1
           38  +} else {
           39  +    $w.text tag configure color1 -background black -foreground white
           40  +    $w.text tag configure color2 -background black -foreground white
           41  +    $w.text tag configure raised -background white -relief raised \
           42  +	    -borderwidth 1
           43  +    $w.text tag configure sunken -background white -relief sunken \
           44  +	    -borderwidth 1
           45  +}
           46  +$w.text tag configure bgstipple -background black -borderwidth 0 \
           47  +	-bgstipple gray25
           48  +$w.text tag configure fgstipple -fgstipple gray50
           49  +$w.text tag configure underline -underline on
           50  +$w.text tag configure overstrike -overstrike on
           51  +$w.text tag configure right -justify right
           52  +$w.text tag configure center -justify center
           53  +$w.text tag configure super -offset 4p \
           54  +	-font -Adobe-Courier-Medium-R-Normal--*-100-*-*-*-*-*-*
           55  +$w.text tag configure sub -offset -2p \
           56  +	-font -Adobe-Courier-Medium-R-Normal--*-100-*-*-*-*-*-*
           57  +$w.text tag configure margins -lmargin1 12m -lmargin2 6m -rmargin 10m
           58  +$w.text tag configure spacing -spacing1 10p -spacing2 2p \
           59  +	-lmargin1 12m -lmargin2 6m -rmargin 10m
           60  +
           61  +$w.text insert end {Text widgets like this one allow you to display information in a
           62  +variety of styles.  Display styles are controlled using a mechanism
           63  +called }
           64  +$w.text insert end tags bold
           65  +$w.text insert end {. Tags are just textual names that you can apply to one
           66  +or more ranges of characters within a text widget.  You can configure
           67  +tags with various display styles.  If you do this, then the tagged
           68  +characters will be displayed with the styles you chose.  The
           69  +available display styles are:
           70  +}
           71  +$w.text insert end "\n1. Font." big
           72  +$w.text insert end "  You can choose any X font, "
           73  +$w.text insert end large verybig
           74  +$w.text insert end " or "
           75  +$w.text insert end "small.\n"
           76  +$w.text insert end "\n2. Color." big
           77  +$w.text insert end "  You can change either the "
           78  +$w.text insert end background color1
           79  +$w.text insert end " or "
           80  +$w.text insert end foreground color2
           81  +$w.text insert end "\ncolor, or "
           82  +$w.text insert end both {color1 color2}
           83  +$w.text insert end ".\n"
           84  +$w.text insert end "\n3. Stippling." big
           85  +$w.text insert end "  You can cause either the "
           86  +$w.text insert end background bgstipple
           87  +$w.text insert end " or "
           88  +$w.text insert end foreground fgstipple
           89  +$w.text insert end {
           90  +information to be drawn with a stipple fill instead of a solid fill.
           91  +}
           92  +$w.text insert end "\n4. Underlining." big
           93  +$w.text insert end "  You can "
           94  +$w.text insert end underline underline
           95  +$w.text insert end " ranges of text.\n"
           96  +$w.text insert end "\n5. Overstrikes." big
           97  +$w.text insert end "  You can "
           98  +$w.text insert end "draw lines through" overstrike
           99  +$w.text insert end " ranges of text.\n"
          100  +$w.text insert end "\n6. 3-D effects." big
          101  +$w.text insert end {  You can arrange for the background to be drawn
          102  +with a border that makes characters appear either }
          103  +$w.text insert end raised raised
          104  +$w.text insert end " or "
          105  +$w.text insert end sunken sunken
          106  +$w.text insert end ".\n"
          107  +$w.text insert end "\n7. Justification." big
          108  +$w.text insert end " You can arrange for lines to be displayed\n"
          109  +$w.text insert end "left-justified,\n"
          110  +$w.text insert end "right-justified, or\n" right
          111  +$w.text insert end "centered.\n" center
          112  +$w.text insert end "\n8. Superscripts and subscripts."  big
          113  +$w.text insert end " You can control the vertical\n"
          114  +$w.text insert end "position of text to generate superscript effects like 10"
          115  +$w.text insert end "n" super
          116  +$w.text insert end " or\nsubscript effects like X"
          117  +$w.text insert end "i" sub
          118  +$w.text insert end ".\n"
          119  +$w.text insert end "\n9. Margins." big
          120  +$w.text insert end " You can control the amount of extra space left"
          121  +$w.text insert end " on\neach side of the text:\n"
          122  +$w.text insert end "This paragraph is an example of the use of " margins
          123  +$w.text insert end "margins.  It consists of a single line of text " margins
          124  +$w.text insert end "that wraps around on the screen.  There are two " margins
          125  +$w.text insert end "separate left margin values, one for the first " margins
          126  +$w.text insert end "display line associated with the text line, " margins
          127  +$w.text insert end "and one for the subsequent display lines, which " margins
          128  +$w.text insert end "occur because of wrapping.  There is also a " margins
          129  +$w.text insert end "separate specification for the right margin, " margins
          130  +$w.text insert end "which is used to choose wrap points for lines.\n" margins
          131  +$w.text insert end "\n10. Spacing." big
          132  +$w.text insert end " You can control the spacing of lines with three\n"
          133  +$w.text insert end "separate parameters.  \"Spacing1\" tells how much "
          134  +$w.text insert end "extra space to leave\nabove a line, \"spacing3\" "
          135  +$w.text insert end "tells how much space to leave below a line,\nand "
          136  +$w.text insert end "if a text line wraps, \"spacing2\" tells how much "
          137  +$w.text insert end "space to leave\nbetween the display lines that "
          138  +$w.text insert end "make up the text line.\n"
          139  +$w.text insert end "These indented paragraphs illustrate how spacing " spacing
          140  +$w.text insert end "can be used.  Each paragraph is actually a " spacing
          141  +$w.text insert end "single line in the text widget, which is " spacing
          142  +$w.text insert end "word-wrapped by the widget.\n" spacing
          143  +$w.text insert end "Spacing1 is set to 10 points for this text, " spacing
          144  +$w.text insert end "which results in relatively large gaps between " spacing
          145  +$w.text insert end "the paragraphs.  Spacing2 is set to 2 points, " spacing
          146  +$w.text insert end "which results in just a bit of extra space " spacing
          147  +$w.text insert end "within a pararaph.  Spacing3 isn't used " spacing
          148  +$w.text insert end "in this example.\n" spacing
          149  +$w.text insert end "To see where the space is, select ranges of " spacing
          150  +$w.text insert end "text within these paragraphs.  The selection " spacing
          151  +$w.text insert end "highlight will cover the extra space." spacing

Added library/demos/text.tcl version [d3587fe242].

            1  +# text.tcl --
            2  +#
            3  +# This demonstration script creates a text widget that describes
            4  +# the basic editing functions.
            5  +#
            6  +# @(#) text.tcl 1.3 95/06/21 09:09:55
            7  +
            8  +set w .text
            9  +catch {destroy $w}
           10  +toplevel $w
           11  +wm title $w "Text Demonstration - Basic Facilities"
           12  +wm iconname $w "text"
           13  +positionWindow $w
           14  +
           15  +frame $w.buttons
           16  +pack  $w.buttons -side bottom -expand y -fill x -pady 2m
           17  +button $w.buttons.dismiss -text Dismiss -command "destroy $w"
           18  +button $w.buttons.code -text "See Code" -command "showCode $w"
           19  +pack $w.buttons.dismiss $w.buttons.code -side left -expand 1
           20  +
           21  +text $w.text -relief sunken -bd 2 -yscrollcommand "$w.scroll set" -setgrid 1 \
           22  +	-height 30
           23  +scrollbar $w.scroll -command "$w.text yview"
           24  +pack $w.scroll -side right -fill y
           25  +pack $w.text -expand yes -fill both
           26  +$w.text insert 0.0 \
           27  +{This window is a text widget.  It displays one or more lines of text
           28  +and allows you to edit the text.  Here is a summary of the things you
           29  +can do to a text widget:
           30  +
           31  +1. Scrolling. Use the scrollbar to adjust the view in the text window.
           32  +
           33  +2. Scanning. Press mouse button 2 in the text window and drag up or down.
           34  +This will drag the text at high speed to allow you to scan its contents.
           35  +
           36  +3. Insert text. Press mouse button 1 to set the insertion cursor, then
           37  +type text.  What you type will be added to the widget.
           38  +
           39  +4. Select. Press mouse button 1 and drag to select a range of characters.
           40  +Once you've released the button, you can adjust the selection by pressing
           41  +button 1 with the shift key down.  This will reset the end of the
           42  +selection nearest the mouse cursor and you can drag that end of the
           43  +selection by dragging the mouse before releasing the mouse button.
           44  +You can double-click to select whole words or triple-click to select
           45  +whole lines.
           46  +
           47  +5. Delete and replace. To delete text, select the characters you'd like
           48  +to delete and type Backspace or Delete.  Alternatively, you can type new
           49  +text, in which case it will replace the selected text.
           50  +
           51  +6. Copy the selection. To copy the selection into this window, select
           52  +what you want to copy (either here or in another application), then
           53  +click button 2 to copy the selection to the point of the mouse cursor.
           54  +
           55  +7. Edit.  Text widgets support the standard Motif editing characters
           56  +plus many Emacs editing characters.  Backspace and Control-h erase the
           57  +character to the left of the insertion cursor.  Delete and Control-d
           58  +erase the character to the right of the insertion cursor.  Meta-backspace
           59  +deletes the word to the left of the insertion cursor, and Meta-d deletes
           60  +the word to the right of the insertion cursor.  Control-k deletes from
           61  +the insertion cursor to the end of the line, or it deletes the newline
           62  +character if that is the only thing left on the line.  Control-o opens
           63  +a new line by inserting a newline character to the right of the insertion
           64  +cursor.  Control-t transposes the two characters on either side of the
           65  +insertion cursor.
           66  +
           67  +7. Resize the window.  This widget has been configured with the "setGrid"
           68  +option on, so that if you resize the window it will always resize to an
           69  +even number of characters high and wide.  Also, if you make the window
           70  +narrow you can see that long lines automatically wrap around onto
           71  +additional lines so that all the information is always visible.}
           72  +$w.text mark set insert 0.0

Added library/demos/widget version [f4e0db3b40].

            1  +#!/bin/sh
            2  +# the next line restarts using wish \
            3  +exec cwish "$0" "$@"
            4  +
            5  +# widget --