Imported Tk 8.6.9

This commit is contained in:
Steve Dower
2018-12-11 10:05:28 -08:00
parent 753ac6b037
commit 5ba5cbc9af
184 changed files with 6223 additions and 1994 deletions

View File

@@ -187,8 +187,8 @@ KEYSYM_FLAGS =
# Tk does not used deprecated Tcl constructs so it should
# compile fine with -DTCL_NO_DEPRECATED. To remove its own
# set of deprecated code uncomment the second line.
NO_DEPRECATED_FLAGS = -DTCL_NO_DEPRECATED
#NO_DEPRECATED_FLAGS = -DTCL_NO_DEPRECATED -DTK_NO_DEPRECATED
NO_DEPRECATED_FLAGS =
#NO_DEPRECATED_FLAGS = -DTK_NO_DEPRECATED
# Some versions of make, like SGI's, use the following variable to
# determine which shell to use for executing commands:

279
unix/configure vendored
View File

@@ -1338,7 +1338,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
TK_VERSION=8.6
TK_MAJOR_VERSION=8
TK_MINOR_VERSION=6
TK_PATCH_LEVEL=".8"
TK_PATCH_LEVEL=".9"
VERSION=${TK_VERSION}
LOCALES="cs da de el en en_gb eo es fr hu it nl pl pt ru sv"
@@ -1429,11 +1429,13 @@ echo "$as_me: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >
for i in `ls -d ${libdir} 2>/dev/null` \
`ls -d ${exec_prefix}/lib 2>/dev/null` \
`ls -d ${prefix}/lib 2>/dev/null` \
`ls -d /usr/contrib/lib 2>/dev/null` \
`ls -d /usr/local/lib 2>/dev/null` \
`ls -d /usr/contrib/lib 2>/dev/null` \
`ls -d /usr/pkg/lib 2>/dev/null` \
`ls -d /usr/lib 2>/dev/null` \
`ls -d /usr/lib64 2>/dev/null` \
`ls -d /usr/local/lib/tcl8.6 2>/dev/null` \
`ls -d /usr/local/lib/tcl/tcl8.6 2>/dev/null` \
; do
if test -f "$i/tclConfig.sh" ; then
ac_cv_c_tclconfig="`(cd $i; pwd)`"
@@ -4794,7 +4796,7 @@ echo "$as_me: error: CYGWIN compile is only supported with --enable-threads" >&2
LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
SHLIB_CFLAGS="-fPIC"
SHLIB_SUFFIX=".so"
SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS}'
SHLIB_LD='${CC} ${CFLAGS} ${LDFLAGS} -shared'
DL_OBJS="tclLoadDl.o"
DL_LIBS="-lroot"
echo "$as_me:$LINENO: checking for inet_ntoa in -lnetwork" >&5
@@ -5223,7 +5225,7 @@ fi
# get rid of the warnings.
#CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES"
SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS}'
SHLIB_LD='${CC} ${CFLAGS} ${LDFLAGS} -shared'
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
@@ -5365,7 +5367,7 @@ fi
SHLIB_CFLAGS="-fpic"
;;
esac
SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}'
SHLIB_LD='${CC} ${SHLIB_CFLAGS} -shared'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
@@ -5394,7 +5396,7 @@ fi
NetBSD-*)
# NetBSD has ELF and can use 'cc -shared' to build shared libs
SHLIB_CFLAGS="-fPIC"
SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}'
SHLIB_LD='${CC} ${SHLIB_CFLAGS} -shared'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
@@ -5415,7 +5417,7 @@ fi
fi
;;
FreeBSD-*)
DragonFly-*|FreeBSD-*)
# This configuration from FreeBSD Ports.
SHLIB_CFLAGS="-fPIC"
SHLIB_LD="${CC} -shared"
@@ -6623,7 +6625,7 @@ fi
BSD/OS*) ;;
CYGWIN_*|MINGW32_*) ;;
IRIX*) ;;
NetBSD-*|FreeBSD-*|OpenBSD-*) ;;
NetBSD-*|DragonFly-*|FreeBSD-*|OpenBSD-*) ;;
Darwin-*) ;;
SCO_SV-3.2*) ;;
*) SHLIB_CFLAGS="-fPIC" ;;
@@ -7399,6 +7401,70 @@ _ACEOF
fi
echo "$as_me:$LINENO: checking for DIR64" >&5
echo $ECHO_N "checking for DIR64... $ECHO_C" >&6
if test "${tcl_cv_DIR64+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <sys/types.h>
#include <dirent.h>
int
main ()
{
struct dirent64 *p; DIR64 d = opendir64(".");
p = readdir64(d); rewinddir64(d); closedir64(d);
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
tcl_cv_DIR64=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
tcl_cv_DIR64=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $tcl_cv_DIR64" >&5
echo "${ECHO_T}$tcl_cv_DIR64" >&6
if test "x${tcl_cv_DIR64}" = "xyes" ; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_DIR64 1
_ACEOF
fi
echo "$as_me:$LINENO: checking for struct stat64" >&5
echo $ECHO_N "checking for struct stat64... $ECHO_C" >&6
if test "${tcl_cv_struct_stat64+set}" = set; then
@@ -8220,191 +8286,6 @@ _ACEOF
fi
#--------------------------------------------------------------------
# Under Solaris 2.4, strtod returns the wrong value for the
# terminating character under some conditions. Check for this
# and if the problem exists use a substitute procedure
# "fixstrtod" (provided by Tcl) that corrects the error.
#--------------------------------------------------------------------
echo "$as_me:$LINENO: checking for strtod" >&5
echo $ECHO_N "checking for strtod... $ECHO_C" >&6
if test "${ac_cv_func_strtod+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
/* Define strtod to an innocuous variant, in case <limits.h> declares strtod.
For example, HP-UX 11i <limits.h> declares gettimeofday. */
#define strtod innocuous_strtod
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char strtod (); below.
Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
<limits.h> exists even on freestanding compilers. */
#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif
#undef strtod
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
{
#endif
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char strtod ();
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_strtod) || defined (__stub___strtod)
choke me
#else
char (*f) () = strtod;
#endif
#ifdef __cplusplus
}
#endif
int
main ()
{
return f != strtod;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_func_strtod=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_func_strtod=no
fi
rm -f conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_func_strtod" >&5
echo "${ECHO_T}$ac_cv_func_strtod" >&6
if test $ac_cv_func_strtod = yes; then
tcl_strtod=1
else
tcl_strtod=0
fi
if test "$tcl_strtod" = 1; then
echo "$as_me:$LINENO: checking for Solaris2.4/Tru64 strtod bugs" >&5
echo $ECHO_N "checking for Solaris2.4/Tru64 strtod bugs... $ECHO_C" >&6
if test "${tcl_cv_strtod_buggy+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test "$cross_compiling" = yes; then
tcl_cv_strtod_buggy=buggy
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
extern double strtod();
int main() {
char *infString="Inf", *nanString="NaN", *spaceString=" ";
char *term;
double value;
value = strtod(infString, &term);
if ((term != infString) && (term[-1] == 0)) {
exit(1);
}
value = strtod(nanString, &term);
if ((term != nanString) && (term[-1] == 0)) {
exit(1);
}
value = strtod(spaceString, &term);
if (term == (spaceString+1)) {
exit(1);
}
exit(0);
}
_ACEOF
rm -f conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
tcl_cv_strtod_buggy=ok
else
echo "$as_me: program exited with status $ac_status" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status )
tcl_cv_strtod_buggy=buggy
fi
rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
echo "$as_me:$LINENO: result: $tcl_cv_strtod_buggy" >&5
echo "${ECHO_T}$tcl_cv_strtod_buggy" >&6
if test "$tcl_cv_strtod_buggy" = buggy; then
case $LIBOBJS in
"fixstrtod.$ac_objext" | \
*" fixstrtod.$ac_objext" | \
"fixstrtod.$ac_objext "* | \
*" fixstrtod.$ac_objext "* ) ;;
*) LIBOBJS="$LIBOBJS fixstrtod.$ac_objext" ;;
esac
USE_COMPAT=1
cat >>confdefs.h <<\_ACEOF
#define strtod fixstrtod
_ACEOF
fi
fi
#--------------------------------------------------------------------
# Check for various typedefs and provide substitutes if
# they don't exist.
@@ -9580,7 +9461,7 @@ ac_x_header_dirs='
/usr/openwin/share/include'
if test "$ac_x_includes" = no; then
# Guess where to find include files, by looking for Xlib.h.
# Guess where to find include files, by looking for Intrinsic.h.
# First, try using that file with no special directory specified.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -9588,7 +9469,7 @@ _ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <X11/Xlib.h>
#include <X11/Intrinsic.h>
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
@@ -9615,7 +9496,7 @@ else
sed 's/^/| /' conftest.$ac_ext >&5
for ac_dir in $ac_x_header_dirs; do
if test -r "$ac_dir/X11/Xlib.h"; then
if test -r "$ac_dir/X11/Intrinsic.h"; then
ac_x_includes=$ac_dir
break
fi
@@ -9629,18 +9510,18 @@ if test "$ac_x_libraries" = no; then
# See if we find them without any special options.
# Don't add to $LIBS permanently.
ac_save_LIBS=$LIBS
LIBS="-lX11 $LIBS"
LIBS="-lXt $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <X11/Xlib.h>
#include <X11/Intrinsic.h>
int
main ()
{
XrmInitialize ()
XtMalloc (0)
;
return 0;
}

View File

@@ -25,7 +25,7 @@ m4_ifdef([SC_USE_CONFIG_HEADERS], [
TK_VERSION=8.6
TK_MAJOR_VERSION=8
TK_MINOR_VERSION=6
TK_PATCH_LEVEL=".8"
TK_PATCH_LEVEL=".9"
VERSION=${TK_VERSION}
LOCALES="cs da de el en en_gb eo es fr hu it nl pl pt ru sv"
@@ -196,15 +196,6 @@ fi
AC_CHECK_HEADERS(sys/time.h)
AC_HEADER_TIME
#--------------------------------------------------------------------
# Under Solaris 2.4, strtod returns the wrong value for the
# terminating character under some conditions. Check for this
# and if the problem exists use a substitute procedure
# "fixstrtod" (provided by Tcl) that corrects the error.
#--------------------------------------------------------------------
SC_BUGGY_STRTOD
#--------------------------------------------------------------------
# Check for various typedefs and provide substitutes if
# they don't exist.

View File

@@ -91,11 +91,13 @@ AC_DEFUN([SC_PATH_TCLCONFIG], [
for i in `ls -d ${libdir} 2>/dev/null` \
`ls -d ${exec_prefix}/lib 2>/dev/null` \
`ls -d ${prefix}/lib 2>/dev/null` \
`ls -d /usr/contrib/lib 2>/dev/null` \
`ls -d /usr/local/lib 2>/dev/null` \
`ls -d /usr/contrib/lib 2>/dev/null` \
`ls -d /usr/pkg/lib 2>/dev/null` \
`ls -d /usr/lib 2>/dev/null` \
`ls -d /usr/lib64 2>/dev/null` \
`ls -d /usr/local/lib/tcl8.6 2>/dev/null` \
`ls -d /usr/local/lib/tcl/tcl8.6 2>/dev/null` \
; do
if test -f "$i/tclConfig.sh" ; then
ac_cv_c_tclconfig="`(cd $i; pwd)`"
@@ -224,8 +226,11 @@ AC_DEFUN([SC_PATH_TKCONFIG], [
`ls -d ${prefix}/lib 2>/dev/null` \
`ls -d /usr/local/lib 2>/dev/null` \
`ls -d /usr/contrib/lib 2>/dev/null` \
`ls -d /usr/pkg/lib 2>/dev/null` \
`ls -d /usr/lib 2>/dev/null` \
`ls -d /usr/lib64 2>/dev/null` \
`ls -d /usr/local/lib/tk8.6 2>/dev/null` \
`ls -d /usr/local/lib/tcl/tk8.6 2>/dev/null` \
; do
if test -f "$i/tkConfig.sh" ; then
ac_cv_c_tkconfig="`(cd $i; pwd)`"
@@ -1258,7 +1263,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
SHLIB_CFLAGS="-fPIC"
SHLIB_SUFFIX=".so"
SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS}'
SHLIB_LD='${CC} ${CFLAGS} ${LDFLAGS} -shared'
DL_OBJS="tclLoadDl.o"
DL_LIBS="-lroot"
AC_CHECK_LIB(network, inet_ntoa, [LIBS="$LIBS -lnetwork"])
@@ -1402,7 +1407,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
# get rid of the warnings.
#CFLAGS_OPTIMIZE="${CFLAGS_OPTIMIZE} -D__NO_STRING_INLINES -D__NO_MATH_INLINES"
SHLIB_LD='${CC} -shared ${CFLAGS} ${LDFLAGS}'
SHLIB_LD='${CC} ${CFLAGS} ${LDFLAGS} -shared'
DL_OBJS="tclLoadDl.o"
DL_LIBS="-ldl"
LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
@@ -1473,7 +1478,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
SHLIB_CFLAGS="-fpic"
;;
esac
SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}'
SHLIB_LD='${CC} ${SHLIB_CFLAGS} -shared'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
@@ -1496,7 +1501,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
NetBSD-*)
# NetBSD has ELF and can use 'cc -shared' to build shared libs
SHLIB_CFLAGS="-fPIC"
SHLIB_LD='${CC} -shared ${SHLIB_CFLAGS}'
SHLIB_LD='${CC} ${SHLIB_CFLAGS} -shared'
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
@@ -1511,7 +1516,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
LDFLAGS="$LDFLAGS -pthread"
])
;;
FreeBSD-*)
DragonFly-*|FreeBSD-*)
# This configuration from FreeBSD Ports.
SHLIB_CFLAGS="-fPIC"
SHLIB_LD="${CC} -shared"
@@ -2007,7 +2012,7 @@ dnl # preprocessing tests use only CPPFLAGS.
BSD/OS*) ;;
CYGWIN_*|MINGW32_*) ;;
IRIX*) ;;
NetBSD-*|FreeBSD-*|OpenBSD-*) ;;
NetBSD-*|DragonFly-*|FreeBSD-*|OpenBSD-*) ;;
Darwin-*) ;;
SCO_SV-3.2*) ;;
*) SHLIB_CFLAGS="-fPIC" ;;
@@ -2392,59 +2397,6 @@ AC_DEFUN([SC_TIME_HANDLER], [
fi
])
#--------------------------------------------------------------------
# SC_BUGGY_STRTOD
#
# Under Solaris 2.4, strtod returns the wrong value for the
# terminating character under some conditions. Check for this
# and if the problem exists use a substitute procedure
# "fixstrtod" (provided by Tcl) that corrects the error.
# Also, on Compaq's Tru64 Unix 5.0,
# strtod(" ") returns 0.0 instead of a failure to convert.
#
# Arguments:
# none
#
# Results:
#
# Might defines some of the following vars:
# strtod (=fixstrtod)
#
#--------------------------------------------------------------------
AC_DEFUN([SC_BUGGY_STRTOD], [
AC_CHECK_FUNC(strtod, tcl_strtod=1, tcl_strtod=0)
if test "$tcl_strtod" = 1; then
AC_CACHE_CHECK([for Solaris2.4/Tru64 strtod bugs], tcl_cv_strtod_buggy,[
AC_TRY_RUN([
extern double strtod();
int main() {
char *infString="Inf", *nanString="NaN", *spaceString=" ";
char *term;
double value;
value = strtod(infString, &term);
if ((term != infString) && (term[-1] == 0)) {
exit(1);
}
value = strtod(nanString, &term);
if ((term != nanString) && (term[-1] == 0)) {
exit(1);
}
value = strtod(spaceString, &term);
if (term == (spaceString+1)) {
exit(1);
}
exit(0);
}], tcl_cv_strtod_buggy=ok, tcl_cv_strtod_buggy=buggy,
tcl_cv_strtod_buggy=buggy)])
if test "$tcl_cv_strtod_buggy" = buggy; then
AC_LIBOBJ([fixstrtod])
USE_COMPAT=1
AC_DEFINE(strtod, fixstrtod, [Do we want to use the strtod() in compat?])
fi
fi
])
#--------------------------------------------------------------------
# SC_TCL_LINK_LIBS
#
@@ -2470,12 +2422,9 @@ AC_DEFUN([SC_TCL_LINK_LIBS], [
#--------------------------------------------------------------------
# On a few very rare systems, all of the libm.a stuff is
# already in libc.a. Set compiler flags accordingly.
# Also, Linux requires the "ieee" library for math to work
# right (and it must appear before "-lm").
#--------------------------------------------------------------------
AC_CHECK_FUNC(sin, MATH_LIBS="", MATH_LIBS="-lm")
AC_CHECK_LIB(ieee, main, [MATH_LIBS="-lieee $MATH_LIBS"])
#--------------------------------------------------------------------
# Interactive UNIX requires -linet instead of -lsocket, plus it
@@ -2579,7 +2528,7 @@ AC_DEFUN([SC_TCL_EARLY_FLAGS],[
# Might define the following vars:
# TCL_WIDE_INT_IS_LONG
# TCL_WIDE_INT_TYPE
# HAVE_STRUCT_DIRENT64
# HAVE_STRUCT_DIRENT64, HAVE_DIR64
# HAVE_STRUCT_STAT64
# HAVE_TYPE_OFF64_T
#
@@ -2615,6 +2564,15 @@ AC_DEFUN([SC_TCL_64BIT_FLAGS], [
AC_DEFINE(HAVE_STRUCT_DIRENT64, 1, [Is 'struct dirent64' in <sys/types.h>?])
fi
AC_CACHE_CHECK([for DIR64], tcl_cv_DIR64,[
AC_TRY_COMPILE([#include <sys/types.h>
#include <dirent.h>],[struct dirent64 *p; DIR64 d = opendir64(".");
p = readdir64(d); rewinddir64(d); closedir64(d);],
tcl_cv_DIR64=yes,tcl_cv_DIR64=no)])
if test "x${tcl_cv_DIR64}" = "xyes" ; then
AC_DEFINE(HAVE_DIR64, 1, [Is 'DIR64' in <sys/types.h>?])
fi
AC_CACHE_CHECK([for struct stat64], tcl_cv_struct_stat64,[
AC_TRY_COMPILE([#include <sys/stat.h>],[struct stat64 p;
],

View File

@@ -4,7 +4,7 @@
Name: tk
Summary: Tk graphical toolkit for the Tcl scripting language.
Version: 8.6.8
Version: 8.6.9
Release: 2
License: BSD
Group: Development/Languages

View File

@@ -13,6 +13,9 @@
/* Do we have access to Darwin CoreFoundation.framework? */
#undef HAVE_COREFOUNDATION
/* Is 'DIR64' in <sys/types.h>? */
#undef HAVE_DIR64
/* Compiler support for module scope symbols */
#undef HAVE_HIDDEN
@@ -238,9 +241,6 @@
/* Define to `unsigned' if <sys/types.h> does not define. */
#undef size_t
/* Do we want to use the strtod() in compat? */
#undef strtod
/* Define to `int' if <sys/types.h> doesn't define. */
#undef uid_t

View File

@@ -406,8 +406,7 @@ ControlUtfProc(
{
const char *srcStart, *srcEnd;
char *dstStart, *dstEnd;
int ch;
int result;
int ch, result;
static char hexChars[] = "0123456789abcdef";
static char mapChars[] = {
0, 0, 0, 0, 0, 0, 0,
@@ -954,7 +953,7 @@ void
TkpGetFontAttrsForChar(
Tk_Window tkwin, /* Window on the font's display */
Tk_Font tkfont, /* Font to query */
int c, /* Character of interest */
int c, /* Character of interest */
TkFontAttributes *faPtr) /* Output: Font attributes */
{
FontAttributes atts;
@@ -1018,7 +1017,7 @@ Tk_MeasureChars(
{
UnixFont *fontPtr;
SubFont *lastSubFontPtr;
int curX, curByte;
int curX, curByte, ch;
/*
* Unix does not use kerning or fractional character widths when
@@ -1036,7 +1035,6 @@ Tk_MeasureChars(
curByte = 0;
} else if (maxLength < 0) {
const char *p, *end, *next;
int ch;
SubFont *thisSubFontPtr;
FontFamily *familyPtr;
Tcl_DString runString;
@@ -1090,7 +1088,6 @@ Tk_MeasureChars(
} else {
const char *p, *end, *next, *term;
int newX, termX, sawNonSpace, dstWrote;
Tcl_UniChar ch;
FontFamily *familyPtr;
XChar2b buf[8];
@@ -1100,7 +1097,7 @@ Tk_MeasureChars(
* individually.
*/
next = source + Tcl_UtfToUniChar(source, &ch);
next = source + TkUtfToUniChar(source, &ch);
newX = curX = termX = 0;
term = source;
@@ -1135,7 +1132,7 @@ Tk_MeasureChars(
break;
}
next += Tcl_UtfToUniChar(next, &ch);
next += TkUtfToUniChar(next, &ch);
if ((ch < 256) && isspace(ch)) {
if (sawNonSpace) {
term = p;
@@ -1160,13 +1157,13 @@ Tk_MeasureChars(
*/
curX = newX;
p += Tcl_UtfToUniChar(p, &ch);
p += TkUtfToUniChar(p, &ch);
}
if ((flags & TK_AT_LEAST_ONE) && (term == source) && (p < end)) {
term = p;
termX = curX;
if (term == source) {
term += Tcl_UtfToUniChar(term, &ch);
term += TkUtfToUniChar(term, &ch);
termX = newX;
}
} else if ((p >= end) || !(flags & TK_WHOLE_WORDS)) {
@@ -1278,8 +1275,7 @@ Tk_DrawChars(
SubFont *thisSubFontPtr, *lastSubFontPtr;
Tcl_DString runString;
const char *p, *end, *next;
int xStart, needWidth, window_width, do_width;
Tcl_UniChar ch;
int xStart, needWidth, window_width, do_width, ch;
FontFamily *familyPtr;
#ifdef TK_DRAW_CHAR_XWINDOW_CHECK
int rx, ry;
@@ -1314,7 +1310,7 @@ Tk_DrawChars(
needWidth = fontPtr->font.fa.underline + fontPtr->font.fa.overstrike;
for (p = source; p <= end; ) {
if (p < end) {
next = p + Tcl_UtfToUniChar(p, &ch);
next = p + TkUtfToUniChar(p, &ch);
thisSubFontPtr = FindSubFontForChar(fontPtr, ch, &lastSubFontPtr);
} else {
next = p + 1;
@@ -1849,7 +1845,9 @@ AllocFontFamily(
if ((familyPtr->faceName == fa.fa.family)
&& (familyPtr->foundry == fa.xa.foundry)
&& (familyPtr->encoding == encoding)) {
Tcl_FreeEncoding(encoding);
if (encoding) {
Tcl_FreeEncoding(encoding);
}
familyPtr->refCount++;
return familyPtr;
}
@@ -1923,7 +1921,9 @@ FreeFontFamily(
if (familyPtr->refCount > 0) {
return;
}
Tcl_FreeEncoding(familyPtr->encoding);
if (familyPtr->encoding) {
Tcl_FreeEncoding(familyPtr->encoding);
}
for (i = 0; i < FONTMAP_PAGES; i++) {
if (familyPtr->fontMap[i] != NULL) {
ckfree(familyPtr->fontMap[i]);
@@ -2213,7 +2213,7 @@ FontMapLoadPage(
int row) /* Index of the page to be loaded into the
* cache. */
{
char buf[16], src[TCL_UTF_MAX];
char buf[16], src[6];
int minHi, maxHi, minLo, maxLo, scale, checkLo;
int i, end, bitOffset, isTwoByteFont, n;
Tcl_Encoding encoding;
@@ -2251,7 +2251,7 @@ FontMapLoadPage(
for (i = row << FONTMAP_SHIFT; i < end; i++) {
int hi, lo;
if (Tcl_UtfToExternal(NULL, encoding, src, Tcl_UniCharToUtf(i, src),
if (Tcl_UtfToExternal(NULL, encoding, src, TkUniCharToUtf(i, src),
TCL_ENCODING_STOPONERROR, NULL, buf, sizeof(buf), NULL,
NULL, NULL) != TCL_OK) {
continue;
@@ -2417,7 +2417,7 @@ CanUseFallback(
unsigned bestScore[2];
char **nameList;
char **nameListOrig;
char src[TCL_UTF_MAX];
char src[6];
FontAttributes want, got;
Display *display;
SubFont subFont;
@@ -2447,7 +2447,7 @@ CanUseFallback(
}
nameListOrig = nameList;
srcLen = Tcl_UniCharToUtf(ch, src);
srcLen = TkUniCharToUtf(ch, src);
want.fa = fontPtr->font.fa;
want.xa = fontPtr->xa;

View File

@@ -125,6 +125,17 @@ TkpGetString(
return Tcl_DStringValue(dsPtr);
}
/*
* Only do this for KeyPress events, otherwise
* further Xlib function behavior might be undefined.
*/
if (eventPtr->type != KeyPress) {
len = 0;
Tcl_DStringSetLength(dsPtr, len);
goto done;
}
#ifdef TK_USE_INPUT_METHODS
if ((winPtr->dispPtr->flags & TK_DISPLAY_USE_IM)
&& (winPtr->inputContext != NULL)
@@ -217,6 +228,7 @@ TkpGetString(
* from having to reenter the XIM engine. [Bug 1373712]
*/
done:
kePtr->charValuePtr = ckalloc(len + 1);
kePtr->charValueLen = len;
memcpy(kePtr->charValuePtr, Tcl_DStringValue(dsPtr), (unsigned) len + 1);
@@ -236,7 +248,7 @@ TkpSetKeycodeAndState(
XEvent *eventPtr)
{
TkDisplay *dispPtr = ((TkWindow *) tkwin)->dispPtr;
int state;
int state, mincode, maxcode;
KeyCode keycode;
if (keySym == NoSymbol) {
@@ -258,6 +270,21 @@ TkpSetKeycodeAndState(
}
}
}
/*
* Filter keycodes out of range, otherwise further Xlib function
* behavior might be undefined, in particular XIM could cause crashes.
*/
mincode = 0;
maxcode = -1;
XDisplayKeycodes(dispPtr->display, &mincode, &maxcode);
if (keycode < mincode) {
keycode = mincode;
} else if (keycode > maxcode) {
keycode = maxcode;
}
eventPtr->xkey.keycode = keycode;
}

View File

@@ -52,8 +52,8 @@ static void SetHelpMenu(TkMenu *menuPtr);
static void DrawMenuEntryAccelerator(TkMenu *menuPtr,
TkMenuEntry *mePtr, Drawable d, GC gc,
Tk_Font tkfont, const Tk_FontMetrics *fmPtr,
Tk_3DBorder activeBorder, int x, int y,
int width, int height, int drawArrow);
Tk_3DBorder activeBorder, Tk_3DBorder bgBorder,
int x, int y, int width, int height, int drawArrow);
static void DrawMenuEntryBackground(TkMenu *menuPtr,
TkMenuEntry *mePtr, Drawable d,
Tk_3DBorder activeBorder, Tk_3DBorder bgBorder,
@@ -481,6 +481,7 @@ DrawMenuEntryAccelerator(
Tk_Font tkfont, /* The precalculated font */
const Tk_FontMetrics *fmPtr,/* The precalculated metrics */
Tk_3DBorder activeBorder, /* The border for an active item */
Tk_3DBorder bgBorder, /* The background border */
int x, /* Left coordinate of entry rect */
int y, /* Top coordinate of entry rect */
int width, /* Width of entry */
@@ -510,8 +511,9 @@ DrawMenuEntryAccelerator(
points[1].y = points[0].y + CASCADE_ARROW_HEIGHT;
points[2].x = points[0].x + CASCADE_ARROW_WIDTH;
points[2].y = points[0].y + CASCADE_ARROW_HEIGHT/2;
Tk_Fill3DPolygon(menuPtr->tkwin, d, activeBorder, points, 3,
DECORATION_BORDER_WIDTH,
Tk_Fill3DPolygon(menuPtr->tkwin, d,
(mePtr->state == ENTRY_ACTIVE) ? activeBorder : bgBorder,
points, 3, DECORATION_BORDER_WIDTH,
(menuPtr->postedCascade == mePtr)
? TK_RELIEF_SUNKEN : TK_RELIEF_RAISED);
} else if (mePtr->accelPtr != NULL) {
@@ -638,7 +640,7 @@ DrawMenuSeparator(
points[0].x = x;
points[0].y = y + height/2;
points[1].x = width - 1;
points[1].x = x + width - 1;
points[1].y = points[0].y;
border = Tk_Get3DBorderFromObj(menuPtr->tkwin, menuPtr->borderPtr);
Tk_Draw3DPolygon(menuPtr->tkwin, d, border, points, 2, 1,
@@ -1193,7 +1195,7 @@ DrawTearoffEntry(
points[0].y = y + height/2;
points[1].y = points[0].y;
segmentWidth = 6;
maxX = width - 1;
maxX = x + width - 1;
border = Tk_Get3DBorderFromObj(menuPtr->tkwin, menuPtr->borderPtr);
while (points[0].x < maxX) {
@@ -1326,8 +1328,7 @@ TkpDrawMenuEntry(
int height, /* Height of the current rectangle */
int strictMotif, /* Boolean flag */
int drawArrow) /* Whether or not to draw the cascade arrow
* for cascade items. Only applies to
* Windows. */
* for cascade items. */
{
GC gc, indicatorGC;
XColor *indicatorColor, *disableColor = NULL;
@@ -1435,7 +1436,8 @@ TkpDrawMenuEntry(
DrawMenuEntryLabel(menuPtr, mePtr, d, gc, tkfont, fmPtr, x, adjustedY,
width, adjustedHeight);
DrawMenuEntryAccelerator(menuPtr, mePtr, d, gc, tkfont, fmPtr,
activeBorder, x, adjustedY, width, adjustedHeight, drawArrow);
activeBorder, bgBorder, x, adjustedY, width, adjustedHeight,
drawArrow);
if (!mePtr->hideMargin) {
if (mePtr->state == ENTRY_ACTIVE) {
bgBorder = activeBorder;
@@ -1718,7 +1720,7 @@ TkpComputeStandardMenuGeometry(
menuPtr->entries[j]->entryFlags |= ENTRY_LAST_COLUMN;
}
windowWidth = x + indicatorSpace + labelWidth + accelWidth
+ 2 * activeBorderWidth + 2 * borderWidth;
+ 2 * activeBorderWidth + borderWidth;
windowHeight += borderWidth;

View File

@@ -711,9 +711,19 @@ Tk_MeasureChars(
(flags & TK_AT_LEAST_ONE && curByte == 0)) {
curX = newX;
curByte = newByte;
} else if (flags & TK_WHOLE_WORDS && termX != 0) {
curX = termX;
curByte = termByte;
} else if (flags & TK_WHOLE_WORDS) {
if ((flags & TK_AT_LEAST_ONE) && (termX == 0)) {
/*
* No space was seen before reaching the right
* of the allotted maxLength space, i.e. no word
* boundary. Return the string that fills the
* allotted space, without overfill.
* curX and curByte are already the right ones:
*/
} else {
curX = termX;
curByte = termByte;
}
}
break;
}
@@ -850,6 +860,7 @@ Tk_DrawChars(
* string when drawing. */
{
const int maxCoord = 0x7FFF;/* Xft coordinates are 16 bit values */
const int minCoord = -maxCoord-1;
UnixFtFont *fontPtr = (UnixFtFont *) tkfont;
XGCValues values;
XftColor *xftcolor;
@@ -859,10 +870,6 @@ Tk_DrawChars(
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (maxCoord <= y) {
return; /* nothing to draw */
}
if (fontPtr->ftDraw == 0) {
#if DEBUG_FONTSEL
printf("Switch to drawable 0x%x\n", drawable);
@@ -900,26 +907,28 @@ Tk_DrawChars(
ftFont = GetFont(fontPtr, c, 0.0);
if (ftFont) {
int cx = x;
int cy = y;
specs[nspec].glyph = XftCharIndex(fontPtr->display, ftFont, c);
XftGlyphExtents(fontPtr->display, ftFont, &specs[nspec].glyph, 1,
&metrics);
if ((x += metrics.xOff) >= maxCoord
|| (y += metrics.yOff) >= maxCoord) {
break;
}
if (metrics.xOff > 0 && cx >= 0 && cy >= 0) {
specs[nspec].font = ftFont;
specs[nspec].x = cx;
specs[nspec].y = cy;
if (++nspec == NUM_SPEC) {
XftDrawGlyphFontSpec(fontPtr->ftDraw, xftcolor,
specs, nspec);
nspec = 0;
}
/*
* Draw glyph only when it fits entirely into 16 bit coords.
*/
if (x >= minCoord && y >= minCoord &&
x <= maxCoord - metrics.width &&
y <= maxCoord - metrics.height) {
specs[nspec].font = ftFont;
specs[nspec].x = x;
specs[nspec].y = y;
if (++nspec == NUM_SPEC) {
XftDrawGlyphFontSpec(fontPtr->ftDraw, xftcolor,
specs, nspec);
nspec = 0;
}
}
x += metrics.xOff;
y += metrics.yOff;
}
}
if (nspec) {
@@ -982,7 +991,7 @@ TkDrawAngledChars(
double angle) /* What angle to put text at, in degrees. */
{
const int maxCoord = 0x7FFF;/* Xft coordinates are 16 bit values */
const int minCoord = -1000; /* Should be good enough... */
const int minCoord = -maxCoord-1;
UnixFtFont *fontPtr = (UnixFtFont *) tkfont;
XGCValues values;
XftColor *xftcolor;
@@ -1021,7 +1030,7 @@ TkDrawAngledChars(
currentFtFont = NULL;
originX = originY = 0; /* lint */
while (numBytes > 0 && x >= minCoord && y >= minCoord) {
while (numBytes > 0) {
XftFont *ftFont;
FcChar32 c;
@@ -1050,34 +1059,54 @@ TkDrawAngledChars(
* this information... but we'll be ready when it does!
*/
XftDrawGlyphs(fontPtr->ftDraw, xftcolor, currentFtFont,
originX, originY, glyphs, nglyph);
XftGlyphExtents(fontPtr->display, currentFtFont, glyphs,
nglyph, &metrics);
/*
* Draw glyph only when it fits entirely into 16 bit coords.
*/
if (x >= minCoord && y >= minCoord &&
x <= maxCoord - metrics.width &&
y <= maxCoord - metrics.height) {
/*
* NOTE:
* The whole algorithm has a design problem, the choice of
* NUM_SPEC is arbitrary, and so the inter-glyph spacing could
* look arbitrary. This algorithm has to draw the whole string
* at once (or whole blocks with same font), this requires a
* dynamic 'glyphs' array. In case of overflow the array has to
* be divided until the maximal string will fit. (GC)
* Given the resolution of current displays though, this should
* not be a huge issue since NUM_SPEC is 1024 and thus able to
* cover about 6000 pixels for a 6 pixel wide font (which is
* a very small barely readable font)
*/
XftDrawGlyphs(fontPtr->ftDraw, xftcolor, currentFtFont,
originX, originY, glyphs, nglyph);
}
}
originX = ROUND16(x);
originY = ROUND16(y);
if (nglyph) {
XftGlyphExtents(fontPtr->display, currentFtFont, glyphs,
nglyph, &metrics);
nglyph = 0;
/*
* Breaking at this place is sub-optimal, but the whole algorithm
* has a design problem, the choice of NUM_SPEC is arbitrary, and so
* the inter-glyph spacing will look arbitrary. This algorithm
* has to draw the whole string at once (or whole blocks with same
* font), this requires a dynamic 'glyphs' array. In case of overflow
* the array has to be divided until the maximal string will fit. (GC)
*/
if ((x += metrics.xOff) >= maxCoord || (y += metrics.yOff) >= maxCoord) {
break;
}
}
currentFtFont = ftFont;
}
glyphs[nglyph++] = XftCharIndex(fontPtr->display, ftFont, c);
}
if (nglyph) {
XftDrawGlyphs(fontPtr->ftDraw, xftcolor, currentFtFont,
originX, originY, glyphs, nglyph);
XftGlyphExtents(fontPtr->display, currentFtFont, glyphs,
nglyph, &metrics);
/*
* Draw glyph only when it fits entirely into 16 bit coords.
*/
if (x >= minCoord && y >= minCoord &&
x <= maxCoord - metrics.width &&
y <= maxCoord - metrics.height) {
XftDrawGlyphs(fontPtr->ftDraw, xftcolor, currentFtFont,
originX, originY, glyphs, nglyph);
}
}
#else /* !XFT_HAS_FIXED_ROTATED_PLACEMENT */
int clen, nspec;
@@ -1105,7 +1134,7 @@ TkDrawAngledChars(
XftDrawSetClip(fontPtr->ftDraw, tsdPtr->clipRegion);
}
nspec = 0;
while (numBytes > 0 && x >= minCoord && y >= minCoord) {
while (numBytes > 0) {
XftFont *ftFont, *ft0Font;
FcChar32 c;
@@ -1123,21 +1152,28 @@ TkDrawAngledChars(
ftFont = GetFont(fontPtr, c, angle);
ft0Font = GetFont(fontPtr, c, 0.0);
if (ftFont && ft0Font) {
specs[nspec].font = ftFont;
specs[nspec].glyph = XftCharIndex(fontPtr->display, ftFont, c);
specs[nspec].x = ROUND16(x);
specs[nspec].y = ROUND16(y);
XftGlyphExtents(fontPtr->display, ft0Font, &specs[nspec].glyph, 1,
&metrics);
if ((x += metrics.xOff*cosA + metrics.yOff*sinA) > maxCoord
|| (y += metrics.yOff*cosA - metrics.xOff*sinA) > maxCoord) {
break;
}
if (++nspec == NUM_SPEC) {
XftDrawGlyphFontSpec(fontPtr->ftDraw, xftcolor,
specs, nspec);
nspec = 0;
/*
* Draw glyph only when it fits entirely into 16 bit coords.
*/
if (x >= minCoord && y >= minCoord &&
x <= maxCoord - metrics.width &&
y <= maxCoord - metrics.height) {
specs[nspec].font = ftFont;
specs[nspec].x = ROUND16(x);
specs[nspec].y = ROUND16(y);
if (++nspec == NUM_SPEC) {
XftDrawGlyphFontSpec(fontPtr->ftDraw, xftcolor,
specs, nspec);
nspec = 0;
}
}
x += metrics.xOff*cosA + metrics.yOff*sinA;
y += metrics.yOff*cosA - metrics.xOff*sinA;
}
}
if (nspec) {

View File

@@ -289,6 +289,11 @@ TkpComputeScrollbarGeometry(
scrollPtr->inset = scrollPtr->highlightWidth + scrollPtr->borderWidth;
width = (scrollPtr->vertical) ? Tk_Width(scrollPtr->tkwin)
: Tk_Height(scrollPtr->tkwin);
/*
* Next line assumes that the arrow area is a square.
*/
scrollPtr->arrowLength = width - 2*scrollPtr->inset + 1;
fieldLength = (scrollPtr->vertical ? Tk_Height(scrollPtr->tkwin)
: Tk_Width(scrollPtr->tkwin))

View File

@@ -261,11 +261,14 @@ RegOpen(
unsigned long bytesAfter;
Atom actualType;
char **propertyPtr;
Tk_ErrorHandler handler;
if (dispPtr->commTkwin == NULL) {
SendInit(interp, dispPtr);
}
handler = Tk_CreateErrorHandler(dispPtr->display, -1, -1, -1, NULL, NULL);
regPtr = ckalloc(sizeof(NameRegistry));
regPtr->dispPtr = dispPtr;
regPtr->locked = 0;
@@ -306,8 +309,11 @@ RegOpen(
XDeleteProperty(dispPtr->display,
RootWindow(dispPtr->display, 0),
dispPtr->registryProperty);
XSync(dispPtr->display, False);
}
Tk_DeleteErrorHandler(handler);
/*
* Xlib placed an extra null byte after the end of the property, just to
* make sure that it is always NULL-terminated. Be sure to include this
@@ -514,6 +520,11 @@ RegClose(
NameRegistry *regPtr) /* Pointer to a registry opened with a
* previous call to RegOpen. */
{
Tk_ErrorHandler handler;
handler = Tk_CreateErrorHandler(regPtr->dispPtr->display, -1, -1, -1,
NULL, NULL);
if (regPtr->modified) {
if (!regPtr->locked && !localData.sendDebug) {
Tcl_Panic("The name registry was modified without being locked!");
@@ -540,6 +551,8 @@ RegClose(
XFlush(regPtr->dispPtr->display);
Tk_DeleteErrorHandler(handler);
if (regPtr->property != NULL) {
if (regPtr->allocedByX) {
XFree(regPtr->property);
@@ -1095,6 +1108,31 @@ Tk_SendObjCmd(
Tcl_DStringAppend(&request, " ", 1);
Tcl_DStringAppend(&request, Tcl_GetString(objv[i]), -1);
}
if (!async) {
/*
* Register the fact that we're waiting for a command to complete
* (this is needed by SendEventProc and by AppendErrorProc to pass
* back the command's results). Set up a timeout handler so that
* we can check during long sends to make sure that the destination
* application is still alive.
*
* We prepare the pending struct here in order to catch potential
* early X errors from AppendPropCarefully() due to XSync().
*/
pending.serial = localData.sendSerial;
pending.dispPtr = dispPtr;
pending.target = destName;
pending.commWindow = commWindow;
pending.interp = interp;
pending.result = NULL;
pending.errorInfo = NULL;
pending.errorCode = NULL;
pending.gotResponse = 0;
pending.nextPtr = tsdPtr->pendingCommands;
tsdPtr->pendingCommands = &pending;
}
(void) AppendPropCarefully(dispPtr->display, commWindow,
dispPtr->commProperty, Tcl_DStringValue(&request),
Tcl_DStringLength(&request) + 1, (async ? NULL : &pending));
@@ -1108,26 +1146,6 @@ Tk_SendObjCmd(
return TCL_OK;
}
/*
* Register the fact that we're waiting for a command to complete (this is
* needed by SendEventProc and by AppendErrorProc to pass back the
* command's results). Set up a timeout handler so that we can check
* during long sends to make sure that the destination application is
* still alive.
*/
pending.serial = localData.sendSerial;
pending.dispPtr = dispPtr;
pending.target = destName;
pending.commWindow = commWindow;
pending.interp = interp;
pending.result = NULL;
pending.errorInfo = NULL;
pending.errorCode = NULL;
pending.gotResponse = 0;
pending.nextPtr = tsdPtr->pendingCommands;
tsdPtr->pendingCommands = &pending;
/*
* Enter a loop processing X events until the result comes in or the
* target is declared to be dead. While waiting for a result, look only at
@@ -1951,6 +1969,7 @@ TkpTestsendCmd(
"bogus", "prop", "serial", NULL
};
TkWindow *winPtr = clientData;
Tk_ErrorHandler handler;
int index;
if (objc < 2) {
@@ -1959,16 +1978,19 @@ TkpTestsendCmd(
return TCL_ERROR;
}
if (Tcl_GetIndexFromObjStruct(interp, objv[1], testsendOptions,
if (Tcl_GetIndexFromObjStruct(interp, objv[1], testsendOptions,
sizeof(char *), "option", 0, &index) != TCL_OK) {
return TCL_ERROR;
}
if (index == TESTSEND_BOGUS) {
return TCL_ERROR;
}
if (index == TESTSEND_BOGUS) {
handler = Tk_CreateErrorHandler(winPtr->dispPtr->display, -1, -1, -1,
NULL, NULL);
XChangeProperty(winPtr->dispPtr->display,
RootWindow(winPtr->dispPtr->display, 0),
winPtr->dispPtr->registryProperty, XA_INTEGER, 32,
PropModeReplace,
(unsigned char *) "This is bogus information", 6);
Tk_DeleteErrorHandler(handler);
} else if (index == TESTSEND_PROP) {
int result, actualFormat;
unsigned long length, bytesAfter;
@@ -2007,7 +2029,10 @@ TkpTestsendCmd(
XFree(property);
}
} else if (Tcl_GetString(objv[4])[0] == 0) {
handler = Tk_CreateErrorHandler(winPtr->dispPtr->display,
-1, -1, -1, NULL, NULL);
XDeleteProperty(winPtr->dispPtr->display, w, propName);
Tk_DeleteErrorHandler(handler);
} else {
Tcl_DString tmp;
@@ -2018,10 +2043,12 @@ TkpTestsendCmd(
*p = 0;
}
}
handler = Tk_CreateErrorHandler(winPtr->dispPtr->display,
-1, -1, -1, NULL, NULL);
XChangeProperty(winPtr->dispPtr->display, w, propName, XA_STRING,
8, PropModeReplace, (unsigned char*)Tcl_DStringValue(&tmp),
p-Tcl_DStringValue(&tmp));
Tk_DeleteErrorHandler(handler);
Tcl_DStringFree(&tmp);
}
} else if (index == TESTSEND_SERIAL) {