Import Tk 8.6.11

This commit is contained in:
Steve Dower
2021-03-30 00:54:10 +01:00
parent 42c69189d9
commit 070b8750b0
403 changed files with 21608 additions and 16269 deletions

View File

@@ -101,11 +101,12 @@ DEMO_INSTALL_DIR = $(INSTALL_ROOT)$(TK_LIBRARY)/demos
# The directory containing the Tcl sources and headers appropriate
# for this version of Tk ("srcdir" will be replaced or has already
# been replaced by the configure script):
TCL_GENERIC_DIR = @TCL_SRC_DIR@/generic
TCLDIR = @TCL_SRC_DIR@
TCL_GENERIC_DIR = $(TCLDIR)/generic
# The directory containing the platform specific Tcl sources and headers
# appropriate for this version of Tk:
TCL_PLATFORM_DIR = @TCL_SRC_DIR@/unix
TCL_PLATFORM_DIR = $(TCLDIR)/unix
# The directory containing the Tcl library archive file appropriate
# for this version of Tk:
@@ -311,7 +312,7 @@ GENERIC_DIR = $(TOP_DIR)/generic
TTK_DIR = $(GENERIC_DIR)/ttk
UNIX_DIR = $(TOP_DIR)/unix
BMAP_DIR = $(TOP_DIR)/bitmaps
TOOL_DIR = @TCL_SRC_DIR@/tools
TOOL_DIR = $(TCLDIR)/tools
TEST_DIR = $(TOP_DIR)/tests
MAC_OSX_DIR = $(TOP_DIR)/macosx
XLIB_DIR = $(TOP_DIR)/xlib
@@ -328,9 +329,9 @@ MAN_FLAGS = @MAN_FLAGS@
CC = @CC@
CC_SWITCHES_NO_STUBS = ${CFLAGS} ${CFLAGS_WARNING} ${SHLIB_CFLAGS} \
-I${UNIX_DIR} -I${GENERIC_DIR} -I${BMAP_DIR} -I${TCL_GENERIC_DIR} \
-I${TCL_PLATFORM_DIR} ${@TK_WINDOWINGSYSTEM@_INCLUDES} ${AC_FLAGS} \
CC_SWITCHES_NO_STUBS = -I${UNIX_DIR} -I${GENERIC_DIR} -I${BMAP_DIR} \
${@TK_WINDOWINGSYSTEM@_INCLUDES} ${CFLAGS} ${CFLAGS_WARNING} \
${SHLIB_CFLAGS} -I${TCL_GENERIC_DIR} -I${TCL_PLATFORM_DIR} ${AC_FLAGS} \
${PROTO_FLAGS} ${SECURITY_FLAGS} ${MEM_DEBUG_FLAGS} ${KEYSYM_FLAGS} \
${NO_DEPRECATED_FLAGS} @EXTRA_CC_SWITCHES@
@@ -338,10 +339,10 @@ CC_SWITCHES = $(CC_SWITCHES_NO_STUBS) @TCL_STUB_FLAGS@
APP_CC_SWITCHES = $(CC_SWITCHES_NO_STUBS) @EXTRA_APP_CC_SWITCHES@
DEPEND_SWITCHES = ${CFLAGS} -I${UNIX_DIR} -I${GENERIC_DIR} -I${BMAP_DIR} \
-I${TCL_GENERIC_DIR} -I${TCL_PLATFORM_DIR} ${@TK_WINDOWINGSYSTEM@_INCLUDES} \
${AC_FLAGS} ${PROTO_FLAGS} ${SECURITY_FLAGS} ${MEM_DEBUG_FLAGS} \
${KEYSYM_FLAGS} @EXTRA_CC_SWITCHES@
DEPEND_SWITCHES = -I${UNIX_DIR} -I${GENERIC_DIR} -I${BMAP_DIR} \
${@TK_WINDOWINGSYSTEM@_INCLUDES} ${CFLAGS} -I${TCL_GENERIC_DIR} \
-I${TCL_PLATFORM_DIR} ${AC_FLAGS} ${PROTO_FLAGS} ${SECURITY_FLAGS} \
${MEM_DEBUG_FLAGS} ${KEYSYM_FLAGS} @EXTRA_CC_SWITCHES@
WISH_OBJS = tkAppInit.o
@@ -570,7 +571,7 @@ DEMOPROGS = browse hello ixset rmt rolodex square tcolor timer widget
SHELL_ENV = \
@LD_LIBRARY_PATH_VAR@="`pwd`:${TCL_BIN_DIR}:$${@LD_LIBRARY_PATH_VAR@}"; \
export @LD_LIBRARY_PATH_VAR@; \
TCL_LIBRARY=@TCL_SRC_DIR@/library; export TCL_LIBRARY; \
TCL_LIBRARY=$(TCLDIR)/library; export TCL_LIBRARY; \
TK_LIBRARY=@TK_SRC_DIR@/library; export TK_LIBRARY;
all: binaries libraries doc
@@ -580,7 +581,7 @@ binaries: ${LIB_FILE} ${WISH_EXE}
libraries:
$(TOP_DIR)/doc/man.macros:
$(INSTALL_DATA) @TCL_SRC_DIR@/doc/man.macros $(TOP_DIR)/doc/man.macros
$(INSTALL_DATA) $(TCLDIR)/doc/man.macros $(TOP_DIR)/doc/man.macros
doc: $(TOP_DIR)/doc/man.macros
@@ -633,8 +634,8 @@ $(TKTEST_EXE): $(TKTEST_OBJS) $(TK_LIB_FILE)
$(MAKE) tktest-real LIB_RUNTIME_DIR="`pwd`:$(TCL_BIN_DIR)"
tktest-real: ${TK_STUB_LIB_FILE}
${CC} ${CFLAGS} ${LDFLAGS} $(TKTEST_OBJS) ${TK_STUB_LIB_FILE} ${TCL_STUB_LIB_SPEC} @TK_BUILD_LIB_SPEC@ \
$(WISH_LIBS) $(CC_SEARCH_FLAGS) -o $(TKTEST_EXE)
${CC} ${CFLAGS} ${LDFLAGS} $(TKTEST_OBJS) @TK_BUILD_LIB_SPEC@ $(WISH_LIBS) \
${TK_STUB_LIB_FILE} ${TCL_STUB_LIB_SPEC} $(CC_SEARCH_FLAGS) -o $(TKTEST_EXE)
# # FIXME: This xttest rule seems to be broken in a number of ways. It should
# # use CC_SEARCH_FLAGS, it does not include the shared lib location logic from
@@ -686,7 +687,7 @@ demo:
# This target can be used to run wish inside either gdb or insight
gdb: ${WISH_EXE}
@echo "set env @LD_LIBRARY_PATH_VAR@=\"`pwd`:${TCL_BIN_DIR}:$${@LD_LIBRARY_PATH_VAR@}\"" > gdb.run
@echo "set env TCL_LIBRARY=@TCL_SRC_DIR@/library" >> gdb.run
@echo "set env TCL_LIBRARY=$(TCLDIR)/library" >> gdb.run
@echo "set env TK_LIBRARY=@TK_SRC_DIR@/library" >> gdb.run
gdb ./${WISH_EXE} --command=gdb.run
rm gdb.run
@@ -748,8 +749,8 @@ install-binaries: $(TK_STUB_LIB_FILE) $(TK_LIB_FILE) ${WISH_EXE}
@if test -f "tk${MAJOR_VERSION}${MINOR_VERSION}.dll"; then \
$(INSTALL_LIBRARY) "tk${MAJOR_VERSION}${MINOR_VERSION}.dll" "$(DLL_INSTALL_DIR)";\
chmod 555 "$(DLL_INSTALL_DIR)/tk${MAJOR_VERSION}${MINOR_VERSION}.dll";\
$(INSTALL_LIBRARY) "../win/libtk${MAJOR_VERSION}${MINOR_VERSION}.a" "$(LIB_INSTALL_DIR)";\
chmod 555 "$(LIB_INSTALL_DIR)/libtk${MAJOR_VERSION}${MINOR_VERSION}.a";\
$(INSTALL_LIBRARY) "../win/libtk${MAJOR_VERSION}${MINOR_VERSION}.dll.a" "$(LIB_INSTALL_DIR)";\
chmod 555 "$(LIB_INSTALL_DIR)/libtk${MAJOR_VERSION}${MINOR_VERSION}.dll.a";\
fi
@echo "Installing ${WISH_EXE} as $(BIN_INSTALL_DIR)/wish$(VERSION)${EXE_SUFFIX}"
@$(INSTALL_PROGRAM) ${WISH_EXE} "$(BIN_INSTALL_DIR)/wish$(VERSION)${EXE_SUFFIX}"
@@ -761,8 +762,8 @@ install-binaries: $(TK_STUB_LIB_FILE) $(TK_LIB_FILE) ${WISH_EXE}
fi
@EXTRA_INSTALL_BINARIES@
@echo "Installing pkg-config file to $(LIB_INSTALL_DIR)/pkgconfig/"
@$(INSTALL_DATA_DIR) $(LIB_INSTALL_DIR)/pkgconfig
@$(INSTALL_DATA) tk.pc $(LIB_INSTALL_DIR)/pkgconfig/tk.pc
@$(INSTALL_DATA_DIR) "$(LIB_INSTALL_DIR)/pkgconfig"
@$(INSTALL_DATA) tk.pc "$(LIB_INSTALL_DIR)/pkgconfig/tk.pc"
install-libraries: libraries
@for i in "$(SCRIPT_INSTALL_DIR)" "$(SCRIPT_INSTALL_DIR)/images" \
@@ -1205,7 +1206,7 @@ tkUnixRFont.o: $(UNIX_DIR)/tkUnixRFont.c
$(CC) -c $(CC_SWITCHES) $(XFT_CFLAGS) $(UNIX_DIR)/tkUnixRFont.c
tkUnixInit.o: $(UNIX_DIR)/tkUnixInit.c tkConfig.sh
$(CC) -c $(CC_SWITCHES) -DTK_LIBRARY=\"${TK_LIBRARY}\" \
$(CC) -c $(CC_SWITCHES) \
$(UNIX_DIR)/tkUnixInit.c
tkUnixKey.o: $(UNIX_DIR)/tkUnixKey.c
@@ -1281,7 +1282,7 @@ tkMacOSXImage.o: $(MAC_OSX_DIR)/tkMacOSXImage.c
$(CC) -c $(CC_SWITCHES) $(MAC_OSX_DIR)/tkMacOSXImage.c
tkMacOSXInit.o: $(MAC_OSX_DIR)/tkMacOSXInit.c tkConfig.sh
$(CC) -c $(CC_SWITCHES) -DTK_LIBRARY=\"${TK_LIBRARY}\" \
$(CC) -c $(CC_SWITCHES) \
$(MAC_OSX_DIR)/tkMacOSXInit.c
tkMacOSXKeyboard.o: $(MAC_OSX_DIR)/tkMacOSXKeyboard.c
@@ -1530,7 +1531,7 @@ rpm: all
#
# Target to create a proper Tk distribution from information in the
# master source directory. DISTDIR must be defined to indicate where
# source directory. DISTDIR must be defined to indicate where
# to put the distribution. DISTDIR must be an absolute path name.
#
@@ -1538,7 +1539,6 @@ DISTROOT = /tmp/dist
DISTNAME = tk${VERSION}${PATCH_LEVEL}
ZIPNAME = tk${MAJOR_VERSION}${MINOR_VERSION}${PATCH_LEVEL}-src.zip
DISTDIR = $(DISTROOT)/$(DISTNAME)
TCLDIR = @TCL_SRC_DIR@
$(UNIX_DIR)/configure: $(UNIX_DIR)/configure.in $(UNIX_DIR)/tcl.m4 \
$(UNIX_DIR)/aclocal.m4
cd $(UNIX_DIR); autoconf
@@ -1547,18 +1547,23 @@ $(MAC_OSX_DIR)/configure: $(MAC_OSX_DIR)/configure.ac $(UNIX_DIR)/configure
$(UNIX_DIR)/tkConfig.h.in: $(MAC_OSX_DIR)/configure
cd $(MAC_OSX_DIR); autoheader; touch $@
dist: $(UNIX_DIR)/configure $(UNIX_DIR)/tkConfig.h.in $(UNIX_DIR)/tk.pc.in $(MAC_OSX_DIR)/configure genstubs
$(TOP_DIR)/manifest.uuid:
printf "git." >$(TOP_DIR)/manifest.uuid
git rev-parse HEAD >>$(TOP_DIR)/manifest.uuid
dist: $(UNIX_DIR)/configure $(UNIX_DIR)/tkConfig.h.in $(UNIX_DIR)/tk.pc.in $(MAC_OSX_DIR)/configure $(TOP_DIR)/doc/man.macros $(TOP_DIR)/manifest.uuid
rm -rf $(DISTDIR)
mkdir -p $(DISTDIR)/unix
cp -p $(TOP_DIR)/manifest.uuid $(DISTDIR)
cp -p $(UNIX_DIR)/*.c $(UNIX_DIR)/*.h $(DISTDIR)/unix
cp $(TOP_DIR)/license.terms $(UNIX_DIR)/Makefile.in $(DISTDIR)/unix
chmod 664 $(DISTDIR)/unix/Makefile.in
cp $(UNIX_DIR)/configure $(UNIX_DIR)/configure.in $(UNIX_DIR)/tk.spec \
$(UNIX_DIR)/aclocal.m4 $(UNIX_DIR)/tcl.m4 \
$(UNIX_DIR)/tkConfig.sh.in $(TCLDIR)/unix/install-sh \
$(UNIX_DIR)/tkConfig.sh.in $(UNIX_DIR)/install-sh \
$(UNIX_DIR)/README $(UNIX_DIR)/installManPage \
$(UNIX_DIR)/tkConfig.h.in $(UNIX_DIR)/tk.pc.in $(DISTDIR)/unix
chmod 775 $(DISTDIR)/unix/configure $(DISTDIR)/unix/configure.in
chmod 775 $(DISTDIR)/unix/configure
mkdir $(DISTDIR)/bitmaps
@(cd $(TOP_DIR); for i in bitmaps/* ; do \
if [ -f $$i ] ; then \
@@ -1608,8 +1613,8 @@ dist: $(UNIX_DIR)/configure $(UNIX_DIR)/tkConfig.h.in $(UNIX_DIR)/tk.pc.in $(M
$(MAC_OSX_DIR)/Tk.xcodeproj/default.pbxuser \
$(DISTDIR)/macosx/Tk.xcodeproj
mkdir $(DISTDIR)/compat
cp -p $(TOP_DIR)/license.terms $(TCLDIR)/compat/unistd.h \
$(TCLDIR)/compat/stdlib.h \
cp -p $(TOP_DIR)/license.terms $(TOP_DIR)/compat/unistd.h \
$(TOP_DIR)/compat/stdlib.h \
$(DISTDIR)/compat
mkdir $(DISTDIR)/xlib
cp -p $(XLIB_DIR)/*.[ch] $(DISTDIR)/xlib
@@ -1656,13 +1661,16 @@ dist: $(UNIX_DIR)/configure $(UNIX_DIR)/tkConfig.h.in $(UNIX_DIR)/tk.pc.in $(M
done;)
mkdir $(DISTDIR)/doc
cp -p $(TOP_DIR)/license.terms $(TOP_DIR)/doc/*.[13n] \
$(TCLDIR)/doc/man.macros $(DISTDIR)/doc
$(TOP_DIR)/doc/man.macros $(DISTDIR)/doc
mkdir $(DISTDIR)/tests
cp -p $(TOP_DIR)/license.terms $(TEST_DIR)/*.{test,tcl} \
$(TEST_DIR)/README $(TEST_DIR)/*.{gif,png,ppm,xbm} \
$(TEST_DIR)/option.file* $(DISTDIR)/tests
mkdir $(DISTDIR)/tests/ttk
cp -p $(TEST_DIR)/ttk/*.{test,tcl} $(DISTDIR)/tests/ttk
cp -p $(TOP_DIR)/.travis.yml $(DISTDIR)
mkdir -p $(DISTDIR)/.github/workflows
cp -p $(TOP_DIR)/.github/workflows/*.yml $(DISTDIR)/.github/workflows
alldist: dist
rm -f $(DISTROOT)/$(DISTNAME)-src.tar.gz $(DISTROOT)/$(ZIPNAME)

69
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=".10"
TK_PATCH_LEVEL=".11"
VERSION=${TK_VERSION}
LOCALES="cs da de el en en_gb eo es fr hu it nl pl pt ru sv"
@@ -1487,10 +1487,6 @@ echo "${ECHO_T}loading" >&6
echo "${ECHO_T}could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6
fi
# eval is required to do the TCL_DBGX substitution
eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\""
eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\""
# If the TCL_BIN_DIR is the build directory (not the install directory),
# then set the common variable name to the value of the build variables.
# For example, the variable TCL_LIB_SPEC will be set to the value
@@ -1524,12 +1520,6 @@ echo "${ECHO_T}could not find ${TCL_BIN_DIR}/tclConfig.sh" >&6
esac
fi
# eval is required to do the TCL_DBGX substitution
eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\""
eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\""
eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\""
eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\""
@@ -3059,6 +3049,7 @@ cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <ctype.h>
#include <stdlib.h>
#if ((' ' & 0x0FF) == 0x020)
# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
@@ -4029,14 +4020,6 @@ if test "${enable_shared+set}" = set; then
else
tcl_ok=yes
fi;
if test "${enable_shared+set}" = set; then
enableval="$enable_shared"
tcl_ok=$enableval
else
tcl_ok=yes
fi
if test "$tcl_ok" = "yes" ; then
echo "$as_me:$LINENO: result: shared" >&5
echo "${ECHO_T}shared" >&6
@@ -4402,7 +4385,7 @@ fi
if test "$GCC" = yes; then
CFLAGS_OPTIMIZE=-O2
CFLAGS_WARNING="-Wall"
CFLAGS_WARNING="-Wall -Wpointer-arith"
else
@@ -4693,7 +4676,7 @@ fi
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
CYGWIN_*|MINGW32*)
CYGWIN_*|MINGW32_*|MSYS_*)
SHLIB_CFLAGS=""
SHLIB_LD='${CC} -shared'
SHLIB_SUFFIX=".dll"
@@ -4704,7 +4687,7 @@ fi
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
TCL_NEEDS_EXP_FILE=1
TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.dll.a'
TCL_EXPORT_FILE_SUFFIX='${VERSION}.dll.a'
SHLIB_LD_LIBS="${SHLIB_LD_LIBS} -Wl,--out-implib,\$@.a"
echo "$as_me:$LINENO: checking for Cygwin version of gcc" >&5
echo $ECHO_N "checking for Cygwin version of gcc... $ECHO_C" >&6
@@ -5005,7 +4988,7 @@ fi
SHLIB_LD='${CC} -shared'
if test $doRpath = yes; then
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
fi
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
@@ -5129,7 +5112,7 @@ esac
if test $doRpath = yes; then
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
fi
@@ -5150,7 +5133,7 @@ esac
if test $doRpath = yes; then
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
fi
@@ -5191,7 +5174,7 @@ esac
if test $doRpath = yes; then
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
fi
@@ -5234,7 +5217,7 @@ fi
LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
if test $doRpath = yes; then
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
fi
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
@@ -5334,8 +5317,8 @@ fi
LD_FLAGS="-Wl,--export-dynamic"
if test $doRpath = yes; then
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
LD_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
fi
;;
@@ -5376,7 +5359,7 @@ fi
DL_LIBS=""
if test $doRpath = yes; then
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
fi
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
@@ -5406,7 +5389,7 @@ fi
LDFLAGS="$LDFLAGS -export-dynamic"
if test $doRpath = yes; then
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
fi
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
@@ -5428,11 +5411,10 @@ fi
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
LDFLAGS=""
if test $doRpath = yes; then
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
LD_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
fi
if test "${TCL_THREADS}" = "1"; then
@@ -5757,6 +5739,7 @@ cat >>confdefs.h <<\_ACEOF
#define MODULE_SCOPE __private_extern__
_ACEOF
tcl_cv_cc_visibility_hidden=yes
fi
@@ -6020,7 +6003,7 @@ fi
DL_LIBS=""
if test $doRpath = yes; then
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'
fi
@@ -6619,7 +6602,7 @@ fi
case $system in
AIX-*) ;;
BSD/OS*) ;;
CYGWIN_*|MINGW32_*) ;;
CYGWIN_*|MINGW32_*|MSYS_*) ;;
IRIX*) ;;
NetBSD-*|DragonFly-*|FreeBSD-*|OpenBSD-*) ;;
Darwin-*) ;;
@@ -6655,7 +6638,7 @@ fi
if test "${SHARED_BUILD}" = 1 -a "${SHLIB_SUFFIX}" != ""; then
LIB_SUFFIX=${SHARED_LIB_SUFFIX}
MAKE_LIB='${SHLIB_LD} -o $@ ${OBJS} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS}'
MAKE_LIB='${SHLIB_LD} -o $@ ${OBJS} ${LDFLAGS} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS}'
if test "${SHLIB_SUFFIX}" = ".dll"; then
INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(BIN_INSTALL_DIR)/$(LIB_FILE)";if test -f $(LIB_FILE).a; then $(INSTALL_DATA) $(LIB_FILE).a "$(LIB_INSTALL_DIR)"; fi;'
@@ -6831,7 +6814,6 @@ else
tcl_ok=no
fi;
# FIXME: Currently, LDFLAGS_DEFAULT is not used, it should work like CFLAGS_DEFAULT.
DBGX=""
if test "$tcl_ok" = "no"; then
CFLAGS_DEFAULT='$(CFLAGS_OPTIMIZE)'
LDFLAGS_DEFAULT='$(LDFLAGS_OPTIMIZE)'
@@ -8816,7 +8798,7 @@ cat >>conftest.$ac_ext <<_ACEOF
int
main ()
{
struct passwd pwd; pwd.pw_gecos;
struct passwd pwd; (void)pwd.pw_gecos;
;
return 0;
}
@@ -10991,8 +10973,12 @@ echo "${ECHO_T}static library" >&6
echo "$LDFLAGS " | grep -q -- '-prebind ' && TK_SHLIB_LD_EXTRAS="${TK_SHLIB_LD_EXTRAS}"' -seg1addr 0xb000000'
TK_SHLIB_LD_EXTRAS="${TK_SHLIB_LD_EXTRAS}"' -sectcreate __TEXT __info_plist Tk-Info.plist'
EXTRA_WISH_LIBS='-sectcreate __TEXT __info_plist Wish-Info.plist'
EXTRA_WISH_LIBS=${EXTRA_WISH_LIBS}' -sectcreate __TEXT __credits_html Credits.html'
if test "${SHARED_BUILD}" = "0"; then
EXTRA_WISH_LIBS=${EXTRA_WISH_LIBS}' -ObjC'
fi
EXTRA_APP_CC_SWITCHES="${EXTRA_APP_CC_SWITCHES}"' -mdynamic-no-pic'
ac_config_files="$ac_config_files Tk-Info.plist:../macosx/Tk-Info.plist.in Wish-Info.plist:../macosx/Wish-Info.plist.in"
ac_config_files="$ac_config_files Tk-Info.plist:../macosx/Tk-Info.plist.in Wish-Info.plist:../macosx/Wish-Info.plist.in Credits.html:../macosx/Credits.html.in"
for l in ${LOCALES}; do CFBUNDLELOCALIZATIONS="${CFBUNDLELOCALIZATIONS}<string>$l</string>"; done
TK_YEAR="`date +%Y`"
@@ -11028,6 +11014,7 @@ _ACEOF
EXTRA_INSTALL="install-private-headers html-tk"
EXTRA_BUILD_HTML='@ln -fs contents.htm "$(HTML_INSTALL_DIR)"/TkTOC.html'
EXTRA_INSTALL_BINARIES='@echo "Installing Info.plist to $(LIB_INSTALL_DIR)/Resources/" && $(INSTALL_DATA_DIR) "$(LIB_INSTALL_DIR)/Resources" && $(INSTALL_DATA) Tk-Info.plist "$(LIB_INSTALL_DIR)/Resources/Info.plist"'
EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing Credits.html to $(LIB_INSTALL_DIR)/Resources/" && $(INSTALL_DATA_DIR) "$(LIB_INSTALL_DIR)/Resources" && $(INSTALL_DATA) Credits.html "$(LIB_INSTALL_DIR)/Resources"'
EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing license.terms to $(LIB_INSTALL_DIR)/Resources/" && $(INSTALL_DATA) "$(TOP_DIR)/license.terms" "$(LIB_INSTALL_DIR)/Resources"'
if test $tk_aqua = yes; then
EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing Images to $(LIB_INSTALL_DIR)/Resources/" && $(INSTALL_DATA_DIR) "$(LIB_INSTALL_DIR)/Resources" && for i in Tk.tiff Tk.icns; do $(INSTALL_DATA) "$(MAC_OSX_DIR)/$$i" "$(LIB_INSTALL_DIR)/Resources"; done'
@@ -11037,6 +11024,7 @@ _ACEOF
EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing Wish.icns to $(BIN_INSTALL_DIR)/../Resources" && $(INSTALL_DATA_DIR) "$(BIN_INSTALL_DIR)/../Resources"'
EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && $(INSTALL_DATA) "$(MAC_OSX_DIR)/Tk.icns" "$(BIN_INSTALL_DIR)/../Resources/Wish.icns"'
EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing Wish.sdef to $(BIN_INSTALL_DIR)/../Resources" && $(INSTALL_DATA) "$(MAC_OSX_DIR)/Wish.sdef" "$(BIN_INSTALL_DIR)/../Resources"'
EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing Credits.html to $(BIN_INSTALL_DIR)/../Resources" && $(INSTALL_DATA) Credits.html "$(BIN_INSTALL_DIR)/../Resources"'
fi
EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Finalizing Tk.framework" && rm -f "$(LIB_INSTALL_DIR)/../Current" && ln -s "$(VERSION)" "$(LIB_INSTALL_DIR)/../Current" && for f in "$(LIB_FILE)" tkConfig.sh Resources Headers PrivateHeaders; do rm -f "$(LIB_INSTALL_DIR)/../../$$f" && ln -s "Versions/Current/$$f" "$(LIB_INSTALL_DIR)/../.."; done && f="$(STUB_LIB_FILE)" && rm -f "$(LIB_INSTALL_DIR)/../../$$f" && ln -s "Versions/$(VERSION)/$$f" "$(LIB_INSTALL_DIR)/../.."'
# Don't use AC_DEFINE for the following as the framework version define
@@ -11709,6 +11697,7 @@ do
# Handling of arguments.
"Tk-Info.plist" ) CONFIG_FILES="$CONFIG_FILES Tk-Info.plist:../macosx/Tk-Info.plist.in" ;;
"Wish-Info.plist" ) CONFIG_FILES="$CONFIG_FILES Wish-Info.plist:../macosx/Wish-Info.plist.in" ;;
"Credits.html" ) CONFIG_FILES="$CONFIG_FILES Credits.html:../macosx/Credits.html.in" ;;
"Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile:../unix/Makefile.in" ;;
"tkConfig.sh" ) CONFIG_FILES="$CONFIG_FILES tkConfig.sh:../unix/tkConfig.sh.in" ;;
"tk.pc" ) CONFIG_FILES="$CONFIG_FILES tk.pc:../unix/tk.pc.in" ;;

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=".10"
TK_PATCH_LEVEL=".11"
VERSION=${TK_VERSION}
LOCALES="cs da de el en en_gb eo es fr hu it nl pl pt ru sv"
@@ -244,7 +244,7 @@ AC_CHECK_TYPE([uintptr_t], [
AC_CACHE_CHECK([pw_gecos in struct pwd], tcl_cv_pwd_pw_gecos, [
AC_TRY_COMPILE([#include <pwd.h>],
[struct passwd pwd; pwd.pw_gecos;],
[struct passwd pwd; (void)pwd.pw_gecos;],
tcl_cv_pwd_pw_gecos=yes, tcl_cv_pwd_pw_gecos=no)])
if test $tcl_cv_pwd_pw_gecos = yes; then
AC_DEFINE(HAVE_PW_GECOS, 1, [Does struct password have a pw_gecos field?])
@@ -682,8 +682,12 @@ if test "`uname -s`" = "Darwin" ; then
echo "$LDFLAGS " | grep -q -- '-prebind ' && TK_SHLIB_LD_EXTRAS="${TK_SHLIB_LD_EXTRAS}"' -seg1addr 0xb000000'
TK_SHLIB_LD_EXTRAS="${TK_SHLIB_LD_EXTRAS}"' -sectcreate __TEXT __info_plist Tk-Info.plist'
EXTRA_WISH_LIBS='-sectcreate __TEXT __info_plist Wish-Info.plist'
EXTRA_WISH_LIBS=${EXTRA_WISH_LIBS}' -sectcreate __TEXT __credits_html Credits.html'
if test "${SHARED_BUILD}" = "0"; then
EXTRA_WISH_LIBS=${EXTRA_WISH_LIBS}' -ObjC'
fi
EXTRA_APP_CC_SWITCHES="${EXTRA_APP_CC_SWITCHES}"' -mdynamic-no-pic'
AC_CONFIG_FILES([Tk-Info.plist:../macosx/Tk-Info.plist.in Wish-Info.plist:../macosx/Wish-Info.plist.in])
AC_CONFIG_FILES([Tk-Info.plist:../macosx/Tk-Info.plist.in Wish-Info.plist:../macosx/Wish-Info.plist.in Credits.html:../macosx/Credits.html.in])
for l in ${LOCALES}; do CFBUNDLELOCALIZATIONS="${CFBUNDLELOCALIZATIONS}<string>$l</string>"; done
TK_YEAR="`date +%Y`"
fi
@@ -720,6 +724,7 @@ if test "$FRAMEWORK_BUILD" = "1" ; then
EXTRA_INSTALL="install-private-headers html-tk"
EXTRA_BUILD_HTML='@ln -fs contents.htm "$(HTML_INSTALL_DIR)"/TkTOC.html'
EXTRA_INSTALL_BINARIES='@echo "Installing Info.plist to $(LIB_INSTALL_DIR)/Resources/" && $(INSTALL_DATA_DIR) "$(LIB_INSTALL_DIR)/Resources" && $(INSTALL_DATA) Tk-Info.plist "$(LIB_INSTALL_DIR)/Resources/Info.plist"'
EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing Credits.html to $(LIB_INSTALL_DIR)/Resources/" && $(INSTALL_DATA_DIR) "$(LIB_INSTALL_DIR)/Resources" && $(INSTALL_DATA) Credits.html "$(LIB_INSTALL_DIR)/Resources"'
EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing license.terms to $(LIB_INSTALL_DIR)/Resources/" && $(INSTALL_DATA) "$(TOP_DIR)/license.terms" "$(LIB_INSTALL_DIR)/Resources"'
if test $tk_aqua = yes; then
EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing Images to $(LIB_INSTALL_DIR)/Resources/" && $(INSTALL_DATA_DIR) "$(LIB_INSTALL_DIR)/Resources" && for i in Tk.tiff Tk.icns; do $(INSTALL_DATA) "$(MAC_OSX_DIR)/$$i" "$(LIB_INSTALL_DIR)/Resources"; done'
@@ -729,6 +734,7 @@ if test "$FRAMEWORK_BUILD" = "1" ; then
EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing Wish.icns to $(BIN_INSTALL_DIR)/../Resources" && $(INSTALL_DATA_DIR) "$(BIN_INSTALL_DIR)/../Resources"'
EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && $(INSTALL_DATA) "$(MAC_OSX_DIR)/Tk.icns" "$(BIN_INSTALL_DIR)/../Resources/Wish.icns"'
EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing Wish.sdef to $(BIN_INSTALL_DIR)/../Resources" && $(INSTALL_DATA) "$(MAC_OSX_DIR)/Wish.sdef" "$(BIN_INSTALL_DIR)/../Resources"'
EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing Credits.html to $(BIN_INSTALL_DIR)/../Resources" && $(INSTALL_DATA) Credits.html "$(BIN_INSTALL_DIR)/../Resources"'
fi
EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Finalizing Tk.framework" && rm -f "$(LIB_INSTALL_DIR)/../Current" && ln -s "$(VERSION)" "$(LIB_INSTALL_DIR)/../Current" && for f in "$(LIB_FILE)" tkConfig.sh Resources Headers PrivateHeaders; do rm -f "$(LIB_INSTALL_DIR)/../../$$f" && ln -s "Versions/Current/$$f" "$(LIB_INSTALL_DIR)/../.."; done && f="$(STUB_LIB_FILE)" && rm -f "$(LIB_INSTALL_DIR)/../../$$f" && ln -s "Versions/$(VERSION)/$$f" "$(LIB_INSTALL_DIR)/../.."'
# Don't use AC_DEFINE for the following as the framework version define

View File

@@ -1,7 +1,7 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2011-04-20.01; # UTC
scriptversion=2020-07-26.22; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
@@ -35,25 +35,21 @@ scriptversion=2011-04-20.01; # UTC
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# 'make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch.
tab=' '
nl='
'
IFS=" "" $nl"
IFS=" $tab$nl"
# set DOITPROG to echo to test this script
# Set DOITPROG to "echo" to test this script.
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit=${DOITPROG-}
if test -z "$doit"; then
doit_exec=exec
else
doit_exec=$doit
fi
doit_exec=${doit:-exec}
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
@@ -68,22 +64,15 @@ mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}
posix_glob='?'
initialize_posix_glob='
test "$posix_glob" != "?" || {
if (set -f) 2>/dev/null; then
posix_glob=
else
posix_glob=:
fi
}
'
posix_mkdir=
# Desired mode of installed file.
mode=0755
# Create dirs (including intermediate dirs) using mode 755.
# This is like GNU 'install' as of coreutils 8.32 (2020).
mkdir_umask=22
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
@@ -97,7 +86,7 @@ dir_arg=
dst_arg=
copy_on_change=false
no_target_directory=
is_target_a_directory=possibly
usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
@@ -120,7 +109,7 @@ Options:
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-S $stripprog installed files.
-S OPTION $stripprog installed files using OPTION.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
@@ -138,45 +127,60 @@ while test $# -ne 0; do
-d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2"
shift;;
shift;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
case $mode in
*' '* | *' '* | *'
'* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
shift;;
case $mode in
*' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
shift;;
-o) chowncmd="$chownprog $2"
shift;;
shift;;
-s) stripcmd=$stripprog;;
-S) stripcmd="$stripprog $2"
shift;;
shift;;
-t) dst_arg=$2
shift;;
-t)
is_target_a_directory=always
dst_arg=$2
# Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
shift;;
-T) no_target_directory=true;;
-T) is_target_a_directory=never;;
--version) echo "$0 $scriptversion"; exit $?;;
--) shift
break;;
--) shift
break;;
-*) echo "$0: invalid option: $1" >&2
exit 1;;
-*) echo "$0: invalid option: $1" >&2
exit 1;;
*) break;;
esac
shift
done
# We allow the use of options -d and -T together, by making -d
# take the precedence; this is for compatibility with GNU install.
if test -n "$dir_arg"; then
if test -n "$dst_arg"; then
echo "$0: target directory not allowed when installing a directory." >&2
exit 1
fi
fi
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
@@ -190,6 +194,10 @@ if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
fi
shift # arg
dst_arg=$arg
# Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
done
fi
@@ -198,11 +206,20 @@ if test $# -eq 0; then
echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call `install-sh -d' without argument.
# It's OK to call 'install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
if test -z "$dir_arg"; then
if test $# -gt 1 || test "$is_target_a_directory" = always; then
if test ! -d "$dst_arg"; then
echo "$0: $dst_arg: Is not a directory." >&2
exit 1
fi
fi
fi
if test -z "$dir_arg"; then
do_exit='(exit $ret); exit $ret'
trap "ret=129; $do_exit" 1
@@ -219,16 +236,16 @@ if test -z "$dir_arg"; then
*[0-7])
if test -z "$stripcmd"; then
u_plus_rw=
u_plus_rw=
else
u_plus_rw='% 200'
u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
u_plus_rw=
u_plus_rw=
else
u_plus_rw=,u+rw
u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
@@ -236,9 +253,9 @@ fi
for src
do
# Protect names starting with `-'.
# Protect names problematic for 'test' and other utilities.
case $src in
-*) src=./$src;;
-* | [=\(\)!]) src=./$src;;
esac
if test -n "$dir_arg"; then
@@ -260,185 +277,150 @@ do
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dst_arg
# Protect names starting with `-'.
case $dst in
-*) dst=./$dst;;
esac
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
# If destination is a directory, append the input filename.
if test -d "$dst"; then
if test -n "$no_target_directory"; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
if test "$is_target_a_directory" = never; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
dst=$dstdir/`basename "$src"`
dstbase=`basename "$src"`
case $dst in
*/) dst=$dst$dstbase;;
*) dst=$dst/$dstbase;;
esac
dstdir_status=0
else
# Prefer dirname, but fall back on a substitute if dirname fails.
dstdir=`
(dirname "$dst") 2>/dev/null ||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$dst" : 'X\(//\)[^/]' \| \
X"$dst" : 'X\(//\)$' \| \
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$dst" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'
`
dstdir=`dirname "$dst"`
test -d "$dstdir"
dstdir_status=$?
fi
fi
case $dstdir in
*/) dstdirslash=$dstdir;;
*) dstdirslash=$dstdir/;;
esac
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
# Create intermediate dirs using mode 755 as modified by the umask.
# This is like FreeBSD 'install' as of 1997-10-28.
umask=`umask`
case $stripcmd.$umask in
# Optimize common cases.
*[2367][2367]) mkdir_umask=$umask;;
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
mkdir_mode=-m$mode
else
mkdir_mode=
fi
*[0-7])
mkdir_umask=`expr $umask + 22 \
- $umask % 100 % 40 + $umask % 20 \
- $umask % 10 % 4 + $umask % 2
`;;
*) mkdir_umask=$umask,go-w;;
esac
posix_mkdir=false
# The $RANDOM variable is not portable (e.g., dash). Use it
# here however when possible just to lower collision chance.
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
mkdir_mode=-m$mode
trap '
ret=$?
rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null
exit $ret
' 0
# Because "mkdir -p" follows existing symlinks and we likely work
# directly in world-writeable /tmp, make sure that the '$tmpdir'
# directory is successfully created first before we actually test
# 'mkdir -p'.
if (umask $mkdir_umask &&
$mkdirprog $mkdir_mode "$tmpdir" &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
test_tmpdir="$tmpdir/a"
ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
else
mkdir_mode=
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
fi
posix_mkdir=false
case $umask in
*[123567][0-7][0-7])
# POSIX mkdir -p sets u+wx bits regardless of umask, which
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
if (umask $mkdir_umask &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writeable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/d" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
fi
trap '' 0;;
esac;;
trap '' 0;;
esac
if
$posix_mkdir && (
umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
# The umask is ridiculous, or mkdir does not conform to POSIX,
# mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
/*) prefix='/';;
-*) prefix='./';;
*) prefix='';;
/*) prefix='/';;
[-=\(\)!]*) prefix='./';;
*) prefix='';;
esac
eval "$initialize_posix_glob"
oIFS=$IFS
IFS=/
$posix_glob set -f
set -f
set fnord $dstdir
shift
$posix_glob set +f
set +f
IFS=$oIFS
prefixes=
for d
do
test -z "$d" && continue
test X"$d" = X && continue
prefix=$prefix$d
if test -d "$prefix"; then
prefixes=
else
if $posix_mkdir; then
(umask=$mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
else
case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*) qprefix=$prefix;;
esac
prefixes="$prefixes '$qprefix'"
fi
fi
prefix=$prefix/
prefix=$prefix$d
if test -d "$prefix"; then
prefixes=
else
if $posix_mkdir; then
(umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
else
case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*) qprefix=$prefix;;
esac
prefixes="$prefixes '$qprefix'"
fi
fi
prefix=$prefix/
done
if test -n "$prefixes"; then
# Don't fail if two instances are running concurrently.
(umask $mkdir_umask &&
eval "\$doit_exec \$mkdirprog $prefixes") ||
test -d "$dstdir" || exit 1
obsolete_mkdir_used=true
# Don't fail if two instances are running concurrently.
(umask $mkdir_umask &&
eval "\$doit_exec \$mkdirprog $prefixes") ||
test -d "$dstdir" || exit 1
obsolete_mkdir_used=true
fi
fi
fi
@@ -451,14 +433,25 @@ do
else
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
dsttmp=${dstdirslash}_inst.$$_
rmtmp=${dstdirslash}_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
(umask $cp_umask &&
{ test -z "$stripcmd" || {
# Create $dsttmp read-write so that cp doesn't create it read-only,
# which would cause strip to fail.
if test -z "$doit"; then
: >"$dsttmp" # No need to fork-exec 'touch'.
else
$doit touch "$dsttmp"
fi
}
} &&
$doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
@@ -473,15 +466,12 @@ do
# If -C, don't bother to copy if it wouldn't change the file.
if $copy_on_change &&
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
eval "$initialize_posix_glob" &&
$posix_glob set -f &&
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
set -f &&
set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 &&
$posix_glob set +f &&
set +f &&
test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then
@@ -494,24 +484,24 @@ do
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
{
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
test ! -f "$dst" ||
$doit $rmcmd -f "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
} &&
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
test ! -f "$dst" ||
$doit $rmcmd -f "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
}
fi || exit 1
@@ -520,9 +510,9 @@ do
done
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
# End:

View File

@@ -43,7 +43,7 @@ if test -f $ManPage ; then : ; else
echo "source manual page file must exist"
exit 1
fi
if test -d $Dir ; then : ; else
if test -d "$Dir" ; then : ; else
echo "target directory must exist"
exit 1
fi
@@ -99,7 +99,7 @@ SrcDir=`dirname $ManPage`
### Process Page to Create Target Pages
###
Specials="FindPhoto FontId MeasureChar"
Specials="DString Thread Notifier RegExp library packagens pkgMkIndex safesock FindPhoto FontId MeasureChar"
for n in $Specials; do
if [ "$Name" = "$n" ] ; then
Names="$n $Names"
@@ -109,15 +109,15 @@ done
First=""
for Target in $Names; do
Target=$Target.$Section$Suffix
rm -f $Dir/$Target $Dir/$Target.*
rm -f "$Dir/$Target" "$Dir/$Target.*"
if test -z "$First" ; then
First=$Target
sed -e "/man\.macros/r $SrcDir/man.macros" -e "/man\.macros/d" \
$ManPage > $Dir/$First
chmod 644 $Dir/$First
$Gzip $Dir/$First
$ManPage > "$Dir/$First"
chmod 644 "$Dir/$First"
$Gzip "$Dir/$First"
else
ln $SymOrLoc$First$Gz $Dir/$Target$Gz
ln $SymOrLoc"$First$Gz" "$Dir/$Target$Gz"
fi
done

View File

@@ -293,10 +293,6 @@ AC_DEFUN([SC_LOAD_TCLCONFIG], [
AC_MSG_RESULT([could not find ${TCL_BIN_DIR}/tclConfig.sh])
fi
# eval is required to do the TCL_DBGX substitution
eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\""
eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\""
# If the TCL_BIN_DIR is the build directory (not the install directory),
# then set the common variable name to the value of the build variables.
# For example, the variable TCL_LIB_SPEC will be set to the value
@@ -330,12 +326,6 @@ AC_DEFUN([SC_LOAD_TCLCONFIG], [
esac
fi
# eval is required to do the TCL_DBGX substitution
eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\""
eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\""
eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\""
eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\""
AC_SUBST(TCL_VERSION)
AC_SUBST(TCL_PATCH_LEVEL)
AC_SUBST(TCL_BIN_DIR)
@@ -376,10 +366,6 @@ AC_DEFUN([SC_LOAD_TKCONFIG], [
AC_MSG_RESULT([could not find ${TK_BIN_DIR}/tkConfig.sh])
fi
# eval is required to do the TK_DBGX substitution
eval "TK_LIB_FILE=\"${TK_LIB_FILE}\""
eval "TK_STUB_LIB_FILE=\"${TK_STUB_LIB_FILE}\""
# If the TK_BIN_DIR is the build directory (not the install directory),
# then set the common variable name to the value of the build variables.
# For example, the variable TK_LIB_SPEC will be set to the value
@@ -413,12 +399,6 @@ AC_DEFUN([SC_LOAD_TKCONFIG], [
esac
fi
# eval is required to do the TK_DBGX substitution
eval "TK_LIB_FLAG=\"${TK_LIB_FLAG}\""
eval "TK_LIB_SPEC=\"${TK_LIB_SPEC}\""
eval "TK_STUB_LIB_FLAG=\"${TK_STUB_LIB_FLAG}\""
eval "TK_STUB_LIB_SPEC=\"${TK_STUB_LIB_SPEC}\""
AC_SUBST(TK_VERSION)
AC_SUBST(TK_BIN_DIR)
AC_SUBST(TK_SRC_DIR)
@@ -531,14 +511,6 @@ AC_DEFUN([SC_ENABLE_SHARED], [
AC_HELP_STRING([--enable-shared],
[build and link with shared libraries (default: on)]),
[tcl_ok=$enableval], [tcl_ok=yes])
if test "${enable_shared+set}" = set; then
enableval="$enable_shared"
tcl_ok=$enableval
else
tcl_ok=yes
fi
if test "$tcl_ok" = "yes" ; then
AC_MSG_RESULT([shared])
SHARED_BUILD=1
@@ -730,8 +702,6 @@ AC_DEFUN([SC_ENABLE_THREADS], [
# Sets to $(CFLAGS_OPTIMIZE) if false
# LDFLAGS_DEFAULT Sets to $(LDFLAGS_DEBUG) if true
# Sets to $(LDFLAGS_OPTIMIZE) if false
# DBGX Formerly used as debug library extension;
# always blank now.
#------------------------------------------------------------------------
AC_DEFUN([SC_ENABLE_SYMBOLS], [
@@ -741,7 +711,6 @@ AC_DEFUN([SC_ENABLE_SYMBOLS], [
[build with debugging symbols (default: off)]),
[tcl_ok=$enableval], [tcl_ok=no])
# FIXME: Currently, LDFLAGS_DEFAULT is not used, it should work like CFLAGS_DEFAULT.
DBGX=""
if test "$tcl_ok" = "no"; then
CFLAGS_DEFAULT='$(CFLAGS_OPTIMIZE)'
LDFLAGS_DEFAULT='$(LDFLAGS_OPTIMIZE)'
@@ -1103,7 +1072,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
CFLAGS_DEBUG=-g
AS_IF([test "$GCC" = yes], [
CFLAGS_OPTIMIZE=-O2
CFLAGS_WARNING="-Wall"
CFLAGS_WARNING="-Wall -Wpointer-arith"
], [
CFLAGS_OPTIMIZE=-O
CFLAGS_WARNING=""
@@ -1212,7 +1181,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
;;
CYGWIN_*|MINGW32*)
CYGWIN_*|MINGW32_*|MSYS_*)
SHLIB_CFLAGS=""
SHLIB_LD='${CC} -shared'
SHLIB_SUFFIX=".dll"
@@ -1223,7 +1192,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
TCL_NEEDS_EXP_FILE=1
TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.dll.a'
TCL_EXPORT_FILE_SUFFIX='${VERSION}.dll.a'
SHLIB_LD_LIBS="${SHLIB_LD_LIBS} -Wl,--out-implib,\$[@].a"
AC_CACHE_CHECK(for Cygwin version of gcc,
ac_cv_cygwin,
@@ -1312,7 +1281,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
do64bit_ok=yes
SHLIB_LD='${CC} -shared'
AS_IF([test $doRpath = yes], [
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'])
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
;;
*)
@@ -1347,7 +1316,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
DL_LIBS=""
AC_LIBOBJ(mkstemp)
AS_IF([test $doRpath = yes], [
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'])
;;
IRIX-6.*)
@@ -1358,7 +1327,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
DL_LIBS=""
AC_LIBOBJ(mkstemp)
AS_IF([test $doRpath = yes], [
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'])
AS_IF([test "$GCC" = yes], [
CFLAGS="$CFLAGS -mabi=n32"
@@ -1384,7 +1353,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
DL_LIBS=""
AC_LIBOBJ(mkstemp)
AS_IF([test $doRpath = yes], [
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'])
# Check to enable 64-bit flags for compiler/linker
@@ -1415,7 +1384,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
DL_LIBS="-ldl"
LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
AS_IF([test $doRpath = yes], [
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'])
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
AS_IF([test "`uname -m`" = "alpha"], [CFLAGS="$CFLAGS -mieee"])
AS_IF([test $do64bit = yes], [
@@ -1447,8 +1416,8 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
DL_LIBS="-mshared -ldl"
LD_FLAGS="-Wl,--export-dynamic"
AS_IF([test $doRpath = yes], [
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
LD_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'])
;;
MP-RAS-02*)
SHLIB_CFLAGS="-K PIC"
@@ -1486,7 +1455,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
AS_IF([test $doRpath = yes], [
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'])
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so${SHLIB_VERSION}'
LDFLAGS="-Wl,-export-dynamic"
@@ -1510,7 +1479,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
DL_LIBS=""
LDFLAGS="$LDFLAGS -export-dynamic"
AS_IF([test $doRpath = yes], [
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'])
LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS}
AS_IF([test "${TCL_THREADS}" = "1"], [
# The -pthread needs to go in the CFLAGS, not LIBS
@@ -1527,10 +1496,9 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
SHLIB_SUFFIX=".so"
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
LDFLAGS=""
AS_IF([test $doRpath = yes], [
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
LD_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'])
CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
LD_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'])
AS_IF([test "${TCL_THREADS}" = "1"], [
# The -pthread needs to go in the LDFLAGS, not LIBS
LIBS=`echo $LIBS | sed s/-pthread//`
@@ -1619,6 +1587,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
AS_IF([test "$tcl_cv_cc_visibility_hidden" != yes], [
AC_DEFINE(MODULE_SCOPE, [__private_extern__],
[Compiler support for module scope symbols])
tcl_cv_cc_visibility_hidden=yes
])
CC_SEARCH_FLAGS=""
LD_SEARCH_FLAGS=""
@@ -1733,7 +1702,7 @@ AC_DEFUN([SC_CONFIG_CFLAGS], [
DL_OBJS="tclLoadDl.o"
DL_LIBS=""
AS_IF([test $doRpath = yes], [
CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}'
CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}'])
AS_IF([test "$GCC" = yes], [CFLAGS="$CFLAGS -mieee"], [
CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee"])
@@ -2009,7 +1978,7 @@ dnl # preprocessing tests use only CPPFLAGS.
case $system in
AIX-*) ;;
BSD/OS*) ;;
CYGWIN_*|MINGW32_*) ;;
CYGWIN_*|MINGW32_*|MSYS_*) ;;
IRIX*) ;;
NetBSD-*|DragonFly-*|FreeBSD-*|OpenBSD-*) ;;
Darwin-*) ;;
@@ -2030,7 +1999,7 @@ dnl # preprocessing tests use only CPPFLAGS.
AS_IF([test "${SHARED_BUILD}" = 1 -a "${SHLIB_SUFFIX}" != ""], [
LIB_SUFFIX=${SHARED_LIB_SUFFIX}
MAKE_LIB='${SHLIB_LD} -o [$]@ ${OBJS} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS}'
MAKE_LIB='${SHLIB_LD} -o [$]@ ${OBJS} ${LDFLAGS} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS}'
AS_IF([test "${SHLIB_SUFFIX}" = ".dll"], [
INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(BIN_INSTALL_DIR)/$(LIB_FILE)";if test -f $(LIB_FILE).a; then $(INSTALL_DATA) $(LIB_FILE).a "$(LIB_INSTALL_DIR)"; fi;'
DLL_INSTALL_DIR="\$(BIN_INSTALL_DIR)"
@@ -2137,13 +2106,13 @@ dnl # preprocessing tests use only CPPFLAGS.
#
# Defines some of the following vars:
# NO_DIRENT_H
# NO_FLOAT_H
# NO_VALUES_H
# NO_STDLIB_H
# NO_STRING_H
# NO_SYS_WAIT_H
# NO_DLFCN_H
# HAVE_SYS_PARAM_H
#
# HAVE_STRING_H ?
#
#--------------------------------------------------------------------
@@ -2362,7 +2331,7 @@ AC_DEFUN([SC_TIME_HANDLER], [
fi
AC_CACHE_CHECK([tm_gmtoff in struct tm], tcl_cv_member_tm_gmtoff, [
AC_TRY_COMPILE([#include <time.h>], [struct tm tm; tm.tm_gmtoff;],
AC_TRY_COMPILE([#include <time.h>], [struct tm tm; (void)tm.tm_gmtoff;],
tcl_cv_member_tm_gmtoff=yes, tcl_cv_member_tm_gmtoff=no)])
if test $tcl_cv_member_tm_gmtoff = yes ; then
AC_DEFINE(HAVE_TM_GMTOFF, 1, [Should we use the tm_gmtoff field of struct tm?])
@@ -2651,7 +2620,10 @@ AC_DEFUN([SC_TCL_CHECK_BROKEN_FUNC],[
AC_CHECK_FUNC($1, tcl_ok=1, tcl_ok=0)
if test ["$tcl_ok"] = 1; then
AC_CACHE_CHECK([proper ]$1[ implementation], [tcl_cv_]$1[_unbroken],
AC_TRY_RUN([[int main() {]$2[}]],[tcl_cv_]$1[_unbroken]=ok,
AC_TRY_RUN([[
#include <stdlib.h>
#include <string.h>
int main() {]$2[}]],[tcl_cv_]$1[_unbroken]=ok,
[tcl_cv_]$1[_unbroken]=broken,[tcl_cv_]$1[_unbroken]=unknown))
if test ["$tcl_cv_]$1[_unbroken"] = "ok"; then
tcl_ok=1

View File

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

View File

@@ -15,9 +15,16 @@
#undef BUILD_tk
#undef STATIC_BUILD
#include "tk.h"
#include "tkPort.h"
#ifdef TK_TEST
#ifdef __cplusplus
extern "C" {
#endif
extern Tcl_PackageInitProc Tktest_Init;
#ifdef __cplusplus
}
#endif
#endif /* TK_TEST */
/*
@@ -30,7 +37,11 @@ extern Tcl_PackageInitProc Tktest_Init;
#define TK_LOCAL_APPINIT Tcl_AppInit
#endif
#ifndef MODULE_SCOPE
# define MODULE_SCOPE extern
# ifdef __cplusplus
# define MODULE_SCOPE extern "C"
# else
# define MODULE_SCOPE extern
# endif
#endif
MODULE_SCOPE int TK_LOCAL_APPINIT(Tcl_Interp *);
MODULE_SCOPE int main(int, char **);
@@ -111,6 +122,13 @@ Tcl_AppInit(
}
Tcl_StaticPackage(interp, "Tk", Tk_Init, Tk_SafeInit);
#if defined(USE_CUSTOM_EXIT_PROC)
if (TkpWantsExitProc()) {
/* The cast below avoids warnings from old gcc compilers. */
Tcl_SetExitProc((void *)TkpExitProc);
}
#endif
#ifdef TK_TEST
if (Tktest_Init(interp) == TCL_ERROR) {
return TCL_ERROR;

View File

@@ -16,7 +16,7 @@
# include <X11/extensions/scrnsaver.h>
# ifdef __APPLE__
/* Support for weak-linked libXss. */
# define HaveXSSLibrary() (XScreenSaverQueryInfo != NULL)
# define HaveXSSLibrary() (&XScreenSaverQueryInfo != NULL)
# else
/* Other platforms always link libXss. */
# define HaveXSSLibrary() (1)

View File

@@ -173,7 +173,7 @@ TkpDrawCheckIndicator(
* Sanity check.
*/
if (tkwin == NULL || display == None || d == None || bgBorder == NULL
if (tkwin == NULL || display == NULL || d == None || bgBorder == NULL
|| indicatorColor == NULL) {
return;
}
@@ -326,11 +326,9 @@ TkpDrawCheckIndicator(
TkButton *
TkpCreateButton(
Tk_Window tkwin)
TCL_UNUSED(Tk_Window))
{
UnixButton *butPtr = ckalloc(sizeof(UnixButton));
return (TkButton *) butPtr;
return (TkButton *)ckalloc(sizeof(UnixButton));
}
/*
@@ -396,7 +394,7 @@ void
TkpDisplayButton(
ClientData clientData) /* Information about widget. */
{
register TkButton *butPtr = (TkButton *) clientData;
TkButton *butPtr = (TkButton *)clientData;
GC gc;
Tk_3DBorder border;
Pixmap pixmap;
@@ -807,8 +805,6 @@ TkpDisplayButton(
butPtr->borderWidth, relief);
}
if (butPtr->highlightWidth > 0) {
GC gc;
if (butPtr->flags & GOT_FOCUS) {
gc = Tk_GCForColor(butPtr->highlightColorPtr, pixmap);
} else {
@@ -860,7 +856,7 @@ TkpDisplayButton(
void
TkpComputeButtonGeometry(
register TkButton *butPtr) /* Button whose geometry may have changed. */
TkButton *butPtr) /* Button whose geometry may have changed. */
{
int width, height, avgWidth, txtWidth, txtHeight;
int haveImage = 0, haveText = 0;

View File

@@ -136,17 +136,17 @@ TkpGetColor(
if (*name != '#') {
XColor screen;
if (((*name - 'A') & 0xdf) < sizeof(tkWebColors)/sizeof(tkWebColors[0])) {
if (!((name[0] - 'G') & 0xdf) && !((name[1] - 'R') & 0xdf)
&& !((name[2] - 'A') & 0xdb) && !((name[3] - 'Y') & 0xdf)
if (((*name - 'A') & 0xDF) < sizeof(tkWebColors)/sizeof(tkWebColors[0])) {
if (!((name[0] - 'G') & 0xDF) && !((name[1] - 'R') & 0xDF)
&& !((name[2] - 'A') & 0xDB) && !((name[3] - 'Y') & 0xDF)
&& !name[4]) {
name = "#808080808080";
goto gotWebColor;
} else {
const char *p = tkWebColors[((*name - 'A') & 0x1f)];
const char *p = tkWebColors[((*name - 'A') & 0x1F)];
if (p) {
const char *q = name;
while (!((*p - *(++q)) & 0xdf)) {
while (!((*p - *(++q)) & 0xDF)) {
if (!*p++) {
name = p;
goto gotWebColor;

View File

@@ -245,7 +245,7 @@ TkGetCursorByName(
if ((argv[0][0] != '@') && !inTkTable) {
XColor fg, bg;
unsigned int maskIndex;
register const struct CursorName *namePtr;
const struct CursorName *namePtr;
TkDisplay *dispPtr;
/*

View File

@@ -360,9 +360,6 @@ TransferXEventsToTcl(
int type;
XEvent x;
TkKeyEvent k;
#ifdef GenericEvent
xGenericEvent xge;
#endif
} event;
Window w;
TkDisplay *dispPtr = NULL;
@@ -380,12 +377,9 @@ TransferXEventsToTcl(
while (QLength(display) > 0) {
XNextEvent(display, &event.x);
#ifdef GenericEvent
if (event.type == GenericEvent) {
Tcl_Panic("Wild GenericEvent; panic! (extension=%d,evtype=%d)",
event.xge.extension, event.xge.evtype);
if (event.type > MappingNotify) {
continue;
}
#endif
w = None;
if (event.type == KeyPress || event.type == KeyRelease) {
for (dispPtr = TkGetDisplayList(); ; dispPtr = dispPtr->nextPtr) {
@@ -514,9 +508,9 @@ DisplayFileProc(
* nice (?!) message.
*/
void (*oldHandler)();
void (*oldHandler)(int);
oldHandler = (void (*)()) signal(SIGPIPE, SIG_IGN);
oldHandler = (void (*)(int)) signal(SIGPIPE, SIG_IGN);
XNoOp(display);
XFlush(display);
(void) signal(SIGPIPE, oldHandler);

View File

@@ -12,15 +12,13 @@
#include "tkUnixInt.h"
#include "tkFont.h"
#include <netinet/in.h> /* for htons() prototype */
#include <arpa/inet.h> /* inet_ntoa() */
/*
* The preferred font encodings.
*/
static const char *const encodingList[] = {
"iso8859-1", "jis0208", "jis0212", NULL
static const char encodingList[][10] = {
"iso8859-1", "jis0208", "jis0212"
};
/*
@@ -38,11 +36,12 @@ static const char *const encodingList[] = {
#define FONTMAP_SHIFT 10
#define FONTMAP_BITSPERPAGE (1 << FONTMAP_SHIFT)
#define FONTMAP_PAGES (0x30000 / FONTMAP_BITSPERPAGE)
#define FONTMAP_NUMCHARS 0x40000
#define FONTMAP_PAGES (FONTMAP_NUMCHARS / FONTMAP_BITSPERPAGE)
typedef struct FontFamily {
struct FontFamily *nextPtr; /* Next in list of all known font families. */
int refCount; /* How many SubFonts are referring to this
size_t refCount; /* How many SubFonts are referring to this
* FontFamily. When the refCount drops to
* zero, this FontFamily may be freed. */
/*
@@ -63,7 +62,7 @@ typedef struct FontFamily {
/* Two-level sparse table used to determine
* quickly if the specified character exists.
* As characters are encountered, more pages
* in this table are dynamically alloced. The
* in this table are dynamically allocated. The
* contents of each page is a bitmask
* consisting of FONTMAP_BITSPERPAGE bits,
* representing whether this font can be used
@@ -194,7 +193,7 @@ static const EncodingAlias encodingAliases[] = {
* Functions used only in this file.
*/
static void FontPkgCleanup(ClientData clientData);
static void FontPkgCleanup(void *clientData);
static FontFamily * AllocFontFamily(Display *display,
XFontStruct *fontStructPtr, int base);
static SubFont * CanUseFallback(UnixFont *fontPtr,
@@ -204,7 +203,7 @@ static SubFont * CanUseFallbackWithAliases(UnixFont *fontPtr,
const char *fallbackName, int ch,
Tcl_DString *nameTriedPtr,
SubFont **fixSubFontPtrPtr);
static int ControlUtfProc(ClientData clientData, const char *src,
static int ControlUtfProc(void *clientData, const char *src,
int srcLen, int flags, Tcl_EncodingState*statePtr,
char *dst, int dstLen, int *srcReadPtr,
int *dstWrotePtr, int *dstCharsPtr);
@@ -239,11 +238,11 @@ static unsigned RankAttributes(FontAttributes *wantPtr,
static void ReleaseFont(UnixFont *fontPtr);
static void ReleaseSubFont(Display *display, SubFont *subFontPtr);
static int SeenName(const char *name, Tcl_DString *dsPtr);
static int Ucs2beToUtfProc(ClientData clientData, const char*src,
static int Ucs2beToUtfProc(void *clientData, const char*src,
int srcLen, int flags, Tcl_EncodingState*statePtr,
char *dst, int dstLen, int *srcReadPtr,
int *dstWrotePtr, int *dstCharsPtr);
static int UtfToUcs2beProc(ClientData clientData, const char*src,
static int UtfToUcs2beProc(void *clientData, const char*src,
int srcLen, int flags, Tcl_EncodingState*statePtr,
char *dst, int dstLen, int *srcReadPtr,
int *dstWrotePtr, int *dstCharsPtr);
@@ -268,9 +267,9 @@ static int UtfToUcs2beProc(ClientData clientData, const char*src,
static void
FontPkgCleanup(
ClientData clientData)
TCL_UNUSED(void *))
{
ThreadSpecificData *tsdPtr =
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (tsdPtr->controlFamily.encoding != NULL) {
@@ -307,9 +306,9 @@ FontPkgCleanup(
void
TkpFontPkgInit(
TkMainInfo *mainPtr) /* The application being created. */
TCL_UNUSED(TkMainInfo *)) /* The application being created. */
{
ThreadSpecificData *tsdPtr =
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
SubFont dummy;
int i;
@@ -363,11 +362,11 @@ TkpFontPkgInit(
static int
ControlUtfProc(
ClientData clientData, /* Not used. */
TCL_UNUSED(void *), /* Not used. */
const char *src, /* Source string in UTF-8. */
int srcLen, /* Source string length in bytes. */
int flags, /* Conversion control flags. */
Tcl_EncodingState *statePtr,/* Place for conversion routine to store state
TCL_UNUSED(int), /* Conversion control flags. */
TCL_UNUSED(Tcl_EncodingState *),/* Place for conversion routine to store state
* information used during a piecewise
* conversion. Contents of statePtr are
* initialized and/or reset by conversion
@@ -391,8 +390,8 @@ ControlUtfProc(
const char *srcStart, *srcEnd;
char *dstStart, *dstEnd;
int ch, result;
static char hexChars[] = "0123456789abcdef";
static char mapChars[] = {
static const char hexChars[] = "0123456789abcdef";
static const char mapChars[] = {
0, 0, 0, 0, 0, 0, 0,
'a', 'b', 't', 'n', 'v', 'f', 'r'
};
@@ -417,15 +416,15 @@ ControlUtfProc(
dst += 2;
} else if ((size_t)ch < 256) {
dst[1] = 'x';
dst[2] = hexChars[(ch >> 4) & 0xf];
dst[3] = hexChars[ch & 0xf];
dst[2] = hexChars[(ch >> 4) & 0xF];
dst[3] = hexChars[ch & 0xF];
dst += 4;
} else if ((size_t)ch < 0x10000) {
dst[1] = 'u';
dst[2] = hexChars[(ch >> 12) & 0xf];
dst[3] = hexChars[(ch >> 8) & 0xf];
dst[4] = hexChars[(ch >> 4) & 0xf];
dst[5] = hexChars[ch & 0xf];
dst[2] = hexChars[(ch >> 12) & 0xF];
dst[3] = hexChars[(ch >> 8) & 0xF];
dst[4] = hexChars[(ch >> 4) & 0xF];
dst[5] = hexChars[ch & 0xF];
dst += 6;
} else {
/* TODO we can do better here */
@@ -461,11 +460,11 @@ ControlUtfProc(
static int
Ucs2beToUtfProc(
ClientData clientData, /* Not used. */
TCL_UNUSED(void *), /* Not used. */
const char *src, /* Source string in Unicode. */
int srcLen, /* Source string length in bytes. */
int flags, /* Conversion control flags. */
Tcl_EncodingState *statePtr,/* Place for conversion routine to store state
TCL_UNUSED(Tcl_EncodingState *),/* Place for conversion routine to store state
* information used during a piecewise
* conversion. Contents of statePtr are
* initialized and/or reset by conversion
@@ -487,9 +486,13 @@ Ucs2beToUtfProc(
* output buffer. */
{
const char *srcStart, *srcEnd;
char *dstEnd, *dstStart;
int result, numChars;
const char *dstEnd, *dstStart;
int result, numChars, charLimit = INT_MAX;
unsigned short ch;
if (flags & TCL_ENCODING_CHAR_LIMIT) {
charLimit = *dstCharsPtr;
}
result = TCL_OK;
/* check alignment with ucs-2 (2 == sizeof(UCS-2)) */
@@ -507,21 +510,26 @@ Ucs2beToUtfProc(
srcEnd = src + srcLen;
dstStart = dst;
dstEnd = dst + dstLen - TCL_UTF_MAX;
dstEnd = dst + dstLen - 4;
for (numChars = 0; src < srcEnd; numChars++) {
for (numChars = 0; src < srcEnd && numChars <= charLimit; numChars++) {
if (dst > dstEnd) {
result = TCL_CONVERT_NOSPACE;
break;
}
/*
* Need to swap byte-order on little-endian machines (x86) for
* UCS-2BE. We know this is an LE->BE swap.
*/
ch = (src[0] & 0xFF) << 8 | (src[1] & 0xFF);
src += 2 /* sizeof(UTF-16) */;
dst += TkUniCharToUtf(htons(*((short *)src)), dst);
src += 2 /* sizeof(UCS-2) */;
/*
* Special case for 1-byte utf chars for speed. Make sure we work with
* unsigned short-size data.
*/
if (ch && ch < 0x80) {
*dst++ = (ch & 0xFF);
} else {
dst += Tcl_UniCharToUtf(ch, dst);
}
}
*srcReadPtr = src - srcStart;
@@ -548,12 +556,12 @@ Ucs2beToUtfProc(
static int
UtfToUcs2beProc(
ClientData clientData, /* TableEncodingData that specifies
TCL_UNUSED(void *), /* TableEncodingData that specifies
* encoding. */
const char *src, /* Source string in UTF-8. */
int srcLen, /* Source string length in bytes. */
int flags, /* Conversion control flags. */
Tcl_EncodingState *statePtr,/* Place for conversion routine to store state
TCL_UNUSED(Tcl_EncodingState *),/* Place for conversion routine to store state
* information used during a piecewise
* conversion. Contents of statePtr are
* initialized and/or reset by conversion
@@ -576,17 +584,13 @@ UtfToUcs2beProc(
{
const char *srcStart, *srcEnd, *srcClose, *dstStart, *dstEnd;
int result, numChars;
Tcl_UniChar *chPtr = (Tcl_UniChar *)statePtr;
if (flags & TCL_ENCODING_START) {
*statePtr = 0;
}
int ch;
srcStart = src;
srcEnd = src + srcLen;
srcClose = srcEnd;
if (!(flags & TCL_ENCODING_END)) {
srcClose -= TCL_UTF_MAX;
srcClose -= 6;
}
dstStart = dst;
@@ -606,17 +610,17 @@ UtfToUcs2beProc(
result = TCL_CONVERT_NOSPACE;
break;
}
src += Tcl_UtfToUniChar(src, chPtr);
src += TkUtfToUniChar(src, &ch);
if (ch > 0xFFFF) {
ch = 0xFFFD;
}
/*
* Ensure big-endianness (store big bits first).
* XXX: This hard-codes the assumed size of Tcl_UniChar as 2. Make
* sure to work in char* for Tcl_UtfToUniChar alignment. [Bug 1122671]
*/
*dst++ = (char)(*chPtr >> 8);
*dst++ = (char)*chPtr;
*dst++ = (char)((ch >> 8) & 0xFF);
*dst++ = (char)(ch & 0xFF);
}
*srcReadPtr = src - srcStart;
*dstWrotePtr = dst - dstStart;
@@ -701,7 +705,7 @@ TkpGetNativeFont(
if (name[0] == '-') {
if (name[1] != '*') {
char *dash;
const char *dash;
dash = strchr(name + 1, '-');
if ((dash == NULL) || (isspace(UCHAR(dash[-1])))) {
@@ -716,7 +720,7 @@ TkpGetNativeFont(
}
fontStructPtr = CreateClosestFont(tkwin, &fa.fa, &fa.xa);
}
fontPtr = ckalloc(sizeof(UnixFont));
fontPtr = (UnixFont *)ckalloc(sizeof(UnixFont));
InitFont(tkwin, fontStructPtr, fontPtr);
return (TkFont *) fontPtr;
@@ -772,7 +776,7 @@ TkpGetFontFromAttributes(
fontPtr = (UnixFont *) tkFontPtr;
if (fontPtr == NULL) {
fontPtr = ckalloc(sizeof(UnixFont));
fontPtr = (UnixFont *)ckalloc(sizeof(UnixFont));
} else {
ReleaseFont(fontPtr);
}
@@ -835,7 +839,7 @@ TkpGetFontFamilies(
Tcl_Interp *interp, /* Interp to hold result. */
Tk_Window tkwin) /* For display to query. */
{
int i, new, numNames;
int i, isNew, numNames;
char *family, **nameList;
Tcl_HashTable familyTable;
Tcl_HashEntry *hPtr;
@@ -864,14 +868,14 @@ TkpGetFontFamilies(
continue; /* See comment above. */
}
*familyEnd = '\0';
Tcl_CreateHashEntry(&familyTable, family, &new);
Tcl_CreateHashEntry(&familyTable, family, &isNew);
}
XFreeFontNames(nameList);
hPtr = Tcl_FirstHashEntry(&familyTable, &search);
resultPtr = Tcl_NewObj();
while (hPtr != NULL) {
strPtr = Tcl_NewStringObj(Tcl_GetHashKey(&familyTable, hPtr), -1);
strPtr = Tcl_NewStringObj((const char *)Tcl_GetHashKey(&familyTable, hPtr), -1);
Tcl_ListObjAppendElement(NULL, resultPtr, strPtr);
hPtr = Tcl_NextHashEntry(&search);
}
@@ -1199,7 +1203,7 @@ TkpMeasureCharsInContext(
Tk_Font tkfont, /* Font in which characters will be drawn. */
const char *source, /* UTF-8 string to be displayed. Need not be
* '\0' terminated. */
int numBytes, /* Maximum number of bytes to consider from
TCL_UNUSED(int), /* Maximum number of bytes to consider from
* source string in all. */
int rangeStart, /* Index of first byte to measure. */
int rangeLength, /* Length of range to measure in bytes. */
@@ -1221,7 +1225,6 @@ TkpMeasureCharsInContext(
int *lengthPtr) /* Filled with x-location just after the
* terminating character. */
{
(void) numBytes; /*unused*/
return Tk_MeasureChars(tkfont, source + rangeStart, rangeLength,
maxLength, flags, lengthPtr);
}
@@ -1370,6 +1373,9 @@ Tk_DrawChars(
* with access to all the characters on the line for context. On X11 this
* context isn't consulted, so we just call Tk_DrawChars().
*
* Note: TK_DRAW_IN_CONTEXT being currently defined only on macOS, this
* function is unused (and possibly unfinished). See [7655f65ae7].
*
* Results:
* None.
*
@@ -1393,7 +1399,7 @@ TkpDrawCharsInContext(
* is passed to this function. If they are not
* stripped out, they will be displayed as
* regular printing characters. */
int numBytes, /* Number of bytes in string. */
TCL_UNUSED(int), /* Number of bytes in string. */
int rangeStart, /* Index of first byte to draw. */
int rangeLength, /* Length of range to draw in bytes. */
int x, int y) /* Coordinates at which to place origin of the
@@ -1402,13 +1408,43 @@ TkpDrawCharsInContext(
{
int widthUntilStart;
(void) numBytes; /*unused*/
Tk_MeasureChars(tkfont, source, rangeStart, -1, 0, &widthUntilStart);
Tk_DrawChars(display, drawable, gc, tkfont, source + rangeStart,
rangeLength, x+widthUntilStart, y);
}
void
TkpDrawAngledCharsInContext(
Display *display, /* Display on which to draw. */
Drawable drawable, /* Window or pixmap in which to draw. */
GC gc, /* Graphics context for drawing characters. */
Tk_Font tkfont, /* Font in which characters will be drawn; must
* be the same as font used in GC. */
const char * source, /* UTF-8 string to be displayed. Need not be
* '\0' terminated. All Tk meta-characters
* (tabs, control characters, and newlines)
* should be stripped out of the string that is
* passed to this function. If they are not
* stripped out, they will be displayed as
* regular printing characters. */
int numBytes, /* Number of bytes in string. */
int rangeStart, /* Index of first byte to draw. */
int rangeLength, /* Length of range to draw in bytes. */
double x, double y, /* Coordinates at which to place origin of the
* whole (not just the range) string when
* drawing. */
double angle) /* What angle to put text at, in degrees. */
{
int widthUntilStart;
double sinA = sin(angle * PI/180.0), cosA = cos(angle * PI/180.0);
(void) numBytes; /*unused*/
Tk_MeasureChars(tkfont, source, rangeStart, -1, 0, &widthUntilStart);
TkDrawAngledChars(display, drawable, gc, tkfont, source + rangeStart,
rangeLength, x+cosA*widthUntilStart, y-sinA*widthUntilStart, angle);
}
/*
*-------------------------------------------------------------------------
*
@@ -1571,7 +1607,7 @@ InitFont(
UnixFont *fontPtr) /* Filled with information constructed from
* the above arguments. */
{
ThreadSpecificData *tsdPtr =
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
unsigned long value;
int minHi, maxHi, minLo, maxLo, fixed, width, limit, i, n;
@@ -1677,7 +1713,7 @@ InitFont(
* 1/3 the width of a capital I.
*/
fontPtr->barHeight = fontPtr->widths['I'] / 3;
fontPtr->barHeight = fontPtr->widths[(unsigned char)'I'] / 3;
if (fontPtr->barHeight == 0) {
fontPtr->barHeight = 1;
}
@@ -1818,13 +1854,13 @@ AllocFontFamily(
Display *display, /* Display in which font will be used. */
XFontStruct *fontStructPtr, /* Screen font whose FontFamily is to be
* returned. */
int base) /* Non-zero if this font family is to be used
TCL_UNUSED(int)) /* Non-zero if this font family is to be used
* in the base font of a font object. */
{
FontFamily *familyPtr;
FontAttributes fa;
Tcl_Encoding encoding;
ThreadSpecificData *tsdPtr =
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
GetFontAttributes(display, fontStructPtr, &fa);
@@ -1843,7 +1879,7 @@ AllocFontFamily(
}
}
familyPtr = ckalloc(sizeof(FontFamily));
familyPtr = (FontFamily *)ckalloc(sizeof(FontFamily));
memset(familyPtr, 0, sizeof(FontFamily));
familyPtr->nextPtr = tsdPtr->fontFamilyList;
tsdPtr->fontFamilyList = familyPtr;
@@ -1900,15 +1936,14 @@ FreeFontFamily(
FontFamily *familyPtr) /* The FontFamily to delete. */
{
FontFamily **familyPtrPtr;
ThreadSpecificData *tsdPtr =
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
int i;
if (familyPtr == NULL) {
return;
}
familyPtr->refCount--;
if (familyPtr->refCount > 0) {
if (familyPtr->refCount-- > 1) {
return;
}
if (familyPtr->encoding) {
@@ -1976,8 +2011,8 @@ FindSubFontForChar(
SubFont *subFontPtr;
Tcl_DString ds;
if (ch < 0 || ch > 0x30000) {
ch = 0xfffd;
if (ch < 0 || ch >= FONTMAP_NUMCHARS) {
ch = 0xFFFD;
}
for (i = 0; i < fontPtr->numSubFonts; i++) {
@@ -2130,7 +2165,7 @@ FontMapLookup(
{
int row, bitOffset;
if (ch < 0 || ch >= 0x30000) {
if (ch < 0 || ch >= FONTMAP_NUMCHARS) {
return 0;
}
row = ch >> FONTMAP_SHIFT;
@@ -2173,7 +2208,7 @@ FontMapInsert(
{
int row, bitOffset;
if (ch >= 0 && ch < 0x30000) {
if (ch >= 0 && ch < FONTMAP_NUMCHARS) {
row = ch >> FONTMAP_SHIFT;
if (subFontPtr->fontMap[row] == NULL) {
FontMapLoadPage(subFontPtr, row);
@@ -2214,10 +2249,10 @@ FontMapLoadPage(
Tcl_Encoding encoding;
XFontStruct *fontStructPtr;
XCharStruct *widths;
ThreadSpecificData *tsdPtr =
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
subFontPtr->fontMap[row] = ckalloc(FONTMAP_BITSPERPAGE / 8);
subFontPtr->fontMap[row] = (char *)ckalloc(FONTMAP_BITSPERPAGE / 8);
memset(subFontPtr->fontMap[row], 0, FONTMAP_BITSPERPAGE / 8);
if (subFontPtr->familyPtr == &tsdPtr->controlFamily) {
@@ -2455,7 +2490,7 @@ CanUseFallback(
numEncodings = 0;
Tcl_DStringInit(&dsEncodings);
charset = NULL; /* lint, since numNames must be > 0 to get here. */
charset = NULL; /* numNames must be > 0 to get here. */
retry:
bestIdx[0] = -1;
@@ -2549,7 +2584,7 @@ CanUseFallback(
* make a copy.
*/
nameList = ckalloc(numNames * sizeof(char *));
nameList = (char **)ckalloc(numNames * sizeof(char *));
memcpy(nameList, nameListOrig, numNames * sizeof(char *));
}
nameList[nameIdx] = NULL;
@@ -2594,11 +2629,11 @@ CanUseFallback(
if (fontPtr->numSubFonts >= SUBFONT_SPACE) {
SubFont *newPtr;
newPtr = ckalloc(sizeof(SubFont) * (fontPtr->numSubFonts + 1));
newPtr = (SubFont *)ckalloc(sizeof(SubFont) * (fontPtr->numSubFonts + 1));
memcpy(newPtr, fontPtr->subFontArray,
fontPtr->numSubFonts * sizeof(SubFont));
if (fixSubFontPtrPtr != NULL) {
register SubFont *fixSubFontPtr = *fixSubFontPtrPtr;
SubFont *fixSubFontPtr = *fixSubFontPtrPtr;
if (fixSubFontPtr != &fontPtr->controlSubFont) {
*fixSubFontPtrPtr =
@@ -2684,7 +2719,7 @@ RankAttributes(
penalty += diff;
}
if (gotPtr->xa.charset != wantPtr->xa.charset) {
int i;
size_t i;
const char *gotAlias, *wantAlias;
penalty += 65000;
@@ -2692,7 +2727,7 @@ RankAttributes(
wantAlias = GetEncodingAlias(wantPtr->xa.charset);
if (strcmp(gotAlias, wantAlias) != 0) {
penalty += 30000;
for (i = 0; encodingList[i] != NULL; i++) {
for (i = 0; i < sizeof(encodingList)/sizeof(encodingList[0]); i++) {
if (strcmp(gotAlias, encodingList[i]) == 0) {
penalty -= 30000;
break;
@@ -3063,29 +3098,31 @@ GetImageOfText(
Pixmap bitmap;
GC bitmapGC;
XGCValues values;
XImage *image;
XImage *image = NULL;
(void) Tk_MeasureChars(tkfont, source, numBytes, -1, 0, &width);
height = fontPtr->fm.ascent + fontPtr->fm.descent;
bitmap = Tk_GetPixmap(display, drawable, width, height, 1);
values.graphics_exposures = False;
values.foreground = BlackPixel(display, DefaultScreen(display));
bitmapGC = XCreateGC(display, bitmap, GCGraphicsExposures|GCForeground,
&values);
XFillRectangle(display, bitmap, bitmapGC, 0, 0, width, height);
if ((width > 0) && (height > 0)) {
bitmap = Tk_GetPixmap(display, drawable, width, height, 1);
values.graphics_exposures = False;
values.foreground = BlackPixel(display, DefaultScreen(display));
bitmapGC = XCreateGC(display, bitmap, GCGraphicsExposures|GCForeground,
&values);
XFillRectangle(display, bitmap, bitmapGC, 0, 0, width, height);
values.font = Tk_FontId(tkfont);
values.foreground = WhitePixel(display, DefaultScreen(display));
values.background = BlackPixel(display, DefaultScreen(display));
XChangeGC(display, bitmapGC, GCFont|GCForeground|GCBackground, &values);
Tk_DrawChars(display, bitmap, bitmapGC, tkfont, source, numBytes, 0,
fontPtr->fm.ascent);
XFreeGC(display, bitmapGC);
values.font = Tk_FontId(tkfont);
values.foreground = WhitePixel(display, DefaultScreen(display));
values.background = BlackPixel(display, DefaultScreen(display));
XChangeGC(display, bitmapGC, GCFont|GCForeground|GCBackground, &values);
Tk_DrawChars(display, bitmap, bitmapGC, tkfont, source, numBytes, 0,
fontPtr->fm.ascent);
XFreeGC(display, bitmapGC);
image = XGetImage(display, bitmap, 0, 0, width, height, AllPlanes,
ZPixmap);
Tk_FreePixmap(display, bitmap);
image = XGetImage(display, bitmap, 0, 0, width, height, AllPlanes,
ZPixmap);
Tk_FreePixmap(display, bitmap);
}
*realWidthPtr = width;
*realHeightPtr = height;
@@ -3100,21 +3137,23 @@ InitDestImage(
int height,
Pixmap *bitmapPtr)
{
Pixmap bitmap;
XImage *image;
Pixmap bitmap = None;
XImage *image = NULL;
GC bitmapGC;
XGCValues values;
bitmap = Tk_GetPixmap(display, drawable, width, height, 1);
values.graphics_exposures = False;
values.foreground = BlackPixel(display, DefaultScreen(display));
bitmapGC = XCreateGC(display, bitmap, GCGraphicsExposures|GCForeground,
&values);
XFillRectangle(display, bitmap, bitmapGC, 0, 0, width, height);
XFreeGC(display, bitmapGC);
if ((width > 0) && (height > 0)) {
bitmap = Tk_GetPixmap(display, drawable, width, height, 1);
values.graphics_exposures = False;
values.foreground = BlackPixel(display, DefaultScreen(display));
bitmapGC = XCreateGC(display, bitmap, GCGraphicsExposures|GCForeground,
&values);
XFillRectangle(display, bitmap, bitmapGC, 0, 0, width, height);
XFreeGC(display, bitmapGC);
image = XGetImage(display, bitmap, 0, 0, width, height, AllPlanes,
ZPixmap);
image = XGetImage(display, bitmap, 0, 0, width, height, AllPlanes,
ZPixmap);
}
*bitmapPtr = bitmap;
return image;
}

View File

@@ -12,11 +12,19 @@
#include "tkInt.h"
#ifdef __GNUC__
/*
* We know that XKeycodeToKeysym is deprecated, nothing we can do about it.
*/
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
/*
** Bug [3607830]: Before using Xkb, it must be initialized. TkpOpenDisplay
** does this and sets the USE_XKB flag if xkb is supported.
** (should this be function ptr?)
*/
#ifdef HAVE_XKBKEYCODETOKEYSYM
# include <X11/XKBlib.h>
#else
@@ -138,8 +146,7 @@ TkpGetString(
#ifdef TK_USE_INPUT_METHODS
if ((winPtr->dispPtr->flags & TK_DISPLAY_USE_IM)
&& (winPtr->inputContext != NULL)
&& (eventPtr->type == KeyPress)) {
&& (winPtr->inputContext != NULL)) {
Status status;
#if X_HAVE_UTF8_STRING
@@ -194,8 +201,7 @@ TkpGetString(
{
/*
* Fall back to convert a keyboard event to a UTF-8 string using
* XLookupString. This is used when input methods are turned off and
* for KeyRelease events.
* XLookupString. This is used when input methods are turned off.
*
* Note: XLookupString() normally returns a single ISO Latin 1 or
* ASCII control character.
@@ -279,9 +285,9 @@ TkpSetKeycodeAndState(
mincode = 0;
maxcode = -1;
XDisplayKeycodes(dispPtr->display, &mincode, &maxcode);
if (keycode < mincode) {
if (keycode < (KeyCode)mincode) {
keycode = mincode;
} else if (keycode > maxcode) {
} else if (keycode > (KeyCode)maxcode) {
keycode = maxcode;
}
@@ -307,6 +313,10 @@ TkpSetKeycodeAndState(
*----------------------------------------------------------------------
*/
#ifdef __GNUC__
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
KeySym
TkpGetKeySym(
TkDisplay *dispPtr, /* Display in which to map keycode. */
@@ -316,6 +326,14 @@ TkpGetKeySym(
int index;
TkKeyEvent* kePtr = (TkKeyEvent*) eventPtr;
/*
* X11 keycodes always lie in the inclusive range [8,255].
*/
if (eventPtr->xkey.keycode > 0xff) {
return NoSymbol;
}
/*
* Refresh the mapping information if it's stale. This must happen before
* we do any input method processing. [Bug 3599312]
@@ -363,6 +381,7 @@ TkpGetKeySym(
&& (eventPtr->xkey.state & LockMask))) {
index += 1;
}
sym = TkKeycodeToKeysym(dispPtr, eventPtr->xkey.keycode, 0,
index);
@@ -372,11 +391,15 @@ TkpGetKeySym(
* alphabetic, then switch back to the unshifted keysym.
*/
#ifndef XK_Oslash
/* XK_Oslash is the official name, but might not be present in older X11 headers */
# define XK_Oslash XK_Ooblique
#endif
if ((index & 1) && !(eventPtr->xkey.state & ShiftMask)
&& (dispPtr->lockUsage == LU_CAPS)) {
if (!(((sym >= XK_A) && (sym <= XK_Z))
|| ((sym >= XK_Agrave) && (sym <= XK_Odiaeresis))
|| ((sym >= XK_Ooblique) && (sym <= XK_Thorn)))) {
|| ((sym >= XK_Oslash) && (sym <= XK_Thorn)))) {
index &= ~1;
sym = TkKeycodeToKeysym(dispPtr, eventPtr->xkey.keycode,
0, index);
@@ -466,6 +489,7 @@ TkpInitKeymapInfo(
continue;
}
keysym = TkKeycodeToKeysym(dispPtr, *codePtr, 0, 0);
if (keysym == XK_Mode_switch) {
dispPtr->modeModMask |= ShiftMask << (i/modMapPtr->max_keypermod);
}

View File

@@ -145,7 +145,7 @@ TkpNewMenu(
void
TkpDestroyMenu(
TkMenu *menuPtr)
TCL_UNUSED(TkMenu *))
{
/*
* Nothing to do.
@@ -171,7 +171,7 @@ TkpDestroyMenu(
void
TkpDestroyMenuEntry(
TkMenuEntry *mEntryPtr)
TCL_UNUSED(TkMenuEntry *))
{
/*
* Nothing to do.
@@ -199,7 +199,7 @@ TkpDestroyMenuEntry(
int
TkpConfigureMenuEntry(
register TkMenuEntry *mePtr)/* Information about menu entry; may or may
TkMenuEntry *mePtr)/* Information about menu entry; may or may
* not already have values for some fields. */
{
/*
@@ -239,7 +239,7 @@ TkpConfigureMenuEntry(
int
TkpMenuNewEntry(
TkMenuEntry *mePtr)
TCL_UNUSED(TkMenuEntry *))
{
return TCL_OK;
}
@@ -292,9 +292,9 @@ TkpSetWindowMenuBar(
void
TkpSetMainMenubar(
Tcl_Interp *interp,
Tk_Window tkwin,
const char *menuName)
TCL_UNUSED(Tcl_Interp *),
TCL_UNUSED(Tk_Window),
TCL_UNUSED(const char *))
{
/*
* Nothing to do.
@@ -323,8 +323,8 @@ static void
GetMenuIndicatorGeometry(
TkMenu *menuPtr, /* The menu we are drawing. */
TkMenuEntry *mePtr, /* The entry we are interested in. */
Tk_Font tkfont, /* The precalculated font */
const Tk_FontMetrics *fmPtr,/* The precalculated metrics */
TCL_UNUSED(Tk_Font), /* The precalculated font */
TCL_UNUSED(const Tk_FontMetrics *),/* The precalculated metrics */
int *widthPtr, /* The resulting width */
int *heightPtr) /* The resulting height */
{
@@ -445,7 +445,6 @@ DrawMenuEntryBackground(
} else {
relief = TK_RELIEF_RAISED;
}
Tk_GetPixelsFromObj(NULL, menuPtr->tkwin,
menuPtr->activeBorderWidthPtr, &activeBorderWidth);
Tk_Fill3DRectangle(menuPtr->tkwin, d, bgBorder, x, y, width, height,
@@ -524,7 +523,7 @@ DrawMenuEntryAccelerator(
if (menuPtr->menuType == MENUBAR) {
left += 5;
}
Tk_DrawChars(menuPtr->display, d, gc, tkfont, accel,
Tk_DrawChars(menuPtr->display, d, gc, tkfont, accel,
mePtr->accelLength, left,
(y + (height + fmPtr->ascent - fmPtr->descent) / 2));
}
@@ -554,11 +553,11 @@ DrawMenuEntryIndicator(
Tk_3DBorder border, /* The background color */
XColor *indicatorColor, /* The color to draw indicators with */
XColor *disableColor, /* The color use use when disabled */
Tk_Font tkfont, /* The font to draw with */
const Tk_FontMetrics *fmPtr,/* The font metrics of the font */
TCL_UNUSED(Tk_Font), /* The font to draw with */
TCL_UNUSED(const Tk_FontMetrics *),/* The font metrics of the font */
int x, /* The left of the entry rect */
int y, /* The top of the entry rect */
int width, /* Width of menu entry */
TCL_UNUSED(int), /* Width of menu entry */
int height) /* Height of menu entry */
{
/*
@@ -623,11 +622,11 @@ DrawMenuEntryIndicator(
static void
DrawMenuSeparator(
TkMenu *menuPtr, /* The menu we are drawing */
TkMenuEntry *mePtr, /* The entry we are drawing */
TCL_UNUSED(TkMenuEntry *), /* The entry we are drawing */
Drawable d, /* The drawable we are using */
GC gc, /* The gc to draw into */
Tk_Font tkfont, /* The font to draw with */
const Tk_FontMetrics *fmPtr,/* The font metrics from the font */
TCL_UNUSED(GC), /* The gc to draw into */
TCL_UNUSED(Tk_Font), /* The font to draw with */
TCL_UNUSED(const Tk_FontMetrics *),/* The font metrics from the font */
int x, int y,
int width, int height)
{
@@ -790,7 +789,7 @@ DrawMenuEntryLabel(
imageHeight, d, leftEdge + imageXOffset,
(int) (y + (mePtr->height-imageHeight)/2 + imageYOffset));
}
} else if (mePtr->bitmapPtr != None) {
} else if (mePtr->bitmapPtr != NULL) {
Pixmap bitmap = Tk_GetBitmapFromObj(menuPtr->tkwin, mePtr->bitmapPtr);
XCopyPlane(menuPtr->display, bitmap, d, gc, 0, 0,
@@ -818,7 +817,7 @@ DrawMenuEntryLabel(
XFillRectangle(menuPtr->display, d, menuPtr->disabledGC, x, y,
(unsigned) width, (unsigned) height);
} else if ((mePtr->image != NULL)
&& (menuPtr->disabledImageGC != None)) {
&& (menuPtr->disabledImageGC != NULL)) {
XFillRectangle(menuPtr->display, d, menuPtr->disabledImageGC,
leftEdge + imageXOffset,
(int) (y + (mePtr->height - imageHeight)/2 + imageYOffset),
@@ -852,19 +851,19 @@ DrawMenuUnderline(
Tk_Font tkfont, /* The precalculated font */
const Tk_FontMetrics *fmPtr,/* The precalculated font metrics */
int x, int y,
int width, int height)
TCL_UNUSED(int), int height)
{
if ((mePtr->underline >= 0) && (mePtr->labelPtr != NULL)) {
int len;
len = Tcl_GetCharLength(mePtr->labelPtr);
if (mePtr->underline < len) {
int activeBorderWidth, leftEdge;
int activeBorderWidth, leftEdge, ch;
const char *label, *start, *end;
label = Tcl_GetString(mePtr->labelPtr);
start = Tcl_UtfAtIndex(label, mePtr->underline);
end = Tcl_UtfNext(start);
start = TkUtfAtIndex(label, mePtr->underline);
end = start + TkUtfToUniChar(start, &ch);
Tk_GetPixelsFromObj(NULL, menuPtr->tkwin,
menuPtr->activeBorderWidthPtr, &activeBorderWidth);
@@ -931,7 +930,7 @@ TkpPostMenu(
int
TkpPostTearoffMenu(
Tcl_Interp *interp, /* The interpreter of the menu */
TCL_UNUSED(Tcl_Interp *), /* The interpreter of the menu */
TkMenu *menuPtr, /* The menu we are posting */
int x, int y, int index) /* The root X,Y coordinates where the
* specified entry will be posted */
@@ -1021,9 +1020,9 @@ TkpPostTearoffMenu(
static void
GetMenuSeparatorGeometry(
TkMenu *menuPtr, /* The menu we are measuring */
TkMenuEntry *mePtr, /* The entry we are measuring */
Tk_Font tkfont, /* The precalculated font */
TCL_UNUSED(TkMenu *), /* The menu we are measuring */
TCL_UNUSED(TkMenuEntry *), /* The entry we are measuring */
TCL_UNUSED(Tk_Font), /* The precalculated font */
const Tk_FontMetrics *fmPtr,/* The precalcualted font metrics */
int *widthPtr, /* The resulting width */
int *heightPtr) /* The resulting height */
@@ -1051,13 +1050,13 @@ GetMenuSeparatorGeometry(
static void
GetTearoffEntryGeometry(
TkMenu *menuPtr, /* The menu we are drawing */
TkMenuEntry *mePtr, /* The entry we are measuring */
TCL_UNUSED(TkMenuEntry *), /* The entry we are measuring */
Tk_Font tkfont, /* The precalculated font */
const Tk_FontMetrics *fmPtr,/* The precalculated font metrics */
int *widthPtr, /* The resulting width */
int *heightPtr) /* The resulting height */
{
if (menuPtr->menuType != MASTER_MENU) {
if (menuPtr->menuType != MAIN_MENU) {
*heightPtr = 0;
*widthPtr = 0;
} else {
@@ -1092,15 +1091,13 @@ TkpComputeMenubarGeometry(
Tk_FontMetrics menuMetrics, entryMetrics, *fmPtr;
int width, height, i, j, x, y, currentRowHeight, maxWidth;
int maxWindowWidth, lastRowBreak, lastEntry;
int borderWidth, activeBorderWidth, helpMenuIndex = -1;
int activeBorderWidth, helpMenuIndex = -1;
TkMenuEntry *mePtr;
if (menuPtr->tkwin == NULL) {
return;
}
Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, menuPtr->borderWidthPtr,
&borderWidth);
Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, menuPtr->activeBorderWidthPtr,
&activeBorderWidth);
maxWidth = 0;
@@ -1111,7 +1108,7 @@ TkpComputeMenubarGeometry(
maxWindowWidth = Tk_Width(menuPtr->tkwin);
if (maxWindowWidth == 1) {
maxWindowWidth = 0x7ffffff;
maxWindowWidth = 0x7FFFFFF;
}
currentRowHeight = 0;
Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, menuPtr->borderWidthPtr,
@@ -1122,7 +1119,7 @@ TkpComputeMenubarGeometry(
/*
* On the Mac especially, getting font metrics can be quite slow, so
* we want to do it intelligently. We are going to precalculate them
* and pass them down to all of the measureing and drawing routines.
* and pass them down to all of the measuring and drawing routines.
* We will measure the font metrics of the menu once, and if an entry
* has a font set, we will measure it as we come to it, and then we
* decide which set to give the geometry routines.
@@ -1269,11 +1266,11 @@ TkpComputeMenubarGeometry(
static void
DrawTearoffEntry(
TkMenu *menuPtr, /* The menu we are drawing */
TkMenuEntry *mePtr, /* The entry we are drawing */
TCL_UNUSED(TkMenuEntry *), /* The entry we are drawing */
Drawable d, /* The drawable we are drawing into */
GC gc, /* The gc we are drawing with */
Tk_Font tkfont, /* The font we are drawing with */
const Tk_FontMetrics *fmPtr,/* The metrics we are drawing with */
TCL_UNUSED(GC), /* The gc we are drawing with */
TCL_UNUSED(Tk_Font), /* The font we are drawing with */
TCL_UNUSED(const Tk_FontMetrics *),/* The metrics we are drawing with */
int x, int y,
int width, int height)
{
@@ -1281,7 +1278,7 @@ DrawTearoffEntry(
int segmentWidth, maxX;
Tk_3DBorder border;
if (menuPtr->menuType != MASTER_MENU) {
if (menuPtr->menuType != MAIN_MENU) {
return;
}
@@ -1324,8 +1321,8 @@ DrawTearoffEntry(
void
TkpInitializeMenuBindings(
Tcl_Interp *interp, /* The interpreter to set. */
Tk_BindingTable bindingTable)
TCL_UNUSED(Tcl_Interp *), /* The interpreter to set. */
TCL_UNUSED(Tk_BindingTable))
/* The table to add to. */
{
/*
@@ -1376,7 +1373,7 @@ SetHelpMenu(
&& (cascadeEntryPtr->menuPtr->masterMenuPtr->tkwin != NULL)
&& (menuPtr->masterMenuPtr->tkwin != NULL)) {
TkMenu *masterMenuPtr = cascadeEntryPtr->menuPtr->masterMenuPtr;
char *helpMenuName = ckalloc(strlen(Tk_PathName(
char *helpMenuName = (char *)ckalloc(strlen(Tk_PathName(
masterMenuPtr->tkwin)) + strlen(".help") + 1);
strcpy(helpMenuName, Tk_PathName(masterMenuPtr->tkwin));
@@ -1852,8 +1849,8 @@ TkpComputeStandardMenuGeometry(
void
TkpMenuNotifyToplevelCreate(
Tcl_Interp *interp, /* The interp the menu lives in. */
const char *menuName) /* The name of the menu to reconfigure. */
TCL_UNUSED(Tcl_Interp *), /* The interp the menu lives in. */
TCL_UNUSED(const char *)) /* The name of the menu to reconfigure. */
{
/*
* Nothing to do.

View File

@@ -25,16 +25,16 @@
* Returns a newly allocated TkMenuButton structure.
*
* Side effects:
* Registers an event handler for the widget.
* None
*
*----------------------------------------------------------------------
*/
TkMenuButton *
TkpCreateMenuButton(
Tk_Window tkwin)
TCL_UNUSED(Tk_Window))
{
return ckalloc(sizeof(TkMenuButton));
return (TkMenuButton *)ckalloc(sizeof(TkMenuButton));
}
/*
@@ -58,14 +58,14 @@ void
TkpDisplayMenuButton(
ClientData clientData) /* Information about widget. */
{
register TkMenuButton *mbPtr = (TkMenuButton *) clientData;
TkMenuButton *mbPtr = (TkMenuButton *)clientData;
GC gc;
Tk_3DBorder border;
Pixmap pixmap;
int x = 0; /* Initialization needed only to stop compiler
* warning. */
int y = 0;
register Tk_Window tkwin = mbPtr->tkwin;
Tk_Window tkwin = mbPtr->tkwin;
int fullWidth, fullHeight;
int textXOffset, textYOffset;
int imageWidth, imageHeight;
@@ -280,8 +280,6 @@ TkpDisplayMenuButton(
mbPtr->borderWidth, mbPtr->relief);
}
if (mbPtr->highlightWidth != 0) {
GC gc;
if (mbPtr->flags & GOT_FOCUS) {
gc = Tk_GCForColor(mbPtr->highlightColorPtr, pixmap);
} else {

View File

@@ -18,18 +18,19 @@
#define __UNIX__ 1
#include <stdio.h>
#include <ctype.h>
#include <fcntl.h>
#include <limits.h>
#include <math.h>
#include <pwd.h>
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
#include <ctype.h>
#include <math.h>
#include <string.h>
#include <limits.h>
#ifdef NO_STDLIB_H
# include "../compat/stdlib.h"
#else
# include <stdlib.h>
#endif
#include <assert.h>
#include <string.h>
#include <sys/types.h>
#include <sys/file.h>
#ifdef HAVE_SYS_SELECT_H
@@ -44,9 +45,9 @@
# include <time.h>
#else
# if HAVE_SYS_TIME_H
# include <sys/time.h>
# include <sys/time.h>
# else
# include <time.h>
# include <time.h>
# endif
#endif
#if HAVE_INTTYPES_H
@@ -190,4 +191,10 @@
sprintf((buf), "%#08lx", (unsigned long) (w))
#endif
/*
* Used by tkWindow.c
*/
#define TkpHandleMapOrUnmap(tkwin, event) Tk_HandleEvent(event)
#endif /* _UNIXPORT */

View File

@@ -12,7 +12,6 @@
#include "tkUnixInt.h"
#include "tkFont.h"
#include <X11/Xft/Xft.h>
#include <ctype.h>
#define MAX_CACHED_COLORS 16
@@ -61,9 +60,13 @@ static Tcl_ThreadDataKey dataKey;
* the TIP 59 configuration database.
*/
#ifndef TCL_CFGVAL_ENCODING
#define TCL_CFGVAL_ENCODING "ascii"
#endif
static int utf8ToUcs4(const char *source, FcChar32 *c, int numBytes)
{
if (numBytes >= 6) {
return TkUtfToUniChar(source, (int *)c);
}
return FcUtf8ToUcs4((const FcChar8 *)source, c, numBytes);
}
void
TkpFontPkgInit(
@@ -74,7 +77,7 @@ TkpFontPkgInit(
{ 0,0 }
};
Tcl_RegisterConfig(mainPtr->interp, "tk", cfg, TCL_CFGVAL_ENCODING);
Tcl_RegisterConfig(mainPtr->interp, "tk", cfg, "utf-8");
}
static XftFont *
@@ -247,6 +250,23 @@ GetTkFontMetrics(
*---------------------------------------------------------------------------
*/
static void
FinishedWithFont(
UnixFtFont *fontPtr);
static int
InitFontErrorProc(
ClientData clientData,
TCL_UNUSED(XErrorEvent *))
{
int *errorFlagPtr = (int *)clientData;
if (errorFlagPtr != NULL) {
*errorFlagPtr = 1;
}
return 0;
}
static UnixFtFont *
InitFont(
Tk_Window tkwin,
@@ -257,10 +277,11 @@ InitFont(
FcCharSet *charset;
FcResult result;
XftFont *ftFont;
int i, iWidth;
int i, iWidth, errorFlag;
Tk_ErrorHandler handler;
if (!fontPtr) {
fontPtr = ckalloc(sizeof(UnixFtFont));
fontPtr = (UnixFtFont *)ckalloc(sizeof(UnixFtFont));
}
FcConfigSubstitute(0, pattern, FcMatchPattern);
@@ -271,14 +292,14 @@ InitFont(
*/
set = FcFontSort(0, pattern, FcTrue, NULL, &result);
if (!set) {
if (!set || set->nfont == 0) {
ckfree(fontPtr);
return NULL;
}
fontPtr->fontset = set;
fontPtr->pattern = pattern;
fontPtr->faces = ckalloc(set->nfont * sizeof(UnixFtFace));
fontPtr->faces = (UnixFtFace *)ckalloc(set->nfont * sizeof(UnixFtFace));
fontPtr->nfaces = set->nfont;
/*
@@ -308,10 +329,25 @@ InitFont(
* Fill in platform-specific fields of TkFont.
*/
errorFlag = 0;
handler = Tk_CreateErrorHandler(Tk_Display(tkwin),
-1, -1, -1, InitFontErrorProc, (ClientData) &errorFlag);
ftFont = GetFont(fontPtr, 0, 0.0);
if ((ftFont == NULL) || errorFlag) {
Tk_DeleteErrorHandler(handler);
FinishedWithFont(fontPtr);
ckfree(fontPtr);
return NULL;
}
fontPtr->font.fid = XLoadFont(Tk_Display(tkwin), "fixed");
GetTkFontAttributes(ftFont, &fontPtr->font.fa);
GetTkFontMetrics(ftFont, &fontPtr->font.fm);
Tk_DeleteErrorHandler(handler);
if (errorFlag) {
FinishedWithFont(fontPtr);
ckfree(fontPtr);
return NULL;
}
/*
* Fontconfig can't report any information about the position or thickness
@@ -336,7 +372,16 @@ InitFont(
TkFont *fPtr = &fontPtr->font;
fPtr->underlinePos = fPtr->fm.descent / 2;
handler = Tk_CreateErrorHandler(Tk_Display(tkwin),
-1, -1, -1, InitFontErrorProc, (ClientData) &errorFlag);
errorFlag = 0;
Tk_MeasureChars((Tk_Font) fPtr, "I", 1, -1, 0, &iWidth);
Tk_DeleteErrorHandler(handler);
if (errorFlag) {
FinishedWithFont(fontPtr);
ckfree(fontPtr);
return NULL;
}
fPtr->underlineHeight = iWidth / 3;
if (fPtr->underlineHeight == 0) {
fPtr->underlineHeight = 1;
@@ -616,7 +661,7 @@ TkpGetSubFonts(
void
TkpGetFontAttrsForChar(
Tk_Window tkwin, /* Window on the font's display */
TCL_UNUSED(Tk_Window), /* Window on the font's display */
Tk_Font tkfont, /* Font to query */
int c, /* Character of interest */
TkFontAttributes *faPtr) /* Output: Font attributes */
@@ -661,12 +706,15 @@ Tk_MeasureChars(
FcChar32 c;
XGlyphInfo extents;
int clen, curX, newX, curByte, newByte, sawNonSpace;
int termByte = 0, termX = 0;
int termByte = 0, termX = 0, errorFlag = 0;
Tk_ErrorHandler handler;
#if DEBUG_FONTSEL
char string[256];
int len = 0;
#endif /* DEBUG_FONTSEL */
handler = Tk_CreateErrorHandler(fontPtr->display,
-1, -1, -1, InitFontErrorProc, &errorFlag);
curX = 0;
curByte = 0;
sawNonSpace = 0;
@@ -702,7 +750,12 @@ Tk_MeasureChars(
#endif /* DEBUG_FONTSEL */
ftFont = GetFont(fontPtr, c, 0.0);
XftTextExtents32(fontPtr->display, ftFont, &c, 1, &extents);
if (!errorFlag) {
XftTextExtents32(fontPtr->display, ftFont, &c, 1, &extents);
} else {
extents.xOff = 0;
errorFlag = 0;
}
newX = curX + extents.xOff;
newByte = curByte + clen;
@@ -731,6 +784,7 @@ Tk_MeasureChars(
curX = newX;
curByte = newByte;
}
Tk_DeleteErrorHandler(handler);
#if DEBUG_FONTSEL
string[len] = '\0';
printf("MeasureChars %s length %d bytes %d\n", string, curX, curByte);
@@ -824,7 +878,7 @@ LookUpColor(Display *display, /* Display to lookup colors on */
fontPtr->colors[last].color.color.red = xcolor.red;
fontPtr->colors[last].color.color.green = xcolor.green;
fontPtr->colors[last].color.color.blue = xcolor.blue;
fontPtr->colors[last].color.color.alpha = 0xffff;
fontPtr->colors[last].color.color.alpha = 0xFFFF;
fontPtr->colors[last].color.pixel = pixel;
/*
@@ -886,7 +940,7 @@ Tk_DrawChars(
}
XGetGCValues(display, gc, GCForeground, &values);
xftcolor = LookUpColor(display, fontPtr, values.foreground);
if (tsdPtr->clipRegion != None) {
if (tsdPtr->clipRegion != NULL) {
XftDrawSetClip(fontPtr->ftDraw, tsdPtr->clipRegion);
}
nspec = 0;
@@ -894,7 +948,7 @@ Tk_DrawChars(
XftFont *ftFont;
FcChar32 c;
clen = FcUtf8ToUcs4((FcChar8 *) source, &c, numBytes);
clen = utf8ToUcs4(source, &c, numBytes);
if (clen <= 0) {
/*
* This should not happen, but it can.
@@ -936,7 +990,7 @@ Tk_DrawChars(
}
doUnderlineStrikeout:
if (tsdPtr->clipRegion != None) {
if (tsdPtr->clipRegion != NULL) {
XftDrawSetClip(fontPtr->ftDraw, NULL);
}
if (fontPtr->font.fa.underline != 0) {
@@ -1028,13 +1082,13 @@ TkDrawAngledChars(
nglyph = 0;
currentFtFont = NULL;
originX = originY = 0; /* lint */
originX = originY = 0;
while (numBytes > 0) {
XftFont *ftFont;
FcChar32 c;
clen = FcUtf8ToUcs4((FcChar8 *) source, &c, numBytes);
clen = utf8ToUcs4(source, &c, numBytes);
if (clen <= 0) {
/*
* This should not happen, but it can.
@@ -1130,7 +1184,7 @@ TkDrawAngledChars(
}
XGetGCValues(display, gc, GCForeground, &values);
xftcolor = LookUpColor(display, fontPtr, values.foreground);
if (tsdPtr->clipRegion != None) {
if (tsdPtr->clipRegion != NULL) {
XftDrawSetClip(fontPtr->ftDraw, tsdPtr->clipRegion);
}
nspec = 0;
@@ -1138,7 +1192,7 @@ TkDrawAngledChars(
XftFont *ftFont, *ft0Font;
FcChar32 c;
clen = FcUtf8ToUcs4((FcChar8 *) source, &c, numBytes);
clen = utf8ToUcs4(source, &c, numBytes);
if (clen <= 0) {
/*
* This should not happen, but it can.
@@ -1182,7 +1236,7 @@ TkDrawAngledChars(
#endif /* XFT_HAS_FIXED_ROTATED_PLACEMENT */
doUnderlineStrikeout:
if (tsdPtr->clipRegion != None) {
if (tsdPtr->clipRegion != NULL) {
XftDrawSetClip(fontPtr->ftDraw, NULL);
}
if (fontPtr->font.fa.underline || fontPtr->font.fa.overstrike) {
@@ -1241,6 +1295,89 @@ TkDrawAngledChars(
}
}
/*
*---------------------------------------------------------------------------
*
* TkpDrawCharsInContext --
*
* Draw a string of characters on the screen like Tk_DrawChars(), but
* with access to all the characters on the line for context. On X11 this
* context isn't consulted, so we just call Tk_DrawChars().
*
* Note: TK_DRAW_IN_CONTEXT being currently defined only on macOS, this
* function is unused (and possibly unfinished). See [7655f65ae7].
*
* Results:
* None.
*
* Side effects:
* Information gets drawn on the screen.
*
*---------------------------------------------------------------------------
*/
void
TkpDrawCharsInContext(
Display *display, /* Display on which to draw. */
Drawable drawable, /* Window or pixmap in which to draw. */
GC gc, /* Graphics context for drawing characters. */
Tk_Font tkfont, /* Font in which characters will be drawn;
* must be the same as font used in GC. */
const char *source, /* UTF-8 string to be displayed. Need not be
* '\0' terminated. All Tk meta-characters
* (tabs, control characters, and newlines)
* should be stripped out of the string that
* is passed to this function. If they are not
* stripped out, they will be displayed as
* regular printing characters. */
int numBytes, /* Number of bytes in string. */
int rangeStart, /* Index of first byte to draw. */
int rangeLength, /* Length of range to draw in bytes. */
int x, int y) /* Coordinates at which to place origin of the
* whole (not just the range) string when
* drawing. */
{
int widthUntilStart;
(void) numBytes; /*unused*/
Tk_MeasureChars(tkfont, source, rangeStart, -1, 0, &widthUntilStart);
Tk_DrawChars(display, drawable, gc, tkfont, source + rangeStart,
rangeLength, x+widthUntilStart, y);
}
void
TkpDrawAngledCharsInContext(
Display *display, /* Display on which to draw. */
Drawable drawable, /* Window or pixmap in which to draw. */
GC gc, /* Graphics context for drawing characters. */
Tk_Font tkfont, /* Font in which characters will be drawn; must
* be the same as font used in GC. */
const char * source, /* UTF-8 string to be displayed. Need not be
* '\0' terminated. All Tk meta-characters
* (tabs, control characters, and newlines)
* should be stripped out of the string that is
* passed to this function. If they are not
* stripped out, they will be displayed as
* regular printing characters. */
int numBytes, /* Number of bytes in string. */
int rangeStart, /* Index of first byte to draw. */
int rangeLength, /* Length of range to draw in bytes. */
double x, double y, /* Coordinates at which to place origin of the
* whole (not just the range) string when
* drawing. */
double angle) /* What angle to put text at, in degrees. */
{
int widthUntilStart;
double sinA = sin(angle * PI/180.0), cosA = cos(angle * PI/180.0);
(void) numBytes; /*unused*/
Tk_MeasureChars(tkfont, source, rangeStart, -1, 0, &widthUntilStart);
TkDrawAngledChars(display, drawable, gc, tkfont, source + rangeStart,
rangeLength, x+cosA*widthUntilStart, y-sinA*widthUntilStart, angle);
}
void
TkUnixSetXftClipRegion(
TkRegion clipRegion) /* The clipping region to install. */

View File

@@ -50,9 +50,9 @@ static void DisplayVerticalValue(TkScale *scalePtr,
TkScale *
TkpCreateScale(
Tk_Window tkwin)
TCL_UNUSED(Tk_Window))
{
return ckalloc(sizeof(TkScale));
return (TkScale *)ckalloc(sizeof(TkScale));
}
/*
@@ -256,7 +256,7 @@ DisplayVerticalScale(
static void
DisplayVerticalValue(
register TkScale *scalePtr, /* Information about widget in which to
TkScale *scalePtr, /* Information about widget in which to
* display value. */
Drawable drawable, /* Pixmap or window in which to draw the
* value. */
@@ -267,7 +267,7 @@ DisplayVerticalValue(
* specified in pixels. */
const char *format) /* Format string to use for the value */
{
register Tk_Window tkwin = scalePtr->tkwin;
Tk_Window tkwin = scalePtr->tkwin;
int y, width, length;
char valueString[TCL_DOUBLE_SPACE];
Tk_FontMetrics fm;
@@ -325,7 +325,7 @@ DisplayHorizontalScale(
* to reflect the part of the window that was
* redrawn. */
{
register Tk_Window tkwin = scalePtr->tkwin;
Tk_Window tkwin = scalePtr->tkwin;
int x, y, width, height, shadowWidth;
double tickInterval = scalePtr->tickInterval;
Tk_3DBorder sliderBorder;
@@ -479,7 +479,7 @@ DisplayHorizontalScale(
static void
DisplayHorizontalValue(
register TkScale *scalePtr, /* Information about widget in which to
TkScale *scalePtr, /* Information about widget in which to
* display value. */
Drawable drawable, /* Pixmap or window in which to draw the
* value. */
@@ -490,7 +490,7 @@ DisplayHorizontalValue(
* in pixels. */
const char *format) /* Format string to use for the value */
{
register Tk_Window tkwin = scalePtr->tkwin;
Tk_Window tkwin = scalePtr->tkwin;
int x, y, length, width;
char valueString[TCL_DOUBLE_SPACE];
Tk_FontMetrics fm;
@@ -546,7 +546,7 @@ void
TkpDisplayScale(
ClientData clientData) /* Widget record for scale. */
{
TkScale *scalePtr = (TkScale *) clientData;
TkScale *scalePtr = (TkScale *)clientData;
Tk_Window tkwin = scalePtr->tkwin;
Tcl_Interp *interp = scalePtr->interp;
Pixmap pixmap;
@@ -575,7 +575,7 @@ TkpDisplayScale(
Tcl_DStringAppend(&buf, scalePtr->command, -1);
Tcl_DStringAppend(&buf, " ", -1);
Tcl_DStringAppend(&buf, string, -1);
result = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), -1, 0);
result = Tcl_EvalEx(interp, Tcl_DStringValue(&buf), -1, TCL_EVAL_GLOBAL);
Tcl_DStringFree(&buf);
if (result != TCL_OK) {
Tcl_AddErrorInfo(interp, "\n (command executed by scale)");

View File

@@ -63,7 +63,7 @@ TkScrollbar *
TkpCreateScrollbar(
Tk_Window tkwin)
{
UnixScrollbar *scrollPtr = ckalloc(sizeof(UnixScrollbar));
UnixScrollbar *scrollPtr = (UnixScrollbar *)ckalloc(sizeof(UnixScrollbar));
scrollPtr->troughGC = NULL;
scrollPtr->copyGC = NULL;
@@ -97,8 +97,8 @@ void
TkpDisplayScrollbar(
ClientData clientData) /* Information about window. */
{
register TkScrollbar *scrollPtr = (TkScrollbar *) clientData;
register Tk_Window tkwin = scrollPtr->tkwin;
TkScrollbar *scrollPtr = (TkScrollbar *)clientData;
Tk_Window tkwin = scrollPtr->tkwin;
XPoint points[7];
Tk_3DBorder border;
int relief, width, elementBorderWidth;
@@ -277,7 +277,7 @@ TkpDisplayScrollbar(
extern void
TkpComputeScrollbarGeometry(
register TkScrollbar *scrollPtr)
TkScrollbar *scrollPtr)
/* Scrollbar whose geometry may have
* changed. */
{
@@ -394,22 +394,22 @@ TkpDestroyScrollbar(
void
TkpConfigureScrollbar(
register TkScrollbar *scrollPtr)
TkScrollbar *scrollPtr)
/* Information about widget; may or may not
* already have values for some fields. */
{
XGCValues gcValues;
GC new;
GC newGC;
UnixScrollbar *unixScrollPtr = (UnixScrollbar *) scrollPtr;
Tk_SetBackgroundFromBorder(scrollPtr->tkwin, scrollPtr->bgBorder);
gcValues.foreground = scrollPtr->troughColorPtr->pixel;
new = Tk_GetGC(scrollPtr->tkwin, GCForeground, &gcValues);
newGC = Tk_GetGC(scrollPtr->tkwin, GCForeground, &gcValues);
if (unixScrollPtr->troughGC != NULL) {
Tk_FreeGC(scrollPtr->display, unixScrollPtr->troughGC);
}
unixScrollPtr->troughGC = new;
unixScrollPtr->troughGC = newGC;
if (unixScrollPtr->copyGC == NULL) {
gcValues.graphics_exposures = False;
unixScrollPtr->copyGC = Tk_GetGC(scrollPtr->tkwin,
@@ -437,12 +437,12 @@ TkpConfigureScrollbar(
int
TkpScrollbarPosition(
register TkScrollbar *scrollPtr,
TkScrollbar *scrollPtr,
/* Scrollbar widget record. */
int x, int y) /* Coordinates within scrollPtr's window. */
{
int length, width, tmp;
register const int inset = scrollPtr->inset;
const int inset = scrollPtr->inset;
if (scrollPtr->vertical) {
length = Tk_Height(scrollPtr->tkwin);

View File

@@ -240,17 +240,17 @@ TkSelGetSelection(
void
TkSelPropProc(
register XEvent *eventPtr) /* X PropertyChange event. */
XEvent *eventPtr) /* X PropertyChange event. */
{
register IncrInfo *incrPtr;
register TkSelHandler *selPtr;
IncrInfo *incrPtr;
TkSelHandler *selPtr;
int length, numItems;
unsigned long i;
Atom target, formatType;
long buffer[TK_SEL_WORDS_AT_ONCE];
TkDisplay *dispPtr = TkGetDisplay(eventPtr->xany.display);
Tk_ErrorHandler errorHandler;
ThreadSpecificData *tsdPtr =
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
/*
@@ -356,7 +356,7 @@ TkSelPropProc(
((char *) buffer)[numItems] = 0;
errorHandler = Tk_CreateErrorHandler(eventPtr->xproperty.display,
-1, -1, -1, (int (*)()) NULL, NULL);
-1, -1, -1, NULL, NULL);
/*
* Encode the data using the proper format for each type.
@@ -449,7 +449,7 @@ TkSelPropProc(
if (srcLen > 3) {
Tcl_Panic("selection conversion left too many bytes unconverted");
}
memcpy(incrPtr->converts[i].buffer, src, (size_t) srcLen+1);
memcpy(incrPtr->converts[i].buffer, src, srcLen + 1);
Tcl_DStringFree(&ds);
} else {
/*
@@ -519,10 +519,10 @@ TkSelPropProc(
void
TkSelEventProc(
Tk_Window tkwin, /* Window for which event was targeted. */
register XEvent *eventPtr) /* X event: either SelectionClear,
XEvent *eventPtr) /* X event: either SelectionClear,
* SelectionRequest, or SelectionNotify. */
{
register TkWindow *winPtr = (TkWindow *) tkwin;
TkWindow *winPtr = (TkWindow *) tkwin;
TkDisplay *dispPtr = winPtr->dispPtr;
Tcl_Interp *interp;
@@ -540,12 +540,11 @@ TkSelEventProc(
*/
if (eventPtr->type == SelectionNotify) {
register TkSelRetrievalInfo *retrPtr;
TkSelRetrievalInfo *retrPtr;
char *propInfo, **propInfoPtr = &propInfo;
Atom type;
int format, result;
unsigned long numItems, bytesAfter;
Tcl_DString ds;
for (retrPtr = pendingRetrievals; ; retrPtr = retrPtr->nextPtr) {
if (retrPtr == NULL) {
@@ -591,6 +590,7 @@ TkSelEventProc(
if ((type == XA_STRING) || (type == dispPtr->textAtom)
|| (type == dispPtr->compoundTextAtom)) {
Tcl_Encoding encoding;
Tcl_DString ds;
if (format != 8) {
Tcl_SetObjResult(retrPtr->interp, Tcl_ObjPrintf(
@@ -649,7 +649,7 @@ TkSelEventProc(
}
if (propInfo[numItems] != '\0') {
propData = ckalloc(numItems + 1);
propData = (char *)ckalloc(numItems + 1);
strcpy(propData, propInfo);
propData[numItems] = '\0';
}
@@ -742,7 +742,7 @@ static void
SelTimeoutProc(
ClientData clientData) /* Information about retrieval in progress. */
{
register TkSelRetrievalInfo *retrPtr = clientData;
TkSelRetrievalInfo *retrPtr = (TkSelRetrievalInfo *)clientData;
/*
* Make sure that the retrieval is still in progress. Then see how long
@@ -766,7 +766,7 @@ SelTimeoutProc(
retrPtr->result = TCL_ERROR;
} else {
retrPtr->timeout = Tcl_CreateTimerHandler(1000, SelTimeoutProc,
(ClientData) retrPtr);
retrPtr);
}
}
@@ -796,7 +796,7 @@ ConvertSelection(
* request; may not be selection's current
* owner, be we set it to the current
* owner. */
register XSelectionRequestEvent *eventPtr)
XSelectionRequestEvent *eventPtr)
/* Event describing request. */
{
union {
@@ -813,11 +813,11 @@ ConvertSelection(
Tk_ErrorHandler errorHandler;
TkSelectionInfo *infoPtr;
TkSelInProgress ip;
ThreadSpecificData *tsdPtr =
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
errorHandler = Tk_CreateErrorHandler(eventPtr->display, -1, -1,-1,
(int (*)()) NULL, NULL);
errorHandler = Tk_CreateErrorHandler(eventPtr->display, -1, -1,
-1, NULL, NULL);
/*
* Initialize the reply event.
@@ -893,12 +893,12 @@ ConvertSelection(
* below).
*/
incr.converts = ckalloc(incr.numConversions * sizeof(ConvertInfo));
incr.converts = (ConvertInfo *)ckalloc(incr.numConversions * sizeof(ConvertInfo));
incr.numIncrs = 0;
for (i = 0; i < incr.numConversions; i++) {
Atom target, property, type;
long buffer[TK_SEL_WORDS_AT_ONCE];
register TkSelHandler *selPtr;
TkSelHandler *selPtr;
int numItems, format;
char *propPtr;
@@ -919,7 +919,7 @@ ConvertSelection(
/*
* Nobody seems to know about this kind of request. If it's of a
* sort that we can handle without any help, do it. Otherwise mark
* the request as an errror.
* the request as an error.
*/
numItems = TkSelDefaultSelection(infoPtr, target, (char *) buffer,
@@ -1064,7 +1064,7 @@ ConvertSelection(
}
Tcl_DeleteTimerHandler(incr.timeout);
errorHandler = Tk_CreateErrorHandler(winPtr->display,
-1, -1, -1, (int (*)()) NULL, NULL);
-1, -1, -1, NULL, NULL);
XSelectInput(reply.xsel.display, reply.xsel.requestor, 0L);
Tk_DeleteErrorHandler(errorHandler);
if (tsdPtr->pendingIncrs == &incr) {
@@ -1124,9 +1124,9 @@ ConvertSelection(
static void
SelRcvIncrProc(
ClientData clientData, /* Information about retrieval. */
register XEvent *eventPtr) /* X PropertyChange event. */
XEvent *eventPtr) /* X PropertyChange event. */
{
register TkSelRetrievalInfo *retrPtr = clientData;
TkSelRetrievalInfo *retrPtr = (TkSelRetrievalInfo *)clientData;
char *propInfo, **propInfoPtr = &propInfo;
Atom type;
int format, result;
@@ -1374,7 +1374,7 @@ IncrTimeoutProc(
* retrieval for which we are selection
* owner. */
{
register IncrInfo *incrPtr = clientData;
IncrInfo *incrPtr = (IncrInfo *)clientData;
incrPtr->idleTime++;
if (incrPtr->idleTime >= 5) {
@@ -1435,7 +1435,7 @@ SelCvtToX(
if (Tcl_SplitList(NULL, string, &numFields, &field) != TCL_OK) {
return NULL;
}
propPtr = ckalloc(numFields * sizeof(long));
propPtr = (long *)ckalloc(numFields * sizeof(long));
/*
* Convert the fields one-by-one.
@@ -1487,7 +1487,7 @@ SelCvtToX(
static void
SelCvtFromX32(
register long *propPtr, /* Property value from X. */
long *propPtr, /* Property value from X. */
int numValues, /* Number of 32-bit values in property. */
Atom type, /* Type of property Should not be XA_STRING
* (if so, don't bother calling this function
@@ -1520,12 +1520,12 @@ SelCvtFromX32(
static void
SelCvtFromX8(
register char *propPtr, /* Property value from X. */
char *propPtr, /* Property value from X. */
int numValues, /* Number of 8-bit values in property. */
Atom type, /* Type of property Should not be XA_STRING
TCL_UNUSED(Atom), /* Type of property Should not be XA_STRING
* (if so, don't bother calling this function
* at all). */
Tk_Window tkwin, /* Window to use for atom conversion. */
TCL_UNUSED(Tk_Window), /* Window to use for atom conversion. */
Tcl_DString *dsPtr) /* Where to store the converted string. */
{
/*

View File

@@ -269,7 +269,7 @@ RegOpen(
handler = Tk_CreateErrorHandler(dispPtr->display, -1, -1, -1, NULL, NULL);
regPtr = ckalloc(sizeof(NameRegistry));
regPtr = (NameRegistry *)ckalloc(sizeof(NameRegistry));
regPtr->dispPtr = dispPtr;
regPtr->locked = 0;
regPtr->modified = 0;
@@ -479,7 +479,7 @@ RegAddName(
sprintf(id, "%x ", (unsigned) commWindow);
idLength = strlen(id);
newBytes = idLength + strlen(name) + 1;
newProp = ckalloc(regPtr->propLength + newBytes);
newProp = (char *)ckalloc(regPtr->propLength + newBytes);
strcpy(newProp, id);
strcpy(newProp+idLength, name);
if (regPtr->property != NULL) {
@@ -808,7 +808,7 @@ Tk_SetAppName(
const char *actualName;
Tcl_DString dString;
int offset, i;
ThreadSpecificData *tsdPtr =
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
interp = winPtr->mainPtr->interp;
@@ -830,7 +830,7 @@ Tk_SetAppName(
* the "send" command to the interpreter.
*/
riPtr = ckalloc(sizeof(RegisteredInterp));
riPtr = (RegisteredInterp *)ckalloc(sizeof(RegisteredInterp));
riPtr->interp = interp;
riPtr->dispPtr = winPtr->dispPtr;
riPtr->nextPtr = tsdPtr->interpListPtr;
@@ -914,7 +914,7 @@ Tk_SetAppName(
RegAddName(regPtr, actualName, Tk_WindowId(dispPtr->commTkwin));
RegClose(regPtr);
riPtr->name = ckalloc(strlen(actualName) + 1);
riPtr->name = (char *)ckalloc(strlen(actualName) + 1);
strcpy(riPtr->name, actualName);
if (actualName != name) {
Tcl_DStringFree(&dString);
@@ -943,7 +943,7 @@ Tk_SetAppName(
int
Tk_SendObjCmd(
ClientData clientData, /* Information about sender (only dispPtr
TCL_UNUSED(void *), /* Information about sender (only dispPtr
* field is used). */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
@@ -958,7 +958,7 @@ Tk_SendObjCmd(
TkWindow *winPtr;
Window commWindow;
PendingCommand pending;
register RegisteredInterp *riPtr;
RegisteredInterp *riPtr;
const char *destName;
int result, index, async, i, firstArg;
Tk_RestrictProc *prevProc;
@@ -967,7 +967,7 @@ Tk_SendObjCmd(
Tcl_Time timeout;
NameRegistry *regPtr;
Tcl_DString request;
ThreadSpecificData *tsdPtr =
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
Tcl_Interp *localInterp; /* Used when the interpreter to send the
* command to is within the same process. */
@@ -1175,7 +1175,7 @@ Tk_SendObjCmd(
msg = "target application died";
}
pending.code = TCL_ERROR;
pending.result = ckalloc(strlen(msg) + 1);
pending.result = (char *)ckalloc(strlen(msg) + 1);
strcpy(pending.result, msg);
pending.gotResponse = 1;
} else {
@@ -1356,7 +1356,7 @@ TkSendCleanup(
static int
SendInit(
Tcl_Interp *interp, /* Interpreter to use for error reporting (no
TCL_UNUSED(Tcl_Interp *), /* Interpreter to use for error reporting (no
* errors are ever returned, but the
* interpreter is needed anyway). */
TkDisplay *dispPtr) /* Display to initialize. */
@@ -1419,14 +1419,14 @@ SendEventProc(
ClientData clientData, /* Display information. */
XEvent *eventPtr) /* Information about event. */
{
TkDisplay *dispPtr = clientData;
TkDisplay *dispPtr = (TkDisplay *)clientData;
char *propInfo, **propInfoPtr = &propInfo;
const char *p;
int result, actualFormat;
unsigned long numItems, bytesAfter;
Atom actualType;
Tcl_Interp *remoteInterp; /* Interp in which to execute the command. */
ThreadSpecificData *tsdPtr =
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if ((eventPtr->xproperty.atom != dispPtr->commProperty)
@@ -1698,16 +1698,16 @@ SendEventProc(
}
pcPtr->code = code;
if (resultString != NULL) {
pcPtr->result = ckalloc(strlen(resultString) + 1);
pcPtr->result = (char *)ckalloc(strlen(resultString) + 1);
strcpy(pcPtr->result, resultString);
}
if (code == TCL_ERROR) {
if (errorInfo != NULL) {
pcPtr->errorInfo = ckalloc(strlen(errorInfo) + 1);
pcPtr->errorInfo = (char *)ckalloc(strlen(errorInfo) + 1);
strcpy(pcPtr->errorInfo, errorInfo);
}
if (errorCode != NULL) {
pcPtr->errorCode = ckalloc(strlen(errorCode) + 1);
pcPtr->errorCode = (char *)ckalloc(strlen(errorCode) + 1);
strcpy(pcPtr->errorCode, errorCode);
}
}
@@ -1774,15 +1774,14 @@ AppendPropCarefully(
* operation above.
*/
/* ARGSUSED */
static int
AppendErrorProc(
ClientData clientData, /* Command to mark complete, or NULL. */
XErrorEvent *errorPtr) /* Information about error. */
TCL_UNUSED(XErrorEvent *)) /* Information about error. */
{
PendingCommand *pendingPtr = clientData;
register PendingCommand *pcPtr;
ThreadSpecificData *tsdPtr =
PendingCommand *pendingPtr = (PendingCommand *)clientData;
PendingCommand *pcPtr;
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
if (pendingPtr == NULL) {
@@ -1796,7 +1795,7 @@ AppendErrorProc(
for (pcPtr = tsdPtr->pendingCommands; pcPtr != NULL;
pcPtr = pcPtr->nextPtr) {
if ((pcPtr == pendingPtr) && (pcPtr->result == NULL)) {
pcPtr->result = ckalloc(strlen(pcPtr->target) + 50);
pcPtr->result = (char *)ckalloc(strlen(pcPtr->target) + 50);
sprintf(pcPtr->result, "no application named \"%s\"",
pcPtr->target);
pcPtr->code = TCL_ERROR;
@@ -1829,10 +1828,10 @@ DeleteProc(
ClientData clientData) /* Info about registration, passed as
* ClientData. */
{
RegisteredInterp *riPtr = clientData;
register RegisteredInterp *riPtr2;
RegisteredInterp *riPtr = (RegisteredInterp *)clientData;
RegisteredInterp *riPtr2;
NameRegistry *regPtr;
ThreadSpecificData *tsdPtr =
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
regPtr = RegOpen(riPtr->interp, riPtr->dispPtr, 1);
@@ -1874,11 +1873,10 @@ DeleteProc(
*----------------------------------------------------------------------
*/
/* ARGSUSED */
static Tk_RestrictAction
SendRestrictProc(
ClientData clientData, /* Not used. */
register XEvent *eventPtr) /* Event that just arrived. */
TCL_UNUSED(void *), /* Not used. */
XEvent *eventPtr) /* Event that just arrived. */
{
TkDisplay *dispPtr;
@@ -1921,7 +1919,7 @@ UpdateCommWindow(
{
Tcl_DString names;
RegisteredInterp *riPtr;
ThreadSpecificData *tsdPtr =
ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
Tcl_DStringInit(&names);
@@ -1954,7 +1952,6 @@ UpdateCommWindow(
*----------------------------------------------------------------------
*/
/* ARGSUSED */
int
TkpTestsendCmd(
ClientData clientData, /* Main window for application. */
@@ -1968,7 +1965,7 @@ TkpTestsendCmd(
static const char *const testsendOptions[] = {
"bogus", "prop", "serial", NULL
};
TkWindow *winPtr = clientData;
TkWindow *winPtr = (TkWindow *)clientData;
Tk_ErrorHandler handler;
int index;

File diff suppressed because it is too large Load Diff