
TK_PATCHES -   02/20/2000

This patch file updates from Tk 8.3.0 to Tk 8.3.0+. It should be applied
by running the "patch" program in the top-level directory of a clean
Tk 8.3.0 release, using the command "patch -p0 <TK_PATCHES"

If you are using Solaris, don't be surprised if the patch utility does not
work. This is a known problem. Better install GNU patch version 2.1 or later.

Prereq: "8.3.0"
*** generic/tk.h.orig	Tue Feb  8 12:31:32 2000
--- generic/tk.h	Wed Feb 16 23:08:40 2000
***************
*** 50,56 ****
  #define TK_RELEASE_SERIAL  0
  
  #define TK_VERSION	"8.3"
! #define TK_PATCH_LEVEL	"8.3.0"
  
  /*
   * The following definitions set up the proper options for Macintosh
--- 50,56 ----
  #define TK_RELEASE_SERIAL  0
  
  #define TK_VERSION	"8.3"
! #define TK_PATCH_LEVEL	"8.3.0+"
  
  /*
   * The following definitions set up the proper options for Macintosh
***************
*** 97,102 ****
--- 97,105 ----
  
  #ifdef XNQueryInputStyle
  #define TK_USE_INPUT_METHODS
+ #ifdef I18N_IMPROVE
+ #include <X11/Xlocale.h>
+ #endif /* I18N_IMPROVE */
  #endif
  
  /*
***************
*** 1356,1366 ****
   */
  
  #include "tkDecls.h"
- 
- /*
-  * Tcl commands exported by Tk:
-  */
- 
  
  #endif /* RESOURCE_INCLUDED */
  
--- 1359,1364 ----
*** pluspatch.orig	Sun Feb 20 12:42:57 2000
--- pluspatch	Wed Feb 16 23:08:40 2000
***************
*** 0 ****
--- 1,60 ----
+ #!/bin/sh
+ # The next line restarts using tclsh8.3 \
+ exec tclsh8.3 $0 ${1+"$@"}
+ 
+ set dirs ". ./unix ./library ./generic ./tests ./doc ./mac ./win ./win/rc"
+ set package "+"
+ set version "8.3.0"
+ set date [clock format [clock seconds] -format {%m/%d/%Y}]
+ 
+ #
+ # This is a tcl-script that will search a list of directories
+ # for ".orig"-files. For all of these it will make a "diff",
+ # and create a patch-file.
+ #
+ #	Written by:	Jan Nijtmans
+ #			CMG (Computer Managemeng Group) Arnhem B.V.
+ #			email: j.nijtmans@chello.nl (private)
+ #			       jan.nijtmans@cmg.nl (work)
+ #			url:   http://purl.oclc.org/net/nijtmans/
+ 
+ set patchlevel ""
+ set dfiles ""
+ 
+ set file [open pluspatch.orig w]
+ close $file
+ 
+ foreach dir $dirs {
+     set files [eval exec ls $dir]
+     foreach file $files {
+ 	if {[regexp ".*\.orig" $file]} {
+ 	    set file $dir/[string range $file 0 [expr [string length $file]-6]]
+ 	    if {$file=="$dir/tk.h"} {
+ 		set patchlevel $file.diff
+ 	    } else {
+ 		lappend dfiles $file.diff
+ 	    }
+ 	    set file [string range $file 2 [string length $file]]
+ 	    puts stdout "creating $file.diff"
+ 	    catch "exec diff -c $file.orig $file >$file.diff"
+ 	}
+     }
+ }
+ 
+ puts stdout "creating TK_PATCHES"
+ set file [open TK_PATCHES w]
+ puts $file "
+ TK_PATCHES -   $date
+ 
+ This patch file updates from Tk ${version} to Tk ${version}${package}. It should be applied
+ by running the \"patch\" program in the top-level directory of a clean
+ Tk ${version} release, using the command \"patch -p0 <TK_PATCHES\"
+ 
+ If you are using Solaris, don't be surprised if the patch utility does not
+ work. This is a known problem. Better install GNU patch version 2.1 or later.
+ 
+ Prereq: \"${version}\"
+ [eval exec cat $patchlevel $dfiles]"
+ close $file
+ 
+ file delete pluspatch.diff pluspatch.orig
*** unix/Makefile.in.orig	Thu Feb 10 12:11:01 2000
--- unix/Makefile.in	Sun Feb 20 12:39:43 2000
***************
*** 41,47 ****
  TK_LIBRARY =		$(prefix)/lib/tk$(VERSION)
  
  # Path name to use when installing library scripts:
! SCRIPT_INSTALL_DIR =	$(INSTALL_ROOT)/$(TK_LIBRARY)
  
  # Directory in which to install the .a or .so binary for the Tk library:
  LIB_INSTALL_DIR =	$(INSTALL_ROOT)$(exec_prefix)/lib
--- 41,47 ----
  TK_LIBRARY =		$(prefix)/lib/tk$(VERSION)
  
  # Path name to use when installing library scripts:
! SCRIPT_INSTALL_DIR =	$(INSTALL_ROOT)$(TK_LIBRARY)
  
  # Directory in which to install the .a or .so binary for the Tk library:
  LIB_INSTALL_DIR =	$(INSTALL_ROOT)$(exec_prefix)/lib
***************
*** 83,88 ****
--- 83,89 ----
  
  # The linker flags needed to link in the Tcl library (ex: -ltcl8.2)
  TCL_LIB_FLAG =		@TCL_LIB_FLAG@
+ TCL_STUB_LIB_FLAG =	@TCL_STUB_LIB_FLAG@
  
  # Libraries built with optimization switches have this additional extension
  TK_DBGX =		@TK_DBGX@
***************
*** 182,192 ****
--- 183,197 ----
  
  #TCL_LIB_SPEC = @TCL_BUILD_LIB_SPEC@
  TCL_LIB_SPEC = @TCL_LIB_SPEC@
+ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@
  TK_EXP_FILE = @TK_EXP_FILE@
  TK_BUILD_EXP_FILE = @TK_BUILD_EXP_FILE@
  
  TCL_STUB_FLAGS = @TCL_STUB_FLAGS@
  
+ TEST_LIB = Tktest@SHLIB_SUFFIX@
+ SQUARE_LIB = Tksquare@SHLIB_SUFFIX@
+ 
  # Libraries to use when linking.  This definition is determined by the
  # configure script.
  LIBS = @LIBS@ $(X11_LIB_SWITCHES) @DL_LIBS@ @MATH_LIBS@ -lc
***************
*** 211,217 ****
  # modify any of this stuff by hand.
  #----------------------------------------------------------------
  
! AC_FLAGS =		@EXTRA_CFLAGS@ @DEFS@
  RANLIB =		@RANLIB@
  SRC_DIR =		@srcdir@/..
  TOP_DIR =		@srcdir@/..
--- 216,223 ----
  # modify any of this stuff by hand.
  #----------------------------------------------------------------
  
! AC_FLAGS =		@EXTRA_CFLAGS@ @DEFS@ @X11_IMAKE_FLAGS@ \
! 	-DI18N_IMPROVE @CPPFLAGS@
  RANLIB =		@RANLIB@
  SRC_DIR =		@srcdir@/..
  TOP_DIR =		@srcdir@/..
***************
*** 248,254 ****
  WISH_OBJS = tkAppInit.o
  
  TCLTEST_OBJS = ${TCL_BIN_DIR}/tclTest.o ${TCL_BIN_DIR}/tclThreadTest.o \
!         ${TCL_BIN_DIR}/tclUnixTest.o
  TKTEST_OBJS = $(TCLTEST_OBJS) tkTestInit.o tkTest.o tkSquare.o
  
  WIDGOBJS = tkButton.o tkEntry.o tkFrame.o tkListbox.o \
--- 254,262 ----
  WISH_OBJS = tkAppInit.o
  
  TCLTEST_OBJS = ${TCL_BIN_DIR}/tclTest.o ${TCL_BIN_DIR}/tclThreadTest.o \
!         ${TCL_BIN_DIR}/tclUnixTest.o ${TCL_BIN_DIR}/tclTestObj.o \
!         ${TCL_BIN_DIR}/tclTestProcBodyObj.o
! 
  TKTEST_OBJS = $(TCLTEST_OBJS) tkTestInit.o tkTest.o tkSquare.o
  
  WIDGOBJS = tkButton.o tkEntry.o tkFrame.o tkListbox.o \
***************
*** 268,274 ****
  	tkUnixCursor.o tkUnixDraw.o tkUnixEmbed.o tkUnixEvent.o \
  	tkUnixFocus.o tkUnixFont.o tkUnixInit.o tkUnixKey.o tkUnixMenu.o \
  	tkUnixMenubu.o tkUnixScale.o tkUnixScrlbr.o tkUnixSelect.o \
! 	tkUnixSend.o tkUnixWm.o tkUnixXId.o tkStubInit.o tkStubLib.o
  
  STUB_LIB_OBJS = tkStubLib.o tkStubImg.o
  
--- 276,283 ----
  	tkUnixCursor.o tkUnixDraw.o tkUnixEmbed.o tkUnixEvent.o \
  	tkUnixFocus.o tkUnixFont.o tkUnixInit.o tkUnixKey.o tkUnixMenu.o \
  	tkUnixMenubu.o tkUnixScale.o tkUnixScrlbr.o tkUnixSelect.o \
! 	tkUnixSend.o tkUnixWm.o tkUnixXId.o tkStubInit.o tkStubLib.o \
! 	tkUnixIm.o
  
  STUB_LIB_OBJS = tkStubLib.o tkStubImg.o
  
***************
*** 330,335 ****
--- 339,345 ----
  	$(UNIX_DIR)/tkUnixEmbed.c $(UNIX_DIR)/tkUnixEvent.c \
  	$(UNIX_DIR)/tkUnixFocus.c \
  	$(UNIX_DIR)/tkUnixFont.c $(UNIX_DIR)/tkUnixInit.c \
+ 	$(UNIX_DIR)/tkUnixIm.c \
  	$(UNIX_DIR)/tkUnixKey.c \
  	$(UNIX_DIR)/tkUnixMenu.c $(UNIX_DIR)/tkUnixMenubu.c \
  	$(UNIX_DIR)/tkUnixScale.c $(UNIX_DIR)/tkUnixScrlbr.c \
***************
*** 368,373 ****
--- 378,391 ----
  	@MAKE_STUB_LIB@
  	$(RANLIB) ${STUB_LIB_FILE}
  
+ ${TEST_LIB}:	tkTest.o ${STUB_LIB_FILE}
+ 	${SHLIB_LD} -o $@ tkTest.o $(TK_LD_SEARCH_FLAGS) ${STUB_LIB_FILE} \
+ 		${TCL_STUB_LIB_SPEC} ${LIBS}
+ 
+ ${SQUARE_LIB}:	tkSquare.o ${STUB_LIB_FILE}
+ 	${SHLIB_LD} -o $@ tkSquare.o $(TK_LD_SEARCH_FLAGS) ${STUB_LIB_FILE} \
+ 		${TCL_STUB_LIB_SPEC} ${LIBS}
+ 
  # Make target which outputs the list of the .o contained in the Tk lib
  # usefull to build a single big shared library containing Tcl/Tk and other
  # extensions.  used for the Tcl Plugin.  -- dl
***************
*** 425,431 ****
  # possible (e.g. if installing as root).
  
  install-binaries: $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) $(TK_BUILD_EXP_FILE) wish
! 	@for i in $(LIB_INSTALL_DIR) $(BIN_INSTALL_DIR) ; \
  	    do \
  	    if [ ! -d $$i ] ; then \
  		echo "Making directory $$i"; \
--- 443,449 ----
  # possible (e.g. if installing as root).
  
  install-binaries: $(TK_LIB_FILE) $(TK_STUB_LIB_FILE) $(TK_BUILD_EXP_FILE) wish
! 	@for i in $(LIB_INSTALL_DIR) $(BIN_INSTALL_DIR) $(SCRIPT_INSTALL_DIR); \
  	    do \
  	    if [ ! -d $$i ] ; then \
  		echo "Making directory $$i"; \
***************
*** 444,449 ****
--- 462,469 ----
  	@$(INSTALL_DATA) $(TK_LIB_FILE) $(LIB_INSTALL_DIR)/$(TK_LIB_FILE)
  	@(cd $(LIB_INSTALL_DIR); $(RANLIB) $(TK_LIB_FILE))
  	@chmod 555 $(LIB_INSTALL_DIR)/$(TK_LIB_FILE)
+ 	@echo "Installing pkgIndex.tcl"
+ 	@$(INSTALL_DATA) pkgIndex.tk $(SCRIPT_INSTALL_DIR)/pkgIndex.tcl
  	@echo "Installing wish as $(BIN_INSTALL_DIR)/wish$(VERSION)"
  	@$(INSTALL_PROGRAM) wish $(BIN_INSTALL_DIR)/wish$(VERSION)
  	@echo "Installing tkConfig.sh to $(LIB_INSTALL_DIR)/"
***************
*** 552,558 ****
  		    $$i > $(MAN3_INSTALL_DIR)/$$i; \
  	    chmod 444 $(MAN3_INSTALL_DIR)/$$i; \
  	    done;
! 	@echo "Cross-linking top-level (.3) docs";
  	@$(UNIX_DIR)/mkLinks $(MAN3_INSTALL_DIR)
  	@echo "Installing command (.n) docs";
  	@cd $(SRC_DIR)/doc; for i in *.n; \
--- 572,578 ----
  		    $$i > $(MAN3_INSTALL_DIR)/$$i; \
  	    chmod 444 $(MAN3_INSTALL_DIR)/$$i; \
  	    done;
! 	@echo "Cross-linking C API (.3) docs";
  	@$(UNIX_DIR)/mkLinks $(MAN3_INSTALL_DIR)
  	@echo "Installing command (.n) docs";
  	@cd $(SRC_DIR)/doc; for i in *.n; \
***************
*** 576,581 ****
--- 596,613 ----
  	rm -f Makefile config.status config.cache config.log tkConfig.sh \
  		$(PACKAGE).* prototype
  
+ patchclean:	modeclean
+ 	@for i in .. ../generic ../doc ../unix ../mac ../win \
+ 		../library ../win/rc ../tests ;do \
+ 	    echo "removing $$i/*.orig and $$i/*.diff"; \
+ 	    rm -f $$i/*.orig $$i/*.diff; \
+ 	done;
+ 	rm -f ../*patch*
+ 
+ modeclean:
+ 	chmod u-w ../changes ../library/*.tcl ../tests/*.test
+ 	chmod u-w ../doc/*.n ../generic/*.c ../win/rc/*.rc
+ 
  depend:
  	makedepend -- $(DEPEND_SWITCHES) -- $(SRCS)
  
***************
*** 719,725 ****
  	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkScrollbar.c
  
  tkSquare.o: $(GENERIC_DIR)/tkSquare.c
! 	$(CC) -c $(CC_SWITCHES_NO_STUBS) $(GENERIC_DIR)/tkSquare.c
  
  tkCanvas.o: $(GENERIC_DIR)/tkCanvas.c
  	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkCanvas.c
--- 751,757 ----
  	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkScrollbar.c
  
  tkSquare.o: $(GENERIC_DIR)/tkSquare.c
! 	$(CC) -c $(CC_SWITCHES) -DUSE_TK_STUBS $(GENERIC_DIR)/tkSquare.c
  
  tkCanvas.o: $(GENERIC_DIR)/tkCanvas.c
  	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkCanvas.c
***************
*** 773,779 ****
  	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkImgPhoto.c
  
  tkTest.o: $(GENERIC_DIR)/tkTest.c
! 	$(CC) -c $(CC_SWITCHES_NO_STUBS) $(GENERIC_DIR)/tkTest.c
  
  tkText.o: $(GENERIC_DIR)/tkText.c
  	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkText.c
--- 805,811 ----
  	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkImgPhoto.c
  
  tkTest.o: $(GENERIC_DIR)/tkTest.c
! 	$(CC) -c $(CC_SWITCHES) -DUSE_TK_STUBS $(GENERIC_DIR)/tkTest.c
  
  tkText.o: $(GENERIC_DIR)/tkText.c
  	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkText.c
***************
*** 843,848 ****
--- 875,883 ----
  
  tkUnixFont.o: $(UNIX_DIR)/tkUnixFont.c
  	$(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tkUnixFont.c
+ 
+ tkUnixIm.o: $(UNIX_DIR)/tkUnixIm.c
+ 	$(CC) -c $(CC_SWITCHES) $(UNIX_DIR)/tkUnixIm.c
  
  tkUnixInit.o: $(UNIX_DIR)/tkUnixInit.c $(GENERIC_DIR)/tkInitScript.h tkConfig.sh
  	$(CC) -c $(CC_SWITCHES) -DTK_LIBRARY=\"${TK_LIBRARY}\" \
*** unix/aclocal.m4.orig	Thu Feb 10 12:11:02 2000
--- unix/aclocal.m4	Wed Feb 16 23:08:41 2000
***************
*** 567,573 ****
      CFLAGS_DEBUG=-g
      CFLAGS_OPTIMIZE=-O
      if test "$using_gcc" = "yes" ; then
! 	CFLAGS_WARNING="-Wall -Wconversion -Wno-implicit-int"
      else
  	CFLAGS_WARNING=""
      fi
--- 567,573 ----
      CFLAGS_DEBUG=-g
      CFLAGS_OPTIMIZE=-O
      if test "$using_gcc" = "yes" ; then
! 	CFLAGS_WARNING="-Wall -Wno-implicit-int"
      else
  	CFLAGS_WARNING=""
      fi
*** unix/configure.in.orig	Thu Feb 10 12:11:02 2000
--- unix/configure.in	Sun Feb 20 12:28:14 2000
***************
*** 323,328 ****
--- 323,329 ----
  
  SC_ENABLE_SHARED
  
+ TK_SHARED_BUILD=${SHARED_BUILD}
  eval eval "TK_SHARED_LIB_SUFFIX=${SHARED_LIB_SUFFIX}"
  eval eval "TK_UNSHARED_LIB_SUFFIX=${UNSHARED_LIB_SUFFIX}"
  
***************
*** 332,342 ****
  if test "${SHARED_BUILD}" = "1" -a "${SHLIB_SUFFIX}" != ""; then
      TK_SHLIB_CFLAGS="${SHLIB_CFLAGS}"
      TK_LIB_FILE=libtk${TK_SHARED_LIB_SUFFIX}
!     MAKE_LIB="\${SHLIB_LD} -o \${TK_LIB_FILE} \${OBJS} \$(TK_LD_SEARCH_FLAGS) ${TCL_STUB_LIB_SPEC} \${LIBS}"
      RANLIB=":"
  
! #    TCL_STUB_FLAGS="-DUSE_TCL_STUBS"
!     TCL_STUB_FLAGS=""
  else
      TK_SHLIB_CFLAGS=""
      TK_LIB_FILE=libtk${TK_UNSHARED_LIB_SUFFIX}
--- 333,342 ----
  if test "${SHARED_BUILD}" = "1" -a "${SHLIB_SUFFIX}" != ""; then
      TK_SHLIB_CFLAGS="${SHLIB_CFLAGS}"
      TK_LIB_FILE=libtk${TK_SHARED_LIB_SUFFIX}
!     MAKE_LIB="\${SHLIB_LD} -o \${TK_LIB_FILE} \${OBJS} \$(TK_LD_SEARCH_FLAGS) \${TCL_STUB_LIB_SPEC} \${LIBS}"
      RANLIB=":"
  
!     TCL_STUB_FLAGS="-DUSE_TCL_STUBS"
  else
      TK_SHLIB_CFLAGS=""
      TK_LIB_FILE=libtk${TK_UNSHARED_LIB_SUFFIX}
***************
*** 372,377 ****
--- 372,484 ----
  TK_SHARED_BUILD=${SHARED_BUILD}
  
  #--------------------------------------------------------------------
+ #	Checking X lib for i18n related things.
+ #--------------------------------------------------------------------
+ 
+ X11_IMAKE_FLAGS=""
+ tk_oldCflags=$CFLAGS
+ tk_oldLibs=$LIBS
+ CFLAGS="$CFLAGS $XINCLUDES"
+ LIBS="$XLIBSW $LIBS"
+ 
+ AC_MSG_CHECKING([XRegisterIMInstantiateCallback])
+ AC_TRY_LINK([
+ #include <X11/Xlib.h>
+ ], [
+ XRegisterIMInstantiateCallback(0, 0, 0, 0, 0, 0);
+ ], [
+ AC_MSG_RESULT(yes)
+ X11_IMAKE_FLAGS="-DHAVE_XIMREGINSTCB"
+ ], [
+ AC_MSG_RESULT(no)
+ ])
+ 
+ AC_MSG_CHECKING([XIDProc])
+ AC_TRY_COMPILE([
+ #include <X11/Xlib.h>
+ ], [
+ XIDProc *a;
+ ], [
+ AC_MSG_RESULT(yes)
+ ], [
+ AC_MSG_RESULT(no)
+ X11_IMAKE_FLAGS="$X11_IMAKE_FLAGS -DNO_XIDPROC"
+ ])
+ 
+ HAVE_XMKMF=""
+ AC_PATH_PROG(HAVE_XMKMF, xmkmf, "", /usr/X11R6/bin /usr/X11R5/bin /usr/local/X11R6/bin /usr/local/X11R5/bin /usr/openwin/bin /usr/X11/bin /usr/X386/bin /usr/sww/bin /usr/unsupported/bin)
+ if test "X$HAVE_XMKMF" != "X"; then
+     IMAKE_FLAGS=""
+     if test -d ImakeCheck; then
+         rm -rf ImakeCheck
+     fi
+     mkdir ImakeCheck
+     cat << EOF > ImakeCheck/Imakefile
+ SRCS = dummy.c
+ OBJS = dummy.o
+ 
+ ComplexProgramTarget(dummy)
+ EOF
+     cat << EOF > ImakeCheck/dummy.c
+ static int justAnInt = 0;
+ EOF
+     (cd ./ImakeCheck; rm -f Makefile Makefile.*; eval $HAVE_XMKMF) > /dev/null 2>&1
+     for i in `(cd ./ImakeCheck; make -n dummy.o)`
+     do
+         case $i in -D*) IMAKE_FLAGS="$IMAKE_FLAGS $i";; esac
+     done
+     if test "X$IMAKE_FLAGS" != "X"; then
+         AC_MSG_RESULT(Add these flags for proper compile: $IMAKE_FLAGS)
+         X11_IMAKE_FLAGS="$X11_IMAKE_FLAGS $IMAKE_FLAGS"
+     fi
+     rm -rf ImakeCheck
+ fi
+ 
+ # At last check FreeBSD and have -lxpg4.
+ AC_MSG_CHECKING([system version (for additional locale library)])
+ if test -f /usr/lib/NextStep/software_version; then
+     system=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version`
+ else
+     system=`uname -s`-`uname -r`
+     if test "$?" -ne 0 ; then
+         system=unknown
+     else
+         # Special check for weird MP-RAS system (uname returns weird
+         # results, and the version is kept in special file).
+     
+         if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then
+             system=MP-RAS-`awk '{print $3}' /etc/.relid'`
+         fi
+         if test "`uname -s`" = "AIX" ; then
+             system=AIX-`uname -v`.`uname -r`
+         fi
+     fi
+ fi
+ 
+ case $system in
+     FreeBSD-*)
+ 	LIBS="$XLIBSW -lxpg4 $tk_oldLibs"
+ 	CFLAGS="$CFLAGS $X11_IMAKE_FLAGS"
+ 	AC_TRY_COMPILE([
+ #include <locale.h>
+ ], [
+ (void)setlocale(LC_ALL, "");
+ ], [
+ AC_MSG_RESULT(use xpg4 library.)
+ XLIBSW="$XLIBSW -lxpg4"
+ ], [
+ AC_MSG_RESULT(no need other libraries.)
+ ])
+ 	;;
+     *)
+ 	AC_MSG_RESULT(No additional library is needed.)
+ 	;;
+ esac
+ 
+ CFLAGS=$tk_oldCflags
+ LIBS=$tk_oldLibs
+ 
+ #--------------------------------------------------------------------
  # The statements below define various symbols relating to creating
  # the stub'd version of the Tk library
  #
***************
*** 401,406 ****
--- 508,514 ----
  AC_SUBST(STUB_LIB_FILE)
  
  AC_SUBST(TK_STUB_LIB_FILE)
+ AC_SUBST(TCL_STUB_LIB_FLAG)
  AC_SUBST(TK_STUB_LIB_FLAG)
  AC_SUBST(TK_BUILD_STUB_LIB_SPEC)
  AC_SUBST(TK_STUB_LIB_SPEC)
***************
*** 432,440 ****
  AC_SUBST(SHLIB_VERSION)
  AC_SUBST(TCL_BIN_DIR)
  AC_SUBST(TCL_LIB_SPEC)
  AC_SUBST(TCL_LIB_FLAG)
! #AC_SUBST(TCL_BUILD_STUB_LIB_SPEC)
! #AC_SUBST(TCL_BUILD_LIB_SPEC)
  AC_SUBST(TCL_DBGX)
  AC_SUBST(TCL_LIB_FLAG)
  AC_SUBST(TCL_SRC_DIR)
--- 540,549 ----
  AC_SUBST(SHLIB_VERSION)
  AC_SUBST(TCL_BIN_DIR)
  AC_SUBST(TCL_LIB_SPEC)
+ AC_SUBST(TCL_STUB_LIB_SPEC)
  AC_SUBST(TCL_LIB_FLAG)
! AC_SUBST(TCL_BUILD_STUB_LIB_SPEC)
! AC_SUBST(TCL_BUILD_LIB_SPEC)
  AC_SUBST(TCL_DBGX)
  AC_SUBST(TCL_LIB_FLAG)
  AC_SUBST(TCL_SRC_DIR)
***************
*** 442,447 ****
--- 551,557 ----
  AC_SUBST(TK_BUILD_LIB_SPEC)
  AC_SUBST(TK_CC_SEARCH_FLAGS)
  AC_SUBST(TK_LD_SEARCH_FLAGS)
+ AC_SUBST(TK_SHARED_LIB_FILE)
  AC_SUBST(TK_LIB_FILE)
  AC_SUBST(TK_LIB_FLAG)
  AC_SUBST(TK_LIB_SPEC)
***************
*** 453,457 ****
  AC_SUBST(XINCLUDES)
  AC_SUBST(XLIBSW)
  AC_SUBST(TK_SHARED_BUILD)
! 
! AC_OUTPUT(Makefile tkConfig.sh)
--- 563,567 ----
  AC_SUBST(XINCLUDES)
  AC_SUBST(XLIBSW)
  AC_SUBST(TK_SHARED_BUILD)
! AC_SUBST(X11_IMAKE_FLAGS)
! AC_OUTPUT(Makefile tkConfig.sh pkgIndex.tcl pkgIndex.tk)
*** unix/configure.orig	Thu Feb 10 12:11:02 2000
--- unix/configure	Sun Feb 20 12:30:02 2000
***************
*** 1516,1522 ****
      CFLAGS_DEBUG=-g
      CFLAGS_OPTIMIZE=-O
      if test "$using_gcc" = "yes" ; then
! 	CFLAGS_WARNING="-Wall -Wconversion -Wno-implicit-int"
      else
  	CFLAGS_WARNING=""
      fi
--- 1516,1522 ----
      CFLAGS_DEBUG=-g
      CFLAGS_OPTIMIZE=-O
      if test "$using_gcc" = "yes" ; then
! 	CFLAGS_WARNING="-Wall -Wno-implicit-int"
      else
  	CFLAGS_WARNING=""
      fi
***************
*** 4000,4005 ****
--- 4000,4006 ----
      fi
  
  
+ TK_SHARED_BUILD=${SHARED_BUILD}
  eval eval "TK_SHARED_LIB_SUFFIX=${SHARED_LIB_SUFFIX}"
  eval eval "TK_UNSHARED_LIB_SUFFIX=${UNSHARED_LIB_SUFFIX}"
  
***************
*** 4009,4019 ****
  if test "${SHARED_BUILD}" = "1" -a "${SHLIB_SUFFIX}" != ""; then
      TK_SHLIB_CFLAGS="${SHLIB_CFLAGS}"
      TK_LIB_FILE=libtk${TK_SHARED_LIB_SUFFIX}
!     MAKE_LIB="\${SHLIB_LD} -o \${TK_LIB_FILE} \${OBJS} \$(TK_LD_SEARCH_FLAGS) ${TCL_STUB_LIB_SPEC} \${LIBS}"
      RANLIB=":"
  
! #    TCL_STUB_FLAGS="-DUSE_TCL_STUBS"
!     TCL_STUB_FLAGS=""
  else
      TK_SHLIB_CFLAGS=""
      TK_LIB_FILE=libtk${TK_UNSHARED_LIB_SUFFIX}
--- 4010,4019 ----
  if test "${SHARED_BUILD}" = "1" -a "${SHLIB_SUFFIX}" != ""; then
      TK_SHLIB_CFLAGS="${SHLIB_CFLAGS}"
      TK_LIB_FILE=libtk${TK_SHARED_LIB_SUFFIX}
!     MAKE_LIB="\${SHLIB_LD} -o \${TK_LIB_FILE} \${OBJS} \$(TK_LD_SEARCH_FLAGS) \${TCL_STUB_LIB_SPEC} \${LIBS}"
      RANLIB=":"
  
!     TCL_STUB_FLAGS="-DUSE_TCL_STUBS"
  else
      TK_SHLIB_CFLAGS=""
      TK_LIB_FILE=libtk${TK_UNSHARED_LIB_SUFFIX}
***************
*** 4049,4054 ****
--- 4049,4250 ----
  TK_SHARED_BUILD=${SHARED_BUILD}
  
  #--------------------------------------------------------------------
+ #	Checking X lib for i18n related things.
+ #--------------------------------------------------------------------
+ 
+ X11_IMAKE_FLAGS=""
+ tk_oldCflags=$CFLAGS
+ tk_oldLibs=$LIBS
+ CFLAGS="$CFLAGS $XINCLUDES"
+ LIBS="$XLIBSW $LIBS"
+ 
+ echo $ac_n "checking XRegisterIMInstantiateCallback""... $ac_c" 1>&6
+ echo "configure:4063: checking XRegisterIMInstantiateCallback" >&5
+ cat > conftest.$ac_ext <<EOF
+ #line 4065 "configure"
+ #include "confdefs.h"
+ 
+ #include <X11/Xlib.h>
+ 
+ int main() {
+ 
+ XRegisterIMInstantiateCallback(0, 0, 0, 0, 0, 0);
+ 
+ ; return 0; }
+ EOF
+ if { (eval echo configure:4076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+   rm -rf conftest*
+   
+ echo "$ac_t""yes" 1>&6
+ X11_IMAKE_FLAGS="-DHAVE_XIMREGINSTCB"
+ 
+ else
+   echo "configure: failed program was:" >&5
+   cat conftest.$ac_ext >&5
+   rm -rf conftest*
+   
+ echo "$ac_t""no" 1>&6
+ 
+ fi
+ rm -f conftest*
+ 
+ echo $ac_n "checking XIDProc""... $ac_c" 1>&6
+ echo "configure:4093: checking XIDProc" >&5
+ cat > conftest.$ac_ext <<EOF
+ #line 4095 "configure"
+ #include "confdefs.h"
+ 
+ #include <X11/Xlib.h>
+ 
+ int main() {
+ 
+ XIDProc *a;
+ 
+ ; return 0; }
+ EOF
+ if { (eval echo configure:4106: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+   rm -rf conftest*
+   
+ echo "$ac_t""yes" 1>&6
+ 
+ else
+   echo "configure: failed program was:" >&5
+   cat conftest.$ac_ext >&5
+   rm -rf conftest*
+   
+ echo "$ac_t""no" 1>&6
+ X11_IMAKE_FLAGS="$X11_IMAKE_FLAGS -DNO_XIDPROC"
+ 
+ fi
+ rm -f conftest*
+ 
+ HAVE_XMKMF=""
+ # Extract the first word of "xmkmf", so it can be a program name with args.
+ set dummy xmkmf; ac_word=$2
+ echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+ echo "configure:4126: checking for $ac_word" >&5
+ if eval "test \"`echo '$''{'ac_cv_path_HAVE_XMKMF'+set}'`\" = set"; then
+   echo $ac_n "(cached) $ac_c" 1>&6
+ else
+   case "$HAVE_XMKMF" in
+   /*)
+   ac_cv_path_HAVE_XMKMF="$HAVE_XMKMF" # Let the user override the test with a path.
+   ;;
+   ?:/*)			 
+   ac_cv_path_HAVE_XMKMF="$HAVE_XMKMF" # Let the user override the test with a dos path.
+   ;;
+   *)
+   IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+   ac_dummy="/usr/X11R6/bin /usr/X11R5/bin /usr/local/X11R6/bin /usr/local/X11R5/bin /usr/openwin/bin /usr/X11/bin /usr/X386/bin /usr/sww/bin /usr/unsupported/bin"
+   for ac_dir in $ac_dummy; do 
+     test -z "$ac_dir" && ac_dir=.
+     if test -f $ac_dir/$ac_word; then
+       ac_cv_path_HAVE_XMKMF="$ac_dir/$ac_word"
+       break
+     fi
+   done
+   IFS="$ac_save_ifs"
+   test -z "$ac_cv_path_HAVE_XMKMF" && ac_cv_path_HAVE_XMKMF=""""
+   ;;
+ esac
+ fi
+ HAVE_XMKMF="$ac_cv_path_HAVE_XMKMF"
+ if test -n "$HAVE_XMKMF"; then
+   echo "$ac_t""$HAVE_XMKMF" 1>&6
+ else
+   echo "$ac_t""no" 1>&6
+ fi
+ 
+ if test "X$HAVE_XMKMF" != "X"; then
+     IMAKE_FLAGS=""
+     if test -d ImakeCheck; then
+         rm -rf ImakeCheck
+     fi
+     mkdir ImakeCheck
+     cat << EOF > ImakeCheck/Imakefile
+ SRCS = dummy.c
+ OBJS = dummy.o
+ 
+ ComplexProgramTarget(dummy)
+ EOF
+     cat << EOF > ImakeCheck/dummy.c
+ static int justAnInt = 0;
+ EOF
+     (cd ./ImakeCheck; rm -f Makefile Makefile.*; eval $HAVE_XMKMF) > /dev/null 2>&1
+     for i in `(cd ./ImakeCheck; make -n dummy.o)`
+     do
+         case $i in -D*) IMAKE_FLAGS="$IMAKE_FLAGS $i";; esac
+     done
+     if test "X$IMAKE_FLAGS" != "X"; then
+         echo "$ac_t""Add these flags for proper compile: $IMAKE_FLAGS" 1>&6
+         X11_IMAKE_FLAGS="$X11_IMAKE_FLAGS $IMAKE_FLAGS"
+     fi
+     rm -rf ImakeCheck
+ fi
+ 
+ # At last check FreeBSD and have -lxpg4.
+ echo $ac_n "checking system version (for additional locale library)""... $ac_c" 1>&6
+ echo "configure:4188: checking system version (for additional locale library)" >&5
+ if test -f /usr/lib/NextStep/software_version; then
+     system=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version`
+ else
+     system=`uname -s`-`uname -r`
+     if test "$?" -ne 0 ; then
+         system=unknown
+     else
+         # Special check for weird MP-RAS system (uname returns weird
+         # results, and the version is kept in special file).
+     
+         if test -r /etc/.relid -a "X`uname -n`" = "X`uname -s`" ; then
+             system=MP-RAS-`awk '{print $3}' /etc/.relid'`
+         fi
+         if test "`uname -s`" = "AIX" ; then
+             system=AIX-`uname -v`.`uname -r`
+         fi
+     fi
+ fi
+ 
+ case $system in
+     FreeBSD-*)
+ 	LIBS="$XLIBSW -lxpg4 $tk_oldLibs"
+ 	CFLAGS="$CFLAGS $X11_IMAKE_FLAGS"
+ 	cat > conftest.$ac_ext <<EOF
+ #line 4213 "configure"
+ #include "confdefs.h"
+ 
+ #include <locale.h>
+ 
+ int main() {
+ 
+ (void)setlocale(LC_ALL, "");
+ 
+ ; return 0; }
+ EOF
+ if { (eval echo configure:4224: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+   rm -rf conftest*
+   
+ echo "$ac_t""use xpg4 library." 1>&6
+ XLIBSW="$XLIBSW -lxpg4"
+ 
+ else
+   echo "configure: failed program was:" >&5
+   cat conftest.$ac_ext >&5
+   rm -rf conftest*
+   
+ echo "$ac_t""no need other libraries." 1>&6
+ 
+ fi
+ rm -f conftest*
+ 	;;
+     *)
+ 	echo "$ac_t""No additional library is needed." 1>&6
+ 	;;
+ esac
+ 
+ CFLAGS=$tk_oldCflags
+ LIBS=$tk_oldLibs
+ 
+ #--------------------------------------------------------------------
  # The statements below define various symbols relating to creating
  # the stub'd version of the Tk library
  #
***************
*** 4088,4093 ****
--- 4284,4290 ----
  
  
  
+ 
  eval "TK_LIB_FILE=${TK_LIB_FILE}"
  
  
***************
*** 4110,4117 ****
  
  
  
! #AC_SUBST(TCL_BUILD_STUB_LIB_SPEC)
! #AC_SUBST(TCL_BUILD_LIB_SPEC)
  
  
  
--- 4307,4316 ----
  
  
  
! 
! 
! 
! 
  
  
  
***************
*** 4243,4249 ****
  
  ac_given_srcdir=$srcdir
  
! trap 'rm -fr `echo "Makefile tkConfig.sh" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
  EOF
  cat >> $CONFIG_STATUS <<EOF
  
--- 4442,4448 ----
  
  ac_given_srcdir=$srcdir
  
! trap 'rm -fr `echo "Makefile tkConfig.sh pkgIndex.tcl pkgIndex.tk" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
  EOF
  cat >> $CONFIG_STATUS <<EOF
  
***************
*** 4285,4292 ****
--- 4484,4493 ----
  s%@CFLAGS_DEBUG@%$CFLAGS_DEBUG%g
  s%@CFLAGS_OPTIMIZE@%$CFLAGS_OPTIMIZE%g
  s%@CFLAGS_WARNING@%$CFLAGS_WARNING%g
+ s%@HAVE_XMKMF@%$HAVE_XMKMF%g
  s%@STUB_LIB_FILE@%$STUB_LIB_FILE%g
  s%@TK_STUB_LIB_FILE@%$TK_STUB_LIB_FILE%g
+ s%@TCL_STUB_LIB_FLAG@%$TCL_STUB_LIB_FLAG%g
  s%@TK_STUB_LIB_FLAG@%$TK_STUB_LIB_FLAG%g
  s%@TK_BUILD_STUB_LIB_SPEC@%$TK_BUILD_STUB_LIB_SPEC%g
  s%@TK_STUB_LIB_SPEC@%$TK_STUB_LIB_SPEC%g
***************
*** 4310,4321 ****
--- 4511,4526 ----
  s%@SHLIB_SUFFIX@%$SHLIB_SUFFIX%g
  s%@SHLIB_VERSION@%$SHLIB_VERSION%g
  s%@TCL_LIB_SPEC@%$TCL_LIB_SPEC%g
+ s%@TCL_STUB_LIB_SPEC@%$TCL_STUB_LIB_SPEC%g
  s%@TCL_LIB_FLAG@%$TCL_LIB_FLAG%g
+ s%@TCL_BUILD_STUB_LIB_SPEC@%$TCL_BUILD_STUB_LIB_SPEC%g
+ s%@TCL_BUILD_LIB_SPEC@%$TCL_BUILD_LIB_SPEC%g
  s%@TCL_DBGX@%$TCL_DBGX%g
  s%@TCL_VERSION@%$TCL_VERSION%g
  s%@TK_BUILD_LIB_SPEC@%$TK_BUILD_LIB_SPEC%g
  s%@TK_CC_SEARCH_FLAGS@%$TK_CC_SEARCH_FLAGS%g
  s%@TK_LD_SEARCH_FLAGS@%$TK_LD_SEARCH_FLAGS%g
+ s%@TK_SHARED_LIB_FILE@%$TK_SHARED_LIB_FILE%g
  s%@TK_LIB_FILE@%$TK_LIB_FILE%g
  s%@TK_LIB_FLAG@%$TK_LIB_FLAG%g
  s%@TK_LIB_SPEC@%$TK_LIB_SPEC%g
***************
*** 4327,4332 ****
--- 4532,4538 ----
  s%@XINCLUDES@%$XINCLUDES%g
  s%@XLIBSW@%$XLIBSW%g
  s%@TK_SHARED_BUILD@%$TK_SHARED_BUILD%g
+ s%@X11_IMAKE_FLAGS@%$X11_IMAKE_FLAGS%g
  
  CEOF
  EOF
***************
*** 4368,4374 ****
  
  cat >> $CONFIG_STATUS <<EOF
  
! CONFIG_FILES=\${CONFIG_FILES-"Makefile tkConfig.sh"}
  EOF
  cat >> $CONFIG_STATUS <<\EOF
  for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
--- 4574,4580 ----
  
  cat >> $CONFIG_STATUS <<EOF
  
! CONFIG_FILES=\${CONFIG_FILES-"Makefile tkConfig.sh pkgIndex.tcl pkgIndex.tk"}
  EOF
  cat >> $CONFIG_STATUS <<\EOF
  for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
*** unix/mkinstalldirs.orig	Wed Feb 16 23:08:41 2000
--- unix/mkinstalldirs	Wed Feb 16 23:08:41 2000
***************
*** 0 ****
--- 1,32 ----
+ #! /bin/sh
+ # mkinstalldirs --- make directory hierarchy
+ # Author: Noah Friedman <friedman@prep.ai.mit.edu>
+ # Created: 1993-05-16
+ # Last modified: 1994-03-25
+ # Public domain
+ 
+ errstatus=0
+ 
+ for file in ${1+"$@"} ; do 
+    set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
+    shift
+ 
+    pathcomp=
+    for d in ${1+"$@"} ; do
+      pathcomp="$pathcomp$d"
+      case "$pathcomp" in
+        -* ) pathcomp=./$pathcomp ;;
+      esac
+ 
+      if test ! -d "$pathcomp"; then
+         echo "mkdir $pathcomp" 1>&2
+         mkdir "$pathcomp" || errstatus=$?
+      fi
+ 
+      pathcomp="$pathcomp/"
+    done
+ done
+ 
+ exit $errstatus
+ 
+ # mkinstalldirs ends here
*** unix/pkgIndex.tcl.in.orig	Wed Feb 16 23:08:41 2000
--- unix/pkgIndex.tcl.in	Wed Feb 16 23:08:41 2000
***************
*** 0 ****
--- 1,7 ----
+ # Tcl package index file, version 1.0
+ 
+ package ifneeded Tk @TK_VERSION@ [list load [file join $dir @TK_LIB_FILE@] Tk]
+ package ifneeded Tksquare @TK_VERSION@ [list tclPkgSetup $dir Tksquare @TK_VERSION@\
+     [list [list Tksquare[info sharedlibextension] load square]]]
+ package ifneeded Tktest @TK_VERSION@ [list tclPkgSetup $dir Tktest @TK_VERSION@\
+     [list [list Tktest[info sharedlibextension] load {testclipboard testcbind testdeleteapps testembed testmakeexist testmenubar testmetrics testprop testsend}]]]
*** unix/pkgIndex.tk.in.orig	Sun Feb 20 12:26:57 2000
--- unix/pkgIndex.tk.in	Sun Feb 20 12:35:25 2000
***************
*** 0 ****
--- 1,5 ----
+ # Tcl package index file, version 1.0
+ 
+ if {[package vcompare [info tclversion] @TCL_VERSION@] < 0} return
+ 
+ package ifneeded Tk @TK_VERSION@ {load @exec_prefix@/lib/@TK_LIB_FILE@ Tk}
*** unix/tkAppInit.c.orig	Thu Dec  2 03:05:39 1999
--- unix/tkAppInit.c	Wed Feb 16 23:08:41 2000
***************
*** 13,20 ****
--- 13,24 ----
   * RCS: @(#) $Id: tkAppInit.c,v 1.5 1999/12/02 02:05:39 redman Exp $
   */
  
+ #undef TCL_USE_STUBS
+ 
  #include "tk.h"
+ #ifndef I18N_IMPROVE
  #include "locale.h"
+ #endif /* !I18N_IMPROVE */
  
  /*
   * The following variable is a special hack that is needed in order for
*** unix/tkConfig.sh.in.orig	Thu Feb 10 12:11:02 2000
--- unix/tkConfig.sh.in	Wed Feb 16 23:08:41 2000
***************
*** 20,26 ****
  TK_PATCH_LEVEL='@TK_PATCH_LEVEL@'
  
  # -D flags for use with the C compiler.
! TK_DEFS='@DEFS@'
  
  # Flag, 1: we built a shared lib, 0 we didn't
  TK_SHARED_BUILD=@TK_SHARED_BUILD@
--- 20,26 ----
  TK_PATCH_LEVEL='@TK_PATCH_LEVEL@'
  
  # -D flags for use with the C compiler.
! TK_DEFS='@DEFS@ @X11_IMAKE_FLAGS@ -DI18N_IMPROVE'
  
  # Flag, 1: we built a shared lib, 0 we didn't
  TK_SHARED_BUILD=@TK_SHARED_BUILD@
*** unix/tkUnixEvent.c.orig	Fri Apr 16 03:51:46 1999
--- unix/tkUnixEvent.c	Wed Feb 16 23:08:41 2000
***************
*** 161,167 ****
          (void) XSync(dispPtr->display, False);
          (void) XCloseDisplay(dispPtr->display);
      }
!     
      ckfree((char *) dispPtr);
  }
  
--- 161,172 ----
          (void) XSync(dispPtr->display, False);
          (void) XCloseDisplay(dispPtr->display);
      }
! #ifdef I18N_IMPROVE
!     if (displayPtr->imEncoding != NULL) {
! 	Tcl_FreeEncoding(displayPtr->imEncoding);
!     }
! #endif /* I18N_IMPROVE */    
! 
      ckfree((char *) dispPtr);
  }
  
***************
*** 246,251 ****
--- 251,268 ----
  
      while (numFound > 0) {
  	XNextEvent(display, &event);
+ #ifdef I18N_IMPROVE
+ 	/*
+ 	 * To avoid Tk freezing by IM server's protocol bugs,
+ 	 * Re-check queued event after an event is filterd.
+ 	 *
+ 	 *	m-hirano
+ 	 */
+ 	if (XFilterEvent(&event, None) == True) {
+ 	    numFound = XEventsQueued(display, QueuedAlready);
+ 	    continue;
+ 	}
+ #endif /* I18N_IMPROVE */
  	Tk_QueueWindowEvent(&event, TCL_QUEUE_TAIL);
  	numFound--;
      }
*** unix/tkUnixIm.c.orig	Wed Feb 16 23:08:41 2000
--- unix/tkUnixIm.c	Wed Feb 16 23:08:41 2000
***************
*** 0 ****
--- 1,255 ----
+ /* 
+  * tkUnixIm.c --
+  *
+  *      This file contains modules to implement the XIM protocol session.
+  *	This is the shrinked version of tkXIM.c, worte for tk8.0jp.
+  *
+  *	Author:	m-hirano@sra.co.jp
+  *
+  * Copyright 1999 Software Research Associates, Inc.
+  *
+  * Permission to use, copy, modify, and distribute this software and its
+  * documentation for any purpose and without fee is hereby granted, provided
+  * that the above copyright notice appear in all copies and that both that
+  * copyright notice and this permission notice appear in supporting
+  * documentation, and that the name of Software Research Associates not be
+  * used in advertising or publicity pertaining to distribution of the
+  * software without specific, written prior permission.  Software Research
+  * Associates makes no representations about the suitability of this software
+  * for any purpose.  It is provided "as is" without express or implied
+  * warranty.
+  */
+ 
+ #if 0
+ static char rcsid[] = "$Header: /home/m-hirano/cvsroot/tcltk/tk8.1/unix/tkUnixIm.c,v 1.1 1999/05/10 00:39:16 m-hirano Exp $";
+ #endif
+ 
+ #include "tkPort.h"
+ #include "tkInt.h"
+ 
+ #ifdef TK_USE_INPUT_METHODS
+ #ifdef I18N_IMPROVE
+ 
+ static void		TkpIMGenericHandler _ANSI_ARGS_((ClientData clientData, XEvent *eventPtr));
+ static TkWindow *	GetToplevel _ANSI_ARGS_((TkWindow *winPtr));
+ static void		TkpCreateIMGenericHandler _ANSI_ARGS_((Tk_Window tkwin));
+ static void		TkpDeleteIMGenericHandler _ANSI_ARGS_((Tk_Window tkwin));
+ 
+ static TkWindow *
+ GetToplevel(winPtr)
+      TkWindow *winPtr;
+ {
+     while (!(winPtr->flags & TK_TOP_LEVEL)) {
+ 	winPtr = winPtr->parentPtr;
+ 	if (winPtr == NULL) {
+ 	    return NULL;
+ 	}
+     }
+     return winPtr;
+ }
+ 
+ 
+ static void
+ TkpIMGenericHandler(clientData, eventPtr)
+      ClientData clientData;
+      XEvent *eventPtr;
+ {
+     Tk_Window tkwin = (Tk_Window)clientData;
+     TkWindow *winPtr = (TkWindow *)clientData;
+     
+     if (eventPtr->xany.window != Tk_WindowId(tkwin) ||
+ 	winPtr->inputContext == NULL ||
+ 	!(winPtr->flags & TK_CHECKED_IC)) {
+ 	/*
+ 	 * Why ME ???
+ 	 */
+ 	return;
+     }
+ 
+     /*
+      * Well, should I care about Enter/Leave ?
+      */
+ 
+     switch (eventPtr->type) {
+         case KeyPress:
+         case FocusIn: {
+ 	    Window root, child;
+ 	    int rootX, rootY;
+ 	    int wX, wY;
+ 	    unsigned int mask;
+ 
+ 	    /*
+ 	     * Care about case mouse pointer is not on winPtr->window.
+ 	     * In such a case, IM server can't fetch any events from Tk.
+ 	     */
+ 
+ 	    if (XQueryPointer(winPtr->display,
+ 			      RootWindow(winPtr->display, winPtr->screenNum),
+ 			      &root, &child, &rootX, &rootY, &wX, &wY, &mask) == True) {
+ 		TkWindow *pWin = (TkWindow *)Tk_CoordsToWindow(rootX, rootY,
+ 							       (Tk_Window)winPtr);
+ 		if (pWin != NULL && (pWin->window != winPtr->window)) {
+ #if 0
+ 		    /*
+ 		     * Code belows are what I REALLY want to do. But,
+ 		     * in XIMPreeditPosition mode, IM server use the
+ 		     * focus window as key event source window and as
+ 		     * PreeditArea window by X11 specification. I want
+ 		     * IM server to use this focus window ONLY as key
+ 		     * event source. Means:
+ 		     *
+ 		     * 	o PreeditArea and PreeditPosition take place
+ 		     * 	  within client window (winPtr->window).
+ 		     *	o KeyPress event source is the window in which
+ 		     *	  mouse pointer is (pWin->window).
+ 		     */
+ 
+ 		    if (XSetICValues(winPtr->inputContext, XNFocusWindow,
+ 				     pWin->window, NULL) != NULL) {
+ 			fprintf(stderr, "debugIC: can't set IC focus to pointer window 0x%08x\n",
+ 				pWin->window);
+ 		    } else {
+ 			fprintf(stderr, "debugIC: set IC focus to pointer window 0x%08x\n",
+ 				pWin->window);
+ 		    }
+ #endif
+ 		    /*
+ 		     * Check pWin and winPtr are in same toplevel.
+ 		     * If they are NOT, don't change focus. 
+ 		     */
+ 		    TkWindow *pTop = GetToplevel(pWin);
+ 		    TkWindow *wTop = GetToplevel(winPtr);
+ 		    if (pTop == wTop) {
+ 			TkpChangeFocus(winPtr, 1);
+ 		    }
+ 		}
+ 	    }
+ 	    /*
+ 	     * Get current focused window.
+ 	     */
+ 	    if (winPtr->dispPtr->lastFocusedIC != winPtr->inputContext) {
+ 		winPtr->dispPtr->lastFocusedIC = winPtr->inputContext;
+ 		XSetICFocus(winPtr->inputContext);
+ 	    }
+ 	    break;
+ 	}
+ 
+         case FocusOut: {
+ 	    winPtr->dispPtr->lastFocusedIC = None;
+ 	    XUnsetICFocus(winPtr->inputContext);
+ 	    break;
+ 	}
+ 
+ 	case DestroyNotify: {
+ 	    winPtr->dispPtr->lastFocusedIC = NULL;
+ 	    XUnsetICFocus(winPtr->inputContext);
+ 	    TkpDeleteIMGenericHandler(tkwin);
+ 	    break;
+ 	}
+     }
+ }
+ 
+ 
+ static void
+ TkpCreateIMGenericHandler(tkwin)
+      Tk_Window tkwin;
+ {
+     Tk_CreateEventHandler(tkwin, FocusChangeMask|StructureNotifyMask|KeyPressMask
+ #if 0
+ 			  EnterWindowMask|LeaveWindowMask,
+ #else
+ 			  ,
+ #endif
+ 			  (Tk_EventProc *)TkpIMGenericHandler,
+ 			  (ClientData)tkwin);
+ }
+ 
+ 
+ static void
+ TkpDeleteIMGenericHandler(tkwin)
+      Tk_Window tkwin;
+ {
+     Tk_DeleteEventHandler(tkwin, FocusChangeMask|StructureNotifyMask|KeyPressMask
+ #if 0
+ 			  EnterWindowMask|LeaveWindowMask,
+ #else
+ 			  ,
+ #endif
+ 			  (Tk_EventProc *)TkpIMGenericHandler,
+ 			  (ClientData)tkwin);
+ }
+ 
+ 
+ XIC
+ TkpCreateIC(winPtr)
+      TkWindow *winPtr;
+ {
+     if (winPtr->dispPtr->inputMethod != NULL &&
+ 	!(winPtr->flags & TK_CHECKED_IC)) {
+ 	winPtr->inputContext =
+ 		XCreateIC(winPtr->dispPtr->inputMethod,
+ 			  XNInputStyle, XIMPreeditNothing|XIMStatusNothing,
+ 			  XNClientWindow, winPtr->window,
+ 			  XNFocusWindow, winPtr->window,
+ 			  NULL);
+ 	if (winPtr->inputContext != NULL) {
+ 	    TkpCreateIMGenericHandler((Tk_Window)winPtr);
+ 	}
+     }
+     winPtr->flags |= TK_CHECKED_IC;
+     return winPtr->inputContext;
+ }
+ 
+ 
+ void
+ TkpDestroyIC(winPtr, needDestroy)
+      TkWindow *winPtr;
+      int needDestroy;
+ {
+     TkpDeleteIMGenericHandler((Tk_Window)winPtr);
+     if (winPtr->inputContext == winPtr->dispPtr->lastFocusedIC) {
+ 	winPtr->dispPtr->lastFocusedIC = None;
+     }
+     if (needDestroy == 1 &&
+ 	winPtr->inputContext != NULL) {
+ 	XDestroyIC(winPtr->inputContext);
+     }
+     winPtr->flags &= ~(TK_CHECKED_IC);
+     winPtr->inputContext = NULL;
+ }
+ 
+ 
+ int
+ Tk_ImconfigureObjCmd(clientData, interp, objc, objv)
+      ClientData clientData;	/* Main window associated with
+ 				 * interpreter. */
+      Tcl_Interp *interp;	/* Current interpreter. */
+      int objc;			/* Number of arguments. */
+      Tcl_Obj *CONST objv[];	/* Argument objects. */
+ {
+     Tk_Window tkwin = (Tk_Window)clientData;
+     Tcl_Obj *resultPtr = Tcl_GetObjResult(interp);
+ 
+     if (objc < 2) {
+ 	Tcl_WrongNumArgs(interp, 1, objv, "path ?option? ?arg? ...");
+ 	return TCL_ERROR;
+     }
+ 
+     tkwin = Tk_NameToWindow(interp, Tcl_GetStringFromObj(objv[1], NULL), tkwin);
+     if (tkwin == NULL) {
+ 	return TCL_ERROR;
+     }
+ 
+     if (((TkWindow *)tkwin)->dispPtr->inputMethod == NULL) {
+ 	Tcl_AppendStringsToObj(resultPtr, "No IM server is available.", NULL);
+ 	return TCL_ERROR;
+     }
+ 
+     Tcl_AppendStringsToObj(resultPtr,
+ 			  (TkpCreateIC((TkWindow *)tkwin) != NULL) ? "1" : "0",
+ 			  NULL);
+     return TCL_OK;
+ }
+ 
+ #endif /* I18N_IMPROVE */
+ #endif /* TK_USE_INPUT_METHODS */
*** unix/tkUnixInit.c.orig	Fri Apr 16 03:51:46 1999
--- unix/tkUnixInit.c	Wed Feb 16 23:08:41 2000
***************
*** 104,111 ****
  
  void
  TkpDisplayWarning(msg, title)
!     char *msg;			/* Message to be displayed. */
!     char *title;		/* Title of warning. */
  {
      Tcl_Channel errChannel = Tcl_GetStdChannel(TCL_STDERR);
      if (errChannel) {
--- 104,111 ----
  
  void
  TkpDisplayWarning(msg, title)
!     CONST char *msg;		/* Message to be displayed. */
!     CONST char *title;		/* Title of warning. */
  {
      Tcl_Channel errChannel = Tcl_GetStdChannel(TCL_STDERR);
      if (errChannel) {
*** unix/tkUnixInt.h.orig	Fri Apr 16 03:51:46 1999
--- unix/tkUnixInt.h	Wed Feb 16 23:08:41 2000
***************
*** 24,29 ****
--- 24,32 ----
   * Prototypes for procedures that are referenced in files other
   * than the ones they're defined in.
   */
+ 
+ #include "tclPlatDecls.h"
+ 
  #include "tkIntPlatDecls.h"
  
  #endif /* _TKUNIXINT */
*** unix/tkUnixKey.c.orig	Wed Feb  9 03:13:54 2000
--- unix/tkUnixKey.c	Wed Feb 16 23:08:42 2000
***************
*** 89,95 ****
--- 89,100 ----
  #endif /* TK_USE_INPUT_METHODS */
      Tcl_DStringSetLength(&buf, len);
  
+ #if defined(I18N_IMPROVE) && defined(TK_USE_INPUT_METHODS)
+     Tcl_ExternalToUtfDString(winPtr->dispPtr->imEncoding,
+ 			     Tcl_DStringValue(&buf), len, dsPtr);
+ #else
      Tcl_ExternalToUtfDString(NULL, Tcl_DStringValue(&buf), len, dsPtr);
+ #endif /* I18N_IMPROVE && TK_USE_INPUT_METHODS */
      Tcl_DStringFree(&buf);
  
      return Tcl_DStringValue(dsPtr);
*** unix/tkUnixSend.c.orig	Fri Apr 16 03:51:47 1999
--- unix/tkUnixSend.c	Wed Feb 16 23:08:42 2000
***************
*** 199,204 ****
--- 199,209 ----
  
  int tkSendSerial = 0;
  
+ int TkpGetSendSerial()
+ {
+     return tkSendSerial;
+ }
+ 
  /*
   * Maximum size property that can be read at one time by
   * this module:
*** library/bgerror.tcl.orig	Fri Apr 16 03:51:25 1999
--- library/bgerror.tcl	Wed Feb 16 23:08:42 2000
***************
*** 42,48 ****
  
      # Ok the application's tkerror either failed or was not found
      # we use the default dialog then :
!     if {$tcl_platform(platform) == "macintosh"} {
  	set ok Ok
      } else {
  	set ok OK
--- 42,48 ----
  
      # Ok the application's tkerror either failed or was not found
      # we use the default dialog then :
!     if {![string compare $tcl_platform(platform) macintosh]} {
  	set ok Ok
      } else {
  	set ok OK
*** library/entry.tcl.orig	Thu Jan  6 03:22:24 2000
--- library/entry.tcl	Wed Feb 16 23:08:42 2000
***************
*** 214,219 ****
--- 214,226 ----
      }
  }
  
+ # input method configuration binding (unix only)
+ if {![string compare $tcl_platform(platform) "unix"]} {
+     if {[string compare [info commands imconfigure] {}]} {
+ 	bind Entry <FocusIn> {catch {imconfigure %W}}
+     }
+ }
+ 
  # Additional emacs-like bindings:
  
  bind Entry <Control-a> {
*** library/text.tcl.orig	Thu Feb 10 09:52:50 2000
--- library/text.tcl	Wed Feb 16 23:08:42 2000
***************
*** 378,383 ****
--- 378,390 ----
      }
  }
  
+ # UNIX only bindings:
+ 
+ if {[string equal $tcl_platform(platform) "unix"] &&
+ 	[string compare [info commands imconfigure] {}]} {
+     bind Text <FocusIn> {catch {imconfigure %W}}
+ }
+ 
  # Macintosh only bindings:
  
  # if text black & highlight black -> text white, other text the same
*** library/tk.tcl.orig	Tue Feb  8 11:00:55 2000
--- library/tk.tcl	Wed Feb 16 23:08:42 2000
***************
*** 14,21 ****
  
  # Insist on running with compatible versions of Tcl and Tk.
  
! package require -exact Tk 8.3
! package require -exact Tcl 8.3
  
  # Add Tk's directory to the end of the auto-load search path, if it
  # isn't already on the path:
--- 14,21 ----
  
  # Insist on running with compatible versions of Tcl and Tk.
  
! package require Tk 8.3
! package require Tcl 8.3
  
  # Add Tk's directory to the end of the auto-load search path, if it
  # isn't already on the path:
*** generic/tkArgv.c.orig	Fri Apr 16 03:51:10 1999
--- generic/tkArgv.c	Wed Feb 16 23:08:42 2000
***************
*** 91,96 ****
--- 91,100 ----
      size_t length;		/* Number of characters in current argument. */
      int i;
  
+     if (Tcl_InitStubs(interp, "8.1", 0) == NULL) {
+ 	return TCL_ERROR;
+     }
+ 
      if (flags & TK_ARGV_DONT_SKIP_FIRST_ARG) {
  	srcIndex = dstIndex = 0;
  	argc = *argcPtr;
*** generic/tkConsole.c.orig	Fri Nov 19 23:00:03 1999
--- generic/tkConsole.c	Wed Feb 16 23:08:42 2000
***************
*** 321,327 ****
  #ifdef MAC_TCL
      static char initCmd[] = "source -rsrc {Console}";
  #else
!     static char initCmd[] = "source $tk_library/console.tcl";
  #endif
      
      consoleInterp = Tcl_CreateInterp();
--- 321,327 ----
  #ifdef MAC_TCL
      static char initCmd[] = "source -rsrc {Console}";
  #else
!     static char initCmd[] = "if [catch {::wrap::source lib/tk$tk_version/console}] {source [file join $tk_library console.tcl]}";
  #endif
      
      consoleInterp = Tcl_CreateInterp();
*** generic/tkEvent.c.orig	Thu Dec 16 22:57:36 1999
--- generic/tkEvent.c	Wed Feb 16 23:08:42 2000
***************
*** 14,23 ****
--- 14,40 ----
   * RCS: @(#) $Id: tkEvent.c,v 1.7 1999/12/16 21:57:36 hobbs Exp $
   */
  
+ #define reserved188 tcl_MainLoop
+ #define reserved284 tcl_SetMainLoop
+ 
  #include "tkPort.h"
  #include "tkInt.h"
  #include <signal.h>
  
+ #ifndef USE_TCL_STUBS
+ extern TclStubs tclStubs;
+ #define tclStubsPtr (&tclStubs)
+ #endif
+ 
+ /*
+  * Make sure that Tcl_MainLoop always references the stub pointer, not
+  * the real function.
+  */
+ #undef Tcl_MainLoop
+ #define Tcl_MainLoop ((void (*) _ANSI_ARGS_((void))) ((tclStubsPtr)->tcl_MainLoop))
+ #undef Tcl_SetMainLoop
+ #define Tcl_SetMainLoop ((void (*) _ANSI_ARGS_((VOID *))) ((tclStubsPtr)->tcl_SetMainLoop))
+ 
  /*
   * There's a potential problem if a handler is deleted while it's
   * current (i.e. its procedure is executing), since Tk_HandleEvent
***************
*** 663,668 ****
--- 680,697 ----
      }
  
  #ifdef TK_USE_INPUT_METHODS
+ #ifdef I18N_IMPROVE
+       /*
+        * No need to create an input context for each and every window.
+        *
+        * Futhermore, XFilterEvent() should be called just after the
+        * event is fetched, since some IM server have protocol bugs that
+        * causes Tk freezing, so events EXCEPT THE INPUT METHODS THINGS
+        * should only be queued into Tcl event queue.
+        *
+        *		m-hirano
+        */
+ #else
      /*
       * Pass the event to the input method(s), if there are any, and
       * discard the event if the input method(s) insist.  Create the
***************
*** 684,689 ****
--- 713,719 ----
  	    goto done;
  	}
      }
+ #endif /* I18N_IMPROVE */
  #endif /* TK_USE_INPUT_METHODS */
  
      /*
***************
*** 937,942 ****
--- 967,983 ----
  	}
      }
  
+ #if defined(TK_USE_INPUT_METHODS) && defined(I18N_IMPROVE)
+     if (eventPtr->type == KeyPress && eventPtr->xkey.keycode == 0) {
+         /*
+          * No doubt this is a composed message from IM server.
+          * Tk can handle KeyPress event with zero keycode value 
+          * if state of the event is zero.
+          */
+         eventPtr->xkey.state = 0;
+     }
+ #endif /* TK_USE_INPUT_METHODS && I18N_IMPROVE */
+ 
      if ((dispPtr->delayedMotionPtr != NULL) && (position == TCL_QUEUE_TAIL)) {
  	if ((eventPtr->type == MotionNotify) && (eventPtr->xmotion.window
  		== dispPtr->delayedMotionPtr->event.xmotion.window)) {
***************
*** 1123,1131 ****
--- 1164,1182 ----
   *--------------------------------------------------------------
   */
  
+ #ifndef USE_TCL_STUBS
+ extern TclStubs tclStubs;
+ #   define Tcl_MainLoop tclStubs.tcl_MainLoop
+ #endif
+ 
  void
  Tk_MainLoop()
  {
+     if (Tcl_MainLoop) {
+ 	Tcl_SetMainLoop(Tk_GetNumMainWindows);
+ 	Tcl_MainLoop();
+ 	return;
+     }
      while (Tk_GetNumMainWindows() > 0) {
  	Tcl_DoOneEvent(0);
      }
*** generic/tkFrame.c.orig	Thu Feb 10 09:52:32 2000
--- generic/tkFrame.c	Wed Feb 16 23:08:42 2000
***************
*** 241,246 ****
--- 241,247 ----
   *
   *--------------------------------------------------------------
   */
+ extern TkStubs tkStubs;
  
  int
  TkCreateFrame(clientData, interp, argc, argv, toplevel, appName)
***************
*** 294,299 ****
--- 295,304 ----
      unsigned int mask;
      Colormap colormap;
      Visual *visual;
+     if ((Tcl_InitStubs(interp, "8.1", 0) == NULL) ||
+ 	    (Tcl_PkgProvideEx(interp, "Tk", TK_VERSION, (ClientData) &tkStubs) != TCL_OK)) {
+ 	return TCL_ERROR;
+     }
  
      if (objc < 2) {
  	Tcl_WrongNumArgs(interp, 1, objv, "pathName ?options?");
*** generic/tkImgBmap.c.orig	Thu Feb 17 19:57:20 2000
--- generic/tkImgBmap.c	Thu Feb 17 19:58:11 2000
***************
*** 530,539 ****
  		!= TCL_OK) {
              return NULL;
          }
-         if (Tcl_SetChannelOption(interp, pi.chan, "-encoding", "binary")
- 		!= TCL_OK) {
-             return NULL;
-         }
      } else {
  	pi.chan = NULL;
      }
--- 530,535 ----
*** generic/tkImgGIF.c.orig	Thu Feb 10 09:52:33 2000
--- generic/tkImgGIF.c	Thu Feb 17 19:51:55 2000
***************
*** 1310,1324 ****
   *	Definition of new functions to write GIFs
   */
  
! static int color _ANSI_ARGS_((int red,int green, int blue));
  static void compress _ANSI_ARGS_((int init_bits, Tcl_Channel handle,
  		ifunptr readValue));
  static int nuevo _ANSI_ARGS_((int red, int green ,int blue,
  		unsigned char mapa[MAXCOLORMAPSIZE][3]));
! static int savemap _ANSI_ARGS_((Tk_PhotoImageBlock *blockPtr,
  		unsigned char mapa[MAXCOLORMAPSIZE][3]));
  static int ReadValue _ANSI_ARGS_((void));
- static int no_bits _ANSI_ARGS_((int colors));
  
  static int
  FileWriteGIF (interp, filename, format, blockPtr)
--- 1310,1324 ----
   *	Definition of new functions to write GIFs
   */
  
! static int color _ANSI_ARGS_((int red,int green, int blue,
! 		unsigned char mapa[MAXCOLORMAPSIZE][3]));
  static void compress _ANSI_ARGS_((int init_bits, Tcl_Channel handle,
  		ifunptr readValue));
  static int nuevo _ANSI_ARGS_((int red, int green ,int blue,
  		unsigned char mapa[MAXCOLORMAPSIZE][3]));
! static void savemap _ANSI_ARGS_((Tk_PhotoImageBlock *blockPtr,
  		unsigned char mapa[MAXCOLORMAPSIZE][3]));
  static int ReadValue _ANSI_ARGS_((void));
  
  static int
  FileWriteGIF (interp, filename, format, blockPtr)
***************
*** 1337,1345 ****
      if (Tcl_SetChannelOption(interp, chan, "-translation", "binary") != TCL_OK) {
  	return TCL_ERROR;
      }
-     if (Tcl_SetChannelOption(interp, chan, "-encoding", "binary") != TCL_OK) {
- 	return TCL_ERROR;
-     }
  
      result = CommonWriteGIF(interp, chan, format, blockPtr);
      if (Tcl_Close(interp, chan) == TCL_ERROR) {
--- 1337,1342 ----
***************
*** 1358,1369 ****
      Tk_PhotoImageBlock *blockPtr;
  {
      int  resolution;
-     long  numcolormap;
  
      long  width,height,x;
      unsigned char c;
      unsigned int top,left;
-     int num;
  
      top = 0;
      left = 0;
--- 1355,1364 ----
***************
*** 1394,1404 ****
      height=blockPtr->height;
      pixelo=blockPtr->pixelPtr + blockPtr->offset[0];
      pixelPitch=blockPtr->pitch;
!     if ((num=savemap(blockPtr,mapa))<0) {
  	Tcl_AppendResult(interp, "too many colors", (char *) NULL);
  	return TCL_ERROR;
      }
!     if (num<3) num=3;
      c=LSB(width);
      Mputc(c,handle);
      c=MSB(width);
--- 1389,1400 ----
      height=blockPtr->height;
      pixelo=blockPtr->pixelPtr + blockPtr->offset[0];
      pixelPitch=blockPtr->pitch;
!     savemap(blockPtr,mapa);
!     if (num>=MAXCOLORMAPSIZE) {
  	Tcl_AppendResult(interp, "too many colors", (char *) NULL);
  	return TCL_ERROR;
      }
!     if (num<2) num=2;
      c=LSB(width);
      Mputc(c,handle);
      c=MSB(width);
***************
*** 1408,1418 ****
      c=MSB(height);
      Mputc(c,handle);
  
!     c= (1 << 7) | (no_bits(num) << 4) | (no_bits(num));
      Mputc(c,handle);
-     resolution = no_bits(num)+1;
  
!     numcolormap=1 << resolution;
  
      /*  background color */
  
--- 1404,1417 ----
      c=MSB(height);
      Mputc(c,handle);
  
!     resolution = 0;
!     while (num >> resolution) {
! 	resolution++;
!     }
!     c = 111 + resolution * 17;
      Mputc(c,handle);
  
!     num = 1 << resolution;
  
      /*  background color */
  
***************
*** 1423,1429 ****
  
      Mputc(c,handle);
  
!     for (x=0; x<numcolormap ;x++) {
  	c = mapa[x][CM_RED];
  	Mputc(c,handle);
  	c = mapa[x][CM_GREEN];
--- 1422,1428 ----
  
      Mputc(c,handle);
  
!     for (x=0; x<num ;x++) {
  	c = mapa[x][CM_RED];
  	Mputc(c,handle);
  	c = mapa[x][CM_GREEN];
***************
*** 1479,1488 ****
  }
  
  static int
! color(red, green, blue)
      int red;
      int green;
      int blue;
  {
      int x;
      for (x=(alphaOffset != 0);x<=MAXCOLORMAPSIZE;x++) {
--- 1478,1488 ----
  }
  
  static int
! color(red, green, blue, mapa)
      int red;
      int green;
      int blue;
+     unsigned char mapa[MAXCOLORMAPSIZE][3];
  {
      int x;
      for (x=(alphaOffset != 0);x<=MAXCOLORMAPSIZE;x++) {
***************
*** 1501,1507 ****
      unsigned char mapa[MAXCOLORMAPSIZE][3];
  {
      int x;
!     for (x=(alphaOffset != 0);x<num;x++) {
  	if ((mapa[x][CM_RED]==red) && (mapa[x][CM_GREEN]==green) &&
  		(mapa[x][CM_BLUE]==blue)) {
  	    return 0;
--- 1501,1507 ----
      unsigned char mapa[MAXCOLORMAPSIZE][3];
  {
      int x;
!     for (x=(alphaOffset != 0);x<=num;x++) {
  	if ((mapa[x][CM_RED]==red) && (mapa[x][CM_GREEN]==green) &&
  		(mapa[x][CM_BLUE]==blue)) {
  	    return 0;
***************
*** 1510,1516 ****
      return 1;
  }
  
! static int
  savemap(blockPtr,mapa)
      Tk_PhotoImageBlock *blockPtr;
      unsigned char mapa[MAXCOLORMAPSIZE][3];
--- 1510,1516 ----
      return 1;
  }
  
! static void
  savemap(blockPtr,mapa)
      Tk_PhotoImageBlock *blockPtr;
      unsigned char mapa[MAXCOLORMAPSIZE][3];
***************
*** 1520,1531 ****
      unsigned char  red,green,blue;
  
      if (alphaOffset) {
! 	num = 1;
  	mapa[0][CM_RED] = 0xd9;
  	mapa[0][CM_GREEN] = 0xd9;
  	mapa[0][CM_BLUE] = 0xd9;
      } else {
! 	num = 0;
      }
  
      for(y=0;y<blockPtr->height;y++) {
--- 1520,1531 ----
      unsigned char  red,green,blue;
  
      if (alphaOffset) {
! 	num = 0;
  	mapa[0][CM_RED] = 0xd9;
  	mapa[0][CM_GREEN] = 0xd9;
  	mapa[0][CM_BLUE] = 0xd9;
      } else {
! 	num = -1;
      }
  
      for(y=0;y<blockPtr->height;y++) {
***************
*** 1537,1555 ****
  		green = colores[greenOffset];
  		blue = colores[blueOffset];
  		if (nuevo(red,green,blue,mapa)) {
! 		    if (num>255) 
! 			return -1;
! 
  		    mapa[num][CM_RED]=red;
  		    mapa[num][CM_GREEN]=green;
  		    mapa[num][CM_BLUE]=blue;
- 		    num++;
  		}
  	    }
  	    colores += pixelSize;
  	}
      }
!     return num-1;
  }
  
  static int
--- 1537,1555 ----
  		green = colores[greenOffset];
  		blue = colores[blueOffset];
  		if (nuevo(red,green,blue,mapa)) {
! 		    num++;
! 		    if (num>=MAXCOLORMAPSIZE) {
! 			return;
! 		    }
  		    mapa[num][CM_RED]=red;
  		    mapa[num][CM_GREEN]=green;
  		    mapa[num][CM_BLUE]=blue;
  		}
  	    }
  	    colores += pixelSize;
  	}
      }
!     return;
  }
  
  static int
***************
*** 1563,1569 ****
      if (alphaOffset && (pixelo[alphaOffset]==0)) {
  	col = 0;
      } else {
! 	col = color(pixelo[0],pixelo[greenOffset],pixelo[blueOffset]);
      }
      pixelo += pixelSize;
      if (--ssize <= 0) {
--- 1563,1569 ----
      if (alphaOffset && (pixelo[alphaOffset]==0)) {
  	col = 0;
      } else {
! 	col = color(pixelo[0],pixelo[greenOffset],pixelo[blueOffset], mapa);
      }
      pixelo += pixelSize;
      if (--ssize <= 0) {
***************
*** 1573,1597 ****
      }
  
      return col;
- }
- 
- /*
-  * Return the number of bits ( -1 ) to represent a given
-  * number of colors ( ex: 256 colors => 7 ).
-  */
- 
- static int
- no_bits( colors )
- int colors;
- {
-     register int bits = 0;
- 
-     colors--;
-     while ( colors >> bits ) {
- 	bits++;
-     }
- 
-     return (bits-1);
  }
  
  
--- 1573,1578 ----
*** generic/tkImgPPM.c.orig	Wed Dec 22 00:55:11 1999
--- generic/tkImgPPM.c	Wed Feb 16 23:08:43 2000
***************
*** 16,23 ****
   * RCS: @(#) $Id: tkImgPPM.c,v 1.7 1999/12/21 23:55:11 hobbs Exp $
   */
  
- #define USE_OLD_IMAGE
- 
  #include "tkInt.h"
  #include "tkPort.h"
  
--- 16,21 ----
***************
*** 40,54 ****
   */
  
  static int		FileMatchPPM _ANSI_ARGS_((Tcl_Channel chan,
! 			    char *fileName, char *formatString,
! 			    int *widthPtr, int *heightPtr));
  static int		FileReadPPM  _ANSI_ARGS_((Tcl_Interp *interp,
! 			    Tcl_Channel chan, char *fileName,
! 			    char *formatString, Tk_PhotoHandle imageHandle,
  			    int destX, int destY, int width, int height,
  			    int srcX, int srcY));
  static int		FileWritePPM _ANSI_ARGS_((Tcl_Interp *interp,
! 			    char *fileName, char *formatString,
  			    Tk_PhotoImageBlock *blockPtr));
  
  Tk_PhotoImageFormat tkImgFmtPPM = {
--- 38,53 ----
   */
  
  static int		FileMatchPPM _ANSI_ARGS_((Tcl_Channel chan,
! 			    CONST char *fileName, Tcl_Obj *format,
! 			    int *widthPtr, int *heightPtr,
! 			    Tcl_Interp *interp));
  static int		FileReadPPM  _ANSI_ARGS_((Tcl_Interp *interp,
! 			    Tcl_Channel chan, CONST char *fileName,
! 			    Tcl_Obj *format, Tk_PhotoHandle imageHandle,
  			    int destX, int destY, int width, int height,
  			    int srcX, int srcY));
  static int		FileWritePPM _ANSI_ARGS_((Tcl_Interp *interp,
! 			    CONST char *fileName, Tcl_Obj *format,
  			    Tk_PhotoImageBlock *blockPtr));
  
  Tk_PhotoImageFormat tkImgFmtPPM = {
***************
*** 88,100 ****
   */
  
  static int
! FileMatchPPM(chan, fileName, formatString, widthPtr, heightPtr)
      Tcl_Channel chan;		/* The image file, open for reading. */
!     char *fileName;		/* The name of the image file. */
!     char *formatString;		/* User-specified format string, or NULL. */
      int *widthPtr, *heightPtr;	/* The dimensions of the image are
  				 * returned here if the file is a valid
  				 * raw PPM file. */
  {
      int dummy;
  
--- 87,100 ----
   */
  
  static int
! FileMatchPPM(chan, fileName, format, widthPtr, heightPtr, interp)
      Tcl_Channel chan;		/* The image file, open for reading. */
!     CONST char *fileName;	/* The name of the image file. */
!     Tcl_Obj *format;		/* User-specified format, or NULL. */
      int *widthPtr, *heightPtr;	/* The dimensions of the image are
  				 * returned here if the file is a valid
  				 * raw PPM file. */
+     Tcl_Interp *interp;		/* not used */
  {
      int dummy;
  
***************
*** 122,133 ****
   */
  
  static int
! FileReadPPM(interp, chan, fileName, formatString, imageHandle, destX, destY,
  	width, height, srcX, srcY)
      Tcl_Interp *interp;		/* Interpreter to use for reporting errors. */
      Tcl_Channel chan;		/* The image file, open for reading. */
!     char *fileName;		/* The name of the image file. */
!     char *formatString;		/* User-specified format string, or NULL. */
      Tk_PhotoHandle imageHandle;	/* The photo image to write into. */
      int destX, destY;		/* Coordinates of top-left pixel in
  				 * photo image to be written to. */
--- 122,133 ----
   */
  
  static int
! FileReadPPM(interp, chan, fileName, format, imageHandle, destX, destY,
  	width, height, srcX, srcY)
      Tcl_Interp *interp;		/* Interpreter to use for reporting errors. */
      Tcl_Channel chan;		/* The image file, open for reading. */
!     CONST char *fileName;	/* The name of the image file. */
!     Tcl_Obj *format;		/* User-specified format, or NULL. */
      Tk_PhotoHandle imageHandle;	/* The photo image to write into. */
      int destX, destY;		/* Coordinates of top-left pixel in
  				 * photo image to be written to. */
***************
*** 255,264 ****
   */
  
  static int
! FileWritePPM(interp, fileName, formatString, blockPtr)
      Tcl_Interp *interp;
!     char *fileName;
!     char *formatString;
      Tk_PhotoImageBlock *blockPtr;
  {
      Tcl_Channel chan;
--- 255,264 ----
   */
  
  static int
! FileWritePPM(interp, fileName, format, blockPtr)
      Tcl_Interp *interp;
!     CONST char *fileName;
!     Tcl_Obj *format;
      Tk_PhotoImageBlock *blockPtr;
  {
      Tcl_Channel chan;
***************
*** 267,282 ****
      unsigned char *pixelPtr, *pixLinePtr;
      char header[16 + TCL_INTEGER_SPACE * 2];
  
!     chan = Tcl_OpenFileChannel(interp, fileName, "w", 0666);
      if (chan == NULL) {
  	return TCL_ERROR;
      }
  
      if (Tcl_SetChannelOption(interp, chan, "-translation", "binary")
- 	    != TCL_OK) {
- 	return TCL_ERROR;
-     }
-     if (Tcl_SetChannelOption(interp, chan, "-encoding", "binary")
  	    != TCL_OK) {
  	return TCL_ERROR;
      }
--- 267,278 ----
      unsigned char *pixelPtr, *pixLinePtr;
      char header[16 + TCL_INTEGER_SPACE * 2];
  
!     chan = Tcl_OpenFileChannel(interp, (char *) fileName, "w", 0666);
      if (chan == NULL) {
  	return TCL_ERROR;
      }
  
      if (Tcl_SetChannelOption(interp, chan, "-translation", "binary")
  	    != TCL_OK) {
  	return TCL_ERROR;
      }
*** generic/tkImgPhoto.c.orig	Tue Feb  8 12:31:33 2000
--- generic/tkImgPhoto.c	Thu Feb 17 19:52:55 2000
***************
*** 20,27 ****
--- 20,32 ----
  
  #include "tkInt.h"
  #include "tkPort.h"
+ #ifdef MAC_TCL
  #include "tclMath.h"
+ #else
+ #include <math.h>
+ #endif
  #include <ctype.h>
+ #include <string.h>
  
  #ifdef __WIN32__
  #include "tkWinInt.h"
***************
*** 1091,1100 ****
  		!= TCL_OK) {
              return TCL_ERROR;
          }
-         if (Tcl_SetChannelOption(interp, chan, "-encoding", "binary")
- 		!= TCL_OK) {
-             return TCL_ERROR;
-         }
      
  	if (MatchFileFormat(interp, chan,
  		Tcl_GetString(options.name), options.format,
--- 1096,1101 ----
***************
*** 1705,1714 ****
  	    return TCL_ERROR;
  	}
          if (Tcl_SetChannelOption(interp, chan, "-translation", "binary")
- 		!= TCL_OK) {
-             return TCL_ERROR;
-         }
-         if (Tcl_SetChannelOption(interp, chan, "-encoding", "binary")
  		!= TCL_OK) {
              return TCL_ERROR;
          }
--- 1706,1711 ----
*** generic/tkInt.decls.orig	Thu Feb 10 09:52:34 2000
--- generic/tkInt.decls	Wed Feb 16 23:08:43 2000
***************
*** 287,293 ****
  }
  
  declare 58 generic {
!     void TkpDisplayWarning (char *msg, char *title)
  }
  
  declare 59 generic {
--- 287,293 ----
  }
  
  declare 58 generic {
!     void TkpDisplayWarning (CONST char *msg, CONST char *title)
  }
  
  declare 59 generic {
***************
*** 629,634 ****
--- 629,663 ----
  }
  
  
+ declare 139 generic {
+     int  TkTextGetIndex (Tcl_Interp *interp, struct TkText *textPtr, \
+ 	    char *string, struct TkTextIndex *indexPtr)
+ }
+ 
+ declare 140 generic {
+     void  TkTextIndexBackBytes (CONST struct TkTextIndex *srcPtr, \
+ 	    int count, struct TkTextIndex *dstPtr)
+ }
+ 
+ declare 141 generic {
+     void  TkTextIndexForwBytes (CONST struct TkTextIndex *srcPtr, \
+ 	    int count, struct TkTextIndex *dstPtr)
+ }
+ 
+ declare 142 generic {
+     struct TkTextIndex *  TkTextMakeByteIndex (struct TkTextBTree_ *tree, \
+ 	    int lineIndex, int byteIndex, struct TkTextIndex *indexPtr)
+ }
+ 
+ declare 143 generic {
+     void  TkTextPrintIndex (CONST struct TkTextIndex *indexPtr, char *string)
+ }
+ 
+ declare 144 generic {
+     struct TkTextSegment * TkTextSetMark (struct TkText *textPtr, char *name, \
+ 			    struct TkTextIndex *indexPtr)
+ }
+ 
  ##############################################################################
  
  # Define the platform specific internal Tcl interface. These functions are
***************
*** 671,676 ****
--- 700,714 ----
      void TkUnixSetMenubar (Tk_Window tkwin, Tk_Window menubar)
  }
  
+ declare 8 unix {
+     int TkpTestembedCmd (ClientData clientdata, Tcl_Interp *interp, \
+ 	    int argc, char **argv)
+ }
+ 
+ declare 9 unix {
+     int TkpGetSendSerial (void)
+ }
+ 
  ############################
  # Windows specific functions
  
***************
*** 814,819 ****
--- 852,862 ----
      int TkWinGetPlatformId(void)
  }
  
+ declare 34 win {
+     int TkpTestembedCmd (ClientData clietdata, Tcl_Interp *interp, \
+ 	    int argc, char **argv)
+ }
+ 
  ########################
  # Mac specific functions
  
***************
*** 1044,1049 ****
--- 1087,1096 ----
      void TkMacPreprocessMenu (void)
  }
  
+ declare 66 mac {
+     int TkpTestembedCmd (ClientData clietdata, Tcl_Interp *interp, \
+ 	    int argc, char **argv)
+ }
  
  ##############################################################################
  
*** generic/tkInt.h.orig	Fri Jan 21 04:54:41 2000
--- generic/tkInt.h	Wed Feb 16 23:08:43 2000
***************
*** 481,486 ****
--- 481,499 ----
  
  #ifdef TK_USE_INPUT_METHODS
      XIM inputMethod;		/* Input method for this display */
+ #ifdef I18N_IMPROVE
+     Tcl_Encoding imEncoding;	/* Tcl encoding when the first Tcl
+ 				 * interp was created.
+ 				 * For encoding conversion from
+ 				 * XmbLookupString() to UTF.
+ 				 */
+     XIC lastFocusedIC;		/* The last focused input context on
+ 				 * the display.
+ 				 */
+ #ifdef XNDestroyCallback
+     XIMCallback destroyCallback;
+ #endif /* XNDestroyCallback */
+ #endif /* I18N_IMPROVE */
  #endif /* TK_USE_INPUT_METHODS */
      Tcl_HashTable winTable;	/* Maps from X window ids to TkWindow ptrs. */
  
***************
*** 999,1007 ****
  EXTERN int		Tk_WmCmd _ANSI_ARGS_((ClientData clientData,
  			    Tcl_Interp *interp, int argc, char **argv));
  
- void	TkConsolePrint _ANSI_ARGS_((Tcl_Interp *interp,
- 			    int devId, char *buffer, long size));
- 
  EXTERN void		TkEventInit _ANSI_ARGS_((void));
  
  EXTERN int		TkCreateMenuCmd _ANSI_ARGS_((Tcl_Interp *interp));
--- 1012,1017 ----
***************
*** 1080,1085 ****
--- 1090,1110 ----
   */
  EXTERN int		TkUnsupported1Cmd _ANSI_ARGS_((ClientData clientData,
  			    Tcl_Interp *interp, int argc, char **argv));
+ 
+ #if defined(TK_USE_INPUT_METHODS) && defined(I18N_IMPROVE)
+ EXTERN XIC		TkpCreateIC _ANSI_ARGS_((TkWindow *winPtr));
+ EXTERN void		TkpDestroyIC _ANSI_ARGS_((TkWindow *winPtr, int needDestroy));
+ EXTERN int		Tk_ImconfigureObjCmd _ANSI_ARGS_((ClientData clientData,
+ 			    Tcl_Interp *interp, int objc,
+ 			    Tcl_Obj *CONST objv[]));
+ #endif
+ 
+ # undef TCL_STORAGE_CLASS
+ # define TCL_STORAGE_CLASS
+ 
+ EXTERN int	TkConsoleInit _ANSI_ARGS_((Tcl_Interp *interp));
+ EXTERN void	TkConsolePrint _ANSI_ARGS_((Tcl_Interp *interp,
+ 			    int devId, char *buffer, long size));
  
  # undef TCL_STORAGE_CLASS
  # define TCL_STORAGE_CLASS DLLIMPORT
*** generic/tkIntDecls.h.orig	Wed Feb  9 03:13:51 2000
--- generic/tkIntDecls.h	Wed Feb 16 23:08:44 2000
***************
*** 22,27 ****
--- 22,31 ----
  #define TCL_STORAGE_CLASS DLLEXPORT
  #endif
  
+ struct TkText;
+ struct TkTextIndex;
+ struct TkTextBTree_;
+ 
  /*
   * WARNING: This file is automatically generated by the tools/genStubs.tcl
   * script.  Any modifications to the function declarations below should be made
***************
*** 214,221 ****
  EXTERN void		TkpClaimFocus _ANSI_ARGS_((TkWindow * topLevelPtr, 
  				int force));
  /* 58 */
! EXTERN void		TkpDisplayWarning _ANSI_ARGS_((char * msg, 
! 				char * title));
  /* 59 */
  EXTERN void		TkpGetAppName _ANSI_ARGS_((Tcl_Interp * interp, 
  				Tcl_DString * name));
--- 218,225 ----
  EXTERN void		TkpClaimFocus _ANSI_ARGS_((TkWindow * topLevelPtr, 
  				int force));
  /* 58 */
! EXTERN void		TkpDisplayWarning _ANSI_ARGS_((CONST char * msg, 
! 				CONST char * title));
  /* 59 */
  EXTERN void		TkpGetAppName _ANSI_ARGS_((Tcl_Interp * interp, 
  				Tcl_DString * name));
***************
*** 512,517 ****
--- 516,545 ----
  /* 138 */
  EXTERN KeySym		TkpGetKeySym _ANSI_ARGS_((TkDisplay * dispPtr, 
  				XEvent * eventPtr));
+ /* 139 */
+ EXTERN int		TkTextGetIndex _ANSI_ARGS_((Tcl_Interp * interp, 
+ 				struct TkText * textPtr, char * string, 
+ 				struct TkTextIndex * indexPtr));
+ /* 140 */
+ EXTERN void		TkTextIndexBackBytes _ANSI_ARGS_((
+ 				CONST struct TkTextIndex * srcPtr, int count, 
+ 				struct TkTextIndex * dstPtr));
+ /* 141 */
+ EXTERN void		TkTextIndexForwBytes _ANSI_ARGS_((
+ 				CONST struct TkTextIndex * srcPtr, int count, 
+ 				struct TkTextIndex * dstPtr));
+ /* 142 */
+ EXTERN struct TkTextIndex * TkTextMakeByteIndex _ANSI_ARGS_((
+ 				struct TkTextBTree_ * tree, int lineIndex, 
+ 				int byteIndex, struct TkTextIndex * indexPtr));
+ /* 143 */
+ EXTERN void		TkTextPrintIndex _ANSI_ARGS_((
+ 				CONST struct TkTextIndex * indexPtr, 
+ 				char * string));
+ /* 144 */
+ EXTERN struct TkTextSegment * TkTextSetMark _ANSI_ARGS_((
+ 				struct TkText * textPtr, char * name, 
+ 				struct TkTextIndex * indexPtr));
  
  typedef struct TkIntStubs {
      int magic;
***************
*** 575,581 ****
      int (*tkpChangeFocus) _ANSI_ARGS_((TkWindow * winPtr, int force)); /* 55 */
      void (*tkpCloseDisplay) _ANSI_ARGS_((TkDisplay * dispPtr)); /* 56 */
      void (*tkpClaimFocus) _ANSI_ARGS_((TkWindow * topLevelPtr, int force)); /* 57 */
!     void (*tkpDisplayWarning) _ANSI_ARGS_((char * msg, char * title)); /* 58 */
      void (*tkpGetAppName) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_DString * name)); /* 59 */
      TkWindow * (*tkpGetOtherWindow) _ANSI_ARGS_((TkWindow * winPtr)); /* 60 */
      TkWindow * (*tkpGetWrapperWindow) _ANSI_ARGS_((TkWindow * winPtr)); /* 61 */
--- 603,609 ----
      int (*tkpChangeFocus) _ANSI_ARGS_((TkWindow * winPtr, int force)); /* 55 */
      void (*tkpCloseDisplay) _ANSI_ARGS_((TkDisplay * dispPtr)); /* 56 */
      void (*tkpClaimFocus) _ANSI_ARGS_((TkWindow * topLevelPtr, int force)); /* 57 */
!     void (*tkpDisplayWarning) _ANSI_ARGS_((CONST char * msg, CONST char * title)); /* 58 */
      void (*tkpGetAppName) _ANSI_ARGS_((Tcl_Interp * interp, Tcl_DString * name)); /* 59 */
      TkWindow * (*tkpGetOtherWindow) _ANSI_ARGS_((TkWindow * winPtr)); /* 60 */
      TkWindow * (*tkpGetWrapperWindow) _ANSI_ARGS_((TkWindow * winPtr)); /* 61 */
***************
*** 816,821 ****
--- 844,855 ----
      void (*tkSetFocusWin) _ANSI_ARGS_((TkWindow * winPtr, int force)); /* 136 */
      void (*tkpSetKeycodeAndState) _ANSI_ARGS_((Tk_Window tkwin, KeySym keySym, XEvent * eventPtr)); /* 137 */
      KeySym (*tkpGetKeySym) _ANSI_ARGS_((TkDisplay * dispPtr, XEvent * eventPtr)); /* 138 */
+     int (*tkTextGetIndex) _ANSI_ARGS_((Tcl_Interp * interp, struct TkText * textPtr, char * string, struct TkTextIndex * indexPtr)); /* 139 */
+     void (*tkTextIndexBackBytes) _ANSI_ARGS_((CONST struct TkTextIndex * srcPtr, int count, struct TkTextIndex * dstPtr)); /* 140 */
+     void (*tkTextIndexForwBytes) _ANSI_ARGS_((CONST struct TkTextIndex * srcPtr, int count, struct TkTextIndex * dstPtr)); /* 141 */
+     struct TkTextIndex * (*tkTextMakeByteIndex) _ANSI_ARGS_((struct TkTextBTree_ * tree, int lineIndex, int byteIndex, struct TkTextIndex * indexPtr)); /* 142 */
+     void (*tkTextPrintIndex) _ANSI_ARGS_((CONST struct TkTextIndex * indexPtr, char * string)); /* 143 */
+     struct TkTextSegment * (*tkTextSetMark) _ANSI_ARGS_((struct TkText * textPtr, char * name, struct TkTextIndex * indexPtr)); /* 144 */
  } TkIntStubs;
  
  #ifdef __cplusplus
***************
*** 1463,1468 ****
--- 1497,1526 ----
  #ifndef TkpGetKeySym
  #define TkpGetKeySym \
  	(tkIntStubsPtr->tkpGetKeySym) /* 138 */
+ #endif
+ #ifndef TkTextGetIndex
+ #define TkTextGetIndex \
+ 	(tkIntStubsPtr->tkTextGetIndex) /* 139 */
+ #endif
+ #ifndef TkTextIndexBackBytes
+ #define TkTextIndexBackBytes \
+ 	(tkIntStubsPtr->tkTextIndexBackBytes) /* 140 */
+ #endif
+ #ifndef TkTextIndexForwBytes
+ #define TkTextIndexForwBytes \
+ 	(tkIntStubsPtr->tkTextIndexForwBytes) /* 141 */
+ #endif
+ #ifndef TkTextMakeByteIndex
+ #define TkTextMakeByteIndex \
+ 	(tkIntStubsPtr->tkTextMakeByteIndex) /* 142 */
+ #endif
+ #ifndef TkTextPrintIndex
+ #define TkTextPrintIndex \
+ 	(tkIntStubsPtr->tkTextPrintIndex) /* 143 */
+ #endif
+ #ifndef TkTextSetMark
+ #define TkTextSetMark \
+ 	(tkIntStubsPtr->tkTextSetMark) /* 144 */
  #endif
  
  #endif /* defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) */
*** generic/tkIntPlatDecls.h.orig	Tue Dec  7 04:51:05 1999
--- generic/tkIntPlatDecls.h	Wed Feb 16 23:08:44 2000
***************
*** 52,57 ****
--- 52,62 ----
  /* 7 */
  EXTERN void		TkUnixSetMenubar _ANSI_ARGS_((Tk_Window tkwin, 
  				Tk_Window menubar));
+ /* 8 */
+ EXTERN int		TkpTestembedCmd _ANSI_ARGS_((ClientData clientdata, 
+ 				Tcl_Interp * interp, int argc, char ** argv));
+ /* 9 */
+ EXTERN int		TkpGetSendSerial _ANSI_ARGS_((void));
  #endif /* UNIX */
  #ifdef __WIN32__
  /* 0 */
***************
*** 142,147 ****
--- 147,155 ----
  				char * className));
  /* 33 */
  EXTERN int		TkWinGetPlatformId _ANSI_ARGS_((void));
+ /* 34 */
+ EXTERN int		TkpTestembedCmd _ANSI_ARGS_((ClientData clietdata, 
+ 				Tcl_Interp * interp, int argc, char ** argv));
  #endif /* __WIN32__ */
  #ifdef MAC_TCL
  /* 0 */
***************
*** 292,297 ****
--- 300,308 ----
  EXTERN MacDrawable *	TkMacGetHostToplevel _ANSI_ARGS_((TkWindow * winPtr));
  /* 65 */
  EXTERN void		TkMacPreprocessMenu _ANSI_ARGS_((void));
+ /* 66 */
+ EXTERN int		TkpTestembedCmd _ANSI_ARGS_((ClientData clietdata, 
+ 				Tcl_Interp * interp, int argc, char ** argv));
  #endif /* MAC_TCL */
  
  typedef struct TkIntPlatStubs {
***************
*** 307,312 ****
--- 318,325 ----
      Window (*tkUnixContainerId) _ANSI_ARGS_((TkWindow * winPtr)); /* 5 */
      int (*tkUnixDoOneXEvent) _ANSI_ARGS_((Tcl_Time * timePtr)); /* 6 */
      void (*tkUnixSetMenubar) _ANSI_ARGS_((Tk_Window tkwin, Tk_Window menubar)); /* 7 */
+     int (*tkpTestembedCmd) _ANSI_ARGS_((ClientData clientdata, Tcl_Interp * interp, int argc, char ** argv)); /* 8 */
+     int (*tkpGetSendSerial) _ANSI_ARGS_((void)); /* 9 */
  #endif /* UNIX */
  #ifdef __WIN32__
      char * (*tkAlignImageData) _ANSI_ARGS_((XImage * image, int alignment, int bitOrder)); /* 0 */
***************
*** 343,348 ****
--- 356,362 ----
      void (*tkWinDialogDebug) _ANSI_ARGS_((int debug)); /* 31 */
      Tcl_Obj * (*tkWinGetMenuSystemDefault) _ANSI_ARGS_((Tk_Window tkwin, char * dbName, char * className)); /* 32 */
      int (*tkWinGetPlatformId) _ANSI_ARGS_((void)); /* 33 */
+     int (*tkpTestembedCmd) _ANSI_ARGS_((ClientData clietdata, Tcl_Interp * interp, int argc, char ** argv)); /* 34 */
  #endif /* __WIN32__ */
  #ifdef MAC_TCL
      void (*tkGenerateActivateEvents) _ANSI_ARGS_((TkWindow * winPtr, int active)); /* 0 */
***************
*** 411,416 ****
--- 425,431 ----
      MacDrawable * (*tkMacContainerId) _ANSI_ARGS_((TkWindow * winPtr)); /* 63 */
      MacDrawable * (*tkMacGetHostToplevel) _ANSI_ARGS_((TkWindow * winPtr)); /* 64 */
      void (*tkMacPreprocessMenu) _ANSI_ARGS_((void)); /* 65 */
+     int (*tkpTestembedCmd) _ANSI_ARGS_((ClientData clietdata, Tcl_Interp * interp, int argc, char ** argv)); /* 66 */
  #endif /* MAC_TCL */
  } TkIntPlatStubs;
  
***************
*** 461,466 ****
--- 476,489 ----
  #define TkUnixSetMenubar \
  	(tkIntPlatStubsPtr->tkUnixSetMenubar) /* 7 */
  #endif
+ #ifndef TkpTestembedCmd
+ #define TkpTestembedCmd \
+ 	(tkIntPlatStubsPtr->tkpTestembedCmd) /* 8 */
+ #endif
+ #ifndef TkpGetSendSerial
+ #define TkpGetSendSerial \
+ 	(tkIntPlatStubsPtr->tkpGetSendSerial) /* 9 */
+ #endif
  #endif /* UNIX */
  #ifdef __WIN32__
  #ifndef TkAlignImageData
***************
*** 596,601 ****
--- 619,628 ----
  #define TkWinGetPlatformId \
  	(tkIntPlatStubsPtr->tkWinGetPlatformId) /* 33 */
  #endif
+ #ifndef TkpTestembedCmd
+ #define TkpTestembedCmd \
+ 	(tkIntPlatStubsPtr->tkpTestembedCmd) /* 34 */
+ #endif
  #endif /* __WIN32__ */
  #ifdef MAC_TCL
  #ifndef TkGenerateActivateEvents
***************
*** 831,836 ****
--- 858,867 ----
  #ifndef TkMacPreprocessMenu
  #define TkMacPreprocessMenu \
  	(tkIntPlatStubsPtr->tkMacPreprocessMenu) /* 65 */
+ #endif
+ #ifndef TkpTestembedCmd
+ #define TkpTestembedCmd \
+ 	(tkIntPlatStubsPtr->tkpTestembedCmd) /* 66 */
  #endif
  #endif /* MAC_TCL */
  
*** generic/tkMain.c.orig	Wed Dec  8 01:11:54 1999
--- generic/tkMain.c	Wed Feb 16 23:08:44 2000
***************
*** 58,65 ****
  extern int		isatty _ANSI_ARGS_((int fd));
  extern char *		strrchr _ANSI_ARGS_((CONST char *string, int c));
  #endif
! extern void		TkpDisplayWarning _ANSI_ARGS_((char *msg,
! 			    char *title));
  
  /*
   * Forward declarations for procedures defined later in this file.
--- 58,65 ----
  extern int		isatty _ANSI_ARGS_((int fd));
  extern char *		strrchr _ANSI_ARGS_((CONST char *string, int c));
  #endif
! extern void		TkpDisplayWarning _ANSI_ARGS_((CONST char *msg,
! 			    CONST char *title));
  
  /*
   * Forward declarations for procedures defined later in this file.
***************
*** 411,416 ****
--- 411,417 ----
  	partial ? "tcl_prompt2" : "tcl_prompt1", TCL_GLOBAL_ONLY);
      if (promptCmd == NULL) {
  defaultPrompt:
+ 	outChannel = Tcl_GetChannel(interp, "stdout", NULL);
  	if (!partial) {
  
              /*
***************
*** 419,431 ****
               * this interpreter with "interp transfer".
               */
  
- 	    outChannel = Tcl_GetChannel(interp, "stdout", NULL);
              if (outChannel != (Tcl_Channel) NULL) {
                  Tcl_WriteChars(outChannel, "% ", 2);
              }
  	}
      } else {
  	code = Tcl_Eval(interp, promptCmd);
  	if (code != TCL_OK) {
  	    Tcl_AddErrorInfo(interp,
  		    "\n    (script that generates prompt)");
--- 420,432 ----
               * this interpreter with "interp transfer".
               */
  
              if (outChannel != (Tcl_Channel) NULL) {
                  Tcl_WriteChars(outChannel, "% ", 2);
              }
  	}
      } else {
  	code = Tcl_Eval(interp, promptCmd);
+ 	outChannel = Tcl_GetChannel(interp, "stdout", NULL);
  	if (code != TCL_OK) {
  	    Tcl_AddErrorInfo(interp,
  		    "\n    (script that generates prompt)");
***************
*** 441,446 ****
--- 442,449 ----
                  Tcl_WriteChars(errChannel, "\n", 1);
              }
  	    goto defaultPrompt;
+ 	} else if (*Tcl_GetStringResult(interp) && outChannel) {
+ 	    Tcl_Write(outChannel, Tcl_GetStringResult(interp), -1);
  	}
      }
      outChannel = Tcl_GetChannel(interp, "stdout", NULL);
*** generic/tkScale.c.orig	Tue Feb  1 12:41:10 2000
--- generic/tkScale.c	Wed Feb 16 23:08:44 2000
***************
*** 24,30 ****
--- 24,34 ----
  #include "tkPort.h"
  #include "default.h"
  #include "tkInt.h"
+ #ifdef MAC_TCL
  #include "tclMath.h"
+ #else
+ #include <math.h>
+ #endif
  #include "tkScale.h"
  
  /*
*** generic/tkSquare.c.orig	Fri Apr 16 03:51:22 1999
--- generic/tkSquare.c	Wed Feb 16 23:08:45 2000
***************
*** 15,25 ****
--- 15,42 ----
   * RCS: @(#) $Id: tkSquare.c,v 1.3 1999/04/16 01:51:22 stanton Exp $
   */
  
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+ 
  #include "tkPort.h"
  #define __NO_OLD_CONFIG
  #include "tk.h"
  #include "tkInt.h"
  
+ #ifdef __cplusplus
+ }
+ #endif
+ 
+ /*
+  * TCL_STORAGE_CLASS is set unconditionally to DLLEXPORT because the
+  * Tksquare_Init declaration is in the source file itself, which is only
+  * accessed when we are building a library.
+  */
+ 
+ #undef TCL_STORAGE_CLASS
+ #define TCL_STORAGE_CLASS DLLEXPORT
+ 
  /*
   * A data structure of the following type is kept for each square
   * widget managed by this file:
***************
*** 107,112 ****
--- 124,178 ----
  static int		SquareWidgetCmd _ANSI_ARGS_((ClientData clientData,
  			    Tcl_Interp *, int objc, Tcl_Obj * CONST objv[]));
  
+ /*
+  *----------------------------------------------------------------------
+  *
+  * Tksquare_Init --
+  *
+  *	This procedure performs intialization for the Tk square
+  *	exension.
+  *
+  * Results:
+  *	Returns a standard Tcl completion code, and leaves an error
+  *	message in interp->result if an error occurs.
+  *
+  * Side effects:
+  *	Creates several test commands.
+  *
+  *----------------------------------------------------------------------
+  */
+ 
+ EXTERN Tksquare_Init _ANSI_ARGS_((Tcl_Interp *interp));
+ 
+ int
+ #ifdef _USING_PROTOTYPES_
+ Tksquare_Init (
+     Tcl_Interp *interp)		/* Interpreter for application. */
+ #else
+ Tksquare_Init(interp)
+     Tcl_Interp *interp;		/* Interpreter for application. */
+ #endif
+ {
+     /*
+      * Create the square command.
+      */
+ 
+     if (Tcl_InitStubs(interp, TCL_VERSION, 1) == NULL) {
+ 	return TCL_ERROR;
+     }
+     if (Tk_InitStubs(interp, TK_VERSION, 1) == NULL) {
+ 	return TCL_ERROR;
+     }
+     if (Tcl_PkgProvide(interp, "Tksquare", TK_VERSION) != TCL_OK) {
+ 	return TCL_ERROR;
+     }
+ 
+     Tcl_CreateObjCommand(interp, "square", SquareObjCmd,
+ 	    (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
+ 
+     return TCL_OK;
+ }
+ 
  /*
   *--------------------------------------------------------------
   *
*** generic/tkStubInit.c.orig	Thu Feb 10 09:52:36 2000
--- generic/tkStubInit.c	Wed Feb 16 23:08:45 2000
***************
*** 346,351 ****
--- 346,357 ----
      TkSetFocusWin, /* 136 */
      TkpSetKeycodeAndState, /* 137 */
      TkpGetKeySym, /* 138 */
+     TkTextGetIndex, /* 139 */
+     TkTextIndexBackBytes, /* 140 */
+     TkTextIndexForwBytes, /* 141 */
+     TkTextMakeByteIndex, /* 142 */
+     TkTextPrintIndex, /* 143 */
+     TkTextSetMark, /* 144 */
  };
  
  TkIntPlatStubs tkIntPlatStubs = {
***************
*** 360,365 ****
--- 366,373 ----
      TkUnixContainerId, /* 5 */
      TkUnixDoOneXEvent, /* 6 */
      TkUnixSetMenubar, /* 7 */
+     TkpTestembedCmd, /* 8 */
+     TkpGetSendSerial, /* 9 */
  #endif /* UNIX */
  #ifdef __WIN32__
      TkAlignImageData, /* 0 */
***************
*** 396,401 ****
--- 404,410 ----
      TkWinDialogDebug, /* 31 */
      TkWinGetMenuSystemDefault, /* 32 */
      TkWinGetPlatformId, /* 33 */
+     TkpTestembedCmd, /* 34 */
  #endif /* __WIN32__ */
  #ifdef MAC_TCL
      TkGenerateActivateEvents, /* 0 */
***************
*** 464,469 ****
--- 473,479 ----
      TkMacContainerId, /* 63 */
      TkMacGetHostToplevel, /* 64 */
      TkMacPreprocessMenu, /* 65 */
+     TkpTestembedCmd, /* 66 */
  #endif /* MAC_TCL */
  };
  
*** generic/tkTest.c.orig	Thu Feb 10 09:52:36 2000
--- generic/tkTest.c	Wed Feb 16 23:08:45 2000
***************
*** 16,27 ****
   * RCS: @(#) $Id: tkTest.c,v 1.11 2000/02/10 08:52:36 hobbs Exp $
   */
  
  #include "tkInt.h"
  #include "tkPort.h"
- #include "tkText.h"
  
  #ifdef __WIN32__
  #include "tkWinInt.h"
  #endif
  
  #ifdef MAC_TCL
--- 16,29 ----
   * RCS: @(#) $Id: tkTest.c,v 1.11 2000/02/10 08:52:36 hobbs Exp $
   */
  
+ #include "tk.h"
+ #include "tkText.h"
  #include "tkInt.h"
  #include "tkPort.h"
  
  #ifdef __WIN32__
  #include "tkWinInt.h"
+ #include "tkScrollbar.h"
  #endif
  
  #ifdef MAC_TCL
***************
*** 33,38 ****
--- 35,57 ----
  #endif
  
  /*
+  * TCL_STORAGE_CLASS is set unconditionally to DLLEXPORT because the
+  * Tktest_Init declaration is in the source file itself, which is only
+  * accessed when we are building a library.
+  */
+ 
+ #undef TCL_STORAGE_CLASS
+ #define TCL_STORAGE_CLASS DLLEXPORT
+ 
+ #ifdef __cplusplus
+ }
+ #define dummy  /* */
+ #define dummy2 /* */
+ #define dummy3 /* */
+ #define dummy4 /* */
+ #endif
+ 
+ /*
   * The following data structure represents the master for a test
   * image:
   */
***************
*** 105,124 ****
      struct NewApp *nextPtr;	/* Next in list of new interpreters. */
  } NewApp;
  
! static NewApp *newAppPtr = NULL;
  				/* First in list of all new interpreters. */
  
- /*
-  * Declaration for the square widget's class command procedure:
-  */
- 
- extern int SquareObjCmd _ANSI_ARGS_((ClientData clientData,
- 	Tcl_Interp *interp, int objc, Tcl_Obj * CONST objv[]));
  
  typedef struct CBinding {
      Tcl_Interp *interp;
      char *command;
!     char *delete;
  } CBinding;
  
  /*
--- 124,137 ----
      struct NewApp *nextPtr;	/* Next in list of new interpreters. */
  } NewApp;
  
! static NewApp *newAppPtr = (NewApp *) NULL;
  				/* First in list of all new interpreters. */
  
  
  typedef struct CBinding {
      Tcl_Interp *interp;
      char *command;
!     char *del;
  } CBinding;
  
  /*
***************
*** 155,161 ****
  			    Tcl_Interp *interp, XEvent *eventPtr,
  			    Tk_Window tkwin, KeySym keySym));
  static void		CBindingFreeProc _ANSI_ARGS_((ClientData clientData));
! int			Tktest_Init _ANSI_ARGS_((Tcl_Interp *interp));
  static int		ImageCmd _ANSI_ARGS_((ClientData dummy,
  			    Tcl_Interp *interp, int argc, char **argv));
  static int		TestcbindCmd _ANSI_ARGS_((ClientData dummy,
--- 168,174 ----
  			    Tcl_Interp *interp, XEvent *eventPtr,
  			    Tk_Window tkwin, KeySym keySym));
  static void		CBindingFreeProc _ANSI_ARGS_((ClientData clientData));
! EXTERN int		Tktest_Init _ANSI_ARGS_((Tcl_Interp *interp));
  static int		ImageCmd _ANSI_ARGS_((ClientData dummy,
  			    Tcl_Interp *interp, int argc, char **argv));
  static int		TestcbindCmd _ANSI_ARGS_((ClientData dummy,
***************
*** 173,179 ****
  			    Tcl_Interp *interp, int objc,
  			    Tcl_Obj * CONST objv[]));
  static int		TestdeleteappsCmd _ANSI_ARGS_((ClientData dummy,
! 			    Tcl_Interp *interp, int argc, char **argv));
  static int		TestfontObjCmd _ANSI_ARGS_((ClientData dummy,
  			    Tcl_Interp *interp, int objc,
  			    Tcl_Obj *CONST objv[]));
--- 186,193 ----
  			    Tcl_Interp *interp, int objc,
  			    Tcl_Obj * CONST objv[]));
  static int		TestdeleteappsCmd _ANSI_ARGS_((ClientData dummy,
! 			    Tcl_Interp *interp, int objc,
! 			    Tcl_Obj * CONST objv[]));
  static int		TestfontObjCmd _ANSI_ARGS_((ClientData dummy,
  			    Tcl_Interp *interp, int objc,
  			    Tcl_Obj *CONST objv[]));
***************
*** 189,202 ****
  			    Tcl_Interp *interp, int objc,
  			    Tcl_Obj * CONST objv[]));
  static int		TestpropCmd _ANSI_ARGS_((ClientData dummy,
! 			    Tcl_Interp *interp, int argc, char **argv));
  static int		TestsendCmd _ANSI_ARGS_((ClientData dummy,
  			    Tcl_Interp *interp, int argc, char **argv));
  static int		TesttextCmd _ANSI_ARGS_((ClientData dummy,
  			    Tcl_Interp *interp, int argc, char **argv));
  #if !(defined(__WIN32__) || defined(MAC_TCL))
  static int		TestwrapperCmd _ANSI_ARGS_((ClientData dummy,
! 			    Tcl_Interp *interp, int argc, char **argv));
  #endif
  static void		TrivialCmdDeletedProc _ANSI_ARGS_((
  			    ClientData clientData));
--- 203,218 ----
  			    Tcl_Interp *interp, int objc,
  			    Tcl_Obj * CONST objv[]));
  static int		TestpropCmd _ANSI_ARGS_((ClientData dummy,
! 			    Tcl_Interp *interp, int objc,
! 			    Tcl_Obj * CONST objv[]));
  static int		TestsendCmd _ANSI_ARGS_((ClientData dummy,
  			    Tcl_Interp *interp, int argc, char **argv));
  static int		TesttextCmd _ANSI_ARGS_((ClientData dummy,
  			    Tcl_Interp *interp, int argc, char **argv));
  #if !(defined(__WIN32__) || defined(MAC_TCL))
  static int		TestwrapperCmd _ANSI_ARGS_((ClientData dummy,
! 			    Tcl_Interp *interp, int objc,
! 			    Tcl_Obj * CONST objv[]));
  #endif
  static void		TrivialCmdDeletedProc _ANSI_ARGS_((
  			    ClientData clientData));
***************
*** 210,221 ****
   * External (platform specific) initialization routine:
   */
  
- extern int		TkplatformtestInit _ANSI_ARGS_((
- 			    Tcl_Interp *interp));
- extern int              TclThread_Init _ANSI_ARGS_((Tcl_Interp *interp));
- 
  #if !(defined(__WIN32__) && defined(MAC_TCL))
  #define TkplatformtestInit(x) TCL_OK
  #endif
  
  /*
--- 226,236 ----
   * External (platform specific) initialization routine:
   */
  
  #if !(defined(__WIN32__) && defined(MAC_TCL))
  #define TkplatformtestInit(x) TCL_OK
+ #else
+ extern int		TkplatformtestInit _ANSI_ARGS_((
+ 			    Tcl_Interp *interp));
  #endif
  
  /*
***************
*** 237,244 ****
--- 252,264 ----
   */
  
  int
+ #ifdef _USING_PROTOTYPES_
+ Tktest_Init (
+     Tcl_Interp *interp)		/* Interpreter for application. */
+ #else
  Tktest_Init(interp)
      Tcl_Interp *interp;		/* Interpreter for application. */
+ #endif
  {
      static int initialized = 0;
  
***************
*** 246,257 ****
       * Create additional commands for testing Tk.
       */
  
      if (Tcl_PkgProvide(interp, "Tktest", TK_VERSION) == TCL_ERROR) {
          return TCL_ERROR;
      }
  
-     Tcl_CreateObjCommand(interp, "square", SquareObjCmd,
- 	    (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
      Tcl_CreateCommand(interp, "testcbind", TestcbindCmd,
  	    (ClientData) Tk_MainWindow(interp), (Tcl_CmdDeleteProc *) NULL);
      Tcl_CreateObjCommand(interp, "testbitmap", TestbitmapObjCmd,
--- 266,281 ----
       * Create additional commands for testing Tk.
       */
  
+     if (Tcl_InitStubs(interp, TCL_VERSION, 1) == NULL) {
+ 	return TCL_ERROR;
+     }
+     if (Tk_InitStubs(interp, TK_VERSION, 1) == NULL) {
+ 	return TCL_ERROR;
+     }
      if (Tcl_PkgProvide(interp, "Tktest", TK_VERSION) == TCL_ERROR) {
          return TCL_ERROR;
      }
  
      Tcl_CreateCommand(interp, "testcbind", TestcbindCmd,
  	    (ClientData) Tk_MainWindow(interp), (Tcl_CmdDeleteProc *) NULL);
      Tcl_CreateObjCommand(interp, "testbitmap", TestbitmapObjCmd,
***************
*** 262,268 ****
  	    (ClientData) Tk_MainWindow(interp), (Tcl_CmdDeleteProc *) NULL);
      Tcl_CreateObjCommand(interp, "testcursor", TestcursorObjCmd,
  	    (ClientData) Tk_MainWindow(interp), (Tcl_CmdDeleteProc *) NULL);
!     Tcl_CreateCommand(interp, "testdeleteapps", TestdeleteappsCmd,
  	    (ClientData) Tk_MainWindow(interp), (Tcl_CmdDeleteProc *) NULL);
      Tcl_CreateCommand(interp, "testembed", TkpTestembedCmd,
  	    (ClientData) Tk_MainWindow(interp), (Tcl_CmdDeleteProc *) NULL);
--- 286,292 ----
  	    (ClientData) Tk_MainWindow(interp), (Tcl_CmdDeleteProc *) NULL);
      Tcl_CreateObjCommand(interp, "testcursor", TestcursorObjCmd,
  	    (ClientData) Tk_MainWindow(interp), (Tcl_CmdDeleteProc *) NULL);
!     Tcl_CreateObjCommand(interp, "testdeleteapps", TestdeleteappsCmd,
  	    (ClientData) Tk_MainWindow(interp), (Tcl_CmdDeleteProc *) NULL);
      Tcl_CreateCommand(interp, "testembed", TkpTestembedCmd,
  	    (ClientData) Tk_MainWindow(interp), (Tcl_CmdDeleteProc *) NULL);
***************
*** 278,299 ****
      Tcl_CreateCommand(interp, "testmetrics", TestmetricsCmd,
  	    (ClientData) Tk_MainWindow(interp), (Tcl_CmdDeleteProc *) NULL);
  #endif
!     Tcl_CreateCommand(interp, "testprop", TestpropCmd,
  	    (ClientData) Tk_MainWindow(interp), (Tcl_CmdDeleteProc *) NULL);
      Tcl_CreateCommand(interp, "testsend", TestsendCmd,
  	    (ClientData) Tk_MainWindow(interp), (Tcl_CmdDeleteProc *) NULL);
      Tcl_CreateCommand(interp, "testtext", TesttextCmd,
  	    (ClientData) Tk_MainWindow(interp), (Tcl_CmdDeleteProc *) NULL);
  #if !(defined(__WIN32__) || defined(MAC_TCL))
!     Tcl_CreateCommand(interp, "testwrapper", TestwrapperCmd,
  	    (ClientData) Tk_MainWindow(interp), (Tcl_CmdDeleteProc *) NULL);
  #endif
- 
- #ifdef TCL_THREADS
-     if (TclThread_Init(interp) != TCL_OK) {
- 	return TCL_ERROR;
-     }
- #endif
      
      /*
       * Create test image type.
--- 302,317 ----
      Tcl_CreateCommand(interp, "testmetrics", TestmetricsCmd,
  	    (ClientData) Tk_MainWindow(interp), (Tcl_CmdDeleteProc *) NULL);
  #endif
!     Tcl_CreateObjCommand(interp, "testprop", TestpropCmd,
  	    (ClientData) Tk_MainWindow(interp), (Tcl_CmdDeleteProc *) NULL);
      Tcl_CreateCommand(interp, "testsend", TestsendCmd,
  	    (ClientData) Tk_MainWindow(interp), (Tcl_CmdDeleteProc *) NULL);
      Tcl_CreateCommand(interp, "testtext", TesttextCmd,
  	    (ClientData) Tk_MainWindow(interp), (Tcl_CmdDeleteProc *) NULL);
  #if !(defined(__WIN32__) || defined(MAC_TCL))
!     Tcl_CreateObjCommand(interp, "testwrapper", TestwrapperCmd,
  	    (ClientData) Tk_MainWindow(interp), (Tcl_CmdDeleteProc *) NULL);
  #endif
      
      /*
       * Create test image type.
***************
*** 329,339 ****
--- 347,365 ----
   */
  
  static int
+ #ifdef _USING_PROTOTYPES_
+ TestcbindCmd (
+     ClientData clientData,		/* Main window for application. */
+     Tcl_Interp *interp,			/* Current interpreter. */
+     int argc,				/* Number of arguments. */
+     char **argv)			/* Argument strings. */
+ #else
  TestcbindCmd(clientData, interp, argc, argv)
      ClientData clientData;		/* Main window for application. */
      Tcl_Interp *interp;			/* Current interpreter. */
      int argc;				/* Number of arguments. */
      char **argv;			/* Argument strings. */
+ #endif
  {
      TkWindow *winPtr;
      Tk_Window tkwin;
***************
*** 370,378 ****
      cbindPtr->command =
  	    strcpy((char *) ckalloc(strlen(argv[3]) + 1), argv[3]);
      if (argc == 4) {
! 	cbindPtr->delete = NULL;
      } else {
! 	cbindPtr->delete =
  		strcpy((char *) ckalloc(strlen(argv[4]) + 1), argv[4]);
      }
  
--- 396,404 ----
      cbindPtr->command =
  	    strcpy((char *) ckalloc(strlen(argv[3]) + 1), argv[3]);
      if (argc == 4) {
! 	cbindPtr->del = NULL;
      } else {
! 	cbindPtr->del =
  		strcpy((char *) ckalloc(strlen(argv[4]) + 1), argv[4]);
      }
  
***************
*** 380,387 ****
  	    object, argv[2], CBindingEvalProc, CBindingFreeProc,
  	    (ClientData) cbindPtr) == 0) {
  	ckfree((char *) cbindPtr->command);
! 	if (cbindPtr->delete != NULL) {
! 	    ckfree((char *) cbindPtr->delete);
  	}
  	ckfree((char *) cbindPtr);
  	return TCL_ERROR;
--- 406,413 ----
  	    object, argv[2], CBindingEvalProc, CBindingFreeProc,
  	    (ClientData) cbindPtr) == 0) {
  	ckfree((char *) cbindPtr->command);
! 	if (cbindPtr->del != NULL) {
! 	    ckfree((char *) cbindPtr->del);
  	}
  	ckfree((char *) cbindPtr);
  	return TCL_ERROR;
***************
*** 390,401 ****
  }
  
  static int
! CBindingEvalProc(clientData, interp, eventPtr, tkwin, keySym)
      ClientData clientData;
      Tcl_Interp *interp;
!     XEvent *eventPtr;
!     Tk_Window tkwin;
!     KeySym keySym;
  {
      CBinding *cbindPtr;
  
--- 416,436 ----
  }
  
  static int
! #ifdef _USING_PROTOTYPES_
! CBindingEvalProc (
!     ClientData clientData,
!     Tcl_Interp *interp,
!     XEvent *dummy,
!     Tk_Window dummy2,
!     KeySym dummy3)
! #else
! CBindingEvalProc(clientData, interp, dummy, dummy2, dummy3)
      ClientData clientData;
      Tcl_Interp *interp;
!     XEvent *dummy;
!     Tk_Window dummy2;
!     KeySym dummy3;
! #endif
  {
      CBinding *cbindPtr;
  
***************
*** 405,418 ****
  }
  
  static void
  CBindingFreeProc(clientData)
      ClientData clientData;
  {
      CBinding *cbindPtr = (CBinding *) clientData;
      
!     if (cbindPtr->delete != NULL) {
! 	Tcl_GlobalEval(cbindPtr->interp, cbindPtr->delete);
! 	ckfree((char *) cbindPtr->delete);
      }
      ckfree((char *) cbindPtr->command);
      ckfree((char *) cbindPtr);
--- 440,458 ----
  }
  
  static void
+ #ifdef _USING_PROTOTYPES_
+ CBindingFreeProc (
+     ClientData clientData)
+ #else
  CBindingFreeProc(clientData)
      ClientData clientData;
+ #endif
  {
      CBinding *cbindPtr = (CBinding *) clientData;
      
!     if (cbindPtr->del != NULL) {
! 	Tcl_GlobalEval(cbindPtr->interp, cbindPtr->del);
! 	ckfree((char *) cbindPtr->del);
      }
      ckfree((char *) cbindPtr->command);
      ckfree((char *) cbindPtr);
***************
*** 437,447 ****
--- 477,495 ----
  
  	/* ARGSUSED */
  static int
+ #ifdef _USING_PROTOTYPES_
+ TestbitmapObjCmd (
+     ClientData clientData,	/* Main window for application. */
+     Tcl_Interp *interp,		/* Current interpreter. */
+     int objc,			/* Number of arguments. */
+     Tcl_Obj *CONST objv[])	/* Argument objects. */
+ #else
  TestbitmapObjCmd(clientData, interp, objc, objv)
      ClientData clientData;	/* Main window for application. */
      Tcl_Interp *interp;		/* Current interpreter. */
      int objc;			/* Number of arguments. */
      Tcl_Obj *CONST objv[];	/* Argument objects. */
+ #endif
  {
  
      if (objc < 2) {
***************
*** 472,482 ****
--- 520,538 ----
  
  	/* ARGSUSED */
  static int
+ #ifdef _USING_PROTOTYPES_
+ TestborderObjCmd (
+     ClientData clientData,	/* Main window for application. */
+     Tcl_Interp *interp,		/* Current interpreter. */
+     int objc,			/* Number of arguments. */
+     Tcl_Obj *CONST objv[])	/* Argument objects. */
+ #else
  TestborderObjCmd(clientData, interp, objc, objv)
      ClientData clientData;	/* Main window for application. */
      Tcl_Interp *interp;		/* Current interpreter. */
      int objc;			/* Number of arguments. */
      Tcl_Obj *CONST objv[];	/* Argument objects. */
+ #endif
  {
  
      if (objc < 2) {
***************
*** 507,517 ****
--- 563,581 ----
  
  	/* ARGSUSED */
  static int
+ #ifdef _USING_PROTOTYPES_
+ TestcolorObjCmd (
+     ClientData clientData,	/* Main window for application. */
+     Tcl_Interp *interp,		/* Current interpreter. */
+     int objc,			/* Number of arguments. */
+     Tcl_Obj *CONST objv[])	/* Argument objects. */
+ #else
  TestcolorObjCmd(clientData, interp, objc, objv)
      ClientData clientData;	/* Main window for application. */
      Tcl_Interp *interp;		/* Current interpreter. */
      int objc;			/* Number of arguments. */
      Tcl_Obj *CONST objv[];	/* Argument objects. */
+ #endif
  {
  
      if (objc < 2) {
***************
*** 542,552 ****
--- 606,624 ----
  
  	/* ARGSUSED */
  static int
+ #ifdef _USING_PROTOTYPES_
+ TestcursorObjCmd (
+     ClientData clientData,	/* Main window for application. */
+     Tcl_Interp *interp,		/* Current interpreter. */
+     int objc,			/* Number of arguments. */
+     Tcl_Obj *CONST objv[])	/* Argument objects. */
+ #else
  TestcursorObjCmd(clientData, interp, objc, objv)
      ClientData clientData;	/* Main window for application. */
      Tcl_Interp *interp;		/* Current interpreter. */
      int objc;			/* Number of arguments. */
      Tcl_Obj *CONST objv[];	/* Argument objects. */
+ #endif
  {
  
      if (objc < 2) {
***************
*** 578,588 ****
  
  	/* ARGSUSED */
  static int
! TestdeleteappsCmd(clientData, interp, argc, argv)
!     ClientData clientData;		/* Main window for application. */
!     Tcl_Interp *interp;			/* Current interpreter. */
!     int argc;				/* Number of arguments. */
!     char **argv;			/* Argument strings. */
  {
      NewApp *nextPtr;
  
--- 650,668 ----
  
  	/* ARGSUSED */
  static int
! #ifdef _USING_PROTOTYPES_
! TestdeleteappsCmd (
!     ClientData dummy,			/* Main window for application. */
!     Tcl_Interp *dummy2,			/* Current interpreter. */
!     int dummy3,				/* Number of arguments. */
!     Tcl_Obj *CONST dummy4[])		/* Argument strings. */
! #else
! TestdeleteappsCmd(dummy, dummy2, dummy3, dummy4)
!     ClientData dummy;			/* Main window for application. */
!     Tcl_Interp *dummy2;			/* Current interpreter. */
!     int dummy3;				/* Number of arguments. */
!     Tcl_Obj *CONST *dummy4[];		/* Argument strings. */
! #endif
  {
      NewApp *nextPtr;
  
***************
*** 1704,1709 ****
--- 1784,1791 ----
  		"\": must be changed", (char *) NULL);
  	return TCL_ERROR;
      }
+     Tk_ImageChanged(timPtr->master, x, y, width, height, timPtr->width,
+ 	    timPtr->height);
      return TCL_OK;
  }
  
***************
*** 1726,1735 ****
--- 1808,1824 ----
   */
  
  static ClientData
+ #ifdef _USING_PROTOTYPES_
+ ImageGet (
+     Tk_Window tkwin,		/* Token for window in which image will
+ 				 * be used. */
+     ClientData clientData)	/* Pointer to TImageMaster for image. */
+ #else
  ImageGet(tkwin, clientData)
      Tk_Window tkwin;		/* Token for window in which image will
  				 * be used. */
      ClientData clientData;	/* Pointer to TImageMaster for image. */
+ #endif
  {
      TImageMaster *timPtr = (TImageMaster *) clientData;
      TImageInstance *instPtr;
***************
*** 1767,1772 ****
--- 1856,1872 ----
   */
  
  static void
+ #ifdef _USING_PROTOTYPES_
+ ImageDisplay (
+     ClientData clientData,	/* Pointer to TImageInstance for image. */
+     Display *display,		/* Display to use for drawing. */
+     Drawable drawable,		/* Where to redraw image. */
+     int imageX, int imageY,	/* Origin of area to redraw, relative to
+ 				 * origin of image. */
+     int width, int height,	/* Dimensions of area to redraw. */
+     int drawableX,		/* Coordinates in drawable corresponding to */
+     int drawableY)		/* imageX and imageY. */
+ #else
  ImageDisplay(clientData, display, drawable, imageX, imageY, width, height,
  	drawableX, drawableY)
      ClientData clientData;	/* Pointer to TImageInstance for image. */
***************
*** 1777,1782 ****
--- 1877,1883 ----
      int width, height;		/* Dimensions of area to redraw. */
      int drawableX, drawableY;	/* Coordinates in drawable corresponding to
  				 * imageX and imageY. */
+ #endif
  {
      TImageInstance *instPtr = (TImageInstance *) clientData;
      char buffer[200 + TCL_INTEGER_SPACE * 6];
***************
*** 1819,1827 ****
--- 1920,1934 ----
   */
  
  static void
+ #ifdef _USING_PROTOTYPES_
+ ImageFree (
+     ClientData clientData,	/* Pointer to TImageInstance for instance. */
+     Display *display)		/* Display where image was to be drawn. */
+ #else
  ImageFree(clientData, display)
      ClientData clientData;	/* Pointer to TImageInstance for instance. */
      Display *display;		/* Display where image was to be drawn. */
+ #endif
  {
      TImageInstance *instPtr = (TImageInstance *) clientData;
      char buffer[200];
***************
*** 1852,1861 ****
--- 1959,1975 ----
   */
  
  static void
+ #ifdef _USING_PROTOTYPES_
+ ImageDelete (
+     ClientData clientData)	/* Pointer to TImageMaster for image.  When
+ 				 * this procedure is called, no more
+ 				 * instances exist. */
+ #else
  ImageDelete(clientData)
      ClientData clientData;	/* Pointer to TImageMaster for image.  When
  				 * this procedure is called, no more
  				 * instances exist. */
+ #endif
  {
      TImageMaster *timPtr = (TImageMaster *) clientData;
      char buffer[100];
***************
*** 2084,2094 ****
  
  	/* ARGSUSED */
  static int
  TestpropCmd(clientData, interp, argc, argv)
      ClientData clientData;		/* Main window for application. */
      Tcl_Interp *interp;			/* Current interpreter. */
      int argc;				/* Number of arguments. */
!     char **argv;			/* Argument strings. */
  {
      Tk_Window mainWin = (Tk_Window) clientData;
      int result, actualFormat;
--- 2198,2216 ----
  
  	/* ARGSUSED */
  static int
+ #ifdef _USING_PROTOTYPES_
+ TestpropCmd (
+     ClientData clientData,		/* Main window for application. */
+     Tcl_Interp *interp,			/* Current interpreter. */
+     int argc,				/* Number of arguments. */
+     Tcl_Obj *CONST argv[])		/* Argument objects. */
+ #else
  TestpropCmd(clientData, interp, argc, argv)
      ClientData clientData;		/* Main window for application. */
      Tcl_Interp *interp;			/* Current interpreter. */
      int argc;				/* Number of arguments. */
!     Tcl_Obj *CONST argv[];		/* Argument objects. */
! #endif
  {
      Tk_Window mainWin = (Tk_Window) clientData;
      int result, actualFormat;
***************
*** 2099,2111 ****
      char buffer[30];
  
      if (argc != 3) {
! 	Tcl_AppendResult(interp, "wrong # args;  must be \"", argv[0],
  		" window property\"", (char *) NULL);
  	return TCL_ERROR;
      }
  
!     w = strtoul(argv[1], &end, 0);
!     propName = Tk_InternAtom(mainWin, argv[2]);
      property = NULL;
      result = XGetWindowProperty(Tk_Display(mainWin),
  	    w, propName, 0, 100000, False, AnyPropertyType,
--- 2221,2233 ----
      char buffer[30];
  
      if (argc != 3) {
! 	Tcl_AppendResult(interp, "wrong # args;  must be \"", Tcl_GetString(argv[0]),
  		" window property\"", (char *) NULL);
  	return TCL_ERROR;
      }
  
!     w = strtoul(Tcl_GetString(argv[1]), &end, 0);
!     propName = Tk_InternAtom(mainWin, Tcl_GetString(argv[2]));
      property = NULL;
      result = XGetWindowProperty(Tk_Display(mainWin),
  	    w, propName, 0, 100000, False, AnyPropertyType,
***************
*** 2240,2246 ****
      } else if (strcmp(argv[1], "serial") == 0) {
  	char buf[TCL_INTEGER_SPACE];
  	
! 	sprintf(buf, "%d", tkSendSerial+1);
  	Tcl_SetResult(interp, buf, TCL_VOLATILE);
      } else {
  	Tcl_AppendResult(interp, "bad option \"", argv[1],
--- 2362,2368 ----
      } else if (strcmp(argv[1], "serial") == 0) {
  	char buf[TCL_INTEGER_SPACE];
  	
! 	sprintf(buf, "%d", TkpGetSendSerial()+1);
  	Tcl_SetResult(interp, buf, TCL_VOLATILE);
      } else {
  	Tcl_AppendResult(interp, "bad option \"", argv[1],
***************
*** 2351,2373 ****
  
  	/* ARGSUSED */
  static int
  TestwrapperCmd(clientData, interp, argc, argv)
      ClientData clientData;		/* Main window for application. */
      Tcl_Interp *interp;			/* Current interpreter. */
      int argc;				/* Number of arguments. */
!     char **argv;			/* Argument strings. */
  {
      TkWindow *winPtr, *wrapperPtr;
      Tk_Window tkwin;
  
      if (argc != 2) {
! 	Tcl_AppendResult(interp, "wrong # args;  must be \"", argv[0],
! 		" window\"", (char *) NULL);
  	return TCL_ERROR;
      }
      
      tkwin = (Tk_Window) clientData;
!     winPtr = (TkWindow *) Tk_NameToWindow(interp, argv[1], tkwin);
      if (winPtr == NULL) {
  	return TCL_ERROR;
      }
--- 2473,2502 ----
  
  	/* ARGSUSED */
  static int
+ #ifdef _USING_PROTOTYPES_
+ TestwrapperCmd (
+     ClientData clientData,		/* Main window for application. */
+     Tcl_Interp *interp,			/* Current interpreter. */
+     int argc,				/* Number of arguments. */
+     Tcl_Obj *CONST argv[])		/* Argument objects. */
+ #else
  TestwrapperCmd(clientData, interp, argc, argv)
      ClientData clientData;		/* Main window for application. */
      Tcl_Interp *interp;			/* Current interpreter. */
      int argc;				/* Number of arguments. */
!     Tcl_Obj *CONST argv[];		/* Argument strings. */
! #endif
  {
      TkWindow *winPtr, *wrapperPtr;
      Tk_Window tkwin;
  
      if (argc != 2) {
! 	Tcl_WrongNumArgs(interp, 1, argv, "window");
  	return TCL_ERROR;
      }
      
      tkwin = (Tk_Window) clientData;
!     winPtr = (TkWindow *) Tk_NameToWindow(interp, Tcl_GetStringFromObj(argv[1], NULL), tkwin);
      if (winPtr == NULL) {
  	return TCL_ERROR;
      }
*** generic/tkText.h.orig	Thu Jan  6 03:18:58 2000
--- generic/tkText.h	Wed Feb 16 23:08:45 2000
***************
*** 30,36 ****
   * file:
   */
  
! typedef struct TkTextBTree *TkTextBTree;
  
  /*
   * The data structure below defines a single line of text (from newline
--- 30,36 ----
   * file:
   */
  
! typedef struct TkTextBTree_ *TkTextBTree;
  
  /*
   * The data structure below defines a single line of text (from newline
*** generic/tkWindow.c.orig	Thu Dec 16 22:57:36 1999
--- generic/tkWindow.c	Thu Feb 17 07:33:53 2000
***************
*** 15,27 ****
--- 15,43 ----
   * RCS: @(#) $Id: tkWindow.c,v 1.14 1999/12/16 21:57:36 hobbs Exp $
   */
  
+ #define reserved284 tcl_SetMainLoop
+ 
  #include "tkPort.h"
  #include "tkInt.h"
  
  #if !defined(__WIN32__) && !defined(MAC_TCL)
  #include "tkUnixInt.h"
  #endif
+ #if defined(__WIN32__)
+ #include "tkWinInt.h"
+ #endif
  
+ #ifndef USE_TCL_STUBS
+ extern TclStubs tclStubs;
+ #define tclStubsPtr (&tclStubs)
+ #endif
+ 
+ /*
+  * Make sure that Tcl_SetMainLoop always references the stub pointer, not
+  * the real function.
+  */
+ #undef Tcl_SetMainLoop
+ #define Tcl_SetMainLoop ((void (*) _ANSI_ARGS_((VOID *))) ((tclStubsPtr)->tcl_SetMainLoop))
  
  typedef struct ThreadSpecificData {
      int numMainWindows;    /* Count of numver of main windows currently
***************
*** 155,160 ****
--- 171,179 ----
  #ifdef MAC_TCL
      {"unsupported1",	TkUnsupported1Cmd,	NULL,			1, 1},
  #endif
+ #if defined(TK_USE_INPUT_METHODS) && defined(I18N_IMPROVE)
+     {"imconfigure",	NULL,			Tk_ImconfigureObjCmd,	1, 1},
+ #endif /* TK_USE_INPUT_METHODS && I18N_IMPROVE */
      {(char *) NULL,	(int (*) _ANSI_ARGS_((ClientData, Tcl_Interp *, int, char **))) NULL, NULL, 0}
  };
  
***************
*** 209,214 ****
--- 228,242 ----
  			    char *name));
  static void		OpenIM _ANSI_ARGS_((TkDisplay *dispPtr));
  static void		UnlinkWindow _ANSI_ARGS_((TkWindow *winPtr));
+ #ifdef TK_USE_INPUT_METHODS
+ #ifdef I18N_IMPROVE
+ static int		CanInitiateIm _ANSI_ARGS_((void));
+ static void		IMInstantiateCallback _ANSI_ARGS_ ((Display *display,
+ 				XPointer clientData, XPointer callData));
+ static void		IMDestroyCallback _ANSI_ARGS_ ((XIM im, XPointer clientData, 
+ 				XPointer callData));
+ #endif /* I18N_IMPROVE */
+ #endif /* TK_USE_INPUT_METHODS */
  
  /*
   *----------------------------------------------------------------------
***************
*** 1275,1281 ****
      TkBindDeadWindow(winPtr);
  #ifdef TK_USE_INPUT_METHODS
      if (winPtr->inputContext != NULL) {
! 	XDestroyIC(winPtr->inputContext);
      }
  #endif /* TK_USE_INPUT_METHODS */
      if (winPtr->tagPtr != NULL) {
--- 1303,1313 ----
      TkBindDeadWindow(winPtr);
  #ifdef TK_USE_INPUT_METHODS
      if (winPtr->inputContext != NULL) {
! #ifdef I18N_IMPROVE
! 	TkpDestroyIC(winPtr, 1);
! #else
!   	XDestroyIC(winPtr->inputContext);
! #endif /* I18N_IMPROVE */
      }
  #endif /* TK_USE_INPUT_METHODS */
      if (winPtr->tagPtr != NULL) {
***************
*** 2427,2432 ****
--- 2459,2639 ----
  {
      return ((TkWindow *) tkwin)->mainPtr->strictMotif;
  }
+ #ifdef TK_USE_INPUT_METHODS
+ #ifdef I18N_IMPROVE
+ 
+ static int
+ CanInitiateIm()
+ {
+     static int inited = 0;
+     static int ret = 0;
+     char *locale;
+ 
+     /*
+      * Determine the current encoding from the LC_* or LANG environment
+      * variables.  We previously used setlocale() to determine the locale,
+      * but this does not work on some systems (e.g. Linux/i386 RH 5.0).
+      */
+ 
+     locale = getenv("LC_ALL");
+ 
+     if (locale == NULL || locale[0] == '\0') {
+ 	locale = getenv("LC_CTYPE");
+     }
+     if (locale == NULL || locale[0] == '\0') {
+ 	locale = getenv("LANG");
+     }
+     if (locale == NULL || locale[0] == '\0') {
+ 	return False;
+     }
+ 
+     if (inited == 0) {
+ 	char *curSpec = setlocale(LC_ALL, NULL);
+ 
+ 	inited = 1;
+ 
+ 	if (strcmp(locale, "C") == 0 ||
+ 	    strcmp(locale, "POSIX") == 0) {
+ 	    goto Checked;
+ 	}
+ 
+ 	/*
+ 	 * Ok I know, everyone of core Tcl/Tk developer hates this.
+ 	 * believe it or not, it must be needed to call
+ 	 * setlocale(3)/_Xsetlocale() VERY HERE. This is what the X
+ 	 * input method wants.
+ 	 * Note that X11's i18n implementation should be ONLY governed
+ 	 * by LC_CTYPE. This is clearly/explicitly specified in X11
+ 	 * documente Chapter 13. Thus, If there are some X11
+ 	 * implementation that need using LC_ALL to initialize i18n
+ 	 * subsystem, I won't care about such a X library.
+ 	 * But, we are still on edge of darkside. ctype(3) routines
+ 	 * are governed by LC_CTYPE.... Need to create "Locale
+ 	 * independent ctype libraries" for Tcl/Tk...
+ 	 *
+ 	 *	m-hirano
+ 	 */
+ 
+ 	/*
+ 	 * OK, First of all, setting WHOLE locale to "C".
+ 	 */
+ 	(void)setlocale(LC_ALL, "C");
+ 	if (setlocale(LC_CTYPE, locale) == NULL) {
+ 	    /*
+ 	     * Reset to old locale.
+ 	     */
+ 	    if (setlocale(LC_ALL, curSpec) == NULL) {
+ 		(void)setlocale(LC_ALL, "C");
+ 	    }
+ 	    goto Checked;
+ 	} else {
+ 	    /*
+ 	     * For insurance, reset LC_NUMERIC to "C" for Tcl numeric parsing.
+ 	     */
+ 	    (void)setlocale(LC_NUMERIC, "C");
+ 	}
+ 	if (XSupportsLocale() != True) {
+ 	    goto Checked;
+ 	}
+ 
+ 	ret = True;
+ 	/*
+ 	 * At last, Setting the locale modifiers.
+ 	 */
+ 	(void)XSetLocaleModifiers("");
+     }
+ 
+     Checked:
+     return ret;
+ }
+ 
+ /*
+  *----------------------------------------------------------------------
+  *
+  * IMInstantiateCallback
+  *
+  *	Whenever IM server become available, this function will be called.
+  *
+  * Results:
+  *	OpenIM() is called.
+  *
+  * Side effects:
+  *	None.
+  *
+  *----------------------------------------------------------------------
+  */
+ 
+ void
+ IMInstantiateCallback(display, clientData, callData)
+      Display *display;
+      XPointer clientData;
+      XPointer callData;
+ {
+     TkDisplay *dispPtr = (TkDisplay *)clientData;
+ 
+     if (display == dispPtr->display &&
+ 	dispPtr->inputMethod == NULL) {
+ 	OpenIM(dispPtr);
+     }
+ }
+ 
+ /*
+  *----------------------------------------------------------------------
+  *
+  * IMDestroyCallback
+  *
+  *	Whenever IM server stops the service, this function will be called.
+  *
+  * Results:
+  *	the XIM opened before is marked as unusable.
+  *
+  * Side effects:
+  *	XIC using this XIM will be useless.
+  *
+  *----------------------------------------------------------------------
+  */
+ void
+ IMDestroyCallback(im, clientData, callData)
+      XIM im;
+      XPointer clientData;
+      XPointer callData;
+ {
+     TkDisplay *dispPtr = (TkDisplay *)clientData;
+     if (im == dispPtr->inputMethod) {
+ 	Tcl_HashTable winTable = dispPtr->winTable;
+ 	Tcl_HashEntry *entry = NULL;
+ 	Tcl_HashSearch search;
+ 	TkWindow *winPtr;
+ 
+ 	/*
+ 	 * We must not call XCloseIM() or XDestroyIC().
+ 	 * because the XIM and XIC are destroyed by Xlib 
+ 	 * automatically.
+ 	 */
+ 	for (entry = Tcl_FirstHashEntry(&winTable, &search); entry != NULL;
+ 	     entry = Tcl_NextHashEntry(&search)) {
+ 	    winPtr = (TkWindow *)Tcl_GetHashValue(entry);
+ 	    if (winPtr->dispPtr->display == dispPtr->display &&
+ 		winPtr->dispPtr->inputMethod == im &&
+ 		winPtr->inputContext != NULL) {
+ 		TkpDestroyIC(winPtr, 0);
+ 	    }
+ 	}
+ 	dispPtr->inputMethod = NULL;
+ 	dispPtr->lastFocusedIC = NULL;
+ #ifdef HAVE_XIMREGINSTCB
+ #ifdef NO_XIDPROC
+ 	XRegisterIMInstantiateCallback(dispPtr->display, NULL, NULL, NULL,
+ 				       (XIMProc)IMInstantiateCallback, (XPointer *)dispPtr);
+ #else
+ 	XRegisterIMInstantiateCallback(dispPtr->display, NULL, NULL, NULL,
+ 				       (XIDProc)IMInstantiateCallback, (XPointer)dispPtr);
+ #endif /* NO_XIDPROC */
+ #endif /* HAVE_XIMREGINSTCB */
+     }
+ }
+ #endif /* I18N_IMPROVE */
+ #endif /* TK_USE_INPUT_METHODS */
  
  /* 
   *--------------------------------------------------------------
***************
*** 2457,2464 ****
--- 2664,2697 ----
      unsigned short i;
      XIMStyles *stylePtr;
  
+ #ifdef I18N_IMPROVE
+     int styleFound = 0;
+ 
+     dispPtr->inputMethod = NULL;
+     dispPtr->imEncoding = NULL;
+     dispPtr->lastFocusedIC = NULL;
+ 
+     if (CanInitiateIm() == False) {
+ 	return;
+     }
+ #endif /* I18N_IMPROVE */
      dispPtr->inputMethod = XOpenIM(dispPtr->display, NULL, NULL, NULL);
      if (dispPtr->inputMethod == NULL) {
+ #ifdef I18N_IMPROVE
+ #ifdef HAVE_XIMREGINSTCB
+ 	/*
+ 	 * Maybe no IM server is available right now.
+ 	 * Try to register instantiate callback.
+ 	 */
+ #ifdef NO_XIDPROC
+ 	XRegisterIMInstantiateCallback(dispPtr->display, NULL, NULL, NULL,
+ 				       (XIMProc)IMInstantiateCallback, (XPointer *)dispPtr);
+ #else
+ 	XRegisterIMInstantiateCallback(dispPtr->display, NULL, NULL, NULL,
+ 				       (XIDProc)IMInstantiateCallback, (XPointer)dispPtr);
+ #endif /* NO_XIDPROC */
+ #endif /* HAVE_XIMREGINSTCB */
+ #endif /* I18N_IMPROVE */
  	return;
      }
  
***************
*** 2469,2479 ****
      for (i = 0; i < stylePtr->count_styles; i++) {
  	if (stylePtr->supported_styles[i]
  		== (XIMPreeditNothing|XIMStatusNothing)) {
! 	    XFree(stylePtr);
! 	    return;
  	}
      }
      XFree(stylePtr);
  
      error:
  
--- 2702,2731 ----
      for (i = 0; i < stylePtr->count_styles; i++) {
  	if (stylePtr->supported_styles[i]
  		== (XIMPreeditNothing|XIMStatusNothing)) {
! #ifdef I18N_IMPROVE
! 	    styleFound = 1;
! #else
!   	    XFree(stylePtr);
!   	    return;
! #endif /* I18N_IMPROVE */
  	}
      }
      XFree(stylePtr);
+ #ifdef I18N_IMPROVE
+     if (styleFound == 1) {
+ 	/*
+ 	 * Create a Tcl_Encoding for XmbLookupString() conversion.
+ 	 */
+ 	dispPtr->imEncoding = Tcl_GetEncoding(NULL, Tcl_GetEncodingName(NULL));
+ #ifdef XNDestroyCallback
+ 	dispPtr->destroyCallback.client_data = (XPointer)dispPtr;
+ 	dispPtr->destroyCallback.callback = (XIMProc)IMDestroyCallback;
+ 	(void)XSetIMValues(dispPtr->inputMethod,
+ 			   XNDestroyCallback, &(dispPtr->destroyCallback), NULL);
+ #endif /* XNDestroyCallback */	
+ 	return;
+     }
+ #endif /* I18N_IMPROVE */
  
      error:
  
***************
*** 2714,2719 ****
--- 2966,2981 ----
      Tcl_DString class;
      ThreadSpecificData *tsdPtr;
      
+ #if defined(__WIN32__) && defined(STATIC_BUILD) && !defined(NO_STATIC_INIT)
+     /*
+      * If we are in a statically linked executable, then we need to
+      * explicitly initialize the Windows function tables here since
+      * DllMain() will not be invoked.
+      */
+ 
+     TkWinXInit(GetModuleHandle(NULL));
+ #endif
+ 
      /*
       * Ensure that we are getting the matching version of Tcl.  This is
       * really only an issue when Tk is loaded dynamically.
***************
*** 2940,2946 ****
      }
      Tcl_MutexUnlock(&windowMutex);
  
!     if (Tcl_PkgRequire(interp, "Tcl", TCL_VERSION, 1) == NULL) {
  	code = TCL_ERROR;
  	goto done;
      }
--- 3202,3208 ----
      }
      Tcl_MutexUnlock(&windowMutex);
  
!     if (Tcl_PkgRequire(interp, "Tcl", TCL_VERSION, 0) == NULL) {
  	code = TCL_ERROR;
  	goto done;
      }
***************
*** 2954,2964 ****
--- 3216,3228 ----
  	goto done;
      }
  
+ #ifndef __WIN32__
  #ifdef Tk_InitStubs
  #undef Tk_InitStubs
  #endif
  
      Tk_InitStubs(interp, TK_VERSION, 1);
+ #endif
  
      /*
       * Invoke platform-specific initialization.
***************
*** 2966,2974 ****
--- 3230,3245 ----
  
      code = TkpInit(interp);
  
+     if (Tcl_SetMainLoop) {
+ 	Tcl_SetMainLoop(Tk_GetNumMainWindows);
+     }
+ 
      done:
      if (argv != NULL) {
  	ckfree((char *) argv);
+     }
+     if (code != TCL_ERROR) {
+ 	code = TCL_OK;
      }
      return code;
  }
*** tests/bind.test.orig	Tue Dec 14 07:53:11 1999
--- tests/bind.test	Wed Feb 16 23:08:46 2000
***************
*** 214,220 ****
      .b.c bind foo
  } {}
  
! 
  if {[string compare testcbind [info commands testcbind]] != 0} {
      puts "This application hasn't been compiled with the testcbind command,"
      puts "therefore I am skipping all of these tests."
--- 214,220 ----
      .b.c bind foo
  } {}
  
! auto_load ::testcbind
  if {[string compare testcbind [info commands testcbind]] != 0} {
      puts "This application hasn't been compiled with the testcbind command,"
      puts "therefore I am skipping all of these tests."
*** tests/button.test.orig	Fri Apr 16 03:51:34 1999
--- tests/button.test	Wed Feb 16 23:08:46 2000
***************
*** 13,18 ****
--- 13,19 ----
      source [file join [pwd] [file dirname [info script]] defs.tcl]
  }
  
+ auto_load ::testsend
  if {[lsearch [image types] test] < 0} {
      puts "This application hasn't been compiled with the \"test\""
      puts "image, so I can't run this test.  Are you sure you're using"
*** tests/defs.tcl.orig	Tue Dec 14 07:53:12 1999
--- tests/defs.tcl	Wed Feb 16 23:08:47 2000
***************
*** 18,28 ****
  if {[info exists tk_version]} {
      tk appname tktest
      wm title . tktest
  } else {
  
      # Ensure that we have a minimal auto_path so we don't pick up extra junk.
  
!     set auto_path [list [info library]]
  }
  
  # create the "tcltest" namespace for all testing variables and procedures
--- 18,46 ----
  if {[info exists tk_version]} {
      tk appname tktest
      wm title . tktest
+     catch {package require -exact Tktest $tk_version}
  } else {
  
      # Ensure that we have a minimal auto_path so we don't pick up extra junk.
  
!     set auto_path [list [info library] [file dirname [info nameofexecutable]]]
! }
! 
! # Error-messages are not neccary if the Tcltest, Objtest
! # or Proctest packages are not present. Many tests can
! # still run, so it is not reasonable to stop for that.
! 
! catch {package require -exact Tcltest [info tclversion]}
! catch {package require -exact Objtest [info tclversion]}
! catch {package require Proctest 1.0}
! if {$tcl_platform(platform) == "unix"} {
!     catch {package require -exact Unixtest [info tclversion]}
! }
! if {$tcl_platform(platform) == "macintosh"} {
!     catch {package require -exact Mactest [info tclversion]}
! }
! if {$tcl_platform(platform) == "windows"} {
!     catch {package require -exact Wintest [info tclversion]}
  }
  
  # create the "tcltest" namespace for all testing variables and procedures
*** tests/entry.test.orig	Wed Dec 22 00:55:54 1999
--- tests/entry.test	Wed Feb 16 23:08:47 2000
***************
*** 12,17 ****
--- 12,18 ----
      source [file join [pwd] [file dirname [info script]] defs.tcl]
  }
  
+ auto_load testsend
  if {[lsearch [image types] test] < 0} {
      puts "This application hasn't been compiled with the \"test\""
      puts "image, so I can't run this test.  Are you sure you're using"
*** tests/image.test.orig	Fri Apr 16 03:51:38 1999
--- tests/image.test	Wed Feb 16 23:08:47 2000
***************
*** 13,18 ****
--- 13,19 ----
      source [file join [pwd] [file dirname [info script]] defs.tcl]
  }
  
+ auto_load testsend
  if {[lsearch [image types] test] < 0} {
      puts "This application hasn't been compiled with the \"test\" image"
      puts "type, so I can't run this test.  Are you sure you're using"
*** tests/menu.test.orig	Fri Apr 16 03:51:39 1999
--- tests/menu.test	Wed Feb 16 23:08:47 2000
***************
*** 11,16 ****
--- 11,17 ----
      source [file join [pwd] [file dirname [info script]] defs.tcl]
  }
  
+ auto_load testcbind
  if {[lsearch [image types] test] < 0} {
      puts "This application hasn't been compiled with the \"test\" image"
      puts "type, so I can't run this test.  Are you sure you're using"
***************
*** 218,224 ****
  .m1 add separator
  .m1 add checkbutton -label "checkbutton" -variable check -onvalue on -offvalue off
  .m1 add radiobutton -label "radiobutton" -variable radio
! image create photo image1 -file [file join $tk_library demos images earth.gif]
  
  foreach configTest {
      {-activebackground 
--- 219,225 ----
  .m1 add separator
  .m1 add checkbutton -label "checkbutton" -variable check -onvalue on -offvalue off
  .m1 add radiobutton -label "radiobutton" -variable radio
! image create photo image1 -file [file join .. library demos images earth.gif]
  
  foreach configTest {
      {-activebackground 
***************
*** 1351,1357 ****
  test menu-8.2 {DestroyMenuEntry} {
      catch {image delete image1a}
      catch {destroy .m1}
!     image create photo image1a -file [file join $tk_library demos images earth.gif]
      menu .m1
      .m1 add command -image image1a
      list [catch {.m1 delete 1} msg] $msg [destroy .m1] [image delete image1a]
--- 1352,1358 ----
  test menu-8.2 {DestroyMenuEntry} {
      catch {image delete image1a}
      catch {destroy .m1}
!     image create photo image1a -file [file join [pwd] .. library demos images earth.gif]
      menu .m1
      .m1 add command -image image1a
      list [catch {.m1 delete 1} msg] $msg [destroy .m1] [image delete image1a]
***************
*** 1605,1611 ****
      catch {image delete image1}
      catch {image delete image2}
      image create test image1
!     image create photo image2 -file [file join $tk_library demos images earth.gif]
      menu .m1
      .m1 add command -image image1
      list [catch {.m1 entryconfigure 1 -image image2} msg] $msg [destroy .m1] [image delete image1] [image delete image2]
--- 1606,1612 ----
      catch {image delete image1}
      catch {image delete image2}
      image create test image1
!     image create photo image2 -file [file join [pwd] .. library demos images earth.gif]
      menu .m1
      .m1 add command -image image1
      list [catch {.m1 entryconfigure 1 -image image2} msg] $msg [destroy .m1] [image delete image1] [image delete image2]
***************
*** 1614,1620 ****
      catch {destroy .m1}
      catch {image delete image1}
      catch {image delete image2}
!     image create photo image1 -file [file join $tk_library demos images earth.gif]
      image create test image2
      menu .m1
      .m1 add checkbutton -image image1
--- 1615,1621 ----
      catch {destroy .m1}
      catch {image delete image1}
      catch {image delete image2}
!     image create photo image1 -file [file join [pwd] .. library demos images earth.gif]
      image create test image2
      menu .m1
      .m1 add checkbutton -image image1
***************
*** 1625,1631 ****
      catch {image delete image1}
      catch {image delete image2}
      catch {image delete image3}
!     image create photo image1 -file [file join $tk_library demos images earth.gif]
      image create test image2
      image create test image3
      menu .m1
--- 1626,1632 ----
      catch {image delete image1}
      catch {image delete image2}
      catch {image delete image3}
!     image create photo image1 -file [file join [pwd] .. library demos images earth.gif]
      image create test image2
      image create test image3
      menu .m1
*** tests/unixEmbed.test.orig	Wed Apr 21 23:53:30 1999
--- tests/unixEmbed.test	Wed Feb 16 23:08:47 2000
***************
*** 115,120 ****
--- 115,121 ----
      dobg {
  	eval destroy [winfo child .]
  	toplevel .t -use $w
+ 	package require Tktest
  	list [testembed] [expr [lindex [lindex [testembed all] 0] 0] - $w]
      }
  } {{{XXX {} {} .t}} 0}
***************
*** 129,134 ****
--- 130,136 ----
  	eval destroy [winfo child .]
  	toplevel .t1 -use $w1
  	toplevel .t2 -use $w2
+ 	package require Tktest
  	testembed
      }
  } {{XXX {} {} .t2} {XXX {} {} .t1}}
***************
*** 155,160 ****
--- 157,163 ----
      dobg {
  	eval destroy [winfo child .]
  	toplevel .t1 -use $w1
+ 	package require Tktest
  	testembed
      }
      destroy .f1
***************
*** 173,178 ****
--- 176,182 ----
      dobg {
  	eval destroy [winfo child .]
  	toplevel .t1 -use $w1
+ 	package require Tktest
  	testembed
  	destroy .t1
  	testembed
***************
*** 593,598 ****
--- 597,603 ----
  	eval destroy [winfo child .]
  	toplevel .t1 -use $w1 -highlightthickness 2 -bd 2 -relief sunken
  	set x {}
+ 	package require Tktest
  	lappend x [testembed]
  	destroy .t1
  	lappend x [testembed]
*** doc/wish.1.orig	Mon Sep 14 20:23:01 1998
--- doc/wish.1	Wed Feb 16 23:08:47 2000
***************
*** 175,182 ****
  command with ``\fB% \fR''.  You can change the prompt by setting the
  variables \fBtcl_prompt1\fR and \fBtcl_prompt2\fR.  If variable
  \fBtcl_prompt1\fR exists then it must consist of a Tcl script
! to output a prompt;  instead of outputting a prompt \fBwish\fR
! will evaluate the script in \fBtcl_prompt1\fR.
  The variable \fBtcl_prompt2\fR is used in a similar way when
  a newline is typed but the current command isn't yet complete;
  if \fBtcl_prompt2\fR isn't set then no prompt is output for
--- 175,183 ----
  command with ``\fB% \fR''.  You can change the prompt by setting the
  variables \fBtcl_prompt1\fR and \fBtcl_prompt2\fR.  If variable
  \fBtcl_prompt1\fR exists then it must consist of a Tcl script
! to return a prompt; instead of outputting a prompt \fBtclsh\fR
! will evaluate the script in \fBtcl_prompt1\fR and write the
! result of the evaluation to stdout.
  The variable \fBtcl_prompt2\fR is used in a similar way when
  a newline is typed but the current command isn't yet complete;
  if \fBtcl_prompt2\fR isn't set then no prompt is output for
*** mac/pkgIndex.tcl.orig	Wed Feb 16 23:08:48 2000
--- mac/pkgIndex.tcl	Wed Feb 16 23:08:48 2000
***************
*** 0 ****
--- 1,5 ----
+ # Tcl package index file, version 1.0
+ 
+ package ifneeded Tk 8.0 [list load [file join $dir libtk8.0[info sharedlibextension]] Tk]
+ package ifneeded Tksquare 8.0 [list tclPkgSetup $dir Tksquare 8.0 [list [list Tksquare[info sharedlibextension] load square]]]
+ package ifneeded Tktest 8.0 [list tclPkgSetup $dir Tktest 8.0 [list [list Tktest[info sharedlibextension] load {testcbind testdeleteapps testembed testmakeexist testmenubar testprop testsend testwrapper}]]]
*** mac/tkMacAppInit.c.orig	Thu Feb 10 09:53:06 2000
--- mac/tkMacAppInit.c	Wed Feb 16 23:08:48 2000
***************
*** 12,17 ****
--- 12,19 ----
   * RCS: @(#) $Id: tkMacAppInit.c,v 1.12 2000/02/10 08:53:06 jingham Exp $
   */
  
+ #undef TCL_USE_STUBS
+ 
  #include <Gestalt.h>
  #include <ToolUtils.h>
  #include <Fonts.h>
*** mac/tkMacInit.c.orig	Fri Apr 16 03:51:31 1999
--- mac/tkMacInit.c	Wed Feb 16 23:08:48 2000
***************
*** 32,37 ****
--- 32,170 ----
  QDGlobalsPtr tcl_macQdPtr = NULL;
  
  /*
+  * Default directory in which to look for libraries:
+  */
+ 
+ #ifndef TK_LIBRARY
+ #define TK_LIBRARY "."
+ #endif
+ 
+ static char defaultLibraryDir[200] = TK_LIBRARY;
+ 
+ /*
+  * The following string is the startup script executed in new
+  * interpreters.  It looks on disk in several different directories
+  * for a script "tk.tcl" that is compatible with this version
+  * of Tk.  The tk.tcl script does all of the real work of
+  * initialization.
+  */
+ 
+ static char initScript[] =
+ "proc tkInit {} {\n\
+     global tk_library tk_version tk_patchLevel env\n\
+     set errors \"\"\n\
+     rename tkInit {}\n\
+     set dirs {}\n\
+     if [info exists env(TK_LIBRARY)] {\n\
+ 	lappend dirs $env(TK_LIBRARY)\n\
+     }\n\
+     lappend dirs $tk_library\n\
+     set tk_library {}\n\
+     if ![catch {uplevel #0 source -rsrc tk}] {\n\
+ 	uplevel #0 {\n\
+     	    source -rsrc button\n\
+     	    source -rsrc entry\n\
+     	    source -rsrc listbox\n\
+     	    source -rsrc menu\n\
+     	    source -rsrc scale\n\
+     	    source -rsrc scrollbar\n\
+     	    source -rsrc text\n\
+     	    source -rsrc dialog\n\
+     	    source -rsrc focus\n\
+     	    source -rsrc optionMenu\n\
+     	    source -rsrc palette\n\
+     	    source -rsrc tearoff\n\
+     	    source -rsrc tkerror\n\
+     	    source -rsrc comdlg\n\
+     	    source -rsrc msgbox\n\\n\
+ 	}\n\
+ 	return\n\
+     }\n\
+     lappend dirs [file join [file dirname [info library]] tk$tk_version]\n\
+     set parentDir [file dirname [file dirname [info nameofexecutable]]]\n\
+     lappend dirs [file join $parentDir lib tk$tk_version]\n\
+     if {![regexp {.*[ab][12345]} $tk_patchLevel version]} {\n\
+ 	set version $tk_version\n\
+     }\n\
+     lappend dirs [file join [file dirname $parentDir] tk$version library]\n\
+     lappend dirs [file join $parentDir library]\n\
+     foreach i $dirs {\n\
+ 	set tk_library $i\n\
+ 	if ![catch {uplevel #0 source [list [file join $i tk.tcl]]}] {\n\
+ 	    return\n\
+ 	} else {\n\
+ 	    append errors \"[file join $i tk.tcl]: $msg\n$errorInfo\n\"\n\
+ 	}\n\
+     }\n\
+     set tk_library {}\n\
+     set msg \"Can't find a usable tk.tcl in the following directories: \n\"\n\
+     append msg \"    $dirs\n\"\n\
+     append msg \"This probably means that Tk wasn't installed properly.\n\"\n\
+     error $msg\n\
+ }\n\
+ tkInit";
+ 
+ /*
+  * The following script is used to initialize Tk in a safe interpreter.
+  */
+ 
+ static char safeInitScript[] =
+ "proc tkInit {} {\n\
+     global tk_library tk_version tk_patchLevel env\n\
+     set errors \"\"\n\
+     rename tkInit {}\n\
+     set dirs {}\n\
+     if [info exists env(TK_LIBRARY)] {\n\
+ 	lappend dirs $env(TK_LIBRARY)\n\
+     }\n\
+     lappend dirs $tk_library\n\
+     set tk_library {}\n\
+     if ![catch {uplevel #0 source -rsrc tk}] {\n\
+ 	uplevel #0 {\n\
+     	    source -rsrc button\n\
+     	    source -rsrc entry\n\
+     	    source -rsrc listbox\n\
+     	    source -rsrc menu\n\
+     	    source -rsrc scale\n\
+     	    source -rsrc scrollbar\n\
+     	    source -rsrc text\n\
+     	    source -rsrc dialog\n\
+     	    source -rsrc focus\n\
+     	    source -rsrc optionMenu\n\
+     	    source -rsrc palette\n\
+     	    source -rsrc tearoff\n\
+     	    source -rsrc tkerror\n\
+     	    source -rsrc comdlg\n\
+     	    source -rsrc msgbox\n\\n\
+ 	}\n\
+ 	return\n\
+     }\n\
+     lappend dirs [file join [file dirname [info library]] tk$tk_version]\n\
+     set parentDir [file dirname [file dirname [info nameofexecutable]]]\n\
+     lappend dirs [file join $parentDir lib tk$tk_version]\n\
+     if {![regexp {.*[ab][1-9]} $tk_patchLevel version]} {\n\
+ 	set version $tk_version\n\
+     }\n\
+     lappend dirs [file join [file dirname [file dirname [info library]]] tk$version library]\n\
+     foreach i $dirs {\n\
+ 	set tk_library $i\n\
+ 	if ![catch {uplevel #0 source [list [file join $i tk.tcl]]}] {\n\
+ 	    return\n\
+ 	} else {\n\
+ 	    append errors \"[file join $i tk.tcl]: $msg\n$errorInfo\n\"\n\
+ 	}\n\
+     }\n\
+     set tk_library {}\n\
+     set msg \"Can't find a usable tk.tcl in the following directories: \n\"\n\
+     append msg \"    $dirs\n\n\"\n\
+     append msg \"$errors\n\n\"\n\
+     append msg \"This probably means that Tk wasn't installed properly.\n\"\n\
+     error $msg\n\
+ }\n\
+ tkInit";
+ 
+ 
+ /*
   *----------------------------------------------------------------------
   *
   * TkpInit --
***************
*** 58,102 ****
      Tcl_DString path;
      int result;
  
-     /*
-      * The following does not work with
-      * safe interps because file exists is restricted.
-      * to be fixed using [interp issafe] like in Unix & Windows.
-      */
-     static char initCmd[] =
- 	"if [file exists $tk_library:tk.tcl] {\n\
- 	    source $tk_library:tk.tcl\n\
- 	    source $tk_library:button.tcl\n\
- 	    source $tk_library:entry.tcl\n\
- 	    source $tk_library:listbox.tcl\n\
- 	    source $tk_library:menu.tcl\n\
- 	    source $tk_library:scale.tcl\n\
- 	    source $tk_library:scrlbar.tcl\n\
- 	    source $tk_library:text.tcl\n\
- 	    source $tk_library:comdlg.tcl\n\
- 	    source $tk_library:msgbox.tcl\n\
- 	} else {\n\
- 	    set msg \"can't find tk resource or $tk_library:tk.tcl;\"\n\
- 	    append msg \" perhaps you need to\\ninstall Tk or set your \"\n\
- 	    append msg \"TK_LIBRARY environment variable?\"\n\
- 	    error $msg\n\
- 	}";
- 
      Tcl_DStringInit(&path);
  
      /*
       * The tk_library path can be found in several places.  Here is the order
       * in which the are searched.
       *		1) the variable may already exist
!      *		2) env array
!      *		3) System Folder:Extensions:Tool Command Language:
       */
!      
      libDir = Tcl_GetVar(interp, "tk_library", TCL_GLOBAL_ONLY);
      if (libDir == NULL) {
- 	libDir = Tcl_GetVar2(interp, "env", "TK_LIBRARY", TCL_GLOBAL_ONLY);
-     }
-     if (libDir == NULL) {
  	tempPath = Tcl_GetVar2(interp, "env", "EXT_FOLDER", TCL_GLOBAL_ONLY);
  	if (tempPath != NULL) {
  	    Tcl_DString libPath;
--- 191,208 ----
      Tcl_DString path;
      int result;
  
      Tcl_DStringInit(&path);
  
      /*
       * The tk_library path can be found in several places.  Here is the order
       * in which the are searched.
       *		1) the variable may already exist
!      *		2) System Folder:Extensions:Tool Command Language:
!      *		3) env array
       */
! 
      libDir = Tcl_GetVar(interp, "tk_library", TCL_GLOBAL_ONLY);
      if (libDir == NULL) {
  	tempPath = Tcl_GetVar2(interp, "env", "EXT_FOLDER", TCL_GLOBAL_ONLY);
  	if (tempPath != NULL) {
  	    Tcl_DString libPath;
***************
*** 112,118 ****
  	}
      }
      if (libDir == NULL) {
! 	libDir = "no library";
      }
  
      /*
--- 218,224 ----
  	}
      }
      if (libDir == NULL) {
! 	libDir = "";
      }
  
      /*
***************
*** 121,151 ****
      Tcl_SetVar(interp, "tk_library", libDir, TCL_GLOBAL_ONLY);
      Tcl_DStringFree(&path);
  
!     /*
!      * Source the needed Tk libraries from the resource
!      * fork of the application.
!      */
!     result = Tcl_MacEvalResource(interp, "tk", 0, NULL);
!     result |= Tcl_MacEvalResource(interp, "button", 0, NULL);
!     result |= Tcl_MacEvalResource(interp, "entry", 0, NULL);
!     result |= Tcl_MacEvalResource(interp, "listbox", 0, NULL);
!     result |= Tcl_MacEvalResource(interp, "menu", 0, NULL);
!     result |= Tcl_MacEvalResource(interp, "scale", 0, NULL);
!     result |= Tcl_MacEvalResource(interp, "scrollbar", 0, NULL);
!     result |= Tcl_MacEvalResource(interp, "text", 0, NULL);
!     result |= Tcl_MacEvalResource(interp, "dialog", 0, NULL);
!     result |= Tcl_MacEvalResource(interp, "focus", 0, NULL);
!     result |= Tcl_MacEvalResource(interp, "optionMenu", 0, NULL);
!     result |= Tcl_MacEvalResource(interp, "palette", 0, NULL);
!     result |= Tcl_MacEvalResource(interp, "tearoff", 0, NULL);
!     result |= Tcl_MacEvalResource(interp, "tkerror", 0, NULL);
!     result |= Tcl_MacEvalResource(interp, "comdlg", 0, NULL);
!     result |= Tcl_MacEvalResource(interp, "msgbox", 0, NULL);
! 
!     if (result != TCL_OK) {
! 	result = Tcl_Eval(interp, initCmd);
      }
!     return result;
  }
  
  /*
--- 227,236 ----
      Tcl_SetVar(interp, "tk_library", libDir, TCL_GLOBAL_ONLY);
      Tcl_DStringFree(&path);
  
!     if (doSafe) {
! 	return Tcl_Eval(interp, safeInitScript);
      }
!     return Tcl_Eval(interp, initScript);
  }
  
  /*
*** mac/tkMacPort.h.orig	Sun Aug  1 23:25:23 1999
--- mac/tkMacPort.h	Wed Feb 16 23:08:48 2000
***************
*** 70,78 ****
   * in any other header file.
   */
  
- #ifndef panic	/* In a stubs-aware setting, this could confuse the #define */
- extern void 		panic  _ANSI_ARGS_(TCL_VARARGS(char *, string));
- #endif
  extern int		strcasecmp _ANSI_ARGS_((CONST char *s1,
  			    CONST char *s2));
  extern int		strncasecmp _ANSI_ARGS_((CONST char *s1,
--- 70,75 ----
*** win/Makefile.gnu.orig	Wed Feb 16 23:08:48 2000
--- win/Makefile.gnu	Thu Feb 17 09:56:12 2000
***************
*** 0 ****
--- 1,571 ----
+ # Generated automatically from Makefile.in by configure.
+ # Visual C++ 2.x and 4.0 makefile
+ #
+ # See the file "license.terms" for information on usage and redistribution
+ # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ # 
+ # Copyright (c) 1995-1996 Sun Microsystems, Inc.
+ # SCCS: @(#) makefile.vc 1.63 97/08/13 13:33:32
+ 
+ # Does not depend on the presence of any environment variables in
+ # order to compile tcl; all needed information is derived from 
+ # location of the compiler directories.
+ 
+ # This file is CYGNUS LOCAL.  It is a copy of makefile.vc from the
+ # standard tk distribution, modified to work with cygwin32 and an
+ # autoconf configure script.  I have chosen to minimize the number of
+ # changes, so the comments continue to refer to Visual C++ and the
+ # like.  This should make it easier to merge in a new version if that
+ # is necessary.
+ 
+ prefix = /progra~1/tcl
+ exec_prefix = ${prefix}
+ VPATH = .:./../xlib:./../generic:./../unix:./../win/rc
+ srcdir = .
+ 
+ INSTALL = $(TOOLS32)/install -c
+ INSTALL_PROGRAM = ${INSTALL}
+ INSTALL_DATA = ${INSTALL} -m 644
+ 
+ CC = gcc
+ CFLAGS = -O2 -DSTATIC_BUILD -DTCL_THREADS -mno-cygwin -fnative-struct
+ NM = nm
+ AS = as
+ LD = ld
+ DLLTOOL = dlltool
+ DLLWRAP = dllwrap -mno-cygwin
+ WINDRES = windres
+ 
+ DLL_LDFLAGS = -mwindows -Wl,-e,_DllMain@12
+ DLL_LDLIBS =
+ 
+ # Current Tk version;  used in various names.
+ 
+ DIRVERSION = 8.3
+ 
+ # The following definition can be set to non-null for special systems
+ # like AFS with replication.  It allows the pathnames used for installation
+ # to be different than those used for actually reference files at
+ # run-time.  INSTALL_ROOT is prepended to $prefix and $exec_prefix
+ # when installing files.
+ INSTALL_ROOT =
+ 
+ # Directory from which applications will reference the library of Tcl
+ # scripts (note: you can set the TK_LIBRARY environment variable at
+ # run-time to override the compiled-in location):
+ TK_LIBRARY =		${prefix}/lib/tk$(DIRVERSION)
+ 
+ # Path name to use when installing library scripts:
+ SCRIPT_INSTALL_DIR =	$(INSTALL_ROOT)$(TK_LIBRARY)
+ 
+ # Directory in which to install the .a or .so binary for the Tk library:
+ LIB_INSTALL_DIR =	$(INSTALL_ROOT)${exec_prefix}/lib
+ 
+ # Directory in which to install the program wish:
+ BIN_INSTALL_DIR =	$(INSTALL_ROOT)${exec_prefix}/bin
+ 
+ # Directory in which to install the include file tk.h:
+ INCLUDE_INSTALL_DIR =	$(INSTALL_ROOT)${prefix}/include
+ 
+ # Directory in which to install the X11 header files.
+ X11_INCLUDE_INSTALL_DIR = $(INSTALL_ROOT)${prefix}/include/X11
+ 
+ DEMOPROGS = browse hello ixset rmt rolodex square tcolor timer widget
+ 
+ #
+ # Project directories
+ #
+ # ROOT    = top of source tree
+ #
+ # TMPDIR  = location where .obj files should be stored during build
+ #
+ # TOOLS32 = location of VC++ 32-bit development tools. Note that the
+ #	    VC++ 2.0 header files are broken, so you need to use the
+ #	    ones that come with the developer network CD's, or later
+ #	    versions of VC++.
+ #
+ # TCLDIR = location of top of Tcl source heirarchy
+ #
+ 
+ ROOT	= $(srcdir)/..
+ TMPDIR	= .
+ TOOLS32	= c:/gcc-2.95.2/bin
+ TCLDIR	= $(srcdir)/../../tcl8.3.0
+ 
+ # Set this to the appropriate value of /MACHINE: for your platform
+ MACHINE	= IX86
+ 
+ # Comment the following line to compile with symbols
+ NODEBUG=1
+ 
+ # uncomment the following two lines to compile with TCL_MEM_DEBUG
+ #DEBUGDEFINES	=-DTCL_MEM_DEBUG
+ 
+ ######################################################################
+ # Do not modify below this line
+ ######################################################################
+ 
+ TCLNAMEPREFIX = tcl
+ TKNAMEPREFIX = tk
+ WISHNAMEPREFIX = wish
+ VERSION = 83
+ DOTVERSION = 8.3
+ 
+ TCLSTUBPREFIX = $(TCLNAMEPREFIX)stub
+ TKSTUBPREFIX  = $(TKNAMEPREFIX)stub
+ 
+ TCLLIB = lib$(TCLNAMEPREFIX)$(VERSION).a
+ TCLSTUBLIB = lib$(TCLSTUBPREFIX)$(VERSION).a
+ TCLLIBSA = lib$(TCLNAMEPREFIX)$(VERSION)s.a
+ TKDLL = $(TKNAMEPREFIX)$(VERSION).dll
+ TKLIB = lib$(TKNAMEPREFIX)$(VERSION).a
+ TKLIBSA = lib$(TKNAMEPREFIX)$(VERSION)s.a
+ TKSTUBLIB = lib$(TKSTUBPREFIX)$(VERSION).a
+ TESTDLLNAME	= $(TKNAMEPREFIX)test$(DBGX).dll
+ TESTDLL		= $(OUTDIR)/$(TESTDLLNAME)
+ SQUAREDLLNAME	= $(TKNAMEPREFIX)square$(DBGX).dll
+ SQUAREDLL	= $(OUTDIR)/$(SQUAREDLLNAME)
+ 
+ WISH = wish$(VERSION).exe
+ WISHSA = wish$(VERSION)s.exe
+ WISHP = wishp$(VERSION).exe
+ TKTEST = tktest.exe
+ DUMPEXTS = $(TMPDIR)\dumpexts.exe
+ 
+ WISHOBJS = \
+ 	$(TMPDIR)/winMain.o
+ 
+ WISHSAOBJS = \
+ 	$(TMPDIR)/winMainSA.o
+ 
+ 
+ TKTESTOBJS = \
+ 	$(TMPDIR)/tkTest.o \
+ 	$(TMPDIR)/tkSquare.o \
+ 	$(TMPDIR)/testMain.o
+ 
+ XLIBOBJS = \
+ 	$(TMPDIR)/xcolors.o \
+ 	$(TMPDIR)/xdraw.o \
+ 	$(TMPDIR)/xgc.o \
+ 	$(TMPDIR)/ximage.o \
+ 	$(TMPDIR)/xutil.o
+ 
+ TKOBJS = \
+ 	$(TMPDIR)/tkConsole.o \
+ 	$(TMPDIR)/tkMain.o \
+ 	$(TMPDIR)/tkUnixMenubu.o \
+ 	$(TMPDIR)/tkUnixScale.o \
+ 	$(XLIBOBJS) \
+ 	$(TMPDIR)/tkWin3d.o \
+ 	$(TMPDIR)/tkWinButton.o \
+ 	$(TMPDIR)/tkWinClipboard.o \
+ 	$(TMPDIR)/tkWinColor.o \
+ 	$(TMPDIR)/tkWinConfig.o \
+ 	$(TMPDIR)/tkWinCursor.o \
+ 	$(TMPDIR)/tkWinDialog.o \
+ 	$(TMPDIR)/tkWinDraw.o \
+ 	$(TMPDIR)/tkWinEmbed.o \
+ 	$(TMPDIR)/tkWinFont.o \
+ 	$(TMPDIR)/tkWinImage.o \
+ 	$(TMPDIR)/tkWinInit.o \
+ 	$(TMPDIR)/tkWinKey.o \
+ 	$(TMPDIR)/tkWinMenu.o \
+ 	$(TMPDIR)/tkWinPixmap.o \
+ 	$(TMPDIR)/tkWinPointer.o \
+ 	$(TMPDIR)/tkWinRegion.o \
+ 	$(TMPDIR)/tkWinScrlbr.o \
+ 	$(TMPDIR)/tkWinSend.o \
+ 	$(TMPDIR)/tkWinWindow.o \
+ 	$(TMPDIR)/tkWinWm.o \
+ 	$(TMPDIR)/tkWinX.o \
+ 	$(TMPDIR)/stubs.o \
+ 	$(TMPDIR)/tk3d.o \
+ 	$(TMPDIR)/tkArgv.o \
+ 	$(TMPDIR)/tkAtom.o \
+ 	$(TMPDIR)/tkBind.o \
+ 	$(TMPDIR)/tkBitmap.o \
+ 	$(TMPDIR)/tkButton.o \
+ 	$(TMPDIR)/tkCanvArc.o \
+ 	$(TMPDIR)/tkCanvBmap.o \
+ 	$(TMPDIR)/tkCanvImg.o \
+ 	$(TMPDIR)/tkCanvLine.o \
+ 	$(TMPDIR)/tkCanvPoly.o \
+ 	$(TMPDIR)/tkCanvPs.o \
+ 	$(TMPDIR)/tkCanvText.o \
+ 	$(TMPDIR)/tkCanvUtil.o \
+ 	$(TMPDIR)/tkCanvWind.o \
+ 	$(TMPDIR)/tkCanvas.o \
+ 	$(TMPDIR)/tkClipboard.o \
+ 	$(TMPDIR)/tkCmds.o \
+ 	$(TMPDIR)/tkColor.o \
+ 	$(TMPDIR)/tkConfig.o \
+ 	$(TMPDIR)/tkCursor.o \
+ 	$(TMPDIR)/tkEntry.o \
+ 	$(TMPDIR)/tkError.o \
+ 	$(TMPDIR)/tkEvent.o \
+ 	$(TMPDIR)/tkFileFilter.o \
+ 	$(TMPDIR)/tkFocus.o \
+ 	$(TMPDIR)/tkFont.o \
+ 	$(TMPDIR)/tkFrame.o \
+ 	$(TMPDIR)/tkGC.o \
+ 	$(TMPDIR)/tkGeometry.o \
+ 	$(TMPDIR)/tkGet.o \
+ 	$(TMPDIR)/tkGrab.o \
+ 	$(TMPDIR)/tkGrid.o \
+ 	$(TMPDIR)/tkImage.o \
+ 	$(TMPDIR)/tkImgBmap.o \
+ 	$(TMPDIR)/tkImgGIF.o \
+ 	$(TMPDIR)/tkImgPPM.o \
+ 	$(TMPDIR)/tkImgPhoto.o \
+ 	$(TMPDIR)/tkImgUtil.o \
+ 	$(TMPDIR)/tkListbox.o \
+ 	$(TMPDIR)/tkMacWinMenu.o \
+ 	$(TMPDIR)/tkMenu.o \
+ 	$(TMPDIR)/tkMenubutton.o \
+ 	$(TMPDIR)/tkMenuDraw.o \
+ 	$(TMPDIR)/tkMessage.o \
+ 	$(TMPDIR)/tkObj.o \
+ 	$(TMPDIR)/tkOldConfig.o \
+ 	$(TMPDIR)/tkOption.o \
+ 	$(TMPDIR)/tkPack.o \
+ 	$(TMPDIR)/tkPlace.o \
+ 	$(TMPDIR)/tkPointer.o \
+ 	$(TMPDIR)/tkRectOval.o \
+ 	$(TMPDIR)/tkScale.o \
+ 	$(TMPDIR)/tkScrollbar.o \
+ 	$(TMPDIR)/tkSelect.o \
+ 	$(TMPDIR)/tkText.o \
+ 	$(TMPDIR)/tkTextBTree.o \
+ 	$(TMPDIR)/tkTextDisp.o \
+ 	$(TMPDIR)/tkTextImage.o \
+ 	$(TMPDIR)/tkTextIndex.o \
+ 	$(TMPDIR)/tkTextMark.o \
+ 	$(TMPDIR)/tkTextTag.o \
+ 	$(TMPDIR)/tkTextWind.o \
+ 	$(TMPDIR)/tkTrig.o \
+ 	$(TMPDIR)/tkUtil.o \
+ 	$(TMPDIR)/tkVisual.o \
+ 	$(TMPDIR)/tkStubInit.o \
+ 	$(TMPDIR)/tkWindow.o
+ 
+ TKDLLOBJS = \
+ 	$(TKOBJS) \
+ 	$(TMPDIR)/tkWin32Dll.o
+ 
+ TKSTUBOBJS = $(TMPDIR)/tkStubLib.o \
+ 	$(TMPDIR)/tkStubImg.o
+ 
+ cc32		= $(TOOLS32)\bin\cl.exe
+ link32		= $(TOOLS32)\bin\link.exe
+ rc32		= $(TOOLS32)\bin\rc.exe
+ include32	= -I$(TOOLS32)\include
+ 
+ WINDIR          = $(ROOT)/win
+ OUTDIR		= .
+ GENERICDIR	= $(ROOT)/generic
+ LIBDIR		= $(ROOT)/library
+ XLIBDIR		= $(ROOT)/xlib
+ BITMAPDIR	= $(ROOT)/bitmaps
+ TCLLIBDIR       = ../../tcl8.3.0/win
+ RCDIR		= $(WINDIR)/rc
+ 
+ TK_INCLUDES	= -I$(WINDIR) -I$(GENERICDIR) -I$(BITMAPDIR) -I$(XLIBDIR) \
+ 			-I$(TCLDIR)/generic
+ TK_DEFINES	= $(DEBUGDEFINES)
+ 
+ TK_CFLAGS	= $(cdebug) $(cflags) $(cvarsdll) $(include32) \
+ 			$(TK_INCLUDES) $(TK_DEFINES) $(CFLAGS)
+ 
+ ######################################################################
+ # Link flags
+ ######################################################################
+ 
+ #!IFDEF NODEBUG
+ #ldebug = /RELEASE
+ #!ELSE
+ #ldebug = -debug:full -debugtype:cv
+ #!ENDIF
+ 
+ # declarations common to all linker options
+ lcommon = /NODEFAULTLIB /RELEASE /NOLOGO
+ 
+ # declarations for use on Intel i386, i486, and Pentium systems
+ #!IF "$(MACHINE)" == "IX86"
+ #DLLENTRY = @12
+ #lflags   = $(lcommon) -align:0x1000 /MACHINE:$(MACHINE)
+ #!ELSE
+ #lflags   = $(lcommon) /MACHINE:$(MACHINE)
+ #!ENDIF
+ 
+ conlflags = $(lflags) -Wl,--subsystem,console -mwindows
+ guilflags = $(lflags) -mwindows
+ dlllflags = $(lflags)
+ 
+ #!IF "$(MACHINE)" == "PPC"
+ #libc = libc.lib
+ #libcdll = crtdll.lib
+ #!ELSE
+ #libc = libc.lib oldnames.lib
+ #libcdll = msvcrt.lib oldnames.lib
+ #!ENDIF
+ 
+ baselibs   = -lkernel32 $(optlibs) -ladvapi32
+ winlibs    = $(baselibs) -luser32 -lgdi32 -lcomdlg32 -lwinspool
+ guilibs	   = $(libc) $(winlibs)
+ 
+ guilibsdll = $(libcdll) $(winlibs)
+ 
+ ######################################################################
+ # Compile flags
+ ######################################################################
+ 
+ #!IFDEF NODEBUG
+ #cdebug = -Ox
+ #!ELSE
+ #cdebug = -Z7 -Od -WX
+ #!ENDIF
+ 
+ # declarations common to all compiler options
+ #ccommon = -c -W3 -nologo -YX
+ 
+ #!IF "$(MACHINE)" == "IX86"
+ #cflags = $(ccommon) -D_X86_=1
+ #!ELSE
+ #!IF "$(MACHINE)" == "MIPS"
+ #cflags = $(ccommon) -D_MIPS_=1
+ #!ELSE
+ #!IF "$(MACHINE)" == "PPC"
+ #cflags = $(ccommon) -D_PPC_=1
+ #!ELSE
+ #!IF "$(MACHINE)" == "ALPHA"
+ #cflags = $(ccommon) -D_ALPHA_=1
+ #!ENDIF
+ #!ENDIF
+ #!ENDIF
+ #!ENDIF
+ 
+ cvars      = -DWIN32 -D_WIN32 -D__WIN32__
+ cvarsmt    = $(cvars) -D_MT
+ cvarsdll   = $(cvarsmt) -D_DLL
+ 
+ CON_CFLAGS	= $(cdebug) $(cflags) $(cvars) $(include32) -DCONSOLE
+ 
+ ######################################################################
+ # Project specific targets
+ ######################################################################
+ 
+ all:    $(WISH) $(TKLIBSA) $(TKSTUBLIB)
+ tktest:	$(WISH) $(TESTDLL) $(PTESTDLL) $(SQUAREDLL)
+ 
+ install: install-binaries install-libraries install-demos
+ 
+ install-binaries: $(TKDLL) $(TKLIB) $(WISH)
+ 	@for i in $(LIB_INSTALL_DIR) $(BIN_INSTALL_DIR) ; \
+ 	    do \
+ 	    if [ ! -d $$i ] ; then \
+ 		echo "Making directory $$i"; \
+ 		mkdir $$i; \
+ 		chmod 755 $$i; \
+ 		else true; \
+ 		fi; \
+ 	    done;
+ 	@echo "Installing $(TKLIB)"
+ 	@$(INSTALL_DATA) $(TKLIB) $(LIB_INSTALL_DIR)/$(TKLIB)
+ 	@chmod 555 $(LIB_INSTALL_DIR)/$(TKLIB)
+ 	@echo "Installing wish"
+ 	@$(INSTALL_PROGRAM) $(WISH) $(BIN_INSTALL_DIR)/$(WISH)
+ #	@echo "Installing tkConfig.sh"
+ #	@$(INSTALL_DATA) ../unix/tkConfig.sh $(LIB_INSTALL_DIR)/tkConfig.sh
+ 
+ install-libraries:
+ 	@echo "Installing $(DLL)"
+ 	@$(INSTALL_DATA) $(TKDLL) $(BIN_INSTALL_DIR)/$(TKDLL)
+ 	@for i in $(INSTALL_ROOT)${prefix}/lib $(INCLUDE_INSTALL_DIR) \
+ 		$(SCRIPT_INSTALL_DIR) \
+ 		$(X11_INCLUDE_INSTALL_DIR) ; \
+ 	    do \
+ 	    if [ ! -d $$i ] ; then \
+ 		echo "Making directory $$i"; \
+ 		mkdir $$i; \
+ 		chmod 755 $$i; \
+ 		else true; \
+ 		fi; \
+ 	    done;
+ 	@echo "Installing tk.h and tkDecls.h"
+ 	@$(INSTALL_DATA) $(GENERICDIR)/tk.h $(INCLUDE_INSTALL_DIR)/tk.h
+ 	@$(INSTALL_DATA) $(GENERICDIR)/tkDecls.h $(INCLUDE_INSTALL_DIR)/tkDecls.h
+ 	for i in $(XLIBDIR)/X11/*.h; \
+ 	    do \
+ 	    echo "Installing $$i"; \
+ 	    $(INSTALL_DATA) $$i $(X11_INCLUDE_INSTALL_DIR); \
+ 	    done;
+ 	for i in $(ROOT)/library/*.tcl $(ROOT)/library/tclIndex $(ROOT)/unix/tkAppInit.c; \
+ 	    do \
+ 	    echo "Installing $$i"; \
+ 	    $(INSTALL_DATA) $$i $(SCRIPT_INSTALL_DIR); \
+ 	    done;
+ 
+ install-minimal:
+ 	@echo "Installing $(DLL)"
+ 	@$(INSTALL_DATA) $(TKDLL) $(BIN_INSTALL_DIR)/$(TKDLL)
+ 	@for i in $(INSTALL_ROOT)${prefix}/lib $(SCRIPT_INSTALL_DIR) ; \
+ 	    do \
+ 	    if [ ! -d $$i ] ; then \
+ 		echo "Making directory $$i"; \
+ 		mkdir $$i; \
+ 		chmod 755 $$i; \
+ 		else true; \
+ 		fi; \
+ 	    done;
+ 	for i in $(ROOT)/library/*.tcl $(ROOT)/library/tclIndex; \
+ 	    do \
+ 	    echo "Installing $$i"; \
+ 	    $(INSTALL_DATA) $$i $(SCRIPT_INSTALL_DIR); \
+ 	    done;
+ 
+ install-demos:
+ 	@for i in $(INSTALL_ROOT)${prefix}/lib $(SCRIPT_INSTALL_DIR) \
+ 		$(SCRIPT_INSTALL_DIR)/demos \
+ 		$(SCRIPT_INSTALL_DIR)/demos/images ; \
+ 	    do \
+ 	    if [ ! -d $$i ] ; then \
+ 		echo "Making directory $$i"; \
+ 		mkdir $$i; \
+ 		chmod 755 $$i; \
+ 		else true; \
+ 		fi; \
+ 	    done;
+ 	@for i in $(ROOT)/library/demos/*; \
+ 	    do \
+ 	    if [ -f $$i ] ; then \
+ 		echo "Installing $$i"; \
+ 		sed -e '3 s|exec wish|exec $(WISH)|' \
+ 			$$i > $(SCRIPT_INSTALL_DIR)/demos/`basename $$i`; \
+ 	    fi; \
+ 	    done;
+ 	@for i in $(DEMOPROGS); \
+ 	    do \
+ 	    chmod 755 $(SCRIPT_INSTALL_DIR)/demos/$$i; \
+ 	    done;
+ 	@for i in $(ROOT)/library/demos/images/*; \
+ 	    do \
+ 	    if [ -f $$i ] ; then \
+ 		echo "Installing $$i"; \
+ 		$(INSTALL_DATA) $$i $(SCRIPT_INSTALL_DIR)/demos/images; \
+ 		fi; \
+ 	    done;
+ 
+ $(TKLIBSA): $(TKOBJS) $(TKSTUBOBJS)
+ 	$(AR) cr $(TKLIBSA) $(TKOBJS) $(TKSTUBOBJS)
+ 
+ $(TKSTUBLIB): $(TKSTUBOBJS)
+ 	$(AR) cr $(TKSTUBLIB) $(TKSTUBOBJS)
+ 
+ $(TKDLL): $(TKDLLOBJS) tkres.o tk.def
+ 	$(DLLWRAP) -s $(DLL_LDFLAGS) -o $@ $(TKDLLOBJS) \
+ 	  --def tk.def tkres.o \
+ 	  $(TCLLIBDIR)/$(TCLSTUBLIB) $(DLL_LDLIBS)
+ 
+ $(TKLIB): $(TMPDIR)/tk.def $(TKDLL)
+ 	$(DLLTOOL) --as=$(AS) --dllname $(TKDLL) --def $(TMPDIR)/tk.def \
+ 	  --output-lib $(TKLIB)
+ 
+ $(TESTDLL):	$(TMPDIR)/tkTest.o $(TMPDIR)/tclDllEntry.o $(OUTDIR)/$(TKSTUBLIB)
+ 	echo EXPORTS > $(TMPDIR)/tktest.def
+ 	echo Tktest_Init >> $(TMPDIR)/tktest.def
+ 	$(DLLWRAP) -s $(DLL_LDFLAGS) -o $@ \
+ 	  --def $(TMPDIR)/tktest.def $(TMPDIR)/tkTest.o $(TMPDIR)/tclDllEntry.o \
+ 	  $(TCLLIBDIR)/$(TCLSTUBLIB) $(OUTDIR)/$(TKSTUBLIB)
+ 	rm -f $(TMPDIRNAME)/tktest.def
+ 
+ $(SQUAREDLL):	$(TMPDIR)/tkSquare.o $(TMPDIR)/tclDllEntry.o $(OUTDIR)/$(TKSTUBLIB)
+ 	echo EXPORTS > $(TMPDIR)/square.def
+ 	echo Tksquare_Init >> $(TMPDIR)/square.def
+ 	$(DLLWRAP) -s $(DLL_LDFLAGS) -o $@ \
+ 	  --def $(TMPDIR)/square.def $(TMPDIR)/tkSquare.o $(TMPDIR)/tclDllEntry.o \
+ 	  $(TCLLIBDIR)/$(TCLSTUBLIB) $(OUTDIR)/$(TKSTUBLIB)
+ 	rm -f $(TMPDIRNAME)/square.def
+ 
+ 
+ 
+ $(WISH): $(WISHOBJS) wishres.o $(TKLIB)
+ 	$(CC) -mno-cygwin $(ldebug) $(guilflags) $(WISHOBJS) wishres.o -o $@ \
+ 		$(TKLIB) $(TCLLIBDIR)/$(TCLLIB) $(guilibsdll)
+ 	strip $(WISH)
+ 
+ tk.def: $(TKDLLOBJS)
+ 	$(DLLTOOL) --export-all --exclude-symbols DllMain@12 --output-def $@ $(TKDLLOBJS)
+ 
+ $(TMPDIR)/tkTest.o: $(GENERICDIR)/tkTest.c
+ 	$(CC) -c $(TK_CFLAGS) -DUSE_TCL_STUBS -DUSE_TK_STUBS -DNO_PLATFORM_TEST $(GENERICDIR)/tkTest.c
+ 
+ $(TMPDIR)/tkWindow.o: $(GENERICDIR)/tkWindow.c
+ 	$(CC) -c $(TK_CFLAGS) -DUSE_TCL_STUBS -DNO_STATIC_INIT $(GENERICDIR)/tkWindow.c
+ 
+ $(TMPDIR)/tkSquare.o: $(GENERICDIR)/tkSquare.c
+ 	$(CC) -c $(TK_CFLAGS) -DUSE_TCL_STUBS -DUSE_TK_STUBS $(GENERICDIR)/tkSquare.c
+ 
+ $(TMPDIR)/tkWinTest.o: $(WINDIR)/tkWinTest.c
+ 	$(CC) -c $(TK_CFLAGS) -DUSE_TCL_STUBS -DUSE_TK_STUBS $(WINDIR)/tkWinTest.c
+ 
+ $(TMPDIR)/winMain.o: $(TMPDIR)/winMain.c
+ 	$(CC) -c $(TK_CFLAGS) $(TMPDIR)/winMain.c
+ 
+ 
+ #
+ # Implicit rules
+ #
+ 
+ .c.o:
+ 	$(CC) -c $(TK_CFLAGS) -DUSE_TCL_STUBS $<
+ 
+ tkres.o: $(ROOT)/win/rc/tk.rc
+ 	$(WINDRES) --include $(ROOT)/win/rc --include $(ROOT)/generic --include $(TCLDIR)/generic \
+ 	  --define VS_VERSION_INFO=1 $(ROOT)/win/rc/tk.rc tkres.o
+ 
+ wishres.o: $(ROOT)/win/rc/wish.rc
+ 	$(WINDRES) --include $(ROOT)/win/rc --include $(ROOT)/generic --include $(TCLDIR)/generic \
+ 	  --define VS_VERSION_INFO=1 $(ROOT)/win/rc/wish.rc wishres.o
+ 
+ clean:
+ 	rm -f *.exp *.a *.dll *.exe $(TMPDIR)/*.o *.res *.def
+ 	rm -f tk.base
+ 
+ # dependencies
+ 
+ $(TMPDIR)/tk.res: \
+     $(RCDIR)/buttons.bmp \
+     $(RCDIR)/cursor*.cur \
+     $(RCDIR)/tk.ico
+ 
+ $(GENERICDIR)/default.h: $(WINDIR)/tkWinDefault.h
+ $(GENERICDIR)/tkButton.c: $(GENERICDIR)/default.h
+ $(GENERICDIR)/tkCanvas.c: $(GENERICDIR)/default.h
+ $(GENERICDIR)/tkEntry.c: $(GENERICDIR)/default.h
+ $(GENERICDIR)/tkFrame.c: $(GENERICDIR)/default.h
+ $(GENERICDIR)/tkListbox.c: $(GENERICDIR)/default.h
+ $(GENERICDIR)/tkMenu.c: $(GENERICDIR)/default.h
+ $(GENERICDIR)/tkMenubutton.c: $(GENERICDIR)/default.h
+ $(GENERICDIR)/tkMessage.c: $(GENERICDIR)/default.h
+ $(GENERICDIR)/tkScale.c: $(GENERICDIR)/default.h
+ $(GENERICDIR)/tkScrollbar.c: $(GENERICDIR)/default.h
+ $(GENERICDIR)/tkText.c: $(GENERICDIR)/default.h
+ $(GENERICDIR)/tkTextIndex.c: $(GENERICDIR)/default.h
+ $(GENERICDIR)/tkTextTag.c: $(GENERICDIR)/default.h
+ 
+ $(GENERICDIR)/tkText.c: $(GENERICDIR)/tkText.h
+ $(GENERICDIR)/tkTextBTree.c: $(GENERICDIR)/tkText.h
+ $(GENERICDIR)/tkTextDisp.c: $(GENERICDIR)/tkText.h
+ $(GENERICDIR)/tkTextDisp.c: $(GENERICDIR)/tkText.h
+ $(GENERICDIR)/tkTextImage.c: $(GENERICDIR)/tkText.h
+ $(GENERICDIR)/tkTextIndex.c: $(GENERICDIR)/tkText.h
+ $(GENERICDIR)/tkTextMark.c: $(GENERICDIR)/tkText.h
+ $(GENERICDIR)/tkTextTag.c: $(GENERICDIR)/tkText.h
+ $(GENERICDIR)/tkTextWind.c: $(GENERICDIR)/tkText.h
+ 
+ $(GENERICDIR)/tkMacWinMenu.c: $(GENERICDIR)/tkMenu.h
+ $(GENERICDIR)/tkMenu.c: $(GENERICDIR)/tkMenu.h
+ $(GENERICDIR)/tkMenuDraw.c: $(GENERICDIR)/tkMenu.h
+ $(WINDIR)/tkWinMenu.c: $(GENERICDIR)/tkMenu.h
+ 
*** win/Makefile.mingw.orig	Sun Feb 20 12:18:10 2000
--- win/Makefile.mingw	Sun Feb 20 12:18:01 2000
***************
*** 0 ****
--- 1,600 ----
+ # GCC/MinGW makefile
+ #
+ # See the file "license.terms" for information on usage and redistribution
+ # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ # 
+ # Copyright (c) 1995-1997 Sun Microsystems, Inc.
+ # RCS: @(#) $Id: makefile.vc,v 1.1.1.1 2000/02/16 21:48:00 khan Exp $
+ 
+ # Does not depend on the presence of any environment variables in
+ # order to compile tcl; all needed information is derived from 
+ # location of the compiler directories.
+ 
+ #
+ # Project directories
+ #
+ # ROOT    = top of source tree
+ #
+ # TMPDIR  = location where .o files should be stored during build
+ #
+ # TOOLS32 = location of VC++ 32-bit development tools. Note that the
+ #	    VC++ 2.0 header files are broken, so you need to use the
+ #	    ones that come with the developer network CD's, or later
+ #	    versions of VC++.
+ #
+ # TCLDIR = location of top of Tcl source heirarchy
+ #
+ 
+ VPATH = .:$(XLIBDIR):$(WINDIR):$(GENERICDIR):$(ROOT)/unix:$(RCDIR)
+ 
+ ROOT		= ..
+ TCLDIR		= ../../tcl8.3.0
+ INSTALLDIR      = c:/progra~1/tcl
+ 
+ # Set this to the appropriate value of /MACHINE: for your platform
+ MACHINE	= IX86
+ 
+ # Yes, Mingw will support IA64!
+ #!IF "$(MACHINE)" == "IA64"
+ #TOOLS32		= c:/mingw64
+ #TOOLS32_rc	= c:/mingw64
+ #!ELSE
+ TOOLS32		= c:/mingw32
+ TOOLS32_rc	= c:/mingw32
+ #!ENDIF
+ 
+ # Uncomment the following line to compile with thread support
+ #THREADDEFINES = -DTCL_THREADS=1
+ 
+ # Set NODEBUG to 0 to compile with symbols
+ NODEBUG = 1
+ 
+ # uncomment the following two lines to compile with TCL_MEM_DEBUG
+ #DEBUGDEFINES	=-DTCL_MEM_DEBUG
+ 
+ ######################################################################
+ # Do not modify below this line
+ ######################################################################
+ 
+ TCLNAMEPREFIX = tcl
+ TKNAMEPREFIX = tk
+ WISHNAMEPREFIX = wish
+ VERSION = 83
+ DOTVERSION = 8.3
+ 
+ TCLSTUBPREFIX = $(TCLNAMEPREFIX)stub
+ TKSTUBPREFIX  = $(TKNAMEPREFIX)stub
+ 
+ 
+ BINROOT		= .
+ #!IF "$(NODEBUG)" == "1"
+ #TMPDIRNAME	= Release
+ #DBGX		=
+ #!ELSE
+ #TMPDIRNAME	= Debug
+ #DBGX		= d
+ #!ENDIF
+ TMPDIR		= $(BINROOT)/$(TMPDIRNAME)
+ OUTDIRNAME	= $(TMPDIRNAME)
+ OUTDIR		= $(TMPDIR)
+ 
+ TCLLIB 		= lib$(TCLNAMEPREFIX)$(VERSION)$(DBGX).a
+ TCLPLUGINLIB 	= lib$(TCLNAMEPREFIX)$(VERSION)p.a
+ TCLSTUBLIB	= lib$(TCLSTUBPREFIX)$(VERSION)$(DBGX).a
+ TKDLLNAME	= $(TKNAMEPREFIX)$(VERSION)$(DBGX).dll
+ TKDLL 		= $(OUTDIR)/$(TKDLLNAME)
+ TKLIB 		= $(OUTDIR)/lib$(TKNAMEPREFIX)$(VERSION)$(DBGX).a
+ TKSTUBLIBNAME	= lib$(TKSTUBPREFIX)$(VERSION)$(DBGX).a
+ TKSTUBLIB	= $(OUTDIR)/$(TKSTUBLIBNAME)
+ TKPLUGINDLLNAME	= $(TKNAMEPREFIX)$(VERSION)p$(DBG).dll
+ TKPLUGINDLL 	= $(OUTDIR)/$(TKPLUGINDLLNAME)
+ TKPLUGINLIB 	= $(OUTDIR)/lib$(TKNAMEPREFIX)$(VERSION)p$(DBGX).a
+ 
+ WISH 		= $(OUTDIR)/$(WISHNAMEPREFIX)$(VERSION)$(DBGX).exe
+ WISHC 		= $(OUTDIR)/$(WISHNAMEPREFIX)c$(VERSION)$(DBGX).exe
+ WISHP 		= $(OUTDIR)/$(WISHNAMEPREFIX)p$(VERSION)$(DBGX).exe
+ TKTEST 		= $(OUTDIR)/$(TKNAMEPREFIX)test.exe
+ CAT32           = $(TMPDIR)/cat32.exe
+ 
+ #RMDIR		= ./rmd.bat
+ #MKDIR		= ./mkd.bat
+ #RM		= del
+ #XCOPY		= xcopy
+ RMDIR		= rm -rf
+ MKDIR		= mkdir -p
+ RM		= rm -f
+ COPY		= cp
+ XCOPY		= cp -r
+ 
+ BIN_INSTALL_DIR = $(INSTALLDIR)/bin
+ INCLUDE_INSTALL_DIR = $(INSTALLDIR)/include
+ LIB_INSTALL_DIR = $(INSTALLDIR)/lib
+ SCRIPT_INSTALL_DIR = $(LIB_INSTALL_DIR)/tk$(DOTVERSION)
+ 
+ WISHOBJS = \
+ 	$(TMPDIR)/winMain.o
+ 
+ TKTESTOBJS = \
+ 	$(TMPDIR)/tkTest.o \
+ 	$(TMPDIR)/tkSquare.o \
+ 	$(TMPDIR)/testMain.o \
+ 	$(TCLLIBDIR)/tclThreadTest.o
+ 
+ XLIBOBJS = \
+ 	$(TMPDIR)/xcolors.o \
+ 	$(TMPDIR)/xdraw.o \
+ 	$(TMPDIR)/xgc.o \
+ 	$(TMPDIR)/ximage.o \
+ 	$(TMPDIR)/xutil.o
+ 
+ TKOBJS = \
+ 	$(TMPDIR)/tkConsole.o \
+ 	$(TMPDIR)/tkUnixMenubu.o \
+ 	$(TMPDIR)/tkUnixScale.o \
+ 	$(XLIBOBJS) \
+ 	$(TMPDIR)/tkWin3d.o \
+ 	$(TMPDIR)/tkWin32Dll.o \
+ 	$(TMPDIR)/tkWinButton.o \
+ 	$(TMPDIR)/tkWinClipboard.o \
+ 	$(TMPDIR)/tkWinColor.o \
+ 	$(TMPDIR)/tkWinConfig.o \
+ 	$(TMPDIR)/tkWinCursor.o \
+ 	$(TMPDIR)/tkWinDialog.o \
+ 	$(TMPDIR)/tkWinDraw.o \
+ 	$(TMPDIR)/tkWinEmbed.o \
+ 	$(TMPDIR)/tkWinFont.o \
+ 	$(TMPDIR)/tkWinImage.o \
+ 	$(TMPDIR)/tkWinInit.o \
+ 	$(TMPDIR)/tkWinKey.o \
+ 	$(TMPDIR)/tkWinMenu.o \
+ 	$(TMPDIR)/tkWinPixmap.o \
+ 	$(TMPDIR)/tkWinPointer.o \
+ 	$(TMPDIR)/tkWinRegion.o \
+ 	$(TMPDIR)/tkWinScrlbr.o \
+ 	$(TMPDIR)/tkWinSend.o \
+ 	$(TMPDIR)/tkWinTest.o \
+ 	$(TMPDIR)/tkWinWindow.o \
+ 	$(TMPDIR)/tkWinWm.o \
+ 	$(TMPDIR)/tkWinX.o \
+ 	$(TMPDIR)/stubs.o \
+ 	$(TMPDIR)/tk3d.o \
+ 	$(TMPDIR)/tkArgv.o \
+ 	$(TMPDIR)/tkAtom.o \
+ 	$(TMPDIR)/tkBind.o \
+ 	$(TMPDIR)/tkBitmap.o \
+ 	$(TMPDIR)/tkButton.o \
+ 	$(TMPDIR)/tkCanvArc.o \
+ 	$(TMPDIR)/tkCanvBmap.o \
+ 	$(TMPDIR)/tkCanvImg.o \
+ 	$(TMPDIR)/tkCanvLine.o \
+ 	$(TMPDIR)/tkCanvPoly.o \
+ 	$(TMPDIR)/tkCanvPs.o \
+ 	$(TMPDIR)/tkCanvText.o \
+ 	$(TMPDIR)/tkCanvUtil.o \
+ 	$(TMPDIR)/tkCanvWind.o \
+ 	$(TMPDIR)/tkCanvas.o \
+ 	$(TMPDIR)/tkClipboard.o \
+ 	$(TMPDIR)/tkCmds.o \
+ 	$(TMPDIR)/tkColor.o \
+ 	$(TMPDIR)/tkConfig.o \
+ 	$(TMPDIR)/tkCursor.o \
+ 	$(TMPDIR)/tkEntry.o \
+ 	$(TMPDIR)/tkError.o \
+ 	$(TMPDIR)/tkEvent.o \
+ 	$(TMPDIR)/tkFileFilter.o \
+ 	$(TMPDIR)/tkFocus.o \
+ 	$(TMPDIR)/tkFont.o \
+ 	$(TMPDIR)/tkFrame.o \
+ 	$(TMPDIR)/tkGC.o \
+ 	$(TMPDIR)/tkGeometry.o \
+ 	$(TMPDIR)/tkGet.o \
+ 	$(TMPDIR)/tkGrab.o \
+ 	$(TMPDIR)/tkGrid.o \
+ 	$(TMPDIR)/tkImage.o \
+ 	$(TMPDIR)/tkImgBmap.o \
+ 	$(TMPDIR)/tkImgGIF.o \
+ 	$(TMPDIR)/tkImgPPM.o \
+ 	$(TMPDIR)/tkImgPhoto.o \
+ 	$(TMPDIR)/tkImgUtil.o \
+ 	$(TMPDIR)/tkListbox.o \
+ 	$(TMPDIR)/tkMacWinMenu.o \
+ 	$(TMPDIR)/tkMain.o \
+ 	$(TMPDIR)/tkMenu.o \
+ 	$(TMPDIR)/tkMenubutton.o \
+ 	$(TMPDIR)/tkMenuDraw.o \
+ 	$(TMPDIR)/tkMessage.o \
+ 	$(TMPDIR)/tkObj.o \
+ 	$(TMPDIR)/tkOldConfig.o \
+ 	$(TMPDIR)/tkOption.o \
+ 	$(TMPDIR)/tkPack.o \
+ 	$(TMPDIR)/tkPlace.o \
+ 	$(TMPDIR)/tkPointer.o \
+ 	$(TMPDIR)/tkRectOval.o \
+ 	$(TMPDIR)/tkScale.o \
+ 	$(TMPDIR)/tkScrollbar.o \
+ 	$(TMPDIR)/tkSelect.o \
+ 	$(TMPDIR)/tkText.o \
+ 	$(TMPDIR)/tkTextBTree.o \
+ 	$(TMPDIR)/tkTextDisp.o \
+ 	$(TMPDIR)/tkTextImage.o \
+ 	$(TMPDIR)/tkTextIndex.o \
+ 	$(TMPDIR)/tkTextMark.o \
+ 	$(TMPDIR)/tkTextTag.o \
+ 	$(TMPDIR)/tkTextWind.o \
+ 	$(TMPDIR)/tkTrig.o \
+ 	$(TMPDIR)/tkUtil.o \
+ 	$(TMPDIR)/tkVisual.o \
+ 	$(TMPDIR)/tkStubInit.o \
+ 	$(TMPDIR)/tkStubLib.o \
+ 	$(TMPDIR)/tkWindow.o
+ 
+ TKSTUBOBJS = $(TMPDIR)/tkStubLib.o \
+ 	$(TMPDIR)/tkStubImg.o
+ 
+ 
+ #cc32		= "$(TOOLS32)/bin/cl.exe"
+ #link32		= "$(TOOLS32)/bin/link.exe"
+ #lib32		= "$(TOOLS32)/bin/lib.exe"
+ #rc32		= "$(TOOLS32_rc)/bin/rc.exe"
+ #include32	= -I"$(TOOLS32)/include"
+ 
+ # Say yes if you have gcc-2.95.2-1 and binutils-19990818-1 or later, which
+ # contains support for `gcc -shared' and `ld --shared'.
+ LD_SUPPORTS_SHARED = no
+ 
+ cc32		= $(CROSS)gcc
+ link32		= $(cc32)
+ rc32		= $(CROSS)windres
+ include32	= 
+ libpath32	= 
+ lib32		= $(CROSS)ar
+ # Needed if LD_SUPPORTS_SHARED is "no". GNU ld supports --shared on 
+ # x86-windows starting from binutils-19990818-1 release. 
+ dllwrap		= $(CROSS)dllwrap
+ 
+ # Needed for cross-compilation only.
+ ifneq "$(strip $(CROSS))" ""
+ rc32_flags	= --preprocessor "$(cc32) -c -E -xc-header -DRC_INVOKED"
+ dllwrap_flags	= --as=$(CROSS)as --dlltool-name=$(CROSS)dlltool \
+ 		  --driver-name=$(cc32)
+ endif
+ 
+ WINDIR          = $(ROOT)/win
+ GENERICDIR	= $(ROOT)/generic
+ XLIBDIR		= $(ROOT)/xlib
+ BITMAPDIR	= $(ROOT)/bitmaps
+ TCLLIBDIR       = $(TCLDIR)/win/$(OUTDIRNAME)
+ RCDIR		= $(WINDIR)/rc
+ 
+ TK_INCLUDES	= -I$(WINDIR) -I$(GENERICDIR) -I$(BITMAPDIR) -I$(XLIBDIR) \
+ 			-I$(TCLDIR)/generic
+ TK_DEFINES	= -D__WIN32__ $(DEBUGDEFINES) $(THREADDEFINES)
+ 
+ ######################################################################
+ # Compile flags
+ ######################################################################
+ 
+ #!IF "$(NODEBUG)" == "1"
+ #!IF "$(MACHINE)" == "ALPHA"
+ ## MSVC on Alpha doesn't understand -Ot
+ #cdebug	= -O2i -Gs -GD
+ #!ELSE
+ ## NOTE: Due to a bug in MSVC, we cannot use -O2 here or Tk starts to misbehave.
+ #cdebug	= -Oti -Gs -GD
+ #!ENDIF
+ #!ELSE
+ #!IF "$(MACHINE)" == "IA64"
+ #cdebug	= -Od -Zi
+ #!ELSE
+ #cdebug	= -Z7 -Od -WX
+ #!ENDIF
+ #!ENDIF
+ 
+ ifeq "$(NODEBUG)" "1"
+ # This cranks the optimization level to maximize speed
+ cdebug = -O2
+ else
+ ifeq "$(MACHINE)" "IA64"
+ cdebug = -g
+ else
+ cdebug = -g
+ endif
+ endif
+ 
+ # declarations common to all compiler options
+ #cflags	= -c -W3 -nologo -Fp$(TMPDIR)/ -YX
+ #cvarsdll = -MD$(DBGX)
+ cflags = -c -Wall
+ cvarsdll = 
+ 
+ CON_CFLAGS	= $(cdebug) $(cflags) $(include32) -DCONSOLE
+ TK_CFLAGS	= $(cdebug) $(cflags) $(cvarsdll) $(include32) \
+ 			$(TK_INCLUDES) $(TK_DEFINES) -DUSE_TCL_STUBS
+ WISH_CFLAGS	= $(cdebug) $(cflags) $(cvarsdll) $(include32) \
+ 			$(TK_INCLUDES) $(TK_DEFINES)
+ 
+ ######################################################################
+ # Link flags
+ ######################################################################
+ 
+ #!IF "$(NODEBUG)" == "1"
+ #ldebug	= /RELEASE
+ #!ELSE
+ #ldebug	= -debug:full -debugtype:cv
+ #!ENDIF
+ 
+ # declarations common to all linker options
+ #lcommon	= /NODEFAULTLIB /RELEASE /NOLOGO
+ #lflags	= $(lcommon) /MACHINE:$(MACHINE)
+ lcommon	= 
+ lflags	= $(lcommon)
+ 
+ # declarations for use on Intel i386, i486, and Pentium systems
+ #!IF "$(MACHINE)" == "IX86"
+ #DLLENTRY = @12
+ #!ENDIF
+ 
+ #conlflags	= $(lflags) -subsystem:console -entry:mainCRTStartup
+ #guilflags	= $(lflags) -subsystem:windows -entry:WinMainCRTStartup
+ #dlllflags	= $(lflags) -entry:_DllMainCRTStartup$(DLLENTRY) -dll
+ conlflags	= $(lflags) 
+ guilflags	= $(lflags) -mwindows
+ 
+ ifeq "$(strip $(LD_SUPPORTS_SHARED))" "yes"
+ dlllflags = $(lflags) -shared
+ else
+ dlllflags = $(lflags) 
+ endif
+ 
+ #!IF "$(MACHINE)" == "PPC"
+ #libc = libc$(DBGX).lib
+ #libcdll = crtdll$(DBGX).lib
+ #!ELSE
+ #libc = libc$(DBGX).lib oldnames.lib
+ #libcdll = msvcrt$(DBGX).lib oldnames.lib
+ #!ENDIF
+ 
+ #baselibs   = kernel32.lib $(optlibs) advapi32.lib
+ #winlibs    = $(baselibs) user32.lib gdi32.lib comdlg32.lib winspool.lib
+ 
+ baselibs   = 
+ winlibs    = -mwindows -lwinspool 
+ 
+ guilibs	   = $(libc) $(winlibs)
+ conlibs    = $(libc) $(baselibs)
+ guilibsdll = $(libcdll) $(winlibs)
+ 
+ ######################################################################
+ # Project specific targets
+ ######################################################################
+ 
+ all:    setup $(WISH) $(CAT32)
+ install: install-binaries install-libraries
+ plugin:	setup $(TKPLUGINDLL) $(WISHP)
+ tktest: setup $(TKTEST) $(CAT32)
+ test:	setup $(TKTEST) $(TKLIB) $(CAT32)
+ 	set TCL_LIBRARY=$(TCLDIR)/library
+ 	set PATH=$(TCLDIR)\\win\\$(TMPDIRNAME);$(PATH)
+ 	$(TKTEST) $(ROOT)/tests/all.tcl | $(CAT32)
+ 
+ runtest: setup $(TKTEST) $(TKLIB) $(CAT32)
+ 	set TCL_LIBRARY=$(TCLDIR)/library
+ 	set PATH=$(TCLDIR)\\win\\$(TMPDIRNAME);$(PATH)
+ 	$(TKTEST) 
+ 
+ console-wish : all $(WISHC)
+ 
+ stubs:
+ 	$(TCLDIR)/win/$(TMPDIRNAME)/tclsh$(VERSION)$(DBGX) \
+ 		$(TCLDIR)/tools/genStubs.tcl $(GENERICDIR) \
+ 		$(GENERICDIR)/tk.decls $(GENERICDIR)/tkInt.decls
+ 
+ setup:
+ 	@$(MKDIR) $(TMPDIR)
+ 	@$(MKDIR) $(OUTDIR)
+ 
+ install-binaries:
+ 	@$(MKDIR) "$(BIN_INSTALL_DIR)"
+ 	$(COPY) $(TKDLL) "$(BIN_INSTALL_DIR)"
+ 	$(COPY) $(WISH) "$(BIN_INSTALL_DIR)"
+ 	@$(MKDIR) "$(LIB_INSTALL_DIR)"
+ 	$(COPY) $(TKLIB) "$(LIB_INSTALL_DIR)"
+ 
+ install-libraries:
+ 	@$(MKDIR) "$(INCLUDE_INSTALL_DIR)"
+ 	@$(MKDIR) "$(INCLUDE_INSTALL_DIR)/X11"
+ 	$(COPY) "$(ROOT)/generic/tk.h"             "$(INCLUDE_INSTALL_DIR)"
+ 	$(COPY) "$(ROOT)/generic/tkDecls.h"        "$(INCLUDE_INSTALL_DIR)"
+ 	$(COPY) "$(ROOT)/generic/tkIntXlibDecls.h" "$(INCLUDE_INSTALL_DIR)"
+ ifeq "$(findstring xcopy, $(XCOPY))" ""
+ 	-$(MKDIR) "$(INCLUDE_INSTALL_DIR)/X11"
+ 	$(COPY) "$(ROOT)"/xlib/X11/*.h            "$(INCLUDE_INSTALL_DIR)/X11"
+ else
+ 	$(XCOPY) "$(ROOT)"/xlib/X11/*.h            "$(INCLUDE_INSTALL_DIR)/X11"
+ endif
+ 	@$(MKDIR) "$(SCRIPT_INSTALL_DIR)"
+ 	@$(MKDIR) "$(SCRIPT_INSTALL_DIR)/images"
+ 	@$(MKDIR) "$(SCRIPT_INSTALL_DIR)/demos"
+ 	@$(MKDIR) "$(SCRIPT_INSTALL_DIR)/demos/images"
+ ifneq "$(findstring xcopy, $(XCOPY))" ""
+ 	$(XCOPY) "$(ROOT)/library"              "$(SCRIPT_INSTALL_DIR)"
+ else
+ 	$(COPY) "$(ROOT)"/library/*.tcl         "$(SCRIPT_INSTALL_DIR)"
+ 	$(COPY) "$(ROOT)"/library/tclIndex      "$(SCRIPT_INSTALL_DIR)"
+ 	$(COPY) "$(GENERICDIR)"/prolog.ps       "$(SCRIPT_INSTALL_DIR)"
+ 	$(COPY) "$(ROOT)"/unix/tkAppInit.c      "$(SCRIPT_INSTALL_DIR)"
+ 	$(XCOPY) "$(ROOT)/library/images"       "$(SCRIPT_INSTALL_DIR)"
+ 	$(XCOPY) "$(ROOT)/library/demos"        "$(SCRIPT_INSTALL_DIR)"
+ endif
+ 
+ $(TKLIB): $(TKDLL) $(TKSTUBLIB)
+ 
+ #$(TKSTUBLIB): $(TKSTUBOBJS)
+ #        $(lib32) /out:$@ $(TKSTUBOBJS)
+ 
+ $(TKSTUBLIB): $(TKSTUBOBJS)
+ 	$(lib32) crv $@ $(TKSTUBOBJS)
+ 
+ #$(TKDLL): $(TKOBJS) $(TMPDIR)/tk.res
+ #	set LIB=$(TOOLS32)/lib
+ #       $(link32) $(ldebug) $(dlllflags) \
+ #		-out:$@ $(TMPDIR)/tk.res $(TCLLIBDIR)/$(TCLSTUBLIB) \
+ #		$(guilibsdll) @<<
+ #			$(TKOBJS)
+ #<<
+ 
+ ifeq "$(strip $(LD_SUPPORTS_SHARED))" "yes"
+ $(TKDLL): $(TKOBJS) $(TMPDIR)/tk.res.o
+ 	$(link32) $(ldebug) $(dlllflags) \
+ 		-o $@ $(TMPDIR)/tk.res.o \
+ 		-Wl,--out-implib,$(TKLIB) \
+ 		-Wl,--output-def,tk83.def \
+ 		$(TKOBJS) \
+ 		$(TCLLIBDIR)/$(TCLSTUBLIB) \
+ 		$(guilibsdll)
+ else
+ $(TKDLL): $(TKOBJS) $(TMPDIR)/tk.res.o
+ 	$(dllwrap) $(dllwrap_flags) $(ldebug) $(dlllflags) \
+ 		-o $@ $(TMPDIR)/tk.res.o \
+ 		--output-lib $(TKLIB) \
+ 		--output-def tk83.def \
+ 		$(TKOBJS) \
+ 		$(TCLLIBDIR)/$(TCLSTUBLIB) \
+ 		$(guilibsdll)
+ endif
+ 
+ $(TKPLUGINLIB): $(TKPLUGINDLL)
+ 
+ #$(TKPLUGINDLL): $(TKOBJS) $(TMPDIR)/tk.res
+ #	set LIB=$(TOOLS32)/lib
+ #        $(link32) $(ldebug) $(dlllflags) \
+ #		-out:$@ $(TMPDIR)/tk.res $(TCLLIBDIR)/$(TCLPLUGINLIB) \
+ #		$(guilibsdll) @<<
+ #			$(TKOBJS)
+ #<<
+ 
+ $(WISH): $(WISHOBJS) $(TKLIB) $(TMPDIR)/wish.res.o
+ 	$(link32) $(ldebug) $(guilflags) $(TMPDIR)/wish.res.o -o $@ \
+ 		$(WISHOBJS) $(TCLLIBDIR)/$(TCLLIB) $(TKLIB) $(guilibsdll) 
+ 
+ $(WISHC): $(WISHOBJS) $(TKLIB) $(TMPDIR)/wish.res.o
+ 	$(link32) $(ldebug) $(conlflags) $(TMPDIR)/wish.res.o -o $@ \
+ 		$(WISHOBJS) $(TCLLIBDIR)/$(TCLLIB) $(TKLIB) $(guilibsdll) 
+ 
+ $(WISHP): $(WISHOBJS) $(TKPLUGINLIB) $(TMPDIR)/wish.res.o
+ 	$(link32) $(ldebug) $(guilflags) $(TMPDIR)/wish.res.o -o $@ \
+ 		$(guilibsdll) $(TCLLIBDIR)/$(TCLPLUGINLIB) \
+ 		$(TKPLUGINLIB) $(WISHOBJS) 
+ 
+ $(TKTEST): $(TKTESTOBJS) $(TKLIB) $(TMPDIR)/wish.res.o
+ 	$(link32) $(ldebug) $(guilflags) $(TMPDIR)/wish.res.o -o $@ \
+ 		$(guilibsdll) $(TCLLIBDIR)/$(TCLLIB) $(TKLIB) $(TKTESTOBJS)
+ 
+ $(CAT32): $(TCLDIR)/win/cat.c
+ 	$(cc32) $(CON_CFLAGS) -o $(TMPDIR)/cat.o $?
+ 	$(link32) $(conlflags) -o $@ -Wl,--stack,0x16384 \
+ 		$(TMPDIR)/cat.o $(conlibs)
+ 
+ #
+ # Regenerate the stubs files.
+ #
+ 
+ genstubs:
+ 	tclsh$(VERSION) $(TCLDIR)/tools/genStubs.tcl $(GENERICDIR) \
+ 		$(GENERICDIR)/tk.decls $(GENERICDIR)/tkInt.decls
+ 
+ #
+ # Special case object file targets
+ #
+ 
+ $(TMPDIR)/testMain.o: $(ROOT)/win/winMain.c
+ 	$(cc32) $(WISH_CFLAGS) -DTK_TEST -o $@ $?
+ 
+ $(TMPDIR)/tkTest.o: $(ROOT)/generic/tkTest.c
+ 	$(cc32) $(WISH_CFLAGS) -o $@ $?
+ 
+ $(TMPDIR)/tkSquare.o: $(ROOT)/generic/tkSquare.c
+ 	$(cc32) $(WISH_CFLAGS) -o $@ $?
+ 
+ $(TMPDIR)/winMain.o: $(ROOT)/win/winMain.c
+ 	$(cc32) $(WISH_CFLAGS) -o $@ $?
+ 
+ $(TMPDIR)/tkStubLib.o : $(GENERICDIR)/tkStubLib.c
+ 	$(cc32) $(TK_CFLAGS) -DSTATIC_BUILD -o $@ $?
+ 
+ #
+ # Implicit rules
+ #
+ 
+ #{$(XLIBDIR)}.c{$(TMPDIR)}.o:
+ #	$(cc32) -DDLL_BUILD -DBUILD_tk $(TK_CFLAGS) -Fo$(TMPDIR)/ $<
+ #
+ #{$(GENERICDIR)}.c{$(TMPDIR)}.o:
+ #	$(cc32) -DDLL_BUILD -DBUILD_tk $(TK_CFLAGS) -Fo$(TMPDIR)/ $<
+ #
+ #{$(WINDIR)}.c{$(TMPDIR)}.o:
+ #	$(cc32) -DDLL_BUILD -DBUILD_tk $(TK_CFLAGS) -Fo$(TMPDIR)/ $<
+ #
+ #{$(ROOT)/unix}.c{$(TMPDIR)}.o:
+ #	$(cc32) -DDLL_BUILD -DBUILD_tk $(TK_CFLAGS) -Fo$(TMPDIR)/ $<
+ #
+ #{$(RCDIR)}.rc{$(TMPDIR)}.res:
+ #	$(rc32) -fo $@ -r -i "$(GENERICDIR)" -i "$(TOOLS32)/include" \
+ #		-i "$(TCLDIR)/generic" $<
+ 
+ %.o : %.c
+ 	$(cc32) -DDLL_BUILD -DBUILD_tk $(TK_CFLAGS) -o $@ $<
+ 
+ %.res.o : %.rc
+ 	$(rc32) $(rc32_flags) -o $@ --include "$(GENERICDIR)" \
+ 		--include $(RCDIR) \
+ 		--include "$(TCLDIR)/generic" $<
+ 
+ clean:
+ 	-@$(RM) $(OUTDIR)/*.exp 
+ 	-@$(RM) $(OUTDIR)/*.lib 
+ 	-@$(RM) $(OUTDIR)/*.dll 
+ 	-@$(RM) $(OUTDIR)/*.exe
+ 	-@$(RM) $(OUTDIR)/*.pdb
+ 	-@$(RM) $(TMPDIR)/*.pch
+ 	-@$(RM) $(TMPDIR)/*.o
+ 	-@$(RM) $(TMPDIR)/*.res.o
+ 	-@$(RM) $(TMPDIR)/*.exe
+ 
+ # dependencies
+ 
+ $(TMPDIR)/tk.res.o: \
+     $(RCDIR)/buttons.bmp \
+     $(RCDIR)/cursor*.cur \
+     $(RCDIR)/tk.ico
+ 
+ $(GENERICDIR)/default.h: $(WINDIR)/tkWinDefault.h
+ $(GENERICDIR)/tkButton.c: $(GENERICDIR)/default.h
+ $(GENERICDIR)/tkCanvas.c: $(GENERICDIR)/default.h
+ $(GENERICDIR)/tkEntry.c: $(GENERICDIR)/default.h
+ $(GENERICDIR)/tkFrame.c: $(GENERICDIR)/default.h
+ $(GENERICDIR)/tkListbox.c: $(GENERICDIR)/default.h
+ $(GENERICDIR)/tkMenu.c: $(GENERICDIR)/default.h
+ $(GENERICDIR)/tkMenubutton.c: $(GENERICDIR)/default.h
+ $(GENERICDIR)/tkMessage.c: $(GENERICDIR)/default.h
+ $(GENERICDIR)/tkScale.c: $(GENERICDIR)/default.h
+ $(GENERICDIR)/tkScrollbar.c: $(GENERICDIR)/default.h
+ $(GENERICDIR)/tkText.c: $(GENERICDIR)/default.h
+ $(GENERICDIR)/tkTextIndex.c: $(GENERICDIR)/default.h
+ $(GENERICDIR)/tkTextTag.c: $(GENERICDIR)/default.h
+ 
+ $(GENERICDIR)/tkText.c: $(GENERICDIR)/tkText.h
+ $(GENERICDIR)/tkTextBTree.c: $(GENERICDIR)/tkText.h
+ $(GENERICDIR)/tkTextDisp.c: $(GENERICDIR)/tkText.h
+ $(GENERICDIR)/tkTextDisp.c: $(GENERICDIR)/tkText.h
+ $(GENERICDIR)/tkTextImage.c: $(GENERICDIR)/tkText.h
+ $(GENERICDIR)/tkTextIndex.c: $(GENERICDIR)/tkText.h
+ $(GENERICDIR)/tkTextMark.c: $(GENERICDIR)/tkText.h
+ $(GENERICDIR)/tkTextTag.c: $(GENERICDIR)/tkText.h
+ $(GENERICDIR)/tkTextWind.c: $(GENERICDIR)/tkText.h
+ 
+ $(GENERICDIR)/tkMacWinMenu.c: $(GENERICDIR)/tkMenu.h
+ $(GENERICDIR)/tkMenu.c: $(GENERICDIR)/tkMenu.h
+ $(GENERICDIR)/tkMenuDraw.c: $(GENERICDIR)/tkMenu.h
+ $(WINDIR)/tkWinMenu.c: $(GENERICDIR)/tkMenu.h
+ 
*** win/aclocal.m4.orig	Thu Feb 10 12:11:05 2000
--- win/aclocal.m4	Wed Feb 16 23:08:48 2000
***************
*** 346,366 ****
      # set various compiler flags depending on whether we are using gcc or cl
      
      if test "${GCC}" = "yes" ; then
! 	CFLAGS_DEBUG=-g
! 	CFLAGS_OPTIMIZE=-O
! 	CFLAGS_WARNING="-Wall -Wconversion"
! 	LDFLAGS_DEBUG=-g
! 	LDFLAGS_OPTIMIZE=-O
! 	PATHTYPE=-u
  	
  	# Specify the CC output file names based on the target name
! 	CC_OBJNAME="-o \[$]@"
! 	CC_EXENAME="-o \[$]@"
      else
  	SHLIB_LD="link -dll -nologo"
  	SHLIB_LD_LIBS="user32.lib advapi32.lib"
  	LIBS="user32.lib advapi32.lib"
  	AR="lib -nologo"
  	RC="rc"
  	MAKE_LIB="\${AR} -out:\[$]@"
  	MAKE_EXE="\${CC} -Fe\[$]@"
--- 346,401 ----
      # set various compiler flags depending on whether we are using gcc or cl
      
      if test "${GCC}" = "yes" ; then
! 	SHLIB_LD="dllwrap"
! 	SHLIB_LD_LIBS="-luser32 -ladvapi32"
! 	LIBS="user32.lib advapi32.lib"
! 	AR="ar cf"
! 	RC="winres"
! 	MAKE_LIB="\${AR} \[$]@"
! 	MAKE_EXE="\${CC} -Fe\[$]@"
! 	
! 	if test "${SHARED_BUILD}" = "0" ; then
! 	    # static
!             AC_MSG_RESULT([using static flags])
! 	    runtime=-MT
! 	    MAKE_DLL="echo "
! 	    LIBSUFFIX="s\${DBGX}.a"
! 	    LIBRARIES="\${STATIC_LIBRARIES}"
! 	    EXESUFFIX="s\${DBGX}.exe"
! 	    DLLSUFFIX=""
! 	else
! 	    # dynamic
!             AC_MSG_RESULT([using shared flags])
! 	    runtime=-MD
! 	    MAKE_DLL="\${SHLIB_LD} \${SHLIB_LD_LIBS} \$(LDFLAGS) -out:\[$]@"
! 	    LIBSUFFIX="\${DBGX}.a"
! 	    DLLSUFFIX="\${DBGX}.dll"
! 	    EXESUFFIX="\${DBGX}.exe"
! 	    LIBRARIES="\${SHARED_LIBRARIES}"
! 	fi
! 
! 	EXTRA_CFLAGS="-YX"
! 	CFLAGS_DEBUG="-nologo -Z7 -Od -WX ${runtime}d"
! 	CFLAGS_OPTIMIZE="-nologo -O2 -Gs -GD ${runtime}"
! 	CFLAGS_WARNING="-W3"
! 	LDFLAGS_DEBUG="-debug:full -debugtype:cv"
! 	LDFLAGS_OPTIMIZE="-release"
! 	PATHTYPE=-w
  	
  	# Specify the CC output file names based on the target name
! 	CC_OBJNAME="-Fo\[$]@"
! 	CC_EXENAME="-Fe\"\$(shell cygpath \$(PATHTYPE) '\[$]@')\""
! 
! 	# Specify linker flags depending on the type of app being 
! 	# built -- Console vs. Window.
! 	LDFLAGS_CONSOLE="-subsystem:console"
! 	LDFLAGS_WINDOW="-subsystem:windows"
      else
  	SHLIB_LD="link -dll -nologo"
  	SHLIB_LD_LIBS="user32.lib advapi32.lib"
  	LIBS="user32.lib advapi32.lib"
  	AR="lib -nologo"
+ 	STLIB_LD="lib -nologo"
  	RC="rc"
  	MAKE_LIB="\${AR} -out:\[$]@"
  	MAKE_EXE="\${CC} -Fe\[$]@"
*** win/configure.orig	Thu Feb 10 12:11:05 2000
--- win/configure	Wed Feb 16 23:08:48 2000
***************
*** 1022,1042 ****
      # set various compiler flags depending on whether we are using gcc or cl
      
      if test "${GCC}" = "yes" ; then
! 	CFLAGS_DEBUG=-g
! 	CFLAGS_OPTIMIZE=-O
! 	CFLAGS_WARNING="-Wall -Wconversion"
! 	LDFLAGS_DEBUG=-g
! 	LDFLAGS_OPTIMIZE=-O
! 	PATHTYPE=-u
  	
  	# Specify the CC output file names based on the target name
! 	CC_OBJNAME="-o \$@"
! 	CC_EXENAME="-o \$@"
      else
  	SHLIB_LD="link -dll -nologo"
  	SHLIB_LD_LIBS="user32.lib advapi32.lib"
  	LIBS="user32.lib advapi32.lib"
  	AR="lib -nologo"
  	RC="rc"
  	MAKE_LIB="\${AR} -out:\$@"
  	MAKE_EXE="\${CC} -Fe\$@"
--- 1022,1077 ----
      # set various compiler flags depending on whether we are using gcc or cl
      
      if test "${GCC}" = "yes" ; then
! 	SHLIB_LD="dllwrap"
! 	SHLIB_LD_LIBS="-luser32 -ladvapi32"
! 	LIBS="user32.lib advapi32.lib"
! 	AR="ar cf"
! 	RC="winres"
! 	MAKE_LIB="\${AR} \$@"
! 	MAKE_EXE="\${CC} -Fe\$@"
! 	
! 	if test "${SHARED_BUILD}" = "0" ; then
! 	    # static
!             echo "$ac_t""using static flags" 1>&6
! 	    runtime=-MT
! 	    MAKE_DLL="echo "
! 	    LIBSUFFIX="s\${DBGX}.a"
! 	    LIBRARIES="\${STATIC_LIBRARIES}"
! 	    EXESUFFIX="s\${DBGX}.exe"
! 	    DLLSUFFIX=""
! 	else
! 	    # dynamic
!             echo "$ac_t""using shared flags" 1>&6
! 	    runtime=-MD
! 	    MAKE_DLL="\${SHLIB_LD} \${SHLIB_LD_LIBS} \$(LDFLAGS) -out:\$@"
! 	    LIBSUFFIX="\${DBGX}.a"
! 	    DLLSUFFIX="\${DBGX}.dll"
! 	    EXESUFFIX="\${DBGX}.exe"
! 	    LIBRARIES="\${SHARED_LIBRARIES}"
! 	fi
! 
! 	EXTRA_CFLAGS="-YX"
! 	CFLAGS_DEBUG="-nologo -Z7 -Od -WX ${runtime}d"
! 	CFLAGS_OPTIMIZE="-nologo -O2 -Gs -GD ${runtime}"
! 	CFLAGS_WARNING="-W3"
! 	LDFLAGS_DEBUG="-debug:full -debugtype:cv"
! 	LDFLAGS_OPTIMIZE="-release"
! 	PATHTYPE=-w
  	
  	# Specify the CC output file names based on the target name
! 	CC_OBJNAME="-Fo\$@"
! 	CC_EXENAME="-Fe\"\$(shell cygpath \$(PATHTYPE) '\$@')\""
! 
! 	# Specify linker flags depending on the type of app being 
! 	# built -- Console vs. Window.
! 	LDFLAGS_CONSOLE="-subsystem:console"
! 	LDFLAGS_WINDOW="-subsystem:windows"
      else
  	SHLIB_LD="link -dll -nologo"
  	SHLIB_LD_LIBS="user32.lib advapi32.lib"
  	LIBS="user32.lib advapi32.lib"
  	AR="lib -nologo"
+ 	STLIB_LD="lib -nologo"
  	RC="rc"
  	MAKE_LIB="\${AR} -out:\$@"
  	MAKE_EXE="\${CC} -Fe\$@"
***************
*** 1086,1092 ****
  #--------------------------------------------------------------------
  
  echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
! echo "configure:1090: checking how to run the C preprocessor" >&5
  # On Suns, sometimes $CPP names a directory.
  if test -n "$CPP" && test -d "$CPP"; then
    CPP=
--- 1121,1127 ----
  #--------------------------------------------------------------------
  
  echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
! echo "configure:1125: checking how to run the C preprocessor" >&5
  # On Suns, sometimes $CPP names a directory.
  if test -n "$CPP" && test -d "$CPP"; then
    CPP=
***************
*** 1101,1113 ****
    # On the NeXT, cc -E runs the code through the compiler's parser,
    # not just through cpp.
    cat > conftest.$ac_ext <<EOF
! #line 1105 "configure"
  #include "confdefs.h"
  #include <assert.h>
  Syntax Error
  EOF
  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:1111: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  if test -z "$ac_err"; then
    :
--- 1136,1148 ----
    # On the NeXT, cc -E runs the code through the compiler's parser,
    # not just through cpp.
    cat > conftest.$ac_ext <<EOF
! #line 1140 "configure"
  #include "confdefs.h"
  #include <assert.h>
  Syntax Error
  EOF
  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:1146: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  if test -z "$ac_err"; then
    :
***************
*** 1118,1130 ****
    rm -rf conftest*
    CPP="${CC-cc} -E -traditional-cpp"
    cat > conftest.$ac_ext <<EOF
! #line 1122 "configure"
  #include "confdefs.h"
  #include <assert.h>
  Syntax Error
  EOF
  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:1128: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  if test -z "$ac_err"; then
    :
--- 1153,1165 ----
    rm -rf conftest*
    CPP="${CC-cc} -E -traditional-cpp"
    cat > conftest.$ac_ext <<EOF
! #line 1157 "configure"
  #include "confdefs.h"
  #include <assert.h>
  Syntax Error
  EOF
  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:1163: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  if test -z "$ac_err"; then
    :
***************
*** 1135,1147 ****
    rm -rf conftest*
    CPP="${CC-cc} -nologo -E"
    cat > conftest.$ac_ext <<EOF
! #line 1139 "configure"
  #include "confdefs.h"
  #include <assert.h>
  Syntax Error
  EOF
  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:1145: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  if test -z "$ac_err"; then
    :
--- 1170,1182 ----
    rm -rf conftest*
    CPP="${CC-cc} -nologo -E"
    cat > conftest.$ac_ext <<EOF
! #line 1174 "configure"
  #include "confdefs.h"
  #include <assert.h>
  Syntax Error
  EOF
  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:1180: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  if test -z "$ac_err"; then
    :
***************
*** 1167,1183 ****
  
  ac_safe=`echo "errno.h" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for errno.h""... $ac_c" 1>&6
! echo "configure:1171: checking for errno.h" >&5
  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 1176 "configure"
  #include "confdefs.h"
  #include <errno.h>
  EOF
  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:1181: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  if test -z "$ac_err"; then
    rm -rf conftest*
--- 1202,1218 ----
  
  ac_safe=`echo "errno.h" | sed 'y%./+-%__p_%'`
  echo $ac_n "checking for errno.h""... $ac_c" 1>&6
! echo "configure:1206: checking for errno.h" >&5
  if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
  else
    cat > conftest.$ac_ext <<EOF
! #line 1211 "configure"
  #include "confdefs.h"
  #include <errno.h>
  EOF
  ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
! { (eval echo configure:1216: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  if test -z "$ac_err"; then
    rm -rf conftest*
***************
*** 1209,1215 ****
  
  
      echo $ac_n "checking for build with symbols""... $ac_c" 1>&6
! echo "configure:1213: checking for build with symbols" >&5
      # Check whether --enable-symbols or --disable-symbols was given.
  if test "${enable_symbols+set}" = set; then
    enableval="$enable_symbols"
--- 1244,1250 ----
  
  
      echo $ac_n "checking for build with symbols""... $ac_c" 1>&6
! echo "configure:1248: checking for build with symbols" >&5
      # Check whether --enable-symbols or --disable-symbols was given.
  if test "${enable_symbols+set}" = set; then
    enableval="$enable_symbols"
***************
*** 1242,1248 ****
  
  
      echo $ac_n "checking the location of tclConfig.sh""... $ac_c" 1>&6
! echo "configure:1246: checking the location of tclConfig.sh" >&5
  
      if test -d ../../tcl8.3$TK_PATCH_LEVEL/win;  then
  	TCL_BIN_DIR_DEFAULT=../../tcl8.3$TK_PATCH_LEVEL/win
--- 1277,1283 ----
  
  
      echo $ac_n "checking the location of tclConfig.sh""... $ac_c" 1>&6
! echo "configure:1281: checking the location of tclConfig.sh" >&5
  
      if test -d ../../tcl8.3$TK_PATCH_LEVEL/win;  then
  	TCL_BIN_DIR_DEFAULT=../../tcl8.3$TK_PATCH_LEVEL/win
***************
*** 1268,1274 ****
  
  
      echo $ac_n "checking for existence of $TCL_BIN_DIR/tclConfig.sh""... $ac_c" 1>&6
! echo "configure:1272: checking for existence of $TCL_BIN_DIR/tclConfig.sh" >&5
  
      if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then
          echo "$ac_t""loading" 1>&6
--- 1303,1309 ----
  
  
      echo $ac_n "checking for existence of $TCL_BIN_DIR/tclConfig.sh""... $ac_c" 1>&6
! echo "configure:1307: checking for existence of $TCL_BIN_DIR/tclConfig.sh" >&5
  
      if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then
          echo "$ac_t""loading" 1>&6
***************
*** 1290,1296 ****
  
  
      echo $ac_n "checking for tclsh""... $ac_c" 1>&6
! echo "configure:1294: checking for tclsh" >&5
  
      if eval "test \"`echo '$''{'ac_cv_path_tclsh'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
--- 1325,1331 ----
  
  
      echo $ac_n "checking for tclsh""... $ac_c" 1>&6
! echo "configure:1329: checking for tclsh" >&5
  
      if eval "test \"`echo '$''{'ac_cv_path_tclsh'+set}'`\" = set"; then
    echo $ac_n "(cached) $ac_c" 1>&6
*** win/makefile.vc.orig	Thu Feb 10 03:54:23 2000
--- win/makefile.vc	Thu Feb 17 11:52:12 2000
***************
*** 1,4 ****
! # Visual C++ 2.x and 4.0 makefile
  #
  # See the file "license.terms" for information on usage and redistribution
  # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
--- 1,4 ----
! # Visual C++ 2.x, 4.x, 5.0 and 6.0 makefile
  #
  # See the file "license.terms" for information on usage and redistribution
  # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
***************
*** 24,33 ****
  #
  # TCLDIR = location of top of Tcl source heirarchy
  #
  
  ROOT		= ..
! TCLDIR		= ..\..\tcl8.3
! INSTALLDIR      = c:\progra~1\tcl
  
  # Set this to the appropriate value of /MACHINE: for your platform
  MACHINE	= IX86
--- 24,36 ----
  #
  # TCLDIR = location of top of Tcl source heirarchy
  #
+ # INSTALLDIR = where the install- targets should copy the binaries and
+ #           support files
+ #
  
  ROOT		= ..
! TCLDIR		= ..\..\tcl8.3.0
! INSTALLDIR      = c:\Progra~1\tcl
  
  # Set this to the appropriate value of /MACHINE: for your platform
  MACHINE	= IX86
***************
*** 36,51 ****
  TOOLS32		= c:\ia64sdk17
  TOOLS32_rc	= c:\ia64sdk17
  !ELSE
! TOOLS32		= c:\Progra~1\devstudio\vc
  TOOLS32_rc	= c:\Progra~1\devstudio\sharedide
  !ENDIF
  
  # Uncomment the following line to compile with thread support
! #THREADDEFINES = -DTCL_THREADS=1
  
  # Set NODEBUG to 0 to compile with symbols
  NODEBUG = 1
  
  # uncomment the following two lines to compile with TCL_MEM_DEBUG
  #DEBUGDEFINES	=-DTCL_MEM_DEBUG
  
--- 39,62 ----
  TOOLS32		= c:\ia64sdk17
  TOOLS32_rc	= c:\ia64sdk17
  !ELSE
! #TOOLS32 	= c:\msdev                                            # VC++ 2.x,4.x
! #TOOLS32_rc	= c:\msdev
! TOOLS32		= c:\Progra~1\devstudio\vc                            # VC++ 5.x
  TOOLS32_rc	= c:\Progra~1\devstudio\sharedide
+ #TOOLS32 	= c:\Progra~1\microsoft visual studio\vc98            # VC++ 6.x
+ #TOOLS32_rc	= c:\Progra~1\microsoft visual studio\common\msdev98
  !ENDIF
+ GNUTOOLS	= c:\gcc-2.95.2\bin
  
  # Uncomment the following line to compile with thread support
! THREADDEFINES = -DTCL_THREADS=1
  
  # Set NODEBUG to 0 to compile with symbols
  NODEBUG = 1
  
+ # Set NOSTATIC to 0 to compile as static libraries
+ NOSTATIC = 1
+ 
  # uncomment the following two lines to compile with TCL_MEM_DEBUG
  #DEBUGDEFINES	=-DTCL_MEM_DEBUG
  
***************
*** 64,75 ****
  
  
  BINROOT		= .
  !IF "$(NODEBUG)" == "1"
! TMPDIRNAME	= Release
! DBGX		=
  !ELSE
! TMPDIRNAME	= Debug
! DBGX		= d
  !ENDIF
  TMPDIR		= $(BINROOT)\$(TMPDIRNAME)
  OUTDIRNAME	= $(TMPDIRNAME)
--- 75,91 ----
  
  
  BINROOT		= .
+ !IF "$(NOSTATIC)" == "1"
+ S		=
+ !ELSE
+ S		= s
+ !ENDIF
  !IF "$(NODEBUG)" == "1"
! TMPDIRNAME	= Release$(S)
! DBGX		= $(S)
  !ELSE
! TMPDIRNAME	= Debug$(S)
! DBGX		= $(S)d
  !ENDIF
  TMPDIR		= $(BINROOT)\$(TMPDIRNAME)
  OUTDIRNAME	= $(TMPDIRNAME)
***************
*** 80,86 ****
--- 96,111 ----
  TCLSTUBLIB	= $(TCLSTUBPREFIX)$(VERSION)$(DBGX).lib
  TKDLLNAME	= $(TKNAMEPREFIX)$(VERSION)$(DBGX).dll
  TKDLL 		= $(OUTDIR)\$(TKDLLNAME)
+ TKARCHIVENAME  = lib$(NAMEPREFIX)$(VERSION)$(DBGX).a
+ TKARCHIVE      = $(OUTDIR)\$(TKARCHIVENAME)
  TKLIB 		= $(OUTDIR)\$(TKNAMEPREFIX)$(VERSION)$(DBGX).lib
+ TKLIBS 		= $(OUTDIR)\$(TKNAMEPREFIX)$(VERSION)s$(DBGX).lib
+ TESTDLLNAME	= $(TKNAMEPREFIX)test.dll
+ TESTDLL 	= $(OUTDIR)\$(TESTDLLNAME)
+ TKPTESTDLLNAME	= $(TKNAMEPREFIX)ptest.dll
+ TKPTESTDLL 	= $(OUTDIR)\$(TKPTESTDLLNAME)
+ SQUAREDLLNAME	= $(TKNAMEPREFIX)square.dll
+ SQUAREDLL	= $(OUTDIR)\$(SQUAREDLLNAME)
  TKSTUBLIBNAME	= $(TKSTUBPREFIX)$(VERSION)$(DBGX).lib
  TKSTUBLIB	= $(OUTDIR)\$(TKSTUBLIBNAME)
  TKPLUGINDLLNAME	= $(TKNAMEPREFIX)$(VERSION)p$(DBG).dll
***************
*** 97,106 ****
--- 122,136 ----
  INCLUDE_INSTALL_DIR = $(INSTALLDIR)\include
  LIB_INSTALL_DIR = $(INSTALLDIR)\lib
  SCRIPT_INSTALL_DIR = $(LIB_INSTALL_DIR)\tk$(DOTVERSION)
+ X11_INCLUDE_INSTALL_DIR = $(INCLUDE_INSTALL_DIR)\X11
+ DEMOPROGS = browse hello ixset rmt rolodex square tcolor timer widget
  
  WISHOBJS = \
  	$(TMPDIR)\winMain.obj
  
+ WISHSAOBJS = \
+ 	$(TMPDIR)\winMainSA.obj
+ 
  TKTESTOBJS = \
  	$(TMPDIR)\tkTest.obj \
  	$(TMPDIR)\tkSquare.obj \
***************
*** 116,126 ****
  
  TKOBJS = \
  	$(TMPDIR)\tkConsole.obj \
  	$(TMPDIR)\tkUnixMenubu.obj \
  	$(TMPDIR)\tkUnixScale.obj \
  	$(XLIBOBJS) \
  	$(TMPDIR)\tkWin3d.obj \
- 	$(TMPDIR)\tkWin32Dll.obj \
  	$(TMPDIR)\tkWinButton.obj \
  	$(TMPDIR)\tkWinClipboard.obj \
  	$(TMPDIR)\tkWinColor.obj \
--- 146,156 ----
  
  TKOBJS = \
  	$(TMPDIR)\tkConsole.obj \
+ 	$(TMPDIR)\tkMain.obj \
  	$(TMPDIR)\tkUnixMenubu.obj \
  	$(TMPDIR)\tkUnixScale.obj \
  	$(XLIBOBJS) \
  	$(TMPDIR)\tkWin3d.obj \
  	$(TMPDIR)\tkWinButton.obj \
  	$(TMPDIR)\tkWinClipboard.obj \
  	$(TMPDIR)\tkWinColor.obj \
***************
*** 185,191 ****
  	$(TMPDIR)\tkImgUtil.obj \
  	$(TMPDIR)\tkListbox.obj \
  	$(TMPDIR)\tkMacWinMenu.obj \
- 	$(TMPDIR)\tkMain.obj \
  	$(TMPDIR)\tkMenu.obj \
  	$(TMPDIR)\tkMenubutton.obj \
  	$(TMPDIR)\tkMenuDraw.obj \
--- 215,220 ----
***************
*** 215,220 ****
--- 244,260 ----
  	$(TMPDIR)\tkStubLib.obj \
  	$(TMPDIR)\tkWindow.obj
  
+ TKDLLOBJS = \
+ 	$(TKOBJS) \
+ 	$(TMPDIR)\tkWin32Dll.obj
+ 
+ TKTESTOBJS = \
+ 	$(TMPDIR)\tkTest.obj \
+ 	$(TMPDIR)\tkWinTest.obj
+ 
+ TKSQUAREOBJS = \
+ 	$(TMPDIR)\tkSquare.obj
+ 
  TKSTUBOBJS = $(TMPDIR)\tkStubLib.obj \
  	$(TMPDIR)\tkStubImg.obj
  
***************
*** 227,237 ****
--- 267,284 ----
  
  WINDIR          = $(ROOT)\win
  GENERICDIR	= $(ROOT)\generic
+ LIBDIR		= $(ROOT)\library
  XLIBDIR		= $(ROOT)\xlib
  BITMAPDIR	= $(ROOT)\bitmaps
  TCLLIBDIR       = $(TCLDIR)\win\$(OUTDIRNAME)
  RCDIR		= $(WINDIR)\rc
  
+ !IF "$(NOSTATIC)" == "1"
+ cstatic = -DUSE_TCL_STUBS
+ !ELSE
+ cstatic =
+ !ENDIF
+ 
  TK_INCLUDES	= -I$(WINDIR) -I$(GENERICDIR) -I$(BITMAPDIR) -I$(XLIBDIR) \
  			-I$(TCLDIR)\generic
  TK_DEFINES	= -D__WIN32__ $(DEBUGDEFINES) $(THREADDEFINES)
***************
*** 241,253 ****
  ######################################################################
  
  !IF "$(NODEBUG)" == "1"
! !IF "$(MACHINE)" == "ALPHA"
! # MSVC on Alpha doesn't understand -Ot
! cdebug	= -O2i -Gs -GD
! !ELSE
! # NOTE: Due to a bug in MSVC, we cannot use -O2 here or Tk starts to misbehave.
! cdebug	= -Oti -Gs -GD
! !ENDIF
  !ELSE
  !IF "$(MACHINE)" == "IA64"
  cdebug	= -Od -Zi
--- 288,294 ----
  ######################################################################
  
  !IF "$(NODEBUG)" == "1"
! cdebug = -Ox -Oy- -GD
  !ELSE
  !IF "$(MACHINE)" == "IA64"
  cdebug	= -Od -Zi
***************
*** 262,268 ****
  
  CON_CFLAGS	= $(cdebug) $(cflags) $(include32) -DCONSOLE
  TK_CFLAGS	= $(cdebug) $(cflags) $(cvarsdll) $(include32) \
! 			$(TK_INCLUDES) $(TK_DEFINES) -DUSE_TCL_STUBS
  WISH_CFLAGS	= $(cdebug) $(cflags) $(cvarsdll) $(include32) \
  			$(TK_INCLUDES) $(TK_DEFINES)
  
--- 303,309 ----
  
  CON_CFLAGS	= $(cdebug) $(cflags) $(include32) -DCONSOLE
  TK_CFLAGS	= $(cdebug) $(cflags) $(cvarsdll) $(include32) \
! 			$(TK_INCLUDES) $(TK_DEFINES) $(cstatic)
  WISH_CFLAGS	= $(cdebug) $(cflags) $(cvarsdll) $(include32) \
  			$(TK_INCLUDES) $(TK_DEFINES)
  
***************
*** 307,313 ****
  # Project specific targets
  ######################################################################
  
! all:    setup $(WISH) $(CAT32)
  install: install-binaries install-libraries
  plugin:	setup $(TKPLUGINDLL) $(WISHP)
  tktest: setup $(TKTEST) $(CAT32)
--- 348,354 ----
  # Project specific targets
  ######################################################################
  
! all:    setup $(WISH) $(TKLIBS) $(CAT32)
  install: install-binaries install-libraries
  plugin:	setup $(TKPLUGINDLL) $(WISHP)
  tktest: setup $(TKTEST) $(CAT32)
***************
*** 332,343 ****
--- 373,396 ----
  	@mkd $(TMPDIR)
  	@mkd $(OUTDIR)
  
+ $(TKARCHIVE): $(TMPDIR)/tk.def
+ 	set PATH=$(GNUTOOLS)
+ 	if exist $(GNUTOOLS)\dlltool.exe dlltool --as=as --dllname $(TCLDLLNAME) \
+ 	  --def $(TMPDIR)/tk.def --output-lib $(OUTDIR)/$(TKARCHIVENAME)
+ 
+ $(TMPDIR)/tcl.def: $(TCLLIB)
+ 	set PATH=$(GNUTOOLS)
+     if exist $(GNUTOOLS)\echo.exe $(GNUTOOLS)\echo "EXPORTS" >$(TMPDIR)tk.def
+ 	if exist $(GNUTOOLS)\sed.exe $(GNUTOOLS)\nm $(TKLIB) |grep " T _" | sed -e "s/00000000 T _//" >> $(TMPDIR)\tk.def
+ 
  install-binaries:
  	@mkd "$(BIN_INSTALL_DIR)"
  	copy $(TKDLL) "$(BIN_INSTALL_DIR)"
  	copy $(WISH) "$(BIN_INSTALL_DIR)"
+ 	-copy $(WISHSA) "$(BIN_INSTALL_DIR)"
  	@mkd "$(LIB_INSTALL_DIR)"
  	copy $(TKLIB) "$(LIB_INSTALL_DIR)"
+ 	copy $(TKLIBS) "$(LIB_INSTALL_DIR)"
  
  install-libraries:
  	@mkd "$(INCLUDE_INSTALL_DIR)"
***************
*** 360,371 ****
  $(TKSTUBLIB): $(TKSTUBOBJS)
          $(lib32) /out:$@ $(TKSTUBOBJS)
  
! $(TKDLL): $(TKOBJS) $(TMPDIR)\tk.res
  	set LIB=$(TOOLS32)\lib
!        $(link32) $(ldebug) $(dlllflags) \
  		-out:$@ $(TMPDIR)\tk.res $(TCLLIBDIR)\$(TCLSTUBLIB) \
  		$(guilibsdll) @<<
! 			$(TKOBJS)
  <<
  
  $(TKPLUGINLIB): $(TKPLUGINDLL)
--- 413,447 ----
  $(TKSTUBLIB): $(TKSTUBOBJS)
          $(lib32) /out:$@ $(TKSTUBOBJS)
  
! $(TKDLL): $(TKDLLOBJS) $(TMPDIR)\tk.res
  	set LIB=$(TOOLS32)\lib
! 	$(link32) $(ldebug) $(dlllflags) \
  		-out:$@ $(TMPDIR)\tk.res $(TCLLIBDIR)\$(TCLSTUBLIB) \
  		$(guilibsdll) @<<
! 			$(TKDLLOBJS)
! <<
! 
! $(TESTDLL): $(TKTESTOBJS) $(TKLIB) $(TCLLIBDIR)\$(TCLLIB)
! 	set LIB=$(TOOLS32)\lib
! 	$(link32) $(ldebug) $(dlllflags) \
! 		-out:$@ $(TKLIB) $(TCLLIBDIR)\$(TCLLIB) \
! 		$(guilibsdll) @<<
! 			$(TKTESTOBJS)
! <<
! 
! $(SQUAREDLL): $(TKSQUAREOBJS) $(TKSTUBLIB) $(TCLLIBDIR)\$(TCLSTUBLIB)
! 	set LIB=$(TOOLS32)\lib
! 	$(link32) $(ldebug) $(dlllflags) \
! 		-out:$@ $(TKSTUBLIB) $(TCLLIBDIR)\$(TCLSTUBLIB) \
! 		$(guilibsdll) @<<
! 			$(TKSQUAREOBJS)
! <<
! 
! 
! $(TKLIBS): $(TKOBJS)
!       @del $(TKLIBS)
!         $(lib32) -out:$(TKLIBS) @<<
!                $(TKOBJS)
  <<
  
  $(TKPLUGINLIB): $(TKPLUGINDLL)
***************
*** 416,429 ****
  # Special case object file targets
  #
  
- $(TMPDIR)\testMain.obj: $(ROOT)\win\winMain.c
- 	$(cc32) $(WISH_CFLAGS) -DTK_TEST -Fo$@ $?
- 
  $(TMPDIR)\tkTest.obj: $(ROOT)\generic\tkTest.c
! 	$(cc32) $(WISH_CFLAGS) -Fo$@ $?
  
  $(TMPDIR)\tkSquare.obj: $(ROOT)\generic\tkSquare.c
! 	$(cc32) $(WISH_CFLAGS) -Fo$@ $?
  
  $(TMPDIR)\winMain.obj: $(ROOT)\win\winMain.c
  	$(cc32) $(WISH_CFLAGS) -Fo$@ $?
--- 492,505 ----
  # Special case object file targets
  #
  
  $(TMPDIR)\tkTest.obj: $(ROOT)\generic\tkTest.c
! 	$(cc32) $(TK_CFLAGS) -DUSE_TK_STUBS -Fo$@ $?
! 
! $(TMPDIR)\tkWinTest.obj: $(ROOT)\win\tkWinTest.c
! 	$(cc32) $(TK_CFLAGS) -DUSE_TK_STUBS -Fo$@ $?
  
  $(TMPDIR)\tkSquare.obj: $(ROOT)\generic\tkSquare.c
! 	$(cc32) $(TK_CFLAGS) -DUSE_TK_STUBS -Fo$@ $?
  
  $(TMPDIR)\winMain.obj: $(ROOT)\win\winMain.c
  	$(cc32) $(WISH_CFLAGS) -Fo$@ $?
***************
*** 436,451 ****
  #
  
  {$(XLIBDIR)}.c{$(TMPDIR)}.obj:
! 	$(cc32) -DDLL_BUILD -DBUILD_tk $(TK_CFLAGS) -Fo$(TMPDIR)\ $<
  
  {$(GENERICDIR)}.c{$(TMPDIR)}.obj:
! 	$(cc32) -DDLL_BUILD -DBUILD_tk $(TK_CFLAGS) -Fo$(TMPDIR)\ $<
  
  {$(WINDIR)}.c{$(TMPDIR)}.obj:
! 	$(cc32) -DDLL_BUILD -DBUILD_tk $(TK_CFLAGS) -Fo$(TMPDIR)\ $<
  
  {$(ROOT)\unix}.c{$(TMPDIR)}.obj:
! 	$(cc32) -DDLL_BUILD -DBUILD_tk $(TK_CFLAGS) -Fo$(TMPDIR)\ $<
  
  {$(RCDIR)}.rc{$(TMPDIR)}.res:
  	$(rc32) -fo $@ -r -i "$(GENERICDIR)" -i "$(TOOLS32)\include" \
--- 512,527 ----
  #
  
  {$(XLIBDIR)}.c{$(TMPDIR)}.obj:
! 	$(cc32) $(TK_CFLAGS) -DBUILD_tk -Fo$(TMPDIR)\ $<
  
  {$(GENERICDIR)}.c{$(TMPDIR)}.obj:
! 	$(cc32) $(TK_CFLAGS) -DBUILD_tk -Fo$(TMPDIR)\ $<
  
  {$(WINDIR)}.c{$(TMPDIR)}.obj:
! 	$(cc32) $(TK_CFLAGS) -DBUILD_tk -Fo$(TMPDIR)\ $<
  
  {$(ROOT)\unix}.c{$(TMPDIR)}.obj:
! 	$(cc32) $(TK_CFLAGS) -DBUILD_tk -Fo$(TMPDIR)\ $<
  
  {$(RCDIR)}.rc{$(TMPDIR)}.res:
  	$(rc32) -fo $@ -r -i "$(GENERICDIR)" -i "$(TOOLS32)\include" \
*** win/pkgIndex.tk.orig	Wed Feb 16 23:08:48 2000
--- win/pkgIndex.tk	Thu Feb 17 20:59:04 2000
***************
*** 0 ****
--- 1,5 ----
+ # Tcl package index file, version 1.0
+ 
+ if {[package vcompare [info tclversion] 8.3] < 0} return
+ 
+ package ifneeded Tk 8.3 [list load tk83.dll Tk]
*** win/pkgIndex.win.orig	Wed Feb 16 23:08:48 2000
--- win/pkgIndex.win	Thu Feb 17 20:57:46 2000
***************
*** 0 ****
--- 1,7 ----
+ # Tcl package index file, version 1.0
+ 
+ package ifneeded Tk 8.3 [list load [file join $dir tk83.dll] Tk]
+ package ifneeded Tksquare 8.3 [list tclPkgSetup $dir Tksquare 8.3\
+     {{Tksquare.dll load square}}]
+ package ifneeded Tktest 8.3 [list tclPkgSetup $dir Tktest 8.3\
+     {{Tktest.dll load {testclipboard testcbind testdeleteapps testembed testmakeexist testmenubar testmetrics testprop testsend}}}]
*** win/tcl83plus.wse.orig	Wed Feb 16 23:08:48 2000
--- win/tcl83plus.wse	Wed Feb 16 15:36:36 2000
***************
*** 0 ****
--- 1,1089 ----
+ Document Type: WSE
+ item: Global
+   Version=6.0
+   Flags=00010100
+   Languages=65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+   Japanese Font Name=MS Gothic
+   Japanese Font Size=10
+   Progress Bar DLL=%_WISE_%\Progress\WIZ%_EXE_OS_TYPE_%.DLL
+   Start Gradient=0 0 255
+   End Gradient=0 0 0
+   Windows Flags=00000100000000010010110000011000
+   Log Pathname=%MAINDIR%\INSTALL.LOG
+   Message Font=MS Sans Serif
+   Font Size=8
+   Disk Filename=SETUP
+   Patch Flags=0000000000000001
+   Patch Threshold=85
+   Patch Memory=4000
+   FTP Cluster Size=20
+   Per-User Version ID=1
+   Dialogs Version=6
+   Variable Name1=_SYS_
+   Variable Default1=C:\WINNT\System32
+   Variable Flags1=00001000
+   Variable Name2=_WISE_
+   Variable Default2=C:\Program Files\Wise
+   Variable Flags2=00001000
+   Variable Name3=_ODBC16_
+   Variable Default3=C:\WINNT\System32
+   Variable Flags3=00001000
+   Variable Name4=_ODBC32_
+   Variable Default4=C:\PROGRA~1\Wise\Runtime\ODBC30
+   Variable Flags4=00001000
+ end
+ item: Open/Close INSTALL.LOG
+   Flags=00000001
+ end
+ item: Check if File/Dir Exists
+   Pathname=%SYS32%
+   Flags=10000100
+ end
+ item: Set Variable
+   Variable=SYS32
+   Value=%WIN%
+ end
+ item: End Block
+ end
+ item: Set Variable
+   Variable=APPTITLE
+   Value=Tcl/Tk 8.3.0 for Windows
+   Flags=10000000
+ end
+ item: Set Variable
+   Variable=GROUP
+   Value=Tcl
+   Flags=10000000
+ end
+ item: Set Variable
+   Variable=DISABLED
+   Value=!
+ end
+ item: Set Variable
+   Variable=MAINDIR
+   Value=Tcl
+   Flags=10000000
+ end
+ item: Check Configuration
+   Flags=10111011
+ end
+ item: Get Registry Key Value
+   Variable=COMMON
+   Key=SOFTWARE\Microsoft\Windows\CurrentVersion
+   Default=C:\Program Files\Common Files
+   Value Name=CommonFilesDir
+   Flags=00000100
+ end
+ item: Get Registry Key Value
+   Variable=PROGRAM_FILES
+   Key=SOFTWARE\Microsoft\Windows\CurrentVersion
+   Default=C:\Program Files
+   Value Name=ProgramFilesDir
+   Flags=00000100
+ end
+ item: Set Variable
+   Variable=MAINDIR
+   Value=%PROGRAM_FILES%\%MAINDIR%
+   Flags=00001100
+ end
+ item: Set Variable
+   Variable=EXPLORER
+   Value=1
+ end
+ item: Else Statement
+ end
+ item: Set Variable
+   Variable=MAINDIR
+   Value=C:\%MAINDIR%
+   Flags=00001100
+ end
+ item: End Block
+ end
+ item: Set Variable
+   Variable=BACKUP
+   Value=%MAINDIR%\BACKUP
+   Flags=10000000
+ end
+ item: Set Variable
+   Variable=DOBACKUP
+   Value=B
+   Flags=10000000
+ end
+ item: Set Variable
+   Variable=COMPONENTS
+   Value=AC
+   Flags=10000000
+ end
+ item: Set Variable
+   Variable=BRANDING
+   Value=0
+ end
+ item: If/While Statement
+   Variable=BRANDING
+   Value=1
+ end
+ item: Read INI Value
+   Variable=NAME
+   Pathname=%INST%\CUSTDATA.INI
+   Section=Registration
+   Item=Name
+ end
+ item: Read INI Value
+   Variable=COMPANY
+   Pathname=%INST%\CUSTDATA.INI
+   Section=Registration
+   Item=Company
+ end
+ item: If/While Statement
+   Variable=NAME
+ end
+ item: Set Variable
+   Variable=DOBRAND
+   Value=1
+ end
+ item: End Block
+ end
+ item: End Block
+ end
+ item: Display Graphic
+   Pathname=..\..\..\Tclplus.bmp
+   X Position=16384
+   Y Position=16384
+   Flags=0000000000000010
+ end
+ item: Wizard Block
+   Direction Variable=DIRECTION
+   Display Variable=DISPLAY
+   Bitmap Pathname=%_WISE_%\DIALOGS\TEMPLATE\WIZARD.BMP
+   X Position=9
+   Y Position=10
+   Filler Color=8421440
+   Dialog=Select Program Manager Group
+   Dialog=Select Backup Directory
+   Dialog=Display Registration Information
+   Dialog=Get Registration Information
+   Variable=EXPLORER
+   Variable=DOBACKUP
+   Variable=DOBRAND
+   Variable=DOBRAND
+   Value=1
+   Value=A
+   Value=1
+   Value=1
+   Compare=0
+   Compare=1
+   Compare=0
+   Compare=1
+   Flags=00000011
+ end
+ item: Custom Dialog Set
+   Name=Welcome
+   Display Variable=DISPLAY
+   item: Dialog
+     Title=Welcome
+     Width=280
+     Height=224
+     Font Name=Helv
+     Font Size=8
+     item: Push Button
+       Rectangle=172 185 214 199
+       Variable=DIRECTION
+       Value=N
+       Create Flags=01010000000000010000000000000001
+       Text=&Next >
+     end
+     item: Push Button
+       Rectangle=222 185 264 199
+       Action=3
+       Create Flags=01010000000000010000000000000000
+       Text=Cancel
+     end
+     item: Static
+       Rectangle=9 177 263 178
+       Action=3
+       Create Flags=01010000000000000000000000000111
+     end
+     item: Static
+       Rectangle=83 8 121 33
+       Action=2
+       Enabled Color=00000000000000001111111111111111
+       Create Flags=01010000000000000000000000001011
+       Pathname=%_WISE_%\dialogs\template\install.grf
+     end
+     item: Static
+       Rectangle=121 10 258 44
+       Enabled Color=00000000000000001111111111111111
+       Create Flags=01010000000000000000000000000000
+       Text=Welcome to %APPTITLE% Setup program. This program will install %APPTITLE% (with plus-, dash-, Img-, and elide- patch) on your computer.
+     end
+     item: Static
+       Rectangle=90 45 260 175
+       Enabled Color=00000000000000001111111111111111
+       Create Flags=01010000000000000000000000000000
+       Text=It is strongly recommended that you exit all Windows programs before running this Setup Program.
+       Text=
+       Text=Click Cancel to quit Setup and close any programs you have running.  Click Next to continue with the Setup program.
+       Text=
+       Text=This software is provided 'as-is', without any express or implied warranty.  In no event will the author(s) be held liable for any damages arising from the use of this software.
+       Text=
+       Text=Permission is granted to anyone to use this software for any purpose, including commercial applications, and redistribute it freely.
+     end
+   end
+ end
+ item: Custom Dialog Set
+   Name=Select Destination Directory
+   Display Variable=DISPLAY
+   item: Dialog
+     Title=Choose Destination Location
+     Width=280
+     Height=224
+     Font Name=Helv
+     Font Size=8
+     item: Push Button
+       Rectangle=172 185 214 199
+       Variable=DIRECTION
+       Value=N
+       Create Flags=01010000000000010000000000000001
+       Text=&Next >
+     end
+     item: Push Button
+       Rectangle=130 185 172 199
+       Variable=DIRECTION
+       Value=B
+       Create Flags=01010000000000010000000000000000
+       Flags=0000000000000001
+       Text=< &Back
+     end
+     item: Push Button
+       Rectangle=222 185 264 199
+       Action=3
+       Create Flags=01010000000000010000000000000000
+       Text=Cancel
+     end
+     item: Static
+       Rectangle=9 177 263 178
+       Action=3
+       Create Flags=01010000000000000000000000000111
+     end
+     item: Static
+       Rectangle=90 10 260 122
+       Create Flags=01010000000000000000000000000000
+       Text=Setup will install %APPTITLE% in the following folder.
+       Text=
+       Text=To install into a different folder, click Browse, and select another folder. 
+       Text=
+       Text=You can choose not to install %APPTITLE% by clicking Cancel to exit Setup.
+     end
+     item: Static
+       Rectangle=90 134 260 162
+       Action=1
+       Create Flags=01010000000000000000000000000111
+       Text=Destination Folder
+     end
+     item: Push Button
+       Rectangle=213 143 255 157
+       Variable=MAINDIR_SAVE
+       Value=%MAINDIR%
+       Destination Dialog=1
+       Action=2
+       Create Flags=01010000000000010000000000000000
+       Text=B&rowse...
+     end
+     item: Static
+       Rectangle=95 146 211 157
+       Destination Dialog=2
+       Create Flags=01010000000000000000000000000000
+       Text=%MAINDIR%
+     end
+   end
+   item: Dialog
+     Title=Select Destination Directory
+     Width=221
+     Height=173
+     Font Name=Helv
+     Font Size=8
+     item: Listbox
+       Rectangle=5 2 160 149
+       Variable=MAINDIR
+       Create Flags=01010000100000010000000101000000
+       Flags=0000110000100010
+       Text=%MAINDIR%
+     end
+     item: Push Button
+       Rectangle=167 6 212 21
+       Create Flags=01010000000000010000000000000001
+       Text=OK
+     end
+     item: Push Button
+       Rectangle=167 25 212 40
+       Variable=MAINDIR
+       Value=%MAINDIR_SAVE%
+       Create Flags=01010000000000010000000000000000
+       Flags=0000000000000001
+       Text=Cancel
+     end
+   end
+ end
+ item: Custom Dialog Set
+   Name=Select Components
+   Display Variable=DISPLAY
+   Flags=00000001
+   item: Dialog
+     Title=Select Components 
+     Width=280
+     Height=224
+     Font Name=Helv
+     Font Size=8
+     item: Push Button
+       Rectangle=172 185 214 199
+       Variable=DIRECTION
+       Value=N
+       Create Flags=01010000000000010000000000000001
+       Text=&Next >
+     end
+     item: Push Button
+       Rectangle=130 185 172 199
+       Variable=DIRECTION
+       Value=B
+       Create Flags=01010000000000010000000000000000
+       Text=< &Back
+     end
+     item: Push Button
+       Rectangle=222 185 264 199
+       Action=3
+       Create Flags=01010000000000010000000000000000
+       Text=Cancel
+     end
+     item: Static
+       Rectangle=9 177 263 178
+       Action=3
+       Create Flags=01010000000000000000000000000111
+     end
+     item: Static
+       Rectangle=205 156 253 166
+       Variable=COMPONENTS
+       Value=MAINDIR
+       Create Flags=01010000000000000000000000000010
+     end
+     item: Static
+       Rectangle=205 148 253 157
+       Variable=COMPONENTS
+       Create Flags=01010000000000000000000000000010
+     end
+     item: Static
+       Rectangle=95 147 184 158
+       Create Flags=01010000000000000000000000000000
+       Text=Disk Space Required:
+     end
+     item: Static
+       Rectangle=95 157 190 167
+       Create Flags=01010000000000000000000000000000
+       Text=Disk Space Remaining:
+     end
+     item: Static
+       Rectangle=90 138 264 168
+       Action=1
+       Create Flags=01010000000000000000000000000111
+     end
+     item: Static
+       Rectangle=90 8 260 41
+       Create Flags=01010000000000000000000000000000
+       Text=In the options list below, select the checkboxes for the options that you would like to have installed.  The disk space fields reflect the requirements of the options you have selected.
+     end
+     item: Listbox
+       Rectangle=90 42 263 133
+       Variable=COMPONENTS
+       Create Flags=01010000101000010000000101010001
+       Flags=0000010001000111
+       Text=Windows Help
+       Text=Demos
+       Text=Development headers & stub libraries
+       Text=Development libraries (VC++ 5.0, no stubs)
+       Text=Development libraries (gcc-2.95, no stubs)
+       Text=
+       Text French=Windows Help
+       Text French=Demos
+       Text French=Development headers & stub libraries
+       Text French=Development libraries (VC++ 5.0, no stubs)
+       Text French=Static libraries (VC++ 5.0, no stubs)
+       Text French=
+       Text German=Windows Help
+       Text German=Demos
+       Text German=Development headers & stub libraries
+       Text German=Development libraries (VC++ 5.0, no stubs)
+       Text German=Static libraries (VC++ 5.0, no stubs)
+       Text German=
+       Text Spanish=Windows Help
+       Text Spanish=Demos
+       Text Spanish=Development headers & stub libraries
+       Text Spanish=Development libraries (VC++ 5.0, no stubs)
+       Text Spanish=Static libraries (VC++ 5.0, no stubs)
+       Text Spanish=
+       Text Italian=Windows Help
+       Text Italian=Demos
+       Text Italian=Development headers & stub libraries
+       Text Italian=Development libraries (VC++ 5.0, no stubs)
+       Text Italian=Static libraries (VC++ 5.0, no stubs)
+       Text Italian=
+     end
+   end
+ end
+ item: Custom Dialog Set
+   Name=Select Program Manager Group
+   Display Variable=DISPLAY
+   item: Dialog
+     Title=Select Program Manager Group
+     Width=280
+     Height=224
+     Font Name=Helv
+     Font Size=8
+     item: Push Button
+       Rectangle=172 185 214 199
+       Variable=DIRECTION
+       Value=N
+       Create Flags=01010000000000010000000000000001
+       Text=&Next >
+     end
+     item: Push Button
+       Rectangle=130 185 172 199
+       Variable=DIRECTION
+       Value=B
+       Create Flags=01010000000000010000000000000000
+       Flags=0000000000000001
+       Text=< &Back
+     end
+     item: Push Button
+       Rectangle=222 185 264 199
+       Action=3
+       Create Flags=01010000000000010000000000000000
+       Text=Cancel
+     end
+     item: Static
+       Rectangle=9 177 263 178
+       Action=3
+       Create Flags=01010000000000000000000000000111
+     end
+     item: Static
+       Rectangle=90 10 260 38
+       Create Flags=01010000000000000000000000000000
+       Text=Enter the name of the Program Manager group to add %APPTITLE% icons to:
+     end
+     item: Combobox
+       Rectangle=90 42 260 148
+       Variable=GROUP
+       Create Flags=01010000001000010000001100000001
+       Flags=0000000000000001
+       Text=%GROUP%
+       Text=
+     end
+   end
+ end
+ item: Custom Dialog Set
+   Name=Start Installation
+   Display Variable=DISPLAY
+   item: Dialog
+     Title=Start Installation
+     Width=280
+     Height=224
+     Font Name=Helv
+     Font Size=8
+     item: Push Button
+       Rectangle=172 185 214 199
+       Variable=DIRECTION
+       Value=N
+       Create Flags=01010000000000010000000000000001
+       Text=&Next >
+     end
+     item: Push Button
+       Rectangle=130 185 172 199
+       Variable=DIRECTION
+       Value=B
+       Create Flags=01010000000000010000000000000000
+       Text=< &Back
+     end
+     item: Push Button
+       Rectangle=222 185 264 199
+       Action=3
+       Create Flags=01010000000000010000000000000000
+       Text=Cancel
+     end
+     item: Static
+       Rectangle=9 177 263 178
+       Action=3
+       Create Flags=01010000000000000000000000000111
+     end
+     item: Static
+       Rectangle=90 10 260 70
+       Create Flags=01010000000000000000000000000000
+       Text=You are now ready to install %APPTITLE%.
+       Text=
+       Text=Press the Next button to begin the installation or the Back button to reenter the installation information.
+     end
+   end
+ end
+ item: If/While Statement
+   Variable=DISPLAY
+   Value=Select Destination Directory
+ end
+ item: Set Variable
+   Variable=BACKUP
+   Value=%MAINDIR%\BACKUP
+ end
+ item: End Block
+ end
+ item: End Block
+ end
+ item: If/While Statement
+   Variable=DOBACKUP
+   Value=A
+ end
+ item: Set Variable
+   Variable=BACKUPDIR
+   Value=%BACKUP%
+ end
+ item: End Block
+ end
+ item: If/While Statement
+   Variable=BRANDING
+   Value=1
+ end
+ item: If/While Statement
+   Variable=DOBRAND
+   Value=1
+ end
+ item: Edit INI File
+   Pathname=%INST%\CUSTDATA.INI
+   Settings=[Registration]
+   Settings=NAME=%NAME%
+   Settings=COMPANY=%COMPANY%
+   Settings=
+ end
+ item: End Block
+ end
+ item: End Block
+ end
+ item: Open/Close INSTALL.LOG
+ end
+ item: Include Script
+   Pathname=C:\Program Files\Wise\INCLUDE\Uninstal.WSE
+ end
+ item: Check Disk Space
+   Component=COMPONENTS
+ end
+ item: Install File
+   Source=c:\Winnt\system32\Msvcrt.dll
+   Destination=%SYS32%\MSVCRT.DLL
+   Flags=0000001010000011
+ end
+ item: If/While Statement
+   Variable=COMPONENTS
+   Value=A
+   Flags=00001010
+ end
+ item: Install File
+   Source=..\..\tcl8.3.0\doc\Tcl83.hlp
+   Destination=%MAINDIR%\doc\tcl83.hlp
+   Flags=0000000010000010
+ end
+ item: Install File
+   Source=..\..\tcl8.3.0\doc\Tcl83.cnt
+   Destination=%MAINDIR%\doc\tcl83.cnt
+   Flags=0000000010000010
+ end
+ item: End Block
+ end
+ item: If/While Statement
+   Variable=COMPONENTS
+   Value=B
+   Flags=00001010
+ end
+ item: Install File
+   Source=..\library\demos\*.tcl
+   Destination=%MAINDIR%\lib\tk8.3\demos
+   Flags=0000000010000010
+ end
+ item: Install File
+   Source=..\library\demos\browse
+   Destination=%MAINDIR%\lib\tk8.3\demos\browse.tcl
+   Flags=0000000010000010
+ end
+ item: Install File
+   Source=..\library\demos\hello
+   Destination=%MAINDIR%\lib\tk8.3\demos\hello.tcl
+   Flags=0000000010000010
+ end
+ item: Install File
+   Source=..\library\demos\images\*
+   Destination=%MAINDIR%\lib\tk8.3\demos\images
+   Flags=0000000010000010
+ end
+ item: Install File
+   Source=..\library\demos\ixset
+   Destination=%MAINDIR%\lib\tk8.3\demos\ixset.tcl
+   Flags=0000000010000010
+ end
+ item: Install File
+   Source=..\library\demos\license.terms
+   Destination=%MAINDIR%\lib\tk8.3\demos\license.terms
+   Flags=0000000010000010
+ end
+ item: Install File
+   Source=..\library\demos\Readme
+   Destination=%MAINDIR%\lib\tk8.3\demos\Readme
+   Flags=0000000010000010
+ end
+ item: Install File
+   Source=..\library\demos\rmt
+   Destination=%MAINDIR%\lib\tk8.3\demos\rmt.tcl
+   Flags=0000000010000010
+ end
+ item: Install File
+   Source=..\library\demos\rolodex
+   Destination=%MAINDIR%\lib\tk8.3\demos\rolodex.tcl
+   Flags=0000000010000010
+ end
+ item: Install File
+   Source=..\library\demos\square
+   Destination=%MAINDIR%\lib\tk8.3\demos\square.tcl
+   Flags=0000000010000010
+ end
+ item: Install File
+   Source=..\library\demos\tclIndex
+   Destination=%MAINDIR%\lib\tk8.3\demos\tclIndex
+   Flags=0000000010000010
+ end
+ item: Install File
+   Source=..\library\demos\tcolor
+   Destination=%MAINDIR%\lib\tk8.3\demos\tcolor.tcl
+   Flags=0000000010000010
+ end
+ item: Install File
+   Source=..\library\demos\timer
+   Destination=%MAINDIR%\lib\tk8.3\demos\timer.tcl
+   Flags=0000000010000010
+ end
+ item: Install File
+   Source=..\library\demos\widget
+   Destination=%MAINDIR%\lib\tk8.3\demos\widget.tcl
+   Flags=0000000010000010
+ end
+ item: End Block
+ end
+ item: If/While Statement
+   Variable=COMPONENTS
+   Value=C
+   Flags=00001010
+ end
+ item: Install File
+   Source=..\generic\tk.h
+   Destination=%MAINDIR%\include\tk.h
+   Flags=0000000010000010
+ end
+ item: Install File
+   Source=..\..\tcl8.3.0\generic\tcl.h
+   Destination=%MAINDIR%\include\tcl.h
+   Flags=0000000010000010
+ end
+ item: Install File
+   Source=..\..\tcl8.3.0\win\Release\tclstub83.lib
+   Destination=%MAINDIR%\lib\tclstub83.lib
+   Flags=0000000010000010
+ end
+ item: Install File
+   Source=..\win\Release\tkstub83.lib
+   Destination=%MAINDIR%\lib\tkstub83.lib
+   Flags=0000000010000010
+ end
+ item: Install File
+   Source=..\..\tcl8.3.0\win\libtclstub83.a
+   Destination=%MAINDIR%\lib\libtclstub83.a
+   Flags=0000000010000010
+ end
+ item: Install File
+   Source=libtkstub83.a
+   Destination=%MAINDIR%\lib\libtkstub83.a
+   Flags=0000000010000010
+ end
+ item: End Block
+ end
+ item: If/While Statement
+   Variable=COMPONENTS
+   Value=D
+   Flags=00001010
+ end
+ item: Install File
+   Source=..\..\tcl8.3.0\win\Release\tcl83.lib
+   Destination=%MAINDIR%\lib\tcl83.lib
+   Flags=0000000010000010
+ end
+ item: Install File
+   Source=..\win\Release\tk83.lib
+   Destination=%MAINDIR%\lib\tk83.lib
+   Flags=0000000010000010
+ end
+ item: End Block
+ end
+ item: If/While Statement
+   Variable=COMPONENTS
+   Value=E
+   Flags=00001010
+ end
+ item: Install File
+   Source=..\..\tcl8.3.0\win\libtcl83.a
+   Destination=%MAINDIR%\lib\libtcl83.a
+   Flags=0000000010000010
+ end
+ item: Install File
+   Source=..\win\libtk83.a
+   Destination=%MAINDIR%\lib\libtk83.a
+   Flags=0000000010000010
+ end
+ item: End Block
+ end
+ item: Install File
+   Source=..\win\Release\tk83.dll
+   Destination=%MAINDIR%\bin\TK83.DLL
+   Flags=0000000010000010
+ end
+ remarked item: Install File
+   Source=..\..\tcl8.3.0\win\Release\Tcl1683.dll
+   Destination=%MAINDIR%\bin\TCL1683.DLL
+   Flags=0000000010000010
+ end
+ item: Install File
+   Source=..\win\Release\wish83.exe
+   Destination=%MAINDIR%\bin\wish83.exe
+   Flags=0000000010000010
+ end
+ item: Install File
+   Source=..\..\tcl8.3.0\win\Release\tclsh83.exe
+   Destination=%MAINDIR%\bin\tclsh83.exe
+   Flags=0000000010000010
+ end
+ item: Install File
+   Source=..\..\tcl8.3.0\win\Release\tclpip83.dll
+   Destination=%MAINDIR%\bin\TCLPIP83.DLL
+   Flags=0000001010000010
+ end
+ item: Install File
+   Source=..\..\tcl8.3.0\win\Release\tcl83.dll
+   Destination=%MAINDIR%\bin\TCL83.DLL
+   Flags=0000001010000010
+ end
+ item: Install File
+   Source=..\..\tcl8.3.0\library\*.tcl
+   Destination=%MAINDIR%\lib\tcl8.3
+   Flags=0000000010000010
+ end
+ item: Install File
+   Source=..\..\tcl8.3.0\library\http1.0\*.tcl
+   Destination=%MAINDIR%\lib\tcl8.3\http1.0
+   Flags=0000000010000010
+ end
+ item: Install File
+   Source=..\..\tcl8.3.0\library\http2.1\*.tcl
+   Destination=%MAINDIR%\lib\tcl8.3\http2.1
+   Flags=0000000010000010
+ end
+ item: Install File
+   Source=..\..\tcl8.3.0\library\msgcat1.0\*
+   Destination=%MAINDIR%\lib\tcl8.3\msgcat1.0
+   Flags=0000000010000010
+ end
+ item: Install File
+   Source=..\..\tcl8.3.0\library\tcltest1.0\*.tcl
+   Destination=%MAINDIR%\lib\tcl8.3\tcltest1.0
+   Flags=0000000010000010
+ end
+ item: Install File
+   Source=..\..\tcl8.3.0\library\encoding\*
+   Destination=%MAINDIR%\lib\tcl8.3\encoding
+   Flags=0000000010000010
+ end
+ item: Install File
+   Source=..\..\tcl8.3.0\library\tclIndex
+   Destination=%MAINDIR%\lib\tcl8.3\tclIndex
+   Flags=0000000010000010
+ end
+ item: Install File
+   Source=..\..\tcl8.3.0\library\license.terms
+   Destination=%MAINDIR%\lib\tcl8.3\license.terms
+   Flags=0000000010000010
+ end
+ item: Install File
+   Source=..\..\tcl8.3.0\library\opt0.4\*.tcl
+   Destination=%MAINDIR%\lib\tcl8.3\opt0.4
+   Flags=0000000010000010
+ end
+ item: Install File
+   Source=..\..\tcl8.3.0\win\Release\tclreg83.dll
+   Destination=%MAINDIR%\lib\tcl8.3\reg1.0\tclreg83.dll
+   Flags=0000000010000010
+ end
+ item: Install File
+   Source=..\..\tcl8.3.0\win\pkgIndex.reg
+   Destination=%MAINDIR%\lib\tcl8.3\reg1.0\pkgIndex.tcl
+   Flags=0000000010000010
+ end
+ item: Install File
+   Source=..\..\tcl8.3.0\win\Release\tcldde83.dll
+   Destination=%MAINDIR%\lib\tcl8.3\dde1.1\tcldde83.dll
+   Flags=0000000010000010
+ end
+ item: Install File
+   Source=..\..\tcl8.3.0\win\pkgIndex.dde
+   Destination=%MAINDIR%\lib\tcl8.3\dde1.1\pkgIndex.tcl
+   Flags=0000000010000010
+ end
+ item: Install File
+   Source=..\library\*.tcl
+   Destination=%MAINDIR%\lib\tk8.3
+   Flags=0000000010000010
+ end
+ item: Install File
+   Source=pkgIndex.tk
+   Destination=%MAINDIR%\lib\tk8.3\pkgIndex.tcl
+   Flags=0000000010000010
+ end
+ item: Install File
+   Source=..\library\focus.tcl
+   Destination=%MAINDIR%\lib\tk8.3\focus.tcl
+   Flags=0000000010000010
+ end
+ item: Install File
+   Source=..\library\images\*
+   Destination=%MAINDIR%\lib\tk8.3\images
+   Flags=0000000010000010
+ end
+ item: Install File
+   Source=..\library\license.terms
+   Destination=%MAINDIR%\lib\tk8.3\license.terms
+   Flags=0000000010000010
+ end
+ item: Install File
+   Source=..\library\tclIndex
+   Destination=%MAINDIR%\lib\tk8.3\tclIndex
+   Flags=0000000010000010
+ end
+ item: Set Variable
+   Variable=COMMON
+   Value=%COMMON%
+   Flags=00010100
+ end
+ item: Set Variable
+   Variable=MAINDIR
+   Value=%MAINDIR%
+   Flags=00010100
+ end
+ item: Check Configuration
+   Flags=10111011
+ end
+ item: Get Registry Key Value
+   Variable=STARTUPDIR
+   Key=Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
+   Default=%WIN%\Start Menu\Programs\StartUp
+   Value Name=StartUp
+   Flags=00000010
+ end
+ item: Get Registry Key Value
+   Variable=DESKTOPDIR
+   Key=Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
+   Default=%WIN%\Desktop
+   Value Name=Desktop
+   Flags=00000010
+ end
+ item: Get Registry Key Value
+   Variable=STARTMENUDIR
+   Key=Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
+   Default=%WIN%\Start Menu
+   Value Name=Start Menu
+   Flags=00000010
+ end
+ item: Get Registry Key Value
+   Variable=GROUPDIR
+   Key=Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
+   Default=%WIN%\Start Menu\Programs
+   Value Name=Programs
+   Flags=00000010
+ end
+ item: Get Registry Key Value
+   Variable=CSTARTUPDIR
+   Key=Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
+   Default=%STARTUPDIR%
+   Value Name=Common Startup
+   Flags=00000100
+ end
+ item: Get Registry Key Value
+   Variable=CDESKTOPDIR
+   Key=Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
+   Default=%DESKTOPDIR%
+   Value Name=Common Desktop
+   Flags=00000100
+ end
+ item: Get Registry Key Value
+   Variable=CSTARTMENUDIR
+   Key=Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
+   Default=%STARTMENUDIR%
+   Value Name=Common Start Menu
+   Flags=00000100
+ end
+ item: Get Registry Key Value
+   Variable=CGROUPDIR
+   Key=Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
+   Default=%GROUPDIR%
+   Value Name=Common Programs
+   Flags=00000100
+ end
+ item: Set Variable
+   Variable=CGROUP_SAVE
+   Value=%GROUP%
+ end
+ item: Set Variable
+   Variable=GROUP
+   Value=%GROUPDIR%\%GROUP%
+ end
+ item: Create Shortcut
+   Source=%MAINDIR%\bin\wish83.exe
+   Destination=%GROUP%\Wish.lnk
+   Icon Number=0
+ end
+ item: Create Shortcut
+   Source=%MAINDIR%\bin\tclsh83.exe
+   Destination=%GROUP%\Tclsh.lnk
+   Icon Number=0
+ end
+ item: Create Shortcut
+   Source=%MAINDIR%\doc\tcl83.hlp
+   Destination=%GROUP%\Tcl Help.lnk
+   Icon Number=0
+   Key Type=1536
+   Flags=00000001
+ end
+ item: Create Shortcut
+   Source=%MAINDIR%\lib\tk8.3\demos\widget.tcl
+   Destination=%GROUP%\Demos\Widget Tour.lnk
+   Icon Number=0
+   Key Type=1536
+   Flags=00000001
+ end
+ item: Else Statement
+ end
+ item: Add ProgMan Icon
+   Group=%GROUP%
+   Icon Name=Wish
+   Command Line=%MAINDIR%\bin\wish83.exe
+   Flags=01000000
+ end
+ item: Add ProgMan Icon
+   Group=%GROUP%
+   Icon Name=Tclsh
+   Command Line=%MAINDIR%\bin\tclsh83.exe
+   Flags=01000000
+ end
+ item: Add ProgMan Icon
+   Group=%GROUP%
+   Icon Name=Tcl Help
+   Command Line=%MAINDIR%\doc\tcl83.hlp
+   Flags=01000000
+ end
+ item: Add ProgMan Icon
+   Group=%GROUP%
+   Icon Name=Widget Tour
+   Command Line=%MAINDIR%\lib\tk8.3\demos\widget.tcl
+   Flags=01000000
+ end
+ item: End Block
+ end
+ item: Self-Register OCXs/DLLs
+   Description=Updating System Configuration, Please Wait...
+ end
+ item: Edit Registry
+   Total Keys=7
+   item: Key
+     Key=Software\Scriptics\Tcl\8.3
+     New Value=%MAINDIR%
+     Value Name=Root
+     Root=2
+   end
+   item: Key
+     Key=TclScript\DefaultIcon
+     New Value=%MAINDIR%\bin\tk83.dll,0
+     New Value=
+   end
+   item: Key
+     Key=.tcl
+     New Value=TclScript
+   end
+   item: Key
+     Key=TclScript
+     New Value=TclScript
+   end
+   item: Key
+     Key=TclScript\shell\open\command
+     New Value=%MAINDIR%\bin\wish83.exe "%%1" %*
+   end
+   item: Key
+     Key=TclScript\shell\edit
+     New Value=&Edit
+   end
+   item: Key
+     Key=TclScript\shell\edit\command
+     New Value=notepad "%%1"
+   end
+ end
+ item: Custom Dialog Set
+   Name=Finished
+   Display Variable=DISPLAY
+   item: Dialog
+     Title=Installation Complete
+     Width=280
+     Height=224
+     Font Name=Helv
+     Font Size=8
+     item: Push Button
+       Rectangle=170 185 212 199
+       Variable=DIRECTION
+       Value=N
+       Create Flags=01010000000000010000000000000001
+       Text=&Finish >
+     end
+     item: Push Button
+       Control Name=CANCEL
+       Rectangle=222 185 264 199
+       Action=3
+       Create Flags=01010000000000010000000000000000
+       Text=Cancel
+     end
+     item: Static
+       Rectangle=9 177 263 178
+       Action=3
+       Create Flags=01010000000000000000000000000111
+     end
+     item: Static
+       Rectangle=90 10 260 63
+       Enabled Color=00000000000000001111111111111111
+       Create Flags=01010000000000000000000000000000
+       Text=%APPTITLE% has been successfully installed.
+       Text=
+       Text=
+       Text=Press the Finish button to exit this installation.
+       Text=
+     end
+     item: Push Button
+       Control Name=BACK
+       Rectangle=128 185 170 199
+       Variable=DIRECTION
+       Value=B
+       Create Flags=01010000000000010000000000000000
+       Text=< &Back
+     end
+     item: Set Control Attribute
+       Control Name=BACK
+       Operation=1
+     end
+     item: Set Control Attribute
+       Control Name=CANCEL
+       Operation=1
+     end
+   end
+ end
*** win/tk83plus.dsp.orig	Wed Feb 16 23:08:48 2000
--- win/tk83plus.dsp	Thu Feb 17 11:28:14 2000
***************
*** 0 ****
--- 1,103 ----
+ # Microsoft Developer Studio Project File - Name="tk83plus" - Package Owner=<4>
+ # Microsoft Developer Studio Generated Build File, Format Version 5.00
+ # ** DO NOT EDIT **
+ 
+ # TARGTYPE "Win32 (x86) External Target" 0x0106
+ 
+ CFG=tk83plus - Win32 Debug
+ !MESSAGE This is not a valid makefile. To build this project using NMAKE,
+ !MESSAGE use the Export Makefile command and run
+ !MESSAGE 
+ !MESSAGE NMAKE /f "tk83plus.mak".
+ !MESSAGE 
+ !MESSAGE You can specify a configuration when running NMAKE
+ !MESSAGE by defining the macro CFG on the command line. For example:
+ !MESSAGE 
+ !MESSAGE NMAKE /f "tk83plus.mak" CFG="tk83plus - Win32 Debug"
+ !MESSAGE 
+ !MESSAGE Possible choices for configuration are:
+ !MESSAGE 
+ !MESSAGE "tk83plus - Win32 Release" (based on "Win32 (x86) External Target")
+ !MESSAGE "tk83plus - Win32 Static" (based on "Win32 (x86) External Target")
+ !MESSAGE "tk83plus - Win32 Debug" (based on "Win32 (x86) External Target")
+ !MESSAGE 
+ 
+ # Begin Project
+ # PROP Scc_ProjName ""
+ # PROP Scc_LocalPath ""
+ 
+ !IF  "$(CFG)" == "tk83plus - Win32 Release"
+ 
+ # PROP BASE Use_Debug_Libraries 0
+ # PROP BASE Output_Dir "Release"
+ # PROP BASE Intermediate_Dir "Release"
+ # PROP BASE Cmd_Line "NMAKE /f makefile.vc"
+ # PROP BASE Rebuild_Opt "/a"
+ # PROP BASE Target_File "wish83.exe"
+ # PROP BASE Bsc_Name "wish83.bsc"
+ # PROP BASE Target_Dir ""
+ # PROP Use_Debug_Libraries 0
+ # PROP Output_Dir "Release"
+ # PROP Intermediate_Dir "Release"
+ # PROP Cmd_Line "NMAKE /f makefile.vc all"
+ # PROP Rebuild_Opt "/a"
+ # PROP Target_File "wish83.exe"
+ # PROP Bsc_Name "wish83.bsc"
+ # PROP Target_Dir ""
+ 
+ !ELSEIF  "$(CFG)" == "tk83plus - Win32 Static"
+ 
+ # PROP BASE Use_Debug_Libraries 0
+ # PROP BASE Output_Dir "Static"
+ # PROP BASE Intermediate_Dir "Static"
+ # PROP BASE Cmd_Line "NMAKE /f makefile.vc"
+ # PROP BASE Rebuild_Opt "/a"
+ # PROP BASE Target_File "wish83.exe"
+ # PROP BASE Bsc_Name "wish83.bsc"
+ # PROP BASE Target_Dir ""
+ # PROP Use_Debug_Libraries 0
+ # PROP Output_Dir "Static"
+ # PROP Intermediate_Dir "Static"
+ # PROP Cmd_Line "NMAKE /f makefile.vc all"
+ # PROP Rebuild_Opt "/a"
+ # PROP Target_File "wish83.exe"
+ # PROP Bsc_Name "wish83.bsc"
+ # PROP Target_Dir ""
+ 
+ !ELSEIF  "$(CFG)" == "tk83plus - Win32 Debug"
+ 
+ # PROP BASE Use_Debug_Libraries 1
+ # PROP BASE Output_Dir "Debug"
+ # PROP BASE Intermediate_Dir "Debug"
+ # PROP BASE Cmd_Line "NMAKE /f makefile.vc"
+ # PROP BASE Rebuild_Opt "/a"
+ # PROP BASE Target_File "wish83.exe"
+ # PROP BASE Bsc_Name "wish83.bsc"
+ # PROP BASE Target_Dir ""
+ # PROP Use_Debug_Libraries 1
+ # PROP Output_Dir "Debug"
+ # PROP Intermediate_Dir "Debug"
+ # PROP Cmd_Line "NMAKE /f makefile.vc all"
+ # PROP Rebuild_Opt "/a"
+ # PROP Target_File "wish83.exe"
+ # PROP Bsc_Name "wish83.bsc"
+ # PROP Target_Dir ""
+ 
+ !ENDIF 
+ 
+ # Begin Target
+ 
+ # Name "tk83plus - Win32 Release"
+ # Name "tk83plus - Win32 Static"
+ # Name "tk83plus - Win32 Debug"
+ 
+ !IF  "$(CFG)" == "tk83plus - Win32 Release"
+ 
+ !ELSEIF  "$(CFG)" == "tk83plus - Win32 Static"
+ 
+ !ELSEIF  "$(CFG)" == "tk83plus - Win32 Debug"
+ 
+ !ENDIF 
+ 
+ # End Target
+ # End Project
*** win/tkWin32Dll.c.orig	Fri Apr 16 03:51:48 1999
--- win/tkWin32Dll.c	Wed Feb 16 23:08:49 2000
***************
*** 13,26 ****
  
  #include "tkWinInt.h"
  
! static int tkPlatformId;
  
- /*
-  * The following declaration is for the VC++ DLL entry point.
-  */
- 
- BOOL APIENTRY		DllMain _ANSI_ARGS_((HINSTANCE hInst,
- 			    DWORD reason, LPVOID reserved));
  
  /*
   *----------------------------------------------------------------------
--- 13,22 ----
  
  #include "tkWinInt.h"
  
! #if defined(_MSC_VER) || defined(__GNUC__)
! #define DllEntryPoint DllMain
! #endif
  
  
  /*
   *----------------------------------------------------------------------
***************
*** 32,63 ****
   *	routine.
   *
   * Results:
!  *	See DllMain.
!  *
!  * Side effects:
!  *	See DllMain.
!  *
!  *----------------------------------------------------------------------
!  */
! 
! BOOL APIENTRY
! DllEntryPoint(hInst, reason, reserved)
!     HINSTANCE hInst;		/* Library instance handle. */
!     DWORD reason;		/* Reason this function is being called. */
!     LPVOID reserved;		/* Not used. */
! {
!     return DllMain(hInst, reason, reserved);
! }
! 
! /*
!  *----------------------------------------------------------------------
!  *
!  * DllMain --
!  *
!  *	DLL entry point.
!  *
!  * Results:
!  *	TRUE on sucess, FALSE on failure.
   *
   * Side effects:
   *	None.
--- 28,34 ----
   *	routine.
   *
   * Results:
!  *	TRUE on success, FALSE otherwise.
   *
   * Side effects:
   *	None.
***************
*** 66,77 ****
   */
  
  BOOL APIENTRY
! DllMain(hInstance, reason, reserved)
!     HINSTANCE hInstance;
!     DWORD reason;
!     LPVOID reserved;
  {
-     OSVERSIONINFO os;
  
      /*
       * If we are attaching to the DLL from a new process, tell Tk about
--- 37,47 ----
   */
  
  BOOL APIENTRY
! DllEntryPoint (
!     HINSTANCE hInstance,	/* Library instance handle. */
!     DWORD reason,		/* Reason this function is being called. */
!     LPVOID reserved)		/* Not used. */
  {
  
      /*
       * If we are attaching to the DLL from a new process, tell Tk about
***************
*** 80,119 ****
       */
      
      if (reason == DLL_PROCESS_ATTACH) {
- 	os.dwOSVersionInfoSize = sizeof(os);
- 	GetVersionEx(&os);
- 	tkPlatformId = os.dwPlatformId;
- 
          TkWinXInit(hInstance);
      } else if (reason == DLL_PROCESS_DETACH) {
          TkWinXCleanup(hInstance);
      }
      return(TRUE);
  }
- 
- /*
-  *----------------------------------------------------------------------
-  *
-  * TkWinGetPlatformId --
-  *
-  *	Determines whether running under NT, 95, or Win32s, to allow 
-  *	runtime conditional code.
-  *
-  * Results:
-  *	The return value is one of:
-  *	    VER_PLATFORM_WIN32s		Win32s on Windows 3.1. 
-  *	    VER_PLATFORM_WIN32_WINDOWS	Win32 on Windows 95.
-  *	    VER_PLATFORM_WIN32_NT	Win32 on Windows NT
-  *
-  * Side effects:
-  *	None.
-  *
-  *----------------------------------------------------------------------
-  */
- 
- int		
- TkWinGetPlatformId()
- {
-     return tkPlatformId;
- }
- 
--- 50,58 ----
*** win/tkWinDllEntry.c.orig	Wed Feb 16 23:08:49 2000
--- win/tkWinDllEntry.c	Wed Feb 16 23:08:49 2000
***************
*** 0 ****
--- 1,37 ----
+ /*
+  *	tkWinDllEntry.c
+  */
+ 
+ #include <windows.h>
+ 
+ #if defined(_MSC_VER) || defined(__GNUC__)
+ #define DllEntryPoint DllMain
+ #endif
+ 
+ 
+ /*
+  *----------------------------------------------------------------------
+  *
+  * DllEntryPoint --
+  *
+  *	This routine is called by gcc, VC++ Borland to invoke the
+  *	initialization code for Tcl.  It simply calls the DllMain
+  *	routine.
+  *
+  * Results:
+  *	TRUE.
+  *
+  * Side effects:
+  *	None.
+  *
+  *----------------------------------------------------------------------
+  */
+ 
+ BOOL APIENTRY
+ DllEntryPoint (
+     HINSTANCE hInst,		/* Library instance handle. */
+     DWORD reason,		/* Reason this function is being called. */
+     LPVOID reserved)		/* Not used. */
+ {
+     return TRUE;
+ }
*** win/tkWinDraw.c.orig	Thu Feb 17 19:42:37 2000
--- win/tkWinDraw.c	Thu Feb 17 19:45:51 2000
***************
*** 563,595 ****
  	
  	infoPtr->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
  	infoPtr->bmiHeader.biWidth = image->width;
! 
! 	/*
! 	 * The following code works around a bug in Win32s.  CreateDIBitmap
! 	 * fails under Win32s for top-down images.  So we have to reverse the
! 	 * order of the scanlines.  If we are not running under Win32s, we can
! 	 * just declare the image to be top-down.
! 	 */
! 
! 	if (tkpIsWin32s) {
! 	    int y;
! 	    char *srcPtr, *dstPtr, *temp;
! 
! 	    temp = ckalloc((unsigned) image->bytes_per_line);
! 	    srcPtr = image->data;
! 	    dstPtr = image->data+(image->bytes_per_line * (image->height - 1));
! 	    for (y = 0; y < (image->height/2); y++) {
! 		memcpy(temp, srcPtr, image->bytes_per_line);
! 		memcpy(srcPtr, dstPtr, image->bytes_per_line);
! 		memcpy(dstPtr, temp, image->bytes_per_line);
! 		srcPtr += image->bytes_per_line;
! 		dstPtr -= image->bytes_per_line;
! 	    }
! 	    ckfree(temp);
! 	    infoPtr->bmiHeader.biHeight = image->height; /* Bottom-up order */
! 	} else {
! 	    infoPtr->bmiHeader.biHeight = -image->height; /* Top-down order */
! 	}
  	infoPtr->bmiHeader.biPlanes = 1;
  	infoPtr->bmiHeader.biBitCount = image->bits_per_pixel;
  	infoPtr->bmiHeader.biCompression = BI_RGB;
--- 563,569 ----
  	
  	infoPtr->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
  	infoPtr->bmiHeader.biWidth = image->width;
! 	infoPtr->bmiHeader.biHeight = -image->height; /* Top-down order */
  	infoPtr->bmiHeader.biPlanes = 1;
  	infoPtr->bmiHeader.biBitCount = image->bits_per_pixel;
  	infoPtr->bmiHeader.biCompression = BI_RGB;
***************
*** 1210,1216 ****
      } else {
  	style = PS_SOLID;
      }
!     if (tkpIsWin32s || (gc->line_width < 2)) {
  	if (gc->line_width > 1) {
  	    style = PS_SOLID;
  	}
--- 1184,1190 ----
      } else {
  	style = PS_SOLID;
      }
!     if (gc->line_width < 2) {
  	if (gc->line_width > 1) {
  	    style = PS_SOLID;
  	}
*** win/tkWinFont.c.orig	Tue Feb  8 11:01:16 2000
--- win/tkWinFont.c	Wed Feb 16 23:08:49 2000
***************
*** 2209,2221 ****
      USHORT **endCountPtr,	/* Filled with malloced pointer to 
  				 * character range information. */
      int *symbolPtr)
!  {
!     int n, i, swapped, offset, cbData, segCount;
      DWORD cmapKey;
      USHORT *startCount, *endCount;
      CMAPTABLE cmapTable;
      ENCODINGTABLE encTable;
      SUBTABLE subTable;
      char *s;
  
      segCount = 0;
--- 2209,2222 ----
      USHORT **endCountPtr,	/* Filled with malloced pointer to 
  				 * character range information. */
      int *symbolPtr)
! {
!     int n, i, swapped, offset, cbData, segCount, charSet;
      DWORD cmapKey;
      USHORT *startCount, *endCount;
      CMAPTABLE cmapTable;
      ENCODINGTABLE encTable;
      SUBTABLE subTable;
+     TEXTMETRIC tm;
      char *s;
  
      segCount = 0;
***************
*** 2314,2319 ****
--- 2315,2332 ----
  		}
  	    }
  	}
+     } else if (GetTextMetrics(hdc, &tm)) {
+         charSet = tm.tmCharSet;
+         if (charSet == ANSI_CHARSET) {
+             segCount = 2;
+             cbData = segCount * sizeof(USHORT);
+             startCount = (USHORT *) ckalloc(cbData);
+             endCount = (USHORT *) ckalloc(cbData);
+             startCount[0] = 0x0020;
+             endCount[0] = 0x007f;
+             startCount[1] = 0x00a0;
+             endCount[1] = 0x00ff;
+         }
      }
      SelectObject(hdc, hFont);
  
*** win/tkWinInit.c.orig	Fri Apr 16 03:51:52 1999
--- win/tkWinInit.c	Wed Feb 16 23:08:50 2000
***************
*** 113,120 ****
  
  void
  TkpDisplayWarning(msg, title)
!     char *msg;			/* Message to be displayed. */
!     char *title;		/* Title of warning. */
  {
      MessageBox(NULL, msg, title, MB_OK | MB_ICONEXCLAMATION | MB_SYSTEMMODAL
  	    | MB_SETFOREGROUND | MB_TOPMOST);
--- 113,120 ----
  
  void
  TkpDisplayWarning(msg, title)
!     CONST char *msg;		/* Message to be displayed. */
!     CONST char *title;		/* Title of warning. */
  {
      MessageBox(NULL, msg, title, MB_OK | MB_ICONEXCLAMATION | MB_SYSTEMMODAL
  	    | MB_SETFOREGROUND | MB_TOPMOST);
*** win/tkWinInt.h.orig	Thu Feb 17 19:46:13 2000
--- win/tkWinInt.h	Thu Feb 17 19:47:03 2000
***************
*** 124,136 ****
  #define TK_WIN_CHILD_CLASS_NAME "TkChild"
  
  /*
-  * The following variable indicates whether we are restricted to Win32s
-  * GDI calls.
-  */
- 
- extern int tkpIsWin32s;
- 
- /*
   * The following variable is a translation table between X gc functions and
   * Win32 raster op modes.
   */
--- 124,129 ----
*** win/tkWinScrlbr.c.orig	Thu Feb 17 19:42:55 2000
--- win/tkWinScrlbr.c	Thu Feb 17 19:48:07 2000
***************
*** 177,187 ****
      scrollInfo.nMin = 0;
      scrollInfo.nMax = MAX_SCROLL;
      thumbSize = (scrollPtr->info.lastFraction - scrollPtr->info.firstFraction);
!     if (tkpIsWin32s) {
! 	scrollInfo.nPage = 0;
!     } else {
! 	scrollInfo.nPage = ((UINT) (thumbSize * (double) MAX_SCROLL)) + 1;
!     } 
      if (thumbSize < 1.0) {
  	scrollInfo.nPos = (int)
  	    ((scrollPtr->info.firstFraction / (1.0-thumbSize))
--- 177,183 ----
      scrollInfo.nMin = 0;
      scrollInfo.nMax = MAX_SCROLL;
      thumbSize = (scrollPtr->info.lastFraction - scrollPtr->info.firstFraction);
!     scrollInfo.nPage = ((UINT) (thumbSize * (double) MAX_SCROLL)) + 1;
      if (thumbSize < 1.0) {
  	scrollInfo.nPos = (int)
  	    ((scrollPtr->info.firstFraction / (1.0-thumbSize))
*** win/tkWinX.c.orig	Thu Feb 17 19:48:41 2000
--- win/tkWinX.c	Thu Feb 17 19:49:32 2000
***************
*** 22,27 ****
--- 22,33 ----
  #include <zmouse.h>
  
  /*
+  * Definitions of extern variables supplied by this file.
+  */
+ 
+ static int tkPlatformId;
+ 
+ /*
   * Declarations of static variables used in this file.
   */
  
***************
*** 136,141 ****
--- 142,148 ----
  
      info.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
      GetVersionEx(&info);
+     tkPlatformId = info.dwPlatformId;
  
      if (childClassInitialized != 0) {
  	return;
***************
*** 1123,1125 ****
--- 1130,1159 ----
  {
      return GetTickCount();
  }
+ 
+ /*
+  *----------------------------------------------------------------------
+  *
+  * TkWinGetPlatformId --
+  *
+  *	Determines whether running under NT, 95, or Win32s, to allow 
+  *	runtime conditional code.
+  *
+  * Results:
+  *	The return value is one of:
+  *	    VER_PLATFORM_WIN32s		Win32s on Windows 3.1. 
+  *	    VER_PLATFORM_WIN32_WINDOWS	Win32 on Windows 95.
+  *	    VER_PLATFORM_WIN32_NT	Win32 on Windows NT
+  *
+  * Side effects:
+  *	None.
+  *
+  *----------------------------------------------------------------------
+  */
+ 
+ int		
+ TkWinGetPlatformId()
+ {
+     return tkPlatformId;
+ }
+ 
*** win/winMain.c.orig	Thu Dec  2 03:05:46 1999
--- win/winMain.c	Sat Feb 19 16:24:28 2000
***************
*** 12,17 ****
--- 12,19 ----
   * RCS: @(#) $Id: winMain.c,v 1.9 1999/12/02 02:05:46 redman Exp $
   */
  
+ #undef TCL_USE_STUBS
+ 
  #include <tk.h>
  #define WIN32_LEAN_AND_MEAN
  #include <windows.h>
***************
*** 32,50 ****
   */
  
  static void		setargv _ANSI_ARGS_((int *argcPtr, char ***argvPtr));
! static void		WishPanic _ANSI_ARGS_(TCL_VARARGS(char *,format));
  
  #ifdef TK_TEST
  extern int		Tktest_Init(Tcl_Interp *interp);
  #endif /* TK_TEST */
  
  #ifdef TCL_TEST
- extern int		TclObjTest_Init _ANSI_ARGS_((Tcl_Interp *interp));
  extern int		Tcltest_Init _ANSI_ARGS_((Tcl_Interp *interp));
  #endif /* TCL_TEST */
  
  static BOOL consoleRequired = TRUE;
  
  
  /*
   *----------------------------------------------------------------------
--- 34,64 ----
   */
  
  static void		setargv _ANSI_ARGS_((int *argcPtr, char ***argvPtr));
! static void		WishPanic _ANSI_ARGS_(TCL_VARARGS(CONST char *,format));
  
  #ifdef TK_TEST
  extern int		Tktest_Init(Tcl_Interp *interp);
  #endif /* TK_TEST */
  
  #ifdef TCL_TEST
  extern int		Tcltest_Init _ANSI_ARGS_((Tcl_Interp *interp));
  #endif /* TCL_TEST */
  
  static BOOL consoleRequired = TRUE;
  
+     /*
+      * The following #if block allows you to change the AppInit
+      * function by using a #define of TCL_LOCAL_APPINIT instead
+      * of rewriting this entire file.  The #if checks for that
+      * #define and uses Tcl_AppInit if it doesn't exist.
+      */
+     
+ #ifndef TK_LOCAL_APPINIT
+ #define TK_LOCAL_APPINIT Tcl_AppInit    
+ #endif
+     extern int TK_LOCAL_APPINIT _ANSI_ARGS_((Tcl_Interp *interp));
+ 
+ 
  
  /*
   *----------------------------------------------------------------------
***************
*** 63,68 ****
--- 77,83 ----
   *----------------------------------------------------------------------
   */
  
+ 
  int APIENTRY
  WinMain(hInstance, hPrevInstance, lpszCmdLine, nCmdShow)
      HINSTANCE hInstance;
***************
*** 76,93 ****
      char *p;
      
      /*
-      * The following #if block allows you to change the AppInit
-      * function by using a #define of TCL_LOCAL_APPINIT instead
-      * of rewriting this entire file.  The #if checks for that
-      * #define and uses Tcl_AppInit if it doesn't exist.
-      */
-     
- #ifndef TK_LOCAL_APPINIT
- #define TK_LOCAL_APPINIT Tcl_AppInit    
- #endif
-     extern int TK_LOCAL_APPINIT _ANSI_ARGS_((Tcl_Interp *interp));
-     
-     /*
       * The following #if block allows you to change how Tcl finds the startup
       * script, prime the library or encoding paths, fiddle with the argv,
       * etc., without needing to rewrite Tk_Main()
--- 91,96 ----
***************
*** 195,203 ****
      }
      Tcl_StaticPackage(interp, "Tcltest", Tcltest_Init,
              (Tcl_PackageInitProc *) NULL);
-     if (TclObjTest_Init(interp) == TCL_ERROR) {
- 	return TCL_ERROR;
-     }
  #endif /* TCL_TEST */
  
  #ifdef TK_TEST
--- 198,203 ----
***************
*** 237,249 ****
   */
  
  void
! WishPanic TCL_VARARGS_DEF(char *,arg1)
  {
      va_list argList;
      char buf[1024];
!     char *format;
!     
!     format = TCL_VARARGS_START(char *,arg1,argList);
      vsprintf(buf, format, argList);
  
      MessageBeep(MB_ICONEXCLAMATION);
--- 237,249 ----
   */
  
  void
! WishPanic TCL_VARARGS_DEF(CONST char *,arg1)
  {
      va_list argList;
      char buf[1024];
!     CONST char *format;
! 
!     format = TCL_VARARGS_START(CONST char *,arg1,argList);
      vsprintf(buf, format, argList);
  
      MessageBeep(MB_ICONEXCLAMATION);
