diff options
author | Keith Seitz <keiths@redhat.com> | 2002-09-25 02:02:52 +0000 |
---|---|---|
committer | Keith Seitz <keiths@redhat.com> | 2002-09-25 02:02:52 +0000 |
commit | 6fcbac2f9c48cbe5e8847313e8ae2b0acb45d19b (patch) | |
tree | 6061deee4ef48824f289a0f67ddc68f6e9de91ea | |
parent | a465013b9c780707078ffa190856ee36cff0ccad (diff) | |
download | gdb-6fcbac2f9c48cbe5e8847313e8ae2b0acb45d19b.tar.gz |
Remove files not from tk distribution and files no longer used in current
distribution (8.4.0).
-rwxr-xr-x | tk/configure | 994 | ||||
-rw-r--r-- | tk/configure.in | 28 | ||||
-rw-r--r-- | tk/doc/BackgdErr.3 | 58 | ||||
-rw-r--r-- | tk/doc/DoOneEvent.3 | 108 | ||||
-rw-r--r-- | tk/doc/DoWhenIdle.3 | 86 | ||||
-rw-r--r-- | tk/doc/GetFontStr.3 | 79 | ||||
-rw-r--r-- | tk/doc/Notifier.3 | 537 | ||||
-rw-r--r-- | tk/doc/Preserve.3 | 103 | ||||
-rw-r--r-- | tk/doc/after.n | 109 | ||||
-rw-r--r-- | tk/doc/exit.n | 28 | ||||
-rw-r--r-- | tk/doc/fileevent.n | 109 | ||||
-rw-r--r-- | tk/doc/update.n | 48 | ||||
-rw-r--r-- | tk/generic/patchlevel.h | 23 | ||||
-rw-r--r-- | tk/generic/tkPatch.h | 23 | ||||
-rw-r--r-- | tk/generic/tkSend.c | 1867 | ||||
-rw-r--r-- | tk/generic/tkXId.c | 495 | ||||
-rw-r--r-- | tk/library/folder.gif | bin | 79 -> 0 bytes | |||
-rw-r--r-- | tk/library/textfile.gif | bin | 79 -> 0 bytes | |||
-rw-r--r-- | tk/library/updir.xbm | 9 | ||||
-rw-r--r-- | tk/mac/tkMacScrollbar.c | 1610 | ||||
-rw-r--r-- | tk/mac/tkMacShLib.exp | 764 | ||||
-rw-r--r-- | tk/tests/defs.tcl | 1097 | ||||
-rw-r--r-- | tk/tests/unixSend.test | 679 | ||||
-rw-r--r-- | tk/unix/ChangeLog | 200 | ||||
-rw-r--r-- | tk/unix/porting.old | 324 | ||||
-rw-r--r-- | tk/win/tk.def | 1056 | ||||
-rw-r--r-- | tk/win/winDumpExts.c | 503 | ||||
-rw-r--r-- | tk/xlib/xcolors.h | 771 |
28 files changed, 0 insertions, 11708 deletions
diff --git a/tk/configure b/tk/configure deleted file mode 100755 index 131b608c790..00000000000 --- a/tk/configure +++ /dev/null @@ -1,994 +0,0 @@ -#! /bin/sh - -# Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.13 -# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. -# -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. - -# Defaults: -ac_help= -ac_default_prefix=/usr/local -# Any additions from configure.in: - -# Initialize some variables set by options. -# The variables have the same names as the options, with -# dashes changed to underlines. -build=NONE -cache_file=./config.cache -exec_prefix=NONE -host=NONE -no_create= -nonopt=NONE -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -sitefile= -srcdir= -target=NONE -verbose= -x_includes=NONE -x_libraries=NONE -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' -includedir='${prefix}/include' -oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' - -# Initialize some other variables. -subdirs= -MFLAGS= MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} -# Maximum number of lines to put in a shell here document. -ac_max_here_lines=12 - -ac_prev= -for ac_option -do - - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" - ac_prev= - continue - fi - - case "$ac_option" in - -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) ac_optarg= ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case "$ac_option" in - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir="$ac_optarg" ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build="$ac_optarg" ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file="$ac_optarg" ;; - - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) - datadir="$ac_optarg" ;; - - -disable-* | --disable-*) - ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - eval "enable_${ac_feature}=no" ;; - - -enable-* | --enable-*) - ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; - *) ac_optarg=yes ;; - esac - eval "enable_${ac_feature}='$ac_optarg'" ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix="$ac_optarg" ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he) - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat << EOF -Usage: configure [options] [host] -Options: [defaults in brackets after descriptions] -Configuration: - --cache-file=FILE cache test results in FILE - --help print this message - --no-create do not create output files - --quiet, --silent do not print \`checking...' messages - --site-file=FILE use FILE as the site file - --version print the version of autoconf that created configure -Directory and file names: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [same as prefix] - --bindir=DIR user executables in DIR [EPREFIX/bin] - --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] - --libexecdir=DIR program executables in DIR [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data in DIR - [PREFIX/share] - --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data in DIR - [PREFIX/com] - --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] - --libdir=DIR object code libraries in DIR [EPREFIX/lib] - --includedir=DIR C header files in DIR [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] - --infodir=DIR info documentation in DIR [PREFIX/info] - --mandir=DIR man documentation in DIR [PREFIX/man] - --srcdir=DIR find the sources in DIR [configure dir or ..] - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM - run sed PROGRAM on installed program names -EOF - cat << EOF -Host type: - --build=BUILD configure for building on BUILD [BUILD=HOST] - --host=HOST configure for HOST [guessed] - --target=TARGET configure for TARGET [TARGET=HOST] -Features and packages: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --x-includes=DIR X include files are in DIR - --x-libraries=DIR X library files are in DIR -EOF - if test -n "$ac_help"; then - echo "--enable and --with options recognized:$ac_help" - fi - exit 0 ;; - - -host | --host | --hos | --ho) - ac_prev=host ;; - -host=* | --host=* | --hos=* | --ho=*) - host="$ac_optarg" ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir="$ac_optarg" ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir="$ac_optarg" ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir="$ac_optarg" ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir="$ac_optarg" ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) - localstatedir="$ac_optarg" ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir="$ac_optarg" ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir="$ac_optarg" ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix="$ac_optarg" ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix="$ac_optarg" ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix="$ac_optarg" ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name="$ac_optarg" ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir="$ac_optarg" ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir="$ac_optarg" ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site="$ac_optarg" ;; - - -site-file | --site-file | --site-fil | --site-fi | --site-f) - ac_prev=sitefile ;; - -site-file=* | --site-file=* | --site-fil=* | --site-fi=* | --site-f=*) - sitefile="$ac_optarg" ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir="$ac_optarg" ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir="$ac_optarg" ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target="$ac_optarg" ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.13" - exit 0 ;; - - -with-* | --with-*) - ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; - *) ac_optarg=yes ;; - esac - eval "with_${ac_package}='$ac_optarg'" ;; - - -without-* | --without-*) - ac_package=`echo $ac_option|sed -e 's/-*without-//'` - # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - eval "with_${ac_package}=no" ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes="$ac_optarg" ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries="$ac_optarg" ;; - - -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } - ;; - - *) - if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then - echo "configure: warning: $ac_option: invalid host type" 1>&2 - fi - if test "x$nonopt" != xNONE; then - { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } - fi - nonopt="$ac_option" - ;; - - esac -done - -if test -n "$ac_prev"; then - { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } -fi - -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -# File descriptor usage: -# 0 standard input -# 1 file creation -# 2 errors and warnings -# 3 some systems may open it to /dev/tty -# 4 used on the Kubota Titan -# 6 checking for... messages and results -# 5 compiler messages saved in config.log -if test "$silent" = yes; then - exec 6>/dev/null -else - exec 6>&1 -fi -exec 5>./config.log - -echo "\ -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. -" 1>&5 - -# Strip out --no-create and --no-recursion so they do not pile up. -# Also quote any args containing shell metacharacters. -ac_configure_args= -for ac_arg -do - case "$ac_arg" in - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) ;; - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) - ac_configure_args="$ac_configure_args '$ac_arg'" ;; - *) ac_configure_args="$ac_configure_args $ac_arg" ;; - esac -done - -# NLS nuisances. -# Only set these to C if already set. These must not be set unconditionally -# because not all systems understand e.g. LANG=C (notably SCO). -# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! -# Non-C LC_CTYPE values break the ctype check. -if test "${LANG+set}" = set; then LANG=C; export LANG; fi -if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi -if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi -if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo > confdefs.h - -# A filename unique to this package, relative to the directory that -# configure is in, which we can look for to find out if srcdir is correct. -ac_unique_file=generic/tk.h - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then its parent. - ac_prog=$0 - ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` - test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. - srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r $srcdir/$ac_unique_file; then - if test "$ac_srcdir_defaulted" = yes; then - { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } - else - { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } - fi -fi -srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` - -# Prefer explicitly selected file to automatically selected ones. -if test -z "$sitefile"; then - if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi - fi -else - CONFIG_SITE="$sitefile" -fi -for ac_site_file in $CONFIG_SITE; do - if test -r "$ac_site_file"; then - echo "loading site script $ac_site_file" - . "$ac_site_file" - fi -done - -if test -r "$cache_file"; then - echo "loading cache $cache_file" - . $cache_file -else - echo "creating cache $cache_file" - > $cache_file -fi - -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -ac_exeext= -ac_objext=o -if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then - # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. - if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then - ac_n= ac_c=' -' ac_t=' ' - else - ac_n=-n ac_c= ac_t= - fi -else - ac_n= ac_c='\c' ac_t= -fi - - - -ac_aux_dir= -for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do - if test -f $ac_dir/install-sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f $ac_dir/install.sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - fi -done -if test -z "$ac_aux_dir"; then - { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } -fi -ac_config_guess=$ac_aux_dir/config.guess -ac_config_sub=$ac_aux_dir/config.sub -ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. - - -# Make sure we can run config.sub. -if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : -else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } -fi - -echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:563: checking host system type" >&5 - -host_alias=$host -case "$host_alias" in -NONE) - case $nonopt in - NONE) - if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : - else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } - fi ;; - *) host_alias=$nonopt ;; - esac ;; -esac - -host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` -host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$ac_t""$host" 1>&6 - - -case "${host}" in -*cygwin* | *mingw32* | *windows32*) - CONFIGDIR="win" - - ;; -*) - CONFIGDIR="unix" - - ac_aux_dir= -for ac_dir in $CONFIGDIR $srcdir/$CONFIGDIR; do - if test -f $ac_dir/install-sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f $ac_dir/install.sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - fi -done -if test -z "$ac_aux_dir"; then - { echo "configure: error: can not find install-sh or install.sh in $CONFIGDIR $srcdir/$CONFIGDIR" 1>&2; exit 1; } -fi -ac_config_guess=$ac_aux_dir/config.guess -ac_config_sub=$ac_aux_dir/config.sub -ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. - - ;; -esac - -echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:615: checking whether ${MAKE-make} sets \${MAKE}" >&5 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftestmake <<\EOF -all: - @echo 'ac_maketemp="${MAKE}"' -EOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` -if test -n "$ac_maketemp"; then - eval ac_cv_prog_make_${ac_make}_set=yes -else - eval ac_cv_prog_make_${ac_make}_set=no -fi -rm -f conftestmake -fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$ac_t""yes" 1>&6 - SET_MAKE= -else - echo "$ac_t""no" 1>&6 - SET_MAKE="MAKE=${MAKE-make}" -fi - -subdirs="$CONFIGDIR" - -trap '' 1 2 15 -cat > confcache <<\EOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs. It is not useful on other systems. -# If it contains results you don't want to keep, you may remove or edit it. -# -# By default, configure uses ./config.cache as the cache file, -# creating it if it does not exist already. You can give configure -# the --cache-file=FILE option to use a different cache file; that is -# what configure does when it calls configure scripts in -# subdirectories, so they share the cache. -# Giving --cache-file=/dev/null disables caching, for debugging configure. -# config.status only pays attention to the cache file if you give it the -# --recheck option to rerun configure. -# -EOF -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -(set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote substitution - # turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - -e "s/'/'\\\\''/g" \ - -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' - ;; - esac >> confcache -if cmp -s $cache_file confcache; then - : -else - if test -w $cache_file; then - echo "updating cache $cache_file" - cat confcache > $cache_file - else - echo "not updating unwritable cache $cache_file" - fi -fi -rm -f confcache - -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -# Any assignment to VPATH causes Sun make to only execute -# the first set of double-colon rules, so remove it if not needed. -# If there is a colon in the path, we need to keep it. -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' -fi - -trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 - -# Transform confdefs.h into DEFS. -# Protect against shell expansion while executing Makefile rules. -# Protect against Makefile macro expansion. -cat > conftest.defs <<\EOF -s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g -s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g -s%\[%\\&%g -s%\]%\\&%g -s%\$%$$%g -EOF -DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` -rm -f conftest.defs - - -# Without the "./", some shells look in PATH for config.status. -: ${CONFIG_STATUS=./config.status} - -echo creating $CONFIG_STATUS -rm -f $CONFIG_STATUS -cat > $CONFIG_STATUS <<EOF -#! /bin/sh -# Generated automatically by configure. -# Run this file to recreate the current configuration. -# This directory was configured as follows, -# on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -# -# $0 $ac_configure_args -# -# Compiler output produced by configure, useful for debugging -# configure, is in ./config.log if it exists. - -ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" -for ac_option -do - case "\$ac_option" in - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" - exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; - -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.13" - exit 0 ;; - -help | --help | --hel | --he | --h) - echo "\$ac_cs_usage"; exit 0 ;; - *) echo "\$ac_cs_usage"; exit 1 ;; - esac -done - -ac_given_srcdir=$srcdir - -trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 -EOF -cat >> $CONFIG_STATUS <<EOF - -# Protect against being on the right side of a sed subst in config.status. -sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g; - s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF -$ac_vpsub -$extrasub -s%@SHELL@%$SHELL%g -s%@CFLAGS@%$CFLAGS%g -s%@CPPFLAGS@%$CPPFLAGS%g -s%@CXXFLAGS@%$CXXFLAGS%g -s%@FFLAGS@%$FFLAGS%g -s%@DEFS@%$DEFS%g -s%@LDFLAGS@%$LDFLAGS%g -s%@LIBS@%$LIBS%g -s%@exec_prefix@%$exec_prefix%g -s%@prefix@%$prefix%g -s%@program_transform_name@%$program_transform_name%g -s%@bindir@%$bindir%g -s%@sbindir@%$sbindir%g -s%@libexecdir@%$libexecdir%g -s%@datadir@%$datadir%g -s%@sysconfdir@%$sysconfdir%g -s%@sharedstatedir@%$sharedstatedir%g -s%@localstatedir@%$localstatedir%g -s%@libdir@%$libdir%g -s%@includedir@%$includedir%g -s%@oldincludedir@%$oldincludedir%g -s%@infodir@%$infodir%g -s%@mandir@%$mandir%g -s%@host@%$host%g -s%@host_alias@%$host_alias%g -s%@host_cpu@%$host_cpu%g -s%@host_vendor@%$host_vendor%g -s%@host_os@%$host_os%g -s%@CONFIGDIR@%$CONFIGDIR%g -s%@SET_MAKE@%$SET_MAKE%g -s%@subdirs@%$subdirs%g - -CEOF -EOF - -cat >> $CONFIG_STATUS <<\EOF - -# Split the substitutions into bite-sized pieces for seds with -# small command number limits, like on Digital OSF/1 and HP-UX. -ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. -ac_file=1 # Number of current file. -ac_beg=1 # First line for current file. -ac_end=$ac_max_sed_cmds # Line after last line for current file. -ac_more_lines=: -ac_sed_cmds="" -while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file - else - sed "${ac_end}q" conftest.subs > conftest.s$ac_file - fi - if test ! -s conftest.s$ac_file; then - ac_more_lines=false - rm -f conftest.s$ac_file - else - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f conftest.s$ac_file" - else - ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" - fi - ac_file=`expr $ac_file + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_cmds` - fi -done -if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat -fi -EOF - -cat >> $CONFIG_STATUS <<EOF - -CONFIG_FILES=\${CONFIG_FILES-"Makefile"} -EOF -cat >> $CONFIG_STATUS <<\EOF -for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; - esac - - # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. - - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" - # A "../" for each directory in $ac_dir_suffix. - ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` - else - ac_dir_suffix= ac_dots= - fi - - case "$ac_given_srcdir" in - .) srcdir=. - if test -z "$ac_dots"; then top_srcdir=. - else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; - /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; - *) # Relative path. - srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" - top_srcdir="$ac_dots$ac_given_srcdir" ;; - esac - - - echo creating "$ac_file" - rm -f "$ac_file" - configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." - case "$ac_file" in - *Makefile*) ac_comsub="1i\\ -# $configure_input" ;; - *) ac_comsub= ;; - esac - - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - sed -e "$ac_comsub -s%@configure_input@%$configure_input%g -s%@srcdir@%$srcdir%g -s%@top_srcdir@%$top_srcdir%g -" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file -fi; done -rm -f conftest.s* - -EOF -cat >> $CONFIG_STATUS <<EOF - -EOF -cat >> $CONFIG_STATUS <<\EOF - -exit 0 -EOF -chmod +x $CONFIG_STATUS -rm -fr confdefs* $ac_clean_files -test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 - -if test "$no_recursion" != yes; then - - # Remove --cache-file and --srcdir arguments so they do not pile up. - ac_sub_configure_args= - ac_prev= - for ac_arg in $ac_configure_args; do - if test -n "$ac_prev"; then - ac_prev= - continue - fi - case "$ac_arg" in - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - ;; - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - ;; - *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;; - esac - done - - for ac_config_dir in $CONFIGDIR; do - - # Do not complain, so a configure script can configure whichever - # parts of a large source tree are present. - if test ! -d $srcdir/$ac_config_dir; then - continue - fi - - echo configuring in $ac_config_dir - - case "$srcdir" in - .) ;; - *) - if test -d ./$ac_config_dir || mkdir ./$ac_config_dir; then :; - else - { echo "configure: error: can not create `pwd`/$ac_config_dir" 1>&2; exit 1; } - fi - ;; - esac - - ac_popdir=`pwd` - cd $ac_config_dir - - # A "../" for each directory in /$ac_config_dir. - ac_dots=`echo $ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'` - - case "$srcdir" in - .) # No --srcdir option. We are building in place. - ac_sub_srcdir=$srcdir ;; - /*) # Absolute path. - ac_sub_srcdir=$srcdir/$ac_config_dir ;; - *) # Relative path. - ac_sub_srcdir=$ac_dots$srcdir/$ac_config_dir ;; - esac - - # Check for guested configure; otherwise get Cygnus style configure. - if test -f $ac_sub_srcdir/configure; then - ac_sub_configure=$ac_sub_srcdir/configure - elif test -f $ac_sub_srcdir/configure.in; then - ac_sub_configure=$ac_configure - else - echo "configure: warning: no configuration information is in $ac_config_dir" 1>&2 - ac_sub_configure= - fi - - # The recursion is here. - if test -n "$ac_sub_configure"; then - - # Make the cache file name correct relative to the subdirectory. - case "$cache_file" in - /*) ac_sub_cache_file=$cache_file ;; - *) # Relative path. - ac_sub_cache_file="$ac_dots$cache_file" ;; - esac - - echo "running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir" - # The eval makes quoting arguments work. - if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir - then : - else - { echo "configure: error: $ac_sub_configure failed for $ac_config_dir" 1>&2; exit 1; } - fi - fi - - cd $ac_popdir - done -fi - - diff --git a/tk/configure.in b/tk/configure.in deleted file mode 100644 index d8856d5b03f..00000000000 --- a/tk/configure.in +++ /dev/null @@ -1,28 +0,0 @@ -dnl This file is used as input to autoconf to generate configure. -dnl The only reason we need this is that the Tk directory structure -dnl changed in 7.5, and this change lets us avoid changing the -dnl configuration superstructure. -dnl Tom Tromey <tromey@cygnus.com> - -AC_PREREQ(2.5) - -AC_INIT(generic/tk.h) - -AC_CANONICAL_HOST - -case "${host}" in -*cygwin* | *mingw32* | *windows32*) - CONFIGDIR="win" - AC_SUBST(CONFIGDIR) - ;; -*) - CONFIGDIR="unix" - AC_SUBST(CONFIGDIR) - AC_CONFIG_AUX_DIR($CONFIGDIR) - ;; -esac - -AC_PROG_MAKE_SET -AC_CONFIG_SUBDIRS($CONFIGDIR) -AC_OUTPUT(Makefile) - diff --git a/tk/doc/BackgdErr.3 b/tk/doc/BackgdErr.3 deleted file mode 100644 index 005f5b609b4..00000000000 --- a/tk/doc/BackgdErr.3 +++ /dev/null @@ -1,58 +0,0 @@ -'\" -'\" Copyright (c) 1992-1994 The Regents of the University of California. -'\" Copyright (c) 1994-1996 Sun Microsystems, Inc. -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -'\" SCCS: @(#) BackgdErr.3 1.3 96/03/25 19:56:51 -'\" -.so man.macros -.TH Tcl_BackgroundError 3 7.5 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_BackgroundError \- report Tcl error that occurred in background processing -.SH SYNOPSIS -.nf -\fB#include <tcl.h>\fR -.sp -\fBTcl_BackgroundError\fR(\fIinterp\fR) -.SH ARGUMENTS -.AS Tcl_Interp *interp -.AP Tcl_Interp *interp in -Interpreter in which the error occurred. -.BE - -.SH DESCRIPTION -.PP -This procedure is typically invoked when a Tcl error occurs during -``background processing'' such as executing an event handler. -When such an error occurs, the error condition is reported to Tcl -or to a widget or some other C code, and there is not usually any -obvious way for that code to report the error to the user. -In these cases the code calls \fBTcl_BackgroundError\fR with an -\fIinterp\fR argument identifying the interpreter in which the -error occurred. At the time \fBTcl_BackgroundError\fR is invoked, -\fIinterp->result\fR is expected to contain an error message. -\fBTcl_BackgroundError\fR will invoke the \fBbgerror\fR -Tcl command to report the error in an application-specific fashion. -If no \fBbgerror\fR command exists, or if it returns with an error condition, -then \fBTcl_BackgroundError\fR reports the error itself by printing -a message on the standard error file. -.PP -\fBTcl_BackgroundError\fR does not invoke \fBbgerror\fR immediately -because this could potentially interfere with scripts that are in process -at the time the error occurred. -Instead, it invokes \fBbgerror\fR later as an idle callback. -\fBTcl_BackgroundError\fR saves the values of the \fBerrorInfo\fR and -\fBerrorCode\fR variables and restores these values just before -invoking \fBbgerror\fR. -.PP -It is possible for many background errors to accumulate before -\fBbgerror\fR is invoked. When this happens, each of the errors -is processed in order. However, if \fBbgerror\fR returns a -break exception, then all remaining error reports for the -interpreter are skipped. - -.SH KEYWORDS -background, bgerror, error diff --git a/tk/doc/DoOneEvent.3 b/tk/doc/DoOneEvent.3 deleted file mode 100644 index fd092c8b8c2..00000000000 --- a/tk/doc/DoOneEvent.3 +++ /dev/null @@ -1,108 +0,0 @@ -'\" -'\" Copyright (c) 1990-1992 The Regents of the University of California. -'\" Copyright (c) 1994-1996 Sun Microsystems, Inc. -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -'\" SCCS: @(#) DoOneEvent.3 1.6 97/05/09 18:12:05 -'\" -.so man.macros -.TH Tcl_DoOneEvent 3 7.5 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_DoOneEvent \- wait for events and invoke event handlers -.SH SYNOPSIS -.nf -\fB#include <tcl.h>\fR -.sp -int -\fBTcl_DoOneEvent\fR(\fIflags\fR) -.SH ARGUMENTS -.AS int flags -.AP int flags in -This parameter is normally zero. It may be an OR-ed combination -of any of the following flag bits: -TCL_WINDOW_EVENTS, -TCL_FILE_EVENTS, TCL_TIMER_EVENTS, TCL_IDLE_EVENTS, TCL_ALL_EVENTS, or -TCL_DONT_WAIT. -.BE - -.SH DESCRIPTION -.PP -This procedure is the entry point to Tcl's event loop; it is responsible for -waiting for events and dispatching event handlers created with -procedures such as \fBTk_CreateEventHandler\fR, \fBTcl_CreateFileHandler\fR, -\fBTcl_CreateTimerHandler\fR, and \fBTcl_DoWhenIdle\fR. -\fBTcl_DoOneEvent\fR checks to see if -events are already present on the Tcl event queue; if so, -it calls the handler(s) for the first (oldest) event, removes it from -the queue, and returns. -If there are no events ready to be handled, then \fBTcl_DoOneEvent\fR -checks for new events from all possible sources. -If any are found, it puts all of them on Tcl's event queue, calls -handlers for the first event on the queue, and returns. -If no events are found, \fBTcl_DoOneEvent\fR checks for \fBTcl_DoWhenIdle\fR -callbacks; if any are found, it invokes all of them and returns. -Finally, if no events or idle callbacks have been found, then -\fBTcl_DoOneEvent\fR sleeps until an event occurs; then it adds any -new events to the Tcl event queue, calls handlers for the first event, -and returns. -The normal return value is 1 to signify that some event -was processed (see below for other alternatives). -.PP -If the \fIflags\fR argument to \fBTcl_DoOneEvent\fR is non-zero, -it restricts the kinds of events that will be processed by -\fBTcl_DoOneEvent\fR. -\fIFlags\fR may be an OR-ed combination of any of the following bits: -.TP 27 -\fBTCL_WINDOW_EVENTS\fR \- -Process window system events. -.TP 27 -\fBTCL_FILE_EVENTS\fR \- -Process file events. -.TP 27 -\fBTCL_TIMER_EVENTS\fR \- -Process timer events. -.TP 27 -\fBTCL_IDLE_EVENTS\fR \- -Process idle callbacks. -.TP 27 -\fBTCL_ALL_EVENTS\fR \- -Process all kinds of events: equivalent to OR-ing together all of the -above flags or specifying none of them. -.TP 27 -\fBTCL_DONT_WAIT\fR \- -Don't sleep: process only events that are ready at the time of the -call. -.LP -If any of the flags \fBTCL_WINDOW_EVENTS\fR, \fBTCL_FILE_EVENTS\fR, -\fBTCL_TIMER_EVENTS\fR, or \fBTCL_IDLE_EVENTS\fR is set, then the only -events that will be considered are those for which flags are set. -Setting none of these flags is equivalent to the value -\fBTCL_ALL_EVENTS\fR, which causes all event types to be processed. -If an application has defined additional event sources with -\fBTcl_CreateEventSource\fR, then additional \fIflag\fR values -may also be valid, depending on those event sources. -.PP -The \fBTCL_DONT_WAIT\fR flag causes \fBTcl_DoOneEvent\fR not to put -the process to sleep: it will check for events but if none are found -then it returns immediately with a return value of 0 to indicate -that no work was done. -\fBTcl_DoOneEvent\fR will also return 0 without doing anything if -the only alternative is to block forever (this can happen, for example, -if \fIflags\fR is \fBTCL_IDLE_EVENTS\fR and there are no -\fBTcl_DoWhenIdle\fR callbacks pending, or if no event handlers or -timer handlers exist). -.PP -\fBTcl_DoOneEvent\fR may be invoked recursively. For example, -it is possible to invoke \fBTcl_DoOneEvent\fR recursively -from a handler called by \fBTcl_DoOneEvent\fR. This sort -of operation is useful in some modal situations, such -as when a -notification dialog has been popped up and an application wishes to -wait for the user to click a button in the dialog before -doing anything else. - -.SH KEYWORDS -callback, event, handler, idle, timer diff --git a/tk/doc/DoWhenIdle.3 b/tk/doc/DoWhenIdle.3 deleted file mode 100644 index c909026d6c9..00000000000 --- a/tk/doc/DoWhenIdle.3 +++ /dev/null @@ -1,86 +0,0 @@ -'\" -'\" Copyright (c) 1990 The Regents of the University of California. -'\" Copyright (c) 1994-1996 Sun Microsystems, Inc. -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -'\" SCCS: @(#) DoWhenIdle.3 1.6 97/05/09 18:18:33 -'\" -.so man.macros -.TH Tcl_DoWhenIdle 3 7.5 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_DoWhenIdle, Tcl_CancelIdleCall \- invoke a procedure when there are no pending events -.SH SYNOPSIS -.nf -\fB#include <tcl.h>\fR -.sp -\fBTcl_DoWhenIdle\fR(\fIproc, clientData\fR) -.sp -\fBTcl_CancelIdleCall\fR(\fIproc, clientData\fR) -.SH ARGUMENTS -.AS Tcl_IdleProc clientData -.AP Tcl_IdleProc *proc in -Procedure to invoke. -.AP ClientData clientData in -Arbitrary one-word value to pass to \fIproc\fR. -.BE - -.SH DESCRIPTION -.PP -\fBTcl_DoWhenIdle\fR arranges for \fIproc\fR to be invoked -when the application becomes idle. The application is -considered to be idle when \fBTcl_DoOneEvent\fR has been -called, couldn't find any events to handle, and is about -to go to sleep waiting for an event to occur. At this -point all pending \fBTcl_DoWhenIdle\fR handlers are -invoked. For each call to \fBTcl_DoWhenIdle\fR there will -be a single call to \fIproc\fR; after \fIproc\fR is -invoked the handler is automatically removed. -\fBTcl_DoWhenIdle\fR is only usable in programs that -use \fBTcl_DoOneEvent\fR to dispatch events. -.PP -\fIProc\fR should have arguments and result that match the -type \fBTcl_IdleProc\fR: -.CS -typedef void Tcl_IdleProc(ClientData \fIclientData\fR); -.CE -The \fIclientData\fR parameter to \fIproc\fR is a copy of the \fIclientData\fR -argument given to \fBTcl_DoWhenIdle\fR. Typically, \fIclientData\fR -points to a data structure containing application-specific information about -what \fIproc\fR should do. -.PP -\fBTcl_CancelIdleCall\fR -may be used to cancel one or more previous -calls to \fBTcl_DoWhenIdle\fR: if there is a \fBTcl_DoWhenIdle\fR -handler registered for \fIproc\fR and \fIclientData\fR, then it -is removed without invoking it. If there is more than one -handler on the idle list that refers to \fIproc\fR and \fIclientData\fR, -all of the handlers are removed. If no existing handlers match -\fIproc\fR and \fIclientData\fR then nothing happens. -.PP -\fBTcl_DoWhenIdle\fR is most useful in situations where -(a) a piece of work will have to be done but (b) it's -possible that something will happen in the near future -that will change what has to be done or require something -different to be done. \fBTcl_DoWhenIdle\fR allows the -actual work to be deferred until all pending events have -been processed. At this point the exact work to be done -will presumably be known and it can be done exactly once. -.PP -For example, \fBTcl_DoWhenIdle\fR might be used by an editor -to defer display updates until all pending commands have -been processed. Without this feature, redundant redisplays -might occur in some situations, such as the processing of -a command file. -.SH BUGS -.PP -At present it is not safe for an idle callback to reschedule itself -continuously. This will interact badly with certain features of Tk -that attempt to wait for all idle callbacks to complete. If you would -like for an idle callback to reschedule itself continuously, it is -better to use a timer handler with a zero timeout period. - -.SH KEYWORDS -callback, defer, idle callback diff --git a/tk/doc/GetFontStr.3 b/tk/doc/GetFontStr.3 deleted file mode 100644 index 32783533346..00000000000 --- a/tk/doc/GetFontStr.3 +++ /dev/null @@ -1,79 +0,0 @@ -'\" -'\" Copyright (c) 1990-1992 The Regents of the University of California. -'\" Copyright (c) 1994-1996 Sun Microsystems, Inc. -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -'\" SCCS: @(#) GetFontStr.3 1.10 96/03/26 18:10:03 -'\" -.so man.macros -.TH Tk_GetFontStruct 3 "" Tk "Tk Library Procedures" -.BS -.SH NAME -Tk_GetFontStruct, Tk_NameOfFontStruct, Tk_FreeFontStruct \- maintain database of fonts -.SH SYNOPSIS -.nf -\fB#include <tk.h>\fR -.sp -XFontStruct * -\fBTk_GetFontStruct(\fIinterp, tkwin, nameId\fB)\fR -.sp -char * -\fBTk_NameOfFontStruct(\fIfontStructPtr\fB)\fR -.sp -\fBTk_FreeFontStruct(\fIfontStructPtr\fB)\fR -.SH ARGUMENTS -.AS "XFontStruct" *fontStructPtr -.AP Tcl_Interp *interp in -Interpreter to use for error reporting. -.AP Tk_Window tkwin in -Token for window in which font will be used. -.AP Tk_Uid nameId in -Name of desired font. -.AP XFontStruct *fontStructPtr in -Font structure to return name for or delete. -.BE - -.SH DESCRIPTION -.PP -\fBTk_GetFont\fR loads the font indicated -by \fInameId\fR and returns a pointer to information about the -font. The pointer returned by \fBTk_GetFont\fR -will remain valid until \fBTk_FreeFont\fR -is called to release it. -\fINameId\fR can be either a font name or pattern; any -value that could be passed to \fBXLoadQueryFont\fR may be -passed to \fBTk_GetFont\fR. If \fBTk_GetFont\fR is unsuccessful -(because, for example, there is no font corresponding to -\fInameId\fR) then it returns \fBNULL\fR and stores an error -message in \fIinterp->result\fR. -.PP -\fBTk_GetFont\fR maintains a database of all fonts it has allocated. -If the same \fInameId\fR is requested multiple times (e.g. by -different windows or for different purposes), then additional -calls for the same \fInameId\fR will be handled very quickly, without -involving the X server. For this reason, it is generally better -to use \fBTk_GetFont\fR in place of X library procedures like -\fBXLoadQueryFont\fR. -.PP -The procedure \fBTk_NameOfFontStruct\fR is roughly the inverse of -\fBTk_GetFontStruct\fR. If its \fIfontStructPtr\fR argument was created -by \fBTk_GetFontStruct\fR, then the return value is the \fInameId\fR -argument that was passed to \fBTk_GetFontStruct\fR to create the -font. If \fIfontStructPtr\fR was not created by a call -to \fBTk_GetFontStruct\fR, then the return value is a hexadecimal string -giving the X identifier for the associated font. -Note: the string returned by \fBTk_NameOfFontStruct\fR is -only guaranteed to persist until the next call to \fBTk_NameOfFontStruct\fR. -.PP -When a font returned by \fBTk_GetFont\fR is no longer -needed, \fBTk_FreeFont\fR should be called to release it. -There should be exactly one call to \fBTk_FreeFont\fR for -each call to \fBTk_GetFont\fR. When a font is no longer in -use anywhere (i.e. it has been freed as many times as it has been gotten) -\fBTk_FreeFont\fR will release it to the X server and delete it from -the database. - -.SH KEYWORDS -font diff --git a/tk/doc/Notifier.3 b/tk/doc/Notifier.3 deleted file mode 100644 index 5016200ab62..00000000000 --- a/tk/doc/Notifier.3 +++ /dev/null @@ -1,537 +0,0 @@ -'\" -'\" Copyright (c) 1995-1997 Sun Microsystems, Inc. -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -'\" SCCS: @(#) Notifier.3 1.16 97/05/17 17:03:17 -'\" -.so man.macros -.TH Notifier 3 8.0 Tcl "Tcl Library Procedures" -.BS -.VS -.SH NAME -Tcl_CreateEventSource, Tcl_DeleteEventSource, Tcl_SetMaxBlockTime, Tcl_QueueEvent, Tcl_DeleteEvents, Tcl_WaitForEvent, Tcl_SetTimer, Tcl_ServiceAll, Tcl_ServiceEvent, Tcl_GetServiceMode, Tcl_SetServiceMode \- the event queue and notifier interfaces - -.SH SYNOPSIS -.nf -\fB#include <tcl.h>\fR -.sp -\fBTcl_CreateEventSource\fR(\fIsetupProc, checkProc, clientData\fB)\fR -.sp -\fBTcl_DeleteEventSource\fR(\fIsetupProc, checkProc, clientData\fB)\fR -.sp -\fBTcl_SetMaxBlockTime\fR(\fItimePtr\fB)\fR -.sp -\fBTcl_QueueEvent\fR(\fIevPtr, position\fR) -.VS -.sp -\fBTcl_DeleteEvents\fR(\fIdeleteProc, clientData\fR) -.sp -int -\fBTcl_WaitForEvent\fR(\fItimePtr\fR) -.sp -\fBTcl_SetTimer\fR(\fItimePtr\fR) -.sp -int -\fBTcl_ServiceAll\fR() -.sp -int -\fBTcl_ServiceEvent\fR(\fIflags\fR) -.sp -int -\fBTcl_GetServiceMode\fR() -.sp -int -\fBTcl_SetServiceMode\fR(\fImode\fR) -.VE - -.SH ARGUMENTS -.AS Tcl_EventDeleteProc milliseconds -.AS Tcl_EventSetupProc *setupProc -.AP Tcl_EventSetupProc *setupProc in -Procedure to invoke to prepare for event wait in \fBTcl_DoOneEvent\fR. -.AP Tcl_EventCheckProc *checkProc in -Procedure for \fBTcl_DoOneEvent\fR to invoke after waiting for -events. Checks to see if any events have occurred and, if so, -queues them. -.AP ClientData clientData in -Arbitrary one-word value to pass to \fIsetupProc\fR, \fIcheckProc\fR, or -\fIdeleteProc\fR. -.AP Tcl_Time *timePtr in -Indicates the maximum amount of time to wait for an event. This -is specified as an interval (how long to wait), not an absolute -time (when to wakeup). If the pointer passed to \fBTcl_WaitForEvent\fR -is NULL, it means there is no maximum wait time: wait forever if -necessary. -.AP Tcl_Event *evPtr in -An event to add to the event queue. The storage for the event must -have been allocated by the caller using \fBTcl_Alloc\fR or \fBckalloc\fR. -.AP Tcl_QueuePosition position in -Where to add the new event in the queue: \fBTCL_QUEUE_TAIL\fR, -\fBTCL_QUEUE_HEAD\fR, or \fBTCL_QUEUE_MARK\fR. -.AP int flags in -What types of events to service. These flags are the same as those -passed to \fBTcl_DoOneEvent\fR. -.AP Tcl_EventDeleteProc *deleteProc in -Procedure to invoke for each queued event in \fBTcl_DeleteEvents\fR. -.VS -.AP int mode in -Inidicates whether events should be serviced by \fBTcl_ServiceAll\fR. -Must be one of \fBTCL_SERVICE_NONE\fR or \fBTCL_SERVICE_ALL\fR. -.VE -.BE - -.SH INTRODUCTION -.PP -.VS -The interfaces described here are used to customize the Tcl event -loop. The two most common customizations are to add new sources of -events and to merge Tcl's event loop with some other event loop, such -as one provided by an application in which Tcl is embedded. Each of -these tasks is described in a separate section below. -.VE -.PP -The procedures in this manual entry are the building blocks out of which -the Tcl event notifier is constructed. The event notifier is the lowest -layer in the Tcl event mechanism. It consists of three things: -.IP [1] -Event sources: these represent the ways in which events can be -generated. For example, there is a timer event source that implements -the \fBTcl_CreateTimerHandler\fR procedure and the \fBafter\fR -command, and there is a file event source that implements the -\fBTcl_CreateFileHandler\fR procedure on Unix systems. An event -source must work with the notifier to detect events at the right -times, record them on the event queue, and eventually notify -higher-level software that they have occurred. The procedures -\fBTcl_CreateEventSource\fR, \fBTcl_DeleteEventSource\fR, -and \fBTcl_SetMaxBlockTime\fR, \fBTcl_QueueEvent\fR, and -\fBTcl_DeleteEvents\fR are used primarily by event sources. -.IP [2] -The event queue: there is a single queue for the whole application, -containing events that have been detected but not yet serviced. Event -sources place events onto the queue so that they may be processed in -order at appropriate times during the event loop. The event queue -guarantees a fair discipline of event handling, so that no event -source can starve the others. It also allows events to be saved for -servicing at a future time. -.VS -\fBTcl_QueueEvent\fR is used (primarily -by event sources) to add events to the event queue and -\fBTcl_DeleteEvents\fR is used to remove events from the queue without -processing them. -.IP [3] -The event loop: in order to detect and process events, the application -enters a loop that waits for events to occur, places them on the event -queue, and then processes them. Most applications will do this by -calling the procedure \fBTcl_DoOneEvent\fR, which is described in a -separate manual entry. -.PP -Most Tcl applications need not worry about any of the internals of -the Tcl notifier. However, the notifier now has enough flexibility -to be retargeted either for a new platform or to use an external event -loop (such as the Motif event loop, when Tcl is embedded in a Motif -application). The procedures \fBTcl_WaitForEvent\fR and -\fBTcl_SetTimer\fR are normally implemented by Tcl, but may be -replaced with new versions to retarget the notifier (the \fBTcl_Sleep\fR, -\fBTcl_CreateFileHandler\fR, and \fBTcl_DeleteFileHandler\fR must -also be replaced; see CREATING A NEW NOTIFIER below for details). -The procedures \fBTcl_ServiceAll\fR, \fBTcl_ServiceEvent\fR, -\fBTcl_GetServiceMode\fR, and \fBTcl_SetServiceMode\fR are provided -to help connect Tcl's event loop to an external event loop such as -Motif's. -.SH "NOTIFIER BASICS" -.VE -.PP -The easiest way to understand how the notifier works is to consider -what happens when \fBTcl_DoOneEvent\fR is called. -\fBTcl_DoOneEvent\fR is passed a \fIflags\fR argument that indicates -what sort of events it is OK to process and also whether or not to -block if no events are ready. \fBTcl_DoOneEvent\fR does the following -things: -.IP [1] -Check the event queue to see if it contains any events that can -be serviced. If so, service the first possible event, remove it -.VS -from the queue, and return. It does this by calling -\fBTcl_ServiceEvent\fR and passing in the \fIflags\fR argument. -.VE -.IP [2] -Prepare to block for an event. To do this, \fBTcl_DoOneEvent\fR -invokes a \fIsetup procedure\fR in each event source. -The event source will perform event-source specific initialization and -.VS -possibly call \fBTcl_SetMaxBlockTime\fR to limit how long -.VE -\fBTcl_WaitForEvent\fR will block if no new events occur. -.IP [3] -Call \fBTcl_WaitForEvent\fR. This procedure is implemented differently -on different platforms; it waits for an event to occur, based on the -information provided by the event sources. -It may cause the application to block if \fItimePtr\fR specifies -an interval other than 0. -\fBTcl_WaitForEvent\fR returns when something has happened, -such as a file becoming readable or the interval given by \fItimePtr\fR -expiring. If there are no events for \fBTcl_WaitForEvent\fR to -wait for, so that it would block forever, then it returns immediately -and \fBTcl_DoOneEvent\fR returns 0. -.IP [4] -Call a \fIcheck procedure\fR in each event source. The check -procedure determines whether any events of interest to this source -occurred. If so, the events are added to the event queue. -.IP [5] -Check the event queue to see if it contains any events that can -be serviced. If so, service the first possible event, remove it -from the queue, and return. -.IP [6] -See if there are idle callbacks pending. If so, invoke all of them and -return. -.IP [7] -Either return 0 to indicate that no events were ready, or go back to -step [2] if blocking was requested by the caller. - -.SH "CREATING A NEW EVENT SOURCE" -.PP -An event source consists of three procedures invoked by the notifier, -plus additional C procedures that are invoked by higher-level code -to arrange for event-driven callbacks. The three procedures called -by the notifier consist of the setup and check procedures described -above, plus an additional procedure that is invoked when an event -is removed from the event queue for servicing. -.PP -The procedure \fBTcl_CreateEventSource\fR creates a new event source. -Its arguments specify the setup procedure and check procedure for -the event source. -\fISetupProc\fR should match the following prototype: -.CS -typedef void Tcl_EventSetupProc( - ClientData \fIclientData\fR, - int \fIflags\fR); -.CE -The \fIclientData\fR argument will be the same as the \fIclientData\fR -argument to \fBTcl_CreateEventSource\fR; it is typically used to -point to private information managed by the event source. -The \fIflags\fR argument will be the same as the \fIflags\fR -argument passed to \fBTcl_DoOneEvent\fR except that it will never -be 0 (\fBTcl_DoOneEvent\fR replaces 0 with \fBTCL_ALL_EVENTS\fR). -\fIFlags\fR indicates what kinds of events should be considered; -if the bit corresponding to this event source isn't set, the event -source should return immediately without doing anything. For -example, the file event source checks for the \fBTCL_FILE_EVENTS\fR -bit. -.PP -\fISetupProc\fR's job is to make sure that the application wakes up -when events of the desired type occur. This is typically done in a -platform-dependent fashion. For example, under Unix an event source -might call \fBTcl_CreateFileHandler\fR; under Windows it might -request notification with a Windows event. For timer-driven event -sources such as timer events or any polled event, the event source -can call \fBTcl_SetMaxBlockTime\fR to force the application to wake -up after a specified time even if no events have occurred. -.VS -If no event source calls \fBTcl_SetMaxBlockTime\fR -then \fBTcl_WaitForEvent\fR will wait as long as necessary for an -event to occur; otherwise, it will only wait as long as the shortest -interval passed to \fBTcl_SetMaxBlockTime\fR by one of the event -sources. If an event source knows that it already has events ready to -report, it can request a zero maximum block time. For example, the -setup procedure for the X event source looks to see if there are -events already queued. If there are, it calls -\fBTcl_SetMaxBlockTime\fR with a 0 block time so that -\fBTcl_WaitForEvent\fR does not block if there is no new data on the X -connection. -.VE -The \fItimePtr\fR argument to \fBTcl_WaitForEvent\fR points to -a structure that describes a time interval in seconds and -microseconds: -.CS -typedef struct Tcl_Time { - long \fIsec\fR; - long \fIusec\fR; -} Tcl_Time; -.CE -The \fIusec\fR field should be less than 1000000. -.PP -.VS -Information provided to \fBTcl_SetMaxBlockTime\fR -is only used for the next call to \fBTcl_WaitForEvent\fR; it is -discarded after \fBTcl_WaitForEvent\fR returns. -.VE -The next time an event wait is done each of the event sources' -setup procedures will be called again, and they can specify new -information for that event wait. -.PP -.VS -If the application uses an external event loop rather than -\fBTcl_DoOneEvent\fR, the event sources may need to call -\fBTcl_SetMaxBlockTime\fR at other times. For example, if a new event -handler is registered that needs to poll for events, the event source -may call \fBTcl_SetMaxBlockTime\fR to set the block time to zero to -force the external event loop to call Tcl. In this case, -\fBTcl_SetMaxBlockTime\fR invokes \fBTcl_SetTimer\fR with the shortest -interval seen since the last call to \fBTcl_DoOneEvent\fR or -\fBTcl_ServiceAll\fR. -.PP -In addition to the generic procedure \fBTcl_SetMaxBlockTime\fR, other -platform-specific procedures may also be available for -\fIsetupProc\fR, if there is additional information needed by -\fBTcl_WaitForEvent\fR on that platform. For example, on Unix systems -the \fBTcl_CreateFileHandler\fR interface can be used to wait for file events. -.VE -.PP -The second procedure provided by each event source is its check -procedure, indicated by the \fIcheckProc\fR argument to -\fBTcl_CreateEventSource\fR. \fICheckProc\fR must match the -following prototype: -.CS -typedef void Tcl_EventCheckProc( - ClientData \fIclientData\fR, - int \fIflags\fR); -.CE -The arguments to this procedure are the same as those for \fIsetupProc\fR. -\fBCheckProc\fR is invoked by \fBTcl_DoOneEvent\fR after it has waited -for events. Presumably at least one event source is now prepared to -queue an event. \fBTcl_DoOneEvent\fR calls each of the event sources -in turn, so they all have a chance to queue any events that are ready. -The check procedure does two things. First, it must see if any events -have triggered. Different event sources do this in different ways. -.PP -If an event source's check procedure detects an interesting event, it -must add the event to Tcl's event queue. To do this, the event source -calls \fBTcl_QueueEvent\fR. The \fIevPtr\fR argument is a pointer to -a dynamically allocated structure containing the event (see below for -more information on memory management issues). Each event source can -define its own event structure with whatever information is relevant -to that event source. However, the first element of the structure -must be a structure of type \fBTcl_Event\fR, and the address of this -structure is used when communicating between the event source and the -rest of the notifier. A \fBTcl_Event\fR has the following definition: -.CS -typedef struct Tcl_Event { - Tcl_EventProc *\fIproc\fR; - struct Tcl_Event *\fInextPtr\fR; -}; -.CE -The event source must fill in the \fIproc\fR field of -the event before calling \fBTcl_QueueEvent\fR. -The \fInextPtr\fR is used to link together the events in the queue -and should not be modified by the event source. -.PP -An event may be added to the queue at any of three positions, depending -on the \fIposition\fR argument to \fBTcl_QueueEvent\fR: -.IP \fBTCL_QUEUE_TAIL\fR 24 -Add the event at the back of the queue, so that all other pending -events will be serviced first. This is almost always the right -place for new events. -.IP \fBTCL_QUEUE_HEAD\fR 24 -Add the event at the front of the queue, so that it will be serviced -before all other queued events. -.IP \fBTCL_QUEUE_MARK\fR 24 -Add the event at the front of the queue, unless there are other -events at the front whose position is \fBTCL_QUEUE_MARK\fR; if so, -add the new event just after all other \fBTCL_QUEUE_MARK\fR events. -This value of \fIposition\fR is used to insert an ordered sequence of -events at the front of the queue, such as a series of -Enter and Leave events synthesized during a grab or ungrab operation -in Tk. -.PP -.VS -When it is time to handle an event from the queue (steps 1 and 4 -above) \fBTcl_ServiceEvent\fR will invoke the \fIproc\fR specified -.VE -in the first queued \fBTcl_Event\fR structure. -\fIProc\fR must match the following prototype: -.CS -typedef int Tcl_EventProc( - Tcl_Event *\fIevPtr\fR, - int \fIflags\fR); -.CE -The first argument to \fIproc\fR is a pointer to the event, which will -be the same as the first argument to the \fBTcl_QueueEvent\fR call that -added the event to the queue. -The second argument to \fIproc\fR is the \fIflags\fR argument for the -.VS -current call to \fBTcl_ServiceEvent\fR; this is used by the event source -.VE -to return immediately if its events are not relevant. -.PP -It is up to \fIproc\fR to handle the event, typically by invoking -one or more Tcl commands or C-level callbacks. -Once the event source has finished handling the event it returns 1 -to indicate that the event can be removed from the queue. -If for some reason the event source decides that the event cannot -be handled at this time, it may return 0 to indicate that the event -.VS -should be deferred for processing later; in this case \fBTcl_ServiceEvent\fR -.VE -will go on to the next event in the queue and attempt to service it. -There are several reasons why an event source might defer an event. -One possibility is that events of this type are excluded by the -\fIflags\fR argument. -For example, the file event source will always return 0 if the -\fBTCL_FILE_EVENTS\fR bit isn't set in \fIflags\fR. -Another example of deferring events happens in Tk if -\fBTk_RestrictEvents\fR has been invoked to defer certain kinds -of window events. -.PP -.VS -When \fIproc\fR returns 1, \fBTcl_ServiceEvent\fR will remove the -event from the event queue and free its storage. -Note that the storage for an event must be allocated by -the event source (using \fBTcl_Alloc\fR or the Tcl macro \fBckalloc\fR) -before calling \fBTcl_QueueEvent\fR, but it -will be freed by \fBTcl_ServiceEvent\fR, not by the event source. -.PP -\fBTcl_DeleteEvents\fR can be used to explicitly remove one or more -events from the event queue. \fBTcl_DeleteEvents\fR calls \fIproc\fR -for each event in the queue, deleting those for with the procedure -returns 1. Events for which the procedure returns 0 are left in the -queue. \fIProc\fR should match the following prototype: -.CS -typedef int Tcl_EventDeleteProc( - Tcl_Event *\fIevPtr\fR, - ClientData \fIclientData\fR); -.CE -The \fIclientData\fR argument will be the same as the \fIclientData\fR -argument to \fBTcl_DeleteEvents\fR; it is typically used to point to -private information managed by the event source. The \fIevPtr\fR will -point to the next event in the queue. -.VE - -.SH "CREATING A NEW NOTIFIER" -.PP -The notifier consists of all the procedures described in this manual -entry, plus \fBTcl_DoOneEvent\fR and \fBTcl_Sleep\fR, which are -.VS -available on all platforms, and \fBTcl_CreateFileHandler\fR and -\fBTcl_DeleteFileHandler\fR, which are Unix-specific. Most of these -procedures are generic, in that they are the same for all notifiers. -However, five of the procedures are notifier-dependent: -\fBTcl_SetTimer\fR, \fBTcl_Sleep\fR, \fBTcl_WaitForEvent\fR, -\fBTcl_CreateFileHandler\fR and \fBTcl_DeleteFileHandler\fR. To -support a new platform or to integrate Tcl with an -application-specific event loop, you must write new versions of these -procedures. -.PP -\fBTcl_WaitForEvent\fR is the lowest-level procedure in the notifier; -it is responsible for waiting for an ``interesting'' event to occur or -for a given time to elapse. Before \fBTcl_WaitForEvent\fR is invoked, -each of the event sources' setup procedure will have been invoked. -The \fItimePtr\fR argument to -\fBTcl_WaitForEvent\fR gives the maximum time to block for an event, -based on calls to \fBTcl_SetMaxBlockTime\fR made by setup procedures -and on other information (such as the \fBTCL_DONT_WAIT\fR bit in -\fIflags\fR). -.PP -Ideally, \fBTcl_WaitForEvent\fR should only wait for an event -to occur; it should not actually process the event in any way. -Later on, the -event sources will process the raw events and create Tcl_Events on -the event queue in their \fIcheckProc\fR procedures. -However, on some platforms (such as Windows) this isn't possible; -events may be processed in \fBTcl_WaitForEvent\fR, including queuing -Tcl_Events and more (for example, callbacks for native widgets may be -invoked). The return value from \fBTcl_WaitForEvent\fR must be either -0, 1, or \-1. On platforms such as Windows where events get processed in -\fBTcl_WaitForEvent\fR, a return value of 1 means that there may be more -events still pending that haven't been processed. This is a sign to the -caller that it must call \fBTcl_WaitForEvent\fR again if it wants all -pending events to be processed. A 0 return value means that calling -\fBTcl_WaitForEvent\fR again will not have any effect: either this is a -platform where \fBTcl_WaitForEvent\fR only waits without doing any event -processing, or \fBTcl_WaitForEvent\fR knows for sure that there are no -additional events to process (e.g. it returned because the time -elapsed). Finally, a return value of \-1 means that the event loop is -no longer operational and the application should probably unwind and -terminate. Under Windows this happens when a WM_QUIT message is received; -under Unix it happens when \fBTcl_WaitForEvent\fR would have waited -forever because there were no active event sources and the timeout was -infinite. -.PP -If the notifier will be used with an external event loop, then it must -also support the \fBTcl_SetTimer\fR interface. \fBTcl_SetTimer\fR is -invoked by \fBTcl_SetMaxBlockTime\fR whenever the maximum blocking -time has been reduced. \fBTcl_SetTimer\fR should arrange for the -external event loop to invoke \fBTcl_ServiceAll\fR after the specified -interval even if no events have occurred. This interface is needed -because \fBTcl_WaitForEvent\fR isn't invoked when there is an external -event loop. If the -notifier will only be used from \fBTcl_DoOneEvent\fR, then -\fBTcl_SetTimer\fR need not do anything. -.PP -On Unix systems, the file event source also needs support from the -notifier. The file event source consists of the -\fBTcl_CreateFileHandler\fR and \fBTcl_DeleteFileHandler\fR -procedures, which are described elsewhere. -.PP -The \fBTcl_Sleep\fR and \fBTcl_DoOneEvent\fR interfaces are described -elsewhere. -.PP -The easiest way to create a new notifier is to look at the code -for an existing notifier, such as the files \fBunix/tclUnixNotfy.c\fR -or \fBwin/tclWinNotify.c\fR in the Tcl source distribution. - -.SH "EXTERNAL EVENT LOOPS" -.PP -The notifier interfaces are designed so that Tcl can be embedded into -applications that have their own private event loops. In this case, -the application does not call \fBTcl_DoOneEvent\fR except in the case -of recursive event loops such as calls to the Tcl commands \fBupdate\fR -or \fBvwait\fR. Most of the time is spent in the external event loop -of the application. In this case the notifier must arrange for the -external event loop to call back into Tcl when something -happens on the various Tcl event sources. These callbacks should -arrange for appropriate Tcl events to be placed on the Tcl event queue. -.PP -Because the external event loop is not calling \fBTcl_DoOneEvent\fR on -a regular basis, it is up to the notifier to arrange for -\fBTcl_ServiceEvent\fR to be called whenever events are pending on the -Tcl event queue. The easiest way to do this is to invoke -\fBTcl_ServiceAll\fR at the end of each callback from the external -event loop. This will ensure that all of the event sources are -polled, any queued events are serviced, and any pending idle handlers -are processed before returning control to the application. In -addition, event sources that need to poll for events can call -\fBTcl_SetMaxBlockTime\fR to force the external event loop to call -Tcl even if no events are available on the system event queue. -.PP -As a side effect of processing events detected in the main external -event loop, Tcl may invoke \fBTcl_DoOneEvent\fR to start a recursive event -loop in commands like \fBvwait\fR. \fBTcl_DoOneEvent\fR will invoke -the external event loop, which will result in callbacks as described -in the preceding paragraph, which will result in calls to -\fBTcl_ServiceAll\fR. However, in these cases it is undesirable to -service events in \fBTcl_ServiceAll\fR. Servicing events there is -unnecessary because control will immediately return to the -external event loop and hence to \fBTcl_DoOneEvent\fR, which can -service the events itself. Furthermore, \fBTcl_DoOneEvent\fR is -supposed to service only a single event, whereas \fBTcl_ServiceAll\fR -normally services all pending events. To handle this situation, -\fBTcl_DoOneEvent\fR sets a flag for \fBTcl_ServiceAll\fR -that causes it to return without servicing any events. -This flag is called the \fIservice mode\fR; -\fBTcl_DoOneEvent\fR restores it to its previous value before it returns. -.PP -In some cases, however, it may be necessary for \fBTcl_ServiceAll\fR -to service events -even when it has been invoked from \fBTcl_DoOneEvent\fR. This happens -when there is yet another recursive event loop invoked via an -event handler called by \fBTcl_DoOneEvent\fR (such as one that is -part of a native widget). In this case, \fBTcl_DoOneEvent\fR may not -have a chance to service events so \fBTcl_ServiceAll\fR must service -them all. Any recursive event loop that calls an external event -loop rather than \fBTcl_DoOneEvent\fR must reset the service mode so -that all events get processed in \fBTcl_ServiceAll\fR. This is done -by invoking the \fBTcl_SetServiceMode\fR procedure. If -\fBTcl_SetServiceMode\fR is passed \fBTCL_SERVICE_NONE\fR, then calls -to \fBTcl_ServiceAll\fR will return immediately without processing any -events. If \fBTcl_SetServiceMode\fR is passed \fBTCL_SERVICE_ALL\fR, -then calls to \fBTcl_ServiceAll\fR will behave normally. -\fBTcl_SetServiceMode\fR returns the previous value of the service -mode, which should be restored when the recursive loop exits. -\fBTcl_GetServiceMode\fR returns the current value of the service -mode. -.VE - -.SH KEYWORDS -event, notifier, event queue, event sources, file events, timer, idle, service mode diff --git a/tk/doc/Preserve.3 b/tk/doc/Preserve.3 deleted file mode 100644 index a2c7d280634..00000000000 --- a/tk/doc/Preserve.3 +++ /dev/null @@ -1,103 +0,0 @@ -'\" -'\" Copyright (c) 1990 The Regents of the University of California. -'\" Copyright (c) 1994-1996 Sun Microsystems, Inc. -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -'\" SCCS: @(#) Preserve.3 1.13 96/05/28 09:26:12 -'\" -.so man.macros -.TH Tcl_Preserve 3 7.5 Tcl "Tcl Library Procedures" -.BS -.SH NAME -Tcl_Preserve, Tcl_Release, Tcl_EventuallyFree \- avoid freeing storage while it's being used -.SH SYNOPSIS -.nf -\fB#include <tcl.h>\fR -.sp -\fBTcl_Preserve\fR(\fIclientData\fR) -.sp -\fBTcl_Release\fR(\fIclientData\fR) -.sp -\fBTcl_EventuallyFree\fR(\fIclientData, freeProc\fR) -.SH ARGUMENTS -.AS Tcl_FreeProc clientData -.AP ClientData clientData in -Token describing structure to be freed or reallocated. Usually a pointer -to memory for structure. -.AP Tcl_FreeProc *freeProc in -Procedure to invoke to free \fIclientData\fR. -.BE - -.SH DESCRIPTION -.PP -These three procedures help implement a simple reference count mechanism -for managing storage. They are designed to solve a problem -having to do with widget deletion, but are also useful in many other -situations. When a widget is deleted, its -widget record (the structure holding information specific to the -widget) must be returned to the storage allocator. -However, it's possible that the widget record is in active use -by one of the procedures on the stack at the time of the deletion. -This can happen, for example, if the command associated with a button -widget causes the button to be destroyed: an X event causes an -event-handling C procedure in the button to be invoked, which in -turn causes the button's associated Tcl command to be executed, -which in turn causes the button to be deleted, which in turn causes -the button's widget record to be de-allocated. -Unfortunately, when the Tcl command returns, the button's -event-handling procedure will need to reference the -button's widget record. -Because of this, the widget record must not be freed as part of the -deletion, but must be retained until the event-handling procedure has -finished with it. -In other situations where the widget is deleted, it may be possible -to free the widget record immediately. -.PP -\fBTcl_Preserve\fR and \fBTcl_Release\fR -implement short-term reference counts for their \fIclientData\fR -argument. -The \fIclientData\fR argument identifies an object and usually -consists of the address of a structure. -The reference counts guarantee that an object will not be freed -until each call to \fBTcl_Preserve\fR for the object has been -matched by calls to \fBTcl_Release\fR. -There may be any number of unmatched \fBTcl_Preserve\fR calls -in effect at once. -.PP -\fBTcl_EventuallyFree\fR is invoked to free up its \fIclientData\fR -argument. -It checks to see if there are unmatched \fBTcl_Preserve\fR calls -for the object. -If not, then \fBTcl_EventuallyFree\fR calls \fIfreeProc\fR immediately. -Otherwise \fBTcl_EventuallyFree\fR records the fact that \fIclientData\fR -needs eventually to be freed. -When all calls to \fBTcl_Preserve\fR have been matched with -calls to \fBTcl_Release\fR then \fIfreeProc\fR will be called by -\fBTcl_Release\fR to do the cleanup. -.PP -All the work of freeing the object is carried out by \fIfreeProc\fR. -\fIFreeProc\fR must have arguments and result that match the -type \fBTcl_FreeProc\fR: -.CS -typedef void Tcl_FreeProc(char *\fIblockPtr\fR); -.CE -The \fIblockPtr\fR argument to \fIfreeProc\fR will be the -same as the \fIclientData\fR argument to \fBTcl_EventuallyFree\fR. -The type of \fIblockPtr\fR (\fBchar *\fR) is different than the type of the -\fIclientData\fR argument to \fBTcl_EventuallyFree\fR for historical -reasons, but the value is the same. -.PP -This mechanism can be used to solve the problem described above -by placing \fBTcl_Preserve\fR and \fBTcl_Release\fR calls around -actions that may cause undesired storage re-allocation. The -mechanism is intended only for short-term use (i.e. while procedures -are pending on the stack); it will not work efficiently as a -mechanism for long-term reference counts. -The implementation does not depend in any way on the internal -structure of the objects being freed; it keeps the reference -counts in a separate structure. - -.SH KEYWORDS -free, reference count, storage diff --git a/tk/doc/after.n b/tk/doc/after.n deleted file mode 100644 index cf4aaeb75c7..00000000000 --- a/tk/doc/after.n +++ /dev/null @@ -1,109 +0,0 @@ -'\" -'\" Copyright (c) 1990-1994 The Regents of the University of California. -'\" Copyright (c) 1994-1996 Sun Microsystems, Inc. -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -'\" SCCS: @(#) after.n 1.4 96/03/25 20:09:33 -'\" -.so man.macros -.TH after n 7.5 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -after \- Execute a command after a time delay -.SH SYNOPSIS -\fBafter \fIms\fR -.sp -\fBafter \fIms \fR?\fIscript script script ...\fR? -.sp -\fBafter cancel \fIid\fR -.sp -\fBafter cancel \fIscript script script ...\fR -.sp -\fBafter idle \fR?\fIscript script script ...\fR? -.sp -\fBafter info \fR?\fIid\fR? -.BE - -.SH DESCRIPTION -.PP -This command is used to delay execution of the program or to execute -a command in background sometime in the future. It has several forms, -depending on the first argument to the command: -.TP -\fBafter \fIms\fR -\fIMs\fR must be an integer giving a time in milliseconds. -The command sleeps for \fIms\fR milliseconds and then returns. -While the command is sleeping the application does not respond to -events. -.TP -\fBafter \fIms \fR?\fIscript script script ...\fR? -In this form the command returns immediately, but it arranges -for a Tcl command to be executed \fIms\fR milliseconds later as an -event handler. -The command will be executed exactly once, at the given time. -The delayed command is formed by concatenating all the \fIscript\fR -arguments in the same fashion as the \fBconcat\fR command. -The command will be executed at global level (outside the context -of any Tcl procedure). -If an error occurs while executing the delayed command then the -\fBbgerror\fR mechanism is used to report the error. -The \fBafter\fR command returns an identifier that can be used -to cancel the delayed command using \fBafter cancel\fR. -.TP -\fBafter cancel \fIid\fR -Cancels the execution of a delayed command that -was previously scheduled. -\fIId\fR indicates which command should be canceled; it must have -been the return value from a previous \fBafter\fR command. -If the command given by \fIid\fR has already been executed then -the \fBafter cancel\fR command has no effect. -.TP -\fBafter cancel \fIscript script ...\fR -This command also cancels the execution of a delayed command. -The \fIscript\fR arguments are concatenated together with space -separators (just as in the \fBconcat\fR command). -If there is a pending command that matches the string, it is -cancelled and will never be executed; if no such command is -currently pending then the \fBafter cancel\fR command has no effect. -.TP -\fBafter idle \fIscript \fR?\fIscript script ...\fR? -Concatenates the \fIscript\fR arguments together with space -separators (just as in the \fBconcat\fR command), and arranges -for the resulting script to be evaluated later as an idle callback. -The script will be run exactly once, the next time the event -loop is entered and there are no events to process. -The command returns an identifier that can be used -to cancel the delayed command using \fBafter cancel\fR. -If an error occurs while executing the script then the -\fBbgerror\fR mechanism is used to report the error. -.TP -\fBafter info \fR?\fIid\fR? -This command returns information about existing event handlers. -If no \fIid\fR argument is supplied, the command returns -a list of the identifiers for all existing -event handlers created by the \fBafter\fR command for this -interpreter. -If \fIid\fR is supplied, it specifies an existing handler; -\fIid\fR must have been the return value from some previous call -to \fBafter\fR and it must not have triggered yet or been cancelled. -In this case the command returns a list with two elements. -The first element of the list is the script associated -with \fIid\fR, and the second element is either -\fBidle\fR or \fBtimer\fR to indicate what kind of event -handler it is. -.LP -The \fBafter \fIms\fR and \fBafter idle\fR forms of the command -assume that the application is event driven: the delayed commands -will not be executed unless the application enters the event loop. -In applications that are not normally event-driven, such as -\fBtclsh\fR, the event loop can be entered with the \fBvwait\fR -and \fBupdate\fR commands. - -.SH "SEE ALSO" -bgerror - -.SH KEYWORDS -cancel, delay, idle callback, sleep, time diff --git a/tk/doc/exit.n b/tk/doc/exit.n deleted file mode 100644 index 2dfffb4791c..00000000000 --- a/tk/doc/exit.n +++ /dev/null @@ -1,28 +0,0 @@ -'\" -'\" Copyright (c) 1993 The Regents of the University of California. -'\" Copyright (c) 1994-1996 Sun Microsystems, Inc. -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -'\" SCCS: @(#) exit.n 1.6 96/03/25 20:13:32 -'\" -.so man.macros -.TH exit n "" Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -exit \- End the application -.SH SYNOPSIS -\fBexit \fR?\fIreturnCode\fR? -.BE - -.SH DESCRIPTION -.PP -Terminate the process, returning \fIreturnCode\fR to the -system as the exit status. -If \fIreturnCode\fR isn't specified then it defaults -to 0. - -.SH KEYWORDS -exit, process diff --git a/tk/doc/fileevent.n b/tk/doc/fileevent.n deleted file mode 100644 index daff74eaa6b..00000000000 --- a/tk/doc/fileevent.n +++ /dev/null @@ -1,109 +0,0 @@ -'\" -'\" Copyright (c) 1994 The Regents of the University of California. -'\" Copyright (c) 1994-1996 Sun Microsystems, Inc. -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -'\" SCCS: @(#) fileevent.n 1.6 96/02/23 13:46:29 -'\" -.so man.macros -.TH fileevent n 7.5 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -fileevent \- Execute a script when a channel becomes readable or writable -.SH SYNOPSIS -\fBfileevent \fIchannelId \fBreadable \fR?\fIscript\fR? -.sp -\fBfileevent \fIchannelId \fBwritable \fR?\fIscript\fR? -.BE - -.SH DESCRIPTION -.PP -This command is used to create \fIfile event handlers\fR. A file event -handler is a binding between a channel and a script, such that the script -is evaluated whenever the channel becomes readable or writable. File event -handlers are most commonly used to allow data to be received from another -process on an event-driven basis, so that the receiver can continue to -interact with the user while waiting for the data to arrive. If an -application invokes \fBgets\fR or \fBread\fR on a blocking channel when -there is no input data available, the process will block; until the input -data arrives, it will not be able to service other events, so it will -appear to the user to ``freeze up''. With \fBfileevent\fR, the process can -tell when data is present and only invoke \fBgets\fR or \fBread\fR when -they won't block. -.PP -The \fIchannelId\fR argument to \fBfileevent\fR refers to an open channel, -such as the return value from a previous \fBopen\fR or \fBsocket\fR -command. -If the \fIscript\fR argument is specified, then \fBfileevent\fR -creates a new event handler: \fIscript\fR will be evaluated -whenever the channel becomes readable or writable (depending on the -second argument to \fBfileevent\fR). -In this case \fBfileevent\fR returns an empty string. -The \fBreadable\fR and \fBwritable\fR event handlers for a file -are independent, and may be created and deleted separately. -However, there may be at most one \fBreadable\fR and one \fBwritable\fR -handler for a file at a given time in a given interpreter. -If \fBfileevent\fR is called when the specified handler already -exists in the invoking interpreter, the new script replaces the old one. -.PP -If the \fIscript\fR argument is not specified, \fBfileevent\fR -returns the current script for \fIchannelId\fR, or an empty string -if there is none. -If the \fIscript\fR argument is specified as an empty string -then the event handler is deleted, so that no script will be invoked. -A file event handler is also deleted automatically whenever -its channel is closed or its interpreter is deleted. -.PP -A channel is considered to be readable if there is unread data -available on the underlying device. -A channel is also considered to be readable if there is unread -data in an input buffer, except in the special case where the -most recent attempt to read from the channel was a \fBgets\fR -call that could not find a complete line in the input buffer. -This feature allows a file to be read a line at a time in nonblocking mode -using events. -A channel is also considered to be readable if an end of file or -error condition is present on the underlying file or device. -It is important for \fIscript\fR to check for these conditions -and handle them appropriately; for example, if there is no special -check for end of file, an infinite loop may occur where \fIscript\fR -reads no data, returns, and is immediately invoked again. -.PP -A channel is considered to be writable if at least one byte of data -can be written to the underlying file or device without blocking, -or if an error condition is present on the underlying file or device. -.PP -Event-driven I/O works best for channels that have been -placed into nonblocking mode with the \fBfconfigure\fR command. -In blocking mode, a \fBputs\fR command may block if you give it -more data than the underlying file or device can accept, and a -\fBgets\fR or \fBread\fR command will block if you attempt to read -more data than is ready; no events will be processed while the -commands block. -In nonblocking mode \fBputs\fR, \fBread\fR, and \fBgets\fR never block. -See the documentation for the individual commands for information -on how they handle blocking and nonblocking channels. -.PP -The script for a file event is executed at global level (outside the -context of any Tcl procedure) in the interpreter in which the -\fBfileevent\fR command was invoked. -If an error occurs while executing the script then the -\fBbgerror\fR mechanism is used to report the error. -In addition, the file event handler is deleted if it ever returns -an error; this is done in order to prevent infinite loops due to -buggy handlers. - -.SH CREDITS -.PP -\fBfileevent\fR is based on the \fBaddinput\fR command created -by Mark Diekhans. - -.SH "SEE ALSO" -bgerror, fconfigure, gets, puts, read - -.SH KEYWORDS -asynchronous I/O, blocking, channel, event handler, nonblocking, readable, -script, writable. diff --git a/tk/doc/update.n b/tk/doc/update.n deleted file mode 100644 index 522b1766d4c..00000000000 --- a/tk/doc/update.n +++ /dev/null @@ -1,48 +0,0 @@ -'\" -'\" Copyright (c) 1990-1992 The Regents of the University of California. -'\" Copyright (c) 1994-1996 Sun Microsystems, Inc. -'\" -'\" See the file "license.terms" for information on usage and redistribution -'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. -'\" -'\" SCCS: @(#) update.n 1.3 96/03/25 20:26:34 -'\" -.so man.macros -.TH update n 7.5 Tcl "Tcl Built-In Commands" -.BS -'\" Note: do not modify the .SH NAME line immediately below! -.SH NAME -update \- Process pending events and idle callbacks -.SH SYNOPSIS -\fBupdate\fR ?\fBidletasks\fR? -.BE - -.SH DESCRIPTION -.PP -This command is used to bring the application ``up to date'' -by entering the event loop repeated until all pending events -(including idle callbacks) have been processed. -.PP -If the \fBidletasks\fR keyword is specified as an argument to the -command, then no new events or errors are processed; only idle -callbacks are invoked. -This causes operations that are normally deferred, such as display -updates and window layout calculations, to be performed immediately. -.PP -The \fBupdate idletasks\fR command is useful in scripts where -changes have been made to the application's state and you want those -changes to appear on the display immediately, rather than waiting -for the script to complete. Most display updates are performed as -idle callbacks, so \fBupdate idletasks\fR will cause them to run. -However, there are some kinds of updates that only happen in -response to events, such as those triggered by window size changes; -these updates will not occur in \fBupdate idletasks\fR. -.PP -The \fBupdate\fR command with no options is useful in scripts where -you are performing a long-running computation but you still want -the application to respond to events such as user interactions; if -you occasionally call \fBupdate\fR then user input will be processed -during the next call to \fBupdate\fR. - -.SH KEYWORDS -event, flush, handler, idle, update diff --git a/tk/generic/patchlevel.h b/tk/generic/patchlevel.h deleted file mode 100644 index 8053233c2bf..00000000000 --- a/tk/generic/patchlevel.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - * patchlevel.h -- - * - * This file does nothing except define a "patch level" for Tk. - * The patch level has the form "X.YpZ" where X.Y is the base - * release, and Z is a serial number that is used to sequence - * patches for a given release. Thus 4.0p1 is the first patch - * to release 4.0, 4.0p2 is the patch that follows 4.0p1, and - * so on. The "pZ" is omitted in an original new release, and - * it is replaced with "bZ" for beta releases or "aZ" for alpha - * releases (e.g. 4.0b1 is the first beta release of Tk 4.0). - * The patch level ensures that patches are applied in the - * correct order and only to appropriate sources. - * - * Copyright (c) 1994-1996 Sun Microsystems, Inc. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * SCCS: @(#) patchlevel.h 1.16 96/04/10 14:30:23 - */ - -#define TK_PATCH_LEVEL "4.1" diff --git a/tk/generic/tkPatch.h b/tk/generic/tkPatch.h deleted file mode 100644 index c36ed20a17a..00000000000 --- a/tk/generic/tkPatch.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - * tkPatch.h -- - * - * This file does nothing except define a "patch level" for Tk. - * The patch level has the form "X.YpZ" where X.Y is the base - * release, and Z is a serial number that is used to sequence - * patches for a given release. Thus 4.0p1 is the first patch - * to release 4.0, 4.0p2 is the patch that follows 4.0p1, and - * so on. The "pZ" is omitted in an original new release, and - * it is replaced with "bZ" for beta releases or "aZ" for alpha - * releases (e.g. 4.0b1 is the first beta release of Tk 4.0). - * The patch level ensures that patches are applied in the - * correct order and only to appropriate sources. - * - * Copyright (c) 1994-1996 Sun Microsystems, Inc. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * SCCS: @(#) tkPatch.h 1.22 96/10/02 14:36:36 - */ - -#define TK_PATCH_LEVEL "4.2" diff --git a/tk/generic/tkSend.c b/tk/generic/tkSend.c deleted file mode 100644 index 074ce5a33d7..00000000000 --- a/tk/generic/tkSend.c +++ /dev/null @@ -1,1867 +0,0 @@ -/* - * tkSend.c -- - * - * This file provides procedures that implement the "send" - * command, allowing commands to be passed from interpreter - * to interpreter. - * - * Copyright (c) 1989-1994 The Regents of the University of California. - * Copyright (c) 1994-1996 Sun Microsystems, Inc. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * SCCS: @(#) tkSend.c 1.64 96/07/20 17:38:32 - */ - -#include "tkPort.h" -#include "tkInt.h" - -/* - * The following structure is used to keep track of the interpreters - * registered by this process. - */ - -typedef struct RegisteredInterp { - char *name; /* Interpreter's name (malloc-ed). */ - Tcl_Interp *interp; /* Interpreter associated with name. NULL - * means that the application was unregistered - * or deleted while a send was in progress - * to it. */ - TkDisplay *dispPtr; /* Display for the application. Needed - * because we may need to unregister the - * interpreter after its main window has - * been deleted. */ - struct RegisteredInterp *nextPtr; - /* Next in list of names associated - * with interps in this process. - * NULL means end of list. */ -} RegisteredInterp; - -static RegisteredInterp *registry = NULL; - /* List of all interpreters - * registered by this process. */ - -/* - * A registry of all interpreters for a display is kept in a - * property "InterpRegistry" on the root window of the display. - * It is organized as a series of zero or more concatenated strings - * (in no particular order), each of the form - * window space name '\0' - * where "window" is the hex id of the comm. window to use to talk - * to an interpreter named "name". - * - * When the registry is being manipulated by an application (e.g. to - * add or remove an entry), it is loaded into memory using a structure - * of the following type: - */ - -typedef struct NameRegistry { - TkDisplay *dispPtr; /* Display from which the registry was - * read. */ - int locked; /* Non-zero means that the display was - * locked when the property was read in. */ - int modified; /* Non-zero means that the property has - * been modified, so it needs to be written - * out when the NameRegistry is closed. */ - unsigned long propLength; /* Length of the property, in bytes. */ - char *property; /* The contents of the property, or NULL - * if none. See format description above; - * this is *not* terminated by the first - * null character. Dynamically allocated. */ - int allocedByX; /* Non-zero means must free property with - * XFree; zero means use ckfree. */ -} NameRegistry; - -/* - * When a result is being awaited from a sent command, one of - * the following structures is present on a list of all outstanding - * sent commands. The information in the structure is used to - * process the result when it arrives. You're probably wondering - * how there could ever be multiple outstanding sent commands. - * This could happen if interpreters invoke each other recursively. - * It's unlikely, but possible. - */ - -typedef struct PendingCommand { - int serial; /* Serial number expected in - * result. */ - TkDisplay *dispPtr; /* Display being used for communication. */ - char *target; /* Name of interpreter command is - * being sent to. */ - Window commWindow; /* Target's communication window. */ - Tcl_Interp *interp; /* Interpreter from which the send - * was invoked. */ - int code; /* Tcl return code for command - * will be stored here. */ - char *result; /* String result for command (malloc'ed), - * or NULL. */ - char *errorInfo; /* Information for "errorInfo" variable, - * or NULL (malloc'ed). */ - char *errorCode; /* Information for "errorCode" variable, - * or NULL (malloc'ed). */ - int gotResponse; /* 1 means a response has been received, - * 0 means the command is still outstanding. */ - struct PendingCommand *nextPtr; - /* Next in list of all outstanding - * commands. NULL means end of - * list. */ -} PendingCommand; - -static PendingCommand *pendingCommands = NULL; - /* List of all commands currently - * being waited for. */ - -/* - * The information below is used for communication between processes - * during "send" commands. Each process keeps a private window, never - * even mapped, with one property, "Comm". When a command is sent to - * an interpreter, the command is appended to the comm property of the - * communication window associated with the interp's process. Similarly, - * when a result is returned from a sent command, it is also appended - * to the comm property. - * - * Each command and each result takes the form of ASCII text. For a - * command, the text consists of a zero character followed by several - * null-terminated ASCII strings. The first string consists of the - * single letter "c". Subsequent strings have the form "option value" - * where the following options are supported: - * - * -r commWindow serial - * - * This option means that a response should be sent to the window - * whose X identifier is "commWindow" (in hex), and the response should - * be identified with the serial number given by "serial" (in decimal). - * If this option isn't specified then the send is asynchronous and - * no response is sent. - * - * -n name - * "Name" gives the name of the application for which the command is - * intended. This option must be present. - * - * -s script - * - * "Script" is the script to be executed. This option must be present. - * - * The options may appear in any order. The -n and -s options must be - * present, but -r may be omitted for asynchronous RPCs. For compatibility - * with future releases that may add new features, there may be additional - * options present; as long as they start with a "-" character, they will - * be ignored. - * - * A result also consists of a zero character followed by several null- - * terminated ASCII strings. The first string consists of the single - * letter "r". Subsequent strings have the form "option value" where - * the following options are supported: - * - * -s serial - * - * Identifies the command for which this is the result. It is the - * same as the "serial" field from the -s option in the command. This - * option must be present. - * - * -c code - * - * "Code" is the completion code for the script, in decimal. If the - * code is omitted it defaults to TCL_OK. - * - * -r result - * - * "Result" is the result string for the script, which may be either - * a result or an error message. If this field is omitted then it - * defaults to an empty string. - * - * -i errorInfo - * - * "ErrorInfo" gives a string with which to initialize the errorInfo - * variable. This option may be omitted; it is ignored unless the - * completion code is TCL_ERROR. - * - * -e errorCode - * - * "ErrorCode" gives a string with with to initialize the errorCode - * variable. This option may be omitted; it is ignored unless the - * completion code is TCL_ERROR. - * - * Options may appear in any order, and only the -s option must be - * present. As with commands, there may be additional options besides - * these; unknown options are ignored. - */ - -/* - * The following variable is the serial number that was used in the - * last "send" command. It is exported only for testing purposes. - */ - -int tkSendSerial = 0; - -/* - * Maximum size property that can be read at one time by - * this module: - */ - -#define MAX_PROP_WORDS 100000 - -/* - * The following variable can be set while debugging to do things like - * skip locking the server. - */ - -static int sendDebug = 0; - -/* - * Forward declarations for procedures defined later in this file: - */ - -static int AppendErrorProc _ANSI_ARGS_((ClientData clientData, - XErrorEvent *errorPtr)); -static void AppendPropCarefully _ANSI_ARGS_((Display *display, - Window window, Atom property, char *value, - int length, PendingCommand *pendingPtr)); -static void DeleteProc _ANSI_ARGS_((ClientData clientData)); -static void RegAddName _ANSI_ARGS_((NameRegistry *regPtr, - char *name, Window commWindow)); -static void RegClose _ANSI_ARGS_((NameRegistry *regPtr)); -static void RegDeleteName _ANSI_ARGS_((NameRegistry *regPtr, - char *name)); -static Window RegFindName _ANSI_ARGS_((NameRegistry *regPtr, - char *name)); -static NameRegistry * RegOpen _ANSI_ARGS_((Tcl_Interp *interp, - TkDisplay *dispPtr, int lock)); -static void SendEventProc _ANSI_ARGS_((ClientData clientData, - XEvent *eventPtr)); -static int SendInit _ANSI_ARGS_((Tcl_Interp *interp, - TkDisplay *dispPtr)); -static Tk_RestrictAction SendRestrictProc _ANSI_ARGS_((ClientData clientData, - XEvent *eventPtr)); -static int ServerSecure _ANSI_ARGS_((TkDisplay *dispPtr)); -static void TimeoutProc _ANSI_ARGS_((ClientData clientData)); -static void UpdateCommWindow _ANSI_ARGS_((TkDisplay *dispPtr)); -static int ValidateName _ANSI_ARGS_((TkDisplay *dispPtr, - char *name, Window commWindow, int oldOK)); - -/* - *---------------------------------------------------------------------- - * - * RegOpen -- - * - * This procedure loads the name registry for a display into - * memory so that it can be manipulated. - * - * Results: - * The return value is a pointer to the loaded registry. - * - * Side effects: - * If "lock" is set then the server will be locked. It is the - * caller's responsibility to call RegClose when finished with - * the registry, so that we can write back the registry if - * neeeded, unlock the server if needed, and free memory. - * - *---------------------------------------------------------------------- - */ - -static NameRegistry * -RegOpen(interp, dispPtr, lock) - Tcl_Interp *interp; /* Interpreter to use for error reporting - * (errors cause a panic so in fact no - * error is ever returned, but the interpreter - * is needed anyway). */ - TkDisplay *dispPtr; /* Display whose name registry is to be - * opened. */ - int lock; /* Non-zero means lock the window server - * when opening the registry, so no-one - * else can use the registry until we - * close it. */ -{ - NameRegistry *regPtr; - int result, actualFormat; - unsigned long bytesAfter; - Atom actualType; - - if (dispPtr->commTkwin == NULL) { - SendInit(interp, dispPtr); - } - - regPtr = (NameRegistry *) ckalloc(sizeof(NameRegistry)); - regPtr->dispPtr = dispPtr; - regPtr->locked = 0; - regPtr->modified = 0; - regPtr->allocedByX = 1; - - if (lock && !sendDebug) { - XGrabServer(dispPtr->display); - regPtr->locked = 1; - } - - /* - * Read the registry property. - */ - - result = XGetWindowProperty(dispPtr->display, - RootWindow(dispPtr->display, 0), - dispPtr->registryProperty, 0, MAX_PROP_WORDS, - False, XA_STRING, &actualType, &actualFormat, - ®Ptr->propLength, &bytesAfter, - (unsigned char **) ®Ptr->property); - - if (actualType == None) { - regPtr->propLength = 0; - regPtr->property = NULL; - } else if ((result != Success) || (actualFormat != 8) - || (actualType != XA_STRING)) { - /* - * The property is improperly formed; delete it. - */ - - if (regPtr->property != NULL) { - XFree(regPtr->property); - regPtr->propLength = 0; - regPtr->property = NULL; - } - XDeleteProperty(dispPtr->display, - RootWindow(dispPtr->display, 0), - dispPtr->registryProperty); - } - - /* - * Xlib placed an extra null byte after the end of the property, just - * to make sure that it is always NULL-terminated. Be sure to include - * this byte in our count if it's needed to ensure null termination - * (note: as of 8/95 I'm no longer sure why this code is needed; seems - * like it shouldn't be). - */ - - if ((regPtr->propLength > 0) - && (regPtr->property[regPtr->propLength-1] != 0)) { - regPtr->propLength++; - } - return regPtr; -} - -/* - *---------------------------------------------------------------------- - * - * RegFindName -- - * - * Given an open name registry, this procedure finds an entry - * with a given name, if there is one, and returns information - * about that entry. - * - * Results: - * The return value is the X identifier for the comm window for - * the application named "name", or None if there is no such - * entry in the registry. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static Window -RegFindName(regPtr, name) - NameRegistry *regPtr; /* Pointer to a registry opened with a - * previous call to RegOpen. */ - char *name; /* Name of an application. */ -{ - char *p, *entry; - Window commWindow; - - commWindow = None; - for (p = regPtr->property; (p-regPtr->property) < regPtr->propLength; ) { - entry = p; - while ((*p != 0) && (!isspace(UCHAR(*p)))) { - p++; - } - if ((*p != 0) && (strcmp(name, p+1) == 0)) { - if (sscanf(entry, "%x", (unsigned int *) &commWindow) == 1) { - return commWindow; - } - } - while (*p != 0) { - p++; - } - p++; - } - return None; -} - -/* - *---------------------------------------------------------------------- - * - * RegDeleteName -- - * - * This procedure deletes the entry for a given name from - * an open registry. - * - * Results: - * None. - * - * Side effects: - * If there used to be an entry named "name" in the registry, - * then it is deleted and the registry is marked as modified - * so it will be written back when closed. - * - *---------------------------------------------------------------------- - */ - -static void -RegDeleteName(regPtr, name) - NameRegistry *regPtr; /* Pointer to a registry opened with a - * previous call to RegOpen. */ - char *name; /* Name of an application. */ -{ - char *p, *entry, *entryName; - int count; - - for (p = regPtr->property; (p-regPtr->property) < regPtr->propLength; ) { - entry = p; - while ((*p != 0) && (!isspace(UCHAR(*p)))) { - p++; - } - if (*p != 0) { - p++; - } - entryName = p; - while (*p != 0) { - p++; - } - p++; - if ((strcmp(name, entryName) == 0)) { - /* - * Found the matching entry. Copy everything after it - * down on top of it. - */ - - count = regPtr->propLength - (p - regPtr->property); - if (count > 0) { - memmove((VOID *) entry, (VOID *) p, (size_t) count); - } - regPtr->propLength -= p - entry; - regPtr->modified = 1; - return; - } - } -} - -/* - *---------------------------------------------------------------------- - * - * RegAddName -- - * - * Add a new entry to an open registry. - * - * Results: - * None. - * - * Side effects: - * The open registry is expanded; it is marked as modified so that - * it will be written back when closed. - * - *---------------------------------------------------------------------- - */ - -static void -RegAddName(regPtr, name, commWindow) - NameRegistry *regPtr; /* Pointer to a registry opened with a - * previous call to RegOpen. */ - char *name; /* Name of an application. The caller - * must ensure that this name isn't - * already registered. */ - Window commWindow; /* X identifier for comm. window of - * application. */ -{ - char id[30]; - char *newProp; - int idLength, newBytes; - - sprintf(id, "%x ", (unsigned int) commWindow); - idLength = strlen(id); - newBytes = idLength + strlen(name) + 1; - newProp = (char *) ckalloc((unsigned) (regPtr->propLength + newBytes)); - strcpy(newProp, id); - strcpy(newProp+idLength, name); - if (regPtr->property != NULL) { - memcpy((VOID *) (newProp + newBytes), (VOID *) regPtr->property, - regPtr->propLength); - if (regPtr->allocedByX) { - XFree(regPtr->property); - } else { - ckfree(regPtr->property); - } - } - regPtr->modified = 1; - regPtr->propLength += newBytes; - regPtr->property = newProp; - regPtr->allocedByX = 0; -} - -/* - *---------------------------------------------------------------------- - * - * RegClose -- - * - * This procedure is called to end a series of operations on - * a name registry. - * - * Results: - * None. - * - * Side effects: - * The registry is written back if it has been modified, and the - * X server is unlocked if it was locked. Memory for the - * registry is freed, so the caller should never use regPtr - * again. - * - *---------------------------------------------------------------------- - */ - -static void -RegClose(regPtr) - NameRegistry *regPtr; /* Pointer to a registry opened with a - * previous call to RegOpen. */ -{ - if (regPtr->modified) { - if (!regPtr->locked && !sendDebug) { - panic("The name registry was modified without being locked!"); - } - XChangeProperty(regPtr->dispPtr->display, - RootWindow(regPtr->dispPtr->display, 0), - regPtr->dispPtr->registryProperty, XA_STRING, 8, - PropModeReplace, (unsigned char *) regPtr->property, - (int) regPtr->propLength); - } - - if (regPtr->locked) { - XUngrabServer(regPtr->dispPtr->display); - } - XFlush(regPtr->dispPtr->display); - - if (regPtr->property != NULL) { - if (regPtr->allocedByX) { - XFree(regPtr->property); - } else { - ckfree(regPtr->property); - } - } - ckfree((char *) regPtr); -} - -/* - *---------------------------------------------------------------------- - * - * ValidateName -- - * - * This procedure checks to see if an entry in the registry - * is still valid. - * - * Results: - * The return value is 1 if the given commWindow exists and its - * name is "name". Otherwise 0 is returned. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static int -ValidateName(dispPtr, name, commWindow, oldOK) - TkDisplay *dispPtr; /* Display for which to perform the - * validation. */ - char *name; /* The name of an application. */ - Window commWindow; /* X identifier for the application's - * comm. window. */ - int oldOK; /* Non-zero means that we should consider - * an application to be valid even if it - * looks like an old-style (pre-4.0) one; - * 0 means consider these invalid. */ -{ - int result, actualFormat, argc, i; - unsigned long length, bytesAfter; - Atom actualType; - char *property; - Tk_ErrorHandler handler; - char **argv; - - property = NULL; - - /* - * Ignore X errors when reading the property (e.g., the window - * might not exist). If an error occurs, result will be some - * value other than Success. - */ - - handler = Tk_CreateErrorHandler(dispPtr->display, -1, -1, -1, - (Tk_ErrorProc *) NULL, (ClientData) NULL); - result = XGetWindowProperty(dispPtr->display, commWindow, - dispPtr->appNameProperty, 0, MAX_PROP_WORDS, - False, XA_STRING, &actualType, &actualFormat, - &length, &bytesAfter, (unsigned char **) &property); - - if ((result == Success) && (actualType == None)) { - XWindowAttributes atts; - - /* - * The comm. window exists but the property we're looking for - * doesn't exist. This probably means that the application - * comes from an older version of Tk (< 4.0) that didn't set the - * property; if this is the case, then assume for compatibility's - * sake that everything's OK. However, it's also possible that - * some random application has re-used the window id for something - * totally unrelated. Check a few characteristics of the window, - * such as its dimensions and mapped state, to be sure that it - * still "smells" like a commWindow. - */ - - if (!oldOK - || !XGetWindowAttributes(dispPtr->display, commWindow, &atts) - || (atts.width != 1) || (atts.height != 1) - || (atts.map_state != IsUnmapped)) { - result = 0; - } else { - result = 1; - } - } else if ((result == Success) && (actualFormat == 8) - && (actualType == XA_STRING)) { - result = 0; - if (Tcl_SplitList((Tcl_Interp *) NULL, property, &argc, &argv) - == TCL_OK) { - for (i = 0; i < argc; i++) { - if (strcmp(argv[i], name) == 0) { - result = 1; - break; - } - } - ckfree((char *) argv); - } - } else { - result = 0; - } - Tk_DeleteErrorHandler(handler); - if (property != NULL) { - XFree(property); - } - return result; -} - -/* - *---------------------------------------------------------------------- - * - * ServerSecure -- - * - * Check whether a server is secure enough for us to trust - * Tcl scripts arriving via that server. - * - * Results: - * The return value is 1 if the server is secure, which means - * that host-style authentication is turned on but there are - * no hosts in the enabled list. This means that some other - * form of authorization (presumably more secure, such as xauth) - * is in use. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static int -ServerSecure(dispPtr) - TkDisplay *dispPtr; /* Display to check. */ -{ -#ifdef TK_NO_SECURITY - return 1; -#else - XHostAddress *addrPtr; - int numHosts, secure; - Bool enabled; - - secure = 0; - addrPtr = XListHosts(dispPtr->display, &numHosts, &enabled); - if (enabled && (numHosts == 0)) { - secure = 1; - } - if (addrPtr != NULL) { - XFree((char *) addrPtr); - } - return secure; -#endif /* TK_NO_SECURITY */ -} - -/* - *-------------------------------------------------------------- - * - * Tk_SetAppName -- - * - * This procedure is called to associate an ASCII name with a Tk - * application. If the application has already been named, the - * name replaces the old one. - * - * Results: - * The return value is the name actually given to the application. - * This will normally be the same as name, but if name was already - * in use for an application then a name of the form "name #2" will - * be chosen, with a high enough number to make the name unique. - * - * Side effects: - * Registration info is saved, thereby allowing the "send" command - * to be used later to invoke commands in the application. In - * addition, the "send" command is created in the application's - * interpreter. The registration will be removed automatically - * if the interpreter is deleted or the "send" command is removed. - * - *-------------------------------------------------------------- - */ - -char * -Tk_SetAppName(tkwin, name) - Tk_Window tkwin; /* Token for any window in the application - * to be named: it is just used to identify - * the application and the display. */ - char *name; /* The name that will be used to - * refer to the interpreter in later - * "send" commands. Must be globally - * unique. */ -{ - RegisteredInterp *riPtr, *riPtr2; - Window w; - TkWindow *winPtr = (TkWindow *) tkwin; - TkDisplay *dispPtr; - NameRegistry *regPtr; - Tcl_Interp *interp; - char *actualName; - Tcl_DString dString; - int offset, i; - -#ifdef __WIN32__ - return name; -#endif /* __WIN32__ */ - - dispPtr = winPtr->dispPtr; - interp = winPtr->mainPtr->interp; - if (dispPtr->commTkwin == NULL) { - SendInit(interp, winPtr->dispPtr); - } - - /* - * See if the application is already registered; if so, remove its - * current name from the registry. - */ - - regPtr = RegOpen(interp, winPtr->dispPtr, 1); - for (riPtr = registry; ; riPtr = riPtr->nextPtr) { - if (riPtr == NULL) { - /* - * This interpreter isn't currently registered; create - * the data structure that will be used to register it locally, - * plus add the "send" command to the interpreter. - */ - - riPtr = (RegisteredInterp *) ckalloc(sizeof(RegisteredInterp)); - riPtr->interp = interp; - riPtr->dispPtr = winPtr->dispPtr; - riPtr->nextPtr = registry; - registry = riPtr; - Tcl_CreateCommand(interp, "send", Tk_SendCmd, (ClientData) riPtr, - DeleteProc); - break; - } - if (riPtr->interp == interp) { - /* - * The interpreter is currently registered; remove it from - * the name registry. - */ - - RegDeleteName(regPtr, riPtr->name); - ckfree(riPtr->name); - break; - } - } - - /* - * Pick a name to use for the application. Use "name" if it's not - * already in use. Otherwise add a suffix such as " #2", trying - * larger and larger numbers until we eventually find one that is - * unique. - */ - - actualName = name; - offset = 0; /* Needed only to avoid "used before - * set" compiler warnings. */ - for (i = 1; ; i++) { - if (i > 1) { - if (i == 2) { - Tcl_DStringInit(&dString); - Tcl_DStringAppend(&dString, name, -1); - Tcl_DStringAppend(&dString, " #", 2); - offset = Tcl_DStringLength(&dString); - Tcl_DStringSetLength(&dString, offset+10); - actualName = Tcl_DStringValue(&dString); - } - sprintf(actualName + offset, "%d", i); - } - w = RegFindName(regPtr, actualName); - if (w == None) { - break; - } - - /* - * The name appears to be in use already, but double-check to - * be sure (perhaps the application died without removing its - * name from the registry?). - */ - - if (w == Tk_WindowId(dispPtr->commTkwin)) { - for (riPtr2 = registry; riPtr2 != NULL; riPtr2 = riPtr2->nextPtr) { - if ((riPtr2->interp != interp) && - (strcmp(riPtr2->name, actualName) == 0)) { - goto nextSuffix; - } - } - RegDeleteName(regPtr, actualName); - break; - } else if (!ValidateName(winPtr->dispPtr, actualName, w, 1)) { - RegDeleteName(regPtr, actualName); - break; - } - nextSuffix: - continue; - } - - /* - * We've now got a name to use. Store it in the name registry and - * in the local entry for this application, plus put it in a property - * on the commWindow. - */ - - RegAddName(regPtr, actualName, Tk_WindowId(dispPtr->commTkwin)); - RegClose(regPtr); - riPtr->name = (char *) ckalloc((unsigned) (strlen(actualName) + 1)); - strcpy(riPtr->name, actualName); - if (actualName != name) { - Tcl_DStringFree(&dString); - } - UpdateCommWindow(dispPtr); - - return riPtr->name; -} - -/* - *-------------------------------------------------------------- - * - * Tk_SendCmd -- - * - * This procedure is invoked to process the "send" Tcl command. - * See the user documentation for details on what it does. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * See the user documentation. - * - *-------------------------------------------------------------- - */ - -int -Tk_SendCmd(clientData, interp, argc, argv) - ClientData clientData; /* Information about sender (only - * dispPtr field is used). */ - Tcl_Interp *interp; /* Current interpreter. */ - int argc; /* Number of arguments. */ - char **argv; /* Argument strings. */ -{ - TkWindow *winPtr; - Window commWindow; - PendingCommand pending; - register RegisteredInterp *riPtr; - char *destName, buffer[30]; - int result, c, async, i, firstArg; - size_t length; - Tk_RestrictProc *prevRestrictProc; - ClientData prevArg; - TkDisplay *dispPtr; - NameRegistry *regPtr; - Tcl_DString request; - Tcl_Interp *localInterp; /* Used when the interpreter to - * send the command to is within - * the same process. */ - - /* - * Process options, if any. - */ - - async = 0; - winPtr = (TkWindow *) Tk_MainWindow(interp); - if (winPtr == NULL) { - return TCL_ERROR; - } - for (i = 1; i < (argc-1); ) { - if (argv[i][0] != '-') { - break; - } - c = argv[i][1]; - length = strlen(argv[i]); - if ((c == 'a') && (strncmp(argv[i], "-async", length) == 0)) { - async = 1; - i++; - } else if ((c == 'd') && (strncmp(argv[i], "-displayof", - length) == 0)) { - winPtr = (TkWindow *) Tk_NameToWindow(interp, argv[i+1], - (Tk_Window) winPtr); - if (winPtr == NULL) { - return TCL_ERROR; - } - i += 2; - } else if (strcmp(argv[i], "--") == 0) { - i++; - break; - } else { - Tcl_AppendResult(interp, "bad option \"", argv[i], - "\": must be -async, -displayof, or --", (char *) NULL); - return TCL_ERROR; - } - } - - if (argc < (i+2)) { - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " ?options? interpName arg ?arg ...?\"", (char *) NULL); - return TCL_ERROR; - } - destName = argv[i]; - firstArg = i+1; - - dispPtr = winPtr->dispPtr; - if (dispPtr->commTkwin == NULL) { - SendInit(interp, winPtr->dispPtr); - } - - /* - * See if the target interpreter is local. If so, execute - * the command directly without going through the X server. - * The only tricky thing is passing the result from the target - * interpreter to the invoking interpreter. Watch out: they - * could be the same! - */ - - for (riPtr = registry; riPtr != NULL; riPtr = riPtr->nextPtr) { - if ((riPtr->dispPtr != dispPtr) - || (strcmp(riPtr->name, destName) != 0)) { - continue; - } - Tcl_Preserve((ClientData) riPtr); - localInterp = riPtr->interp; - Tcl_Preserve((ClientData) localInterp); - if (firstArg == (argc-1)) { - result = Tcl_GlobalEval(localInterp, argv[firstArg]); - } else { - Tcl_DStringInit(&request); - Tcl_DStringAppend(&request, argv[firstArg], -1); - for (i = firstArg+1; i < argc; i++) { - Tcl_DStringAppend(&request, " ", 1); - Tcl_DStringAppend(&request, argv[i], -1); - } - result = Tcl_GlobalEval(localInterp, Tcl_DStringValue(&request)); - Tcl_DStringFree(&request); - } - if (interp != localInterp) { - if (result == TCL_ERROR) { - - /* - * An error occurred, so transfer error information from the - * destination interpreter back to our interpreter. Must clear - * interp's result before calling Tcl_AddErrorInfo, since - * Tcl_AddErrorInfo will store the interp's result in errorInfo - * before appending riPtr's $errorInfo; we've already got - * everything we need in riPtr's $errorInfo. - */ - - Tcl_ResetResult(interp); - Tcl_AddErrorInfo(interp, Tcl_GetVar2(localInterp, - "errorInfo", (char *) NULL, TCL_GLOBAL_ONLY)); - Tcl_SetVar2(interp, "errorCode", (char *) NULL, - Tcl_GetVar2(localInterp, "errorCode", (char *) NULL, - TCL_GLOBAL_ONLY), TCL_GLOBAL_ONLY); - } - if (localInterp->freeProc != TCL_STATIC) { - interp->result = localInterp->result; - interp->freeProc = localInterp->freeProc; - localInterp->freeProc = TCL_STATIC; - } else { - Tcl_SetResult(interp, localInterp->result, TCL_VOLATILE); - } - Tcl_ResetResult(localInterp); - } - Tcl_Release((ClientData) riPtr); - Tcl_Release((ClientData) localInterp); - return result; - } - - /* - * Bind the interpreter name to a communication window. - */ - - regPtr = RegOpen(interp, winPtr->dispPtr, 0); - commWindow = RegFindName(regPtr, destName); - RegClose(regPtr); - if (commWindow == None) { - Tcl_AppendResult(interp, "no application named \"", - destName, "\"", (char *) NULL); - return TCL_ERROR; - } - - /* - * Send the command to the target interpreter by appending it to the - * comm window in the communication window. - */ - - tkSendSerial++; - Tcl_DStringInit(&request); - Tcl_DStringAppend(&request, "\0c\0-n ", 6); - Tcl_DStringAppend(&request, destName, -1); - if (!async) { - sprintf(buffer, "%x %d", - (unsigned int) Tk_WindowId(dispPtr->commTkwin), - tkSendSerial); - Tcl_DStringAppend(&request, "\0-r ", 4); - Tcl_DStringAppend(&request, buffer, -1); - } - Tcl_DStringAppend(&request, "\0-s ", 4); - Tcl_DStringAppend(&request, argv[firstArg], -1); - for (i = firstArg+1; i < argc; i++) { - Tcl_DStringAppend(&request, " ", 1); - Tcl_DStringAppend(&request, argv[i], -1); - } - (void) AppendPropCarefully(dispPtr->display, commWindow, - dispPtr->commProperty, Tcl_DStringValue(&request), - Tcl_DStringLength(&request) + 1, - (async) ? (PendingCommand *) NULL : &pending); - Tcl_DStringFree(&request); - if (async) { - /* - * This is an asynchronous send: return immediately without - * waiting for a response. - */ - - return TCL_OK; - } - - /* - * Register the fact that we're waiting for a command to complete - * (this is needed by SendEventProc and by AppendErrorProc to pass - * back the command's results). Set up a timeout handler so that - * we can check during long sends to make sure that the destination - * application is still alive. - */ - - pending.serial = tkSendSerial; - pending.dispPtr = dispPtr; - pending.target = destName; - pending.commWindow = commWindow; - pending.interp = interp; - pending.result = NULL; - pending.errorInfo = NULL; - pending.errorCode = NULL; - pending.gotResponse = 0; - pending.nextPtr = pendingCommands; - pendingCommands = &pending; - - /* - * Enter a loop processing X events until the result comes - * in or the target is declared to be dead. While waiting - * for a result, look only at send-related events so that - * the send is synchronous with respect to other events in - * the application. - */ - - prevRestrictProc = Tk_RestrictEvents(SendRestrictProc, - (ClientData) NULL, &prevArg); - Tcl_CreateModalTimeout(1000, TimeoutProc, (ClientData) &pending); - while (!pending.gotResponse) { - Tcl_DoOneEvent(TCL_WINDOW_EVENTS); - } - Tcl_DeleteModalTimeout(TimeoutProc, (ClientData) &pending); - (void) Tk_RestrictEvents(prevRestrictProc, prevArg, &prevArg); - - /* - * Unregister the information about the pending command - * and return the result. - */ - - if (pendingCommands == &pending) { - pendingCommands = pending.nextPtr; - } else { - PendingCommand *pcPtr; - - for (pcPtr = pendingCommands; pcPtr != NULL; - pcPtr = pcPtr->nextPtr) { - if (pcPtr->nextPtr == &pending) { - pcPtr->nextPtr = pending.nextPtr; - break; - } - } - } - if (pending.errorInfo != NULL) { - /* - * Special trick: must clear the interp's result before calling - * Tcl_AddErrorInfo, since Tcl_AddErrorInfo will store the interp's - * result in errorInfo before appending pending.errorInfo; we've - * already got everything we need in pending.errorInfo. - */ - - Tcl_ResetResult(interp); - Tcl_AddErrorInfo(interp, pending.errorInfo); - ckfree(pending.errorInfo); - } - if (pending.errorCode != NULL) { - Tcl_SetVar2(interp, "errorCode", (char *) NULL, pending.errorCode, - TCL_GLOBAL_ONLY); - ckfree(pending.errorCode); - } - Tcl_SetResult(interp, pending.result, TCL_DYNAMIC); - return pending.code; -} - -/* - *---------------------------------------------------------------------- - * - * TkGetInterpNames -- - * - * This procedure is invoked to fetch a list of all the - * interpreter names currently registered for the display - * of a particular window. - * - * Results: - * A standard Tcl return value. Interp->result will be set - * to hold a list of all the interpreter names defined for - * tkwin's display. If an error occurs, then TCL_ERROR - * is returned and interp->result will hold an error message. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -TkGetInterpNames(interp, tkwin) - Tcl_Interp *interp; /* Interpreter for returning a result. */ - Tk_Window tkwin; /* Window whose display is to be used - * for the lookup. */ -{ - TkWindow *winPtr = (TkWindow *) tkwin; - char *p, *entry, *entryName; - NameRegistry *regPtr; - Window commWindow; - int count; - - /* - * Read the registry property, then scan through all of its entries. - * Validate each entry to be sure that its application still exists. - */ - - regPtr = RegOpen(interp, winPtr->dispPtr, 1); - for (p = regPtr->property; (p-regPtr->property) < regPtr->propLength; ) { - entry = p; - if (sscanf(p, "%x",(unsigned int *) &commWindow) != 1) { - commWindow = None; - } - while ((*p != 0) && (!isspace(UCHAR(*p)))) { - p++; - } - if (*p != 0) { - p++; - } - entryName = p; - while (*p != 0) { - p++; - } - p++; - if (ValidateName(winPtr->dispPtr, entryName, commWindow, 1)) { - /* - * The application still exists; add its name to the result. - */ - - Tcl_AppendElement(interp, entryName); - } else { - /* - * This name is bogus (perhaps the application died without - * cleaning up its entry in the registry?). Delete the name. - */ - - count = regPtr->propLength - (p - regPtr->property); - if (count > 0) { - memmove((VOID *) entry, (VOID *) p, (size_t) count); - } - regPtr->propLength -= p - entry; - regPtr->modified = 1; - p = entry; - } - } - RegClose(regPtr); - return TCL_OK; -} - -/* - *-------------------------------------------------------------- - * - * SendInit -- - * - * This procedure is called to initialize the - * communication channels for sending commands and - * receiving results. - * - * Results: - * None. - * - * Side effects: - * Sets up various data structures and windows. - * - *-------------------------------------------------------------- - */ - -static int -SendInit(interp, dispPtr) - Tcl_Interp *interp; /* Interpreter to use for error reporting - * (no errors are ever returned, but the - * interpreter is needed anyway). */ - TkDisplay *dispPtr; /* Display to initialize. */ -{ - XSetWindowAttributes atts; - - /* - * Create the window used for communication, and set up an - * event handler for it. - */ - - dispPtr->commTkwin = Tk_CreateWindow(interp, (Tk_Window) NULL, - "_comm", DisplayString(dispPtr->display)); - if (dispPtr->commTkwin == NULL) { - panic("Tk_CreateWindow failed in SendInit!"); - } - atts.override_redirect = True; - Tk_ChangeWindowAttributes(dispPtr->commTkwin, - CWOverrideRedirect, &atts); - Tk_CreateEventHandler(dispPtr->commTkwin, PropertyChangeMask, - SendEventProc, (ClientData) dispPtr); - Tk_MakeWindowExist(dispPtr->commTkwin); - - /* - * Get atoms used as property names. - */ - - dispPtr->commProperty = Tk_InternAtom(dispPtr->commTkwin, "Comm"); - dispPtr->registryProperty = Tk_InternAtom(dispPtr->commTkwin, - "InterpRegistry"); - dispPtr->appNameProperty = Tk_InternAtom(dispPtr->commTkwin, - "TK_APPLICATION"); - - return TCL_OK; -} - -/* - *-------------------------------------------------------------- - * - * SendEventProc -- - * - * This procedure is invoked automatically by the toolkit - * event manager when a property changes on the communication - * window. This procedure reads the property and handles - * command requests and responses. - * - * Results: - * None. - * - * Side effects: - * If there are command requests in the property, they - * are executed. If there are responses in the property, - * their information is saved for the (ostensibly waiting) - * "send" commands. The property is deleted. - * - *-------------------------------------------------------------- - */ - -static void -SendEventProc(clientData, eventPtr) - ClientData clientData; /* Display information. */ - XEvent *eventPtr; /* Information about event. */ -{ - TkDisplay *dispPtr = (TkDisplay *) clientData; - char *propInfo; - register char *p; - int result, actualFormat; - unsigned long numItems, bytesAfter; - Atom actualType; - Tcl_Interp *remoteInterp; /* Interp in which to execute the command. */ - - if ((eventPtr->xproperty.atom != dispPtr->commProperty) - || (eventPtr->xproperty.state != PropertyNewValue)) { - return; - } - - /* - * Read the comm property and delete it. - */ - - propInfo = NULL; - result = XGetWindowProperty(dispPtr->display, - Tk_WindowId(dispPtr->commTkwin), - dispPtr->commProperty, 0, MAX_PROP_WORDS, True, - XA_STRING, &actualType, &actualFormat, - &numItems, &bytesAfter, (unsigned char **) &propInfo); - - /* - * If the property doesn't exist or is improperly formed - * then ignore it. - */ - - if ((result != Success) || (actualType != XA_STRING) - || (actualFormat != 8)) { - if (propInfo != NULL) { - XFree(propInfo); - } - return; - } - - /* - * Several commands and results could arrive in the property at - * one time; each iteration through the outer loop handles a - * single command or result. - */ - - for (p = propInfo; (p-propInfo) < numItems; ) { - /* - * Ignore leading NULLs; each command or result starts with a - * NULL so that no matter how badly formed a preceding command - * is, we'll be able to tell that a new command/result is - * starting. - */ - - if (*p == 0) { - p++; - continue; - } - - if ((*p == 'c') && (p[1] == 0)) { - Window commWindow; - char *interpName, *script, *serial, *end; - Tcl_DString reply; - RegisteredInterp *riPtr; - - /* - *---------------------------------------------------------- - * This is an incoming command from some other application. - * Iterate over all of its options. Stop when we reach - * the end of the property or something that doesn't look - * like an option. - *---------------------------------------------------------- - */ - - p += 2; - interpName = NULL; - commWindow = None; - serial = ""; - script = NULL; - while (((p-propInfo) < numItems) && (*p == '-')) { - switch (p[1]) { - case 'r': - commWindow = (Window) strtoul(p+2, &end, 16); - if ((end == p+2) || (*end != ' ')) { - commWindow = None; - } else { - p = serial = end+1; - } - break; - case 'n': - if (p[2] == ' ') { - interpName = p+3; - } - break; - case 's': - if (p[2] == ' ') { - script = p+3; - } - break; - } - while (*p != 0) { - p++; - } - p++; - } - - if ((script == NULL) || (interpName == NULL)) { - continue; - } - - /* - * Initialize the result property, so that we're ready at any - * time if we need to return an error. - */ - - if (commWindow != None) { - Tcl_DStringInit(&reply); - Tcl_DStringAppend(&reply, "\0r\0-s ", 6); - Tcl_DStringAppend(&reply, serial, -1); - Tcl_DStringAppend(&reply, "\0-r ", 4); - } - - if (!ServerSecure(dispPtr)) { - if (commWindow != None) { - Tcl_DStringAppend(&reply, "X server insecure (must use xauth-style authorization); command ignored", -1); - } - result = TCL_ERROR; - goto returnResult; - } - - /* - * Locate the application, then execute the script. - */ - - for (riPtr = registry; ; riPtr = riPtr->nextPtr) { - if (riPtr == NULL) { - if (commWindow != None) { - Tcl_DStringAppend(&reply, - "receiver never heard of interpreter \"", -1); - Tcl_DStringAppend(&reply, interpName, -1); - Tcl_DStringAppend(&reply, "\"", 1); - } - result = TCL_ERROR; - goto returnResult; - } - if (strcmp(riPtr->name, interpName) == 0) { - break; - } - } - Tcl_Preserve((ClientData) riPtr); - - /* - * We must protect the interpreter because the script may - * enter another event loop, which might call Tcl_DeleteInterp. - */ - - remoteInterp = riPtr->interp; - Tcl_Preserve((ClientData) remoteInterp); - - result = Tcl_GlobalEval(remoteInterp, script); - - /* - * The call to Tcl_Release may have released the interpreter - * which will cause the "send" command for that interpreter - * to be deleted. The command deletion callback will set the - * riPtr->interp field to NULL, hence the check below for NULL. - */ - - if (commWindow != None) { - Tcl_DStringAppend(&reply, remoteInterp->result, -1); - if (result == TCL_ERROR) { - char *varValue; - - varValue = Tcl_GetVar2(remoteInterp, "errorInfo", - (char *) NULL, TCL_GLOBAL_ONLY); - if (varValue != NULL) { - Tcl_DStringAppend(&reply, "\0-i ", 4); - Tcl_DStringAppend(&reply, varValue, -1); - } - varValue = Tcl_GetVar2(remoteInterp, "errorCode", - (char *) NULL, TCL_GLOBAL_ONLY); - if (varValue != NULL) { - Tcl_DStringAppend(&reply, "\0-e ", 4); - Tcl_DStringAppend(&reply, varValue, -1); - } - } - } - Tcl_Release((ClientData) remoteInterp); - Tcl_Release((ClientData) riPtr); - - /* - * Return the result to the sender if a commWindow was - * specified (if none was specified then this is an asynchronous - * call). Right now reply has everything but the completion - * code, but it needs the NULL to terminate the current option. - */ - - returnResult: - if (commWindow != None) { - if (result != TCL_OK) { - char buffer[20]; - - sprintf(buffer, "%d", result); - Tcl_DStringAppend(&reply, "\0-c ", 4); - Tcl_DStringAppend(&reply, buffer, -1); - } - (void) AppendPropCarefully(dispPtr->display, commWindow, - dispPtr->commProperty, Tcl_DStringValue(&reply), - Tcl_DStringLength(&reply) + 1, - (PendingCommand *) NULL); - XFlush(dispPtr->display); - Tcl_DStringFree(&reply); - } - } else if ((*p == 'r') && (p[1] == 0)) { - int serial, code, gotSerial; - char *errorInfo, *errorCode, *resultString; - PendingCommand *pcPtr; - - /* - *---------------------------------------------------------- - * This is a reply to some command that we sent out. Iterate - * over all of its options. Stop when we reach the end of the - * property or something that doesn't look like an option. - *---------------------------------------------------------- - */ - - p += 2; - code = TCL_OK; - gotSerial = 0; - errorInfo = NULL; - errorCode = NULL; - resultString = ""; - while (((p-propInfo) < numItems) && (*p == '-')) { - switch (p[1]) { - case 'c': - if (sscanf(p+2, " %d", &code) != 1) { - code = TCL_OK; - } - break; - case 'e': - if (p[2] == ' ') { - errorCode = p+3; - } - break; - case 'i': - if (p[2] == ' ') { - errorInfo = p+3; - } - break; - case 'r': - if (p[2] == ' ') { - resultString = p+3; - } - break; - case 's': - if (sscanf(p+2, " %d", &serial) == 1) { - gotSerial = 1; - } - break; - } - while (*p != 0) { - p++; - } - p++; - } - - if (!gotSerial) { - continue; - } - - /* - * Give the result information to anyone who's - * waiting for it. - */ - - for (pcPtr = pendingCommands; pcPtr != NULL; - pcPtr = pcPtr->nextPtr) { - if ((serial != pcPtr->serial) || (pcPtr->result != NULL)) { - continue; - } - pcPtr->code = code; - if (resultString != NULL) { - pcPtr->result = (char *) ckalloc((unsigned) - (strlen(resultString) + 1)); - strcpy(pcPtr->result, resultString); - } - if (code == TCL_ERROR) { - if (errorInfo != NULL) { - pcPtr->errorInfo = (char *) ckalloc((unsigned) - (strlen(errorInfo) + 1)); - strcpy(pcPtr->errorInfo, errorInfo); - } - if (errorCode != NULL) { - pcPtr->errorCode = (char *) ckalloc((unsigned) - (strlen(errorCode) + 1)); - strcpy(pcPtr->errorCode, errorCode); - } - } - pcPtr->gotResponse = 1; - break; - } - } else { - /* - * Didn't recognize this thing. Just skip through the next - * null character and try again. - */ - - while (*p != 0) { - p++; - } - p++; - } - } - XFree(propInfo); -} - -/* - *-------------------------------------------------------------- - * - * AppendPropCarefully -- - * - * Append a given property to a given window, but set up - * an X error handler so that if the append fails this - * procedure can return an error code rather than having - * Xlib panic. - * - * Results: - * None. - * - * Side effects: - * The given property on the given window is appended to. - * If this operation fails and if pendingPtr is non-NULL, - * then the pending operation is marked as complete with - * an error. - * - *-------------------------------------------------------------- - */ - -static void -AppendPropCarefully(display, window, property, value, length, pendingPtr) - Display *display; /* Display on which to operate. */ - Window window; /* Window whose property is to - * be modified. */ - Atom property; /* Name of property. */ - char *value; /* Characters to append to property. */ - int length; /* Number of bytes to append. */ - PendingCommand *pendingPtr; /* Pending command to mark complete - * if an error occurs during the - * property op. NULL means just - * ignore the error. */ -{ - Tk_ErrorHandler handler; - - handler = Tk_CreateErrorHandler(display, -1, -1, -1, AppendErrorProc, - (ClientData) pendingPtr); - XChangeProperty(display, window, property, XA_STRING, 8, - PropModeAppend, (unsigned char *) value, length); - Tk_DeleteErrorHandler(handler); -} - -/* - * The procedure below is invoked if an error occurs during - * the XChangeProperty operation above. - */ - - /* ARGSUSED */ -static int -AppendErrorProc(clientData, errorPtr) - ClientData clientData; /* Command to mark complete, or NULL. */ - XErrorEvent *errorPtr; /* Information about error. */ -{ - PendingCommand *pendingPtr = (PendingCommand *) clientData; - register PendingCommand *pcPtr; - - if (pendingPtr == NULL) { - return 0; - } - - /* - * Make sure this command is still pending. - */ - - for (pcPtr = pendingCommands; pcPtr != NULL; - pcPtr = pcPtr->nextPtr) { - if ((pcPtr == pendingPtr) && (pcPtr->result == NULL)) { - pcPtr->result = (char *) ckalloc((unsigned) - (strlen(pcPtr->target) + 50)); - sprintf(pcPtr->result, "no application named \"%s\"", - pcPtr->target); - pcPtr->code = TCL_ERROR; - pcPtr->gotResponse = 1; - break; - } - } - return 0; -} - -/* - *-------------------------------------------------------------- - * - * TimeoutProc -- - * - * This procedure is invoked when an unusually long amout of - * time has elapsed during the processing of a sent command. - * It checks to make sure that the target application still - * exists, and reschedules itself to check again later. - * - * Results: - * None. - * - * Side effects: - * If the target application has gone away abort the send - * operation with an error. - * - *-------------------------------------------------------------- - */ - -static void -TimeoutProc(clientData) - ClientData clientData; /* Information about command that - * has been sent but not yet - * responded to. */ -{ - PendingCommand *pcPtr = (PendingCommand *) clientData; - register PendingCommand *pcPtr2; - - /* - * Make sure that the command is still in the pending list - * and that it hasn't already completed. Then validate the - * existence of the target application. - */ - - for (pcPtr2 = pendingCommands; pcPtr2 != NULL; - pcPtr2 = pcPtr2->nextPtr) { - char *msg; - if ((pcPtr2 != pcPtr) || (pcPtr2->result != NULL)) { - continue; - } - if (!ValidateName(pcPtr2->dispPtr, pcPtr2->target, - pcPtr2->commWindow, 0)) { - if (ValidateName(pcPtr2->dispPtr, pcPtr2->target, - pcPtr2->commWindow, 1)) { - msg = - "target application died or uses a Tk version before 4.0"; - } else { - msg = "target application died"; - } - pcPtr2->code = TCL_ERROR; - pcPtr2->result = (char *) ckalloc((unsigned) (strlen(msg) + 1)); - strcpy(pcPtr2->result, msg); - pcPtr2->gotResponse = 1; - } else { - Tcl_DeleteModalTimeout(TimeoutProc, clientData); - Tcl_CreateModalTimeout(2000, TimeoutProc, clientData); - } - } -} - -/* - *-------------------------------------------------------------- - * - * DeleteProc -- - * - * This procedure is invoked by Tcl when the "send" command - * is deleted in an interpreter. It unregisters the interpreter. - * - * Results: - * None. - * - * Side effects: - * The interpreter given by riPtr is unregistered. - * - *-------------------------------------------------------------- - */ - -static void -DeleteProc(clientData) - ClientData clientData; /* Info about registration, passed - * as ClientData. */ -{ - RegisteredInterp *riPtr = (RegisteredInterp *) clientData; - register RegisteredInterp *riPtr2; - NameRegistry *regPtr; - - regPtr = RegOpen(riPtr->interp, riPtr->dispPtr, 1); - RegDeleteName(regPtr, riPtr->name); - RegClose(regPtr); - - if (registry == riPtr) { - registry = riPtr->nextPtr; - } else { - for (riPtr2 = registry; riPtr2 != NULL; - riPtr2 = riPtr2->nextPtr) { - if (riPtr2->nextPtr == riPtr) { - riPtr2->nextPtr = riPtr->nextPtr; - break; - } - } - } - ckfree((char *) riPtr->name); - riPtr->interp = NULL; - UpdateCommWindow(riPtr->dispPtr); - Tcl_EventuallyFree((ClientData) riPtr, TCL_DYNAMIC); -} - -/* - *---------------------------------------------------------------------- - * - * SendRestrictProc -- - * - * This procedure filters incoming events when a "send" command - * is outstanding. It defers all events except those containing - * send commands and results. - * - * Results: - * False is returned except for property-change events on a - * commWindow. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - - /* ARGSUSED */ -static Tk_RestrictAction -SendRestrictProc(clientData, eventPtr) - ClientData clientData; /* Not used. */ - register XEvent *eventPtr; /* Event that just arrived. */ -{ - TkDisplay *dispPtr; - - if (eventPtr->type != PropertyNotify) { - return TK_DEFER_EVENT; - } - for (dispPtr = tkDisplayList; dispPtr != NULL; dispPtr = dispPtr->nextPtr) { - if ((eventPtr->xany.display == dispPtr->display) - && (eventPtr->xproperty.window - == Tk_WindowId(dispPtr->commTkwin))) { - return TK_PROCESS_EVENT; - } - } - return TK_DEFER_EVENT; -} - -/* - *---------------------------------------------------------------------- - * - * UpdateCommWindow -- - * - * This procedure updates the list of application names stored - * on our commWindow. It is typically called when interpreters - * are registered and unregistered. - * - * Results: - * None. - * - * Side effects: - * The TK_APPLICATION property on the comm window is updated. - * - *---------------------------------------------------------------------- - */ - -static void -UpdateCommWindow(dispPtr) - TkDisplay *dispPtr; /* Display whose commWindow is to be - * updated. */ -{ - Tcl_DString names; - RegisteredInterp *riPtr; - - Tcl_DStringInit(&names); - for (riPtr = registry; riPtr != NULL; riPtr = riPtr->nextPtr) { - Tcl_DStringAppendElement(&names, riPtr->name); - } - XChangeProperty(dispPtr->display, Tk_WindowId(dispPtr->commTkwin), - dispPtr->appNameProperty, XA_STRING, 8, PropModeReplace, - (unsigned char *) Tcl_DStringValue(&names), - Tcl_DStringLength(&names)); - Tcl_DStringFree(&names); -} diff --git a/tk/generic/tkXId.c b/tk/generic/tkXId.c deleted file mode 100644 index 8cf397d9dd4..00000000000 --- a/tk/generic/tkXId.c +++ /dev/null @@ -1,495 +0,0 @@ -/* - * tkXId.c -- - * - * This file provides a replacement function for the default X - * resource allocator (_XAllocID). The problem with the default - * allocator is that it never re-uses ids, which causes long-lived - * applications to crash when X resource identifiers wrap around. - * The replacement functions in this file re-use old identifiers - * to prevent this problem. - * - * The code in this file is based on similar implementations by - * George C. Kaplan and Michael Hoegeman. - * - * Copyright (c) 1993 The Regents of the University of California. - * Copyright (c) 1994-1995 Sun Microsystems, Inc. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * SCCS: @(#) tkXId.c 1.16 96/02/28 21:56:40 - */ - -/* - * The definition below is needed on some systems so that we can access - * the resource_alloc field of Display structures in order to replace - * the resource allocator. - */ - -#define XLIB_ILLEGAL_ACCESS 1 - -#include "tkInt.h" -#include "tkPort.h" - -/* - * A structure of the following type is used to hold one or more - * available resource identifiers. There is a list of these structures - * for each display. - */ - -#define IDS_PER_STACK 10 -typedef struct TkIdStack { - XID ids[IDS_PER_STACK]; /* Array of free identifiers. */ - int numUsed; /* Indicates how many of the entries - * in ids are currently in use. */ - TkDisplay *dispPtr; /* Display to which ids belong. */ - struct TkIdStack *nextPtr; /* Next bunch of free identifiers - * for the same display. */ -} TkIdStack; - -/* - * Forward declarations for procedures defined in this file: - */ - -static XID AllocXId _ANSI_ARGS_((Display *display)); -static Tk_RestrictAction CheckRestrictProc _ANSI_ARGS_(( - ClientData clientData, XEvent *eventPtr)); -static void WindowIdCleanup _ANSI_ARGS_((ClientData clientData)); -static void WindowIdCleanup2 _ANSI_ARGS_((ClientData clientData)); - -/* - *---------------------------------------------------------------------- - * - * TkInitXId -- - * - * This procedure is called to initialize the id allocator for - * a given display. - * - * Results: - * None. - * - * Side effects: - * The official allocator for the display is set up to be Tk_AllocXID. - * - *---------------------------------------------------------------------- - */ - -void -TkInitXId(dispPtr) - TkDisplay *dispPtr; /* Tk's information about the - * display. */ -{ - dispPtr->idStackPtr = NULL; - dispPtr->defaultAllocProc = dispPtr->display->resource_alloc; - dispPtr->display->resource_alloc = AllocXId; - dispPtr->windowStackPtr = NULL; - dispPtr->idCleanupScheduled = 0; -} - -/* - *---------------------------------------------------------------------- - * - * AllocXId -- - * - * This procedure is invoked by Xlib as the resource allocator - * for a display. - * - * Results: - * The return value is an X resource identifier that isn't currently - * in use. - * - * Side effects: - * The identifier is removed from the stack of free identifiers, - * if it was previously on the stack. - * - *---------------------------------------------------------------------- - */ - -static XID -AllocXId(display) - Display *display; /* Display for which to allocate. */ -{ - TkDisplay *dispPtr; - TkIdStack *stackPtr; - - /* - * Find Tk's information about the display. - */ - - dispPtr = TkGetDisplay(display); - - /* - * If the topmost chunk on the stack is empty then free it. Then - * check for a free id on the stack and return it if it exists. - */ - - stackPtr = dispPtr->idStackPtr; - if (stackPtr != NULL) { - while (stackPtr->numUsed == 0) { - dispPtr->idStackPtr = stackPtr->nextPtr; - ckfree((char *) stackPtr); - stackPtr = dispPtr->idStackPtr; - if (stackPtr == NULL) { - goto defAlloc; - } - } - stackPtr->numUsed--; - return stackPtr->ids[stackPtr->numUsed]; - } - - /* - * No free ids in the stack: just get one from the default - * allocator. - */ - - defAlloc: - return (*dispPtr->defaultAllocProc)(display); -} - -/* - *---------------------------------------------------------------------- - * - * Tk_FreeXId -- - * - * This procedure is called to indicate that an X resource identifier - * is now free. - * - * Results: - * None. - * - * Side effects: - * The identifier is added to the stack of free identifiers for its - * display, so that it can be re-used. - * - *---------------------------------------------------------------------- - */ - -void -Tk_FreeXId(display, xid) - Display *display; /* Display for which xid was - * allocated. */ - XID xid; /* Identifier that is no longer - * in use. */ -{ - TkDisplay *dispPtr; - TkIdStack *stackPtr; - - /* - * Find Tk's information about the display. - */ - - dispPtr = TkGetDisplay(display); - - /* - * Add a new chunk to the stack if the current chunk is full. - */ - - stackPtr = dispPtr->idStackPtr; - if ((stackPtr == NULL) || (stackPtr->numUsed >= IDS_PER_STACK)) { - stackPtr = (TkIdStack *) ckalloc(sizeof(TkIdStack)); - stackPtr->numUsed = 0; - stackPtr->dispPtr = dispPtr; - stackPtr->nextPtr = dispPtr->idStackPtr; - dispPtr->idStackPtr = stackPtr; - } - - /* - * Add the id to the current chunk. - */ - - stackPtr->ids[stackPtr->numUsed] = xid; - stackPtr->numUsed++; -} - -/* - *---------------------------------------------------------------------- - * - * TkFreeWindowId -- - * - * This procedure is invoked instead of TkFreeXId for window ids. - * See below for the reason why. - * - * Results: - * None. - * - * Side effects: - * The id given by w will eventually be freed, so that it can be - * reused for other resources. - * - * Design: - * Freeing window ids is very tricky because there could still be - * events pending for a window in the event queue (or even in the - * server) at the time the window is destroyed. If the window - * id were to get reused immediately for another window, old - * events could "drop in" on the new window, causing unexpected - * behavior. - * - * Thus we have to wait to re-use a window id until we know that - * there are no events left for it. Right now this is done in - * two steps. First, we wait until we know that the server - * has seen the XDestroyWindow request, so we can be sure that - * it won't generate more events for the window and that any - * existing events are in our queue. Second, we make sure that - * there are no events whatsoever in our queue (this is conservative - * but safe). - * - * The first step is done by remembering the request id of the - * XDestroyWindow request and using LastKnownRequestProcessed to - * see what events the server has processed. If multiple windows - * get destroyed at about the same time, we just remember the - * most recent request number for any of them (again, conservative - * but safe). - * - * There are a few other complications as well. When Tk destroys a - * sub-tree of windows, it only issues a single XDestroyWindow call, - * at the very end for the root of the subtree. We can't free any of - * the window ids until the final XDestroyWindow call. To make sure - * that this happens, we have to keep track of deletions in progress, - * hence the need for the "destroyCount" field of the display. - * - * One final problem. Some servers, like Sun X11/News servers still - * seem to have problems with ids getting reused too quickly. I'm - * not completely sure why this is a problem, but delaying the - * recycling of ids appears to eliminate it. Therefore, we wait - * an additional few seconds, even after "the coast is clear" - * before reusing the ids. - * - *---------------------------------------------------------------------- - */ - -void -TkFreeWindowId(dispPtr, w) - TkDisplay *dispPtr; /* Display that w belongs to. */ - Window w; /* X identifier for window on dispPtr. */ -{ - TkIdStack *stackPtr; - - /* - * Put the window id on a separate stack of window ids, rather - * than the main stack, so it won't get reused right away. Add - * a new chunk to the stack if the current chunk is full. - */ - - stackPtr = dispPtr->windowStackPtr; - if ((stackPtr == NULL) || (stackPtr->numUsed >= IDS_PER_STACK)) { - stackPtr = (TkIdStack *) ckalloc(sizeof(TkIdStack)); - stackPtr->numUsed = 0; - stackPtr->dispPtr = dispPtr; - stackPtr->nextPtr = dispPtr->windowStackPtr; - dispPtr->windowStackPtr = stackPtr; - } - - /* - * Add the id to the current chunk. - */ - - stackPtr->ids[stackPtr->numUsed] = w; - stackPtr->numUsed++; - - /* - * Schedule a call to WindowIdCleanup if one isn't already - * scheduled. - */ - - if (!dispPtr->idCleanupScheduled) { - dispPtr->idCleanupScheduled = 1; - Tcl_CreateTimerHandler(100, WindowIdCleanup, (ClientData *) dispPtr); - } -} - -/* - *---------------------------------------------------------------------- - * - * WindowIdCleanup -- - * - * See if we can now free up all the accumulated ids of - * deleted windows. - * - * Results: - * None. - * - * Side effects: - * If it's safe to move the window ids back to the main free - * list, we schedule this to happen after a few mores seconds - * of delay. If it's not safe to move them yet, a timer handler - * gets invoked to try again later. - * - *---------------------------------------------------------------------- - */ - -static void -WindowIdCleanup(clientData) - ClientData clientData; /* Pointer to TkDisplay for display */ -{ - TkDisplay *dispPtr = (TkDisplay *) clientData; - int anyEvents, delta; - Tk_RestrictProc *oldProc; - ClientData oldData; - - dispPtr->idCleanupScheduled = 0; - - /* - * See if it's safe to recycle the window ids. It's safe if: - * (a) no deletions are in progress. - * (b) the server has seen all of the requests up to the last - * XDestroyWindow request. - * (c) there are no events in the event queue; the only way to - * test for this right now is to create a restrict proc that - * will filter the events, then call Tcl_DoOneEvent to see if - * the procedure gets invoked. - */ - - if (dispPtr->destroyCount > 0) { - goto tryAgain; - } - delta = LastKnownRequestProcessed(dispPtr->display) - - dispPtr->lastDestroyRequest; - if (delta < 0) { - XSync(dispPtr->display, False); - } - anyEvents = 0; - oldProc = Tk_RestrictEvents(CheckRestrictProc, (ClientData) &anyEvents, - &oldData); - Tcl_DoOneEvent(TCL_DONT_WAIT|TCL_WINDOW_EVENTS); - Tk_RestrictEvents(oldProc, oldData, &oldData); - if (anyEvents) { - goto tryAgain; - } - - /* - * These ids look safe to recycle, but we still need to delay a bit - * more (see comments for TkFreeWindowId). Schedule the final freeing. - */ - - if (dispPtr->windowStackPtr != NULL) { - Tcl_CreateTimerHandler(5000, WindowIdCleanup2, - (ClientData) dispPtr->windowStackPtr); - dispPtr->windowStackPtr = NULL; - } - return; - - /* - * It's still not safe to free up the ids. Try again a bit later. - */ - - tryAgain: - dispPtr->idCleanupScheduled = 1; - Tcl_CreateTimerHandler(500, WindowIdCleanup, (ClientData *) dispPtr); -} - -/* - *---------------------------------------------------------------------- - * - * WindowIdCleanup2 -- - * - * This procedure is the last one in the chain that recycles - * window ids. It takes all of the ids indicated by its - * argument and adds them back to the main id free list. - * - * Results: - * None. - * - * Side effects: - * Window ids get added to the main free list for their display. - * - *---------------------------------------------------------------------- - */ - -static void -WindowIdCleanup2(clientData) - ClientData clientData; /* Pointer to TkIdStack list. */ -{ - TkIdStack *stackPtr = (TkIdStack *) clientData; - TkIdStack *lastPtr; - - lastPtr = stackPtr; - while (lastPtr->nextPtr != NULL) { - lastPtr = lastPtr->nextPtr; - } - lastPtr->nextPtr = stackPtr->dispPtr->idStackPtr; - stackPtr->dispPtr->idStackPtr = stackPtr; -} - -/* - *---------------------------------------------------------------------- - * - * CheckRestrictProc -- - * - * This procedure is a restrict procedure, called by Tcl_DoOneEvent - * to filter X events. All it does is to set a flag to indicate - * that there are X events present. - * - * Results: - * Sets the integer pointed to by the argument, then returns - * TK_DEFER_EVENT. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static Tk_RestrictAction -CheckRestrictProc(clientData, eventPtr) - ClientData clientData; /* Pointer to flag to set. */ - XEvent *eventPtr; /* Event to filter; not used. */ -{ - int *flag = (int *) clientData; - *flag = 1; - return TK_DEFER_EVENT; -} - -/* - *---------------------------------------------------------------------- - * - * Tk_GetPixmap -- - * - * Same as the XCreatePixmap procedure except that it manages - * resource identifiers better. - * - * Results: - * Returns a new pixmap. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -Pixmap -Tk_GetPixmap(display, d, width, height, depth) - Display *display; /* Display for new pixmap. */ - Drawable d; /* Drawable where pixmap will be used. */ - int width, height; /* Dimensions of pixmap. */ - int depth; /* Bits per pixel for pixmap. */ -{ - return XCreatePixmap(display, d, (unsigned) width, (unsigned) height, - (unsigned) depth); -} - -/* - *---------------------------------------------------------------------- - * - * Tk_FreePixmap -- - * - * Same as the XFreePixmap procedure except that it also marks - * the resource identifier as free. - * - * Results: - * None. - * - * Side effects: - * The pixmap is freed in the X server and its resource identifier - * is saved for re-use. - * - *---------------------------------------------------------------------- - */ - -void -Tk_FreePixmap(display, pixmap) - Display *display; /* Display for which pixmap was allocated. */ - Pixmap pixmap; /* Identifier for pixmap. */ -{ - XFreePixmap(display, pixmap); - Tk_FreeXId(display, (XID) pixmap); -} diff --git a/tk/library/folder.gif b/tk/library/folder.gif Binary files differdeleted file mode 100644 index 112bce7ab09..00000000000 --- a/tk/library/folder.gif +++ /dev/null diff --git a/tk/library/textfile.gif b/tk/library/textfile.gif Binary files differdeleted file mode 100644 index 764d498aa53..00000000000 --- a/tk/library/textfile.gif +++ /dev/null diff --git a/tk/library/updir.xbm b/tk/library/updir.xbm deleted file mode 100644 index a2404f7c189..00000000000 --- a/tk/library/updir.xbm +++ /dev/null @@ -1,9 +0,0 @@ -#define updir_width 28 -#define updir_height 16 -static char updir_bits[] = { - 0x00, 0x00, 0x00, 0x00, 0x80, 0x1f, 0x00, 0x00, 0x40, 0x20, 0x00, 0x00, - 0x20, 0x40, 0x00, 0x00, 0xf0, 0xff, 0xff, 0x01, 0x10, 0x00, 0x00, 0x01, - 0x10, 0x02, 0x00, 0x01, 0x10, 0x07, 0x00, 0x01, 0x90, 0x0f, 0x00, 0x01, - 0x10, 0x02, 0x00, 0x01, 0x10, 0x02, 0x00, 0x01, 0x10, 0x02, 0x00, 0x01, - 0x10, 0xfe, 0x07, 0x01, 0x10, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x01, - 0xf0, 0xff, 0xff, 0x01}; diff --git a/tk/mac/tkMacScrollbar.c b/tk/mac/tkMacScrollbar.c deleted file mode 100644 index 3a1098aef44..00000000000 --- a/tk/mac/tkMacScrollbar.c +++ /dev/null @@ -1,1610 +0,0 @@ -/* - * tkMacScrollbar.c -- - * - * This module implements the native Macintosh scrollbar widget - * for the Tk toolkit. A scrollbar displays a slider and two - * arrows; mouse clicks on features within the scrollbar cause - * scrolling commands to be invoked. - * - * Copyright (c) 1995-1996 Sun Microsystems, Inc. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * SCCS: @(#) tkMacScrollbar.c 1.11 96/09/05 13:39:45 - */ - -#include "tkPort.h" -#include "default.h" -#include "tkInt.h" -#include <Controls.h> -#include "tkMacInt.h" - -/* - * The following definitions should really be in MacOS - * header files. They are included here as this is the only - * file that needs the declarations. - */ -typedef pascal void (*ThumbActionFunc)(void); - -#if GENERATINGCFM -typedef UniversalProcPtr ThumbActionUPP; -#else -typedef ThumbActionFunc ThumbActionUPP; -#endif - -enum { - uppThumbActionProcInfo = kPascalStackBased -}; - -#if GENERATINGCFM -#define NewThumbActionProc(userRoutine) \ - (ThumbActionUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppThumbActionProcInfo, GetCurrentArchitecture()) -#else -#define NewThumbActionProc(userRoutine) \ - ((ThumbActionUPP) (userRoutine)) -#endif - -/* - * Change defines for Mac look & feel. - * TODO: should be moved to tkDefaults.h - */ -#undef DEF_SCROLLBAR_WIDTH -#define DEF_SCROLLBAR_WIDTH "15" -#undef DEF_SCROLLBAR_RELIEF -#define DEF_SCROLLBAR_RELIEF "flat" -#undef DEF_SCROLLBAR_BORDER_WIDTH -#define DEF_SCROLLBAR_BORDER_WIDTH "0" -#undef DEF_SCROLLBAR_HIGHLIGHT_WIDTH -#define DEF_SCROLLBAR_HIGHLIGHT_WIDTH "0" - -/* - * A data structure of the following type is kept for each scrollbar - * widget managed by this file: - */ - -typedef struct { - Tk_Window tkwin; /* Window that embodies the scrollbar. NULL - * means that the window has been destroyed - * but the data structures haven't yet been - * cleaned up.*/ - Display *display; /* Display containing widget. Used, among - * other things, so that resources can be - * freed even after tkwin has gone away. */ - Tcl_Interp *interp; /* Interpreter associated with scrollbar. */ - Tcl_Command widgetCmd; /* Token for scrollbar's widget command. */ - Tk_Uid orientUid; /* Orientation for window ("vertical" or - * "horizontal"). */ - int vertical; /* Non-zero means vertical orientation - * requested, zero means horizontal. */ - int width; /* Desired narrow dimension of scrollbar, - * in pixels. */ - char *command; /* Command prefix to use when invoking - * scrolling commands. NULL means don't - * invoke commands. Malloc'ed. */ - int commandSize; /* Number of non-NULL bytes in command. */ - int repeatDelay; /* How long to wait before auto-repeating - * on scrolling actions (in ms). */ - int repeatInterval; /* Interval between autorepeats (in ms). */ - int jump; /* Value of -jump option. */ - - /* - * Information used when displaying widget: - */ - - int borderWidth; /* Width of 3-D borders. */ - Tk_3DBorder bgBorder; /* Used for drawing background (all flat - * surfaces except for trough). */ - Tk_3DBorder activeBorder; /* For drawing backgrounds when active (i.e. - * when mouse is positioned over element). */ - XColor *troughColorPtr; /* Color for drawing trough. */ - GC troughGC; /* For drawing trough. */ - GC copyGC; /* Used for copying from pixmap onto screen. */ - int relief; /* Indicates whether window as a whole is - * raised, sunken, or flat. */ - int highlightWidth; /* Width in pixels of highlight to draw - * around widget when it has the focus. - * <= 0 means don't draw a highlight. */ - XColor *highlightBgColorPtr; - /* Color for drawing traversal highlight - * area when highlight is off. */ - XColor *highlightColorPtr; /* Color for drawing traversal highlight. */ - int inset; /* Total width of all borders, including - * traversal highlight and 3-D border. - * Indicates how much interior stuff must - * be offset from outside edges to leave - * room for borders. */ - int elementBorderWidth; /* Width of border to draw around elements - * inside scrollbar (arrows and slider). - * -1 means use borderWidth. */ - int arrowLength; /* Length of arrows along long dimension of - * scrollbar, including space for a small gap - * between the arrow and the slider. - * Recomputed on window size changes. */ - int sliderFirst; /* Pixel coordinate of top or left edge - * of slider area, including border. */ - int sliderLast; /* Coordinate of pixel just after bottom - * or right edge of slider area, including - * border. */ - int activeField; /* Names field to be displayed in active - * colors, such as TOP_ARROW, or 0 for - * no field. */ - int activeRelief; /* Value of -activeRelief option: relief - * to use for active element. */ - - /* - * Information describing the application related to the scrollbar. - * This information is provided by the application by invoking the - * "set" widget command. This information can now be provided in - * two ways: the "old" form (totalUnits, windowUnits, firstUnit, - * and lastUnit), or the "new" form (firstFraction and lastFraction). - * FirstFraction and lastFraction will always be valid, but - * the old-style information is only valid if the NEW_STYLE_COMMANDS - * flag is 0. - */ - - int totalUnits; /* Total dimension of application, in - * units. Valid only if the NEW_STYLE_COMMANDS - * flag isn't set. */ - int windowUnits; /* Maximum number of units that can be - * displayed in the window at once. Valid - * only if the NEW_STYLE_COMMANDS flag isn't - * set. */ - int firstUnit; /* Number of last unit visible in - * application's window. Valid only if the - * NEW_STYLE_COMMANDS flag isn't set. */ - int lastUnit; /* Index of last unit visible in window. - * Valid only if the NEW_STYLE_COMMANDS - * flag isn't set. */ - double firstFraction; /* Position of first visible thing in window, - * specified as a fraction between 0 and - * 1.0. */ - double lastFraction; /* Position of last visible thing in window, - * specified as a fraction between 0 and - * 1.0. */ - - /* - * Miscellaneous information: - */ - - Tk_Cursor cursor; /* Current cursor for window, or None. */ - char *takeFocus; /* Value of -takefocus option; not used in - * the C code, but used by keyboard traversal - * scripts. Malloc'ed, but may be NULL. */ - Tk_TimerToken autoRepeat; /* Token for auto-repeat that's - * currently in progress. NULL means no - * auto-repeat in progress. */ - int flags; /* Various flags; see below for - * definitions. */ - - /* - * Mac specific fields. - */ - ControlRef sbHandle; /* Handle to the Scrollbar control struct. */ -} Scrollbar; - -/* - * Legal values for "activeField" field of Scrollbar structures. These - * are also the return values from the ScrollbarPosition procedure. - */ - -#define OUTSIDE 0 -#define TOP_ARROW 1 -#define TOP_GAP 2 -#define SLIDER 3 -#define BOTTOM_GAP 4 -#define BOTTOM_ARROW 5 - -/* - * Flag bits for scrollbars: - * - * REDRAW_PENDING: Non-zero means a DoWhenIdle handler - * has already been queued to redraw - * this window. - * NEW_STYLE_COMMANDS: Non-zero means the new style of commands - * should be used to communicate with the - * widget: ".t yview scroll 2 lines", instead - * of ".t yview 40", for example. - * GOT_FOCUS: Non-zero means this window has the input - * focus. - * SCROLLBAR_GROW: Non-zero means this window draws the grow - * region for the toplevel window. Mac only. - * ACTIVE: Non-zero means this window is currently - * active (in the foreground). Mac only. - */ - -#define REDRAW_PENDING 1 -#define NEW_STYLE_COMMANDS 2 -#define GOT_FOCUS 4 -#define SCROLLBAR_GROW 8 -#define ACTIVE 16 - -/* - * Minimum slider length, in pixels (designed to make sure that the slider - * is always easy to grab with the mouse). - */ - -#define MIN_SLIDER_LENGTH 5 - -/* - * Information used for argv parsing. - */ - -static Tk_ConfigSpec configSpecs[] = { - {TK_CONFIG_BORDER, "-activebackground", "activeBackground", "Foreground", - DEF_SCROLLBAR_ACTIVE_BG_COLOR, Tk_Offset(Scrollbar, activeBorder), - TK_CONFIG_COLOR_ONLY}, - {TK_CONFIG_BORDER, "-activebackground", "activeBackground", "Foreground", - DEF_SCROLLBAR_ACTIVE_BG_MONO, Tk_Offset(Scrollbar, activeBorder), - TK_CONFIG_MONO_ONLY}, - {TK_CONFIG_RELIEF, "-activerelief", "activeRelief", "Relief", - DEF_SCROLLBAR_ACTIVE_RELIEF, Tk_Offset(Scrollbar, activeRelief), 0}, - {TK_CONFIG_BORDER, "-background", "background", "Background", - DEF_SCROLLBAR_BG_COLOR, Tk_Offset(Scrollbar, bgBorder), - TK_CONFIG_COLOR_ONLY}, - {TK_CONFIG_BORDER, "-background", "background", "Background", - DEF_SCROLLBAR_BG_MONO, Tk_Offset(Scrollbar, bgBorder), - TK_CONFIG_MONO_ONLY}, - {TK_CONFIG_SYNONYM, "-bd", "borderWidth", (char *) NULL, - (char *) NULL, 0, 0}, - {TK_CONFIG_SYNONYM, "-bg", "background", (char *) NULL, - (char *) NULL, 0, 0}, - {TK_CONFIG_PIXELS, "-borderwidth", "borderWidth", "BorderWidth", - DEF_SCROLLBAR_BORDER_WIDTH, Tk_Offset(Scrollbar, borderWidth), 0}, - {TK_CONFIG_STRING, "-command", "command", "Command", - DEF_SCROLLBAR_COMMAND, Tk_Offset(Scrollbar, command), - TK_CONFIG_NULL_OK}, - {TK_CONFIG_ACTIVE_CURSOR, "-cursor", "cursor", "Cursor", - DEF_SCROLLBAR_CURSOR, Tk_Offset(Scrollbar, cursor), TK_CONFIG_NULL_OK}, - {TK_CONFIG_PIXELS, "-elementborderwidth", "elementBorderWidth", - "BorderWidth", DEF_SCROLLBAR_EL_BORDER_WIDTH, - Tk_Offset(Scrollbar, elementBorderWidth), 0}, - {TK_CONFIG_COLOR, "-highlightbackground", "highlightBackground", - "HighlightBackground", DEF_SCROLLBAR_HIGHLIGHT_BG, - Tk_Offset(Scrollbar, highlightBgColorPtr), 0}, - {TK_CONFIG_COLOR, "-highlightcolor", "highlightColor", "HighlightColor", - DEF_SCROLLBAR_HIGHLIGHT, - Tk_Offset(Scrollbar, highlightColorPtr), 0}, - {TK_CONFIG_PIXELS, "-highlightthickness", "highlightThickness", - "HighlightThickness", - DEF_SCROLLBAR_HIGHLIGHT_WIDTH, Tk_Offset(Scrollbar, highlightWidth), 0}, - {TK_CONFIG_BOOLEAN, "-jump", "jump", "Jump", - DEF_SCROLLBAR_JUMP, Tk_Offset(Scrollbar, jump), 0}, - {TK_CONFIG_UID, "-orient", "orient", "Orient", - DEF_SCROLLBAR_ORIENT, Tk_Offset(Scrollbar, orientUid), 0}, - {TK_CONFIG_RELIEF, "-relief", "relief", "Relief", - DEF_SCROLLBAR_RELIEF, Tk_Offset(Scrollbar, relief), 0}, - {TK_CONFIG_INT, "-repeatdelay", "repeatDelay", "RepeatDelay", - DEF_SCROLLBAR_REPEAT_DELAY, Tk_Offset(Scrollbar, repeatDelay), 0}, - {TK_CONFIG_INT, "-repeatinterval", "repeatInterval", "RepeatInterval", - DEF_SCROLLBAR_REPEAT_INTERVAL, Tk_Offset(Scrollbar, repeatInterval), 0}, - {TK_CONFIG_STRING, "-takefocus", "takeFocus", "TakeFocus", - DEF_SCROLLBAR_TAKE_FOCUS, Tk_Offset(Scrollbar, takeFocus), - TK_CONFIG_NULL_OK}, - {TK_CONFIG_COLOR, "-troughcolor", "troughColor", "Background", - DEF_SCROLLBAR_TROUGH_COLOR, Tk_Offset(Scrollbar, troughColorPtr), - TK_CONFIG_COLOR_ONLY}, - {TK_CONFIG_COLOR, "-troughcolor", "troughColor", "Background", - DEF_SCROLLBAR_TROUGH_MONO, Tk_Offset(Scrollbar, troughColorPtr), - TK_CONFIG_MONO_ONLY}, - {TK_CONFIG_PIXELS, "-width", "width", "Width", - DEF_SCROLLBAR_WIDTH, Tk_Offset(Scrollbar, width), 0}, - {TK_CONFIG_END, (char *) NULL, (char *) NULL, (char *) NULL, - (char *) NULL, 0, 0} -}; - -/* - * Forward declarations for procedures defined later in this file: - */ - -static void ComputeScrollbarGeometry _ANSI_ARGS_(( - Scrollbar *scrollPtr)); -static int ConfigureScrollbar _ANSI_ARGS_((Tcl_Interp *interp, - Scrollbar *scrollPtr, int argc, char **argv, - int flags)); -static void DestroyScrollbar _ANSI_ARGS_((char *memPtr)); -static void DisplayScrollbar _ANSI_ARGS_((ClientData clientData)); -static void EventuallyRedraw _ANSI_ARGS_((Scrollbar *scrollPtr)); -static void ScrollbarCmdDeletedProc _ANSI_ARGS_(( - ClientData clientData)); -static void ScrollbarEventProc _ANSI_ARGS_((ClientData clientData, - XEvent *eventPtr)); -static int ScrollbarPosition _ANSI_ARGS_((Scrollbar *scrollPtr, - int x, int y)); -static int ScrollbarWidgetCmd _ANSI_ARGS_((ClientData clientData, - Tcl_Interp *, int argc, char **argv)); -static pascal void ScrollbarActionProc _ANSI_ARGS_((ControlRef theControl, - ControlPartCode partCode)); -static pascal void ThumbActionProc _ANSI_ARGS_((void)); - -/* - * Globals uses locally in this file. - */ -static ControlActionUPP scrollActionProc = NULL; /* Pointer to func. */ -static ThumbActionUPP thumbActionProc = NULL; /* Pointer to func. */ -static Scrollbar *activeScrollPtr = NULL; /* Non-null when in thumb */ - /* proc. */ - -/* - *-------------------------------------------------------------- - * - * Tk_MacScrollbarCmd -- - * - * This procedure is invoked to process the "scrollbar" Tcl - * command. See the user documentation for details on what - * it does. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * See the user documentation. - * - *-------------------------------------------------------------- - */ - -int -Tk_MacScrollbarCmd(clientData, interp, argc, argv) - ClientData clientData; /* Main window associated with - * interpreter. */ - Tcl_Interp *interp; /* Current interpreter. */ - int argc; /* Number of arguments. */ - char **argv; /* Argument strings. */ -{ - Tk_Window tkwin = (Tk_Window) clientData; - register Scrollbar *scrollPtr; - Tk_Window new; - - if (argc < 2) { - Tcl_AppendResult(interp, "wrong # args: should be \"", - argv[0], " pathName ?options?\"", (char *) NULL); - return TCL_ERROR; - } - - new = Tk_CreateWindowFromPath(interp, tkwin, argv[1], (char *) NULL); - if (new == NULL) { - return TCL_ERROR; - } - - /* - * Initialize fields that won't be initialized by ConfigureScrollbar, - * or which ConfigureScrollbar expects to have reasonable values - * (e.g. resource pointers). - */ - - scrollPtr = (Scrollbar *) ckalloc(sizeof(Scrollbar)); - scrollPtr->tkwin = new; - scrollPtr->display = Tk_Display(new); - scrollPtr->interp = interp; - scrollPtr->widgetCmd = Tcl_CreateCommand(interp, - Tk_PathName(scrollPtr->tkwin), ScrollbarWidgetCmd, - (ClientData) scrollPtr, ScrollbarCmdDeletedProc); - scrollPtr->orientUid = NULL; - scrollPtr->vertical = 0; - scrollPtr->width = 0; - scrollPtr->command = NULL; - scrollPtr->commandSize = 0; - scrollPtr->repeatDelay = 0; - scrollPtr->repeatInterval = 0; - scrollPtr->borderWidth = 0; - scrollPtr->bgBorder = NULL; - scrollPtr->activeBorder = NULL; - scrollPtr->troughColorPtr = NULL; - scrollPtr->troughGC = None; - scrollPtr->copyGC = None; - scrollPtr->relief = TK_RELIEF_FLAT; - scrollPtr->highlightWidth = 0; - scrollPtr->highlightBgColorPtr = NULL; - scrollPtr->highlightColorPtr = NULL; - scrollPtr->inset = 0; - scrollPtr->elementBorderWidth = -1; - scrollPtr->arrowLength = 0; - scrollPtr->sliderFirst = 0; - scrollPtr->sliderLast = 0; - scrollPtr->activeField = 0; - scrollPtr->activeRelief = TK_RELIEF_RAISED; - scrollPtr->totalUnits = 0; - scrollPtr->windowUnits = 0; - scrollPtr->firstUnit = 0; - scrollPtr->lastUnit = 0; - scrollPtr->firstFraction = 0.0; - scrollPtr->lastFraction = 0.0; - scrollPtr->cursor = None; - scrollPtr->takeFocus = NULL; - scrollPtr->autoRepeat = NULL; - scrollPtr->flags = 0; - - /* - * Mac specific inits. - */ - scrollPtr->sbHandle = NULL; - - Tk_SetClass(scrollPtr->tkwin, "MacScrollbar"); - Tk_CreateEventHandler(scrollPtr->tkwin, - ActivateMask|ExposureMask|StructureNotifyMask|FocusChangeMask|ButtonPressMask, - ScrollbarEventProc, (ClientData) scrollPtr); - if (ConfigureScrollbar(interp, scrollPtr, argc-2, argv+2, 0) != TCL_OK) { - goto error; - } - - interp->result = Tk_PathName(scrollPtr->tkwin); - return TCL_OK; - - error: - Tk_DestroyWindow(scrollPtr->tkwin); - return TCL_ERROR; -} - -/* - *-------------------------------------------------------------- - * - * ScrollbarWidgetCmd -- - * - * This procedure is invoked to process the Tcl command - * that corresponds to a widget managed by this module. - * See the user documentation for details on what it does. - * - * Results: - * A standard Tcl result. - * - * Side effects: - * See the user documentation. - * - *-------------------------------------------------------------- - */ - -static int -ScrollbarWidgetCmd(clientData, interp, argc, argv) - ClientData clientData; /* Information about scrollbar - * widget. */ - Tcl_Interp *interp; /* Current interpreter. */ - int argc; /* Number of arguments. */ - char **argv; /* Argument strings. */ -{ - register Scrollbar *scrollPtr = (Scrollbar *) clientData; - int result = TCL_OK; - size_t length; - int c; - - if (argc < 2) { - Tcl_AppendResult(interp, "wrong # args: should be \"", - argv[0], " option ?arg arg ...?\"", (char *) NULL); - return TCL_ERROR; - } - Tcl_Preserve((ClientData) scrollPtr); - c = argv[1][0]; - length = strlen(argv[1]); - if ((c == 'a') && (strncmp(argv[1], "activate", length) == 0)) { - if (argc == 2) { - switch (scrollPtr->activeField) { - case TOP_ARROW: interp->result = "arrow1"; break; - case SLIDER: interp->result = "slider"; break; - case BOTTOM_ARROW: interp->result = "arrow2"; break; - } - goto done; - } - if (argc != 3) { - Tcl_AppendResult(interp, "wrong # args: should be \"", - argv[0], " activate element\"", (char *) NULL); - goto error; - } - c = argv[2][0]; - length = strlen(argv[2]); - if ((c == 'a') && (strcmp(argv[2], "arrow1") == 0)) { - scrollPtr->activeField = TOP_ARROW; - } else if ((c == 'a') && (strcmp(argv[2], "arrow2") == 0)) { - scrollPtr->activeField = BOTTOM_ARROW; - } else if ((c == 's') && (strncmp(argv[2], "slider", length) == 0)) { - scrollPtr->activeField = SLIDER; - } else { - scrollPtr->activeField = OUTSIDE; - } - EventuallyRedraw(scrollPtr); - } else if ((c == 'c') && (strncmp(argv[1], "cget", length) == 0) - && (length >= 2)) { - if (argc != 3) { - Tcl_AppendResult(interp, "wrong # args: should be \"", - argv[0], " cget option\"", - (char *) NULL); - goto error; - } - result = Tk_ConfigureValue(interp, scrollPtr->tkwin, configSpecs, - (char *) scrollPtr, argv[2], 0); - } else if ((c == 'c') && (strncmp(argv[1], "configure", length) == 0) - && (length >= 2)) { - if (argc == 2) { - result = Tk_ConfigureInfo(interp, scrollPtr->tkwin, configSpecs, - (char *) scrollPtr, (char *) NULL, 0); - } else if (argc == 3) { - result = Tk_ConfigureInfo(interp, scrollPtr->tkwin, configSpecs, - (char *) scrollPtr, argv[2], 0); - } else { - result = ConfigureScrollbar(interp, scrollPtr, argc-2, argv+2, - TK_CONFIG_ARGV_ONLY); - } - } else if ((c == 'd') && (strncmp(argv[1], "delta", length) == 0)) { - int xDelta, yDelta, pixels, length; - double fraction; - - if (argc != 4) { - Tcl_AppendResult(interp, "wrong # args: should be \"", - argv[0], " delta xDelta yDelta\"", (char *) NULL); - goto error; - } - if ((Tcl_GetInt(interp, argv[2], &xDelta) != TCL_OK) - || (Tcl_GetInt(interp, argv[3], &yDelta) != TCL_OK)) { - goto error; - } - if (scrollPtr->vertical) { - pixels = yDelta; - length = Tk_Height(scrollPtr->tkwin) - 1 - - 2*(scrollPtr->arrowLength + scrollPtr->inset); - } else { - pixels = xDelta; - length = Tk_Width(scrollPtr->tkwin) - 1 - - 2*(scrollPtr->arrowLength + scrollPtr->inset); - } - if (length == 0) { - fraction = 0.0; - } else { - fraction = ((double) pixels / (double) length); - } - sprintf(interp->result, "%g", fraction); - } else if ((c == 'f') && (strncmp(argv[1], "fraction", length) == 0)) { - int x, y, pos, length; - double fraction; - - if (argc != 4) { - Tcl_AppendResult(interp, "wrong # args: should be \"", - argv[0], " fraction x y\"", (char *) NULL); - goto error; - } - if ((Tcl_GetInt(interp, argv[2], &x) != TCL_OK) - || (Tcl_GetInt(interp, argv[3], &y) != TCL_OK)) { - goto error; - } - if (scrollPtr->vertical) { - pos = y - (scrollPtr->arrowLength + scrollPtr->inset); - length = Tk_Height(scrollPtr->tkwin) - 1 - - 2*(scrollPtr->arrowLength + scrollPtr->inset); - } else { - pos = x - (scrollPtr->arrowLength + scrollPtr->inset); - length = Tk_Width(scrollPtr->tkwin) - 1 - - 2*(scrollPtr->arrowLength + scrollPtr->inset); - } - if (length == 0) { - fraction = 0.0; - } else { - fraction = ((double) pos / (double) length); - } - if (fraction < 0) { - fraction = 0; - } else if (fraction > 1.0) { - fraction = 1.0; - } - sprintf(interp->result, "%g", fraction); - } else if ((c == 'g') && (strncmp(argv[1], "get", length) == 0)) { - if (argc != 2) { - Tcl_AppendResult(interp, "wrong # args: should be \"", - argv[0], " get\"", (char *) NULL); - goto error; - } - if (scrollPtr->flags & NEW_STYLE_COMMANDS) { - char first[TCL_DOUBLE_SPACE], last[TCL_DOUBLE_SPACE]; - - Tcl_PrintDouble(interp, scrollPtr->firstFraction, first); - Tcl_PrintDouble(interp, scrollPtr->lastFraction, last); - Tcl_AppendResult(interp, first, " ", last, (char *) NULL); - } else { - sprintf(interp->result, "%d %d %d %d", scrollPtr->totalUnits, - scrollPtr->windowUnits, scrollPtr->firstUnit, - scrollPtr->lastUnit); - } - } else if ((c == 'i') && (strncmp(argv[1], "identify", length) == 0)) { - int x, y, thing; - - if (argc != 4) { - Tcl_AppendResult(interp, "wrong # args: should be \"", - argv[0], " identify x y\"", (char *) NULL); - goto error; - } - if ((Tcl_GetInt(interp, argv[2], &x) != TCL_OK) - || (Tcl_GetInt(interp, argv[3], &y) != TCL_OK)) { - goto error; - } - thing = ScrollbarPosition(scrollPtr, x,y); - switch (thing) { - case TOP_ARROW: interp->result = "arrow1"; break; - case TOP_GAP: interp->result = "trough1"; break; - case SLIDER: interp->result = "slider"; break; - case BOTTOM_GAP: interp->result = "trough2"; break; - case BOTTOM_ARROW: interp->result = "arrow2"; break; - } - } else if ((c == 's') && (strncmp(argv[1], "set", length) == 0)) { - int totalUnits, windowUnits, firstUnit, lastUnit; - - if (argc == 4) { - double first, last; - - if (Tcl_GetDouble(interp, argv[2], &first) != TCL_OK) { - goto error; - } - if (Tcl_GetDouble(interp, argv[3], &last) != TCL_OK) { - goto error; - } - if (first < 0) { - scrollPtr->firstFraction = 0; - } else if (first > 1.0) { - scrollPtr->firstFraction = 1.0; - } else { - scrollPtr->firstFraction = first; - } - if (last < scrollPtr->firstFraction) { - scrollPtr->lastFraction = scrollPtr->firstFraction; - } else if (last > 1.0) { - scrollPtr->lastFraction = 1.0; - } else { - scrollPtr->lastFraction = last; - } - scrollPtr->flags |= NEW_STYLE_COMMANDS; - } else if (argc == 6) { - if (Tcl_GetInt(interp, argv[2], &totalUnits) != TCL_OK) { - goto error; - } - if (totalUnits < 0) { - totalUnits = 0; - } - if (Tcl_GetInt(interp, argv[3], &windowUnits) != TCL_OK) { - goto error; - } - if (windowUnits < 0) { - windowUnits = 0; - } - if (Tcl_GetInt(interp, argv[4], &firstUnit) != TCL_OK) { - goto error; - } - if (Tcl_GetInt(interp, argv[5], &lastUnit) != TCL_OK) { - goto error; - } - if (totalUnits > 0) { - if (lastUnit < firstUnit) { - lastUnit = firstUnit; - } - } else { - firstUnit = lastUnit = 0; - } - scrollPtr->totalUnits = totalUnits; - scrollPtr->windowUnits = windowUnits; - scrollPtr->firstUnit = firstUnit; - scrollPtr->lastUnit = lastUnit; - if (scrollPtr->totalUnits == 0) { - scrollPtr->firstFraction = 0.0; - scrollPtr->lastFraction = 1.0; - } else { - scrollPtr->firstFraction = ((double) firstUnit)/totalUnits; - scrollPtr->lastFraction = ((double) (lastUnit+1))/totalUnits; - } - scrollPtr->flags &= ~NEW_STYLE_COMMANDS; - } else { - Tcl_AppendResult(interp, "wrong # args: should be \"", - argv[0], " set firstFraction lastFraction\" or \"", - argv[0], - " set totalUnits windowUnits firstUnit lastUnit\"", - (char *) NULL); - goto error; - } - ComputeScrollbarGeometry(scrollPtr); - EventuallyRedraw(scrollPtr); - } else { - Tcl_AppendResult(interp, "bad option \"", argv[1], - "\": must be activate, cget, configure, delta, fraction, ", - "get, identify, or set", (char *) NULL); - goto error; - } - done: - Tcl_Release((ClientData) scrollPtr); - return result; - - error: - Tcl_Release((ClientData) scrollPtr); - return TCL_ERROR; -} - -/* - *---------------------------------------------------------------------- - * - * DestroyScrollbar -- - * - * This procedure is invoked by Tcl_EventuallyFree or Tcl_Release - * to clean up the internal structure of a scrollbar at a safe time - * (when no-one is using it anymore). - * - * Results: - * None. - * - * Side effects: - * Everything associated with the scrollbar is freed up. - * - *---------------------------------------------------------------------- - */ - -static void -DestroyScrollbar(memPtr) - char *memPtr; /* Info about scrollbar widget. */ -{ - register Scrollbar *scrollPtr = (Scrollbar *) memPtr; - - /* - * Free up all the stuff that requires special handling, then - * let Tk_FreeOptions handle all the standard option-related - * stuff. - */ - - /* - * Free Macintosh control. - */ - if (scrollPtr->sbHandle != NULL) { - DisposeControl(scrollPtr->sbHandle); - scrollPtr->sbHandle = NULL; - } - - if (scrollPtr->troughGC != None) { - Tk_FreeGC(scrollPtr->display, scrollPtr->troughGC); - } - if (scrollPtr->copyGC != None) { - Tk_FreeGC(scrollPtr->display, scrollPtr->copyGC); - } - Tk_FreeOptions(configSpecs, (char *) scrollPtr, scrollPtr->display, 0); - ckfree((char *) scrollPtr); -} - -/* - *---------------------------------------------------------------------- - * - * ConfigureScrollbar -- - * - * This procedure is called to process an argv/argc list, plus - * the Tk option database, in order to configure (or - * reconfigure) a scrollbar widget. - * - * Results: - * The return value is a standard Tcl result. If TCL_ERROR is - * returned, then interp->result contains an error message. - * - * Side effects: - * Configuration information, such as colors, border width, - * etc. get set for scrollPtr; old resources get freed, - * if there were any. - * - *---------------------------------------------------------------------- - */ - -static int -ConfigureScrollbar(interp, scrollPtr, argc, argv, flags) - Tcl_Interp *interp; /* Used for error reporting. */ - register Scrollbar *scrollPtr; /* Information about widget; may or - * may not already have values for - * some fields. */ - int argc; /* Number of valid entries in argv. */ - char **argv; /* Arguments. */ - int flags; /* Flags to pass to - * Tk_ConfigureWidget. */ -{ - size_t length; - XGCValues gcValues; - GC new; - - if (Tk_ConfigureWidget(interp, scrollPtr->tkwin, configSpecs, - argc, argv, (char *) scrollPtr, flags) != TCL_OK) { - return TCL_ERROR; - } - - /* - * A few options need special processing, such as parsing the - * orientation or setting the background from a 3-D border. - */ - - length = strlen(scrollPtr->orientUid); - if (strncmp(scrollPtr->orientUid, "vertical", length) == 0) { - scrollPtr->vertical = 1; - } else if (strncmp(scrollPtr->orientUid, "horizontal", length) == 0) { - scrollPtr->vertical = 0; - } else { - Tcl_AppendResult(interp, "bad orientation \"", scrollPtr->orientUid, - "\": must be vertical or horizontal", (char *) NULL); - return TCL_ERROR; - } - - if (scrollPtr->command != NULL) { - scrollPtr->commandSize = strlen(scrollPtr->command); - } else { - scrollPtr->commandSize = 0; - } - - Tk_SetBackgroundFromBorder(scrollPtr->tkwin, scrollPtr->bgBorder); - - gcValues.foreground = scrollPtr->troughColorPtr->pixel; - new = Tk_GetGC(scrollPtr->tkwin, GCForeground, &gcValues); - if (scrollPtr->troughGC != None) { - Tk_FreeGC(scrollPtr->display, scrollPtr->troughGC); - } - scrollPtr->troughGC = new; - if (scrollPtr->copyGC == None) { - gcValues.graphics_exposures = False; - scrollPtr->copyGC = Tk_GetGC(scrollPtr->tkwin, GCGraphicsExposures, - &gcValues); - } - - /* - * Register the desired geometry for the window (leave enough space - * for the two arrows plus a minimum-size slider, plus border around - * the whole window, if any). Then arrange for the window to be - * redisplayed. - */ - - ComputeScrollbarGeometry(scrollPtr); - EventuallyRedraw(scrollPtr); - return TCL_OK; -} - -/* - *-------------------------------------------------------------- - * - * DisplayScrollbar -- - * - * This procedure redraws the contents of a scrollbar window. - * It is invoked as a do-when-idle handler, so it only runs - * when there's nothing else for the application to do. - * - * Results: - * None. - * - * Side effects: - * Information appears on the screen. - * - *-------------------------------------------------------------- - */ - -static void -DisplayScrollbar(clientData) - ClientData clientData; /* Information about window. */ -{ - register Scrollbar *scrollPtr = (Scrollbar *) clientData; - register Tk_Window tkwin = scrollPtr->tkwin; - - MacDrawable *macDraw; - CGrafPtr saveWorld; - GDHandle saveDevice; - GWorldPtr destPort; - double middle; - WindowRef windowRef; - int drawGrowRgn = false; - int flushRight = false; - int flushBottom = false; - - if ((scrollPtr->tkwin == NULL) || !Tk_IsMapped(tkwin)) { - goto done; - } - - /* - * Draw the focus or any 3D relief we may have. - */ - if (scrollPtr->highlightWidth != 0) { - GC gc; - - if (scrollPtr->flags & GOT_FOCUS) { - gc = Tk_GCForColor(scrollPtr->highlightColorPtr, - Tk_WindowId(tkwin)); - } else { - gc = Tk_GCForColor(scrollPtr->highlightBgColorPtr, - Tk_WindowId(tkwin)); - } - Tk_DrawFocusHighlight(tkwin, gc, scrollPtr->highlightWidth, - Tk_WindowId(tkwin)); - } - Tk_Draw3DRectangle(tkwin, Tk_WindowId(tkwin), scrollPtr->bgBorder, - scrollPtr->highlightWidth, scrollPtr->highlightWidth, - Tk_Width(tkwin) - 2*scrollPtr->highlightWidth, - Tk_Height(tkwin) - 2*scrollPtr->highlightWidth, - scrollPtr->borderWidth, scrollPtr->relief); - - /* - * Set up port for drawing Macintosh control. - */ - macDraw = (MacDrawable *) Tk_WindowId(tkwin); - destPort = TkMacGetDrawablePort(Tk_WindowId(tkwin)); - GetGWorld(&saveWorld, &saveDevice); - SetGWorld(destPort, NULL); - TkMacSetUpClippingRgn(Tk_WindowId(tkwin)); - - /* - * Given the Tk parameters for the fractions of the start and - * end of the thumb, the following calculation determines the - * location for the fixed sized Macintosh thumb. - */ - middle = scrollPtr->firstFraction / (scrollPtr->firstFraction + - (1.0 - scrollPtr->lastFraction)); - - if (scrollPtr->sbHandle == NULL) { - Rect r; - - r.left = r.top = 0; - r.right = r.bottom = 1; - scrollPtr->sbHandle = NewControl((WindowRef) destPort, &r, "\p", - false, (short) (middle * 1000), 0, 1000, - scrollBarProc, (SInt32) scrollPtr); - - /* - * If we are foremost than make us active. - */ - if ((WindowPtr) destPort == FrontWindow()) { - scrollPtr->flags |= ACTIVE; - } - } - windowRef = (**scrollPtr->sbHandle).contrlOwner; - - /* - * We can't use the Macintosh commands SizeControl and MoveControl as these - * calls will also cause a redraw which in our case will also cause - * flicker. To avoid this we adjust the control record directly. The - * Draw1Control command appears to just draw where ever the control says to - * draw so this seems right. - * - * NOTE: changing the control record directly may not work when - * Apple releases the Copland version of the MacOS in late 1996. - */ - - (**scrollPtr->sbHandle).contrlRect.left = macDraw->xOff + scrollPtr->inset; - (**scrollPtr->sbHandle).contrlRect.top = macDraw->yOff + scrollPtr->inset; - (**scrollPtr->sbHandle).contrlRect.right = macDraw->xOff + Tk_Width(tkwin) - - scrollPtr->inset; - (**scrollPtr->sbHandle).contrlRect.bottom = macDraw->yOff + - Tk_Height(tkwin) - scrollPtr->inset; - - /* - * Here is a lovely hack to draw the grow region of a window. - */ - /* TODO: use accessor function!!! */ - if (windowRef->portRect.top == (**scrollPtr->sbHandle).contrlRect.top) { - (**scrollPtr->sbHandle).contrlRect.top--; - } - - if (windowRef->portRect.left == (**scrollPtr->sbHandle).contrlRect.left) { - (**scrollPtr->sbHandle).contrlRect.left--; - } - - if (windowRef->portRect.right == (**scrollPtr->sbHandle).contrlRect.right) { - flushRight = true; - (**scrollPtr->sbHandle).contrlRect.right++; - } - - if (windowRef->portRect.bottom == (**scrollPtr->sbHandle).contrlRect.bottom) { - flushBottom = true; - (**scrollPtr->sbHandle).contrlRect.bottom++; - } - - if (flushBottom && flushRight) { - if (scrollPtr->vertical) { - (**scrollPtr->sbHandle).contrlRect.bottom -= 14; - } else { - (**scrollPtr->sbHandle).contrlRect.right -= 14; - } - drawGrowRgn = true; - TkMacSetScrollbarGrow((TkWindow *) tkwin, true); - } else { - TkMacSetScrollbarGrow((TkWindow *) tkwin, false); - } - - /* - * Set the thumb position in the scrollbar. - */ - (**scrollPtr->sbHandle).contrlValue = (short) (middle * 1000); - if ((**scrollPtr->sbHandle).contrlHilite == 0 || - (**scrollPtr->sbHandle).contrlHilite == 255) { - if (scrollPtr->firstFraction == 0.0 && - scrollPtr->lastFraction == 1.0) { - (**scrollPtr->sbHandle).contrlHilite = 255; - } else { - (**scrollPtr->sbHandle).contrlHilite = 0; - } - } - if ((**scrollPtr->sbHandle).contrlVis != 255) { - (**scrollPtr->sbHandle).contrlVis = 255; - } - - if (scrollPtr->flags & ACTIVE) { - Draw1Control(scrollPtr->sbHandle); - if (drawGrowRgn) { - DrawGrowIcon(windowRef); - } - } else { - (**scrollPtr->sbHandle).contrlHilite = 255; - Draw1Control(scrollPtr->sbHandle); - if (drawGrowRgn) { - DrawGrowIcon(windowRef); - Tk_Fill3DRectangle(tkwin, Tk_WindowId(tkwin), scrollPtr->bgBorder, - Tk_Width(tkwin) - 13, Tk_Height(tkwin) - 13, - Tk_Width(tkwin), Tk_Height(tkwin), - 0, TK_RELIEF_FLAT); - } - } - - SetGWorld(saveWorld, saveDevice); - - done: - scrollPtr->flags &= ~REDRAW_PENDING; -} - -/* - *-------------------------------------------------------------- - * - * ScrollbarEventProc -- - * - * This procedure is invoked by the Tk dispatcher for various - * events on scrollbars. - * - * Results: - * None. - * - * Side effects: - * When the window gets deleted, internal structures get - * cleaned up. When it gets exposed, it is redisplayed. - * - *-------------------------------------------------------------- - */ - -static void -ScrollbarEventProc(clientData, eventPtr) - ClientData clientData; /* Information about window. */ - XEvent *eventPtr; /* Information about event. */ -{ - Scrollbar *scrollPtr = (Scrollbar *) clientData; - Tcl_Interp *interp; - - if ((eventPtr->type == Expose) && (eventPtr->xexpose.count == 0)) { - EventuallyRedraw(scrollPtr); - } else if (eventPtr->type == DestroyNotify) { - if (scrollPtr->tkwin != NULL) { - scrollPtr->tkwin = NULL; - Tcl_DeleteCommand(scrollPtr->interp, - Tcl_GetCommandName(scrollPtr->interp, - scrollPtr->widgetCmd)); - } - if (scrollPtr->flags & REDRAW_PENDING) { - Tk_CancelIdleCall(DisplayScrollbar, (ClientData) scrollPtr); - } - Tcl_EventuallyFree((ClientData) scrollPtr, DestroyScrollbar); - } else if (eventPtr->type == ConfigureNotify) { - ComputeScrollbarGeometry(scrollPtr); - EventuallyRedraw(scrollPtr); - } else if (eventPtr->type == FocusIn) { - if (eventPtr->xfocus.detail != NotifyInferior) { - scrollPtr->flags |= GOT_FOCUS; - if (scrollPtr->highlightWidth > 0) { - EventuallyRedraw(scrollPtr); - } - } - } else if (eventPtr->type == FocusOut) { - if (eventPtr->xfocus.detail != NotifyInferior) { - scrollPtr->flags &= ~GOT_FOCUS; - if (scrollPtr->highlightWidth > 0) { - EventuallyRedraw(scrollPtr); - } - } - } else if (eventPtr->type == UnmapNotify) { - TkMacSetScrollbarGrow((TkWindow *) scrollPtr->tkwin, false); - } else if (eventPtr->type == ActivateNotify) { - scrollPtr->flags |= ACTIVE; - EventuallyRedraw(scrollPtr); - } else if (eventPtr->type == DeactivateNotify) { - scrollPtr->flags &= ~ACTIVE; - EventuallyRedraw(scrollPtr); - } else if (eventPtr->type == ButtonPress) { - Point where; - Rect bounds; - int part, x, y, dummy; - unsigned int state; - CGrafPtr saveWorld; - GDHandle saveDevice; - GWorldPtr destPort; - Window dummyWin; - - /* - * To call Macintosh control routines we must have the port - * set to the window containing the control. We will then test - * which part of the control was hit and act accordingly. - */ - destPort = TkMacGetDrawablePort(Tk_WindowId(scrollPtr->tkwin)); - GetGWorld(&saveWorld, &saveDevice); - SetGWorld(destPort, NULL); - TkMacSetUpClippingRgn(Tk_WindowId(scrollPtr->tkwin)); - - TkMacWinBounds((TkWindow *) scrollPtr->tkwin, &bounds); - where.h = eventPtr->xbutton.x + bounds.left; - where.v = eventPtr->xbutton.y + bounds.top; - part = TestControl(scrollPtr->sbHandle, where); - if (part == inThumb && scrollPtr->jump == false) { - /* - * Case 1: In thumb, no jump scrolling. Call track control - * with the thumb action proc which will do most of the work. - * Set the global activeScrollPtr to the current control - * so the callback may have access to it. - */ - if (thumbActionProc == NULL) { - thumbActionProc = NewThumbActionProc(ThumbActionProc); - } - activeScrollPtr = scrollPtr; - part = TrackControl(scrollPtr->sbHandle, where, - (ControlActionUPP) thumbActionProc); - activeScrollPtr = NULL; - } else if (part == inThumb) { - /* - * Case 2: in thumb with jump scrolling. Call TrackControl - * with a NULL action proc. Use the new value of the control - * to set update the control. - */ - part = TrackControl(scrollPtr->sbHandle, where, NULL); - if (part == inThumb) { - double newFirstFraction, thumbWidth; - Tcl_DString cmdString; - char vauleString[TCL_DOUBLE_SPACE]; - - /* - * The following calculation takes the new control - * value and maps it to what Tk needs for its variable - * thumb size representation. - */ - thumbWidth = scrollPtr->lastFraction - - scrollPtr->firstFraction; - newFirstFraction = (1.0 - thumbWidth) * - ((double) GetControlValue(scrollPtr->sbHandle) / 1000.0); - sprintf(vauleString, "%g", newFirstFraction); - - Tcl_DStringInit(&cmdString); - Tcl_DStringAppend(&cmdString, scrollPtr->command, - strlen(scrollPtr->command)); - Tcl_DStringAppendElement(&cmdString, "moveto"); - Tcl_DStringAppendElement(&cmdString, vauleString); - Tcl_DStringAppend(&cmdString, "; update idletasks", - strlen("; update idletasks")); - - interp = scrollPtr->interp; - Tcl_Preserve((ClientData) interp); - Tcl_GlobalEval(interp, cmdString.string); - Tcl_Release((ClientData) interp); - Tcl_DStringFree(&cmdString); - } - } else if (part != 0) { - /* - * Case 3: in any other part of the scrollbar. We call - * TrackControl with the scrollActionProc which will do - * most all the work. - */ - if (scrollActionProc == NULL) { - scrollActionProc = NewControlActionProc(ScrollbarActionProc); - } - TrackControl(scrollPtr->sbHandle, where, scrollActionProc); - HiliteControl(scrollPtr->sbHandle, 0); - } - - /* - * The TrackControl call will "eat" the ButtonUp event. We now - * generate a ButtonUp event so Tk will unset implicit grabs etc. - */ - GetMouse(&where); - XQueryPointer(NULL, None, &dummyWin, &dummyWin, &x, - &y, &dummy, &dummy, &state); - TkGenerateButtonEvent(x, y, state); - - SetGWorld(saveWorld, saveDevice); - } -} - -/* - *---------------------------------------------------------------------- - * - * ScrollbarCmdDeletedProc -- - * - * This procedure is invoked when a widget command is deleted. If - * the widget isn't already in the process of being destroyed, - * this command destroys it. - * - * Results: - * None. - * - * Side effects: - * The widget is destroyed. - * - *---------------------------------------------------------------------- - */ - -static void -ScrollbarCmdDeletedProc(clientData) - ClientData clientData; /* Pointer to widget record for widget. */ -{ - Scrollbar *scrollPtr = (Scrollbar *) clientData; - Tk_Window tkwin = scrollPtr->tkwin; - - /* - * This procedure could be invoked either because the window was - * destroyed and the command was then deleted (in which case tkwin - * is NULL) or because the command was deleted, and then this procedure - * destroys the widget. - */ - - if (tkwin != NULL) { - scrollPtr->tkwin = NULL; - Tk_DestroyWindow(tkwin); - } -} - -/* - *---------------------------------------------------------------------- - * - * ComputeScrollbarGeometry -- - * - * After changes in a scrollbar's size or configuration, this - * procedure recomputes various geometry information used in - * displaying the scrollbar. - * - * Results: - * None. - * - * Side effects: - * The scrollbar will be displayed differently. - * - *---------------------------------------------------------------------- - */ - -static void -ComputeScrollbarGeometry(scrollPtr) - register Scrollbar *scrollPtr; /* Scrollbar whose geometry may - * have changed. */ -{ - int width, fieldLength; - -/* TODO: this should be Mac specific */ - - if (scrollPtr->highlightWidth < 0) { - scrollPtr->highlightWidth = 0; - } - scrollPtr->inset = scrollPtr->highlightWidth + scrollPtr->borderWidth; - width = (scrollPtr->vertical) ? Tk_Width(scrollPtr->tkwin) - : Tk_Height(scrollPtr->tkwin); - scrollPtr->arrowLength = width - 2*scrollPtr->inset + 1; - fieldLength = (scrollPtr->vertical ? Tk_Height(scrollPtr->tkwin) - : Tk_Width(scrollPtr->tkwin)) - - 2*(scrollPtr->arrowLength + scrollPtr->inset); - if (fieldLength < 0) { - fieldLength = 0; - } - scrollPtr->sliderFirst = fieldLength*scrollPtr->firstFraction; - scrollPtr->sliderLast = fieldLength*scrollPtr->lastFraction; - - /* - * Adjust the slider so that some piece of it is always - * displayed in the scrollbar and so that it has at least - * a minimal width (so it can be grabbed with the mouse). - */ - - if (scrollPtr->sliderFirst > (fieldLength - 2*scrollPtr->borderWidth)) { - scrollPtr->sliderFirst = fieldLength - 2*scrollPtr->borderWidth; - } - if (scrollPtr->sliderFirst < 0) { - scrollPtr->sliderFirst = 0; - } - if (scrollPtr->sliderLast < (scrollPtr->sliderFirst - + MIN_SLIDER_LENGTH)) { - scrollPtr->sliderLast = scrollPtr->sliderFirst + MIN_SLIDER_LENGTH; - } - if (scrollPtr->sliderLast > fieldLength) { - scrollPtr->sliderLast = fieldLength; - } - scrollPtr->sliderFirst += scrollPtr->arrowLength + scrollPtr->inset; - scrollPtr->sliderLast += scrollPtr->arrowLength + scrollPtr->inset; - - /* - * Register the desired geometry for the window (leave enough space - * for the two arrows plus a minimum-size slider, plus border around - * the whole window, if any). Then arrange for the window to be - * redisplayed. - */ - - if (scrollPtr->vertical) { - Tk_GeometryRequest(scrollPtr->tkwin, - scrollPtr->width + 2*scrollPtr->inset, - 2*(scrollPtr->arrowLength + scrollPtr->borderWidth - + scrollPtr->inset)); - } else { - Tk_GeometryRequest(scrollPtr->tkwin, - 2*(scrollPtr->arrowLength + scrollPtr->borderWidth - + scrollPtr->inset), scrollPtr->width + 2*scrollPtr->inset); - } - Tk_SetInternalBorder(scrollPtr->tkwin, scrollPtr->inset); -} - -/* - *-------------------------------------------------------------- - * - * ScrollbarPosition -- - * - * Determine the scrollbar element corresponding to a - * given position. - * - * Results: - * One of TOP_ARROW, TOP_GAP, etc., indicating which element - * of the scrollbar covers the position given by (x, y). If - * (x,y) is outside the scrollbar entirely, then OUTSIDE is - * returned. - * - * Side effects: - * None. - * - *-------------------------------------------------------------- - */ - -static int -ScrollbarPosition(scrollPtr, x, y) - register Scrollbar *scrollPtr; /* Scrollbar widget record. */ - int x, y; /* Coordinates within scrollPtr's - * window. */ -{ - int length, width, tmp; - ControlPartCode part; - Point where; - Rect bounds; - - if (scrollPtr->vertical) { - length = Tk_Height(scrollPtr->tkwin); - width = Tk_Width(scrollPtr->tkwin); - } else { - tmp = x; - x = y; - y = tmp; - length = Tk_Width(scrollPtr->tkwin); - width = Tk_Height(scrollPtr->tkwin); - } - - if ((x < scrollPtr->inset) || (x >= (width - scrollPtr->inset)) - || (y < scrollPtr->inset) || (y >= (length - scrollPtr->inset))) { - return OUTSIDE; - } - - /* - * All of the calculations in this procedure mirror those in - * DisplayScrollbar. Be sure to keep the two consistent. - */ - - TkMacWinBounds((TkWindow *) scrollPtr->tkwin, &bounds); - where.h = x + bounds.left; - where.v = y + bounds.top; - part = TestControl(scrollPtr->sbHandle, where); - switch (part) { - case inUpButton: - return TOP_ARROW; - case inPageUp: - return TOP_GAP; - case inThumb: - return SLIDER; - case inPageDown: - return BOTTOM_GAP; - case inDownButton: - return BOTTOM_ARROW; - default: - return OUTSIDE; - } -} - -/* - *-------------------------------------------------------------- - * - * EventuallyRedraw -- - * - * Arrange for one or more of the fields of a scrollbar - * to be redrawn. - * - * Results: - * None. - * - * Side effects: - * None. - * - *-------------------------------------------------------------- - */ - -static void -EventuallyRedraw(scrollPtr) - register Scrollbar *scrollPtr; /* Information about widget. */ -{ - if ((scrollPtr->tkwin == NULL) || (!Tk_IsMapped(scrollPtr->tkwin))) { - return; - } - if ((scrollPtr->flags & REDRAW_PENDING) == 0) { - Tk_DoWhenIdle(DisplayScrollbar, (ClientData) scrollPtr); - scrollPtr->flags |= REDRAW_PENDING; - } -} - -/* - *-------------------------------------------------------------- - * - * ScrollbarActionProc -- - * - * Callback procedure used by the Macintosh toolbox call - * TrackControl. This call will update the display while - * the scrollbar is being manipulated by the user. - * - * Results: - * None. - * - * Side effects: - * May change the display. - * - *-------------------------------------------------------------- - */ - -static pascal void -ScrollbarActionProc(ControlRef theControl, ControlPartCode partCode) - /* ControlRef theControl; /* Handle to scrollbat control */ - /* ControlPartCode partCode; /* Part of scrollbar that was "hit" */ -{ - register Scrollbar *scrollPtr = (Scrollbar *) GetCRefCon(theControl); - Tcl_DString cmdString; - Tcl_Interp *interp; - - Tcl_DStringInit(&cmdString); - switch (partCode) { - case inPageUp: - case inPageDown: - case inDownButton: - case inUpButton: - if (partCode == inPageUp || partCode == inPageDown) { - Tcl_DStringAppendElement(&cmdString, "tkScrollByPages"); - } else { - Tcl_DStringAppendElement(&cmdString, "tkScrollByUnits"); - } - Tcl_DStringAppendElement(&cmdString, - Tk_PathName(scrollPtr->tkwin)); - Tcl_DStringAppendElement(&cmdString, "hv"); - if (partCode == inPageUp || partCode == inUpButton) { - Tcl_DStringAppendElement(&cmdString, "-1"); - } else { - Tcl_DStringAppendElement(&cmdString, "1"); - } - Tcl_DStringAppend(&cmdString, "; update idletasks", - strlen("; update idletasks")); - interp = scrollPtr->interp; - Tcl_Preserve((ClientData) interp); - Tcl_GlobalEval(interp, cmdString.string); - Tcl_Release((ClientData) interp); - break; - } - Tcl_DStringFree(&cmdString); -} - -/* - *-------------------------------------------------------------- - * - * ThumbActionProc -- - * - * Callback procedure used by the Macintosh toolbox call - * TrackControl. This call is used to track the thumb of - * the scrollbar. Unlike the ScrollbarActionProc function - * this function is called once and basically takes over - * tracking the scrollbar from the control. This is done - * to avoid conflicts with what the control plans to draw. - * - * Results: - * None. - * - * Side effects: - * May change the display. - * - *-------------------------------------------------------------- - */ - -static pascal void -ThumbActionProc() -{ - register Scrollbar *scrollPtr = activeScrollPtr; - Tcl_DString cmdString; - Rect nullRect = {0,0,0,0}; - int origValue, trackBarPin; - double thumbWidth, newFirstFraction, trackBarSize; - char vauleString[40]; - Point currentPoint = { 0, 0 }; - Point lastPoint = { 0, 0 }; - Rect trackRect; - Tcl_Interp *interp; - - if (scrollPtr == NULL) { - return; - } - - Tcl_DStringInit(&cmdString); - - /* - * First compute values that will remain constant during the tracking - * of the thumb. The variable trackBarSize is the length of the scrollbar - * minus the 2 arrows and half the width of the thumb on both sides - * (3 * arrowLength). The variable trackBarPin is the lower starting point - * of the drag region. - * - * Note: the arrowLength is equal to the thumb width of a Mac scrollbar. - */ - origValue = GetControlValue(scrollPtr->sbHandle); - trackRect = (**scrollPtr->sbHandle).contrlRect; - if (scrollPtr->vertical == true) { - trackBarSize = (double) (trackRect.bottom - trackRect.top - - (scrollPtr->arrowLength * 3)); - trackBarPin = trackRect.top + scrollPtr->arrowLength - + (scrollPtr->arrowLength / 2); - InsetRect(&trackRect, -25, -113); - - } else { - trackBarSize = (double) (trackRect.right - trackRect.left - - (scrollPtr->arrowLength * 3)); - trackBarPin = trackRect.left + scrollPtr->arrowLength - + (scrollPtr->arrowLength / 2); - InsetRect(&trackRect, -113, -25); - } - - /* - * Track the mouse while the button is held down. If the mouse is moved, - * we calculate the value that should be passed to the "command" part of - * the scrollbar. - */ - while (StillDown()) { - GetMouse(¤tPoint); - if (EqualPt(currentPoint, lastPoint)) { - continue; - } - lastPoint = currentPoint; - - /* - * Calculating this value is a little tricky. We need to calculate a - * value for where the thumb would be in a Motif widget (variable - * thumb). This value is what the "command" expects and is what will - * be resent to the scrollbar to update its value. - */ - thumbWidth = scrollPtr->lastFraction - scrollPtr->firstFraction; - if (PtInRect(currentPoint, &trackRect)) { - if (scrollPtr->vertical == true) { - newFirstFraction = (1.0 - thumbWidth) * - ((double) (currentPoint.v - trackBarPin) / trackBarSize); - } else { - newFirstFraction = (1.0 - thumbWidth) * - ((double) (currentPoint.h - trackBarPin) / trackBarSize); - } - } else { - newFirstFraction = ((double) origValue / 1000.0) - * (1.0 - thumbWidth); - } - - sprintf(vauleString, "%g", newFirstFraction); - - Tcl_DStringSetLength(&cmdString, 0); - Tcl_DStringAppend(&cmdString, scrollPtr->command, - strlen(scrollPtr->command)); - Tcl_DStringAppendElement(&cmdString, "moveto"); - Tcl_DStringAppendElement(&cmdString, vauleString); - Tcl_DStringAppend(&cmdString, "; update idletasks", - strlen("; update idletasks")); - - interp = scrollPtr->interp; - Tcl_Preserve((ClientData) interp); - Tcl_GlobalEval(interp, cmdString.string); - Tcl_Release((ClientData) interp); - } - - /* - * This next bit of code is a bit of a hack - but needed. The problem is - * that the control wants to draw the drag outline if the control value - * changes during the drag (which it does). What we do here is change the - * clip region to hide this drawing from the user. - */ - ClipRect(&nullRect); - - Tcl_DStringFree(&cmdString); - return; -} diff --git a/tk/mac/tkMacShLib.exp b/tk/mac/tkMacShLib.exp deleted file mode 100644 index e6b4aa5b248..00000000000 --- a/tk/mac/tkMacShLib.exp +++ /dev/null @@ -1,764 +0,0 @@ -MacMoveWindow -TkAboutDlg -TkActivateMenuEntry -TkAllocWindow -TkBTreeCharTagged -TkBTreeCharsInLine -TkBTreeCheck -TkBTreeCreate -TkBTreeDeleteChars -TkBTreeDestroy -TkBTreeFindLine -TkBTreeGetTags -TkBTreeInsertChars -TkBTreeLineIndex -TkBTreeLinkSegment -TkBTreeNextLine -TkBTreeNextTag -TkBTreeNumLines -TkBTreePrevTag -TkBTreePreviousLine -TkBTreeStartSearch -TkBTreeStartSearchBack -TkBTreeTag -TkBTreeUnlinkSegment -TkBezierPoints -TkBezierScreenPoints -TkBindDeadWindow -TkBindEventProc -TkBindFree -TkBindInit -TkButtonWorldChanged -TkCanvPostscriptCmd -TkChangeEventWindow -TkClipBox -TkClipInit -TkComputeAnchor -TkConsoleCreate -TkConsoleInit -TkConsolePrint -TkCopyAndGlobalEval -TkCreateBindingProcedure -TkCreateCursorFromData -TkCreateFrame -TkCreateMainWindow -TkCreateMenuReferences -TkCreateNamedFont -TkCreateRegion -TkCurrentTime -TkDeadAppCmd -TkDeleteAllImages -TkDestroyMenu -TkDestroyRegion -TkDoConfigureNotify -TkEventDeadWindow -TkEventuallyRecomputeMenu -TkEventuallyRedrawMenu -TkEventuallyRedrawScale -TkFillPolygon -TkFindMenuReferences -TkFindStateNum -TkFindStateString -TkFocusDeadWindow -TkFocusFilterEvent -TkFocusKeyEvent -TkFontPkgFree -TkFontPkgInit -TkFreeBindingTags -TkFreeCursor -TkFreeFileFilters -TkFreeMenuReferences -TkGenWMConfigureEvent -TkGenWMDestroyEvent -TkGenerateActivateEvents -TkGenerateButtonEvent -TkGetBitmapData -TkGetButtPoints -TkGetCursorByName -TkGetDefaultScreenName -TkGetDisplay -TkGetDisplayOf -TkGetFileFilters -TkGetInterpNames -TkGetMenuHashTable -TkGetMenuIndex -TkGetMiterPoints -TkGetPointerCoords -TkGetServerInfo -TkGetTransientMaster -TkGrabDeadWindow -TkGrabState -TkInOutEvents -TkIncludePoint -TkInitFileFilters -TkInitFontAttributes -TkIntersectRegion -TkInvokeButton -TkInvokeMenu -TkKeysymToString -TkLineToArea -TkLineToPoint -TkMacButtonKeyState -TkMacClearMenubarActive -TkMacConvertEvent -TkMacConvertTkEvent -TkMacDispatchMenuEvent -TkMacDoHLEvent -TkMacGenerateTime -TkMacGetDrawablePort -TkMacGetScrollbarGrowWindow -TkMacGetXWindow -TkMacGrowToplevel -TkMacHandleMenuSelect -TkMacHandleTearoffMenu -TkMacInitAppleEvents -TkMacInitMenus -TkMacInstallCursor -TkMacInvalClipRgns -TkMacInvalidateWindow -TkMacIsCharacterMissing -TkMacMakeRealWindowExist -TkMacMakeStippleMap -TkMacMenuClick -TkMacRegisterOffScreenWindow -TkMacResizable -TkMacSetEmbedRgn -TkMacSetHelpMenuItemCount -TkMacSetScrollbarGrow -TkMacSetUpClippingRgn -TkMacSetUpGraphicsPort -TkMacUnregisterMacWindow -TkMacUpdateClipRgn -TkMacUseMenuID -TkMacVisableClipRgn -TkMacWinBounds -TkMacWindowOffset -TkMacXAddPixel -TkMacXDestroyImage -TkMacXGetPixel -TkMacXPutPixel -TkMacXSubImage -TkMacZoomToplevel -TkMakeBezierCurve -TkMakeBezierPostscript -TkMakeMenuWindow -TkMenuButtonWorldChanged -TkMenuConfigureDrawOptions -TkMenuConfigureEntryDrawOptions -TkMenuEntryFreeDrawOptions -TkMenuEventProc -TkMenuFreeDrawOptions -TkMenuImageProc -TkMenuInit -TkMenuInitializeDrawingFields -TkMenuInitializeEntryDrawingFields -TkMenuSelectImageProc -TkNewMenuName -TkOptionClassChanged -TkOptionDeadWindow -TkOvalToArea -TkOvalToPoint -TkParseXLFD -TkPointerDeadWindow -TkPointerEvent -TkPolygonToArea -TkPolygonToPoint -TkPositionInTree -TkPostCommand -TkPostSubmenu -TkPostTearoffMenu -TkPreprocessMenu -TkPutImage -TkQueueEventForAllChildren -TkRecomputeMenu -TkRectInRegion -TkRoundToResolution -TkScrollWindow -TkScrollbarEventProc -TkScrollbarEventuallyRedraw -TkSelClearSelection -TkSelDeadWindow -TkSelDefaultSelection -TkSelEventProc -TkSelGetSelection -TkSelInit -TkSelPropProc -TkSelUpdateClipboard -TkSetClassProcs -TkSetMacColor -TkSetRegion -TkSetWMName -TkSetWindowMenuBar -TkStringToKeysym -TkSuspendClipboard -TkTextBindProc -TkTextChanged -TkTextCharBbox -TkTextCharLayoutProc -TkTextCreateDInfo -TkTextCreateTag -TkTextDLineInfo -TkTextEventuallyRepick -TkTextFreeDInfo -TkTextFreeTag -TkTextGetIndex -TkTextGetTabs -TkTextImageCmd -TkTextImageIndex -TkTextIndexBackChars -TkTextIndexCmp -TkTextIndexForwChars -TkTextIndexToSeg -TkTextInsertDisplayProc -TkTextLostSelection -TkTextMakeIndex -TkTextMarkCmd -TkTextMarkNameToIndex -TkTextMarkSegToIndex -TkTextPickCurrent -TkTextPixelIndex -TkTextPrintIndex -TkTextRedrawRegion -TkTextRedrawTag -TkTextRelayoutWindow -TkTextScanCmd -TkTextSeeCmd -TkTextSegToOffset -TkTextSetMark -TkTextSetYView -TkTextTagCmd -TkTextWindowCmd -TkTextWindowIndex -TkTextXviewCmd -TkTextYviewCmd -TkThickPolyLineToArea -TkUnionRectWithRegion -TkUnsupported1Cmd -TkWmAddToColormapWindows -TkWmDeadWindow -TkWmFocusToplevel -TkWmMapWindow -TkWmNewWindow -TkWmProtocolEventProc -TkWmRemoveFromColormapWindows -TkWmRestackToplevel -TkWmSetClass -TkWmUnmapWindow -Tk_3DBorderColor -Tk_3DBorderGC -Tk_3DHorizontalBevel -Tk_3DVerticalBevel -Tk_AddOption -Tk_BellCmd -Tk_BindCmd -Tk_BindEvent -Tk_BindtagsCmd -Tk_ButtonCmd -Tk_CanvasCmd -Tk_CanvasDrawableCoords -Tk_CanvasEventuallyRedraw -Tk_CanvasGetCoord -Tk_CanvasGetTextInfo -Tk_CanvasPsBitmap -Tk_CanvasPsColor -Tk_CanvasPsFont -Tk_CanvasPsPath -Tk_CanvasPsStipple -Tk_CanvasPsY -Tk_CanvasSetStippleOrigin -Tk_CanvasTagsParseProc -Tk_CanvasTagsPrintProc -Tk_CanvasTkwin -Tk_CanvasWindowCoords -Tk_ChangeWindowAttributes -Tk_CharBbox -Tk_CheckbuttonCmd -Tk_ChooseColorCmd -Tk_ClearSelection -Tk_ClipboardAppend -Tk_ClipboardClear -Tk_ClipboardCmd -Tk_ComputeTextLayout -Tk_ConfigureInfo -Tk_ConfigureValue -Tk_ConfigureWidget -Tk_ConfigureWindow -Tk_CoordsToWindow -Tk_CreateBinding -Tk_CreateBindingTable -Tk_CreateErrorHandler -Tk_CreateEventHandler -Tk_CreateGenericHandler -Tk_CreateImageType -Tk_CreateItemType -Tk_CreatePhotoImageFormat -Tk_CreateSelHandler -Tk_CreateWindow -Tk_CreateWindowFromPath -Tk_DefineBitmap -Tk_DefineCursor -Tk_DeleteAllBindings -Tk_DeleteBinding -Tk_DeleteBindingTable -Tk_DeleteErrorHandler -Tk_DeleteEventHandler -Tk_DeleteGenericHandler -Tk_DeleteImage -Tk_DeleteSelHandler -Tk_DestroyCmd -Tk_DestroyWindow -Tk_DisplayName -Tk_DistanceToTextLayout -Tk_Draw3DPolygon -Tk_Draw3DRectangle -Tk_DrawChars -Tk_DrawFocusHighlight -Tk_DrawTextLayout -Tk_EntryCmd -Tk_EventCmd -Tk_Fill3DPolygon -Tk_Fill3DRectangle -Tk_FindPhoto -Tk_FocusCmd -Tk_FontId -Tk_FontObjCmd -Tk_FrameCmd -Tk_Free3DBorder -Tk_FreeBitmap -Tk_FreeColor -Tk_FreeColormap -Tk_FreeCursor -Tk_FreeFont -Tk_FreeGC -Tk_FreeImage -Tk_FreeOptions -Tk_FreePixmap -Tk_FreeTextLayout -Tk_GCForColor -Tk_GeometryRequest -Tk_Get3DBorder -Tk_GetAllBindings -Tk_GetAnchor -Tk_GetAtomName -Tk_GetBinding -Tk_GetBitmap -Tk_GetBitmapFromData -Tk_GetCapStyle -Tk_GetColor -Tk_GetColorByValue -Tk_GetColormap -Tk_GetCursor -Tk_GetCursorFromData -Tk_GetFont -Tk_GetFontFromObj -Tk_GetFontMetrics -Tk_GetGC -Tk_GetImage -Tk_GetItemTypes -Tk_GetJoinStyle -Tk_GetJustify -Tk_GetNumMainWindows -Tk_GetOpenFileCmd -Tk_GetOption -Tk_GetPixels -Tk_GetPixmap -Tk_GetRelief -Tk_GetRootCoords -Tk_GetSaveFileCmd -Tk_GetScreenMM -Tk_GetScrollInfo -Tk_GetSelection -Tk_GetUid -Tk_GetVRootGeometry -Tk_GetVisual -Tk_Grab -Tk_GrabCmd -Tk_GridCmd -Tk_HandleEvent -Tk_IdToWindow -Tk_ImageChanged -Tk_ImageCmd -Tk_Init -Tk_InternAtom -Tk_IntersectTextLayout -Tk_LabelCmd -Tk_ListboxCmd -Tk_LowerCmd -Tk_Main -Tk_MainLoop -Tk_MainWindow -Tk_MaintainGeometry -Tk_MakeWindowExist -Tk_ManageGeometry -Tk_MapWindow -Tk_MeasureChars -Tk_MenuCmd -Tk_MenubuttonCmd -Tk_MessageBoxCmd -Tk_MessageCmd -Tk_MoveResizeWindow -Tk_MoveToplevelWindow -Tk_MoveWindow -Tk_NameOf3DBorder -Tk_NameOfAnchor -Tk_NameOfBitmap -Tk_NameOfCapStyle -Tk_NameOfColor -Tk_NameOfCursor -Tk_NameOfFont -Tk_NameOfImage -Tk_NameOfJoinStyle -Tk_NameOfJustify -Tk_NameOfRelief -Tk_NameToWindow -Tk_OptionCmd -Tk_OwnSelection -Tk_PackCmd -Tk_ParseArgv -Tk_PhotoBlank -Tk_PhotoExpand -Tk_PhotoGetImage -Tk_PhotoGetSize -Tk_PhotoPutBlock -Tk_PhotoPutZoomedBlock -Tk_PhotoSetSize -Tk_PlaceCmd -Tk_PointToChar -Tk_PostscriptFontName -Tk_PreserveColormap -Tk_QueueWindowEvent -Tk_RadiobuttonCmd -Tk_RaiseCmd -Tk_RedrawImage -Tk_ResizeWindow -Tk_RestackWindow -Tk_RestrictEvents -Tk_SafeInit -Tk_ScaleCmd -Tk_ScrollbarCmd -Tk_SelectionCmd -Tk_SendCmd -Tk_SetAppName -Tk_SetBackgroundFromBorder -Tk_SetClass -Tk_SetGrid -Tk_SetInternalBorder -Tk_SetWindowBackground -Tk_SetWindowBackgroundPixmap -Tk_SetWindowBorder -Tk_SetWindowBorderPixmap -Tk_SetWindowBorderWidth -Tk_SetWindowColormap -Tk_SetWindowVisual -Tk_SizeOfBitmap -Tk_SizeOfImage -Tk_StrictMotif -Tk_TextCmd -Tk_TextLayoutToPostscript -Tk_TextWidth -Tk_TkObjCmd -Tk_TkwaitCmd -Tk_TopCoordsToWindow -Tk_ToplevelCmd -Tk_UndefineCursor -Tk_UnderlineChars -Tk_UnderlineTextLayout -Tk_Ungrab -Tk_UnmaintainGeometry -Tk_UnmapWindow -Tk_UnsetGrid -Tk_UpdateCmd -Tk_UpdatePointer -Tk_WinfoObjCmd -Tk_WmCmd -TkpChangeFocus -TkpClaimFocus -TkpCloseDisplay -TkpComputeButtonGeometry -TkpComputeMenuButtonGeometry -TkpComputeMenubarGeometry -TkpComputeScrollbarGeometry -TkpComputeStandardMenuGeometry -TkpConfigureMenuEntry -TkpConfigureScrollbar -TkpCreateButton -TkpCreateMenuButton -TkpCreateNativeBitmap -TkpCreateScale -TkpCreateScrollbar -TkpDefineNativeBitmaps -TkpDeleteFont -TkpDestroyButton -TkpDestroyMenu -TkpDestroyMenuButton -TkpDestroyMenuEntry -TkpDestroyScale -TkpDestroyScrollbar -TkpDisplayButton -TkpDisplayMenuButton -TkpDisplayScale -TkpDisplayScrollbar -TkpDisplayWarning -TkpDrawMenuEntry -TkpFindWindow -TkpFreeBorder -TkpGetAppName -TkpGetBorder -TkpGetColor -TkpGetColorByValue -TkpGetFontFamilies -TkpGetFontFromAttributes -TkpGetMS -TkpGetNativeAppBitmap -TkpGetNativeFont -TkpGetOtherWindow -TkpGetShadows -TkpInit -TkpInitializeMenuBindings -TkpMakeContainer -TkpMakeWindow -TkpMenuInit -TkpMenuNewEntry -TkpNewMenu -TkpOpenDisplay -TkpPixelToValue -TkpPostMenu -TkpRedirectKeyEvent -TkpScaleElement -TkpScrollbarPosition -TkpSetCapture -TkpSetCursor -TkpSetMainMenubar -TkpSetScaleValue -TkpSetWindowMenuBar -TkpTestembedCmd -TkpUseWindow -TkpValueToPixel -TkpWindowWasRecentlyDeleted -XAllocColor -XAllocSizeHints -XBell -XChangeGC -XChangeProperty -XChangeWindowAttributes -XConfigureWindow -XCopyArea -XCopyPlane -TkCreateBitmapFromData -XCreateColormap -XCreateGC -XCreateImage -XDefineCursor -XDestroyWindow -XDrawArc -XDrawLine -XDrawLines -XDrawRectangle -XFillArc -XFillPolygon -XFillRectangle -XFillRectangles -XForceScreenSaver -XFreeColormap -XFreeColors -XFreeGC -XFreeModifiermap -XGContextFromGC -XGetAtomName -XGetGeometry -XGetImage -XGetModifierMapping -XGetVisualInfo -XGetWindowProperty -XGrabKeyboard -XGrabPointer -XInternAtom -XKeycodeToKeysym -XKeysymToKeycode -XKeysymToString -XLookupString -XMapWindow -XMoveResizeWindow -XMoveWindow -XParseColor -XQueryPointer -XRaiseWindow -TkReadBitmapFile -XRefreshKeyboardMapping -XResizeWindow -XRootWindow -XSelectInput -XSendEvent -XSetArcMode -XSetBackground -XSetClipMask -XSetClipOrigin -XSetErrorHandler -XSetFillRule -XSetFillStyle -XSetFont -XSetForeground -XSetFunction -XSetIconName -XSetInputFocus -XSetLineAttributes -XSetSelectionOwner -XSetStipple -XSetTSOrigin -XSetWMNormalHints -XSetWindowBackground -XSetWindowBackgroundPixmap -XSetWindowBorder -XSetWindowBorderPixmap -XSetWindowBorderWidth -XSetWindowColormap -XStringToKeysym -XUngrabKeyboard -XUngrabPointer -XUnmapWindow -_Aldata -_Assert -_Atcount -_Atfuns -_Clocale -_Closreg -_Costate -_Daysto -_Dbl -_Defloc -_Environ -_Environ1 -_Fgpos -_Files -_Flt -_Fopen -_Foprep -_Fread -_Freeloc -_Frprep -_Fspos -_Fwprep -_Fwrite -_Genld -_Gentime -_Getdst -_Getfld -_Getfloat -_Getint -_Getloc -_Getmem -_Getstr -_Gettime -_Getzone -_Isdst -_Ldbl -_Ldtob -_Litob -_Locale -_Locsum -_Loctab -_Locterm -_Locvar -_MWERKS_Atcount -_MWERKS_Atfuns -_Makeloc -_Makestab -_Makewct -_Mbcurmax -_Mbstate -_Mbtowc -_Nnl -_PJP_C_Copyright -_Printf -_Putfld -_Putstr -_Puttxt -_Randseed -_Readloc -_Scanf -_Setloc -_Skip -_Stdin -_Stdout -_Stod -_Stof -_Stoflt -_Stold -_Strerror -_Strftime -_Strxfrm -_Times -_Tolower -_Toupper -_Ttotm -_WCostate -_Wcstate -_Wctob -_Wctomb -_Wctrans -_Wctype -_XInitImageFuncPtrs -__CheckForSystem7 -__RemoveConsoleHandler__ -__aborting -__ctopstring -__getcreator -__gettype -__myraise -__system7present -_atexit -_exit -_fcreator -_ftype -pendingPtr -tclFocusDebug -tcl_macQdPtr -tkActiveUid -tkAppleMenu -tkArcType -tkBTreeDebug -tkBitmapImageType -tkBitmapType -tkDisabledUid -tkDisplayList -tkEditMenu -tkFileMenu -tkImageType -tkImgFmtGIF -tkImgFmtPPM -tkLineType -tkMacAppInFront -tkMacFocusWin -tkMainWindowList -tkMenuConfigSpecs -tkMenuEntryConfigSpecs -tkNormalUid -tkOvalType -tkPhotoImageType -tkPolygonType -tkPredefBitmapTable -tkRectangleType -tkSendSerial -tkTextCharType -tkTextCharUid -tkTextDebug -tkTextDisabledUid -tkTextLeftMarkType -tkTextNoneUid -tkTextNormalUid -tkTextRightMarkType -tkTextToggleOffType -tkTextToggleOnType -tkTextType -tkTextWordUid -tkWindowType -tkpButtonConfigSpecs -tkpButtonProcs -tkpMenubuttonClass -tkpScrollbarConfigSpecs -tkpScrollbarProcs -#TclMacInitializeFragment -#TclMacTerminateFragment -#__initialize -#__ptmf_null -#__terminate diff --git a/tk/tests/defs.tcl b/tk/tests/defs.tcl deleted file mode 100644 index a2e55cdbb6a..00000000000 --- a/tk/tests/defs.tcl +++ /dev/null @@ -1,1097 +0,0 @@ -# defs.tcl -- -# -# This file contains support code for the Tcl/Tk test suite.It is -# It is normally sourced by the individual files in the test suite -# before they run their tests. This improved approach to testing -# was designed and initially implemented by Mary Ann May-Pumphrey -# of Sun Microsystems. -# -# Copyright (c) 1990-1994 The Regents of the University of California. -# Copyright (c) 1994-1996 Sun Microsystems, Inc. -# Copyright (c) 1998-1999 by Scriptics Corporation. -# All rights reserved. -# -# RCS: @(#) $Id$ - -# Initialize wish shell - -if {[info exists tk_version]} { - tk appname tktest - wm title . tktest -} else { - - # Ensure that we have a minimal auto_path so we don't pick up extra junk. - - set auto_path [list [info library]] -} - -# create the "tcltest" namespace for all testing variables and procedures - -namespace eval tcltest { - set procList [list test cleanupTests dotests saveState restoreState \ - normalizeMsg makeFile removeFile makeDirectory removeDirectory \ - viewFile bytestring set_iso8859_1_locale restore_locale \ - safeFetch threadReap] - if {[info exists tk_version]} { - lappend procList setupbg dobg bgReady cleanupbg fixfocus - } - foreach proc $procList { - namespace export $proc - } - - # setup ::tcltest default vars - foreach {var default} {verbose b match {} skip {}} { - if {![info exists $var]} { - variable $var $default - } - } - - # Tests should not rely on the current working directory. - # Files that are part of the test suite should be accessed relative to - # ::tcltest::testsDir. - - set originalDir [pwd] - set tDir [file join $originalDir [file dirname [info script]]] - cd $tDir - variable testsDir [pwd] - cd $originalDir - - # Count the number of files tested (0 if all.tcl wasn't called). - # The all.tcl file will set testSingleFile to false, so stats will - # not be printed until all.tcl calls the cleanupTests proc. - # The currentFailure var stores the boolean value of whether the - # current test file has had any failures. The failFiles list - # stores the names of test files that had failures. - - variable numTestFiles 0 - variable testSingleFile true - variable currentFailure false - variable failFiles {} - - # Tests should remove all files they create. The test suite will - # check the current working dir for files created by the tests. - # ::tcltest::filesMade keeps track of such files created using the - # ::tcltest::makeFile and ::tcltest::makeDirectory procedures. - # ::tcltest::filesExisted stores the names of pre-existing files. - - variable filesMade {} - variable filesExisted {} - - # ::tcltest::numTests will store test files as indices and the list - # of files (that should not have been) left behind by the test files. - - array set ::tcltest::createdNewFiles {} - - # initialize ::tcltest::numTests array to keep track fo the number of - # tests that pass, fial, and are skipped. - - array set numTests [list Total 0 Passed 0 Skipped 0 Failed 0] - - # initialize ::tcltest::skippedBecause array to keep track of - # constraints that kept tests from running - - array set ::tcltest::skippedBecause {} - - # tests that use thread need to know which is the main thread - - variable ::tcltest::mainThread 1 - if {[info commands testthread] != {}} { - puts "Tk with threads enabled is known to have problems with X" - set ::tcltest::mainThread [testthread names] - } -} - -# If there is no "memory" command (because memory debugging isn't -# enabled), generate a dummy command that does nothing. - -if {[info commands memory] == ""} { - proc memory args {} -} - -# ::tcltest::initConfig -- -# -# Check configuration information that will determine which tests -# to run. To do this, create an array ::tcltest::testConfig. Each -# element has a 0 or 1 value. If the element is "true" then tests -# with that constraint will be run, otherwise tests with that constraint -# will be skipped. See the README file for the list of built-in -# constraints defined in this procedure. -# -# Arguments: -# none -# -# Results: -# The ::tcltest::testConfig array is reset to have an index for -# each built-in test constraint. - -proc ::tcltest::initConfig {} { - - global tcl_platform tcl_interactive tk_version - - catch {unset ::tcltest::testConfig} - - # The following trace procedure makes it so that we can safely refer to - # non-existent members of the ::tcltest::testConfig array without causing an - # error. Instead, reading a non-existent member will return 0. This is - # necessary because tests are allowed to use constraint "X" without ensuring - # that ::tcltest::testConfig("X") is defined. - - trace variable ::tcltest::testConfig r ::tcltest::safeFetch - - proc ::tcltest::safeFetch {n1 n2 op} { - if {($n2 != {}) && ([info exists ::tcltest::testConfig($n2)] == 0)} { - set ::tcltest::testConfig($n2) 0 - } - } - - set ::tcltest::testConfig(unixOnly) \ - [expr {$tcl_platform(platform) == "unix"}] - set ::tcltest::testConfig(macOnly) \ - [expr {$tcl_platform(platform) == "macintosh"}] - set ::tcltest::testConfig(pcOnly) \ - [expr {$tcl_platform(platform) == "windows"}] - - set ::tcltest::testConfig(unix) $::tcltest::testConfig(unixOnly) - set ::tcltest::testConfig(mac) $::tcltest::testConfig(macOnly) - set ::tcltest::testConfig(pc) $::tcltest::testConfig(pcOnly) - - set ::tcltest::testConfig(unixOrPc) \ - [expr {$::tcltest::testConfig(unix) || $::tcltest::testConfig(pc)}] - set ::tcltest::testConfig(macOrPc) \ - [expr {$::tcltest::testConfig(mac) || $::tcltest::testConfig(pc)}] - set ::tcltest::testConfig(macOrUnix) \ - [expr {$::tcltest::testConfig(mac) || $::tcltest::testConfig(unix)}] - - set ::tcltest::testConfig(nt) [expr {$tcl_platform(os) == "Windows NT"}] - set ::tcltest::testConfig(95) [expr {$tcl_platform(os) == "Windows 95"}] - - # The following config switches are used to mark tests that should work, - # but have been temporarily disabled on certain platforms because they don't - # and we haven't gotten around to fixing the underlying problem. - - set ::tcltest::testConfig(tempNotPc) [expr {!$::tcltest::testConfig(pc)}] - set ::tcltest::testConfig(tempNotMac) [expr {!$::tcltest::testConfig(mac)}] - set ::tcltest::testConfig(tempNotUnix) [expr {!$::tcltest::testConfig(unix)}] - - # The following config switches are used to mark tests that crash on - # certain platforms, so that they can be reactivated again when the - # underlying problem is fixed. - - set ::tcltest::testConfig(pcCrash) [expr {!$::tcltest::testConfig(pc)}] - set ::tcltest::testConfig(macCrash) [expr {!$::tcltest::testConfig(mac)}] - set ::tcltest::testConfig(unixCrash) [expr {!$::tcltest::testConfig(unix)}] - - # Set the "fonts" constraint for wish apps - - if {[info exists tk_version]} { - set ::tcltest::testConfig(fonts) 1 - catch {destroy .e} - entry .e -width 0 -font {Helvetica -12} -bd 1 - .e insert end "a.bcd" - if {([winfo reqwidth .e] != 37) || ([winfo reqheight .e] != 20)} { - set ::tcltest::testConfig(fonts) 0 - } - destroy .e - catch {destroy .t} - text .t -width 80 -height 20 -font {Times -14} -bd 1 - pack .t - .t insert end "This is\na dot." - update - set x [list [.t bbox 1.3] [.t bbox 2.5]] - destroy .t - if {[string match {{22 3 6 15} {31 18 [34] 15}} $x] == 0} { - set ::tcltest::testConfig(fonts) 0 - } - - # Test to see if we have are running Unix apps on Exceed, - # which won't return font failures (Windows-like), which is - # not what we want from ann X server (other Windows X servers - # operate as expected) - - set ::tcltest::testConfig(noExceed) 1 - if {$::tcltest::testConfig(unixOnly) && \ - [catch {font actual "\{xyz"}] == 0} { - puts "Running X app on Exceed, skipping problematic font tests..." - set ::tcltest::testConfig(noExceed) 0 - } - } - - # Skip empty tests - - set ::tcltest::testConfig(emptyTest) 0 - - # By default, tests that expost known bugs are skipped. - - set ::tcltest::testConfig(knownBug) 0 - - # By default, non-portable tests are skipped. - - set ::tcltest::testConfig(nonPortable) 0 - - # Some tests require user interaction. - - set ::tcltest::testConfig(userInteraction) 0 - - # Some tests must be skipped if the interpreter is not in interactive mode - - set ::tcltest::testConfig(interactive) $tcl_interactive - - # Some tests must be skipped if you are running as root on Unix. - # Other tests can only be run if you are running as root on Unix. - - set ::tcltest::testConfig(root) 0 - set ::tcltest::testConfig(notRoot) 1 - set user {} - if {$tcl_platform(platform) == "unix"} { - catch {set user [exec whoami]} - if {$user == ""} { - catch {regexp {^[^(]*\(([^)]*)\)} [exec id] dummy user} - } - if {($user == "root") || ($user == "")} { - set ::tcltest::testConfig(root) 1 - set ::tcltest::testConfig(notRoot) 0 - } - } - - # Set nonBlockFiles constraint: 1 means this platform supports - # setting files into nonblocking mode. - - if {[catch {set f [open defs r]}]} { - set ::tcltest::testConfig(nonBlockFiles) 1 - } else { - if {[catch {fconfigure $f -blocking off}] == 0} { - set ::tcltest::testConfig(nonBlockFiles) 1 - } else { - set ::tcltest::testConfig(nonBlockFiles) 0 - } - close $f - } - - # Set asyncPipeClose constraint: 1 means this platform supports - # async flush and async close on a pipe. - # - # Test for SCO Unix - cannot run async flushing tests because a - # potential problem with select is apparently interfering. - # (Mark Diekhans). - - if {$tcl_platform(platform) == "unix"} { - if {[catch {exec uname -X | fgrep {Release = 3.2v}}] == 0} { - set ::tcltest::testConfig(asyncPipeClose) 0 - } else { - set ::tcltest::testConfig(asyncPipeClose) 1 - } - } else { - set ::tcltest::testConfig(asyncPipeClose) 1 - } - - # Test to see if we have a broken version of sprintf with respect - # to the "e" format of floating-point numbers. - - set ::tcltest::testConfig(eformat) 1 - if {[string compare "[format %g 5e-5]" "5e-05"] != 0} { - set ::tcltest::testConfig(eformat) 0 - } - - # Test to see if execed commands such as cat, echo, rm and so forth are - # present on this machine. - - set ::tcltest::testConfig(unixExecs) 1 - if {$tcl_platform(platform) == "macintosh"} { - set ::tcltest::testConfig(unixExecs) 0 - } - if {($::tcltest::testConfig(unixExecs) == 1) && \ - ($tcl_platform(platform) == "windows")} { - if {[catch {exec cat defs}] == 1} { - set ::tcltest::testConfig(unixExecs) 0 - } - if {($::tcltest::testConfig(unixExecs) == 1) && \ - ([catch {exec echo hello}] == 1)} { - set ::tcltest::testConfig(unixExecs) 0 - } - if {($::tcltest::testConfig(unixExecs) == 1) && \ - ([catch {exec sh -c echo hello}] == 1)} { - set ::tcltest::testConfig(unixExecs) 0 - } - if {($::tcltest::testConfig(unixExecs) == 1) && \ - ([catch {exec wc defs}] == 1)} { - set ::tcltest::testConfig(unixExecs) 0 - } - if {$::tcltest::testConfig(unixExecs) == 1} { - exec echo hello > removeMe - if {[catch {exec rm removeMe}] == 1} { - set ::tcltest::testConfig(unixExecs) 0 - } - } - if {($::tcltest::testConfig(unixExecs) == 1) && \ - ([catch {exec sleep 1}] == 1)} { - set ::tcltest::testConfig(unixExecs) 0 - } - if {($::tcltest::testConfig(unixExecs) == 1) && \ - ([catch {exec fgrep unixExecs defs}] == 1)} { - set ::tcltest::testConfig(unixExecs) 0 - } - if {($::tcltest::testConfig(unixExecs) == 1) && \ - ([catch {exec ps}] == 1)} { - set ::tcltest::testConfig(unixExecs) 0 - } - if {($::tcltest::testConfig(unixExecs) == 1) && \ - ([catch {exec echo abc > removeMe}] == 0) && \ - ([catch {exec chmod 644 removeMe}] == 1) && \ - ([catch {exec rm removeMe}] == 0)} { - set ::tcltest::testConfig(unixExecs) 0 - } else { - catch {exec rm -f removeMe} - } - if {($::tcltest::testConfig(unixExecs) == 1) && \ - ([catch {exec mkdir removeMe}] == 1)} { - set ::tcltest::testConfig(unixExecs) 0 - } else { - catch {exec rm -r removeMe} - } - } -} - -::tcltest::initConfig - - -# ::tcltest::processCmdLineArgs -- -# -# Use command line args to set the verbose, skip, and -# match variables. This procedure must be run after -# constraints are initialized, because some constraints can be -# overridden. -# -# Arguments: -# none -# -# Results: -# ::tcltest::verbose is set to <value> - -proc ::tcltest::processCmdLineArgs {} { - global argv - - # The "argv" var doesn't exist in some cases, so use {} - # The "argv" var doesn't exist in some cases. - - if {(![info exists argv]) || ([llength $argv] < 2)} { - set flagArray {} - } else { - set flagArray $argv - } - - if {[catch {array set flag $flagArray}]} { - puts stderr "Error: odd number of command line args specified:" - puts stderr " $argv" - exit - } - - # Allow for 1-char abbreviations, where applicable (e.g., -match == -m). - # Note that -verbose cannot be abbreviated to -v in wish because it - # conflicts with the wish option -visual. - - foreach arg {-verbose -match -skip -constraints} { - set abbrev [string range $arg 0 1] - if {([info exists flag($abbrev)]) && \ - ([lsearch -exact $flagArray $arg] < \ - [lsearch -exact $flagArray $abbrev])} { - set flag($arg) $flag($abbrev) - } - } - - # Set ::tcltest::workingDir to [pwd]. - # Save the names of files that already exist in ::tcltest::workingDir. - - set ::tcltest::workingDir [pwd] - foreach file [glob -nocomplain [file join $::tcltest::workingDir *]] { - lappend ::tcltest::filesExisted [file tail $file] - } - - # Set ::tcltest::verbose to the arg of the -verbose flag, if given - - if {[info exists flag(-verbose)]} { - set ::tcltest::verbose $flag(-verbose) - } - - # Set ::tcltest::match to the arg of the -match flag, if given - - if {[info exists flag(-match)]} { - set ::tcltest::match $flag(-match) - } - - # Set ::tcltest::skip to the arg of the -skip flag, if given - - if {[info exists flag(-skip)]} { - set ::tcltest::skip $flag(-skip) - } - - # Use the -constraints flag, if given, to turn on constraints that are - # turned off by default: userInteractive knownBug nonPortable. This - # code fragment must be run after constraints are initialized. - - if {[info exists flag(-constraints)]} { - foreach elt $flag(-constraints) { - set ::tcltest::testConfig($elt) 1 - } - } -} - -::tcltest::processCmdLineArgs - - -# ::tcltest::cleanupTests -- -# -# Remove files and dirs created using the makeFile and makeDirectory -# commands since the last time this proc was invoked. -# -# Print the names of the files created without the makeFile command -# since the tests were invoked. -# -# Print the number tests (total, passed, failed, and skipped) since the -# tests were invoked. -# - -proc ::tcltest::cleanupTests {{calledFromAllFile 0}} { - set tail [file tail [info script]] - - # Remove files and directories created by the :tcltest::makeFile and - # ::tcltest::makeDirectory procedures. - # Record the names of files in ::tcltest::workingDir that were not - # pre-existing, and associate them with the test file that created them. - - if {!$calledFromAllFile} { - - foreach file $::tcltest::filesMade { - if {[file exists $file]} { - catch {file delete -force $file} - } - } - set currentFiles {} - foreach file [glob -nocomplain [file join $::tcltest::workingDir *]] { - lappend currentFiles [file tail $file] - } - set newFiles {} - foreach file $currentFiles { - if {[lsearch -exact $::tcltest::filesExisted $file] == -1} { - lappend newFiles $file - } - } - set ::tcltest::filesExisted $currentFiles - if {[llength $newFiles] > 0} { - set ::tcltest::createdNewFiles($tail) $newFiles - } - } - - if {$calledFromAllFile || $::tcltest::testSingleFile} { - - # print stats - - puts -nonewline stdout "$tail:" - foreach index [list "Total" "Passed" "Skipped" "Failed"] { - puts -nonewline stdout "\t$index\t$::tcltest::numTests($index)" - } - puts stdout "" - - # print number test files sourced - # print names of files that ran tests which failed - - if {$calledFromAllFile} { - puts stdout "Sourced $::tcltest::numTestFiles Test Files." - set ::tcltest::numTestFiles 0 - if {[llength $::tcltest::failFiles] > 0} { - puts stdout "Files with failing tests: $::tcltest::failFiles" - set ::tcltest::failFiles {} - } - } - - # if any tests were skipped, print the constraints that kept them - # from running. - - set constraintList [array names ::tcltest::skippedBecause] - if {[llength $constraintList] > 0} { - puts stdout "Number of tests skipped for each constraint:" - foreach constraint [lsort $constraintList] { - puts stdout \ - "\t$::tcltest::skippedBecause($constraint)\t$constraint" - unset ::tcltest::skippedBecause($constraint) - } - } - - # report the names of test files in ::tcltest::createdNewFiles, and - # reset the array to be empty. - - set testFilesThatTurded [lsort [array names ::tcltest::createdNewFiles]] - if {[llength $testFilesThatTurded] > 0} { - puts stdout "Warning: test files left files behind:" - foreach testFile $testFilesThatTurded { - puts "\t$testFile:\t$::tcltest::createdNewFiles($testFile)" - unset ::tcltest::createdNewFiles($testFile) - } - } - - # reset filesMade, filesExisted, and numTests - - set ::tcltest::filesMade {} - foreach index [list "Total" "Passed" "Skipped" "Failed"] { - set ::tcltest::numTests($index) 0 - } - - # exit only if running Tk in non-interactive mode - - global tk_version tcl_interactive - if {[info exists tk_version] && !$tcl_interactive} { - exit - } - } else { - - # if we're deferring stat-reporting until all files are sourced, - # then add current file to failFile list if any tests in this file - # failed - - incr ::tcltest::numTestFiles - if {($::tcltest::currentFailure) && \ - ([lsearch -exact $::tcltest::failFiles $tail] == -1)} { - lappend ::tcltest::failFiles $tail - } - set ::tcltest::currentFailure false - } -} - - -# test -- -# -# This procedure runs a test and prints an error message if the test fails. -# If ::tcltest::verbose has been set, it also prints a message even if the -# test succeeds. The test will be skipped if it doesn't match the -# ::tcltest::match variable, if it matches an element in -# ::tcltest::skip, or if one of the elements of "constraints" turns -# out not to be true. -# -# Arguments: -# name - Name of test, in the form foo-1.2. -# description - Short textual description of the test, to -# help humans understand what it does. -# constraints - A list of one or more keywords, each of -# which must be the name of an element in -# the array "::tcltest::testConfig". If any of these -# elements is zero, the test is skipped. -# This argument may be omitted. -# script - Script to run to carry out the test. It must -# return a result that can be checked for -# correctness. -# expectedAnswer - Expected result from script. - -proc ::tcltest::test {name description script expectedAnswer args} { - incr ::tcltest::numTests(Total) - - # skip the test if it's name matches an element of skip - - foreach pattern $::tcltest::skip { - if {[string match $pattern $name]} { - incr ::tcltest::numTests(Skipped) - return - } - } - # skip the test if it's name doesn't match any element of match - - if {[llength $::tcltest::match] > 0} { - set ok 0 - foreach pattern $::tcltest::match { - if {[string match $pattern $name]} { - set ok 1 - break - } - } - if {!$ok} { - incr ::tcltest::numTests(Skipped) - return - } - } - set i [llength $args] - if {$i == 0} { - set constraints {} - } elseif {$i == 1} { - - # "constraints" argument exists; shuffle arguments down, then - # make sure that the constraints are satisfied. - - set constraints $script - set script $expectedAnswer - set expectedAnswer [lindex $args 0] - set doTest 0 - if {[string match {*[$\[]*} $constraints] != 0} { - - # full expression, e.g. {$foo > [info tclversion]} - - catch {set doTest [uplevel #0 expr $constraints]} - - } elseif {[regexp {[^.a-zA-Z0-9 ]+} $constraints] != 0} { - - # something like {a || b} should be turned into - # $::tcltest::testConfig(a) || $::tcltest::testConfig(b). - - regsub -all {[.a-zA-Z0-9]+} $constraints \ - {$::tcltest::testConfig(&)} c - catch {set doTest [eval expr $c]} - } else { - - # just simple constraints such as {unixOnly fonts}. - - set doTest 1 - foreach constraint $constraints { - if {![info exists ::tcltest::testConfig($constraint)] - || !$::tcltest::testConfig($constraint)} { - set doTest 0 - - # store the constraint that kept the test from running - - set constraints $constraint - break - } - } - } - if {$doTest == 0} { - incr ::tcltest::numTests(Skipped) - if {[string first s $::tcltest::verbose] != -1} { - puts stdout "++++ $name SKIPPED: $constraints" - } - - # add the constraint to the list of constraints the kept tests - # from running - - if {[info exists ::tcltest::skippedBecause($constraints)]} { - incr ::tcltest::skippedBecause($constraints) - } else { - set ::tcltest::skippedBecause($constraints) 1 - } - return - } - } else { - error "wrong # args: must be \"test name description ?constraints? script expectedAnswer\"" - } - memory tag $name - set code [catch {uplevel $script} actualAnswer] - if {$code != 0 || [string compare $actualAnswer $expectedAnswer] != 0} { - incr ::tcltest::numTests(Failed) - set ::tcltest::currentFailure true - if {[string first b $::tcltest::verbose] == -1} { - set script "" - } - puts stdout "\n==== $name $description FAILED" - if {$script != ""} { - puts stdout "==== Contents of test case:" - puts stdout $script - } - if {$code != 0} { - if {$code == 1} { - puts stdout "==== Test generated error:" - puts stdout $actualAnswer - } elseif {$code == 2} { - puts stdout "==== Test generated return exception; result was:" - puts stdout $actualAnswer - } elseif {$code == 3} { - puts stdout "==== Test generated break exception" - } elseif {$code == 4} { - puts stdout "==== Test generated continue exception" - } else { - puts stdout "==== Test generated exception $code; message was:" - puts stdout $actualAnswer - } - } else { - puts stdout "---- Result was:\n$actualAnswer" - } - puts stdout "---- Result should have been:\n$expectedAnswer" - puts stdout "==== $name FAILED\n" - } else { - incr ::tcltest::numTests(Passed) - if {[string first p $::tcltest::verbose] != -1} { - puts stdout "++++ $name PASSED" - } - } -} - -# ::tcltest::dotests -- -# -# takes two arguments--the name of the test file (such -# as "parse.test"), and a pattern selecting the tests you want to -# execute. It sets ::tcltest::matching to the second argument, calls -# "source" on the file specified in the first argument, and restores -# ::tcltest::matching to its pre-call value at the end. -# -# Arguments: -# file name of tests file to source -# args pattern selecting the tests you want to execute -# -# Results: -# none - -proc ::tcltest::dotests {file args} { - set savedTests $::tcltest::match - set ::tcltest::match $args - source $file - set ::tcltest::match $savedTests -} - -proc ::tcltest::openfiles {} { - if {[catch {testchannel open} result]} { - return {} - } - return $result -} - -proc ::tcltest::leakfiles {old} { - if {[catch {testchannel open} new]} { - return {} - } - set leak {} - foreach p $new { - if {[lsearch $old $p] < 0} { - lappend leak $p - } - } - return $leak -} - -set ::tcltest::saveState {} - -proc ::tcltest::saveState {} { - uplevel #0 {set ::tcltest::saveState [list [info procs] [info vars]]} -} - -proc ::tcltest::restoreState {} { - foreach p [info procs] { - if {[lsearch [lindex $::tcltest::saveState 0] $p] < 0} { - rename $p {} - } - } - foreach p [uplevel #0 {info vars}] { - if {[lsearch [lindex $::tcltest::saveState 1] $p] < 0} { - uplevel #0 "unset $p" - } - } -} - -proc ::tcltest::normalizeMsg {msg} { - regsub "\n$" [string tolower $msg] "" msg - regsub -all "\n\n" $msg "\n" msg - regsub -all "\n\}" $msg "\}" msg - return $msg -} - -# makeFile -- -# -# Create a new file with the name <name>, and write <contents> to it. -# -# If this file hasn't been created via makeFile since the last time -# cleanupTests was called, add it to the $filesMade list, so it will -# be removed by the next call to cleanupTests. -# -proc ::tcltest::makeFile {contents name} { - set fd [open $name w] - fconfigure $fd -translation lf - if {[string index $contents [expr {[string length $contents] - 1}]] == "\n"} { - puts -nonewline $fd $contents - } else { - puts $fd $contents - } - close $fd - - set fullName [file join [pwd] $name] - if {[lsearch -exact $::tcltest::filesMade $fullName] == -1} { - lappend ::tcltest::filesMade $fullName - } -} - -proc ::tcltest::removeFile {name} { - file delete $name -} - -# makeDirectory -- -# -# Create a new dir with the name <name>. -# -# If this dir hasn't been created via makeDirectory since the last time -# cleanupTests was called, add it to the $directoriesMade list, so it will -# be removed by the next call to cleanupTests. -# -proc ::tcltest::makeDirectory {name} { - file mkdir $name - - set fullName [file join [pwd] $name] - if {[lsearch -exact $::tcltest::filesMade $fullName] == -1} { - lappend ::tcltest::filesMade $fullName - } -} - -proc ::tcltest::removeDirectory {name} { - file delete -force $name -} - -proc ::tcltest::viewFile {name} { - global tcl_platform - if {($tcl_platform(platform) == "macintosh") || \ - ($::tcltest::testConfig(unixExecs) == 0)} { - set f [open $name] - set data [read -nonewline $f] - close $f - return $data - } else { - exec cat $name - } -} - -# -# Construct a string that consists of the requested sequence of bytes, -# as opposed to a string of properly formed UTF-8 characters. -# This allows the tester to -# 1. Create denormalized or improperly formed strings to pass to C procedures -# that are supposed to accept strings with embedded NULL bytes. -# 2. Confirm that a string result has a certain pattern of bytes, for instance -# to confirm that "\xe0\0" in a Tcl script is stored internally in -# UTF-8 as the sequence of bytes "\xc3\xa0\xc0\x80". -# -# Generally, it's a bad idea to examine the bytes in a Tcl string or to -# construct improperly formed strings in this manner, because it involves -# exposing that Tcl uses UTF-8 internally. - -proc ::tcltest::bytestring {string} { - encoding convertfrom identity $string -} - -# Locate tcltest executable - -if {![info exists tk_version]} { - set tcltest [info nameofexecutable] - - if {$tcltest == "{}"} { - set tcltest {} - } -} - -set ::tcltest::testConfig(stdio) 0 -catch { - catch {file delete -force tmp} - set f [open tmp w] - puts $f { - exit - } - close $f - - set f [open "|[list $tcltest tmp]" r] - close $f - - set ::tcltest::testConfig(stdio) 1 -} -catch {file delete -force tmp} - -# Deliberately call the socket with the wrong number of arguments. The error -# message you get will indicate whether sockets are available on this system. - -catch {socket} msg -set ::tcltest::testConfig(socket) \ - [expr {$msg != "sockets are not available on this system"}] - -# -# Internationalization / ISO support procs -- dl -# - -if {[info commands testlocale]==""} { - - # No testlocale command, no tests... - # (it could be that we are a sub interp and we could just load - # the Tcltest package but that would interfere with tests - # that tests packages/loading in slaves...) - - set ::tcltest::testConfig(hasIsoLocale) 0 -} else { - proc ::tcltest::set_iso8859_1_locale {} { - set ::tcltest::previousLocale [testlocale ctype] - testlocale ctype $::tcltest::isoLocale - } - - proc ::tcltest::restore_locale {} { - testlocale ctype $::tcltest::previousLocale - } - - if {![info exists ::tcltest::isoLocale]} { - set ::tcltest::isoLocale fr - switch $tcl_platform(platform) { - "unix" { - - # Try some 'known' values for some platforms: - - switch -exact -- $tcl_platform(os) { - "FreeBSD" { - set ::tcltest::isoLocale fr_FR.ISO_8859-1 - } - HP-UX { - set ::tcltest::isoLocale fr_FR.iso88591 - } - Linux - - IRIX { - set ::tcltest::isoLocale fr - } - default { - - # Works on SunOS 4 and Solaris, and maybe others... - # define it to something else on your system - #if you want to test those. - - set ::tcltest::isoLocale iso_8859_1 - } - } - } - "windows" { - set ::tcltest::isoLocale French - } - } - } - - set ::tcltest::testConfig(hasIsoLocale) \ - [string length [::tcltest::set_iso8859_1_locale]] - ::tcltest::restore_locale -} - -# -# procedures that are Tk specific -# - -if {[info exists tk_version]} { - - # If the main window isn't already mapped (e.g. because the tests are - # being run automatically) , specify a precise size for it so that the - # user won't have to position it manually. - - if {![winfo ismapped .]} { - wm geometry . +0+0 - update - } - - # The following code can be used to perform tests involving a second - # process running in the background. - - # Locate the tktest executable - - set ::tcltest::tktest [info nameofexecutable] - if {$::tcltest::tktest == "{}"} { - set ::tcltest::tktest {} - puts stdout \ - "Unable to find tktest executable, skipping multiple process tests." - } - - # Create background process - - proc ::tcltest::setupbg args { - if {$::tcltest::tktest == ""} { - error "you're not running tktest so setupbg should not have been called" - } - if {[info exists ::tcltest::fd] && ($::tcltest::fd != "")} { - cleanupbg - } - - # The following code segment cannot be run on Windows prior - # to Tk 8.1b3 due to a channel I/O bug (bugID 1495). - - global tcl_platform - set ::tcltest::fd [open "|[list $::tcltest::tktest -geometry +0+0 -name tktest] $args" r+] - puts $::tcltest::fd "puts foo; flush stdout" - flush $::tcltest::fd - if {[gets $::tcltest::fd data] < 0} { - error "unexpected EOF from \"$::tcltest::tktest\"" - } - if {[string compare $data foo]} { - error "unexpected output from background process \"$data\"" - } - fileevent $::tcltest::fd readable bgReady - } - - # Send a command to the background process, catching errors and - # flushing I/O channels - - proc ::tcltest::dobg {command} { - puts $::tcltest::fd "catch [list $command] msg; update; puts \$msg; puts **DONE**; flush stdout" - flush $::tcltest::fd - set ::tcltest::bgDone 0 - set ::tcltest::bgData {} - tkwait variable ::tcltest::bgDone - set ::tcltest::bgData - } - - # Data arrived from background process. Check for special marker - # indicating end of data for this command, and make data available - # to dobg procedure. - - proc ::tcltest::bgReady {} { - set x [gets $::tcltest::fd] - if {[eof $::tcltest::fd]} { - fileevent $::tcltest::fd readable {} - set ::tcltest::bgDone 1 - } elseif {$x == "**DONE**"} { - set ::tcltest::bgDone 1 - } else { - append ::tcltest::bgData $x - } - } - - # Exit the background process, and close the pipes - - proc ::tcltest::cleanupbg {} { - catch { - puts $::tcltest::fd "exit" - close $::tcltest::fd - } - set ::tcltest::fd "" - } - - # Clean up focus after using generate event, which - # can leave the window manager with the wrong impression - # about who thinks they have the focus. (BW) - - proc ::tcltest::fixfocus {} { - catch {destroy .focus} - toplevel .focus - wm geometry .focus +0+0 - entry .focus.e - .focus.e insert 0 "fixfocus" - pack .focus.e - update - focus -force .focus.e - destroy .focus - } -} - -# threadReap -- -# -# Kill all threads except for the main thread. -# Do nothing if testthread is not defined. -# -# Arguments: -# none. -# -# Results: -# Returns the number of existing threads. - -if {[info commands testthread] != {}} { - proc ::tcltest::threadReap {} { - testthread errorproc ThreadNullError - while {[llength [testthread names]] > 1} { - foreach tid [testthread names] { - if {$tid != $::tcltest::mainThread} { - catch {testthread send -async $tid {testthread exit}} - update - } - } - } - testthread errorproc ThreadError - return [llength [testthread names]] - } -} else { - proc ::tcltest::threadReap {} { - return 1 - } -} - -# Need to catch the import because it fails if defs.tcl is sourced -# more than once. - -catch {namespace import ::tcltest::*} -return diff --git a/tk/tests/unixSend.test b/tk/tests/unixSend.test deleted file mode 100644 index 0afdd4974d9..00000000000 --- a/tk/tests/unixSend.test +++ /dev/null @@ -1,679 +0,0 @@ -# This file is a Tcl script to test out the "send" command and the -# other procedures in the file tkSend.c. It is organized in the -# standard fashion for Tcl tests. -# -# Copyright (c) 1994 Sun Microsystems, Inc. -# Copyright (c) 1994-1996 Sun Microsystems, Inc. -# Copyright (c) 1998-1999 by Scriptics Corporation. -# All rights reserved. -# -# RCS: @(#) $Id$ - -if {[lsearch [namespace children] ::tcltest] == -1} { - source [file join [pwd] [file dirname [info script]] defs.tcl] -} - -if {$tcl_platform(platform) == "macintosh"} { - puts "send is not available on the Mac - skipping tests" - ::tcltest::cleanupTests - return -} -if {$tcl_platform(platform) == "windows"} { - puts "skipping: Unix only tests..." - ::tcltest::cleanupTests - return -} -if {[auto_execok xhost] == ""} { - puts "xhost application isn't available - skipping tests" - ::tcltest::cleanupTests - return -} - -if {[info commands testsend] == "testsend"} { - set gotTestCmds 1 -} else { - set gotTestCmds 0 -} - -foreach i [winfo children .] { - destroy $i -} -wm geometry . {} -raise . - -# If send is disabled because of inadequate security, don't run any -# of these tests at all. - -setupbg -set app [dobg {tk appname}] -if {[catch {send $app set a 0} msg] == 1} { - if [string match "X server insecure *" $msg] { - puts -nonewline "Your X server is insecure, so \"send\" can't be used;" - puts " skipping \"send\" tests." - cleanupbg - ::tcltest::cleanupTests - return - } -} -cleanupbg - -# Compute a script that will load Tk into a child interpreter. - -foreach pkg [info loaded] { - if {[lindex $pkg 1] == "Tk"} { - set loadTk "load $pkg" - break - } -} - -# Procedure to create a new application with a given name and class. - -proc newApp {screen name class} { - global loadTk - interp create $name - $name eval [list set argv [list -display $screen -name $name -class $class]] - eval $loadTk $name -} - -set name [tk appname] -if $gotTestCmds { - set registry [testsend prop root InterpRegistry] - set commId [lindex [testsend prop root InterpRegistry] 0] -} -tk appname tktest -catch {send t_s_1 destroy .} -catch {send t_s_2 destroy .} - -if $gotTestCmds { - test unixSend-1.1 {RegOpen procedure, bogus property} { - testsend bogus - set result [winfo interps] - tk appname tktest - list $result [winfo interps] - } {{} tktest} - test unixSend-1.2 {RegOpen procedure, bogus property} { - testsend prop root InterpRegistry {} - set result [winfo interps] - tk appname tktest - list $result [winfo interps] - } {{} tktest} - test unixSend-1.3 {RegOpen procedure, bogus property} { - testsend prop root InterpRegistry abcdefg - tk appname tktest - set x [testsend prop root InterpRegistry] - string range $x [string first " " $x] end - } " tktest\nabcdefg\n" - - frame .f -width 1 -height 1 - set id [string range [winfo id .f] 2 end] - test unixSend-2.1 {RegFindName procedure} { - testsend prop root InterpRegistry {} - list [catch {send foo bar} msg] $msg - } {1 {no application named "foo"}} - test unixSend-2.2 {RegFindName procedure} { - testsend prop root InterpRegistry " abc\n def\nghi\n\n$id foo\n" - tk appname foo - } {foo #2} - test unixSend-2.3 {RegFindName procedure} { - testsend prop root InterpRegistry "gyz foo\n" - tk appname foo - } {foo} - test unixSend-2.4 {RegFindName procedure} { - testsend prop root InterpRegistry "${id}z foo\n" - tk appname foo - } {foo} - - test unixSend-3.1 {RegDeleteName procedure} { - tk appname tktest - testsend prop root InterpRegistry "012345 gorp\n12345 foo\n12345 tktest" - tk appname x - set x [testsend prop root InterpRegistry] - string range $x [string first " " $x] end - } " x\n012345 gorp\n12345 foo\n" - test unixSend-3.2 {RegDeleteName procedure} { - tk appname tktest - testsend prop root InterpRegistry "012345 gorp\n12345 tktest\n23456 tktest" - tk appname x - set x [testsend prop root InterpRegistry] - string range $x [string first " " $x] end - } " x\n012345 gorp\n23456 tktest\n" - test unixSend-3.3 {RegDeleteName procedure} { - tk appname tktest - testsend prop root InterpRegistry "012345 tktest\n12345 bar\n23456 tktest" - tk appname x - set x [testsend prop root InterpRegistry] - string range $x [string first " " $x] end - } " x\n12345 bar\n23456 tktest\n" - test unixSend-3.4 {RegDeleteName procedure} { - tk appname tktest - testsend prop root InterpRegistry "foo" - tk appname x - set x [testsend prop root InterpRegistry] - string range $x [string first " " $x] end - } " x\nfoo\n" - test unixSend-3.5 {RegDeleteName procedure} { - tk appname tktest - testsend prop root InterpRegistry "" - tk appname x - set x [testsend prop root InterpRegistry] - string range $x [string first " " $x] end - } " x\n" - - test unixSend-4.1 {RegAddName procedure} { - testsend prop root InterpRegistry "" - tk appname bar - testsend prop root InterpRegistry - } "$commId bar\n" - test unixSend-4.2 {RegAddName procedure} { - testsend prop root InterpRegistry "abc def" - tk appname bar - tk appname foo - testsend prop root InterpRegistry - } "$commId foo\nabc def\n" - - # Previous checks should already cover the Regclose procedure. - - test unixSend-5.1 {ValidateName procedure} { - testsend prop root InterpRegistry "123 abc\n" - winfo interps - } {} - test unixSend-5.2 {ValidateName procedure} { - testsend prop root InterpRegistry "$id Hi there" - winfo interps - } {{Hi there}} - test unixSend-5.3 {ValidateName procedure} { - testsend prop root InterpRegistry "$id Bogus" - list [catch {send Bogus set a 44} msg] $msg - } {1 {target application died or uses a Tk version before 4.0}} - test unixSend-5.4 {ValidateName procedure} { - tk appname test - testsend prop root InterpRegistry "$commId Bogus\n$commId test\n" - winfo interps - } {test} -} - -winfo interps -tk appname tktest -update -setupbg -set x [split [exec xhost] \n] -foreach i [lrange $x 1 end] { - exec xhost - $i -} -test unixSend-6.1 {ServerSecure procedure} {nonPortable} { - set a 44 - list [dobg [list send [tk appname] set a 55]] $a -} {55 55} -test unixSend-6.2 {ServerSecure procedure} {nonPortable} { - set a 22 - exec xhost [exec hostname] - list [catch {dobg [list send [tk appname] set a 33]} msg] $a $msg -} {0 22 {X server insecure (must use xauth-style authorization); command ignored}} -test unixSend-6.3 {ServerSecure procedure} {nonPortable} { - set a abc - exec xhost - [exec hostname] - list [dobg [list send [tk appname] set a new]] $a -} {new new} -cleanupbg - -if $gotTestCmds { - test unixSend-7.1 {Tk_SetAppName procedure} { - testsend prop root InterpRegistry "" - tk appname newName - list [tk appname oldName] [testsend prop root InterpRegistry] - } "oldName {$commId oldName\n}" - test unixSend-7.2 {Tk_SetAppName procedure, name not in use} { - testsend prop root InterpRegistry "" - list [tk appname gorp] [testsend prop root InterpRegistry] - } "gorp {$commId gorp\n}" - test unixSend-7.3 {Tk_SetAppName procedure, name in use by us} { - tk appname name1 - testsend prop root InterpRegistry "$commId name2\n" - list [tk appname name2] [testsend prop root InterpRegistry] - } "name2 {$commId name2\n}" - test unixSend-7.4 {Tk_SetAppName procedure, name in use} { - tk appname name1 - testsend prop root InterpRegistry "$id foo\n$id foo #2\n$id foo #3\n" - list [tk appname foo] [testsend prop root InterpRegistry] - } "{foo #4} {$commId foo #4\n$id foo\n$id foo #2\n$id foo #3\n}" -} - -test unixSend-8.1 {Tk_SendCmd procedure, options} { - setupbg - set app [dobg {tk appname}] - set a 66 - send -async $app [list send [tk appname] set a 77] - set result $a - after 200 set x 40 - tkwait variable x - cleanupbg - lappend result $a -} {66 77} -if [info exists env(TK_ALT_DISPLAY)] { - test unixSend-8.2 {Tk_SendCmd procedure, options} { - setupbg -display $env(TK_ALT_DISPLAY) - tk appname xyzgorp - set a homeDisplay - set result [dobg " - toplevel .t -screen [winfo screen .] - wm geometry .t +0+0 - set a altDisplay - tk appname xyzgorp - list \[send xyzgorp set a\] \[send -displayof .t xyzgorp set a\] - "] - cleanupbg - set result - } {altDisplay homeDisplay} -} -test unixSend-8.3 {Tk_SendCmd procedure, options} { - list [catch {send -- -async foo bar baz} msg] $msg -} {1 {no application named "-async"}} -test unixSend-8.4 {Tk_SendCmd procedure, options} { - list [catch {send -gorp foo bar baz} msg] $msg -} {1 {bad option "-gorp": must be -async, -displayof, or --}} -test unixSend-8.5 {Tk_SendCmd procedure, options} { - list [catch {send -async foo} msg] $msg -} {1 {wrong # args: should be "send ?options? interpName arg ?arg ...?"}} -test unixSend-8.6 {Tk_SendCmd procedure, options} { - list [catch {send foo} msg] $msg -} {1 {wrong # args: should be "send ?options? interpName arg ?arg ...?"}} -test unixSend-8.7 {Tk_SendCmd procedure, local execution} { - set a initial - send [tk appname] {set a new} - set a -} {new} -test unixSend-8.8 {Tk_SendCmd procedure, local execution} { - set a initial - send [tk appname] set a new - set a -} {new} -test unixSend-8.9 {Tk_SendCmd procedure, local execution} { - set a initial - string tolower [list [catch {send [tk appname] open bad_file} msg] \ - $msg $errorInfo $errorCode] -} {1 {couldn't open "bad_file": no such file or directory} {couldn't open "bad_file": no such file or directory - while executing -"open bad_file" - invoked from within -"send [tk appname] open bad_file"} {posix enoent {no such file or directory}}} -test unixSend-8.10 {Tk_SendCmd procedure, no such interpreter} { - list [catch {send bogus_name bogus_command} msg] $msg -} {1 {no application named "bogus_name"}} -if $gotTestCmds { - newApp "" t_s_1 Test - t_s_1 eval wm withdraw . - test unixSend-8.11 {Tk_SendCmd procedure, local execution, different interp} { - set a us - send t_s_1 set a them - list $a [send t_s_1 set a] - } {us them} - test unixSend-8.12 {Tk_SendCmd procedure, local execution, different interp} { - set a us - send t_s_1 {set a them} - list $a [send t_s_1 {set a}] - } {us them} - test unixSend-8.13 {Tk_SendCmd procedure, local execution, different interp} { - set a us - send t_s_1 {set a them} - list $a [send t_s_1 {set a}] - } {us them} - test unixSend-8.14 {Tk_SendCmd procedure, local interp killed by send} { - newApp "" t_s_2 Test - list [catch {send t_s_2 {destroy .; concat result}} msg] $msg - } {0 result} - interp delete t_s_2 - test unixSend-8.15 {Tk_SendCmd procedure, local interp, error info} { - catch {error foo} - list [catch {send t_s_1 {if 1 {open bogus_file_name}}} msg] $msg $errorInfo $errorCode - } {1 {couldn't open "bogus_file_name": no such file or directory} {couldn't open "bogus_file_name": no such file or directory - while executing -"open bogus_file_name" - invoked from within -"if 1 {open bogus_file_name}" - invoked from within -"send t_s_1 {if 1 {open bogus_file_name}}"} {POSIX ENOENT {no such file or directory}}} - test unixSend-8.16 {Tk_SendCmd procedure, bogusCommWindow} { - testsend prop root InterpRegistry "10234 bogus\n" - set result [list [catch {send bogus bogus command} msg] $msg] - winfo interps - tk appname tktest - set result - } {1 {no application named "bogus"}} - interp delete t_s_1 -} -test unixSend-8.17 {Tk_SendCmd procedure, deferring events} {nonPortable} { - # Non-portable because some window managers ignore "raise" - # requests so can't guarantee that new app's window won't - # obscure .f, thereby masking the Expose event. - - setupbg - set app [dobg {tk appname}] - raise . ; # Don't want new app obscuring .f - catch {destroy .f} - frame .f - place .f -x 0 -y 0 - bind .f <Expose> {set a exposed} - set a {no event yet} - set result "" - lappend result [send $app send [list [tk appname]] set a] - lappend result $a - update - cleanupbg - lappend result $a -} {{no event yet} {no event yet} exposed} -test unixSend-8.18 {Tk_SendCmd procedure, error in remote app} { - setupbg - set app [dobg {tk appname}] - set result [string tolower [list [catch {send $app open bad_name} msg] \ - $msg $errorInfo $errorCode]] - cleanupbg - set result -} {1 {couldn't open "bad_name": no such file or directory} {couldn't open "bad_name": no such file or directory - while executing -"open bad_name" - invoked from within -"send $app open bad_name"} {posix enoent {no such file or directory}}} -test unixSend-8.19 {Tk_SendCmd, using modal timeouts} { - setupbg - set app [dobg {tk appname}] - set x no - set result "" - after 0 {set x yes} - lappend result [send $app {concat x y z}] - lappend result $x - update - cleanupbg - lappend result $x -} {{x y z} no yes} - -tk appname tktest -catch {destroy .f} -frame .f -set id [string range [winfo id .f] 2 end] -if $gotTestCmds { - test unixSend-9.1 {Tk_GetInterpNames procedure} { - testsend prop root InterpRegistry \ - "$commId tktest\nfoo bar\n$commId tktest\n$id frame .f\n\n\n" - list [winfo interps] [testsend prop root InterpRegistry] - } "{tktest tktest {frame .f}} {$commId tktest\n$commId tktest\n$id frame .f -}" - test unixSend-9.2 {Tk_GetInterpNames procedure} { - testsend prop root InterpRegistry \ - "$commId tktest\nfoobar\n$commId gorp\n" - list [winfo interps] [testsend prop root InterpRegistry] - } "tktest {$commId tktest\n}" - test unixSend-9.3 {Tk_GetInterpNames procedure} { - testsend prop root InterpRegistry {} - list [winfo interps] [testsend prop root InterpRegistry] - } {{} {}} - - testsend prop root InterpRegistry "$commId tktest\n$id dummy\n" - test unixSend-10.1 {SendEventProc procedure, bogus comm property} { - testsend prop comm Comm {abc def} - testsend prop comm Comm {} - update - } {} - test unixSend-10.2 {SendEventProc procedure, simultaneous messages} { - testsend prop comm Comm \ - "c\n-n tktest\n-s set a 44\nc\n-n tktest\n-s set b 45\n" - set a null - set b xyzzy - update - list $a $b - } {44 45} - test unixSend-10.3 {SendEventProc procedure, simultaneous messages} { - testsend prop comm Comm \ - "c\n-n tktest\n-s set a newA\nr\n-s [testsend serial]\n-r 12345\nc\n-n tktest\n-s set b newB\n" - set a null - set b xyzzy - set x [send dummy bogus] - list $x $a $b - } {12345 newA newB} - test unixSend-10.4 {SendEventProc procedure, leading nulls, bogus commands} { - testsend prop comm Comm \ - "\n\nx\n-bogus\n\nc\n-n tktest\n-s set a 44\n" - set a null - update - set a - } {44} - test unixSend-10.5 {SendEventProc procedure, extraneous command options} { - testsend prop comm Comm \ - "c\n-n tktest\n-x miscellanous\n-y who knows?\n-s set a new\n" - set a null - update - set a - } {new} - test unixSend-10.6 {SendEventProc procedure, unknown interpreter} { - testsend prop [winfo id .f] Comm {} - testsend prop comm Comm \ - "c\n-n unknown\n-r $id 44\n-s set a new\n" - set a null - update - list [testsend prop [winfo id .f] Comm] $a - } "{\nr\n-s 44\n-r receiver never heard of interpreter \"unknown\"\n-c 1\n} null" - test unixSend-10.7 {SendEventProc procedure, error in script} { - testsend prop [winfo id .f] Comm {} - testsend prop comm Comm \ - "c\n-n tktest\n-r $id 62\n-s foreach i {1 2 3} {error {test error} {Initial errorInfo} {test code}}\n" - update - testsend prop [winfo id .f] Comm - } { -r --s 62 --r test error --i Initial errorInfo - ("foreach" body line 1) - invoked from within -"foreach i {1 2 3} {error {test error} {Initial errorInfo} {test code}}" --e test code --c 1 -} - test unixSend-10.8 {SendEventProc procedure, exceptional return} { - testsend prop [winfo id .f] Comm {} - testsend prop comm Comm \ - "c\n-n tktest\n-r $id 62\n-s break\n" - update - testsend prop [winfo id .f] Comm - } { -r --s 62 --r --c 3 -} - test unixSend-10.9 {SendEventProc procedure, empty return} { - testsend prop [winfo id .f] Comm {} - testsend prop comm Comm \ - "c\n-n tktest\n-r $id 62\n-s concat\n" - update - testsend prop [winfo id .f] Comm - } { -r --s 62 --r -} - test unixSend-10.10 {SendEventProc procedure, asynchronous calls} { - testsend prop [winfo id .f] Comm {} - testsend prop comm Comm \ - "c\n-n tktest\n-s foreach i {1 2 3} {error {test error} {Initial errorInfo} {test code}}\n" - update - testsend prop [winfo id .f] Comm - } {} - test unixSend-10.11 {SendEventProc procedure, exceptional return} { - testsend prop [winfo id .f] Comm {} - testsend prop comm Comm \ - "c\n-n tktest\n-s break\n" - update - testsend prop [winfo id .f] Comm - } {} - test unixSend-10.12 {SendEventProc procedure, empty return} { - testsend prop [winfo id .f] Comm {} - testsend prop comm Comm \ - "c\n-n tktest\n-s concat\n" - update - testsend prop [winfo id .f] Comm - } {} - test unixSend-10.13 {SendEventProc procedure, return processing} { - testsend prop comm Comm \ - "r\n-c 1\n-e test1\n-i test2\n-r test3\n-s [testsend serial]\n" - list [catch {send dummy foo} msg] $msg $errorInfo $errorCode - } {1 test3 {test2 - invoked from within -"send dummy foo"} test1} - test unixSend-10.14 {SendEventProc procedure, extraneous return options} { - testsend prop comm Comm \ - "r\n-x test1\n-y test2\n-r result\n-s [testsend serial]\n" - list [catch {send dummy foo} msg] $msg - } {0 result} - test unixSend-10.15 {SendEventProc procedure, serial number} { - testsend prop comm Comm \ - "r\n-r response\n" - list [catch {send dummy foo} msg] $msg - } {1 {target application died or uses a Tk version before 4.0}} - test unixSend-10.16 {SendEventProc procedure, serial number} { - testsend prop comm Comm \ - "r\n-r response\n\n-s 0" - list [catch {send dummy foo} msg] $msg - } {1 {target application died or uses a Tk version before 4.0}} - test unixSend-10.17 {SendEventProc procedure, errorCode and errorInfo} { - testsend prop comm Comm \ - "r\n-i test1\n-e test2\n-c 4\n-s [testsend serial]\n" - set errorCode oldErrorCode - set errorInfo oldErrorInfo - list [catch {send dummy foo} msg] $msg $errorInfo $errorCode - } {4 {} oldErrorInfo oldErrorCode} - test unixSend-10.18 {SendEventProc procedure, send kills application} { - setupbg - dobg {tk appname t_s_3} - set x [list [catch {send t_s_3 destroy .} msg] $msg] - cleanupbg - set x - } {0 {}} - test unixSend-10.19 {SendEventProc procedure, send exits} { - setupbg - dobg {tk appname t_s_3} - set x [list [catch {send t_s_3 exit} msg] $msg] - close $::tcltest::fd - set x - } {1 {target application died}} - - test unixSend-11.1 {AppendPropCarefully and AppendErrorProc procedures} { - testsend prop root InterpRegistry "0x21447 dummy\n" - list [catch {send dummy foo} msg] $msg - } {1 {no application named "dummy"}} - test unixSend-11.2 {AppendPropCarefully and AppendErrorProc procedures} { - testsend prop comm Comm "c\n-r0x123 44\n-n tktest\n-s concat a b c\n" - update - } {} -} - -winfo interps -tk appname tktest -catch {destroy .f} -frame .f -set id [string range [winfo id .f] 2 end] -if $gotTestCmds { - test unixSend-12.1 {TimeoutProc procedure} { - testsend prop root InterpRegistry "$id dummy\n" - list [catch {send dummy foo} msg] $msg - } {1 {target application died or uses a Tk version before 4.0}} - testsend prop root InterpRegistry "" -} -test unixSend-12.2 {TimeoutProc procedure} { - winfo interps - tk appname tktest - update - setupbg - puts $::tcltest::fd {after 10 {after 5000; exit}; puts [tk appname]; puts **DONE**; flush stdout} - set ::tcltest::bgDone 0 - set ::tcltest::bgData {} - flush $::tcltest::fd - tkwait variable ::tcltest::bgDone - set app $::tcltest::bgData - after 200 - set result [list [catch {send $app foo} msg] $msg] - close $::tcltest::fd - set result -} {1 {target application died}} - -winfo interps -tk appname tktest -test unixSend-13.1 {DeleteProc procedure} { - setupbg - set app [dobg {rename send {}; tk appname}] - set result [list [catch {send $app foo} msg] $msg [winfo interps]] - cleanupbg - set result -} {1 {no application named "tktest #2"} tktest} -test unixSend-13.2 {DeleteProc procedure} { - winfo interps - tk appname tktest - rename send {} - set result {} - lappend result [winfo interps] [info commands send] - tk appname foo - lappend result [winfo interps] [info commands send] -} {{} {} foo send} - -if [info exists env(TK_ALT_DISPLAY)] { - test unixSend-14.1 {SendRestrictProc procedure, sends crossing from different displays} { - setupbg -display $env(TK_ALT_DISPLAY) - set result [dobg " - toplevel .t -screen [winfo screen .] - wm geometry .t +0+0 - tk appname xyzgorp1 - set x child - "] - toplevel .t -screen $env(TK_ALT_DISPLAY) - wm geometry .t +0+0 - tk appname xyzgorp2 - update - set y parent - set result [send -displayof .t xyzgorp1 {list $x [send -displayof .t xyzgorp2 set y]}] - destroy .t - cleanupbg - set result - } {child parent} -} - -if $gotTestCmds { - testsend prop root InterpRegister $registry - tk appname tktest - test unixSend-15.1 {UpdateCommWindow procedure} { - set x [list [testsend prop comm TK_APPLICATION]] - newApp "" t_s_1 Test - send t_s_1 wm withdraw . - newApp "" t_s_2 Test - send t_s_2 wm withdraw . - lappend x [testsend prop comm TK_APPLICATION] - interp delete t_s_1 - lappend x [testsend prop comm TK_APPLICATION] - interp delete t_s_2 - lappend x [testsend prop comm TK_APPLICATION] - } {tktest {t_s_2 t_s_1 tktest} {t_s_2 tktest} tktest} -} - -tk appname $name -if $gotTestCmds { - testsend prop root InterpRegistry $registry -} -if $gotTestCmds { - testdeleteapps -} -rename newApp {} - -# cleanup -::tcltest::cleanupTests -return - - - - - - - - - - - - - diff --git a/tk/unix/ChangeLog b/tk/unix/ChangeLog deleted file mode 100644 index ddf2006c3ab..00000000000 --- a/tk/unix/ChangeLog +++ /dev/null @@ -1,200 +0,0 @@ -Mon Apr 13 17:55:38 1998 Ian Lance Taylor <ian@cygnus.com> - - * configure.in: Remove AC_REPLACE_FUNCS(memmove). - * Makefile.in (LIBOBJS): Remove variable. - (OBJS): Remove $(LIBOBJS). - (memmove.o): Remove target. - * configure: Rebuild. - -Mon Apr 6 20:07:55 1998 Ian Lance Taylor <ian@cygnus.com> - - * configure.in: Handle an empty x_libraries string correctly, in - case of Solaris when not using gcc. - * configure: Rebuild. - -Mon Dec 15 15:13:08 1997 Ian Lance Taylor <ian@cygnus.com> - - * tkUnixPort.h: Don't include <string.h> if _STRING is defined. - - * configure.in: When checking for GNU ld on Solaris, don't - redirect stderr to /dev/null. - * configure: Rebuild. - -Thu Sep 4 20:03:38 1997 Ian Lance Taylor <ian@cygnus.com> - - * configure.in: If SHLIB_LD matches *gcc*, then don't remove the - -Wl from TK_LD_SEARCH_FLAGS. Otherwise building shared libraries - fails on HP/UX. - * configure: Rebuild. - -Tue Oct 28 16:37:12 1997 Ian Lance Taylor <ian@cygnus.com> - - * Makefile.in (install-minimal): New target. - -Tue Oct 21 14:25:07 1997 Tom Tromey <tromey@cygnus.com> - - * tkUnixFont.c (TkpGetFontFamilies): Use XFreeFontNames, not - XFree. From jkb@mrc-lmb.cam.ac.uk (James Bonfield). - -Wed Sep 17 13:43:58 1997 Tom Tromey <tromey@cygnus.com> - - * configure: Rebuilt. - * configure.in: Better error message if TCL_BIN_DIR can't be - found. - -Tue Aug 5 14:41:23 1997 Tom Tromey <tromey@cygnus.com> - - * configure: Rebuilt. - * configure.in: Preserved local changes. - * Makefile.in: Preserved local changes. - * mkLinks: Preserved local changes. - -Tue Jul 1 22:10:44 1997 Ian Lance Taylor <ian@cygnus.com> - - * configure.in: Fix -lnsl test. - * configure: Rebuild. - -Mon Jun 30 13:36:27 1997 Ian Lance Taylor <ian@cygnus.com> - - * configure.in: Rework check for socket libraries to use a cache - variable and to not set ac_cv_func cache variables - inappropriately. - * configure: Rebuild. - -Mon Jun 9 16:25:20 1997 Ian Lance Taylor <ian@cygnus.com> - - * tkConfig.sh.in: Set TK_BUILD_INCLUDES. - * configure.in: Set TK_BUILD_INCLUDES. - * configure: Rebuild. - -Fri May 9 09:26:51 1997 Tom Tromey <tromey@cygnus.com> - - * tkUnixPort.h (panic): Added prototype. From Ian Taylor. - -Fri Apr 18 12:13:39 1997 Tom Tromey <tromey@cygnus.com> - - * configure: Regenerated. - * configure.in: Only statically link on Solaris if running GNU - ld. - -Thu Mar 13 10:40:55 1997 Tom Tromey <tromey@cygnus.com> - - * configure.in: Don't run AC_C_CROSS. - (AC_CONFIG_AUX_DIR): Look in srcdir. - -Sun Dec 8 23:07:48 1996 Martin Hunt <hunt@cygnus.com> - - * Makefile.in (${TK_SHARED_LIB_FILE}): Don't run RANLIB on - shared libs. - -Mon Aug 26 09:44:57 1996 Tom Tromey <tromey@creche.cygnus.com> - - * Makefile.in: Use TK_SHARED_LIB_FILE, TK_UNSHARED_LIB_FILE. - * configure: Regenerated. - * configure.in: Introduct TK_SHARED_LIB_FILE and - TK_UNSHARED_LIB_FILE. - - * configure: Regenerated. - * configure.in: AC_SUBST more variables so shared/unshared lib - targets can be separate. - - * Makefile.in (libtk${TCL_SHARED_LIB_SUFFIX}): New target. - (libtk${TCL_SHARED_LIB_SUFFIX}): New target. - -Fri Aug 23 13:40:25 1996 Tom Tromey <tromey@creche.cygnus.com> - - * configure: Regenerated. - * configure.in: Suppress --enable-shared when statically linking - libX11. - -Wed Aug 14 09:21:16 1996 Tom Tromey <tromey@creche.cygnus.com> - - * Makefile.in (install-man): Man page permissions are 644, not - 444. - -Mon Aug 5 10:47:45 1996 Tom Tromey <tromey@creche.cygnus.com> - - * Makefile.in (configure): Don't depend on configure.in. Work - when not in srcdir. - - * Makefile.in (config.status): New target. - (Makefile): Depend on config.status. - -Fri Aug 2 13:51:59 1996 Tom Tromey <tromey@creche.cygnus.com> - - * configure.in: Find Tcl source directory relative to $srcdir. - * configure: Regenerated. - -Wed Jun 26 12:51:49 1996 Jason Molenda (crash@godzilla.cygnus.co.jp) - - * Makefile.in (TK_LIBRARY, LIB_INSTALL_DIR, BIN_INSTALL_DIR, - BIN_DIR, INCLUDE_INSTALL_DIR, MAN_INSTALL_DIR): Use autoconf-set - values. - (install-libraries, install-demos): Use @datadir@ instead of - hard-coded dirname. - * configure.in (AC_PREREQ): autoconf 2.5 or higher. - * configure: Rebuilt. - -Mon Jun 10 16:22:12 1996 Tom Tromey <tromey@creche.cygnus.com> - - * Makefile.in (install-binaries): Don't add version info to - installed wish. - -Tue Jun 4 17:57:46 1996 Gordon Irlam <gordoni@snuffle.cygnus.com> - - * install-sh: Add MIT copyright. - -Thu May 9 10:01:48 1996 Tom Tromey <tromey@snuffle.cygnus.com> - - * Makefile.in (CFLAGS): Set to @CFLAGS@. - -Wed May 8 08:57:06 1996 Tom Tromey <tromey@snuffle.cygnus.com> - - * configure: Regenerated. - * configure.in: In Solaris case, must link against libX11 twice. - -Tue May 7 11:22:10 1996 Tom Tromey <tromey@snuffle.cygnus.com> - - * configure: Regenerated. - * configure.in: Run AC_PROG_CC. - - * mkLinks: Find man pages in section 3, not section n. - - * Makefile.in (install-man): Install man pages in section 3, not - section n. - - * mkLinks: Use cp, not ln. - -Tue Apr 23 13:13:59 1996 Tom Tromey <tromey@creche.cygnus.com> - - * Makefile.in (CC_SWITCHES): Define TK_LIB_TRAILER. - (TK_LIB_TRAILER): New macro. - - * tkUnixInit.c (TkPlatformInit): Handle location independence. - -Fri Mar 29 08:23:15 1996 Tom Tromey <tromey@creche.cygnus.com> - - * mkLinks: Exit with status 0. - -Fri Mar 1 11:49:57 1996 Tom Tromey <tromey@creche.cygnus.com> - - * configure: Regenerated. - * configure.in: Use AC_CANONICAL_SYSTEM. Look in Cygnus build - tree for config.sub and config.guess. - -Wed Jan 24 12:39:28 1996 Tom Tromey <tromey@creche.cygnus.com> - - * Makefile.in: Use maintainer-clean, not realclean. - -Thu Jan 11 09:13:11 1996 Tom Tromey <tromey@creche.cygnus.com> - - * configure.in: Look in ../../tcl, not ../../tcl7.5a. - -Wed Jan 10 12:09:58 1996 Tom Tromey <tromey@creche.cygnus.com> - - * configure.in: Use AC_CHECK_HEADERS, not AC_HAVE_HEADERS. - - * Makefile.in (TCL_DIR): Look in tcl, not tcl7.5a2. - (TCL_BIN_DIR): Ditto. - (TCLDIR): Ditto. - diff --git a/tk/unix/porting.old b/tk/unix/porting.old deleted file mode 100644 index ea8aa5c2cc0..00000000000 --- a/tk/unix/porting.old +++ /dev/null @@ -1,324 +0,0 @@ -This is an old version of the file "porting.notes". It contains -porting information that people submitted for Tk releases numbered -3.6 and earlier. You may find information in this file useful if -there is no information available for your machine in the current -version of "porting.notes". - -I don't have personal access to any of these machines, so I make -no guarantees that the notes are correct, complete, or up-to-date. -If you see the word "I" in any explanations, it refers to the person -who contributed the information, not to me; this means that I -probably can't answer any questions about any of this stuff. In -some cases, a person has volunteered to act as a contact point for -questions about porting Tcl to a particular machine; in these -cases the person's name and e-mail address are listed. I'd be -happy to receive corrections or updates. - -sccsid = SCCS: @(#) porting.old 1.2 96/02/16 10:27:30 - ---------------------------------------------- -DEC Alphas: ---------------------------------------------- - -1. There appears to be a compiler/library bug that prevents tkTrig.c -from compiling unless you turn off optimization (remove the -O compiler -switch). The problem appears to have been fixed in the 1.3-4 version -of the compiler. - ---------------------------------------------- -HP-UX systems: ---------------------------------------------- - -1. Configuration: - HP-UX Release 7.05 on a series 300 (68k) machine. - The native cc has been used for production. - X11r4 libraries and include files were taken from - internet archives, where as the server came with HPUX release 7.05. - - Problems: - Symbol table space for cc had to be increased with: -Wc,-Ns3000 - tkBind.c did not compile under -O: - C1 internal error in "GetField": Set Error Detected - *** Error code 1 - tkBind.c did compile without optimization (no -O). - -2. Note: if you have trouble getting xauth-style access control to work -(and you'll need xauth if you want to use "send"), be sure to uncomment -the line - -# Vuelogin*authorize: True - -in the file /usr/vue/config/Xconfig, so that the server starts up with -authorization enabled. Also, you may have to reboot the machine in -order to force the server to restart. - ---------------------------------------------- -SCO Unix: ---------------------------------------------- - -Getting Tk to run under SCO Unix: - -Add a "#undef select" to tkEvent.c, and remove the reference to TK_EXCEPTION -around line 460 of main.c. - -Tk uses its own scheme for allocating the border colors for its 3D widgets, -which causes problems when running TK on a system with "PseudoColor" -display class, and a 16-cell colormap. - -If you can't go to eight bitplanes, you can instead start the server with a -"-static" (Xsco) or "-analog" (Xsight) option, making the display class -become "StaticColor". This makes the entire colormap read-only, and it will -return the color that most closely maps to the desired color as possible. - ---------------------------------------------- -Silicon Graphics systems: ---------------------------------------------- - -1. Change the CC variable in the Makefile to: - -CC = cc -xansi -D__STDC__ -signed - -2. Change the LIBS variable in the Makefile to use the X11 shared library - ("-lX11_s" instead of "-lX11"). - -3. Under some versions of IRIX (e.g. 4.0.1) you have to turn off - optimization (e.g. change "-O" in CFLAGS to "-O0" or remove it - entirely) because of faulty code generation. If the Tcl or Tk test - suites fail, turn off optimization. - -4. Add a "-lsun" switch just before "-lm" in the LIBS definition. - Under some versions of IRIX (5.1.1.3?) you'll need to omit the - "-lsun" switch, plus remove the "-lsocket" and "-lnsl" switches - added by the configure script; otherwise you won't be able to - use symbolic host names for the display, only numerical Internet - addresses. - -5. Rumor has it that you'll also need a "-lmalloc" switch in the - LIBS definition. - -6. In IRIX 5.2 you'll have to modify Makefile to fix the following problems: - - The "-c" option is illegal with this version of install, but - the "-F" switch is needed instead. Change this in the "INSTALL =" - definition line. - - The order of file and directory have to be changed in all the - invocations of INSTALL_DATA or INSTALL_PROGRAM. - ---------------------------------------------- -IBM RS/6000's: ---------------------------------------------- -1. To allow ALT- sequences to work on the RS-6000, the following -line should be changed in tkBind.c: - - OLD LINE: - {"Alt", Mod2Mask, 0}, - NEW LINE: - {"Alt", Mod1Mask, 0}, - ---------------------------------------------- -AT&T SVR4: ---------------------------------------------- - -1. The first major hurdle is that SVR4's select() subtly differs -from BSD select. This impacts Tk in two ways, some of the Xlib calls -make use of select() and are inherently broken and Tk itself makes -extensive use of select(). The first problem can't be fixed without -rebuilding one's Xlib, but can be avoided. I intend to submit part -of my work the XFree86 guys so that the next version of XFree86 for -SVR4 will not be broken. Until then, it is necessary to comment out -this section of code from Tk_DoOneEvent() (which is near line 1227): - -#if !defined(SVR4) - void (*oldHandler)(); - - oldHandler = (void (*)()) signal(SIGPIPE, SIG_IGN); - XNoOp(display); - XFlush(display); - (void) signal(SIGPIPE, oldHandler); -#endif /* SVR4 */ - -if you don't comment it out, some scripts cause wish to go into -an infinite loop of sending no-ops to the X server. - -2. As for fixing Tk's calls to select(), I've taken the simple -approach of writing a wrapper for select and then using #define to -replace all calls to select with the wrapper. I chose tkConfig.h -to load the wrapper. So at the very end of tkConfig.h, it now looks -like: - -#if defined(SVR4) -# include "BSDselect.h" -#endif - -#endif /* _TKCONFIG */ - -The file BSDselect.h looks like this: - -#include <sys/types.h> -#include <sys/time.h> -#include <sys/select.h> - -/* This is a fix for the difference between BSD's select() and - * SVR4's select(). SVR4's select() can never return a value larger - * than the total number of file descriptors being checked. So, if - * you select for read and write on one file descriptor, and both - * are true, SVR4 select() will only return 1. BSD select in the - * same situation will return 2. - * - * Additionally, BSD select() on timing out, will zero the masks, - * while SVR4 does not. This is fixed here as well. - * - * Set your tabstops to 4 characters to have this code nicely formatted. - * - * Jerry Whelan, guru@bradley.edu, June 12th, 1993 - */ - - -int -BSDselect(nfds, readfds, writefds, exceptfds, timeout) -int nfds; -fd_set *readfds, *writefds, *exceptfds; -struct timeval *timeout; -{ - int rval, - i; - - rval = select(nfds, readfds, writefds, exceptfds, timeout); - - switch(rval) { - case -1: return(rval); - break; - - case 0: if(readfds != NULL) - FD_ZERO(readfds); - if(writefds != NULL) - FD_ZERO(writefds); - if(exceptfds != NULL) - FD_ZERO(exceptfds); - - return(rval); - break; - - default: for(i=0, rval=0; i < nfds; i++) { - if((readfds != NULL) && FD_ISSET -(i, readfds)) rval++; - if((writefds != NULL) && FD_ISSE -T(i, writefds)) rval++; - if((writefds != NULL) && FD_ISSE -T(i, exceptfds)) rval++; - } - return(rval); - } -/* Should never get here */ -} - ---------------------------------------------- -CDC 4680MP, EP/IX 1.4.3: ---------------------------------------------- - -The installation was done in the System V environment (-systype sysv) -with the BSD extensions available (-I/usr/include/bsd and -lbsd). It was -built with the 2.20 level C compiler. The 2.11 level can be used, but -it is better to match what TCL is built with, which must be 2.20 or -higher (see the porting notes with TCL for the details). - -To make the configure script find the BSD extensions, I set environment -variable DEFS to "-I/usr/include/bsd" and LIBS to "-lbsd" before -running it. I would have also set CC to "cc2.20", but that compiler -driver has a bug that loader errors (e.g. not finding a library routine, -which the script uses to tell what is available) do not cause an error -status to be returned to the shell (but see the Tcl 2.1.1 porting notes -for comments about using "-non_shared"). - -After running configure, I changed the CC definition line in Makefile -from: - CC=cc -to - CC=cc2.20 -to match the TCL build. Skip this if the default compiler is already 2.20 -(or later). - ---------------------------------------------- -CDC 4680MP, EP/IX 2.1.1: ---------------------------------------------- - -The installation was done in the System V environment (-systype sysv) -with the BSD extensions available (-I/usr/include/bsd and -lbsd). It was -built with the 3.11 level C compiler. Earlier levels can be used, but it -is better to match what TCL is built with, which must be 2.20 or higher -(see the porting notes with TCL for the details). - -To make the configure script find the BSD extensions, I set environment -variable DEFS to "-I/usr/include/bsd -non_shared" and LIBS to "-lbsd" -before running it. - -See the Tcl porting notes for comments on why "-non_shared" is needed -during the configuration step. It was removed from AC_FLAGS before -building. - -------------------------------------------------- -Pyramid, OSx 5.1a (UCB universe, GCC installed): -------------------------------------------------- - -Instead of typing "./configure" to configure, type - - DEFS="-I/usr/include/X11/attinc" ./configure - -to sh to do the configuration. - -------------------------------------------------- -NextSTEP 3.1: -------------------------------------------------- - -1. Run configure with predefined CPP: - CPP='cc -E' ./configure - (If your shell is [t]csh, do a "setenv CPP 'cc -E'") - -2. Edit Makefile: - -add the following to AC_FLAGS: - -Dstrtod=tcl_strtod - -Note: Tk's raise test may fail when running the tvtwm window manager. -Changing to either twm or even better fvwm ensures that this test will -succeed. - -------------------------------------------------- -Encore 91, UMAX V 3.0.9.3: -------------------------------------------------- - -1. Modify the CFLAGS definition in Makefile to include -DENCORE: - - CFLAGS = -O -DENCORE - -2. "mkdir" does not by default create the parent directories. The mkdir -directives should be modified to "midir -p". - -3. An error of a redeclaration of read, can be resolved by conditionally -not compiling if an ENCORE system. - -#ifndef ENCORE -extern int read _ANSI_ARGS_((int fd, char *buf, size_t size)); -#endif - -------------------------------------------------- -Sequent machines running Dynix: -Contact: Andrew Swan (aswan@soda.berkeley.edu) -------------------------------------------------- - -1. Use gcc instead of the cc distributed by Sequent - -2. There are problems with the distributed version of - <stddef.h>. The easiest solution is probably to create a - copy of stddef.h, make sure it comes early in the include - path and then edit it as need be to eliminate conflicts - with the X11 header files. - -3. The same comments about the tanh function from the notes on - porting Tcl apply to Tk. - -------------------------------------------------- -Systems running Interactive 4.0: -------------------------------------------------- - -1. Add "-posix" to CFLAGS in Makefile (or Makefile.in). - -2. Add "-lnsl_s" to LIBS in Makefile (or Makefile.in). diff --git a/tk/win/tk.def b/tk/win/tk.def deleted file mode 100644 index 49839af3248..00000000000 --- a/tk/win/tk.def +++ /dev/null @@ -1,1056 +0,0 @@ -LIBRARY tk42 -EXPORTS -_XDrawLine -XDrawLine -_XFillRectangle -XFillRectangle -_XCreateGC -XCreateGC -_XChangeGC -XChangeGC -_XFreeGC -XFreeGC -_XSetArcMode -XSetArcMode -_XSetBackground -XSetBackground -_XSetClipMask -XSetClipMask -_XSetClipOrigin -XSetClipOrigin -_XSetFillRule -XSetFillRule -_XSetFillStyle -XSetFillStyle -_XSetFont -XSetFont -_XSetForeground -XSetForeground -_XSetFunction -XSetFunction -_XSetLineAttributes -XSetLineAttributes -_XSetStipple -XSetStipple -_XSetTSOrigin -XSetTSOrigin -_TkSetRegion -TkSetRegion -_XCreateBitmapFromData -XCreateBitmapFromData -_XReadBitmapFile -XReadBitmapFile -_XInternAtom -XInternAtom -_XGetVisualInfo -XGetVisualInfo -_XSetSelectionOwner -XSetSelectionOwner -_TkSelEventProc -TkSelEventProc -_TkSelPropProc -TkSelPropProc -_TkWinClipboardRender -TkWinClipboardRender -_TkSelGetSelection -TkSelGetSelection -_TkSelUpdateClipboard -TkSelUpdateClipboard -_XCreateColormap -XCreateColormap -_XAllocColor -XAllocColor -_XAllocNamedColor -XAllocNamedColor -_XFreeColormap -XFreeColormap -_XFreeColors -XFreeColors -_XParseColor -XParseColor -_TkWinSelectPalette -TkWinSelectPalette -_TkCreateCursorFromData -TkCreateCursorFromData -_TkFreeCursor -TkFreeCursor -_TkGetCursorByName -TkGetCursorByName -_TkWinUpdateCursor -TkWinUpdateCursor -_Tk_ChooseColorCmd -Tk_ChooseColorCmd -_Tk_GetOpenFileCmd -Tk_GetOpenFileCmd -_Tk_GetSaveFileCmd -Tk_GetSaveFileCmd -_Tk_MessageBoxCmd -Tk_MessageBoxCmd -_XCopyArea -XCopyArea -_XCopyPlane -XCopyPlane -_XDrawArc -XDrawArc -_XDrawLines -XDrawLines -_XDrawRectangle -XDrawRectangle -_XDrawString -XDrawString -_XFillArc -XFillArc -_XFillPolygon -XFillPolygon -_XFillRectangles -XFillRectangles -_TkPutImage -TkPutImage -_TkScrollWindow -TkScrollWindow -_TkWinGetDrawableDC -TkWinGetDrawableDC -_TkWinReleaseDrawableDC -TkWinReleaseDrawableDC -_XLoadQueryFont -XLoadQueryFont -_XQueryFont -XQueryFont -_XLoadFont -XLoadFont -_XFreeFont -XFreeFont -_XGetFontProperty -XGetFontProperty -_XTextExtents -XTextExtents -_XTextWidth -XTextWidth -_XCreateImage -XCreateImage -_TkPlatformInit -TkPlatformInit -_XGetModifierMapping -XGetModifierMapping -_XKeysymToString -XKeysymToString -_XKeycodeToKeysym -XKeycodeToKeysym -_XStringToKeysym -XStringToKeysym -_XFreeModifiermap -XFreeModifiermap -_XKeysymToKeycode -XKeysymToKeycode -_XLookupString -XLookupString -_Tk_FreePixmap -Tk_FreePixmap -_Tk_GetPixmap -Tk_GetPixmap -_TkSetPixmapColormap -TkSetPixmapColormap -_XDefineCursor -XDefineCursor -_XGetInputFocus -XGetInputFocus -_XGrabKeyboard -XGrabKeyboard -_XGrabPointer -XGrabPointer -_XQueryPointer -XQueryPointer -_XSetInputFocus -XSetInputFocus -_XUngrabKeyboard -XUngrabKeyboard -_XUngrabPointer -XUngrabPointer -_TkGetPointerCoords -TkGetPointerCoords -_TkWinPointerDeadWindow -TkWinPointerDeadWindow -_TkWinPointerEvent -TkWinPointerEvent -_TkWinPointerInit -TkWinPointerInit -_TkClipBox -TkClipBox -_TkCreateRegion -TkCreateRegion -_TkDestroyRegion -TkDestroyRegion -_TkIntersectRegion -TkIntersectRegion -_TkRectInRegion -TkRectInRegion -_TkUnionRectWithRegion -TkUnionRectWithRegion -_XChangeWindowAttributes -XChangeWindowAttributes -_XClearWindow -XClearWindow -_XConfigureWindow -XConfigureWindow -_XDestroyWindow -XDestroyWindow -_XMapWindow -XMapWindow -_XMoveResizeWindow -XMoveResizeWindow -_XMoveWindow -XMoveWindow -_XRaiseWindow -XRaiseWindow -_XResizeWindow -XResizeWindow -_XUnmapWindow -XUnmapWindow -_TkMakeWindow -TkMakeWindow -_Tk_CoordsToWindow -Tk_CoordsToWindow -_Tk_GetRootCoords -Tk_GetRootCoords -_Tk_GetVRootGeometry -Tk_GetVRootGeometry -_Tk_MoveToplevelWindow -Tk_MoveToplevelWindow -_Tk_SetGrid -Tk_SetGrid -_Tk_UnsetGrid -Tk_UnsetGrid -_Tk_WmCmd -Tk_WmCmd -_TkWmAddToColormapWindows -TkWmAddToColormapWindows -_TkWmDeadWindow -TkWmDeadWindow -_TkWmMapWindow -TkWmMapWindow -_TkWmNewWindow -TkWmNewWindow -_TkWmProtocolEventProc -TkWmProtocolEventProc -_TkWmRemoveFromColormapWindows -TkWmRemoveFromColormapWindows -_TkWmRestackToplevel -TkWmRestackToplevel -_TkWmSetClass -TkWmSetClass -_TkWmUnmapWindow -TkWmUnmapWindow -_TkWinGetSystemPalette -TkWinGetSystemPalette -_TkWinWmConfigure -TkWinWmConfigure -_TkWinWmInstallColormaps -TkWinWmInstallColormaps -_TkWinWmSetLimits -TkWinWmSetLimits -_XOpenDisplay -XOpenDisplay -_XBell -XBell -_Tk_FreeXId -Tk_FreeXId -_TkGetDefaultScreenName -TkGetDefaultScreenName -_TkGetServerInfo -TkGetServerInfo -TkWinChildProc -_TkWinEnterModalLoop -TkWinEnterModalLoop -_TkWinGetAppInstance -TkWinGetAppInstance -_TkWinGetDrawableFromHandle -TkWinGetDrawableFromHandle -_TkWinGetModifierState -TkWinGetModifierState -_TkWinGetTkModule -TkWinGetTkModule -_TkWinLeaveModalLoop -TkWinLeaveModalLoop -TkWinTopLevelProc -_TkWinXInit -TkWinXInit -_XGetImage -XGetImage -_XGetAtomName -XGetAtomName -_XCreatePixmapCursor -XCreatePixmapCursor -_XCreateGlyphCursor -XCreateGlyphCursor -_XGContextFromGC -XGContextFromGC -_XListHosts -XListHosts -_XRootWindow -XRootWindow -_XSetErrorHandler -XSetErrorHandler -_XIconifyWindow -XIconifyWindow -_XWithdrawWindow -XWithdrawWindow -_XGetWMColormapWindows -XGetWMColormapWindows -_XSetWMColormapWindows -XSetWMColormapWindows -_XSetTransientForHint -XSetTransientForHint -_XChangeProperty -XChangeProperty -_XDeleteProperty -XDeleteProperty -_XForceScreenSaver -XForceScreenSaver -_XFreeCursor -XFreeCursor -_XGetGeometry -XGetGeometry -_XGetWindowProperty -XGetWindowProperty -_XGetWindowAttributes -XGetWindowAttributes -_XLookupColor -XLookupColor -_XNextEvent -XNextEvent -_XPutBackEvent -XPutBackEvent -_XQueryColors -XQueryColors -_XQueryTree -XQueryTree -_XRefreshKeyboardMapping -XRefreshKeyboardMapping -_XSelectInput -XSelectInput -_XSendEvent -XSendEvent -_XSetCommand -XSetCommand -_XSetIconName -XSetIconName -_XSetWindowBackground -XSetWindowBackground -_XSetWindowBackgroundPixmap -XSetWindowBackgroundPixmap -_XSetWindowBorder -XSetWindowBorder -_XSetWindowBorderPixmap -XSetWindowBorderPixmap -_XSetWindowBorderWidth -XSetWindowBorderWidth -_XSetWindowColormap -XSetWindowColormap -_XTranslateCoordinates -XTranslateCoordinates -_XWindowEvent -XWindowEvent -_XCreateIC -XCreateIC -_XDestroyIC -XDestroyIC -_XFilterEvent -XFilterEvent -_XmbLookupString -XmbLookupString -_XSetWMClientMachine -XSetWMClientMachine -_XStringListToTextProperty -XStringListToTextProperty -__XInitImageFuncPtrs -_XInitImageFuncPtrs -_Tk_3DBorderColor -Tk_3DBorderColor -_Tk_3DBorderGC -Tk_3DBorderGC -_Tk_3DHorizontalBevel -Tk_3DHorizontalBevel -_Tk_3DVerticalBevel -Tk_3DVerticalBevel -_Tk_Draw3DPolygon -Tk_Draw3DPolygon -_Tk_Draw3DRectangle -Tk_Draw3DRectangle -_Tk_Fill3DPolygon -Tk_Fill3DPolygon -_Tk_Fill3DRectangle -Tk_Fill3DRectangle -_Tk_Free3DBorder -Tk_Free3DBorder -_Tk_Get3DBorder -Tk_Get3DBorder -_Tk_GetRelief -Tk_GetRelief -_Tk_NameOf3DBorder -Tk_NameOf3DBorder -_Tk_NameOfRelief -Tk_NameOfRelief -_Tk_SetBackgroundFromBorder -Tk_SetBackgroundFromBorder -_Tk_ParseArgv -Tk_ParseArgv -_Tk_GetAtomName -Tk_GetAtomName -_Tk_InternAtom -Tk_InternAtom -_Tk_BindEvent -Tk_BindEvent -_Tk_CreateBinding -Tk_CreateBinding -_Tk_CreateBindingTable -Tk_CreateBindingTable -_Tk_DeleteAllBindings -Tk_DeleteAllBindings -_Tk_DeleteBinding -Tk_DeleteBinding -_Tk_DeleteBindingTable -Tk_DeleteBindingTable -_Tk_GetAllBindings -Tk_GetAllBindings -_Tk_GetBinding -Tk_GetBinding -_Tk_EventCmd -Tk_EventCmd -_TkBindFree -TkBindFree -_TkBindInit -TkBindInit -_TkCopyAndGlobalEval -TkCopyAndGlobalEval -_TkKeysymToString -TkKeysymToString -_TkStringToKeysym -TkStringToKeysym -_Tk_DefineBitmap -Tk_DefineBitmap -_Tk_FreeBitmap -Tk_FreeBitmap -_Tk_GetBitmap -Tk_GetBitmap -_Tk_GetBitmapFromData -Tk_GetBitmapFromData -_Tk_NameOfBitmap -Tk_NameOfBitmap -_Tk_SizeOfBitmap -Tk_SizeOfBitmap -_Tk_ButtonCmd -Tk_ButtonCmd -_Tk_CheckbuttonCmd -Tk_CheckbuttonCmd -_Tk_LabelCmd -Tk_LabelCmd -_Tk_RadiobuttonCmd -Tk_RadiobuttonCmd -_tkArcType -tkArcType -_tkBitmapType -tkBitmapType -_tkImageType -tkImageType -_tkLineType -tkLineType -_TkFillPolygon -TkFillPolygon -_tkPolygonType -tkPolygonType -_Tk_CanvasPsBitmap -Tk_CanvasPsBitmap -_Tk_CanvasPsColor -Tk_CanvasPsColor -_Tk_CanvasPsFont -Tk_CanvasPsFont -_Tk_CanvasPsPath -Tk_CanvasPsPath -_Tk_CanvasPsStipple -Tk_CanvasPsStipple -_Tk_CanvasPsY -Tk_CanvasPsY -_TkGetProlog -TkGetProlog -_TkCanvPostscriptCmd -TkCanvPostscriptCmd -_tkTextType -tkTextType -_Tk_CanvasDrawableCoords -Tk_CanvasDrawableCoords -_Tk_CanvasGetCoord -Tk_CanvasGetCoord -_Tk_CanvasGetTextInfo -Tk_CanvasGetTextInfo -_Tk_CanvasSetStippleOrigin -Tk_CanvasSetStippleOrigin -_Tk_CanvasTagsParseProc -Tk_CanvasTagsParseProc -_Tk_CanvasTagsPrintProc -Tk_CanvasTagsPrintProc -_Tk_CanvasTkwin -Tk_CanvasTkwin -_Tk_CanvasWindowCoords -Tk_CanvasWindowCoords -_tkWindowType -tkWindowType -_Tk_CanvasEventuallyRedraw -Tk_CanvasEventuallyRedraw -_Tk_CreateItemType -Tk_CreateItemType -_Tk_GetItemTypes -Tk_GetItemTypes -_Tk_CanvasCmd -Tk_CanvasCmd -_Tk_ClipboardAppend -Tk_ClipboardAppend -_Tk_ClipboardClear -Tk_ClipboardClear -_Tk_ClipboardCmd -Tk_ClipboardCmd -_TkClipInit -TkClipInit -_Tk_BellCmd -Tk_BellCmd -_Tk_BindCmd -Tk_BindCmd -_Tk_BindtagsCmd -Tk_BindtagsCmd -_Tk_DestroyCmd -Tk_DestroyCmd -_Tk_LowerCmd -Tk_LowerCmd -_Tk_RaiseCmd -Tk_RaiseCmd -_Tk_TkCmd -Tk_TkCmd -_Tk_TkwaitCmd -Tk_TkwaitCmd -_Tk_UpdateCmd -Tk_UpdateCmd -_Tk_WinfoCmd -Tk_WinfoCmd -_TkBindEventProc -TkBindEventProc -_TkDeadAppCmd -TkDeadAppCmd -_TkFreeBindingTags -TkFreeBindingTags -_Tk_FreeColor -Tk_FreeColor -_Tk_GCForColor -Tk_GCForColor -_Tk_GetColor -Tk_GetColor -_Tk_GetColorByValue -Tk_GetColorByValue -_Tk_NameOfColor -Tk_NameOfColor -_TkCmapStressed -TkCmapStressed -_Tk_ConfigureInfo -Tk_ConfigureInfo -_Tk_ConfigureValue -Tk_ConfigureValue -_Tk_ConfigureWidget -Tk_ConfigureWidget -_Tk_FreeOptions -Tk_FreeOptions -_Tk_FreeCursor -Tk_FreeCursor -_Tk_GetCursor -Tk_GetCursor -_Tk_GetCursorFromData -Tk_GetCursorFromData -_Tk_NameOfCursor -Tk_NameOfCursor -_Tk_EntryCmd -Tk_EntryCmd -_Tk_CreateErrorHandler -Tk_CreateErrorHandler -_Tk_DeleteErrorHandler -Tk_DeleteErrorHandler -_Tk_CreateEventHandler -Tk_CreateEventHandler -_Tk_CreateGenericHandler -Tk_CreateGenericHandler -_Tk_DeleteEventHandler -Tk_DeleteEventHandler -_Tk_DeleteGenericHandler -Tk_DeleteGenericHandler -_Tk_HandleEvent -Tk_HandleEvent -_Tk_MainLoop -Tk_MainLoop -_Tk_QueueWindowEvent -Tk_QueueWindowEvent -_Tk_RestrictEvents -Tk_RestrictEvents -_TkCurrentTime -TkCurrentTime -_TkEventDeadWindow -TkEventDeadWindow -_TkQueueEventForAllChildren -TkQueueEventForAllChildren -_TkFreeFileFilters -TkFreeFileFilters -_TkInitFileFilters -TkInitFileFilters -_TkGetFileFilters -TkGetFileFilters -_Tk_FocusCmd -Tk_FocusCmd -_TkFocusDeadWindow -TkFocusDeadWindow -_TkFocusFilterEvent -TkFocusFilterEvent -_TkGetFocus -TkGetFocus -_Tk_FreeFontStruct -Tk_FreeFontStruct -_Tk_GetFontStruct -Tk_GetFontStruct -_Tk_NameOfFontStruct -Tk_NameOfFontStruct -_TkComputeTextGeometry -TkComputeTextGeometry -_TkDisplayChars -TkDisplayChars -_TkDisplayText -TkDisplayText -_TkMeasureChars -TkMeasureChars -_TkUnderlineChars -TkUnderlineChars -_Tk_FrameCmd -Tk_FrameCmd -_Tk_ToplevelCmd -Tk_ToplevelCmd -_TkCreateFrame -TkCreateFrame -_Tk_FreeGC -Tk_FreeGC -_Tk_GetGC -Tk_GetGC -_Tk_GeometryRequest -Tk_GeometryRequest -_Tk_MaintainGeometry -Tk_MaintainGeometry -_Tk_ManageGeometry -Tk_ManageGeometry -_Tk_SetInternalBorder -Tk_SetInternalBorder -_Tk_UnmaintainGeometry -Tk_UnmaintainGeometry -_Tk_GetAnchor -Tk_GetAnchor -_Tk_GetCapStyle -Tk_GetCapStyle -_Tk_GetJoinStyle -Tk_GetJoinStyle -_Tk_GetJustify -Tk_GetJustify -_Tk_GetPixels -Tk_GetPixels -_Tk_GetScreenMM -Tk_GetScreenMM -_Tk_GetUid -Tk_GetUid -_Tk_NameOfAnchor -Tk_NameOfAnchor -_Tk_NameOfCapStyle -Tk_NameOfCapStyle -_Tk_NameOfJoinStyle -Tk_NameOfJoinStyle -_Tk_NameOfJustify -Tk_NameOfJustify -_Tk_Grab -Tk_Grab -_Tk_Ungrab -Tk_Ungrab -_Tk_GrabCmd -Tk_GrabCmd -_TkChangeEventWindow -TkChangeEventWindow -_TkGrabDeadWindow -TkGrabDeadWindow -_TkGrabState -TkGrabState -_TkInOutEvents -TkInOutEvents -_TkPointerEvent -TkPointerEvent -_TkPositionInTree -TkPositionInTree -_Tk_GridCmd -Tk_GridCmd -_Tk_CreateImageType -Tk_CreateImageType -_Tk_DeleteImage -Tk_DeleteImage -_Tk_FreeImage -Tk_FreeImage -_Tk_GetImage -Tk_GetImage -_Tk_ImageChanged -Tk_ImageChanged -_Tk_NameOfImage -Tk_NameOfImage -_Tk_RedrawImage -Tk_RedrawImage -_Tk_SizeOfImage -Tk_SizeOfImage -_Tk_ImageCmd -Tk_ImageCmd -_TkDeleteAllImages -TkDeleteAllImages -_tkBitmapImageType -tkBitmapImageType -_TkGetBitmapData -TkGetBitmapData -_tkImgFmtGIF -tkImgFmtGIF -_tkImgFmtPPM -tkImgFmtPPM -_Tk_CreatePhotoImageFormat -Tk_CreatePhotoImageFormat -_Tk_FindPhoto -Tk_FindPhoto -_Tk_PhotoPutBlock -Tk_PhotoPutBlock -_Tk_PhotoPutZoomedBlock -Tk_PhotoPutZoomedBlock -_Tk_PhotoGetImage -Tk_PhotoGetImage -_Tk_PhotoBlank -Tk_PhotoBlank -_Tk_PhotoExpand -Tk_PhotoExpand -_Tk_PhotoGetSize -Tk_PhotoGetSize -_Tk_PhotoSetSize -Tk_PhotoSetSize -_tkPhotoImageType -tkPhotoImageType -_TkAlignImageData -TkAlignImageData -_Tk_ListboxCmd -Tk_ListboxCmd -_Tk_Main -Tk_Main -_Tk_MenuCmd -Tk_MenuCmd -_Tk_MenubuttonCmd -Tk_MenubuttonCmd -_Tk_MessageCmd -Tk_MessageCmd -_Tk_AddOption -Tk_AddOption -_Tk_GetOption -Tk_GetOption -_Tk_OptionCmd -Tk_OptionCmd -_TkOptionClassChanged -TkOptionClassChanged -_TkOptionDeadWindow -TkOptionDeadWindow -_Tk_PackCmd -Tk_PackCmd -_Tk_PlaceCmd -Tk_PlaceCmd -_tkRectangleType -tkRectangleType -_tkOvalType -tkOvalType -_Tk_ScaleCmd -Tk_ScaleCmd -_Tk_ScrollbarCmd -Tk_ScrollbarCmd -_Tk_ClearSelection -Tk_ClearSelection -_Tk_CreateSelHandler -Tk_CreateSelHandler -_Tk_DeleteSelHandler -Tk_DeleteSelHandler -_Tk_GetSelection -Tk_GetSelection -_Tk_OwnSelection -Tk_OwnSelection -_Tk_SelectionCmd -Tk_SelectionCmd -_TkSelDeadWindow -TkSelDeadWindow -_TkSelInit -TkSelInit -_pendingPtr -pendingPtr -_TkSelClearSelection -TkSelClearSelection -_TkSelDefaultSelection -TkSelDefaultSelection -_Tk_SetAppName -Tk_SetAppName -_Tk_SendCmd -Tk_SendCmd -_tkSendSerial -tkSendSerial -_TkGetInterpNames -TkGetInterpNames -_Tk_TextCmd -Tk_TextCmd -_tkTextDebug -tkTextDebug -_tkTextCharUid -tkTextCharUid -_tkTextDisabledUid -tkTextDisabledUid -_tkTextNoneUid -tkTextNoneUid -_tkTextNormalUid -tkTextNormalUid -_tkTextWordUid -tkTextWordUid -_TkTextGetTabs -TkTextGetTabs -_TkTextLostSelection -TkTextLostSelection -_tkBTreeDebug -tkBTreeDebug -_tkTextCharType -tkTextCharType -_tkTextToggleOnType -tkTextToggleOnType -_tkTextToggleOffType -tkTextToggleOffType -_TkBTreeCharTagged -TkBTreeCharTagged -_TkBTreeCheck -TkBTreeCheck -_TkBTreeCharsInLine -TkBTreeCharsInLine -_TkBTreeCreate -TkBTreeCreate -_TkBTreeDestroy -TkBTreeDestroy -_TkBTreeDeleteChars -TkBTreeDeleteChars -_TkBTreeFindLine -TkBTreeFindLine -_TkBTreeGetTags -TkBTreeGetTags -_TkBTreeInsertChars -TkBTreeInsertChars -_TkBTreeLineIndex -TkBTreeLineIndex -_TkBTreeLinkSegment -TkBTreeLinkSegment -_TkBTreeNextLine -TkBTreeNextLine -_TkBTreeNextTag -TkBTreeNextTag -_TkBTreeNumLines -TkBTreeNumLines -_TkBTreePreviousLine -TkBTreePreviousLine -_TkBTreePrevTag -TkBTreePrevTag -_TkBTreeStartSearch -TkBTreeStartSearch -_TkBTreeStartSearchBack -TkBTreeStartSearchBack -_TkBTreeTag -TkBTreeTag -_TkBTreeUnlinkSegment -TkBTreeUnlinkSegment -_TkTextChanged -TkTextChanged -_TkTextCharBbox -TkTextCharBbox -_TkTextCharLayoutProc -TkTextCharLayoutProc -_TkTextCreateDInfo -TkTextCreateDInfo -_TkTextDLineInfo -TkTextDLineInfo -_TkTextFreeDInfo -TkTextFreeDInfo -_TkTextEventuallyRepick -TkTextEventuallyRepick -_TkTextPixelIndex -TkTextPixelIndex -_TkTextRedrawRegion -TkTextRedrawRegion -_TkTextRedrawTag -TkTextRedrawTag -_TkTextRelayoutWindow -TkTextRelayoutWindow -_TkTextScanCmd -TkTextScanCmd -_TkTextSeeCmd -TkTextSeeCmd -_TkTextSetYView -TkTextSetYView -_TkTextXviewCmd -TkTextXviewCmd -_TkTextYviewCmd -TkTextYviewCmd -_TkTextGetIndex -TkTextGetIndex -_TkTextIndexBackChars -TkTextIndexBackChars -_TkTextIndexCmp -TkTextIndexCmp -_TkTextIndexForwChars -TkTextIndexForwChars -_TkTextIndexToSeg -TkTextIndexToSeg -_TkTextMakeIndex -TkTextMakeIndex -_TkTextPrintIndex -TkTextPrintIndex -_TkTextSegToOffset -TkTextSegToOffset -_tkTextLeftMarkType -tkTextLeftMarkType -_tkTextRightMarkType -tkTextRightMarkType -_TkTextInsertDisplayProc -TkTextInsertDisplayProc -_TkTextMarkCmd -TkTextMarkCmd -_TkTextMarkNameToIndex -TkTextMarkNameToIndex -_TkTextMarkSegToIndex -TkTextMarkSegToIndex -_TkTextSetMark -TkTextSetMark -_TkTextBindProc -TkTextBindProc -_TkTextCreateTag -TkTextCreateTag -_TkTextFreeTag -TkTextFreeTag -_TkTextPickCurrent -TkTextPickCurrent -_TkTextTagCmd -TkTextTagCmd -_TkTextWindowCmd -TkTextWindowCmd -_TkTextWindowIndex -TkTextWindowIndex -_TkBezierPoints -TkBezierPoints -_TkBezierScreenPoints -TkBezierScreenPoints -_TkGetButtPoints -TkGetButtPoints -_TkGetMiterPoints -TkGetMiterPoints -_TkIncludePoint -TkIncludePoint -_TkLineToArea -TkLineToArea -_TkLineToPoint -TkLineToPoint -_TkMakeBezierCurve -TkMakeBezierCurve -_TkMakeBezierPostscript -TkMakeBezierPostscript -_TkOvalToArea -TkOvalToArea -_TkOvalToPoint -TkOvalToPoint -_TkPolygonToArea -TkPolygonToArea -_TkPolygonToPoint -TkPolygonToPoint -_TkThickPolyLineToArea -TkThickPolyLineToArea -_Tk_DrawFocusHighlight -Tk_DrawFocusHighlight -_Tk_GetScrollInfo -Tk_GetScrollInfo -_TkFindStateNum -TkFindStateNum -_TkFindStateString -TkFindStateString -_Tk_FreeColormap -Tk_FreeColormap -_Tk_GetColormap -Tk_GetColormap -_Tk_GetVisual -Tk_GetVisual -_Tk_PreserveColormap -Tk_PreserveColormap -_Tk_ChangeWindowAttributes -Tk_ChangeWindowAttributes -_Tk_ConfigureWindow -Tk_ConfigureWindow -_Tk_CreateWindow -Tk_CreateWindow -_Tk_CreateWindowFromPath -Tk_CreateWindowFromPath -_Tk_DefineCursor -Tk_DefineCursor -_Tk_DestroyWindow -Tk_DestroyWindow -_Tk_DisplayName -Tk_DisplayName -_Tk_GetNumMainWindows -Tk_GetNumMainWindows -_Tk_IdToWindow -Tk_IdToWindow -_Tk_Init -Tk_Init -_Tk_MainWindow -Tk_MainWindow -_Tk_MakeWindowExist -Tk_MakeWindowExist -_Tk_MapWindow -Tk_MapWindow -_Tk_MoveResizeWindow -Tk_MoveResizeWindow -_Tk_MoveWindow -Tk_MoveWindow -_Tk_NameToWindow -Tk_NameToWindow -_Tk_ResizeWindow -Tk_ResizeWindow -_Tk_RestackWindow -Tk_RestackWindow -_Tk_SetClass -Tk_SetClass -_Tk_SetWindowBackground -Tk_SetWindowBackground -_Tk_SetWindowBackgroundPixmap -Tk_SetWindowBackgroundPixmap -_Tk_SetWindowBorder -Tk_SetWindowBorder -_Tk_SetWindowBorderWidth -Tk_SetWindowBorderWidth -_Tk_SetWindowBorderPixmap -Tk_SetWindowBorderPixmap -_Tk_SetWindowColormap -Tk_SetWindowColormap -_Tk_SetWindowVisual -Tk_SetWindowVisual -_Tk_StrictMotif -Tk_StrictMotif -_Tk_UndefineCursor -Tk_UndefineCursor -_Tk_UnmapWindow -Tk_UnmapWindow -_tkDisplayList -tkDisplayList -_tkActiveUid -tkActiveUid -_tkDisabledUid -tkDisabledUid -_tkMainWindowList -tkMainWindowList -_tkNormalUid -tkNormalUid -_TkCreateMainWindow -TkCreateMainWindow -_TkGetDisplay -TkGetDisplay diff --git a/tk/win/winDumpExts.c b/tk/win/winDumpExts.c deleted file mode 100644 index 8bc496e01e4..00000000000 --- a/tk/win/winDumpExts.c +++ /dev/null @@ -1,503 +0,0 @@ -/* - * winDumpExts.c -- - * Author: Gordon Chaffee, Scott Stanton - * - * History: The real functionality of this file was written by - * Matt Pietrek in 1993 in his pedump utility. I've - * modified it to dump the externals in a bunch of object - * files to create a .def file. - * - * 10/12/95 Modified by Scott Stanton to support Relocatable Object Module - * Format files for Borland C++ 4.5. - * - * Notes: Visual C++ puts an underscore before each exported symbol. - * This file removes them. I don't know if this is a problem - * this other compilers. If _MSC_VER is defined, - * the underscore is removed. If not, it isn't. To get a - * full dump of an object file, use the -f option. This can - * help determine the something that may be different with a - * compiler other than Visual C++. - *---------------------------------------------------------------------- - * - * SCCS: @(#) winDumpExts.c 1.11 96/09/18 15:25:11 - */ - -#include <windows.h> -#include <stdio.h> -#include <string.h> -#include <process.h> - -#ifdef _ALPHA_ -#define e_magic_number IMAGE_FILE_MACHINE_ALPHA -#else -#define e_magic_number IMAGE_FILE_MACHINE_I386 -#endif - -/* - *---------------------------------------------------------------------- - * GetArgcArgv -- - * - * Break up a line into argc argv - *---------------------------------------------------------------------- - */ -int -GetArgcArgv(char *s, char **argv) -{ - int quote = 0; - int argc = 0; - char *bp; - - bp = s; - while (1) { - while (isspace(*bp)) { - bp++; - } - if (*bp == '\n' || *bp == '\0') { - *bp = '\0'; - return argc; - } - if (*bp == '\"') { - quote = 1; - bp++; - } - argv[argc++] = bp; - - while (*bp != '\0') { - if (quote) { - if (*bp == '\"') { - quote = 0; - *bp = '\0'; - bp++; - break; - } - bp++; - continue; - } - if (isspace(*bp)) { - *bp = '\0'; - bp++; - break; - } - bp++; - } - } -} - -/* - * The names of the first group of possible symbol table storage classes - */ -char * SzStorageClass1[] = { - "NULL","AUTOMATIC","EXTERNAL","STATIC","REGISTER","EXTERNAL_DEF","LABEL", - "UNDEFINED_LABEL","MEMBER_OF_STRUCT","ARGUMENT","STRUCT_TAG", - "MEMBER_OF_UNION","UNION_TAG","TYPE_DEFINITION","UNDEFINED_STATIC", - "ENUM_TAG","MEMBER_OF_ENUM","REGISTER_PARAM","BIT_FIELD" -}; - -/* - * The names of the second group of possible symbol table storage classes - */ -char * SzStorageClass2[] = { - "BLOCK","FUNCTION","END_OF_STRUCT","FILE","SECTION","WEAK_EXTERNAL" -}; - -/* - *---------------------------------------------------------------------- - * GetSZStorageClass -- - * - * Given a symbol storage class value, return a descriptive - * ASCII string - *---------------------------------------------------------------------- - */ -PSTR -GetSZStorageClass(BYTE storageClass) -{ - if ( storageClass <= IMAGE_SYM_CLASS_BIT_FIELD ) - return SzStorageClass1[storageClass]; - else if ( (storageClass >= IMAGE_SYM_CLASS_BLOCK) - && (storageClass <= IMAGE_SYM_CLASS_WEAK_EXTERNAL) ) - return SzStorageClass2[storageClass-IMAGE_SYM_CLASS_BLOCK]; - else - return "???"; -} - -/* - *---------------------------------------------------------------------- - * GetSectionName -- - * - * Used by DumpSymbolTable, it gives meaningful names to - * the non-normal section number. - * - * Results: - * A name is returned in buffer - *---------------------------------------------------------------------- - */ -void -GetSectionName(WORD section, PSTR buffer, unsigned cbBuffer) -{ - char tempbuffer[10]; - - switch ( (SHORT)section ) - { - case IMAGE_SYM_UNDEFINED: strcpy(tempbuffer, "UNDEF"); break; - case IMAGE_SYM_ABSOLUTE: strcpy(tempbuffer, "ABS "); break; - case IMAGE_SYM_DEBUG: strcpy(tempbuffer, "DEBUG"); break; - default: wsprintf(tempbuffer, "%-5X", section); - } - - strncpy(buffer, tempbuffer, cbBuffer-1); -} - -/* - *---------------------------------------------------------------------- - * DumpSymbolTable -- - * - * Dumps a COFF symbol table from an EXE or OBJ. We only use - * it to dump tables from OBJs. - *---------------------------------------------------------------------- - */ -void -DumpSymbolTable(PIMAGE_SYMBOL pSymbolTable, FILE *fout, unsigned cSymbols) -{ - unsigned i; - PSTR stringTable; - char sectionName[10]; - - fprintf(fout, "Symbol Table - %X entries (* = auxillary symbol)\n", - cSymbols); - - fprintf(fout, - "Indx Name Value Section cAux Type Storage\n" - "---- -------------------- -------- ---------- ----- ------- --------\n"); - - /* - * The string table apparently starts right after the symbol table - */ - stringTable = (PSTR)&pSymbolTable[cSymbols]; - - for ( i=0; i < cSymbols; i++ ) { - fprintf(fout, "%04X ", i); - if ( pSymbolTable->N.Name.Short != 0 ) - fprintf(fout, "%-20.8s", pSymbolTable->N.ShortName); - else - fprintf(fout, "%-20s", stringTable + pSymbolTable->N.Name.Long); - - fprintf(fout, " %08X", pSymbolTable->Value); - - GetSectionName(pSymbolTable->SectionNumber, sectionName, - sizeof(sectionName)); - fprintf(fout, " sect:%s aux:%X type:%02X st:%s\n", - sectionName, - pSymbolTable->NumberOfAuxSymbols, - pSymbolTable->Type, - GetSZStorageClass(pSymbolTable->StorageClass) ); -#if 0 - if ( pSymbolTable->NumberOfAuxSymbols ) - DumpAuxSymbols(pSymbolTable); -#endif - - /* - * Take into account any aux symbols - */ - i += pSymbolTable->NumberOfAuxSymbols; - pSymbolTable += pSymbolTable->NumberOfAuxSymbols; - pSymbolTable++; - } -} - -/* - *---------------------------------------------------------------------- - * DumpExternals -- - * - * Dumps a COFF symbol table from an EXE or OBJ. We only use - * it to dump tables from OBJs. - *---------------------------------------------------------------------- - */ -void -DumpExternals(PIMAGE_SYMBOL pSymbolTable, FILE *fout, unsigned cSymbols) -{ - unsigned i; - PSTR stringTable; - char *s, *f; - char symbol[1024]; - - /* - * The string table apparently starts right after the symbol table - */ - stringTable = (PSTR)&pSymbolTable[cSymbols]; - - for ( i=0; i < cSymbols; i++ ) { - if (pSymbolTable->SectionNumber > 0 && pSymbolTable->Type == 0x20) { - if (pSymbolTable->StorageClass == IMAGE_SYM_CLASS_EXTERNAL) { - if (pSymbolTable->N.Name.Short != 0) { - strncpy(symbol, pSymbolTable->N.ShortName, 8); - symbol[8] = 0; - } else { - s = stringTable + pSymbolTable->N.Name.Long; - strcpy(symbol, s); - } - s = symbol; - f = strchr(s, '@'); - if (f) { - *f = 0; - } -#if defined(_MSC_VER) && defined(_X86_) - if (symbol[0] == '_') { - s = &symbol[1]; - } -#endif - if ((stricmp(s, "DllEntryPoint") != 0) - && (stricmp(s, "DllMain") != 0)) { - fprintf(fout, "\t%s\n", s); - } - } - } - - /* - * Take into account any aux symbols - */ - i += pSymbolTable->NumberOfAuxSymbols; - pSymbolTable += pSymbolTable->NumberOfAuxSymbols; - pSymbolTable++; - } -} - -/* - *---------------------------------------------------------------------- - * DumpObjFile -- - * - * Dump an object file--either a full listing or just the exported - * symbols. - *---------------------------------------------------------------------- - */ -void -DumpObjFile(PIMAGE_FILE_HEADER pImageFileHeader, FILE *fout, int full) -{ - PIMAGE_SYMBOL PCOFFSymbolTable; - DWORD COFFSymbolCount; - - PCOFFSymbolTable = (PIMAGE_SYMBOL) - ((DWORD)pImageFileHeader + pImageFileHeader->PointerToSymbolTable); - COFFSymbolCount = pImageFileHeader->NumberOfSymbols; - - if (full) { - DumpSymbolTable(PCOFFSymbolTable, fout, COFFSymbolCount); - } else { - DumpExternals(PCOFFSymbolTable, fout, COFFSymbolCount); - } -} - -/* - *---------------------------------------------------------------------- - * SkipToNextRecord -- - * - * Skip over the current ROMF record and return the type of the - * next record. - *---------------------------------------------------------------------- - */ - -BYTE -SkipToNextRecord(BYTE **ppBuffer) -{ - int length; - (*ppBuffer)++; /* Skip over the type.*/ - length = *((WORD*)(*ppBuffer))++; /* Retrieve the length. */ - *ppBuffer += length; /* Skip over the rest. */ - return **ppBuffer; /* Return the type. */ -} - -/* - *---------------------------------------------------------------------- - * DumpROMFObjFile -- - * - * Dump a Relocatable Object Module Format file, displaying only - * the exported symbols. - *---------------------------------------------------------------------- - */ -void -DumpROMFObjFile(LPVOID pBuffer, FILE *fout) -{ - BYTE type, length; - char symbol[1024], *s; - - while (1) { - type = SkipToNextRecord(&(BYTE*)pBuffer); - if (type == 0x90) { /* PUBDEF */ - if (((BYTE*)pBuffer)[4] != 0) { - length = ((BYTE*)pBuffer)[5]; - strncpy(symbol, ((char*)pBuffer) + 6, length); - symbol[length] = '\0'; - s = symbol; - if ((stricmp(s, "DllEntryPoint") != 0) - && (stricmp(s, "DllMain") != 0)) { - if (s[0] == '_') { - s++; - fprintf(fout, "\t_%s\n\t%s=_%s\n", s, s, s); - } else { - fprintf(fout, "\t%s\n", s); - } - } - } - } else if (type == 0x8B || type == 0x8A) { /* MODEND */ - break; - } - } -} - -/* - *---------------------------------------------------------------------- - * DumpFile -- - * - * Open up a file, memory map it, and call the appropriate - * dumping routine - *---------------------------------------------------------------------- - */ -void -DumpFile(LPSTR filename, FILE *fout, int full) -{ - HANDLE hFile; - HANDLE hFileMapping; - LPVOID lpFileBase; - PIMAGE_DOS_HEADER dosHeader; - - hFile = CreateFile(filename, GENERIC_READ, FILE_SHARE_READ, NULL, - OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); - - if (hFile == INVALID_HANDLE_VALUE) { - fprintf(stderr, "Couldn't open file with CreateFile()\n"); - return; - } - - hFileMapping = CreateFileMapping(hFile, NULL, PAGE_READONLY, 0, 0, NULL); - if (hFileMapping == 0) { - CloseHandle(hFile); - fprintf(stderr, "Couldn't open file mapping with CreateFileMapping()\n"); - return; - } - - lpFileBase = MapViewOfFile(hFileMapping, FILE_MAP_READ, 0, 0, 0); - if (lpFileBase == 0) { - CloseHandle(hFileMapping); - CloseHandle(hFile); - fprintf(stderr, "Couldn't map view of file with MapViewOfFile()\n"); - return; - } - - dosHeader = (PIMAGE_DOS_HEADER)lpFileBase; - if (dosHeader->e_magic == IMAGE_DOS_SIGNATURE) { -#if 0 - DumpExeFile( dosHeader ); -#else - fprintf(stderr, "File is an executable. I don't dump those.\n"); - return; -#endif - } - /* Does it look like a i386 COFF OBJ file??? */ - else if ((dosHeader->e_magic == e_magic_number) - && (dosHeader->e_sp == 0)) { - /* - * The two tests above aren't what they look like. They're - * really checking for IMAGE_FILE_HEADER.Machine == i386 (0x14C) - * and IMAGE_FILE_HEADER.SizeOfOptionalHeader == 0; - */ - DumpObjFile((PIMAGE_FILE_HEADER) lpFileBase, fout, full); - } else if (*((BYTE *)lpFileBase) == 0x80) { - /* - * This file looks like it might be a ROMF file. - */ - DumpROMFObjFile(lpFileBase, fout); - } else { - printf("unrecognized file format\n"); - } - UnmapViewOfFile(lpFileBase); - CloseHandle(hFileMapping); - CloseHandle(hFile); -} - -void -main(int argc, char **argv) -{ - char *fargv[1000]; - char cmdline[10000]; - int i, arg; - FILE *fout; - int pos; - int full = 0; - char *outfile = NULL; - - if (argc < 3) { - Usage: - fprintf(stderr, "Usage: %s ?-o outfile? ?-f(ull)? <dllname> <object filenames> ..\n", argv[0]); - exit(1); - } - - arg = 1; - while (argv[arg][0] == '-') { - if (strcmp(argv[arg], "--") == 0) { - arg++; - break; - } else if (strcmp(argv[arg], "-f") == 0) { - full = 1; - } else if (strcmp(argv[arg], "-o") == 0) { - arg++; - if (arg == argc) { - goto Usage; - } - outfile = argv[arg]; - } - arg++; - } - if (arg == argc) { - goto Usage; - } - - if (outfile) { - fout = fopen(outfile, "w+"); - if (fout == NULL) { - fprintf(stderr, "Unable to open \'%s\' for writing:\n", - argv[arg]); - perror(""); - exit(1); - } - } else { - fout = stdout; - } - - if (! full) { - char *dllname = argv[arg]; - arg++; - if (arg == argc) { - goto Usage; - } - fprintf(fout, "LIBRARY %s\n", dllname); - fprintf(fout, "EXETYPE WINDOWS\n"); - fprintf(fout, "CODE PRELOAD MOVEABLE DISCARDABLE\n"); - fprintf(fout, "DATA PRELOAD MOVEABLE MULTIPLE\n\n"); - fprintf(fout, "EXPORTS\n"); - } - - for (; arg < argc; arg++) { - if (argv[arg][0] == '@') { - FILE *fargs = fopen(&argv[arg][1], "r"); - if (fargs == NULL) { - fprintf(stderr, "Unable to open \'%s\' for reading:\n", - argv[arg]); - perror(""); - exit(1); - } - pos = 0; - for (i = 0; i < arg; i++) { - strcpy(&cmdline[pos], argv[i]); - pos += strlen(&cmdline[pos]) + 1; - fargv[i] = argv[i]; - } - fgets(&cmdline[pos], sizeof(cmdline), fargs); - fprintf(stderr, "%s\n", &cmdline[pos]); - fclose(fargs); - i += GetArgcArgv(&cmdline[pos], &fargv[i]); - argc = i; - argv = fargv; - } - DumpFile(argv[arg], fout, full); - } - exit(0); -} diff --git a/tk/xlib/xcolors.h b/tk/xlib/xcolors.h deleted file mode 100644 index ad62d18102f..00000000000 --- a/tk/xlib/xcolors.h +++ /dev/null @@ -1,771 +0,0 @@ -/* - * xcolors.h -- - * - * This file defines the xColors array which contains RGB values - * for the X color names. - * - * Copyright (c) 1995 Sun Microsystems, Inc. - * - * See the file "license.terms" for information on usage and redistribution - * of this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * SCCS: @(#) xcolors.h 1.1 95/02/08 11:29:12 - */ - -#ifndef _XCOLORS -#define _XCOLORS - -/* - * Define X color names structure. - */ - -typedef struct { - unsigned char red; - unsigned char green; - unsigned char blue; - char *name; -} XColorEntry; - -static XColorEntry xColors[] = { - 255, 250, 250, "snow", - 248, 248, 255, "ghost white", - 248, 248, 255, "GhostWhite", - 245, 245, 245, "white smoke", - 245, 245, 245, "WhiteSmoke", - 220, 220, 220, "gainsboro", - 255, 250, 240, "floral white", - 255, 250, 240, "FloralWhite", - 253, 245, 230, "old lace", - 253, 245, 230, "OldLace", - 250, 240, 230, "linen", - 250, 235, 215, "antique white", - 250, 235, 215, "AntiqueWhite", - 255, 239, 213, "papaya whip", - 255, 239, 213, "PapayaWhip", - 255, 235, 205, "blanched almond", - 255, 235, 205, "BlanchedAlmond", - 255, 228, 196, "bisque", - 255, 218, 185, "peach puff", - 255, 218, 185, "PeachPuff", - 255, 222, 173, "navajo white", - 255, 222, 173, "NavajoWhite", - 255, 228, 181, "moccasin", - 255, 248, 220, "cornsilk", - 255, 255, 240, "ivory", - 255, 250, 205, "lemon chiffon", - 255, 250, 205, "LemonChiffon", - 255, 245, 238, "seashell", - 240, 255, 240, "honeydew", - 245, 255, 250, "mint cream", - 245, 255, 250, "MintCream", - 240, 255, 255, "azure", - 240, 248, 255, "alice blue", - 240, 248, 255, "AliceBlue", - 230, 230, 250, "lavender", - 255, 240, 245, "lavender blush", - 255, 240, 245, "LavenderBlush", - 255, 228, 225, "misty rose", - 255, 228, 225, "MistyRose", - 255, 255, 255, "white", - 0, 0, 0, "black", - 47, 79, 79, "dark slate gray", - 47, 79, 79, "DarkSlateGray", - 47, 79, 79, "dark slate grey", - 47, 79, 79, "DarkSlateGrey", - 105, 105, 105, "dim gray", - 105, 105, 105, "DimGray", - 105, 105, 105, "dim grey", - 105, 105, 105, "DimGrey", - 112, 128, 144, "slate gray", - 112, 128, 144, "SlateGray", - 112, 128, 144, "slate grey", - 112, 128, 144, "SlateGrey", - 119, 136, 153, "light slate gray", - 119, 136, 153, "LightSlateGray", - 119, 136, 153, "light slate grey", - 119, 136, 153, "LightSlateGrey", - 190, 190, 190, "gray", - 190, 190, 190, "grey", - 211, 211, 211, "light grey", - 211, 211, 211, "LightGrey", - 211, 211, 211, "light gray", - 211, 211, 211, "LightGray", - 25, 25, 112, "midnight blue", - 25, 25, 112, "MidnightBlue", - 0, 0, 128, "navy", - 0, 0, 128, "navy blue", - 0, 0, 128, "NavyBlue", - 100, 149, 237, "cornflower blue", - 100, 149, 237, "CornflowerBlue", - 72, 61, 139, "dark slate blue", - 72, 61, 139, "DarkSlateBlue", - 106, 90, 205, "slate blue", - 106, 90, 205, "SlateBlue", - 123, 104, 238, "medium slate blue", - 123, 104, 238, "MediumSlateBlue", - 132, 112, 255, "light slate blue", - 132, 112, 255, "LightSlateBlue", - 0, 0, 205, "medium blue", - 0, 0, 205, "MediumBlue", - 65, 105, 225, "royal blue", - 65, 105, 225, "RoyalBlue", - 0, 0, 255, "blue", - 30, 144, 255, "dodger blue", - 30, 144, 255, "DodgerBlue", - 0, 191, 255, "deep sky blue", - 0, 191, 255, "DeepSkyBlue", - 135, 206, 235, "sky blue", - 135, 206, 235, "SkyBlue", - 135, 206, 250, "light sky blue", - 135, 206, 250, "LightSkyBlue", - 70, 130, 180, "steel blue", - 70, 130, 180, "SteelBlue", - 176, 196, 222, "light steel blue", - 176, 196, 222, "LightSteelBlue", - 173, 216, 230, "light blue", - 173, 216, 230, "LightBlue", - 176, 224, 230, "powder blue", - 176, 224, 230, "PowderBlue", - 175, 238, 238, "pale turquoise", - 175, 238, 238, "PaleTurquoise", - 0, 206, 209, "dark turquoise", - 0, 206, 209, "DarkTurquoise", - 72, 209, 204, "medium turquoise", - 72, 209, 204, "MediumTurquoise", - 64, 224, 208, "turquoise", - 0, 255, 255, "cyan", - 224, 255, 255, "light cyan", - 224, 255, 255, "LightCyan", - 95, 158, 160, "cadet blue", - 95, 158, 160, "CadetBlue", - 102, 205, 170, "medium aquamarine", - 102, 205, 170, "MediumAquamarine", - 127, 255, 212, "aquamarine", - 0, 100, 0, "dark green", - 0, 100, 0, "DarkGreen", - 85, 107, 47, "dark olive green", - 85, 107, 47, "DarkOliveGreen", - 143, 188, 143, "dark sea green", - 143, 188, 143, "DarkSeaGreen", - 46, 139, 87, "sea green", - 46, 139, 87, "SeaGreen", - 60, 179, 113, "medium sea green", - 60, 179, 113, "MediumSeaGreen", - 32, 178, 170, "light sea green", - 32, 178, 170, "LightSeaGreen", - 152, 251, 152, "pale green", - 152, 251, 152, "PaleGreen", - 0, 255, 127, "spring green", - 0, 255, 127, "SpringGreen", - 124, 252, 0, "lawn green", - 124, 252, 0, "LawnGreen", - 0, 255, 0, "green", - 127, 255, 0, "chartreuse", - 0, 250, 154, "medium spring green", - 0, 250, 154, "MediumSpringGreen", - 173, 255, 47, "green yellow", - 173, 255, 47, "GreenYellow", - 50, 205, 50, "lime green", - 50, 205, 50, "LimeGreen", - 154, 205, 50, "yellow green", - 154, 205, 50, "YellowGreen", - 34, 139, 34, "forest green", - 34, 139, 34, "ForestGreen", - 107, 142, 35, "olive drab", - 107, 142, 35, "OliveDrab", - 189, 183, 107, "dark khaki", - 189, 183, 107, "DarkKhaki", - 240, 230, 140, "khaki", - 238, 232, 170, "pale goldenrod", - 238, 232, 170, "PaleGoldenrod", - 250, 250, 210, "light goldenrod yellow", - 250, 250, 210, "LightGoldenrodYellow", - 255, 255, 224, "light yellow", - 255, 255, 224, "LightYellow", - 255, 255, 0, "yellow", - 255, 215, 0, "gold", - 238, 221, 130, "light goldenrod", - 238, 221, 130, "LightGoldenrod", - 218, 165, 32, "goldenrod", - 184, 134, 11, "dark goldenrod", - 184, 134, 11, "DarkGoldenrod", - 188, 143, 143, "rosy brown", - 188, 143, 143, "RosyBrown", - 205, 92, 92, "indian red", - 205, 92, 92, "IndianRed", - 139, 69, 19, "saddle brown", - 139, 69, 19, "SaddleBrown", - 160, 82, 45, "sienna", - 205, 133, 63, "peru", - 222, 184, 135, "burlywood", - 245, 245, 220, "beige", - 245, 222, 179, "wheat", - 244, 164, 96, "sandy brown", - 244, 164, 96, "SandyBrown", - 210, 180, 140, "tan", - 210, 105, 30, "chocolate", - 178, 34, 34, "firebrick", - 165, 42, 42, "brown", - 233, 150, 122, "dark salmon", - 233, 150, 122, "DarkSalmon", - 250, 128, 114, "salmon", - 255, 160, 122, "light salmon", - 255, 160, 122, "LightSalmon", - 255, 165, 0, "orange", - 255, 140, 0, "dark orange", - 255, 140, 0, "DarkOrange", - 255, 127, 80, "coral", - 240, 128, 128, "light coral", - 240, 128, 128, "LightCoral", - 255, 99, 71, "tomato", - 255, 69, 0, "orange red", - 255, 69, 0, "OrangeRed", - 255, 0, 0, "red", - 255, 105, 180, "hot pink", - 255, 105, 180, "HotPink", - 255, 20, 147, "deep pink", - 255, 20, 147, "DeepPink", - 255, 192, 203, "pink", - 255, 182, 193, "light pink", - 255, 182, 193, "LightPink", - 219, 112, 147, "pale violet red", - 219, 112, 147, "PaleVioletRed", - 176, 48, 96, "maroon", - 199, 21, 133, "medium violet red", - 199, 21, 133, "MediumVioletRed", - 208, 32, 144, "violet red", - 208, 32, 144, "VioletRed", - 255, 0, 255, "magenta", - 238, 130, 238, "violet", - 221, 160, 221, "plum", - 218, 112, 214, "orchid", - 186, 85, 211, "medium orchid", - 186, 85, 211, "MediumOrchid", - 153, 50, 204, "dark orchid", - 153, 50, 204, "DarkOrchid", - 148, 0, 211, "dark violet", - 148, 0, 211, "DarkViolet", - 138, 43, 226, "blue violet", - 138, 43, 226, "BlueViolet", - 160, 32, 240, "purple", - 147, 112, 219, "medium purple", - 147, 112, 219, "MediumPurple", - 216, 191, 216, "thistle", - 255, 250, 250, "snow1", - 238, 233, 233, "snow2", - 205, 201, 201, "snow3", - 139, 137, 137, "snow4", - 255, 245, 238, "seashell1", - 238, 229, 222, "seashell2", - 205, 197, 191, "seashell3", - 139, 134, 130, "seashell4", - 255, 239, 219, "AntiqueWhite1", - 238, 223, 204, "AntiqueWhite2", - 205, 192, 176, "AntiqueWhite3", - 139, 131, 120, "AntiqueWhite4", - 255, 228, 196, "bisque1", - 238, 213, 183, "bisque2", - 205, 183, 158, "bisque3", - 139, 125, 107, "bisque4", - 255, 218, 185, "PeachPuff1", - 238, 203, 173, "PeachPuff2", - 205, 175, 149, "PeachPuff3", - 139, 119, 101, "PeachPuff4", - 255, 222, 173, "NavajoWhite1", - 238, 207, 161, "NavajoWhite2", - 205, 179, 139, "NavajoWhite3", - 139, 121, 94, "NavajoWhite4", - 255, 250, 205, "LemonChiffon1", - 238, 233, 191, "LemonChiffon2", - 205, 201, 165, "LemonChiffon3", - 139, 137, 112, "LemonChiffon4", - 255, 248, 220, "cornsilk1", - 238, 232, 205, "cornsilk2", - 205, 200, 177, "cornsilk3", - 139, 136, 120, "cornsilk4", - 255, 255, 240, "ivory1", - 238, 238, 224, "ivory2", - 205, 205, 193, "ivory3", - 139, 139, 131, "ivory4", - 240, 255, 240, "honeydew1", - 224, 238, 224, "honeydew2", - 193, 205, 193, "honeydew3", - 131, 139, 131, "honeydew4", - 255, 240, 245, "LavenderBlush1", - 238, 224, 229, "LavenderBlush2", - 205, 193, 197, "LavenderBlush3", - 139, 131, 134, "LavenderBlush4", - 255, 228, 225, "MistyRose1", - 238, 213, 210, "MistyRose2", - 205, 183, 181, "MistyRose3", - 139, 125, 123, "MistyRose4", - 240, 255, 255, "azure1", - 224, 238, 238, "azure2", - 193, 205, 205, "azure3", - 131, 139, 139, "azure4", - 131, 111, 255, "SlateBlue1", - 122, 103, 238, "SlateBlue2", - 105, 89, 205, "SlateBlue3", - 71, 60, 139, "SlateBlue4", - 72, 118, 255, "RoyalBlue1", - 67, 110, 238, "RoyalBlue2", - 58, 95, 205, "RoyalBlue3", - 39, 64, 139, "RoyalBlue4", - 0, 0, 255, "blue1", - 0, 0, 238, "blue2", - 0, 0, 205, "blue3", - 0, 0, 139, "blue4", - 30, 144, 255, "DodgerBlue1", - 28, 134, 238, "DodgerBlue2", - 24, 116, 205, "DodgerBlue3", - 16, 78, 139, "DodgerBlue4", - 99, 184, 255, "SteelBlue1", - 92, 172, 238, "SteelBlue2", - 79, 148, 205, "SteelBlue3", - 54, 100, 139, "SteelBlue4", - 0, 191, 255, "DeepSkyBlue1", - 0, 178, 238, "DeepSkyBlue2", - 0, 154, 205, "DeepSkyBlue3", - 0, 104, 139, "DeepSkyBlue4", - 135, 206, 255, "SkyBlue1", - 126, 192, 238, "SkyBlue2", - 108, 166, 205, "SkyBlue3", - 74, 112, 139, "SkyBlue4", - 176, 226, 255, "LightSkyBlue1", - 164, 211, 238, "LightSkyBlue2", - 141, 182, 205, "LightSkyBlue3", - 96, 123, 139, "LightSkyBlue4", - 198, 226, 255, "SlateGray1", - 185, 211, 238, "SlateGray2", - 159, 182, 205, "SlateGray3", - 108, 123, 139, "SlateGray4", - 202, 225, 255, "LightSteelBlue1", - 188, 210, 238, "LightSteelBlue2", - 162, 181, 205, "LightSteelBlue3", - 110, 123, 139, "LightSteelBlue4", - 191, 239, 255, "LightBlue1", - 178, 223, 238, "LightBlue2", - 154, 192, 205, "LightBlue3", - 104, 131, 139, "LightBlue4", - 224, 255, 255, "LightCyan1", - 209, 238, 238, "LightCyan2", - 180, 205, 205, "LightCyan3", - 122, 139, 139, "LightCyan4", - 187, 255, 255, "PaleTurquoise1", - 174, 238, 238, "PaleTurquoise2", - 150, 205, 205, "PaleTurquoise3", - 102, 139, 139, "PaleTurquoise4", - 152, 245, 255, "CadetBlue1", - 142, 229, 238, "CadetBlue2", - 122, 197, 205, "CadetBlue3", - 83, 134, 139, "CadetBlue4", - 0, 245, 255, "turquoise1", - 0, 229, 238, "turquoise2", - 0, 197, 205, "turquoise3", - 0, 134, 139, "turquoise4", - 0, 255, 255, "cyan1", - 0, 238, 238, "cyan2", - 0, 205, 205, "cyan3", - 0, 139, 139, "cyan4", - 151, 255, 255, "DarkSlateGray1", - 141, 238, 238, "DarkSlateGray2", - 121, 205, 205, "DarkSlateGray3", - 82, 139, 139, "DarkSlateGray4", - 127, 255, 212, "aquamarine1", - 118, 238, 198, "aquamarine2", - 102, 205, 170, "aquamarine3", - 69, 139, 116, "aquamarine4", - 193, 255, 193, "DarkSeaGreen1", - 180, 238, 180, "DarkSeaGreen2", - 155, 205, 155, "DarkSeaGreen3", - 105, 139, 105, "DarkSeaGreen4", - 84, 255, 159, "SeaGreen1", - 78, 238, 148, "SeaGreen2", - 67, 205, 128, "SeaGreen3", - 46, 139, 87, "SeaGreen4", - 154, 255, 154, "PaleGreen1", - 144, 238, 144, "PaleGreen2", - 124, 205, 124, "PaleGreen3", - 84, 139, 84, "PaleGreen4", - 0, 255, 127, "SpringGreen1", - 0, 238, 118, "SpringGreen2", - 0, 205, 102, "SpringGreen3", - 0, 139, 69, "SpringGreen4", - 0, 255, 0, "green1", - 0, 238, 0, "green2", - 0, 205, 0, "green3", - 0, 139, 0, "green4", - 127, 255, 0, "chartreuse1", - 118, 238, 0, "chartreuse2", - 102, 205, 0, "chartreuse3", - 69, 139, 0, "chartreuse4", - 192, 255, 62, "OliveDrab1", - 179, 238, 58, "OliveDrab2", - 154, 205, 50, "OliveDrab3", - 105, 139, 34, "OliveDrab4", - 202, 255, 112, "DarkOliveGreen1", - 188, 238, 104, "DarkOliveGreen2", - 162, 205, 90, "DarkOliveGreen3", - 110, 139, 61, "DarkOliveGreen4", - 255, 246, 143, "khaki1", - 238, 230, 133, "khaki2", - 205, 198, 115, "khaki3", - 139, 134, 78, "khaki4", - 255, 236, 139, "LightGoldenrod1", - 238, 220, 130, "LightGoldenrod2", - 205, 190, 112, "LightGoldenrod3", - 139, 129, 76, "LightGoldenrod4", - 255, 255, 224, "LightYellow1", - 238, 238, 209, "LightYellow2", - 205, 205, 180, "LightYellow3", - 139, 139, 122, "LightYellow4", - 255, 255, 0, "yellow1", - 238, 238, 0, "yellow2", - 205, 205, 0, "yellow3", - 139, 139, 0, "yellow4", - 255, 215, 0, "gold1", - 238, 201, 0, "gold2", - 205, 173, 0, "gold3", - 139, 117, 0, "gold4", - 255, 193, 37, "goldenrod1", - 238, 180, 34, "goldenrod2", - 205, 155, 29, "goldenrod3", - 139, 105, 20, "goldenrod4", - 255, 185, 15, "DarkGoldenrod1", - 238, 173, 14, "DarkGoldenrod2", - 205, 149, 12, "DarkGoldenrod3", - 139, 101, 8, "DarkGoldenrod4", - 255, 193, 193, "RosyBrown1", - 238, 180, 180, "RosyBrown2", - 205, 155, 155, "RosyBrown3", - 139, 105, 105, "RosyBrown4", - 255, 106, 106, "IndianRed1", - 238, 99, 99, "IndianRed2", - 205, 85, 85, "IndianRed3", - 139, 58, 58, "IndianRed4", - 255, 130, 71, "sienna1", - 238, 121, 66, "sienna2", - 205, 104, 57, "sienna3", - 139, 71, 38, "sienna4", - 255, 211, 155, "burlywood1", - 238, 197, 145, "burlywood2", - 205, 170, 125, "burlywood3", - 139, 115, 85, "burlywood4", - 255, 231, 186, "wheat1", - 238, 216, 174, "wheat2", - 205, 186, 150, "wheat3", - 139, 126, 102, "wheat4", - 255, 165, 79, "tan1", - 238, 154, 73, "tan2", - 205, 133, 63, "tan3", - 139, 90, 43, "tan4", - 255, 127, 36, "chocolate1", - 238, 118, 33, "chocolate2", - 205, 102, 29, "chocolate3", - 139, 69, 19, "chocolate4", - 255, 48, 48, "firebrick1", - 238, 44, 44, "firebrick2", - 205, 38, 38, "firebrick3", - 139, 26, 26, "firebrick4", - 255, 64, 64, "brown1", - 238, 59, 59, "brown2", - 205, 51, 51, "brown3", - 139, 35, 35, "brown4", - 255, 140, 105, "salmon1", - 238, 130, 98, "salmon2", - 205, 112, 84, "salmon3", - 139, 76, 57, "salmon4", - 255, 160, 122, "LightSalmon1", - 238, 149, 114, "LightSalmon2", - 205, 129, 98, "LightSalmon3", - 139, 87, 66, "LightSalmon4", - 255, 165, 0, "orange1", - 238, 154, 0, "orange2", - 205, 133, 0, "orange3", - 139, 90, 0, "orange4", - 255, 127, 0, "DarkOrange1", - 238, 118, 0, "DarkOrange2", - 205, 102, 0, "DarkOrange3", - 139, 69, 0, "DarkOrange4", - 255, 114, 86, "coral1", - 238, 106, 80, "coral2", - 205, 91, 69, "coral3", - 139, 62, 47, "coral4", - 255, 99, 71, "tomato1", - 238, 92, 66, "tomato2", - 205, 79, 57, "tomato3", - 139, 54, 38, "tomato4", - 255, 69, 0, "OrangeRed1", - 238, 64, 0, "OrangeRed2", - 205, 55, 0, "OrangeRed3", - 139, 37, 0, "OrangeRed4", - 255, 0, 0, "red1", - 238, 0, 0, "red2", - 205, 0, 0, "red3", - 139, 0, 0, "red4", - 255, 20, 147, "DeepPink1", - 238, 18, 137, "DeepPink2", - 205, 16, 118, "DeepPink3", - 139, 10, 80, "DeepPink4", - 255, 110, 180, "HotPink1", - 238, 106, 167, "HotPink2", - 205, 96, 144, "HotPink3", - 139, 58, 98, "HotPink4", - 255, 181, 197, "pink1", - 238, 169, 184, "pink2", - 205, 145, 158, "pink3", - 139, 99, 108, "pink4", - 255, 174, 185, "LightPink1", - 238, 162, 173, "LightPink2", - 205, 140, 149, "LightPink3", - 139, 95, 101, "LightPink4", - 255, 130, 171, "PaleVioletRed1", - 238, 121, 159, "PaleVioletRed2", - 205, 104, 137, "PaleVioletRed3", - 139, 71, 93, "PaleVioletRed4", - 255, 52, 179, "maroon1", - 238, 48, 167, "maroon2", - 205, 41, 144, "maroon3", - 139, 28, 98, "maroon4", - 255, 62, 150, "VioletRed1", - 238, 58, 140, "VioletRed2", - 205, 50, 120, "VioletRed3", - 139, 34, 82, "VioletRed4", - 255, 0, 255, "magenta1", - 238, 0, 238, "magenta2", - 205, 0, 205, "magenta3", - 139, 0, 139, "magenta4", - 255, 131, 250, "orchid1", - 238, 122, 233, "orchid2", - 205, 105, 201, "orchid3", - 139, 71, 137, "orchid4", - 255, 187, 255, "plum1", - 238, 174, 238, "plum2", - 205, 150, 205, "plum3", - 139, 102, 139, "plum4", - 224, 102, 255, "MediumOrchid1", - 209, 95, 238, "MediumOrchid2", - 180, 82, 205, "MediumOrchid3", - 122, 55, 139, "MediumOrchid4", - 191, 62, 255, "DarkOrchid1", - 178, 58, 238, "DarkOrchid2", - 154, 50, 205, "DarkOrchid3", - 104, 34, 139, "DarkOrchid4", - 155, 48, 255, "purple1", - 145, 44, 238, "purple2", - 125, 38, 205, "purple3", - 85, 26, 139, "purple4", - 171, 130, 255, "MediumPurple1", - 159, 121, 238, "MediumPurple2", - 137, 104, 205, "MediumPurple3", - 93, 71, 139, "MediumPurple4", - 255, 225, 255, "thistle1", - 238, 210, 238, "thistle2", - 205, 181, 205, "thistle3", - 139, 123, 139, "thistle4", - 0, 0, 0, "gray0", - 0, 0, 0, "grey0", - 3, 3, 3, "gray1", - 3, 3, 3, "grey1", - 5, 5, 5, "gray2", - 5, 5, 5, "grey2", - 8, 8, 8, "gray3", - 8, 8, 8, "grey3", - 10, 10, 10, "gray4", - 10, 10, 10, "grey4", - 13, 13, 13, "gray5", - 13, 13, 13, "grey5", - 15, 15, 15, "gray6", - 15, 15, 15, "grey6", - 18, 18, 18, "gray7", - 18, 18, 18, "grey7", - 20, 20, 20, "gray8", - 20, 20, 20, "grey8", - 23, 23, 23, "gray9", - 23, 23, 23, "grey9", - 26, 26, 26, "gray10", - 26, 26, 26, "grey10", - 28, 28, 28, "gray11", - 28, 28, 28, "grey11", - 31, 31, 31, "gray12", - 31, 31, 31, "grey12", - 33, 33, 33, "gray13", - 33, 33, 33, "grey13", - 36, 36, 36, "gray14", - 36, 36, 36, "grey14", - 38, 38, 38, "gray15", - 38, 38, 38, "grey15", - 41, 41, 41, "gray16", - 41, 41, 41, "grey16", - 43, 43, 43, "gray17", - 43, 43, 43, "grey17", - 46, 46, 46, "gray18", - 46, 46, 46, "grey18", - 48, 48, 48, "gray19", - 48, 48, 48, "grey19", - 51, 51, 51, "gray20", - 51, 51, 51, "grey20", - 54, 54, 54, "gray21", - 54, 54, 54, "grey21", - 56, 56, 56, "gray22", - 56, 56, 56, "grey22", - 59, 59, 59, "gray23", - 59, 59, 59, "grey23", - 61, 61, 61, "gray24", - 61, 61, 61, "grey24", - 64, 64, 64, "gray25", - 64, 64, 64, "grey25", - 66, 66, 66, "gray26", - 66, 66, 66, "grey26", - 69, 69, 69, "gray27", - 69, 69, 69, "grey27", - 71, 71, 71, "gray28", - 71, 71, 71, "grey28", - 74, 74, 74, "gray29", - 74, 74, 74, "grey29", - 77, 77, 77, "gray30", - 77, 77, 77, "grey30", - 79, 79, 79, "gray31", - 79, 79, 79, "grey31", - 82, 82, 82, "gray32", - 82, 82, 82, "grey32", - 84, 84, 84, "gray33", - 84, 84, 84, "grey33", - 87, 87, 87, "gray34", - 87, 87, 87, "grey34", - 89, 89, 89, "gray35", - 89, 89, 89, "grey35", - 92, 92, 92, "gray36", - 92, 92, 92, "grey36", - 94, 94, 94, "gray37", - 94, 94, 94, "grey37", - 97, 97, 97, "gray38", - 97, 97, 97, "grey38", - 99, 99, 99, "gray39", - 99, 99, 99, "grey39", - 102, 102, 102, "gray40", - 102, 102, 102, "grey40", - 105, 105, 105, "gray41", - 105, 105, 105, "grey41", - 107, 107, 107, "gray42", - 107, 107, 107, "grey42", - 110, 110, 110, "gray43", - 110, 110, 110, "grey43", - 112, 112, 112, "gray44", - 112, 112, 112, "grey44", - 115, 115, 115, "gray45", - 115, 115, 115, "grey45", - 117, 117, 117, "gray46", - 117, 117, 117, "grey46", - 120, 120, 120, "gray47", - 120, 120, 120, "grey47", - 122, 122, 122, "gray48", - 122, 122, 122, "grey48", - 125, 125, 125, "gray49", - 125, 125, 125, "grey49", - 127, 127, 127, "gray50", - 127, 127, 127, "grey50", - 130, 130, 130, "gray51", - 130, 130, 130, "grey51", - 133, 133, 133, "gray52", - 133, 133, 133, "grey52", - 135, 135, 135, "gray53", - 135, 135, 135, "grey53", - 138, 138, 138, "gray54", - 138, 138, 138, "grey54", - 140, 140, 140, "gray55", - 140, 140, 140, "grey55", - 143, 143, 143, "gray56", - 143, 143, 143, "grey56", - 145, 145, 145, "gray57", - 145, 145, 145, "grey57", - 148, 148, 148, "gray58", - 148, 148, 148, "grey58", - 150, 150, 150, "gray59", - 150, 150, 150, "grey59", - 153, 153, 153, "gray60", - 153, 153, 153, "grey60", - 156, 156, 156, "gray61", - 156, 156, 156, "grey61", - 158, 158, 158, "gray62", - 158, 158, 158, "grey62", - 161, 161, 161, "gray63", - 161, 161, 161, "grey63", - 163, 163, 163, "gray64", - 163, 163, 163, "grey64", - 166, 166, 166, "gray65", - 166, 166, 166, "grey65", - 168, 168, 168, "gray66", - 168, 168, 168, "grey66", - 171, 171, 171, "gray67", - 171, 171, 171, "grey67", - 173, 173, 173, "gray68", - 173, 173, 173, "grey68", - 176, 176, 176, "gray69", - 176, 176, 176, "grey69", - 179, 179, 179, "gray70", - 179, 179, 179, "grey70", - 181, 181, 181, "gray71", - 181, 181, 181, "grey71", - 184, 184, 184, "gray72", - 184, 184, 184, "grey72", - 186, 186, 186, "gray73", - 186, 186, 186, "grey73", - 189, 189, 189, "gray74", - 189, 189, 189, "grey74", - 191, 191, 191, "gray75", - 191, 191, 191, "grey75", - 194, 194, 194, "gray76", - 194, 194, 194, "grey76", - 196, 196, 196, "gray77", - 196, 196, 196, "grey77", - 199, 199, 199, "gray78", - 199, 199, 199, "grey78", - 201, 201, 201, "gray79", - 201, 201, 201, "grey79", - 204, 204, 204, "gray80", - 204, 204, 204, "grey80", - 207, 207, 207, "gray81", - 207, 207, 207, "grey81", - 209, 209, 209, "gray82", - 209, 209, 209, "grey82", - 212, 212, 212, "gray83", - 212, 212, 212, "grey83", - 214, 214, 214, "gray84", - 214, 214, 214, "grey84", - 217, 217, 217, "gray85", - 217, 217, 217, "grey85", - 219, 219, 219, "gray86", - 219, 219, 219, "grey86", - 222, 222, 222, "gray87", - 222, 222, 222, "grey87", - 224, 224, 224, "gray88", - 224, 224, 224, "grey88", - 227, 227, 227, "gray89", - 227, 227, 227, "grey89", - 229, 229, 229, "gray90", - 229, 229, 229, "grey90", - 232, 232, 232, "gray91", - 232, 232, 232, "grey91", - 235, 235, 235, "gray92", - 235, 235, 235, "grey92", - 237, 237, 237, "gray93", - 237, 237, 237, "grey93", - 240, 240, 240, "gray94", - 240, 240, 240, "grey94", - 242, 242, 242, "gray95", - 242, 242, 242, "grey95", - 245, 245, 245, "gray96", - 245, 245, 245, "grey96", - 247, 247, 247, "gray97", - 247, 247, 247, "grey97", - 250, 250, 250, "gray98", - 250, 250, 250, "grey98", - 252, 252, 252, "gray99", - 252, 252, 252, "grey99", - 255, 255, 255, "gray100", - 255, 255, 255, "grey100", - 0, 0, 0, NULL -}; - -#endif /* _XCOLORS */ |